Built motion from commit 351e7f9c.|2.6.31
[motion2.git] / server / services / ami / trigger / index.js
index 6c59f6c..4f2fb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc69d=['checkTriggers','interface','status','checkTrigger','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','data2','html','render','uri','buildUri','isNil','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winApplication','winArguments','data3','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','contactmanager','exec','integration','queue','routeId','script','parse','query','search','replace','channel','AllConditions','every','AnyConditions','some','checkConditions','evt','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','interaction','event','operator','agent','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','lodash','url','mustache','./urlforward','./cmContact','./script','../../../config/environment','trigger','../ami','redis','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentcongestion','custom:agentreject','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','undefined','debug','inspect'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc69d,0x143));var _0xdc69=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xc69d[_0x58965a];return _0x254efc;};'use strict';var util=require('util');var _=require(_0xdc69('0x0'));var url=require(_0xdc69('0x1'));var Mustache=require(_0xdc69('0x2'));var Redis=require('ioredis');var urlforward=require(_0xdc69('0x3'));var integration=require('./integration');var cmContact=require(_0xdc69('0x4'));var script=require(_0xdc69('0x5'));var config=require(_0xdc69('0x6'));var logger=require('../../../config/logger')(_0xdc69('0x7'));var ami=require(_0xdc69('0x8'));config[_0xdc69('0x9')]=_['defaults'](config[_0xdc69('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xdc69('0xa'))(new Redis(config[_0xdc69('0x9')]));var operators={'equals':function(_0x3adc31,_0xd55d67){return _0x3adc31==_0xd55d67;},'not_equals':function(_0x48856c,_0x163d2e){return _0x48856c!=_0x163d2e;}};var barAndWebActions=[_0xdc69('0xb'),_0xdc69('0x1'),_0xdc69('0xc')];function Trigger(_0x2d118){this[_0xdc69('0xd')]=_0x2d118[_0xdc69('0xd')];this[_0xdc69('0xe')]=_0x2d118[_0xdc69('0xe')];this[_0xdc69('0xf')]=_0x2d118[_0xdc69('0xf')];this[_0xdc69('0x10')]=_0x2d118[_0xdc69('0x10')];this['voiceExtensions']=_0x2d118[_0xdc69('0x11')];this[_0xdc69('0x12')]=_0x2d118['zendeskAccounts'];this[_0xdc69('0x13')]=_0x2d118[_0xdc69('0x13')];this['salesforceAccounts']=_0x2d118[_0xdc69('0x14')];this[_0xdc69('0x15')]=_0x2d118[_0xdc69('0x15')];this[_0xdc69('0x16')]=_0x2d118[_0xdc69('0x16')];this[_0xdc69('0x17')]=_0x2d118[_0xdc69('0x17')];this['vtigerAccounts']=_0x2d118['vtigerAccounts'];this[_0xdc69('0x18')]=_0x2d118[_0xdc69('0x18')];this[_0xdc69('0x19')]=_0x2d118[_0xdc69('0x19')];this[_0xdc69('0x1a')]=_0x2d118[_0xdc69('0x1a')];this[_0xdc69('0x1b')]={'zendesk':this[_0xdc69('0x12')],'salesforce':this[_0xdc69('0x14')],'freshdesk':this[_0xdc69('0x13')],'sugarcrm':this[_0xdc69('0x15')],'zoho':this[_0xdc69('0x16')],'desk':this[_0xdc69('0x17')],'vtiger':this[_0xdc69('0x1c')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xdc69('0x1a')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x1f'),this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x20'),this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x21'),this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on']('custom:agentnosuchnumber',this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on']('custom:agentnoanswer',this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x22'),this[_0xdc69('0x1d')]['bind'](this));ami['on'](_0xdc69('0x23'),this['syncCustomEvent'][_0xdc69('0x1e')](this));ami['on']('custom:amd',this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0xdc69('0x1d')]['bind'](this));ami['on'](_0xdc69('0x24'),this[_0xdc69('0x1d')]['bind'](this));ami['on'](_0xdc69('0x25'),this['syncAgentDial'][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x26'),this[_0xdc69('0x27')]['bind'](this));ami['on'](_0xdc69('0x28'),this['syncAgentDial']['bind'](this));ami['on']('custom:newinteraction',this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x29'),this[_0xdc69('0x1d')]['bind'](this));ami['on'](_0xdc69('0x2a'),this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x2b'),this['syncCustomEvent'][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x2c'),this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0xdc69('0x2d'),this[_0xdc69('0x1d')][_0xdc69('0x1e')](this));ami['on'](_0xdc69('0x2e'),this['syncCustomEvent'][_0xdc69('0x1e')](this));}Trigger[_0xdc69('0x2f')][_0xdc69('0x30')]=function(_0x5ebe8d,_0x32dc2d,_0x2c09ed){logger[_0xdc69('0x31')](_0x5ebe8d,_0x32dc2d,JSON[_0xdc69('0x32')](_0x2c09ed));io['to'](_0x5ebe8d)['emit'](_0x32dc2d,_0x2c09ed);};Trigger[_0xdc69('0x2f')][_0xdc69('0x1d')]=function(_0x161c8e){var _0xaa1bc5=_['clone'](_0x161c8e);if(typeof _0xaa1bc5[_0xdc69('0x33')]===_0xdc69('0x34')){_0xaa1bc5[_0xdc69('0x33')]='voice';}logger[_0xdc69('0x35')](_0xdc69('0x1d'),util[_0xdc69('0x36')](_0xaa1bc5,{'showHidden':!![],'depth':null}));this[_0xdc69('0x37')](_0xaa1bc5);};Trigger[_0xdc69('0x2f')][_0xdc69('0x27')]=function(_0x54e647){if(this['agents'][_0x54e647[_0xdc69('0x38')]]){this[_0xdc69('0x1d')](_0x54e647);}};Trigger['prototype'][_0xdc69('0x37')]=function(_0x379cfb){var _0x406475;for(var _0x3aa7f7 in this[_0xdc69('0xd')]){if(this[_0xdc69('0xd')]['hasOwnProperty'](_0x3aa7f7)){if(this['triggers'][_0x3aa7f7][_0xdc69('0x39')]){_0x406475=this[_0xdc69('0x3a')](this[_0xdc69('0xd')][_0x3aa7f7],_0x379cfb);if(_0x406475){_['merge'](_0x379cfb,_0x379cfb[_0xdc69('0x3b')]);for(var _0x4e9cf5=0x0,_0x5213ef,_0x36d17a,_0x4c7cac;_0x4e9cf5<this[_0xdc69('0xd')][_0x3aa7f7][_0xdc69('0x3c')][_0xdc69('0x3d')];_0x4e9cf5+=0x1){_0x5213ef=this[_0xdc69('0xd')][_0x3aa7f7][_0xdc69('0x3c')][_0x4e9cf5];if(this['agents'][_0x379cfb[_0xdc69('0x38')]]){switch(_0x5213ef[_0xdc69('0x3e')][_0xdc69('0x3f')]()){case'contactmanager':break;case _0xdc69('0x40'):case _0xdc69('0x41'):var _0x4c8d7b={};switch(barAndWebActions[_0x5213ef[_0xdc69('0x42')]]){case _0xdc69('0xb'):_0x4c8d7b['TemplateId']=_0x5213ef[_0xdc69('0x43')];_0x4c8d7b[_0xdc69('0x44')]=this['templates'][_0x5213ef[_0xdc69('0x43')]]?Mustache[_0xdc69('0x45')](this[_0xdc69('0x10')][_0x5213ef[_0xdc69('0x43')]][_0xdc69('0x44')],_0x379cfb):'template\x20not\x20found';break;case _0xdc69('0x1'):_0x4c8d7b[_0xdc69('0x46')]=this[_0xdc69('0x47')](_0x5213ef[_0xdc69('0x43')],_0x379cfb,_[_0xdc69('0x48')](_0x5213ef['data3'])?!![]:parseInt(_0x5213ef['data3'],0xa));if(_['isNil'](_0x5213ef['data4'])){_0x4c8d7b['location']='0';}else{_0x4c8d7b[_0xdc69('0x49')]=_0x5213ef['data4'];_0x4c8d7b[_0xdc69('0x4a')]=_[_0xdc69('0x48')](_0x5213ef[_0xdc69('0x4b')])?_0xdc69('0x4c'):_0x5213ef[_0xdc69('0x4b')];_0x4c8d7b[_0xdc69('0x4d')]=_[_0xdc69('0x48')](_0x5213ef['data6'])?_0xdc69('0x4e'):_0x5213ef[_0xdc69('0x4f')];}break;case _0xdc69('0xc'):_0x4c8d7b[_0xdc69('0x50')]=_0x5213ef[_0xdc69('0x43')]?Mustache[_0xdc69('0x45')](_0x5213ef[_0xdc69('0x43')],_0x379cfb):'';_0x4c8d7b[_0xdc69('0x51')]=_0x5213ef[_0xdc69('0x52')]?Mustache[_0xdc69('0x45')](_0x5213ef['data3'],_0x379cfb):'';break;}this['emit'](util[_0xdc69('0x53')](_0xdc69('0x54'),this[_0xdc69('0xe')][_0x379cfb[_0xdc69('0x38')]][_0xdc69('0x55')]),util[_0xdc69('0x53')](_0xdc69('0x56'),_0x5213ef[_0xdc69('0x3e')][_0xdc69('0x3f')](),barAndWebActions[_0x5213ef[_0xdc69('0x42')]]),_[_0xdc69('0x57')](_0x4c8d7b,_0x379cfb));break;case _0xdc69('0x58'):this['emit'](util[_0xdc69('0x53')](_0xdc69('0x54'),this['agents'][_0x379cfb[_0xdc69('0x38')]][_0xdc69('0x55')]),util[_0xdc69('0x53')]('trigger:%s',_0x5213ef[_0xdc69('0x3e')][_0xdc69('0x3f')]()),_[_0xdc69('0x57')]({'ProjectId':parseInt(_0x5213ef[_0xdc69('0x42')],0xa)},_0x379cfb));break;default:this['emit'](util[_0xdc69('0x53')](_0xdc69('0x54'),this['agents'][_0x379cfb['interface']]['name']),util['format'](_0xdc69('0x59'),_0x5213ef[_0xdc69('0x3e')][_0xdc69('0x3f')]()),_['merge']({},_0x5213ef,_0x379cfb));}}switch(_0x5213ef['action'][_0xdc69('0x3f')]()){case _0xdc69('0x5a'):cmContact[_0xdc69('0x5b')](this['agents'][_0x379cfb[_0xdc69('0x38')]],this[_0xdc69('0xd')][_0x3aa7f7],_0x5213ef,_0x379cfb);break;case _0xdc69('0x5c'):integration[_0xdc69('0x5b')](_0x5213ef,_0x379cfb,this[_0xdc69('0x1b')],this[_0xdc69('0xe')][_0x379cfb[_0xdc69('0x38')]],this[_0xdc69('0xf')][_0x379cfb[_0xdc69('0x5d')]],this[_0xdc69('0x11')][_0x379cfb[_0xdc69('0x5e')]]);break;case'urlforward':urlforward[_0xdc69('0x5b')](_0x5213ef,_0x379cfb);break;case _0xdc69('0x5f'):script[_0xdc69('0x5b')](_0x5213ef,_0x379cfb);break;}}}}}}};Trigger[_0xdc69('0x2f')][_0xdc69('0x47')]=function(_0x9c0491,_0xeaa9ca,_0x2b3910){var _0x5ba3dd=url[_0xdc69('0x60')](Mustache[_0xdc69('0x45')](_0x9c0491,_0xeaa9ca),!![]);if(_0x2b3910){_[_0xdc69('0x57')](_0x5ba3dd[_0xdc69('0x61')],_0xeaa9ca);}delete _0x5ba3dd[_0xdc69('0x62')];var _0x410a21=url[_0xdc69('0x53')](_0x5ba3dd);_0x410a21=_0x410a21[_0xdc69('0x63')](/\/\?/g,'?');return _0x410a21;};Trigger['prototype'][_0xdc69('0x3a')]=function(_0x5cf522,_0x5e7245){var _0x5f5a2f=!![];var _0x3f5093=!![];var _0x41f2a7=![];if(_0x5cf522[_0xdc69('0x64')]===_0x5e7245[_0xdc69('0x33')]){_0x41f2a7=!![];}if(_0x5cf522[_0xdc69('0x65')][_0xdc69('0x3d')]){_0x5f5a2f=_[_0xdc69('0x66')](_0x5cf522[_0xdc69('0x65')],this['checkConditions'](_0x5e7245,_0x5cf522[_0xdc69('0x64')]));}if(_0x5cf522[_0xdc69('0x67')][_0xdc69('0x3d')]){_0x3f5093=_[_0xdc69('0x68')](_0x5cf522['AnyConditions'],this[_0xdc69('0x69')](_0x5e7245,_0x5cf522[_0xdc69('0x64')]));}var _0x23bafa=_0x41f2a7&&_0x5f5a2f&&_0x3f5093;logger['debug']('checkTrigger:\x20trigger',util[_0xdc69('0x36')](_0x5cf522,{'showHidden':!![],'depth':null}),_0xdc69('0x6a'),util[_0xdc69('0x36')](_0x5e7245,{'showHidden':!![],'depth':null}),_0x41f2a7,_0x5f5a2f,_0x3f5093);return _0x23bafa;};Trigger[_0xdc69('0x2f')][_0xdc69('0x69')]=function(_0x80d0b,_0x29abe0){return function(_0x53c90f){switch(_0x53c90f[_0xdc69('0x6b')]){case _0xdc69('0x6c'):if(_0x80d0b[_0xdc69('0x64')]===_0x29abe0){if(_0x29abe0===_0xdc69('0x6d')){return _0x80d0b[_0xdc69('0x6e')]?operators[_0x53c90f['operator']](Number(_0x53c90f[_0xdc69('0x6f')]),_0x80d0b[_0xdc69('0x6e')]):![];}else{return _0x80d0b[_[_0xdc69('0x70')](_0x29abe0)+_0xdc69('0x71')]?operators[_0x53c90f['operator']](Number(_0x53c90f['value']),_0x80d0b[_[_0xdc69('0x70')](_0x29abe0)+_0xdc69('0x71')]):![];}}break;case _0xdc69('0x72'):case'message':if(_0x80d0b[_0xdc69('0x64')]===_0x29abe0){return _0x80d0b[_0xdc69('0x73')]?operators[_0x53c90f[_0xdc69('0x74')]](_0x53c90f[_0xdc69('0x6f')],_0x80d0b[_0xdc69('0x73')]):![];}break;case _0xdc69('0x5d'):return _0x80d0b['queue']?operators[_0x53c90f[_0xdc69('0x74')]](_0x53c90f[_0xdc69('0x6f')],_0x80d0b[_0xdc69('0x5d')]):![];case _0xdc69('0x75'):return _0x80d0b['membername']?operators[_0x53c90f[_0xdc69('0x74')]](_0x53c90f[_0xdc69('0x6f')],_0x80d0b['membername']):![];case _0xdc69('0x76'):return _0x80d0b['lastevent']?operators[_0x53c90f[_0xdc69('0x74')]](_0x53c90f[_0xdc69('0x6f')],_0x80d0b[_0xdc69('0x76')]):![];case'routeId':return _0x80d0b[_0xdc69('0x5e')]?operators[_0x53c90f['operator']](_0x53c90f[_0xdc69('0x6f')],_0x80d0b['routeId']):![];case _0xdc69('0x77'):if(_0x53c90f['value']===_0xdc69('0x78'))_0x53c90f[_0xdc69('0x6f')]=null;return typeof _0x80d0b[_0xdc69('0x79')]!==_0xdc69('0x34')?operators[_0x53c90f[_0xdc69('0x74')]](_0x53c90f['value'],_0x80d0b['substatus']):![];case _0xdc69('0x7a'):if(_0x80d0b[_0xdc69('0x64')]===_0x29abe0){return _0x53c90f['value']===_0xdc69('0x7b')&&_0x53c90f['operator']===_0xdc69('0x7c')?!![]:![];}break;}return![];};};module[_0xdc69('0x7d')]=Trigger;
\ No newline at end of file
+var _0x4548=['undefined','voice','inspect','checkTriggers','interface','status','checkTrigger','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','popup','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','600','winArguments','user:%s','format','trigger:%s:%s','data1','merge','jscripty','trigger:%s','exec','integration','accounts','queue','routeId','urlforward','script','parse','search','replace','channel','AllConditions','every','AnyConditions','checkConditions','debug','account','ChatWebsiteId','operator','value','AccountId','interaction','message','event','agent','membername','lastevent','null','substatus','created','equals','lodash','url','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','clone','motionChannel'];(function(_0x396c7b,_0x4d54f6){var _0x3d7335=function(_0x86ca1e){while(--_0x86ca1e){_0x396c7b['push'](_0x396c7b['shift']());}};_0x3d7335(++_0x4d54f6);}(_0x4548,0x1c5));var _0x8454=function(_0xb8f93a,_0x5b795c){_0xb8f93a=_0xb8f93a-0x0;var _0x151361=_0x4548[_0xb8f93a];return _0x151361;};'use strict';var util=require('util');var _=require(_0x8454('0x0'));var url=require(_0x8454('0x1'));var Mustache=require('mustache');var Redis=require(_0x8454('0x2'));var urlforward=require(_0x8454('0x3'));var integration=require(_0x8454('0x4'));var cmContact=require(_0x8454('0x5'));var script=require(_0x8454('0x6'));var config=require(_0x8454('0x7'));var logger=require(_0x8454('0x8'))(_0x8454('0x9'));var ami=require(_0x8454('0xa'));config['redis']=_[_0x8454('0xb')](config['redis'],{'host':_0x8454('0xc'),'port':0x18eb});var io=require(_0x8454('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x566ba6,_0x6242c3){return _0x566ba6==_0x6242c3;},'not_equals':function(_0x564c4c,_0x25056e){return _0x564c4c!=_0x25056e;}};var barAndWebActions=['popup',_0x8454('0x1'),_0x8454('0xe')];function Trigger(_0x19fba8){this[_0x8454('0xf')]=_0x19fba8[_0x8454('0xf')];this['agents']=_0x19fba8[_0x8454('0x10')];this[_0x8454('0x11')]=_0x19fba8['voiceQueues'];this[_0x8454('0x12')]=_0x19fba8[_0x8454('0x12')];this[_0x8454('0x13')]=_0x19fba8[_0x8454('0x13')];this[_0x8454('0x14')]=_0x19fba8[_0x8454('0x14')];this[_0x8454('0x15')]=_0x19fba8['freshdeskAccounts'];this[_0x8454('0x16')]=_0x19fba8[_0x8454('0x16')];this[_0x8454('0x17')]=_0x19fba8[_0x8454('0x17')];this[_0x8454('0x18')]=_0x19fba8['zohoAccounts'];this['deskAccounts']=_0x19fba8[_0x8454('0x19')];this[_0x8454('0x1a')]=_0x19fba8[_0x8454('0x1a')];this[_0x8454('0x1b')]=_0x19fba8[_0x8454('0x1b')];this[_0x8454('0x1c')]=_0x19fba8[_0x8454('0x1c')];this['freshsalesAccounts']=_0x19fba8['freshsalesAccounts'];this['accounts']={'zendesk':this[_0x8454('0x14')],'salesforce':this[_0x8454('0x16')],'freshdesk':this[_0x8454('0x15')],'sugarcrm':this[_0x8454('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0x8454('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x8454('0x1c')],'freshsales':this[_0x8454('0x1d')],'servicenow':this[_0x8454('0x1b')]};ami['on']('custom:agentcalled',this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x20'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x21'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x22'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x23'),this['syncCustomEvent'][_0x8454('0x1f')](this));ami['on'](_0x8454('0x24'),this['syncCustomEvent'][_0x8454('0x1f')](this));ami['on'](_0x8454('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8454('0x26'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x27'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x28'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on']('custom:timeout',this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x29'),this[_0x8454('0x2a')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x2b'),this[_0x8454('0x2a')][_0x8454('0x1f')](this));ami['on']('custom:dialend',this[_0x8454('0x2a')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x2c'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x8454('0x1f')](this));ami['on'](_0x8454('0x2d'),this['syncCustomEvent'][_0x8454('0x1f')](this));ami['on'](_0x8454('0x2e'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x2f'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on'](_0x8454('0x30'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0x8454('0x1f')](this));ami['on'](_0x8454('0x31'),this[_0x8454('0x1e')][_0x8454('0x1f')](this));}Trigger[_0x8454('0x32')][_0x8454('0x33')]=function(_0x8cdb22,_0x5a3372,_0x3cd4ad){logger[_0x8454('0x34')](_0x8cdb22,_0x5a3372,JSON['stringify'](_0x3cd4ad));io['to'](_0x8cdb22)[_0x8454('0x33')](_0x5a3372,_0x3cd4ad);};Trigger[_0x8454('0x32')][_0x8454('0x1e')]=function(_0xbbeb17){var _0x1ec6cf=_[_0x8454('0x35')](_0xbbeb17);if(typeof _0x1ec6cf[_0x8454('0x36')]===_0x8454('0x37')){_0x1ec6cf[_0x8454('0x36')]=_0x8454('0x38');}logger['debug'](_0x8454('0x1e'),util[_0x8454('0x39')](_0x1ec6cf,{'showHidden':!![],'depth':null}));this[_0x8454('0x3a')](_0x1ec6cf);};Trigger[_0x8454('0x32')]['syncAgentDial']=function(_0x332148){if(this[_0x8454('0x10')][_0x332148[_0x8454('0x3b')]]){this[_0x8454('0x1e')](_0x332148);}};Trigger['prototype'][_0x8454('0x3a')]=function(_0x232e99){var _0x4474e1;for(var _0x46434e in this[_0x8454('0xf')]){if(this[_0x8454('0xf')]['hasOwnProperty'](_0x46434e)){if(this['triggers'][_0x46434e][_0x8454('0x3c')]){_0x4474e1=this[_0x8454('0x3d')](this[_0x8454('0xf')][_0x46434e],_0x232e99);if(_0x4474e1){_['merge'](_0x232e99,_0x232e99['variables']);for(var _0x1efd3a=0x0,_0xb3eec5,_0x202ed3,_0x17d0e0;_0x1efd3a<this['triggers'][_0x46434e][_0x8454('0x3e')][_0x8454('0x3f')];_0x1efd3a+=0x1){_0xb3eec5=this[_0x8454('0xf')][_0x46434e][_0x8454('0x3e')][_0x1efd3a];if(this[_0x8454('0x10')][_0x232e99[_0x8454('0x3b')]]){switch(_0xb3eec5[_0x8454('0x40')][_0x8454('0x41')]()){case _0x8454('0x42'):break;case _0x8454('0x43'):case _0x8454('0x44'):var _0xdb5367={};switch(barAndWebActions[_0xb3eec5['data1']]){case _0x8454('0x45'):_0xdb5367[_0x8454('0x46')]=_0xb3eec5[_0x8454('0x47')];_0xdb5367['html']=this[_0x8454('0x12')][_0xb3eec5[_0x8454('0x47')]]?Mustache[_0x8454('0x48')](this[_0x8454('0x12')][_0xb3eec5['data2']][_0x8454('0x49')],_0x232e99):_0x8454('0x4a');break;case'url':_0xdb5367[_0x8454('0x4b')]=this[_0x8454('0x4c')](_0xb3eec5['data2'],_0x232e99,_[_0x8454('0x4d')](_0xb3eec5[_0x8454('0x4e')])?!![]:parseInt(_0xb3eec5[_0x8454('0x4e')],0xa));if(_[_0x8454('0x4d')](_0xb3eec5['data4'])){_0xdb5367[_0x8454('0x4f')]='0';}else{_0xdb5367[_0x8454('0x50')]=_0xb3eec5[_0x8454('0x51')];_0xdb5367[_0x8454('0x52')]=_[_0x8454('0x4d')](_0xb3eec5[_0x8454('0x53')])?_0x8454('0x54'):_0xb3eec5[_0x8454('0x53')];_0xdb5367[_0x8454('0x55')]=_[_0x8454('0x4d')](_0xb3eec5[_0x8454('0x56')])?_0x8454('0x57'):_0xb3eec5['data6'];}break;case _0x8454('0xe'):_0xdb5367['winApplication']=_0xb3eec5[_0x8454('0x47')]?Mustache[_0x8454('0x48')](_0xb3eec5[_0x8454('0x47')],_0x232e99):'';_0xdb5367[_0x8454('0x58')]=_0xb3eec5['data3']?Mustache[_0x8454('0x48')](_0xb3eec5[_0x8454('0x4e')],_0x232e99):'';break;}this[_0x8454('0x33')](util['format'](_0x8454('0x59'),this['agents'][_0x232e99[_0x8454('0x3b')]]['name']),util[_0x8454('0x5a')](_0x8454('0x5b'),_0xb3eec5[_0x8454('0x40')]['toLowerCase'](),barAndWebActions[_0xb3eec5[_0x8454('0x5c')]]),_[_0x8454('0x5d')](_0xdb5367,_0x232e99));break;case _0x8454('0x5e'):this[_0x8454('0x33')](util[_0x8454('0x5a')](_0x8454('0x59'),this[_0x8454('0x10')][_0x232e99[_0x8454('0x3b')]]['name']),util['format'](_0x8454('0x5f'),_0xb3eec5[_0x8454('0x40')][_0x8454('0x41')]()),_[_0x8454('0x5d')]({'ProjectId':parseInt(_0xb3eec5[_0x8454('0x5c')],0xa)},_0x232e99));break;default:this[_0x8454('0x33')](util['format'](_0x8454('0x59'),this[_0x8454('0x10')][_0x232e99[_0x8454('0x3b')]]['name']),util[_0x8454('0x5a')](_0x8454('0x5f'),_0xb3eec5['action'][_0x8454('0x41')]()),_[_0x8454('0x5d')]({},_0xb3eec5,_0x232e99));}}switch(_0xb3eec5['action'][_0x8454('0x41')]()){case _0x8454('0x42'):cmContact[_0x8454('0x60')](this[_0x8454('0x10')][_0x232e99[_0x8454('0x3b')]],this[_0x8454('0xf')][_0x46434e],_0xb3eec5,_0x232e99);break;case _0x8454('0x61'):integration[_0x8454('0x60')](_0xb3eec5,_0x232e99,this[_0x8454('0x62')],this[_0x8454('0x10')][_0x232e99[_0x8454('0x3b')]],this[_0x8454('0x11')][_0x232e99[_0x8454('0x63')]],this[_0x8454('0x13')][_0x232e99[_0x8454('0x64')]]);break;case _0x8454('0x65'):urlforward[_0x8454('0x60')](_0xb3eec5,_0x232e99);break;case _0x8454('0x66'):script[_0x8454('0x60')](_0xb3eec5,_0x232e99);break;}}}}}}};Trigger[_0x8454('0x32')]['buildUri']=function(_0x3ba85a,_0x2b6ee7,_0x14393f){var _0x138895=url[_0x8454('0x67')](Mustache[_0x8454('0x48')](_0x3ba85a,_0x2b6ee7),!![]);if(_0x14393f){_['merge'](_0x138895['query'],_0x2b6ee7);}delete _0x138895[_0x8454('0x68')];var _0x2d491d=url['format'](_0x138895);_0x2d491d=_0x2d491d[_0x8454('0x69')](/\/\?/g,'?');return _0x2d491d;};Trigger[_0x8454('0x32')][_0x8454('0x3d')]=function(_0x17cefa,_0x5d4496){var _0x21d7b9=!![];var _0x220638=!![];var _0x594430=![];if(_0x17cefa[_0x8454('0x6a')]===_0x5d4496[_0x8454('0x36')]){_0x594430=!![];}if(_0x17cefa[_0x8454('0x6b')][_0x8454('0x3f')]){_0x21d7b9=_[_0x8454('0x6c')](_0x17cefa['AllConditions'],this['checkConditions'](_0x5d4496,_0x17cefa[_0x8454('0x6a')]));}if(_0x17cefa['AnyConditions'][_0x8454('0x3f')]){_0x220638=_['some'](_0x17cefa[_0x8454('0x6d')],this[_0x8454('0x6e')](_0x5d4496,_0x17cefa['channel']));}var _0x17d937=_0x594430&&_0x21d7b9&&_0x220638;logger[_0x8454('0x6f')]('checkTrigger:\x20trigger',util[_0x8454('0x39')](_0x17cefa,{'showHidden':!![],'depth':null}),'evt',util[_0x8454('0x39')](_0x5d4496,{'showHidden':!![],'depth':null}),_0x594430,_0x21d7b9,_0x220638);return _0x17d937;};Trigger[_0x8454('0x32')][_0x8454('0x6e')]=function(_0x33194d,_0x3a2d3e){return function(_0x48ef24){switch(_0x48ef24['field']){case _0x8454('0x70'):if(_0x33194d[_0x8454('0x6a')]===_0x3a2d3e){if(_0x3a2d3e==='chat'){return _0x33194d[_0x8454('0x71')]?operators[_0x48ef24[_0x8454('0x72')]](Number(_0x48ef24[_0x8454('0x73')]),_0x33194d['ChatWebsiteId']):![];}else{return _0x33194d[_['upperFirst'](_0x3a2d3e)+'AccountId']?operators[_0x48ef24[_0x8454('0x72')]](Number(_0x48ef24[_0x8454('0x73')]),_0x33194d[_['upperFirst'](_0x3a2d3e)+_0x8454('0x74')]):![];}}break;case _0x8454('0x75'):case _0x8454('0x76'):if(_0x33194d[_0x8454('0x6a')]===_0x3a2d3e){return _0x33194d[_0x8454('0x77')]?operators[_0x48ef24[_0x8454('0x72')]](_0x48ef24[_0x8454('0x73')],_0x33194d[_0x8454('0x77')]):![];}break;case'queue':return _0x33194d[_0x8454('0x63')]?operators[_0x48ef24[_0x8454('0x72')]](_0x48ef24['value'],_0x33194d[_0x8454('0x63')]):![];case _0x8454('0x78'):return _0x33194d['membername']?operators[_0x48ef24[_0x8454('0x72')]](_0x48ef24[_0x8454('0x73')],_0x33194d[_0x8454('0x79')]):![];case _0x8454('0x7a'):return _0x33194d[_0x8454('0x7a')]?operators[_0x48ef24[_0x8454('0x72')]](_0x48ef24[_0x8454('0x73')],_0x33194d[_0x8454('0x7a')]):![];case'routeId':return _0x33194d[_0x8454('0x64')]?operators[_0x48ef24[_0x8454('0x72')]](_0x48ef24[_0x8454('0x73')],_0x33194d[_0x8454('0x64')]):![];case'mailSubstatus':if(_0x48ef24['value']===_0x8454('0x7b'))_0x48ef24[_0x8454('0x73')]=null;return typeof _0x33194d[_0x8454('0x7c')]!==_0x8454('0x37')?operators[_0x48ef24[_0x8454('0x72')]](_0x48ef24[_0x8454('0x73')],_0x33194d[_0x8454('0x7c')]):![];case'offlineMessage':if(_0x33194d[_0x8454('0x6a')]===_0x3a2d3e){return _0x48ef24['value']===_0x8454('0x7d')&&_0x48ef24[_0x8454('0x72')]===_0x8454('0x7e')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file