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 _0xa4fb=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit'];(function(_0x3ca750,_0x24db41){var _0x7e850a=function(_0x3ab0f0){while(--_0x3ab0f0){_0x3ca750['push'](_0x3ca750['shift']());}};_0x7e850a(++_0x24db41);}(_0xa4fb,0x150));var _0xba4f=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0xa4fb[_0x58d5ac];return _0x37985c;};'use strict';var EventEmitter=require(_0xba4f('0x0'));var ChatWebsite=require(_0xba4f('0x1'))['db'][_0xba4f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xba4f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xba4f('0x4')};function emitEvent(_0x196e5b){return function(_0x27a519,_0x4ac34c,_0x413f97){ChatWebsiteEvents[_0xba4f('0x5')](_0x196e5b+':'+_0x27a519['id'],_0x27a519);ChatWebsiteEvents[_0xba4f('0x5')](_0x196e5b,_0x27a519);_0x413f97(null);};}for(var e in events){if(events[_0xba4f('0x6')](e)){var event=events[e];ChatWebsite[_0xba4f('0x7')](e,emitEvent(event));}}module[_0xba4f('0x8')]=ChatWebsiteEvents;