Built motion from commit 37e1ed56.|2.6.29
[motion2.git] / server / services / ami / trigger / index.js
index a43244b..ddcc59b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa613=['membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','sugarcrmAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','prototype','motionChannel','undefined','voice','inspect','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','render','html','template\x20not\x20found','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winapp','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','integration','accounts','queue','routeId','urlforward','exec','query','search','AllConditions','length','channel','some','checkConditions','debug','evt','field','account','chat','value','ChatWebsiteId','AccountId','upperFirst','interaction','message','event','operator','agent'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa613,0x8a));var _0x3a61=function(_0x3443d3,_0xf1bb82){_0x3443d3=_0x3443d3-0x0;var _0x3de675=_0xa613[_0x3443d3];return _0x3de675;};'use strict';var util=require(_0x3a61('0x0'));var _=require('lodash');var url=require(_0x3a61('0x1'));var Mustache=require(_0x3a61('0x2'));var Redis=require(_0x3a61('0x3'));var urlforward=require(_0x3a61('0x4'));var integration=require(_0x3a61('0x5'));var cmContact=require(_0x3a61('0x6'));var script=require(_0x3a61('0x7'));var config=require(_0x3a61('0x8'));var logger=require(_0x3a61('0x9'))(_0x3a61('0xa'));var ami=require('../ami');config[_0x3a61('0xb')]=_[_0x3a61('0xc')](config['redis'],{'host':_0x3a61('0xd'),'port':0x18eb});var io=require(_0x3a61('0xe'))(new Redis(config[_0x3a61('0xb')]));var operators={'equals':function(_0x3040dd,_0x1c3fe9){return _0x3040dd==_0x1c3fe9;},'not_equals':function(_0x538238,_0x2ad63f){return _0x538238!=_0x2ad63f;}};var barAndWebActions=[_0x3a61('0xf'),'url','winapp'];function Trigger(_0x56fbbc){this[_0x3a61('0x10')]=_0x56fbbc[_0x3a61('0x10')];this['agents']=_0x56fbbc[_0x3a61('0x11')];this[_0x3a61('0x12')]=_0x56fbbc[_0x3a61('0x12')];this[_0x3a61('0x13')]=_0x56fbbc[_0x3a61('0x13')];this[_0x3a61('0x14')]=_0x56fbbc['voiceExtensions'];this['zendeskAccounts']=_0x56fbbc[_0x3a61('0x15')];this[_0x3a61('0x16')]=_0x56fbbc[_0x3a61('0x16')];this[_0x3a61('0x17')]=_0x56fbbc[_0x3a61('0x17')];this['sugarcrmAccounts']=_0x56fbbc['sugarcrmAccounts'];this[_0x3a61('0x18')]=_0x56fbbc['zohoAccounts'];this[_0x3a61('0x19')]=_0x56fbbc['deskAccounts'];this[_0x3a61('0x1a')]=_0x56fbbc[_0x3a61('0x1a')];this['servicenowAccounts']=_0x56fbbc[_0x3a61('0x1b')];this['dynamics365Accounts']=_0x56fbbc[_0x3a61('0x1c')];this['freshsalesAccounts']=_0x56fbbc[_0x3a61('0x1d')];this['accounts']={'zendesk':this[_0x3a61('0x15')],'salesforce':this[_0x3a61('0x17')],'freshdesk':this[_0x3a61('0x16')],'sugarcrm':this[_0x3a61('0x1e')],'zoho':this[_0x3a61('0x18')],'desk':this[_0x3a61('0x19')],'vtiger':this[_0x3a61('0x1a')],'dynamics365':this[_0x3a61('0x1c')],'freshsales':this[_0x3a61('0x1d')],'servicenow':this[_0x3a61('0x1b')]};ami['on'](_0x3a61('0x1f'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x22'),this[_0x3a61('0x20')]['bind'](this));ami['on'](_0x3a61('0x23'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x24'),this['syncCustomEvent'][_0x3a61('0x21')](this));ami['on']('custom:agentnosuchnumber',this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x25'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x26'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x27'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x28'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x29'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x2a'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on']('custom:timeout',this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x2b'),this[_0x3a61('0x2c')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x2d'),this[_0x3a61('0x2c')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x2e'),this[_0x3a61('0x2c')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x2f'),this['syncCustomEvent'][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x30'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x31'),this['syncCustomEvent'][_0x3a61('0x21')](this));ami['on']('custom:incomingmessage',this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on'](_0x3a61('0x32'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));ami['on']('custom:acceptmessage',this[_0x3a61('0x20')]['bind'](this));ami['on'](_0x3a61('0x33'),this[_0x3a61('0x20')]['bind'](this));ami['on'](_0x3a61('0x34'),this[_0x3a61('0x20')][_0x3a61('0x21')](this));}Trigger['prototype'][_0x3a61('0x35')]=function(_0x1b54e7,_0x15b5e0,_0x2485e4){logger[_0x3a61('0x36')](_0x1b54e7,_0x15b5e0,JSON[_0x3a61('0x37')](_0x2485e4));io['to'](_0x1b54e7)[_0x3a61('0x35')](_0x15b5e0,_0x2485e4);};Trigger[_0x3a61('0x38')][_0x3a61('0x20')]=function(_0x2a126f){var _0x3ffa76=_['clone'](_0x2a126f);if(typeof _0x3ffa76[_0x3a61('0x39')]===_0x3a61('0x3a')){_0x3ffa76['motionChannel']=_0x3a61('0x3b');}logger['debug'](_0x3a61('0x20'),util[_0x3a61('0x3c')](_0x3ffa76,{'showHidden':!![],'depth':null}));this[_0x3a61('0x3d')](_0x3ffa76);};Trigger[_0x3a61('0x38')][_0x3a61('0x2c')]=function(_0x202fc6){if(this[_0x3a61('0x11')][_0x202fc6[_0x3a61('0x3e')]]){this[_0x3a61('0x20')](_0x202fc6);}};Trigger['prototype']['checkTriggers']=function(_0x4aee41){var _0x1e2e3f;for(var _0x298468 in this[_0x3a61('0x10')]){if(this[_0x3a61('0x10')][_0x3a61('0x3f')](_0x298468)){if(this['triggers'][_0x298468][_0x3a61('0x40')]){_0x1e2e3f=this[_0x3a61('0x41')](this[_0x3a61('0x10')][_0x298468],_0x4aee41);if(_0x1e2e3f){_[_0x3a61('0x42')](_0x4aee41,_0x4aee41[_0x3a61('0x43')]);for(var _0xa97ebe=0x0,_0x2e3670,_0x393d90,_0x3c8c87;_0xa97ebe<this['triggers'][_0x298468][_0x3a61('0x44')]['length'];_0xa97ebe+=0x1){_0x2e3670=this[_0x3a61('0x10')][_0x298468]['Actions'][_0xa97ebe];if(this[_0x3a61('0x11')][_0x4aee41[_0x3a61('0x3e')]]){switch(_0x2e3670[_0x3a61('0x45')][_0x3a61('0x46')]()){case _0x3a61('0x47'):break;case _0x3a61('0x48'):case _0x3a61('0x49'):var _0x587304={};switch(barAndWebActions[_0x2e3670[_0x3a61('0x4a')]]){case _0x3a61('0xf'):_0x587304['TemplateId']=_0x2e3670[_0x3a61('0x4b')];_0x587304['html']=this[_0x3a61('0x13')][_0x2e3670['data2']]?Mustache[_0x3a61('0x4c')](this[_0x3a61('0x13')][_0x2e3670[_0x3a61('0x4b')]][_0x3a61('0x4d')],_0x4aee41):_0x3a61('0x4e');break;case'url':_0x587304['uri']=this[_0x3a61('0x4f')](_0x2e3670['data2'],_0x4aee41,_[_0x3a61('0x50')](_0x2e3670[_0x3a61('0x51')])?!![]:parseInt(_0x2e3670[_0x3a61('0x51')],0xa));if(_[_0x3a61('0x50')](_0x2e3670[_0x3a61('0x52')])){_0x587304['location']='0';}else{_0x587304[_0x3a61('0x53')]=_0x2e3670[_0x3a61('0x52')];_0x587304[_0x3a61('0x54')]=_[_0x3a61('0x50')](_0x2e3670[_0x3a61('0x55')])?_0x3a61('0x56'):_0x2e3670[_0x3a61('0x55')];_0x587304[_0x3a61('0x57')]=_[_0x3a61('0x50')](_0x2e3670['data6'])?_0x3a61('0x58'):_0x2e3670[_0x3a61('0x59')];}break;case _0x3a61('0x5a'):_0x587304['winApplication']=_0x2e3670['data2']?Mustache['render'](_0x2e3670['data2'],_0x4aee41):'';_0x587304['winArguments']=_0x2e3670[_0x3a61('0x51')]?Mustache[_0x3a61('0x4c')](_0x2e3670[_0x3a61('0x51')],_0x4aee41):'';break;}this[_0x3a61('0x35')](util[_0x3a61('0x5b')](_0x3a61('0x5c'),this[_0x3a61('0x11')][_0x4aee41[_0x3a61('0x3e')]]['name']),util[_0x3a61('0x5b')](_0x3a61('0x5d'),_0x2e3670[_0x3a61('0x45')][_0x3a61('0x46')](),barAndWebActions[_0x2e3670[_0x3a61('0x4a')]]),_['merge'](_0x587304,_0x4aee41));break;case _0x3a61('0x5e'):this['emit'](util[_0x3a61('0x5b')](_0x3a61('0x5c'),this[_0x3a61('0x11')][_0x4aee41[_0x3a61('0x3e')]][_0x3a61('0x5f')]),util[_0x3a61('0x5b')](_0x3a61('0x60'),_0x2e3670['action'][_0x3a61('0x46')]()),_[_0x3a61('0x42')]({'ProjectId':parseInt(_0x2e3670['data1'],0xa)},_0x4aee41));break;default:this[_0x3a61('0x35')](util[_0x3a61('0x5b')]('user:%s',this[_0x3a61('0x11')][_0x4aee41[_0x3a61('0x3e')]][_0x3a61('0x5f')]),util[_0x3a61('0x5b')](_0x3a61('0x60'),_0x2e3670[_0x3a61('0x45')][_0x3a61('0x46')]()),_[_0x3a61('0x42')]({},_0x2e3670,_0x4aee41));}}switch(_0x2e3670['action'][_0x3a61('0x46')]()){case _0x3a61('0x47'):cmContact['exec'](this['agents'][_0x4aee41[_0x3a61('0x3e')]],this[_0x3a61('0x10')][_0x298468],_0x2e3670,_0x4aee41);break;case _0x3a61('0x61'):integration['exec'](_0x2e3670,_0x4aee41,this[_0x3a61('0x62')],this['agents'][_0x4aee41['interface']],this['voiceQueues'][_0x4aee41[_0x3a61('0x63')]],this[_0x3a61('0x14')][_0x4aee41[_0x3a61('0x64')]]);break;case _0x3a61('0x65'):urlforward['exec'](_0x2e3670,_0x4aee41);break;case'script':script[_0x3a61('0x66')](_0x2e3670,_0x4aee41);break;}}}}}}};Trigger[_0x3a61('0x38')][_0x3a61('0x4f')]=function(_0x55d709,_0x381f3b,_0xd51bcf){var _0x3b2a40=url['parse'](Mustache[_0x3a61('0x4c')](_0x55d709,_0x381f3b),!![]);if(_0xd51bcf){_[_0x3a61('0x42')](_0x3b2a40[_0x3a61('0x67')],_0x381f3b);}delete _0x3b2a40[_0x3a61('0x68')];var _0x3b30c2=url[_0x3a61('0x5b')](_0x3b2a40);_0x3b30c2=_0x3b30c2['replace'](/\/\?/g,'?');return _0x3b30c2;};Trigger[_0x3a61('0x38')][_0x3a61('0x41')]=function(_0x5ecb0c,_0x3fa07c){var _0x521c22=!![];var _0x3bc5b0=!![];var _0x2d6c2c=![];if(_0x5ecb0c['channel']===_0x3fa07c[_0x3a61('0x39')]){_0x2d6c2c=!![];}if(_0x5ecb0c[_0x3a61('0x69')][_0x3a61('0x6a')]){_0x521c22=_['every'](_0x5ecb0c[_0x3a61('0x69')],this['checkConditions'](_0x3fa07c,_0x5ecb0c[_0x3a61('0x6b')]));}if(_0x5ecb0c['AnyConditions'][_0x3a61('0x6a')]){_0x3bc5b0=_[_0x3a61('0x6c')](_0x5ecb0c['AnyConditions'],this[_0x3a61('0x6d')](_0x3fa07c,_0x5ecb0c[_0x3a61('0x6b')]));}var _0x51ce77=_0x2d6c2c&&_0x521c22&&_0x3bc5b0;logger[_0x3a61('0x6e')]('checkTrigger:\x20trigger',util[_0x3a61('0x3c')](_0x5ecb0c,{'showHidden':!![],'depth':null}),_0x3a61('0x6f'),util[_0x3a61('0x3c')](_0x3fa07c,{'showHidden':!![],'depth':null}),_0x2d6c2c,_0x521c22,_0x3bc5b0);return _0x51ce77;};Trigger[_0x3a61('0x38')][_0x3a61('0x6d')]=function(_0x32429a,_0xbb0986){return function(_0x3f98d1){switch(_0x3f98d1[_0x3a61('0x70')]){case _0x3a61('0x71'):if(_0x32429a[_0x3a61('0x6b')]===_0xbb0986){if(_0xbb0986===_0x3a61('0x72')){return _0x32429a['ChatWebsiteId']?operators[_0x3f98d1['operator']](Number(_0x3f98d1[_0x3a61('0x73')]),_0x32429a[_0x3a61('0x74')]):![];}else{return _0x32429a[_['upperFirst'](_0xbb0986)+_0x3a61('0x75')]?operators[_0x3f98d1['operator']](Number(_0x3f98d1['value']),_0x32429a[_[_0x3a61('0x76')](_0xbb0986)+_0x3a61('0x75')]):![];}}break;case _0x3a61('0x77'):case _0x3a61('0x78'):if(_0x32429a[_0x3a61('0x6b')]===_0xbb0986){return _0x32429a[_0x3a61('0x79')]?operators[_0x3f98d1[_0x3a61('0x7a')]](_0x3f98d1['value'],_0x32429a[_0x3a61('0x79')]):![];}break;case _0x3a61('0x63'):return _0x32429a[_0x3a61('0x63')]?operators[_0x3f98d1[_0x3a61('0x7a')]](_0x3f98d1[_0x3a61('0x73')],_0x32429a['queue']):![];case _0x3a61('0x7b'):return _0x32429a[_0x3a61('0x7c')]?operators[_0x3f98d1['operator']](_0x3f98d1['value'],_0x32429a[_0x3a61('0x7c')]):![];case'lastevent':return _0x32429a[_0x3a61('0x7d')]?operators[_0x3f98d1['operator']](_0x3f98d1[_0x3a61('0x73')],_0x32429a[_0x3a61('0x7d')]):![];case _0x3a61('0x64'):return _0x32429a['routeId']?operators[_0x3f98d1[_0x3a61('0x7a')]](_0x3f98d1['value'],_0x32429a['routeId']):![];case _0x3a61('0x7e'):if(_0x3f98d1['value']===_0x3a61('0x7f'))_0x3f98d1['value']=null;return typeof _0x32429a[_0x3a61('0x80')]!==_0x3a61('0x3a')?operators[_0x3f98d1[_0x3a61('0x7a')]](_0x3f98d1[_0x3a61('0x73')],_0x32429a[_0x3a61('0x80')]):![];case _0x3a61('0x81'):if(_0x32429a['channel']===_0xbb0986){return _0x3f98d1[_0x3a61('0x73')]==='created'&&_0x3f98d1[_0x3a61('0x7a')]===_0x3a61('0x82')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x37a7=['defaults','redis','url','triggers','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','agents','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','action','motionbar','browser','data1','popup','TemplateId','html','templates','render','uri','data2','isNil','data3','data4','windowWidth','data5','data6','600','winapp','winApplication','winArguments','user:%s','name','trigger:%s:%s','toLowerCase','format','trigger:%s','exec','integration','urlforward','script','parse','query','search','replace','channel','AllConditions','checkConditions','AnyConditions','some','checkTrigger:\x20trigger','field','account','chat','ChatWebsiteId','upperFirst','AccountId','operator','interaction','value','queue','agent','membername','lastevent','routeId','mailSubstatus','substatus','offlineMessage','created','equals','exports','util','lodash','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger'];(function(_0x1bb93d,_0x160ae9){var _0xde6852=function(_0x103820){while(--_0x103820){_0x1bb93d['push'](_0x1bb93d['shift']());}};_0xde6852(++_0x160ae9);}(_0x37a7,0x73));var _0x737a=function(_0x2b885e,_0x8f87c2){_0x2b885e=_0x2b885e-0x0;var _0x42b600=_0x37a7[_0x2b885e];return _0x42b600;};'use strict';var util=require(_0x737a('0x0'));var _=require(_0x737a('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0x737a('0x2'));var urlforward=require(_0x737a('0x3'));var integration=require(_0x737a('0x4'));var cmContact=require(_0x737a('0x5'));var script=require(_0x737a('0x6'));var config=require(_0x737a('0x7'));var logger=require(_0x737a('0x8'))(_0x737a('0x9'));var ami=require('../ami');config['redis']=_[_0x737a('0xa')](config[_0x737a('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x737a('0xb')]));var operators={'equals':function(_0x22e708,_0x4ee616){return _0x22e708==_0x4ee616;},'not_equals':function(_0x4ae58b,_0xfa84){return _0x4ae58b!=_0xfa84;}};var barAndWebActions=['popup',_0x737a('0xc'),'winapp'];function Trigger(_0x42a4f7){this[_0x737a('0xd')]=_0x42a4f7[_0x737a('0xd')];this['agents']=_0x42a4f7['agents'];this[_0x737a('0xe')]=_0x42a4f7[_0x737a('0xe')];this['templates']=_0x42a4f7['templates'];this['voiceExtensions']=_0x42a4f7[_0x737a('0xf')];this[_0x737a('0x10')]=_0x42a4f7[_0x737a('0x10')];this[_0x737a('0x11')]=_0x42a4f7['freshdeskAccounts'];this[_0x737a('0x12')]=_0x42a4f7[_0x737a('0x12')];this[_0x737a('0x13')]=_0x42a4f7[_0x737a('0x13')];this[_0x737a('0x14')]=_0x42a4f7[_0x737a('0x14')];this[_0x737a('0x15')]=_0x42a4f7[_0x737a('0x15')];this[_0x737a('0x16')]=_0x42a4f7[_0x737a('0x16')];this[_0x737a('0x17')]=_0x42a4f7['servicenowAccounts'];this[_0x737a('0x18')]=_0x42a4f7[_0x737a('0x18')];this['freshsalesAccounts']=_0x42a4f7[_0x737a('0x19')];this[_0x737a('0x1a')]={'zendesk':this[_0x737a('0x10')],'salesforce':this[_0x737a('0x12')],'freshdesk':this[_0x737a('0x11')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x737a('0x14')],'desk':this[_0x737a('0x15')],'vtiger':this[_0x737a('0x16')],'dynamics365':this[_0x737a('0x18')],'freshsales':this[_0x737a('0x19')],'servicenow':this[_0x737a('0x17')]};ami['on'](_0x737a('0x1b'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x1e'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x1f'),this[_0x737a('0x1c')]['bind'](this));ami['on'](_0x737a('0x20'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x21'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x22'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on']('custom:agentbusy',this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on']('custom:agentcongestion',this[_0x737a('0x1c')]['bind'](this));ami['on'](_0x737a('0x23'),this['syncCustomEvent'][_0x737a('0x1d')](this));ami['on'](_0x737a('0x24'),this['syncCustomEvent'][_0x737a('0x1d')](this));ami['on'](_0x737a('0x25'),this[_0x737a('0x1c')]['bind'](this));ami['on'](_0x737a('0x26'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0x737a('0x27')][_0x737a('0x1d')](this));ami['on']('custom:dialconnect',this[_0x737a('0x27')]['bind'](this));ami['on'](_0x737a('0x28'),this[_0x737a('0x27')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x29'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x737a('0x1d')](this));ami['on']('custom:substatus',this['syncCustomEvent']['bind'](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x737a('0x1d')](this));ami['on'](_0x737a('0x2a'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x2b'),this[_0x737a('0x1c')][_0x737a('0x1d')](this));ami['on'](_0x737a('0x2c'),this['syncCustomEvent'][_0x737a('0x1d')](this));ami['on']('custom:offlineMessage',this[_0x737a('0x1c')][_0x737a('0x1d')](this));}Trigger[_0x737a('0x2d')][_0x737a('0x2e')]=function(_0x5da6d0,_0xc24947,_0x1f2d46){logger[_0x737a('0x2f')](_0x5da6d0,_0xc24947,JSON[_0x737a('0x30')](_0x1f2d46));io['to'](_0x5da6d0)[_0x737a('0x2e')](_0xc24947,_0x1f2d46);};Trigger[_0x737a('0x2d')]['syncCustomEvent']=function(_0x77a32c){var _0x3474db=_[_0x737a('0x31')](_0x77a32c);if(typeof _0x3474db[_0x737a('0x32')]===_0x737a('0x33')){_0x3474db[_0x737a('0x32')]=_0x737a('0x34');}logger[_0x737a('0x35')](_0x737a('0x1c'),util[_0x737a('0x36')](_0x3474db,{'showHidden':!![],'depth':null}));this[_0x737a('0x37')](_0x3474db);};Trigger[_0x737a('0x2d')][_0x737a('0x27')]=function(_0x1a3b47){if(this[_0x737a('0x38')][_0x1a3b47[_0x737a('0x39')]]){this[_0x737a('0x1c')](_0x1a3b47);}};Trigger[_0x737a('0x2d')][_0x737a('0x37')]=function(_0x59be8f){var _0x35b738;for(var _0x3d2033 in this[_0x737a('0xd')]){if(this[_0x737a('0xd')][_0x737a('0x3a')](_0x3d2033)){if(this[_0x737a('0xd')][_0x3d2033]['status']){_0x35b738=this[_0x737a('0x3b')](this[_0x737a('0xd')][_0x3d2033],_0x59be8f);if(_0x35b738){_[_0x737a('0x3c')](_0x59be8f,_0x59be8f[_0x737a('0x3d')]);for(var _0x1a3960=0x0,_0x3d42cb,_0x3ecf1a,_0x441e53;_0x1a3960<this['triggers'][_0x3d2033][_0x737a('0x3e')][_0x737a('0x3f')];_0x1a3960+=0x1){_0x3d42cb=this[_0x737a('0xd')][_0x3d2033][_0x737a('0x3e')][_0x1a3960];if(this[_0x737a('0x38')][_0x59be8f['interface']]){switch(_0x3d42cb[_0x737a('0x40')]['toLowerCase']()){case'contactmanager':break;case _0x737a('0x41'):case _0x737a('0x42'):var _0x58bc1e={};switch(barAndWebActions[_0x3d42cb[_0x737a('0x43')]]){case _0x737a('0x44'):_0x58bc1e[_0x737a('0x45')]=_0x3d42cb['data2'];_0x58bc1e[_0x737a('0x46')]=this[_0x737a('0x47')][_0x3d42cb['data2']]?Mustache[_0x737a('0x48')](this['templates'][_0x3d42cb['data2']]['html'],_0x59be8f):'template\x20not\x20found';break;case _0x737a('0xc'):_0x58bc1e[_0x737a('0x49')]=this['buildUri'](_0x3d42cb[_0x737a('0x4a')],_0x59be8f,_[_0x737a('0x4b')](_0x3d42cb[_0x737a('0x4c')])?!![]:parseInt(_0x3d42cb[_0x737a('0x4c')],0xa));if(_['isNil'](_0x3d42cb['data4'])){_0x58bc1e['location']='0';}else{_0x58bc1e['uriLocation']=_0x3d42cb[_0x737a('0x4d')];_0x58bc1e[_0x737a('0x4e')]=_[_0x737a('0x4b')](_0x3d42cb[_0x737a('0x4f')])?'800':_0x3d42cb['data5'];_0x58bc1e['windowHeight']=_[_0x737a('0x4b')](_0x3d42cb[_0x737a('0x50')])?_0x737a('0x51'):_0x3d42cb['data6'];}break;case _0x737a('0x52'):_0x58bc1e[_0x737a('0x53')]=_0x3d42cb[_0x737a('0x4a')]?Mustache['render'](_0x3d42cb[_0x737a('0x4a')],_0x59be8f):'';_0x58bc1e[_0x737a('0x54')]=_0x3d42cb[_0x737a('0x4c')]?Mustache[_0x737a('0x48')](_0x3d42cb[_0x737a('0x4c')],_0x59be8f):'';break;}this['emit'](util['format'](_0x737a('0x55'),this[_0x737a('0x38')][_0x59be8f[_0x737a('0x39')]][_0x737a('0x56')]),util['format'](_0x737a('0x57'),_0x3d42cb[_0x737a('0x40')][_0x737a('0x58')](),barAndWebActions[_0x3d42cb[_0x737a('0x43')]]),_[_0x737a('0x3c')](_0x58bc1e,_0x59be8f));break;case'jscripty':this[_0x737a('0x2e')](util[_0x737a('0x59')](_0x737a('0x55'),this['agents'][_0x59be8f[_0x737a('0x39')]][_0x737a('0x56')]),util[_0x737a('0x59')]('trigger:%s',_0x3d42cb[_0x737a('0x40')][_0x737a('0x58')]()),_[_0x737a('0x3c')]({'ProjectId':parseInt(_0x3d42cb[_0x737a('0x43')],0xa)},_0x59be8f));break;default:this[_0x737a('0x2e')](util[_0x737a('0x59')](_0x737a('0x55'),this['agents'][_0x59be8f[_0x737a('0x39')]][_0x737a('0x56')]),util['format'](_0x737a('0x5a'),_0x3d42cb[_0x737a('0x40')]['toLowerCase']()),_[_0x737a('0x3c')]({},_0x3d42cb,_0x59be8f));}}switch(_0x3d42cb[_0x737a('0x40')]['toLowerCase']()){case'contactmanager':cmContact[_0x737a('0x5b')](this[_0x737a('0x38')][_0x59be8f[_0x737a('0x39')]],this[_0x737a('0xd')][_0x3d2033],_0x3d42cb,_0x59be8f);break;case _0x737a('0x5c'):integration[_0x737a('0x5b')](_0x3d42cb,_0x59be8f,this[_0x737a('0x1a')],this['agents'][_0x59be8f['interface']],this[_0x737a('0xe')][_0x59be8f['queue']],this[_0x737a('0xf')][_0x59be8f['routeId']]);break;case _0x737a('0x5d'):urlforward[_0x737a('0x5b')](_0x3d42cb,_0x59be8f);break;case _0x737a('0x5e'):script['exec'](_0x3d42cb,_0x59be8f);break;}}}}}}};Trigger[_0x737a('0x2d')]['buildUri']=function(_0x47a425,_0xd08fd6,_0x12f783){var _0x169192=url[_0x737a('0x5f')](Mustache['render'](_0x47a425,_0xd08fd6),!![]);if(_0x12f783){_['merge'](_0x169192[_0x737a('0x60')],_0xd08fd6);}delete _0x169192[_0x737a('0x61')];var _0x807352=url[_0x737a('0x59')](_0x169192);_0x807352=_0x807352[_0x737a('0x62')](/\/\?/g,'?');return _0x807352;};Trigger['prototype'][_0x737a('0x3b')]=function(_0x14a3f5,_0xcf130){var _0x2a7592=!![];var _0x28072c=!![];var _0x5b7c26=![];if(_0x14a3f5[_0x737a('0x63')]===_0xcf130['motionChannel']){_0x5b7c26=!![];}if(_0x14a3f5[_0x737a('0x64')][_0x737a('0x3f')]){_0x2a7592=_['every'](_0x14a3f5['AllConditions'],this[_0x737a('0x65')](_0xcf130,_0x14a3f5['channel']));}if(_0x14a3f5[_0x737a('0x66')]['length']){_0x28072c=_[_0x737a('0x67')](_0x14a3f5[_0x737a('0x66')],this[_0x737a('0x65')](_0xcf130,_0x14a3f5[_0x737a('0x63')]));}var _0x4c88c7=_0x5b7c26&&_0x2a7592&&_0x28072c;logger[_0x737a('0x35')](_0x737a('0x68'),util[_0x737a('0x36')](_0x14a3f5,{'showHidden':!![],'depth':null}),'evt',util[_0x737a('0x36')](_0xcf130,{'showHidden':!![],'depth':null}),_0x5b7c26,_0x2a7592,_0x28072c);return _0x4c88c7;};Trigger['prototype'][_0x737a('0x65')]=function(_0x3183f5,_0x2b7b36){return function(_0x1701fc){switch(_0x1701fc[_0x737a('0x69')]){case _0x737a('0x6a'):if(_0x3183f5['channel']===_0x2b7b36){if(_0x2b7b36===_0x737a('0x6b')){return _0x3183f5[_0x737a('0x6c')]?operators[_0x1701fc['operator']](Number(_0x1701fc['value']),_0x3183f5[_0x737a('0x6c')]):![];}else{return _0x3183f5[_[_0x737a('0x6d')](_0x2b7b36)+_0x737a('0x6e')]?operators[_0x1701fc[_0x737a('0x6f')]](Number(_0x1701fc['value']),_0x3183f5[_[_0x737a('0x6d')](_0x2b7b36)+_0x737a('0x6e')]):![];}}break;case _0x737a('0x70'):case'message':if(_0x3183f5[_0x737a('0x63')]===_0x2b7b36){return _0x3183f5['event']?operators[_0x1701fc[_0x737a('0x6f')]](_0x1701fc[_0x737a('0x71')],_0x3183f5['event']):![];}break;case'queue':return _0x3183f5[_0x737a('0x72')]?operators[_0x1701fc[_0x737a('0x6f')]](_0x1701fc['value'],_0x3183f5[_0x737a('0x72')]):![];case _0x737a('0x73'):return _0x3183f5[_0x737a('0x74')]?operators[_0x1701fc[_0x737a('0x6f')]](_0x1701fc['value'],_0x3183f5[_0x737a('0x74')]):![];case _0x737a('0x75'):return _0x3183f5[_0x737a('0x75')]?operators[_0x1701fc['operator']](_0x1701fc[_0x737a('0x71')],_0x3183f5['lastevent']):![];case'routeId':return _0x3183f5[_0x737a('0x76')]?operators[_0x1701fc[_0x737a('0x6f')]](_0x1701fc[_0x737a('0x71')],_0x3183f5['routeId']):![];case _0x737a('0x77'):if(_0x1701fc[_0x737a('0x71')]==='null')_0x1701fc[_0x737a('0x71')]=null;return typeof _0x3183f5['substatus']!==_0x737a('0x33')?operators[_0x1701fc[_0x737a('0x6f')]](_0x1701fc['value'],_0x3183f5[_0x737a('0x78')]):![];case _0x737a('0x79'):if(_0x3183f5['channel']===_0x2b7b36){return _0x1701fc[_0x737a('0x71')]===_0x737a('0x7a')&&_0x1701fc[_0x737a('0x6f')]===_0x737a('0x7b')?!![]:![];}break;}return![];};};module[_0x737a('0x7c')]=Trigger;
\ No newline at end of file