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 _0xf725=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x461a1d,_0x4fe2ff){var _0x2fcbdc=function(_0x43f54c){while(--_0x43f54c){_0x461a1d['push'](_0x461a1d['shift']());}};_0x2fcbdc(++_0x4fe2ff);}(_0xf725,0x7e));var _0x5f72=function(_0x531461,_0x446774){_0x531461=_0x531461-0x0;var _0x1501c1=_0xf725[_0x531461];return _0x1501c1;};'use strict';var EventEmitter=require(_0x5f72('0x0'));var ChatWebsite=require(_0x5f72('0x1'))['db'][_0x5f72('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5f72('0x3')](0x0);var events={'afterCreate':_0x5f72('0x4'),'afterUpdate':_0x5f72('0x5'),'afterDestroy':_0x5f72('0x6')};function emitEvent(_0x172588){return function(_0x4200ff,_0x17a5bc,_0x557be3){ChatWebsiteEvents[_0x5f72('0x7')](_0x172588+':'+_0x4200ff['id'],_0x4200ff);ChatWebsiteEvents[_0x5f72('0x7')](_0x172588,_0x4200ff);_0x557be3(null);};}for(var e in events){if(events[_0x5f72('0x8')](e)){var event=events[e];ChatWebsite[_0x5f72('0x9')](e,emitEvent(event));}}module[_0x5f72('0xa')]=ChatWebsiteEvents;