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 _0x6f1f=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6f1f,0x1bc));var _0xf6f1=function(_0x21be2b,_0x3db162){_0x21be2b=_0x21be2b-0x0;var _0x10932e=_0x6f1f[_0x21be2b];return _0x10932e;};'use strict';var EventEmitter=require(_0xf6f1('0x0'));var WhatsappAccount=require(_0xf6f1('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf6f1('0x2'),'afterUpdate':_0xf6f1('0x3'),'afterDestroy':_0xf6f1('0x4')};function emitEvent(_0x77df6e){return function(_0x3842af,_0x4c7485,_0x2175ce){WhatsappAccountEvents['emit'](_0x77df6e+':'+_0x3842af['id'],_0x3842af);WhatsappAccountEvents[_0xf6f1('0x5')](_0x77df6e,_0x3842af);_0x2175ce(null);};}for(var e in events){if(events[_0xf6f1('0x6')](e)){var event=events[e];WhatsappAccount[_0xf6f1('0x7')](e,emitEvent(event));}}module[_0xf6f1('0x8')]=WhatsappAccountEvents;