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 _0xc2ce=['events','../../mysqldb','Dashboard','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3d6ad6,_0x140880){var _0x4b593a=function(_0x3d7e0a){while(--_0x3d7e0a){_0x3d6ad6['push'](_0x3d6ad6['shift']());}};_0x4b593a(++_0x140880);}(_0xc2ce,0x75));var _0xec2c=function(_0x4ea955,_0x1eda76){_0x4ea955=_0x4ea955-0x0;var _0x558561=_0xc2ce[_0x4ea955];return _0x558561;};'use strict';var EventEmitter=require(_0xec2c('0x0'));var Dashboard=require(_0xec2c('0x1'))['db'][_0xec2c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xec2c('0x3'),'afterDestroy':_0xec2c('0x4')};function emitEvent(_0x427157){return function(_0x500767,_0x826b5e,_0x301aab){DashboardEvents[_0xec2c('0x5')](_0x427157+':'+_0x500767['id'],_0x500767);DashboardEvents[_0xec2c('0x5')](_0x427157,_0x500767);_0x301aab(null);};}for(var e in events){if(events[_0xec2c('0x6')](e)){var event=events[e];Dashboard[_0xec2c('0x7')](e,emitEvent(event));}}module[_0xec2c('0x8')]=DashboardEvents;