Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / services / ami / trigger / index.js
index 16fef8b..29f47fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d93=['merge','jscripty','trigger:%s','exec','integration','routeId','urlforward','script','parse','query','every','AllConditions','checkConditions','channel','AnyConditions','some','field','account','chat','operator','value','AccountId','upperFirst','interaction','message','event','queue','agent','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','checkTrigger','length','Actions','interface','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','windowWidth','800','data5','data6','600','winApplication','user:%s','name','format','trigger:%s:%s'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6d93,0x177));var _0x36d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d93[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x36d9('0x0'));var _=require(_0x36d9('0x1'));var url=require(_0x36d9('0x2'));var Mustache=require(_0x36d9('0x3'));var Redis=require(_0x36d9('0x4'));var urlforward=require(_0x36d9('0x5'));var integration=require(_0x36d9('0x6'));var cmContact=require('./cmContact');var script=require(_0x36d9('0x7'));var config=require(_0x36d9('0x8'));var logger=require(_0x36d9('0x9'))(_0x36d9('0xa'));var ami=require(_0x36d9('0xb'));config[_0x36d9('0xc')]=_[_0x36d9('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x36d9('0xe'))(new Redis(config[_0x36d9('0xc')]));var operators={'equals':function(_0x4a64ef,_0x84d37e){return _0x4a64ef==_0x84d37e;},'not_equals':function(_0x151f75,_0xba6706){return _0x151f75!=_0xba6706;}};var barAndWebActions=[_0x36d9('0xf'),'url',_0x36d9('0x10')];function Trigger(_0x3a72a4){this[_0x36d9('0x11')]=_0x3a72a4[_0x36d9('0x11')];this['agents']=_0x3a72a4[_0x36d9('0x12')];this[_0x36d9('0x13')]=_0x3a72a4[_0x36d9('0x13')];this[_0x36d9('0x14')]=_0x3a72a4[_0x36d9('0x14')];this['voiceExtensions']=_0x3a72a4[_0x36d9('0x15')];this[_0x36d9('0x16')]=_0x3a72a4['zendeskAccounts'];this['freshdeskAccounts']=_0x3a72a4[_0x36d9('0x17')];this[_0x36d9('0x18')]=_0x3a72a4[_0x36d9('0x18')];this[_0x36d9('0x19')]=_0x3a72a4[_0x36d9('0x19')];this[_0x36d9('0x1a')]=_0x3a72a4[_0x36d9('0x1a')];this[_0x36d9('0x1b')]=_0x3a72a4[_0x36d9('0x1b')];this['vtigerAccounts']=_0x3a72a4['vtigerAccounts'];this[_0x36d9('0x1c')]=_0x3a72a4[_0x36d9('0x1c')];this[_0x36d9('0x1d')]=_0x3a72a4[_0x36d9('0x1d')];this[_0x36d9('0x1e')]=_0x3a72a4[_0x36d9('0x1e')];this[_0x36d9('0x1f')]={'zendesk':this[_0x36d9('0x16')],'salesforce':this[_0x36d9('0x18')],'freshdesk':this[_0x36d9('0x17')],'sugarcrm':this[_0x36d9('0x19')],'zoho':this[_0x36d9('0x1a')],'desk':this[_0x36d9('0x1b')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x36d9('0x1d')],'freshsales':this[_0x36d9('0x1e')],'servicenow':this[_0x36d9('0x1c')]};ami['on'](_0x36d9('0x20'),this['syncCustomEvent'][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x22'),this['syncCustomEvent'][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x23'),this[_0x36d9('0x24')]['bind'](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x25'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on']('custom:agentnoanswer',this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x26'),this['syncCustomEvent'][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x27'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x28'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent']['bind'](this));ami['on'](_0x36d9('0x29'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0x36d9('0x2a')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x2b'),this[_0x36d9('0x2a')][_0x36d9('0x21')](this));ami['on']('custom:dialend',this[_0x36d9('0x2a')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x2c'),this['syncCustomEvent']['bind'](this));ami['on'](_0x36d9('0x2d'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x2e'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x2f'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x30'),this[_0x36d9('0x24')][_0x36d9('0x21')](this));ami['on'](_0x36d9('0x31'),this['syncCustomEvent'][_0x36d9('0x21')](this));}Trigger[_0x36d9('0x32')][_0x36d9('0x33')]=function(_0x45d816,_0x560e9b,_0x4f5f61){logger[_0x36d9('0x34')](_0x45d816,_0x560e9b,JSON[_0x36d9('0x35')](_0x4f5f61));io['to'](_0x45d816)[_0x36d9('0x33')](_0x560e9b,_0x4f5f61);};Trigger[_0x36d9('0x32')][_0x36d9('0x24')]=function(_0xc34fe0){var _0x532d0e=_[_0x36d9('0x36')](_0xc34fe0);this[_0x36d9('0x37')](_0x532d0e);};Trigger[_0x36d9('0x32')][_0x36d9('0x2a')]=function(_0x544520){if(this[_0x36d9('0x12')][_0x544520['interface']]){this[_0x36d9('0x24')](_0x544520);}};Trigger['prototype'][_0x36d9('0x37')]=function(_0x1d421c){var _0x219839;for(var _0x4d5104 in this[_0x36d9('0x11')]){if(this[_0x36d9('0x11')]['hasOwnProperty'](_0x4d5104)){if(this[_0x36d9('0x11')][_0x4d5104]['status']){_0x219839=this[_0x36d9('0x38')](this[_0x36d9('0x11')][_0x4d5104],_0x1d421c);if(_0x219839){_['merge'](_0x1d421c,_0x1d421c['variables']);for(var _0x23ae72=0x0,_0x5317ab,_0x1e8e0b,_0x323312;_0x23ae72<this[_0x36d9('0x11')][_0x4d5104]['Actions'][_0x36d9('0x39')];_0x23ae72+=0x1){_0x5317ab=this[_0x36d9('0x11')][_0x4d5104][_0x36d9('0x3a')][_0x23ae72];if(this[_0x36d9('0x12')][_0x1d421c[_0x36d9('0x3b')]]){switch(_0x5317ab[_0x36d9('0x3c')][_0x36d9('0x3d')]()){case'contactmanager':break;case _0x36d9('0x3e'):case _0x36d9('0x3f'):var _0x31b60={};switch(barAndWebActions[_0x5317ab[_0x36d9('0x40')]]){case _0x36d9('0xf'):_0x31b60[_0x36d9('0x41')]=_0x5317ab[_0x36d9('0x42')];_0x31b60[_0x36d9('0x43')]=this['templates'][_0x5317ab[_0x36d9('0x42')]]?Mustache[_0x36d9('0x44')](this[_0x36d9('0x14')][_0x5317ab[_0x36d9('0x42')]][_0x36d9('0x43')],_0x1d421c):'template\x20not\x20found';break;case _0x36d9('0x2'):_0x31b60[_0x36d9('0x45')]=this[_0x36d9('0x46')](_0x5317ab[_0x36d9('0x42')],_0x1d421c,_[_0x36d9('0x47')](_0x5317ab[_0x36d9('0x48')])?!![]:parseInt(_0x5317ab['data3'],0xa));if(_[_0x36d9('0x47')](_0x5317ab[_0x36d9('0x49')])){_0x31b60[_0x36d9('0x4a')]='0';}else{_0x31b60['uriLocation']=_0x5317ab[_0x36d9('0x49')];_0x31b60[_0x36d9('0x4b')]=_[_0x36d9('0x47')](_0x5317ab['data5'])?_0x36d9('0x4c'):_0x5317ab[_0x36d9('0x4d')];_0x31b60['windowHeight']=_[_0x36d9('0x47')](_0x5317ab[_0x36d9('0x4e')])?_0x36d9('0x4f'):_0x5317ab[_0x36d9('0x4e')];}break;case'winapp':_0x31b60[_0x36d9('0x50')]=_0x5317ab[_0x36d9('0x42')]?Mustache[_0x36d9('0x44')](_0x5317ab[_0x36d9('0x42')],_0x1d421c):'';_0x31b60['winArguments']=_0x5317ab[_0x36d9('0x48')]?Mustache[_0x36d9('0x44')](_0x5317ab[_0x36d9('0x48')],_0x1d421c):'';break;}this['emit'](util['format'](_0x36d9('0x51'),this[_0x36d9('0x12')][_0x1d421c[_0x36d9('0x3b')]][_0x36d9('0x52')]),util[_0x36d9('0x53')](_0x36d9('0x54'),_0x5317ab['action'][_0x36d9('0x3d')](),barAndWebActions[_0x5317ab[_0x36d9('0x40')]]),_[_0x36d9('0x55')](_0x31b60,_0x1d421c));break;case _0x36d9('0x56'):this[_0x36d9('0x33')](util['format']('user:%s',this[_0x36d9('0x12')][_0x1d421c['interface']]['name']),util['format'](_0x36d9('0x57'),_0x5317ab[_0x36d9('0x3c')][_0x36d9('0x3d')]()),_['merge']({'ProjectId':parseInt(_0x5317ab[_0x36d9('0x40')],0xa)},_0x1d421c));break;default:this[_0x36d9('0x33')](util[_0x36d9('0x53')]('user:%s',this[_0x36d9('0x12')][_0x1d421c[_0x36d9('0x3b')]][_0x36d9('0x52')]),util[_0x36d9('0x53')]('trigger:%s',_0x5317ab[_0x36d9('0x3c')][_0x36d9('0x3d')]()),_[_0x36d9('0x55')]({},_0x5317ab,_0x1d421c));}}switch(_0x5317ab[_0x36d9('0x3c')][_0x36d9('0x3d')]()){case'contactmanager':cmContact[_0x36d9('0x58')](this['agents'][_0x1d421c['interface']],this[_0x36d9('0x11')][_0x4d5104],_0x5317ab,_0x1d421c);break;case _0x36d9('0x59'):integration[_0x36d9('0x58')](_0x5317ab,_0x1d421c,this[_0x36d9('0x1f')],this[_0x36d9('0x12')][_0x1d421c[_0x36d9('0x3b')]],this[_0x36d9('0x13')][_0x1d421c['queue']],this[_0x36d9('0x15')][_0x1d421c[_0x36d9('0x5a')]]);break;case _0x36d9('0x5b'):urlforward[_0x36d9('0x58')](_0x5317ab,_0x1d421c);break;case _0x36d9('0x5c'):script[_0x36d9('0x58')](_0x5317ab,_0x1d421c);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x1c85b1,_0x5399ce,_0xac0f25){var _0xc316c1=url[_0x36d9('0x5d')](Mustache[_0x36d9('0x44')](_0x1c85b1,_0x5399ce),!![]);if(_0xac0f25){_[_0x36d9('0x55')](_0xc316c1[_0x36d9('0x5e')],_0x5399ce);}delete _0xc316c1['search'];var _0x17a137=url[_0x36d9('0x53')](_0xc316c1);_0x17a137=_0x17a137['replace'](/\/\?/g,'?');return _0x17a137;};Trigger[_0x36d9('0x32')][_0x36d9('0x38')]=function(_0x3175f7,_0xead806){var _0x269b1c=!![],_0x498fe9=!![];if(_0x3175f7['AllConditions'][_0x36d9('0x39')]){_0x269b1c=_[_0x36d9('0x5f')](_0x3175f7[_0x36d9('0x60')],this[_0x36d9('0x61')](_0xead806,_0x3175f7[_0x36d9('0x62')]));}if(_0x3175f7[_0x36d9('0x63')][_0x36d9('0x39')]){_0x498fe9=_[_0x36d9('0x64')](_0x3175f7[_0x36d9('0x63')],this[_0x36d9('0x61')](_0xead806,_0x3175f7[_0x36d9('0x62')]));}return _0x269b1c&&_0x498fe9;};Trigger[_0x36d9('0x32')][_0x36d9('0x61')]=function(_0x1c69a9,_0x2469c3){return function(_0x1140db){switch(_0x1140db[_0x36d9('0x65')]){case _0x36d9('0x66'):if(_0x1c69a9['channel']===_0x2469c3){if(_0x2469c3===_0x36d9('0x67')){return _0x1c69a9['ChatWebsiteId']?operators[_0x1140db[_0x36d9('0x68')]](Number(_0x1140db[_0x36d9('0x69')]),_0x1c69a9['ChatWebsiteId']):![];}else{return _0x1c69a9[_['upperFirst'](_0x2469c3)+_0x36d9('0x6a')]?operators[_0x1140db[_0x36d9('0x68')]](Number(_0x1140db['value']),_0x1c69a9[_[_0x36d9('0x6b')](_0x2469c3)+_0x36d9('0x6a')]):![];}}break;case _0x36d9('0x6c'):case _0x36d9('0x6d'):if(_0x1c69a9['channel']===_0x2469c3){return _0x1c69a9[_0x36d9('0x6e')]?operators[_0x1140db[_0x36d9('0x68')]](_0x1140db[_0x36d9('0x69')],_0x1c69a9[_0x36d9('0x6e')]):![];}break;case'queue':return _0x1c69a9[_0x36d9('0x6f')]?operators[_0x1140db['operator']](_0x1140db[_0x36d9('0x69')],_0x1c69a9[_0x36d9('0x6f')]):![];case _0x36d9('0x70'):return _0x1c69a9['membername']?operators[_0x1140db[_0x36d9('0x68')]](_0x1140db['value'],_0x1c69a9['membername']):![];case'lastevent':return _0x1c69a9[_0x36d9('0x71')]?operators[_0x1140db['operator']](_0x1140db['value'],_0x1c69a9[_0x36d9('0x71')]):![];case'routeId':return _0x1c69a9[_0x36d9('0x5a')]?operators[_0x1140db[_0x36d9('0x68')]](_0x1140db[_0x36d9('0x69')],_0x1c69a9[_0x36d9('0x5a')]):![];}return![];};};module[_0x36d9('0x72')]=Trigger;
\ No newline at end of file
+var _0x341a=['isNil','data3','location','data4','windowWidth','data5','800','data6','600','winApplication','render','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','contactmanager','exec','voiceQueues','queue','routeId','search','AllConditions','every','channel','AnyConditions','some','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','redis','localhost','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','clone','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','length','Actions','action','toLowerCase','motionbar','data1','popup','TemplateId','data2','html','template\x20not\x20found','uri','buildUri'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x341a,0xa0));var _0xa341=function(_0x7b0df6,_0x369636){_0x7b0df6=_0x7b0df6-0x0;var _0x15c38b=_0x341a[_0x7b0df6];return _0x15c38b;};'use strict';var util=require(_0xa341('0x0'));var _=require(_0xa341('0x1'));var url=require(_0xa341('0x2'));var Mustache=require(_0xa341('0x3'));var Redis=require(_0xa341('0x4'));var urlforward=require(_0xa341('0x5'));var integration=require(_0xa341('0x6'));var cmContact=require(_0xa341('0x7'));var script=require(_0xa341('0x8'));var config=require(_0xa341('0x9'));var logger=require(_0xa341('0xa'))('trigger');var ami=require(_0xa341('0xb'));config[_0xa341('0xc')]=_['defaults'](config[_0xa341('0xc')],{'host':_0xa341('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa341('0xc')]));var operators={'equals':function(_0x4d9868,_0x55b9b5){return _0x4d9868==_0x55b9b5;},'not_equals':function(_0x418534,_0x411fde){return _0x418534!=_0x411fde;}};var barAndWebActions=['popup',_0xa341('0x2'),_0xa341('0xe')];function Trigger(_0x331c9e){this[_0xa341('0xf')]=_0x331c9e['triggers'];this['agents']=_0x331c9e[_0xa341('0x10')];this['voiceQueues']=_0x331c9e['voiceQueues'];this[_0xa341('0x11')]=_0x331c9e[_0xa341('0x11')];this[_0xa341('0x12')]=_0x331c9e[_0xa341('0x12')];this[_0xa341('0x13')]=_0x331c9e[_0xa341('0x13')];this[_0xa341('0x14')]=_0x331c9e['freshdeskAccounts'];this[_0xa341('0x15')]=_0x331c9e[_0xa341('0x15')];this['sugarcrmAccounts']=_0x331c9e['sugarcrmAccounts'];this[_0xa341('0x16')]=_0x331c9e['zohoAccounts'];this[_0xa341('0x17')]=_0x331c9e[_0xa341('0x17')];this[_0xa341('0x18')]=_0x331c9e['vtigerAccounts'];this[_0xa341('0x19')]=_0x331c9e[_0xa341('0x19')];this[_0xa341('0x1a')]=_0x331c9e[_0xa341('0x1a')];this[_0xa341('0x1b')]=_0x331c9e[_0xa341('0x1b')];this[_0xa341('0x1c')]={'zendesk':this[_0xa341('0x13')],'salesforce':this[_0xa341('0x15')],'freshdesk':this[_0xa341('0x14')],'sugarcrm':this[_0xa341('0x1d')],'zoho':this[_0xa341('0x16')],'desk':this[_0xa341('0x17')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xa341('0x1a')],'freshsales':this[_0xa341('0x1b')],'servicenow':this[_0xa341('0x19')]};ami['on']('custom:agentcalled',this[_0xa341('0x1e')]['bind'](this));ami['on']('custom:agentconnect',this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x20'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x21'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x22'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x23'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x24'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on']('custom:agentreject',this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x25'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x26'),this['syncCustomEvent'][_0xa341('0x1f')](this));ami['on'](_0xa341('0x27'),this[_0xa341('0x28')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x29'),this['syncAgentDial'][_0xa341('0x1f')](this));ami['on'](_0xa341('0x2a'),this[_0xa341('0x28')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x2b'),this['syncCustomEvent'][_0xa341('0x1f')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0xa341('0x1f')](this));ami['on'](_0xa341('0x2c'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x2d'),this[_0xa341('0x1e')]['bind'](this));ami['on'](_0xa341('0x2e'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));ami['on'](_0xa341('0x2f'),this[_0xa341('0x1e')][_0xa341('0x1f')](this));}Trigger[_0xa341('0x30')]['emit']=function(_0x1c3673,_0x4912d0,_0x3d6074){logger[_0xa341('0x31')](_0x1c3673,_0x4912d0,JSON[_0xa341('0x32')](_0x3d6074));io['to'](_0x1c3673)[_0xa341('0x33')](_0x4912d0,_0x3d6074);};Trigger[_0xa341('0x30')][_0xa341('0x1e')]=function(_0x520324){var _0x2e7e4e=_[_0xa341('0x34')](_0x520324);this['checkTriggers'](_0x2e7e4e);};Trigger[_0xa341('0x30')][_0xa341('0x28')]=function(_0x5485bb){if(this[_0xa341('0x10')][_0x5485bb[_0xa341('0x35')]]){this[_0xa341('0x1e')](_0x5485bb);}};Trigger[_0xa341('0x30')][_0xa341('0x36')]=function(_0x1043e7){var _0x3e6c19;for(var _0x145c93 in this[_0xa341('0xf')]){if(this['triggers'][_0xa341('0x37')](_0x145c93)){if(this[_0xa341('0xf')][_0x145c93][_0xa341('0x38')]){_0x3e6c19=this[_0xa341('0x39')](this[_0xa341('0xf')][_0x145c93],_0x1043e7);if(_0x3e6c19){_[_0xa341('0x3a')](_0x1043e7,_0x1043e7['variables']);for(var _0xa35c41=0x0,_0x350bc6,_0x2dd244,_0x519748;_0xa35c41<this[_0xa341('0xf')][_0x145c93]['Actions'][_0xa341('0x3b')];_0xa35c41+=0x1){_0x350bc6=this['triggers'][_0x145c93][_0xa341('0x3c')][_0xa35c41];if(this[_0xa341('0x10')][_0x1043e7[_0xa341('0x35')]]){switch(_0x350bc6[_0xa341('0x3d')][_0xa341('0x3e')]()){case'contactmanager':break;case _0xa341('0x3f'):case'browser':var _0x1775bd={};switch(barAndWebActions[_0x350bc6[_0xa341('0x40')]]){case _0xa341('0x41'):_0x1775bd[_0xa341('0x42')]=_0x350bc6[_0xa341('0x43')];_0x1775bd[_0xa341('0x44')]=this[_0xa341('0x11')][_0x350bc6['data2']]?Mustache['render'](this[_0xa341('0x11')][_0x350bc6[_0xa341('0x43')]][_0xa341('0x44')],_0x1043e7):_0xa341('0x45');break;case _0xa341('0x2'):_0x1775bd[_0xa341('0x46')]=this[_0xa341('0x47')](_0x350bc6['data2'],_0x1043e7,_[_0xa341('0x48')](_0x350bc6[_0xa341('0x49')])?!![]:parseInt(_0x350bc6[_0xa341('0x49')],0xa));if(_['isNil'](_0x350bc6['data4'])){_0x1775bd[_0xa341('0x4a')]='0';}else{_0x1775bd['uriLocation']=_0x350bc6[_0xa341('0x4b')];_0x1775bd[_0xa341('0x4c')]=_['isNil'](_0x350bc6[_0xa341('0x4d')])?_0xa341('0x4e'):_0x350bc6['data5'];_0x1775bd['windowHeight']=_[_0xa341('0x48')](_0x350bc6[_0xa341('0x4f')])?_0xa341('0x50'):_0x350bc6['data6'];}break;case _0xa341('0xe'):_0x1775bd[_0xa341('0x51')]=_0x350bc6['data2']?Mustache[_0xa341('0x52')](_0x350bc6['data2'],_0x1043e7):'';_0x1775bd[_0xa341('0x53')]=_0x350bc6[_0xa341('0x49')]?Mustache[_0xa341('0x52')](_0x350bc6['data3'],_0x1043e7):'';break;}this[_0xa341('0x33')](util[_0xa341('0x54')](_0xa341('0x55'),this[_0xa341('0x10')][_0x1043e7[_0xa341('0x35')]][_0xa341('0x56')]),util[_0xa341('0x54')](_0xa341('0x57'),_0x350bc6['action'][_0xa341('0x3e')](),barAndWebActions[_0x350bc6[_0xa341('0x40')]]),_[_0xa341('0x3a')](_0x1775bd,_0x1043e7));break;case _0xa341('0x58'):this[_0xa341('0x33')](util[_0xa341('0x54')](_0xa341('0x55'),this['agents'][_0x1043e7[_0xa341('0x35')]][_0xa341('0x56')]),util['format']('trigger:%s',_0x350bc6[_0xa341('0x3d')]['toLowerCase']()),_[_0xa341('0x3a')]({'ProjectId':parseInt(_0x350bc6[_0xa341('0x40')],0xa)},_0x1043e7));break;default:this['emit'](util[_0xa341('0x54')](_0xa341('0x55'),this[_0xa341('0x10')][_0x1043e7[_0xa341('0x35')]][_0xa341('0x56')]),util[_0xa341('0x54')](_0xa341('0x59'),_0x350bc6[_0xa341('0x3d')][_0xa341('0x3e')]()),_[_0xa341('0x3a')]({},_0x350bc6,_0x1043e7));}}switch(_0x350bc6[_0xa341('0x3d')][_0xa341('0x3e')]()){case _0xa341('0x5a'):cmContact[_0xa341('0x5b')](this[_0xa341('0x10')][_0x1043e7[_0xa341('0x35')]],this[_0xa341('0xf')][_0x145c93],_0x350bc6,_0x1043e7);break;case'integration':integration['exec'](_0x350bc6,_0x1043e7,this[_0xa341('0x1c')],this[_0xa341('0x10')][_0x1043e7['interface']],this[_0xa341('0x5c')][_0x1043e7[_0xa341('0x5d')]],this['voiceExtensions'][_0x1043e7[_0xa341('0x5e')]]);break;case'urlforward':urlforward[_0xa341('0x5b')](_0x350bc6,_0x1043e7);break;case'script':script[_0xa341('0x5b')](_0x350bc6,_0x1043e7);break;}}}}}}};Trigger[_0xa341('0x30')]['buildUri']=function(_0x5e18d9,_0x1076db,_0x3c7fb7){var _0x86c044=url['parse'](Mustache[_0xa341('0x52')](_0x5e18d9,_0x1076db),!![]);if(_0x3c7fb7){_[_0xa341('0x3a')](_0x86c044['query'],_0x1076db);}delete _0x86c044[_0xa341('0x5f')];var _0x377fa5=url['format'](_0x86c044);_0x377fa5=_0x377fa5['replace'](/\/\?/g,'?');return _0x377fa5;};Trigger[_0xa341('0x30')][_0xa341('0x39')]=function(_0x1d03c8,_0x477477){var _0x33d4c2=!![],_0x3dd523=!![];if(_0x1d03c8[_0xa341('0x60')][_0xa341('0x3b')]){_0x33d4c2=_[_0xa341('0x61')](_0x1d03c8['AllConditions'],this['checkConditions'](_0x477477,_0x1d03c8[_0xa341('0x62')]));}if(_0x1d03c8[_0xa341('0x63')]['length']){_0x3dd523=_[_0xa341('0x64')](_0x1d03c8[_0xa341('0x63')],this[_0xa341('0x65')](_0x477477,_0x1d03c8[_0xa341('0x62')]));}return _0x33d4c2&&_0x3dd523;};Trigger[_0xa341('0x30')]['checkConditions']=function(_0x3b6a57,_0x257b19){return function(_0x4f5e76){switch(_0x4f5e76[_0xa341('0x66')]){case _0xa341('0x67'):if(_0x3b6a57[_0xa341('0x62')]===_0x257b19){if(_0x257b19===_0xa341('0x68')){return _0x3b6a57[_0xa341('0x69')]?operators[_0x4f5e76[_0xa341('0x6a')]](Number(_0x4f5e76[_0xa341('0x6b')]),_0x3b6a57['ChatWebsiteId']):![];}else{return _0x3b6a57[_[_0xa341('0x6c')](_0x257b19)+_0xa341('0x6d')]?operators[_0x4f5e76[_0xa341('0x6a')]](Number(_0x4f5e76[_0xa341('0x6b')]),_0x3b6a57[_[_0xa341('0x6c')](_0x257b19)+_0xa341('0x6d')]):![];}}break;case _0xa341('0x6e'):case _0xa341('0x6f'):if(_0x3b6a57[_0xa341('0x62')]===_0x257b19){return _0x3b6a57[_0xa341('0x70')]?operators[_0x4f5e76[_0xa341('0x6a')]](_0x4f5e76[_0xa341('0x6b')],_0x3b6a57[_0xa341('0x70')]):![];}break;case _0xa341('0x5d'):return _0x3b6a57[_0xa341('0x5d')]?operators[_0x4f5e76[_0xa341('0x6a')]](_0x4f5e76['value'],_0x3b6a57[_0xa341('0x5d')]):![];case _0xa341('0x71'):return _0x3b6a57['membername']?operators[_0x4f5e76['operator']](_0x4f5e76[_0xa341('0x6b')],_0x3b6a57['membername']):![];case _0xa341('0x72'):return _0x3b6a57[_0xa341('0x72')]?operators[_0x4f5e76[_0xa341('0x6a')]](_0x4f5e76['value'],_0x3b6a57[_0xa341('0x72')]):![];case _0xa341('0x5e'):return _0x3b6a57[_0xa341('0x5e')]?operators[_0x4f5e76['operator']](_0x4f5e76['value'],_0x3b6a57[_0xa341('0x5e')]):![];}return![];};};module[_0xa341('0x73')]=Trigger;
\ No newline at end of file