Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / ami / trigger / index.js
index 29f47fa..8939ac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x8deb=['replace','AllConditions','every','channel','AnyConditions','checkConditions','field','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','interaction','value','membername','lastevent','exports','util','lodash','mustache','ioredis','./integration','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','popup','url','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','checkTriggers','interface','checkTrigger','merge','variables','Actions','length','action','toLowerCase','motionbar','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','data6','600','winApplication','winArguments','user:%s','name','format','jscripty','data1','trigger:%s','contactmanager','exec','integration','voiceQueues','queue','routeId','urlforward','script','parse'];(function(_0x279327,_0x2d6788){var _0x4ee042=function(_0xd7aaa1){while(--_0xd7aaa1){_0x279327['push'](_0x279327['shift']());}};_0x4ee042(++_0x2d6788);}(_0x8deb,0xf0));var _0xb8de=function(_0x597d22,_0x278ad4){_0x597d22=_0x597d22-0x0;var _0x3277cc=_0x8deb[_0x597d22];return _0x3277cc;};'use strict';var util=require(_0xb8de('0x0'));var _=require(_0xb8de('0x1'));var url=require('url');var Mustache=require(_0xb8de('0x2'));var Redis=require(_0xb8de('0x3'));var urlforward=require('./urlforward');var integration=require(_0xb8de('0x4'));var cmContact=require('./cmContact');var script=require(_0xb8de('0x5'));var config=require(_0xb8de('0x6'));var logger=require('../../../config/logger')(_0xb8de('0x7'));var ami=require(_0xb8de('0x8'));config[_0xb8de('0x9')]=_[_0xb8de('0xa')](config[_0xb8de('0x9')],{'host':_0xb8de('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb8de('0x9')]));var operators={'equals':function(_0xbe38d6,_0x391ec0){return _0xbe38d6==_0x391ec0;},'not_equals':function(_0x4e6177,_0x19030e){return _0x4e6177!=_0x19030e;}};var barAndWebActions=[_0xb8de('0xc'),_0xb8de('0xd'),'winapp'];function Trigger(_0x1cd7cd){this[_0xb8de('0xe')]=_0x1cd7cd[_0xb8de('0xe')];this['agents']=_0x1cd7cd[_0xb8de('0xf')];this['voiceQueues']=_0x1cd7cd['voiceQueues'];this[_0xb8de('0x10')]=_0x1cd7cd[_0xb8de('0x10')];this[_0xb8de('0x11')]=_0x1cd7cd[_0xb8de('0x11')];this[_0xb8de('0x12')]=_0x1cd7cd[_0xb8de('0x12')];this[_0xb8de('0x13')]=_0x1cd7cd[_0xb8de('0x13')];this[_0xb8de('0x14')]=_0x1cd7cd[_0xb8de('0x14')];this[_0xb8de('0x15')]=_0x1cd7cd['sugarcrmAccounts'];this[_0xb8de('0x16')]=_0x1cd7cd[_0xb8de('0x16')];this[_0xb8de('0x17')]=_0x1cd7cd[_0xb8de('0x17')];this['vtigerAccounts']=_0x1cd7cd['vtigerAccounts'];this[_0xb8de('0x18')]=_0x1cd7cd['servicenowAccounts'];this[_0xb8de('0x19')]=_0x1cd7cd[_0xb8de('0x19')];this[_0xb8de('0x1a')]=_0x1cd7cd[_0xb8de('0x1a')];this['accounts']={'zendesk':this[_0xb8de('0x12')],'salesforce':this[_0xb8de('0x14')],'freshdesk':this[_0xb8de('0x13')],'sugarcrm':this[_0xb8de('0x15')],'zoho':this[_0xb8de('0x16')],'desk':this[_0xb8de('0x17')],'vtiger':this[_0xb8de('0x1b')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xb8de('0x1a')],'servicenow':this[_0xb8de('0x18')]};ami['on'](_0xb8de('0x1c'),this[_0xb8de('0x1d')]['bind'](this));ami['on'](_0xb8de('0x1e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentringnoanswer',this[_0xb8de('0x1d')]['bind'](this));ami['on']('custom:agentcomplete',this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x20'),this['syncCustomEvent'][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x21'),this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x22'),this['syncCustomEvent'][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x23'),this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on']('custom:agentreject',this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x24'),this[_0xb8de('0x1d')]['bind'](this));ami['on'](_0xb8de('0x25'),this[_0xb8de('0x1d')]['bind'](this));ami['on'](_0xb8de('0x26'),this[_0xb8de('0x27')][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x28'),this[_0xb8de('0x27')][_0xb8de('0x1f')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0xb8de('0x1f')](this));ami['on']('custom:newinteraction',this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0xb8de('0x29'),this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x2a'),this['syncCustomEvent'][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x2b'),this[_0xb8de('0x1d')][_0xb8de('0x1f')](this));ami['on'](_0xb8de('0x2c'),this['syncCustomEvent'][_0xb8de('0x1f')](this));}Trigger[_0xb8de('0x2d')][_0xb8de('0x2e')]=function(_0x613b67,_0x5c24d6,_0x33b0a8){logger['info'](_0x613b67,_0x5c24d6,JSON[_0xb8de('0x2f')](_0x33b0a8));io['to'](_0x613b67)[_0xb8de('0x2e')](_0x5c24d6,_0x33b0a8);};Trigger[_0xb8de('0x2d')][_0xb8de('0x1d')]=function(_0x3c43b8){var _0x5a0076=_[_0xb8de('0x30')](_0x3c43b8);this[_0xb8de('0x31')](_0x5a0076);};Trigger[_0xb8de('0x2d')][_0xb8de('0x27')]=function(_0x495731){if(this[_0xb8de('0xf')][_0x495731[_0xb8de('0x32')]]){this[_0xb8de('0x1d')](_0x495731);}};Trigger['prototype']['checkTriggers']=function(_0xb2e588){var _0x156486;for(var _0x2489b5 in this[_0xb8de('0xe')]){if(this['triggers']['hasOwnProperty'](_0x2489b5)){if(this['triggers'][_0x2489b5]['status']){_0x156486=this[_0xb8de('0x33')](this['triggers'][_0x2489b5],_0xb2e588);if(_0x156486){_[_0xb8de('0x34')](_0xb2e588,_0xb2e588[_0xb8de('0x35')]);for(var _0x571e04=0x0,_0x4d0d5b,_0x8b29a9,_0x4c2f14;_0x571e04<this[_0xb8de('0xe')][_0x2489b5][_0xb8de('0x36')][_0xb8de('0x37')];_0x571e04+=0x1){_0x4d0d5b=this[_0xb8de('0xe')][_0x2489b5][_0xb8de('0x36')][_0x571e04];if(this[_0xb8de('0xf')][_0xb2e588['interface']]){switch(_0x4d0d5b[_0xb8de('0x38')][_0xb8de('0x39')]()){case'contactmanager':break;case _0xb8de('0x3a'):case'browser':var _0x2f2859={};switch(barAndWebActions[_0x4d0d5b['data1']]){case _0xb8de('0xc'):_0x2f2859[_0xb8de('0x3b')]=_0x4d0d5b[_0xb8de('0x3c')];_0x2f2859[_0xb8de('0x3d')]=this['templates'][_0x4d0d5b[_0xb8de('0x3c')]]?Mustache[_0xb8de('0x3e')](this['templates'][_0x4d0d5b['data2']][_0xb8de('0x3d')],_0xb2e588):_0xb8de('0x3f');break;case _0xb8de('0xd'):_0x2f2859[_0xb8de('0x40')]=this[_0xb8de('0x41')](_0x4d0d5b['data2'],_0xb2e588,_['isNil'](_0x4d0d5b[_0xb8de('0x42')])?!![]:parseInt(_0x4d0d5b[_0xb8de('0x42')],0xa));if(_[_0xb8de('0x43')](_0x4d0d5b[_0xb8de('0x44')])){_0x2f2859[_0xb8de('0x45')]='0';}else{_0x2f2859[_0xb8de('0x46')]=_0x4d0d5b['data4'];_0x2f2859[_0xb8de('0x47')]=_[_0xb8de('0x43')](_0x4d0d5b[_0xb8de('0x48')])?_0xb8de('0x49'):_0x4d0d5b[_0xb8de('0x48')];_0x2f2859['windowHeight']=_['isNil'](_0x4d0d5b[_0xb8de('0x4a')])?_0xb8de('0x4b'):_0x4d0d5b[_0xb8de('0x4a')];}break;case'winapp':_0x2f2859[_0xb8de('0x4c')]=_0x4d0d5b['data2']?Mustache['render'](_0x4d0d5b['data2'],_0xb2e588):'';_0x2f2859[_0xb8de('0x4d')]=_0x4d0d5b[_0xb8de('0x42')]?Mustache[_0xb8de('0x3e')](_0x4d0d5b[_0xb8de('0x42')],_0xb2e588):'';break;}this['emit'](util['format'](_0xb8de('0x4e'),this['agents'][_0xb2e588[_0xb8de('0x32')]][_0xb8de('0x4f')]),util[_0xb8de('0x50')]('trigger:%s:%s',_0x4d0d5b[_0xb8de('0x38')][_0xb8de('0x39')](),barAndWebActions[_0x4d0d5b['data1']]),_[_0xb8de('0x34')](_0x2f2859,_0xb2e588));break;case _0xb8de('0x51'):this[_0xb8de('0x2e')](util[_0xb8de('0x50')](_0xb8de('0x4e'),this['agents'][_0xb2e588['interface']][_0xb8de('0x4f')]),util[_0xb8de('0x50')]('trigger:%s',_0x4d0d5b['action'][_0xb8de('0x39')]()),_[_0xb8de('0x34')]({'ProjectId':parseInt(_0x4d0d5b[_0xb8de('0x52')],0xa)},_0xb2e588));break;default:this['emit'](util[_0xb8de('0x50')](_0xb8de('0x4e'),this[_0xb8de('0xf')][_0xb2e588[_0xb8de('0x32')]][_0xb8de('0x4f')]),util[_0xb8de('0x50')](_0xb8de('0x53'),_0x4d0d5b[_0xb8de('0x38')]['toLowerCase']()),_['merge']({},_0x4d0d5b,_0xb2e588));}}switch(_0x4d0d5b['action'][_0xb8de('0x39')]()){case _0xb8de('0x54'):cmContact[_0xb8de('0x55')](this[_0xb8de('0xf')][_0xb2e588[_0xb8de('0x32')]],this[_0xb8de('0xe')][_0x2489b5],_0x4d0d5b,_0xb2e588);break;case _0xb8de('0x56'):integration[_0xb8de('0x55')](_0x4d0d5b,_0xb2e588,this['accounts'],this[_0xb8de('0xf')][_0xb2e588[_0xb8de('0x32')]],this[_0xb8de('0x57')][_0xb2e588[_0xb8de('0x58')]],this[_0xb8de('0x11')][_0xb2e588[_0xb8de('0x59')]]);break;case _0xb8de('0x5a'):urlforward[_0xb8de('0x55')](_0x4d0d5b,_0xb2e588);break;case _0xb8de('0x5b'):script[_0xb8de('0x55')](_0x4d0d5b,_0xb2e588);break;}}}}}}};Trigger[_0xb8de('0x2d')][_0xb8de('0x41')]=function(_0x29bd36,_0x28c9eb,_0x7588ed){var _0x3817da=url[_0xb8de('0x5c')](Mustache[_0xb8de('0x3e')](_0x29bd36,_0x28c9eb),!![]);if(_0x7588ed){_[_0xb8de('0x34')](_0x3817da['query'],_0x28c9eb);}delete _0x3817da['search'];var _0x985d0a=url[_0xb8de('0x50')](_0x3817da);_0x985d0a=_0x985d0a[_0xb8de('0x5d')](/\/\?/g,'?');return _0x985d0a;};Trigger[_0xb8de('0x2d')][_0xb8de('0x33')]=function(_0x1ab51c,_0x305635){var _0x4a703f=!![],_0x1784eb=!![];if(_0x1ab51c[_0xb8de('0x5e')][_0xb8de('0x37')]){_0x4a703f=_[_0xb8de('0x5f')](_0x1ab51c[_0xb8de('0x5e')],this['checkConditions'](_0x305635,_0x1ab51c[_0xb8de('0x60')]));}if(_0x1ab51c['AnyConditions'][_0xb8de('0x37')]){_0x1784eb=_['some'](_0x1ab51c[_0xb8de('0x61')],this[_0xb8de('0x62')](_0x305635,_0x1ab51c['channel']));}return _0x4a703f&&_0x1784eb;};Trigger[_0xb8de('0x2d')][_0xb8de('0x62')]=function(_0x24ee5a,_0x32841c){return function(_0x468b0e){switch(_0x468b0e[_0xb8de('0x63')]){case _0xb8de('0x64'):if(_0x24ee5a[_0xb8de('0x60')]===_0x32841c){if(_0x32841c===_0xb8de('0x65')){return _0x24ee5a[_0xb8de('0x66')]?operators[_0x468b0e[_0xb8de('0x67')]](Number(_0x468b0e['value']),_0x24ee5a[_0xb8de('0x66')]):![];}else{return _0x24ee5a[_[_0xb8de('0x68')](_0x32841c)+_0xb8de('0x69')]?operators[_0x468b0e[_0xb8de('0x67')]](Number(_0x468b0e['value']),_0x24ee5a[_['upperFirst'](_0x32841c)+'AccountId']):![];}}break;case _0xb8de('0x6a'):case'message':if(_0x24ee5a['channel']===_0x32841c){return _0x24ee5a['event']?operators[_0x468b0e['operator']](_0x468b0e[_0xb8de('0x6b')],_0x24ee5a['event']):![];}break;case'queue':return _0x24ee5a[_0xb8de('0x58')]?operators[_0x468b0e[_0xb8de('0x67')]](_0x468b0e[_0xb8de('0x6b')],_0x24ee5a[_0xb8de('0x58')]):![];case'agent':return _0x24ee5a['membername']?operators[_0x468b0e['operator']](_0x468b0e[_0xb8de('0x6b')],_0x24ee5a[_0xb8de('0x6c')]):![];case _0xb8de('0x6d'):return _0x24ee5a[_0xb8de('0x6d')]?operators[_0x468b0e[_0xb8de('0x67')]](_0x468b0e[_0xb8de('0x6b')],_0x24ee5a['lastevent']):![];case'routeId':return _0x24ee5a[_0xb8de('0x59')]?operators[_0x468b0e[_0xb8de('0x67')]](_0x468b0e[_0xb8de('0x6b')],_0x24ee5a[_0xb8de('0x59')]):![];}return![];};};module[_0xb8de('0x6e')]=Trigger;
\ No newline at end of file