/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ !function(e){function t(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return e[s].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="rainloop/v/0.0.0/static/js/min/",t(0)}([function(e,t,i){i(70)(i(6))},function(e,t,i){!function(){"use strict";var t=null,s={},o=i(11),n=i(2),r=i(12),a=i(3),l=i(72),c=i(73),u=i(49),d=i(4),h=i(7);s.trim=r.trim,s.inArray=r.inArray,s.isArray=n.isArray,s.isObject=n.isObject,s.isFunc=n.isFunction,s.isUnd=n.isUndefined,s.isNull=n.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=n.debounce(function(e){s.isUnd(e)?h.$win.resize():o.setTimeout(function(){h.$win.resize()},e)},50),s.windowResizeCallback=function(){s.windowResize()},s.isPosNumeric=function(e,t){return s.isNormal(e)?(s.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},s.pInt=function(e,t){var i=s.isNormal(e)&&""!==e?o.parseInt(e,10):t||0;return o.isNaN(i)?t||0:i},s.pString=function(e){return s.isNormal(e)?""+e:""},s.encodeURIComponent=function(e){return o.encodeURIComponent(e)},s.isNonEmptyArray=function(e){return s.isArray(e)&&0n;n++)s=i[n].split("="),t[o.decodeURIComponent(s[0])]=o.decodeURIComponent(s[1]);return t},s.mailToHelper=function(e,t){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var r=[],a=null,l=null,c={},u=i(25),h=e.replace(/\?.+$/,""),p=e.replace(/^[^\?]*\?/,""),m=function(e){return e?n.compact(n.map(o.decodeURIComponent(e).split(/[,]/),function(e){var t=new u;return t.mailsoParse(e),""!==t.email?t:null})):null};return r=m(h),c=s.simpleQueryParser(p),s.isUnd(c.cc)||(a=m(o.decodeURIComponent(c.cc))),s.isUnd(c.bcc)||(l=m(o.decodeURIComponent(c.bcc))),i(5).showScreenPopup(t,[d.ComposeType.Empty,null,r,a,l,s.isUnd(c.subject)?null:s.pString(o.decodeURIComponent(c.subject)),s.isUnd(c.body)?null:s.plainToHtml(s.pString(o.decodeURIComponent(c.body)))]),!0}return!1},s.rsaObject=function(e){return c&&e&&(null===t||t&&t.__sPublicKey!==e)&&o.crypto&&o.crypto.getRandomValues?(t=new c,t.setPublicKey(e),t.__sPublicKey=e):t=!1,t},s.rsaEncode=function(e,t){if(o.crypto&&o.crypto.getRandomValues&&t){var i=!1,n=s.rsaObject(t);if(n&&(i=n.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==i&&s.isNormal(i)))return"rsa:xxx:"+i}return e},s.rsaEncode.supported=!1,s.encodeHtml=function(e){return s.isNormal(e)?n.escape(e.toString()):""},s.splitPlainText=function(e,t){var i="",o="",n=e,r=0,a=0;for(t=s.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),r=o.lastIndexOf(" "),a=o.lastIndexOf("\n"),-1!==a&&(r=a),-1===r&&(r=t),i+=o.substring(0,r)+"\n",n=n.substring(r+1);return i+n},s.timeOutAction=function(){var e={};return function(t,i,n){s.isUnd(e[t])&&(e[t]=0),o.clearTimeout(e[t]),e[t]=o.setTimeout(i,n)}}(),s.timeOutActionSecond=function(){var e={};return function(t,i,s){e[t]||(e[t]=o.setTimeout(function(){i(),e[t]=0},s))}}(),s.hos=function(e,t){return e&&o.Object&&o.Object.hasOwnProperty?o.Object.hasOwnProperty.call(e,t):!1},s.inFocus=function(){return o.document.activeElement?(s.isUnd(o.document.activeElement.__inFocusCache)&&(o.document.activeElement.__inFocusCache=r(o.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!o.document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(o.document&&o.document.activeElement&&o.document.activeElement.blur){var e=r(o.document.activeElement);e.is("input,textarea")&&o.document.activeElement.blur()}},s.removeSelection=function(){if(o&&o.getSelection){var e=o.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else o.document&&o.document.selection&&o.document.selection.empty&&o.document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/g," "));var i=!1,o=[],r="RE"===e,a="FWD"===e,l=!a;return""!==t&&n.each(t.split(":"),function(e){var t=s.trim(e);i||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(o.push(e),i=!0):(r||(r=!!/^RE/i.test(t)),a||(a=!!/^FWD/i.test(t)))}),l?r=!1:a=!1,s.trim((l?"Re: ":"Fwd: ")+(r?"Re: ":"")+(a?"Fwd: ":"")+s.trim(o.join(":")))},s.roundNumber=function(e,t){return o.Math.round(e*o.Math.pow(10,t))/o.Math.pow(10,t)},s.friendlySize=function(e){return e=s.pInt(e),e>=1073741824?s.roundNumber(e/1073741824,1)+"GB":e>=1048576?s.roundNumber(e/1048576,1)+"MB":e>=1024?s.roundNumber(e/1024,0)+"KB":e+"B"},s.log=function(e){o.console&&o.console.log&&o.console.log(e)},s.delegateRun=function(e,t,i,o){e&&e[t]&&(o=s.pInt(o),0>=o?e[t].apply(e,s.isArray(i)?i:[]):n.delay(function(){e[t].apply(e,s.isArray(i)?i:[])},o))},s.kill_CtrlA_CtrlS=function(e){if(e=e||o.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===d.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===d.EventKeyCode.A&&(o.getSelection?o.getSelection().removeAllRanges():o.document.selection&&o.document.selection.clear&&o.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,i){var o=function(){return n&&n.canExecute&&n.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1},n=t?o:s.emptyFunction;return n.enabled=a.observable(!0),i=s.isUnd(i)?!0:i,n.canExecute=a.computed(s.isFunc(i)?function(){return n.enabled()&&i.call(e)}:function(){return n.enabled()&&!!i}),n},s.createMomentDate=function(e){return s.isUnd(e.moment)&&(e.moment=a.observable(moment())),a.computed(function(){h.momentTrigger();var e=this.moment();return 1970===e.year()?"":e.fromNow()},e)},s.createMomentShortDate=function(e){return a.computed(function(){var e="",t=moment(),s=this.moment(),o=this.momentDate();return e=1970===s.year()?"":4>=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i(8).i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i(8).i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},s.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=s.trim(e.substring(0,e.length-7))),s.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},s.quoteName=function(e){return e.replace(/["]/g,'\\"')},s.microtime=function(){return(new Date).getTime()},s.timestamp=function(){return o.Math.round(s.microtime()/1e3)},s.convertLangName=function(e,t){return i(8).i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},s.fakeMd5=function(e){var t="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length ').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&r(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,n,l){var c=null,u=o.open(""),d="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",h=r("#"+t);o[d]=function(){if(u&&u.document.body&&h&&h[0]){var t=r(u.document.body);r("#rl-content",t).html(h.html()),r("html",u.document).addClass("external "+r("html").attr("class")),i(8).i18nToNode(t),e&&r("#rl-content",t)[0]&&a.applyBindings(e,r("#rl-content",t)[0]),o[d]=null,l(u)}},u.document.open(),u.document.write(''+s.encodeHtml(n)+'
'),u.document.close(),c=u.document.createElement("script"),c.type="text/javascript",c.innerHTML="if(window&&window.opener&&window.opener['"+d+"']){window.opener['"+d+"']();window.opener['"+d+"']=null}",u.document.getElementsByTagName("head")[0].appendChild(c)},s.settingsSaveHelperFunction=function(e,t,i,o){return i=i||null,o=s.isUnd(o)?1e3:s.pInt(o),function(s,r,a,l,c){t.call(i,r&&r.Result?d.SaveSettingsStep.TrueResult:d.SaveSettingsStep.FalseResult),e&&e.call(i,s,r,a,l,c),n.delay(function(){t.call(i,d.SaveSettingsStep.Idle)},o)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.settingsSaveHelperSubscribeFunction=function(e,t,i,o){return function(n){if(e){switch(i){default:n=s.pString(n);break;case"bool":case"boolean":n=n?"1":"0";break;case"int":case"integer":case"number":n=s.pInt(n);break;case"trim":n=s.trim(n)}var r={};r[t]=n,e.saveAdminConfig?e.saveAdminConfig(o||null,r):e.saveSettings&&e.saveSettings(o||null,r)}}},s.htmlToPlain=function(e){var t=0,i=0,s=0,o=0,a=0,l="",c=function(e){for(var t=100,i="",s="",o=e,n=0,r=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),r=s.lastIndexOf("\n"),-1!==r&&(n=r),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},u=function(e){return e=c(r.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+r.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},m=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,m).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,f).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),l=h.$div.html(l).text(),l=l.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=l.indexOf("__bq__start__",t),i>-1);)s=l.indexOf("__bq__start__",i+5),o=l.indexOf("__bq__end__",i+5),(-1===s||s>o)&&o>i?(l=l.substring(0,i)+u(l.substring(i+13,o))+l.substring(o+11),t=0):t=s>-1&&o>s?s-1:0;return l=l.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,""),t=s.isUnd(t)?!1:!!t;var i=!1,o=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(o=!1,r=[],l=0;l"===a.substr(0,1),n&&!i?(o=!0,i=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&i?""!==a?(i=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(a):r.push(n&&i?a.substr(1):a);i&&(i=!1,r.push("~~~/blockquote~~~")),c=r}while(o);return e=c.join("\n"),e=e.replace(/\u200C\u200C/g,"").replace(/\u200D\u200D/g,"").replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/\n/g,"
"),t?s.findEmailAndLinks(e):e},o.rainloop_Utils_htmlToPlain=s.htmlToPlain,o.rainloop_Utils_plainToHtml=s.plainToHtml,s.findEmailAndLinks=function(e){return e=l.link(e,{newWindow:!0,stripPrefix:!1,urls:!0,email:!0,twitter:!1,replaceFn:function(e,t){return!(e&&t&&"url"===t.getType()&&t.matchedText&&0!==t.matchedText.indexOf("http"))}})},s.resizeAndCrop=function(e,t,i){var s=new o.Image;s.onload=function(){var e=[0,0],s=o.document.createElement("canvas"),n=s.getContext("2d");s.width=t,s.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],n.fillStyle="#fff",n.fillRect(0,0,t,t),n.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(s.toDataURL("image/jpeg"))},s.src=e},s.folderListOptionsBuilder=function(e,t,i,n,r,a,l,c,u,h){var p=null,m=!1,f=0,g=0,b="   ",y=[];for(h=s.isUnd(h)?!1:!!h,u=s.isNormal(u)?u:0f;f++)y.push({id:n[f][0],name:n[f][1],system:!1,seporator:!1,disabled:!1});for(m=!0,f=0,g=e.length;g>f;f++)p=e[f],(l?l.call(null,p):!0)&&(m&&0f;f++)p=t[f],!p.subScribed()&&p.existen&&!h||!p.selectable&&!p.hasSubScribedSubfolders()||(l?l.call(null,p):!0)&&(d.FolderType.User===p.type()||!u||p.hasSubScribedSubfolders())&&(m&&01||c>0&&l>c){for(l>c?(u(c),i=c,n=c):((3>=l||l>=c-2)&&(r+=2),u(l),i=l,n=l);r>0;)if(i-=1,n+=1,i>0&&(u(i,!1),r--),c>=n)u(n,!0),r--;else if(0>=i)break;3===i?u(2,!1):i>3&&u(o.Math.round((i-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(o.Math.round((c+n)/2),!0,"..."),i>1&&u(1,!1),c>n&&u(c,!0)}return a}},s.selectElement=function(e){var t,i;o.getSelection?(t=o.getSelection(),t.removeAllRanges(),i=o.document.createRange(),i.selectNodeContents(e),t.addRange(i)):o.document.selection&&(i=o.document.body.createTextRange(),i.moveToElementText(e),i.select())},s.detectDropdownVisibility=n.debounce(function(){h.dropdownVisibility(!!n.find(h.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){r(".checkAutocomplete").trigger("change")};(s.isUnd(e)?1:!e)?t():n.delay(t,100)},s.setHeadViewport=function(e){var t=[];n.each(e,function(e,i){t.push(""+e+"="+i)}),r("#rl-head-viewport").attr("content",t.join(", "))},s.getFileExtension=function(e){e=s.trim(e).toLowerCase();var t=e.split(".").pop();return t===e?"":t},s.mimeContentType=function(e){var t="",i="application/octet-stream";return e=s.trim(e).toLowerCase(),"winmail.dat"===e?"application/ms-tnef":(t=s.getFileExtension(e),t&&0'),i.after(n),i.remove()),n&&n[0]&&(n.attr("data-href",a).attr("data-theme",e[0]),n[0].styleSheet&&!s.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=e[1]:n.text(e[1])),t(d.SaveSettingsStep.TrueResult))}).always(function(){s.__themeTimer=o.setTimeout(function(){t(d.SaveSettingsStep.Idle)},1e3),s.__themeAjax=null}))},s.substr=o.String.substr,"b"!=="ab".substr(-1)&&(s.substr=function(e,t,i){return 0>t&&(t=e.length+t),e.substr(t,i)}),e.exports=s}()},function(e){e.exports=window._},function(e,t,i){!function(t){"use strict";var s=i(11),o=i(2),n=i(12),r=function(e,i,s){t.utils.domNodeDisposal.addDisposeCallback(e,function(){s&&s.dispose&&s.dispose(),i&&(i.off("click.koTooltip"),i.tooltip&&i.tooltip("destroy")),i=null})};t.bindingHandlers.tooltip={init:function(e,s){var o=null,a=!0,l="",c="",u=null,d=i(7),h=i(8);d.bMobileDevice||(o=n(e),l=o.data("tooltip-class")||"",a="on"===(o.data("tooltip-i18n")||"on"),c=o.data("tooltip-placement")||"top",o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){var e=a?t.unwrap(s()):s()();return""===e||o.is(".disabled")||d.dropdownVisibility()?"":''+(a?h.i18n(e):e)+""}}).on("click.koTooltip",function(){o.tooltip("hide")}),u=d.tooltipTrigger.subscribe(function(){o.tooltip("hide")}),r(e,o,u))}},t.bindingHandlers.tooltipForTest={init:function(e){var t=n(e),o=null,a=i(7);t.tooltip({container:"body",trigger:"hover manual",title:function(){return t.data("tooltip3-data")||""}}),n(s.document).on("click",function(){t.tooltip("hide")}),o=a.tooltipTrigger.subscribe(function(){t.tooltip("hide")}),r(e,t,o)},update:function(e,i){var s=t.unwrap(i());""===s?n(e).data("tooltip3-data","").tooltip("hide"):(n(e).data("tooltip3-data",s),o.delay(function(){n(e).is(":visible")&&n(e).tooltip("show")},100))}},t.bindingHandlers.registrateBootstrapDropdown={init:function(e){var t=i(7);t&&t.aBootstrapDropdowns&&t.aBootstrapDropdowns.push(n(e))}},t.bindingHandlers.openDropdownTrigger={update:function(e,s){if(t.unwrap(s())){var o=n(e),r=i(1);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),s()(!1)}}},t.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},t.bindingHandlers.popover={init:function(e,i){n(e).popover(t.unwrap(i())),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).popover("destroy")})}},t.bindingHandlers.csstext={init:function(e,s){var o=i(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(s()):n(e).text(t.unwrap(s()))},update:function(e,s){var o=i(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(s()):n(e).text(t.unwrap(s()))}},t.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},t.bindingHandlers.onEnter={init:function(e,i,o,r){n(e).on("keypress.koOnEnter",function(t){t&&13===s.parseInt(t.keyCode,10)&&(n(e).trigger("change"),i().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEnter")})}},t.bindingHandlers.onEsc={init:function(e,i,o,r){n(e).on("keypress.koOnEsc",function(t){t&&27===s.parseInt(t.keyCode,10)&&(n(e).trigger("change"),i().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEsc")})}},t.bindingHandlers.clickOnTrue={update:function(e,i){t.unwrap(i())&&n(e).click()}},t.bindingHandlers.modal={init:function(e,s){var o=i(7),r=i(1);n(e).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:t.unwrap(s())}).on("shown.koModal",r.windowResizeCallback).find(".close").on("click.koModal",function(){s()(!1)}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("shown.koModal").find(".close").off("click.koModal")})},update:function(e,s){var r=i(7);n(e).modal(t.unwrap(s())?"show":"hide"),r.$html.hasClass("rl-anim")&&(r.$html.addClass("rl-modal-animation"),o.delay(function(){r.$html.removeClass("rl-modal-animation")},400))}},t.bindingHandlers.i18nInit={init:function(e){i(8).i18nToNode(e)}},t.bindingHandlers.i18nUpdate={update:function(e,s){t.unwrap(s()),i(8).i18nToNode(e)}},t.bindingHandlers.link={update:function(e,i){n(e).attr("href",t.unwrap(i()))}},t.bindingHandlers.title={update:function(e,i){n(e).attr("title",t.unwrap(i()))}},t.bindingHandlers.textF={init:function(e,i){n(e).text(t.unwrap(i()))}},t.bindingHandlers.initDom={init:function(e,t){t()(e)}},t.bindingHandlers.initFixedTrigger={init:function(e,i){var o=t.unwrap(i()),r=null,a=n(e),l=null,c=o[1]||0;r=n(o[0]||null),r=r[0]?r:null,r&&n(s).resize(function(){l=r.offset(),l&&l.top&&a.css("top",l.top+c)})}},t.bindingHandlers.initResizeTrigger={init:function(e,i){var s=t.unwrap(i());n(e).css({height:s[1],"min-height":s[1]})},update:function(e,s){var o=i(1),r=i(7),a=t.unwrap(s()),l=o.pInt(a[1]),c=0,u=n(e).offset().top;u>0&&(u+=o.pInt(a[2]),c=r.$win.height()-u,c>l&&(l=c),n(e).css({height:l,"min-height":l}))}},t.bindingHandlers.appendDom={update:function(e,i){n(e).hide().empty().append(t.unwrap(i())).show()}},t.bindingHandlers.draggable={init:function(e,o,r){var a=i(7),l=i(1);if(!a.bMobileDevice){var c=100,u=3,d=r(),h=d&&d.droppableSelector?d.droppableSelector:"",p={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};h&&(p.drag=function(e){n(h).each(function(){var t=null,i=null,o=n(this),r=o.offset(),a=r.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+o.width()&&(e.pageY>=a-c&&e.pageY<=a&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},p.stop=function(){n(h).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),p.helper=function(e){return o()(e&&e.target?t.dataFor(e.target):null)},n(e).draggable(p).on("mousedown.koDraggable",function(){l.removeInFocus()}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("mousedown.koDraggable").draggable("destroy")})}}},t.bindingHandlers.droppable={init:function(e,s,o){var r=i(7);if(!r.bMobileDevice){var a=s(),l=o(),c=l&&l.droppableOver?l.droppableOver:null,u=l&&l.droppableOut?l.droppableOut:null,d={tolerance:"pointer",hoverClass:"droppableHover"};a&&(d.drop=function(e,t){a(e,t)},c&&(d.over=function(e,t){c(e,t)}),u&&(d.out=function(e,t){u(e,t)}),n(e).droppable(d),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).droppable("destroy")}))}}},t.bindingHandlers.nano={init:function(e){var t=i(7);t.bDisableNanoScroll||n(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},t.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,i){var s=t.unwrap(i()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},t.bindingHandlers.emailsTags={init:function(e,t,s){var r=i(1),a=i(25),l=n(e),c=t(),u=s(),d=u.autoCompleteSource||null,h=function(e){c&&c.focused&&c.focused(!!e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:h,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=r.trim(e),i=null;return""!==t?(i=new a,i.mailsoParse(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)}),c&&c.focused&&c.focused.subscribe&&c.focused.subscribe(function(e){l.inputosaurus(e?"focus":"blur")})},update:function(e,i){var s=n(e),o=i(),r=t.unwrap(o);s.data("EmailsTagsValue")!==r&&(s.val(r),s.data("EmailsTagsValue",r),s.inputosaurus("refresh"))}},t.bindingHandlers.command={init:function(e,i,s,o){var r=n(e),a=i();if(!a||!a.enabled||!a.canExecute)throw new Error("You are not using command function");r.addClass("command"),t.bindingHandlers[r.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,s=n(e),o=t();i=o.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},t.extenders.trimmer=function(e){var s=i(1),o=t.computed({read:e,write:function(t){e(s.trim(t.toString()))},owner:this});return o(e()),o},t.extenders.posInterer=function(e,s){var o=i(1),n=t.computed({read:e,write:function(t){var i=o.pInt(t.toString(),s);0>=i&&(i=s),i===e()&&""+i!=""+t&&e(i+1),e(i)}});return n(e()),n},t.extenders.limitedList=function(e,s){var o=i(1),n=t.computed({read:e,write:function(i){var n=t.unwrap(e),r=t.unwrap(s);o.isNonEmptyArray(r)?-1").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),h.appendTo(d),r.viewModelDom=h,e.__dom=h,"Popups"===a&&(r.cancelCommand=r.closeCommand=u.createCommand(r,function(){i.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),this.onShowTrigger&&this.onShowTrigger(!this.onShowTrigger()),u.delegateRun(this,"onShowWithDelay",[],500)):(u.delegateRun(this,"onHide"),u.delegateRun(this,"onHideWithDelay",[],500),this.onHideTrigger&&this.onHideTrigger(!this.onHideTrigger()),this.restoreKeyScope(),s.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},r)),s.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,r,h])}),n.applyBindingAccessorsToNode(h[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),u.delegateRun(r,"onBuild",[h]),r&&"Popups"===a&&r.registerPopupKeyDown(),s.each(e.__names,function(e){c.runHook("view-model-post-build",[e,r,h])})):u.log("Cannot find view model position: "+a)}return e?e.__vm:null},t.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},t.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),s.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},t.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},t.prototype.screenOnRoute=function(e,t){var i=this,o=null,n=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&s.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),s.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.delegateRun(i.oCurrentScreen,"onHideWithDelay",[],500),i.oCurrentScreen.onHideTrigger&&i.oCurrentScreen.onHideTrigger(!i.oCurrentScreen.onHideTrigger()),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"),u.delegateRun(e.__vm,"onHideWithDelay",[],500),e.__vm.onHideTrigger&&e.__vm.onHideTrigger(!e.__vm.onHideTrigger()))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),i.oCurrentScreen.onShowTrigger&&i.oCurrentScreen.onShowTrigger(!i.oCurrentScreen.onShowTrigger()),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),e.__vm.onShowTrigger&&e.__vm.onShowTrigger(!e.__vm.onShowTrigger()),u.delegateRun(e.__vm,"onShowWithDelay",[],200),s.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),n=o.__cross?o.__cross():null,n&&n.parse(t)})))},t.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),s.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},100),s.delay(function(){l.$html.addClass("rl-started-delay")},200)},t.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(r.changed.active=!0,r[i?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[i?"replaceHash":"setHash"](e),r.changed.active=!0)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){_.call(this,L),this.oMoveCache={},this.quotaDebounce=o.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=o.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=o.debounce(this.messagesMoveTrigger,500),s.setInterval(function(){m.pub("interval.30s")},3e4),s.setInterval(function(){m.pub("interval.1m")},6e4),s.setInterval(function(){m.pub("interval.2m")},12e4),s.setInterval(function(){m.pub("interval.3m")},18e4),s.setInterval(function(){m.pub("interval.5m")},3e5),s.setInterval(function(){m.pub("interval.10m")},6e5),s.setInterval(function(){m.pub("interval.15m")},9e5),s.setInterval(function(){m.pub("interval.20m")},9e5),s.setTimeout(function(){s.setInterval(function(){m.pub("interval.5m-after5m")},3e5)},3e5),s.setTimeout(function(){s.setInterval(function(){m.pub("interval.10m-after5m")},6e5)},3e5),n.wakeUp(function(){L.jsVersion(function(e,t){l.StorageResultType.Success===e&&t&&!t.Result&&(s.parent&&I.settingsGet("InIframe")?s.parent.location.reload():s.location.reload())},I.settingsGet("Version"))},{},36e5),I.settingsGet("UserBackgroundHash")&&o.delay(function(){n("#rl-bg").attr("style","background-image: none !important;").backstretch(p.userBackground(I.settingsGet("UserBackgroundHash")),{fade:c.bAnimationSupported?1e3:0,centeredX:!0,centeredY:!0}).removeAttr("style")},1e3),this.socialUsers=o.bind(this.socialUsers,this)}var s=i(11),o=i(2),n=i(12),r=i(33),a=i(76),l=i(4),c=i(7),u=i(15),d=i(20),h=i(1),p=i(13),m=i(28),f=i(8),g=i(5),b=i(18),y=i(36),S=i(31),v=i(24),w=i(30),C=i(66),T=i(85),F=i(21),A=i(23),E=i(26),N=i(44),R=i(42),I=i(9),L=i(14),P=i(25),M=i(102),k=i(97),D=i(103),x=i(106),O=i(105),_=i(47);o.extend(t.prototype,_.prototype),t.prototype.remote=function(){return L},t.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){o.each(E.messageList(),function(e){b.initMessageFlagsFromCache(e)}),b.initMessageFlagsFromCache(E.message())},t.prototype.reloadMessageList=function(e,t){var i=(E.messageListPage()-1)*v.messagesPerPage();(h.isUnd(t)?1:!t)||b.setFolderHash(F.currentFolderFullNameRaw(),""),(h.isUnd(e)?1:!e)||(E.messageListPage(1),i=0),E.messageListLoading(!0),L.messageList(function(e,t,i){l.StorageResultType.Success===e&&t&&t.Result?(E.messageListError(""),E.messageListLoading(!1),E.setMessageList(t,i)):l.StorageResultType.Unload===e?(E.messageListError(""),E.messageListLoading(!1)):l.StorageResultType.Abort!==e&&(E.messageList([]),E.messageListLoading(!1),E.messageListError(t&&t.ErrorCode?f.getNotification(t.ErrorCode):f.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},F.currentFolderFullNameRaw(),i,v.messagesPerPage(),E.messageListSearch())},t.prototype.recacheInboxMessageList=function(){L.messageList(h.emptyFunction,b.getFolderInboxName(),0,v.messagesPerPage(),"",!0)},t.prototype.reloadMessageListHelper=function(e){this.reloadMessageList(e)},t.prototype.contactsSync=function(e){var t=N.contacts;return t.importing()||t.syncing()||!N.enableContactsSync()||!N.allowContactsSync()?!1:(t.syncing(!0),L.contactsSync(function(i,s){t.syncing(!1),e&&e(i,s)}),!0)},t.prototype.messagesMoveTrigger=function(){var e=this,t=F.spamFolder();o.each(this.oMoveCache,function(i){var s=t===i.To,o=!s&&t===i.From&&b.getFolderInboxName()===i.To;L.messagesMove(e.moveOrDeleteResponseHelper,i.From,i.To,i.Uid,s?"SPAM":o?"HAM":"")}),this.oMoveCache={}},t.prototype.messagesMoveHelper=function(e,t,i){var s="$$"+e+"$$"+t+"$$";this.oMoveCache[s]||(this.oMoveCache[s]={From:e,To:t,Uid:[]}),this.oMoveCache[s].Uid=o.union(this.oMoveCache[s].Uid,i),this.messagesMoveTrigger()},t.prototype.messagesCopyHelper=function(e,t,i){L.messagesCopy(this.moveOrDeleteResponseHelper,e,t,i)},t.prototype.messagesDeleteHelper=function(e,t){L.messagesDelete(this.moveOrDeleteResponseHelper,e,t)},t.prototype.moveOrDeleteResponseHelper=function(e,t){l.StorageResultType.Success===e&&F.currentFolder()&&(t&&h.isArray(t.Result)&&2===t.Result.length?b.setFolderHash(t.Result[0],t.Result[1]):(b.setFolderHash(F.currentFolderFullNameRaw(),""),t&&-1s;s++)n=t[s],n&&(a=n.FullNameRaw,r=b.getFolderFromCacheList(a),r||(r=M.newInstanceFromJson(n),r&&(b.setFolderToCacheList(a,r),b.setFolderFullNameRaw(r.fullNameHash,a,r))),r&&(r.collapsed(!i.isFolderExpanded(r.fullNameHash)),n.Extended&&(n.Extended.Hash&&b.setFolderHash(r.fullNameRaw,n.Extended.Hash),h.isNormal(n.Extended.MessageCount)&&r.messageCountAll(n.Extended.MessageCount),h.isNormal(n.Extended.MessageUnseenCount)&&r.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&h.isArray(l["@Collection"])&&r.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(r)));return c},t.prototype.setFolders=function(e){var t=!1,i=function(e){return""===e||u.Values.UnuseOptionValue===e||null!==b.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])&&(h.isUnd(e.Result.Namespace)||(F.namespace=e.Result.Namespace),S.threadsAllowed(!!I.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),F.folderList(this.folderResponseParseRec(F.namespace,e.Result["@Collection"])),F.folderList.optimized(!!e.Result.Optimized),e.Result.SystemFolders&&""==""+I.settingsGet("SentFolder")+I.settingsGet("DraftFolder")+I.settingsGet("SpamFolder")+I.settingsGet("TrashFolder")+I.settingsGet("ArchiveFolder")+I.settingsGet("NullFolder")&&(I.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),I.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),I.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),I.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),I.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),t=!0),F.sentFolder(i(I.settingsGet("SentFolder"))),F.draftFolder(i(I.settingsGet("DraftFolder"))),F.spamFolder(i(I.settingsGet("SpamFolder"))),F.trashFolder(i(I.settingsGet("TrashFolder"))),F.archiveFolder(i(I.settingsGet("ArchiveFolder"))),t&&L.saveSystemFolders(h.emptyFunction,{SentFolder:F.sentFolder(),DraftFolder:F.draftFolder(),SpamFolder:F.spamFolder(),TrashFolder:F.trashFolder(),ArchiveFolder:F.archiveFolder(),NullFolder:"NullFolder"}),R.set(l.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},t.prototype.isFolderExpanded=function(e){var t=R.get(l.ClientSideKeyName.ExpandedFolders);return h.isArray(t)&&-1!==o.indexOf(t,e)},t.prototype.setExpandedFolder=function(e,t){var i=R.get(l.ClientSideKeyName.ExpandedFolders);h.isArray(i)||(i=[]),t?(i.push(e),i=o.uniq(i)):i=o.without(i,e),R.set(l.ClientSideKeyName.ExpandedFolders,i)},t.prototype.initHorizontalLayoutResizer=function(e){var t=200,i=500,s=null,o=null,r=function(t,i){i&&i.size&&i.size.height&&(R.set(e,i.size.height),u(i.size.height),h.windowResize())},a={helper:"ui-resizable-helper-h",minHeight:t,maxHeight:i,handles:"s",stop:r},u=function(e){e&&(s&&s.attr("style","height:"+e+"px"),o&&o.attr("style","top:"+(55+e)+"px"))},d=function(i){if(i)s&&s.hasClass("ui-resizable")&&s.resizable("destroy").removeAttr("style"),o&&o.removeAttr("style");else if(c.$html.hasClass("rl-bottom-preview-pane")){s=n(".b-message-list-wrapper"),o=n(".b-message-view-wrapper"),s.hasClass("ui-resizable")||s.resizable(a);var r=h.pInt(R.get(e))||300;u(r>t?r:t)}};d(!1),m.sub("layout",function(e){d(l.Layout.BottomPreview!==e)})},t.prototype.initVerticalLayoutResizer=function(e){var t=60,i=155,s=n("#rl-left"),o=n("#rl-right"),r=R.get(e)||null,a=function(e){e&&(s.css({width:""+e+"px"}),o.css({left:""+e+"px"}))},l=function(o){if(o)s.resizable("disable"),a(t);else{s.resizable("enable");var n=h.pInt(R.get(e))||i;a(n>i?n:i)}},c=function(t,i){i&&i.size&&i.size.width&&(R.set(e,i.size.width),o.css({left:""+i.size.width+"px"}))};null!==r&&a(r>i?r:i),s.resizable({helper:"ui-resizable-helper-w",minWidth:i,maxWidth:350,handles:"e",stop:c}),m.sub("left-panel.off",function(){l(!0)}),m.sub("left-panel.on",function(){l(!1)})},t.prototype.logout=function(){var e=this;L.logout(function(){e.loginAndLogoutReload(!0,I.settingsGet("ParentEmail")&&0=5?r:20,r=320>=r?r:320,o.delay(function(){e.contactsSync()},1e4),o.delay(function(){e.folderInformationMultiply(!0)},2e3),s.setInterval(function(){e.contactsSync()},6e4*r+5e3),e.accountsAndIdentities(!0),o.delay(function(){var t=F.currentFolderFullNameRaw();b.getFolderInboxName()!==t&&e.folderInformation(t)},1e3),o.delay(function(){e.quota()},5e3),o.delay(function(){L.appDelayStart(h.emptyFunction)},35e3),m.sub("rl.auto-logout",function(){e.logout()}),d.runHook("rl-start-user-screens"),m.pub("rl.bootstart-user-screens"),I.settingsGet("AccountSignMe")&&s.navigator.registerProtocolHandler&&o.delay(function(){try{s.navigator.registerProtocolHandler("mailto",s.location.protocol+"//"+s.location.host+s.location.pathname+"?mailto&to=%s",""+(I.settingsGet("Title")||"RainLoop"))}catch(e){}I.settingsGet("MailToEmail")&&h.mailToHelper(I.settingsGet("MailToEmail"),i(27))},500),c.bMobileDevice||o.defer(function(){e.initVerticalLayoutResizer(l.ClientSideKeyName.FolderListSize)})}else this.bootstartLoginScreen();a&&a.set(100)},e))):(this.bootstartLoginScreen(),a&&a.set(100)),u&&(s["rl_"+n+"_google_service"]=function(){y.google.loading(!0),e.socialUsers()}),S&&(s["rl_"+n+"_facebook_service"]=function(){y.facebook.loading(!0),e.socialUsers()}),v&&(s["rl_"+n+"_twitter_service"]=function(){y.twitter.loading(!0),e.socialUsers()}),m.sub("interval.1m",function(){c.momentTrigger(!c.momentTrigger())}),d.runHook("rl-start-screens"),m.pub("rl.bootstart-end")},e.exports=new t}()},function(e,t,i){!function(){"use strict";var t={},s=i(11),o=i(2),n=i(12),r=i(3),a=i(19),l=i(4);t.$win=n(s),t.$doc=n(s.document),t.$html=n("html"),t.$div=n("
"),t.$win.__sizes=[0,0],t.now=(new s.Date).getTime(),t.momentTrigger=r.observable(!0),t.dropdownVisibility=r.observable(!1).extend({rateLimit:0}),t.tooltipTrigger=r.observable(!1).extend({rateLimit:0}),t.useKeyboardShortcuts=r.observable(!0),t.iAjaxErrorCount=0,t.iTokenErrorCount=0,t.iMessageBodyCacheCount=0,t.bUnload=!1,t.sUserAgent="navigator"in s&&"userAgent"in s.navigator&&s.navigator.userAgent.toLowerCase()||"",t.bMobileDevice=/android/i.test(t.sUserAgent)||/iphone/i.test(t.sUserAgent)||/ipod/i.test(t.sUserAgent)||/ipad/i.test(t.sUserAgent)||/blackberry/i.test(t.sUserAgent),t.bDisableNanoScroll=t.bMobileDevice,t.bAllowPdfPreview=!t.bMobileDevice,t.bAnimationSupported=!t.bMobileDevice&&t.$html.hasClass("csstransitions")&&t.$html.hasClass("cssanimations"),t.bXMLHttpRequestSupported=!!s.XMLHttpRequest,t.__APP__=null,t.oHtmlEditorDefaultConfig={title:!1,stylesSet:!1,customConfig:"",contentsCss:"",toolbarGroups:[{name:"spec"},{name:"styles"},{name:"basicstyles",groups:["basicstyles","cleanup","bidi"]},{name:"colors"},{name:"paragraph",groups:["list","indent","blocks","align"]},{name:"links"},{name:"insert"},{name:"document",groups:["mode","document","doctools"]},{name:"others"}],removePlugins:"liststyle",removeButtons:"Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll,Source",removeDialogTabs:"link:advanced;link:target;image:advanced;images:advanced",extraPlugins:"plain,signature",allowedContent:!0,extraAllowedContent:!0,forceEnterMode:!0,autoParagraph:!1,fillEmptyBlocks:!1,ignoreEmptyParagraph:!0,font_defaultLabel:"Arial",fontSize_defaultLabel:"13",fontSize_sizes:"10/10px;12/12px;13/13px;14/14px;16/16px;18/18px;20/20px;24/24px;28/28px;36/36px;48/48px"},t.oHtmlEditorLangsMap={bg:"bg",de:"de",es:"es",fr:"fr",hu:"hu",is:"is",it:"it",ja:"ja","ja-jp":"ja",ko:"ko","ko-kr":"ko",lt:"lt",lv:"lv",nl:"nl",no:"no",pl:"pl",pt:"pt","pt-pt":"pt","pt-br":"pt-br",ro:"ro",ru:"ru",sk:"sk",sv:"sv",tr:"tr",ua:"ru",zh:"zh","zh-tw":"zh","zh-cn":"zh-cn"},t.bAllowPdfPreview&&s.navigator&&s.navigator.mimeTypes&&(t.bAllowPdfPreview=!!o.find(s.navigator.mimeTypes,function(e){return e&&"application/pdf"===e.type})),t.aBootstrapDropdowns=[],t.aViewModels={settings:[],"settings-removed":[],"settings-disabled":[]},t.leftPanelDisabled=r.observable(!1),t.popupVisibilityNames=r.observableArray([]),t.popupVisibility=r.computed(function(){return 01&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},t.prototype.phpInfo=function(){return this.sServer+"Info"},t.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},t.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ContactsVcf/"},t.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ContactsCsv/"},t.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},t.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},t.prototype.themePreviewLink=function(e){var t=this.sVersionPrefix;return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=this.sWebPrefix),t+"themes/"+s.encodeURI(e)+"/images/preview.png"},t.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},t.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/min/openpgp.js"},t.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},t.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},t.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){h.call(this),this.oRequests={},this.sSubSubQuery="&ss=/"}var s=i(2),o=i(1),n=i(15),r=i(94),a=i(18),l=i(9),c=i(31),u=i(24),d=i(26),h=i(59);s.extend(t.prototype,h.prototype),t.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:l.settingsGet("SentFolder"),DraftFolder:l.settingsGet("DraftFolder"),SpamFolder:l.settingsGet("SpamFolder"),TrashFolder:l.settingsGet("TrashFolder"),ArchiveFolder:l.settingsGet("ArchiveFolder")},null,"",["Folders"])},t.prototype.login=function(e,t,i,s,o,n,r,a){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:r||"",AdditionalCodeSignMe:a?"1":"0",SignMe:o?"1":"0"})},t.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},t.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},t.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},t.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},t.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},t.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},t.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},t.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},t.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},t.prototype.accountSetup=function(e,t,i,s){s=o.isUnd(s)?!0:!!s,this.defaultRequest(e,"AccountSetup",{Email:t,Password:i,New:s?"1":"0"})},t.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},t.prototype.accountsAndIdentitiesSortOrder=function(e,t,i){this.defaultRequest(e,"AccountsAndIdentitiesSortOrder",{Accounts:t,Identities:i})},t.prototype.identityUpdate=function(e,t,i,s,o,n,r,a){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n,Signature:r,SignatureInsertBefore:a?"1":"0"})},t.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},t.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},t.prototype.accountsCounts=function(e){this.defaultRequest(e,"AccountsCounts")},t.prototype.filtersSave=function(e,t,i,o){this.defaultRequest(e,"FiltersSave",{Raw:i,RawIsActive:o?"1":"0",Filters:s.map(t,function(e){return e.toJson()})})},t.prototype.filtersGet=function(e){this.defaultRequest(e,"Filters",{})},t.prototype.templates=function(e){this.defaultRequest(e,"Templates",{})},t.prototype.templateGetById=function(e,t){this.defaultRequest(e,"TemplateGetByID",{ID:t})},t.prototype.templateDelete=function(e,t){this.defaultRequest(e,"TemplateDelete",{IdToDelete:t})},t.prototype.templateSetup=function(e,t,i,s){this.defaultRequest(e,"TemplateSetup",{ID:t,Name:i,Body:s})},t.prototype.messageList=function(e,t,i,s,l,h){t=o.pString(t);var p=a.getFolderHash(t);return h=o.isUnd(h)?!1:!!h,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),l=o.pString(l),""===p||""!==l&&-1!==l.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:l,UidNext:a.getFolderInboxName()===t?a.getFolderUidNext(t):"",UseThreads:c.threadsAllowed()&&u.useThreads()?"1":"0",ExpandedThreadUid:c.threadsAllowed()&&t===d.messageListThreadFolder()?d.messageListThreadUids().join(","):""},""===l?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",h?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===l?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+this.sSubSubQuery+r.urlsafe_encode([t,i,s,l,c.projectHash(),p,a.getFolderInboxName()===t?a.getFolderUidNext(t):"",c.threadsAllowed()&&u.useThreads()?"1":"0",c.threadsAllowed()&&t===d.messageListThreadFolder()?d.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),h?[]:["MessageList"])},t.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},t.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),a.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+this.sSubSubQuery+r.urlsafe_encode([t,i,c.projectHash(),c.threadsAllowed()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},t.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},t.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},t.prototype.folderInformation=function(e,t,n){var r=!0,l=[];o.isArray(n)&&0t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),s.find(a,function(e){var s=u.getFolderFromCacheList(e[1]);return s&&(s.interval=o,t.push(e[1])),i<=t.length}),s.uniq(t)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(e){this.sModelName=e||"",this.disposables=[]}var s=i(2),o=i(1);t.prototype.regDisposables=function(e){o.isArray(e)?s.each(e,function(e){this.disposables.push(e)},this):e&&this.disposables.push(e)},t.prototype.onDestroy=function(){o.disposeObject(this)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.capaOpenPGP=o.observable(!1),this.openpgp=null,this.openpgpkeys=o.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)})}var s=i(2),o=i(3),n=i(1);t.prototype.isSupported=function(){return!!this.openpgp},t.prototype.findPublicKeyByHex=function(e){return s.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},t.prototype.findPublicKeysByEmail=function(e){var t=this;return s.compact(s.map(this.openpgpkeysPublic(),function(i){var s=null;if(i&&e===i.email)try{if(s=t.openpgp.key.readArmored(i.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(o){}return null}))},t.prototype.findPrivateKeyByEmail=function(e,t){var i=null,o=s.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(o)try{i=this.openpgp.key.readArmored(o.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(n.pString(t))):i=null}catch(r){i=null}return i},t.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(i(30).email(),e)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.iAutoLogoutTimer=0,this.layout=o.observable(r.Layout.SidePreview).extend({limitedList:[r.Layout.SidePreview,r.Layout.BottomPreview,r.Layout.NoPreview]}),this.editorDefaultType=o.observable(r.EditorDefaultType.Html).extend({limitedList:[r.EditorDefaultType.Html,r.EditorDefaultType.Plain,r.EditorDefaultType.HtmlForced,r.EditorDefaultType.PlainForced]}),this.messagesPerPage=o.observable(n.Defaults.MessagesPerPage).extend({limitedList:n.Defaults.MessagesPerPageArray}),this.showImages=o.observable(!1),this.useCheckboxesInList=o.observable(!0),this.useThreads=o.observable(!1),this.replySameFolder=o.observable(!1),this.autoLogout=o.observable(30),this.computers(),this.subscribers() }var s=i(11),o=i(3),n=i(15),r=i(4),a=i(7),l=i(1),c=i(28),u=i(9);t.prototype.computers=function(){this.usePreviewPane=o.computed(function(){return r.Layout.NoPreview!==this.layout()},this)},t.prototype.subscribers=function(){this.layout.subscribe(function(e){a.$html.toggleClass("rl-no-preview-pane",r.Layout.NoPreview===e),a.$html.toggleClass("rl-side-preview-pane",r.Layout.SidePreview===e),a.$html.toggleClass("rl-bottom-preview-pane",r.Layout.BottomPreview===e),a.$html.toggleClass("rl-mobile-layout",r.Layout.Mobile===e),c.pub("layout",[e])})},t.prototype.populate=function(){this.layout(l.pInt(u.settingsGet("Layout"))),this.editorDefaultType(u.settingsGet("EditorDefaultType")),this.autoLogout(l.pInt(u.settingsGet("AutoLogout"))),this.messagesPerPage(u.settingsGet("MPP")),this.showImages(!!u.settingsGet("ShowImages")),this.useCheckboxesInList(!!u.settingsGet("UseCheckboxesInList")),this.useThreads(!!u.settingsGet("UseThreads")),this.replySameFolder(!!u.settingsGet("ReplySameFolder"));var e=this;c.sub("rl.auto-logout-refresh",function(){s.clearTimeout(e.iAutoLogoutTimer),0,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},t.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=s.trim(e.Name),this.email=s.trim(e.Email),this.dkimStatus=s.trim(e.DkimStatus||""),this.dkimValue=s.trim(e.DkimValue||""),t=""!==this.email,this.clearDuplicateName()),t},t.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=s.isUnd(t)?!1:!!t,i=s.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'
")+'" target="_blank" tabindex="-1">'+s.encodeHtml(this.name)+"":i?s.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=s.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+s.encodeHtml(o)+""+s.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=s.encodeHtml(o))):t&&(o=''+s.encodeHtml(this.email)+""))),o},t.prototype.mailsoParse=function(e){if(e=s.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},o="",n="",r="",a=!1,l=!1,c=!1,u=null,d=0,h=0,p=0;p0&&0===o.length&&(o=t(e,0,p)),l=!0,d=p);break;case">":l&&(h=p,n=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=p);break;case")":c&&(h=p,r=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,c=!1);break;case"\\":p++}p++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===r.length&&(o=e.replace(n,"")),n=s.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=s.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=s.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),r=r.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.staticMessage=new y,this.messageList=o.observableArray([]).extend({rateLimit:0}),this.messageListCount=o.observable(0),this.messageListSearch=o.observable(""),this.messageListPage=o.observable(1),this.messageListError=o.observable(""),this.messageListThreadFolder=o.observable(""),this.messageListThreadUids=o.observableArray([]),this.messageListEndFolder=o.observable(""),this.messageListEndSearch=o.observable(""),this.messageListEndPage=o.observable(1),this.messageListLoading=o.observable(!1),this.messageListIsNotCompleted=o.observable(!1),this.messageListCompleteLoadingThrottle=o.observable(!1).extend({throttle:200}),this.message=o.observable(null),this.currentMessage=o.observable(null),this.message.focused=o.observable(!1),this.messageError=o.observable(""),this.messageLoading=o.observable(!1),this.messageLoadingThrottle=o.observable(!1).extend({throttle:50}),this.messageFullScreenMode=o.observable(!1),this.messagesBodiesDom=o.observable(null),this.messageActiveDom=o.observable(null),this.messageListChecked=o.computed(function(){return s.filter(this.messageList(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.hasCheckedMessages=o.computed(function(){return 0=e?1:e},this),this.mainMessageListSearch=o.computed({read:this.messageListSearch,write:function(e){l.setHash(p.mailBox(g.currentFolderFullNameHash(),1,h.trim(e.toString())))},owner:this}),this.messageListCompleteLoading=o.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.isMessageSelected=o.computed(function(){return null!==this.message()},this)},t.prototype.subscribers=function(){this.messageListThreadFolder.subscribe(function(){this.messageListThreadUids([])},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(s.debounce(function(e){s.each(e,function(e){e&&e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.message.subscribe(function(e){e?c.Layout.NoPreview===b.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===b.layout()&&-10&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=a(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&s.delay(function(){t.find(".rl-cache-purge").remove()},300)))},t.prototype.initUidNextAndNewMessages=function(e,t,o){if(f.getFolderInboxName()===e&&h.isNormal(t)&&""!==t){if(h.isArray(o)&&03)a.displayDesktopNotification(p.notificationMailIcon(),i(30).email(),m.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>n;n++)a.displayDesktopNotification(p.notificationMailIcon(),y.emailsToLine(y.initEmailsFromJson(o[n].From),!1),o[n].Subject)}f.setFolderUidNext(e,t)}},t.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},t.prototype.removeMessagesFromList=function(e,t,i,o){i=h.isNormal(i)?i:"",o=h.isUnd(o)?!1:!!o,t=s.map(t,function(e){return h.pInt(e)});var n=this,r=0,a=this.messageList(),l=f.getFolderFromCacheList(e),c=""===i?null:f.getFolderFromCacheList(i||""),u=g.currentFolderFullNameRaw(),d=this.message(),p=u===e?s.filter(a,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-r?l.messageCountUnread()-r:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),r>0&&c.messageCountUnread(c.messageCountUnread()+r),c.actionBlink(!0)),0150)&&(e.addClass("rl-bq-switcher hidden-bq"),a('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),h.windowResize()}).after("
").before("
"))})},100)}},t.prototype.setMessage=function(e,t){var s=!1,o=!1,n=!1,r=null,l=null,u="",p="",m=!1,g=!1,y=this.messagesBodiesDom(),S=this.message();e&&S&&e.Result&&"Object/Message"===e.Result["@Object"]&&S.folderFullNameRaw===e.Result.Folder&&S.uid===e.Result.Uid&&(this.messageError(""),S.initUpdateByMessageJson(e.Result),f.addRequestedMessage(S.folderFullNameRaw,S.uid),t||S.initFlagsByJson(e.Result),y=y&&y[0]?y:null,y&&(u="rl-mgs-"+S.hash.replace(/[^a-zA-Z0-9]/g,""),l=y.find("#"+u),l&&l[0]?(S.body=l,S.body&&(S.body.data("rl-cache-count",++d.iMessageBodyCacheCount),S.fetchDataToDom())):(o=!!e.Result.HasExternals,n=!!e.Result.HasInternals,r=a('
').hide().addClass("rl-cache-class"),r.data("rl-cache-count",++d.iMessageBodyCacheCount),h.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,p=e.Result.Html.toString()):h.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,p=h.plainToHtml(e.Result.Plain.toString(),!1),(S.isPgpSigned()||S.isPgpEncrypted())&&i(23).capaOpenPGP()&&(S.plainRaw=h.pString(e.Result.Plain),g=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),g||(m=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),d.$div.empty(),m&&S.isPgpSigned()?p=d.$div.append(a('
').text(S.plainRaw)).html():g&&S.isPgpEncrypted()&&(p=d.$div.append(a('
').text(S.plainRaw)).html()),d.$div.empty(),S.isPgpSigned(m),S.isPgpEncrypted(g))):s=!1,r.html(h.findEmailAndLinks(p)).addClass("b-text-part "+(s?"html":"plain")),S.isHtml(!!s),S.hasImages(!!o),S.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=r,S.body&&y.append(S.body),S.storeDataToDom(),n&&S.showInternalImages(!0),S.hasImages()&&b.showImages()&&S.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(S.body),this.hideMessageBodies(),S.body.show(),r&&this.initBlockquoteSwitcher(r)),f.initMessageFlagsFromCache(S),S.unseen()&&i(6).setMessageSeen(S),h.windowResize())},t.prototype.calculateMessageListHash=function(e){return s.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},t.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])){var s=null,o=0,a=0,l=0,u=0,d=[],p=r().unix(),g=null,S=null,v=null,w=0,C=!1;for(l=h.pInt(e.Result.MessageResultCount),u=h.pInt(e.Result.Offset),h.isNonEmptyArray(e.Result.LastCollapsedThreadUids)&&(s=e.Result.LastCollapsedThreadUids),v=f.getFolderFromCacheList(h.isNormal(e.Result.Folder)?e.Result.Folder:""),v&&!t&&(v.interval=p,f.setFolderHash(e.Result.Folder,e.Result.FolderHash),h.isNormal(e.Result.MessageCount)&&v.messageCountAll(e.Result.MessageCount),h.isNormal(e.Result.MessageUnseenCount)&&(h.pInt(v.messageCountUnread())!==h.pInt(e.Result.MessageUnseenCount)&&(C=!0),v.messageCountUnread(e.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(v.fullNameRaw,e.Result.UidNext,e.Result.NewMessages)),C&&v&&f.clearMessageFlagsFromCacheByFolder(v.fullNameRaw),o=0,a=e.Result["@Collection"].length;a>o;o++)g=e.Result["@Collection"][o],g&&"Object/Message"===g["@Object"]&&(S=y.newInstanceFromJson(g),S&&(f.hasNewMessageAndRemoveFromCache(S.folderFullNameRaw,S.uid)&&5>=w&&(w++,S.newForAnimation(!0)),S.deleted(!1),t?f.initMessageFlagsFromCache(S):f.storeMessageFlagsToCache(S),S.lastInCollapsedThreadLoading(!1),S.lastInCollapsedThread(s&&-1i;i++)o.push(e[i].toLine(!!t));return o.join(", ")},t.prototype.initOnShow=function(e,t,i,s,r,a,l){S.composeInEdit(!0);var c=this,d="",p="",m="",f="",g="",y=null,v="",w="",T=[],F={},A=null,E=C.email(),N=[],I=null,L=null,P=e||u.ComposeType.Empty;if(t=t||null,t&&h.isNormal(t)&&(L=h.isArray(t)&&1===t.length?t[0]:h.isArray(t)?null:t),this.oLastMessage=L,null!==E&&(F[E]=!0),this.reset(),A=this.findIdentityByMessage(P,L),A&&(F[A.email()]=!0),h.isNonEmptyArray(i)&&this.to(this.emailArrayToStringLineHelper(i)),h.isNonEmptyArray(s)&&this.cc(this.emailArrayToStringLineHelper(s)),h.isNonEmptyArray(r)&&this.bcc(this.emailArrayToStringLineHelper(r)),""!==P&&L){switch(f=L.fullFormatDateValue(),g=L.subject(),I=L.aDraftInfo,y=n(L.body).clone(),y&&(y.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),y.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),y.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),v=y.html(),P){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(this.emailArrayToStringLineHelper(L.replyEmails(F))),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(L,P),this.aDraftInfo=["reply",L.uid,L.folderFullNameRaw],this.sInReplyTo=L.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+L.sReferences);break;case u.ComposeType.ReplyAll:T=L.replyAllEmails(F),this.to(this.emailArrayToStringLineHelper(T[0])),this.cc(this.emailArrayToStringLineHelper(T[1])),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(L,P),this.aDraftInfo=["reply",L.uid,L.folderFullNameRaw],this.sInReplyTo=L.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+L.references());break;case u.ComposeType.Forward:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(L,P),this.aDraftInfo=["forward",L.uid,L.folderFullNameRaw],this.sInReplyTo=L.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+L.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(L,P),this.aDraftInfo=["forward",L.uid,L.folderFullNameRaw],this.sInReplyTo=L.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+L.sReferences);break;case u.ComposeType.Draft:this.to(this.emailArrayToStringLineHelper(L.to)),this.cc(this.emailArrayToStringLineHelper(L.cc)),this.bcc(this.emailArrayToStringLineHelper(L.bcc)),this.replyTo(this.emailArrayToStringLineHelper(L.replyTo)),this.bFromDraft=!0,this.draftFolder(L.folderFullNameRaw),this.draftUid(L.uid),this.subject(g),this.prepearMessageAttachments(L,P),this.aDraftInfo=h.isNonEmptyArray(I)&&3===I.length?I:null,this.sInReplyTo=L.sInReplyTo,this.sReferences=L.sReferences;break;case u.ComposeType.EditAsNew:this.to(this.emailArrayToStringLineHelper(L.to)),this.cc(this.emailArrayToStringLineHelper(L.cc)),this.bcc(this.emailArrayToStringLineHelper(L.bcc)),this.replyTo(this.emailArrayToStringLineHelper(L.replyTo)),this.subject(g),this.prepearMessageAttachments(L,P),this.aDraftInfo=h.isNonEmptyArray(I)&&3===I.length?I:null,this.sInReplyTo=L.sInReplyTo,this.sReferences=L.sReferences
}switch(P){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:d=L.fromToLine(!1,!0),w=b.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:f,EMAIL:d}),v="

"+w+":

"+h.trim(v)+"

";break;case u.ComposeType.Forward:d=L.fromToLine(!1,!0),p=L.toToLine(!1,!0),m=L.ccToLine(!1,!0),v="

"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+d+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+p+(0"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+m:"")+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+h.encodeHtml(f)+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+h.encodeHtml(g)+"

"+h.trim(v)+"

";break;case u.ComposeType.ForwardAsAttachment:v=""}this.editor(function(e){e.setHtml(v,!1),(u.EditorDefaultType.PlainForced===c.editorDefaultType()||!L.isHtml()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType())&&e.modeToggle(!1),A&&u.ComposeType.Draft!==P&&u.ComposeType.EditAsNew!==P&&c.setSignatureFromIdentity(A),c.setFocusInPopup()})}else u.ComposeType.Empty===P?(this.subject(h.isNormal(a)?""+a:""),v=h.isNormal(l)?""+l:"",this.editor(function(e){e.setHtml(v,!1),u.EditorDefaultType.Html!==c.editorDefaultType()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType()&&e.modeToggle(!1),A&&c.setSignatureFromIdentity(A),c.setFocusInPopup()})):h.isNonEmptyArray(t)&&(o.each(t,function(e){c.addMessageAsAttachment(e)}),this.editor(function(e){e.setHtml("",!1),u.EditorDefaultType.Html!==c.editorDefaultType()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType()&&e.modeToggle(!1),A&&u.ComposeType.Draft!==P&&u.ComposeType.EditAsNew!==P&&c.setSignatureFromIdentity(A),c.setFocusInPopup()}));N=this.getAttachmentsDownloadsForUpload(),h.isNonEmptyArray(N)&&R.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!c.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=c.getAttachmentById(t.Result[s]),i&&(i.tempName(s),i.waiting(!1).uploading(!1).complete(!0)))}else c.setMessageAttachmentFailedDownloadText()},N),A&&this.currentIdentity(A),this.resizerTrigger()},t.prototype.setFocusInPopup=function(){p.bMobileDevice||(""===this.to()?(this.to.focused(!1),this.to.focused(!0)):this.oEditor&&this.oEditor.focus())},t.prototype.onShowWithDelay=function(){this.setFocusInPopup(),this.resizerTrigger()},t.prototype.tryToClosePopup=function(){var e=this,t=i(40);!L.isPopupVisible(t)&&this.modalVisibility()&&(this.bSkipNextHide||this.isEmptyForm()&&!this.draftUid()?h.delegateRun(e,"closeCommand"):L.showScreenPopup(t,[b.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&h.delegateRun(e,"closeCommand")}]))},t.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),N.settingsGet("AllowCtrlEnterOnCompose")&&key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),m.sub("window.resize.real",this.resizerTrigger),m.sub("window.resize.real",o.debounce(this.resizerTrigger,50)),this.dropboxEnabled()&&(t=s.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",n(t).attr("id","dropboxjs").attr("data-app-key",e.dropboxApiKey()),s.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)}),s.setInterval(function(){e.modalVisibility()&&e.oEditor&&e.oEditor.resize()},5e3)},t.prototype.driveCallback=function(e,t){if(t&&s.XMLHttpRequest&&s.google&&t[s.google.picker.Response.ACTION]===s.google.picker.Action.PICKED&&t[s.google.picker.Response.DOCUMENTS]&&t[s.google.picker.Response.DOCUMENTS][0]&&t[s.google.picker.Response.DOCUMENTS][0].id){var i=this,o=new s.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[s.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=l.parse(o.responseText),s=function(e,t,i){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+i,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":s(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":s(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":s(t,"image/png","png");break;case"application/vnd.google-apps.presentation":s(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:s(t,"application/pdf","pdf")}t&&t.downloadUrl&&i.addDriveAttachment(t,e)}}),o.send()}},t.prototype.driveCreatePiker=function(e){if(s.gapi&&e&&e.access_token){var t=this;s.gapi.load("picker",{callback:function(){if(s.google&&s.google.picker){var i=(new s.google.picker.PickerBuilder).addView(s.google.picker.ViewId.DOCS).setAppId(N.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(o.bind(t.driveCallback,t,e.access_token)).enableFeature(s.google.picker.Feature.NAV_HIDDEN).build();i.setVisible(!0)}}})}},t.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken(),i=function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();return i&&e.driveCreatePiker(i),!0}return!1};t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:N.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(e){i(e)||s.gapi.auth.authorize({client_id:N.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},i)})}})}},t.prototype.getAttachmentById=function(e){for(var t=this.attachments(),i=0,s=t.length;s>i;i++)if(t[i]&&e===t[i].id)return t[i];return null},t.prototype.cancelAttachmentHelper=function(e,t){var i=this;return function(){var s=o.find(i.attachments(),function(t){return t&&t.id===e});s&&(i.attachments.remove(s),h.delegateRunOnDestroy(s),t&&t.cancel(e))}},t.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=h.pInt(N.settingsGet("AttachmentLimit")),i=new c({action:f.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});i?(i.on("onDragEnter",o.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",o.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",o.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",o.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",o.bind(function(t,i,o){var n=null;h.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(s.Math.floor(i/o*100))},this)).on("onSelect",o.bind(function(e,s){this.dragAndDropOver(!1);var o=this,n=h.isUnd(s.FileName)?"":s.FileName.toString(),r=h.isNormal(s.Size)?h.pInt(s.Size):null,a=new I(e,n,r);return a.cancel=o.cancelAttachmentHelper(e,i),this.attachments.push(a),this.attachmentsPlace(!0),r>0&&t>0&&r>t?(a.waiting(!1).uploading(!0).complete(!0).error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var i=null;h.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&i.waiting(!1).uploading(!0).complete(!1)},this)).on("onComplete",o.bind(function(t,i,s){var o="",n=null,r=null,a=this.getAttachmentById(t);r=i&&s&&s.Result&&s.Result.Attachment?s.Result.Attachment:null,n=s&&s.Result&&s.Result.ErrorCode?s.Result.ErrorCode:null,null!==n?o=b.getUploadErrorDescByCode(n):r||(o=b.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==o&&00&&i>0&&s>i?(t.uploading(!1).complete(!0),t.error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(R.composeUploadExternals(function(e,i){var s=!1;t.uploading(!1).complete(!0),u.StorageResultType.Success===e&&i&&i.Result&&i.Result[t.id]&&(s=!0,t.tempName(i.Result[t.id])),s||t.error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},t.prototype.addDriveAttachment=function(e,t){var i=h.pInt(N.settingsGet("AttachmentLimit")),s=null,o=e.fileSize?h.pInt(e.fileSize):0;return s=new I(e.downloadUrl,e.title,o),s.fromMessage=!1,s.cancel=this.cancelAttachmentHelper(e.downloadUrl),s.waiting(!1).uploading(!0).complete(!1),this.attachments.push(s),this.attachmentsPlace(!0),o>0&&i>0&&o>i?(s.uploading(!1).complete(!0),s.error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(R.composeUploadDrive(function(e,t){var i=!1;s.uploading(!1).complete(!0),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(i=!0,s.tempName(t.Result[s.id][0]),s.size(h.pInt(t.Result[s.id][1]))),i||s.error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},t.prototype.prepearMessageAttachments=function(e,t){if(e){var i=h.isNonEmptyArray(e.attachments())?e.attachments():[],s=0,o=i.length,n=null,r=null,a=!1;if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;o>s;s++){switch(r=i[s],a=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:a=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:a=!0}a&&(n=new I(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),n.fromMessage=!0,n.cancel=this.cancelAttachmentHelper(r.download),n.waiting(!1).uploading(!0).complete(!1),this.attachments.push(n))}}},t.prototype.removeLinkedAttachments=function(){var e=o.find(this.attachments(),function(e){return e&&e.isLinked});e&&(this.attachments.remove(e),h.delegateRunOnDestroy(e))},t.prototype.setMessageAttachmentFailedDownloadText=function(){o.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).complete(!0).error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},t.prototype.isEmptyForm=function(e){e=h.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.replyTo().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},t.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestDsn(!1),this.requestReadReceipt(!1),this.markAsImportant(!1),this.attachmentsPlace(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCc(!1),this.showBcc(!1),this.showReplyTo(!1),h.delegateRunOnDestroy(this.attachments()),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},t.prototype.getAttachmentsDownloadsForUpload=function(){return o.map(o.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},t.prototype.resizerTrigger=function(){this.resizer(!this.resizer())},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.oSubs={}}var s=i(2),o=i(1),n=i(20);t.prototype.oSubs={},t.prototype.sub=function(e,t,i){return o.isObject(e)?(i=t||null,t=null,s.each(e,function(e,t){this.sub(t,e,i)},this)):(o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i])),this},t.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||s.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.disposable=[]}var s=i(2),o=i(3),n=i(1);t.prototype.disposable=[],t.prototype.dispose=function(){s.each(this.disposable,function(e){e&&e.dispose&&e.dispose()})},t.componentExportHelper=function(e,t){return{viewModel:{createViewModel:function(t,s){return t=t||{},t.element=null,s.element&&(t.element=$(s.element),i(8).i18nToNode(t.element),!n.isUnd(t.inline)&&o.unwrap(t.inline)&&t.element.css("display","inline-block")),new e(t)}},template:{element:t}}},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.email=o.observable(""),this.signature=o.observable(""),this.accounts=o.observableArray([]),this.accounts.loading=o.observable(!1).extend({throttle:100}),this.computers()}var s=i(2),o=i(3),n=i(9);t.prototype.computers=function(){this.accountsEmails=o.computed(function(){return s.compact(s.map(this.accounts(),function(e){return e?e.email:null}))},this),this.accountsUnreadCount=o.computed(function(){var e=0;return e},this)},t.prototype.populate=function(){this.email(n.settingsGet("Email"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){n.call(this),this.projectHash=s.observable(""),this.threadsAllowed=s.observable(!1),this.composeInEdit=s.observable(!1),this.contactsAutosave=s.observable(!1),this.useLocalProxyForExternalImages=s.observable(!1),this.contactsIsAllowed=s.observable(!1),this.devEmail="",this.devPassword=""}var s=i(3),o=i(9),n=i(65);t.prototype.populate=function(){n.prototype.populate.call(this),this.projectHash(o.settingsGet("ProjectHash")),this.contactsAutosave(!!o.settingsGet("ContactsAutosave")),this.useLocalProxyForExternalImages(!!o.settingsGet("UseLocalProxyForExternalImages")),this.contactsIsAllowed(!!o.settingsGet("ContactsIsAllowed")),this.devEmail=o.settingsGet("DevEmail"),this.devPassword=o.settingsGet("DevPassword")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.languages=s.observableArray([]),this.language=s.observable("").extend({limitedList:this.languages})}var s=i(3),o=i(1),n=i(9);t.prototype.populate=function(){var e=n.settingsGet("Languages");this.languages(o.isArray(e)?e:[]),this.language(n.settingsGet("Language"))},e.exports=new t}()},function(e){e.exports=window.moment},function(e,t,i){!function(){"use strict";function t(e){a.call(this),this.value=e.value||"",this.size=e.size||0,this.label=e.label||"",this.preLabel=e.preLabel||"",this.enable=r.isUnd(e.enable)?!0:e.enable,this.trigger=e.trigger&&e.trigger.subscribe?e.trigger:null,this.placeholder=e.placeholder||"",this.labeled=!r.isUnd(e.label),this.preLabeled=!r.isUnd(e.preLabel),this.triggered=!r.isUnd(e.trigger)&&!!this.trigger,this.classForTrigger=o.observable(""),this.className=o.computed(function(){var e=o.unwrap(this.size),t=this.trigger?" "+r.trim("settings-saved-trigger-input "+this.classForTrigger()):"";return(e>0?"span"+e:"")+t},this),!r.isUnd(e.width)&&e.element&&e.element.find("input,select,textarea").css("width",e.width),this.disposable.push(this.className),this.trigger&&(this.setTriggerState(this.trigger()),this.disposable.push(this.trigger.subscribe(this.setTriggerState,this)))}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(29);t.prototype.setTriggerState=function(e){switch(r.pInt(e)){case n.SaveSettingsStep.TrueResult:this.classForTrigger("success");break;case n.SaveSettingsStep.FalseResult:this.classForTrigger("error");break;default:this.classForTrigger("")}},s.extend(t.prototype,a.prototype),t.componentExportHelper=a.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var s=i(2),o=i(41),n=i(1);t.prototype.oCross=null,t.prototype.sScreenName="",t.prototype.aViewModels=[],t.prototype.viewModels=function(){return this.aViewModels},t.prototype.screenName=function(){return this.sScreenName},t.prototype.routes=function(){return null},t.prototype.__cross=function(){return this.oCross},t.prototype.__start=function(){var e=this.routes(),t=null,i=null;n.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||n.emptyFunction,this),t=o.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.google={},this.twitter={},this.facebook={},this.dropbox={},this.google.enabled=s.observable(!1),this.google.clientID=s.observable(""),this.google.clientSecret=s.observable(""),this.google.apiKey=s.observable(""),this.google.loading=s.observable(!1),this.google.userName=s.observable(""),this.google.loggined=s.computed(function(){return""!==this.google.userName()},this),this.google.capa={},this.google.capa.auth=s.observable(!1),this.google.capa.drive=s.observable(!1),this.google.capa.preview=s.observable(!1),this.google.require={},this.google.require.clientSettings=s.computed(function(){return this.google.enabled()&&(this.google.capa.auth()||this.google.capa.drive())},this),this.google.require.apiKeySettings=s.computed(function(){return this.google.enabled()&&this.google.capa.drive()},this),this.facebook.enabled=s.observable(!1),this.facebook.appID=s.observable(""),this.facebook.appSecret=s.observable(""),this.facebook.loading=s.observable(!1),this.facebook.userName=s.observable(""),this.facebook.supported=s.observable(!1),this.facebook.loggined=s.computed(function(){return""!==this.facebook.userName()},this),this.twitter.enabled=s.observable(!1),this.twitter.consumerKey=s.observable(""),this.twitter.consumerSecret=s.observable(""),this.twitter.loading=s.observable(!1),this.twitter.userName=s.observable(""),this.twitter.loggined=s.computed(function(){return""!==this.twitter.userName()},this),this.dropbox.enabled=s.observable(!1),this.dropbox.apiKey=s.observable("")}var s=i(3);t.prototype.google={},t.prototype.twitter={},t.prototype.facebook={},t.prototype.dropbox={},t.prototype.populate=function(){var e=i(9);this.google.enabled(!!e.settingsGet("AllowGoogleSocial")),this.google.clientID(e.settingsGet("GoogleClientID")),this.google.clientSecret(e.settingsGet("GoogleClientSecret")),this.google.apiKey(e.settingsGet("GoogleApiKey")),this.google.capa.auth(!!e.settingsGet("AllowGoogleSocialAuth")),this.google.capa.drive(!!e.settingsGet("AllowGoogleSocialDrive")),this.google.capa.preview(!!e.settingsGet("AllowGoogleSocialPreview")),this.facebook.enabled(!!e.settingsGet("AllowFacebookSocial")),this.facebook.appID(e.settingsGet("FacebookAppID")),this.facebook.appSecret(e.settingsGet("FacebookAppSecret")),this.facebook.supported(!!e.settingsGet("SupportedFacebookSocial")),this.twitter.enabled=s.observable(!!e.settingsGet("AllowTwitterSocial")),this.twitter.consumerKey=s.observable(e.settingsGet("TwitterConsumerKey")),this.twitter.consumerSecret=s.observable(e.settingsGet("TwitterConsumerSecret")),this.dropbox.enabled(!!e.settingsGet("AllowDropboxSocial")),this.dropbox.apiKey(e.settingsGet("DropboxApiKey"))},e.exports=new t}()},,function(e,t,i){!function(){"use strict";function t(e){r.call(this),this.value=e.value,(n.isUnd(this.value)||!this.value.subscribe)&&(this.value=o.observable(n.isUnd(this.value)?!1:!!this.value)),this.enable=e.enable,(n.isUnd(this.enable)||!this.enable.subscribe)&&(this.enable=o.observable(n.isUnd(this.enable)?!0:!!this.enable)),this.disable=e.disable,(n.isUnd(this.disable)||!this.disable.subscribe)&&(this.disable=o.observable(n.isUnd(this.disable)?!1:!!this.disable)),this.label=e.label||"",this.inline=n.isUnd(e.inline)?!1:e.inline,this.readOnly=n.isUnd(e.readOnly)?!1:!!e.readOnly,this.inverted=n.isUnd(e.inverted)?!1:!!e.inverted,this.labeled=!n.isUnd(e.label)}var s=i(2),o=i(3),n=i(1),r=i(29);s.extend(t.prototype,r.prototype),t.prototype.click=function(){this.readOnly||!this.enable()||this.disable()||this.value(!this.value())},t.componentExportHelper=r.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.themes=s.observableArray([]),this.themeBackgroundName=s.observable(""),this.themeBackgroundHash=s.observable(""),this.theme=s.observable("").extend({limitedList:this.themes})}var s=i(3),o=i(1),n=i(9);t.prototype.populate=function(){var e=n.settingsGet("Themes");this.themes(o.isArray(e)?e:[]),this.theme(n.settingsGet("Theme")),this.themeBackgroundName(n.settingsGet("UserBackgroundName")),this.themeBackgroundHash(n.settingsGet("UserBackgroundHash"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"Popups","PopupsAsk"),this.askDesc=o.observable(""),this.yesButton=o.observable(""),this.noButton=o.observable(""),this.yesFocus=o.observable(!1),this.noFocus=o.observable(!1),this.fYesAction=null,this.fNoAction=null,this.bFocusYesOnShow=!0,this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=r.KeyState.PopupAsk,c.constructorEnd(this)}var s=i(2),o=i(3),n=i(19),r=i(4),a=i(1),l=i(8),c=i(5),u=i(10);c.extendAsViewModel(["View/Popup/Ask","PopupsAskViewModel"],t),s.extend(t.prototype,u.prototype),t.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(l.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(l.i18n("POPUPS_ASK/BUTTON_NO")),this.yesFocus(!1),this.noFocus(!1),this.fYesAction=null,this.fNoAction=null},t.prototype.yesClick=function(){this.cancelCommand(),a.isFunc(this.fYesAction)&&this.fYesAction.call(null)},t.prototype.noClick=function(){this.cancelCommand(),a.isFunc(this.fNoAction)&&this.fNoAction.call(null)},t.prototype.onShow=function(e,t,i,s,o,n){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=i||null,this.askDesc(e||""),s&&this.yesButton(s),s&&this.yesButton(o),this.bFocusYesOnShow=a.isUnd(n)?!0:!!n},t.prototype.onShowWithDelay=function(){this.bFocusYesOnShow&&this.yesFocus(!0)},t.prototype.onBuild=function(){n("tab, shift+tab, right, left",r.KeyState.PopupAsk,s.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),n("esc",r.KeyState.PopupAsk,s.bind(function(){return this.noClick(),!1},this))},e.exports=t}()},function(e){e.exports=window.crossroads},function(e,t,i){!function(){"use strict";function t(){var e=i(2).find([i(96),i(95)],function(e){return e&&e.supported()});this.oDriver=null,e&&(this.oDriver=new e)}t.prototype.oDriver=null,t.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},t.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new t}()},,function(e,t,i){!function(){"use strict";function t(){this.contacts=s.observableArray([]),this.contacts.loading=s.observable(!1).extend({throttle:200}),this.contacts.importing=s.observable(!1).extend({throttle:200}),this.contacts.syncing=s.observable(!1).extend({throttle:200}),this.contacts.exportingVcf=s.observable(!1).extend({throttle:200}),this.contacts.exportingCsv=s.observable(!1).extend({throttle:200}),this.allowContactsSync=s.observable(!1),this.enableContactsSync=s.observable(!1),this.contactsSyncUrl=s.observable(""),this.contactsSyncUser=s.observable(""),this.contactsSyncPass=s.observable("")}var s=i(3),o=i(9);t.prototype.populate=function(){this.allowContactsSync(!!o.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync(!!o.settingsGet("EnableContactsSync")),this.contactsSyncUrl(o.settingsGet("ContactsSyncUrl")),this.contactsSyncUser(o.settingsGet("ContactsSyncUser")),this.contactsSyncPass(o.settingsGet("ContactsSyncPassword"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){p.call(this,"Popups","PopupsFolderSystem"),l.initOnStartOrLangChange(function(){this.sChooseOnText=l.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE"),this.sUnuseText=l.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME")},this),this.notification=o.observable(""),this.folderSelectList=o.computed(function(){return a.folderListOptionsBuilder([],c.folderList(),c.folderListSystemNames(),[["",this.sChooseOnText],[r.Values.UnuseOptionValue,this.sUnuseText]],null,null,null,null,null,!0)},this);var e=null,t=null;this.sentFolder=c.sentFolder,this.draftFolder=c.draftFolder,this.spamFolder=c.spamFolder,this.trashFolder=c.trashFolder,this.archiveFolder=c.archiveFolder,e=s.debounce(function(){u.settingsSet("SentFolder",c.sentFolder()),u.settingsSet("DraftFolder",c.draftFolder()),u.settingsSet("SpamFolder",c.spamFolder()),u.settingsSet("TrashFolder",c.trashFolder()),u.settingsSet("ArchiveFolder",c.archiveFolder()),d.saveSystemFolders(a.emptyFunction,{SentFolder:c.sentFolder(),DraftFolder:c.draftFolder(),SpamFolder:c.spamFolder(),TrashFolder:c.trashFolder(),ArchiveFolder:c.archiveFolder(),NullFolder:"NullFolder"})},1e3),t=function(){u.settingsSet("SentFolder",c.sentFolder()),u.settingsSet("DraftFolder",c.draftFolder()),u.settingsSet("SpamFolder",c.spamFolder()),u.settingsSet("TrashFolder",c.trashFolder()),u.settingsSet("ArchiveFolder",c.archiveFolder()),e()},c.sentFolder.subscribe(t),c.draftFolder.subscribe(t),c.spamFolder.subscribe(t),c.trashFolder.subscribe(t),c.archiveFolder.subscribe(t),this.defautOptionsAfterRender=a.defautOptionsAfterRender,h.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(15),a=i(1),l=i(8),c=i(21),u=i(9),d=i(14),h=i(5),p=i(10);h.extendAsViewModel(["View/Popup/FolderSystem","PopupsFolderSystemViewModel"],t),s.extend(t.prototype,p.prototype),t.prototype.sChooseOnText="",t.prototype.sUnuseText="",t.prototype.onShow=function(e){var t="";switch(e=a.isUnd(e)?n.SetSystemFoldersNotification.None:e){case n.SetSystemFoldersNotification.Sent:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case n.SetSystemFoldersNotification.Draft:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case n.SetSystemFoldersNotification.Spam:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case n.SetSystemFoldersNotification.Trash:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case n.SetSystemFoldersNotification.Archive:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"Popups","PopupsLanguages"),this.LanguageStore=i(32),this.exp=o.observable(!1),this.languages=o.computed(function(){return s.map(this.LanguageStore.languages(),function(e){return{key:e,selected:o.observable(!1),fullName:n.convertLangName(e)}})},this),this.LanguageStore.language.subscribe(function(){this.resetMainLanguage()},this),r.constructorEnd(this)}var s=i(2),o=i(3),n=i(1),r=i(5),a=i(10);r.extendAsViewModel(["View/Popup/Languages","PopupsLanguagesViewModel"],t),s.extend(t.prototype,a.prototype),t.prototype.languageEnName=function(e){var t=n.convertLangName(e,!0);return"English"===t?"":t},t.prototype.resetMainLanguage=function(){var e=this.LanguageStore.language();s.each(this.languages(),function(t){t.selected(t.key===e)})},t.prototype.onShow=function(){this.exp(!0),this.resetMainLanguage()},t.prototype.onHide=function(){this.exp(!1)},t.prototype.changeLanguage=function(e){this.LanguageStore.language(e),this.cancelCommand()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e){h.call(this),this.isLocalAutocomplete=!0,this.iframe=n('