]*>([\s\S\r\n]*)<\/div>/gim,u).replace(/
]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),a=p.$div.html(a).text(),a=a.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,n=100;n>0&&(n--,s=a.indexOf("__bq__start__",t),s>-1);)i=a.indexOf("__bq__start__",s+5),o=a.indexOf("__bq__end__",s+5),(-1===i||i>o)&&o>s?(a=a.substring(0,s)+c(a.substring(s+13,o))+a.substring(o+11),t=0):t=i>-1&&o>i?i-1:0;return a=a.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,""),t=i.isUnd(t)?!1:!!t;var s=!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&&!s?(o=!0,s=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&s?""!==a?(s=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(a):r.push(n&&s?a.substr(1):a);s&&(s=!1,r.push("~~~/blockquote~~~")),c=r}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"
").replace(/\n/g,"
"),t?i.findEmailAndLinks(e):e},o.rainloop_Utils_htmlToPlain=i.htmlToPlain,o.rainloop_Utils_plainToHtml=i.plainToHtml,i.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"))}})},i.resizeAndCrop=function(e,t,s){var i=new o.Image;i.onload=function(){var e=[0,0],i=o.document.createElement("canvas"),n=i.getContext("2d");i.width=t,i.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),s(i.toDataURL("image/jpeg"))},i.src=e},i.folderListOptionsBuilder=function(e,t,s,n,r,a,l,c,u,h){var p=null,m=!1,g=0,f=0,b=" ",y=[];for(h=i.isUnd(h)?!1:!!h,u=i.isNormal(u)?u:0
g;g++)y.push({id:n[g][0],name:n[g][1],system:!1,seporator:!1,disabled:!1});for(m=!0,g=0,f=e.length;f>g;g++)p=e[g],(l?l.call(null,p):!0)&&(m&&0g;g++)p=t[g],!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),s=c,n=c):((3>=l||l>=c-2)&&(r+=2),u(l),s=l,n=l);r>0;)if(s-=1,n+=1,s>0&&(u(s,!1),r--),c>=n)u(n,!0),r--;else if(0>=s)break;3===s?u(2,!1):s>3&&u(o.Math.round((s-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(o.Math.round((c+n)/2),!0,"..."),s>1&&u(1,!1),c>n&&u(c,!0)}return a}},i.selectElement=function(e){var t,s;o.getSelection?(t=o.getSelection(),t.removeAllRanges(),s=o.document.createRange(),s.selectNodeContents(e),t.addRange(s)):o.document.selection&&(s=o.document.body.createTextRange(),s.moveToElementText(e),s.select())},i.detectDropdownVisibility=n.debounce(function(){p.dropdownVisibility(!!n.find(p.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){r(".checkAutocomplete").trigger("change")};(i.isUnd(e)?1:!e)?t():n.delay(t,100)},i.reloadLanguage=function(e,t,o){var a=i.microtime();p.$html.addClass("rl-changing-language"),r.ajax({url:s(11).langLink(e),dataType:"script",cache:!0}).fail(o||i.emptyFunction).done(function(){n.delay(function(){i.i18nReload(),(t||i.emptyFunction)(),p.$html.removeClass("rl-changing-language")},500'),a.after(l),a.remove()),l&&l[0]&&(l.attr("data-href",c).attr("data-theme",e[0]),l[0].styleSheet&&!i.isUnd(l[0].styleSheet.cssText)?l[0].styleSheet.cssText=e[1]:l.text(e[1])),n){var o=r("#rl-bg");t?o.backstretch(n.publicLink(t),{fade:p.bAnimationSupported?1e3:0,centeredX:!0,centeredY:!0}):o.data("backstretch")&&o.backstretch("destroy").attr("style","")}s(d.SaveSettingsStep.TrueResult)}}).always(function(){i.__themeTimer=o.setTimeout(function(){s(d.SaveSettingsStep.Idle)},1e3),i.__themeAjax=null}))},e.exports=i}()},function(e){e.exports=window._},function(e,t,s){!function(t){"use strict";var i=s(12),o=s(2),n=s(13),r=function(e,s,i){t.utils.domNodeDisposal.addDisposeCallback(e,function(){i&&i.dispose&&i.dispose(),s&&(s.off("click.koTooltip"),s.tooltip&&s.tooltip("destroy")),s=null})};t.bindingHandlers.tooltip={init:function(e,i){var o=null,a=!0,l="",c="",u=null,d=s(7),h=s(1);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(i()):i()();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=s(7);t.tooltip({container:"body",trigger:"hover manual",title:function(){return t.data("tooltip3-data")||""}}),n(i.document).on("click",function(){t.tooltip("hide")}),o=a.tooltipTrigger.subscribe(function(){t.tooltip("hide")}),r(e,t,o)},update:function(e,s){var i=t.unwrap(s());""===i?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",i).tooltip("show")}},t.bindingHandlers.registrateBootstrapDropdown={init:function(e){var t=s(7);t&&t.aBootstrapDropdowns&&t.aBootstrapDropdowns.push(n(e))}},t.bindingHandlers.openDropdownTrigger={update:function(e,i){if(t.unwrap(i())){var o=n(e),r=s(1);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),i()(!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,s){n(e).popover(t.unwrap(s())),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).popover("destroy")})}},t.bindingHandlers.csstext={init:function(e,i){var o=s(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(i()):n(e).text(t.unwrap(i()))},update:function(e,i){var o=s(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(i()):n(e).text(t.unwrap(i()))}},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,s,o,r){n(e).on("keypress.koOnEnter",function(t){t&&13===i.parseInt(t.keyCode,10)&&(n(e).trigger("change"),s().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEnter")})}},t.bindingHandlers.onEsc={init:function(e,s,o,r){n(e).on("keypress.koOnEsc",function(t){t&&27===i.parseInt(t.keyCode,10)&&(n(e).trigger("change"),s().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEsc")})}},t.bindingHandlers.clickOnTrue={update:function(e,s){t.unwrap(s())&&n(e).click()}},t.bindingHandlers.modal={init:function(e,i){var o=s(7),r=s(1);n(e).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:t.unwrap(i())}).on("shown.koModal",function(){r.windowResize()}).find(".close").on("click.koModal",function(){i()(!1)}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("shown.koModal").find(".close").off("click.koModal")})},update:function(e,s){n(e).modal(t.unwrap(s())?"show":"hide")}},t.bindingHandlers.i18nInit={init:function(e){var t=s(1);t.i18nToNode(e)}},t.bindingHandlers.i18nUpdate={update:function(e,i){var o=s(1);t.unwrap(i()),o.i18nToNode(e)}},t.bindingHandlers.link={update:function(e,s){n(e).attr("href",t.unwrap(s()))}},t.bindingHandlers.title={update:function(e,s){n(e).attr("title",t.unwrap(s()))}},t.bindingHandlers.textF={init:function(e,s){n(e).text(t.unwrap(s()))}},t.bindingHandlers.initDom={init:function(e,t){t()(e)}},t.bindingHandlers.initFixedTrigger={init:function(e,s){var o=t.unwrap(s()),r=null,a=n(e),l=null,c=o[1]||0;r=n(o[0]||null),r=r[0]?r:null,r&&n(i).resize(function(){l=r.offset(),l&&l.top&&a.css("top",l.top+c)})}},t.bindingHandlers.initResizeTrigger={init:function(e,s){var i=t.unwrap(s());n(e).css({height:i[1],"min-height":i[1]})
-},update:function(e,i){var o=s(1),r=s(7),a=t.unwrap(i()),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,s){n(e).hide().empty().append(t.unwrap(s())).show()}},t.bindingHandlers.draggable={init:function(e,o,r){var a=s(7),l=s(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,s=null,o=n(this),r=o.offset(),a=r.top+o.height();i.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",i.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(s=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",i.setInterval(s,10)),s()))})},p.stop=function(){n(h).each(function(){i.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,i,o){var r=s(7);if(!r.bMobileDevice){var a=i(),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=s(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,s){var i=t.unwrap(s()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(i.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(i.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,i){var r=s(1),a=s(23),l=n(e),c=t(),u=i(),d=u.autoCompleteSource||null,h=function(e){c&&c.focusTrigger&&c.focusTrigger(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),s=null;return""!==t?(s=new a,s.mailsoParse(t),[s.toLine(!1),s]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,s,i){var o=n(e),r=i(),a=r.emailsTagsFilter||null,l=t.unwrap(s());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),a&&t.unwrap(a)&&o.inputosaurus("focus")}},t.bindingHandlers.command={init:function(e,s,i,o){var r=n(e),a=s();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 s=!0,i=n(e),o=t();s=o.enabled(),i.toggleClass("command-not-enabled",!s),s&&(s=o.canExecute(),i.toggleClass("command-can-not-be-execute",!s)),i.toggleClass("command-disabled disable disabled",!s).toggleClass("no-disabled",!!s),(i.is("input")||i.is("button"))&&i.prop("disabled",!s)}},t.extenders.trimmer=function(e){var i=s(1),o=t.computed({read:e,write:function(t){e(i.trim(t.toString()))},owner:this});return o(e()),o},t.extenders.posInterer=function(e,i){var o=s(1),n=t.computed({read:e,write:function(t){var s=o.pInt(t.toString(),i);0>=s&&(s=i),s===e()&&""+s!=""+t&&e(s+1),e(s)}});return n(e()),n},t.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},t.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},t.extenders.toggleSubscribeProperty=function(e,t){var s=t[1];return s&&(e.subscribe(function(e){e&&e[s]&&e[s](!1)},t[0],"beforeChange"),e.subscribe(function(e){e&&e[s]&&e[s](!0)},t[0])),e},t.extenders.falseTimeout=function(e,t){var o=s(1);return e.iTimeout=0,e.subscribe(function(s){s&&(i.clearTimeout(e.iTimeout),e.iTimeout=i.setTimeout(function(){e(!1),e.iTimeout=0},o.pInt(t)))}),e},t.observable.fn.validateNone=function(){return this.hasError=t.observable(!1),this},t.observable.fn.validateEmail=function(){var e=s(1);return this.hasError=t.observable(!1),this.subscribe(function(t){t=e.trim(t),this.hasError(""!==t&&!/^[^@\s]+@[^@\s]+$/.test(t))},this),this.valueHasMutated(),this},t.observable.fn.validateSimpleEmail=function(){var e=s(1);return this.hasError=t.observable(!1),this.subscribe(function(t){t=e.trim(t),this.hasError(""!==t&&!/^.+@.+$/.test(t))},this),this.valueHasMutated(),this},t.observable.fn.validateFunc=function(e){var i=s(1);return this.hasFuncError=t.observable(!1),i.isFunc(e)&&(this.subscribe(function(t){this.hasFuncError(!e(t))},this),this.valueHasMutated()),this},e.exports=t}(ko)},function(e){!function(){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.SpoolerType={Delay:0,MessageList:1,Move:2},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",UserBackground:"USER_BACKGROUND",Sieve:"SIEVE",AttachmentThumbnails:"ATTACHMENT_THUMBNAILS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4,MessageListSize:5},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain",HtmlForced:"HtmlForced",PlainForced:"PlainForced"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={All:"All",Any:"Any"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,AccountDoesNotExist:802,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t}()},function(e,t,s){!function(){"use strict";function t(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var i=s(2),o=s(13),n=s(3),r=s(60),a=s(32),l=s(7),c=s(21),u=s(1);t.prototype.oScreens={},t.prototype.sDefaultScreenName="",t.prototype.oCurrentScreen=null,t.prototype.hideLoading=function(){o("#rl-loading").hide()},t.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},t.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},t.prototype.addSettingsViewModel=function(e,t,s,i,o){e.__rlSettingsData={Label:s,Template:t,Route:i,IsDefault:!!o},l.aViewModels.settings.push(e)},t.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},t.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},t.prototype.routeOff=function(){r.changed.active=!1},t.prototype.routeOn=function(){r.changed.active=!0},t.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},t.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var s=this,r=new e(t),a=r.viewModelPosition(),d=o("#rl-content #rl-"+a.toLowerCase()),h=null;e.__builded=!0,e.__vm=r,r.viewModelName=e.__name,r.viewModelNames=e.__names,d&&1===d.length?(h=o("").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(){s.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),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),i.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()),i.delay(function(){t.viewModelDom.hide()},300))},r)),i.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(),i.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||[]),i.each(e.__names,function(s){c.runHook("view-model-on-show",[s,e.__vm,t||[]])})))},t.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},t.prototype.screenOnRoute=function(e,t){var s=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())&&i.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),i.defer(function(){s.oCurrentScreen&&(u.delegateRun(s.oCurrentScreen,"onHide"),u.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=o,s.oCurrentScreen&&(u.delegateRun(s.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),u.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),i.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},s)),n=o.__cross?o.__cross():null,n&&n.parse(t)})))},t.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),i.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)},this),i.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\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),i.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},t.prototype.setHash=function(e,t,s){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,s=u.isUnd(s)?!1:!!s,(u.isUnd(t)?1:!t)?(r.changed.active=!0,r[s?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[s?"replaceHash":"setHash"](e),r.changed.active=!0)},e.exports=new t}()},function(e,t,s){!function(){"use strict";function t(){N.call(this,v),this.oMoveCache={},this.quotaDebounce=o.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=o.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=o.debounce(this.messagesMoveTrigger,500),i.setInterval(function(){m.pub("interval.30s")},3e4),i.setInterval(function(){m.pub("interval.1m")},6e4),i.setInterval(function(){m.pub("interval.2m")},12e4),i.setInterval(function(){m.pub("interval.3m")},18e4),i.setInterval(function(){m.pub("interval.5m")},3e5),i.setInterval(function(){m.pub("interval.10m")},6e5),i.setInterval(function(){m.pub("interval.15m")},9e5),i.setInterval(function(){m.pub("interval.20m")},9e5),i.setTimeout(function(){i.setInterval(function(){m.pub("interval.5m-after5m")},3e5)},3e5),i.setTimeout(function(){i.setInterval(function(){m.pub("interval.10m-after5m")},6e5)},3e5),n.wakeUp(function(){v.jsVersion(function(e,t){l.StorageResultType.Success===e&&t&&!t.Result&&(i.parent&&b.settingsGet("InIframe")?i.parent.location.reload():i.location.reload())},b.settingsGet("Version"))},{},36e5),b.settingsGet("UserBackgroundHash")&&o.delay(function(){n("#rl-bg").backstretch(p.publicLink(b.settingsGet("UserBackgroundHash")),{fade:c.bAnimationSupported?1e3:0})},3e3),this.socialUsers=o.bind(this.socialUsers,this)}var i=s(12),o=s(2),n=s(13),r=s(29),a=s(59),l=s(4),c=s(7),u=s(15),d=s(21),h=s(1),p=s(11),m=s(25),g=s(5),f=s(50),b=s(8),y=s(9),S=s(19),v=s(14),w=s(23),C=s(77),T=s(64),F=s(71),A=s(78),E=s(79),N=s(35);o.extend(t.prototype,N.prototype),t.prototype.remote=function(){return v},t.prototype.data=function(){return y},t.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){o.each(y.messageList(),function(e){S.initMessageFlagsFromCache(e)}),S.initMessageFlagsFromCache(y.message())},t.prototype.reloadMessageList=function(e,t){var s=this,i=(y.messageListPage()-1)*y.messagesPerPage();(h.isUnd(t)?1:!t)||S.setFolderHash(y.currentFolderFullNameRaw(),""),(h.isUnd(e)?1:!e)||(y.messageListPage(1),i=0),y.messageListLoading(!0),v.messageList(function(e,t,i){l.StorageResultType.Success===e&&t&&t.Result?(y.messageListError(""),y.messageListLoading(!1),s.setMessageList(t,i)):l.StorageResultType.Unload===e?(y.messageListError(""),y.messageListLoading(!1)):l.StorageResultType.Abort!==e&&(y.messageList([]),y.messageListLoading(!1),y.messageListError(t&&t.ErrorCode?h.getNotification(t.ErrorCode):h.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},y.currentFolderFullNameRaw(),i,y.messagesPerPage(),y.messageListSearch())},t.prototype.recacheInboxMessageList=function(){v.messageList(h.emptyFunction,S.getFolderInboxName(),0,y.messagesPerPage(),"",!0)},t.prototype.reloadMessageListHelper=function(e){this.reloadMessageList(e)},t.prototype.contactsSync=function(e){var t=y.contacts;return t.importing()||t.syncing()||!y.enableContactsSync()||!y.allowContactsSync()?!1:(t.syncing(!0),v.contactsSync(function(s,i){t.syncing(!1),e&&e(s,i)}),!0)},t.prototype.messagesMoveTrigger=function(){var e=this,t=y.spamFolder();o.each(this.oMoveCache,function(s){var i=t===s.To,o=!i&&t===s.From&&S.getFolderInboxName()===s.To;v.messagesMove(e.moveOrDeleteResponseHelper,s.From,s.To,s.Uid,i?"SPAM":o?"HAM":"")}),this.oMoveCache={}},t.prototype.messagesMoveHelper=function(e,t,s){var i="$$"+e+"$$"+t+"$$";this.oMoveCache[i]||(this.oMoveCache[i]={From:e,To:t,Uid:[]}),this.oMoveCache[i].Uid=o.union(this.oMoveCache[i].Uid,s),this.messagesMoveTrigger()},t.prototype.messagesCopyHelper=function(e,t,s){v.messagesCopy(this.moveOrDeleteResponseHelper,e,t,s)},t.prototype.messagesDeleteHelper=function(e,t){v.messagesDelete(this.moveOrDeleteResponseHelper,e,t)},t.prototype.moveOrDeleteResponseHelper=function(e,t){l.StorageResultType.Success===e&&y.currentFolder()&&(t&&h.isArray(t.Result)&&2===t.Result.length?S.setFolderHash(t.Result[0],t.Result[1]):(S.setFolderHash(y.currentFolderFullNameRaw(),""),t&&-1o;o++)m=e.Result["@Collection"][o],m&&"Object/Message"===m["@Object"]&&(g=p[o],g&&g.initByJson(m)||(g=T.newInstanceFromJson(m)),g&&(S.hasNewMessageAndRemoveFromCache(g.folderFullNameRaw,g.uid)&&5>=b&&(b++,g.newForAnimation(!0)),g.deleted(!1),t?S.initMessageFlagsFromCache(g):S.storeMessageFlagsToCache(g),g.lastInCollapsedThread(s&&-1i;i++)n=t[i],n&&(a=n.FullNameRaw,r=S.getFolderFromCacheList(a),r||(r=C.newInstanceFromJson(n),r&&(S.setFolderToCacheList(a,r),S.setFolderFullNameRaw(r.fullNameHash,a,r))),r&&(r.collapsed(!s.isFolderExpanded(r.fullNameHash)),n.Extended&&(n.Extended.Hash&&S.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=[],s=!1,i=function(e){return""===e||u.Values.UnuseOptionValue===e||null!==S.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])&&(h.isUnd(e.Result.Namespace)||(y.namespace=e.Result.Namespace),y.threading(!!b.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(y.namespace,e.Result["@Collection"]),y.folderList(t),e.Result.SystemFolders&&""==""+b.settingsGet("SentFolder")+b.settingsGet("DraftFolder")+b.settingsGet("SpamFolder")+b.settingsGet("TrashFolder")+b.settingsGet("ArchiveFolder")+b.settingsGet("NullFolder")&&(b.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),b.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),b.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),b.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),b.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),s=!0),y.sentFolder(i(b.settingsGet("SentFolder"))),y.draftFolder(i(b.settingsGet("DraftFolder"))),y.spamFolder(i(b.settingsGet("SpamFolder"))),y.trashFolder(i(b.settingsGet("TrashFolder"))),y.archiveFolder(i(b.settingsGet("ArchiveFolder"))),s&&v.saveSystemFolders(h.emptyFunction,{SentFolder:y.sentFolder(),DraftFolder:y.draftFolder(),SpamFolder:y.spamFolder(),TrashFolder:y.trashFolder(),ArchiveFolder:y.archiveFolder(),NullFolder:"NullFolder"}),f.set(l.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))
-},t.prototype.isFolderExpanded=function(e){var t=f.get(l.ClientSideKeyName.ExpandedFolders);return h.isArray(t)&&-1!==o.indexOf(t,e)},t.prototype.setExpandedFolder=function(e,t){var s=f.get(l.ClientSideKeyName.ExpandedFolders);h.isArray(s)||(s=[]),t?(s.push(e),s=o.uniq(s)):s=o.without(s,e),f.set(l.ClientSideKeyName.ExpandedFolders,s)},t.prototype.initHorizontalLayoutResizer=function(e){var t=200,s=500,i=null,o=null,r=function(t,s){s&&s.size&&s.size.height&&(f.set(e,s.size.height),u(s.size.height),h.windowResize())},a={helper:"ui-resizable-helper-h",minHeight:t,maxHeight:s,handles:"s",stop:r},u=function(e){e&&(i&&i.attr("style","height:"+e+"px"),o&&o.attr("style","top:"+(55+e)+"px"))},d=function(s){if(s)i&&i.hasClass("ui-resizable")&&i.resizable("destroy").removeAttr("style"),o&&o.removeAttr("style");else if(c.$html.hasClass("rl-bottom-preview-pane")){i=n(".b-message-list-wrapper"),o=n(".b-message-view-wrapper"),i.hasClass("ui-resizable")||i.resizable(a);var r=h.pInt(f.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,s=155,i=n("#rl-left"),o=n("#rl-right"),r=f.get(e)||null,a=function(e){e&&(i.css({width:""+e+"px"}),o.css({left:""+e+"px"}))},l=function(o){if(o)i.resizable("disable"),a(t);else{i.resizable("enable");var n=h.pInt(f.get(e))||s;a(n>s?n:s)}},c=function(t,s){s&&s.size&&s.size.width&&(f.set(e,s.size.width),o.css({left:""+s.size.width+"px"}))};null!==r&&a(r>s?r:s),i.resizable({helper:"ui-resizable-helper-w",minWidth:s,maxWidth:350,handles:"e",stop:c}),m.sub("left-panel.off",function(){l(!0)}),m.sub("left-panel.on",function(){l(!1)})},t.prototype.bootstartLoginScreen=function(){var e=h.pString(b.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),o.defer(function(){i.location.href=e})):(g.hideLoading(),g.startScreens([s(83)]),d.runHook("rl-start-login-screens"),m.pub("rl.bootstart-login-screens"))},t.prototype.bootstart=function(){N.prototype.bootstart.call(this),y.populateDataOnStart();var e=this,t=s(133),n=b.settingsGet("JsHash"),r=h.pInt(b.settingsGet("ContactsSyncInterval")),u=b.settingsGet("AllowGoogleSocial"),f=b.settingsGet("AllowFacebookSocial"),w=b.settingsGet("AllowTwitterSocial");a&&(a.set(70),a.sleep()),c.leftPanelDisabled.subscribe(function(e){m.pub("left-panel."+(e?"off":"on"))}),b.settingsGet("Auth")?(this.setTitle(h.i18n("TITLES/LOADING")),e.folders(o.bind(function(n){if(g.hideLoading(),n){if(t&&i.crypto&&i.crypto.getRandomValues&&b.capa(l.Capa.OpenPGP)){var C=function(t){y.openpgp=t,y.openpgpKeyring=new t.Keyring,y.capaOpenPGP(!0),m.pub("openpgp.init"),e.reloadOpenPgpKeys()};i.openpgp?C(i.openpgp):t.script(p.openPgpJs()).wait(function(){i.openpgp&&C(i.openpgp)})}else y.capaOpenPGP(!1);g.startScreens([s(84),s(85),s(82)]),(u||f||w)&&e.socialUsers(!0),m.sub("interval.2m",function(){e.folderInformation(S.getFolderInboxName())}),m.sub("interval.3m",function(){var t=y.currentFolderFullNameRaw();S.getFolderInboxName()!==t&&e.folderInformation(t)}),m.sub("interval.5m-after5m",function(){e.folderInformationMultiply()}),m.sub("interval.15m",function(){e.quota()}),m.sub("interval.20m",function(){e.folders()}),r=r>=5?r:20,r=320>=r?r:320,o.delay(function(){e.contactsSync()},1e4),o.delay(function(){e.folderInformationMultiply(!0)},2e3),i.setInterval(function(){e.contactsSync()},6e4*r+5e3),(b.capa(l.Capa.AdditionalAccounts)||b.capa(l.Capa.AdditionalIdentities))&&e.accountsAndIdentities(!0),o.delay(function(){var t=y.currentFolderFullNameRaw();S.getFolderInboxName()!==t&&e.folderInformation(t)},1e3),o.delay(function(){e.quota()},5e3),o.delay(function(){v.appDelayStart(h.emptyFunction)},35e3),d.runHook("rl-start-user-screens"),m.pub("rl.bootstart-user-screens"),b.settingsGet("AccountSignMe")&&i.navigator.registerProtocolHandler&&o.delay(function(){try{i.navigator.registerProtocolHandler("mailto",i.location.protocol+"//"+i.location.host+i.location.pathname+"?mailto&to=%s",""+(b.settingsGet("Title")||"RainLoop"))}catch(e){}b.settingsGet("MailToEmail")&&h.mailToHelper(b.settingsGet("MailToEmail"),s(24))},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&&(i["rl_"+n+"_google_service"]=function(){y.googleActions(!0),e.socialUsers()}),f&&(i["rl_"+n+"_facebook_service"]=function(){y.facebookActions(!0),e.socialUsers()}),w&&(i["rl_"+n+"_twitter_service"]=function(){y.twitterActions(!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,s){!function(){"use strict";var t={},i=s(12),o=s(2),n=s(13),r=s(3),a=s(18),l=s(4);t.$win=n(i),t.$doc=n(i.document),t.$html=n("html"),t.$div=n(""),t.now=(new i.Date).getTime(),t.momentTrigger=r.observable(!0),t.dropdownVisibility=r.observable(!1).extend({rateLimit:0}),t.tooltipTrigger=r.observable(!1).extend({rateLimit:0}),t.langChangeTrigger=r.observable(!0),t.useKeyboardShortcuts=r.observable(!0),t.iAjaxErrorCount=0,t.iTokenErrorCount=0,t.iMessageBodyCacheCount=0,t.bUnload=!1,t.sUserAgent=(i.navigator.userAgent||"").toLowerCase(),t.bIsiOSDevice=-1=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){g.setHash(h.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=r.observable(""),this.messageListLoading=r.observable(!1),this.messageListIsNotCompleted=r.observable(!1),this.messageListCompleteLoadingThrottle=r.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=r.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(o.debounce(function(e){o.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new f,this.message=r.observable(null),this.messageLoading=r.observable(!1),this.messageLoadingThrottle=r.observable(!1).extend({throttle:50}),this.message.focused=r.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===this.layout()&&-10?i.Math.ceil(t/e*100):0},this),this.composeInEdit=r.observable(!1),this.capaOpenPGP=r.observable(!1),this.openpgpkeys=r.observableArray([]),this.openpgp=null,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)}),this.googleActions=r.observable(!1),this.googleLoggined=r.observable(!1),this.googleUserName=r.observable(""),this.facebookActions=r.observable(!1),this.facebookLoggined=r.observable(!1),this.facebookUserName=r.observable(""),this.twitterActions=r.observable(!1),this.twitterLoggined=r.observable(!1),this.twitterUserName=r.observable(""),this.customThemeType=r.observable(c.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=o.throttle(this.purgeMessageBodyCache,3e4)}var i=s(12),o=s(2),n=s(13),r=s(3),a=s(29),l=s(15),c=s(4),u=s(7),d=s(1),h=s(11),p=s(8),m=s(19),g=s(5),f=s(64),b=s(50),y=s(48);o.extend(t.prototype,y.prototype),t.prototype.purgeMessageBodyCache=function(){var e=0,t=null,s=u.iMessageBodyCacheCount-l.Values.MessageBodyCacheLimit;s>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=n(this);s>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&o.delay(function(){t.find(".rl-cache-purge").remove()},300)))},t.prototype.populateDataOnStart=function(){y.prototype.populateDataOnStart.call(this),this.accountEmail(p.settingsGet("Email")),this.accountIncLogin(p.settingsGet("IncLogin")),this.accountOutLogin(p.settingsGet("OutLogin")),this.projectHash(p.settingsGet("ProjectHash")),this.defaultIdentityID(p.settingsGet("DefaultIdentityID")),this.displayName(p.settingsGet("DisplayName")),this.replyTo(p.settingsGet("ReplyTo")),this.signature(p.settingsGet("Signature")),this.signatureToAll(!!p.settingsGet("SignatureToAll")),this.enableTwoFactor(!!p.settingsGet("EnableTwoFactor")),this.lastFoldersHash=b.get(c.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!p.settingsGet("RemoteSuggestions"),this.devEmail=p.settingsGet("DevEmail"),this.devPassword=p.settingsGet("DevPassword")},t.prototype.initUidNextAndNewMessages=function(e,t,s){if(m.getFolderInboxName()===e&&d.isNormal(t)&&""!==t){if(d.isArray(s)&&03)l(h.notificationMailIcon(),this.accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:a}));else for(;a>r;r++)l(h.notificationMailIcon(),f.emailsToLine(f.initEmailsFromJson(s[r].From),!1),s[r].Subject)}m.setFolderUidNext(e,t)}},t.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},t.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],s=5,i=a().unix(),n=i-300,r=[],l=m.getFolderInboxName(),c=function(t){o.each(t,function(t){t&&l!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),o.find(r,function(e){var o=m.getFolderFromCacheList(e[1]);return o&&(o.interval=i,t.push(e[1])),s<=t.length}),o.uniq(t)},t.prototype.removeMessagesFromList=function(e,t,s,i){s=d.isNormal(s)?s:"",i=d.isUnd(i)?!1:!!i,t=o.map(t,function(e){return d.pInt(e)});var n=this,r=0,a=this.messageList(),l=m.getFolderFromCacheList(e),c=""===s?null:m.getFolderFromCacheList(s||""),u=this.currentFolderFullNameRaw(),h=this.message(),p=u===e?o.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"),n('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),d.windowResize()}).after("
").before("
"))})},100)}},t.prototype.setMessage=function(e,t){var i=!1,o=!1,r=!1,a=null,l=null,h="",p="",g=!1,f=!1,b=this.messagesBodiesDom(),y=this.message();e&&y&&e.Result&&"Object/Message"===e.Result["@Object"]&&y.folderFullNameRaw===e.Result.Folder&&y.uid===e.Result.Uid&&(this.messageError(""),y.initUpdateByMessageJson(e.Result),m.addRequestedMessage(y.folderFullNameRaw,y.uid),t||y.initFlagsByJson(e.Result),b=b&&b[0]?b:null,b&&(h="rl-mgs-"+y.hash.replace(/[^a-zA-Z0-9]/g,""),l=b.find("#"+h),l&&l[0]?(y.body=l,y.body&&(y.body.data("rl-cache-count",++u.iMessageBodyCacheCount),y.fetchDataToDom())):(o=!!e.Result.HasExternals,r=!!e.Result.HasInternals,a=n('').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(y.isPgpSigned()||y.isPgpEncrypted())&&this.capaOpenPGP()&&(y.plainRaw=d.pString(e.Result.Plain),f=/---BEGIN PGP MESSAGE---/.test(y.plainRaw),f||(g=/-----BEGIN PGP SIGNED MESSAGE-----/.test(y.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(y.plainRaw)),u.$div.empty(),g&&y.isPgpSigned()?p=u.$div.append(n('').text(y.plainRaw)).html():f&&y.isPgpEncrypted()&&(p=u.$div.append(n('').text(y.plainRaw)).html()),u.$div.empty(),y.isPgpSigned(g),y.isPgpEncrypted(f))):i=!1,a.html(d.findEmailAndLinks(p)).addClass("b-text-part "+(i?"html":"plain")),y.isHtml(!!i),y.hasImages(!!o),y.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),y.pgpSignedVerifyUser(""),y.body=a,y.body&&b.append(y.body),y.storeDataToDom(),r&&y.showInternalImages(!0),y.hasImages()&&this.showImages()&&y.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(y.body),this.hideMessageBodies(),y.body.show(),a&&this.initBlockquoteSwitcher(a)),m.initMessageFlagsFromCache(y),y.unseen()&&s(6).setMessageSeen(y),d.windowResize())},t.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},t.prototype.findPublicKeyByHex=function(e){return o.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},t.prototype.findPublicKeysByEmail=function(e){var t=this;return o.compact(o.map(this.openpgpkeysPublic(),function(s){var i=null;if(s&&e===s.email)try{if(i=t.openpgp.key.readArmored(s.armor),i&&!i.err&&i.keys&&i.keys[0])return i.keys[0]}catch(o){}return null}))},t.prototype.findPrivateKeyByEmail=function(e,t){var s=this,i=null,n=o.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(n)try{i=s.openpgp.key.readArmored(n.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(d.pString(t))):i=null}catch(r){i=null}return i},t.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new t}()},function(e,t,s){!function(){"use strict";function t(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=n.pString(e),this.sTemplate=n.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=i.observable(!1),this.modalVisibility=i.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var i=s(3),o=s(4),n=s(1),r=s(7);t.prototype.bDisabeCloseOnEsc=!1,t.prototype.sPosition="",t.prototype.sTemplate="",t.prototype.sDefaultKeyScope=o.KeyState.None,t.prototype.sCurrentKeyScope=o.KeyState.None,t.prototype.viewModelName="",t.prototype.viewModelNames=[],t.prototype.viewModelDom=null,t.prototype.viewModelTemplate=function(){return this.sTemplate},t.prototype.viewModelPosition=function(){return this.sPosition},t.prototype.cancelCommand=function(){},t.prototype.closeCommand=function(){},t.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=r.keyScope(),r.keyScope(this.sDefaultKeyScope)},t.prototype.restoreKeyScope=function(){r.keyScope(this.sCurrentKeyScope)},t.prototype.registerPopupKeyDown=function(){var e=this;r.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return n.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!n.inFocus())return!1}return!0})},e.exports=t}()},function(e,t,s){!function(){"use strict";function t(){var e=s(8);this.sBase="#/",this.sServer="./?",this.sSubQuery="&s=/",this.sSubSubQuery="&ss=/",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var i=s(1);t.prototype.root=function(){return this.sBase},t.prototype.rootAdmin=function(){return this.sServer+"/Admin/"},t.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/Download/"+this.sSubSubQuery+e},t.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/View/"+this.sSubSubQuery+e},t.prototype.attachmentThumbnailPreview=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ViewThumbnail/"+this.sSubSubQuery+e},t.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ViewAsPlain/"+this.sSubSubQuery+e},t.prototype.attachmentFramed=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/FramedView/"+this.sSubSubQuery+e},t.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.append=function(){return this.sServer+"/Append/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.change=function(e){return this.sServer+"/Change/"+this.sSubQuery+this.sSpecSuffix+"/"+i.encodeURIComponent(e)+"/"},t.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSubQuery+this.sSpecSuffix+"/"+e},t.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ViewAsPlain/"+this.sSubSubQuery+e},t.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/Download/"+this.sSubSubQuery+e},t.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+i.encodeURIComponent(e)+"/"},t.prototype.publicLink=function(e){return this.sServer+"/Raw/0/Public/"+e+"/"},t.prototype.inbox=function(e){return e=i.isUnd(e)?"INBOX":e,this.sBase+"mailbox/"+e},t.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},t.prototype.settings=function(e){var t=this.sBase+"settings";return i.isUnd(e)||""===e||(t+="/"+e),t},t.prototype.about=function(){return this.sBase+"about"},t.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},t.prototype.mailBox=function(e,t,s){t=i.isNormal(t)?i.pInt(t):1,s=i.pString(s);var o=this.sBase+"mailbox/";return""!==e&&(o+=encodeURI(e)),t>1&&(o=o.replace(/[\/]+$/,""),o+="/p"+t),""!==s&&(o=o.replace(/[\/]+$/,""),o+="/"+encodeURI(s)),o},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="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+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){e.exports=window},function(e){e.exports=window.jQuery},function(e,t,s){!function(){"use strict";function t(){u.call(this),this.oRequests={}}var i=s(2),o=s(1),n=s(15),r=s(70),a=s(8),l=s(19),c=s(9),u=s(49);i.extend(t.prototype,u.prototype),t.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:a.settingsGet("SentFolder"),DraftFolder:a.settingsGet("DraftFolder"),SpamFolder:a.settingsGet("SpamFolder"),TrashFolder:a.settingsGet("TrashFolder"),ArchiveFolder:a.settingsGet("ArchiveFolder")},null,"",["Folders"])},t.prototype.login=function(e,t,s,i,o,n,r,a){this.defaultRequest(e,"Login",{Email:t,Login:s,Password:i,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,s,i,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:s,User:i,Password:o})},t.prototype.accountSetup=function(e,t,s,i){i=o.isUnd(i)?!0:!!i,this.defaultRequest(e,"AccountSetup",{Email:t,Password:s,New:i?"1":"0"})},t.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},t.prototype.identityUpdate=function(e,t,s,i,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:s,Name:i,ReplyTo:o,Bcc:n})},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){return!!e},t.prototype.filtersSave=function(e,t){this.defaultRequest(e,"FiltersSave",{Filters:i.map(t,function(e){return e.toJson()})})},t.prototype.filtersGet=function(e){this.defaultRequest(e,"Filters",{})},t.prototype.messageList=function(e,t,s,i,a,u){t=o.pString(t);var d=l.getFolderHash(t);return u=o.isUnd(u)?!1:!!u,s=o.isUnd(s)?0:o.pInt(s),i=o.isUnd(s)?20:o.pInt(i),a=o.pString(a),""===d||""!==a&&-1!==a.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:s,Limit:i,Search:a,UidNext:l.getFolderInboxName()===t?l.getFolderUidNext(t):"",UseThreads:c.threading()&&c.useThreads()?"1":"0",ExpandedThreadUid:c.threading()&&t===c.messageListThreadFolder()?c.messageListThreadUids().join(","):""},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",u?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,s,i,a,c.projectHash(),d,l.getFolderInboxName()===t?l.getFolderUidNext(t):"",c.threading()&&c.useThreads()?"1":"0",c.threading()&&t===c.messageListThreadFolder()?c.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),u?[]:["MessageList"])},t.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},t.prototype.message=function(e,t,s){return t=o.pString(t),s=o.pInt(s),l.getFolderFromCacheList(t)&&s>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,s,c.projectHash(),c.threading()&&c.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,s){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:s,Url:t},999e3)},t.prototype.folderInformation=function(e,t,n){var r=!0,a=[];o.isArray(n)&&0,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[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=i.trim(e.Name),this.email=i.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},t.prototype.toLine=function(e,t,s){var o="";return""!==this.email&&(t=i.isUnd(t)?!1:!!t,s=i.isUnd(s)?!1:!!s,e&&""!==this.name?o=t?'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.name)+"":s?i.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=i.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(o)+""+i.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",s&&(o=i.encodeHtml(o))):t&&(o=''+i.encodeHtml(this.email)+""))),o},t.prototype.mailsoParse=function(e){if(e=i.trim(e),""===e)return!1;for(var t=function(e,t,s){e+="";var i=e.length;return 0>t&&(t+=i),i="undefined"==typeof s?i:0>s?s+i:s+t,t>=e.length||0>t||t>i?!1:e.slice(t,i)},s=function(e,t,s,i){return 0>s&&(s+=e.length),i=void 0!==i?i:e.length,0>i&&(i=i+e.length-s),e.slice(0,s)+t.substr(0,i)+t.slice(i)+e.slice(s+i)},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=s(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=s(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=i.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=i.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=i.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,s){!function(){"use strict";function t(){T.call(this,"Popups","PopupsCompose"),this.oEditor=null,this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.bCapaAdditionalIdentities=b.capa(u.Capa.AdditionalIdentities),this.allowContacts=!!b.settingsGet("ContactsIsAllowed");var e=this,n=function(){h.windowResize()},a=function(t){!1===e.showCcAndBcc()&&0"},t.prototype.sendMessageResponse=function(e,t){var s=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(s=!0,this.modalVisibility()&&h.delegateRun(this,"closeCommand")),this.modalVisibility()&&!s&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),i.alert(h.trim(h.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=h.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),i.alert(o||h.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},t.prototype.saveMessageResponse=function(e,t){var s=!1,o=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(s=!0,this.bFromDraft&&(o=y.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&y.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.savedTime(i.Math.round((new i.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
"+s}return e},t.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?o.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},t.prototype.onShow=function(e,t,i,o,n){if(C.routeOff(),this.autosaveStart(),this.composeInEdit()){e=e||u.ComposeType.Empty;var r=this,a=s(31);u.ComposeType.Empty!==e?C.showScreenPopup(a,[h.i18n("COMPOSE/DISCARD_UNSAVED_DATA"),function(){r.initOnShow(e,t,i,o,n)},null,null,null,!1]):i&&0s;s++)o.push(e[s].toLine(!!t));return o.join(", ")};if(t=t||null,t&&h.isNormal(t)&&(R=h.isArray(t)&&1===t.length?t[0]:h.isArray(t)?null:t),null!==T&&(w[T]=!0),C=this.findIdentityIdByMessage(I,R),C&&C[0]&&(w[C[1]]=!0,this.currentIdentityID(C[0])),this.reset(),h.isNonEmptyArray(s)&&this.to(P(s)),""!==I&&R){switch(p=R.fullFormatDateValue(),m=R.subject(),N=R.aDraftInfo,g=n(R.body).clone(),g&&(g.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),g.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),g.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),f=g.html(),I){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(P(R.replyEmails(w))),this.subject(h.replySubjectAdd("Re",m)),this.prepearMessageAttachments(R,I),this.aDraftInfo=["reply",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+R.sReferences);break;case u.ComposeType.ReplyAll:S=R.replyAllEmails(w),this.to(P(S[0])),this.cc(P(S[1])),this.subject(h.replySubjectAdd("Re",m)),this.prepearMessageAttachments(R,I),this.aDraftInfo=["reply",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+R.references());break;case u.ComposeType.Forward:this.subject(h.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(R,I),this.aDraftInfo=["forward",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+R.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(h.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(R,I),this.aDraftInfo=["forward",R.uid,R.folderFullNameRaw],this.sInReplyTo=R.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+R.sReferences);break;case u.ComposeType.Draft:this.to(P(R.to)),this.cc(P(R.cc)),this.bcc(P(R.bcc)),this.bFromDraft=!0,this.draftFolder(R.folderFullNameRaw),this.draftUid(R.uid),this.subject(m),this.prepearMessageAttachments(R,I),this.aDraftInfo=h.isNonEmptyArray(N)&&3===N.length?N:null,this.sInReplyTo=R.sInReplyTo,this.sReferences=R.sReferences;break;case u.ComposeType.EditAsNew:this.to(P(R.to)),this.cc(P(R.cc)),this.bcc(P(R.bcc)),this.subject(m),this.prepearMessageAttachments(R,I),this.aDraftInfo=h.isNonEmptyArray(N)&&3===N.length?N:null,this.sInReplyTo=R.sInReplyTo,this.sReferences=R.sReferences
-}switch(I){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=R.fromToLine(!1,!0),b=h.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:p,EMAIL:l}),f="
"+b+":"+f+"
";break;case u.ComposeType.Forward:l=R.fromToLine(!1,!0),c=R.toToLine(!1,!0),d=R.ccToLine(!1,!0),f="
"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+h.encodeHtml(p)+"
"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+h.encodeHtml(m)+"
"+f;break;case u.ComposeType.ForwardAsAttachment:f=""}A&&""!==F&&u.ComposeType.EditAsNew!==I&&u.ComposeType.Draft!==I&&(f=this.convertSignature(F,P(R.from,!0),f,I)),this.editor(function(e){e.setHtml(f,!1),(u.EditorDefaultType.PlainForced===y.editorDefaultType()||!R.isHtml()&&u.EditorDefaultType.HtmlForced!==y.editorDefaultType())&&e.modeToggle(!1)})}else u.ComposeType.Empty===I?(this.subject(h.isNormal(i)?""+i:""),f=h.isNormal(r)?""+r:"",A&&""!==F&&(f=this.convertSignature(F,"",h.plainToHtml(f,!0),I)),this.editor(function(e){e.setHtml(f,!1),u.EditorDefaultType.Html!==y.editorDefaultType()&&u.EditorDefaultType.HtmlForced!==y.editorDefaultType()&&e.modeToggle(!1)})):h.isNonEmptyArray(t)&&o.each(t,function(e){a.addMessageAsAttachment(e)});E=this.getAttachmentsDownloadsForUpload(),h.isNonEmptyArray(E)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var s=null,i="";if(!a.viewModelVisibility())for(i in t.Result)t.Result.hasOwnProperty(i)&&(s=a.getAttachmentById(t.Result[i]),s&&(s.tempName(i),s.waiting(!1).uploading(!1).complete(!0)))}else a.setMessageAttachmentFailedDownloadText()},E),this.triggerForResize()},t.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},t.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},t.prototype.tryToClosePopup=function(){var e=this,t=s(31);!C.isPopupVisible(t)&&this.modalVisibility()&&(this.bSkipNextHide||this.isEmptyForm()&&!this.draftUid()?h.delegateRun(e,"closeCommand"):C.showScreenPopup(t,[h.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}),b.settingsGet("AllowСtrlEnterOnCompose")&&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}),p.$win.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=i.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",b.settingsGet("DropboxApiKey")),i.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){i.gapi&&e.driveVisible(!0)})},t.prototype.driveCallback=function(e,t){if(t&&i.XMLHttpRequest&&i.google&&t[i.google.picker.Response.ACTION]===i.google.picker.Action.PICKED&&t[i.google.picker.Response.DOCUMENTS]&&t[i.google.picker.Response.DOCUMENTS][0]&&t[i.google.picker.Response.DOCUMENTS][0].id){var s=this,o=new i.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[i.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),i=function(e,t,s){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+s,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":i(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":i(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":i(t,"image/png","png");break;case"application/vnd.google-apps.presentation":i(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:i(t,"application/pdf","pdf")}t&&t.downloadUrl&&s.addDriveAttachment(t,e)}}),o.send()}},t.prototype.driveCreatePiker=function(e){if(i.gapi&&e&&e.access_token){var t=this;i.gapi.load("picker",{callback:function(){if(i.google&&i.google.picker){var s=(new i.google.picker.PickerBuilder).addView(i.google.picker.ViewId.DOCS).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(o.bind(t.driveCallback,t,e.access_token)).enableFeature(i.google.picker.Feature.NAV_HIDDEN).build();s.setVisible(!0)}}})}},t.prototype.driveOpenPopup=function(){if(i.gapi){var e=this;i.gapi.load("auth",{callback:function(){var t=i.gapi.auth.getToken(),s=function(t){if(t&&!t.error){var s=i.gapi.auth.getToken();return s&&e.driveCreatePiker(s),!0}return!1};t?e.driveCreatePiker(t):i.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(e){s(e)||i.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},s)})}})}},t.prototype.getAttachmentById=function(e){for(var t=this.attachments(),s=0,i=t.length;i>s;s++)if(t[s]&&e===t[s].id)return t[s];return null},t.prototype.cancelAttachmentHelper=function(e,t){var s=this;return function(){var i=o.find(s.attachments(),function(t){return t&&t.id===e});i&&(s.attachments.remove(i),h.delegateRunOnDestroy(i),t&&t.cancel(e))}},t.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=h.pInt(b.settingsGet("AttachmentLimit")),s=new c({action:g.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.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,s,o){var n=null;h.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(i.Math.floor(s/o*100))},this)).on("onSelect",o.bind(function(e,i){this.dragAndDropOver(!1);var o=this,n=h.isUnd(i.FileName)?"":i.FileName.toString(),r=h.isNormal(i.Size)?h.pInt(i.Size):null,a=new w(e,n,r);return a.cancel=o.cancelAttachmentHelper(e,s),this.attachments.push(a),this.attachmentsPlace(!0),r>0&&t>0&&r>t?(a.waiting(!1).uploading(!0).complete(!0).error(h.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var s=null;h.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&s.waiting(!1).uploading(!0).complete(!1)},this)).on("onComplete",o.bind(function(t,s,i){var o="",n=null,r=null,a=this.getAttachmentById(t);r=s&&i&&i.Result&&i.Result.Attachment?i.Result.Attachment:null,n=i&&i.Result&&i.Result.ErrorCode?i.Result.ErrorCode:null,null!==n?o=h.getUploadErrorDescByCode(n):r||(o=h.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==o&&00&&s>0&&i>s?(t.uploading(!1).complete(!0),t.error(h.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,s){var i=!1;t.uploading(!1).complete(!0),u.StorageResultType.Success===e&&s&&s.Result&&s.Result[t.id]&&(i=!0,t.tempName(s.Result[t.id])),i||t.error(h.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},t.prototype.addDriveAttachment=function(e,t){var s=h.pInt(b.settingsGet("AttachmentLimit")),i=null,o=e.fileSize?h.pInt(e.fileSize):0;return i=new w(e.downloadUrl,e.title,o),i.fromMessage=!1,i.cancel=this.cancelAttachmentHelper(e.downloadUrl),i.waiting(!1).uploading(!0).complete(!1),this.attachments.push(i),this.attachmentsPlace(!0),o>0&&s>0&&o>s?(i.uploading(!1).complete(!0),i.error(h.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var s=!1;i.uploading(!1).complete(!0),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[i.id]&&(s=!0,i.tempName(t.Result[i.id][0]),i.size(h.pInt(t.Result[i.id][1]))),s||i.error(h.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},t.prototype.prepearMessageAttachments=function(e,t){if(e){var s=h.isNonEmptyArray(e.attachments())?e.attachments():[],i=0,o=s.length,n=null,r=null,a=!1;if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;o>i;i++){switch(r=s[i],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 w(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(h.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.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},t.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),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.showCcAndBcc(!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.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=t}()},function(e,t,s){!function(){"use strict";function t(){this.oSubs={}}var i=s(2),o=s(1),n=s(21);t.prototype.oSubs={},t.prototype.sub=function(e,t,s){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,s]),this},t.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||i.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new t}()},function(e,t,s){!function(){"use strict";function t(){this.disposable=[]}var i=s(2),o=s(3),n=s(1);t.prototype.disposable=[],t.prototype.dispose=function(){i.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),n.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,s){!function(){"use strict";function t(e){a.call(this),this.value=e.value||"",this.size=e.size||0,this.label=e.label||"",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.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 i=s(2),o=s(3),n=s(4),r=s(1),a=s(26);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("")}},i.extend(t.prototype,a.prototype),t.componentExportHelper=a.componentExportHelper,e.exports=t}()},function(e,t,s){!function(){"use strict";function t(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var i=s(2),o=s(32),n=s(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,s=null;n.isNonEmptyArray(e)&&(s=i.bind(this.onRoute||n.emptyFunction,this),t=o.create(),i.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},e.exports=t}()},function(e){e.exports=window.moment},function(e,t,s){!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 i=s(2),o=s(3),n=s(1),r=s(26);i.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,s){!function(){"use strict";function t(){c.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,l.constructorEnd(this)}var i=s(2),o=s(3),n=s(18),r=s(4),a=s(1),l=s(5),c=s(10);l.extendAsViewModel(["View/Popup/Ask","PopupsAskViewModel"],t),i.extend(t.prototype,c.prototype),t.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(a.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(a.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,s,i,o,n){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=s||null,this.askDesc(e||""),i&&this.yesButton(i),i&&this.yesButton(o),this.bFocusYesOnShow=a.isUnd(n)?!0:!!n},t.prototype.onFocus=function(){this.bFocusYesOnShow&&this.yesFocus(!0)},t.prototype.onBuild=function(){n("tab, shift+tab, right, left",r.KeyState.PopupAsk,i.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),n("esc",r.KeyState.PopupAsk,i.bind(function(){return this.noClick(),!1},this))},e.exports=t}()},function(e){e.exports=window.crossroads},function(e,t,s){!function(){"use strict";function t(){h.call(this,"Popups","PopupsFolderSystem"),a.initOnStartOrLangChange(function(){this.sChooseOnText=a.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE"),this.sUnuseText=a.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=this,t=null,s=null;this.sentFolder=c.sentFolder,this.draftFolder=c.draftFolder,this.spamFolder=c.spamFolder,this.trashFolder=c.trashFolder,this.archiveFolder=c.archiveFolder,t=i.debounce(function(){l.settingsSet("SentFolder",e.sentFolder()),l.settingsSet("DraftFolder",e.draftFolder()),l.settingsSet("SpamFolder",e.spamFolder()),l.settingsSet("TrashFolder",e.trashFolder()),l.settingsSet("ArchiveFolder",e.archiveFolder()),u.saveSystemFolders(a.emptyFunction,{SentFolder:e.sentFolder(),DraftFolder:e.draftFolder(),SpamFolder:e.spamFolder(),TrashFolder:e.trashFolder(),ArchiveFolder:e.archiveFolder(),NullFolder:"NullFolder"})},1e3),s=function(){l.settingsSet("SentFolder",e.sentFolder()),l.settingsSet("DraftFolder",e.draftFolder()),l.settingsSet("SpamFolder",e.spamFolder()),l.settingsSet("TrashFolder",e.trashFolder()),l.settingsSet("ArchiveFolder",e.archiveFolder()),t()},this.sentFolder.subscribe(s),this.draftFolder.subscribe(s),this.spamFolder.subscribe(s),this.trashFolder.subscribe(s),this.archiveFolder.subscribe(s),this.defautOptionsAfterRender=a.defautOptionsAfterRender,d.constructorEnd(this)}var i=s(2),o=s(3),n=s(4),r=s(15),a=s(1),l=s(8),c=s(9),u=s(14),d=s(5),h=s(10);d.extendAsViewModel(["View/Popup/FolderSystem","PopupsFolderSystemViewModel"],t),i.extend(t.prototype,h.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=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case n.SetSystemFoldersNotification.Draft:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case n.SetSystemFoldersNotification.Spam:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case n.SetSystemFoldersNotification.Trash:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case n.SetSystemFoldersNotification.Archive:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},e.exports=t}()},function(e,t,s){!function(){"use strict";function t(){l.call(this,"Popups","PopupsLanguages"),this.Data=r.__APP__.data(),this.exp=o.observable(!1),this.languages=o.computed(function(){return i.map(this.Data.languages(),function(e){return{key:e,selected:o.observable(!1),fullName:n.convertLangName(e)}})},this),this.Data.mainLanguage.subscribe(function(){this.resetMainLanguage()},this),a.constructorEnd(this)}var i=s(2),o=s(3),n=s(1),r=s(7),a=s(5),l=s(10);a.extendAsViewModel(["View/Popup/Languages","PopupsLanguagesViewModel"],t),i.extend(t.prototype,l.prototype),t.prototype.languageEnName=function(e){var t=n.convertLangName(e,!0);return"English"===t?"":t},t.prototype.resetMainLanguage=function(){var e=this.Data.mainLanguage();i.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.Data.mainLanguage(e),this.cancelCommand()},e.exports=t}()},function(e,t,s){!function(){"use strict";function t(e){d.call(this),this.isLocalAutocomplete=!0,this.iframe=n('').appendTo("body"),r.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===a.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(a.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,i.location&&i.location.toString?i.location.toString():"",r.$html.attr("class"),a.microtime()-r.now)}),r.$doc.on("keydown",function(e){e&&e.ctrlKey&&r.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&r.$html.removeClass("rl-ctrl-key-pressed")})}var i=s(12),o=s(2),n=s(13),r=s(7),a=s(1),l=s(11),c=s(25),u=s(8),d=s(46);o.extend(t.prototype,d.prototype),t.prototype.remote=function(){return null},t.prototype.data=function(){return null},t.prototype.download=function(e){var t=null,s=null,o=i.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(s=i.document.createElement("a"),s.href=e,i.document.createEvent&&(t=i.document.createEvent("MouseEvents"),t&&t.initEvent&&s.dispatchEvent))?(t.initEvent("click",!0,!0),s.dispatchEvent(t),!0):(r.bMobileDevice?(i.open(e,"_self"),i.focus()):this.iframe.attr("src",e),!0)},t.prototype.googlePreviewSupportedCache=null,t.prototype.googlePreviewSupported=function(){return null===this.googlePreviewSupportedCache&&(this.googlePreviewSupportedCache=!!u.settingsGet("AllowGoogleSocial")&&!!u.settingsGet("AllowGoogleSocialPreview")),this.googlePreviewSupportedCache},t.prototype.setTitle=function(e){e=(a.isNormal(e)&&0'+this.editor.getData()+" ":this.editor.getData():""},t.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},t.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},t.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},t.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,s=r.settingsGet("Language"),o=!!r.settingsGet("AllowHtmlEditorSourceButton"),a=!!r.settingsGet("AllowHtmlEditorBitiButtons");!o&&a||t.toolbarGroups.__SourceInited||(t.toolbarGroups.__SourceInited=!0,o&&(t.removeButtons=t.removeButtons.replace(",Source","")),a?t.removeButtons=t.removeButtons.replace(",bidi",""):t.removePlugins+=(t.removePlugins?",":"")+"bidi"),t.enterMode=i.CKEDITOR.ENTER_BR,t.shiftEnterMode=i.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[s]||"en",i.CKEDITOR.env&&(i.CKEDITOR.env.isCompatible=!0),e.editor=i.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(i.CKEDITOR.CTRL+65,"selectAll"),e.editor.editable().addClass("cke_enable_context_menu"),e.fOnReady(),e.__resizable=!0,e.resize()})};i.CKEDITOR?t():i.__initEditor=t}},t.prototype.focus=function(){this.editor&&this.editor.focus()},t.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},t.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},t.prototype.clear=function(e){this.setHtml("",e)},e.exports=t}()},function(e){!function(){"use strict";e.exports={eml:"message/rfc822",mime:"message/rfc822",txt:"text/plain",text:"text/plain",def:"text/plain",list:"text/plain","in":"text/plain",ini:"text/plain",log:"text/plain",sql:"text/plain",cfg:"text/plain",conf:"text/plain",asc:"text/plain",rtx:"text/richtext",vcard:"text/vcard",vcf:"text/vcard",htm:"text/html",html:"text/html",csv:"text/csv",ics:"text/calendar",ifb:"text/calendar",xml:"text/xml",json:"application/json",swf:"application/x-shockwave-flash",hlp:"application/winhlp",wgt:"application/widget",chm:"application/vnd.ms-htmlhelp",p10:"application/pkcs10",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",torrent:"application/x-bittorrent",js:"application/javascript",pl:"text/perl",css:"text/css",asp:"text/asp",php:"application/x-httpd-php",php3:"application/x-httpd-php",php4:"application/x-httpd-php",php5:"application/x-httpd-php",phtml:"application/x-httpd-php",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",jfif:"image/jpeg",gif:"image/gif",bmp:"image/bmp",cgm:"image/cgm",ief:"image/ief",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",svgz:"image/svg+xml",djv:"image/vnd.djvu",djvu:"image/vnd.djvu",webp:"image/webp",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",exe:"application/x-msdownload",dll:"application/x-msdownload",scr:"application/x-msdownload",com:"application/x-msdownload",bat:"application/x-msdownload",msi:"application/x-msdownload",cab:"application/vnd.ms-cab-compressed",gz:"application/x-gzip",tgz:"application/x-gzip",bz:"application/x-bzip",bz2:"application/x-bzip2",deb:"application/x-debian-package",psf:"application/x-font-linux-psf",otf:"application/x-font-otf",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",mp3:"audio/mpeg",amr:"audio/amr",aac:"audio/x-aac",aif:"audio/x-aiff",aifc:"audio/x-aiff",aiff:"audio/x-aiff",wav:"audio/x-wav",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",midi:"audio/midi",mp4a:"audio/mp4",ogg:"audio/ogg",weba:"audio/webm",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",m3u:"audio/x-mpegurl",flv:"video/x-flv",qt:"video/quicktime",mov:"video/quicktime",wmv:"video/windows-media",avi:"video/x-msvideo",mpg:"video/mpeg",mpeg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpgv",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",ogv:"video/ogg",webm:"video/webm",m4v:"video/x-m4v",asf:"video/x-ms-asf",asx:"video/x-ms-asf",wm:"video/x-ms-wm",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",movie:"video/x-sgi-movie",pdf:"application/pdf",psd:"image/vnd.adobe.photoshop",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",doc:"application/msword",dot:"application/msword",rtf:"application/rtf",xls:"application/vnd.ms-excel",ppt:"application/vnd.ms-powerpoint",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",odt:"application/vnd.oasis.opendocument.text",ods:"application/vnd.oasis.opendocument.spreadsheet"}}()},function(e,t,s){!function(){"use strict";function t(e){if(r.call(this),this.values=o.observableArray([]),this.value=e.value,(n.isUnd(this.value)||!this.value.subscribe)&&(this.value=o.observable("")),this.inline=n.isUnd(e.inline)?!1:e.inline,this.readOnly=n.isUnd(e.readOnly)?!1:!!e.readOnly,e.values){var t=i.map(e.values,function(e,t){return{label:e,value:t}
-});this.values(t)}this.click=i.bind(this.click,this)}var i=s(2),o=s(3),n=s(1),r=s(26);t.prototype.click=function(e){!this.readOnly&&e&&this.value(e.value)},i.extend(t.prototype,r.prototype),t.componentExportHelper=r.componentExportHelper,e.exports=t}()},function(e,t,s){!function(){"use strict";function t(e){o.call(this,e)}var i=s(2),o=s(30);i.extend(t.prototype,o.prototype),e.exports=o.componentExportHelper(t,"CheckboxComponent")}()},function(e,t,s){!function(){"use strict";function t(e){o.call(this,e)}var i=s(2),o=s(27);i.extend(t.prototype,o.prototype),e.exports=o.componentExportHelper(t,"InputComponent")}()},function(e,t,s){!function(){"use strict";function t(e){n.call(this,e),this.animationBox=o.observable(!1).extend({falseTimeout:200}),this.animationCheckmark=o.observable(!1).extend({falseTimeout:200}),this.animationBoxSetTrue=i.bind(this.animationBoxSetTrue,this),this.animationCheckmarkSetTrue=i.bind(this.animationCheckmarkSetTrue,this),this.disposable.push(this.value.subscribe(function(e){this.triggerAnimation(e)},this))}var i=s(2),o=s(3),n=s(30);i.extend(t.prototype,n.prototype),t.prototype.animationBoxSetTrue=function(){this.animationBox(!0)},t.prototype.animationCheckmarkSetTrue=function(){this.animationCheckmark(!0)},t.prototype.triggerAnimation=function(e){e?(this.animationBoxSetTrue(),i.delay(this.animationCheckmarkSetTrue,200)):(this.animationCheckmarkSetTrue(),i.delay(this.animationBoxSetTrue,200))},e.exports=n.componentExportHelper(t,"CheckboxMaterialDesignComponent")}()},function(e,t,s){!function(){"use strict";function t(e){o.call(this,e)}var i=s(2),o=s(38);i.extend(t.prototype,o.prototype),e.exports=o.componentExportHelper(t,"RadioComponent")}()},function(e,t,s){!function(){"use strict";function t(e){r.call(this),this.element=e.element||null,this.value=e.value&&e.value.subscribe?e.value:null,this.element&&(this.value?(this.element.css("display","inline-block"),e.verticalAlign&&this.element.css("vertical-align",e.verticalAlign),this.setState(this.value()),this.disposable.push(this.value.subscribe(this.setState,this))):this.element.hide())}var i=s(2),o=s(4),n=s(1),r=s(26);t.prototype.setState=function(e){switch(n.pInt(e)){case o.SaveSettingsStep.TrueResult:this.element.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case o.SaveSettingsStep.FalseResult:this.element.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case o.SaveSettingsStep.Animate:this.element.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:case o.SaveSettingsStep.Idle:this.element.find(".animated").hide().end().find(".error,.success").removeClass("visible")}},i.extend(t.prototype,r.prototype),e.exports=r.componentExportHelper(t,"SaveTriggerComponent")}()},function(e,t,s){!function(){"use strict";function t(e){n.call(this,e),this.options=e.options||"",this.optionsText=e.optionsText||null,this.optionsValue=e.optionsValue||null,this.defautOptionsAfterRender=o.defautOptionsAfterRender}var i=s(2),o=s(1),n=s(27);i.extend(t.prototype,n.prototype),e.exports=n.componentExportHelper(t,"SelectComponent")}()},function(e,t,s){!function(){"use strict";function t(e){n.call(this,e),this.rows=e.rows||5,this.spellcheck=o.isUnd(e.spellcheck)?!1:!!e.spellcheck}var i=s(2),o=s(1),n=s(27);i.extend(t.prototype,n.prototype),e.exports=n.componentExportHelper(t,"TextAreaComponent")}()},function(e){!function(){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}()},function(e,t,s){!function(){"use strict";function t(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null,this.setupSettings()}var i=s(2),o=s(13),n=s(3),r=s(7),a=s(1),l=s(11),c=s(5),u=s(28);i.extend(t.prototype,u.prototype),t.prototype.setupSettings=function(e){e&&e()},t.prototype.onRoute=function(e){var t=this,s=null,u=null,d=null,h=null;u=i.find(r.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(i.find(r.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&i.find(r.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?s=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(s=new u,h=o("