97d57f43af6a0a838a0deb897c46340089119e1d
[motion2.git] / server / services / email / realtime / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x48e3=['../model/mailAccount','mailAccounts','mapKeys','mergeFromDatabase','hasOwnProperty','initMailAccounts','length','isUndefined','merge','lodash'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x48e3,0x103));var _0x348e=function(_0x71781c,_0x3ded98){_0x71781c=_0x71781c-0x0;var _0x3386c4=_0x48e3[_0x71781c];return _0x3386c4;};'use strict';var _=require(_0x348e('0x0'));var MailAccount=require(_0x348e('0x1'));var Realtime=function(){this[_0x348e('0x2')]={};};function freeIsNotKey(_0x326867,_0x2f7c1a,_0x25e7c6){var _0x220960=_[_0x348e('0x3')](_0x326867,function(_0x2b56e0,_0x271da1){return _0x2b56e0[_0x25e7c6];});for(var _0x3c74b5 in _0x2f7c1a){if(_0x2f7c1a['hasOwnProperty'](_0x3c74b5)){if(!_0x220960[_0x3c74b5]){delete _0x2f7c1a[_0x3c74b5];}}}}Realtime['prototype'][_0x348e('0x4')]=function(_0x27532a,_0x12d065){for(var _0x46857 in _0x12d065){if(_0x27532a[_0x348e('0x5')](_0x46857)){_0x27532a[_0x46857]=_0x12d065[_0x46857];}}};Realtime['prototype'][_0x348e('0x6')]=function(){var _0x59efaf=this;return function(_0x466fc2){if(_0x466fc2){freeIsNotKey(_0x466fc2,_0x59efaf[_0x348e('0x2')],'id');for(var _0x1c7294=0x0,_0x2904ba={},_0x289833={};_0x1c7294<_0x466fc2[_0x348e('0x7')];_0x1c7294+=0x1){_0x2904ba=_0x466fc2[_0x1c7294];if(_[_0x348e('0x8')](_0x59efaf[_0x348e('0x2')][_0x2904ba['id']])){_0x59efaf[_0x348e('0x2')][_0x2904ba['id']]=new MailAccount(_0x2904ba);}else{_[_0x348e('0x9')](_0x59efaf[_0x348e('0x2')][_0x2904ba['id']],_0x2904ba);}}}return _0x59efaf[_0x348e('0x2')];};};module['exports']=Realtime;