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 _0xe911=['hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','save','update','remove'];(function(_0x1734f2,_0x50fe4d){var _0x1f0d98=function(_0x218546){while(--_0x218546){_0x1734f2['push'](_0x1734f2['shift']());}};_0x1f0d98(++_0x50fe4d);}(_0xe911,0x81));var _0x1e91=function(_0x3ad1fc,_0x1c21f9){_0x3ad1fc=_0x3ad1fc-0x0;var _0x2a80e7=_0xe911[_0x3ad1fc];return _0x2a80e7;};'use strict';var EventEmitter=require(_0x1e91('0x0'));var Dashboard=require(_0x1e91('0x1'))['db'][_0x1e91('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e91('0x3'),'afterUpdate':_0x1e91('0x4'),'afterDestroy':_0x1e91('0x5')};function emitEvent(_0x1d50af){return function(_0x2f2152,_0x12dd01,_0x15d1d4){DashboardEvents['emit'](_0x1d50af+':'+_0x2f2152['id'],_0x2f2152);DashboardEvents['emit'](_0x1d50af,_0x2f2152);_0x15d1d4(null);};}for(var e in events){if(events[_0x1e91('0x6')](e)){var event=events[e];Dashboard[_0x1e91('0x7')](e,emitEvent(event));}}module[_0x1e91('0x8')]=DashboardEvents;