").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=pb.createCommand(e,function(){ub.hideScreenPopup(a)})),qb.runHook("view-model-pre-build",[a.__name,e,h]),c.applyBindings(e,h[0]),this.delegateRun(e,"onBuild",[h]),qb.runHook("view-model-post-build",[a.__name,e,h])):pb.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),qb.runHook("view-model-on-show",[a.__name,a.__vm,b||[]])))},r.prototype.screenOnRoute=function(a,b){var c=this,d=null,e=null;""===pb.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,pb.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"),pb.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"),qb.runHook("screen-on-show",[c.oCurrentScreen.screenName(),c.oCurrentScreen]),pb.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"),qb.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(),qb.runHook("screen-pre-start",[a.screenName(),a]),this.delegateRun(a,"onStart"),qb.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=pb.isUnd(c)?!1:!!c,(pb.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},ub=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=nb.EmailType.Facebook),null===this.privateType&&(this.privateType=nb.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=pb.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=pb.trim(a.Name),this.email=pb.trim(a.Email),b=""!==this.email,this.clearDuplicateName()),b},s.prototype.toLine=function(a,b,c){var d="";return""!==this.email&&(b=pb.isUnd(b)?!1:!!b,c=pb.isUnd(c)?!1:!!c,a&&""!==this.name?d=b?'
")+'" target="_blank" tabindex="-1">'+pb.encodeHtml(this.name)+"":c?pb.encodeHtml(this.name):this.name:(d=this.email,""!==this.name?b?d=pb.encodeHtml('"'+this.name+'" <')+'
")+'" target="_blank" tabindex="-1">'+pb.encodeHtml(d)+""+pb.encodeHtml(">"):(d='"'+this.name+'" <'+d+">",c&&(d=pb.encodeHtml(d))):b&&(d='
'+pb.encodeHtml(this.email)+""))),d},s.prototype.mailsoParse=function(a){if(a=pb.trim(a),""===a)return!1;for(var b=function(a,b,c){a+="";var d=a.length;return 0>b&&(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;m
0&&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=pb.trim(e).replace(/^[<]+/,"").replace(/[>]+$/,""),d=pb.trim(d).replace(/^["']+/,"").replace(/["']+$/,""),f=pb.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(pb.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++)pb.isUnd(b[a[d].email])&&(b[a[d].email]=!0,c.push(a[d]))},x.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.requestHash="",this.subject(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(nb.MessagePriority.Normal),this.fromEmailString(""),this.toEmailsString(""),this.senderEmailsString(""),this.prefetched=!1,this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isRtl(!1),this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.priority(nb.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},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(pb.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(pb.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(pb.pInt(a.ParentThread)),this.threads(pb.isArray(a.Threads)?a.Threads:[]),this.threadsLen(pb.pInt(a.ThreadsLen)),this.initFlagsByJson(a),this.computeSenderEmail(),b=!0),b},x.prototype.computeSenderEmail=function(){var a=Bb.data().sentFolder(),b=Bb.data().draftFolder();this.senderEmailsString(this.folderFullNameRaw===a||this.folderFullNameRaw===b?this.toEmailsString():this.fromEmailString())},x.prototype.initUpdateByMessageJson=function(a){var b=!1,c=nb.MessagePriority.Normal;return a&&"Object/Message"===a["@Object"]&&(c=pb.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 pb.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 pb.isArray(this.from)&&this.from[0]?this.from[0].email:""},x.prototype.viewLink=function(){return Bb.link().messageViewLink(this.requestHash)},x.prototype.downloadLink=function(){return Bb.link().messageDownloadLink(this.requestHash)},x.prototype.replyEmails=function(a){var b=[],c=pb.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=pb.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(nb.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=pb.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=pb.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]}),yb.resize()),pb.windowResize(500))},x.prototype.showInternalImages=function(a){if(this.body&&!this.body.data("rl-init-internal-images")){a=pb.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=pb.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]),pb.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.canBeEdited=c.computed(function(){return nb.FolderType.User===this.type()&&this.existen&&this.selectable},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 nb.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){pb.isPosNumeric(a,!0)?this.privateMessageCountAll(a):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=c.computed({read:this.privateMessageCountUnread,write:function(a){pb.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();if(nb.FolderType.Inbox===c&&Bb.data().foldersInboxUnreadCount(b),a>0){if(nb.FolderType.Draft===c)return""+a;if(b>0&&nb.FolderType.Trash!==c&&nb.FolderType.SentItems!==c)return""+b}return""},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(){pb.timeOutAction("folder-list-folder-visibility-change",function(){yb.trigger("folder-list-folder-visibility-change")},100)}),this.localName=c.computed(function(){sb.langChangeTrigger();var a=this.type(),b=this.name();if(this.isSystemFolder())switch(a){case nb.FolderType.Inbox:b=pb.i18n("FOLDER_LIST/INBOX_NAME");break;case nb.FolderType.SentItems:b=pb.i18n("FOLDER_LIST/SENT_NAME");break;case nb.FolderType.Draft:b=pb.i18n("FOLDER_LIST/DRAFTS_NAME");break;case nb.FolderType.Spam:b=pb.i18n("FOLDER_LIST/SPAM_NAME");break;case nb.FolderType.Trash:b=pb.i18n("FOLDER_LIST/TRASH_NAME")}return b},this),this.manageFolderSystemName=c.computed(function(){sb.langChangeTrigger();var a="",b=this.type(),c=this.name();if(this.isSystemFolder())switch(b){case nb.FolderType.Inbox:a="("+pb.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case nb.FolderType.SentItems:a="("+pb.i18n("FOLDER_LIST/SENT_NAME")+")";break;case nb.FolderType.Draft:a="("+pb.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case nb.FolderType.Spam:a="("+pb.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case nb.FolderType.Trash:a="("+pb.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.interval=0,y.prototype.isNamespaceFolder=!1,y.prototype.isGmailFolder=!1,y.prototype.isUnpaddigFolder=!1,y.prototype.collapsedCss=function(){return this.hasSubScribedSubfolders()?this.collapsed()?"icon-right-mini e-collapsed-sign":"icon-down-mini 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?nb.FolderType.Inbox:nb.FolderType.User),b=!0),b},y.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")},z.prototype.email="",z.prototype.changeAccountLink=function(){return Bb.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():'"'+pb.quoteName(a)+'" <'+this.email()+">"},pb.extendAsViewModel("PopupsFolderClearViewModel",B),B.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},B.prototype.onShow=function(a){this.clearPopup(),a&&this.selectedFolder(a)},B.prototype.onBuild=function(){var a=this;yb.on("keydown",function(b){var c=!0;return b&&nb.EventKeyCode.Esc===b.keyCode&&a.modalVisibility()&&(ub.delegateRun(a,"cancelCommand"),c=!1),c})},pb.extendAsViewModel("PopupsFolderCreateViewModel",C),C.prototype.sNoParentText="",C.prototype.simpleFolderNameValidation=function(a){return/^[^\\\/]+$/g.test(pb.trim(a))},C.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.focusTrigger(!1)},C.prototype.onShow=function(){this.clearPopup(),this.focusTrigger(!0)},C.prototype.onBuild=function(){var a=this;yb.on("keydown",function(b){var c=!0;return b&&nb.EventKeyCode.Esc===b.keyCode&&a.modalVisibility()&&(ub.delegateRun(a,"cancelCommand"),c=!1),c})},pb.extendAsViewModel("PopupsFolderSystemViewModel",D),D.prototype.sChooseOnText="",D.prototype.sUnuseText="",D.prototype.onShow=function(a){var b="";switch(a=pb.isUnd(a)?nb.SetSystemFoldersNotification.None:a){case nb.SetSystemFoldersNotification.Sent:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case nb.SetSystemFoldersNotification.Draft:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case nb.SetSystemFoldersNotification.Spam:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case nb.SetSystemFoldersNotification.Trash:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH")}this.notification(b)},D.prototype.onBuild=function(){var a=this;yb.on("keydown",function(b){var c=!0;return b&&nb.EventKeyCode.Esc===b.keyCode&&a.modalVisibility()&&(ub.delegateRun(a,"cancelCommand"),c=!1),c})},pb.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[Bb.data().accountEmail()]=Bb.data().accountEmail(),a){case nb.ComposeType.Empty:d=Bb.data().accountEmail();break;case nb.ComposeType.Reply:case nb.ComposeType.ReplyAll:case nb.ComposeType.Forward:case nb.ComposeType.ForwardAsAttachment:h.find(h.union(b.to,b.cc,b.bcc),e);break;case nb.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=Bb.data().displayName(),c=Bb.data().accountEmail();return""===b?c:(pb.isUnd(a)?1:!a)?b+" ("+c+")":'"'+pb.quoteName(b)+'" <'+c+">"},E.prototype.sendMessageResponse=function(b,c){var d=!1;this.sending(!1),nb.StorageResultType.Success===b&&c&&c.Result&&(d=!0,this.modalVisibility()&&ub.delegateRun(this,"closeCommand")),this.modalVisibility()&&!d&&(c&&nb.Notification.CantSaveMessage===c.ErrorCode?(this.sendSuccessButSaveError(!0),a.alert(pb.trim(pb.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(this.sendError(!0),a.alert(pb.getNotification(c&&c.ErrorCode?c.ErrorCode:nb.Notification.CantSendMessage))))},E.prototype.saveMessageResponse=function(b,c){var d=!1,e=null;this.saving(!1),nb.StorageResultType.Success===b&&c&&c.Result&&c.Result.NewFolder&&c.Result.NewUid&&(this.bFromDraft&&(e=Bb.data().message(),e&&this.draftFolder()===e.folderFullNameRaw&&this.draftUid()===e.uid&&Bb.data().message(null)),this.draftFolder(c.Result.NewFolder),this.draftUid(c.Result.NewUid),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&&pb.isNormal(c)&&(t=pb.isArray(c)&&1===c.length?c[0]:pb.isArray(c)?null:c),null!==q&&(p[q]=!0,this.currentIdentityID(this.findIdentityIdByMessage(v,t))),this.reset(),pb.isNonEmptyArray(d)&&this.to(w(d)),""!==v&&t){switch(j=t.fullFormatDateValue(),k=t.subject(),s=t.aDraftInfo,l=b(t.body).clone(),pb.removeBlockquoteSwitcher(l),m=l.html(),v){case nb.ComposeType.Empty:break;case nb.ComposeType.Reply:this.to(w(t.replyEmails(p))),this.subject(pb.replySubjectAdd("Re",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["reply",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.sReferences),u=!0;break;case nb.ComposeType.ReplyAll:o=t.replyAllEmails(p),this.to(w(o[0])),this.cc(w(o[1])),this.subject(pb.replySubjectAdd("Re",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["reply",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.references()),u=!0;break;case nb.ComposeType.Forward:this.subject(pb.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["forward",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.sReferences);break;case nb.ComposeType.ForwardAsAttachment:this.subject(pb.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["forward",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.sReferences);break;case nb.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.subject(k),this.prepearMessageAttachments(t,v),this.aDraftInfo=pb.isNonEmptyArray(s)&&3===s.length?s:null,this.sInReplyTo=t.sInReplyTo,this.sReferences=t.sReferences}if(this.oEditor){switch(v){case nb.ComposeType.Reply:case nb.ComposeType.ReplyAll:f=t.fromToLine(!1,!0),n=pb.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:j,EMAIL:f}),m="
"+n+":
"+m+"
";break;case nb.ComposeType.Forward:f=t.fromToLine(!1,!0),g=t.toToLine(!1,!0),i=t.ccToLine(!1,!0),m="
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+f+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+g+(0"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+i:"")+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+pb.encodeHtml(j)+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+pb.encodeHtml(k)+"
"+m;break;case nb.ComposeType.ForwardAsAttachment:m=""}this.oEditor.setRawText(m,t.isHtml())}}else this.oEditor&&nb.ComposeType.Empty===v?this.oEditor.setRawText("
"+pb.convertPlainTextToHtml(Bb.data().signature()),nb.EditorDefaultType.Html===Bb.data().editorDefaultType()):pb.isNonEmptyArray(c)&&h.each(c,function(a){e.addMessageAsAttachment(a)});""===this.to()&&this.to.focusTrigger(!this.to.focusTrigger()),r=this.getAttachmentsDownloadsForUpload(),pb.isNonEmptyArray(r)&&Bb.remote().messageUploadAttachments(function(a,b){if(nb.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.tryToClosePopup=function(){var a=this;ub.showScreenPopup(K,[pb.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){a.modalVisibility()&&ub.delegateRun(a,"closeCommand")}])},E.prototype.onBuild=function(){this.initEditor(),this.initUploader();var a=this,c=null;yb.on("keydown",function(b){var c=!0;return b&&a.modalVisibility()&&Bb.data().useKeyboardShortcuts()&&(b.ctrlKey&&nb.EventKeyCode.S===b.keyCode?(a.saveCommand(),c=!1):b.ctrlKey&&nb.EventKeyCode.Enter===b.keyCode?(a.sendCommand(),c=!1):nb.EventKeyCode.Esc===b.keyCode&&(a.tryToClosePopup(),c=!1)),c}),yb.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",Bb.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(pb.i18n("EDITOR/TEXT_SWITCHER_CONFIRM"),pb.i18n("EDITOR/TEXT_SWITCHER_PLAINT_TEXT"),pb.i18n("EDITOR/TEXT_SWITCHER_RICH_FORMATTING"))}},E.prototype.initUploader=function(){if(this.composeUploaderButton()){var a={},b=pb.pInt(Bb.settingsGet("AttachmentLimit")),c=new g({action:Bb.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});c?(c.on("onDragEnter",h.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",h.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",h.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",h.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",h.bind(function(b,c,d){var e=null;pb.isUnd(a[b])?(e=this.getAttachmentById(b),e&&(a[b]=e)):e=a[b],e&&e.progress(" - "+Math.floor(c/d*100)+"%")},this)).on("onSelect",h.bind(function(a,d){this.dragAndDropOver(!1);var e=this,f=pb.isUnd(d.FileName)?"":d.FileName.toString(),g=pb.isNormal(d.Size)?pb.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(pb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",h.bind(function(b){var c=null;pb.isUnd(a[b])?(c=this.getAttachmentById(b),c&&(a[b]=c)):c=a[b],c&&(c.waiting(!1),c.uploading(!0))},this)).on("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=pb.getUploadErrorDescByCode(f):g||(e=pb.i18n("UPLOAD/ERROR_UNKNOWN")),h&&(""!==e&&00&&d>0&&f>d?(e.uploading(!1),e.error(pb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(Bb.remote().composeUploadExternals(function(a,b){var c=!1;e.uploading(!1),nb.StorageResultType.Success===a&&b&&b.Result&&b.Result[e.id]&&(c=!0,e.tempName(b.Result[e.id])),c||e.error(pb.getUploadErrorDescByCode(nb.UploadErrorCode.FileNoUploaded))},[a.link]),!0)},E.prototype.prepearMessageAttachments=function(a,b){if(a){var c=this,d=pb.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(nb.ComposeType.ForwardAsAttachment===b)this.addMessageAsAttachment(a);else for(;f>e;e++){switch(h=d[e],i=!1,b){case nb.ComposeType.Reply:case nb.ComposeType.ReplyAll:i=h.isLinked;break;case nb.ComposeType.Forward:case nb.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(pb.getUploadErrorDescByCode(nb.UploadErrorCode.FileNoUploaded))},this)},E.prototype.isEmptyForm=function(a){a=pb.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.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())},pb.extendAsViewModel("PopupsContactsViewModel",F),F.prototype.setShareToNone=function(){this.viewScopeType(nb.ContactScopeType.Default)},F.prototype.setShareToAll=function(){this.viewScopeType(nb.ContactScopeType.ShareAll)},F.prototype.addNewProperty=function(a){var b=new u(a,"");b.focused(!0),this.viewProperties.push(b)},F.prototype.addNewEmail=function(){this.addNewProperty(nb.ContactPropertyType.EmailPersonal)},F.prototype.addNewPhone=function(){this.addNewProperty(nb.ContactPropertyType.MobilePersonal)},F.prototype.removeCheckedOrSelectedContactsFromList=function(){var a=this,b=this.contacts,c=this.currentContact(),d=this.contacts().length,e=this.contactsCheckedOrSelected();0=d&&(this.bDropPageAfterDelete=!0),h.delay(function(){h.each(e,function(a){b.remove(a)})},500))},F.prototype.deleteSelectedContacts=function(){00?d:0),b.contactsCount(d),b.contacts(e),b.viewClearSearch(""!==b.search()),b.contacts.loading(!1),""!==b.viewID()&&!b.currentContact()&&b.contacts.setSelectedByUid&&b.contacts.setSelectedByUid(""+b.viewID())},c,mb.Defaults.ContactsPerPage,this.search())},F.prototype.onBuild=function(a){this.oContentVisible=b(".b-list-content",a),this.oContentScrollable=b(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable);var d=this;c.computed(function(){var a=this.modalVisibility(),b=Bb.data().useKeyboardShortcuts();this.selector.useKeyboard(a&&b)},this).extend({notify:"always"}),a.on("click",".e-pagenator .e-page",function(){var a=c.dataFor(this);a&&(d.contactsPage(pb.pInt(a.value)),d.reloadContactList())}),yb.on("keydown",function(a){var b=!0;return a&&nb.EventKeyCode.Esc===a.keyCode&&d.modalVisibility()&&(ub.delegateRun(d,"closeCommand"),b=!1),b})},F.prototype.onShow=function(){ub.routeOff(),this.reloadContactList(!0)},F.prototype.onHide=function(){ub.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),h.each(this.contacts(),function(a){a.checked(!1)})},pb.extendAsViewModel("PopupsAdvancedSearchViewModel",G),G.prototype.buildSearchStringValue=function(a){return-1=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(nb.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=pb.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=pb.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]}),yb.resize()),pb.windowResize(500))},x.prototype.showInternalImages=function(a){if(this.body&&!this.body.data("rl-init-internal-images")){a=pb.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=pb.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]),pb.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.canBeEdited=c.computed(function(){return nb.FolderType.User===this.type()&&this.existen&&this.selectable},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 nb.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){pb.isPosNumeric(a,!0)?this.privateMessageCountAll(a):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=c.computed({read:this.privateMessageCountUnread,write:function(a){pb.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();if(nb.FolderType.Inbox===c&&Bb.data().foldersInboxUnreadCount(b),a>0){if(nb.FolderType.Draft===c)return""+a;if(b>0&&nb.FolderType.Trash!==c&&nb.FolderType.SentItems!==c)return""+b}return""},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(){pb.timeOutAction("folder-list-folder-visibility-change",function(){yb.trigger("folder-list-folder-visibility-change")},100)}),this.localName=c.computed(function(){sb.langChangeTrigger();var a=this.type(),b=this.name();if(this.isSystemFolder())switch(a){case nb.FolderType.Inbox:b=pb.i18n("FOLDER_LIST/INBOX_NAME");break;case nb.FolderType.SentItems:b=pb.i18n("FOLDER_LIST/SENT_NAME");break;case nb.FolderType.Draft:b=pb.i18n("FOLDER_LIST/DRAFTS_NAME");break;case nb.FolderType.Spam:b=pb.i18n("FOLDER_LIST/SPAM_NAME");break;case nb.FolderType.Trash:b=pb.i18n("FOLDER_LIST/TRASH_NAME")}return b},this),this.manageFolderSystemName=c.computed(function(){sb.langChangeTrigger();var a="",b=this.type(),c=this.name();if(this.isSystemFolder())switch(b){case nb.FolderType.Inbox:a="("+pb.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case nb.FolderType.SentItems:a="("+pb.i18n("FOLDER_LIST/SENT_NAME")+")";break;case nb.FolderType.Draft:a="("+pb.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case nb.FolderType.Spam:a="("+pb.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case nb.FolderType.Trash:a="("+pb.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.interval=0,y.prototype.isNamespaceFolder=!1,y.prototype.isGmailFolder=!1,y.prototype.isUnpaddigFolder=!1,y.prototype.collapsedCss=function(){return this.hasSubScribedSubfolders()?this.collapsed()?"icon-right-mini e-collapsed-sign":"icon-down-mini 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?nb.FolderType.Inbox:nb.FolderType.User),b=!0),b},y.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")},z.prototype.email="",z.prototype.changeAccountLink=function(){return Bb.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():'"'+pb.quoteName(a)+'" <'+this.email()+">"},pb.extendAsViewModel("PopupsFolderClearViewModel",B),B.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},B.prototype.onShow=function(a){this.clearPopup(),a&&this.selectedFolder(a)},B.prototype.onBuild=function(){var a=this;yb.on("keydown",function(b){var c=!0;return b&&nb.EventKeyCode.Esc===b.keyCode&&a.modalVisibility()&&(ub.delegateRun(a,"cancelCommand"),c=!1),c})},pb.extendAsViewModel("PopupsFolderCreateViewModel",C),C.prototype.sNoParentText="",C.prototype.simpleFolderNameValidation=function(a){return/^[^\\\/]+$/g.test(pb.trim(a))},C.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.focusTrigger(!1)},C.prototype.onShow=function(){this.clearPopup(),this.focusTrigger(!0)},C.prototype.onBuild=function(){var a=this;yb.on("keydown",function(b){var c=!0;return b&&nb.EventKeyCode.Esc===b.keyCode&&a.modalVisibility()&&(ub.delegateRun(a,"cancelCommand"),c=!1),c})},pb.extendAsViewModel("PopupsFolderSystemViewModel",D),D.prototype.sChooseOnText="",D.prototype.sUnuseText="",D.prototype.onShow=function(a){var b="";switch(a=pb.isUnd(a)?nb.SetSystemFoldersNotification.None:a){case nb.SetSystemFoldersNotification.Sent:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case nb.SetSystemFoldersNotification.Draft:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case nb.SetSystemFoldersNotification.Spam:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case nb.SetSystemFoldersNotification.Trash:b=pb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH")}this.notification(b)},D.prototype.onBuild=function(){var a=this;yb.on("keydown",function(b){var c=!0;return b&&nb.EventKeyCode.Esc===b.keyCode&&a.modalVisibility()&&(ub.delegateRun(a,"cancelCommand"),c=!1),c})},pb.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[Bb.data().accountEmail()]=Bb.data().accountEmail(),a){case nb.ComposeType.Empty:d=Bb.data().accountEmail();break;case nb.ComposeType.Reply:case nb.ComposeType.ReplyAll:case nb.ComposeType.Forward:case nb.ComposeType.ForwardAsAttachment:h.find(h.union(b.to,b.cc,b.bcc),e);break;case nb.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=Bb.data().displayName(),c=Bb.data().accountEmail();return""===b?c:(pb.isUnd(a)?1:!a)?b+" ("+c+")":'"'+pb.quoteName(b)+'" <'+c+">"},E.prototype.sendMessageResponse=function(b,c){var d=!1;this.sending(!1),nb.StorageResultType.Success===b&&c&&c.Result&&(d=!0,this.modalVisibility()&&ub.delegateRun(this,"closeCommand")),this.modalVisibility()&&!d&&(c&&nb.Notification.CantSaveMessage===c.ErrorCode?(this.sendSuccessButSaveError(!0),a.alert(pb.trim(pb.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(this.sendError(!0),a.alert(pb.getNotification(c&&c.ErrorCode?c.ErrorCode:nb.Notification.CantSendMessage))))},E.prototype.saveMessageResponse=function(b,c){var d=!1,e=null;this.saving(!1),nb.StorageResultType.Success===b&&c&&c.Result&&c.Result.NewFolder&&c.Result.NewUid&&(this.bFromDraft&&(e=Bb.data().message(),e&&this.draftFolder()===e.folderFullNameRaw&&this.draftUid()===e.uid&&Bb.data().message(null)),this.draftFolder(c.Result.NewFolder),this.draftUid(c.Result.NewUid),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&&pb.isNormal(c)&&(t=pb.isArray(c)&&1===c.length?c[0]:pb.isArray(c)?null:c),null!==q&&(p[q]=!0,this.currentIdentityID(this.findIdentityIdByMessage(v,t))),this.reset(),pb.isNonEmptyArray(d)&&this.to(w(d)),""!==v&&t){switch(j=t.fullFormatDateValue(),k=t.subject(),s=t.aDraftInfo,l=b(t.body).clone(),pb.removeBlockquoteSwitcher(l),m=l.html(),v){case nb.ComposeType.Empty:break;case nb.ComposeType.Reply:this.to(w(t.replyEmails(p))),this.subject(pb.replySubjectAdd("Re",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["reply",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.sReferences),u=!0;break;case nb.ComposeType.ReplyAll:o=t.replyAllEmails(p),this.to(w(o[0])),this.cc(w(o[1])),this.subject(pb.replySubjectAdd("Re",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["reply",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.references()),u=!0;break;case nb.ComposeType.Forward:this.subject(pb.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["forward",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.sReferences);break;case nb.ComposeType.ForwardAsAttachment:this.subject(pb.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(t,v),this.aDraftInfo=["forward",t.uid,t.folderFullNameRaw],this.sInReplyTo=t.sMessageId,this.sReferences=pb.trim(this.sInReplyTo+" "+t.sReferences);break;case nb.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.subject(k),this.prepearMessageAttachments(t,v),this.aDraftInfo=pb.isNonEmptyArray(s)&&3===s.length?s:null,this.sInReplyTo=t.sInReplyTo,this.sReferences=t.sReferences}if(this.oEditor){switch(v){case nb.ComposeType.Reply:case nb.ComposeType.ReplyAll:f=t.fromToLine(!1,!0),n=pb.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:j,EMAIL:f}),m="
"+n+":
"+m+"
";break;case nb.ComposeType.Forward:f=t.fromToLine(!1,!0),g=t.toToLine(!1,!0),i=t.ccToLine(!1,!0),m="
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+f+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+g+(0"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+i:"")+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+pb.encodeHtml(j)+"
"+pb.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+pb.encodeHtml(k)+"
"+m;break;case nb.ComposeType.ForwardAsAttachment:m=""}this.oEditor.setRawText(m,t.isHtml())}}else this.oEditor&&nb.ComposeType.Empty===v?this.oEditor.setRawText("
"+pb.convertPlainTextToHtml(Bb.data().signature()),nb.EditorDefaultType.Html===Bb.data().editorDefaultType()):pb.isNonEmptyArray(c)&&h.each(c,function(a){e.addMessageAsAttachment(a)});""===this.to()&&this.to.focusTrigger(!this.to.focusTrigger()),r=this.getAttachmentsDownloadsForUpload(),pb.isNonEmptyArray(r)&&Bb.remote().messageUploadAttachments(function(a,b){if(nb.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.tryToClosePopup=function(){var a=this;ub.showScreenPopup(K,[pb.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){a.modalVisibility()&&ub.delegateRun(a,"closeCommand")}])},E.prototype.onBuild=function(){this.initEditor(),this.initUploader();var a=this,c=null;yb.on("keydown",function(b){var c=!0;return b&&a.modalVisibility()&&Bb.data().useKeyboardShortcuts()&&(b.ctrlKey&&nb.EventKeyCode.S===b.keyCode?(a.saveCommand(),c=!1):b.ctrlKey&&nb.EventKeyCode.Enter===b.keyCode?(a.sendCommand(),c=!1):nb.EventKeyCode.Esc===b.keyCode&&(a.tryToClosePopup(),c=!1)),c}),yb.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",Bb.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(pb.i18n("EDITOR/TEXT_SWITCHER_CONFIRM"),pb.i18n("EDITOR/TEXT_SWITCHER_PLAINT_TEXT"),pb.i18n("EDITOR/TEXT_SWITCHER_RICH_FORMATTING"))}},E.prototype.initUploader=function(){if(this.composeUploaderButton()){var a={},b=pb.pInt(Bb.settingsGet("AttachmentLimit")),c=new g({action:Bb.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});c?(c.on("onDragEnter",h.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",h.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",h.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",h.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",h.bind(function(b,c,d){var e=null;pb.isUnd(a[b])?(e=this.getAttachmentById(b),e&&(a[b]=e)):e=a[b],e&&e.progress(" - "+Math.floor(c/d*100)+"%")},this)).on("onSelect",h.bind(function(a,d){this.dragAndDropOver(!1);var e=this,f=pb.isUnd(d.FileName)?"":d.FileName.toString(),g=pb.isNormal(d.Size)?pb.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(pb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",h.bind(function(b){var c=null;pb.isUnd(a[b])?(c=this.getAttachmentById(b),c&&(a[b]=c)):c=a[b],c&&(c.waiting(!1),c.uploading(!0))},this)).on("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=pb.getUploadErrorDescByCode(f):g||(e=pb.i18n("UPLOAD/ERROR_UNKNOWN")),h&&(""!==e&&00&&d>0&&f>d?(e.uploading(!1),e.error(pb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(Bb.remote().composeUploadExternals(function(a,b){var c=!1;e.uploading(!1),nb.StorageResultType.Success===a&&b&&b.Result&&b.Result[e.id]&&(c=!0,e.tempName(b.Result[e.id])),c||e.error(pb.getUploadErrorDescByCode(nb.UploadErrorCode.FileNoUploaded))},[a.link]),!0)},E.prototype.prepearMessageAttachments=function(a,b){if(a){var c=this,d=pb.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(nb.ComposeType.ForwardAsAttachment===b)this.addMessageAsAttachment(a);else for(;f>e;e++){switch(h=d[e],i=!1,b){case nb.ComposeType.Reply:case nb.ComposeType.ReplyAll:i=h.isLinked;break;case nb.ComposeType.Forward:case nb.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(pb.getUploadErrorDescByCode(nb.UploadErrorCode.FileNoUploaded))},this)},E.prototype.isEmptyForm=function(a){a=pb.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.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())},pb.extendAsViewModel("PopupsContactsViewModel",F),F.prototype.setShareToNone=function(){this.viewScopeType(nb.ContactScopeType.Default)},F.prototype.setShareToAll=function(){this.viewScopeType(nb.ContactScopeType.ShareAll)},F.prototype.addNewProperty=function(a){var b=new u(a,"");b.focused(!0),this.viewProperties.push(b)},F.prototype.addNewEmail=function(){this.addNewProperty(nb.ContactPropertyType.EmailPersonal)},F.prototype.addNewPhone=function(){this.addNewProperty(nb.ContactPropertyType.MobilePersonal)},F.prototype.removeCheckedOrSelectedContactsFromList=function(){var a=this,b=this.contacts,c=this.currentContact(),d=this.contacts().length,e=this.contactsCheckedOrSelected();0=d&&(this.bDropPageAfterDelete=!0),h.delay(function(){h.each(e,function(a){b.remove(a)})},500))},F.prototype.deleteSelectedContacts=function(){00?d:0),b.contactsCount(d),b.contacts(e),b.viewClearSearch(""!==b.search()),b.contacts.loading(!1),""!==b.viewID()&&!b.currentContact()&&b.contacts.setSelectedByUid&&b.contacts.setSelectedByUid(""+b.viewID())},c,mb.Defaults.ContactsPerPage,this.search())},F.prototype.onBuild=function(a){this.oContentVisible=b(".b-list-content",a),this.oContentScrollable=b(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable);var d=this;c.computed(function(){var a=this.modalVisibility(),b=Bb.data().useKeyboardShortcuts();this.selector.useKeyboard(a&&b)},this).extend({notify:"always"}),a.on("click",".e-pagenator .e-page",function(){var a=c.dataFor(this);a&&(d.contactsPage(pb.pInt(a.value)),d.reloadContactList())}),yb.on("keydown",function(a){var b=!0;return a&&d.modalVisibility()&&(nb.EventKeyCode.Esc===a.keyCode?(ub.delegateRun(d,"closeCommand"),b=!1):a.ctrlKey&&nb.EventKeyCode.S===a.keyCode&&(d.saveCommand(),b=!1)),b})},F.prototype.onShow=function(){ub.routeOff(),this.reloadContactList(!0)},F.prototype.onHide=function(){ub.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),h.each(this.contacts(),function(a){a.checked(!1)})},pb.extendAsViewModel("PopupsAdvancedSearchViewModel",G),G.prototype.buildSearchStringValue=function(a){return-10&&g.messageCountUnread(0<=g.messageCountUnread()-e?g.messageCountUnread()-e:0)),i&&(i.messageCountAll(i.messageCountAll()+b.length),e>0&&i.messageCountUnread(i.messageCountUnread()+e)),00&&(nb.EventKeyCode.Backspace===c||nb.EventKeyCode.Esc===c)&&d.viewModelVisibility()&&e.useKeyboardShortcuts()&&!pb.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&&Bb.download(a.linkDownload())}),this.oMessageScrollerDom=a.find(".messageItem .content"),this.oMessageScrollerDom=this.oMessageScrollerDom&&this.oMessageScrollerDom[0]?this.oMessageScrollerDom:null},R.prototype.isDraftFolder=function(){return Bb.data().message()&&Bb.data().draftFolder()===Bb.data().message().folderFullNameRaw},R.prototype.isSentFolder=function(){return Bb.data().message()&&Bb.data().sentFolder()===Bb.data().message().folderFullNameRaw},R.prototype.isDraftOrSentFolder=function(){return this.isDraftFolder()||this.isSentFolder()},R.prototype.composeClick=function(){ub.showScreenPopup(E)},R.prototype.editMessage=function(){Bb.data().message()&&ub.showScreenPopup(E,[nb.ComposeType.Draft,Bb.data().message()])},R.prototype.scrollMessageToTop=function(){this.oMessageScrollerDom&&this.oMessageScrollerDom.scrollTop(0)},R.prototype.showImages=function(a){a&&a.showExternalImages&&a.showExternalImages(!0)},pb.extendAsViewModel("SettingsMenuViewModel",S),S.prototype.link=function(a){return Bb.link().settings(a)},S.prototype.backToMailBoxClick=function(){ub.setHash(Bb.link().inbox())},pb.extendAsViewModel("SettingsPaneViewModel",T),T.prototype.onShow=function(){Bb.data().message(null)},T.prototype.backToMailBoxClick=function(){ub.setHash(Bb.link().inbox())},pb.addSettingsViewModel(U,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),U.prototype.onBuild=function(){var a=this;h.delay(function(){var c=Bb.data(),d=pb.settingsSaveHelperSimpleFunction(a.mppTrigger,a);c.language.subscribe(function(c){a.languageTrigger(nb.SaveSettingsStep.Animate),b.ajax({url:Bb.link().langLink(c),dataType:"script",cache:!0}).done(function(){pb.i18nToDoc(),a.languageTrigger(nb.SaveSettingsStep.TrueResult)}).fail(function(){a.languageTrigger(nb.SaveSettingsStep.FalseResult)}).always(function(){h.delay(function(){a.languageTrigger(nb.SaveSettingsStep.Idle)},1e3)}),Bb.remote().saveSettings(pb.emptyFunction,{Language:c})}),c.editorDefaultType.subscribe(function(a){Bb.remote().saveSettings(pb.emptyFunction,{EditorDefaultType:a})}),c.messagesPerPage.subscribe(function(a){Bb.remote().saveSettings(d,{MPP:a})}),c.showImages.subscribe(function(a){Bb.remote().saveSettings(pb.emptyFunction,{ShowImages:a?"1":"0"})}),c.contactsAutosave.subscribe(function(a){Bb.remote().saveSettings(pb.emptyFunction,{ContactsAutosave:a?"1":"0"})}),c.interfaceAnimation.subscribe(function(a){Bb.remote().saveSettings(pb.emptyFunction,{InterfaceAnimation:a})}),c.useDesktopNotifications.subscribe(function(a){pb.timeOutAction("SaveDesktopNotifications",function(){Bb.remote().saveSettings(pb.emptyFunction,{DesktopNotifications:a?"1":"0"})},3e3)}),c.replySameFolder.subscribe(function(a){pb.timeOutAction("SaveReplySameFolder",function(){Bb.remote().saveSettings(pb.emptyFunction,{ReplySameFolder:a?"1":"0"})},3e3)}),c.useThreads.subscribe(function(a){c.messageList([]),Bb.remote().saveSettings(pb.emptyFunction,{UseThreads:a?"1":"0"})}),c.usePreviewPane.subscribe(function(a){c.messageList([]),Bb.remote().saveSettings(pb.emptyFunction,{UsePreviewPane:a?"1":"0"})}),c.useCheckboxesInList.subscribe(function(a){Bb.remote().saveSettings(pb.emptyFunction,{UseCheckboxesInList:a?"1":"0"})})},50)},U.prototype.onShow=function(){Bb.data().desktopNotifications.valueHasMutated()},U.prototype.selectLanguage=function(){ub.showScreenPopup(J)},pb.addSettingsViewModel(V,"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),V.prototype.addNewAccount=function(){ub.showScreenPopup(H)},V.prototype.deleteAccount=function(a){if(a&&a.deleteAccess()){this.accountForDeletion(null);var b=function(b){return a===b};a&&(this.accounts.remove(b),Bb.remote().accountDelete(function(){Bb.accountsAndIdentities()},a.email))}},pb.addSettingsViewModel(W,"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),W.prototype.onBuild=function(){var a=this;h.delay(function(){var b=Bb.data(),c=pb.settingsSaveHelperSimpleFunction(a.displayNameTrigger,a),d=pb.settingsSaveHelperSimpleFunction(a.replyTrigger,a),e=pb.settingsSaveHelperSimpleFunction(a.signatureTrigger,a);b.displayName.subscribe(function(a){Bb.remote().saveSettings(c,{DisplayName:a})}),b.replyTo.subscribe(function(a){Bb.remote().saveSettings(d,{ReplyTo:a})}),b.signature.subscribe(function(a){Bb.remote().saveSettings(e,{Signature:a})})},50)},pb.addSettingsViewModel(X,"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"),X.prototype.addNewIdentity=function(){ub.showScreenPopup(I)},X.prototype.editIdentity=function(a){ub.showScreenPopup(I,[a])},X.prototype.deleteIdentity=function(a){if(a&&a.deleteAccess()){this.identityForDeletion(null);var b=function(b){return a===b};a&&(this.identities.remove(b),Bb.remote().identityDelete(function(){Bb.accountsAndIdentities()},a.id))}},X.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=Bb.data(),c=pb.settingsSaveHelperSimpleFunction(b.displayNameTrigger,b),d=pb.settingsSaveHelperSimpleFunction(b.replyTrigger,b),e=pb.settingsSaveHelperSimpleFunction(b.signatureTrigger,b);a.displayName.subscribe(function(a){Bb.remote().saveSettings(c,{DisplayName:a})}),a.replyTo.subscribe(function(a){Bb.remote().saveSettings(d,{ReplyTo:a})}),a.signature.subscribe(function(a){Bb.remote().saveSettings(e,{Signature:a})})},50)},pb.addSettingsViewModel(Y,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),pb.addSettingsViewModel(Z,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),Z.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword("")},Z.prototype.onChangePasswordResponse=function(a,b){this.changeProcess(!1),nb.StorageResultType.Success===a&&b&&b.Result?(this.currentPassword(""),this.newPassword(""),this.passwordUpdateSuccess(!0)):this.passwordUpdateError(!0)},pb.addSettingsViewModel($,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),$.prototype.folderEditOnEnter=function(a){var b=a?pb.trim(a.nameForEdit()):"";""!==b&&a.name()!==b&&(Bb.local().set(nb.ClientSideKeyName.FoldersLashHash,""),Bb.data().foldersRenaming(!0),Bb.remote().folderRename(function(a,b){Bb.data().foldersRenaming(!1),nb.StorageResultType.Success===a&&b&&b.Result||Bb.data().foldersListError(b&&b.ErrorCode?pb.getNotification(b.ErrorCode):pb.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),Bb.folders()},a.fullNameRaw,b),Bb.cache().removeFolderFromCacheList(a.fullNameRaw),a.name(b)),a.edited(!1)},$.prototype.folderEditOnEsc=function(a){a&&a.edited(!1)},$.prototype.onShow=function(){Bb.data().foldersListError("")},$.prototype.createFolder=function(){ub.showScreenPopup(C)},$.prototype.systemFolder=function(){ub.showScreenPopup(D)},$.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&&(Bb.local().set(nb.ClientSideKeyName.FoldersLashHash,""),Bb.data().folderList.remove(b),Bb.data().foldersDeleting(!0),Bb.remote().folderDelete(function(a,b){Bb.data().foldersDeleting(!1),nb.StorageResultType.Success===a&&b&&b.Result||Bb.data().foldersListError(b&&b.ErrorCode?pb.getNotification(b.ErrorCode):pb.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),Bb.folders()},a.fullNameRaw),Bb.cache().removeFolderFromCacheList(a.fullNameRaw))}else 01048576?(a.alert(pb.i18n("SETTINGS_THEMES/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",h.bind(function(){this.customThemeUploaderProgress(!0)},this)).on("onComplete",h.bind(function(b,c,d){c&&d&&d.Result?this.customThemeImg(d.Result):a.alert(d&&d.ErrorCode?pb.getUploadErrorDescByCode(d.ErrorCode):pb.getUploadErrorDescByCode(nb.UploadErrorCode.Unknown)),this.customThemeUploaderProgress(!1)},this)),!!b}return!1},ab.prototype.populateDataOnStart=function(){var a=Bb.settingsGet("Languages"),b=Bb.settingsGet("Themes");pb.isArray(a)&&this.languages(a),pb.isArray(b)&&this.themes(b),this.mainLanguage(Bb.settingsGet("Language")),this.mainTheme(Bb.settingsGet("Theme")),this.allowCustomTheme(!!Bb.settingsGet("AllowCustomTheme")),this.allowAdditionalAccounts(!!Bb.settingsGet("AllowAdditionalAccounts")),this.allowIdentities(!!Bb.settingsGet("AllowIdentities")),this.determineUserLanguage(!!Bb.settingsGet("DetermineUserLanguage")),this.allowThemes(!!Bb.settingsGet("AllowThemes")),this.allowCustomLogin(!!Bb.settingsGet("AllowCustomLogin")),this.allowLanguagesOnLogin(!!Bb.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!Bb.settingsGet("AllowLanguagesOnSettings")),this.editorDefaultType(Bb.settingsGet("EditorDefaultType")),this.showImages(!!Bb.settingsGet("ShowImages")),this.contactsAutosave(!!Bb.settingsGet("ContactsAutosave")),this.interfaceAnimation(Bb.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(Bb.settingsGet("MPP")),this.desktopNotifications(!!Bb.settingsGet("DesktopNotifications")),this.useThreads(!!Bb.settingsGet("UseThreads")),this.replySameFolder(!!Bb.settingsGet("ReplySameFolder")),this.usePreviewPane(!!Bb.settingsGet("UsePreviewPane")),this.useCheckboxesInList(!!Bb.settingsGet("UseCheckboxesInList")),this.facebookEnable(!!Bb.settingsGet("AllowFacebookSocial")),this.facebookAppID(Bb.settingsGet("FacebookAppID")),this.facebookAppSecret(Bb.settingsGet("FacebookAppSecret")),this.twitterEnable(!!Bb.settingsGet("AllowTwitterSocial")),this.twitterConsumerKey(Bb.settingsGet("TwitterConsumerKey")),this.twitterConsumerSecret(Bb.settingsGet("TwitterConsumerSecret")),this.googleEnable(!!Bb.settingsGet("AllowGoogleSocial")),this.googleClientID(Bb.settingsGet("GoogleClientID")),this.googleClientSecret(Bb.settingsGet("GoogleClientSecret")),this.dropboxEnable(!!Bb.settingsGet("AllowDropboxSocial")),this.dropboxApiKey(Bb.settingsGet("DropboxApiKey")),this.contactsIsAllowed(!!Bb.settingsGet("ContactsIsAllowed"))},h.extend(bb.prototype,ab.prototype),bb.prototype.purgeMessageBodyCache=function(){var a=0,c=null,d=sb.iMessageBodyCacheCount-mb.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)))},bb.prototype.populateDataOnStart=function(){ab.prototype.populateDataOnStart.call(this),this.accountEmail(Bb.settingsGet("Email")),this.accountIncLogin(Bb.settingsGet("IncLogin")),this.accountOutLogin(Bb.settingsGet("OutLogin")),this.projectHash(Bb.settingsGet("ProjectHash")),this.displayName(Bb.settingsGet("DisplayName")),this.replyTo(Bb.settingsGet("ReplyTo")),this.signature(Bb.settingsGet("Signature")),this.lastFoldersHash=Bb.local().get(nb.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!Bb.settingsGet("RemoteSuggestions"),this.devEmail=Bb.settingsGet("DevEmail"),this.devLogin=Bb.settingsGet("DevLogin"),this.devPassword=Bb.settingsGet("DevPassword")},bb.prototype.initUidNextAndNewMessages=function(b,c,d){if("INBOX"===b&&pb.isNormal(c)&&""!==c){if(pb.isArray(d)&&03)i(Bb.link().notificationMailIcon(),Bb.data().accountEmail(),pb.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:g}));else for(;g>f;f++)i(Bb.link().notificationMailIcon(),x.emailsToLine(x.initEmailsFromJson(d[f].From),!1),d[f].Subject)}Bb.cache().setFolderUidNext(b,c)}},bb.prototype.folderResponseParseRec=function(a,b){var c=0,d=0,e=null,f=null,g="",h=[],i=[];for(c=0,d=b.length;d>c;c++)e=b[c],e&&(g=e.FullNameRaw,f=Bb.cache().getFolderFromCacheList(g),f||(f=y.newInstanceFromJson(e),f&&(Bb.cache().setFolderToCacheList(g,f),Bb.cache().setFolderFullNameRaw(f.fullNameHash,g),f.isGmailFolder=mb.Values.GmailFolderName.toLowerCase()===g.toLowerCase(),""!==a&&a===f.fullNameRaw+f.delimiter&&(f.isNamespaceFolder=!0),(f.isNamespaceFolder||f.isGmailFolder)&&(f.isUnpaddigFolder=!0))),f&&(f.collapsed(!pb.isFolderExpanded(f.fullNameHash)),e.Extended&&(e.Extended.Hash&&Bb.cache().setFolderHash(f.fullNameRaw,e.Extended.Hash),pb.isNormal(e.Extended.MessageCount)&&f.messageCountAll(e.Extended.MessageCount),pb.isNormal(e.Extended.MessageUnseenCount)&&f.messageCountUnread(e.Extended.MessageUnseenCount)),h=e.SubFolders,h&&"Collection/FolderCollection"===h["@Object"]&&h["@Collection"]&&pb.isArray(h["@Collection"])&&f.subFolders(this.folderResponseParseRec(a,h["@Collection"])),i.push(f)));return i},bb.prototype.setFolders=function(a){var b=[],c=!1,d=Bb.data(),e=function(a){return""===a||mb.Values.UnuseOptionValue===a||null!==Bb.cache().getFolderFromCacheList(a)?a:""};a&&a.Result&&"Collection/FolderCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&pb.isArray(a.Result["@Collection"])&&(pb.isUnd(a.Result.Namespace)||(d.namespace=a.Result.Namespace),this.threading(!!Bb.settingsGet("UseImapThread")&&a.Result.IsThreadsSupported&&!0),b=this.folderResponseParseRec(d.namespace,a.Result["@Collection"]),d.folderList(b),a.Result.SystemFolders&&""==""+Bb.settingsGet("SentFolder")+Bb.settingsGet("DraftFolder")+Bb.settingsGet("SpamFolder")+Bb.settingsGet("TrashFolder")+Bb.settingsGet("NullFolder")&&(Bb.settingsSet("SentFolder",a.Result.SystemFolders[2]||null),Bb.settingsSet("DraftFolder",a.Result.SystemFolders[3]||null),Bb.settingsSet("SpamFolder",a.Result.SystemFolders[4]||null),Bb.settingsSet("TrashFolder",a.Result.SystemFolders[5]||null),c=!0),d.sentFolder(e(Bb.settingsGet("SentFolder"))),d.draftFolder(e(Bb.settingsGet("DraftFolder"))),d.spamFolder(e(Bb.settingsGet("SpamFolder"))),d.trashFolder(e(Bb.settingsGet("TrashFolder"))),c&&Bb.remote().saveSystemFolders(pb.emptyFunction,{SentFolder:d.sentFolder(),DraftFolder:d.draftFolder(),SpamFolder:d.spamFolder(),TrashFolder:d.trashFolder(),NullFolder:"NullFolder"}),Bb.local().set(nb.ClientSideKeyName.FoldersLashHash,a.Result.FoldersHash))},bb.prototype.hideMessageBodies=function(){var a=this.messagesBodiesDom();a&&a.find(".b-text-part").hide()},bb.prototype.getNextFolderNames=function(a){a=pb.isUnd(a)?!1:!!a;var b=[],c=10,d=f().unix(),e=d-300,g=[],i=function(b){h.each(b,function(b){b&&"INBOX"!==b.fullNameRaw&&b.selectable&&b.existen&&e>b.interval&&(!a||b.subScribed())&&g.push([b.interval,b.fullNameRaw]),b&&0b[0]?1:0}),h.find(g,function(a){var e=Bb.cache().getFolderFromCacheList(a[1]);return e&&(e.interval=d,b.push(a[1])),c<=b.length}),h.uniq(b)},bb.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),Bb.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",++sb.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",++sb.iMessageBodyCacheCount),pb.isNormal(a.Result.Html)&&""!==a.Result.Html?(d=!0,g.html(a.Result.Html.toString()).addClass("b-text-part html")):pb.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&&pb.initBlockquoteSwitcher(g)),Bb.cache().initMessageFlagsFromCache(k),k.unseen()&&Bb.setMessageSeen(k),pb.windowResize())
},bb.prototype.setMessageList=function(a,b){if(a&&a.Result&&"Collection/MessageCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&pb.isArray(a.Result["@Collection"])){var c=Bb.data(),d=Bb.cache(),e=null,g=0,h=0,i=0,j=0,k=[],l=f().unix(),m=c.staticMessageList,n=null,o=null,p=null,q=0,r=!1;for(i=pb.pInt(a.Result.MessageResultCount),j=pb.pInt(a.Result.Offset),pb.isNonEmptyArray(a.Result.LastCollapsedThreadUids)&&(e=a.Result.LastCollapsedThreadUids),p=Bb.cache().getFolderFromCacheList(pb.isNormal(a.Result.Folder)?a.Result.Folder:""),p&&!b&&(p.interval=l,Bb.cache().setFolderHash(a.Result.Folder,a.Result.FolderHash),pb.isNormal(a.Result.MessageCount)&&p.messageCountAll(a.Result.MessageCount),pb.isNormal(a.Result.MessageUnseenCount)&&(pb.pInt(p.messageCountUnread())!==pb.pInt(a.Result.MessageUnseenCount)&&(r=!0),p.messageCountUnread(a.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(p.fullNameRaw,a.Result.UidNext,a.Result.NewMessages)),r&&p&&Bb.cache().clearMessageFlagsFromCacheByFolder(p.fullNameRaw),g=0,h=a.Result["@Collection"].length;h>g;g++)n=a.Result["@Collection"][g],n&&"Object/Message"===n["@Object"]&&(o=m[g],o&&o.initByJson(n)||(o=x.newInstanceFromJson(n)),o&&(d.hasNewMessageAndRemoveFromCache(o.folderFullNameRaw,o.uid)&&5>=q&&(q++,o.newForAnimation(!0)),o.deleted(!1),b?Bb.cache().initMessageFlagsFromCache(o):Bb.cache().storeMessageFlagsToCache(o),o.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/"+rb.urlsafe_encode([b,c,Bb.data().projectHash(),Bb.data().threading()&&Bb.data().useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},db.prototype.composeUploadExternals=function(a,b){this.defaultRequest(a,"ComposeUploadExternals",{Externals:b},999e3)},db.prototype.folderInformation=function(a,b,c){var d=!0,e=Bb.cache(),f=[];pb.isArray(c)&&0 ").addClass("rl-settings-view-model").hide().attr("data-bind",'template: {name: "'+f.__rlSettingsData.Template+'"}, i18nInit: true'),i.appendTo(g),e.data=Bb.data(),e.viewModelDom=i,e.__rlSettingsData=f.__rlSettingsData,f.__dom=i,f.__builded=!0,f.__vm=e,c.applyBindings(e,i[0]),ub.delegateRun(e,"onBuild",[i])):pb.log("Cannot find sub settings view model position: SettingsSubScreen")),e&&h.defer(function(){d.oCurrentSubScreen&&(ub.delegateRun(d.oCurrentSubScreen,"onHide"),d.oCurrentSubScreen.viewModelDom.hide()),d.oCurrentSubScreen=e,d.oCurrentSubScreen&&(d.oCurrentSubScreen.viewModelDom.show(),ub.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)),pb.windowResize()})):ub.setHash(Bb.link().settings(),!1,!0)},gb.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(ub.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},gb.prototype.onBuild=function(){h.each(tb.settings,function(a){a&&a.__rlSettingsData&&!h.find(tb["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(tb["settings-disabled"],function(b){return b&&b===a})})},this),this.oViewModelPlace=b("#rl-content #rl-settings-subscreen")},gb.prototype.routes=function(){var a=h.find(tb.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=pb.isUnd(c.subname)?b:pb.pString(c.subname),[c.subname]}};return[["{subname}/",c],["{subname}",c],["",c]]},h.extend(hb.prototype,q.prototype),hb.prototype.onShow=function(){Bb.setTitle(pb.i18n("TITLES/LOGIN"))},h.extend(ib.prototype,q.prototype),ib.prototype.oLastRoute={},ib.prototype.setNewTitle=function(){var a=Bb.data().accountEmail(),b=Bb.data().foldersInboxUnreadCount();Bb.setTitle((""===a?"":(b>0?"("+b+") ":" ")+a+" - ")+pb.i18n("TITLES/MAILBOX"))},ib.prototype.onShow=function(){this.setNewTitle()},ib.prototype.onRoute=function(a,b,c){var d=Bb.data(),e=Bb.cache().getFolderFullNameRaw(a),f=Bb.cache().getFolderFromCacheList(e);f&&(d.currentFolder(f).messageListPage(b).messageListSearch(c),!d.usePreviewPane()&&d.message()&&d.message(null),Bb.reloadMessageList())},ib.prototype.onStart=function(){var a=Bb.data(),b=function(){pb.windowResize()};(Bb.settingsGet("AllowAdditionalAccounts")||Bb.settingsGet("AllowIdentities"))&&Bb.accountsAndIdentities(),h.delay(function(){"INBOX"!==a.currentFolderFullNameRaw()&&Bb.folderInformation("INBOX")},1e3),h.delay(function(){Bb.quota()},5e3),h.delay(function(){Bb.remote().appDelayStart(pb.emptyFunction)},35e3),xb.toggleClass("rl-no-preview-pane",!a.usePreviewPane()),a.folderList.subscribe(b),a.messageList.subscribe(b),a.message.subscribe(b),a.usePreviewPane.subscribe(function(a){xb.toggleClass("rl-no-preview-pane",!a)}),a.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},ib.prototype.onBuild=function(){sb.bMobileDevice||h.defer(function(){pb.initLayoutResizer("#rl-resizer-left","#rl-resizer-right","#rl-right",350,800,350,350,nb.ClientSideKeyName.MailBoxListSize)})},ib.prototype.routes=function(){var a=function(a,b){return b[0]=pb.pString(b[0]),b[1]=pb.pInt(b[1]),b[1]=0>=b[1]?1:b[1],b[2]=pb.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]=pb.pString(b[0]),b[1]=pb.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(jb.prototype,gb.prototype),jb.prototype.onShow=function(){Bb.setTitle(this.sSettingsTitle)},h.extend(kb.prototype,o.prototype),kb.prototype.oSettings=null,kb.prototype.oPlugins=null,kb.prototype.oLocal=null,kb.prototype.oLink=null,kb.prototype.oSubs={},kb.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):(sb.bMobileDevice?(a.open(b,"_self"),a.focus()):this.iframe.attr("src",b),!0)},kb.prototype.link=function(){return null===this.oLink&&(this.oLink=new i),this.oLink},kb.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new n),this.oLocal},kb.prototype.settingsGet=function(a){return null===this.oSettings&&(this.oSettings=pb.isNormal(vb)?vb:{}),pb.isUnd(this.oSettings[a])?null:this.oSettings[a]},kb.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=pb.isNormal(vb)?vb:{}),this.oSettings[a]=b},kb.prototype.setTitle=function(b){b=(0