Built motion from commit 64a6f4bc.|2.6.26
[motion2.git] / server / services / ami / trigger / index.js
index ac162bd..1c8b7c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4499=['deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','voice','debug','inspect','agents','checkTriggers','status','checkTrigger','merge','variables','Actions','interface','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','data6','winApplication','winArguments','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','exec','integration','urlforward','script','parse','query','search','channel','AllConditions','length','AnyConditions','checkConditions','checkTrigger:\x20trigger','evt','field','chat','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','exports','util','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts'];(function(_0x176c78,_0x5ce076){var _0x54bbce=function(_0x299063){while(--_0x299063){_0x176c78['push'](_0x176c78['shift']());}};_0x54bbce(++_0x5ce076);}(_0x4499,0x6b));var _0x9449=function(_0x1601ad,_0x4e4a92){_0x1601ad=_0x1601ad-0x0;var _0x3973aa=_0x4499[_0x1601ad];return _0x3973aa;};'use strict';var util=require(_0x9449('0x0'));var _=require('lodash');var url=require(_0x9449('0x1'));var Mustache=require(_0x9449('0x2'));var Redis=require(_0x9449('0x3'));var urlforward=require('./urlforward');var integration=require(_0x9449('0x4'));var cmContact=require(_0x9449('0x5'));var script=require(_0x9449('0x6'));var config=require('../../../config/environment');var logger=require(_0x9449('0x7'))(_0x9449('0x8'));var ami=require(_0x9449('0x9'));config[_0x9449('0xa')]=_[_0x9449('0xb')](config[_0x9449('0xa')],{'host':_0x9449('0xc'),'port':0x18eb});var io=require(_0x9449('0xd'))(new Redis(config['redis']));var operators={'equals':function(_0x40ffdf,_0x7432f3){return _0x40ffdf==_0x7432f3;},'not_equals':function(_0xe81ab6,_0x2c8fa2){return _0xe81ab6!=_0x2c8fa2;}};var barAndWebActions=[_0x9449('0xe'),'url',_0x9449('0xf')];function Trigger(_0xb6974b){this[_0x9449('0x10')]=_0xb6974b[_0x9449('0x10')];this['agents']=_0xb6974b['agents'];this[_0x9449('0x11')]=_0xb6974b[_0x9449('0x11')];this[_0x9449('0x12')]=_0xb6974b['templates'];this[_0x9449('0x13')]=_0xb6974b[_0x9449('0x13')];this[_0x9449('0x14')]=_0xb6974b[_0x9449('0x14')];this[_0x9449('0x15')]=_0xb6974b[_0x9449('0x15')];this['salesforceAccounts']=_0xb6974b[_0x9449('0x16')];this[_0x9449('0x17')]=_0xb6974b[_0x9449('0x17')];this[_0x9449('0x18')]=_0xb6974b[_0x9449('0x18')];this[_0x9449('0x19')]=_0xb6974b[_0x9449('0x19')];this[_0x9449('0x1a')]=_0xb6974b[_0x9449('0x1a')];this[_0x9449('0x1b')]=_0xb6974b[_0x9449('0x1b')];this[_0x9449('0x1c')]=_0xb6974b['dynamics365Accounts'];this[_0x9449('0x1d')]=_0xb6974b[_0x9449('0x1d')];this[_0x9449('0x1e')]={'zendesk':this[_0x9449('0x14')],'salesforce':this[_0x9449('0x16')],'freshdesk':this[_0x9449('0x15')],'sugarcrm':this[_0x9449('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0x9449('0x19')],'vtiger':this[_0x9449('0x1a')],'dynamics365':this[_0x9449('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x9449('0x1f')](this));ami['on'](_0x9449('0x20'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x22'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x23'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x24'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on']('custom:agentbusy',this[_0x9449('0x21')]['bind'](this));ami['on'](_0x9449('0x25'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x26'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x27'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x28'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x29'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x2a'),this[_0x9449('0x2b')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x2c'),this[_0x9449('0x2b')][_0x9449('0x1f')](this));ami['on']('custom:dialend',this[_0x9449('0x2b')]['bind'](this));ami['on'](_0x9449('0x2d'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x2e'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x2f'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x30'),this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x9449('0x1f')](this));ami['on'](_0x9449('0x31'),this[_0x9449('0x21')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x9449('0x21')][_0x9449('0x1f')](this));ami['on'](_0x9449('0x32'),this[_0x9449('0x21')][_0x9449('0x1f')](this));}Trigger[_0x9449('0x33')][_0x9449('0x34')]=function(_0x1d11a5,_0x531291,_0x37765f){logger[_0x9449('0x35')](_0x1d11a5,_0x531291,JSON[_0x9449('0x36')](_0x37765f));io['to'](_0x1d11a5)[_0x9449('0x34')](_0x531291,_0x37765f);};Trigger[_0x9449('0x33')][_0x9449('0x21')]=function(_0x4e14ff){var _0x5d0b34=_[_0x9449('0x37')](_0x4e14ff);if(typeof _0x5d0b34[_0x9449('0x38')]===_0x9449('0x39')){_0x5d0b34['motionChannel']=_0x9449('0x3a');}logger[_0x9449('0x3b')](_0x9449('0x21'),util[_0x9449('0x3c')](_0x5d0b34,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x5d0b34);};Trigger[_0x9449('0x33')][_0x9449('0x2b')]=function(_0x28d32e){if(this[_0x9449('0x3d')][_0x28d32e['interface']]){this[_0x9449('0x21')](_0x28d32e);}};Trigger[_0x9449('0x33')][_0x9449('0x3e')]=function(_0x488b8f){var _0x13c741;for(var _0x1e61c3 in this[_0x9449('0x10')]){if(this[_0x9449('0x10')]['hasOwnProperty'](_0x1e61c3)){if(this[_0x9449('0x10')][_0x1e61c3][_0x9449('0x3f')]){_0x13c741=this[_0x9449('0x40')](this['triggers'][_0x1e61c3],_0x488b8f);if(_0x13c741){_[_0x9449('0x41')](_0x488b8f,_0x488b8f[_0x9449('0x42')]);for(var _0x4cf3e4=0x0,_0x3d4e25,_0x7c0246,_0x53ef97;_0x4cf3e4<this[_0x9449('0x10')][_0x1e61c3][_0x9449('0x43')]['length'];_0x4cf3e4+=0x1){_0x3d4e25=this[_0x9449('0x10')][_0x1e61c3][_0x9449('0x43')][_0x4cf3e4];if(this[_0x9449('0x3d')][_0x488b8f[_0x9449('0x44')]]){switch(_0x3d4e25[_0x9449('0x45')][_0x9449('0x46')]()){case _0x9449('0x47'):break;case'motionbar':case _0x9449('0x48'):var _0xed87e9={};switch(barAndWebActions[_0x3d4e25[_0x9449('0x49')]]){case _0x9449('0xe'):_0xed87e9[_0x9449('0x4a')]=_0x3d4e25[_0x9449('0x4b')];_0xed87e9[_0x9449('0x4c')]=this['templates'][_0x3d4e25[_0x9449('0x4b')]]?Mustache[_0x9449('0x4d')](this[_0x9449('0x12')][_0x3d4e25['data2']][_0x9449('0x4c')],_0x488b8f):_0x9449('0x4e');break;case _0x9449('0x1'):_0xed87e9[_0x9449('0x4f')]=this[_0x9449('0x50')](_0x3d4e25['data2'],_0x488b8f,_[_0x9449('0x51')](_0x3d4e25[_0x9449('0x52')])?!![]:parseInt(_0x3d4e25[_0x9449('0x52')],0xa));if(_[_0x9449('0x51')](_0x3d4e25['data4'])){_0xed87e9[_0x9449('0x53')]='0';}else{_0xed87e9[_0x9449('0x54')]=_0x3d4e25[_0x9449('0x55')];_0xed87e9[_0x9449('0x56')]=_[_0x9449('0x51')](_0x3d4e25[_0x9449('0x57')])?_0x9449('0x58'):_0x3d4e25[_0x9449('0x57')];_0xed87e9['windowHeight']=_[_0x9449('0x51')](_0x3d4e25[_0x9449('0x59')])?'600':_0x3d4e25['data6'];}break;case _0x9449('0xf'):_0xed87e9[_0x9449('0x5a')]=_0x3d4e25[_0x9449('0x4b')]?Mustache[_0x9449('0x4d')](_0x3d4e25[_0x9449('0x4b')],_0x488b8f):'';_0xed87e9[_0x9449('0x5b')]=_0x3d4e25['data3']?Mustache[_0x9449('0x4d')](_0x3d4e25[_0x9449('0x52')],_0x488b8f):'';break;}this[_0x9449('0x34')](util[_0x9449('0x5c')](_0x9449('0x5d'),this[_0x9449('0x3d')][_0x488b8f[_0x9449('0x44')]]['name']),util['format'](_0x9449('0x5e'),_0x3d4e25['action'][_0x9449('0x46')](),barAndWebActions[_0x3d4e25['data1']]),_[_0x9449('0x41')](_0xed87e9,_0x488b8f));break;case _0x9449('0x5f'):this[_0x9449('0x34')](util['format'](_0x9449('0x5d'),this[_0x9449('0x3d')][_0x488b8f[_0x9449('0x44')]][_0x9449('0x60')]),util[_0x9449('0x5c')]('trigger:%s',_0x3d4e25[_0x9449('0x45')]['toLowerCase']()),_['merge']({'ProjectId':parseInt(_0x3d4e25['data1'],0xa)},_0x488b8f));break;default:this[_0x9449('0x34')](util[_0x9449('0x5c')](_0x9449('0x5d'),this[_0x9449('0x3d')][_0x488b8f['interface']][_0x9449('0x60')]),util[_0x9449('0x5c')](_0x9449('0x61'),_0x3d4e25['action']['toLowerCase']()),_['merge']({},_0x3d4e25,_0x488b8f));}}switch(_0x3d4e25[_0x9449('0x45')][_0x9449('0x46')]()){case _0x9449('0x47'):cmContact[_0x9449('0x62')](this[_0x9449('0x3d')][_0x488b8f['interface']],this[_0x9449('0x10')][_0x1e61c3],_0x3d4e25,_0x488b8f);break;case _0x9449('0x63'):integration[_0x9449('0x62')](_0x3d4e25,_0x488b8f,this['accounts'],this['agents'][_0x488b8f['interface']],this[_0x9449('0x11')][_0x488b8f['queue']],this['voiceExtensions'][_0x488b8f['routeId']]);break;case _0x9449('0x64'):urlforward[_0x9449('0x62')](_0x3d4e25,_0x488b8f);break;case _0x9449('0x65'):script['exec'](_0x3d4e25,_0x488b8f);break;}}}}}}};Trigger['prototype'][_0x9449('0x50')]=function(_0x2f1f2c,_0x42e97a,_0x254c7b){var _0x404ef2=url[_0x9449('0x66')](Mustache[_0x9449('0x4d')](_0x2f1f2c,_0x42e97a),!![]);if(_0x254c7b){_['merge'](_0x404ef2[_0x9449('0x67')],_0x42e97a);}delete _0x404ef2[_0x9449('0x68')];var _0x419abc=url[_0x9449('0x5c')](_0x404ef2);_0x419abc=_0x419abc['replace'](/\/\?/g,'?');return _0x419abc;};Trigger[_0x9449('0x33')]['checkTrigger']=function(_0x940c58,_0x8fdb55){var _0x5bc3df=!![];var _0x3f8624=!![];var _0x27f4f7=![];if(_0x940c58[_0x9449('0x69')]===_0x8fdb55['motionChannel']){_0x27f4f7=!![];}if(_0x940c58[_0x9449('0x6a')][_0x9449('0x6b')]){_0x5bc3df=_['every'](_0x940c58[_0x9449('0x6a')],this['checkConditions'](_0x8fdb55,_0x940c58[_0x9449('0x69')]));}if(_0x940c58[_0x9449('0x6c')]['length']){_0x3f8624=_['some'](_0x940c58[_0x9449('0x6c')],this[_0x9449('0x6d')](_0x8fdb55,_0x940c58[_0x9449('0x69')]));}var _0x1576f2=_0x27f4f7&&_0x5bc3df&&_0x3f8624;logger['debug'](_0x9449('0x6e'),util[_0x9449('0x3c')](_0x940c58,{'showHidden':!![],'depth':null}),_0x9449('0x6f'),util[_0x9449('0x3c')](_0x8fdb55,{'showHidden':!![],'depth':null}),_0x27f4f7,_0x5bc3df,_0x3f8624);return _0x1576f2;};Trigger[_0x9449('0x33')][_0x9449('0x6d')]=function(_0x18e296,_0x2aa990){return function(_0x3f9e0e){switch(_0x3f9e0e[_0x9449('0x70')]){case'account':if(_0x18e296['channel']===_0x2aa990){if(_0x2aa990===_0x9449('0x71')){return _0x18e296['ChatWebsiteId']?operators[_0x3f9e0e[_0x9449('0x72')]](Number(_0x3f9e0e[_0x9449('0x73')]),_0x18e296['ChatWebsiteId']):![];}else{return _0x18e296[_[_0x9449('0x74')](_0x2aa990)+_0x9449('0x75')]?operators[_0x3f9e0e[_0x9449('0x72')]](Number(_0x3f9e0e[_0x9449('0x73')]),_0x18e296[_[_0x9449('0x74')](_0x2aa990)+'AccountId']):![];}}break;case _0x9449('0x76'):case _0x9449('0x77'):if(_0x18e296[_0x9449('0x69')]===_0x2aa990){return _0x18e296[_0x9449('0x78')]?operators[_0x3f9e0e[_0x9449('0x72')]](_0x3f9e0e[_0x9449('0x73')],_0x18e296[_0x9449('0x78')]):![];}break;case _0x9449('0x79'):return _0x18e296[_0x9449('0x79')]?operators[_0x3f9e0e[_0x9449('0x72')]](_0x3f9e0e[_0x9449('0x73')],_0x18e296[_0x9449('0x79')]):![];case _0x9449('0x7a'):return _0x18e296[_0x9449('0x7b')]?operators[_0x3f9e0e[_0x9449('0x72')]](_0x3f9e0e[_0x9449('0x73')],_0x18e296['membername']):![];case _0x9449('0x7c'):return _0x18e296[_0x9449('0x7c')]?operators[_0x3f9e0e[_0x9449('0x72')]](_0x3f9e0e['value'],_0x18e296[_0x9449('0x7c')]):![];case'routeId':return _0x18e296[_0x9449('0x7d')]?operators[_0x3f9e0e['operator']](_0x3f9e0e['value'],_0x18e296[_0x9449('0x7d')]):![];case _0x9449('0x7e'):if(_0x3f9e0e[_0x9449('0x73')]===_0x9449('0x7f'))_0x3f9e0e[_0x9449('0x73')]=null;return typeof _0x18e296['substatus']!==_0x9449('0x39')?operators[_0x3f9e0e[_0x9449('0x72')]](_0x3f9e0e[_0x9449('0x73')],_0x18e296[_0x9449('0x80')]):![];case _0x9449('0x81'):if(_0x18e296[_0x9449('0x69')]===_0x2aa990){return _0x3f9e0e[_0x9449('0x73')]===_0x9449('0x82')&&_0x3f9e0e[_0x9449('0x72')]==='equals'?!![]:![];}break;}return![];};};module[_0x9449('0x83')]=Trigger;
\ No newline at end of file
+var _0x42f0=['custom:agentnoanswer','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','emit','info','stringify','clone','motionChannel','voice','debug','inspect','checkTriggers','prototype','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','agents','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','render','html','uri','isNil','data3','data4','location','data5','windowHeight','data6','winapp','winArguments','format','user:%s','name','jscripty','trigger:%s','exec','voiceQueues','routeId','script','buildUri','parse','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','lastevent','null','substatus','undefined','offlineMessage','created','equals','exports','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/logger','trigger','../ami','redis','localhost','popup','triggers','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber'];(function(_0x5ed3de,_0x24b412){var _0x28f740=function(_0x214f58){while(--_0x214f58){_0x5ed3de['push'](_0x5ed3de['shift']());}};_0x28f740(++_0x24b412);}(_0x42f0,0xdb));var _0x042f=function(_0x16356f,_0x2e0b87){_0x16356f=_0x16356f-0x0;var _0x4995b8=_0x42f0[_0x16356f];return _0x4995b8;};'use strict';var util=require('util');var _=require(_0x042f('0x0'));var url=require(_0x042f('0x1'));var Mustache=require('mustache');var Redis=require(_0x042f('0x2'));var urlforward=require(_0x042f('0x3'));var integration=require('./integration');var cmContact=require(_0x042f('0x4'));var script=require(_0x042f('0x5'));var config=require('../../../config/environment');var logger=require(_0x042f('0x6'))(_0x042f('0x7'));var ami=require(_0x042f('0x8'));config[_0x042f('0x9')]=_['defaults'](config['redis'],{'host':_0x042f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x042f('0x9')]));var operators={'equals':function(_0x40af5b,_0x16f5f4){return _0x40af5b==_0x16f5f4;},'not_equals':function(_0x1970f0,_0x68002b){return _0x1970f0!=_0x68002b;}};var barAndWebActions=[_0x042f('0xb'),_0x042f('0x1'),'winapp'];function Trigger(_0xeb1c1c){this[_0x042f('0xc')]=_0xeb1c1c[_0x042f('0xc')];this['agents']=_0xeb1c1c['agents'];this['voiceQueues']=_0xeb1c1c['voiceQueues'];this[_0x042f('0xd')]=_0xeb1c1c[_0x042f('0xd')];this['voiceExtensions']=_0xeb1c1c[_0x042f('0xe')];this[_0x042f('0xf')]=_0xeb1c1c['zendeskAccounts'];this[_0x042f('0x10')]=_0xeb1c1c[_0x042f('0x10')];this[_0x042f('0x11')]=_0xeb1c1c[_0x042f('0x11')];this[_0x042f('0x12')]=_0xeb1c1c[_0x042f('0x12')];this['zohoAccounts']=_0xeb1c1c[_0x042f('0x13')];this[_0x042f('0x14')]=_0xeb1c1c['deskAccounts'];this[_0x042f('0x15')]=_0xeb1c1c['vtigerAccounts'];this[_0x042f('0x16')]=_0xeb1c1c[_0x042f('0x16')];this[_0x042f('0x17')]=_0xeb1c1c[_0x042f('0x17')];this['freshsalesAccounts']=_0xeb1c1c[_0x042f('0x18')];this[_0x042f('0x19')]={'zendesk':this[_0x042f('0xf')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x042f('0x10')],'sugarcrm':this[_0x042f('0x12')],'zoho':this[_0x042f('0x13')],'desk':this[_0x042f('0x14')],'vtiger':this[_0x042f('0x15')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x042f('0x18')],'servicenow':this[_0x042f('0x16')]};ami['on'](_0x042f('0x1a'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x1d'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x1e'),this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x1f'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x20'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x21'),this[_0x042f('0x1b')]['bind'](this));ami['on']('custom:agentbusy',this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on']('custom:agentcongestion',this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x22'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x23'),this['syncCustomEvent'][_0x042f('0x1c')](this));ami['on'](_0x042f('0x24'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x25'),this[_0x042f('0x1b')]['bind'](this));ami['on']('custom:dialbegin',this[_0x042f('0x26')]['bind'](this));ami['on'](_0x042f('0x27'),this[_0x042f('0x26')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0x042f('0x29'),this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x2a'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x2b'),this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x2c'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on'](_0x042f('0x2d'),this[_0x042f('0x1b')][_0x042f('0x1c')](this));ami['on']('custom:acceptmessage',this[_0x042f('0x1b')]['bind'](this));ami['on'](_0x042f('0x2e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:offlineMessage',this[_0x042f('0x1b')]['bind'](this));}Trigger['prototype'][_0x042f('0x2f')]=function(_0x194028,_0x280984,_0x4c48d2){logger[_0x042f('0x30')](_0x194028,_0x280984,JSON[_0x042f('0x31')](_0x4c48d2));io['to'](_0x194028)[_0x042f('0x2f')](_0x280984,_0x4c48d2);};Trigger['prototype'][_0x042f('0x1b')]=function(_0x963790){var _0x92ee91=_[_0x042f('0x32')](_0x963790);if(typeof _0x92ee91[_0x042f('0x33')]==='undefined'){_0x92ee91[_0x042f('0x33')]=_0x042f('0x34');}logger[_0x042f('0x35')]('syncCustomEvent',util[_0x042f('0x36')](_0x92ee91,{'showHidden':!![],'depth':null}));this[_0x042f('0x37')](_0x92ee91);};Trigger[_0x042f('0x38')]['syncAgentDial']=function(_0x5023d5){if(this['agents'][_0x5023d5[_0x042f('0x39')]]){this[_0x042f('0x1b')](_0x5023d5);}};Trigger[_0x042f('0x38')][_0x042f('0x37')]=function(_0x135d68){var _0x25dbd7;for(var _0x4e3be1 in this[_0x042f('0xc')]){if(this['triggers'][_0x042f('0x3a')](_0x4e3be1)){if(this['triggers'][_0x4e3be1][_0x042f('0x3b')]){_0x25dbd7=this[_0x042f('0x3c')](this[_0x042f('0xc')][_0x4e3be1],_0x135d68);if(_0x25dbd7){_[_0x042f('0x3d')](_0x135d68,_0x135d68[_0x042f('0x3e')]);for(var _0x43ba0b=0x0,_0x37400f,_0x2e1769,_0x36610c;_0x43ba0b<this['triggers'][_0x4e3be1][_0x042f('0x3f')][_0x042f('0x40')];_0x43ba0b+=0x1){_0x37400f=this['triggers'][_0x4e3be1]['Actions'][_0x43ba0b];if(this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]]){switch(_0x37400f[_0x042f('0x42')][_0x042f('0x43')]()){case _0x042f('0x44'):break;case'motionbar':case _0x042f('0x45'):var _0x276110={};switch(barAndWebActions[_0x37400f[_0x042f('0x46')]]){case'popup':_0x276110[_0x042f('0x47')]=_0x37400f[_0x042f('0x48')];_0x276110['html']=this['templates'][_0x37400f[_0x042f('0x48')]]?Mustache[_0x042f('0x49')](this[_0x042f('0xd')][_0x37400f[_0x042f('0x48')]][_0x042f('0x4a')],_0x135d68):'template\x20not\x20found';break;case _0x042f('0x1'):_0x276110[_0x042f('0x4b')]=this['buildUri'](_0x37400f['data2'],_0x135d68,_[_0x042f('0x4c')](_0x37400f[_0x042f('0x4d')])?!![]:parseInt(_0x37400f[_0x042f('0x4d')],0xa));if(_[_0x042f('0x4c')](_0x37400f[_0x042f('0x4e')])){_0x276110[_0x042f('0x4f')]='0';}else{_0x276110['uriLocation']=_0x37400f['data4'];_0x276110['windowWidth']=_[_0x042f('0x4c')](_0x37400f[_0x042f('0x50')])?'800':_0x37400f['data5'];_0x276110[_0x042f('0x51')]=_[_0x042f('0x4c')](_0x37400f['data6'])?'600':_0x37400f[_0x042f('0x52')];}break;case _0x042f('0x53'):_0x276110['winApplication']=_0x37400f[_0x042f('0x48')]?Mustache[_0x042f('0x49')](_0x37400f[_0x042f('0x48')],_0x135d68):'';_0x276110[_0x042f('0x54')]=_0x37400f[_0x042f('0x4d')]?Mustache[_0x042f('0x49')](_0x37400f[_0x042f('0x4d')],_0x135d68):'';break;}this[_0x042f('0x2f')](util[_0x042f('0x55')](_0x042f('0x56'),this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]][_0x042f('0x57')]),util[_0x042f('0x55')]('trigger:%s:%s',_0x37400f[_0x042f('0x42')][_0x042f('0x43')](),barAndWebActions[_0x37400f['data1']]),_['merge'](_0x276110,_0x135d68));break;case _0x042f('0x58'):this[_0x042f('0x2f')](util['format'](_0x042f('0x56'),this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]][_0x042f('0x57')]),util[_0x042f('0x55')](_0x042f('0x59'),_0x37400f['action'][_0x042f('0x43')]()),_[_0x042f('0x3d')]({'ProjectId':parseInt(_0x37400f[_0x042f('0x46')],0xa)},_0x135d68));break;default:this[_0x042f('0x2f')](util['format']('user:%s',this['agents'][_0x135d68[_0x042f('0x39')]][_0x042f('0x57')]),util['format']('trigger:%s',_0x37400f[_0x042f('0x42')][_0x042f('0x43')]()),_['merge']({},_0x37400f,_0x135d68));}}switch(_0x37400f[_0x042f('0x42')][_0x042f('0x43')]()){case _0x042f('0x44'):cmContact['exec'](this[_0x042f('0x41')][_0x135d68[_0x042f('0x39')]],this['triggers'][_0x4e3be1],_0x37400f,_0x135d68);break;case'integration':integration[_0x042f('0x5a')](_0x37400f,_0x135d68,this['accounts'],this['agents'][_0x135d68[_0x042f('0x39')]],this[_0x042f('0x5b')][_0x135d68['queue']],this[_0x042f('0xe')][_0x135d68[_0x042f('0x5c')]]);break;case'urlforward':urlforward['exec'](_0x37400f,_0x135d68);break;case _0x042f('0x5d'):script[_0x042f('0x5a')](_0x37400f,_0x135d68);break;}}}}}}};Trigger[_0x042f('0x38')][_0x042f('0x5e')]=function(_0x40e9c7,_0x8bbbc6,_0x157c1e){var _0x2cc3f5=url[_0x042f('0x5f')](Mustache['render'](_0x40e9c7,_0x8bbbc6),!![]);if(_0x157c1e){_[_0x042f('0x3d')](_0x2cc3f5[_0x042f('0x60')],_0x8bbbc6);}delete _0x2cc3f5[_0x042f('0x61')];var _0x55ed00=url[_0x042f('0x55')](_0x2cc3f5);_0x55ed00=_0x55ed00[_0x042f('0x62')](/\/\?/g,'?');return _0x55ed00;};Trigger[_0x042f('0x38')][_0x042f('0x3c')]=function(_0x1cda1e,_0x199ed9){var _0x541d21=!![];var _0xb0447f=!![];var _0x376206=![];if(_0x1cda1e[_0x042f('0x63')]===_0x199ed9['motionChannel']){_0x376206=!![];}if(_0x1cda1e['AllConditions'][_0x042f('0x40')]){_0x541d21=_[_0x042f('0x64')](_0x1cda1e[_0x042f('0x65')],this[_0x042f('0x66')](_0x199ed9,_0x1cda1e[_0x042f('0x63')]));}if(_0x1cda1e[_0x042f('0x67')]['length']){_0xb0447f=_['some'](_0x1cda1e['AnyConditions'],this[_0x042f('0x66')](_0x199ed9,_0x1cda1e[_0x042f('0x63')]));}var _0x345b88=_0x376206&&_0x541d21&&_0xb0447f;logger[_0x042f('0x35')]('checkTrigger:\x20trigger',util[_0x042f('0x36')](_0x1cda1e,{'showHidden':!![],'depth':null}),_0x042f('0x68'),util[_0x042f('0x36')](_0x199ed9,{'showHidden':!![],'depth':null}),_0x376206,_0x541d21,_0xb0447f);return _0x345b88;};Trigger[_0x042f('0x38')][_0x042f('0x66')]=function(_0x56c897,_0x3cc521){return function(_0x3be087){switch(_0x3be087[_0x042f('0x69')]){case _0x042f('0x6a'):if(_0x56c897['channel']===_0x3cc521){if(_0x3cc521===_0x042f('0x6b')){return _0x56c897[_0x042f('0x6c')]?operators[_0x3be087[_0x042f('0x6d')]](Number(_0x3be087[_0x042f('0x6e')]),_0x56c897[_0x042f('0x6c')]):![];}else{return _0x56c897[_[_0x042f('0x6f')](_0x3cc521)+_0x042f('0x70')]?operators[_0x3be087[_0x042f('0x6d')]](Number(_0x3be087[_0x042f('0x6e')]),_0x56c897[_['upperFirst'](_0x3cc521)+_0x042f('0x70')]):![];}}break;case _0x042f('0x71'):case _0x042f('0x72'):if(_0x56c897['channel']===_0x3cc521){return _0x56c897[_0x042f('0x73')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897[_0x042f('0x73')]):![];}break;case'queue':return _0x56c897[_0x042f('0x74')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897[_0x042f('0x74')]):![];case _0x042f('0x75'):return _0x56c897['membername']?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087['value'],_0x56c897['membername']):![];case'lastevent':return _0x56c897[_0x042f('0x76')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897['lastevent']):![];case'routeId':return _0x56c897[_0x042f('0x5c')]?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087['value'],_0x56c897[_0x042f('0x5c')]):![];case'mailSubstatus':if(_0x3be087[_0x042f('0x6e')]===_0x042f('0x77'))_0x3be087[_0x042f('0x6e')]=null;return typeof _0x56c897[_0x042f('0x78')]!==_0x042f('0x79')?operators[_0x3be087[_0x042f('0x6d')]](_0x3be087[_0x042f('0x6e')],_0x56c897[_0x042f('0x78')]):![];case _0x042f('0x7a'):if(_0x56c897[_0x042f('0x63')]===_0x3cc521){return _0x3be087[_0x042f('0x6e')]===_0x042f('0x7b')&&_0x3be087['operator']===_0x042f('0x7c')?!![]:![];}break;}return![];};};module[_0x042f('0x7d')]=Trigger;
\ No newline at end of file