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 _0xce0d=['events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x36e388,_0x5c77b1){var _0x2db659=function(_0x3da28f){while(--_0x3da28f){_0x36e388['push'](_0x36e388['shift']());}};_0x2db659(++_0x5c77b1);}(_0xce0d,0x19a));var _0xdce0=function(_0x6942e0,_0x131e6d){_0x6942e0=_0x6942e0-0x0;var _0xb86490=_0xce0d[_0x6942e0];return _0xb86490;};'use strict';var EventEmitter=require(_0xdce0('0x0'));var DashboardItem=require(_0xdce0('0x1'))['db'][_0xdce0('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xdce0('0x3')](0x0);var events={'afterCreate':_0xdce0('0x4'),'afterUpdate':_0xdce0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x44eee8){return function(_0x90fac8,_0x3d4fc6,_0x294690){DashboardItemEvents['emit'](_0x44eee8+':'+_0x90fac8['id'],_0x90fac8);DashboardItemEvents[_0xdce0('0x6')](_0x44eee8,_0x90fac8);_0x294690(null);};}for(var e in events){if(events[_0xdce0('0x7')](e)){var event=events[e];DashboardItem[_0xdce0('0x8')](e,emitEvent(event));}}module[_0xdce0('0x9')]=DashboardItemEvents;