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 _0x750d=['emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x5a6f19,_0x57e685){var _0x2e0c6e=function(_0x903cf1){while(--_0x903cf1){_0x5a6f19['push'](_0x5a6f19['shift']());}};_0x2e0c6e(++_0x57e685);}(_0x750d,0x112));var _0xd750=function(_0x18b7c6,_0x510bee){_0x18b7c6=_0x18b7c6-0x0;var _0x1d8d79=_0x750d[_0x18b7c6];return _0x1d8d79;};'use strict';var EventEmitter=require(_0xd750('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xd750('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd750('0x2')](0x0);var events={'afterCreate':_0xd750('0x3'),'afterUpdate':_0xd750('0x4'),'afterDestroy':_0xd750('0x5')};function emitEvent(_0x28ad5d){return function(_0x18cd56,_0x294478,_0xd9cbac){WhatsappAccountEvents[_0xd750('0x6')](_0x28ad5d+':'+_0x18cd56['id'],_0x18cd56);WhatsappAccountEvents['emit'](_0x28ad5d,_0x18cd56);_0xd9cbac(null);};}for(var e in events){if(events[_0xd750('0x7')](e)){var event=events[e];WhatsappAccount[_0xd750('0x8')](e,emitEvent(event));}}module[_0xd750('0x9')]=WhatsappAccountEvents;