Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / ami / trigger / index.js
index 8f2bc18..5b8f7a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1335=['defaults','localhost','socket.io-emitter','redis','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','custom:agentconnect','bind','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','checkTriggers','interface','status','checkTrigger','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','TemplateId','data2','html','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','600','winApplication','render','format','user:%s','name','trigger:%s:%s','data1','merge','jscripty','trigger:%s','exec','integration','routeId','script','buildUri','parse','query','search','AllConditions','every','checkConditions','AnyConditions','some','channel','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger'];(function(_0x52a739,_0x4949f4){var _0x1fd038=function(_0x240c92){while(--_0x240c92){_0x52a739['push'](_0x52a739['shift']());}};_0x1fd038(++_0x4949f4);}(_0x1335,0x6f));var _0x5133=function(_0x4a94b7,_0x97312f){_0x4a94b7=_0x4a94b7-0x0;var _0x2c01f5=_0x1335[_0x4a94b7];return _0x2c01f5;};'use strict';var util=require(_0x5133('0x0'));var _=require(_0x5133('0x1'));var url=require(_0x5133('0x2'));var Mustache=require(_0x5133('0x3'));var Redis=require(_0x5133('0x4'));var urlforward=require(_0x5133('0x5'));var integration=require(_0x5133('0x6'));var cmContact=require(_0x5133('0x7'));var script=require('./script');var cmContactRpc=require('../rpc/cmContact');var config=require(_0x5133('0x8'));var logger=require(_0x5133('0x9'))(_0x5133('0xa'));var ami=require('../ami');config['redis']=_[_0x5133('0xb')](config['redis'],{'host':_0x5133('0xc'),'port':0x18eb});var io=require(_0x5133('0xd'))(new Redis(config[_0x5133('0xe')]));var operators={'equals':function(_0x1c6c3f,_0x432d54){return _0x1c6c3f==_0x432d54;},'not_equals':function(_0x31e838,_0x27713a){return _0x31e838!=_0x27713a;}};var barAndWebActions=['popup',_0x5133('0x2'),_0x5133('0xf')];function Trigger(_0x183dee){this[_0x5133('0x10')]=_0x183dee[_0x5133('0x10')];this[_0x5133('0x11')]=_0x183dee[_0x5133('0x11')];this[_0x5133('0x12')]=_0x183dee[_0x5133('0x12')];this[_0x5133('0x13')]=_0x183dee[_0x5133('0x13')];this[_0x5133('0x14')]=_0x183dee[_0x5133('0x14')];this[_0x5133('0x15')]=_0x183dee['zendeskAccounts'];this['freshdeskAccounts']=_0x183dee[_0x5133('0x16')];this[_0x5133('0x17')]=_0x183dee[_0x5133('0x17')];this[_0x5133('0x18')]=_0x183dee['sugarcrmAccounts'];this['zohoAccounts']=_0x183dee[_0x5133('0x19')];this['deskAccounts']=_0x183dee[_0x5133('0x1a')];this[_0x5133('0x1b')]=_0x183dee['vtigerAccounts'];this[_0x5133('0x1c')]=_0x183dee['servicenowAccounts'];this[_0x5133('0x1d')]=_0x183dee[_0x5133('0x1d')];this[_0x5133('0x1e')]=_0x183dee[_0x5133('0x1e')];this[_0x5133('0x1f')]={'zendesk':this[_0x5133('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x5133('0x16')],'sugarcrm':this[_0x5133('0x18')],'zoho':this[_0x5133('0x19')],'desk':this[_0x5133('0x1a')],'vtiger':this[_0x5133('0x1b')],'dynamics365':this[_0x5133('0x1d')],'freshsales':this[_0x5133('0x1e')],'servicenow':this['servicenowAccounts']};ami['on'](_0x5133('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5133('0x21'),this['syncCustomEvent'][_0x5133('0x22')](this));ami['on'](_0x5133('0x23'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x25'),this['syncCustomEvent'][_0x5133('0x22')](this));ami['on'](_0x5133('0x26'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x27'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x28'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on']('custom:agentcongestion',this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on']('custom:agentreject',this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x29'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x2a'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x2b'),this['syncAgentDial'][_0x5133('0x22')](this));ami['on'](_0x5133('0x2c'),this[_0x5133('0x2d')]['bind'](this));ami['on'](_0x5133('0x2e'),this[_0x5133('0x2d')]['bind'](this));ami['on'](_0x5133('0x2f'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on'](_0x5133('0x30'),this[_0x5133('0x24')][_0x5133('0x22')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0x5133('0x22')](this));ami['on'](_0x5133('0x31'),this[_0x5133('0x24')]['bind'](this));ami['on'](_0x5133('0x32'),this[_0x5133('0x24')]['bind'](this));ami['on'](_0x5133('0x33'),this['syncCustomEvent'][_0x5133('0x22')](this));}Trigger[_0x5133('0x34')][_0x5133('0x35')]=function(_0x3d5a98,_0x381703,_0x2fa989){logger[_0x5133('0x36')](_0x3d5a98,_0x381703,JSON['stringify'](_0x2fa989));io['to'](_0x3d5a98)[_0x5133('0x35')](_0x381703,_0x2fa989);};Trigger[_0x5133('0x34')][_0x5133('0x24')]=function(_0x245236){var _0x5564a1=_[_0x5133('0x37')](_0x245236);this[_0x5133('0x38')](_0x5564a1);};Trigger['prototype'][_0x5133('0x2d')]=function(_0x282b58){if(this[_0x5133('0x11')][_0x282b58[_0x5133('0x39')]]){this['syncCustomEvent'](_0x282b58);}};Trigger[_0x5133('0x34')][_0x5133('0x38')]=function(_0xc6fb38){var _0x587e79;for(var _0x48c490 in this[_0x5133('0x10')]){if(this[_0x5133('0x10')]['hasOwnProperty'](_0x48c490)){if(this[_0x5133('0x10')][_0x48c490][_0x5133('0x3a')]){_0x587e79=this[_0x5133('0x3b')](this[_0x5133('0x10')][_0x48c490],_0xc6fb38);if(_0x587e79){_['merge'](_0xc6fb38,_0xc6fb38[_0x5133('0x3c')]);for(var _0x58ab72=0x0,_0x337a02,_0x37f2ae,_0x45635f;_0x58ab72<this[_0x5133('0x10')][_0x48c490][_0x5133('0x3d')][_0x5133('0x3e')];_0x58ab72+=0x1){_0x337a02=this['triggers'][_0x48c490][_0x5133('0x3d')][_0x58ab72];if(this[_0x5133('0x11')][_0xc6fb38['interface']]){switch(_0x337a02[_0x5133('0x3f')][_0x5133('0x40')]()){case _0x5133('0x41'):break;case _0x5133('0x42'):case _0x5133('0x43'):var _0x24c13a={};switch(barAndWebActions[_0x337a02['data1']]){case'popup':_0x24c13a[_0x5133('0x44')]=_0x337a02[_0x5133('0x45')];_0x24c13a['html']=this[_0x5133('0x13')][_0x337a02[_0x5133('0x45')]]?Mustache['render'](this[_0x5133('0x13')][_0x337a02[_0x5133('0x45')]][_0x5133('0x46')],_0xc6fb38):_0x5133('0x47');break;case _0x5133('0x2'):_0x24c13a[_0x5133('0x48')]=this['buildUri'](_0x337a02[_0x5133('0x45')],_0xc6fb38,_[_0x5133('0x49')](_0x337a02[_0x5133('0x4a')])?!![]:parseInt(_0x337a02['data3'],0xa));if(_[_0x5133('0x49')](_0x337a02[_0x5133('0x4b')])){_0x24c13a[_0x5133('0x4c')]='0';}else{_0x24c13a[_0x5133('0x4d')]=_0x337a02[_0x5133('0x4b')];_0x24c13a[_0x5133('0x4e')]=_[_0x5133('0x49')](_0x337a02[_0x5133('0x4f')])?'800':_0x337a02['data5'];_0x24c13a[_0x5133('0x50')]=_[_0x5133('0x49')](_0x337a02[_0x5133('0x51')])?_0x5133('0x52'):_0x337a02[_0x5133('0x51')];}break;case _0x5133('0xf'):_0x24c13a[_0x5133('0x53')]=_0x337a02[_0x5133('0x45')]?Mustache['render'](_0x337a02[_0x5133('0x45')],_0xc6fb38):'';_0x24c13a['winArguments']=_0x337a02['data3']?Mustache[_0x5133('0x54')](_0x337a02[_0x5133('0x4a')],_0xc6fb38):'';break;}this[_0x5133('0x35')](util[_0x5133('0x55')](_0x5133('0x56'),this[_0x5133('0x11')][_0xc6fb38[_0x5133('0x39')]][_0x5133('0x57')]),util[_0x5133('0x55')](_0x5133('0x58'),_0x337a02[_0x5133('0x3f')][_0x5133('0x40')](),barAndWebActions[_0x337a02[_0x5133('0x59')]]),_[_0x5133('0x5a')](_0x24c13a,_0xc6fb38));break;case _0x5133('0x5b'):this['emit'](util[_0x5133('0x55')](_0x5133('0x56'),this[_0x5133('0x11')][_0xc6fb38[_0x5133('0x39')]][_0x5133('0x57')]),util[_0x5133('0x55')]('trigger:%s',_0x337a02[_0x5133('0x3f')][_0x5133('0x40')]()),_[_0x5133('0x5a')]({'ProjectId':parseInt(_0x337a02[_0x5133('0x59')],0xa)},_0xc6fb38));break;default:this[_0x5133('0x35')](util['format'](_0x5133('0x56'),this['agents'][_0xc6fb38[_0x5133('0x39')]]['name']),util['format'](_0x5133('0x5c'),_0x337a02[_0x5133('0x3f')][_0x5133('0x40')]()),_[_0x5133('0x5a')]({},_0x337a02,_0xc6fb38));}}switch(_0x337a02[_0x5133('0x3f')][_0x5133('0x40')]()){case _0x5133('0x41'):cmContact[_0x5133('0x5d')](this[_0x5133('0x11')][_0xc6fb38[_0x5133('0x39')]],_0x337a02,_0xc6fb38,cmContactRpc);break;case _0x5133('0x5e'):integration['exec'](_0x337a02,_0xc6fb38,this[_0x5133('0x1f')],this[_0x5133('0x11')][_0xc6fb38['interface']],this[_0x5133('0x12')][_0xc6fb38['queue']],this[_0x5133('0x14')][_0xc6fb38[_0x5133('0x5f')]]);break;case'urlforward':urlforward[_0x5133('0x5d')](_0x337a02,_0xc6fb38);break;case _0x5133('0x60'):script[_0x5133('0x5d')](_0x337a02,_0xc6fb38);break;}}}}}}};Trigger[_0x5133('0x34')][_0x5133('0x61')]=function(_0x4abab0,_0x25b50b,_0xee4f5d){var _0x28eec7=url[_0x5133('0x62')](Mustache[_0x5133('0x54')](_0x4abab0,_0x25b50b),!![]);if(_0xee4f5d){_['merge'](_0x28eec7[_0x5133('0x63')],_0x25b50b);}delete _0x28eec7[_0x5133('0x64')];var _0x3430b2=url[_0x5133('0x55')](_0x28eec7);_0x3430b2=_0x3430b2['replace'](/\/\?/g,'?');return _0x3430b2;};Trigger[_0x5133('0x34')]['checkTrigger']=function(_0x3226d7,_0x5ecb3b){var _0x4c9f04=!![],_0x22b04e=!![];if(_0x3226d7[_0x5133('0x65')][_0x5133('0x3e')]){_0x4c9f04=_[_0x5133('0x66')](_0x3226d7[_0x5133('0x65')],this[_0x5133('0x67')](_0x5ecb3b,_0x3226d7['channel']));}if(_0x3226d7[_0x5133('0x68')]['length']){_0x22b04e=_[_0x5133('0x69')](_0x3226d7[_0x5133('0x68')],this[_0x5133('0x67')](_0x5ecb3b,_0x3226d7[_0x5133('0x6a')]));}return _0x4c9f04&&_0x22b04e;};Trigger[_0x5133('0x34')][_0x5133('0x67')]=function(_0x272ac2,_0x3b78af){return function(_0x3e4b95){switch(_0x3e4b95['field']){case _0x5133('0x6b'):if(_0x272ac2[_0x5133('0x6a')]===_0x3b78af){if(_0x3b78af===_0x5133('0x6c')){return _0x272ac2[_0x5133('0x6d')]?operators[_0x3e4b95[_0x5133('0x6e')]](Number(_0x3e4b95[_0x5133('0x6f')]),_0x272ac2[_0x5133('0x6d')]):![];}else{return _0x272ac2[_[_0x5133('0x70')](_0x3b78af)+_0x5133('0x71')]?operators[_0x3e4b95[_0x5133('0x6e')]](Number(_0x3e4b95['value']),_0x272ac2[_[_0x5133('0x70')](_0x3b78af)+_0x5133('0x71')]):![];}}break;case _0x5133('0x72'):case _0x5133('0x73'):if(_0x272ac2['channel']===_0x3b78af){return _0x272ac2[_0x5133('0x74')]?operators[_0x3e4b95['operator']](_0x3e4b95['value'],_0x272ac2['event']):![];}break;case _0x5133('0x75'):return _0x272ac2[_0x5133('0x75')]?operators[_0x3e4b95[_0x5133('0x6e')]](_0x3e4b95[_0x5133('0x6f')],_0x272ac2[_0x5133('0x75')]):![];case _0x5133('0x76'):return _0x272ac2[_0x5133('0x77')]?operators[_0x3e4b95[_0x5133('0x6e')]](_0x3e4b95[_0x5133('0x6f')],_0x272ac2[_0x5133('0x77')]):![];case _0x5133('0x78'):return _0x272ac2[_0x5133('0x78')]?operators[_0x3e4b95[_0x5133('0x6e')]](_0x3e4b95[_0x5133('0x6f')],_0x272ac2['lastevent']):![];case'routeId':return _0x272ac2[_0x5133('0x5f')]?operators[_0x3e4b95[_0x5133('0x6e')]](_0x3e4b95['value'],_0x272ac2[_0x5133('0x5f')]):![];}return![];};};module[_0x5133('0x79')]=Trigger;
\ No newline at end of file
+var _0x5a17=['popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','action','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','isNil','data3','location','data4','windowWidth','data5','800','windowHeight','data6','winApplication','winArguments','format','user:%s','trigger:%s:%s','toLowerCase','jscripty','name','trigger:%s','exec','integration','routeId','script','parse','query','search','replace','every','AllConditions','channel','AnyConditions','length','some','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','message','event','queue','agent','lastevent','url','ioredis','./urlforward','./integration','trigger','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0xc848f9,_0x8e51fb){var _0x3436d4=function(_0xd7954a){while(--_0xd7954a){_0xc848f9['push'](_0xc848f9['shift']());}};_0x3436d4(++_0x8e51fb);}(_0x5a17,0xda));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x75a1('0x0'));var Mustache=require('mustache');var Redis=require(_0x75a1('0x1'));var urlforward=require(_0x75a1('0x2'));var integration=require(_0x75a1('0x3'));var cmContact=require('./cmContact');var script=require('./script');var cmContactRpc=require('../rpc/cmContact');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x75a1('0x4'));var ami=require(_0x75a1('0x5'));config[_0x75a1('0x6')]=_[_0x75a1('0x7')](config['redis'],{'host':_0x75a1('0x8'),'port':0x18eb});var io=require(_0x75a1('0x9'))(new Redis(config[_0x75a1('0x6')]));var operators={'equals':function(_0xf6856a,_0x5b0a5c){return _0xf6856a==_0x5b0a5c;},'not_equals':function(_0x125d1e,_0x32cf5c){return _0x125d1e!=_0x32cf5c;}};var barAndWebActions=[_0x75a1('0xa'),_0x75a1('0x0'),_0x75a1('0xb')];function Trigger(_0x42157b){this[_0x75a1('0xc')]=_0x42157b[_0x75a1('0xc')];this[_0x75a1('0xd')]=_0x42157b[_0x75a1('0xd')];this['voiceQueues']=_0x42157b[_0x75a1('0xe')];this[_0x75a1('0xf')]=_0x42157b[_0x75a1('0xf')];this[_0x75a1('0x10')]=_0x42157b[_0x75a1('0x10')];this[_0x75a1('0x11')]=_0x42157b['zendeskAccounts'];this[_0x75a1('0x12')]=_0x42157b['freshdeskAccounts'];this['salesforceAccounts']=_0x42157b[_0x75a1('0x13')];this[_0x75a1('0x14')]=_0x42157b[_0x75a1('0x14')];this['zohoAccounts']=_0x42157b[_0x75a1('0x15')];this[_0x75a1('0x16')]=_0x42157b['deskAccounts'];this[_0x75a1('0x17')]=_0x42157b['vtigerAccounts'];this['servicenowAccounts']=_0x42157b[_0x75a1('0x18')];this[_0x75a1('0x19')]=_0x42157b[_0x75a1('0x19')];this[_0x75a1('0x1a')]=_0x42157b[_0x75a1('0x1a')];this[_0x75a1('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x75a1('0x13')],'freshdesk':this[_0x75a1('0x12')],'sugarcrm':this[_0x75a1('0x14')],'zoho':this['zohoAccounts'],'desk':this[_0x75a1('0x16')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x75a1('0x19')],'freshsales':this[_0x75a1('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0x75a1('0x1c'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on']('custom:agentconnect',this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on']('custom:agentringnoanswer',this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x1f'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x20'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x21'),this['syncCustomEvent'][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x22'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x23'),this[_0x75a1('0x1d')]['bind'](this));ami['on']('custom:agentreject',this['syncCustomEvent']['bind'](this));ami['on'](_0x75a1('0x24'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x25'),this[_0x75a1('0x1d')]['bind'](this));ami['on'](_0x75a1('0x26'),this['syncAgentDial'][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x27'),this[_0x75a1('0x28')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x29'),this[_0x75a1('0x28')]['bind'](this));ami['on'](_0x75a1('0x2a'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x2b'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x2c'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x2d'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));ami['on'](_0x75a1('0x2e'),this[_0x75a1('0x1d')]['bind'](this));ami['on'](_0x75a1('0x2f'),this[_0x75a1('0x1d')][_0x75a1('0x1e')](this));}Trigger[_0x75a1('0x30')][_0x75a1('0x31')]=function(_0x5226f6,_0x421a28,_0x555e18){logger[_0x75a1('0x32')](_0x5226f6,_0x421a28,JSON[_0x75a1('0x33')](_0x555e18));io['to'](_0x5226f6)[_0x75a1('0x31')](_0x421a28,_0x555e18);};Trigger[_0x75a1('0x30')][_0x75a1('0x1d')]=function(_0x95a2ca){var _0x32483c=_[_0x75a1('0x34')](_0x95a2ca);this['checkTriggers'](_0x32483c);};Trigger[_0x75a1('0x30')][_0x75a1('0x28')]=function(_0x1bc659){if(this[_0x75a1('0xd')][_0x1bc659[_0x75a1('0x35')]]){this[_0x75a1('0x1d')](_0x1bc659);}};Trigger[_0x75a1('0x30')][_0x75a1('0x36')]=function(_0x45e49a){var _0x40e199;for(var _0x8a28c0 in this[_0x75a1('0xc')]){if(this['triggers'][_0x75a1('0x37')](_0x8a28c0)){if(this[_0x75a1('0xc')][_0x8a28c0][_0x75a1('0x38')]){_0x40e199=this[_0x75a1('0x39')](this[_0x75a1('0xc')][_0x8a28c0],_0x45e49a);if(_0x40e199){_[_0x75a1('0x3a')](_0x45e49a,_0x45e49a['variables']);for(var _0x2e4337=0x0,_0x4e8cad,_0x44ac97,_0x209d98;_0x2e4337<this[_0x75a1('0xc')][_0x8a28c0]['Actions']['length'];_0x2e4337+=0x1){_0x4e8cad=this[_0x75a1('0xc')][_0x8a28c0]['Actions'][_0x2e4337];if(this[_0x75a1('0xd')][_0x45e49a[_0x75a1('0x35')]]){switch(_0x4e8cad[_0x75a1('0x3b')]['toLowerCase']()){case _0x75a1('0x3c'):break;case _0x75a1('0x3d'):case _0x75a1('0x3e'):var _0x5c2e29={};switch(barAndWebActions[_0x4e8cad[_0x75a1('0x3f')]]){case _0x75a1('0xa'):_0x5c2e29[_0x75a1('0x40')]=_0x4e8cad['data2'];_0x5c2e29[_0x75a1('0x41')]=this[_0x75a1('0xf')][_0x4e8cad[_0x75a1('0x42')]]?Mustache[_0x75a1('0x43')](this['templates'][_0x4e8cad[_0x75a1('0x42')]][_0x75a1('0x41')],_0x45e49a):_0x75a1('0x44');break;case _0x75a1('0x0'):_0x5c2e29['uri']=this['buildUri'](_0x4e8cad[_0x75a1('0x42')],_0x45e49a,_[_0x75a1('0x45')](_0x4e8cad[_0x75a1('0x46')])?!![]:parseInt(_0x4e8cad[_0x75a1('0x46')],0xa));if(_[_0x75a1('0x45')](_0x4e8cad['data4'])){_0x5c2e29[_0x75a1('0x47')]='0';}else{_0x5c2e29['uriLocation']=_0x4e8cad[_0x75a1('0x48')];_0x5c2e29[_0x75a1('0x49')]=_[_0x75a1('0x45')](_0x4e8cad[_0x75a1('0x4a')])?_0x75a1('0x4b'):_0x4e8cad[_0x75a1('0x4a')];_0x5c2e29[_0x75a1('0x4c')]=_[_0x75a1('0x45')](_0x4e8cad[_0x75a1('0x4d')])?'600':_0x4e8cad[_0x75a1('0x4d')];}break;case _0x75a1('0xb'):_0x5c2e29[_0x75a1('0x4e')]=_0x4e8cad[_0x75a1('0x42')]?Mustache[_0x75a1('0x43')](_0x4e8cad['data2'],_0x45e49a):'';_0x5c2e29[_0x75a1('0x4f')]=_0x4e8cad[_0x75a1('0x46')]?Mustache[_0x75a1('0x43')](_0x4e8cad[_0x75a1('0x46')],_0x45e49a):'';break;}this[_0x75a1('0x31')](util[_0x75a1('0x50')](_0x75a1('0x51'),this[_0x75a1('0xd')][_0x45e49a[_0x75a1('0x35')]]['name']),util[_0x75a1('0x50')](_0x75a1('0x52'),_0x4e8cad[_0x75a1('0x3b')][_0x75a1('0x53')](),barAndWebActions[_0x4e8cad[_0x75a1('0x3f')]]),_['merge'](_0x5c2e29,_0x45e49a));break;case _0x75a1('0x54'):this[_0x75a1('0x31')](util['format']('user:%s',this['agents'][_0x45e49a[_0x75a1('0x35')]][_0x75a1('0x55')]),util[_0x75a1('0x50')](_0x75a1('0x56'),_0x4e8cad['action'][_0x75a1('0x53')]()),_['merge']({'ProjectId':parseInt(_0x4e8cad[_0x75a1('0x3f')],0xa)},_0x45e49a));break;default:this[_0x75a1('0x31')](util[_0x75a1('0x50')](_0x75a1('0x51'),this[_0x75a1('0xd')][_0x45e49a[_0x75a1('0x35')]][_0x75a1('0x55')]),util['format']('trigger:%s',_0x4e8cad[_0x75a1('0x3b')]['toLowerCase']()),_['merge']({},_0x4e8cad,_0x45e49a));}}switch(_0x4e8cad[_0x75a1('0x3b')][_0x75a1('0x53')]()){case _0x75a1('0x3c'):cmContact[_0x75a1('0x57')](this[_0x75a1('0xd')][_0x45e49a[_0x75a1('0x35')]],_0x4e8cad,_0x45e49a,cmContactRpc);break;case _0x75a1('0x58'):integration[_0x75a1('0x57')](_0x4e8cad,_0x45e49a,this[_0x75a1('0x1b')],this['agents'][_0x45e49a[_0x75a1('0x35')]],this[_0x75a1('0xe')][_0x45e49a['queue']],this[_0x75a1('0x10')][_0x45e49a[_0x75a1('0x59')]]);break;case'urlforward':urlforward[_0x75a1('0x57')](_0x4e8cad,_0x45e49a);break;case _0x75a1('0x5a'):script['exec'](_0x4e8cad,_0x45e49a);break;}}}}}}};Trigger[_0x75a1('0x30')]['buildUri']=function(_0x1518a8,_0x376353,_0x41bbff){var _0x65402=url[_0x75a1('0x5b')](Mustache[_0x75a1('0x43')](_0x1518a8,_0x376353),!![]);if(_0x41bbff){_['merge'](_0x65402[_0x75a1('0x5c')],_0x376353);}delete _0x65402[_0x75a1('0x5d')];var _0x5685e2=url[_0x75a1('0x50')](_0x65402);_0x5685e2=_0x5685e2[_0x75a1('0x5e')](/\/\?/g,'?');return _0x5685e2;};Trigger[_0x75a1('0x30')][_0x75a1('0x39')]=function(_0x3d2193,_0x6b92f3){var _0x39d39d=!![],_0x1a4198=!![];if(_0x3d2193['AllConditions']['length']){_0x39d39d=_[_0x75a1('0x5f')](_0x3d2193[_0x75a1('0x60')],this['checkConditions'](_0x6b92f3,_0x3d2193[_0x75a1('0x61')]));}if(_0x3d2193[_0x75a1('0x62')][_0x75a1('0x63')]){_0x1a4198=_[_0x75a1('0x64')](_0x3d2193[_0x75a1('0x62')],this[_0x75a1('0x65')](_0x6b92f3,_0x3d2193['channel']));}return _0x39d39d&&_0x1a4198;};Trigger['prototype']['checkConditions']=function(_0x1bde11,_0x57943e){return function(_0x1d93cd){switch(_0x1d93cd[_0x75a1('0x66')]){case _0x75a1('0x67'):if(_0x1bde11[_0x75a1('0x61')]===_0x57943e){if(_0x57943e===_0x75a1('0x68')){return _0x1bde11[_0x75a1('0x69')]?operators[_0x1d93cd[_0x75a1('0x6a')]](Number(_0x1d93cd[_0x75a1('0x6b')]),_0x1bde11[_0x75a1('0x69')]):![];}else{return _0x1bde11[_[_0x75a1('0x6c')](_0x57943e)+'AccountId']?operators[_0x1d93cd['operator']](Number(_0x1d93cd['value']),_0x1bde11[_[_0x75a1('0x6c')](_0x57943e)+'AccountId']):![];}}break;case'interaction':case _0x75a1('0x6d'):if(_0x1bde11['channel']===_0x57943e){return _0x1bde11[_0x75a1('0x6e')]?operators[_0x1d93cd[_0x75a1('0x6a')]](_0x1d93cd[_0x75a1('0x6b')],_0x1bde11[_0x75a1('0x6e')]):![];}break;case _0x75a1('0x6f'):return _0x1bde11[_0x75a1('0x6f')]?operators[_0x1d93cd['operator']](_0x1d93cd[_0x75a1('0x6b')],_0x1bde11['queue']):![];case _0x75a1('0x70'):return _0x1bde11['membername']?operators[_0x1d93cd[_0x75a1('0x6a')]](_0x1d93cd[_0x75a1('0x6b')],_0x1bde11['membername']):![];case'lastevent':return _0x1bde11[_0x75a1('0x71')]?operators[_0x1d93cd['operator']](_0x1d93cd[_0x75a1('0x6b')],_0x1bde11['lastevent']):![];case _0x75a1('0x59'):return _0x1bde11[_0x75a1('0x59')]?operators[_0x1d93cd[_0x75a1('0x6a')]](_0x1d93cd['value'],_0x1bde11[_0x75a1('0x59')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file