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 _0xdbd0=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4bdbbe,_0x29c144){var _0x340998=function(_0x32d56c){while(--_0x32d56c){_0x4bdbbe['push'](_0x4bdbbe['shift']());}};_0x340998(++_0x29c144);}(_0xdbd0,0x88));var _0x0dbd=function(_0x38a9c7,_0x28d3ef){_0x38a9c7=_0x38a9c7-0x0;var _0x2ab87=_0xdbd0[_0x38a9c7];return _0x2ab87;};'use strict';var EventEmitter=require(_0x0dbd('0x0'));var ChatWebsite=require(_0x0dbd('0x1'))['db'][_0x0dbd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0dbd('0x3')](0x0);var events={'afterCreate':_0x0dbd('0x4'),'afterUpdate':'update','afterDestroy':_0x0dbd('0x5')};function emitEvent(_0x190897){return function(_0x1aeffb,_0x5ec8d7,_0x333815){ChatWebsiteEvents[_0x0dbd('0x6')](_0x190897+':'+_0x1aeffb['id'],_0x1aeffb);ChatWebsiteEvents[_0x0dbd('0x6')](_0x190897,_0x1aeffb);_0x333815(null);};}for(var e in events){if(events[_0x0dbd('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;