Built motion from commit 511216ff.|2.6.34
[motion2.git] / server / services / ami / trigger / index.js
index 64f9775..5f2122b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1989=['custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','debug','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','Actions','length','action','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','location','windowWidth','data5','windowHeight','data6','winArguments','user:%s','name','trigger:%s:%s','jscripty','format','toLowerCase','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','query','channel','AllConditions','every','AnyConditions','some','checkConditions','inspect','evt','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','substatus','offlineMessage','created','equals','exports','url','mustache','./urlforward','./integration','./script','../../../config/logger','trigger','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:closedinteraction','custom:substatus'];(function(_0x42e854,_0x397d0e){var _0x3c2b92=function(_0x2e0aac){while(--_0x2e0aac){_0x42e854['push'](_0x42e854['shift']());}};_0x3c2b92(++_0x397d0e);}(_0x1989,0x149));var _0x9198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1989[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x9198('0x0'));var Mustache=require(_0x9198('0x1'));var Redis=require('ioredis');var urlforward=require(_0x9198('0x2'));var integration=require(_0x9198('0x3'));var cmContact=require('./cmContact');var script=require(_0x9198('0x4'));var config=require('../../../config/environment');var logger=require(_0x9198('0x5'))(_0x9198('0x6'));var ami=require('../ami');config[_0x9198('0x7')]=_[_0x9198('0x8')](config[_0x9198('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9198('0x9'))(new Redis(config[_0x9198('0x7')]));var operators={'equals':function(_0xf7d7ba,_0x283243){return _0xf7d7ba==_0x283243;},'not_equals':function(_0x150e2a,_0x580fec){return _0x150e2a!=_0x580fec;}};var barAndWebActions=[_0x9198('0xa'),'url',_0x9198('0xb')];function Trigger(_0xe7f4a1){this['triggers']=_0xe7f4a1[_0x9198('0xc')];this[_0x9198('0xd')]=_0xe7f4a1[_0x9198('0xd')];this['voiceQueues']=_0xe7f4a1[_0x9198('0xe')];this[_0x9198('0xf')]=_0xe7f4a1[_0x9198('0xf')];this['voiceExtensions']=_0xe7f4a1[_0x9198('0x10')];this[_0x9198('0x11')]=_0xe7f4a1['zendeskAccounts'];this[_0x9198('0x12')]=_0xe7f4a1[_0x9198('0x12')];this[_0x9198('0x13')]=_0xe7f4a1[_0x9198('0x13')];this[_0x9198('0x14')]=_0xe7f4a1[_0x9198('0x14')];this['zohoAccounts']=_0xe7f4a1[_0x9198('0x15')];this[_0x9198('0x16')]=_0xe7f4a1[_0x9198('0x16')];this[_0x9198('0x17')]=_0xe7f4a1[_0x9198('0x17')];this[_0x9198('0x18')]=_0xe7f4a1['servicenowAccounts'];this[_0x9198('0x19')]=_0xe7f4a1[_0x9198('0x19')];this[_0x9198('0x1a')]=_0xe7f4a1[_0x9198('0x1a')];this[_0x9198('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x9198('0x13')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x9198('0x14')],'zoho':this[_0x9198('0x15')],'desk':this[_0x9198('0x16')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x9198('0x19')],'freshsales':this[_0x9198('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0x9198('0x1c'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x1f'),this[_0x9198('0x1d')]['bind'](this));ami['on'](_0x9198('0x20'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on']('custom:agentcomplete',this[_0x9198('0x1d')]['bind'](this));ami['on'](_0x9198('0x21'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x22'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x23'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on']('custom:agentcongestion',this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x24'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on']('custom:amd',this[_0x9198('0x1d')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x25'),this['syncCustomEvent'][_0x9198('0x1e')](this));ami['on'](_0x9198('0x26'),this['syncAgentDial'][_0x9198('0x1e')](this));ami['on'](_0x9198('0x27'),this['syncAgentDial'][_0x9198('0x1e')](this));ami['on']('custom:dialend',this[_0x9198('0x28')][_0x9198('0x1e')](this));ami['on']('custom:newinteraction',this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x29'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9198('0x2a'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x2b'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x2c'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9198('0x2d'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x2e'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));ami['on'](_0x9198('0x2f'),this[_0x9198('0x1d')][_0x9198('0x1e')](this));}Trigger[_0x9198('0x30')][_0x9198('0x31')]=function(_0x482fb3,_0x4ed541,_0x133cf8){logger['info'](_0x482fb3,_0x4ed541,JSON[_0x9198('0x32')](_0x133cf8));io['to'](_0x482fb3)[_0x9198('0x31')](_0x4ed541,_0x133cf8);};Trigger[_0x9198('0x30')][_0x9198('0x1d')]=function(_0x4248ce){var _0x556ef4=_[_0x9198('0x33')](_0x4248ce);if(typeof _0x556ef4[_0x9198('0x34')]===_0x9198('0x35')){_0x556ef4['motionChannel']=_0x9198('0x36');}logger[_0x9198('0x37')]('syncCustomEvent',util['inspect'](_0x556ef4,{'showHidden':!![],'depth':null}));this[_0x9198('0x38')](_0x556ef4);};Trigger['prototype'][_0x9198('0x28')]=function(_0x1efac3){if(this[_0x9198('0xd')][_0x1efac3[_0x9198('0x39')]]){this[_0x9198('0x1d')](_0x1efac3);}};Trigger[_0x9198('0x30')][_0x9198('0x38')]=function(_0x230a79){var _0x54a82e;for(var _0x348c2c in this[_0x9198('0xc')]){if(this['triggers'][_0x9198('0x3a')](_0x348c2c)){if(this[_0x9198('0xc')][_0x348c2c]['status']){_0x54a82e=this[_0x9198('0x3b')](this[_0x9198('0xc')][_0x348c2c],_0x230a79);if(_0x54a82e){_[_0x9198('0x3c')](_0x230a79,_0x230a79['variables']);for(var _0x3519b7=0x0,_0x573ef0,_0x8e006a,_0x5042cb;_0x3519b7<this[_0x9198('0xc')][_0x348c2c][_0x9198('0x3d')][_0x9198('0x3e')];_0x3519b7+=0x1){_0x573ef0=this['triggers'][_0x348c2c][_0x9198('0x3d')][_0x3519b7];if(this[_0x9198('0xd')][_0x230a79['interface']]){switch(_0x573ef0[_0x9198('0x3f')]['toLowerCase']()){case _0x9198('0x40'):break;case _0x9198('0x41'):case _0x9198('0x42'):var _0x2da9c0={};switch(barAndWebActions[_0x573ef0[_0x9198('0x43')]]){case'popup':_0x2da9c0[_0x9198('0x44')]=_0x573ef0[_0x9198('0x45')];_0x2da9c0[_0x9198('0x46')]=this[_0x9198('0xf')][_0x573ef0[_0x9198('0x45')]]?Mustache[_0x9198('0x47')](this[_0x9198('0xf')][_0x573ef0[_0x9198('0x45')]][_0x9198('0x46')],_0x230a79):_0x9198('0x48');break;case _0x9198('0x0'):_0x2da9c0[_0x9198('0x49')]=this['buildUri'](_0x573ef0[_0x9198('0x45')],_0x230a79,_[_0x9198('0x4a')](_0x573ef0[_0x9198('0x4b')])?!![]:parseInt(_0x573ef0[_0x9198('0x4b')],0xa));if(_[_0x9198('0x4a')](_0x573ef0[_0x9198('0x4c')])){_0x2da9c0[_0x9198('0x4d')]='0';}else{_0x2da9c0['uriLocation']=_0x573ef0[_0x9198('0x4c')];_0x2da9c0[_0x9198('0x4e')]=_[_0x9198('0x4a')](_0x573ef0['data5'])?'800':_0x573ef0[_0x9198('0x4f')];_0x2da9c0[_0x9198('0x50')]=_[_0x9198('0x4a')](_0x573ef0['data6'])?'600':_0x573ef0[_0x9198('0x51')];}break;case _0x9198('0xb'):_0x2da9c0['winApplication']=_0x573ef0[_0x9198('0x45')]?Mustache[_0x9198('0x47')](_0x573ef0[_0x9198('0x45')],_0x230a79):'';_0x2da9c0[_0x9198('0x52')]=_0x573ef0[_0x9198('0x4b')]?Mustache[_0x9198('0x47')](_0x573ef0['data3'],_0x230a79):'';break;}this[_0x9198('0x31')](util['format'](_0x9198('0x53'),this['agents'][_0x230a79[_0x9198('0x39')]][_0x9198('0x54')]),util['format'](_0x9198('0x55'),_0x573ef0[_0x9198('0x3f')]['toLowerCase'](),barAndWebActions[_0x573ef0[_0x9198('0x43')]]),_[_0x9198('0x3c')](_0x2da9c0,_0x230a79));break;case _0x9198('0x56'):this[_0x9198('0x31')](util[_0x9198('0x57')]('user:%s',this[_0x9198('0xd')][_0x230a79['interface']][_0x9198('0x54')]),util[_0x9198('0x57')]('trigger:%s',_0x573ef0[_0x9198('0x3f')][_0x9198('0x58')]()),_[_0x9198('0x3c')]({'ProjectId':parseInt(_0x573ef0[_0x9198('0x43')],0xa)},_0x230a79));break;default:this[_0x9198('0x31')](util[_0x9198('0x57')](_0x9198('0x53'),this[_0x9198('0xd')][_0x230a79[_0x9198('0x39')]][_0x9198('0x54')]),util[_0x9198('0x57')](_0x9198('0x59'),_0x573ef0[_0x9198('0x3f')]['toLowerCase']()),_[_0x9198('0x3c')]({},_0x573ef0,_0x230a79));}}switch(_0x573ef0[_0x9198('0x3f')][_0x9198('0x58')]()){case _0x9198('0x40'):cmContact[_0x9198('0x5a')](this[_0x9198('0xd')][_0x230a79[_0x9198('0x39')]],this[_0x9198('0xc')][_0x348c2c],_0x573ef0,_0x230a79);break;case _0x9198('0x5b'):integration[_0x9198('0x5a')](_0x573ef0,_0x230a79,this[_0x9198('0x1b')],this[_0x9198('0xd')][_0x230a79[_0x9198('0x39')]],this[_0x9198('0xe')][_0x230a79[_0x9198('0x5c')]],this[_0x9198('0x10')][_0x230a79[_0x9198('0x5d')]]);break;case _0x9198('0x5e'):urlforward[_0x9198('0x5a')](_0x573ef0,_0x230a79);break;case _0x9198('0x5f'):script[_0x9198('0x5a')](_0x573ef0,_0x230a79);break;}}}}}}};Trigger['prototype'][_0x9198('0x60')]=function(_0x53a79e,_0x3c06d8,_0x50bcf6){var _0x2f8f7b=url['parse'](Mustache[_0x9198('0x47')](_0x53a79e,_0x3c06d8),!![]);if(_0x50bcf6){_['merge'](_0x2f8f7b[_0x9198('0x61')],_0x3c06d8);}delete _0x2f8f7b['search'];var _0x32ac2a=url[_0x9198('0x57')](_0x2f8f7b);_0x32ac2a=_0x32ac2a['replace'](/\/\?/g,'?');return _0x32ac2a;};Trigger[_0x9198('0x30')]['checkTrigger']=function(_0x2e33f6,_0x162726){var _0x5d3685=!![];var _0x563923=!![];var _0x136b88=![];if(_0x2e33f6[_0x9198('0x62')]===_0x162726[_0x9198('0x34')]){_0x136b88=!![];}if(_0x2e33f6[_0x9198('0x63')][_0x9198('0x3e')]){_0x5d3685=_[_0x9198('0x64')](_0x2e33f6[_0x9198('0x63')],this['checkConditions'](_0x162726,_0x2e33f6[_0x9198('0x62')]));}if(_0x2e33f6[_0x9198('0x65')][_0x9198('0x3e')]){_0x563923=_[_0x9198('0x66')](_0x2e33f6[_0x9198('0x65')],this[_0x9198('0x67')](_0x162726,_0x2e33f6['channel']));}var _0x3d493b=_0x136b88&&_0x5d3685&&_0x563923;logger[_0x9198('0x37')]('checkTrigger:\x20trigger',util[_0x9198('0x68')](_0x2e33f6,{'showHidden':!![],'depth':null}),_0x9198('0x69'),util[_0x9198('0x68')](_0x162726,{'showHidden':!![],'depth':null}),_0x136b88,_0x5d3685,_0x563923);return _0x3d493b;};Trigger[_0x9198('0x30')][_0x9198('0x67')]=function(_0x21c985,_0x474faa){return function(_0x1a1b5d){switch(_0x1a1b5d[_0x9198('0x6a')]){case'account':if(_0x21c985[_0x9198('0x62')]===_0x474faa){if(_0x474faa===_0x9198('0x6b')){return _0x21c985[_0x9198('0x6c')]?operators[_0x1a1b5d[_0x9198('0x6d')]](Number(_0x1a1b5d[_0x9198('0x6e')]),_0x21c985[_0x9198('0x6c')]):![];}else{return _0x21c985[_[_0x9198('0x6f')](_0x474faa)+_0x9198('0x70')]?operators[_0x1a1b5d['operator']](Number(_0x1a1b5d[_0x9198('0x6e')]),_0x21c985[_['upperFirst'](_0x474faa)+_0x9198('0x70')]):![];}}break;case _0x9198('0x71'):case _0x9198('0x72'):if(_0x21c985[_0x9198('0x62')]===_0x474faa){return _0x21c985[_0x9198('0x73')]?operators[_0x1a1b5d[_0x9198('0x6d')]](_0x1a1b5d[_0x9198('0x6e')],_0x21c985[_0x9198('0x73')]):![];}break;case'queue':return _0x21c985[_0x9198('0x5c')]?operators[_0x1a1b5d[_0x9198('0x6d')]](_0x1a1b5d[_0x9198('0x6e')],_0x21c985[_0x9198('0x5c')]):![];case _0x9198('0x74'):return _0x21c985[_0x9198('0x75')]?operators[_0x1a1b5d['operator']](_0x1a1b5d[_0x9198('0x6e')],_0x21c985['membername']):![];case _0x9198('0x76'):return _0x21c985[_0x9198('0x76')]?operators[_0x1a1b5d[_0x9198('0x6d')]](_0x1a1b5d[_0x9198('0x6e')],_0x21c985[_0x9198('0x76')]):![];case'routeId':return _0x21c985['routeId']?operators[_0x1a1b5d[_0x9198('0x6d')]](_0x1a1b5d[_0x9198('0x6e')],_0x21c985['routeId']):![];case'mailSubstatus':if(_0x1a1b5d['value']==='null')_0x1a1b5d[_0x9198('0x6e')]=null;return typeof _0x21c985[_0x9198('0x77')]!==_0x9198('0x35')?operators[_0x1a1b5d['operator']](_0x1a1b5d[_0x9198('0x6e')],_0x21c985[_0x9198('0x77')]):![];case _0x9198('0x78'):if(_0x21c985[_0x9198('0x62')]===_0x474faa){return _0x1a1b5d['value']===_0x9198('0x79')&&_0x1a1b5d[_0x9198('0x6d')]===_0x9198('0x7a')?!![]:![];}break;}return![];};};module[_0x9198('0x7b')]=Trigger;
\ No newline at end of file
+var _0x165f=['winApplication','winArguments','format','user:%s','jscripty','trigger:%s','toLowerCase','name','exec','integration','queue','voiceExtensions','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','AnyConditions','checkConditions','checkTrigger:\x20trigger','inspect','evt','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','event','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','exports','util','lodash','url','mustache','ioredis','./cmContact','./script','../../../config/environment','../../../config/logger','redis','defaults','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','debug','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','windowWidth','data5','800','windowHeight','data6','600'];(function(_0x22eca5,_0x3fa0e5){var _0x384d73=function(_0x139588){while(--_0x139588){_0x22eca5['push'](_0x22eca5['shift']());}};_0x384d73(++_0x3fa0e5);}(_0x165f,0x12a));var _0xf165=function(_0xa028b8,_0xce3ed){_0xa028b8=_0xa028b8-0x0;var _0x1ed82e=_0x165f[_0xa028b8];return _0x1ed82e;};'use strict';var util=require(_0xf165('0x0'));var _=require(_0xf165('0x1'));var url=require(_0xf165('0x2'));var Mustache=require(_0xf165('0x3'));var Redis=require(_0xf165('0x4'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xf165('0x5'));var script=require(_0xf165('0x6'));var config=require(_0xf165('0x7'));var logger=require(_0xf165('0x8'))('trigger');var ami=require('../ami');config[_0xf165('0x9')]=_[_0xf165('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf165('0x9')]));var operators={'equals':function(_0x5f120f,_0x2274ee){return _0x5f120f==_0x2274ee;},'not_equals':function(_0x72e527,_0x3dfd73){return _0x72e527!=_0x3dfd73;}};var barAndWebActions=[_0xf165('0xb'),_0xf165('0x2'),_0xf165('0xc')];function Trigger(_0x2184ef){this['triggers']=_0x2184ef[_0xf165('0xd')];this[_0xf165('0xe')]=_0x2184ef['agents'];this['voiceQueues']=_0x2184ef[_0xf165('0xf')];this[_0xf165('0x10')]=_0x2184ef['templates'];this['voiceExtensions']=_0x2184ef['voiceExtensions'];this[_0xf165('0x11')]=_0x2184ef[_0xf165('0x11')];this[_0xf165('0x12')]=_0x2184ef[_0xf165('0x12')];this[_0xf165('0x13')]=_0x2184ef[_0xf165('0x13')];this[_0xf165('0x14')]=_0x2184ef[_0xf165('0x14')];this[_0xf165('0x15')]=_0x2184ef['zohoAccounts'];this['deskAccounts']=_0x2184ef['deskAccounts'];this[_0xf165('0x16')]=_0x2184ef['vtigerAccounts'];this[_0xf165('0x17')]=_0x2184ef[_0xf165('0x17')];this[_0xf165('0x18')]=_0x2184ef[_0xf165('0x18')];this[_0xf165('0x19')]=_0x2184ef['freshsalesAccounts'];this[_0xf165('0x1a')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xf165('0x13')],'freshdesk':this[_0xf165('0x12')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xf165('0x15')],'desk':this[_0xf165('0x1b')],'vtiger':this[_0xf165('0x16')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xf165('0x19')],'servicenow':this[_0xf165('0x17')]};ami['on'](_0xf165('0x1c'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x1f'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x20'),this['syncCustomEvent'][_0xf165('0x1e')](this));ami['on'](_0xf165('0x21'),this['syncCustomEvent'][_0xf165('0x1e')](this));ami['on'](_0xf165('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf165('0x23'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on']('custom:agentbusy',this[_0xf165('0x1d')]['bind'](this));ami['on']('custom:agentcongestion',this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on']('custom:agentreject',this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x24'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x25'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on']('custom:timeout',this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x26'),this[_0xf165('0x27')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x28'),this[_0xf165('0x27')][_0xf165('0x1e')](this));ami['on']('custom:dialend',this[_0xf165('0x27')]['bind'](this));ami['on'](_0xf165('0x29'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x2a'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x2b'),this[_0xf165('0x1d')]['bind'](this));ami['on'](_0xf165('0x2c'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on']('custom:outgoingmessage',this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x2d'),this[_0xf165('0x1d')][_0xf165('0x1e')](this));ami['on'](_0xf165('0x2e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:offlineMessage',this[_0xf165('0x1d')][_0xf165('0x1e')](this));}Trigger[_0xf165('0x2f')][_0xf165('0x30')]=function(_0x5635f1,_0x45e0d6,_0x2dd11a){logger['info'](_0x5635f1,_0x45e0d6,JSON[_0xf165('0x31')](_0x2dd11a));io['to'](_0x5635f1)[_0xf165('0x30')](_0x45e0d6,_0x2dd11a);};Trigger[_0xf165('0x2f')][_0xf165('0x1d')]=function(_0x222e62){var _0x9b752d=_[_0xf165('0x32')](_0x222e62);if(typeof _0x9b752d[_0xf165('0x33')]===_0xf165('0x34')){_0x9b752d[_0xf165('0x33')]=_0xf165('0x35');}logger[_0xf165('0x36')](_0xf165('0x1d'),util['inspect'](_0x9b752d,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x9b752d);};Trigger[_0xf165('0x2f')][_0xf165('0x27')]=function(_0xe7799){if(this[_0xf165('0xe')][_0xe7799[_0xf165('0x37')]]){this['syncCustomEvent'](_0xe7799);}};Trigger[_0xf165('0x2f')][_0xf165('0x38')]=function(_0x18f4fa){var _0x4c4463;for(var _0x1f3b1a in this[_0xf165('0xd')]){if(this[_0xf165('0xd')][_0xf165('0x39')](_0x1f3b1a)){if(this['triggers'][_0x1f3b1a][_0xf165('0x3a')]){_0x4c4463=this[_0xf165('0x3b')](this['triggers'][_0x1f3b1a],_0x18f4fa);if(_0x4c4463){_[_0xf165('0x3c')](_0x18f4fa,_0x18f4fa[_0xf165('0x3d')]);for(var _0x23f86b=0x0,_0x8ad1c3,_0x31a99c,_0xf79a28;_0x23f86b<this[_0xf165('0xd')][_0x1f3b1a][_0xf165('0x3e')][_0xf165('0x3f')];_0x23f86b+=0x1){_0x8ad1c3=this[_0xf165('0xd')][_0x1f3b1a][_0xf165('0x3e')][_0x23f86b];if(this[_0xf165('0xe')][_0x18f4fa[_0xf165('0x37')]]){switch(_0x8ad1c3[_0xf165('0x40')]['toLowerCase']()){case _0xf165('0x41'):break;case _0xf165('0x42'):case _0xf165('0x43'):var _0x1691f1={};switch(barAndWebActions[_0x8ad1c3[_0xf165('0x44')]]){case _0xf165('0xb'):_0x1691f1[_0xf165('0x45')]=_0x8ad1c3[_0xf165('0x46')];_0x1691f1[_0xf165('0x47')]=this[_0xf165('0x10')][_0x8ad1c3[_0xf165('0x46')]]?Mustache[_0xf165('0x48')](this[_0xf165('0x10')][_0x8ad1c3[_0xf165('0x46')]][_0xf165('0x47')],_0x18f4fa):_0xf165('0x49');break;case _0xf165('0x2'):_0x1691f1[_0xf165('0x4a')]=this[_0xf165('0x4b')](_0x8ad1c3['data2'],_0x18f4fa,_['isNil'](_0x8ad1c3[_0xf165('0x4c')])?!![]:parseInt(_0x8ad1c3['data3'],0xa));if(_[_0xf165('0x4d')](_0x8ad1c3[_0xf165('0x4e')])){_0x1691f1[_0xf165('0x4f')]='0';}else{_0x1691f1['uriLocation']=_0x8ad1c3[_0xf165('0x4e')];_0x1691f1[_0xf165('0x50')]=_['isNil'](_0x8ad1c3[_0xf165('0x51')])?_0xf165('0x52'):_0x8ad1c3['data5'];_0x1691f1[_0xf165('0x53')]=_[_0xf165('0x4d')](_0x8ad1c3[_0xf165('0x54')])?_0xf165('0x55'):_0x8ad1c3[_0xf165('0x54')];}break;case _0xf165('0xc'):_0x1691f1[_0xf165('0x56')]=_0x8ad1c3[_0xf165('0x46')]?Mustache[_0xf165('0x48')](_0x8ad1c3[_0xf165('0x46')],_0x18f4fa):'';_0x1691f1[_0xf165('0x57')]=_0x8ad1c3[_0xf165('0x4c')]?Mustache[_0xf165('0x48')](_0x8ad1c3[_0xf165('0x4c')],_0x18f4fa):'';break;}this[_0xf165('0x30')](util[_0xf165('0x58')](_0xf165('0x59'),this[_0xf165('0xe')][_0x18f4fa[_0xf165('0x37')]]['name']),util['format']('trigger:%s:%s',_0x8ad1c3[_0xf165('0x40')]['toLowerCase'](),barAndWebActions[_0x8ad1c3[_0xf165('0x44')]]),_[_0xf165('0x3c')](_0x1691f1,_0x18f4fa));break;case _0xf165('0x5a'):this[_0xf165('0x30')](util[_0xf165('0x58')](_0xf165('0x59'),this[_0xf165('0xe')][_0x18f4fa[_0xf165('0x37')]]['name']),util['format'](_0xf165('0x5b'),_0x8ad1c3['action'][_0xf165('0x5c')]()),_['merge']({'ProjectId':parseInt(_0x8ad1c3[_0xf165('0x44')],0xa)},_0x18f4fa));break;default:this['emit'](util['format']('user:%s',this['agents'][_0x18f4fa['interface']][_0xf165('0x5d')]),util[_0xf165('0x58')](_0xf165('0x5b'),_0x8ad1c3[_0xf165('0x40')][_0xf165('0x5c')]()),_[_0xf165('0x3c')]({},_0x8ad1c3,_0x18f4fa));}}switch(_0x8ad1c3[_0xf165('0x40')][_0xf165('0x5c')]()){case _0xf165('0x41'):cmContact[_0xf165('0x5e')](this[_0xf165('0xe')][_0x18f4fa[_0xf165('0x37')]],this[_0xf165('0xd')][_0x1f3b1a],_0x8ad1c3,_0x18f4fa);break;case _0xf165('0x5f'):integration['exec'](_0x8ad1c3,_0x18f4fa,this[_0xf165('0x1a')],this[_0xf165('0xe')][_0x18f4fa[_0xf165('0x37')]],this[_0xf165('0xf')][_0x18f4fa[_0xf165('0x60')]],this[_0xf165('0x61')][_0x18f4fa[_0xf165('0x62')]]);break;case _0xf165('0x63'):urlforward[_0xf165('0x5e')](_0x8ad1c3,_0x18f4fa);break;case _0xf165('0x64'):script[_0xf165('0x5e')](_0x8ad1c3,_0x18f4fa);break;}}}}}}};Trigger[_0xf165('0x2f')][_0xf165('0x4b')]=function(_0x4fe58d,_0x2c0ea8,_0x291307){var _0x30e1b2=url[_0xf165('0x65')](Mustache[_0xf165('0x48')](_0x4fe58d,_0x2c0ea8),!![]);if(_0x291307){_[_0xf165('0x3c')](_0x30e1b2[_0xf165('0x66')],_0x2c0ea8);}delete _0x30e1b2[_0xf165('0x67')];var _0x1d27af=url['format'](_0x30e1b2);_0x1d27af=_0x1d27af[_0xf165('0x68')](/\/\?/g,'?');return _0x1d27af;};Trigger[_0xf165('0x2f')][_0xf165('0x3b')]=function(_0x34543a,_0x28ba5f){var _0x48243b=!![];var _0x2634f1=!![];var _0x5ebed4=![];if(_0x34543a[_0xf165('0x69')]===_0x28ba5f['motionChannel']){_0x5ebed4=!![];}if(_0x34543a['AllConditions']['length']){_0x48243b=_['every'](_0x34543a[_0xf165('0x6a')],this['checkConditions'](_0x28ba5f,_0x34543a[_0xf165('0x69')]));}if(_0x34543a[_0xf165('0x6b')][_0xf165('0x3f')]){_0x2634f1=_['some'](_0x34543a[_0xf165('0x6b')],this[_0xf165('0x6c')](_0x28ba5f,_0x34543a[_0xf165('0x69')]));}var _0x7dbc2b=_0x5ebed4&&_0x48243b&&_0x2634f1;logger[_0xf165('0x36')](_0xf165('0x6d'),util[_0xf165('0x6e')](_0x34543a,{'showHidden':!![],'depth':null}),_0xf165('0x6f'),util[_0xf165('0x6e')](_0x28ba5f,{'showHidden':!![],'depth':null}),_0x5ebed4,_0x48243b,_0x2634f1);return _0x7dbc2b;};Trigger[_0xf165('0x2f')][_0xf165('0x6c')]=function(_0x554827,_0x366014){return function(_0x39d27a){switch(_0x39d27a[_0xf165('0x70')]){case _0xf165('0x71'):if(_0x554827[_0xf165('0x69')]===_0x366014){if(_0x366014===_0xf165('0x72')){return _0x554827['ChatWebsiteId']?operators[_0x39d27a[_0xf165('0x73')]](Number(_0x39d27a[_0xf165('0x74')]),_0x554827[_0xf165('0x75')]):![];}else{return _0x554827[_[_0xf165('0x76')](_0x366014)+_0xf165('0x77')]?operators[_0x39d27a['operator']](Number(_0x39d27a[_0xf165('0x74')]),_0x554827[_[_0xf165('0x76')](_0x366014)+_0xf165('0x77')]):![];}}break;case'interaction':case'message':if(_0x554827[_0xf165('0x69')]===_0x366014){return _0x554827[_0xf165('0x78')]?operators[_0x39d27a[_0xf165('0x73')]](_0x39d27a[_0xf165('0x74')],_0x554827['event']):![];}break;case _0xf165('0x60'):return _0x554827[_0xf165('0x60')]?operators[_0x39d27a[_0xf165('0x73')]](_0x39d27a[_0xf165('0x74')],_0x554827[_0xf165('0x60')]):![];case'agent':return _0x554827['membername']?operators[_0x39d27a[_0xf165('0x73')]](_0x39d27a[_0xf165('0x74')],_0x554827[_0xf165('0x79')]):![];case _0xf165('0x7a'):return _0x554827[_0xf165('0x7a')]?operators[_0x39d27a[_0xf165('0x73')]](_0x39d27a[_0xf165('0x74')],_0x554827[_0xf165('0x7a')]):![];case'routeId':return _0x554827[_0xf165('0x62')]?operators[_0x39d27a[_0xf165('0x73')]](_0x39d27a[_0xf165('0x74')],_0x554827[_0xf165('0x62')]):![];case _0xf165('0x7b'):if(_0x39d27a[_0xf165('0x74')]===_0xf165('0x7c'))_0x39d27a[_0xf165('0x74')]=null;return typeof _0x554827['substatus']!==_0xf165('0x34')?operators[_0x39d27a[_0xf165('0x73')]](_0x39d27a['value'],_0x554827[_0xf165('0x7d')]):![];case _0xf165('0x7e'):if(_0x554827['channel']===_0x366014){return _0x39d27a['value']==='created'&&_0x39d27a[_0xf165('0x73')]==='equals'?!![]:![];}break;}return![];};};module[_0xf165('0x7f')]=Trigger;
\ No newline at end of file