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 _0x87df=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x12813f,_0x38ae10){var _0x313ce3=function(_0x4006fe){while(--_0x4006fe){_0x12813f['push'](_0x12813f['shift']());}};_0x313ce3(++_0x38ae10);}(_0x87df,0x167));var _0xf87d=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0x87df[_0x3fc287];return _0x33af9f;};'use strict';var EventEmitter=require(_0xf87d('0x0'));var ChatWebsite=require(_0xf87d('0x1'))['db'][_0xf87d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf87d('0x3')](0x0);var events={'afterCreate':_0xf87d('0x4'),'afterUpdate':_0xf87d('0x5'),'afterDestroy':_0xf87d('0x6')};function emitEvent(_0xb0fb5a){return function(_0x25290a,_0x1d4ff6,_0x4fbca2){ChatWebsiteEvents['emit'](_0xb0fb5a+':'+_0x25290a['id'],_0x25290a);ChatWebsiteEvents[_0xf87d('0x7')](_0xb0fb5a,_0x25290a);_0x4fbca2(null);};}for(var e in events){if(events[_0xf87d('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xf87d('0x9')]=ChatWebsiteEvents;