From 33b3be62ef81bc626fdbb2cfec72dfefbe861e33 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Sat, 7 Dec 2013 02:45:46 +0400 Subject: [PATCH] Prevent to check empty folder name --- dev/Boots/RainLoopApp.js | 143 +++++++++++++------------ dev/Screens/MailBox.js | 4 +- rainloop/v/0.0.0/static/js/app.js | 147 +++++++++++++------------- rainloop/v/0.0.0/static/js/app.min.js | 2 +- 4 files changed, 151 insertions(+), 145 deletions(-) diff --git a/dev/Boots/RainLoopApp.js b/dev/Boots/RainLoopApp.js index 3ec3a11b8..78282bde3 100644 --- a/dev/Boots/RainLoopApp.js +++ b/dev/Boots/RainLoopApp.js @@ -238,96 +238,99 @@ RainLoopApp.prototype.quota = function () */ RainLoopApp.prototype.folderInformation = function (sFolder, aList) { - this.remote().folderInformation(function (sResult, oData) { - if (Enums.StorageResultType.Success === sResult) - { - if (oData && oData.Result && oData.Result.Hash && oData.Result.Folder) + if ('' !== Utils.trim(sFolder)) + { + this.remote().folderInformation(function (sResult, oData) { + if (Enums.StorageResultType.Success === sResult) { - var - sHash = RL.cache().getFolderHash(oData.Result.Folder), - oFolder = RL.cache().getFolderFromCacheList(oData.Result.Folder), - bCheck = false, - sUid = '', - aList = [], - bUnreadCountChange = false, - oFlags = null - ; - - if (oFolder) + if (oData && oData.Result && oData.Result.Hash && oData.Result.Folder) { - if (oData.Result.Hash) - { - RL.cache().setFolderHash(oData.Result.Folder, oData.Result.Hash); - } + var + sHash = RL.cache().getFolderHash(oData.Result.Folder), + oFolder = RL.cache().getFolderFromCacheList(oData.Result.Folder), + bCheck = false, + sUid = '', + aList = [], + bUnreadCountChange = false, + oFlags = null + ; - if (Utils.isNormal(oData.Result.MessageCount)) + if (oFolder) { - oFolder.messageCountAll(oData.Result.MessageCount); - } - - if (Utils.isNormal(oData.Result.MessageUnseenCount)) - { - if (Utils.pInt(oFolder.messageCountUnread()) !== Utils.pInt(oData.Result.MessageUnseenCount)) + if (oData.Result.Hash) { - bUnreadCountChange = true; + RL.cache().setFolderHash(oData.Result.Folder, oData.Result.Hash); } - - oFolder.messageCountUnread(oData.Result.MessageUnseenCount); - } - if (bUnreadCountChange) - { - RL.cache().clearMessageFlagsFromCacheByFolder(oFolder.fullNameRaw); - } - - if (oData.Result.Flags) - { - for (sUid in oData.Result.Flags) + if (Utils.isNormal(oData.Result.MessageCount)) { - if (oData.Result.Flags.hasOwnProperty(sUid)) + oFolder.messageCountAll(oData.Result.MessageCount); + } + + if (Utils.isNormal(oData.Result.MessageUnseenCount)) + { + if (Utils.pInt(oFolder.messageCountUnread()) !== Utils.pInt(oData.Result.MessageUnseenCount)) { - bCheck = true; - oFlags = oData.Result.Flags[sUid]; - RL.cache().storeMessageFlagsToCacheByFolderAndUid(oFolder.fullNameRaw, sUid.toString(), [ - !oFlags['IsSeen'], !!oFlags['IsFlagged'], !!oFlags['IsAnswered'], !!oFlags['IsForwarded'] - ]); + bUnreadCountChange = true; + } + + oFolder.messageCountUnread(oData.Result.MessageUnseenCount); + } + + if (bUnreadCountChange) + { + RL.cache().clearMessageFlagsFromCacheByFolder(oFolder.fullNameRaw); + } + + if (oData.Result.Flags) + { + for (sUid in oData.Result.Flags) + { + if (oData.Result.Flags.hasOwnProperty(sUid)) + { + bCheck = true; + oFlags = oData.Result.Flags[sUid]; + RL.cache().storeMessageFlagsToCacheByFolderAndUid(oFolder.fullNameRaw, sUid.toString(), [ + !oFlags['IsSeen'], !!oFlags['IsFlagged'], !!oFlags['IsAnswered'], !!oFlags['IsForwarded'] + ]); + } + } + + if (bCheck) + { + RL.reloadFlagsCurrentMessageListAndMessageFromCache(); } } - if (bCheck) - { - RL.reloadFlagsCurrentMessageListAndMessageFromCache(); - } - } + RL.data().initUidNextAndNewMessages(oFolder.fullNameRaw, oData.Result.UidNext, oData.Result.NewMessages); - RL.data().initUidNextAndNewMessages(oFolder.fullNameRaw, oData.Result.UidNext, oData.Result.NewMessages); - - if (oData.Result.Hash !== sHash || '' === sHash) - { - if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) + if (oData.Result.Hash !== sHash || '' === sHash) { - RL.reloadMessageList(); - } - else if ('INBOX' === oFolder.fullNameRaw) - { - RL.recacheInboxMessageList(); - } - } - else if (bUnreadCountChange) - { - if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) - { - aList = RL.data().messageList(); - if (Utils.isNonEmptyArray(aList)) + if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) { - RL.folderInformation(oFolder.fullNameRaw, aList); + RL.reloadMessageList(); + } + else if ('INBOX' === oFolder.fullNameRaw) + { + RL.recacheInboxMessageList(); + } + } + else if (bUnreadCountChange) + { + if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) + { + aList = RL.data().messageList(); + if (Utils.isNonEmptyArray(aList)) + { + RL.folderInformation(oFolder.fullNameRaw, aList); + } } } } } } - } - }, sFolder, aList); + }, sFolder, aList); + } }; RainLoopApp.prototype.setMessageSeen = function (oMessage) diff --git a/dev/Screens/MailBox.js b/dev/Screens/MailBox.js index a4e302f5f..d68d97615 100644 --- a/dev/Screens/MailBox.js +++ b/dev/Screens/MailBox.js @@ -78,7 +78,7 @@ MailBoxScreen.prototype.onStart = function () _.delay(function () { var sFolder = RL.data().spamFolder(); - if (sFolder !== oData.currentFolderFullNameRaw()) + if (sFolder !== oData.currentFolderFullNameRaw() && '' !== sFolder) { RL.folderInformation(sFolder); } @@ -86,7 +86,7 @@ MailBoxScreen.prototype.onStart = function () _.delay(function () { var sFolder = RL.data().draftFolder(); - if (sFolder !== oData.currentFolderFullNameRaw()) + if (sFolder !== oData.currentFolderFullNameRaw() && '' !== sFolder) { RL.folderInformation(sFolder); } diff --git a/rainloop/v/0.0.0/static/js/app.js b/rainloop/v/0.0.0/static/js/app.js index a4facda35..aa9005d3f 100644 --- a/rainloop/v/0.0.0/static/js/app.js +++ b/rainloop/v/0.0.0/static/js/app.js @@ -15129,7 +15129,7 @@ MailBoxScreen.prototype.onStart = function () _.delay(function () { var sFolder = RL.data().spamFolder(); - if (sFolder !== oData.currentFolderFullNameRaw()) + if (sFolder !== oData.currentFolderFullNameRaw() && '' !== sFolder) { RL.folderInformation(sFolder); } @@ -15137,7 +15137,7 @@ MailBoxScreen.prototype.onStart = function () _.delay(function () { var sFolder = RL.data().draftFolder(); - if (sFolder !== oData.currentFolderFullNameRaw()) + if (sFolder !== oData.currentFolderFullNameRaw() && '' !== sFolder) { RL.folderInformation(sFolder); } @@ -15701,96 +15701,99 @@ RainLoopApp.prototype.quota = function () */ RainLoopApp.prototype.folderInformation = function (sFolder, aList) { - this.remote().folderInformation(function (sResult, oData) { - if (Enums.StorageResultType.Success === sResult) - { - if (oData && oData.Result && oData.Result.Hash && oData.Result.Folder) + if ('' !== Utils.trim(sFolder)) + { + this.remote().folderInformation(function (sResult, oData) { + if (Enums.StorageResultType.Success === sResult) { - var - sHash = RL.cache().getFolderHash(oData.Result.Folder), - oFolder = RL.cache().getFolderFromCacheList(oData.Result.Folder), - bCheck = false, - sUid = '', - aList = [], - bUnreadCountChange = false, - oFlags = null - ; - - if (oFolder) + if (oData && oData.Result && oData.Result.Hash && oData.Result.Folder) { - if (oData.Result.Hash) - { - RL.cache().setFolderHash(oData.Result.Folder, oData.Result.Hash); - } + var + sHash = RL.cache().getFolderHash(oData.Result.Folder), + oFolder = RL.cache().getFolderFromCacheList(oData.Result.Folder), + bCheck = false, + sUid = '', + aList = [], + bUnreadCountChange = false, + oFlags = null + ; - if (Utils.isNormal(oData.Result.MessageCount)) + if (oFolder) { - oFolder.messageCountAll(oData.Result.MessageCount); - } - - if (Utils.isNormal(oData.Result.MessageUnseenCount)) - { - if (Utils.pInt(oFolder.messageCountUnread()) !== Utils.pInt(oData.Result.MessageUnseenCount)) + if (oData.Result.Hash) { - bUnreadCountChange = true; + RL.cache().setFolderHash(oData.Result.Folder, oData.Result.Hash); } - - oFolder.messageCountUnread(oData.Result.MessageUnseenCount); - } - if (bUnreadCountChange) - { - RL.cache().clearMessageFlagsFromCacheByFolder(oFolder.fullNameRaw); - } - - if (oData.Result.Flags) - { - for (sUid in oData.Result.Flags) + if (Utils.isNormal(oData.Result.MessageCount)) { - if (oData.Result.Flags.hasOwnProperty(sUid)) + oFolder.messageCountAll(oData.Result.MessageCount); + } + + if (Utils.isNormal(oData.Result.MessageUnseenCount)) + { + if (Utils.pInt(oFolder.messageCountUnread()) !== Utils.pInt(oData.Result.MessageUnseenCount)) { - bCheck = true; - oFlags = oData.Result.Flags[sUid]; - RL.cache().storeMessageFlagsToCacheByFolderAndUid(oFolder.fullNameRaw, sUid.toString(), [ - !oFlags['IsSeen'], !!oFlags['IsFlagged'], !!oFlags['IsAnswered'], !!oFlags['IsForwarded'] - ]); + bUnreadCountChange = true; + } + + oFolder.messageCountUnread(oData.Result.MessageUnseenCount); + } + + if (bUnreadCountChange) + { + RL.cache().clearMessageFlagsFromCacheByFolder(oFolder.fullNameRaw); + } + + if (oData.Result.Flags) + { + for (sUid in oData.Result.Flags) + { + if (oData.Result.Flags.hasOwnProperty(sUid)) + { + bCheck = true; + oFlags = oData.Result.Flags[sUid]; + RL.cache().storeMessageFlagsToCacheByFolderAndUid(oFolder.fullNameRaw, sUid.toString(), [ + !oFlags['IsSeen'], !!oFlags['IsFlagged'], !!oFlags['IsAnswered'], !!oFlags['IsForwarded'] + ]); + } + } + + if (bCheck) + { + RL.reloadFlagsCurrentMessageListAndMessageFromCache(); } } - if (bCheck) - { - RL.reloadFlagsCurrentMessageListAndMessageFromCache(); - } - } + RL.data().initUidNextAndNewMessages(oFolder.fullNameRaw, oData.Result.UidNext, oData.Result.NewMessages); - RL.data().initUidNextAndNewMessages(oFolder.fullNameRaw, oData.Result.UidNext, oData.Result.NewMessages); - - if (oData.Result.Hash !== sHash || '' === sHash) - { - if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) + if (oData.Result.Hash !== sHash || '' === sHash) { - RL.reloadMessageList(); - } - else if ('INBOX' === oFolder.fullNameRaw) - { - RL.recacheInboxMessageList(); - } - } - else if (bUnreadCountChange) - { - if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) - { - aList = RL.data().messageList(); - if (Utils.isNonEmptyArray(aList)) + if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) { - RL.folderInformation(oFolder.fullNameRaw, aList); + RL.reloadMessageList(); + } + else if ('INBOX' === oFolder.fullNameRaw) + { + RL.recacheInboxMessageList(); + } + } + else if (bUnreadCountChange) + { + if (oFolder.fullNameRaw === RL.data().currentFolderFullNameRaw()) + { + aList = RL.data().messageList(); + if (Utils.isNonEmptyArray(aList)) + { + RL.folderInformation(oFolder.fullNameRaw, aList); + } } } } } } - } - }, sFolder, aList); + }, sFolder, aList); + } }; RainLoopApp.prototype.setMessageSeen = function (oMessage) diff --git a/rainloop/v/0.0.0/static/js/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index 64debb32d..52bc0fe41 100644 --- a/rainloop/v/0.0.0/static/js/app.min.js +++ b/rainloop/v/0.0.0/static/js/app.min.js @@ -5,4 +5,4 @@ else if(0>=b)break;3===b?h(2,!1):b>3&&h(Math.round((b-1)/2),!1,"..."),g-2===c?h( })),f.append("
")}),e.hide(),function(f,h,i){d||(e.appendTo(i),d=!0),g=h,c.unbind("click.fpNamespace"),a.setTimeout(function(){c.one("click.fpNamespace",function(){e.hide()})},500);var j=b(f).position();e.css("top",5+j.top+b(f).height()+"px").css("left",j.left+"px").show()}}(),j.htmlColorPicker=function(){var c=b(a.document),d=!1,e=b('
'),f=e.find(".editorCpColors"),g=function(){};return b.each(j.htmlColorPickerColors,function(a,b){f.append('')}),e.hide(),b(".editorCpColor",f).click(function(a){var c=1,d="#000000",e=b(a.target).css("background-color"),f=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(null!==f){for(delete f[0];3>=c;++c)f[c]=ob.pInt(f[c]).toString(16),1===f[c].length&&(f[c]="0"+f[c]);d="#"+f.join("")}else d=e;g(d)}),function(f,h,i){d||(e.appendTo(i),d=!0);var j=b(f).position();g=h,c.unbind("click.cpNamespace"),a.setTimeout(function(){c.one("click.cpNamespace",function(){e.hide()})},100),e.css("top",5+j.top+b(f).height()+"px").css("left",j.left+"px").show()}}(),j.htmlFunctions={bold:function(){this.ec("bold")},italic:function(){this.ec("italic")},underline:function(){this.ec("underline")},strikethrough:function(){this.ec("strikethrough")},indent:function(){this.ec("indent")},outdent:function(){this.ec("outdent")},justifyleft:function(){this.ec("justifyLeft")},justifycenter:function(){this.ec("justifyCenter")},justifyright:function(){this.ec("justifyRight")},horizontalrule:function(){this.ec("insertHorizontalRule",!1,"ht")},removeformat:function(){this.ec("removeFormat")},orderedlist:function(){this.ec("insertorderedlist")},unorderedlist:function(){this.ec("insertunorderedlist")},forecolor:function(a){j.htmlColorPicker(a,h.bind(function(a){this.setcolor("forecolor",a)},this),this.toolbar)},backcolor:function(a){j.htmlColorPicker(a,h.bind(function(a){this.setcolor("backcolor",a)},this),this.toolbar)},fontname:function(a){j.htmlFontPicker(a,h.bind(function(a){this.ec("fontname",!1,a)},this),this.toolbar)}},k.prototype.selectItemCallbacks=function(a){(this.oCallbacks.onItemSelect||this.emptyFunction)(a)},k.prototype.init=function(d,e){if(this.oContentVisible=d,this.oContentScrollable=e,this.oContentVisible&&this.oContentScrollable){var f=this;b(this.oContentVisible).on("click",this.sItemSelector,function(a){f.actionClick(c.dataFor(this),a)}).on("click",this.sItemCheckedSelector,function(a){var b=c.dataFor(this);b&&(a&&a.shiftKey?f.actionClick(b,a):(f.sLastUid=f.getItemUid(b),b.selected()?(b.checked(!1),f.selectedItem(null)):b.checked(!b.checked())))}),b(a.document).on("keydown",function(a){var b=!0;return a&&f.bUseKeyboard&&!ob.inFocus()&&(-10)if(m){if(m)if(mb.EventKeyCode.Down===b||mb.EventKeyCode.Up===b||mb.EventKeyCode.Insert===b)h.each(k,function(a){if(!i)switch(b){case mb.EventKeyCode.Up:m===a?i=!0:j=a;break;case mb.EventKeyCode.Down:case mb.EventKeyCode.Insert:g?(j=a,i=!0):m===a&&(g=!0)}});else if(mb.EventKeyCode.Home===b||mb.EventKeyCode.End===b)mb.EventKeyCode.Home===b?j=k[0]:mb.EventKeyCode.End===b&&(j=k[k.length-1]);else if(mb.EventKeyCode.PageDown===b){for(;l>e;e++)if(m===k[e]){e+=f,e=e>l-1?l-1:e,j=k[e];break}}else if(mb.EventKeyCode.PageUp===b)for(e=l;e>=0;e--)if(m===k[e]){e-=f,e=0>e?0:e,j=k[e];break}}else mb.EventKeyCode.Down===b||mb.EventKeyCode.Insert===b||mb.EventKeyCode.Home===b||mb.EventKeyCode.PageUp===b?j=k[0]:(mb.EventKeyCode.Up===b||mb.EventKeyCode.End===b||mb.EventKeyCode.PageDown===b)&&(j=k[k.length-1]);j?(m&&(c?(mb.EventKeyCode.Up===b||mb.EventKeyCode.Down===b)&&m.checked(!m.checked()):mb.EventKeyCode.Insert===b&&m.checked(!m.checked())),this.throttleSelection=!0,this.selectedItem(j),this.throttleSelection=!0,0!==this.iSelectTimer?(a.clearTimeout(this.iSelectTimer),this.iSelectTimer=a.setTimeout(function(){d.iSelectTimer=0,d.actionClick(j)},1e3)):(this.iSelectTimer=a.setTimeout(function(){d.iSelectTimer=0},200),this.actionClick(j)),this.scrollToSelected()):m&&(!c||mb.EventKeyCode.Up!==b&&mb.EventKeyCode.Down!==b?mb.EventKeyCode.Insert===b&&m.checked(!m.checked()):m.checked(!m.checked()))},k.prototype.scrollToSelected=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var a=20,c=b(this.sItemSelectedSelector,this.oContentScrollable),d=c.position(),e=this.oContentVisible.height(),f=c.outerHeight();return d&&(d.top<0||d.top+f>e)?(d.top<0?this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+d.top-a):this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+d.top-e+f+a),!0):!1},k.prototype.eventClickFunction=function(a,b){var c=this.getItemUid(a),d=0,e=0,f=null,g="",h=!1,i=!1,j=[],k=!1;if(b&&b.shiftKey&&""!==c&&""!==this.sLastUid&&c!==this.sLastUid)for(j=this.list(),k=a.checked(),d=0,e=j.length;e>d;d++)f=j[d],g=this.getItemUid(f),h=!1,(g===this.sLastUid||g===c)&&(h=!0),h&&(i=!i),(i||h)&&f.checked(k);this.sLastUid=""===c?"":c},k.prototype.actionClick=function(a,b){if(a){var c=!0,d=this.getItemUid(a);b&&(b.shiftKey?(c=!1,""===this.sLastUid&&(this.sLastUid=d),a.checked(!a.checked()),this.eventClickFunction(a,b)):b.ctrlKey&&(c=!1,this.sLastUid=d,a.checked(!a.checked()))),c&&(this.selectedItem(a),this.sLastUid=d)}},k.prototype.on=function(a,b){this.oCallbacks[a]=b},l.supported=function(){return!0},l.prototype.set=function(a,c){var d=b.cookie(lb.Values.ClientSideCookieIndexName),e=!1,f=null;try{f=null===d?null:JSON.parse(d),f||(f={}),f[a]=c,b.cookie(lb.Values.ClientSideCookieIndexName,JSON.stringify(f),{expires:30}),e=!0}catch(g){}return e},l.prototype.get=function(a){var c=b.cookie(lb.Values.ClientSideCookieIndexName),d=null;try{d=null===c?null:JSON.parse(c),d=d&&!ob.isUnd(d[a])?d[a]:null}catch(e){}return d},m.supported=function(){return!!a.localStorage},m.prototype.set=function(b,c){var d=a.localStorage[lb.Values.ClientSideCookieIndexName]||null,e=!1,f=null;try{f=null===d?null:JSON.parse(d),f||(f={}),f[b]=c,a.localStorage[lb.Values.ClientSideCookieIndexName]=JSON.stringify(f),e=!0}catch(g){}return e},m.prototype.get=function(b){var c=a.localStorage[lb.Values.ClientSideCookieIndexName]||null,d=null;try{d=null===c?null:JSON.parse(c),d=d&&!ob.isUnd(d[b])?d[b]:null}catch(e){}return d},n.prototype.oDriver=null,n.prototype.set=function(a,b){return this.oDriver?this.oDriver.set("p"+a,b):!1},n.prototype.get=function(a){return this.oDriver?this.oDriver.get("p"+a):null},o.prototype.bootstart=function(){},p.prototype.sPosition="",p.prototype.sTemplate="",p.prototype.viewModelName="",p.prototype.viewModelDom=null,p.prototype.viewModelTemplate=function(){return this.sTemplate},p.prototype.viewModelPosition=function(){return this.sPosition},p.prototype.cancelCommand=p.prototype.closeCommand=function(){},q.prototype.oCross=null,q.prototype.sScreenName="",q.prototype.aViewModels=[],q.prototype.viewModels=function(){return this.aViewModels},q.prototype.screenName=function(){return this.sScreenName},q.prototype.routes=function(){return null},q.prototype.__cross=function(){return this.oCross},q.prototype.__start=function(){var a=this.routes(),b=null,c=null;ob.isNonEmptyArray(a)&&(c=h.bind(this.onRoute||ob.emptyFunction,this),b=d.create(),h.each(a,function(a){b.addRoute(a[0],c).rules=a[1]}),this.oCross=b)},r.prototype.sDefaultScreenName="",r.prototype.oScreens={},r.prototype.oBoot=null,r.prototype.oCurrentScreen=null,r.prototype.showLoading=function(){b("#rl-loading").show()},r.prototype.hideLoading=function(){b("#rl-loading").hide()},r.prototype.routeOff=function(){e.changed.active=!1},r.prototype.routeOn=function(){e.changed.active=!0},r.prototype.setBoot=function(a){return ob.isNormal(a)&&(this.oBoot=a),this},r.prototype.screen=function(a){return""===a||ob.isUnd(this.oScreens[a])?null:this.oScreens[a]},r.prototype.delegateRun=function(a,b,c){a&&a[b]&&a[b].apply(a,ob.isArray(c)?c:[])},r.prototype.buildViewModel=function(a,d){if(a&&!a.__builded){var e=new a(d),f=e.viewModelPosition(),g=b("#rl-content #rl-"+f.toLowerCase()),h=null;a.__builded=!0,a.__vm=e,e.data=Ab.data(),e.viewModelName=a.__name,g&&1===g.length?(h=b("
").addClass("rl-view-model").addClass("RL-"+e.viewModelTemplate()).hide().attr("data-bind",'template: {name: "'+e.viewModelTemplate()+'"}, i18nInit: true'),h.appendTo(g),e.viewModelDom=h,a.__dom=h,"Popups"===f&&(e.cancelCommand=e.closeCommand=ob.createCommand(e,function(){tb.hideScreenPopup(a)})),pb.runHook("view-model-pre-build",[a.__name,e,h]),c.applyBindings(e,h[0]),this.delegateRun(e,"onBuild",[h]),pb.runHook("view-model-post-build",[a.__name,e,h])):ob.log("Cannot find view model position: "+f)}return a?a.__vm:null},r.prototype.applyExternal=function(a,b){a&&b&&c.applyBindings(a,b)},r.prototype.hideScreenPopup=function(a){a&&a.__vm&&a.__dom&&(a.__dom.hide(),a.__vm.modalVisibility(!1),this.delegateRun(a.__vm,"onHide"),this.popupVisibility(!1))},r.prototype.showScreenPopup=function(a,b){a&&(this.buildViewModel(a),a.__vm&&a.__dom&&(a.__dom.show(),a.__vm.modalVisibility(!0),this.delegateRun(a.__vm,"onShow",b||[]),this.popupVisibility(!0),pb.runHook("view-model-on-show",[a.__name,a.__vm,b||[]])))},r.prototype.screenOnRoute=function(a,b){var c=this,d=null,e=null;""===ob.pString(a)&&(a=this.sDefaultScreenName),""!==a&&(d=this.screen(a),d||(d=this.screen(this.sDefaultScreenName),d&&(b=a+"/"+b,a=this.sDefaultScreenName)),d&&d.__started&&(d.__builded||(d.__builded=!0,ob.isNonEmptyArray(d.viewModels())&&h.each(d.viewModels(),function(a){this.buildViewModel(a,d)},this),this.delegateRun(d,"onBuild")),h.defer(function(){c.oCurrentScreen&&(c.delegateRun(c.oCurrentScreen,"onHide"),ob.isNonEmptyArray(c.oCurrentScreen.viewModels())&&h.each(c.oCurrentScreen.viewModels(),function(a){a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()&&(a.__dom.hide(),a.__vm.viewModelVisibility(!1),c.delegateRun(a.__vm,"onHide"))})),c.oCurrentScreen=d,c.oCurrentScreen&&(c.delegateRun(c.oCurrentScreen,"onShow"),pb.runHook("screen-on-show",[c.oCurrentScreen.screenName(),c.oCurrentScreen]),ob.isNonEmptyArray(c.oCurrentScreen.viewModels())&&h.each(c.oCurrentScreen.viewModels(),function(a){a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()&&(a.__dom.show(),a.__vm.viewModelVisibility(!0),c.delegateRun(a.__vm,"onShow"),pb.runHook("view-model-on-show",[a.__name,a.__vm]))},c)),e=d.__cross(),e&&e.parse(b)})))},r.prototype.startScreens=function(a){h.each(a,function(a){var b=new a,c=b?b.screenName():"";b&&""!==c&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=c),this.oScreens[c]=b)},this),h.each(this.oScreens,function(a){a&&!a.__started&&a.__start&&(a.__started=!0,a.__start(),pb.runHook("screen-pre-start",[a.screenName(),a]),this.delegateRun(a,"onStart"),pb.runHook("screen-post-start",[a.screenName(),a]))},this);var b=d.create();b.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,h.bind(this.screenOnRoute,this)),e.initialized.add(b.parse,b),e.changed.add(b.parse,b),e.init()},r.prototype.setHash=function(a,b,c){a="#"===a.substr(0,1)?a.substr(1):a,a="/"===a.substr(0,1)?a.substr(1):a,c=ob.isUnd(c)?!1:!!c,(ob.isUnd(b)?1:!b)?(e.changed.active=!0,e[c?"replaceHash":"setHash"](a),e.setHash(a)):(e.changed.active=!1,e[c?"replaceHash":"setHash"](a),e.changed.active=!0)},r.prototype.bootstart=function(){return this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart(),this},tb=new r,s.newInstanceFromJson=function(a){var b=new s;return b.initByJson(a)?b:null},s.prototype.name="",s.prototype.email="",s.prototype.privateType=null,s.prototype.clear=function(){this.email="",this.name="",this.privateType=null},s.prototype.validate=function(){return""!==this.name||""!==this.email},s.prototype.hash=function(a){return"#"+(a?"":this.name)+"#"+this.email+"#"},s.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},s.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=mb.EmailType.Facebook),null===this.privateType&&(this.privateType=mb.EmailType.Default)),this.privateType},s.prototype.search=function(a){return-1<(this.name+" "+this.email).toLowerCase().indexOf(a.toLowerCase())},s.prototype.parse=function(a){this.clear(),a=ob.trim(a);var b=/(?:"([^"]+)")? ?,]+)>?,? ?/g,c=b.exec(a);c?(this.name=c[1]||"",this.email=c[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(a)&&(this.name="",this.email=a)},s.prototype.initByJson=function(a){var b=!1;return a&&"Object/Email"===a["@Object"]&&(this.name=ob.trim(a.Name),this.email=ob.trim(a.Email),b=""!==this.email,this.clearDuplicateName()),b},s.prototype.toLine=function(a,b,c){var d="";return""!==this.email&&(b=ob.isUnd(b)?!1:!!b,c=ob.isUnd(c)?!1:!!c,a&&""!==this.name?d=b?'")+'" target="_blank" tabindex="-1">'+ob.encodeHtml(this.name)+"":c?ob.encodeHtml(this.name):this.name:(d=this.email,""!==this.name?b?d=ob.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+ob.encodeHtml(d)+""+ob.encodeHtml(">"):(d='"'+this.name+'" <'+d+">",c&&(d=ob.encodeHtml(d))):b&&(d=''+ob.encodeHtml(this.email)+""))),d},s.prototype.select2Result=function(){var a="",b=Ab.cache().getUserPic(this.email);return a+=""!==b?'':'',mb.EmailType.Facebook===this.type()?(a+=""+(0'):a+=""+(0('+this.name+")":this.email),a+""},s.prototype.select2Selection=function(a){var c="";if(mb.EmailType.Facebook===this.type()){if(c=0").text(c).appendTo(a),a.append(''),null}else c=0b&&(b+=d),d="undefined"==typeof c?d:0>c?c+d:c+b,b>=a.length||0>b||b>d?!1:a.slice(b,d)},c=function(a,b,c,d){return 0>c&&(c+=a.length),d=void 0!==d?d:a.length,0>d&&(d=d+a.length-c),a.slice(0,c)+b.substr(0,d)+b.slice(d)+a.slice(c+d)},d="",e="",f="",g=!1,h=!1,i=!1,j=null,k=0,l=0,m=0;m0&&0===d.length&&(d=b(a,0,m)),h=!0,k=m);break;case">":h&&(l=m,e=b(a,k+1,l-k-1),a=c(a,"",k,l-k+1),l=0,m=0,k=0,h=!1);break;case"(":g||h||i||(i=!0,k=m);break;case")":i&&(l=m,f=b(a,k+1,l-k-1),a=c(a,"",k,l-k+1),l=0,m=0,k=0,i=!1);break;case"\\":m++}m++}return 0===e.length&&(j=a.match(/[^@\s]+@\S+/i),j&&j[0]?e=j[0]:d=a),e.length>0&&0===d.length&&0===f.length&&(d=a.replace(e,"")),e=ob.trim(e).replace(/^[<]+/,"").replace(/[>]+$/,""),d=ob.trim(d).replace(/^["']+/,"").replace(/["']+$/,""),f=ob.trim(f).replace(/^[(]+/,"").replace(/[)]+$/,""),d=d.replace(/\\\\(.)/,"$1"),f=f.replace(/\\\\(.)/,"$1"),this.name=d,this.email=e,this.clearDuplicateName(),!0},s.prototype.inputoTagLine=function(){return 0+$/,""),b=!0),b},v.prototype.isImage=function(){return-1e;e++)d.push(a[e].toLine(b,c));return d.join(", ")},x.initEmailsFromJson=function(a){var b=0,c=0,d=null,e=[];if(ob.isNonEmptyArray(a))for(b=0,c=a.length;c>b;b++)d=s.newInstanceFromJson(a[b]),d&&e.push(d);return e},x.replyHelper=function(a,b,c){if(a&&0d;d++)ob.isUnd(b[a[d].email])&&(b[a[d].email]=!0,c.push(a[d]))},x.prototype.initByJson=function(a){var b=!1;return a&&"Object/Message"===a["@Object"]&&(this.folderFullNameRaw=a.Folder,this.uid=a.Uid,this.requestHash=a.RequestHash,this.prefetched=!1,this.size(ob.pInt(a.Size)),this.from=x.initEmailsFromJson(a.From),this.to=x.initEmailsFromJson(a.To),this.cc=x.initEmailsFromJson(a.Cc),this.bcc=x.initEmailsFromJson(a.Bcc),this.replyTo=x.initEmailsFromJson(a.ReplyTo),this.subject(a.Subject),this.dateTimeStampInUTC(ob.pInt(a.DateTimeStampInUTC)),this.hasAttachments(!!a.HasAttachments),this.attachmentsMainType(a.AttachmentsMainType),this.fromEmailString(x.emailsToLine(this.from,!0)),this.toEmailsString(x.emailsToLine(this.to,!0)),this.parentUid(ob.pInt(a.ParentThread)),this.threads(ob.isArray(a.Threads)?a.Threads:[]),this.threadsLen(ob.pInt(a.ThreadsLen)),this.initFlagsByJson(a),this.computeSenderEmail(),b=!0),b},x.prototype.computeSenderEmail=function(){var a=Ab.data().sentFolder(),b=Ab.data().draftFolder();this.senderEmailsString(this.folderFullNameRaw===a||this.folderFullNameRaw===b?this.toEmailsString():this.fromEmailString())},x.prototype.initUpdateByMessageJson=function(a){var b=!1,c=mb.MessagePriority.Normal;return a&&"Object/Message"===a["@Object"]&&(c=ob.pInt(a.Priority),this.priority(-1b;b++)d=v.newInstanceFromJson(a["@Collection"][b]),d&&(""!==d.cidWithOutTags&&0+$/,""),b=h.find(c,function(b){return a===b.cidWithOutTags})),b||null},x.prototype.findAttachmentByContentLocation=function(a){var b=null,c=this.attachments();return ob.isNonEmptyArray(c)&&(b=h.find(c,function(b){return a===b.contentLocation})),b||null},x.prototype.messageId=function(){return this.sMessageId},x.prototype.inReplyTo=function(){return this.sInReplyTo},x.prototype.references=function(){return this.sReferences},x.prototype.fromAsSingleEmail=function(){return ob.isArray(this.from)&&this.from[0]?this.from[0].email:""},x.prototype.viewLink=function(){return Ab.link().messageViewLink(this.requestHash)},x.prototype.downloadLink=function(){return Ab.link().messageDownloadLink(this.requestHash)},x.prototype.replyEmails=function(a){var b=[],c=ob.isUnd(a)?{}:a;return x.replyHelper(this.replyTo,c,b),0===b.length&&x.replyHelper(this.from,c,b),b},x.prototype.replyAllEmails=function(a){var b=[],c=[],d=ob.isUnd(a)?{}:a;return x.replyHelper(this.replyTo,d,b),0===b.length&&x.replyHelper(this.from,d,b),x.replyHelper(this.to,d,b),x.replyHelper(this.cc,d,c),[b,c]},x.prototype.textBodyToString=function(){return this.body?this.body.html():""},x.prototype.attachmentsToStringLine=function(){var a=h.map(this.attachments(),function(a){return a.fileName+" ("+a.friendlySize+")"});return a&&0=0&&e&&!f&&d.attr("src",e)}),c&&a.setTimeout(function(){d.print()},100))})},x.prototype.printMessage=function(){this.viewPopupMessage(!0)},x.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},x.prototype.populateByMessageListItem=function(a){return this.folderFullNameRaw=a.folderFullNameRaw,this.uid=a.uid,this.requestHash=a.requestHash,this.subject(a.subject()),this.size(a.size()),this.dateTimeStampInUTC(a.dateTimeStampInUTC()),this.priority(a.priority()),this.fromEmailString(a.fromEmailString()),this.toEmailsString(a.toEmailsString()),this.emails=a.emails,this.from=a.from,this.to=a.to,this.cc=a.cc,this.bcc=a.bcc,this.replyTo=a.replyTo,this.unseen(a.unseen()),this.flagged(a.flagged()),this.answered(a.answered()),this.forwarded(a.forwarded()),this.selected(a.selected()),this.checked(a.checked()),this.hasAttachments(a.hasAttachments()),this.attachmentsMainType(a.attachmentsMainType()),this.moment(a.moment()),this.body=null,this.priority(mb.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(a.parentUid()),this.threads(a.threads()),this.threadsLen(a.threadsLen()),this.computeSenderEmail(),this},x.prototype.showExternalImages=function(a){this.body&&this.body.data("rl-has-images")&&(a=ob.isUnd(a)?!1:a,this.hasImages(!1),this.body.data("rl-has-images",!1),b("[data-x-src]",this.body).each(function(){a&&b(this).is("img")?b(this).addClass("lazy").attr("data-original",b(this).attr("data-x-src")).removeAttr("data-x-src"):b(this).attr("src",b(this).attr("data-x-src")).removeAttr("data-x-src")}),b("[data-x-style-url]",this.body).each(function(){var a=ob.trim(b(this).attr("style"));a=""===a?"":";"===a.substr(-1)?a+" ":a+"; ",b(this).attr("style",a+b(this).attr("data-x-style-url")).removeAttr("data-x-style-url")}),a&&(b("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:b(".RL-MailMessageView .messageView .messageItem .content")[0]}),xb.resize()),ob.windowResize(500))},x.prototype.showInternalImages=function(a){if(this.body&&!this.body.data("rl-init-internal-images")){a=ob.isUnd(a)?!1:a;var c=this;this.body.data("rl-init-internal-images",!0),b("[data-x-src-cid]",this.body).each(function(){var d=c.findAttachmentByCid(b(this).attr("data-x-src-cid"));d&&d.download&&(a&&b(this).is("img")?b(this).addClass("lazy").attr("data-original",d.linkPreview()):b(this).attr("src",d.linkPreview()))}),b("[data-x-src-location]",this.body).each(function(){var d=c.findAttachmentByContentLocation(b(this).attr("data-x-src-location"));d||(d=c.findAttachmentByCid(b(this).attr("data-x-src-location"))),d&&d.download&&(a&&b(this).is("img")?b(this).addClass("lazy").attr("data-original",d.linkPreview()):b(this).attr("src",d.linkPreview()))}),b("[data-x-style-cid]",this.body).each(function(){var a="",d="",e=c.findAttachmentByCid(b(this).attr("data-x-style-cid"));e&&e.linkPreview&&(d=b(this).attr("data-x-style-cid-name"),""!==d&&(a=ob.trim(b(this).attr("style")),a=""===a?"":";"===a.substr(-1)?a+" ":a+"; ",b(this).attr("style",a+d+": url('"+e.linkPreview()+"')")))}),a&&!function(a,b){h.delay(function(){a.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:b})},300)}(b("img.lazy",c.body),b(".RL-MailMessageView .messageView .messageItem .content")[0]),ob.windowResize(500)}},y.newInstanceFromJson=function(a){var b=new y;return b.initByJson(a)?b.initComputed():null},y.prototype.initComputed=function(){return this.hasSubScribedSubfolders=c.computed(function(){return!!h.find(this.subFolders(),function(a){return a.subScribed()})},this),this.visible=c.computed(function(){var a=this.subScribed(),b=this.hasSubScribedSubfolders();return a||b&&(!this.existen||!this.selectable)},this),this.isSystemFolder=c.computed(function(){return mb.FolderType.User!==this.type()},this),this.hidden=c.computed(function(){var a=this.isSystemFolder(),b=this.hasSubScribedSubfolders();return this.isGmailFolder||a&&this.isNamespaceFolder||a&&!b},this),this.selectableForFolderList=c.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=c.computed({read:this.privateMessageCountAll,write:function(a){ob.isPosNumeric(a,!0)?this.privateMessageCountAll(a):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=c.computed({read:this.privateMessageCountUnread,write:function(a){ob.isPosNumeric(a,!0)?this.privateMessageCountUnread(a):this.privateMessageCountUnread.valueHasMutated()},owner:this}),this.printableUnreadCount=c.computed(function(){var a=this.messageCountAll(),b=this.messageCountUnread(),c=this.type();return b>0&&(mb.FolderType.Inbox===c||mb.FolderType.Spam===c)?""+b:a>0&&mb.FolderType.Draft===c?""+a:"" },this),this.canBeDeleted=c.computed(function(){var a=this.isSystemFolder();return!a&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=c.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){ob.timeOutAction("folder-list-folder-visibility-change",function(){xb.trigger("folder-list-folder-visibility-change")},100)}),this.localName=c.computed(function(){rb.langChangeTick();var a=this.type(),b=this.name();if(this.isSystemFolder())switch(a){case mb.FolderType.Inbox:b=ob.i18n("FOLDER_LIST/INBOX_NAME");break;case mb.FolderType.SentItems:b=ob.i18n("FOLDER_LIST/SENT_NAME");break;case mb.FolderType.Draft:b=ob.i18n("FOLDER_LIST/DRAFTS_NAME");break;case mb.FolderType.Spam:b=ob.i18n("FOLDER_LIST/SPAM_NAME");break;case mb.FolderType.Trash:b=ob.i18n("FOLDER_LIST/TRASH_NAME")}return b},this),this.manageFolderSystemName=c.computed(function(){rb.langChangeTick();var a="",b=this.type(),c=this.name();if(this.isSystemFolder())switch(b){case mb.FolderType.Inbox:a="("+ob.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case mb.FolderType.SentItems:a="("+ob.i18n("FOLDER_LIST/SENT_NAME")+")";break;case mb.FolderType.Draft:a="("+ob.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case mb.FolderType.Spam:a="("+ob.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case mb.FolderType.Trash:a="("+ob.i18n("FOLDER_LIST/TRASH_NAME")+")"}return(""!==a&&"("+c+")"===a||"(inbox)"===a.toLowerCase())&&(a=""),a},this),this.collapsed=c.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(a){this.collapsedPrivate(a)},owner:this}),this},y.prototype.fullName="",y.prototype.fullNameRaw="",y.prototype.fullNameHash="",y.prototype.delimiter="",y.prototype.namespace="",y.prototype.deep=0,y.prototype.isNamespaceFolder=!1,y.prototype.isGmailFolder=!1,y.prototype.isUnpaddigFolder=!1,y.prototype.collapsedCss=function(){return this.hasSubScribedSubfolders()?this.collapsed()?"icon-arrow-right-3 e-collapsed-sign":"icon-arrow-down-3 e-collapsed-sign":"icon-none e-collapsed-sign"},y.prototype.initByJson=function(a){var b=!1;return a&&"Object/Folder"===a["@Object"]&&(this.name(a.Name),this.delimiter=a.Delimiter,this.fullName=a.FullName,this.fullNameRaw=a.FullNameRaw,this.fullNameHash=a.FullNameHash,this.deep=a.FullNameRaw.split(this.delimiter).length-1,this.selectable=!!a.IsSelectable,this.existen=!!a.IsExisten,this.subScribed(!!a.IsSubscribed),this.type("INBOX"===this.fullNameRaw?mb.FolderType.Inbox:mb.FolderType.User),b=!0),b},y.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")},z.prototype.email="",z.prototype.changeAccountLink=function(){return Ab.link().change(this.email)},A.prototype.formattedName=function(){var a=this.name();return""===a?this.email():a+" <"+this.email()+">"},A.prototype.formattedNameForCompose=function(){var a=this.name();return""===a?this.email():a+" ("+this.email()+")"},A.prototype.formattedNameForEmail=function(){var a=this.name();return""===a?this.email():'"'+ob.quoteName(a)+'" <'+this.email()+">"},ob.extendAsViewModel("PopupsFolderClearViewModel",B),B.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},B.prototype.onShow=function(a){this.clearPopup(),a&&this.selectedFolder(a)},ob.extendAsViewModel("PopupsFolderCreateViewModel",C),C.prototype.sNoParentText="",C.prototype.simpleFolderNameValidation=function(a){return/^[^\\\/]+$/g.test(ob.trim(a))},C.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.focusTrigger(!1)},C.prototype.onShow=function(){this.clearPopup(),this.focusTrigger(!0)},ob.extendAsViewModel("PopupsFolderSystemViewModel",D),D.prototype.sChooseOnText="",D.prototype.sUnuseText="",D.prototype.onShow=function(a){var b="";switch(a=ob.isUnd(a)?mb.SetSystemFoldersNotification.None:a){case mb.SetSystemFoldersNotification.Sent:b=ob.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case mb.SetSystemFoldersNotification.Draft:b=ob.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case mb.SetSystemFoldersNotification.Spam:b=ob.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case mb.SetSystemFoldersNotification.Trash:b=ob.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH")}this.notification(b)},ob.extendAsViewModel("PopupsComposeViewModel",E),E.prototype.findIdentityIdByMessage=function(a,b){var c={},d="",e=function(a){return a&&a.email&&c[a.email]?(d=c[a.email],!0):!1};switch(this.bAllowIdentities&&h.each(this.identities(),function(a){c[a.email()]=a.id}),c[Ab.data().accountEmail()]=Ab.data().accountEmail(),a){case mb.ComposeType.Empty:d=Ab.data().accountEmail();break;case mb.ComposeType.Reply:case mb.ComposeType.ReplyAll:case mb.ComposeType.Forward:case mb.ComposeType.ForwardAsAttachment:h.find(h.union(b.to,b.cc,b.bcc),e);break;case mb.ComposeType.Draft:h.find(h.union(b.from,b.replyTo),e)}return d},E.prototype.selectIdentity=function(a){a&&this.currentIdentityID(a.optValue)},E.prototype.formattedFrom=function(a){var b=Ab.data().displayName(),c=Ab.data().accountEmail();return""===b?c:(ob.isUnd(a)?1:!a)?b+" ("+c+")":'"'+ob.quoteName(b)+'" <'+c+">"},E.prototype.sendMessageResponse=function(b,c){var d=!1;this.sending(!1),mb.StorageResultType.Success===b&&c&&c.Result&&(d=!0,this.modalVisibility()&&tb.delegateRun(this,"closeCommand")),this.modalVisibility()&&!d&&(c&&mb.Notification.CantSaveMessage===c.ErrorCode?(this.sendSuccessButSaveError(!0),a.alert(ob.trim(ob.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(this.sendError(!0),a.alert(ob.getNotification(c&&c.ErrorCode?c.ErrorCode:mb.Notification.CantSendMessage))))},E.prototype.saveMessageResponse=function(b,c){var d=!1,e=null;this.saving(!1),mb.StorageResultType.Success===b&&c&&c.Result&&c.Result.NewFolder&&c.Result.NewUid&&(this.bFromDraft&&(e=Ab.data().message(),e&&this.draftFolder()===e.folderFullNameRaw&&this.draftUid()===e.uid&&Ab.data().message(null)),this.draftFolder(c.Result.NewFolder),this.draftUid(c.Result.NewUid),this.draftID(c.Result.NewID),this.modalVisibility()&&(this.savedTime(Math.round((new a.Date).getTime()/1e3)),this.savedOrSendingText(0b;b++)d.push(a[b].toLine(!1));return d.join(", ")};if(c=c||null,c&&ob.isNormal(c)&&(t=ob.isArray(c)&&1===c.length?c[0]:ob.isArray(c)?null:c),null!==q&&(p[q]=!0,this.currentIdentityID(this.findIdentityIdByMessage(v,t))),this.reset(),ob.isNonEmptyArray(d)&&this.to(w(d)),""!==v&&t){switch(j=t.fullFormatDateValue(),k=t.subject(),s=t.aDraftInfo,l=b(t.body).clone(),ob.removeBlockquoteSwitcher(l),m=l.html(),v){case mb.ComposeType.Empty:break;case mb.ComposeType.Reply:this.to(w(t.replyEmails(p))),this.subject(ob.replySubjectAdd("Re",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["reply",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=ob.trim(this.sInReplyTo+" "+t.sReferences),u=!0;break;case mb.ComposeType.ReplyAll:o=t.replyAllEmails(p),this.to(w(o[0])),this.cc(w(o[1])),this.subject(ob.replySubjectAdd("Re",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["reply",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=ob.trim(this.sInReplyTo+" "+t.references()),u=!0;break;case mb.ComposeType.Forward:this.subject(ob.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["forward",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=ob.trim(this.sInReplyTo+" "+t.sReferences);break;case mb.ComposeType.ForwardAsAttachment:this.subject(ob.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["forward",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=ob.trim(this.sInReplyTo+" "+t.sReferences);break;case mb.ComposeType.Draft:this.to(w(t.to)),this.cc(w(t.cc)),this.bcc(w(t.bcc)),this.bFromDraft=!0,this.draftFolder(t.folderFullNameRaw),this.draftUid(t.uid),this.draftID(t.messageId()),this.subject(k),this.prepearMessageAttachments(t,v),this.aDraftInfo=ob.isNonEmptyArray(s)&&3===s.length?s:null,this.sInReplyTo=t.sInReplyTo,this.sReferences=t.sReferences}if(this.oEditor){switch(v){case mb.ComposeType.Reply:case mb.ComposeType.ReplyAll:f=t.fromToLine(!1,!0),n=ob.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:j,EMAIL:f}),m="

"+n+":

"+m+"
";break;case mb.ComposeType.Forward:f=t.fromToLine(!1,!0),g=t.toToLine(!1,!0),i=t.ccToLine(!1,!0),m="


"+ob.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+ob.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+f+"
"+ob.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+g+(0"+ob.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+i:"")+"
"+ob.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+ob.encodeHtml(j)+"
"+ob.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+ob.encodeHtml(k)+"

"+m;break;case mb.ComposeType.ForwardAsAttachment:m=""}this.oEditor.setRawText(m,t.isHtml())}}else this.oEditor&&mb.ComposeType.Empty===v?this.oEditor.setRawText("
"+ob.convertPlainTextToHtml(Ab.data().signature()),mb.EditorDefaultType.Html===Ab.data().editorDefaultType()):ob.isNonEmptyArray(c)&&h.each(c,function(a){e.addMessageAsAttachment(a)});r=this.getAttachmentsDownloadsForUpload(),ob.isNonEmptyArray(r)&&Ab.remote().messageUploadAttachments(function(a,b){if(mb.StorageResultType.Success===a&&b&&b.Result){var c=null,d="";if(!e.viewModelVisibility())for(d in b.Result)b.Result.hasOwnProperty(d)&&(c=e.getAttachmentById(b.Result[d]),c&&c.tempName(d))}else e.setMessageAttachmentFailedDowbloadText()},r),u&&this.oEditor&&this.oEditor.focus(),this.triggerForResize()},E.prototype.onBuild=function(){this.initEditor(),this.initUploader();var a=this,c=null;xb.on("keydown",function(b){var c=!0;return b&&a.modalVisibility()&&Ab.data().useKeyboardShortcuts()&&(b.ctrlKey&&mb.EventKeyCode.S===b.keyCode?(a.saveCommand(),c=!1):b.ctrlKey&&mb.EventKeyCode.Enter===b.keyCode&&(a.sendCommand(),c=!1)),c}),xb.on("resize",function(){a.triggerForResize()}),this.dropboxEnabled()&&(c=document.createElement("script"),c.type="text/javascript",c.src="https://www.dropbox.com/static/api/1/dropins.js",b(c).attr("id","dropboxjs").attr("data-app-key",Ab.settingsGet("DropboxApiKey")),document.body.appendChild(c))},E.prototype.getAttachmentById=function(a){for(var b=this.attachments(),c=0,d=b.length;d>c;c++)if(b[c]&&a===b[c].id)return b[c];return null},E.prototype.initEditor=function(){if(this.composeEditorTextArea()&&this.composeEditorHtmlArea()&&this.composeEditorToolbar()){var a=this;this.oEditor=new j(this.composeEditorTextArea(),this.composeEditorHtmlArea(),this.composeEditorToolbar(),{onSwitch:function(b){b||a.removeLinkedAttachments()}}),this.oEditor.initLanguage(ob.i18n("EDITOR/TEXT_SWITCHER_CONFIRM"),ob.i18n("EDITOR/TEXT_SWITCHER_PLAINT_TEXT"),ob.i18n("EDITOR/TEXT_SWITCHER_RICH_FORMATTING"))}},E.prototype.initUploader=function(){if(this.composeUploaderButton()){var a={},b=ob.pInt(Ab.settingsGet("AttachmentLimit")),c=new g({action:Ab.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace(),onDragEnter:h.bind(function(){this.dragAndDropOver(!0)},this),onDragLeave:h.bind(function(){this.dragAndDropOver(!1)},this),onBodyDragEnter:h.bind(function(){this.dragAndDropVisible(!0)},this),onBodyDragLeave:h.bind(function(){this.dragAndDropVisible(!1)},this),onProgress:h.bind(function(b,c,d){var e=null;ob.isUnd(a[b])?(e=this.getAttachmentById(b),e&&(a[b]=e)):e=a[b],e&&e.progress(" - "+Math.floor(c/d*100)+"%")},this),onSelect:h.bind(function(a,d){this.dragAndDropOver(!1);var e=this,f=ob.isUnd(d.FileName)?"":d.FileName.toString(),g=ob.isNormal(d.Size)?ob.pInt(d.Size):null,h=new w(a,f,g);return h.cancel=function(a){return function(){e.attachments.remove(function(b){return b&&b.id===a}),c&&c.cancel(a)}}(a),this.attachments.push(h),g>0&&b>0&&g>b?(h.error(ob.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this),onStart:h.bind(function(b){var c=null;ob.isUnd(a[b])?(c=this.getAttachmentById(b),c&&(a[b]=c)):c=a[b],c&&(c.waiting(!1),c.uploading(!0))},this),onComplete:h.bind(function(b,c,d){var e="",f=null,g=null,h=this.getAttachmentById(b);g=c&&d&&d.Result&&d.Result.Attachment?d.Result.Attachment:null,f=d&&d.Result&&d.Result.ErrorCode?d.Result.ErrorCode:null,null!==f?e=ob.getUploadErrorDescByCode(f):g||(e=ob.i18n("UPLOAD/ERROR_UNKNOWN")),h&&(""!==e&&00&&d>0&&f>d?(e.uploading(!1),e.error(ob.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(Ab.remote().composeUploadExternals(function(a,b){var c=!1;e.uploading(!1),mb.StorageResultType.Success===a&&b&&b.Result&&b.Result[e.id]&&(c=!0,e.tempName(b.Result[e.id])),c||e.error(ob.getUploadErrorDescByCode(mb.UploadErrorCode.FileNoUploaded))},[a.link]),!0)},E.prototype.prepearMessageAttachments=function(a,b){if(a){var c=this,d=ob.isNonEmptyArray(a.attachments())?a.attachments():[],e=0,f=d.length,g=null,h=null,i=!1,j=function(a){return function(){c.attachments.remove(function(b){return b&&b.id===a})}};if(mb.ComposeType.ForwardAsAttachment===b)this.addMessageAsAttachment(a);else for(;f>e;e++){switch(h=d[e],i=!1,b){case mb.ComposeType.Reply:case mb.ComposeType.ReplyAll:i=h.isLinked;break;case mb.ComposeType.Forward:case mb.ComposeType.Draft:i=!0}i=!0,i&&(g=new w(h.download,h.fileName,h.estimatedSize,h.isInline,h.isLinked,h.cid,h.contentLocation),g.fromMessage=!0,g.cancel=j(h.download),g.waiting(!1).uploading(!0),this.attachments.push(g))}}},E.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(a){return a&&a.isLinked})},E.prototype.setMessageAttachmentFailedDowbloadText=function(){h.each(this.attachments(),function(a){a&&a.fromMessage&&a.waiting(!1).uploading(!1).error(ob.getUploadErrorDescByCode(mb.UploadErrorCode.FileNoUploaded))},this)},E.prototype.isEmptyForm=function(a){a=ob.isUnd(a)?!0:!!a;var b=a?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&b&&""===this.oEditor.getTextForRequest()},E.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.bReloadFolder=!1,this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.draftID(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear()},E.prototype.getAttachmentsDownloadsForUpload=function(){return h.map(h.filter(this.attachments(),function(a){return a&&""===a.tempName()}),function(a){return a.id})},E.prototype.triggerForResize=function(){this.resizer(!this.resizer())},ob.extendAsViewModel("PopupsContactsViewModel",F),F.prototype.addNewEmail=function(){var a=new u(mb.ContactPropertyType.EmailPersonal,"");a.focused(!0),this.viewProperties.push(a)},F.prototype.addNewPhone=function(){var a=new u(mb.ContactPropertyType.PhonePersonal,"");a.focused(!0),this.viewProperties.push(a)},F.prototype.removeCheckedOrSelectedContactsFromList=function(){var a=this,b=this.contacts,c=this.currentContact(),d=this.contactsCheckedOrSelected();00&&g.messageCountUnread(0<=g.messageCountUnread()-e?g.messageCountUnread()-e:0)),i&&!d&&(i.messageCountAll(i.messageCountAll()+b.length),e>0&&i.messageCountUnread(i.messageCountUnread()+e)),00&&(mb.EventKeyCode.Backspace===c||mb.EventKeyCode.Esc===c)&&d.viewModelVisibility()&&e.useKeyboardShortcuts()&&!ob.inFocus()&&e.message()&&(d.fullScreenMode(!1),e.usePreviewPane()||e.message(null),b=!1),b}),b(".attachmentsPlace",a).magnificPopup({delegate:".magnificPopupImage:visible",type:"image",gallery:{enabled:!0,preload:[1,1],navigateByImgClick:!0},callbacks:{open:function(){e.useKeyboardShortcuts(!1)},close:function(){e.useKeyboardShortcuts(!0)}},mainClass:"mfp-fade",removalDelay:400}),a.on("click",".attachmentsPlace .attachmentPreview",function(a){a&&a.stopPropagation&&a.stopPropagation()}).on("click",".attachmentsPlace .attachmentItem",function(){var a=c.dataFor(this);a&&a.download&&Ab.download(a.linkDownload())}),this.oMessageScrollerDom=a.find(".messageItem .content"),this.oMessageScrollerDom=this.oMessageScrollerDom&&this.oMessageScrollerDom[0]?this.oMessageScrollerDom:null},Q.prototype.isDraftFolder=function(){return Ab.data().message()&&Ab.data().draftFolder()===Ab.data().message().folderFullNameRaw},Q.prototype.isSentFolder=function(){return Ab.data().message()&&Ab.data().sentFolder()===Ab.data().message().folderFullNameRaw},Q.prototype.isDraftOrSentFolder=function(){return this.isDraftFolder()||this.isSentFolder()},Q.prototype.composeClick=function(){tb.showScreenPopup(E)},Q.prototype.editMessage=function(){Ab.data().message()&&tb.showScreenPopup(E,[mb.ComposeType.Draft,Ab.data().message()])},Q.prototype.scrollMessageToTop=function(){this.oMessageScrollerDom&&this.oMessageScrollerDom.scrollTop(0)},Q.prototype.showImages=function(a){a&&a.showExternalImages&&a.showExternalImages(!0)},ob.extendAsViewModel("SettingsMenuViewModel",R),R.prototype.link=function(a){return Ab.link().settings(a)},R.prototype.backToMailBoxClick=function(){tb.setHash(Ab.link().inbox())},ob.extendAsViewModel("SettingsPaneViewModel",S),S.prototype.onShow=function(){Ab.data().message(null)},S.prototype.backToMailBoxClick=function(){tb.setHash(Ab.link().inbox())},ob.addSettingsViewModel(T,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),T.prototype.onBuild=function(){var a=this;h.delay(function(){var c=Ab.data(),d=ob.settingsSaveHelperSimpleFunction(a.mppTrigger,a);c.language.subscribe(function(c){a.languageTrigger(mb.SaveSettingsStep.Animate),b.ajax({url:Ab.link().langLink(c),dataType:"script",cache:!0}).done(function(){ob.i18nToDoc(),a.languageTrigger(mb.SaveSettingsStep.TrueResult)}).fail(function(){a.languageTrigger(mb.SaveSettingsStep.FalseResult)}).always(function(){h.delay(function(){a.languageTrigger(mb.SaveSettingsStep.Idle)},1e3)}),Ab.remote().saveSettings(ob.emptyFunction,{Language:c})}),c.editorDefaultType.subscribe(function(a){Ab.remote().saveSettings(ob.emptyFunction,{EditorDefaultType:a})}),c.messagesPerPage.subscribe(function(a){Ab.remote().saveSettings(d,{MPP:a})}),c.showImages.subscribe(function(a){Ab.remote().saveSettings(ob.emptyFunction,{ShowImages:a?"1":"0"})}),c.interfaceAnimation.subscribe(function(a){Ab.remote().saveSettings(ob.emptyFunction,{InterfaceAnimation:a})}),c.useDesktopNotifications.subscribe(function(a){ob.timeOutAction("SaveDesktopNotifications",function(){Ab.remote().saveSettings(ob.emptyFunction,{DesktopNotifications:a?"1":"0"})},3e3)}),c.replySameFolder.subscribe(function(a){ob.timeOutAction("SaveReplySameFolder",function(){Ab.remote().saveSettings(ob.emptyFunction,{ReplySameFolder:a?"1":"0"})},3e3)}),c.useThreads.subscribe(function(a){c.messageList([]),Ab.remote().saveSettings(ob.emptyFunction,{UseThreads:a?"1":"0"})}),c.usePreviewPane.subscribe(function(a){c.messageList([]),Ab.remote().saveSettings(ob.emptyFunction,{UsePreviewPane:a?"1":"0"})}),c.useCheckboxesInList.subscribe(function(a){Ab.remote().saveSettings(ob.emptyFunction,{UseCheckboxesInList:a?"1":"0"})})},50)},T.prototype.onShow=function(){Ab.data().desktopNotifications.valueHasMutated()},T.prototype.selectLanguage=function(){tb.showScreenPopup(J)},ob.addSettingsViewModel(U,"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),U.prototype.addNewAccount=function(){tb.showScreenPopup(H)},U.prototype.deleteAccount=function(a){if(a&&a.deleteAccess()){this.accountForDeletion(null);var b=function(b){return a===b};a&&(this.accounts.remove(b),Ab.remote().accountDelete(function(){Ab.accountsAndIdentities()},a.email))}},ob.addSettingsViewModel(V,"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),V.prototype.onBuild=function(){var a=this;h.delay(function(){var b=Ab.data(),c=ob.settingsSaveHelperSimpleFunction(a.displayNameTrigger,a),d=ob.settingsSaveHelperSimpleFunction(a.replyTrigger,a),e=ob.settingsSaveHelperSimpleFunction(a.signatureTrigger,a);b.displayName.subscribe(function(a){Ab.remote().saveSettings(c,{DisplayName:a})}),b.replyTo.subscribe(function(a){Ab.remote().saveSettings(d,{ReplyTo:a})}),b.signature.subscribe(function(a){Ab.remote().saveSettings(e,{Signature:a})})},50)},ob.addSettingsViewModel(W,"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"),W.prototype.addNewIdentity=function(){tb.showScreenPopup(I)},W.prototype.editIdentity=function(a){tb.showScreenPopup(I,[a])},W.prototype.deleteIdentity=function(a){if(a&&a.deleteAccess()){this.identityForDeletion(null);var b=function(b){return a===b};a&&(this.identities.remove(b),Ab.remote().identityDelete(function(){Ab.accountsAndIdentities()},a.id))}},W.prototype.onBuild=function(a){var b=this;a.on("click",".identity-item .e-action",function(){var a=c.dataFor(this);a&&b.editIdentity(a)}),h.delay(function(){var a=Ab.data(),c=ob.settingsSaveHelperSimpleFunction(b.displayNameTrigger,b),d=ob.settingsSaveHelperSimpleFunction(b.replyTrigger,b),e=ob.settingsSaveHelperSimpleFunction(b.signatureTrigger,b);a.displayName.subscribe(function(a){Ab.remote().saveSettings(c,{DisplayName:a})}),a.replyTo.subscribe(function(a){Ab.remote().saveSettings(d,{ReplyTo:a})}),a.signature.subscribe(function(a){Ab.remote().saveSettings(e,{Signature:a})})},50)},ob.addSettingsViewModel(X,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),ob.addSettingsViewModel(Y,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),Y.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword("")},Y.prototype.onChangePasswordResponse=function(a,b){this.changeProcess(!1),mb.StorageResultType.Success===a&&b&&b.Result?(this.currentPassword(""),this.newPassword(""),this.passwordUpdateSuccess(!0)):this.passwordUpdateError(!0)},ob.addSettingsViewModel(Z,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),Z.prototype.folderEditOnEnter=function(a){var b=a?ob.trim(a.nameForEdit()):"";""!==b&&a.name()!==b&&(Ab.local().set(mb.ClientSideKeyName.FoldersLashHash,""),Ab.data().foldersRenaming(!0),Ab.remote().folderRename(function(a,b){Ab.data().foldersRenaming(!1),mb.StorageResultType.Success===a&&b&&b.Result||Ab.data().foldersListError(b&&b.ErrorCode?ob.getNotification(b.ErrorCode):ob.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),Ab.folders(!1)},a.fullNameRaw,b),Ab.cache().removeFolderFromCacheList(a.fullNameRaw),a.name(b)),a.edited(!1)},Z.prototype.folderEditOnEsc=function(a){a&&a.edited(!1)},Z.prototype.onShow=function(){Ab.data().foldersListError("")},Z.prototype.createFolder=function(){tb.showScreenPopup(C)},Z.prototype.systemFolder=function(){tb.showScreenPopup(D)},Z.prototype.deleteFolder=function(a){if(a&&a.canBeDeleted()&&a.deleteAccess()&&0===a.privateMessageCountAll()){this.folderForDeletion(null);var b=function(c){return a===c?!0:(c.subFolders.remove(b),!1)};a&&(Ab.local().set(mb.ClientSideKeyName.FoldersLashHash,""),Ab.data().folderList.remove(b),Ab.data().foldersDeleting(!0),Ab.remote().folderDelete(function(a,b){Ab.data().foldersDeleting(!1),mb.StorageResultType.Success===a&&b&&b.Result||Ab.data().foldersListError(b&&b.ErrorCode?ob.getNotification(b.ErrorCode):ob.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),Ab.folders(!1)},a.fullNameRaw),Ab.cache().removeFolderFromCacheList(a.fullNameRaw))}else 01048576?(a.alert(ob.i18n("SETTINGS_THEMES/ERROR_FILE_IS_TOO_BIG")),!1):!0},this),onStart:h.bind(function(){this.customThemeUploaderProgress(!0)},this),onComplete:h.bind(function(b,c,d){c&&d&&d.Result?this.customThemeImg(d.Result):a.alert(d&&d.ErrorCode?ob.getUploadErrorDescByCode(d.ErrorCode):ob.getUploadErrorDescByCode(mb.UploadErrorCode.Unknown)),this.customThemeUploaderProgress(!1)},this)});return!!b}return!1},_.prototype.populateDataOnStart=function(){var a=Ab.settingsGet("Languages"),b=Ab.settingsGet("Themes");ob.isArray(a)&&this.languages(a),ob.isArray(b)&&this.themes(b),this.mainLanguage(Ab.settingsGet("Language")),this.mainTheme(Ab.settingsGet("Theme")),this.allowCustomTheme(!!Ab.settingsGet("AllowCustomTheme")),this.allowAdditionalAccounts(!!Ab.settingsGet("AllowAdditionalAccounts")),this.allowIdentities(!!Ab.settingsGet("AllowIdentities")),this.determineUserLanguage(!!Ab.settingsGet("DetermineUserLanguage")),this.allowThemes(!!Ab.settingsGet("AllowThemes")),this.allowCustomLogin(!!Ab.settingsGet("AllowCustomLogin")),this.allowLanguagesOnLogin(!!Ab.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!Ab.settingsGet("AllowLanguagesOnSettings")),this.editorDefaultType(Ab.settingsGet("EditorDefaultType")),this.showImages(!!Ab.settingsGet("ShowImages")),this.interfaceAnimation(Ab.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(Ab.settingsGet("MPP")),this.desktopNotifications(!!Ab.settingsGet("DesktopNotifications")),this.useThreads(!!Ab.settingsGet("UseThreads")),this.replySameFolder(!!Ab.settingsGet("ReplySameFolder")),this.usePreviewPane(!!Ab.settingsGet("UsePreviewPane")),this.useCheckboxesInList(!!Ab.settingsGet("UseCheckboxesInList")),this.facebookEnable(!!Ab.settingsGet("AllowFacebookSocial")),this.facebookAppID(Ab.settingsGet("FacebookAppID")),this.facebookAppSecret(Ab.settingsGet("FacebookAppSecret")),this.twitterEnable(!!Ab.settingsGet("AllowTwitterSocial")),this.twitterConsumerKey(Ab.settingsGet("TwitterConsumerKey")),this.twitterConsumerSecret(Ab.settingsGet("TwitterConsumerSecret")),this.googleEnable(!!Ab.settingsGet("AllowGoogleSocial")),this.googleClientID(Ab.settingsGet("GoogleClientID")),this.googleClientSecret(Ab.settingsGet("GoogleClientSecret")),this.dropboxEnable(!!Ab.settingsGet("AllowDropboxSocial")),this.dropboxApiKey(Ab.settingsGet("DropboxApiKey")),this.contactsIsAllowed(!!Ab.settingsGet("ContactsIsAllowed"))},h.extend(ab.prototype,_.prototype),ab.prototype.purgeMessageBodyCache=function(){var a=0,c=null,d=rb.iMessageBodyCacheCount-lb.Values.MessageBodyCacheLimit;d>0&&(c=this.messagesBodiesDom(),c&&(c.find(".rl-cache-class").each(function(){var c=b(this);d>c.data("rl-cache-count")&&(c.addClass("rl-cache-purge"),a++)}),a>0&&h.delay(function(){c.find(".rl-cache-purge").remove()},300)))},ab.prototype.populateDataOnStart=function(){_.prototype.populateDataOnStart.call(this),this.accountEmail(Ab.settingsGet("Email")),this.accountIncLogin(Ab.settingsGet("IncLogin")),this.accountOutLogin(Ab.settingsGet("OutLogin")),this.projectHash(Ab.settingsGet("ProjectHash")),this.displayName(Ab.settingsGet("DisplayName")),this.replyTo(Ab.settingsGet("ReplyTo")),this.signature(Ab.settingsGet("Signature")),this.lastFoldersHash=Ab.local().get(mb.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!Ab.settingsGet("RemoteSuggestions"),this.devEmail=Ab.settingsGet("DevEmail"),this.devLogin=Ab.settingsGet("DevLogin"),this.devPassword=Ab.settingsGet("DevPassword")},ab.prototype.initUidNextAndNewMessages=function(b,c,d){if("INBOX"===b&&ob.isNormal(c)&&""!==c){if(ob.isArray(d)&&03)i(Ab.link().notificationMailIcon(),Ab.data().accountEmail(),ob.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:g}));else for(;g>f;f++)i(Ab.link().notificationMailIcon(),x.emailsToLine(x.initEmailsFromJson(d[f].From),!1),d[f].Subject)}Ab.cache().setFolderUidNext(b,c)}},ab.prototype.folderResponseParseRec=function(a,b,c){var d=0,e=0,f=null,g=null,h="",i=[],j=[];for(c=!!c,d=0,e=b.length;e>d;d++)f=b[d],f&&(h=f.FullNameRaw,g=Ab.cache().getFolderFromCacheList(h),g||(g=y.newInstanceFromJson(f),g&&(Ab.cache().setFolderToCacheList(h,g),Ab.cache().setFolderFullNameRaw(g.fullNameHash,h),g.isGmailFolder=lb.Values.GmailFolderName.toLowerCase()===h.toLowerCase(),""!==a&&a===g.fullNameRaw+g.delimiter&&(g.isNamespaceFolder=!0),(g.isNamespaceFolder||g.isGmailFolder)&&(g.isUnpaddigFolder=!0))),g&&(g.collapsed(!ob.isFolderExpanded(g.fullNameHash)),!c&&f.Extended&&(f.Extended.Hash&&Ab.cache().setFolderHash(g.fullNameRaw,f.Extended.Hash),ob.isNormal(f.Extended.MessageCount)&&g.messageCountAll(f.Extended.MessageCount),ob.isNormal(f.Extended.MessageUnseenCount)&&g.messageCountUnread(f.Extended.MessageUnseenCount)),i=f.SubFolders,i&&"Collection/FolderCollection"===i["@Object"]&&i["@Collection"]&&ob.isArray(i["@Collection"])&&g.subFolders(this.folderResponseParseRec(a,i["@Collection"],c)),j.push(g)));return j},ab.prototype.setFolders=function(a,b){var c=[],d=!1,e=Ab.data(),f=e.folderList(),g=0===f.length,h=function(a){return""===a||lb.Values.UnuseOptionValue===a||null!==Ab.cache().getFolderFromCacheList(a)?a:""};a&&a.Result&&"Collection/FolderCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&ob.isArray(a.Result["@Collection"])&&(ob.isUnd(a.Result.Namespace)||(e.namespace=a.Result.Namespace),this.threading(!!Ab.settingsGet("UseImapThread")&&a.Result.IsThreadsSupported&&!0),c=this.folderResponseParseRec(e.namespace,a.Result["@Collection"],!!b),e.folderList(c),a.Result.SystemFolders&&""==""+Ab.settingsGet("SentFolder")+Ab.settingsGet("DraftFolder")+Ab.settingsGet("SpamFolder")+Ab.settingsGet("TrashFolder")&&(Ab.settingsSet("SentFolder",a.Result.SystemFolders[2]||null),Ab.settingsSet("DraftFolder",a.Result.SystemFolders[3]||null),Ab.settingsSet("SpamFolder",a.Result.SystemFolders[4]||null),Ab.settingsSet("TrashFolder",a.Result.SystemFolders[5]||null),d=!0),e.sentFolder(h(Ab.settingsGet("SentFolder"))),e.draftFolder(h(Ab.settingsGet("DraftFolder"))),e.spamFolder(h(Ab.settingsGet("SpamFolder"))),e.trashFolder(h(Ab.settingsGet("TrashFolder"))),d&&Ab.remote().saveSystemFolders(ob.emptyFunction,{SentFolder:e.sentFolder(),DraftFolder:e.draftFolder(),SpamFolder:e.spamFolder(),TrashFolder:e.trashFolder()}),b||Ab.local().set(mb.ClientSideKeyName.FoldersLashHash,a.Result.FoldersHash),g&&b&&Ab.folders(!1))},ab.prototype.hideMessageBodies=function(){var a=this.messagesBodiesDom();a&&a.find(".b-text-part").hide()},ab.prototype.setMessage=function(a,c){var d=!1,e=!1,f=!1,g=null,h=null,i="",j=this.messagesBodiesDom(),k=this.message();a&&k&&a.Result&&"Object/Message"===a.Result["@Object"]&&k.folderFullNameRaw===a.Result.Folder&&k.uid===a.Result.Uid&&(this.messageError(""),k.initUpdateByMessageJson(a.Result),Ab.cache().addRequestedMessage(k.folderFullNameRaw,k.uid),c||k.initFlagsByJson(a.Result),j=j&&j[0]?j:null,j&&(i="rl-"+k.requestHash.replace(/[^a-zA-Z0-9]/g,""),h=j.find("#"+i),h&&h[0]?(h.data("rl-cache-count",++rb.iMessageBodyCacheCount),k.isRtl(!!h.data("rl-is-rtl")),k.isHtml(!!h.data("rl-is-html")),k.hasImages(!!h.data("rl-has-images")),k.body=h):(e=!!a.Result.HasExternals,f=!!a.Result.HasInternals,g=b('
').hide().addClass("rl-cache-class"),g.data("rl-cache-count",++rb.iMessageBodyCacheCount),ob.isNormal(a.Result.Html)&&""!==a.Result.Html?(d=!0,g.html(a.Result.Html.toString()).addClass("b-text-part html")):ob.isNormal(a.Result.Plain)&&""!==a.Result.Plain?(d=!1,g.html(a.Result.Plain.toString()).addClass("b-text-part plain")):d=!1,a.Result.Rtl&&(g.data("rl-is-rtl",!0),g.addClass("rtl-text-part")),j.append(g),g.data("rl-is-html",d),g.data("rl-has-images",e),k.isRtl(!!g.data("rl-is-rtl")),k.isHtml(!!g.data("rl-is-html")),k.hasImages(!!g.data("rl-has-images")),k.body=g,f&&k.showInternalImages(!0),k.hasImages()&&this.showImages()&&k.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(k.body),this.hideMessageBodies(),k.body.show(),g&&ob.initBlockquoteSwitcher(g)),Ab.cache().initMessageFlagsFromCache(k),k.unseen()&&Ab.setMessageSeen(k),ob.windowResize())},ab.prototype.setMessageList=function(a,b){if(a&&a.Result&&"Collection/MessageCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&ob.isArray(a.Result["@Collection"])){var c=Ab.data(),d=Ab.cache(),e=null,f=0,g=0,h=0,i=0,j=[],k=c.staticMessageList,l=null,m=null,n=null,o=0,p=!1;for(h=ob.pInt(a.Result.MessageResultCount),i=ob.pInt(a.Result.Offset),ob.isNonEmptyArray(a.Result.LastCollapsedThreadUids)&&(e=a.Result.LastCollapsedThreadUids),n=Ab.cache().getFolderFromCacheList(ob.isNormal(a.Result.Folder)?a.Result.Folder:""),n&&!b&&(Ab.cache().setFolderHash(a.Result.Folder,a.Result.FolderHash),ob.isNormal(a.Result.MessageCount)&&n.messageCountAll(a.Result.MessageCount),ob.isNormal(a.Result.MessageUnseenCount)&&(ob.pInt(n.messageCountUnread())!==ob.pInt(a.Result.MessageUnseenCount)&&(p=!0),n.messageCountUnread(a.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(n.fullNameRaw,a.Result.UidNext,a.Result.NewMessages)),p&&n&&Ab.cache().clearMessageFlagsFromCacheByFolder(n.fullNameRaw),f=0,g=a.Result["@Collection"].length;g>f;f++)l=a.Result["@Collection"][f],l&&"Object/Message"===l["@Object"]&&(m=k[f],m&&m.initByJson(l)||(m=x.newInstanceFromJson(l)),m&&(d.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=o&&(o++,m.newForAnimation(!0)),m.deleted(!1),b?Ab.cache().initMessageFlagsFromCache(m):Ab.cache().storeMessageFlagsToCache(m),m.lastInCollapsedThread(e&&-1(new a.Date).getTime()-l),n&&i.oRequests[n]&&(i.oRequests[n].__aborted&&(e="abort"),i.oRequests[n]=null),i.defaultResponse(c,n,e,b,f,d)}),n&&00?(this.defaultRequest(a,"Message",{},null,"Message/"+qb.urlsafe_encode([b,c,Ab.data().projectHash(),Ab.data().threading()&&Ab.data().useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},cb.prototype.composeUploadExternals=function(a,b){this.defaultRequest(a,"ComposeUploadExternals",{Externals:b},999e3)},cb.prototype.folderInformation=function(a,b,c){var d=!0,e=Ab.cache(),f=[];ob.isArray(c)&&0
").addClass("rl-settings-view-model").hide().attr("data-bind",'template: {name: "'+f.__rlSettingsData.Template+'"}, i18nInit: true'),i.appendTo(g),e.data=Ab.data(),e.viewModelDom=i,e.__rlSettingsData=f.__rlSettingsData,f.__dom=i,f.__builded=!0,f.__vm=e,c.applyBindings(e,i[0]),tb.delegateRun(e,"onBuild",[i])):ob.log("Cannot find sub settings view model position: SettingsSubScreen")),e&&h.defer(function(){d.oCurrentSubScreen&&(tb.delegateRun(d.oCurrentSubScreen,"onHide"),d.oCurrentSubScreen.viewModelDom.hide()),d.oCurrentSubScreen=e,d.oCurrentSubScreen&&(d.oCurrentSubScreen.viewModelDom.show(),tb.delegateRun(d.oCurrentSubScreen,"onShow"),h.each(d.menu(),function(a){a.selected(e&&e.__rlSettingsData&&a.route===e.__rlSettingsData.Route)}),b("#rl-content .b-settings .b-content .content").scrollTop(0)),ob.windowResize()})):tb.setHash(Ab.link().settings(),!1,!0)},fb.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(tb.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},fb.prototype.onBuild=function(){h.each(sb.settings,function(a){a&&a.__rlSettingsData&&!h.find(sb["settings-removed"],function(b){return b&&b===a})&&this.menu.push({route:a.__rlSettingsData.Route,label:a.__rlSettingsData.Label,selected:c.observable(!1),disabled:!!h.find(sb["settings-disabled"],function(b){return b&&b===a})})},this),this.oViewModelPlace=b("#rl-content #rl-settings-subscreen")},fb.prototype.routes=function(){var a=h.find(sb.settings,function(a){return a&&a.__rlSettingsData&&a.__rlSettingsData.IsDefault}),b=a?a.__rlSettingsData.Route:"general",c={subname:/^(.*)$/,normalize_:function(a,c){return c.subname=ob.isUnd(c.subname)?b:ob.pString(c.subname),[c.subname]}};return[["{subname}/",c],["{subname}",c],["",c]]},h.extend(gb.prototype,q.prototype),gb.prototype.onShow=function(){Ab.setTitle(ob.i18n("TITLES/LOGIN"))},h.extend(hb.prototype,q.prototype),hb.prototype.oLastRoute={},hb.prototype.onShow=function(){var a=Ab.data().accountEmail();Ab.setTitle((""===a?"":a+" - ")+ob.i18n("TITLES/MAILBOX"))},hb.prototype.onRoute=function(a,b,c){var d=Ab.data(),e=Ab.cache().getFolderFullNameRaw(a),f=Ab.cache().getFolderFromCacheList(e);f&&(d.currentFolder(f).messageListPage(b).messageListSearch(c),!d.usePreviewPane()&&d.message()&&d.message(null),Ab.reloadMessageList())},hb.prototype.onStart=function(){var b=Ab.data(),c=function(){ob.windowResize()};(Ab.settingsGet("AllowAdditionalAccounts")||Ab.settingsGet("AllowIdentities"))&&Ab.accountsAndIdentities(),h.delay(function(){Ab.quota()},5e3),h.delay(function(){"INBOX"!==b.currentFolderFullNameRaw()&&Ab.folderInformation("INBOX")},1e3),h.delay(function(){var a=Ab.data().spamFolder();a!==b.currentFolderFullNameRaw()&&Ab.folderInformation(a)},1500),h.delay(function(){var a=Ab.data().draftFolder();a!==b.currentFolderFullNameRaw()&&Ab.folderInformation(a)},2e3),h.delay(function(){Ab.remote().appDelayStart(ob.emptyFunction)},35e3),a.setInterval(function(){Ab.folderInformation("INBOX")},12e4),a.setInterval(function(){Ab.quota()},3e5),wb.toggleClass("rl-no-preview-pane",!b.usePreviewPane()),b.folderList.subscribe(c),b.messageList.subscribe(c),b.message.subscribe(c),b.usePreviewPane.subscribe(function(a){wb.toggleClass("rl-no-preview-pane",!a)})},hb.prototype.onBuild=function(){rb.bMobileDevice||h.defer(function(){ob.initLayoutResizer("#rl-resizer-left","#rl-resizer-right","#rl-right",350,800,350,350,mb.ClientSideKeyName.MailBoxListSize)})},hb.prototype.routes=function(){var a=function(a,b){return b[0]=ob.pString(b[0]),b[1]=ob.pInt(b[1]),b[1]=0>=b[1]?1:b[1],b[2]=ob.pString(b[2]),""===a&&(b[0]="Inbox",b[1]=1),[decodeURI(b[0]),b[1],decodeURI(b[2])]},b=function(a,b){return b[0]=ob.pString(b[0]),b[1]=ob.pString(b[1]),""===a&&(b[0]="Inbox"),[decodeURI(b[0]),1,decodeURI(b[1])]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:b}],[/^([^\/]*)$/,{normalize_:a}]]},h.extend(ib.prototype,fb.prototype),ib.prototype.onShow=function(){Ab.setTitle(this.sSettingsTitle)},h.extend(jb.prototype,o.prototype),jb.prototype.oSettings=null,jb.prototype.oLink=null,jb.prototype.download=function(b){var c=null,d=null,e=navigator.userAgent.toLowerCase();return e&&(e.indexOf("chrome")>-1||e.indexOf("chrome")>-1)&&(c=document.createElement("a"),c.href=b,document.createEvent&&(d=document.createEvent("MouseEvents"),d&&d.initEvent&&c.dispatchEvent))?(d.initEvent("click",!0,!0),c.dispatchEvent(d),!0):(rb.bMobileDevice?(a.open(b,"_self"),a.focus()):this.iframe.attr("src",b),!0)},jb.prototype.link=function(){return null===this.oLink&&(this.oLink=new i),this.oLink},jb.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new n),this.oLocal},jb.prototype.settingsGet=function(a){return null===this.oSettings&&(this.oSettings=ob.isNormal(ub)?ub:{}),ob.isUnd(this.oSettings[a])?null:this.oSettings[a]},jb.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=ob.isNormal(ub)?ub:{}),this.oSettings[a]=b},jb.prototype.setTitle=function(b){b=(0l;l++)p.push({id:e[l][0],name:e[l][1],disable:!1});for(l=0,m=b.length;m>l;l++)n=b[l],(h?h.call(null,n):!0)&&p.push({id:n.fullNameRaw,system:!0,name:i?i.call(null,n):n.name(),disable:!n.selectable||-1l;l++)n=c[l],n.isGmailFolder||!n.subScribed()&&n.existen||(h?h.call(null,n):!0)&&(mb.FolderType.User===n.type()||!j||!n.isNamespaceFolder&&0
").addClass("rl-settings-view-model").hide().attr("data-bind",'template: {name: "'+f.__rlSettingsData.Template+'"}, i18nInit: true'),i.appendTo(g),e.data=Ab.data(),e.viewModelDom=i,e.__rlSettingsData=f.__rlSettingsData,f.__dom=i,f.__builded=!0,f.__vm=e,c.applyBindings(e,i[0]),tb.delegateRun(e,"onBuild",[i])):ob.log("Cannot find sub settings view model position: SettingsSubScreen")),e&&h.defer(function(){d.oCurrentSubScreen&&(tb.delegateRun(d.oCurrentSubScreen,"onHide"),d.oCurrentSubScreen.viewModelDom.hide()),d.oCurrentSubScreen=e,d.oCurrentSubScreen&&(d.oCurrentSubScreen.viewModelDom.show(),tb.delegateRun(d.oCurrentSubScreen,"onShow"),h.each(d.menu(),function(a){a.selected(e&&e.__rlSettingsData&&a.route===e.__rlSettingsData.Route)}),b("#rl-content .b-settings .b-content .content").scrollTop(0)),ob.windowResize()})):tb.setHash(Ab.link().settings(),!1,!0)},fb.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(tb.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},fb.prototype.onBuild=function(){h.each(sb.settings,function(a){a&&a.__rlSettingsData&&!h.find(sb["settings-removed"],function(b){return b&&b===a})&&this.menu.push({route:a.__rlSettingsData.Route,label:a.__rlSettingsData.Label,selected:c.observable(!1),disabled:!!h.find(sb["settings-disabled"],function(b){return b&&b===a})})},this),this.oViewModelPlace=b("#rl-content #rl-settings-subscreen")},fb.prototype.routes=function(){var a=h.find(sb.settings,function(a){return a&&a.__rlSettingsData&&a.__rlSettingsData.IsDefault}),b=a?a.__rlSettingsData.Route:"general",c={subname:/^(.*)$/,normalize_:function(a,c){return c.subname=ob.isUnd(c.subname)?b:ob.pString(c.subname),[c.subname]}};return[["{subname}/",c],["{subname}",c],["",c]]},h.extend(gb.prototype,q.prototype),gb.prototype.onShow=function(){Ab.setTitle(ob.i18n("TITLES/LOGIN"))},h.extend(hb.prototype,q.prototype),hb.prototype.oLastRoute={},hb.prototype.onShow=function(){var a=Ab.data().accountEmail();Ab.setTitle((""===a?"":a+" - ")+ob.i18n("TITLES/MAILBOX"))},hb.prototype.onRoute=function(a,b,c){var d=Ab.data(),e=Ab.cache().getFolderFullNameRaw(a),f=Ab.cache().getFolderFromCacheList(e);f&&(d.currentFolder(f).messageListPage(b).messageListSearch(c),!d.usePreviewPane()&&d.message()&&d.message(null),Ab.reloadMessageList())},hb.prototype.onStart=function(){var b=Ab.data(),c=function(){ob.windowResize()};(Ab.settingsGet("AllowAdditionalAccounts")||Ab.settingsGet("AllowIdentities"))&&Ab.accountsAndIdentities(),h.delay(function(){Ab.quota()},5e3),h.delay(function(){"INBOX"!==b.currentFolderFullNameRaw()&&Ab.folderInformation("INBOX")},1e3),h.delay(function(){var a=Ab.data().spamFolder();a!==b.currentFolderFullNameRaw()&&""!==a&&Ab.folderInformation(a)},1500),h.delay(function(){var a=Ab.data().draftFolder();a!==b.currentFolderFullNameRaw()&&""!==a&&Ab.folderInformation(a)},2e3),h.delay(function(){Ab.remote().appDelayStart(ob.emptyFunction)},35e3),a.setInterval(function(){Ab.folderInformation("INBOX")},12e4),a.setInterval(function(){Ab.quota()},3e5),wb.toggleClass("rl-no-preview-pane",!b.usePreviewPane()),b.folderList.subscribe(c),b.messageList.subscribe(c),b.message.subscribe(c),b.usePreviewPane.subscribe(function(a){wb.toggleClass("rl-no-preview-pane",!a)})},hb.prototype.onBuild=function(){rb.bMobileDevice||h.defer(function(){ob.initLayoutResizer("#rl-resizer-left","#rl-resizer-right","#rl-right",350,800,350,350,mb.ClientSideKeyName.MailBoxListSize)})},hb.prototype.routes=function(){var a=function(a,b){return b[0]=ob.pString(b[0]),b[1]=ob.pInt(b[1]),b[1]=0>=b[1]?1:b[1],b[2]=ob.pString(b[2]),""===a&&(b[0]="Inbox",b[1]=1),[decodeURI(b[0]),b[1],decodeURI(b[2])]},b=function(a,b){return b[0]=ob.pString(b[0]),b[1]=ob.pString(b[1]),""===a&&(b[0]="Inbox"),[decodeURI(b[0]),1,decodeURI(b[1])]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:b}],[/^([^\/]*)$/,{normalize_:a}]]},h.extend(ib.prototype,fb.prototype),ib.prototype.onShow=function(){Ab.setTitle(this.sSettingsTitle)},h.extend(jb.prototype,o.prototype),jb.prototype.oSettings=null,jb.prototype.oLink=null,jb.prototype.download=function(b){var c=null,d=null,e=navigator.userAgent.toLowerCase();return e&&(e.indexOf("chrome")>-1||e.indexOf("chrome")>-1)&&(c=document.createElement("a"),c.href=b,document.createEvent&&(d=document.createEvent("MouseEvents"),d&&d.initEvent&&c.dispatchEvent))?(d.initEvent("click",!0,!0),c.dispatchEvent(d),!0):(rb.bMobileDevice?(a.open(b,"_self"),a.focus()):this.iframe.attr("src",b),!0)},jb.prototype.link=function(){return null===this.oLink&&(this.oLink=new i),this.oLink},jb.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new n),this.oLocal},jb.prototype.settingsGet=function(a){return null===this.oSettings&&(this.oSettings=ob.isNormal(ub)?ub:{}),ob.isUnd(this.oSettings[a])?null:this.oSettings[a]},jb.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=ob.isNormal(ub)?ub:{}),this.oSettings[a]=b},jb.prototype.setTitle=function(b){b=(0l;l++)p.push({id:e[l][0],name:e[l][1],disable:!1});for(l=0,m=b.length;m>l;l++)n=b[l],(h?h.call(null,n):!0)&&p.push({id:n.fullNameRaw,system:!0,name:i?i.call(null,n):n.name(),disable:!n.selectable||-1l;l++)n=c[l],n.isGmailFolder||!n.subScribed()&&n.existen||(h?h.call(null,n):!0)&&(mb.FolderType.User===n.type()||!j||!n.isNamespaceFolder&&0