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 _0xf385=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f47c7,_0x354f53){var _0x27f4b0=function(_0x45e9dd){while(--_0x45e9dd){_0x4f47c7['push'](_0x4f47c7['shift']());}};_0x27f4b0(++_0x354f53);}(_0xf385,0xab));var _0x5f38=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xf385[_0x7feb90];return _0x3c5b33;};'use strict';var EventEmitter=require(_0x5f38('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5f38('0x1')](0x0);var events={'afterCreate':_0x5f38('0x2'),'afterUpdate':_0x5f38('0x3'),'afterDestroy':_0x5f38('0x4')};function emitEvent(_0x3c4a48){return function(_0x54633a,_0x4ee4af,_0x513138){DashboardItemEvents[_0x5f38('0x5')](_0x3c4a48+':'+_0x54633a['id'],_0x54633a);DashboardItemEvents['emit'](_0x3c4a48,_0x54633a);_0x513138(null);};}for(var e in events){if(events[_0x5f38('0x6')](e)){var event=events[e];DashboardItem[_0x5f38('0x7')](e,emitEvent(event));}}module[_0x5f38('0x8')]=DashboardItemEvents;