diff --git a/dev/ViewModels/PopupsComposeViewModel.js b/dev/ViewModels/PopupsComposeViewModel.js index e907d6542a..31f474f921 100644 --- a/dev/ViewModels/PopupsComposeViewModel.js +++ b/dev/ViewModels/PopupsComposeViewModel.js @@ -53,6 +53,7 @@ function PopupsComposeViewModel() this.savedOrSendingText = ko.observable(''); this.emptyToError = ko.observable(false); + this.attachmentsInProcessError = ko.observable(false); this.showCcAndBcc = ko.observable(false); this.cc.subscribe(fCcAndBccCheckHelper, this); @@ -160,6 +161,13 @@ function PopupsComposeViewModel() this.emptyToError(false); } }, this); + + this.attachmentsInProcess.subscribe(function (aValue) { + if (this.attachmentsInProcessError() && Utils.isArray(aValue) && 0 === aValue.length) + { + this.attachmentsInProcessError(false); + } + }, this); this.editorResizeThrottle = _.throttle(_.bind(this.editorResize, this), 100); @@ -167,14 +175,6 @@ function PopupsComposeViewModel() this.editorResizeThrottle(); }, this); - this.canBeSended = ko.computed(function () { - return !this.sending() && - !this.saving() && - 0 === this.attachmentsInProcess().length && - 0 < this.to().length - ; - }, this); - this.canBeSendedOrSaved = ko.computed(function () { return !this.sending() && !this.saving(); }, this); @@ -198,7 +198,11 @@ function PopupsComposeViewModel() aFlagsCache = [] ; - if (0 === sTo.length) + if (0 < this.attachmentsInProcess().length) + { + this.attachmentsInProcessError(true); + } + else if (0 === sTo.length) { this.emptyToError(true); } @@ -1463,6 +1467,7 @@ PopupsComposeViewModel.prototype.reset = function () this.savedTime(0); this.savedOrSendingText(''); this.emptyToError(false); + this.attachmentsInProcessError(false); this.showCcAndBcc(false); this.attachments([]); diff --git a/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html b/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html index dfe61a85dd..93a53f55b3 100644 --- a/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html +++ b/rainloop/v/0.0.0/app/templates/Views/App/PopupsCompose.html @@ -101,6 +101,9 @@
+ + +
diff --git a/rainloop/v/0.0.0/langs/de.ini b/rainloop/v/0.0.0/langs/de.ini index 634d3579fc..c7ff490079 100644 --- a/rainloop/v/0.0.0/langs/de.ini +++ b/rainloop/v/0.0.0/langs/de.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Gesendet" FORWARD_MESSAGE_TOP_SUBJECT = "Betreff" EMPTY_TO_ERROR_DESC = "Geben Sie bitte mindestens einen Empfänger an" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Empfangsbestätigung anfordern" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/en.ini b/rainloop/v/0.0.0/langs/en.ini index 315a2e8b55..1d783309bd 100644 --- a/rainloop/v/0.0.0/langs/en.ini +++ b/rainloop/v/0.0.0/langs/en.ini @@ -219,6 +219,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Sent" FORWARD_MESSAGE_TOP_SUBJECT = "Subject" EMPTY_TO_ERROR_DESC = "Please specify at least one recipient" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/es.ini b/rainloop/v/0.0.0/langs/es.ini index 56cecfe3f7..ff47b53ace 100644 --- a/rainloop/v/0.0.0/langs/es.ini +++ b/rainloop/v/0.0.0/langs/es.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Enviado" FORWARD_MESSAGE_TOP_SUBJECT = "Asunto" EMPTY_TO_ERROR_DESC = "Por favor especifique al menos un destinatario" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Solicitar confirmación de lectura" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/fr.ini b/rainloop/v/0.0.0/langs/fr.ini index 6e94a9254c..0066837396 100644 --- a/rainloop/v/0.0.0/langs/fr.ini +++ b/rainloop/v/0.0.0/langs/fr.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Envoyé" FORWARD_MESSAGE_TOP_SUBJECT = "Sujet" EMPTY_TO_ERROR_DESC = "Merci de spécifier au minimum un destinataire" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Demander une confirmation de lecture" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/hu.ini b/rainloop/v/0.0.0/langs/hu.ini index 1c61a959c8..093663682a 100644 --- a/rainloop/v/0.0.0/langs/hu.ini +++ b/rainloop/v/0.0.0/langs/hu.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Küldő" FORWARD_MESSAGE_TOP_SUBJECT = "Tárgy" EMPTY_TO_ERROR_DESC = "Please specify at least one recipient" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/is.ini b/rainloop/v/0.0.0/langs/is.ini index 55183e4f2d..e39cdf04dc 100644 --- a/rainloop/v/0.0.0/langs/is.ini +++ b/rainloop/v/0.0.0/langs/is.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Sent" FORWARD_MESSAGE_TOP_SUBJECT = "Viðfangsefni" EMPTY_TO_ERROR_DESC = "Vinsamlegast taktu fram að minnsta kosti einn viðtakanda" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/it.ini b/rainloop/v/0.0.0/langs/it.ini index 9943cddc6d..4a9842ea45 100644 --- a/rainloop/v/0.0.0/langs/it.ini +++ b/rainloop/v/0.0.0/langs/it.ini @@ -219,6 +219,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Inviato il" FORWARD_MESSAGE_TOP_SUBJECT = "Oggetto" EMPTY_TO_ERROR_DESC = "Specifica almeno un destinatario" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Richiedi conferma di lettura" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/ja-jp.ini b/rainloop/v/0.0.0/langs/ja-jp.ini index b260175d2c..3dc2676e42 100644 --- a/rainloop/v/0.0.0/langs/ja-jp.ini +++ b/rainloop/v/0.0.0/langs/ja-jp.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Sent" FORWARD_MESSAGE_TOP_SUBJECT = "Subject" EMPTY_TO_ERROR_DESC = "Please specify at least one recipient" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "開封確認を要求しますか?" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/ko-kr.ini b/rainloop/v/0.0.0/langs/ko-kr.ini index 8629e9be31..a4307a41e0 100644 --- a/rainloop/v/0.0.0/langs/ko-kr.ini +++ b/rainloop/v/0.0.0/langs/ko-kr.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "참조" FORWARD_MESSAGE_TOP_SENT = "보냄" FORWARD_MESSAGE_TOP_SUBJECT = "제목" EMPTY_TO_ERROR_DESC = "수신인을 한 명 이상 선택하세요" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/lv.ini b/rainloop/v/0.0.0/langs/lv.ini index b2e52cc813..8ac456444c 100644 --- a/rainloop/v/0.0.0/langs/lv.ini +++ b/rainloop/v/0.0.0/langs/lv.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Nosūtīts" FORWARD_MESSAGE_TOP_SUBJECT = "Tēma" EMPTY_TO_ERROR_DESC = "Pievienojat vismaz vienu saņēmēju" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/nl.ini b/rainloop/v/0.0.0/langs/nl.ini index 49d39c1f54..e0a825b9b7 100644 --- a/rainloop/v/0.0.0/langs/nl.ini +++ b/rainloop/v/0.0.0/langs/nl.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Verzonden" FORWARD_MESSAGE_TOP_SUBJECT = "Onderwerp" EMPTY_TO_ERROR_DESC = "Gelieve minstens 1 ontvanger aan te duiden" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/no.ini b/rainloop/v/0.0.0/langs/no.ini index 295cb941b1..f5dc05a9de 100644 --- a/rainloop/v/0.0.0/langs/no.ini +++ b/rainloop/v/0.0.0/langs/no.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Sendt" FORWARD_MESSAGE_TOP_SUBJECT = "Emne" EMPTY_TO_ERROR_DESC = "Vennligst oppgi minst én mottaker" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/pl.ini b/rainloop/v/0.0.0/langs/pl.ini index 736164163d..082dba05a5 100644 --- a/rainloop/v/0.0.0/langs/pl.ini +++ b/rainloop/v/0.0.0/langs/pl.ini @@ -217,6 +217,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Wysłany" FORWARD_MESSAGE_TOP_SUBJECT = "Temat" EMPTY_TO_ERROR_DESC = "Wprowadź co najmniej jednego odbiorcę" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Żądaj potwierdzenia odbioru" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/pt-br.ini b/rainloop/v/0.0.0/langs/pt-br.ini index 0a0966d87e..b6ef08639e 100644 --- a/rainloop/v/0.0.0/langs/pt-br.ini +++ b/rainloop/v/0.0.0/langs/pt-br.ini @@ -219,6 +219,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Enviar" FORWARD_MESSAGE_TOP_SUBJECT = "Assunto" EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Pedir um recibo de leitura" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/pt-pt.ini b/rainloop/v/0.0.0/langs/pt-pt.ini index e238d8298b..433c0ca873 100644 --- a/rainloop/v/0.0.0/langs/pt-pt.ini +++ b/rainloop/v/0.0.0/langs/pt-pt.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "CC" FORWARD_MESSAGE_TOP_SENT = "Enviar" FORWARD_MESSAGE_TOP_SUBJECT = "Assunto" EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Pedir um recibo de leitura" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/ro.ini b/rainloop/v/0.0.0/langs/ro.ini index dd8b116c25..b647a7d824 100644 --- a/rainloop/v/0.0.0/langs/ro.ini +++ b/rainloop/v/0.0.0/langs/ro.ini @@ -217,6 +217,7 @@ FORWARD_MESSAGE_TOP_CC = "Copie" FORWARD_MESSAGE_TOP_SENT = "Primit la" FORWARD_MESSAGE_TOP_SUBJECT = "Subiect" EMPTY_TO_ERROR_DESC = "Vă rugăm să specificați cel puțin un destinatar" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Cere confirmare de citire" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/ru.ini b/rainloop/v/0.0.0/langs/ru.ini index 4ded65445b..0e5b8a3564 100644 --- a/rainloop/v/0.0.0/langs/ru.ini +++ b/rainloop/v/0.0.0/langs/ru.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "Копия" FORWARD_MESSAGE_TOP_SENT = "Отправлено" FORWARD_MESSAGE_TOP_SUBJECT = "Тема" EMPTY_TO_ERROR_DESC = "Укажите как минимум одного получателя" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Запрос о прочтении письма" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/sk.ini b/rainloop/v/0.0.0/langs/sk.ini index cc4af0cf0d..60e56bf5af 100644 --- a/rainloop/v/0.0.0/langs/sk.ini +++ b/rainloop/v/0.0.0/langs/sk.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "Kópia" FORWARD_MESSAGE_TOP_SENT = "Odoslať" FORWARD_MESSAGE_TOP_SUBJECT = "Predmet" EMPTY_TO_ERROR_DESC = "Zadajte prosím aspoň jedného príjemcu" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Vyžiadať potvrdenie o prečítaní" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/ua.ini b/rainloop/v/0.0.0/langs/ua.ini index 70606756d8..e26f18aa42 100644 --- a/rainloop/v/0.0.0/langs/ua.ini +++ b/rainloop/v/0.0.0/langs/ua.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "Копія" FORWARD_MESSAGE_TOP_SENT = "Надіслано" FORWARD_MESSAGE_TOP_SUBJECT = "Тема" EMPTY_TO_ERROR_DESC = "Вкажіть як мінімум одного отримувача" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Запит про прочитання листа" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/langs/zh-cn.ini b/rainloop/v/0.0.0/langs/zh-cn.ini index ed54d71dd0..d32252f147 100644 --- a/rainloop/v/0.0.0/langs/zh-cn.ini +++ b/rainloop/v/0.0.0/langs/zh-cn.ini @@ -218,6 +218,7 @@ FORWARD_MESSAGE_TOP_CC = "抄送" FORWARD_MESSAGE_TOP_SENT = "发送" FORWARD_MESSAGE_TOP_SUBJECT = "主题" EMPTY_TO_ERROR_DESC = "请至少选择一位接收人" +ATTACHMENTS_UPLOAD_ERROR_DESC = "Not all attachments have been uploaded yet" BUTTON_REQUEST_READ_RECEIPT = "Request a read receipt" [POPUPS_ASK] diff --git a/rainloop/v/0.0.0/static/css/app.css b/rainloop/v/0.0.0/static/css/app.css index 9d0796bc48..e693bef81e 100644 --- a/rainloop/v/0.0.0/static/css/app.css +++ b/rainloop/v/0.0.0/static/css/app.css @@ -637,7 +637,7 @@ border-radius: 8px; } - + /*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ /* ============================================================================= @@ -1142,7 +1142,7 @@ table { border-collapse: collapse; border-spacing: 0; } - + @charset "UTF-8"; @font-face { @@ -1513,7 +1513,7 @@ table { .icon-resize-out:before { content: "\e06d"; } - + /** initial setup **/ .nano { /* @@ -1630,7 +1630,7 @@ table { .nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 { background-color: rgba(0, 0, 0, 0.4); } - + /* Magnific Popup CSS */ .mfp-bg { top: 0; @@ -1995,7 +1995,7 @@ img.mfp-img { right: 0; padding-top: 0; } - + /* overlay at start */ .mfp-fade.mfp-bg { @@ -2041,7 +2041,7 @@ img.mfp-img { -moz-transform: translateX(50px); transform: translateX(50px); } - + .simple-pace { -webkit-pointer-events: none; pointer-events: none; @@ -2112,7 +2112,7 @@ img.mfp-img { @keyframes simple-pace-stripe-animation { 0% { transform: none; transform: none; } 100% { transform: translate(-32px, 0); transform: translate(-32px, 0); } -} +} .inputosaurus-container { background-color:#fff; border:1px solid #bcbec0; @@ -2180,7 +2180,7 @@ img.mfp-img { box-shadow:none; } .inputosaurus-input-hidden { display:none; } - + .flag-wrapper { width: 24px; height: 16px; @@ -2226,7 +2226,7 @@ img.mfp-img { .flag.flag-pt-br {background-position: -192px -11px} .flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px} - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ .clearfix { *zoom: 1; diff --git a/rainloop/v/0.0.0/static/js/admin.js b/rainloop/v/0.0.0/static/js/admin.js index 22fd8cd4b7..2a75d01d17 100644 --- a/rainloop/v/0.0.0/static/js/admin.js +++ b/rainloop/v/0.0.0/static/js/admin.js @@ -78,7 +78,7 @@ var NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null ; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /*jshint onevar: false*/ @@ -87,7 +87,7 @@ var */ var RL = null; /*jshint onevar: true*/ - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -244,7 +244,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes) return oType && 'application/pdf' === oType.type; }); } - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ Consts.Defaults = {}; @@ -364,7 +364,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA * @type {string} */ Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -795,7 +795,7 @@ Enums.Notification = { 'UnknownNotification': 999, 'UnknownError': 999 }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ Utils.trim = $.trim; @@ -2552,7 +2552,7 @@ Utils.detectDropdownVisibility = _.debounce(function () { return oItem.hasClass('open'); })); }, 50); - + /*jslint bitwise: true*/ // Base64 encode / decode // http://www.webtoolkit.info/ @@ -2716,7 +2716,7 @@ Base64 = { } }; -/*jslint bitwise: false*/ +/*jslint bitwise: false*/ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ ko.bindingHandlers.tooltip = { @@ -3559,7 +3559,7 @@ ko.observable.fn.validateFunc = function (fFunc) return this; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -3865,7 +3865,7 @@ LinkBuilder.prototype.socialFacebook = function () { return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -3961,7 +3961,7 @@ Plugins.settingsGet = function (sPluginSection, sName) }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4037,7 +4037,7 @@ CookieDriver.prototype.get = function (sKey) return mResult; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4110,7 +4110,7 @@ LocalStorageDriver.prototype.get = function (sKey) return mResult; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4155,7 +4155,7 @@ LocalStorage.prototype.get = function (iKey) { return this.oDriver ? this.oDriver.get('p' + iKey) : null; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4170,7 +4170,7 @@ KnoinAbstractBoot.prototype.bootstart = function () { }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4265,7 +4265,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function () return true; }); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4343,7 +4343,7 @@ KnoinAbstractScreen.prototype.__start = function () this.oCross = oRoute; } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4759,7 +4759,7 @@ Knoin.prototype.bootstart = function () }; kn = new Knoin(); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5125,7 +5125,7 @@ EmailModel.prototype.inputoTagLine = function () { return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5171,7 +5171,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml) return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ? Utils.encodeHtml(this.name()) : this.name(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5468,7 +5468,7 @@ PopupsDomainViewModel.prototype.clearForm = function () this.smtpAuth(true); this.whiteList(''); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5612,7 +5612,7 @@ PopupsPluginViewModel.prototype.onBuild = function () return false; }, this)); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5730,7 +5730,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function () { var sValue = this.key(); return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue)); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5792,7 +5792,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) RL.data().mainLanguage(sLang); this.cancelCommand(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5905,7 +5905,7 @@ PopupsAskViewModel.prototype.onBuild = function () }, this)); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5994,7 +5994,7 @@ AdminLoginViewModel.prototype.onHide = function () { this.loginFocus(false); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6020,7 +6020,7 @@ AdminMenuViewModel.prototype.link = function (sRoute) { return '#/' + sRoute; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6046,7 +6046,7 @@ AdminPaneViewModel.prototype.logoutClick = function () RL.remote().adminLogout(function () { RL.loginAndLogoutReload(); }); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6174,7 +6174,7 @@ AdminGeneral.prototype.phpInfoLink = function () return RL.link().phpInfo(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6221,7 +6221,7 @@ AdminLogin.prototype.onBuild = function () }, 50); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6292,7 +6292,7 @@ AdminBranding.prototype.onBuild = function () }, 50); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6514,7 +6514,7 @@ AdminContacts.prototype.onBuild = function () }, 50); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6605,7 +6605,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function () { RL.reloadDomainList(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6720,7 +6720,7 @@ AdminSecurity.prototype.phpInfoLink = function () { return RL.link().phpInfo(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6848,7 +6848,7 @@ AdminSocial.prototype.onBuild = function () }, 50); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6947,7 +6947,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData) RL.reloadPluginList(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7047,7 +7047,7 @@ AdminPackages.prototype.installPackage = function (oPackage) RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7104,7 +7104,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function () ; return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')'); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7181,7 +7181,7 @@ AdminAbout.prototype.updateCoreData = function () RL.updateCoreData(); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7314,7 +7314,7 @@ AbstractData.prototype.populateDataOnStart = function() this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7367,7 +7367,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype); AdminDataStorage.prototype.populateDataOnStart = function() { AbstractData.prototype.populateDataOnStart.call(this); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7643,7 +7643,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion) 'Version': sVersion }); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7906,7 +7906,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback) { this.defaultRequest(fCallback, 'AdminPing'); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7967,7 +7967,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData) { this.oServices = oData; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7980,7 +7980,7 @@ function AdminCacheStorage() } _.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8162,7 +8162,7 @@ AbstractSettings.prototype.routes = function () ['', oRules] ]; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8179,7 +8179,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype); AdminLoginScreen.prototype.onShow = function () { RL.setTitle(''); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8199,7 +8199,7 @@ _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype); AdminSettingsScreen.prototype.onShow = function () { RL.setTitle(''); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8559,7 +8559,7 @@ AbstractApp.prototype.bootstart = function () ssm.ready(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8862,7 +8862,7 @@ AdminApp.prototype.bootstart = function () * @type {AdminApp} */ RL = new AdminApp(); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ $html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); @@ -8915,7 +8915,7 @@ window['__RLBOOT'] = function (fCall) { window['__RLBOOT'] = null; }); }; - + if (window.SimplePace) { window.SimplePace.add(10); } diff --git a/rainloop/v/0.0.0/static/js/app.js b/rainloop/v/0.0.0/static/js/app.js index 635e265c0c..d6e1d00dbd 100644 --- a/rainloop/v/0.0.0/static/js/app.js +++ b/rainloop/v/0.0.0/static/js/app.js @@ -78,7 +78,7 @@ var NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null ; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /*jshint onevar: false*/ @@ -90,7 +90,7 @@ var $proxyDiv = $('
') ; -/*jshint onevar: true*/ +/*jshint onevar: true*/ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -247,7 +247,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes) return oType && 'application/pdf' === oType.type; }); } - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ Consts.Defaults = {}; @@ -367,7 +367,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA * @type {string} */ Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII='; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -798,7 +798,7 @@ Enums.Notification = { 'UnknownNotification': 999, 'UnknownError': 999 }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ Utils.trim = $.trim; @@ -2555,7 +2555,7 @@ Utils.detectDropdownVisibility = _.debounce(function () { return oItem.hasClass('open'); })); }, 50); - + /*jslint bitwise: true*/ // Base64 encode / decode // http://www.webtoolkit.info/ @@ -2719,7 +2719,7 @@ Base64 = { } }; -/*jslint bitwise: false*/ +/*jslint bitwise: false*/ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ ko.bindingHandlers.tooltip = { @@ -3562,7 +3562,7 @@ ko.observable.fn.validateFunc = function (fFunc) return this; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -3868,7 +3868,7 @@ LinkBuilder.prototype.socialFacebook = function () { return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : ''); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -3964,7 +3964,7 @@ Plugins.settingsGet = function (sPluginSection, sName) }; - + /** * @constructor @@ -4203,7 +4203,7 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus) this.setHtml('', bFocus); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4916,7 +4916,7 @@ Selector.prototype.on = function (sEventName, fCallback) { this.oCallbacks[sEventName] = fCallback; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -4992,7 +4992,7 @@ CookieDriver.prototype.get = function (sKey) return mResult; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5065,7 +5065,7 @@ LocalStorageDriver.prototype.get = function (sKey) return mResult; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5110,7 +5110,7 @@ LocalStorage.prototype.get = function (iKey) { return this.oDriver ? this.oDriver.get('p' + iKey) : null; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5125,7 +5125,7 @@ KnoinAbstractBoot.prototype.bootstart = function () { }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5220,7 +5220,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function () return true; }); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5298,7 +5298,7 @@ KnoinAbstractScreen.prototype.__start = function () this.oCross = oRoute; } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -5714,7 +5714,7 @@ Knoin.prototype.bootstart = function () }; kn = new Knoin(); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6080,7 +6080,7 @@ EmailModel.prototype.inputoTagLine = function () { return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6206,7 +6206,7 @@ ContactModel.prototype.lineAsCcc = function () return aResult.join(' '); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6237,7 +6237,7 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder) }, this); } - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6283,7 +6283,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml) return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ? Utils.encodeHtml(this.name()) : this.name(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6521,7 +6521,7 @@ AttachmentModel.prototype.iconClass = function () return sClass; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -6584,7 +6584,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment) } return bResult; -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -7797,7 +7797,7 @@ MessageModel.prototype.flagHash = function () return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(), this.isReadReceipt()].join(''); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8131,7 +8131,7 @@ FolderModel.prototype.printableFullName = function () { return this.fullName.split(this.delimiter).join(' / '); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8154,7 +8154,7 @@ AccountModel.prototype.email = ''; AccountModel.prototype.changeAccountLink = function () { return RL.link().change(this.email); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8192,7 +8192,7 @@ IdentityModel.prototype.formattedNameForEmail = function () var sName = this.name(); return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>'; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8242,7 +8242,7 @@ FilterActionModel.prototype.removeSelf = function () { this.parentList.remove(this); } -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8293,7 +8293,7 @@ FilterConditionModel.prototype.removeSelf = function () this.parentList.remove(this); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8349,7 +8349,7 @@ FilterModel.prototype.parse = function (oItem) return bResult; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8382,7 +8382,7 @@ OpenPgpKeyModel.prototype.user = ''; OpenPgpKeyModel.prototype.email = ''; OpenPgpKeyModel.prototype.armor = ''; OpenPgpKeyModel.prototype.isPrivate = false; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8480,7 +8480,7 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder) this.selectedFolder(oFolder); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8592,7 +8592,7 @@ PopupsFolderCreateViewModel.prototype.onFocus = function () { this.folderName.focused(true); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8707,7 +8707,7 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType) this.notification(sNotification); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -8763,6 +8763,7 @@ function PopupsComposeViewModel() this.savedOrSendingText = ko.observable(''); this.emptyToError = ko.observable(false); + this.attachmentsInProcessError = ko.observable(false); this.showCcAndBcc = ko.observable(false); this.cc.subscribe(fCcAndBccCheckHelper, this); @@ -8870,6 +8871,13 @@ function PopupsComposeViewModel() this.emptyToError(false); } }, this); + + this.attachmentsInProcess.subscribe(function (aValue) { + if (this.attachmentsInProcessError() && Utils.isArray(aValue) && 0 === aValue.length) + { + this.attachmentsInProcessError(false); + } + }, this); this.editorResizeThrottle = _.throttle(_.bind(this.editorResize, this), 100); @@ -8877,14 +8885,6 @@ function PopupsComposeViewModel() this.editorResizeThrottle(); }, this); - this.canBeSended = ko.computed(function () { - return !this.sending() && - !this.saving() && - 0 === this.attachmentsInProcess().length && - 0 < this.to().length - ; - }, this); - this.canBeSendedOrSaved = ko.computed(function () { return !this.sending() && !this.saving(); }, this); @@ -8908,7 +8908,11 @@ function PopupsComposeViewModel() aFlagsCache = [] ; - if (0 === sTo.length) + if (0 < this.attachmentsInProcess().length) + { + this.attachmentsInProcessError(true); + } + else if (0 === sTo.length) { this.emptyToError(true); } @@ -10173,6 +10177,7 @@ PopupsComposeViewModel.prototype.reset = function () this.savedTime(0); this.savedOrSendingText(''); this.emptyToError(false); + this.attachmentsInProcessError(false); this.showCcAndBcc(false); this.attachments([]); @@ -10209,7 +10214,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function () this.editorResizeThrottle(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -10953,7 +10958,7 @@ PopupsContactsViewModel.prototype.onHide = function () // oItem.checked(false); // }); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11091,7 +11096,7 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function () { this.fromFocus(true); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11187,7 +11192,7 @@ PopupsAddAccountViewModel.prototype.onFocus = function () { this.emailFocus(true); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11278,7 +11283,7 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function () { this.key.focus(true); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11320,7 +11325,7 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey) this.key(oOpenPgpKey.armor); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11417,7 +11422,7 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function () { this.email.focus(true); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11659,7 +11664,7 @@ PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFr this.to(aRec); this.text(sText); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11809,7 +11814,7 @@ PopupsIdentityViewModel.prototype.onFocus = function () this.email.focused(true); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11871,7 +11876,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) RL.data().mainLanguage(sLang); this.cancelCommand(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -11927,7 +11932,7 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function () { this.code.focused(true); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12040,7 +12045,7 @@ PopupsAskViewModel.prototype.onBuild = function () }, this)); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12087,7 +12092,7 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom) } }, this)); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12385,7 +12390,7 @@ LoginViewModel.prototype.selectLanguage = function () kn.showScreenPopup(PopupsLanguagesViewModel); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12483,7 +12488,7 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function () } }); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12497,7 +12502,7 @@ function MailBoxSystemDropDownViewModel() } Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12511,7 +12516,7 @@ function SettingsSystemDropDownViewModel() } Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -12761,7 +12766,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function () kn.showScreenPopup(PopupsContactsViewModel); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -13666,7 +13671,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function () ; return !!oJua; -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14360,7 +14365,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage) RL.reloadFlagsCurrentMessageListAndMessageFromCache(); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14391,7 +14396,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function () { kn.setHash(RL.link().inbox()); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14424,7 +14429,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function () { kn.setHash(RL.link().inbox()); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14586,7 +14591,7 @@ SettingsGeneral.prototype.selectLanguage = function () { kn.showScreenPopup(PopupsLanguagesViewModel); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14638,7 +14643,7 @@ SettingsContacts.prototype.onBuild = function () //{ // //}; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14721,7 +14726,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove) } } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -14811,7 +14816,7 @@ SettingsIdentity.prototype.onBuild = function () }, 50); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15030,7 +15035,7 @@ SettingsIdentities.prototype.onBuild = function (oDom) }); }, 50); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15067,7 +15072,7 @@ SettingsFilters.prototype.addFilter = function () this.filters.push(oFilter); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15219,7 +15224,7 @@ SettingsSecurity.prototype.onBuild = function () this.processing(true); RL.remote().getTwoFactor(this.onResult); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15288,7 +15293,7 @@ function SettingsSocialScreen() } Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social'); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15395,7 +15400,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword)); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15592,7 +15597,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder) oFolder.subScribed(false); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15708,7 +15713,7 @@ SettingsThemes.prototype.onBuild = function () }; })); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15778,7 +15783,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove) RL.reloadOpenPgpKeys(); } } -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -15911,7 +15916,7 @@ AbstractData.prototype.populateDataOnStart = function() this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -17167,7 +17172,7 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword) { return this.findPrivateKeyByEmail(this.accountEmail(), sPassword); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -17443,7 +17448,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion) 'Version': sVersion }); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -18230,7 +18235,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback) this.defaultRequest(fCallback, 'SocialUsers'); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -18291,7 +18296,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData) { this.oServices = oData; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -18611,7 +18616,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function this.setMessageFlagsToCache(sFolder, sUid, aFlags); } }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -18793,7 +18798,7 @@ AbstractSettings.prototype.routes = function () ['', oRules] ]; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -18810,7 +18815,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype); LoginScreen.prototype.onShow = function () { RL.setTitle(''); -}; +}; /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -18983,7 +18988,7 @@ MailBoxScreen.prototype.routes = function () [/^([^\/]*)$/, {'normalize_': fNormS}] ]; }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -19012,7 +19017,7 @@ SettingsScreen.prototype.onShow = function () RL.setTitle(this.sSettingsTitle); RL.data().keyScope(Enums.KeyState.Settings); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -19372,7 +19377,7 @@ AbstractApp.prototype.bootstart = function () ssm.ready(); }; - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ /** @@ -20669,7 +20674,7 @@ RainLoopApp.prototype.bootstart = function () * @type {RainLoopApp} */ RL = new RainLoopApp(); - + /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ $html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile'); @@ -20722,7 +20727,7 @@ window['__RLBOOT'] = function (fCall) { window['__RLBOOT'] = null; }); }; - + if (window.SimplePace) { window.SimplePace.add(10); } diff --git a/rainloop/v/0.0.0/static/js/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index cc9c0fd8a3..df686a539a 100644 --- a/rainloop/v/0.0.0/static/js/app.min.js +++ b/rainloop/v/0.0.0/static/js/app.min.js @@ -1,10 +1,10 @@ /*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ -!function(e,t,s,i,o,n,a,r,l,c){"use strict";function u(){this.sBase="#/",this.sServer="./?",this.sVersion=jt.settingsGet("Version"),this.sSpecSuffix=jt.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=jt.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}function d(e,s,i,o){var n=this;n.editor=null,n.iBlurTimer=0,n.fOnBlur=s||null,n.fOnReady=i||null,n.fOnModeChange=o||null,n.$element=t(e),n.init(),n.resize=r.throttle(r.bind(n.resize,n),100)}function h(e,t,i,o,n,a){this.list=e,this.listChecked=s.computed(function(){return r.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=s.computed(function(){return 00&&-1t?t:e))},this),this.body=null,this.plainRaw="",this.isRtl=s.observable(!1),this.isHtml=s.observable(!1),this.hasImages=s.observable(!1),this.attachments=s.observableArray([]),this.isPgpSigned=s.observable(!1),this.isPgpEncrypted=s.observable(!1),this.pgpSignedVerifyStatus=s.observable(Lt.SignedVerifyStatus.None),this.pgpSignedVerifyUser=s.observable(""),this.priority=s.observable(Lt.MessagePriority.Normal),this.readReceipt=s.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=s.observable(0),this.threads=s.observableArray([]),this.threadsLen=s.observable(0),this.hasUnseenSubMessage=s.observable(!1),this.hasFlaggedSubMessage=s.observable(!1),this.lastInCollapsedThread=s.observable(!1),this.lastInCollapsedThreadLoading=s.observable(!1),this.threadsLenResult=s.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}function N(){this.name=s.observable(""),this.fullName="",this.fullNameRaw="",this.fullNameHash="",this.delimiter="",this.namespace="",this.deep=0,this.interval=0,this.selectable=!1,this.existen=!0,this.type=s.observable(Lt.FolderType.User),this.focused=s.observable(!1),this.selected=s.observable(!1),this.edited=s.observable(!1),this.collapsed=s.observable(!0),this.subScribed=s.observable(!0),this.subFolders=s.observableArray([]),this.deleteAccess=s.observable(!1),this.actionBlink=s.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=s.observable(""),this.name.subscribe(function(e){this.nameForEdit(e)},this),this.edited.subscribe(function(e){e&&this.nameForEdit(this.name())},this),this.privateMessageCountAll=s.observable(0),this.privateMessageCountUnread=s.observable(0),this.collapsedPrivate=s.observable(!0)}function R(e,t){this.email=e,this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(t)}function I(e,t,i){this.id=e,this.email=s.observable(t),this.name=s.observable(""),this.replyTo=s.observable(""),this.bcc=s.observable(""),this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(i)}function L(e,t){this.parentList=e,this.canBeDeleted=t,this.value=s.observable(""),this.type=s.observable(Lt.FiltersAction.Move),this.typeOptions=[{id:Lt.FiltersAction.Move,name:"Move to"},{id:Lt.FiltersAction.Forward,name:"Forward to"},{id:Lt.FiltersAction.Delete,name:"Discard"},{id:Lt.FiltersAction.MarkAsRead,name:"Mark as read"}],this.template=s.computed(function(){var e="";switch(this.type()){default:case Lt.FiltersAction.Move:e="SettingsFiltersActionValueAsFolders";break;case Lt.FiltersAction.Forward:e="SettingsFiltersActionWithValue";break;case Lt.FiltersAction.MarkAsRead:case Lt.FiltersAction.Delete:e="SettingsFiltersActionNoValue"}return e},this)}function P(e,t){this.parentList=e,this.canBeDeleted=t,this.field=s.observable(Lt.FilterConditionField.Subject),this.fieldOptions=[{id:Lt.FilterConditionField.Subject,name:"Subject"},{id:Lt.FilterConditionField.Recipient,name:"Recipient (To or CC)"},{id:Lt.FilterConditionField.From,name:"From"},{id:Lt.FilterConditionField.To,name:"To"}],this.type=s.observable(Lt.FilterConditionType.Contains),this.typeOptions=[{id:Lt.FilterConditionType.Contains,name:"Contains"},{id:Lt.FilterConditionType.NotContains,name:"Not Contains"},{id:Lt.FilterConditionType.EqualTo,name:"Equal To"},{id:Lt.FilterConditionType.NotEqualTo,name:"Not Equal To"}],this.value=s.observable(""),this.template=s.computed(function(){var e="";switch(this.type()){default:e="SettingsFiltersConditionDefault"}return e},this)}function M(){this.enabled=s.observable(!0),this.name=s.observable(""),this.conditionsType=s.observable(Lt.FilterRulesType.And),this.conditions=s.observableArray([]),this.actions=s.observableArray([]),this.conditions.subscribe(function(){Mt.windowResize()}),this.actions.subscribe(function(){Mt.windowResize()}),this.conditionsCanBeDeleted=s.computed(function(){return 1=e?1:e},this),this.contactsPagenator=s.computed(Mt.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=s.observable(!0),this.viewClearSearch=s.observable(!1),this.viewID=s.observable(""),this.viewReadOnly=s.observable(!1),this.viewProperties=s.observableArray([]),this.viewTags=s.observable(""),this.viewTags.visibility=s.observable(!1),this.viewTags.focusTrigger=s.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=s.observable(Lt.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1e)break;t[0]&&t[1]&&t[2]&&t[1]===t[2]&&("PRIVATE"===t[1]?o.privateKeys.importKey(t[0]):"PUBLIC"===t[1]&&o.publicKeys.importKey(t[0])),e--}return o.store(),jt.reloadOpenPgpKeys(),Mt.delegateRun(this,"cancelCommand"),!0}),S.constructorEnd(this)}function G(){b.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=s.observable(""),this.keyDom=s.observable(null),S.constructorEnd(this)}function K(){b.call(this,"Popups","PopupsGenerateNewOpenPgpKey"),this.email=s.observable(""),this.email.focus=s.observable(""),this.email.error=s.observable(!1),this.name=s.observable(""),this.password=s.observable(""),this.keyBitLength=s.observable(2048),this.submitRequest=s.observable(!1),this.email.subscribe(function(){this.email.error(!1)},this),this.generateOpenPgpKeyCommand=Mt.createCommand(this,function(){var t=this,s="",i=null,o=jt.data().openpgpKeyring;return this.email.error(""===Mt.trim(this.email())),!o||this.email.error()?!1:(s=this.email(),""!==this.name()&&(s=this.name()+" <"+s+">"),this.submitRequest(!0),r.delay(function(){i=e.openpgp.generateKeyPair(1,Mt.pInt(t.keyBitLength()),s,Mt.trim(t.password())),i&&i.privateKeyArmored&&(o.privateKeys.importKey(i.privateKeyArmored),o.publicKeys.importKey(i.publicKeyArmored),o.store(),jt.reloadOpenPgpKeys(),Mt.delegateRun(t,"cancelCommand")),t.submitRequest(!1)},100),!0)}),S.constructorEnd(this)}function q(){b.call(this,"Popups","PopupsComposeOpenPgp"),this.notification=s.observable(""),this.sign=s.observable(!0),this.encrypt=s.observable(!0),this.password=s.observable(""),this.password.focus=s.observable(!1),this.buttonFocus=s.observable(!1),this.from=s.observable(""),this.to=s.observableArray([]),this.text=s.observable(""),this.resultCallback=null,this.submitRequest=s.observable(!1),this.doCommand=Mt.createCommand(this,function(){var t=this,s=!0,i=jt.data(),o=null,n=[]; +!function(e,t,s,i,o,n,a,r,l,c){"use strict";function u(){this.sBase="#/",this.sServer="./?",this.sVersion=jt.settingsGet("Version"),this.sSpecSuffix=jt.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=jt.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}function d(e,s,i,o){var n=this;n.editor=null,n.iBlurTimer=0,n.fOnBlur=s||null,n.fOnReady=i||null,n.fOnModeChange=o||null,n.$element=t(e),n.init(),n.resize=r.throttle(r.bind(n.resize,n),100)}function h(e,t,i,o,n,a){this.list=e,this.listChecked=s.computed(function(){return r.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=s.computed(function(){return 00&&-1t?t:e))},this),this.body=null,this.plainRaw="",this.isRtl=s.observable(!1),this.isHtml=s.observable(!1),this.hasImages=s.observable(!1),this.attachments=s.observableArray([]),this.isPgpSigned=s.observable(!1),this.isPgpEncrypted=s.observable(!1),this.pgpSignedVerifyStatus=s.observable(Lt.SignedVerifyStatus.None),this.pgpSignedVerifyUser=s.observable(""),this.priority=s.observable(Lt.MessagePriority.Normal),this.readReceipt=s.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=s.observable(0),this.threads=s.observableArray([]),this.threadsLen=s.observable(0),this.hasUnseenSubMessage=s.observable(!1),this.hasFlaggedSubMessage=s.observable(!1),this.lastInCollapsedThread=s.observable(!1),this.lastInCollapsedThreadLoading=s.observable(!1),this.threadsLenResult=s.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}function N(){this.name=s.observable(""),this.fullName="",this.fullNameRaw="",this.fullNameHash="",this.delimiter="",this.namespace="",this.deep=0,this.interval=0,this.selectable=!1,this.existen=!0,this.type=s.observable(Lt.FolderType.User),this.focused=s.observable(!1),this.selected=s.observable(!1),this.edited=s.observable(!1),this.collapsed=s.observable(!0),this.subScribed=s.observable(!0),this.subFolders=s.observableArray([]),this.deleteAccess=s.observable(!1),this.actionBlink=s.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=s.observable(""),this.name.subscribe(function(e){this.nameForEdit(e)},this),this.edited.subscribe(function(e){e&&this.nameForEdit(this.name())},this),this.privateMessageCountAll=s.observable(0),this.privateMessageCountUnread=s.observable(0),this.collapsedPrivate=s.observable(!0)}function R(e,t){this.email=e,this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(t)}function I(e,t,i){this.id=e,this.email=s.observable(t),this.name=s.observable(""),this.replyTo=s.observable(""),this.bcc=s.observable(""),this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(i)}function L(e,t){this.parentList=e,this.canBeDeleted=t,this.value=s.observable(""),this.type=s.observable(Lt.FiltersAction.Move),this.typeOptions=[{id:Lt.FiltersAction.Move,name:"Move to"},{id:Lt.FiltersAction.Forward,name:"Forward to"},{id:Lt.FiltersAction.Delete,name:"Discard"},{id:Lt.FiltersAction.MarkAsRead,name:"Mark as read"}],this.template=s.computed(function(){var e="";switch(this.type()){default:case Lt.FiltersAction.Move:e="SettingsFiltersActionValueAsFolders";break;case Lt.FiltersAction.Forward:e="SettingsFiltersActionWithValue";break;case Lt.FiltersAction.MarkAsRead:case Lt.FiltersAction.Delete:e="SettingsFiltersActionNoValue"}return e},this)}function P(e,t){this.parentList=e,this.canBeDeleted=t,this.field=s.observable(Lt.FilterConditionField.Subject),this.fieldOptions=[{id:Lt.FilterConditionField.Subject,name:"Subject"},{id:Lt.FilterConditionField.Recipient,name:"Recipient (To or CC)"},{id:Lt.FilterConditionField.From,name:"From"},{id:Lt.FilterConditionField.To,name:"To"}],this.type=s.observable(Lt.FilterConditionType.Contains),this.typeOptions=[{id:Lt.FilterConditionType.Contains,name:"Contains"},{id:Lt.FilterConditionType.NotContains,name:"Not Contains"},{id:Lt.FilterConditionType.EqualTo,name:"Equal To"},{id:Lt.FilterConditionType.NotEqualTo,name:"Not Equal To"}],this.value=s.observable(""),this.template=s.computed(function(){var e="";switch(this.type()){default:e="SettingsFiltersConditionDefault"}return e},this)}function M(){this.enabled=s.observable(!0),this.name=s.observable(""),this.conditionsType=s.observable(Lt.FilterRulesType.And),this.conditions=s.observableArray([]),this.actions=s.observableArray([]),this.conditions.subscribe(function(){Mt.windowResize()}),this.actions.subscribe(function(){Mt.windowResize()}),this.conditionsCanBeDeleted=s.computed(function(){return 1=e?1:e},this),this.contactsPagenator=s.computed(Mt.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=s.observable(!0),this.viewClearSearch=s.observable(!1),this.viewID=s.observable(""),this.viewReadOnly=s.observable(!1),this.viewProperties=s.observableArray([]),this.viewTags=s.observable(""),this.viewTags.visibility=s.observable(!1),this.viewTags.focusTrigger=s.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=s.observable(Lt.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1e)break;t[0]&&t[1]&&t[2]&&t[1]===t[2]&&("PRIVATE"===t[1]?o.privateKeys.importKey(t[0]):"PUBLIC"===t[1]&&o.publicKeys.importKey(t[0])),e--}return o.store(),jt.reloadOpenPgpKeys(),Mt.delegateRun(this,"cancelCommand"),!0}),S.constructorEnd(this)}function G(){b.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=s.observable(""),this.keyDom=s.observable(null),S.constructorEnd(this)}function K(){b.call(this,"Popups","PopupsGenerateNewOpenPgpKey"),this.email=s.observable(""),this.email.focus=s.observable(""),this.email.error=s.observable(!1),this.name=s.observable(""),this.password=s.observable(""),this.keyBitLength=s.observable(2048),this.submitRequest=s.observable(!1),this.email.subscribe(function(){this.email.error(!1)},this),this.generateOpenPgpKeyCommand=Mt.createCommand(this,function(){var t=this,s="",i=null,o=jt.data().openpgpKeyring;return this.email.error(""===Mt.trim(this.email())),!o||this.email.error()?!1:(s=this.email(),""!==this.name()&&(s=this.name()+" <"+s+">"),this.submitRequest(!0),r.delay(function(){i=e.openpgp.generateKeyPair(1,Mt.pInt(t.keyBitLength()),s,Mt.trim(t.password())),i&&i.privateKeyArmored&&(o.privateKeys.importKey(i.privateKeyArmored),o.publicKeys.importKey(i.publicKeyArmored),o.store(),jt.reloadOpenPgpKeys(),Mt.delegateRun(t,"cancelCommand")),t.submitRequest(!1)},100),!0)}),S.constructorEnd(this)}function q(){b.call(this,"Popups","PopupsComposeOpenPgp"),this.notification=s.observable(""),this.sign=s.observable(!0),this.encrypt=s.observable(!0),this.password=s.observable(""),this.password.focus=s.observable(!1),this.buttonFocus=s.observable(!1),this.from=s.observable(""),this.to=s.observableArray([]),this.text=s.observable(""),this.resultCallback=null,this.submitRequest=s.observable(!1),this.doCommand=Mt.createCommand(this,function(){var t=this,s=!0,i=jt.data(),o=null,n=[]; this.submitRequest(!0),s&&this.sign()&&""===this.from()&&(this.notification(Mt.i18n("PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL")),s=!1),s&&this.sign()&&(o=i.findPrivateKeyByEmail(this.from(),this.password()),o||(this.notification(Mt.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR",{EMAIL:this.from()})),s=!1)),s&&this.encrypt()&&0===this.to().length&&(this.notification(Mt.i18n("PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT")),s=!1),s&&this.encrypt()&&(n=[],r.each(this.to(),function(e){var o=i.findPublicKeysByEmail(e);0===o.length&&s&&(t.notification(Mt.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR",{EMAIL:e})),s=!1),n=n.concat(o)}),!s||0!==n.length&&this.to().length===n.length||(s=!1)),r.delay(function(){if(t.resultCallback&&s)try{o&&0===n.length?t.resultCallback(e.openpgp.signClearMessage([o],t.text())):o&&00&&t>0&&e>t},this),this.hasMessages=s.computed(function(){return 0'),o.after(n),o.remove()),n&&n[0]&&(n.attr("data-href",a).attr("data-theme",e[0]),n&&n[0]&&n[0].styleSheet&&!Mt.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=e[1]:n.text(e[1])),i.themeTrigger(Lt.SaveSettingsStep.TrueResult))}).always(function(){i.iTimer=e.setTimeout(function(){i.themeTrigger(Lt.SaveSettingsStep.Idle)},1e3),i.oLastAjax=null})),jt.remote().saveSettings(null,{Theme:s})},this)}function ft(){this.openpgpkeys=jt.data().openpgpkeys,this.openpgpkeysPublic=jt.data().openpgpkeysPublic,this.openpgpkeysPrivate=jt.data().openpgpkeysPrivate,this.openPgpKeyForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}function bt(){this.leftPanelDisabled=s.observable(!1),this.useKeyboardShortcuts=s.observable(!0),this.keyScopeReal=s.observable(Lt.KeyState.All),this.keyScopeFake=s.observable(Lt.KeyState.All),this.keyScope=s.computed({owner:this,read:function(){return this.keyScopeFake()},write:function(e){Lt.KeyState.Menu!==e&&(Lt.KeyState.Compose===e?Mt.disableKeyFilter():Mt.restoreKeyFilter(),this.keyScopeFake(e),kt.dropdownVisibility()&&(e=Lt.KeyState.Menu)),this.keyScopeReal(e)}}),this.keyScopeReal.subscribe(function(e){c.setScope(e)}),this.leftPanelDisabled.subscribe(function(e){jt.pub("left-panel."+(e?"off":"on"))}),kt.dropdownVisibility.subscribe(function(e){e?(kt.tooltipTrigger(!kt.tooltipTrigger()),this.keyScope(Lt.KeyState.Menu)):Lt.KeyState.Menu===c.getScope()&&this.keyScope(this.keyScopeFake())},this),Mt.initDataConstructorBySettings(this)}function yt(){bt.call(this);var i=function(e){return function(){var t=jt.cache().getFolderFromCacheList(e());t&&t.type(Lt.FolderType.User)}},o=function(e){return function(t){var s=jt.cache().getFolderFromCacheList(t);s&&s.type(e)}};this.devEmail="",this.devPassword="",this.accountEmail=s.observable(""),this.accountIncLogin=s.observable(""),this.accountOutLogin=s.observable(""),this.projectHash=s.observable(""),this.threading=s.observable(!1),this.lastFoldersHash="",this.remoteSuggestions=!1,this.sentFolder=s.observable(""),this.draftFolder=s.observable(""),this.spamFolder=s.observable(""),this.trashFolder=s.observable(""),this.archiveFolder=s.observable(""),this.sentFolder.subscribe(i(this.sentFolder),this,"beforeChange"),this.draftFolder.subscribe(i(this.draftFolder),this,"beforeChange"),this.spamFolder.subscribe(i(this.spamFolder),this,"beforeChange"),this.trashFolder.subscribe(i(this.trashFolder),this,"beforeChange"),this.archiveFolder.subscribe(i(this.archiveFolder),this,"beforeChange"),this.sentFolder.subscribe(o(Lt.FolderType.SentItems),this),this.draftFolder.subscribe(o(Lt.FolderType.Draft),this),this.spamFolder.subscribe(o(Lt.FolderType.Spam),this),this.trashFolder.subscribe(o(Lt.FolderType.Trash),this),this.archiveFolder.subscribe(o(Lt.FolderType.Archive),this),this.draftFolderNotEnabled=s.computed(function(){return""===this.draftFolder()||It.Values.UnuseOptionValue===this.draftFolder() },this),this.displayName=s.observable(""),this.signature=s.observable(""),this.signatureToAll=s.observable(!1),this.replyTo=s.observable(""),this.enableTwoFactor=s.observable(!1),this.accounts=s.observableArray([]),this.accountsLoading=s.observable(!1).extend({throttle:100}),this.defaultIdentityID=s.observable(""),this.identities=s.observableArray([]),this.identitiesLoading=s.observable(!1).extend({throttle:100}),this.contactTags=s.observableArray([]),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(""),this.allowContactsSync=s.observable(!!jt.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync=s.observable(!!jt.settingsGet("EnableContactsSync")),this.contactsSyncUrl=s.observable(jt.settingsGet("ContactsSyncUrl")),this.contactsSyncUser=s.observable(jt.settingsGet("ContactsSyncUser")),this.contactsSyncPass=s.observable(jt.settingsGet("ContactsSyncPassword")),this.namespace="",this.folderList=s.observableArray([]),this.folderList.focused=s.observable(!1),this.foldersListError=s.observable(""),this.foldersLoading=s.observable(!1),this.foldersCreating=s.observable(!1),this.foldersDeleting=s.observable(!1),this.foldersRenaming=s.observable(!1),this.foldersChanging=s.computed(function(){var e=this.foldersLoading(),t=this.foldersCreating(),s=this.foldersDeleting(),i=this.foldersRenaming();return e||t||s||i},this),this.foldersInboxUnreadCount=s.observable(0),this.currentFolder=s.observable(null).extend({toggleSubscribe:[null,function(e){e&&e.selected(!1)},function(e){e&&e.selected(!0)}]}),this.currentFolderFullNameRaw=s.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=s.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=s.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=s.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this),this.folderListSystemNames=s.computed(function(){var e=["INBOX"],t=this.folderList(),s=this.sentFolder(),i=this.draftFolder(),o=this.spamFolder(),n=this.trashFolder(),a=this.archiveFolder();return Mt.isArray(t)&&0=e?1:e},this),this.mainMessageListSearch=s.computed({read:this.messageListSearch,write:function(e){xt.setHash(jt.link().mailBox(this.currentFolderFullNameHash(),1,Mt.trim(e.toString())))},owner:this}),this.messageListError=s.observable(""),this.messageListLoading=s.observable(!1),this.messageListIsNotCompleted=s.observable(!1),this.messageListCompleteLoadingThrottle=s.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=s.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(r.debounce(function(e){r.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new E,this.message=s.observable(null),this.messageLoading=s.observable(!1),this.messageLoadingThrottle=s.observable(!1).extend({throttle:50}),this.message.focused=s.observable(!1),this.message.subscribe(function(t){t?Lt.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.hideMessageBodies(),Lt.Layout.NoPreview===jt.data().layout()&&-10?Math.ceil(t/e*100):0},this),this.capaOpenPGP=s.observable(!1),this.openpgpkeys=s.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)}),this.googleActions=s.observable(!1),this.googleLoggined=s.observable(!1),this.googleUserName=s.observable(""),this.facebookActions=s.observable(!1),this.facebookLoggined=s.observable(!1),this.facebookUserName=s.observable(""),this.twitterActions=s.observable(!1),this.twitterLoggined=s.observable(!1),this.twitterUserName=s.observable(""),this.customThemeType=s.observable(Lt.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=r.throttle(this.purgeMessageBodyCache,3e4)}function St(){this.oRequests={}}function vt(){St.call(this),this.oRequests={}}function Ct(){this.oServices={},this.bCapaGravatar=jt.capa(Lt.Capa.Gravatar)}function wt(){Ct.call(this),this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={}}function Tt(e){y.call(this,"settings",e),this.menu=s.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}function Ft(){y.call(this,"login",[$])}function At(){y.call(this,"mailbox",[Q,et,tt,st]),this.oLastRoute={}}function Et(){Tt.call(this,[Z,it,ot]),Mt.initOnStartOrLangChange(function(){this.sSettingsTitle=Mt.i18n("TITLES/SETTINGS")},this,function(){jt.setTitle(this.sSettingsTitle)})}function Nt(){f.call(this),this.oSettings=null,this.oPlugins=null,this.oLocal=null,this.oLink=null,this.oSubs={},this.isLocalAutocomplete=!0,this.popupVisibilityNames=s.observableArray([]),this.popupVisibility=s.computed(function(){return 0').appendTo("body"),Gt.on("error",function(e){jt&&e&&e.originalEvent&&e.originalEvent.message&&-1===Mt.inArray(e.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&jt.remote().jsError(Mt.emptyFunction,e.originalEvent.message,e.originalEvent.filename,e.originalEvent.lineno,location&&location.toString?location.toString():"",Bt.attr("class"),Mt.microtime()-kt.now)}),Kt.on("keydown",function(e){e&&e.ctrlKey&&Bt.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&Bt.removeClass("rl-ctrl-key-pressed")})}function Rt(){Nt.call(this),this.oData=null,this.oRemote=null,this.oCache=null,this.oMoveCache={},this.quotaDebounce=r.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=r.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=r.debounce(this.messagesMoveTrigger,500),e.setInterval(function(){jt.pub("interval.30s")},3e4),e.setInterval(function(){jt.pub("interval.1m")},6e4),e.setInterval(function(){jt.pub("interval.2m")},12e4),e.setInterval(function(){jt.pub("interval.3m")},18e4),e.setInterval(function(){jt.pub("interval.5m")},3e5),e.setInterval(function(){jt.pub("interval.10m")},6e5),e.setTimeout(function(){e.setInterval(function(){jt.pub("interval.10m-after5m")},6e5)},3e5),t.wakeUp(function(){jt.remote().jsVersion(function(t,s){Lt.StorageResultType.Success===t&&s&&!s.Result&&(e.parent&&jt.settingsGet("InIframe")?e.parent.location.reload():e.location.reload())},jt.settingsGet("Version"))},{},36e5)}var It={},Lt={},Pt={},Mt={},Dt={},Ot={},kt={},_t={settings:[],"settings-removed":[],"settings-disabled":[]},Ut=[],xt=null,Vt=e.rainloopAppData||{},Ht=e.rainloopI18N||{},Bt=t("html"),Gt=t(e),Kt=t(e.document),qt=e.Notification&&e.Notification.requestPermission?e.Notification:null,jt=null,zt=t("
");kt.now=(new Date).getTime(),kt.momentTrigger=s.observable(!0),kt.dropdownVisibility=s.observable(!1).extend({rateLimit:0}),kt.tooltipTrigger=s.observable(!1).extend({rateLimit:0}),kt.langChangeTrigger=s.observable(!0),kt.iAjaxErrorCount=0,kt.iTokenErrorCount=0,kt.iMessageBodyCacheCount=0,kt.bUnload=!1,kt.sUserAgent=(navigator.userAgent||"").toLowerCase(),kt.bIsiOSDevice=-1/g,">").replace(/"/g,""").replace(/'/g,"'"):""},Mt.splitPlainText=function(e,t){var s="",i="",o=e,n=0,a=0;for(t=Mt.isUnd(t)?100:t;o.length>t;)i=o.substring(0,t),n=i.lastIndexOf(" "),a=i.lastIndexOf("\n"),-1!==a&&(n=a),-1===n&&(n=t),s+=i.substring(0,n)+"\n",o=o.substring(n+1);return s+o},Mt.timeOutAction=function(){var t={};return function(s,i,o){Mt.isUnd(t[s])&&(t[s]=0),e.clearTimeout(t[s]),t[s]=e.setTimeout(i,o)}}(),Mt.timeOutActionSecond=function(){var t={};return function(s,i,o){t[s]||(t[s]=e.setTimeout(function(){i(),t[s]=0},o))}}(),Mt.audio=function(){var t=!1;return function(s,i){if(!1===t)if(kt.bIsiOSDevice)t=null;else{var o=!1,n=!1,a=e.Audio?new e.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(n=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||n?(t=a,t.preload="none",t.loop=!1,t.autoplay=!1,t.muted=!1,t.src=o?s:i):t=null):t=null}return t}}(),Mt.hos=function(e,t){return e&&Object.hasOwnProperty?Object.hasOwnProperty.call(e,t):!1},Mt.i18n=function(e,t,s){var i="",o=Mt.isUnd(Ht[e])?Mt.isUnd(s)?e:s:Ht[e];if(!Mt.isUnd(t)&&!Mt.isNull(t))for(i in t)Mt.hos(t,i)&&(o=o.replace("%"+i+"%",t[i]));return o},Mt.i18nToNode=function(e){r.defer(function(){t(".i18n",e).each(function(){var e=t(this),s="";s=e.data("i18n-text"),s?e.text(Mt.i18n(s)):(s=e.data("i18n-html"),s&&e.html(Mt.i18n(s)),s=e.data("i18n-placeholder"),s&&e.attr("placeholder",Mt.i18n(s)),s=e.data("i18n-title"),s&&e.attr("title",Mt.i18n(s)))})})},Mt.i18nToDoc=function(){e.rainloopI18N&&(Ht=e.rainloopI18N||{},Mt.i18nToNode(Kt),kt.langChangeTrigger(!kt.langChangeTrigger())),e.rainloopI18N={}},Mt.initOnStartOrLangChange=function(e,t,s){e&&e.call(t),s?kt.langChangeTrigger.subscribe(function(){e&&e.call(t),s.call(t)}):e&&kt.langChangeTrigger.subscribe(e,t)},Mt.inFocus=function(){return document.activeElement?(Mt.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=t(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},Mt.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var e=t(document.activeElement);e.is("input,textarea")&&document.activeElement.blur()}},Mt.removeSelection=function(){if(e&&e.getSelection){var t=e.getSelection();t&&t.removeAllRanges&&t.removeAllRanges()}else document&&document.selection&&document.selection.empty&&document.selection.empty()},Mt.replySubjectAdd=function(t,s,i){var o=null,n=Mt.trim(s);return n=null===(o=new e.RegExp("^"+t+"[\\s]?\\:(.*)$","gi").exec(s))||Mt.isUnd(o[1])?null===(o=new e.RegExp("^("+t+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(s))||Mt.isUnd(o[1])||Mt.isUnd(o[2])||Mt.isUnd(o[3])?t+": "+s:o[1]+(Mt.pInt(o[2])+1)+o[3]:t+"[2]: "+o[1],n=n.replace(/[\s]+/g," "),n=(Mt.isUnd(i)?!0:i)?Mt.fixLongSubject(n):n},Mt.fixLongSubject=function(e){var t=0,s=null;e=Mt.trim(e.replace(/[\s]+/," "));do s=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!s||Mt.isUnd(s[0]))&&(s=null),s&&(t=0,t+=Mt.isUnd(s[2])?1:0+Mt.pInt(s[2]),t+=Mt.isUnd(s[4])?1:0+Mt.pInt(s[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(s);return e=e.replace(/[\s]+/," ")},Mt.roundNumber=function(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},Mt.friendlySize=function(e){return e=Mt.pInt(e),e>=1073741824?Mt.roundNumber(e/1073741824,1)+"GB":e>=1048576?Mt.roundNumber(e/1048576,1)+"MB":e>=1024?Mt.roundNumber(e/1024,0)+"KB":e+"B"},Mt.log=function(t){e.console&&e.console.log&&e.console.log(t)},Mt.getNotification=function(e,t){return e=Mt.pInt(e),Lt.Notification.ClientViewError===e&&t?t:Mt.isUnd(Pt[e])?"":Pt[e]},Mt.initNotificationLanguage=function(){Pt[Lt.Notification.InvalidToken]=Mt.i18n("NOTIFICATIONS/INVALID_TOKEN"),Pt[Lt.Notification.AuthError]=Mt.i18n("NOTIFICATIONS/AUTH_ERROR"),Pt[Lt.Notification.AccessError]=Mt.i18n("NOTIFICATIONS/ACCESS_ERROR"),Pt[Lt.Notification.ConnectionError]=Mt.i18n("NOTIFICATIONS/CONNECTION_ERROR"),Pt[Lt.Notification.CaptchaError]=Mt.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),Pt[Lt.Notification.SocialFacebookLoginAccessDisable]=Mt.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),Pt[Lt.Notification.SocialTwitterLoginAccessDisable]=Mt.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),Pt[Lt.Notification.SocialGoogleLoginAccessDisable]=Mt.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),Pt[Lt.Notification.DomainNotAllowed]=Mt.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),Pt[Lt.Notification.AccountNotAllowed]=Mt.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),Pt[Lt.Notification.AccountTwoFactorAuthRequired]=Mt.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),Pt[Lt.Notification.AccountTwoFactorAuthError]=Mt.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),Pt[Lt.Notification.CouldNotSaveNewPassword]=Mt.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),Pt[Lt.Notification.CurrentPasswordIncorrect]=Mt.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),Pt[Lt.Notification.NewPasswordShort]=Mt.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),Pt[Lt.Notification.NewPasswordWeak]=Mt.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),Pt[Lt.Notification.NewPasswordForbidden]=Mt.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),Pt[Lt.Notification.ContactsSyncError]=Mt.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),Pt[Lt.Notification.CantGetMessageList]=Mt.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),Pt[Lt.Notification.CantGetMessage]=Mt.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),Pt[Lt.Notification.CantDeleteMessage]=Mt.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),Pt[Lt.Notification.CantMoveMessage]=Mt.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Pt[Lt.Notification.CantCopyMessage]=Mt.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Pt[Lt.Notification.CantSaveMessage]=Mt.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),Pt[Lt.Notification.CantSendMessage]=Mt.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),Pt[Lt.Notification.InvalidRecipients]=Mt.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),Pt[Lt.Notification.CantCreateFolder]=Mt.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),Pt[Lt.Notification.CantRenameFolder]=Mt.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),Pt[Lt.Notification.CantDeleteFolder]=Mt.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),Pt[Lt.Notification.CantDeleteNonEmptyFolder]=Mt.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),Pt[Lt.Notification.CantSubscribeFolder]=Mt.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),Pt[Lt.Notification.CantUnsubscribeFolder]=Mt.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),Pt[Lt.Notification.CantSaveSettings]=Mt.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),Pt[Lt.Notification.CantSavePluginSettings]=Mt.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),Pt[Lt.Notification.DomainAlreadyExists]=Mt.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),Pt[Lt.Notification.CantInstallPackage]=Mt.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),Pt[Lt.Notification.CantDeletePackage]=Mt.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),Pt[Lt.Notification.InvalidPluginPackage]=Mt.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),Pt[Lt.Notification.UnsupportedPluginPackage]=Mt.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),Pt[Lt.Notification.LicensingServerIsUnavailable]=Mt.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),Pt[Lt.Notification.LicensingExpired]=Mt.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),Pt[Lt.Notification.LicensingBanned]=Mt.i18n("NOTIFICATIONS/LICENSING_BANNED"),Pt[Lt.Notification.DemoSendMessageError]=Mt.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),Pt[Lt.Notification.AccountAlreadyExists]=Mt.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),Pt[Lt.Notification.MailServerError]=Mt.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),Pt[Lt.Notification.InvalidInputArgument]=Mt.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),Pt[Lt.Notification.UnknownNotification]=Mt.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),Pt[Lt.Notification.UnknownError]=Mt.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},Mt.getUploadErrorDescByCode=function(e){var t="";switch(Mt.pInt(e)){case Lt.UploadErrorCode.FileIsTooBig:t=Mt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case Lt.UploadErrorCode.FilePartiallyUploaded:t=Mt.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case Lt.UploadErrorCode.FileNoUploaded:t=Mt.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case Lt.UploadErrorCode.MissingTempFolder:t=Mt.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case Lt.UploadErrorCode.FileOnSaveingError:t=Mt.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case Lt.UploadErrorCode.FileType:t=Mt.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=Mt.i18n("UPLOAD/ERROR_UNKNOWN")}return t},Mt.delegateRun=function(e,t,s,i){e&&e[t]&&(i=Mt.pInt(i),0>=i?e[t].apply(e,Mt.isArray(s)?s:[]):r.delay(function(){e[t].apply(e,Mt.isArray(s)?s:[])},i))},Mt.killCtrlAandS=function(t){if(t=t||e.event,t&&t.ctrlKey&&!t.shiftKey&&!t.altKey){var s=t.target||t.srcElement,i=t.keyCode||t.which;if(i===Lt.EventKeyCode.S)return void t.preventDefault();if(s&&s.tagName&&s.tagName.match(/INPUT|TEXTAREA/i))return;i===Lt.EventKeyCode.A&&(e.getSelection?e.getSelection().removeAllRanges():e.document.selection&&e.document.selection.clear&&e.document.selection.clear(),t.preventDefault())}},Mt.createCommand=function(e,t,i){var o=t?function(){return o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=s.observable(!0),i=Mt.isUnd(i)?!0:i,o.canExecute=s.computed(Mt.isFunc(i)?function(){return o.enabled()&&i.call(e)}:function(){return o.enabled()&&!!i}),o},Mt.initDataConstructorBySettings=function(t){t.editorDefaultType=s.observable(Lt.EditorDefaultType.Html),t.showImages=s.observable(!1),t.interfaceAnimation=s.observable(Lt.InterfaceAnimation.Full),t.contactsAutosave=s.observable(!1),kt.sAnimationType=Lt.InterfaceAnimation.Full,t.capaThemes=s.observable(!1),t.allowLanguagesOnSettings=s.observable(!0),t.allowLanguagesOnLogin=s.observable(!0),t.useLocalProxyForExternalImages=s.observable(!1),t.desktopNotifications=s.observable(!1),t.useThreads=s.observable(!0),t.replySameFolder=s.observable(!0),t.useCheckboxesInList=s.observable(!0),t.layout=s.observable(Lt.Layout.SidePreview),t.usePreviewPane=s.computed(function(){return Lt.Layout.NoPreview!==t.layout()}),t.interfaceAnimation.subscribe(function(e){if(kt.bMobileDevice||e===Lt.InterfaceAnimation.None)Bt.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),kt.sAnimationType=Lt.InterfaceAnimation.None;else switch(e){case Lt.InterfaceAnimation.Full:Bt.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),kt.sAnimationType=e;break;case Lt.InterfaceAnimation.Normal:Bt.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),kt.sAnimationType=e}}),t.interfaceAnimation.valueHasMutated(),t.desktopNotificationsPermisions=s.computed(function(){t.desktopNotifications();var s=Lt.DesktopNotifications.NotSupported;if(qt&&qt.permission)switch(qt.permission.toLowerCase()){case"granted":s=Lt.DesktopNotifications.Allowed;break;case"denied":s=Lt.DesktopNotifications.Denied;break;case"default":s=Lt.DesktopNotifications.NotAllowed}else e.webkitNotifications&&e.webkitNotifications.checkPermission&&(s=e.webkitNotifications.checkPermission());return s}),t.useDesktopNotifications=s.computed({read:function(){return t.desktopNotifications()&&Lt.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()},write:function(e){if(e){var s=t.desktopNotificationsPermisions();Lt.DesktopNotifications.Allowed===s?t.desktopNotifications(!0):Lt.DesktopNotifications.NotAllowed===s?qt.requestPermission(function(){t.desktopNotifications.valueHasMutated(),Lt.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()?t.desktopNotifications()?t.desktopNotifications.valueHasMutated():t.desktopNotifications(!0):t.desktopNotifications()?t.desktopNotifications(!1):t.desktopNotifications.valueHasMutated()}):t.desktopNotifications(!1)}else t.desktopNotifications(!1)}}),t.language=s.observable(""),t.languages=s.observableArray([]),t.mainLanguage=s.computed({read:t.language,write:function(e){e!==t.language()?-1=t.diff(s,"hours")?i:t.format("L")===s.format("L")?Mt.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?Mt.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},Mt.isFolderExpanded=function(e){var t=jt.local().get(Lt.ClientSideKeyName.ExpandedFolders);return r.isArray(t)&&-1!==r.indexOf(t,e)},Mt.setExpandedFolder=function(e,t){var s=jt.local().get(Lt.ClientSideKeyName.ExpandedFolders);r.isArray(s)||(s=[]),t?(s.push(e),s=r.uniq(s)):s=r.without(s,e),jt.local().set(Lt.ClientSideKeyName.ExpandedFolders,s)},Mt.initLayoutResizer=function(e,s,i){var o=60,n=155,a=t(e),r=t(s),l=jt.local().get(i)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(o);else{a.resizable("enable");var t=Mt.pInt(jt.local().get(i))||n;c(t>n?t:n)}},d=function(e,t){t&&t.size&&t.size.width&&(jt.local().set(i,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>n?l:n),a.resizable({helper:"ui-resizable-helper",minWidth:n,maxWidth:350,handles:"e",stop:d}),jt.sub("left-panel.off",function(){u(!0)}),jt.sub("left-panel.on",function(){u(!1)})},Mt.initBlockquoteSwitcher=function(e){if(e){var s=t("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===t(this).parent().closest("blockquote",e).length});s&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),t('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),Mt.windowResize()}).after("
").before("
"))})}},Mt.removeBlockquoteSwitcher=function(e){e&&(t(e).find("blockquote.rl-bq-switcher").each(function(){t(this).removeClass("rl-bq-switcher hidden-bq")}),t(e).find(".rlBlockquoteSwitcher").each(function(){t(this).remove()}))},Mt.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},Mt.extendAsViewModel=function(e,t,s){t&&(s||(s=b),t.__name=e,Dt.regViewModelHook(e,t),r.extend(t.prototype,s.prototype))},Mt.addSettingsViewModel=function(e,t,s,i,o){e.__rlSettingsData={Label:s,Template:t,Route:i,IsDefault:!!o},_t.settings.push(e)},Mt.removeSettingsViewModel=function(e){_t["settings-removed"].push(e)},Mt.disableSettingsViewModel=function(e){_t["settings-disabled"].push(e)},Mt.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=Mt.trim(e.substring(0,e.length-7))),Mt.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},Mt.quoteName=function(e){return e.replace(/["]/g,'\\"')},Mt.microtime=function(){return(new Date).getTime()},Mt.convertLangName=function(e,t){return Mt.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},Mt.fakeMd5=function(e){var t="",s="0123456789abcdefghijklmnopqrstuvwxyz";for(e=Mt.isUnd(e)?32:Mt.pInt(e);t.length>>32-t}function s(e,t){var s,i,o,n,a;return o=2147483648&e,n=2147483648&t,s=1073741824&e,i=1073741824&t,a=(1073741823&e)+(1073741823&t),s&i?2147483648^a^o^n:s|i?1073741824&a?3221225472^a^o^n:1073741824^a^o^n:a^o^n}function i(e,t,s){return e&t|~e&s}function o(e,t,s){return e&s|t&~s}function n(e,t,s){return e^t^s}function a(e,t,s){return t^(e|~s)}function r(e,o,n,a,r,l,c){return e=s(e,s(s(i(o,n,a),r),c)),s(t(e,l),o)}function l(e,i,n,a,r,l,c){return e=s(e,s(s(o(i,n,a),r),c)),s(t(e,l),i)}function c(e,i,o,a,r,l,c){return e=s(e,s(s(n(i,o,a),r),c)),s(t(e,l),i)}function u(e,i,o,n,r,l,c){return e=s(e,s(s(a(i,o,n),r),c)),s(t(e,l),i)}function d(e){for(var t,s=e.length,i=s+8,o=(i-i%64)/64,n=16*(o+1),a=Array(n-1),r=0,l=0;s>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<>>29,a}function h(e){var t,s,i="",o="";for(s=0;3>=s;s++)t=e>>>8*s&255,o="0"+t.toString(16),i+=o.substr(o.length-2,2);return i}function p(e){e=e.replace(/rn/g,"n");for(var t="",s=0;si?t+=String.fromCharCode(i):i>127&&2048>i?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128))}return t}var m,g,f,b,y,S,v,C,w,T=Array(),F=7,A=12,E=17,N=22,R=5,I=9,L=14,P=20,M=4,D=11,O=16,k=23,_=6,U=10,x=15,V=21;for(e=p(e),T=d(e),S=1732584193,v=4023233417,C=2562383102,w=271733878,m=0;m/g,">").replace(/")},Mt.draggeblePlace=function(){return t('
 
').appendTo("#rl-hidden")},Mt.defautOptionsAfterRender=function(e,s){s&&!Mt.isUnd(s.disabled)&&e&&t(e).toggleClass("disabled",s.disabled).prop("disabled",s.disabled)},Mt.windowPopupKnockout=function(s,i,o,n){var a=null,r=e.open(""),l="__OpenerApplyBindingsUid"+Mt.fakeMd5()+"__",c=t("#"+i);e[l]=function(){if(r&&r.document.body&&c&&c[0]){var i=t(r.document.body);t("#rl-content",i).html(c.html()),t("html",r.document).addClass("external "+t("html").attr("class")),Mt.i18nToNode(i),S.prototype.applyExternal(s,t("#rl-content",i)[0]),e[l]=null,n(r)}},r.document.open(),r.document.write(''+Mt.encodeHtml(o)+'
'),r.document.close(),a=r.document.createElement("script"),a.type="text/javascript",a.innerHTML="if(window&&window.opener&&window.opener['"+l+"']){window.opener['"+l+"']();window.opener['"+l+"']=null}",r.document.getElementsByTagName("head")[0].appendChild(a)},Mt.settingsSaveHelperFunction=function(e,t,s,i){return s=s||null,i=Mt.isUnd(i)?1e3:Mt.pInt(i),function(o,n,a,l,c){t.call(s,n&&n.Result?Lt.SaveSettingsStep.TrueResult:Lt.SaveSettingsStep.FalseResult),e&&e.call(s,o,n,a,l,c),r.delay(function(){t.call(s,Lt.SaveSettingsStep.Idle)},i)}},Mt.settingsSaveHelperSimpleFunction=function(e,t){return Mt.settingsSaveHelperFunction(null,e,t,1e3)},Mt.htmlToPlain=function(e){var s="",i="> ",o=function(){if(arguments&&1\n",e.replace(/\n([> ]+)/gm,function(){return arguments&&1]*>(.|[\s\S\r\n]*)<\/div>/gim,n),e="\n"+t.trim(e)+"\n"),e}return""},a=function(){return arguments&&1/g,">"):""},r=function(){if(arguments&&1/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(/]*>/gim,"").replace(/]*>(.|[\s\S\r\n]*)<\/div>/gim,n).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>(.|[\s\S\r\n]*)<\/a>/gim,r).replace(/ /gi," ").replace(/<[^>]*>/gm,"").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&").replace(/&\w{2,6};/gi,""),s.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/__bq__start__(.|[\s\S\r\n]*)__bq__end__/gm,o).replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},Mt.plainToHtml=function(e){return e.toString().replace(/&/g,"&").replace(/>/g,">").replace(/")},Mt.resizeAndCrop=function(t,s,i){var o=new e.Image;o.onload=function(){var e=[0,0],t=document.createElement("canvas"),o=t.getContext("2d");t.width=s,t.height=s,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],o.fillStyle="#fff",o.fillRect(0,0,s,s),o.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,s,s),i(t.toDataURL("image/jpeg"))},o.src=t},Mt.computedPagenatorHelper=function(e,t){return function(){var s=0,i=0,o=2,n=[],a=e(),r=t(),l=function(e,t,s){var i={current:e===a,name:Mt.isUnd(s)?e.toString():s.toString(),custom:Mt.isUnd(s)?!1:!0,title:Mt.isUnd(s)?"":e.toString(),value:e.toString()};(Mt.isUnd(t)?0:!t)?n.unshift(i):n.push(i)};if(r>1||r>0&&a>r){for(a>r?(l(r),s=r,i=r):((3>=a||a>=r-2)&&(o+=2),l(a),s=a,i=a);o>0;)if(s-=1,i+=1,s>0&&(l(s,!1),o--),r>=i)l(i,!0),o--;else if(0>=s)break;3===s?l(2,!1):s>3&&l(Math.round((s-1)/2),!1,"..."),r-2===i?l(r-1,!0):r-2>i&&l(Math.round((r+i)/2),!0,"..."),s>1&&l(1,!1),r>i&&l(r,!0)}return n}},Mt.selectElement=function(t){if(e.getSelection){var s=e.getSelection();s.removeAllRanges();var i=document.createRange();i.selectNodeContents(t),s.addRange(i)}else if(document.selection){var o=document.body.createTextRange();o.moveToElementText(t),o.select()}},Mt.disableKeyFilter=function(){e.key&&(c.filter=function(){return jt.data().useKeyboardShortcuts()})},Mt.restoreKeyFilter=function(){e.key&&(c.filter=function(e){if(jt.data().useKeyboardShortcuts()){var t=e.target||e.srcElement,s=t?t.tagName:"";return s=s.toUpperCase(),!("INPUT"===s||"SELECT"===s||"TEXTAREA"===s||t&&"DIV"===s&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1})},Mt.detectDropdownVisibility=r.debounce(function(){kt.dropdownVisibility(!!r.find(Ut,function(e){return e.hasClass("open")}))},50),Ot={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return Ot.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var t,s,i,o,n,a,r,l="",c=0;for(e=Ot._utf8_encode(e);c>2,n=(3&t)<<4|s>>4,a=(15&s)<<2|i>>6,r=63&i,isNaN(s)?a=r=64:isNaN(i)&&(r=64),l=l+this._keyStr.charAt(o)+this._keyStr.charAt(n)+this._keyStr.charAt(a)+this._keyStr.charAt(r);return l},decode:function(e){var t,s,i,o,n,a,r,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,s=(15&n)<<4|a>>2,i=(3&a)<<6|r,l+=String.fromCharCode(t),64!==a&&(l+=String.fromCharCode(s)),64!==r&&(l+=String.fromCharCode(i));return Ot._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",s=0,i=e.length,o=0;i>s;s++)o=e.charCodeAt(s),128>o?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128));return t},_utf8_decode:function(e){for(var t="",s=0,i=0,o=0,n=0;si?(t+=String.fromCharCode(i),s++):i>191&&224>i?(o=e.charCodeAt(s+1),t+=String.fromCharCode((31&i)<<6|63&o),s+=2):(o=e.charCodeAt(s+1),n=e.charCodeAt(s+2),t+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&n),s+=3);return t}},s.bindingHandlers.tooltip={init:function(e,i){if(!kt.bMobileDevice){var o=t(e),n=o.data("tooltip-class")||"",a=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:a,trigger:"hover",title:function(){return o.is(".disabled")||kt.dropdownVisibility()?"":''+Mt.i18n(s.utils.unwrapObservable(i()))+""}}).click(function(){o.tooltip("hide")}),kt.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}}},s.bindingHandlers.tooltip2={init:function(e,s){var i=t(e),o=i.data("tooltip-class")||"",n=i.data("tooltip-placement")||"top";i.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:n,title:function(){return i.is(".disabled")||kt.dropdownVisibility()?"":''+s()()+""}}).click(function(){i.tooltip("hide")}),kt.tooltipTrigger.subscribe(function(){i.tooltip("hide")})}},s.bindingHandlers.tooltip3={init:function(e){var s=t(e);s.tooltip({container:"body",trigger:"hover manual",title:function(){return s.data("tooltip3-data")||""}}),Kt.click(function(){s.tooltip("hide")}),kt.tooltipTrigger.subscribe(function(){s.tooltip("hide")})},update:function(e,i){var o=s.utils.unwrapObservable(i());""===o?t(e).data("tooltip3-data","").tooltip("hide"):t(e).data("tooltip3-data",o).tooltip("show")}},s.bindingHandlers.registrateBootstrapDropdown={init:function(e){Ut.push(t(e))}},s.bindingHandlers.openDropdownTrigger={update:function(e,i){if(s.utils.unwrapObservable(i())){var o=t(e);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),Mt.detectDropdownVisibility()),i()(!1)}}},s.bindingHandlers.dropdownCloser={init:function(e){t(e).closest(".dropdown").on("click",".e-item",function(){t(e).dropdown("toggle")})}},s.bindingHandlers.popover={init:function(e,i){t(e).popover(s.utils.unwrapObservable(i()))}},s.bindingHandlers.csstext={init:function(e,i){e&&e.styleSheet&&!Mt.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=s.utils.unwrapObservable(i()):t(e).text(s.utils.unwrapObservable(i()))},update:function(e,i){e&&e.styleSheet&&!Mt.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=s.utils.unwrapObservable(i()):t(e).text(s.utils.unwrapObservable(i()))}},s.bindingHandlers.resizecrop={init:function(e){t(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,s){s()(),t(e).resizecrop({width:"100",height:"100"})}},s.bindingHandlers.onEnter={init:function(s,i,o,n){t(s).on("keypress",function(o){o&&13===e.parseInt(o.keyCode,10)&&(t(s).trigger("change"),i().call(n))})}},s.bindingHandlers.onEsc={init:function(s,i,o,n){t(s).on("keypress",function(o){o&&27===e.parseInt(o.keyCode,10)&&(t(s).trigger("change"),i().call(n))})}},s.bindingHandlers.clickOnTrue={update:function(e,i){s.utils.unwrapObservable(i())&&t(e).click()}},s.bindingHandlers.modal={init:function(e,i){t(e).toggleClass("fade",!kt.bMobileDevice).modal({keyboard:!1,show:s.utils.unwrapObservable(i())}).on("shown",function(){Mt.windowResize()}).find(".close").click(function(){i()(!1)})},update:function(e,i){t(e).modal(s.utils.unwrapObservable(i())?"show":"hide")}},s.bindingHandlers.i18nInit={init:function(e){Mt.i18nToNode(e)}},s.bindingHandlers.i18nUpdate={update:function(e,t){s.utils.unwrapObservable(t()),Mt.i18nToNode(e)}},s.bindingHandlers.link={update:function(e,i){t(e).attr("href",s.utils.unwrapObservable(i()))}},s.bindingHandlers.title={update:function(e,i){t(e).attr("title",s.utils.unwrapObservable(i()))}},s.bindingHandlers.textF={init:function(e,i){t(e).text(s.utils.unwrapObservable(i()))}},s.bindingHandlers.initDom={init:function(e,t){t()(e)}},s.bindingHandlers.initResizeTrigger={init:function(e,i){var o=s.utils.unwrapObservable(i());t(e).css({height:o[1],"min-height":o[1]})},update:function(e,i){var o=s.utils.unwrapObservable(i()),n=Mt.pInt(o[1]),a=0,r=t(e).offset().top;r>0&&(r+=Mt.pInt(o[2]),a=Gt.height()-r,a>n&&(n=a),t(e).css({height:n,"min-height":n}))}},s.bindingHandlers.appendDom={update:function(e,i){t(e).hide().empty().append(s.utils.unwrapObservable(i())).show()}},s.bindingHandlers.draggable={init:function(i,o,n){if(!kt.bMobileDevice){var a=100,r=3,l=n(),c=l&&l.droppableSelector?l.droppableSelector:"",u={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};c&&(u.drag=function(s){t(c).each(function(){var i=null,o=null,n=t(this),l=n.offset(),c=l.top+n.height();e.clearInterval(n.data("timerScroll")),n.data("timerScroll",!1),s.pageX>=l.left&&s.pageX<=l.left+n.width()&&(s.pageY>=c-a&&s.pageY<=c&&(i=function(){n.scrollTop(n.scrollTop()+r),Mt.windowResize()},n.data("timerScroll",e.setInterval(i,10)),i()),s.pageY>=l.top&&s.pageY<=l.top+a&&(o=function(){n.scrollTop(n.scrollTop()-r),Mt.windowResize()},n.data("timerScroll",e.setInterval(o,10)),o()))})},u.stop=function(){t(c).each(function(){e.clearInterval(t(this).data("timerScroll")),t(this).data("timerScroll",!1)})}),u.helper=function(e){return o()(e&&e.target?s.dataFor(e.target):null)},t(i).draggable(u).on("mousedown",function(){Mt.removeInFocus()})}}},s.bindingHandlers.droppable={init:function(e,s,i){if(!kt.bMobileDevice){var o=s(),n=i(),a=n&&n.droppableOver?n.droppableOver:null,r=n&&n.droppableOut?n.droppableOut:null,l={tolerance:"pointer",hoverClass:"droppableHover"};o&&(l.drop=function(e,t){o(e,t)},a&&(l.over=function(e,t){a(e,t)}),r&&(l.out=function(e,t){r(e,t)}),t(e).droppable(l))}}},s.bindingHandlers.nano={init:function(e){kt.bDisableNanoScroll||t(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},s.bindingHandlers.saveTrigger={init:function(e){var s=t(e);s.data("save-trigger-type",s.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===s.data("save-trigger-type")?s.append('  ').addClass("settings-saved-trigger"):s.addClass("settings-saved-trigger-input")},update:function(e,i){var o=s.utils.unwrapObservable(i()),n=t(e);if("custom"===n.data("save-trigger-type"))switch(o.toString()){case"1":n.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":n.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":n.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:n.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":n.addClass("success").removeClass("error");break;case"0":n.addClass("error").removeClass("success");break;case"-2":break;default:n.removeClass("error success")}}},s.bindingHandlers.emailsTags={init:function(e,s){var i=t(e),o=s(),n=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};i.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:n,inputDelimiters:[",",";"],autoCompleteSource:function(e,t){jt.getAutocomplete(e.term,function(e){t(r.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return r.map(e,function(e){var t=Mt.trim(e),s=null;return""!==t?(s=new v,s.mailsoParse(t),s.clearDuplicateName(),[s.toLine(!1),s]):[t,null]})},change:r.bind(function(e){i.data("EmailsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){i.data("EmailsTagsValue")!==e&&(i.val(e),i.data("EmailsTagsValue",e),i.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&i.inputosaurus("focus")})}},s.bindingHandlers.contactTags={init:function(e,s){var i=t(e),o=s(),n=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};i.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:n,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:function(e,t){jt.getContactsTagsAutocomplete(e.term,function(e){t(r.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return r.map(e,function(e){var t=Mt.trim(e),s=null;return""!==t?(s=new T,s.name(t),[s.toLine(!1),s]):[t,null]})},change:r.bind(function(e){i.data("ContactsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){i.data("ContactsTagsValue")!==e&&(i.val(e),i.data("ContactsTagsValue",e),i.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&i.inputosaurus("focus")})}},s.bindingHandlers.command={init:function(e,i,o,n){var a=t(e),r=i();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),s.bindingHandlers[a.is("form")?"submit":"click"].init.apply(n,arguments)},update:function(e,s){var i=!0,o=t(e),n=s();i=n.enabled(),o.toggleClass("command-not-enabled",!i),i&&(i=n.canExecute(),o.toggleClass("command-can-not-be-execute",!i)),o.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(o.is("input")||o.is("button"))&&o.prop("disabled",!i)}},s.extenders.trimmer=function(e){var t=s.computed({read:e,write:function(t){e(Mt.trim(t.toString()))},owner:this});return t(e()),t},s.extenders.posInterer=function(e,t){var i=s.computed({read:e,write:function(s){var i=Mt.pInt(s.toString(),t);0>=i&&(i=t),i===e()&&""+i!=""+s&&e(i+1),e(i)}});return i(e()),i},s.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},s.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},s.extenders.falseTimeout=function(t,s){return t.iTimeout=0,t.subscribe(function(i){i&&(e.clearTimeout(t.iTimeout),t.iTimeout=e.setTimeout(function(){t(!1),t.iTimeout=0},Mt.pInt(s)))}),t},s.observable.fn.validateNone=function(){return this.hasError=s.observable(!1),this},s.observable.fn.validateEmail=function(){return this.hasError=s.observable(!1),this.subscribe(function(e){e=Mt.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateSimpleEmail=function(){return this.hasError=s.observable(!1),this.subscribe(function(e){e=Mt.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateFunc=function(e){return this.hasFuncError=s.observable(!1),Mt.isFunc(e)&&(this.subscribe(function(t){this.hasFuncError(!e(t))},this),this.valueHasMutated()),this},u.prototype.root=function(){return this.sBase},u.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},u.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},u.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},u.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},u.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},u.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},u.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},u.prototype.change=function(t){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+e.encodeURIComponent(t)+"/"},u.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},u.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},u.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},u.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},u.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},u.prototype.settings=function(e){var t=this.sBase+"settings";return Mt.isUnd(e)||""===e||(t+="/"+e),t},u.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},u.prototype.mailBox=function(e,t,s){t=Mt.isNormal(t)?Mt.pInt(t):1,s=Mt.pString(s);var i=this.sBase+"mailbox/";return""!==e&&(i+=encodeURI(e)),t>1&&(i=i.replace(/[\/]+$/,""),i+="/p"+t),""!==s&&(i=i.replace(/[\/]+$/,""),i+="/"+encodeURI(s)),i},u.prototype.phpInfo=function(){return this.sServer+"Info"},u.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},u.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},u.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},u.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},u.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},u.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=Mt.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},u.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},u.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},u.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},u.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},u.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},Dt.oViewModelsHooks={},Dt.oSimpleHooks={},Dt.regViewModelHook=function(e,t){t&&(t.__hookName=e)},Dt.addHook=function(e,t){Mt.isFunc(t)&&(Mt.isArray(Dt.oSimpleHooks[e])||(Dt.oSimpleHooks[e]=[]),Dt.oSimpleHooks[e].push(t))},Dt.runHook=function(e,t){Mt.isArray(Dt.oSimpleHooks[e])&&(t=t||[],r.each(Dt.oSimpleHooks[e],function(e){e.apply(null,t)}))},Dt.mainSettingsGet=function(e){return jt?jt.settingsGet(e):null},Dt.remoteRequest=function(e,t,s,i,o,n){jt&&jt.remote().defaultRequest(e,t,s,i,o,n)},Dt.settingsGet=function(e,t){var s=Dt.mainSettingsGet("Plugins");return s=s&&Mt.isUnd(s[e])?null:s[e],s?Mt.isUnd(s[t])?null:s[t]:null},d.prototype.blurTrigger=function(){if(this.fOnBlur){var t=this;e.clearTimeout(t.iBlurTimer),t.iBlurTimer=e.setTimeout(function(){t.fOnBlur()},200)}},d.prototype.focusTrigger=function(){this.fOnBlur&&e.clearTimeout(this.iBlurTimer)},d.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},d.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},d.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},d.prototype.getData=function(){return this.editor?"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain?this.editor.__plain.getRawData():this.editor.getData():""},d.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"))},d.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},d.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()}},d.prototype.init=function(){if(this.$element&&this.$element[0]){var t=this,s=kt.oHtmlEditorDefaultConfig,i=jt.settingsGet("Language"),o=!!jt.settingsGet("AllowHtmlEditorSourceButton");o&&s.toolbarGroups&&!s.toolbarGroups.__SourceInited&&(s.toolbarGroups.__SourceInited=!0,s.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),s.language=kt.oHtmlEditorLangsMap[i]||"en",e.CKEDITOR.env&&(e.CKEDITOR.env.isCompatible=!0),t.editor=e.CKEDITOR.appendTo(t.$element[0],s),t.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),t.editor.on("blur",function(){t.blurTrigger()}),t.editor.on("mode",function(){t.blurTrigger(),t.fOnModeChange&&t.fOnModeChange("plain"!==t.editor.mode)}),t.editor.on("focus",function(){t.focusTrigger()}),t.fOnReady&&t.editor.on("instanceReady",function(){t.editor.setKeystroke(e.CKEDITOR.CTRL+65,"selectAll"),t.fOnReady(),t.__resizable=!0,t.resize()})}},d.prototype.focus=function(){this.editor&&this.editor.focus()},d.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},d.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},d.prototype.clear=function(e){this.setHtml("",e)},h.prototype.itemSelected=function(e){this.isListChecked()?e||(this.oCallbacks.onItemSelect||this.emptyFunction)(e||null):e&&(this.oCallbacks.onItemSelect||this.emptyFunction)(e)},h.prototype.goDown=function(e){this.newSelectPosition(Lt.EventKeyCode.Down,!1,e)},h.prototype.goUp=function(e){this.newSelectPosition(Lt.EventKeyCode.Up,!1,e)},h.prototype.init=function(e,i,o){if(this.oContentVisible=e,this.oContentScrollable=i,o=o||"all",this.oContentVisible&&this.oContentScrollable){var n=this;t(this.oContentVisible).on("selectstart",function(e){e&&e.preventDefault&&e.preventDefault()}).on("click",this.sItemSelector,function(e){n.actionClick(s.dataFor(this),e)}).on("click",this.sItemCheckedSelector,function(e){var t=s.dataFor(this);t&&(e&&e.shiftKey?n.actionClick(t,e):(n.focusedItem(t),t.checked(!t.checked())))}),c("enter",o,function(){return n.focusedItem()&&!n.focusedItem().selected()?(n.actionClick(n.focusedItem()),!1):!0}),c("ctrl+up, command+up, ctrl+down, command+down",o,function(){return!1}),c("up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space",o,function(e,t){if(e&&t&&t.shortcut){var s=0;switch(t.shortcut){case"up":case"shift+up":s=Lt.EventKeyCode.Up;break;case"down":case"shift+down":s=Lt.EventKeyCode.Down;break;case"insert":s=Lt.EventKeyCode.Insert;break;case"space":s=Lt.EventKeyCode.Space;break; case"home":s=Lt.EventKeyCode.Home;break;case"end":s=Lt.EventKeyCode.End;break;case"pageup":s=Lt.EventKeyCode.PageUp;break;case"pagedown":s=Lt.EventKeyCode.PageDown}if(s>0)return n.newSelectPosition(s,c.shift),!1}})}},h.prototype.autoSelect=function(e){this.bAutoSelect=!!e},h.prototype.getItemUid=function(e){var t="",s=this.oCallbacks.onItemGetUid||null;return s&&e&&(t=s(e)),t.toString()},h.prototype.newSelectPosition=function(e,t,s){var i=0,o=10,n=!1,a=!1,l=null,c=this.list(),u=c?c.length:0,d=this.focusedItem();if(u>0)if(d){if(d)if(Lt.EventKeyCode.Down===e||Lt.EventKeyCode.Up===e||Lt.EventKeyCode.Insert===e||Lt.EventKeyCode.Space===e)r.each(c,function(t){if(!a)switch(e){case Lt.EventKeyCode.Up:d===t?a=!0:l=t;break;case Lt.EventKeyCode.Down:case Lt.EventKeyCode.Insert:n?(l=t,a=!0):d===t&&(n=!0)}});else if(Lt.EventKeyCode.Home===e||Lt.EventKeyCode.End===e)Lt.EventKeyCode.Home===e?l=c[0]:Lt.EventKeyCode.End===e&&(l=c[c.length-1]);else if(Lt.EventKeyCode.PageDown===e){for(;u>i;i++)if(d===c[i]){i+=o,i=i>u-1?u-1:i,l=c[i];break}}else if(Lt.EventKeyCode.PageUp===e)for(i=u;i>=0;i--)if(d===c[i]){i-=o,i=0>i?0:i,l=c[i];break}}else Lt.EventKeyCode.Down===e||Lt.EventKeyCode.Insert===e||Lt.EventKeyCode.Space===e||Lt.EventKeyCode.Home===e||Lt.EventKeyCode.PageUp===e?l=c[0]:(Lt.EventKeyCode.Up===e||Lt.EventKeyCode.End===e||Lt.EventKeyCode.PageDown===e)&&(l=c[c.length-1]);l?(this.focusedItem(l),d&&(t?(Lt.EventKeyCode.Up===e||Lt.EventKeyCode.Down===e)&&d.checked(!d.checked()):(Lt.EventKeyCode.Insert===e||Lt.EventKeyCode.Space===e)&&d.checked(!d.checked())),!this.bAutoSelect&&!s||this.isListChecked()||Lt.EventKeyCode.Space===e||this.selectedItem(l),this.scrollToFocused()):d&&(!t||Lt.EventKeyCode.Up!==e&&Lt.EventKeyCode.Down!==e?(Lt.EventKeyCode.Insert===e||Lt.EventKeyCode.Space===e)&&d.checked(!d.checked()):d.checked(!d.checked()),this.focusedItem(d))},h.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,s=t(this.sItemFocusedSelector,this.oContentScrollable),i=s.position(),o=this.oContentVisible.height(),n=s.outerHeight();return i&&(i.top<0||i.top+n>o)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-o+n+e),!0):!1},h.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},h.prototype.eventClickFunction=function(e,t){var s=this.getItemUid(e),i=0,o=0,n=null,a="",r=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==s&&""!==this.sLastUid&&s!==this.sLastUid)for(c=this.list(),u=e.checked(),i=0,o=c.length;o>i;i++)n=c[i],a=this.getItemUid(n),r=!1,(a===this.sLastUid||a===s)&&(r=!0),r&&(l=!l),(l||r)&&n.checked(u);this.sLastUid=""===s?"":s},h.prototype.actionClick=function(e,t){if(e){var s=!0,i=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(s=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(s=!1,""===this.sLastUid&&(this.sLastUid=i),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),s&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},h.prototype.on=function(e,t){this.oCallbacks[e]=t},p.supported=function(){return!0},p.prototype.set=function(e,s){var i=t.cookie(It.Values.ClientSideCookieIndexName),o=!1,n=null;try{n=null===i?null:JSON.parse(i),n||(n={}),n[e]=s,t.cookie(It.Values.ClientSideCookieIndexName,JSON.stringify(n),{expires:30}),o=!0}catch(a){}return o},p.prototype.get=function(e){var s=t.cookie(It.Values.ClientSideCookieIndexName),i=null;try{i=null===s?null:JSON.parse(s),i=i&&!Mt.isUnd(i[e])?i[e]:null}catch(o){}return i},m.supported=function(){return!!e.localStorage},m.prototype.set=function(t,s){var i=e.localStorage[It.Values.ClientSideCookieIndexName]||null,o=!1,n=null;try{n=null===i?null:JSON.parse(i),n||(n={}),n[t]=s,e.localStorage[It.Values.ClientSideCookieIndexName]=JSON.stringify(n),o=!0}catch(a){}return o},m.prototype.get=function(t){var s=e.localStorage[It.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===s?null:JSON.parse(s),i=i&&!Mt.isUnd(i[t])?i[t]:null}catch(o){}return i},g.prototype.oDriver=null,g.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},g.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},f.prototype.bootstart=function(){},b.prototype.sPosition="",b.prototype.sTemplate="",b.prototype.viewModelName="",b.prototype.viewModelDom=null,b.prototype.viewModelTemplate=function(){return this.sTemplate},b.prototype.viewModelPosition=function(){return this.sPosition},b.prototype.cancelCommand=b.prototype.closeCommand=function(){},b.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=jt.data().keyScope(),jt.data().keyScope(this.sDefaultKeyScope)},b.prototype.restoreKeyScope=function(){jt.data().keyScope(this.sCurrentKeyScope)},b.prototype.registerPopupKeyDown=function(){var e=this;Gt.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&Lt.EventKeyCode.Esc===t.keyCode)return Mt.delegateRun(e,"cancelCommand"),!1;if(Lt.EventKeyCode.Backspace===t.keyCode&&!Mt.inFocus())return!1}return!0})},y.prototype.oCross=null,y.prototype.sScreenName="",y.prototype.aViewModels=[],y.prototype.viewModels=function(){return this.aViewModels},y.prototype.screenName=function(){return this.sScreenName},y.prototype.routes=function(){return null},y.prototype.__cross=function(){return this.oCross},y.prototype.__start=function(){var e=this.routes(),t=null,s=null;Mt.isNonEmptyArray(e)&&(s=r.bind(this.onRoute||Mt.emptyFunction,this),t=i.create(),r.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},S.constructorEnd=function(e){Mt.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},S.prototype.sDefaultScreenName="",S.prototype.oScreens={},S.prototype.oBoot=null,S.prototype.oCurrentScreen=null,S.prototype.hideLoading=function(){t("#rl-loading").hide()},S.prototype.routeOff=function(){o.changed.active=!1},S.prototype.routeOn=function(){o.changed.active=!0},S.prototype.setBoot=function(e){return Mt.isNormal(e)&&(this.oBoot=e),this},S.prototype.screen=function(e){return""===e||Mt.isUnd(this.oScreens[e])?null:this.oScreens[e]},S.prototype.buildViewModel=function(e,i){if(e&&!e.__builded){var o=new e(i),n=o.viewModelPosition(),a=t("#rl-content #rl-"+n.toLowerCase()),l=null;e.__builded=!0,e.__vm=o,o.data=jt.data(),o.viewModelName=e.__name,a&&1===a.length?(l=t("
").addClass("rl-view-model").addClass("RL-"+o.viewModelTemplate()).hide(),l.appendTo(a),o.viewModelDom=l,e.__dom=l,"Popups"===n&&(o.cancelCommand=o.closeCommand=Mt.createCommand(o,function(){xt.hideScreenPopup(e)}),o.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),jt.popupVisibilityNames.push(this.viewModelName),o.viewModelDom.css("z-index",3e3+jt.popupVisibilityNames().length+10),Mt.delegateRun(this,"onFocus",[],500)):(Mt.delegateRun(this,"onHide"),this.restoreKeyScope(),jt.popupVisibilityNames.remove(this.viewModelName),o.viewModelDom.css("z-index",2e3),kt.tooltipTrigger(!kt.tooltipTrigger()),r.delay(function(){t.viewModelDom.hide()},300))},o)),Dt.runHook("view-model-pre-build",[e.__name,o,l]),s.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:o.viewModelTemplate()}}},o),Mt.delegateRun(o,"onBuild",[l]),o&&"Popups"===n&&o.registerPopupKeyDown(),Dt.runHook("view-model-post-build",[e.__name,o,l])):Mt.log("Cannot find view model position: "+n)}return e?e.__vm:null},S.prototype.applyExternal=function(e,t){e&&t&&s.applyBindings(e,t)},S.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),Dt.runHook("view-model-on-hide",[e.__name,e.__vm]))},S.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),Mt.delegateRun(e.__vm,"onShow",t||[]),Dt.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},S.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},S.prototype.screenOnRoute=function(e,t){var s=this,i=null,o=null;""===Mt.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(i=this.screen(e),i||(i=this.screen(this.sDefaultScreenName),i&&(t=e+"/"+t,e=this.sDefaultScreenName)),i&&i.__started&&(i.__builded||(i.__builded=!0,Mt.isNonEmptyArray(i.viewModels())&&r.each(i.viewModels(),function(e){this.buildViewModel(e,i)},this),Mt.delegateRun(i,"onBuild")),r.defer(function(){s.oCurrentScreen&&(Mt.delegateRun(s.oCurrentScreen,"onHide"),Mt.isNonEmptyArray(s.oCurrentScreen.viewModels())&&r.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),Mt.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=i,s.oCurrentScreen&&(Mt.delegateRun(s.oCurrentScreen,"onShow"),Dt.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),Mt.isNonEmptyArray(s.oCurrentScreen.viewModels())&&r.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),Mt.delegateRun(e.__vm,"onShow"),Mt.delegateRun(e.__vm,"onFocus",[],200),Dt.runHook("view-model-on-show",[e.__name,e.__vm]))},s)),o=i.__cross(),o&&o.parse(t)})))},S.prototype.startScreens=function(e){t("#rl-content").css({visibility:"hidden"}),r.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)},this),r.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),Dt.runHook("screen-pre-start",[e.screenName(),e]),Mt.delegateRun(e,"onStart"),Dt.runHook("screen-post-start",[e.screenName(),e]))},this);var s=i.create();s.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,r.bind(this.screenOnRoute,this)),o.initialized.add(s.parse,s),o.changed.add(s.parse,s),o.init(),t("#rl-content").css({visibility:"visible"}),r.delay(function(){Bt.removeClass("rl-started-trigger").addClass("rl-started")},50)},S.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=Mt.isUnd(s)?!1:!!s,(Mt.isUnd(t)?1:!t)?(o.changed.active=!0,o[s?"replaceHash":"setHash"](e),o.setHash(e)):(o.changed.active=!1,o[s?"replaceHash":"setHash"](e),o.changed.active=!0)},S.prototype.bootstart=function(){return this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart(),this},xt=new S,v.newInstanceFromJson=function(e){var t=new v;return t.initByJson(e)?t:null},v.prototype.name="",v.prototype.email="",v.prototype.privateType=null,v.prototype.clear=function(){this.email="",this.name="",this.privateType=null},v.prototype.validate=function(){return""!==this.name||""!==this.email},v.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},v.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},v.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=Lt.EmailType.Facebook),null===this.privateType&&(this.privateType=Lt.EmailType.Default)),this.privateType},v.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},v.prototype.parse=function(e){this.clear(),e=Mt.trim(e);var t=/(?:"([^"]+)")? ?,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},v.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=Mt.trim(e.Name),this.email=Mt.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},v.prototype.toLine=function(e,t,s){var i="";return""!==this.email&&(t=Mt.isUnd(t)?!1:!!t,s=Mt.isUnd(s)?!1:!!s,e&&""!==this.name?i=t?'
")+'" target="_blank" tabindex="-1">'+Mt.encodeHtml(this.name)+"":s?Mt.encodeHtml(this.name):this.name:(i=this.email,""!==this.name?t?i=Mt.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+Mt.encodeHtml(i)+""+Mt.encodeHtml(">"):(i='"'+this.name+'" <'+i+">",s&&(i=Mt.encodeHtml(i))):t&&(i=''+Mt.encodeHtml(this.email)+""))),i},v.prototype.mailsoParse=function(e){if(e=Mt.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)},i="",o="",n="",a=!1,r=!1,l=!1,c=null,u=0,d=0,h=0;h0&&0===i.length&&(i=t(e,0,h)),r=!0,u=h);break;case">":r&&(d=h,o=t(e,u+1,d-u-1),e=s(e,"",u,d-u+1),d=0,h=0,u=0,r=!1);break;case"(":a||r||l||(l=!0,u=h);break;case")":l&&(d=h,n=t(e,u+1,d-u-1),e=s(e,"",u,d-u+1),d=0,h=0,u=0,l=!1);break;case"\\":h++}h++}return 0===o.length&&(c=e.match(/[^@\s]+@\S+/i),c&&c[0]?o=c[0]:i=e),o.length>0&&0===i.length&&0===n.length&&(i=e.replace(o,"")),o=Mt.trim(o).replace(/^[<]+/,"").replace(/[>]+$/,""),i=Mt.trim(i).replace(/^["']+/,"").replace(/["']+$/,""),n=Mt.trim(n).replace(/^[(]+/,"").replace(/[)]+$/,""),i=i.replace(/\\\\(.)/,"$1"),n=n.replace(/\\\\(.)/,"$1"),this.name=i,this.email=o,this.clearDuplicateName(),!0},v.prototype.inputoTagLine=function(){return 0+$/,""),t=!0),t},F.prototype.isImage=function(){return-1o;o++)i.push(e[o].toLine(t,s));return i.join(", ")},E.initEmailsFromJson=function(e){var t=0,s=0,i=null,o=[];if(Mt.isNonEmptyArray(e))for(t=0,s=e.length;s>t;t++)i=v.newInstanceFromJson(e[t]),i&&o.push(i);return o},E.replyHelper=function(e,t,s){if(e&&0i;i++)Mt.isUnd(t[e[i].email])&&(t[e[i].email]=!0,s.push(e[i]))},E.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(Lt.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.toEmailsString(""),this.senderEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isRtl(!1),this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(Lt.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},E.prototype.computeSenderEmail=function(){var e=jt.data().sentFolder(),t=jt.data().draftFolder();this.senderEmailsString(this.folderFullNameRaw===e||this.folderFullNameRaw===t?this.toEmailsString():this.fromEmailString())},E.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(Mt.pInt(e.Size)),this.from=E.initEmailsFromJson(e.From),this.to=E.initEmailsFromJson(e.To),this.cc=E.initEmailsFromJson(e.Cc),this.bcc=E.initEmailsFromJson(e.Bcc),this.replyTo=E.initEmailsFromJson(e.ReplyTo),this.deliveredTo=E.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),this.dateTimeStampInUTC(Mt.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(E.emailsToLine(this.from,!0)),this.toEmailsString(E.emailsToLine(this.to,!0)),this.parentUid(Mt.pInt(e.ParentThread)),this.threads(Mt.isArray(e.Threads)?e.Threads:[]),this.threadsLen(Mt.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},E.prototype.initUpdateByMessageJson=function(e){var t=!1,s=Lt.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(s=Mt.pInt(e.Priority),this.priority(-1t;t++)i=F.newInstanceFromJson(e["@Collection"][t]),i&&(""!==i.cidWithOutTags&&0+$/,""),t=r.find(s,function(t){return e===t.cidWithOutTags})),t||null},E.prototype.findAttachmentByContentLocation=function(e){var t=null,s=this.attachments();return Mt.isNonEmptyArray(s)&&(t=r.find(s,function(t){return e===t.contentLocation})),t||null},E.prototype.messageId=function(){return this.sMessageId},E.prototype.inReplyTo=function(){return this.sInReplyTo},E.prototype.references=function(){return this.sReferences},E.prototype.fromAsSingleEmail=function(){return Mt.isArray(this.from)&&this.from[0]?this.from[0].email:""},E.prototype.viewLink=function(){return jt.link().messageViewLink(this.requestHash)},E.prototype.downloadLink=function(){return jt.link().messageDownloadLink(this.requestHash)},E.prototype.replyEmails=function(e){var t=[],s=Mt.isUnd(e)?{}:e;return E.replyHelper(this.replyTo,s,t),0===t.length&&E.replyHelper(this.from,s,t),t},E.prototype.replyAllEmails=function(e){var t=[],s=[],i=Mt.isUnd(e)?{}:e;return E.replyHelper(this.replyTo,i,t),0===t.length&&E.replyHelper(this.from,i,t),E.replyHelper(this.to,i,t),E.replyHelper(this.cc,i,s),[t,s]},E.prototype.textBodyToString=function(){return this.body?this.body.html():""},E.prototype.attachmentsToStringLine=function(){var e=r.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&o&&!n&&i.attr("src",o)}),s&&e.setTimeout(function(){i.print()},100))})},E.prototype.printMessage=function(){this.viewPopupMessage(!0)},E.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},E.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.toEmailsString(e.toEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(Lt.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},E.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var s="";e=Mt.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),s=this.proxy?"data-x-additional-src":"data-x-src",t("["+s+"]",this.body).each(function(){e&&t(this).is("img")?t(this).addClass("lazy").attr("data-original",t(this).attr(s)).removeAttr(s):t(this).attr("src",t(this).attr(s)).removeAttr(s)}),s=this.proxy?"data-x-additional-style-url":"data-x-style-url",t("["+s+"]",this.body).each(function(){var e=Mt.trim(t(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",t(this).attr("style",e+t(this).attr(s)).removeAttr(s)}),e&&(t("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t(".RL-MailMessageView .messageView .messageItem .content")[0]}),Gt.resize()),Mt.windowResize(500)}},E.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=Mt.isUnd(e)?!1:e;var s=this;t("[data-x-src-cid]",this.body).each(function(){var i=s.findAttachmentByCid(t(this).attr("data-x-src-cid"));i&&i.download&&(e&&t(this).is("img")?t(this).addClass("lazy").attr("data-original",i.linkPreview()):t(this).attr("src",i.linkPreview()))}),t("[data-x-src-location]",this.body).each(function(){var i=s.findAttachmentByContentLocation(t(this).attr("data-x-src-location"));i||(i=s.findAttachmentByCid(t(this).attr("data-x-src-location"))),i&&i.download&&(e&&t(this).is("img")?t(this).addClass("lazy").attr("data-original",i.linkPreview()):t(this).attr("src",i.linkPreview()))}),t("[data-x-style-cid]",this.body).each(function(){var e="",i="",o=s.findAttachmentByCid(t(this).attr("data-x-style-cid"));o&&o.linkPreview&&(i=t(this).attr("data-x-style-cid-name"),""!==i&&(e=Mt.trim(t(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",t(this).attr("style",e+i+": url('"+o.linkPreview()+"')")))}),e&&!function(e,t){r.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(t("img.lazy",s.body),t(".RL-MailMessageView .messageView .messageItem .content")[0]),Mt.windowResize(500)}},E.prototype.storeDataToDom=function(){this.body&&(this.body.data("rl-is-rtl",!!this.isRtl()),this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw),jt.data().capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser())))},E.prototype.storePgpVerifyDataToDom=function(){this.body&&jt.data().capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},E.prototype.fetchDataToDom=function(){this.body&&(this.isRtl(!!this.body.data("rl-is-rtl")),this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=Mt.pString(this.body.data("rl-plain-raw")),jt.data().capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.None),this.pgpSignedVerifyUser("")))},E.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var s=[],i=null,o=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",n=jt.data().findPublicKeysByEmail(o),a=null,l=null,c="";this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""); -try{i=e.openpgp.cleartext.readArmored(this.plainRaw),i&&i.getText&&(this.pgpSignedVerifyStatus(n.length?Lt.SignedVerifyStatus.Unverified:Lt.SignedVerifyStatus.UnknownPublicKeys),s=i.verify(n),s&&0').text(c)).html(),zt.empty(),this.replacePlaneTextBody(c)))))}catch(u){}this.storePgpVerifyDataToDom()}},E.prototype.decryptPgpEncryptedMessage=function(s){if(this.isPgpEncrypted()){var i=[],o=null,n=null,a=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=jt.data().findPublicKeysByEmail(a),c=jt.data().findSelfPrivateKey(s),u=null,d=null,h="";this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),c||this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.UnknownPrivateKey);try{o=e.openpgp.message.readArmored(this.plainRaw),o&&c&&o.decrypt&&(this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.Unverified),n=o.decrypt(c),n&&(i=n.verify(l),i&&0').text(h)).html(),zt.empty(),this.replacePlaneTextBody(h)))}catch(p){}this.storePgpVerifyDataToDom()}},E.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},E.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},N.newInstanceFromJson=function(e){var t=new N;return t.initByJson(e)?t.initComputed():null},N.prototype.initComputed=function(){return this.hasSubScribedSubfolders=s.computed(function(){return!!r.find(this.subFolders(),function(e){return e.subScribed()&&!e.isSystemFolder()})},this),this.canBeEdited=s.computed(function(){return Lt.FolderType.User===this.type()&&this.existen&&this.selectable},this),this.visible=s.computed(function(){var e=this.subScribed(),t=this.hasSubScribedSubfolders();return e||t&&(!this.existen||!this.selectable)},this),this.isSystemFolder=s.computed(function(){return Lt.FolderType.User!==this.type()},this),this.hidden=s.computed(function(){var e=this.isSystemFolder(),t=this.hasSubScribedSubfolders();return e&&!t||!this.selectable&&!t},this),this.selectableForFolderList=s.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=s.computed({read:this.privateMessageCountAll,write:function(e){Mt.isPosNumeric(e,!0)?this.privateMessageCountAll(e):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=s.computed({read:this.privateMessageCountUnread,write:function(e){Mt.isPosNumeric(e,!0)?this.privateMessageCountUnread(e):this.privateMessageCountUnread.valueHasMutated()},owner:this}),this.printableUnreadCount=s.computed(function(){var e=this.messageCountAll(),t=this.messageCountUnread(),s=this.type();if(Lt.FolderType.Inbox===s&&jt.data().foldersInboxUnreadCount(t),e>0){if(Lt.FolderType.Draft===s)return""+e;if(t>0&&Lt.FolderType.Trash!==s&&Lt.FolderType.Archive!==s&&Lt.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=s.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=s.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){Mt.timeOutAction("folder-list-folder-visibility-change",function(){Gt.trigger("folder-list-folder-visibility-change")},100)}),this.localName=s.computed(function(){kt.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case Lt.FolderType.Inbox:t=Mt.i18n("FOLDER_LIST/INBOX_NAME");break;case Lt.FolderType.SentItems:t=Mt.i18n("FOLDER_LIST/SENT_NAME");break;case Lt.FolderType.Draft:t=Mt.i18n("FOLDER_LIST/DRAFTS_NAME");break;case Lt.FolderType.Spam:t=Mt.i18n("FOLDER_LIST/SPAM_NAME");break;case Lt.FolderType.Trash:t=Mt.i18n("FOLDER_LIST/TRASH_NAME");break;case Lt.FolderType.Archive:t=Mt.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=s.computed(function(){kt.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case Lt.FolderType.Inbox:e="("+Mt.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case Lt.FolderType.SentItems:e="("+Mt.i18n("FOLDER_LIST/SENT_NAME")+")";break;case Lt.FolderType.Draft:e="("+Mt.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case Lt.FolderType.Spam:e="("+Mt.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case Lt.FolderType.Trash:e="("+Mt.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case Lt.FolderType.Archive:e="("+Mt.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=s.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=s.computed(function(){return 0"},I.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},I.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+Mt.quoteName(e)+'" <'+this.email()+">"},L.prototype.removeSelf=function(){this.canBeDeleted()&&this.parentList.remove(this)},P.prototype.removeSelf=function(){this.canBeDeleted()&&this.parentList.remove(this)},M.prototype.addCondition=function(){this.conditions.push(new P(this.conditions,this.conditionsCanBeDeleted))},M.prototype.addAction=function(){this.actions.push(new L(this.actions,this.actionsCanBeDeleted))},M.prototype.parse=function(e){var t=!1;return e&&"Object/Filter"===e["@Object"]&&(this.name(Mt.pString(e.Name)),t=!0),t},D.prototype.index=0,D.prototype.id="",D.prototype.guid="",D.prototype.user="",D.prototype.email="",D.prototype.armor="",D.prototype.isPrivate=!1,Mt.extendAsViewModel("PopupsFolderClearViewModel",O),O.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},O.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},Mt.extendAsViewModel("PopupsFolderCreateViewModel",k),k.prototype.sNoParentText="",k.prototype.simpleFolderNameValidation=function(e){return/^[^\\\/]+$/g.test(Mt.trim(e))},k.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},k.prototype.onShow=function(){this.clearPopup()},k.prototype.onFocus=function(){this.folderName.focused(!0)},Mt.extendAsViewModel("PopupsFolderSystemViewModel",_),_.prototype.sChooseOnText="",_.prototype.sUnuseText="",_.prototype.onShow=function(e){var t="";switch(e=Mt.isUnd(e)?Lt.SetSystemFoldersNotification.None:e){case Lt.SetSystemFoldersNotification.Sent:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case Lt.SetSystemFoldersNotification.Draft:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case Lt.SetSystemFoldersNotification.Spam:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case Lt.SetSystemFoldersNotification.Trash:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case Lt.SetSystemFoldersNotification.Archive:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},Mt.extendAsViewModel("PopupsComposeViewModel",U),U.prototype.openOpenPgpPopup=function(){if(this.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var e=this;xt.showScreenPopup(q,[function(t){e.editor(function(e){e.setPlain(t)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},U.prototype.reloadDraftFolder=function(){var e=jt.data().draftFolder();""!==e&&(jt.cache().setFolderHash(e,""),jt.data().currentFolderFullNameRaw()===e?jt.reloadMessageList(!0):jt.folderInformation(e))},U.prototype.findIdentityIdByMessage=function(e,t){var s={},i="",o=function(e){return e&&e.email&&s[e.email]?(i=s[e.email],!0):!1};if(this.bCapaAdditionalIdentities&&r.each(this.identities(),function(e){s[e.email()]=e.id}),s[jt.data().accountEmail()]=jt.data().accountEmail(),t)switch(e){case Lt.ComposeType.Empty:break;case Lt.ComposeType.Reply:case Lt.ComposeType.ReplyAll:case Lt.ComposeType.Forward:case Lt.ComposeType.ForwardAsAttachment:r.find(r.union(t.to,t.cc,t.bcc,t.deliveredTo),o);break;case Lt.ComposeType.Draft:r.find(r.union(t.from,t.replyTo),o)}return""===i&&(i=this.defaultIdentityID()),""===i&&(i=jt.data().accountEmail()),i},U.prototype.selectIdentity=function(e){e&&this.currentIdentityID(e.optValue)},U.prototype.formattedFrom=function(e){var t=jt.data().displayName(),s=jt.data().accountEmail();return""===t?s:(Mt.isUnd(e)?1:!e)?t+" ("+s+")":'"'+Mt.quoteName(t)+'" <'+s+">"},U.prototype.sendMessageResponse=function(t,s){var i=!1,o="";this.sending(!1),Lt.StorageResultType.Success===t&&s&&s.Result&&(i=!0,this.modalVisibility()&&Mt.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(s&&Lt.Notification.CantSaveMessage===s.ErrorCode?(this.sendSuccessButSaveError(!0),e.alert(Mt.trim(Mt.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=Mt.getNotification(s&&s.ErrorCode?s.ErrorCode:Lt.Notification.CantSendMessage,s&&s.ErrorMessage?s.ErrorMessage:""),this.sendError(!0),e.alert(o||Mt.getNotification(Lt.Notification.CantSendMessage)))),this.reloadDraftFolder()},U.prototype.saveMessageResponse=function(t,s){var i=!1,o=null;this.saving(!1),Lt.StorageResultType.Success===t&&s&&s.Result&&s.Result.NewFolder&&s.Result.NewUid&&(this.bFromDraft&&(o=jt.data().message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&jt.data().message(null)),this.draftFolder(s.Result.NewFolder),this.draftUid(s.Result.NewUid),this.modalVisibility()&&(this.savedTime(Math.round((new e.Date).getTime()/1e3)),this.savedOrSendingText(0s;s++)o.push(e[s].toLine(!!t));return o.join(", ")};if(s=s||null,s&&Mt.isNormal(s)&&(C=Mt.isArray(s)&&1===s.length?s[0]:Mt.isArray(s)?null:s),null!==f&&(g[f]=!0),this.currentIdentityID(this.findIdentityIdByMessage(w,C)),this.reset(),Mt.isNonEmptyArray(i)&&this.to(T(i)),""!==w&&C){switch(c=C.fullFormatDateValue(),u=C.subject(),v=C.aDraftInfo,d=t(C.body).clone(),Mt.removeBlockquoteSwitcher(d),h=d.html(),w){case Lt.ComposeType.Empty:break;case Lt.ComposeType.Reply:this.to(T(C.replyEmails(g))),this.subject(Mt.replySubjectAdd("Re",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["reply",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.ReplyAll:m=C.replyAllEmails(g),this.to(T(m[0])),this.cc(T(m[1])),this.subject(Mt.replySubjectAdd("Re",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["reply",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.references());break;case Lt.ComposeType.Forward:this.subject(Mt.replySubjectAdd("Fwd",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["forward",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.ForwardAsAttachment:this.subject(Mt.replySubjectAdd("Fwd",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["forward",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.Draft:this.to(T(C.to)),this.cc(T(C.cc)),this.bcc(T(C.bcc)),this.bFromDraft=!0,this.draftFolder(C.folderFullNameRaw),this.draftUid(C.uid),this.subject(u),this.prepearMessageAttachments(C,w),this.aDraftInfo=Mt.isNonEmptyArray(v)&&3===v.length?v:null,this.sInReplyTo=C.sInReplyTo,this.sReferences=C.sReferences;break;case Lt.ComposeType.EditAsNew:this.to(T(C.to)),this.cc(T(C.cc)),this.bcc(T(C.bcc)),this.subject(u),this.prepearMessageAttachments(C,w),this.aDraftInfo=Mt.isNonEmptyArray(v)&&3===v.length?v:null,this.sInReplyTo=C.sInReplyTo,this.sReferences=C.sReferences}switch(w){case Lt.ComposeType.Reply:case Lt.ComposeType.ReplyAll:n=C.fromToLine(!1,!0),p=Mt.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:c,EMAIL:n}),h="

"+p+":

"+h+"

";break;case Lt.ComposeType.Forward:n=C.fromToLine(!1,!0),a=C.toToLine(!1,!0),l=C.ccToLine(!1,!0),h="


"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+n+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+a+(0"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+l:"")+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+Mt.encodeHtml(c)+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+Mt.encodeHtml(u)+"

"+h;break;case Lt.ComposeType.ForwardAsAttachment:h=""}y&&""!==b&&Lt.ComposeType.EditAsNew!==w&&Lt.ComposeType.Draft!==w&&(h=this.convertSignature(b,T(C.from,!0))+"
"+h),this.editor(function(e){e.setHtml(h,!1),C.isHtml()||e.modeToggle(!1)})}else Lt.ComposeType.Empty===w?(h=this.convertSignature(b),this.editor(function(e){e.setHtml(h,!1),Lt.EditorDefaultType.Html!==jt.data().editorDefaultType()&&e.modeToggle(!1)})):Mt.isNonEmptyArray(s)&&r.each(s,function(e){o.addMessageAsAttachment(e)});S=this.getAttachmentsDownloadsForUpload(),Mt.isNonEmptyArray(S)&&jt.remote().messageUploadAttachments(function(e,t){if(Lt.StorageResultType.Success===e&&t&&t.Result){var s=null,i="";if(!o.viewModelVisibility())for(i in t.Result)t.Result.hasOwnProperty(i)&&(s=o.getAttachmentById(t.Result[i]),s&&s.tempName(i))}else o.setMessageAttachmentFailedDowbloadText()},S),this.triggerForResize()},U.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},U.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},U.prototype.tryToClosePopup=function(){var e=this;xt.isPopupVisible(Y)||xt.showScreenPopup(Y,[Mt.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&Mt.delegateRun(e,"closeCommand")}])},U.prototype.onBuild=function(){this.initUploader();var e=this,s=null;c("ctrl+q, command+q",Lt.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),c("ctrl+s, command+s",Lt.KeyState.Compose,function(){return e.saveCommand(),!1}),c("ctrl+enter, command+enter",Lt.KeyState.Compose,function(){return e.sendCommand(),!1}),c("esc",Lt.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),Gt.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(s=document.createElement("script"),s.type="text/javascript",s.src="https://www.dropbox.com/static/api/1/dropins.js",t(s).attr("id","dropboxjs").attr("data-app-key",jt.settingsGet("DropboxApiKey")),document.body.appendChild(s))},U.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},U.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=Mt.pInt(jt.settingsGet("AttachmentLimit")),s=new a({action:jt.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",r.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",r.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",r.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",r.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",r.bind(function(t,s,i){var o=null;Mt.isUnd(e[t])?(o=this.getAttachmentById(t),o&&(e[t]=o)):o=e[t],o&&o.progress(" - "+Math.floor(s/i*100)+"%")},this)).on("onSelect",r.bind(function(e,i){this.dragAndDropOver(!1);var o=this,n=Mt.isUnd(i.FileName)?"":i.FileName.toString(),a=Mt.isNormal(i.Size)?Mt.pInt(i.Size):null,r=new A(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(Mt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",r.bind(function(t){var s=null;Mt.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",r.bind(function(t,s,i){var o="",n=null,a=null,r=this.getAttachmentById(t);a=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=Mt.getUploadErrorDescByCode(n):a||(o=Mt.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&i>0&&n>i?(o.uploading(!1),o.error(Mt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(jt.remote().composeUploadExternals(function(e,t){var s=!1;o.uploading(!1),Lt.StorageResultType.Success===e&&t&&t.Result&&t.Result[o.id]&&(s=!0,o.tempName(t.Result[o.id])),s||o.error(Mt.getUploadErrorDescByCode(Lt.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},U.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,i=Mt.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=i.length,a=null,r=null,l=!1,c=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(Lt.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=i[o],l=!1,t){case Lt.ComposeType.Reply:case Lt.ComposeType.ReplyAll:l=r.isLinked;break;case Lt.ComposeType.Forward:case Lt.ComposeType.Draft:case Lt.ComposeType.EditAsNew:l=!0}l&&(a=new A(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},U.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},U.prototype.setMessageAttachmentFailedDowbloadText=function(){r.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(Mt.getUploadErrorDescByCode(Lt.UploadErrorCode.FileNoUploaded))},this)},U.prototype.isEmptyForm=function(e){e=Mt.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())},U.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!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.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},U.prototype.getAttachmentsDownloadsForUpload=function(){return r.map(r.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},U.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},Mt.extendAsViewModel("PopupsContactsViewModel",x),x.prototype.getPropertyPlceholder=function(e){var t="";switch(e){case Lt.ContactPropertyType.LastName:t="CONTACTS/PLACEHOLDER_ENTER_LAST_NAME";break;case Lt.ContactPropertyType.FirstName:t="CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME";break;case Lt.ContactPropertyType.Nick:t="CONTACTS/PLACEHOLDER_ENTER_NICK_NAME"}return t},x.prototype.addNewProperty=function(e,t){this.viewProperties.push(new w(e,t||"","",!0,this.getPropertyPlceholder(e)))},x.prototype.addNewOrFocusProperty=function(e,t){var s=r.find(this.viewProperties(),function(t){return e===t.type()});s?s.focused(!0):this.addNewProperty(e,t)},x.prototype.addNewTag=function(){this.viewTags.visibility(!0),this.viewTags.focusTrigger(!0)},x.prototype.addNewEmail=function(){this.addNewProperty(Lt.ContactPropertyType.Email,"Home")},x.prototype.addNewPhone=function(){this.addNewProperty(Lt.ContactPropertyType.Phone,"Mobile")},x.prototype.addNewWeb=function(){this.addNewProperty(Lt.ContactPropertyType.Web)},x.prototype.addNewNickname=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Nick)},x.prototype.addNewNotes=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Note)},x.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Birthday)},x.prototype.exportVcf=function(){jt.download(jt.link().exportContactsVcf())},x.prototype.exportCsv=function(){jt.download(jt.link().exportContactsCsv())},x.prototype.initUploader=function(){if(this.importUploaderButton()){var t=new a({action:jt.link().uploadContacts(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,disableDragAndDrop:!0,disableMultiple:!0,disableDocumentDropPrevent:!0,clickElement:this.importUploaderButton()});t&&t.on("onStart",r.bind(function(){this.contacts.importing(!0)},this)).on("onComplete",r.bind(function(t,s,i){this.contacts.importing(!1),this.reloadContactList(),t&&s&&i&&i.Result||e.alert(Mt.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},x.prototype.removeCheckedOrSelectedContactsFromList=function(){var e=this,t=this.contacts,s=this.currentContact(),i=this.contacts().length,o=this.contactsCheckedOrSelected();0=i&&(this.bDropPageAfterDelete=!0),r.delay(function(){r.each(o,function(e){t.remove(e)})},500))},x.prototype.deleteSelectedContacts=function(){00?i:0),Mt.isNonEmptyArray(s.Result.Tags)&&(n=r.map(s.Result.Tags,function(e){var t=new T;return t.parse(e)?t:null}),n=r.compact(n))),t.contactsCount(i),t.contacts(o),t.contactTags(n),t.contacts.loading(!1),t.viewClearSearch(""!==t.search())},s,It.Defaults.ContactsPerPage,this.search())},x.prototype.onBuild=function(e){this.oContentVisible=t(".b-list-content",e),this.oContentScrollable=t(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,Lt.KeyState.ContactList);var i=this;c("delete",Lt.KeyState.ContactList,function(){return i.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=s.dataFor(this);e&&(i.contactsPage(Mt.pInt(e.value)),i.reloadContactList())}),this.initUploader()},x.prototype.onShow=function(){xt.routeOff(),this.reloadContactList(!0)},x.prototype.onHide=function(){xt.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},Mt.extendAsViewModel("PopupsAdvancedSearchViewModel",V),V.prototype.buildSearchStringValue=function(e){return-1').text(c)).html(),zt.empty(),this.replacePlaneTextBody(c)))))}catch(u){}this.storePgpVerifyDataToDom()}},E.prototype.decryptPgpEncryptedMessage=function(s){if(this.isPgpEncrypted()){var i=[],o=null,n=null,a=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=jt.data().findPublicKeysByEmail(a),c=jt.data().findSelfPrivateKey(s),u=null,d=null,h="";this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),c||this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.UnknownPrivateKey);try{o=e.openpgp.message.readArmored(this.plainRaw),o&&c&&o.decrypt&&(this.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.Unverified),n=o.decrypt(c),n&&(i=n.verify(l),i&&0').text(h)).html(),zt.empty(),this.replacePlaneTextBody(h)))}catch(p){}this.storePgpVerifyDataToDom()}},E.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},E.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},N.newInstanceFromJson=function(e){var t=new N;return t.initByJson(e)?t.initComputed():null},N.prototype.initComputed=function(){return this.hasSubScribedSubfolders=s.computed(function(){return!!r.find(this.subFolders(),function(e){return e.subScribed()&&!e.isSystemFolder()})},this),this.canBeEdited=s.computed(function(){return Lt.FolderType.User===this.type()&&this.existen&&this.selectable},this),this.visible=s.computed(function(){var e=this.subScribed(),t=this.hasSubScribedSubfolders();return e||t&&(!this.existen||!this.selectable)},this),this.isSystemFolder=s.computed(function(){return Lt.FolderType.User!==this.type()},this),this.hidden=s.computed(function(){var e=this.isSystemFolder(),t=this.hasSubScribedSubfolders();return e&&!t||!this.selectable&&!t},this),this.selectableForFolderList=s.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=s.computed({read:this.privateMessageCountAll,write:function(e){Mt.isPosNumeric(e,!0)?this.privateMessageCountAll(e):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=s.computed({read:this.privateMessageCountUnread,write:function(e){Mt.isPosNumeric(e,!0)?this.privateMessageCountUnread(e):this.privateMessageCountUnread.valueHasMutated()},owner:this}),this.printableUnreadCount=s.computed(function(){var e=this.messageCountAll(),t=this.messageCountUnread(),s=this.type();if(Lt.FolderType.Inbox===s&&jt.data().foldersInboxUnreadCount(t),e>0){if(Lt.FolderType.Draft===s)return""+e;if(t>0&&Lt.FolderType.Trash!==s&&Lt.FolderType.Archive!==s&&Lt.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=s.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=s.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){Mt.timeOutAction("folder-list-folder-visibility-change",function(){Gt.trigger("folder-list-folder-visibility-change")},100)}),this.localName=s.computed(function(){kt.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case Lt.FolderType.Inbox:t=Mt.i18n("FOLDER_LIST/INBOX_NAME");break;case Lt.FolderType.SentItems:t=Mt.i18n("FOLDER_LIST/SENT_NAME");break;case Lt.FolderType.Draft:t=Mt.i18n("FOLDER_LIST/DRAFTS_NAME");break;case Lt.FolderType.Spam:t=Mt.i18n("FOLDER_LIST/SPAM_NAME");break;case Lt.FolderType.Trash:t=Mt.i18n("FOLDER_LIST/TRASH_NAME");break;case Lt.FolderType.Archive:t=Mt.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=s.computed(function(){kt.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case Lt.FolderType.Inbox:e="("+Mt.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case Lt.FolderType.SentItems:e="("+Mt.i18n("FOLDER_LIST/SENT_NAME")+")";break;case Lt.FolderType.Draft:e="("+Mt.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case Lt.FolderType.Spam:e="("+Mt.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case Lt.FolderType.Trash:e="("+Mt.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case Lt.FolderType.Archive:e="("+Mt.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=s.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=s.computed(function(){return 0"},I.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},I.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+Mt.quoteName(e)+'" <'+this.email()+">"},L.prototype.removeSelf=function(){this.canBeDeleted()&&this.parentList.remove(this)},P.prototype.removeSelf=function(){this.canBeDeleted()&&this.parentList.remove(this)},M.prototype.addCondition=function(){this.conditions.push(new P(this.conditions,this.conditionsCanBeDeleted))},M.prototype.addAction=function(){this.actions.push(new L(this.actions,this.actionsCanBeDeleted))},M.prototype.parse=function(e){var t=!1;return e&&"Object/Filter"===e["@Object"]&&(this.name(Mt.pString(e.Name)),t=!0),t},D.prototype.index=0,D.prototype.id="",D.prototype.guid="",D.prototype.user="",D.prototype.email="",D.prototype.armor="",D.prototype.isPrivate=!1,Mt.extendAsViewModel("PopupsFolderClearViewModel",O),O.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},O.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},Mt.extendAsViewModel("PopupsFolderCreateViewModel",k),k.prototype.sNoParentText="",k.prototype.simpleFolderNameValidation=function(e){return/^[^\\\/]+$/g.test(Mt.trim(e))},k.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},k.prototype.onShow=function(){this.clearPopup()},k.prototype.onFocus=function(){this.folderName.focused(!0)},Mt.extendAsViewModel("PopupsFolderSystemViewModel",_),_.prototype.sChooseOnText="",_.prototype.sUnuseText="",_.prototype.onShow=function(e){var t="";switch(e=Mt.isUnd(e)?Lt.SetSystemFoldersNotification.None:e){case Lt.SetSystemFoldersNotification.Sent:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case Lt.SetSystemFoldersNotification.Draft:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case Lt.SetSystemFoldersNotification.Spam:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case Lt.SetSystemFoldersNotification.Trash:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case Lt.SetSystemFoldersNotification.Archive:t=Mt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},Mt.extendAsViewModel("PopupsComposeViewModel",U),U.prototype.openOpenPgpPopup=function(){if(this.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var e=this;xt.showScreenPopup(q,[function(t){e.editor(function(e){e.setPlain(t)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},U.prototype.reloadDraftFolder=function(){var e=jt.data().draftFolder();""!==e&&(jt.cache().setFolderHash(e,""),jt.data().currentFolderFullNameRaw()===e?jt.reloadMessageList(!0):jt.folderInformation(e))},U.prototype.findIdentityIdByMessage=function(e,t){var s={},i="",o=function(e){return e&&e.email&&s[e.email]?(i=s[e.email],!0):!1};if(this.bCapaAdditionalIdentities&&r.each(this.identities(),function(e){s[e.email()]=e.id}),s[jt.data().accountEmail()]=jt.data().accountEmail(),t)switch(e){case Lt.ComposeType.Empty:break;case Lt.ComposeType.Reply:case Lt.ComposeType.ReplyAll:case Lt.ComposeType.Forward:case Lt.ComposeType.ForwardAsAttachment:r.find(r.union(t.to,t.cc,t.bcc,t.deliveredTo),o);break;case Lt.ComposeType.Draft:r.find(r.union(t.from,t.replyTo),o)}return""===i&&(i=this.defaultIdentityID()),""===i&&(i=jt.data().accountEmail()),i},U.prototype.selectIdentity=function(e){e&&this.currentIdentityID(e.optValue)},U.prototype.formattedFrom=function(e){var t=jt.data().displayName(),s=jt.data().accountEmail();return""===t?s:(Mt.isUnd(e)?1:!e)?t+" ("+s+")":'"'+Mt.quoteName(t)+'" <'+s+">"},U.prototype.sendMessageResponse=function(t,s){var i=!1,o="";this.sending(!1),Lt.StorageResultType.Success===t&&s&&s.Result&&(i=!0,this.modalVisibility()&&Mt.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(s&&Lt.Notification.CantSaveMessage===s.ErrorCode?(this.sendSuccessButSaveError(!0),e.alert(Mt.trim(Mt.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=Mt.getNotification(s&&s.ErrorCode?s.ErrorCode:Lt.Notification.CantSendMessage,s&&s.ErrorMessage?s.ErrorMessage:""),this.sendError(!0),e.alert(o||Mt.getNotification(Lt.Notification.CantSendMessage)))),this.reloadDraftFolder()},U.prototype.saveMessageResponse=function(t,s){var i=!1,o=null;this.saving(!1),Lt.StorageResultType.Success===t&&s&&s.Result&&s.Result.NewFolder&&s.Result.NewUid&&(this.bFromDraft&&(o=jt.data().message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&jt.data().message(null)),this.draftFolder(s.Result.NewFolder),this.draftUid(s.Result.NewUid),this.modalVisibility()&&(this.savedTime(Math.round((new e.Date).getTime()/1e3)),this.savedOrSendingText(0s;s++)o.push(e[s].toLine(!!t));return o.join(", ")};if(s=s||null,s&&Mt.isNormal(s)&&(C=Mt.isArray(s)&&1===s.length?s[0]:Mt.isArray(s)?null:s),null!==f&&(g[f]=!0),this.currentIdentityID(this.findIdentityIdByMessage(w,C)),this.reset(),Mt.isNonEmptyArray(i)&&this.to(T(i)),""!==w&&C){switch(c=C.fullFormatDateValue(),u=C.subject(),v=C.aDraftInfo,d=t(C.body).clone(),Mt.removeBlockquoteSwitcher(d),h=d.html(),w){case Lt.ComposeType.Empty:break;case Lt.ComposeType.Reply:this.to(T(C.replyEmails(g))),this.subject(Mt.replySubjectAdd("Re",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["reply",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.ReplyAll:m=C.replyAllEmails(g),this.to(T(m[0])),this.cc(T(m[1])),this.subject(Mt.replySubjectAdd("Re",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["reply",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.references());break;case Lt.ComposeType.Forward:this.subject(Mt.replySubjectAdd("Fwd",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["forward",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.ForwardAsAttachment:this.subject(Mt.replySubjectAdd("Fwd",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["forward",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Mt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.Draft:this.to(T(C.to)),this.cc(T(C.cc)),this.bcc(T(C.bcc)),this.bFromDraft=!0,this.draftFolder(C.folderFullNameRaw),this.draftUid(C.uid),this.subject(u),this.prepearMessageAttachments(C,w),this.aDraftInfo=Mt.isNonEmptyArray(v)&&3===v.length?v:null,this.sInReplyTo=C.sInReplyTo,this.sReferences=C.sReferences;break;case Lt.ComposeType.EditAsNew:this.to(T(C.to)),this.cc(T(C.cc)),this.bcc(T(C.bcc)),this.subject(u),this.prepearMessageAttachments(C,w),this.aDraftInfo=Mt.isNonEmptyArray(v)&&3===v.length?v:null,this.sInReplyTo=C.sInReplyTo,this.sReferences=C.sReferences}switch(w){case Lt.ComposeType.Reply:case Lt.ComposeType.ReplyAll:n=C.fromToLine(!1,!0),p=Mt.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:c,EMAIL:n}),h="

"+p+":

"+h+"

";break;case Lt.ComposeType.Forward:n=C.fromToLine(!1,!0),a=C.toToLine(!1,!0),l=C.ccToLine(!1,!0),h="


"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+n+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+a+(0"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+l:"")+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+Mt.encodeHtml(c)+"
"+Mt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+Mt.encodeHtml(u)+"

"+h;break;case Lt.ComposeType.ForwardAsAttachment:h=""}y&&""!==b&&Lt.ComposeType.EditAsNew!==w&&Lt.ComposeType.Draft!==w&&(h=this.convertSignature(b,T(C.from,!0))+"
"+h),this.editor(function(e){e.setHtml(h,!1),C.isHtml()||e.modeToggle(!1)})}else Lt.ComposeType.Empty===w?(h=this.convertSignature(b),this.editor(function(e){e.setHtml(h,!1),Lt.EditorDefaultType.Html!==jt.data().editorDefaultType()&&e.modeToggle(!1)})):Mt.isNonEmptyArray(s)&&r.each(s,function(e){o.addMessageAsAttachment(e)});S=this.getAttachmentsDownloadsForUpload(),Mt.isNonEmptyArray(S)&&jt.remote().messageUploadAttachments(function(e,t){if(Lt.StorageResultType.Success===e&&t&&t.Result){var s=null,i="";if(!o.viewModelVisibility())for(i in t.Result)t.Result.hasOwnProperty(i)&&(s=o.getAttachmentById(t.Result[i]),s&&s.tempName(i))}else o.setMessageAttachmentFailedDowbloadText()},S),this.triggerForResize()},U.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},U.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},U.prototype.tryToClosePopup=function(){var e=this;xt.isPopupVisible(Y)||xt.showScreenPopup(Y,[Mt.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&Mt.delegateRun(e,"closeCommand")}])},U.prototype.onBuild=function(){this.initUploader();var e=this,s=null;c("ctrl+q, command+q",Lt.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),c("ctrl+s, command+s",Lt.KeyState.Compose,function(){return e.saveCommand(),!1}),c("ctrl+enter, command+enter",Lt.KeyState.Compose,function(){return e.sendCommand(),!1}),c("esc",Lt.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),Gt.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(s=document.createElement("script"),s.type="text/javascript",s.src="https://www.dropbox.com/static/api/1/dropins.js",t(s).attr("id","dropboxjs").attr("data-app-key",jt.settingsGet("DropboxApiKey")),document.body.appendChild(s))},U.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},U.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=Mt.pInt(jt.settingsGet("AttachmentLimit")),s=new a({action:jt.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",r.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",r.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",r.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",r.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",r.bind(function(t,s,i){var o=null;Mt.isUnd(e[t])?(o=this.getAttachmentById(t),o&&(e[t]=o)):o=e[t],o&&o.progress(" - "+Math.floor(s/i*100)+"%")},this)).on("onSelect",r.bind(function(e,i){this.dragAndDropOver(!1);var o=this,n=Mt.isUnd(i.FileName)?"":i.FileName.toString(),a=Mt.isNormal(i.Size)?Mt.pInt(i.Size):null,r=new A(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(Mt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",r.bind(function(t){var s=null;Mt.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",r.bind(function(t,s,i){var o="",n=null,a=null,r=this.getAttachmentById(t);a=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=Mt.getUploadErrorDescByCode(n):a||(o=Mt.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&i>0&&n>i?(o.uploading(!1),o.error(Mt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(jt.remote().composeUploadExternals(function(e,t){var s=!1;o.uploading(!1),Lt.StorageResultType.Success===e&&t&&t.Result&&t.Result[o.id]&&(s=!0,o.tempName(t.Result[o.id])),s||o.error(Mt.getUploadErrorDescByCode(Lt.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},U.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,i=Mt.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=i.length,a=null,r=null,l=!1,c=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(Lt.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=i[o],l=!1,t){case Lt.ComposeType.Reply:case Lt.ComposeType.ReplyAll:l=r.isLinked;break;case Lt.ComposeType.Forward:case Lt.ComposeType.Draft:case Lt.ComposeType.EditAsNew:l=!0}l&&(a=new A(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},U.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},U.prototype.setMessageAttachmentFailedDowbloadText=function(){r.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(Mt.getUploadErrorDescByCode(Lt.UploadErrorCode.FileNoUploaded))},this)},U.prototype.isEmptyForm=function(e){e=Mt.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())},U.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!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),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},U.prototype.getAttachmentsDownloadsForUpload=function(){return r.map(r.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},U.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},Mt.extendAsViewModel("PopupsContactsViewModel",x),x.prototype.getPropertyPlceholder=function(e){var t="";switch(e){case Lt.ContactPropertyType.LastName:t="CONTACTS/PLACEHOLDER_ENTER_LAST_NAME";break;case Lt.ContactPropertyType.FirstName:t="CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME";break;case Lt.ContactPropertyType.Nick:t="CONTACTS/PLACEHOLDER_ENTER_NICK_NAME"}return t},x.prototype.addNewProperty=function(e,t){this.viewProperties.push(new w(e,t||"","",!0,this.getPropertyPlceholder(e)))},x.prototype.addNewOrFocusProperty=function(e,t){var s=r.find(this.viewProperties(),function(t){return e===t.type()});s?s.focused(!0):this.addNewProperty(e,t)},x.prototype.addNewTag=function(){this.viewTags.visibility(!0),this.viewTags.focusTrigger(!0)},x.prototype.addNewEmail=function(){this.addNewProperty(Lt.ContactPropertyType.Email,"Home")},x.prototype.addNewPhone=function(){this.addNewProperty(Lt.ContactPropertyType.Phone,"Mobile")},x.prototype.addNewWeb=function(){this.addNewProperty(Lt.ContactPropertyType.Web)},x.prototype.addNewNickname=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Nick)},x.prototype.addNewNotes=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Note)},x.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Birthday)},x.prototype.exportVcf=function(){jt.download(jt.link().exportContactsVcf())},x.prototype.exportCsv=function(){jt.download(jt.link().exportContactsCsv())},x.prototype.initUploader=function(){if(this.importUploaderButton()){var t=new a({action:jt.link().uploadContacts(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,disableDragAndDrop:!0,disableMultiple:!0,disableDocumentDropPrevent:!0,clickElement:this.importUploaderButton()});t&&t.on("onStart",r.bind(function(){this.contacts.importing(!0)},this)).on("onComplete",r.bind(function(t,s,i){this.contacts.importing(!1),this.reloadContactList(),t&&s&&i&&i.Result||e.alert(Mt.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},x.prototype.removeCheckedOrSelectedContactsFromList=function(){var e=this,t=this.contacts,s=this.currentContact(),i=this.contacts().length,o=this.contactsCheckedOrSelected();0=i&&(this.bDropPageAfterDelete=!0),r.delay(function(){r.each(o,function(e){t.remove(e)})},500))},x.prototype.deleteSelectedContacts=function(){00?i:0),Mt.isNonEmptyArray(s.Result.Tags)&&(n=r.map(s.Result.Tags,function(e){var t=new T;return t.parse(e)?t:null}),n=r.compact(n))),t.contactsCount(i),t.contacts(o),t.contactTags(n),t.contacts.loading(!1),t.viewClearSearch(""!==t.search())},s,It.Defaults.ContactsPerPage,this.search())},x.prototype.onBuild=function(e){this.oContentVisible=t(".b-list-content",e),this.oContentScrollable=t(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,Lt.KeyState.ContactList);var i=this;c("delete",Lt.KeyState.ContactList,function(){return i.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=s.dataFor(this);e&&(i.contactsPage(Mt.pInt(e.value)),i.reloadContactList())}),this.initUploader()},x.prototype.onShow=function(){xt.routeOff(),this.reloadContactList(!0)},x.prototype.onHide=function(){xt.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},Mt.extendAsViewModel("PopupsAdvancedSearchViewModel",V),V.prototype.buildSearchStringValue=function(e){return-1 li"),o=s&&("tab"===s.shortcut||"right"===s.shortcut),n=i.index(i.filter(".active"));return!o&&n>0?n--:o&&n-1&&r.eq(n).removeClass("focused"),38===a&&n>0?n--:40===a&&no)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-o+n+e),!0):!1},et.prototype.messagesDrop=function(e,t){if(e&&t&&t.helper){var s=t.helper.data("rl-folder"),i=Bt.hasClass("rl-ctrl-key-pressed"),o=t.helper.data("rl-uids");Mt.isNormal(s)&&""!==s&&Mt.isArray(o)&&jt.moveMessagesToFolder(s,o,e.fullNameRaw,i)}},et.prototype.composeClick=function(){xt.showScreenPopup(U)},et.prototype.createFolder=function(){xt.showScreenPopup(k)},et.prototype.configureFolders=function(){xt.setHash(jt.link().settings("folders"))},et.prototype.contactsClick=function(){this.allowContacts&&xt.showScreenPopup(x)},Mt.extendAsViewModel("MailBoxMessageListViewModel",tt),tt.prototype.emptySubjectValue="",tt.prototype.searchEnterAction=function(){this.mainMessageListSearch(this.sLastSearchValue),this.inputMessageListSearchFocus(!1)},tt.prototype.printableMessageCountForDeletion=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>1?" ("+(100>e?e:"99+")+")":""},tt.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},tt.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&jt.moveMessagesToFolder(jt.data().currentFolderFullNameRaw(),jt.data().messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},tt.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=Mt.draggeblePlace(),s=jt.data().messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",jt.data().currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),r.defer(function(){var e=jt.data().messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},tt.prototype.onMessageResponse=function(e,t,s){var i=jt.data();i.hideMessageBodies(),i.messageLoading(!1),Lt.StorageResultType.Success===e&&t&&t.Result?i.setMessage(t,s):Lt.StorageResultType.Unload===e?(i.message(null),i.messageError("")):Lt.StorageResultType.Abort!==e&&(i.message(null),i.messageError(Mt.getNotification(t&&t.ErrorCode?t.ErrorCode:Lt.Notification.UnknownError)))},tt.prototype.populateMessageBody=function(e){e&&(jt.remote().message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?jt.data().messageLoading(!0):Mt.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},tt.prototype.setAction=function(e,t,s){var i=[],o=null,n=jt.cache(),a=0;if(Mt.isUnd(s)&&(s=jt.data().messageListChecked()),i=r.map(s,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},st.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},st.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},st.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(jt.remote().sendReadReceiptMessage(Mt.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),Mt.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),Mt.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":jt.data().accountEmail()})),e.isReadReceipt(!0),jt.cache().storeMessageFlagsToCache(e),jt.reloadFlagsCurrentMessageListAndMessageFromCache())},Mt.extendAsViewModel("SettingsMenuViewModel",it),it.prototype.link=function(e){return jt.link().settings(e)},it.prototype.backToMailBoxClick=function(){xt.setHash(jt.link().inbox())},Mt.extendAsViewModel("SettingsPaneViewModel",ot),ot.prototype.onBuild=function(){var e=this;c("esc",Lt.KeyState.Settings,function(){e.backToMailBoxClick()})},ot.prototype.onShow=function(){jt.data().message(null)},ot.prototype.backToMailBoxClick=function(){xt.setHash(jt.link().inbox())},Mt.addSettingsViewModel(nt,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),nt.prototype.toggleLayout=function(){this.layout(Lt.Layout.NoPreview===this.layout()?Lt.Layout.SidePreview:Lt.Layout.NoPreview)},nt.prototype.onBuild=function(){var e=this;r.delay(function(){var s=jt.data(),i=Mt.settingsSaveHelperSimpleFunction(e.mppTrigger,e);s.language.subscribe(function(s){e.languageTrigger(Lt.SaveSettingsStep.Animate),t.ajax({url:jt.link().langLink(s),dataType:"script",cache:!0}).done(function(){Mt.i18nToDoc(),e.languageTrigger(Lt.SaveSettingsStep.TrueResult)}).fail(function(){e.languageTrigger(Lt.SaveSettingsStep.FalseResult)}).always(function(){r.delay(function(){e.languageTrigger(Lt.SaveSettingsStep.Idle)},1e3)}),jt.remote().saveSettings(Mt.emptyFunction,{Language:s})}),s.editorDefaultType.subscribe(function(e){jt.remote().saveSettings(Mt.emptyFunction,{EditorDefaultType:e})}),s.messagesPerPage.subscribe(function(e){jt.remote().saveSettings(i,{MPP:e})}),s.showImages.subscribe(function(e){jt.remote().saveSettings(Mt.emptyFunction,{ShowImages:e?"1":"0"})}),s.interfaceAnimation.subscribe(function(e){jt.remote().saveSettings(Mt.emptyFunction,{InterfaceAnimation:e})}),s.useDesktopNotifications.subscribe(function(e){Mt.timeOutAction("SaveDesktopNotifications",function(){jt.remote().saveSettings(Mt.emptyFunction,{DesktopNotifications:e?"1":"0"})},3e3)}),s.replySameFolder.subscribe(function(e){Mt.timeOutAction("SaveReplySameFolder",function(){jt.remote().saveSettings(Mt.emptyFunction,{ReplySameFolder:e?"1":"0"})},3e3)}),s.useThreads.subscribe(function(e){s.messageList([]),jt.remote().saveSettings(Mt.emptyFunction,{UseThreads:e?"1":"0"})}),s.layout.subscribe(function(e){s.messageList([]),jt.remote().saveSettings(Mt.emptyFunction,{Layout:e})}),s.useCheckboxesInList.subscribe(function(e){jt.remote().saveSettings(Mt.emptyFunction,{UseCheckboxesInList:e?"1":"0"})})},50)},nt.prototype.onShow=function(){jt.data().desktopNotifications.valueHasMutated()},nt.prototype.selectLanguage=function(){xt.showScreenPopup(z)},Mt.addSettingsViewModel(at,"SettingsContacts","SETTINGS_LABELS/LABEL_CONTACTS_NAME","contacts"),at.prototype.onBuild=function(){jt.data().contactsAutosave.subscribe(function(e){jt.remote().saveSettings(Mt.emptyFunction,{ContactsAutosave:e?"1":"0"})})},Mt.addSettingsViewModel(rt,"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),rt.prototype.addNewAccount=function(){xt.showScreenPopup(H)},rt.prototype.deleteAccount=function(t){if(t&&t.deleteAccess()){this.accountForDeletion(null);var s=function(e){return t===e};t&&(this.accounts.remove(s),jt.remote().accountDelete(function(t,s){Lt.StorageResultType.Success===t&&s&&s.Result&&s.Reload?(xt.routeOff(),xt.setHash(jt.link().root(),!0),xt.routeOff(),r.defer(function(){e.location.reload()})):jt.accountsAndIdentities()},t.email))}},Mt.addSettingsViewModel(lt,"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),lt.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=jt.data().signature();this.editor=new d(e.signatureDom(),function(){jt.data().signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},lt.prototype.onBuild=function(){var e=this;r.delay(function(){var t=jt.data(),s=Mt.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=Mt.settingsSaveHelperSimpleFunction(e.replyTrigger,e),o=Mt.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);t.displayName.subscribe(function(e){jt.remote().saveSettings(s,{DisplayName:e})}),t.replyTo.subscribe(function(e){jt.remote().saveSettings(i,{ReplyTo:e})}),t.signature.subscribe(function(e){jt.remote().saveSettings(o,{Signature:e})}),t.signatureToAll.subscribe(function(e){jt.remote().saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},Mt.addSettingsViewModel(ct,"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"),ct.prototype.formattedAccountIdentity=function(){var e=this.displayName.peek(),t=this.accountEmail.peek();return""===e?t:'"'+Mt.quoteName(e)+'" <'+t+">"},ct.prototype.addNewIdentity=function(){xt.showScreenPopup(j)},ct.prototype.editIdentity=function(e){xt.showScreenPopup(j,[e])},ct.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var t=function(t){return e===t};e&&(this.identities.remove(t),jt.remote().identityDelete(function(){jt.accountsAndIdentities()},e.id))}},ct.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=jt.data().signature();this.editor=new d(e.signatureDom(),function(){jt.data().signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},ct.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=s.dataFor(this);e&&t.editIdentity(e)}),r.delay(function(){var e=jt.data(),s=Mt.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=Mt.settingsSaveHelperSimpleFunction(t.replyTrigger,t),o=Mt.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),n=Mt.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);e.defaultIdentityID.subscribe(function(e){jt.remote().saveSettings(n,{DefaultIdentityID:e})}),e.displayName.subscribe(function(e){jt.remote().saveSettings(s,{DisplayName:e})}),e.replyTo.subscribe(function(e){jt.remote().saveSettings(i,{ReplyTo:e})}),e.signature.subscribe(function(e){jt.remote().saveSettings(o,{Signature:e})}),e.signatureToAll.subscribe(function(e){jt.remote().saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},Mt.addSettingsViewModel(ut,"SettingsFilters","SETTINGS_LABELS/LABEL_FILTERS_NAME","filters"),ut.prototype.deleteFilter=function(e){this.filters.remove(e)},ut.prototype.addFilter=function(){var e=new M;e.addCondition(),e.addAction(),this.filters.push(e)},Mt.addSettingsViewModel(dt,"SettingsSecurity","SETTINGS_LABELS/LABEL_SECURITY_NAME","security"),dt.prototype.showSecret=function(){this.secreting(!0),jt.remote().showTwoFactorSecret(this.onSecretResult)},dt.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},dt.prototype.createTwoFactor=function(){this.processing(!0),jt.remote().createTwoFactor(this.onResult)},dt.prototype.enableTwoFactor=function(){this.processing(!0),jt.remote().enableTwoFactor(this.onResult,this.viewEnable())},dt.prototype.testTwoFactor=function(){xt.showScreenPopup(W) },dt.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),jt.remote().clearTwoFactor(this.onResult)},dt.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},dt.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),Lt.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(Mt.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(Mt.pString(t.Result.Secret)),this.viewBackupCodes(Mt.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(Mt.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var s=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&jt.remote().enableTwoFactor(function(e,t){Lt.StorageResultType.Success===e&&t&&t.Result||(s.viewEnable.subs=!1,s.viewEnable(!1),s.viewEnable.subs=!0)},e)},this)}},dt.prototype.onSecretResult=function(e,t){this.secreting(!1),Lt.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(Mt.pString(t.Result.Secret)),this.viewUrl(Mt.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},dt.prototype.onBuild=function(){this.processing(!0),jt.remote().getTwoFactor(this.onResult)},Mt.addSettingsViewModel(ht,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),Mt.addSettingsViewModel(pt,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),pt.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},pt.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),Lt.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&Lt.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(Mt.getNotification(t&&t.ErrorCode?t.ErrorCode:Lt.Notification.CouldNotSaveNewPassword)))},Mt.addSettingsViewModel(mt,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),mt.prototype.folderEditOnEnter=function(e){var t=e?Mt.trim(e.nameForEdit()):"";""!==t&&e.name()!==t&&(jt.local().set(Lt.ClientSideKeyName.FoldersLashHash,""),jt.data().foldersRenaming(!0),jt.remote().folderRename(function(e,t){jt.data().foldersRenaming(!1),Lt.StorageResultType.Success===e&&t&&t.Result||jt.data().foldersListError(t&&t.ErrorCode?Mt.getNotification(t.ErrorCode):Mt.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),jt.folders()},e.fullNameRaw,t),jt.cache().removeFolderFromCacheList(e.fullNameRaw),e.name(t)),e.edited(!1)},mt.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},mt.prototype.onShow=function(){jt.data().foldersListError("")},mt.prototype.createFolder=function(){xt.showScreenPopup(k)},mt.prototype.systemFolder=function(){xt.showScreenPopup(_)},mt.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var t=function(s){return e===s?!0:(s.subFolders.remove(t),!1)};e&&(jt.local().set(Lt.ClientSideKeyName.FoldersLashHash,""),jt.data().folderList.remove(t),jt.data().foldersDeleting(!0),jt.remote().folderDelete(function(e,t){jt.data().foldersDeleting(!1),Lt.StorageResultType.Success===e&&t&&t.Result||jt.data().foldersListError(t&&t.ErrorCode?Mt.getNotification(t.ErrorCode):Mt.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),jt.folders()},e.fullNameRaw),jt.cache().removeFolderFromCacheList(e.fullNameRaw))}else 00&&(s=this.messagesBodiesDom(),s&&(s.find(".rl-cache-class").each(function(){var s=t(this);i>s.data("rl-cache-count")&&(s.addClass("rl-cache-purge"),e++)}),e>0&&r.delay(function(){s.find(".rl-cache-purge").remove()},300)))},yt.prototype.populateDataOnStart=function(){bt.prototype.populateDataOnStart.call(this),this.accountEmail(jt.settingsGet("Email")),this.accountIncLogin(jt.settingsGet("IncLogin")),this.accountOutLogin(jt.settingsGet("OutLogin")),this.projectHash(jt.settingsGet("ProjectHash")),this.defaultIdentityID(jt.settingsGet("DefaultIdentityID")),this.displayName(jt.settingsGet("DisplayName")),this.replyTo(jt.settingsGet("ReplyTo")),this.signature(jt.settingsGet("Signature")),this.signatureToAll(!!jt.settingsGet("SignatureToAll")),this.enableTwoFactor(!!jt.settingsGet("EnableTwoFactor")),this.lastFoldersHash=jt.local().get(Lt.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!jt.settingsGet("RemoteSuggestions"),this.devEmail=jt.settingsGet("DevEmail"),this.devPassword=jt.settingsGet("DevPassword")},yt.prototype.initUidNextAndNewMessages=function(t,s,i){if("INBOX"===t&&Mt.isNormal(s)&&""!==s){if(Mt.isArray(i)&&03)l(jt.link().notificationMailIcon(),jt.data().accountEmail(),Mt.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:a}));else for(;a>n;n++)l(jt.link().notificationMailIcon(),E.emailsToLine(E.initEmailsFromJson(i[n].From),!1),i[n].Subject)}jt.cache().setFolderUidNext(t,s)}},yt.prototype.folderResponseParseRec=function(e,t){var s=0,i=0,o=null,n=null,a="",r=[],l=[];for(s=0,i=t.length;i>s;s++)o=t[s],o&&(a=o.FullNameRaw,n=jt.cache().getFolderFromCacheList(a),n||(n=N.newInstanceFromJson(o),n&&(jt.cache().setFolderToCacheList(a,n),jt.cache().setFolderFullNameRaw(n.fullNameHash,a))),n&&(n.collapsed(!Mt.isFolderExpanded(n.fullNameHash)),o.Extended&&(o.Extended.Hash&&jt.cache().setFolderHash(n.fullNameRaw,o.Extended.Hash),Mt.isNormal(o.Extended.MessageCount)&&n.messageCountAll(o.Extended.MessageCount),Mt.isNormal(o.Extended.MessageUnseenCount)&&n.messageCountUnread(o.Extended.MessageUnseenCount)),r=o.SubFolders,r&&"Collection/FolderCollection"===r["@Object"]&&r["@Collection"]&&Mt.isArray(r["@Collection"])&&n.subFolders(this.folderResponseParseRec(e,r["@Collection"])),l.push(n)));return l},yt.prototype.setFolders=function(e){var t=[],s=!1,i=jt.data(),o=function(e){return""===e||It.Values.UnuseOptionValue===e||null!==jt.cache().getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&Mt.isArray(e.Result["@Collection"])&&(Mt.isUnd(e.Result.Namespace)||(i.namespace=e.Result.Namespace),this.threading(!!jt.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(i.namespace,e.Result["@Collection"]),i.folderList(t),e.Result.SystemFolders&&""==""+jt.settingsGet("SentFolder")+jt.settingsGet("DraftFolder")+jt.settingsGet("SpamFolder")+jt.settingsGet("TrashFolder")+jt.settingsGet("ArchiveFolder")+jt.settingsGet("NullFolder")&&(jt.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),jt.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),jt.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),jt.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),jt.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),s=!0),i.sentFolder(o(jt.settingsGet("SentFolder"))),i.draftFolder(o(jt.settingsGet("DraftFolder"))),i.spamFolder(o(jt.settingsGet("SpamFolder"))),i.trashFolder(o(jt.settingsGet("TrashFolder"))),i.archiveFolder(o(jt.settingsGet("ArchiveFolder"))),s&&jt.remote().saveSystemFolders(Mt.emptyFunction,{SentFolder:i.sentFolder(),DraftFolder:i.draftFolder(),SpamFolder:i.spamFolder(),TrashFolder:i.trashFolder(),ArchiveFolder:i.archiveFolder(),NullFolder:"NullFolder"}),jt.local().set(Lt.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},yt.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},yt.prototype.getNextFolderNames=function(e){e=Mt.isUnd(e)?!1:!!e;var t=[],s=10,i=n().unix(),o=i-300,a=[],l=function(t){r.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&o>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),r.find(a,function(e){var o=jt.cache().getFolderFromCacheList(e[1]);return o&&(o.interval=i,t.push(e[1])),s<=t.length}),r.uniq(t)},yt.prototype.removeMessagesFromList=function(e,t,s,i){s=Mt.isNormal(s)?s:"",i=Mt.isUnd(i)?!1:!!i,t=r.map(t,function(e){return Mt.pInt(e)});var o=0,n=jt.data(),a=jt.cache(),l=n.messageList(),c=jt.cache().getFolderFromCacheList(e),u=""===s?null:a.getFolderFromCacheList(s||""),d=n.currentFolderFullNameRaw(),h=n.message(),p=d===e?r.filter(l,function(e){return e&&-10&&c.messageCountUnread(0<=c.messageCountUnread()-o?c.messageCountUnread()-o:0)),u&&(u.messageCountAll(u.messageCountAll()+t.length),o>0&&u.messageCountUnread(u.messageCountUnread()+o),u.actionBlink(!0)),0').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++kt.iMessageBodyCacheCount),Mt.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,a.html(e.Result.Html.toString()).addClass("b-text-part html")):Mt.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,c=e.Result.Plain.toString(),(p.isPgpSigned()||p.isPgpEncrypted())&&jt.data().capaOpenPGP()&&Mt.isNormal(e.Result.PlainRaw)&&(p.plainRaw=Mt.pString(e.Result.PlainRaw),d=/---BEGIN PGP MESSAGE---/.test(p.plainRaw),d||(u=/-----BEGIN PGP SIGNED MESSAGE-----/.test(p.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(p.plainRaw)),zt.empty(),u&&p.isPgpSigned()?c=zt.append(t('
').text(p.plainRaw)).html():d&&p.isPgpEncrypted()&&(c=zt.append(t('
').text(p.plainRaw)).html()),zt.empty(),p.isPgpSigned(u),p.isPgpEncrypted(d)),a.html(c).addClass("b-text-part plain")):i=!1,p.isHtml(!!i),p.hasImages(!!o),p.pgpSignedVerifyStatus(Lt.SignedVerifyStatus.None),p.pgpSignedVerifyUser(""),e.Result.Rtl&&(p.isRtl(!0),a.addClass("rtl-text-part")),p.body=a,p.body&&h.append(p.body),p.storeDataToDom(),n&&p.showInternalImages(!0),p.hasImages()&&this.showImages()&&p.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(p.body),this.hideMessageBodies(),p.body.show(),a&&Mt.initBlockquoteSwitcher(a)),jt.cache().initMessageFlagsFromCache(p),p.unseen()&&jt.setMessageSeen(p),Mt.windowResize())},yt.prototype.calculateMessageListHash=function(e){return r.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},yt.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&Mt.isArray(e.Result["@Collection"])){var s=jt.data(),i=jt.cache(),o=null,a=0,r=0,l=0,c=0,u=[],d=n().unix(),h=s.staticMessageList,p=null,m=null,g=null,f=0,b=!1;for(l=Mt.pInt(e.Result.MessageResultCount),c=Mt.pInt(e.Result.Offset),Mt.isNonEmptyArray(e.Result.LastCollapsedThreadUids)&&(o=e.Result.LastCollapsedThreadUids),g=jt.cache().getFolderFromCacheList(Mt.isNormal(e.Result.Folder)?e.Result.Folder:""),g&&!t&&(g.interval=d,jt.cache().setFolderHash(e.Result.Folder,e.Result.FolderHash),Mt.isNormal(e.Result.MessageCount)&&g.messageCountAll(e.Result.MessageCount),Mt.isNormal(e.Result.MessageUnseenCount)&&(Mt.pInt(g.messageCountUnread())!==Mt.pInt(e.Result.MessageUnseenCount)&&(b=!0),g.messageCountUnread(e.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(g.fullNameRaw,e.Result.UidNext,e.Result.NewMessages)),b&&g&&jt.cache().clearMessageFlagsFromCacheByFolder(g.fullNameRaw),a=0,r=e.Result["@Collection"].length;r>a;a++)p=e.Result["@Collection"][a],p&&"Object/Message"===p["@Object"]&&(m=h[a],m&&m.initByJson(p)||(m=E.newInstanceFromJson(p)),m&&(i.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=f&&(f++,m.newForAnimation(!0)),m.deleted(!1),t?jt.cache().initMessageFlagsFromCache(m):jt.cache().storeMessageFlagsToCache(m),m.lastInCollapsedThread(o&&-1(new e.Date).getTime()-d),p&&l.oRequests[p]&&(l.oRequests[p].__aborted&&(o="abort"),l.oRequests[p]=null),l.defaultResponse(s,p,o,t,n,i)}),p&&00?(this.defaultRequest(e,"Message",{},null,"Message/"+Ot.urlsafe_encode([t,s,jt.data().projectHash(),jt.data().threading()&&jt.data().useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},vt.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},vt.prototype.folderInformation=function(e,t,s){var i=!0,o=jt.cache(),n=[];Mt.isArray(s)&&0
").addClass("rl-settings-view-model").hide(),l.appendTo(a),o.data=jt.data(),o.viewModelDom=l,o.__rlSettingsData=n.__rlSettingsData,n.__dom=l,n.__builded=!0,n.__vm=o,s.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:n.__rlSettingsData.Template}}},o),Mt.delegateRun(o,"onBuild",[l])):Mt.log("Cannot find sub settings view model position: SettingsSubScreen")),o&&r.defer(function(){i.oCurrentSubScreen&&(Mt.delegateRun(i.oCurrentSubScreen,"onHide"),i.oCurrentSubScreen.viewModelDom.hide()),i.oCurrentSubScreen=o,i.oCurrentSubScreen&&(i.oCurrentSubScreen.viewModelDom.show(),Mt.delegateRun(i.oCurrentSubScreen,"onShow"),Mt.delegateRun(i.oCurrentSubScreen,"onFocus",[],200),r.each(i.menu(),function(e){e.selected(o&&o.__rlSettingsData&&e.route===o.__rlSettingsData.Route)}),t("#rl-content .b-settings .b-content .content").scrollTop(0)),Mt.windowResize()})):xt.setHash(jt.link().settings(),!1,!0)},Tt.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(Mt.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},Tt.prototype.onBuild=function(){r.each(_t.settings,function(e){e&&e.__rlSettingsData&&!r.find(_t["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:s.observable(!1),disabled:!!r.find(_t["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=t("#rl-content #rl-settings-subscreen")},Tt.prototype.routes=function(){var e=r.find(_t.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",s={subname:/^(.*)$/,normalize_:function(e,s){return s.subname=Mt.isUnd(s.subname)?t:Mt.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},r.extend(Ft.prototype,y.prototype),Ft.prototype.onShow=function(){jt.setTitle("")},r.extend(At.prototype,y.prototype),At.prototype.oLastRoute={},At.prototype.setNewTitle=function(){var e=jt.data().accountEmail(),t=jt.data().foldersInboxUnreadCount();jt.setTitle((""===e?"":(t>0?"("+t+") ":" ")+e+" - ")+Mt.i18n("TITLES/MAILBOX"))},At.prototype.onShow=function(){this.setNewTitle(),jt.data().keyScope(Lt.KeyState.MessageList)},At.prototype.onRoute=function(e,t,s,i){if(Mt.isUnd(i)?1:!i){var o=jt.data(),n=jt.cache().getFolderFullNameRaw(e),a=jt.cache().getFolderFromCacheList(n);a&&(o.currentFolder(a).messageListPage(t).messageListSearch(s),Lt.Layout.NoPreview===o.layout()&&o.message()&&(o.message(null),o.messageFullScreenMode(!1)),jt.reloadMessageList())}else Lt.Layout.NoPreview!==jt.data().layout()||jt.data().message()||jt.historyBack()},At.prototype.onStart=function(){var e=jt.data(),t=function(){Mt.windowResize()};(jt.capa(Lt.Capa.AdditionalAccounts)||jt.capa(Lt.Capa.AdditionalIdentities))&&jt.accountsAndIdentities(),r.delay(function(){"INBOX"!==e.currentFolderFullNameRaw()&&jt.folderInformation("INBOX")},1e3),r.delay(function(){jt.quota()},5e3),r.delay(function(){jt.remote().appDelayStart(Mt.emptyFunction)},35e3),Bt.toggleClass("rl-no-preview-pane",Lt.Layout.NoPreview===e.layout()),e.folderList.subscribe(t),e.messageList.subscribe(t),e.message.subscribe(t),e.layout.subscribe(function(e){Bt.toggleClass("rl-no-preview-pane",Lt.Layout.NoPreview===e)}),e.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},At.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=Mt.pString(t[0]),t[1]=Mt.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=Mt.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},s=function(e,t){return t[0]=Mt.pString(t[0]),t[1]=Mt.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},r.extend(Et.prototype,Tt.prototype),Et.prototype.onShow=function(){jt.setTitle(this.sSettingsTitle),jt.data().keyScope(Lt.KeyState.Settings)},r.extend(Nt.prototype,f.prototype),Nt.prototype.oSettings=null,Nt.prototype.oPlugins=null,Nt.prototype.oLocal=null,Nt.prototype.oLink=null,Nt.prototype.oSubs={},Nt.prototype.download=function(t){var s=null,i=null,o=navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(s=document.createElement("a"),s.href=t,document.createEvent&&(i=document.createEvent("MouseEvents"),i&&i.initEvent&&s.dispatchEvent))?(i.initEvent("click",!0,!0),s.dispatchEvent(i),!0):(kt.bMobileDevice?(e.open(t,"_self"),e.focus()):this.iframe.attr("src",t),!0)},Nt.prototype.link=function(){return null===this.oLink&&(this.oLink=new u),this.oLink},Nt.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new g),this.oLocal},Nt.prototype.settingsGet=function(e){return null===this.oSettings&&(this.oSettings=Mt.isNormal(Vt)?Vt:{}),Mt.isUnd(this.oSettings[e])?null:this.oSettings[e]},Nt.prototype.settingsSet=function(e,t){null===this.oSettings&&(this.oSettings=Mt.isNormal(Vt)?Vt:{}),this.oSettings[e]=t},Nt.prototype.setTitle=function(t){t=(Mt.isNormal(t)&&0d;d++)f.push({id:o[d][0],name:o[d][1],system:!1,seporator:!1,disabled:!1});for(m=!0,d=0,h=t.length;h>d;d++)p=t[d],(r?r.call(null,p):!0)&&(m&&0d;d++)p=s[d],(p.subScribed()||!p.existen)&&(r?r.call(null,p):!0)&&(Lt.FolderType.User===p.type()||!c||0=5?o:20,o=320>=o?o:320,e.setInterval(function(){jt.contactsSync()},6e4*o+5e3),r.delay(function(){jt.contactsSync()},5e3),r.delay(function(){jt.folderInformationMultiply(!0)},500),r.delay(function(){jt.remote().servicesPics(function(e,t){Lt.StorageResultType.Success===e&&t&&t.Result&&jt.cache().setServicesData(t.Result)})},2e3),Dt.runHook("rl-start-user-screens"),jt.pub("rl.bootstart-user-screens"),jt.settingsGet("AccountSignMe")&&e.navigator.registerProtocolHandler&&r.delay(function(){try{e.navigator.registerProtocolHandler("mailto",e.location.protocol+"//"+e.location.host+e.location.pathname+"?mailto&to=%s",""+(jt.settingsGet("Title")||"RainLoop"))}catch(t){}jt.settingsGet("MailToEmail")&&jt.mailToHelper(jt.settingsGet("MailToEmail"))},500)):(xt.startScreens([Ft]),Dt.runHook("rl-start-login-screens"),jt.pub("rl.bootstart-login-screens")),e.SimplePace&&e.SimplePace.set(100),kt.bMobileDevice||r.defer(function(){Mt.initLayoutResizer("#rl-left","#rl-right",Lt.ClientSideKeyName.FolderListSize)})},this))):(s=Mt.pString(jt.settingsGet("CustomLoginLink")),s?(xt.routeOff(),xt.setHash(jt.link().root(),!0),xt.routeOff(),r.defer(function(){e.location.href=s})):(xt.hideLoading(),xt.startScreens([Ft]),Dt.runHook("rl-start-login-screens"),jt.pub("rl.bootstart-login-screens"),e.SimplePace&&e.SimplePace.set(100))),n&&(e["rl_"+i+"_google_service"]=function(){jt.data().googleActions(!0),jt.socialUsers()}),a&&(e["rl_"+i+"_facebook_service"]=function(){jt.data().facebookActions(!0),jt.socialUsers()}),l&&(e["rl_"+i+"_twitter_service"]=function(){jt.data().twitterActions(!0),jt.socialUsers()}),jt.sub("interval.1m",function(){kt.momentTrigger(!kt.momentTrigger())}),Dt.runHook("rl-start-screens"),jt.pub("rl.bootstart-end")},jt=new Rt,Bt.addClass(kt.bMobileDevice?"mobile":"no-mobile"),Gt.keydown(Mt.killCtrlAandS).keyup(Mt.killCtrlAandS),Gt.unload(function(){kt.bUnload=!0}),Bt.on("click.dropdown.data-api",function(){Mt.detectDropdownVisibility()}),e.rl=e.rl||{},e.rl.addHook=Dt.addHook,e.rl.settingsGet=Dt.mainSettingsGet,e.rl.remoteRequest=Dt.remoteRequest,e.rl.pluginSettingsGet=Dt.settingsGet,e.rl.addSettingsViewModel=Mt.addSettingsViewModel,e.rl.createCommand=Mt.createCommand,e.rl.EmailModel=v,e.rl.Enums=Lt,e.__RLBOOT=function(s){t(function(){e.rainloopTEMPLATES&&e.rainloopTEMPLATES[0]?(t("#rl-templates").html(e.rainloopTEMPLATES[0]),r.delay(function(){e.rainloopAppData={},e.rainloopI18N={},e.rainloopTEMPLATES={},xt.setBoot(jt).bootstart(),Bt.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},50)):s(!1),e.__RLBOOT=null})},e.SimplePace&&e.SimplePace.add(10)}(window,jQuery,ko,crossroads,hasher,moment,Jua,_,ifvisible,key); \ No newline at end of file diff --git a/rainloop/v/0.0.0/static/js/boot.js b/rainloop/v/0.0.0/static/js/boot.js index 5a19e57366..14938bec3c 100644 --- a/rainloop/v/0.0.0/static/js/boot.js +++ b/rainloop/v/0.0.0/static/js/boot.js @@ -1,6 +1,6 @@ -/*! See http://www.JSON.org/js.html */ -var JSON;JSON||(JSON={}),function(){function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;cs.progress&&s.add(s.addSpeed)},500)},s.prototype.stopAddInterval=function(){e.clearInterval(this.addInterval),this.addInterval=0},s.prototype.build=function(){if(null===this.el){var e=document.querySelector("body");e&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='
',e.firstChild?e.insertBefore(this.el,e.firstChild):e.appendChild(this.el))}return this.el},s.prototype.reset=function(){return this.progress=0,this.render()},s.prototype.update=function(s){var t=e.parseInt(s,10);return t>this.progress&&(this.progress=t,this.progress=100this.progress?0:this.progress),this.render()},s.prototype.add=function(s){return this.progress+=e.parseInt(s,10),this.progress=100this.progress?0:this.progress,this.render()},s.prototype.setSpeed=function(e,s){this.addSpeed=e,this.stopProgress=s||100},s.prototype.render=function(){var s=this.build();s&&s.children&&s.children[0]&&s.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),s.className=s.className.replace("simple-pace-inactive",""),s.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),e.setTimeout(function(){s.className=s.className.replace("simple-pace-active",""),s.className+=" simple-pace-inactive"},500))},!e.SimplePace){var t=new s;e.SimplePace={sleep:function(){t.setSpeed(2,95)},set:function(e){t.update(e)},add:function(e){t.add(e)}}}}(window); +!function(e){function s(){var s=this;s.el=null,s.done=!1,s.progress=0,s.addInterval=0,s.addSpeed=3,s.stopProgress=100,s.interval=e.setInterval(function(){var t=s.build();t&&e.clearInterval(s.interval)},100)}if(s.prototype.startAddInterval=function(){var s=this;s.stopAddInterval(),s.addInterval=e.setInterval(function(){0s.progress&&s.add(s.addSpeed)},500)},s.prototype.stopAddInterval=function(){e.clearInterval(this.addInterval),this.addInterval=0},s.prototype.build=function(){if(null===this.el){var e=document.querySelector("body");e&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='
',e.firstChild?e.insertBefore(this.el,e.firstChild):e.appendChild(this.el))}return this.el},s.prototype.reset=function(){return this.progress=0,this.render()},s.prototype.update=function(s){var t=e.parseInt(s,10);return t>this.progress&&(this.progress=t,this.progress=100this.progress?0:this.progress),this.render()},s.prototype.add=function(s){return this.progress+=e.parseInt(s,10),this.progress=100this.progress?0:this.progress,this.render()},s.prototype.setSpeed=function(e,s){this.addSpeed=e,this.stopProgress=s||100},s.prototype.render=function(){var s=this.build();s&&s.children&&s.children[0]&&s.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),s.className=s.className.replace("simple-pace-inactive",""),s.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),e.setTimeout(function(){s.className=s.className.replace("simple-pace-active",""),s.className+=" simple-pace-inactive"},500))},!e.SimplePace){var t=new s;e.SimplePace={sleep:function(){t.setSpeed(2,95)},set:function(e){t.update(e)},add:function(e){t.add(e)}}}}(window); /*! RainLoop Top Driver v1.0 (c) 2013 RainLoop Team; Licensed under MIT */ !function(t,h){function s(){}s.prototype.s=t.sessionStorage,s.prototype.t=t.top||t,s.prototype.getHash=function(){var t=null;if(this.s)t=this.s.getItem("__rlA")||null;else if(this.t){var s=this.t.name&&h&&"{"===this.t.name.toString().substr(0,1)?h.parse(this.t.name.toString()):null;t=s?s.__rlA||null:null}return t},s.prototype.setHash=function(){var s=t.rainloopAppData,n=null;this.s?this.s.setItem("__rlA",s&&s.AuthAccountHash?s.AuthAccountHash:""):this.t&&h&&(n={},n.__rlA=s&&s.AuthAccountHash?s.AuthAccountHash:"",this.t.name=h.stringify(n))},s.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},t._rlhh=new s,t.__rlah=function(){return t._rlhh?t._rlhh.getHash():null},t.__rlah_set=function(){t._rlhh&&t._rlhh.setHash()},t.__rlah_clear=function(){t._rlhh&&t._rlhh.clearHash()}}(window,window.JSON); \ No newline at end of file diff --git a/rainloop/v/0.0.0/static/js/libs.js b/rainloop/v/0.0.0/static/js/libs.js index 9a72389695..2869ab92e2 100644 --- a/rainloop/v/0.0.0/static/js/libs.js +++ b/rainloop/v/0.0.0/static/js/libs.js @@ -22,7 +22,7 @@ if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c (function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return"area"===o?(s=t.parentNode,n=s.name,t.href&&n&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css("position"),("absolute"===a||"relative"===a||"fixed"===a)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var a=e.attr(t,"tabindex"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,a&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===a?["Left","Right"]:["Top","Bottom"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+a]=function(i){return i===t?o["inner"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+a]=function(t,i){return"number"!=typeof t?o["outer"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var a=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],n=u+"-"+i,a||(a=s,s=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&"_"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},a=i.split("."),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,a){var n,r=this;"boolean"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,a,n){"string"==typeof a&&(a={effect:a});var r,o=a?a===!0||"number"==typeof a?i:a.effect||i:t;a=a||{},"number"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function s(t,i){return parseInt(e.css(t,i),10)||0}function a(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,o=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var i,s,a=e("
"),r=a.children()[0];return e("body").append(a),i=r.offsetWidth,a.css("overflow","scroll"),s=r.offsetWidth,i===s&&(s=a[0].clientWidth),a.remove(),n=i-s},getScrollInfo:function(t){var i=t.isWindow?"":t.element.css("overflow-x"),s=t.isWindow?"":t.element.css("overflow-y"),a="scroll"===i||"auto"===i&&t.widths?"left":i>0?"right":"center",vertical:0>n?"top":a>0?"bottom":"middle"};c>p&&p>o(i+s)&&(h.horizontal="center"),d>m&&m>o(a+n)&&(h.vertical="middle"),h.important=r(o(i),o(s))>r(o(a),o(n))?"horizontal":"vertical",t.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollLeft:s.offset.left,n=s.width,o=e.left-t.collisionPosition.marginLeft,h=a-o,l=o+t.collisionWidth-n-a;t.collisionWidth>n?h>0&&0>=l?(i=e.left+h+t.collisionWidth-n-a,e.left+=h-i):e.left=l>0&&0>=h?a:h>l?a+n-t.collisionWidth:a:h>0?e.left+=h:l>0?e.left-=l:e.left=r(e.left-o,e.left)},top:function(e,t){var i,s=t.within,a=s.isWindow?s.scrollTop:s.offset.top,n=t.within.height,o=e.top-t.collisionPosition.marginTop,h=a-o,l=o+t.collisionHeight-n-a;t.collisionHeight>n?h>0&&0>=l?(i=e.top+h+t.collisionHeight-n-a,e.top+=h-i):e.top=l>0&&0>=h?a:h>l?a+n-t.collisionHeight:a:h>0?e.top+=h:l>0?e.top-=l:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var i,s,a=t.within,n=a.offset.left+a.scrollLeft,r=a.width,h=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,c=l+t.collisionWidth-r-h,d="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+d+p+f+t.collisionWidth-r-n,(0>i||o(u)>i)&&(e.left+=d+p+f)):c>0&&(s=e.left-t.collisionPosition.marginLeft+d+p+f-h,(s>0||c>o(s))&&(e.left+=d+p+f))},top:function(e,t){var i,s,a=t.within,n=a.offset.top+a.scrollTop,r=a.height,h=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,c=l+t.collisionHeight-r-h,d="top"===t.my[1],p=d?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-r-n,e.top+p+f+m>u&&(0>s||o(u)>s)&&(e.top+=p+f+m)):c>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,e.top+p+f+m>c&&(i>0||c>o(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,a,n,r=document.getElementsByTagName("body")[0],o=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(n in s)t.style[n]=s[n];t.appendChild(o),i=r||document.documentElement,i.insertBefore(t,i.firstChild),o.style.cssText="position: absolute; left: 10.7432222px;",a=e(o).offset().left,e.support.offsetFractions=a>10&&11>a,t.innerHTML="",i.removeChild(t)}()})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var a=this._uiHash();if(this._trigger("drag",t,a)===!1)return this._mouseUp({}),!1;this.position=a.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,a=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(a=e.ui.ddmanager.drop(this,t)),this.dropped&&(a=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!a||"valid"===this.options.revert&&a||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,a)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,a=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return a.parents("body").length||a.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),a[0]===this.element[0]||/(fixed|absolute)/.test(a.css("position"))||a.css("position","absolute"),a},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,a,s=this.options;return s.containment?"window"===s.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===s.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):s.containment.constructor===Array?(this.containment=s.containment,undefined):("parent"===s.containment&&(s.containment=this.helper[0].parentNode),i=e(s.containment),a=i[0],a&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(a.scrollWidth,a.offsetWidth):a.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(a.scrollHeight,a.offsetHeight):a.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var a="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}),{top:i.top+this.offset.relative.top*a+this.offset.parent.top*a-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*a,left:i.left+this.offset.relative.left*a+this.offset.parent.left*a-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*a}},_generatePosition:function(t){var i,a,s,n,r=this.options,o="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=t.pageX,h=t.pageY;return this.offset.scroll||(this.offset.scroll={top:o.scrollTop(),left:o.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(a=this.relative_container.offset(),i=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),r.grid&&(s=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,h=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-r.grid[1]:s+r.grid[1]:s,n=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,a){return a=a||this._uiHash(),e.ui.plugin.call(this,t,[i,a]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,a)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var a=e(this).data("ui-draggable"),s=a.options,n=e.extend({},i,{item:a.element});a.sortables=[],e(s.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(a.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i){var a=e(this).data("ui-draggable"),s=e.extend({},i,{item:a.element});e.each(a.sortables,function(){this.instance.isOver?(this.instance.isOver=0,a.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===a.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,s))})},drag:function(t,i){var a=e(this).data("ui-draggable"),s=this;e.each(a.sortables,function(){var n=!1,r=this;this.instance.positionAbs=a.positionAbs,this.instance.helperProportions=a.helperProportions,this.instance.offset.click=a.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(n=!0,e.each(a.sortables,function(){return this.instance.positionAbs=a.positionAbs,this.instance.helperProportions=a.helperProportions,this.instance.offset.click=a.offset.click,this!==r&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(r.instance.element[0],this.instance.element[0])&&(n=!1),n})),n?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(s).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=a.offset.click.top,this.instance.offset.click.left=a.offset.click.left,this.instance.offset.parent.left-=a.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=a.offset.parent.top-this.instance.offset.parent.top,a._trigger("toSortable",t),a.dropped=this.instance.element,a.currentItem=a.element,this.instance.fromOutside=a),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),a._trigger("fromSortable",t),a.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var a=e(i.helper),s=e(this).data("ui-draggable").options;a.css("opacity")&&(s._opacity=a.css("opacity")),a.css("opacity",s.opacity)},stop:function(t,i){var a=e(this).data("ui-draggable").options;a._opacity&&e(i.helper).css("opacity",a._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),a=i.options,s=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(a.axis&&"x"===a.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY=0;d--)o=p.snapElements[d].left,l=o+p.snapElements[d].width,h=p.snapElements[d].top,u=h+p.snapElements[d].height,o-m>v||g>l+m||h-m>b||y>u+m||!e.contains(p.snapElements[d].item.ownerDocument,p.snapElements[d].item)?(p.snapElements[d].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(a=m>=Math.abs(h-b),s=m>=Math.abs(u-y),n=m>=Math.abs(o-v),r=m>=Math.abs(l-g),a&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),n&&(i.position.left=p._convertPositionTo("relative",{top:0,left:o-p.helperProportions.width}).left-p.margins.left),r&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),c=a||s||n||r,"outer"!==f.snapMode&&(a=m>=Math.abs(h-y),s=m>=Math.abs(u-b),n=m>=Math.abs(o-g),r=m>=Math.abs(l-v),a&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.left=p._convertPositionTo("relative",{top:0,left:o}).left-p.margins.left),r&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[d].snapping&&(a||s||n||r||c)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=a||s||n||r||c)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,a=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});a.length&&(t=parseInt(e(a[0]).css("zIndex"),10)||0,e(a).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+a.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var a=e(i.helper),s=e(this).data("ui-draggable").options;a.css("zIndex")&&(s._zIndex=a.css("zIndex")),a.css("zIndex",s.zIndex)},stop:function(t,i){var a=e(this).data("ui-draggable").options;a._zIndex&&e(i.helper).css("zIndex",a._zIndex)}})})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var a=i||e.ui.ddmanager.current,s=!1;return a&&(a.currentItem||a.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===a.options.scope&&t.accept.call(t.element[0],a.currentItem||a.element)&&e.ui.intersect(a,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(s=!0,!1):undefined}),s?!1:this.accept.call(this.element[0],a.currentItem||a.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(a)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,a){if(!i.offset)return!1;var s,n,r=(e.positionAbs||e.position.absolute).left,o=r+e.helperProportions.width,l=(e.positionAbs||e.position.absolute).top,h=l+e.helperProportions.height,u=i.offset.left,d=u+i.proportions.width,c=i.offset.top,p=c+i.proportions.height;switch(a){case"fit":return r>=u&&d>=o&&l>=c&&p>=h;case"intersect":return r+e.helperProportions.width/2>u&&d>o-e.helperProportions.width/2&&l+e.helperProportions.height/2>c&&p>h-e.helperProportions.height/2;case"pointer":return s=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,n=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(n,c,i.proportions.height)&&t(s,u,i.proportions.width);case"touch":return(l>=c&&p>=l||h>=c&&p>=h||c>l&&h>p)&&(r>=u&&d>=r||o>=u&&d>=o||u>r&&o>d);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var a,s,n=e.ui.ddmanager.droppables[t.options.scope]||[],r=i?i.type:null,o=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(a=0;n.length>a;a++)if(!(n[a].options.disabled||t&&!n[a].accept.call(n[a].element[0],t.currentItem||t.element))){for(s=0;o.length>s;s++)if(o[s]===n[a].element[0]){n[a].proportions.height=0;continue e}n[a].visible="none"!==n[a].element.css("display"),n[a].visible&&("mousedown"===r&&n[a]._activate.call(n[a],i),n[a].offset=n[a].element.offset(),n[a].proportions={width:n[a].element[0].offsetWidth,height:n[a].element[0].offsetHeight})}},drop:function(t,i){var a=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(a=this._drop.call(this,i)||a),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),a},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var a,s,n,r=e.ui.intersect(t,this,this.options.tolerance),o=!r&&this.isover?"isout":r&&!this.isover?"isover":null;o&&(this.options.greedy&&(s=this.options.scope,n=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===s}),n.length&&(a=e.data(n[0],"ui-droppable"),a.greedyChild="isover"===o)),a&&"isover"===o&&(a.isover=!1,a.isout=!0,a._out.call(a,i)),this[o]=!0,this["isout"===o?"isover":"isout"]=!1,this["isover"===o?"_over":"_out"].call(this,i),a&&"isout"===o&&(a.isout=!1,a.isover=!0,a._over.call(a,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery);(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,a,n,r=this,o=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=o.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),n="ui-resizable-"+s,a=e("
"),a.css({zIndex:o.zIndex}),"se"===s&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(a);this._renderAxis=function(t){var i,s,a,n;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),n=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),a=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(a,n),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){r.resizing||(this.className&&(a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=a&&a[1]?a[1]:"se")}),o.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){o.disabled||(e(this).removeClass("ui-resizable-autohide"),r._handles.show())}).mouseleave(function(){o.disabled||r.resizing||(e(this).addClass("ui-resizable-autohide"),r._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,a=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(a=!0);return!this.options.disabled&&a},_mouseStart:function(i){var s,a,n,r=this.options,o=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:o.top,left:o.left}),this._renderProxy(),s=t(this.helper.css("left")),a=t(this.helper.css("top")),r.containment&&(s+=e(r.containment).scrollLeft()||0,a+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:a},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:a},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,a={},n=this.originalMousePosition,r=this.axis,o=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-n.left||0,d=t.pageY-n.top||0,p=this._change[r];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==o&&(a.top=this.position.top+"px"),this.position.left!==h&&(a.left=this.position.left+"px"),this.size.width!==l&&(a.width=this.size.width+"px"),this.size.height!==u&&(a.height=this.size.height+"px"),s.css(a),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(a)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,a,n,r,o,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),a=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,n=s?0:u.sizeDiff.width,r={width:u.helper.width()-n,height:u.helper.height()-a},o=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(r,{top:h,left:o})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,a,n,r,o=this.options;r={minWidth:i(o.minWidth)?o.minWidth:0,maxWidth:i(o.maxWidth)?o.maxWidth:1/0,minHeight:i(o.minHeight)?o.minHeight:0,maxHeight:i(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=r.minHeight*this.aspectRatio,a=r.minWidth/this.aspectRatio,s=r.maxHeight*this.aspectRatio,n=r.maxWidth/this.aspectRatio,t>r.minWidth&&(r.minWidth=t),a>r.minHeight&&(r.minHeight=a),r.maxWidth>s&&(r.maxWidth=s),r.maxHeight>n&&(r.maxHeight=n)),this._vBoundaries=r},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,a=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===a&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===a&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,a=i(e.width)&&t.maxWidth&&t.maxWidthe.width,o=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return r&&(e.width=t.minWidth),o&&(e.height=t.minHeight),a&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),r&&u&&(e.left=h-t.minWidth),a&&u&&(e.left=h-t.maxWidth),o&&c&&(e.top=l-t.minHeight),n&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,a,n=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(a=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[a.css("borderTopWidth"),a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")],s=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);a.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,a=this.originalPosition;return{top:a.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,a=i._proportionallyResizeElements,n=a.length&&/textarea/i.test(a[0].nodeName),r=n&&e.ui.hasScroll(a[0],"left")?0:i.sizeDiff.height,o=n?0:i.sizeDiff.width,h={width:i.size.width-o,height:i.size.height-r},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};a&&a.length&&e(a[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,a,n,r,o,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,a){s[e]=t(i.css("padding"+a))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},a=l.containerOffset,n=l.containerSize.height,r=l.containerSize.width,o=e.ui.hasScroll(p,"left")?p.scrollWidth:r,h=e.ui.hasScroll(p)?p.scrollHeight:n,l.parentData={element:p,left:a.left,top:a.top,width:o,height:h}))},resize:function(t){var i,s,a,n,r=e(this).data("ui-resizable"),o=r.options,h=r.containerOffset,l=r.position,u=r._aspectRatio||t.shiftKey,c={top:0,left:0},d=r.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(r._helper?h.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-h.left:r.position.left-c.left),u&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=o.helper?h.left:0),l.top<(r._helper?h.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-h.top:r.position.top),u&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?h.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top,i=Math.abs((r._helper?r.offset.left-c.left:r.offset.left-c.left)+r.sizeDiff.width),s=Math.abs((r._helper?r.offset.top-c.top:r.offset.top-h.top)+r.sizeDiff.height),a=r.containerElement.get(0)===r.element.parent().get(0),n=/relative|absolute/.test(r.containerElement.css("position")),a&&n&&(i-=r.parentData.left),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,u&&(r.size.height=r.size.width/r.aspectRatio)),s+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-s,u&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,a=t.containerPosition,n=t.containerElement,r=e(t.helper),o=r.offset(),h=r.outerWidth()-t.sizeDiff.width,l=r.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(n.css("position"))&&e(this).css({left:o.left-a.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(n.css("position"))&&e(this).css({left:o.left-a.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),a=s.options,n=s.originalSize,r=s.originalPosition,o={height:s.size.height-n.height||0,width:s.size.width-n.width||0,top:s.position.top-r.top||0,left:s.position.left-r.left||0},h=function(t,s){e(t).each(function(){var t=e(this),a=e(this).data("ui-resizable-alsoresize"),n={},r=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(e,t){var i=(a[t]||0)+(o[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})};"object"!=typeof a.alsoResize||a.alsoResize.nodeType?h(a.alsoResize):e.each(a.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,a=t.originalSize,n=t.originalPosition,r=t.axis,o="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=o[0]||1,l=o[1]||1,u=Math.round((s.width-a.width)/h)*h,c=Math.round((s.height-a.height)/l)*l,d=a.width+u,p=a.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=o,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(r)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(r)?(t.size.width=d,t.size.height=p,t.position.top=n.top-c):/^(sw)$/.test(r)?(t.size.width=d,t.size.height=p,t.position.left=n.left-u):(t.size.width=d,t.size.height=p,t.position.top=n.top-c,t.position.left=n.left-u)}})})(jQuery);(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,a=e.data(this,"selectable-item");return a?(s=!t.metaKey&&!t.ctrlKey||!a.$element.hasClass("ui-selected"),a.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),a.unselecting=!s,a.selecting=s,a.selected=s,s?i._trigger("selecting",t,{selecting:a.element}):i._trigger("unselecting",t,{unselecting:a.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,a=this.options,n=this.opos[0],r=this.opos[1],o=t.pageX,h=t.pageY;return n>o&&(i=o,o=n,n=i),r>h&&(i=h,h=r,r=i),this.helper.css({left:n,top:r,width:o-n,height:h-r}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===a.tolerance?l=!(i.left>o||n>i.right||i.top>h||r>i.bottom):"fit"===a.tolerance&&(l=i.left>n&&o>i.right&&i.top>r&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}function i(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))}e.widget("ui.sortable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===e.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,i){"disabled"===t?(this.options[t]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,i){var s=null,a=!1,n=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,n.widgetName+"-item")===n?(s=e(this),!1):undefined}),e.data(t.target,n.widgetName+"-item")===n&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(a=!0)}),a)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var a,n,r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",r.cursor),this.storedStylesheet=e("").appendTo(n)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(a=this.containers.length-1;a>=0;a--)this.containers[a]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!r.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,a,n,r=this.options,o=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY=0;i--)if(s=this.items[i],a=s.item[0],n=this._intersectsWithPointer(s),n&&s.instance===this.currentContainer&&a!==this.currentItem[0]&&this.placeholder[1===n?"next":"prev"]()[0]!==a&&!e.contains(this.placeholder[0],a)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],a):!0)){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,a=this.placeholder.offset(),n=this.options.axis,r={};n&&"x"!==n||(r.left=a.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(r.top=a.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,a=s+this.helperProportions.height,n=e.left,r=n+e.width,o=e.top,h=o+e.height,l=this.offset.click.top,u=this.offset.click.left,c="x"===this.options.axis||s+l>o&&h>s+l,d="y"===this.options.axis||t+u>n&&r>t+u,p=c&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>n&&r>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>o&&h>a-this.helperProportions.height/2},_intersectsWithPointer:function(e){var i="x"===this.options.axis||t(this.positionAbs.top+this.offset.click.top,e.top,e.height),s="y"===this.options.axis||t(this.positionAbs.left+this.offset.click.left,e.left,e.width),a=i&&s,n=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return a?this.floating?r&&"right"===r||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),s=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),a=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&s||"left"===n&&!s:a&&("down"===a&&i||"up"===a&&!i)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var i,s,a,n,r=[],o=[],h=this._connectWith();if(h&&t)for(i=h.length-1;i>=0;i--)for(a=e(h[i]),s=a.length-1;s>=0;s--)n=e.data(a[s],this.widgetFullName),n&&n!==this&&!n.options.disabled&&o.push([e.isFunction(n.options.items)?n.options.items.call(n.element):e(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);for(o.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=o.length-1;i>=0;i--)o[i][0].each(function(){r.push(this)});return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,a,n,r,o,h,l,u=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(a=e(d[i]),s=a.length-1;s>=0;s--)n=e.data(a[s],this.widgetFullName),n&&n!==this&&!n.options.disabled&&(c.push([e.isFunction(n.options.items)?n.options.items.call(n.element[0],t,{item:this.currentItem}):e(n.options.items,n.element),n]),this.containers.push(n));for(i=c.length-1;i>=0;i--)for(r=c[i][1],o=c[i][0],s=0,l=o.length;l>s;s++)h=e(o[s]),h.data(this.widgetName+"-item",r),u.push({item:h,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,a,n;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(a=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=a.outerWidth(),s.height=a.outerHeight()),n=a.offset(),s.left=n.left,s.top=n.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)n=this.containers[i].element.offset(),this.containers[i].containerCache.left=n.left,this.containers[i].containerCache.top=n.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),a=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e(" ",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(a)}):"img"===s&&a.attr("src",t.currentItem.attr("src")),i||a.css("visibility","hidden"),a},update:function(e,a){(!i||s.forcePlaceholderSize)&&(a.height()||a.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),a.width()||a.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(s){var a,n,r,o,h,l,u,c,d,p,f=null,m=null;for(a=this.containers.length-1;a>=0;a--)if(!e.contains(this.currentItem[0],this.containers[a].element[0]))if(this._intersectsWith(this.containers[a].containerCache)){if(f&&e.contains(this.containers[a].element[0],f.element[0]))continue;f=this.containers[a],m=a}else this.containers[a].containerCache.over&&(this.containers[a]._trigger("out",s,this._uiHash(this)),this.containers[a].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(r=1e4,o=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",u=this.positionAbs[h]+this.offset.click[h],n=this.items.length-1;n>=0;n--)e.contains(this.containers[m].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(!p||t(this.positionAbs.top+this.offset.click.top,this.items[n].top,this.items[n].height))&&(c=this.items[n].item.offset()[h],d=!1,Math.abs(c-u)>Math.abs(c+this.items[n][l]-u)&&(d=!0,c+=this.items[n][l]),r>Math.abs(c-u)&&(r=Math.abs(c-u),o=this.items[n],this.direction=d?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;o?this._rearrange(s,o,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,a=this.options;"parent"===a.containment&&(a.containment=this.helper[0].parentNode),("document"===a.containment||"window"===a.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===a.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===a.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(a.containment)||(t=e(a.containment)[0],i=e(a.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,a="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,n=/(html|body)/i.test(a[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():n?0:a.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():n?0:a.scrollLeft())*s}},_generatePosition:function(t){var i,s,a=this.options,n=t.pageX,r=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.leftthis.containment[2]&&(n=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),a.grid&&(i=this.originalPageY+Math.round((r-this.originalPageY)/a.grid[1])*a.grid[1],r=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-a.grid[1]:i+a.grid[1]:i,s=this.originalPageX+Math.round((n-this.originalPageX)/a.grid[0])*a.grid[0],n=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-a.grid[0]:s+a.grid[0]:s)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:o.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:o.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var a=this.counter;this._delay(function(){a===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&s.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||s.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(s.push(function(e){this._trigger("remove",e,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)t||s.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(i=0;s.length>i;i++)s[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e){var t=0;e.widget("ui.autocomplete",{version:"1.10.3",defaultElement:"",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,i,a,s=this.element[0].nodeName.toLowerCase(),n="textarea"===s,r="input"===s;this.isMultiLine=n?!0:r?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[n||r?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(s){if(this.element.prop("readOnly"))return t=!0,a=!0,i=!0,undefined;t=!1,a=!1,i=!1;var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:t=!0,this._move("previousPage",s);break;case n.PAGE_DOWN:t=!0,this._move("nextPage",s);break;case n.UP:t=!0,this._keyEvent("previous",s);break;case n.DOWN:t=!0,this._keyEvent("next",s);break;case n.ENTER:case n.NUMPAD_ENTER:this.menu.active&&(t=!0,s.preventDefault(),this.menu.select(s));break;case n.TAB:this.menu.active&&this.menu.select(s);break;case n.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(s),s.preventDefault());break;default:i=!0,this._searchTimeout(s)}},keypress:function(a){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&a.preventDefault(),undefined;if(!i){var s=e.ui.keyCode;switch(a.keyCode){case s.PAGE_UP:this._move("previousPage",a);break;case s.PAGE_DOWN:this._move("nextPage",a);break;case s.UP:this._keyEvent("previous",a);break;case s.DOWN:this._keyEvent("next",a)}}},input:function(e){return a?(a=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("