1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x6ccc=['account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','ChatWebsiteId'];(function(_0x5ec21d,_0x5d0772){var _0x43bde8=function(_0x1bfc7c){while(--_0x1bfc7c){_0x5ec21d['push'](_0x5ec21d['shift']());}};_0x43bde8(++_0x5d0772);}(_0x6ccc,0x197));var _0xc6cc=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0x6ccc[_0x3d6d80];return _0x30712a;};'use strict';var _=require(_0xc6cc('0x0'));var utils=require(_0xc6cc('0x1'));var logger=require('../../../../config/logger')(_0xc6cc('0x2'));var rpc={'chatMessage':require(_0xc6cc('0x3')),'openchannelMessage':require(_0xc6cc('0x4')),'mailMessage':require(_0xc6cc('0x5')),'smsMessage':require(_0xc6cc('0x6')),'faxMessage':require(_0xc6cc('0x7')),'whatsappMessage':require(_0xc6cc('0x8'))};exports['consequence']=function(_0xaf2e1e,_0x343685){return function(_0x254a3a){try{var _0x15013d={'body':utils[_0xc6cc('0x9')](_0x343685[0x0],this),'ContactId':this[_0xc6cc('0xa')]['id']};if(this['channel']===_0xc6cc('0xb')){_0x15013d[_0xc6cc('0xc')]=this[_0xc6cc('0xd')]['id'];}else{_0x15013d[_[_0xc6cc('0xe')](this[_0xc6cc('0xf')])+_0xc6cc('0x10')]=this[_0xc6cc('0xd')]['id'];}_0x15013d[_[_0xc6cc('0xe')](this[_0xc6cc('0xf')])+_0xc6cc('0x11')]=this[_0xc6cc('0x12')]['id'];if(rpc[this[_0xc6cc('0xf')]+_0xc6cc('0x13')]){return rpc[this['channel']+_0xc6cc('0x13')][_0xc6cc('0x14')](_0x15013d)[_0xc6cc('0x15')](function(_0x111721){logger[_0xc6cc('0x16')](_0xc6cc('0x17'),_0xaf2e1e,_0x15013d[_0xc6cc('0x18')]);_0x254a3a[_0xc6cc('0x19')]();})[_0xc6cc('0x1a')](function(_0x3ede18){logger[_0xc6cc('0x1b')](_0xc6cc('0x17'),_0xaf2e1e,JSON[_0xc6cc('0x1c')](_0x3ede18));_0x254a3a[_0xc6cc('0x1d')]();});}}catch(_0xf56c7e){logger[_0xc6cc('0x1b')](_0xc6cc('0x17'),_0xaf2e1e,JSON[_0xc6cc('0x1c')](_0xf56c7e));_0x254a3a[_0xc6cc('0x1d')]();}};};