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 _0x1a3f=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x5d590e,_0x5183f8){var _0x4896b4=function(_0x38be8c){while(--_0x38be8c){_0x5d590e['push'](_0x5d590e['shift']());}};_0x4896b4(++_0x5183f8);}(_0x1a3f,0x13f));var _0xf1a3=function(_0x1f86d5,_0x3b1b57){_0x1f86d5=_0x1f86d5-0x0;var _0x4e1e09=_0x1a3f[_0x1f86d5];return _0x4e1e09;};'use strict';var _=require(_0xf1a3('0x0'));var MailAccount=require(_0xf1a3('0x1'));var Realtime=function(){this[_0xf1a3('0x2')]={};};function freeIsNotKey(_0x4bf291,_0x1833d0,_0x15efb0){var _0xfd9758=_[_0xf1a3('0x3')](_0x4bf291,function(_0x5e4cc4,_0x585edd){return _0x5e4cc4[_0x15efb0];});for(var _0x3a65de in _0x1833d0){if(_0x1833d0[_0xf1a3('0x4')](_0x3a65de)){if(!_0xfd9758[_0x3a65de]){delete _0x1833d0[_0x3a65de];}}}}Realtime['prototype'][_0xf1a3('0x5')]=function(_0x1be44e,_0x40ef8a){for(var _0x5042ef in _0x40ef8a){if(_0x1be44e[_0xf1a3('0x4')](_0x5042ef)){_0x1be44e[_0x5042ef]=_0x40ef8a[_0x5042ef];}}};Realtime['prototype'][_0xf1a3('0x6')]=function(){var _0x5cf9f4=this;return function(_0x11f289){if(_0x11f289){freeIsNotKey(_0x11f289,_0x5cf9f4[_0xf1a3('0x2')],'id');for(var _0x2516e0=0x0,_0x17e2a2={},_0x1abaaf={};_0x2516e0<_0x11f289[_0xf1a3('0x7')];_0x2516e0+=0x1){_0x17e2a2=_0x11f289[_0x2516e0];if(_[_0xf1a3('0x8')](_0x5cf9f4['mailAccounts'][_0x17e2a2['id']])){_0x5cf9f4[_0xf1a3('0x2')][_0x17e2a2['id']]=new MailAccount(_0x17e2a2);}else{_[_0xf1a3('0x9')](_0x5cf9f4[_0xf1a3('0x2')][_0x17e2a2['id']],_0x17e2a2);}}}return _0x5cf9f4[_0xf1a3('0x2')];};};module[_0xf1a3('0xa')]=Realtime;