From 333c063cf16415c8441d99188bce96cd49abd3f4 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Mon, 16 Jun 2014 23:56:11 +0400 Subject: [PATCH] Change build system (Grunt -> Gulp) Remove attachments on reply (Closes #195) Do not show deleted (flag \Deleted) messages (Closes #185) Release commit --- Gruntfile.js => build/other/Gruntfile.js | 10 +- build/owncloud/rainloop-app/VERSION | 2 +- build/owncloud/rainloop-app/appinfo/info.xml | 18 +- build/owncloud/rainloop-app_/INSTALL | 19 - .../owncloud/rainloop-app_/ajax/personal.php | 46 -- build/owncloud/rainloop-app_/appinfo/app.php | 33 - build/owncloud/rainloop-app_/appinfo/info.xml | 10 - build/owncloud/rainloop-app_/appinfo/version | 1 - .../owncloud/rainloop-app_/img/logo-64x64.png | Bin 832 -> 0 bytes build/owncloud/rainloop-app_/img/mail.png | Bin 1518 -> 0 bytes build/owncloud/rainloop-app_/index-admin.php | 22 - build/owncloud/rainloop-app_/index.php | 36 -- build/owncloud/rainloop-app_/js/personal.js | 13 - build/owncloud/rainloop-app_/js/rainloop.js | 76 --- .../rainloop-app_/lib/RainLoopHelper.php | 28 - build/owncloud/rainloop-app_/personal.php | 29 - .../rainloop-app_/templates/empty.php | 1 - .../rainloop-app_/templates/iframe.php | 3 - .../rainloop-app_/templates/personal.php | 21 - dev/Admin/About.js | 2 +- dev/Common/_Begin.js | 6 +- dev/Common/_BeginW.js | 4 +- dev/Styles/@Main.less | 7 + dev/Styles/Layout.less | 25 +- dev/Styles/SettingsFolders.less | 14 +- dev/ViewModels/PopupsComposeViewModel.js | 1 - gulpfile.js | 585 ++++++++++++++++++ package.json | 38 +- .../app/libraries/MailSo/Mime/Message.php | 13 +- .../templates/Views/App/MailMessageList.html | 4 +- rainloop/v/0.0.0/static/css/app.css | 265 ++++---- rainloop/v/0.0.0/static/css/app.min.css | 2 +- rainloop/v/0.0.0/static/js/admin.js | 212 +++++-- rainloop/v/0.0.0/static/js/admin.min.js | 8 +- rainloop/v/0.0.0/static/js/app.js | 346 ++++++++--- rainloop/v/0.0.0/static/js/app.min.js | 18 +- rainloop/v/0.0.0/static/js/boot.js | 8 +- rainloop/v/0.0.0/static/js/libs.js | 104 ++-- vendors/bootstrap/less/mixins.less | 18 +- vendors/ifvisible/ifvisible.min.js | 2 +- .../jquery.nanoscroller-0.7.min.js | 4 +- .../jquery.nanoscroller.js | 14 +- vendors/rl/rl-1.0.min.js | 2 +- vendors/simple-pace/simple-pace-1.0.min.js | 2 +- 44 files changed, 1300 insertions(+), 772 deletions(-) rename Gruntfile.js => build/other/Gruntfile.js (99%) delete mode 100644 build/owncloud/rainloop-app_/INSTALL delete mode 100644 build/owncloud/rainloop-app_/ajax/personal.php delete mode 100644 build/owncloud/rainloop-app_/appinfo/app.php delete mode 100644 build/owncloud/rainloop-app_/appinfo/info.xml delete mode 100644 build/owncloud/rainloop-app_/appinfo/version delete mode 100644 build/owncloud/rainloop-app_/img/logo-64x64.png delete mode 100644 build/owncloud/rainloop-app_/img/mail.png delete mode 100644 build/owncloud/rainloop-app_/index-admin.php delete mode 100644 build/owncloud/rainloop-app_/index.php delete mode 100644 build/owncloud/rainloop-app_/js/personal.js delete mode 100644 build/owncloud/rainloop-app_/js/rainloop.js delete mode 100644 build/owncloud/rainloop-app_/lib/RainLoopHelper.php delete mode 100644 build/owncloud/rainloop-app_/personal.php delete mode 100644 build/owncloud/rainloop-app_/templates/empty.php delete mode 100644 build/owncloud/rainloop-app_/templates/iframe.php delete mode 100644 build/owncloud/rainloop-app_/templates/personal.php create mode 100644 gulpfile.js diff --git a/Gruntfile.js b/build/other/Gruntfile.js similarity index 99% rename from Gruntfile.js rename to build/other/Gruntfile.js index c64de9e07..304826fdc 100644 --- a/Gruntfile.js +++ b/build/other/Gruntfile.js @@ -1,4 +1,8 @@ +/** + * @deprecated + */ + /*jshint node: true */ 'use strict'; @@ -106,9 +110,9 @@ module.exports = function (grunt) { js_index: { nonull: true, src: [ - 'vendors/json2.min.js', - 'vendors/simple-pace/simple-pace-1.0.min.js', - 'vendors/rl/rl-1.0.min.js' + "vendors/json2.min.js", + "vendors/simple-pace/simple-pace-1.0.min.js", + "vendors/rl/rl-1.0.min.js" ], dest: 'rainloop/v/<%= cfg.devVersion %>/static/js/boot.js' }, diff --git a/build/owncloud/rainloop-app/VERSION b/build/owncloud/rainloop-app/VERSION index a58941b07..171538eb0 100644 --- a/build/owncloud/rainloop-app/VERSION +++ b/build/owncloud/rainloop-app/VERSION @@ -1 +1 @@ -1.3 \ No newline at end of file +0.0 \ No newline at end of file diff --git a/build/owncloud/rainloop-app/appinfo/info.xml b/build/owncloud/rainloop-app/appinfo/info.xml index d5828e34a..c261b5b93 100644 --- a/build/owncloud/rainloop-app/appinfo/info.xml +++ b/build/owncloud/rainloop-app/appinfo/info.xml @@ -1,10 +1,10 @@ - - - rainloop - RainLoop - RainLoop Webmail - 1.2 - CC BY-NC-SA 3.0 - RainLoop Team - 6.0 + + + rainloop + RainLoop + RainLoop Webmail + 0.0 + CC BY-NC-SA 3.0 + RainLoop Team + 6.0 \ No newline at end of file diff --git a/build/owncloud/rainloop-app_/INSTALL b/build/owncloud/rainloop-app_/INSTALL deleted file mode 100644 index 727dab048..000000000 --- a/build/owncloud/rainloop-app_/INSTALL +++ /dev/null @@ -1,19 +0,0 @@ -************************************************************************ -* -* ownCloud - RainLoop mail plugin -* -* @author RainLoop Team -* @copyright 2014 RainLoop Team -* -* https://github.com/RainLoop/rainloop-webmail/ -* -************************************************************************ - -INSTALL: -- Unpack the RainLoop Webmail application package in the apps directory of your OwnCloud instance - -CONFIGURATION: - - 1) In the Apps > Enable 'RainLoop' plugin - 2) In the Settings > Personal > Type your mail server email(login) and password (for autologin) - 3) Enjoy! diff --git a/build/owncloud/rainloop-app_/ajax/personal.php b/build/owncloud/rainloop-app_/ajax/personal.php deleted file mode 100644 index 1791cc880..000000000 --- a/build/owncloud/rainloop-app_/ajax/personal.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Invalid argument(s)', 'Email' => $sEmail, 'Login' => $sLogin)); - return false; -} - -OCP\JSON::success(array('Message' => 'Saved successfully', 'Email' => $sEmail, 'Login' => $sLogin)); -return true; diff --git a/build/owncloud/rainloop-app_/appinfo/app.php b/build/owncloud/rainloop-app_/appinfo/app.php deleted file mode 100644 index 1e2b1784c..000000000 --- a/build/owncloud/rainloop-app_/appinfo/app.php +++ /dev/null @@ -1,33 +0,0 @@ - 'rainloop_index', - 'order' => 20, - 'href' => OCP\Util::linkTo('rainloop', 'index.php'), - 'icon' => OCP\Util::imagePath('rainloop', 'mail.png'), - 'name' => 'RainLoop' -)); - -if(OC_User::isAdminUser(OCP\User::getUser())) -{ - OCP\App::addNavigationEntry(array( - 'id' => 'rainloop_index_admin', - 'order' => 21, - 'href' => OCP\Util::linkTo('rainloop', 'index-admin.php'), - 'icon' => OCP\Util::imagePath('rainloop', 'mail.png'), - 'name' => 'RainLoop (Admin)' - )); -} diff --git a/build/owncloud/rainloop-app_/appinfo/info.xml b/build/owncloud/rainloop-app_/appinfo/info.xml deleted file mode 100644 index e4f04473f..000000000 --- a/build/owncloud/rainloop-app_/appinfo/info.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - rainloop - RainLoop - RainLoop Webmail - 0.0.0 - CC BY-NC-SA 3.0 - RainLoop Team - 6.0 - \ No newline at end of file diff --git a/build/owncloud/rainloop-app_/appinfo/version b/build/owncloud/rainloop-app_/appinfo/version deleted file mode 100644 index bd52db81d..000000000 --- a/build/owncloud/rainloop-app_/appinfo/version +++ /dev/null @@ -1 +0,0 @@ -0.0.0 \ No newline at end of file diff --git a/build/owncloud/rainloop-app_/img/logo-64x64.png b/build/owncloud/rainloop-app_/img/logo-64x64.png deleted file mode 100644 index ce1dd1a886c906ec36cee1dec72b9df605886f02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 832 zcmV-G1Hb%k7RCwC#n$brDK^(`2<+!Jah`6UC zB6^C5h=@4)4|jR5=a_ zzRF^}svNfv^ZdeBqWN>ez`6O3CP!Ob6K4KgljDGB{)*sTz z^!1_w(9GG-TyfDP!Xo{00A?<4KW=CfaL&!$~?mW93ud- z3_)ie1;GE|1Obpm2w~>A#vwlZ0OULT3;~cO2o&>Dvk;$t01|?#%xy-f#%wh&H3#uH z%$L{-A&Pnb^MGX;LLBpvWebE<%-aGXRr6^>@B+0UGRf&e7>ied9i0f84^6TZJ!A+9whO+(;!!F#YF;zg_o!^}%< zGkk06A@JD`#0GHz6bHf##J%YUURb+q4dR=rH)D8#QX6s=7zaZ2Kh67ZKWsPpMwF>h zmcl094*z1_Z=xoi4f_x)S#E};)g`u~9hP>B+z5nnM$H?8a7BP%`{qb22=eStDWm3x zg)jxNiZw*A)>t0*2B$?WvJ%!1$@}hbPqxO2d_LeA15oG_B85LARQOY3?wp_|o{0^U zHL<40a`3hPI3dTTW*ofXI!ef~!-ywEDQATr105Wd)|viX?ieA*mL>=98jTQg>=7rG z!(@x>@8onp!CAW{&f2af2c=}kUg0{JbIi%f$;rvd$*HLN6<`1!uF_d9==`$)0000< KMNUMnLSTX$7j)+U diff --git a/build/owncloud/rainloop-app_/img/mail.png b/build/owncloud/rainloop-app_/img/mail.png deleted file mode 100644 index 21076eed70fcfaf735b09c0c5fbadf342cb72e4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1518 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$jZRL%n;xc;tCZ1|NlRb90j8xFakp$z3fdgFrP4#1o;I6Gr~v)48h;oRe?!> zv%n*=n1O-sFbFdq&tH)O6qG7)jVKAuPb(=;EJ|evNX*PD(erZ+Q7ALkGu1ORbpPyR z4h%+DPZ!6K2=}*ByoC-c@Hk)oEk8?2;DLOnZ~5GeiG?j+F3mi)^HhHo~t_ZV?VAV#ZR~*I*;aq&}-?7w|)(Yk+_k0A?b}%kr zX>`A-*TSiEV!Ecs1Vg?K!4MAyB^KF<4e3ps8V7_A%4Hw0J!omtVBJ(+5}EB?z@IVG zKsT3TUvKV|qQ!Xy%pVTTzQdOAc=wHe;vTmpVnqY=qfB+Ujy0TE^!>mO+f!V}W;~Lg zvQlskYjVNey`3f(Ph`nGtP|IAx|=-f5`*Z(+WrL$=aiTDI55fmHdA6~+{anyuws2O zkHDMN4}L9Z`E6unuhF@Wqd(W@Yx*2L29@879j5bnd=HdtXs%OdD7cc}!r3rYgxTa^ z-X*u)+uc~#6l!Koc(uAG6G$D=oAZ)&PeYK`Po|ibYfKs;Ywm)wqo=E%%Q~loCIGoJ Bx~TvF diff --git a/build/owncloud/rainloop-app_/index-admin.php b/build/owncloud/rainloop-app_/index-admin.php deleted file mode 100644 index 313c2917a..000000000 --- a/build/owncloud/rainloop-app_/index-admin.php +++ /dev/null @@ -1,22 +0,0 @@ -assign('rainloop-url', $sResultUrl); - -$oTemplate->printpage(); diff --git a/build/owncloud/rainloop-app_/index.php b/build/owncloud/rainloop-app_/index.php deleted file mode 100644 index 91c4e2cef..000000000 --- a/build/owncloud/rainloop-app_/index.php +++ /dev/null @@ -1,36 +0,0 @@ -assign('rainloop-url', $sResultUrl); - -$oTemplate->printpage(); diff --git a/build/owncloud/rainloop-app_/js/personal.js b/build/owncloud/rainloop-app_/js/personal.js deleted file mode 100644 index f1f988bc1..000000000 --- a/build/owncloud/rainloop-app_/js/personal.js +++ /dev/null @@ -1,13 +0,0 @@ - -/** - * ownCloud - RainLoop mail plugin - * - * @author RainLoop Team - * @copyright 2014 RainLoop Team - * - * https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud - */ - -$(function() { - RainLoopFormHelper('#mail-rainloop-personal-form', 'personal.php'); -}); diff --git a/build/owncloud/rainloop-app_/js/rainloop.js b/build/owncloud/rainloop-app_/js/rainloop.js deleted file mode 100644 index e48404759..000000000 --- a/build/owncloud/rainloop-app_/js/rainloop.js +++ /dev/null @@ -1,76 +0,0 @@ - -function RainLoopFormHelper(sID, sAjaxFile, fCallback) -{ - try - { - var - oForm = $(sID), - oSubmit = $('#rainloop-save-button', oForm), - sSubmitValue = oSubmit.val(), - oDesc = oForm.find('.rainloop-result-desc') - ; - - oSubmit.click(function (oEvent) { - - var oDefAjax = null; - - oEvent.preventDefault(); - - oForm - .addClass('rainloop-ajax') - .removeClass('rainloop-error') - .removeClass('rainloop-success') - ; - - oDesc.text(''); - oSubmit.val('...'); - - oDefAjax = $.ajax({ - 'type': 'POST', - 'async': true, - 'url': OC.filePath('rainloop', 'ajax', sAjaxFile), - 'data': oForm.serialize(), - 'dataType': 'json', - 'global': true - }); - - oDefAjax.always(function (oData) { - - var bResult = false; - - oForm.removeClass('rainloop-ajax'); - oSubmit.val(sSubmitValue); - - if (oData) - { - bResult = 'success' === oData['status']; - if (oData['Message']) - { - oDesc.text(oData['Message']); - } - } - - if (bResult) - { - oForm.addClass('rainloop-success'); - } - else - { - oForm.addClass('rainloop-error'); - if ('' === oDesc.text()) - { - oDesc.text('Error'); - } - } - - if (fCallback) - { - fCallback(bResult, oData); - } - }); - - return false; - }); - } - catch(e) {} -} diff --git a/build/owncloud/rainloop-app_/lib/RainLoopHelper.php b/build/owncloud/rainloop-app_/lib/RainLoopHelper.php deleted file mode 100644 index f2832da3b..000000000 --- a/build/owncloud/rainloop-app_/lib/RainLoopHelper.php +++ /dev/null @@ -1,28 +0,0 @@ -assign('rainloop-email', $sEmail); -$oTemplate->assign('rainloop-login', OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-login', '')); - -$sPass = OCP\Config::getUserValue($sUser, 'rainloop', 'rainloop-password', ''); -$oTemplate->assign('rainloop-password', 0 === strlen($sPass) && 0 === strlen($sEmail) ? '' : '******'); - -return $oTemplate->fetchPage(); diff --git a/build/owncloud/rainloop-app_/templates/empty.php b/build/owncloud/rainloop-app_/templates/empty.php deleted file mode 100644 index fa0c45f25..000000000 --- a/build/owncloud/rainloop-app_/templates/empty.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/build/owncloud/rainloop-app_/templates/iframe.php b/build/owncloud/rainloop-app_/templates/iframe.php deleted file mode 100644 index 2e4b3d4df..000000000 --- a/build/owncloud/rainloop-app_/templates/iframe.php +++ /dev/null @@ -1,3 +0,0 @@ -
\ No newline at end of file diff --git a/build/owncloud/rainloop-app_/templates/personal.php b/build/owncloud/rainloop-app_/templates/personal.php deleted file mode 100644 index 6ca0ac726..000000000 --- a/build/owncloud/rainloop-app_/templates/personal.php +++ /dev/null @@ -1,21 +0,0 @@ -
- - - -
-

t('RainLoop Webmail (autologin)')); ?>

-

- - - - - - - -    -

-
-
\ No newline at end of file diff --git a/dev/Admin/About.js b/dev/Admin/About.js index 08f065565..399469f8c 100644 --- a/dev/Admin/About.js +++ b/dev/Admin/About.js @@ -53,7 +53,7 @@ function AdminAbout() } return sType; - + }, this); } diff --git a/dev/Common/_Begin.js b/dev/Common/_Begin.js index d6706c21a..500574a0e 100644 --- a/dev/Common/_Begin.js +++ b/dev/Common/_Begin.js @@ -21,7 +21,7 @@ var * @type {Object.} */ Utils = {}, - + /** * @type {Object.} */ @@ -67,7 +67,7 @@ var I18n = window['rainloopI18N'] || {}, $html = $('html'), - + // $body = $('body'), $window = $(window), @@ -75,4 +75,4 @@ var $document = $(window.document), NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null -; \ No newline at end of file +; diff --git a/dev/Common/_BeginW.js b/dev/Common/_BeginW.js index b863c05c3..3c7fc77d0 100644 --- a/dev/Common/_BeginW.js +++ b/dev/Common/_BeginW.js @@ -6,7 +6,7 @@ */ var RL = null, - + $proxyDiv = $('
') ; -/*jshint onevar: true*/ +/*jshint onevar: true*/ \ No newline at end of file diff --git a/dev/Styles/@Main.less b/dev/Styles/@Main.less index d97e94c2a..2c87f8e23 100644 --- a/dev/Styles/@Main.less +++ b/dev/Styles/@Main.less @@ -14,6 +14,7 @@ @import "../../vendors/bootstrap/less/forms.less"; @import "../../vendors/bootstrap/less/tables.less"; +// @import "../../vendors/bootstrap/less/sprites.less"; @import "../../vendors/bootstrap/less/dropdowns.less"; @import "../../vendors/bootstrap/less/wells.less"; @import "../../vendors/bootstrap/less/component-animations.less"; @@ -32,8 +33,14 @@ @import "../../vendors/bootstrap/less/modals.less"; @import "../../vendors/bootstrap/less/tooltip.less"; @import "../../vendors/bootstrap/less/popovers.less"; + +// @import "../../vendors/bootstrap/less/thumbnails.less"; @import "../../vendors/bootstrap/less/labels-badges.less"; @import "../../vendors/bootstrap/less/progress-bars.less"; +// @import "../../vendors/bootstrap/less/accordion.less"; +// @import "../../vendors/bootstrap/less/carousel.less"; +// @import "../../vendors/bootstrap/less/hero-unit.less"; + @import "../../vendors/bootstrap/less/utilities.less"; @import "_FontasticToBoot.less"; diff --git a/dev/Styles/Layout.less b/dev/Styles/Layout.less index e6e782734..ca4534b44 100644 --- a/dev/Styles/Layout.less +++ b/dev/Styles/Layout.less @@ -230,20 +230,31 @@ html.rl-no-preview-pane { } } -.visible-on-ctrl { +.visible-on-ctrl, .visible-on-ctrl-btn { display: none; } -.hidden-on-ctrl { +.hidden-on-ctrl-btn { display: inline-block; } -html.rl-ctrl-key-pressed .visible-on-ctrl { - display: inline-block; -} +html.rl-ctrl-key-pressed { -html.rl-ctrl-key-pressed .hidden-on-ctrl { - display: none; + .visible-on-ctrl { + display: inline-block; + } + + .btn-group.open .visible-on-ctrl-btn { + display: inline-block; + } + + .hidden-on-ctrl { + display: none; + } + + .btn-group.open .hidden-on-ctrl-btn { + display: none; + } } #rl-loading, #rl-loading-error { diff --git a/dev/Styles/SettingsFolders.less b/dev/Styles/SettingsFolders.less index 5bb0719e1..a9f281b6e 100644 --- a/dev/Styles/SettingsFolders.less +++ b/dev/Styles/SettingsFolders.less @@ -1,10 +1,4 @@ -/*.folderPaddingHelper(@i) { - (~".folder-padding.deep-@{i}") { - width: 15px * @i + 10px; - } -}*/ - .b-settings-folders { &.ignore-folder-subscribe { @@ -62,7 +56,7 @@ border-bottom: 1px dashed #333; cursor: pointer; } - + .folder-name-input { border-width: 1px; margin-bottom: 0; @@ -116,10 +110,4 @@ .folder-padding.deep-5 { width: 15px * 5 + 10px; } - -/* .folderPaddingHelper(1); - .folderPaddingHelper(2); - .folderPaddingHelper(3); - .folderPaddingHelper(4); - .folderPaddingHelper(5);*/ } \ No newline at end of file diff --git a/dev/ViewModels/PopupsComposeViewModel.js b/dev/ViewModels/PopupsComposeViewModel.js index 5dd8fc66c..5e501905f 100644 --- a/dev/ViewModels/PopupsComposeViewModel.js +++ b/dev/ViewModels/PopupsComposeViewModel.js @@ -1371,7 +1371,6 @@ PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage, break; } - bAdd = true; if (bAdd) { oAttachment = new ComposeAttachmentModel( diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 000000000..44e9dba85 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,585 @@ + +'use strict'; + +var + pkg = require('./package.json'), + cfg = { + devVersion: '0.0.0', + releasesPath: 'build/dist/releases', + + destPath: '', + cleanPath: '', + zipSrcPath: '', + zipFile: '', + + paths: {}, + summary: { + verbose: true, + reasonCol: 'cyan,bold', + codeCol: 'green' + }, + uglify: { + mangle: true, + compress: true, + preserveComments: 'some' + } + }, + + fs = require('node-fs'), + path = require('path'), + gulp = require('gulp'), + concat = require('gulp-concat-util'), + header = require('gulp-header'), + footer = require('gulp-footer'), + rename = require('gulp-rename'), + minifyCss = require('gulp-minify-css'), + less = require('gulp-less'), + jshint = require('gulp-jshint'), + uglify = require('gulp-uglify'), + gutil = require('gulp-util') +; + +function regOtherMinTask(sName, sPath, sInc, sOut, sHeader) +{ + gulp.task(sName, function() { + return gulp.src(sPath + sInc) + .pipe(uglify()) + .pipe(header(sHeader || '')) + .pipe(rename(sOut)) + .pipe(gulp.dest(sPath)); + }); +} + +function zipDir(sSrcDir, sDestDir, sFileName) +{ + return gulp.src(sSrcDir + '**/*') + .pipe(require('gulp-zip')(sFileName)) + .pipe(gulp.dest(sDestDir)); +} + +function cleanDir(sDir) +{ + return gulp.src(sDir, {read: false}) + .pipe(require('gulp-clean')()); +} + +function renameFileWothMd5Hash(sFile) +{ + var sHash = require('crypto').createHash('md5').update(fs.readFileSync(sFile)).digest('hex'); + fs.renameSync(sFile, sFile.replace(/\.zip$/, '-' + sHash + '.zip')); + return true; +} + +cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/'; +cfg.paths.staticCSS = 'rainloop/v/' + cfg.devVersion + '/static/css/'; + +cfg.paths.less = { + main: { + name: 'less.css', + src: 'dev/Styles/@Main.less', + watch: ['dev/Styles/*.less'], + options: { + paths: [path.join(__dirname, 'dev/Styles/'), path.join(__dirname, 'vendors/bootstrap/less/')] + } + } +}; + +cfg.paths.css = { + main: { + name: 'app.css', + name_min: 'app.min.css', + src: [ + 'vendors/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.css', + 'vendors/normalize/normalize.css', + 'vendors/fontastic/styles.css', + 'vendors/jquery-nanoscroller/nanoscroller.css', + 'vendors/jquery-magnific-popup/magnific-popup.css', + 'vendors/jquery-magnific-popup/magnific-popup-animations.css', + 'vendors/simple-pace/styles.css', + 'vendors/inputosaurus/inputosaurus.css', + 'vendors/flags/flags-fixed.css', + cfg.paths.staticCSS + cfg.paths.less.main.name + ] + } +}; + +cfg.paths.js = { + boot: { + name: 'boot.js', + src: [ + 'vendors/json2.min.js', + 'vendors/simple-pace/simple-pace-1.0.min.js', + 'vendors/rl/rl-1.0.min.js' + ] + }, + openpgp: { + name: 'openpgp.min.js', + src: [ + 'vendors/openpgp/openpgp-0.5.1.min.js' + ] + }, + libs: { + name: 'libs.js', + src: [ + 'vendors/modernizr.js', + 'vendors/underscore/underscore-1.5.2.min.js', + 'vendors/jquery/jquery-1.11.1.min.js', + 'vendors/jquery-ui/js/jquery-ui-1.10.3.custom.min.js', + 'vendors/jquery-cookie/jquery.cookie-1.4.0.min.js', + 'vendors/jquery-finger/jquery.finger.min.js', + 'vendors/jquery-mousewheel/jquery.mousewheel-3.1.4.min.js', + 'vendors/jquery-scrollstop/jquery.scrollstop.min.js', + 'vendors/jquery-lazyload/jquery.lazyload.min.js', + 'vendors/jquery-nanoscroller/jquery.nanoscroller-0.7.min.js', + 'vendors/jquery-wakeup/jquery.wakeup.min.js', + 'vendors/inputosaurus/inputosaurus.min.js', + 'vendors/moment/min/moment.min.js ', + 'vendors/routes/signals.min.js', + 'vendors/routes/hasher.min.js', + 'vendors/routes/crossroads.min.js', + 'vendors/knockout/knockout-3.1.0.js', + 'vendors/knockout-projections/knockout-projections-1.0.0.min.js', + 'vendors/ssm/ssm.min.js', + 'vendors/jua/jua.min.js', + 'vendors/keymaster/keymaster.js', + 'vendors/ifvisible/ifvisible.min.js', + 'vendors/jquery-magnific-popup/jquery.magnific-popup.min.js', + 'vendors/bootstrap/js/bootstrap.min.js', + 'dev/Common/_LibsEnd.js' + ] + }, + app: { + name: 'app.js', + name_min: 'app.min.js', + src: [ + 'dev/Common/_Begin.js', + 'dev/Common/_BeginW.js', + + 'dev/Common/Globals.js', + 'dev/Common/Constants.js', + 'dev/Common/Enums.js', + 'dev/Common/Utils.js', + 'dev/Common/Base64.js', + 'dev/Common/Knockout.js', + 'dev/Common/LinkBuilder.js', + 'dev/Common/Plugins.js', + 'dev/Common/NewHtmlEditorWrapper.js', + 'dev/Common/Selector.js', + + 'dev/Storages/LocalStorages/CookieDriver.js', + 'dev/Storages/LocalStorages/LocalStorageDriver.js', + 'dev/Storages/LocalStorage.js', + + 'dev/Knoin/AbstractBoot.js', + 'dev/Knoin/AbstractViewModel.js', + 'dev/Knoin/AbstractScreen.js', + 'dev/Knoin/Knoin.js', + + 'dev/Models/EmailModel.js', + 'dev/Models/ContactModel.js', + 'dev/Models/ContactPropertyModel.js', + 'dev/Models/ContactTagModel.js', + 'dev/Models/AttachmentModel.js', + 'dev/Models/ComposeAttachmentModel.js', + 'dev/Models/MessageModel.js', + 'dev/Models/FolderModel.js', + 'dev/Models/AccountModel.js', + 'dev/Models/IdentityModel.js', + 'dev/Models/FilterConditionModel.js', + 'dev/Models/FilterModel.js', + 'dev/Models/OpenPgpKeyModel.js', + + 'dev/ViewModels/PopupsFolderClearViewModel.js', + 'dev/ViewModels/PopupsFolderCreateViewModel.js', + 'dev/ViewModels/PopupsFolderSystemViewModel.js', + 'dev/ViewModels/PopupsComposeViewModel.js', + 'dev/ViewModels/PopupsContactsViewModel.js', + 'dev/ViewModels/PopupsAdvancedSearchViewModel.js', + 'dev/ViewModels/PopupsAddAccountViewModel.js', + 'dev/ViewModels/PopupsAddOpenPgpKeyViewModel.js', + 'dev/ViewModels/PopupsViewOpenPgpKeyViewModel.js', + 'dev/ViewModels/PopupsGenerateNewOpenPgpKeyViewModel.js', + 'dev/ViewModels/PopupsComposeOpenPgpViewModel.js', + 'dev/ViewModels/PopupsIdentityViewModel.js', + 'dev/ViewModels/PopupsLanguagesViewModel.js', + 'dev/ViewModels/PopupsTwoFactorTestViewModel.js', + 'dev/ViewModels/PopupsAskViewModel.js', + 'dev/ViewModels/PopupsKeyboardShortcutsHelpViewModel.js', + + 'dev/ViewModels/LoginViewModel.js', + + 'dev/ViewModels/AbstractSystemDropDownViewModel.js', + 'dev/ViewModels/MailBoxSystemDropDownViewModel.js', + 'dev/ViewModels/SettingsSystemDropDownViewModel.js', + + 'dev/ViewModels/MailBoxFolderListViewModel.js', + 'dev/ViewModels/MailBoxMessageListViewModel.js', + 'dev/ViewModels/MailBoxMessageViewViewModel.js', + + 'dev/ViewModels/SettingsMenuViewModel.js', + 'dev/ViewModels/SettingsPaneViewModel.js', + + 'dev/Settings/General.js', + 'dev/Settings/Contacts.js', + 'dev/Settings/Accounts.js', + 'dev/Settings/Identity.js', + 'dev/Settings/Identities.js', + 'dev/Settings/Filters.js', + 'dev/Settings/Security.js', + 'dev/Settings/Social.js', + 'dev/Settings/ChangePassword.js', + 'dev/Settings/Folders.js', + 'dev/Settings/Themes.js', + 'dev/Settings/OpenPGP.js', + + 'dev/Storages/AbstractData.js', + 'dev/Storages/WebMailData.js', + + 'dev/Storages/AbstractAjaxRemote.js', + 'dev/Storages/WebMailAjaxRemote.js', + + 'dev/Storages/AbstractCache.js', + 'dev/Storages/WebMailCache.js', + + 'dev/Screens/AbstractSettings.js', + + 'dev/Screens/Login.js', + 'dev/Screens/MailBox.js', + 'dev/Screens/Settings.js', + + 'dev/Boots/AbstractApp.js', + 'dev/Boots/RainLoopApp.js', + + 'dev/Common/_End.js', + 'dev/Common/_CoreEnd.js' + ] + }, + admin: { + name: 'admin.js', + name_min: 'admin.min.js', + src: [ + 'dev/Common/_Begin.js', + 'dev/Common/_BeginA.js', + + 'dev/Common/Globals.js', + 'dev/Common/Constants.js', + 'dev/Common/Enums.js', + 'dev/Common/Utils.js', + 'dev/Common/Base64.js', + 'dev/Common/Knockout.js', + 'dev/Common/LinkBuilder.js', + 'dev/Common/Plugins.js', + + 'dev/Storages/LocalStorages/CookieDriver.js', + 'dev/Storages/LocalStorages/LocalStorageDriver.js', + 'dev/Storages/LocalStorage.js', + + 'dev/Knoin/AbstractBoot.js', + 'dev/Knoin/AbstractViewModel.js', + 'dev/Knoin/AbstractScreen.js', + 'dev/Knoin/Knoin.js', + + 'dev/Models/EmailModel.js', + 'dev/Models/ContactTagModel.js', + + 'dev/ViewModels/PopupsDomainViewModel.js', + 'dev/ViewModels/PopupsPluginViewModel.js', + 'dev/ViewModels/PopupsActivateViewModel.js', + 'dev/ViewModels/PopupsLanguagesViewModel.js', + 'dev/ViewModels/PopupsAskViewModel.js', + + 'dev/ViewModels/AdminLoginViewModel.js', + + 'dev/ViewModels/AdminMenuViewModel.js', + 'dev/ViewModels/AdminPaneViewModel.js', + + 'dev/Admin/General.js', + 'dev/Admin/Login.js', + 'dev/Admin/Branding.js', + 'dev/Admin/Contacts.js', + 'dev/Admin/Domains.js', + 'dev/Admin/Security.js', + 'dev/Admin/Social.js', + 'dev/Admin/Plugins.js', + 'dev/Admin/Packages.js', + 'dev/Admin/Licensing.js', + 'dev/Admin/About.js', + + 'dev/Storages/AbstractData.js', + 'dev/Storages/AdminData.js', + + 'dev/Storages/AbstractAjaxRemote.js', + 'dev/Storages/AdminAjaxRemote.js', + + 'dev/Storages/AbstractCache.js', + 'dev/Storages/AdminCache.js', + + 'dev/Screens/AbstractSettings.js', + + 'dev/Screens/AdminLogin.js', + 'dev/Screens/AdminSettings.js', + + 'dev/Boots/AbstractApp.js', + 'dev/Boots/AdminApp.js', + + 'dev/Common/_End.js', + 'dev/Common/_CoreEnd.js' + ] + } +}; + +// CSS +gulp.task('less:main', function() { + return gulp.src(cfg.paths.less.main.src) + .pipe(less({ + 'paths': cfg.paths.less.main.options.paths + })) + .pipe(rename(cfg.paths.less.main.name)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +gulp.task('css:main', ['less:main'], function() { + return gulp.src(cfg.paths.css.main.src) + .pipe(concat(cfg.paths.css.main.name)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +gulp.task('css:main:min', ['css:main'], function() { + return gulp.src(cfg.paths.staticCSS + cfg.paths.css.main.name) + .pipe(minifyCss()) + .pipe(rename(cfg.paths.css.main.name_min)) + .pipe(gulp.dest(cfg.paths.staticCSS)); +}); + +// JS +// - concat +gulp.task('js:boot', function() { + return gulp.src(cfg.paths.js.boot.src) + .pipe(concat(cfg.paths.js.boot.name)) + .pipe(gulp.dest(cfg.paths.staticJS)); +}); + +gulp.task('js:openpgp', function() { + return gulp.src(cfg.paths.js.openpgp.src) + .pipe(rename(cfg.paths.js.openpgp.name)) + .pipe(gulp.dest(cfg.paths.staticJS)); +}); + +gulp.task('js:libs', function() { + return gulp.src(cfg.paths.js.libs.src) + .pipe(concat(cfg.paths.js.libs.name, {separator: '\n\n'})) + .pipe(gulp.dest(cfg.paths.staticJS)); +}); + +gulp.task('js:app', function() { + return gulp.src(cfg.paths.js.app.src) + .pipe(concat(cfg.paths.js.app.name)) + .pipe(header('/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n' + + '(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible, key) {\n')) + .pipe(footer('\n\n}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible, key));')) + .pipe(gulp.dest(cfg.paths.staticJS)); +}); + +gulp.task('js:admin', function() { + return gulp.src(cfg.paths.js.admin.src) + .pipe(concat(cfg.paths.js.admin.name)) + .pipe(header('/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */\n' + + '(function (window, $, ko, crossroads, hasher, _) {\n')) + .pipe(footer('\n\n}(window, jQuery, ko, crossroads, hasher, _));')) + .pipe(gulp.dest(cfg.paths.staticJS)); +}); + +// - lint +gulp.task('js:app:lint', ['js:app'], function() { + return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name) + .pipe(jshint('.jshintrc')) + .pipe(jshint.reporter('jshint-summary', cfg.summary)) + .pipe(jshint.reporter('fail')); +}); + +gulp.task('js:admin:lint', ['js:admin'], function() { + return gulp.src(cfg.paths.staticJS + cfg.paths.js.admin.name) + .pipe(jshint('.jshintrc')) + .pipe(jshint.reporter('jshint-summary', cfg.summary)) + .pipe(jshint.reporter('fail')); +}); + +// - min +gulp.task('js:app:min', ['js:app:lint'], function() { + return gulp.src(cfg.paths.staticJS + cfg.paths.js.app.name) + .pipe(rename(cfg.paths.js.app.name_min)) + .pipe(uglify(cfg.uglify)) + .pipe(gulp.dest(cfg.paths.staticJS)) + .on('error', gutil.log); +}); + +gulp.task('js:admin:min', ['js:admin:lint'], function() { + return gulp.src(cfg.paths.staticJS + cfg.paths.js.admin.name) + .pipe(rename(cfg.paths.js.admin.name_min)) + .pipe(uglify(cfg.uglify)) + .pipe(gulp.dest(cfg.paths.staticJS)) + .on('error', gutil.log); +}); + +// OTHER +regOtherMinTask('other:cookie', 'vendors/jquery-cookie/', 'jquery.cookie.js', 'jquery.cookie-1.4.0.min.js', + '/*! jquery.cookie v1.4.0 (c) 2013 Klaus Hartl | MIT */\n'); + +regOtherMinTask('other:ifvisible', 'vendors/ifvisible/', 'src/ifvisible.js', 'ifvisible.min.js', + '/*!ifvisible.js v1.0.0 (c) 2013 Serkan Yersen | MIT */\n'); + +regOtherMinTask('other:wakeup', 'vendors/jquery-wakeup/', 'jquery.wakeup.js', 'jquery.wakeup.min.js', + '/*! jQuery WakeUp plugin (c) 2013 Paul Okopny | MIT */\n'); + +regOtherMinTask('other:mousewheel', 'vendors/jquery-mousewheel/', 'jquery.mousewheel.js', 'jquery.mousewheel-3.1.4.min.js', + '/*! jquery.mousewheel v3.1.4 (c) 2013 Brandon Aaron (http://brandon.aaron.sh) | MIT */\n'); + +regOtherMinTask('other:nano', 'vendors/jquery-nanoscroller/', 'jquery.nanoscroller.js', 'jquery.nanoscroller-0.7.min.js', + '/*! nanoScrollerJS v0.7 (c) 2013 James Florentino; modified by RainLoop Team | MIT */\n'); + +regOtherMinTask('other:inputosaurus', 'vendors/inputosaurus/', 'inputosaurus.js', 'inputosaurus.min.js', + '/*! Inputosaurus Text v0.1.6 (c) 2013 Dan Kielp ; modified by RainLoop Team | MIT */\n'); + +regOtherMinTask('other:pace', 'vendors/simple-pace/', 'simple-pace.js', 'simple-pace-1.0.min.js', + '/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */\n'); + +regOtherMinTask('other:rl', 'vendors/rl/', 'rl.js', 'rl-1.0.min.js', + '/*! RainLoop Top Driver v1.0 (c) 2013 RainLoop Team; Licensed under MIT */\n'); + +gulp.task('package-inc-release', function() { + fs.writeFileSync('package.json', + fs.readFileSync('package.json', 'utf8').replace(/"release":\s?"[\d]+",/, '"release": "' + + (1 + parseInt(pkg.release, 10)) + '",')); +}); + +// BUILD (RainLoop) +gulp.task('rainloop:copy', function() { + + var + versionFull = pkg.version + '.' + parseInt(pkg.release, 10), + dist = cfg.releasesPath + '/webmail/' + versionFull + '/src/' + ; + + fs.mkdirSync(dist, '0777', true); + fs.mkdirSync(dist + 'data'); + fs.mkdirSync(dist + 'rainloop/v/' + versionFull, '0777', true); + + return gulp.src('rainloop/v/' + cfg.devVersion + '/**/*', {base: 'rainloop/v/' + cfg.devVersion}) + .pipe(gulp.dest(dist + 'rainloop/v/' + versionFull)); +}); + +gulp.task('rainloop:setup', ['rainloop:copy'], function() { + + var + versionFull = pkg.version + '.' + parseInt(pkg.release, 10), + dist = cfg.releasesPath + '/webmail/' + versionFull + '/src/' + ; + + fs.writeFileSync(dist + 'data/EMPTY', versionFull); + + fs.writeFileSync(dist + 'index.php', + fs.readFileSync('index.php', 'utf8').replace('\'APP_VERSION\', \'0.0.0\'', '\'APP_VERSION\', \'' + versionFull + '\'')); + + fs.writeFileSync(dist + 'rainloop/v/' + versionFull + '/index.php.root', fs.readFileSync(dist + 'index.php')); + + fs.unlinkSync(dist + 'rainloop/v/' + versionFull + '/static/css/less.css'); + + cfg.destPath = cfg.releasesPath + '/webmail/' + versionFull + '/'; + cfg.cleanPath = dist; + cfg.zipSrcPath = dist; + cfg.zipFile = 'rainloop-' + versionFull + '.zip'; + cfg.md5File = cfg.zipFile; +}); + +gulp.task('rainloop:zip', ['rainloop:copy', 'rainloop:setup'], function() { + return (cfg.destPath && cfg.zipSrcPath && cfg.zipFile) ? + zipDir(cfg.zipSrcPath, cfg.destPath, cfg.zipFile) : false; +}); + +gulp.task('rainloop:md5', ['rainloop:zip'], function() { + return (cfg.destPath && cfg.md5File) ? + renameFileWothMd5Hash(cfg.destPath + cfg.md5File) : false; +}); + +gulp.task('rainloop:clean', ['rainloop:copy', 'rainloop:setup'], function() { + return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; +}); + +// BUILD (OwnCloud) +gulp.task('rainloop:owncloud:copy', function() { + + var + versionFull = pkg.ownCloudPackageVersion, + dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/' + ; + + fs.mkdirSync(dist, '0777', true); + fs.mkdirSync(dist + 'rainloop', '0777', true); + + return gulp.src('build/owncloud/rainloop-app/**/*', {base: 'build/owncloud/rainloop-app/'}) + .pipe(gulp.dest(dist + 'rainloop')); +}); + +gulp.task('rainloop:owncloud:setup', ['rainloop:owncloud:copy'], function() { + + var + versionFull = pkg.ownCloudPackageVersion, + dist = cfg.releasesPath + '/owncloud/' + versionFull + '/src/' + ; + + fs.writeFileSync(dist + 'rainloop/appinfo/info.xml', + fs.readFileSync(dist + 'rainloop/appinfo/info.xml', 'utf8').replace('0.0', '' + versionFull + '')); + + fs.writeFileSync(dist + 'rainloop/appinfo/version', versionFull); + fs.writeFileSync(dist + 'rainloop/VERSION', versionFull); + + cfg.destPath = cfg.releasesPath + '/owncloud/' + versionFull + '/'; + cfg.cleanPath = dist; + cfg.zipSrcPath = dist; + cfg.zipFile = 'rainloop-owncloud-app-' + versionFull + '.zip'; + cfg.md5File = cfg.zipFile; + +}); + +gulp.task('rainloop:owncloud:zip', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup'], function() { + return (cfg.destPath && cfg.zipSrcPath && cfg.zipFile) ? + zipDir(cfg.zipSrcPath, cfg.destPath, cfg.zipFile) : false; +}); + +gulp.task('rainloop:owncloud:md5', ['rainloop:owncloud:zip'], function() { + return (cfg.destPath && cfg.md5File) ? + renameFileWothMd5Hash(cfg.destPath + cfg.md5File) : false; +}); + +gulp.task('rainloop:owncloud:clean', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup'], function() { + return (cfg.cleanPath) ? cleanDir(cfg.cleanPath) : false; +}); + +// MAIN +gulp.task('default', ['js:boot', 'js:libs', 'js:app:min', 'js:admin:min', 'css:main:min']); +gulp.task('fast', ['js:app', 'js:admin', 'css:main']); + +gulp.task('rainloop', ['rainloop:copy', 'rainloop:setup', 'rainloop:zip', 'rainloop:md5', 'rainloop:clean']); +gulp.task('rainloop+', ['rainloop', 'package-inc-release']); + +gulp.task('owncloud', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup', 'rainloop:owncloud:zip', 'rainloop:owncloud:md5', 'rainloop:owncloud:clean']); + +//WATCH +gulp.task('watch', function() { + gulp.watch(cfg.paths.js.app.src, {interval: 1000}, ['js:app']); + gulp.watch(cfg.paths.js.admin.src, {interval: 1000}, ['js:admin']); + gulp.watch(cfg.paths.less.main.watch, {interval: 1000}, ['css:main']); +}); + +// aliases +gulp.task('w', ['watch']); +gulp.task('f', ['fast']); + +gulp.task('rl', ['rainloop']); +gulp.task('rl+', ['rainloop+']); +gulp.task('build', ['rainloop']); +gulp.task('build+', ['rainloop+']); +gulp.task('b', ['rainloop']); +gulp.task('b+', ['rainloop+']); + +gulp.task('own', ['owncloud']); \ No newline at end of file diff --git a/package.json b/package.json index 1a1cb4ed1..6d97a0e97 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.6.7", - "release": "127", + "release": "131", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", - "main": "Gruntfile.js", + "main": "gulpfile.js", "author": { "name": "RainLoop Team", "email": "support@rainloop.net", @@ -36,20 +36,28 @@ "plugins" ], "readmeFilename": "README.md", - "ownCloudPackageVersion": "1.3", + "ownCloudPackageVersion": "1.4", "engines": { - "node": ">= 0.8.0" + "node": ">= 0.10.0" }, "devDependencies": { - "wrench": "*", - "grunt": "~0.4.1", - "grunt-css": "*", - "grunt-md5": "*", - "grunt-contrib-jshint": "*", - "grunt-contrib-compress": "*", - "grunt-contrib-concat": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-watch": "*", - "grunt-contrib-less": "~0.5.0" + + "crypto": "*", + "node-fs": "*", + "jshint-summary": "*", + + "gulp": "*", + "gulp-util": "*", + "gulp-uglify": "*", + "gulp-clean": "*", + "gulp-jshint": "*", + "gulp-less": "*", + "gulp-zip": "*", + "gulp-rename": "*", + "gulp-header": "*", + "gulp-footer": "*", + "gulp-minify-css": "*", + "gulp-concat-util": "*" + } -} \ No newline at end of file +} diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php index cfffa4705..36cc6e937 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Mime/Message.php @@ -69,7 +69,7 @@ class Message public function DoesNotAddDefaultXMailer() { $this->bAddDefaultXMailer = false; - + return $this; } @@ -371,7 +371,7 @@ class Message return $this; } - + /** * @param \MailSo\Mime\EmailCollection $oEmails * @@ -504,7 +504,12 @@ class Message { if (0 === strlen($sHostName)) { - $sHostName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'mailso'; + $sHostName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''; + } + + if (empty($sHostName)) + { + $sHostName = 'localhost'; } return '<'.md5(rand(100000, 999999).time().$sHostName).'@'.$sHostName.'>'; @@ -557,7 +562,7 @@ class Message Header::NewInstance(\MailSo\Mime\Enumerations\Header::CONTENT_ID, $sCID) ); } - + if (0 < strlen($sContentLocation)) { $oAttachmentPart->Headers->Add( diff --git a/rainloop/v/0.0.0/app/templates/Views/App/MailMessageList.html b/rainloop/v/0.0.0/app/templates/Views/App/MailMessageList.html index 390567302..b0e175d32 100644 --- a/rainloop/v/0.0.0/app/templates/Views/App/MailMessageList.html +++ b/rainloop/v/0.0.0/app/templates/Views/App/MailMessageList.html @@ -11,8 +11,8 @@
 
").addClass("rl-settings-view-model").hide(),i.appendTo(h),e.data=ib.data(),e.viewModelDom=i,e.__rlSettingsData=g.__rlSettingsData,g.__dom=i,g.__builded=!0,g.__vm=e,c.applyBindingAccessorsToNode(i[0],{i18nInit:!0,template:function(){return{name:g.__rlSettingsData.Template}}},e),X.delegateRun(e,"onBuild",[i])):X.log("Cannot find sub settings view model position: SettingsSubScreen")),e&&f.defer(function(){d.oCurrentSubScreen&&(X.delegateRun(d.oCurrentSubScreen,"onHide"),d.oCurrentSubScreen.viewModelDom.hide()),d.oCurrentSubScreen=e,d.oCurrentSubScreen&&(d.oCurrentSubScreen.viewModelDom.show(),X.delegateRun(d.oCurrentSubScreen,"onShow"),X.delegateRun(d.oCurrentSubScreen,"onFocus",[],200),f.each(d.menu(),function(a){a.selected(e&&e.__rlSettingsData&&a.route===e.__rlSettingsData.Route)}),b("#rl-content .b-settings .b-content .content").scrollTop(0)),X.windowResize()})):bb.setHash(ib.link().settings(),!1,!0)},P.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(X.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},P.prototype.onBuild=function(){f.each(_.settings,function(a){a&&a.__rlSettingsData&&!f.find(_["settings-removed"],function(b){return b&&b===a})&&this.menu.push({route:a.__rlSettingsData.Route,label:a.__rlSettingsData.Label,selected:c.observable(!1),disabled:!!f.find(_["settings-disabled"],function(b){return b&&b===a})})},this),this.oViewModelPlace=b("#rl-content #rl-settings-subscreen")},P.prototype.routes=function(){var a=f.find(_.settings,function(a){return a&&a.__rlSettingsData&&a.__rlSettingsData.IsDefault}),b=a?a.__rlSettingsData.Route:"general",c={subname:/^(.*)$/,normalize_:function(a,c){return c.subname=X.isUnd(c.subname)?b:X.pString(c.subname),[c.subname]}};return[["{subname}/",c],["{subname}",c],["",c]]},f.extend(Q.prototype,m.prototype),Q.prototype.onShow=function(){ib.setTitle("")},f.extend(R.prototype,P.prototype),R.prototype.onShow=function(){ib.setTitle("")},f.extend(S.prototype,k.prototype),S.prototype.oSettings=null,S.prototype.oPlugins=null,S.prototype.oLocal=null,S.prototype.oLink=null,S.prototype.oSubs={},S.prototype.download=function(b){var c=null,d=null,e=navigator.userAgent.toLowerCase();return e&&(e.indexOf("chrome")>-1||e.indexOf("chrome")>-1)&&(c=document.createElement("a"),c.href=b,document.createEvent&&(d=document.createEvent("MouseEvents"),d&&d.initEvent&&c.dispatchEvent))?(d.initEvent("click",!0,!0),c.dispatchEvent(d),!0):($.bMobileDevice?(a.open(b,"_self"),a.focus()):this.iframe.attr("src",b),!0)},S.prototype.link=function(){return null===this.oLink&&(this.oLink=new g),this.oLink},S.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new j),this.oLocal},S.prototype.settingsGet=function(a){return null===this.oSettings&&(this.oSettings=X.isNormal(cb)?cb:{}),X.isUnd(this.oSettings[a])?null:this.oSettings[a]},S.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=X.isNormal(cb)?cb:{}),this.oSettings[a]=b},S.prototype.setTitle=function(b){b=(X.isNormal(b)&&0').appendTo("body"),st.on("error",function(e){lt&&e&&e.originalEvent&&e.originalEvent.message&&-1===$.inArray(e.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&<.remote().jsError($.emptyFunction,e.originalEvent.message,e.originalEvent.filename,e.originalEvent.lineno,location&&location.toString?location.toString():"",ot.attr("class"),$.microtime()-X.now)}),at.on("keydown",function(e){e&&e.ctrlKey&&ot.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&ot.removeClass("rl-ctrl-key-pressed")})}function j(){K.call(this),this.oData=null,this.oRemote=null,this.oCache=null}var z={},W={},Y={},$={},J={},Q={},X={},Z={settings:[],"settings-removed":[],"settings-disabled":[]},et=[],tt=null,it=e.rainloopAppData||{},nt=e.rainloopI18N||{},ot=t("html"),st=t(e),at=t(e.document),rt=e.Notification&&e.Notification.requestPermission?e.Notification:null,lt=null;X.now=(new Date).getTime(),X.momentTrigger=i.observable(!0),X.dropdownVisibility=i.observable(!1).extend({rateLimit:0}),X.tooltipTrigger=i.observable(!1).extend({rateLimit:0}),X.langChangeTrigger=i.observable(!0),X.iAjaxErrorCount=0,X.iTokenErrorCount=0,X.iMessageBodyCacheCount=0,X.bUnload=!1,X.sUserAgent=(navigator.userAgent||"").toLowerCase(),X.bIsiOSDevice=-1/g,">").replace(/"/g,""").replace(/'/g,"'"):""},$.splitPlainText=function(e,t){var i="",n="",o=e,s=0,a=0;for(t=$.isUnd(t)?100:t;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},$.timeOutAction=function(){var t={};return function(i,n,o){$.isUnd(t[i])&&(t[i]=0),e.clearTimeout(t[i]),t[i]=e.setTimeout(n,o)}}(),$.timeOutActionSecond=function(){var t={};return function(i,n,o){t[i]||(t[i]=e.setTimeout(function(){n(),t[i]=0},o))}}(),$.audio=function(){var t=!1;return function(i,n){if(!1===t)if(X.bIsiOSDevice)t=null;else{var o=!1,s=!1,a=e.Audio?new e.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(t=a,t.preload="none",t.loop=!1,t.autoplay=!1,t.muted=!1,t.src=o?i:n):t=null):t=null}return t}}(),$.hos=function(e,t){return e&&Object.hasOwnProperty?Object.hasOwnProperty.call(e,t):!1},$.i18n=function(e,t,i){var n="",o=$.isUnd(nt[e])?$.isUnd(i)?e:i:nt[e];if(!$.isUnd(t)&&!$.isNull(t))for(n in t)$.hos(t,n)&&(o=o.replace("%"+n+"%",t[n]));return o},$.i18nToNode=function(e){s.defer(function(){t(".i18n",e).each(function(){var e=t(this),i="";i=e.data("i18n-text"),i?e.text($.i18n(i)):(i=e.data("i18n-html"),i&&e.html($.i18n(i)),i=e.data("i18n-placeholder"),i&&e.attr("placeholder",$.i18n(i)),i=e.data("i18n-title"),i&&e.attr("title",$.i18n(i)))})})},$.i18nToDoc=function(){e.rainloopI18N&&(nt=e.rainloopI18N||{},$.i18nToNode(at),X.langChangeTrigger(!X.langChangeTrigger())),e.rainloopI18N={}},$.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?X.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&X.langChangeTrigger.subscribe(e,t)},$.inFocus=function(){return document.activeElement?($.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=t(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},$.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var e=t(document.activeElement);e.is("input,textarea")&&document.activeElement.blur()}},$.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()},$.replySubjectAdd=function(t,i,n){var o=null,s=$.trim(i);return s=null===(o=new e.RegExp("^"+t+"[\\s]?\\:(.*)$","gi").exec(i))||$.isUnd(o[1])?null===(o=new e.RegExp("^("+t+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(i))||$.isUnd(o[1])||$.isUnd(o[2])||$.isUnd(o[3])?t+": "+i:o[1]+($.pInt(o[2])+1)+o[3]:t+"[2]: "+o[1],s=s.replace(/[\s]+/g," "),s=($.isUnd(n)?!0:n)?$.fixLongSubject(s):s +},$.fixLongSubject=function(e){var t=0,i=null;e=$.trim(e.replace(/[\s]+/," "));do i=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!i||$.isUnd(i[0]))&&(i=null),i&&(t=0,t+=$.isUnd(i[2])?1:0+$.pInt(i[2]),t+=$.isUnd(i[4])?1:0+$.pInt(i[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(i);return e=e.replace(/[\s]+/," ")},$.roundNumber=function(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},$.friendlySize=function(e){return e=$.pInt(e),e>=1073741824?$.roundNumber(e/1073741824,1)+"GB":e>=1048576?$.roundNumber(e/1048576,1)+"MB":e>=1024?$.roundNumber(e/1024,0)+"KB":e+"B"},$.log=function(t){e.console&&e.console.log&&e.console.log(t)},$.getNotification=function(e,t){return e=$.pInt(e),W.Notification.ClientViewError===e&&t?t:$.isUnd(Y[e])?"":Y[e]},$.initNotificationLanguage=function(){Y[W.Notification.InvalidToken]=$.i18n("NOTIFICATIONS/INVALID_TOKEN"),Y[W.Notification.AuthError]=$.i18n("NOTIFICATIONS/AUTH_ERROR"),Y[W.Notification.AccessError]=$.i18n("NOTIFICATIONS/ACCESS_ERROR"),Y[W.Notification.ConnectionError]=$.i18n("NOTIFICATIONS/CONNECTION_ERROR"),Y[W.Notification.CaptchaError]=$.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),Y[W.Notification.SocialFacebookLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),Y[W.Notification.SocialTwitterLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),Y[W.Notification.SocialGoogleLoginAccessDisable]=$.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),Y[W.Notification.DomainNotAllowed]=$.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),Y[W.Notification.AccountNotAllowed]=$.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),Y[W.Notification.AccountTwoFactorAuthRequired]=$.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),Y[W.Notification.AccountTwoFactorAuthError]=$.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),Y[W.Notification.CouldNotSaveNewPassword]=$.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),Y[W.Notification.CurrentPasswordIncorrect]=$.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),Y[W.Notification.NewPasswordShort]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),Y[W.Notification.NewPasswordWeak]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),Y[W.Notification.NewPasswordForbidden]=$.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),Y[W.Notification.ContactsSyncError]=$.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),Y[W.Notification.CantGetMessageList]=$.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),Y[W.Notification.CantGetMessage]=$.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),Y[W.Notification.CantDeleteMessage]=$.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),Y[W.Notification.CantMoveMessage]=$.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Y[W.Notification.CantCopyMessage]=$.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Y[W.Notification.CantSaveMessage]=$.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),Y[W.Notification.CantSendMessage]=$.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),Y[W.Notification.InvalidRecipients]=$.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),Y[W.Notification.CantCreateFolder]=$.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),Y[W.Notification.CantRenameFolder]=$.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),Y[W.Notification.CantDeleteFolder]=$.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),Y[W.Notification.CantDeleteNonEmptyFolder]=$.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),Y[W.Notification.CantSubscribeFolder]=$.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),Y[W.Notification.CantUnsubscribeFolder]=$.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),Y[W.Notification.CantSaveSettings]=$.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),Y[W.Notification.CantSavePluginSettings]=$.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),Y[W.Notification.DomainAlreadyExists]=$.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),Y[W.Notification.CantInstallPackage]=$.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),Y[W.Notification.CantDeletePackage]=$.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),Y[W.Notification.InvalidPluginPackage]=$.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),Y[W.Notification.UnsupportedPluginPackage]=$.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),Y[W.Notification.LicensingServerIsUnavailable]=$.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),Y[W.Notification.LicensingExpired]=$.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),Y[W.Notification.LicensingBanned]=$.i18n("NOTIFICATIONS/LICENSING_BANNED"),Y[W.Notification.DemoSendMessageError]=$.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),Y[W.Notification.AccountAlreadyExists]=$.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),Y[W.Notification.MailServerError]=$.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),Y[W.Notification.UnknownNotification]=$.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),Y[W.Notification.UnknownError]=$.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},$.getUploadErrorDescByCode=function(e){var t="";switch($.pInt(e)){case W.UploadErrorCode.FileIsTooBig:t=$.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case W.UploadErrorCode.FilePartiallyUploaded:t=$.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case W.UploadErrorCode.FileNoUploaded:t=$.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case W.UploadErrorCode.MissingTempFolder:t=$.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case W.UploadErrorCode.FileOnSaveingError:t=$.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case W.UploadErrorCode.FileType:t=$.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=$.i18n("UPLOAD/ERROR_UNKNOWN")}return t},$.delegateRun=function(e,t,i,n){e&&e[t]&&(n=$.pInt(n),0>=n?e[t].apply(e,$.isArray(i)?i:[]):s.delay(function(){e[t].apply(e,$.isArray(i)?i:[])},n))},$.killCtrlAandS=function(t){if(t=t||e.event,t&&t.ctrlKey&&!t.shiftKey&&!t.altKey){var i=t.target||t.srcElement,n=t.keyCode||t.which;if(n===W.EventKeyCode.S)return void t.preventDefault();if(i&&i.tagName&&i.tagName.match(/INPUT|TEXTAREA/i))return;n===W.EventKeyCode.A&&(e.getSelection?e.getSelection().removeAllRanges():e.document.selection&&e.document.selection.clear&&e.document.selection.clear(),t.preventDefault())}},$.createCommand=function(e,t,n){var o=t?function(){return o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=i.observable(!0),n=$.isUnd(n)?!0:n,o.canExecute=i.computed($.isFunc(n)?function(){return o.enabled()&&n.call(e)}:function(){return o.enabled()&&!!n}),o},$.initDataConstructorBySettings=function(t){t.editorDefaultType=i.observable(W.EditorDefaultType.Html),t.showImages=i.observable(!1),t.interfaceAnimation=i.observable(W.InterfaceAnimation.Full),t.contactsAutosave=i.observable(!1),X.sAnimationType=W.InterfaceAnimation.Full,t.capaThemes=i.observable(!1),t.allowCustomLogin=i.observable(!1),t.allowLanguagesOnSettings=i.observable(!0),t.allowLanguagesOnLogin=i.observable(!0),t.desktopNotifications=i.observable(!1),t.useThreads=i.observable(!0),t.replySameFolder=i.observable(!0),t.useCheckboxesInList=i.observable(!0),t.layout=i.observable(W.Layout.SidePreview),t.usePreviewPane=i.computed(function(){return W.Layout.NoPreview!==t.layout()}),t.interfaceAnimation.subscribe(function(e){if(X.bMobileDevice||e===W.InterfaceAnimation.None)ot.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),X.sAnimationType=W.InterfaceAnimation.None;else switch(e){case W.InterfaceAnimation.Full:ot.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),X.sAnimationType=e;break;case W.InterfaceAnimation.Normal:ot.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),X.sAnimationType=e}}),t.interfaceAnimation.valueHasMutated(),t.desktopNotificationsPermisions=i.computed(function(){t.desktopNotifications();var i=W.DesktopNotifications.NotSupported;if(rt&&rt.permission)switch(rt.permission.toLowerCase()){case"granted":i=W.DesktopNotifications.Allowed;break;case"denied":i=W.DesktopNotifications.Denied;break;case"default":i=W.DesktopNotifications.NotAllowed}else e.webkitNotifications&&e.webkitNotifications.checkPermission&&(i=e.webkitNotifications.checkPermission());return i}),t.useDesktopNotifications=i.computed({read:function(){return t.desktopNotifications()&&W.DesktopNotifications.Allowed===t.desktopNotificationsPermisions()},write:function(e){if(e){var i=t.desktopNotificationsPermisions();W.DesktopNotifications.Allowed===i?t.desktopNotifications(!0):W.DesktopNotifications.NotAllowed===i?rt.requestPermission(function(){t.desktopNotifications.valueHasMutated(),W.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=i.observable(""),t.languages=i.observableArray([]),t.mainLanguage=i.computed({read:t.language,write:function(e){e!==t.language()?-1<$.inArray(e,t.languages())?t.language(e):0=t.diff(i,"hours")?n:t.format("L")===i.format("L")?$.i18n("MESSAGE_LIST/TODAY_AT",{TIME:i.format("LT")}):t.clone().subtract("days",1).format("L")===i.format("L")?$.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:i.format("LT")}):i.format(t.year()===i.year()?"D MMM.":"LL")},e)},$.isFolderExpanded=function(e){var t=lt.local().get(W.ClientSideKeyName.ExpandedFolders);return s.isArray(t)&&-1!==s.indexOf(t,e)},$.setExpandedFolder=function(e,t){var i=lt.local().get(W.ClientSideKeyName.ExpandedFolders);s.isArray(i)||(i=[]),t?(i.push(e),i=s.uniq(i)):i=s.without(i,e),lt.local().set(W.ClientSideKeyName.ExpandedFolders,i)},$.initLayoutResizer=function(e,i,n){var o=60,s=155,a=t(e),r=t(i),l=lt.local().get(n)||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=$.pInt(lt.local().get(n))||s;c(t>s?t:s)}},d=function(e,t){t&&t.size&&t.size.width&&(lt.local().set(n,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>s?l:s),a.resizable({helper:"ui-resizable-helper",minWidth:s,maxWidth:350,handles:"e",stop:d}),lt.sub("left-panel.off",function(){u(!0)}),lt.sub("left-panel.on",function(){u(!1)})},$.initBlockquoteSwitcher=function(e){if(e){var i=t("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===t(this).parent().closest("blockquote",e).length});i&&0100)&&(e.addClass("rl-bq-switcher hidden-bq"),t('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),$.windowResize()}).after("
").before("
"))})}},$.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()}))},$.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},$.extendAsViewModel=function(e,t,i){t&&(i||(i=d),t.__name=e,J.regViewModelHook(e,t),s.extend(t.prototype,i.prototype))},$.addSettingsViewModel=function(e,t,i,n,o){e.__rlSettingsData={Label:i,Template:t,Route:n,IsDefault:!!o},Z.settings.push(e)},$.removeSettingsViewModel=function(e){Z["settings-removed"].push(e)},$.disableSettingsViewModel=function(e){Z["settings-disabled"].push(e)},$.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=$.trim(e.substring(0,e.length-7))),$.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},$.quoteName=function(e){return e.replace(/["]/g,'\\"')},$.microtime=function(){return(new Date).getTime()},$.convertLangName=function(e,t){return $.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},$.fakeMd5=function(e){var t="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=$.isUnd(e)?32:$.pInt(e);t.length>>32-t}function i(e,t){var i,n,o,s,a;return o=2147483648&e,s=2147483648&t,i=1073741824&e,n=1073741824&t,a=(1073741823&e)+(1073741823&t),i&n?2147483648^a^o^s:i|n?1073741824&a?3221225472^a^o^s:1073741824^a^o^s:a^o^s}function n(e,t,i){return e&t|~e&i}function o(e,t,i){return e&i|t&~i}function s(e,t,i){return e^t^i}function a(e,t,i){return t^(e|~i)}function r(e,o,s,a,r,l,c){return e=i(e,i(i(n(o,s,a),r),c)),i(t(e,l),o)}function l(e,n,s,a,r,l,c){return e=i(e,i(i(o(n,s,a),r),c)),i(t(e,l),n)}function c(e,n,o,a,r,l,c){return e=i(e,i(i(s(n,o,a),r),c)),i(t(e,l),n)}function u(e,n,o,s,r,l,c){return e=i(e,i(i(a(n,o,s),r),c)),i(t(e,l),n)}function d(e){for(var t,i=e.length,n=i+8,o=(n-n%64)/64,s=16*(o+1),a=Array(s-1),r=0,l=0;i>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<>>29,a}function p(e){var t,i,n="",o="";for(i=0;3>=i;i++)t=e>>>8*i&255,o="0"+t.toString(16),n+=o.substr(o.length-2,2);return n}function g(e){e=e.replace(/rn/g,"n");for(var t="",i=0;in?t+=String.fromCharCode(n):n>127&&2048>n?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}var h,m,f,b,S,v,y,C,A,w=Array(),T=7,N=12,E=17,P=22,I=5,D=9,_=14,R=20,k=4,L=11,O=16,F=23,x=6,U=10,M=15,V=21;for(e=g(e),w=d(e),v=1732584193,y=4023233417,C=2562383102,A=271733878,h=0;h/g,">").replace(/")},$.draggeblePlace=function(){return t('
 
').appendTo("#rl-hidden")},$.defautOptionsAfterRender=function(e,i){i&&!$.isUnd(i.disabled)&&e&&t(e).toggleClass("disabled",i.disabled).prop("disabled",i.disabled)},$.windowPopupKnockout=function(i,n,o,s){var a=null,r=e.open(""),l="__OpenerApplyBindingsUid"+$.fakeMd5()+"__",c=t("#"+n);e[l]=function(){if(r&&r.document.body&&c&&c[0]){var n=t(r.document.body);t("#rl-content",n).html(c.html()),t("html",r.document).addClass("external "+t("html").attr("class")),$.i18nToNode(n),g.prototype.applyExternal(i,t("#rl-content",n)[0]),e[l]=null,s(r)}},r.document.open(),r.document.write(''+$.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)},$.settingsSaveHelperFunction=function(e,t,i,n){return i=i||null,n=$.isUnd(n)?1e3:$.pInt(n),function(o,a,r,l,c){t.call(i,a&&a.Result?W.SaveSettingsStep.TrueResult:W.SaveSettingsStep.FalseResult),e&&e.call(i,o,a,r,l,c),s.delay(function(){t.call(i,W.SaveSettingsStep.Idle)},n)}},$.settingsSaveHelperSimpleFunction=function(e,t){return $.settingsSaveHelperFunction(null,e,t,1e3)},$.htmlToPlain=function(e){var i="",n="> ",o=function(){if(arguments&&1\n",e.replace(/\n([> ]+)/gm,function(){return arguments&&1]*>(.|[\s\S\r\n]*)<\/div>/gim,s),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,s).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,""),i.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,"")},$.plainToHtml=function(e){return e.toString().replace(/&/g,"&").replace(/>/g,">").replace(/")},$.resizeAndCrop=function(t,i,n){var o=new e.Image;o.onload=function(){var e=[0,0],t=document.createElement("canvas"),o=t.getContext("2d");t.width=i,t.height=i,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],o.fillStyle="#fff",o.fillRect(0,0,i,i),o.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,i,i),n(t.toDataURL("image/jpeg"))},o.src=t},$.computedPagenatorHelper=function(e,t){return function(){var i=0,n=0,o=2,s=[],a=e(),r=t(),l=function(e,t,i){var n={current:e===a,name:$.isUnd(i)?e.toString():i.toString(),custom:$.isUnd(i)?!1:!0,title:$.isUnd(i)?"":e.toString(),value:e.toString()};($.isUnd(t)?0:!t)?s.unshift(n):s.push(n)};if(r>1||r>0&&a>r){for(a>r?(l(r),i=r,n=r):((3>=a||a>=r-2)&&(o+=2),l(a),i=a,n=a);o>0;)if(i-=1,n+=1,i>0&&(l(i,!1),o--),r>=n)l(n,!0),o--;else if(0>=i)break;3===i?l(2,!1):i>3&&l(Math.round((i-1)/2),!1,"..."),r-2===n?l(r-1,!0):r-2>n&&l(Math.round((r+n)/2),!0,"..."),i>1&&l(1,!1),r>n&&l(r,!0)}return s}},$.selectElement=function(t){if(e.getSelection){var i=e.getSelection();i.removeAllRanges();var n=document.createRange();n.selectNodeContents(t),i.addRange(n)}else if(document.selection){var o=document.body.createTextRange();o.moveToElementText(t),o.select()}},$.disableKeyFilter=function(){e.key&&(key.filter=function(){return lt.data().useKeyboardShortcuts()})},$.restoreKeyFilter=function(){e.key&&(key.filter=function(e){if(lt.data().useKeyboardShortcuts()){var t=e.target||e.srcElement,i=t?t.tagName:"";return i=i.toUpperCase(),!("INPUT"===i||"SELECT"===i||"TEXTAREA"===i||t&&"DIV"===i&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1})},$.detectDropdownVisibility=s.debounce(function(){X.dropdownVisibility(!!s.find(et,function(e){return e.hasClass("open")}))},50),Q={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return Q.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var t,i,n,o,s,a,r,l="",c=0;for(e=Q._utf8_encode(e);c>2,s=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,r=63&n,isNaN(i)?a=r=64:isNaN(n)&&(r=64),l=l+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a)+this._keyStr.charAt(r);return l},decode:function(e){var t,i,n,o,s,a,r,l="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&s)<<4|a>>2,n=(3&a)<<6|r,l+=String.fromCharCode(t),64!==a&&(l+=String.fromCharCode(i)),64!==r&&(l+=String.fromCharCode(n));return Q._utf8_decode(l)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,n=e.length,o=0;n>i;i++)o=e.charCodeAt(i),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="",i=0,n=0,o=0,s=0;in?(t+=String.fromCharCode(n),i++):n>191&&224>n?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&n)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),s=e.charCodeAt(i+2),t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s),i+=3);return t}},i.bindingHandlers.tooltip={init:function(e,n){if(!X.bMobileDevice){var o=t(e),s=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")||X.dropdownVisibility()?"":''+$.i18n(i.utils.unwrapObservable(n()))+""}}).click(function(){o.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(e,i){var n=t(e),o=n.data("tooltip-class")||"",s=n.data("tooltip-placement")||"top";n.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:s,title:function(){return n.is(".disabled")||X.dropdownVisibility()?"":''+i()()+""}}).click(function(){n.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){n.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(e){var i=t(e);i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),at.click(function(){i.tooltip("hide")}),X.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,n){var o=i.utils.unwrapObservable(n());""===o?t(e).data("tooltip3-data","").tooltip("hide"):t(e).data("tooltip3-data",o).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(e){et.push(t(e))}},i.bindingHandlers.openDropdownTrigger={update:function(e,n){if(i.utils.unwrapObservable(n())){var o=t(e);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),$.detectDropdownVisibility()),n()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){t(e).closest(".dropdown").on("click",".e-item",function(){t(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,n){t(e).popover(i.utils.unwrapObservable(n()))}},i.bindingHandlers.csstext={init:function(e,n){e&&e.styleSheet&&!$.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=i.utils.unwrapObservable(n()):t(e).text(i.utils.unwrapObservable(n()))},update:function(e,n){e&&e.styleSheet&&!$.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=i.utils.unwrapObservable(n()):t(e).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.resizecrop={init:function(e){t(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,i){i()(),t(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(i,n,o,s){t(i).on("keypress",function(o){o&&13===e.parseInt(o.keyCode,10)&&(t(i).trigger("change"),n().call(s))})}},i.bindingHandlers.onEsc={init:function(i,n,o,s){t(i).on("keypress",function(o){o&&27===e.parseInt(o.keyCode,10)&&(t(i).trigger("change"),n().call(s))})}},i.bindingHandlers.clickOnTrue={update:function(e,n){i.utils.unwrapObservable(n())&&t(e).click()}},i.bindingHandlers.modal={init:function(e,n){t(e).toggleClass("fade",!X.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(n())}).on("shown",function(){$.windowResize()}).find(".close").click(function(){n()(!1)})},update:function(e,n){t(e).modal(i.utils.unwrapObservable(n())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(e){$.i18nToNode(e)}},i.bindingHandlers.i18nUpdate={update:function(e,t){i.utils.unwrapObservable(t()),$.i18nToNode(e)}},i.bindingHandlers.link={update:function(e,n){t(e).attr("href",i.utils.unwrapObservable(n()))}},i.bindingHandlers.title={update:function(e,n){t(e).attr("title",i.utils.unwrapObservable(n()))}},i.bindingHandlers.textF={init:function(e,n){t(e).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,n){var o=i.utils.unwrapObservable(n());t(e).css({height:o[1],"min-height":o[1]})},update:function(e,n){var o=i.utils.unwrapObservable(n()),s=$.pInt(o[1]),a=0,r=t(e).offset().top;r>0&&(r+=$.pInt(o[2]),a=st.height()-r,a>s&&(s=a),t(e).css({height:s,"min-height":s}))}},i.bindingHandlers.appendDom={update:function(e,n){t(e).hide().empty().append(i.utils.unwrapObservable(n())).show()}},i.bindingHandlers.draggable={init:function(n,o,s){if(!X.bMobileDevice){var a=100,r=3,l=s(),c=l&&l.droppableSelector?l.droppableSelector:"",u={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};c&&(u.drag=function(i){t(c).each(function(){var n=null,o=null,s=t(this),l=s.offset(),c=l.top+s.height();e.clearInterval(s.data("timerScroll")),s.data("timerScroll",!1),i.pageX>=l.left&&i.pageX<=l.left+s.width()&&(i.pageY>=c-a&&i.pageY<=c&&(n=function(){s.scrollTop(s.scrollTop()+r),$.windowResize()},s.data("timerScroll",e.setInterval(n,10)),n()),i.pageY>=l.top&&i.pageY<=l.top+a&&(o=function(){s.scrollTop(s.scrollTop()-r),$.windowResize()},s.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?i.dataFor(e.target):null)},t(n).draggable(u).on("mousedown",function(){$.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(e,i,n){if(!X.bMobileDevice){var o=i(),s=n(),a=s&&s.droppableOver?s.droppableOver:null,r=s&&s.droppableOut?s.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))}}},i.bindingHandlers.nano={init:function(e){X.bDisableNanoScroll||t(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var i=t(e);i.data("save-trigger-type",i.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===i.data("save-trigger-type")?i.append('  ').addClass("settings-saved-trigger"):i.addClass("settings-saved-trigger-input")},update:function(e,n){var o=i.utils.unwrapObservable(n()),s=t(e);if("custom"===s.data("save-trigger-type"))switch(o.toString()){case"1":s.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":s.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":s.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:s.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":s.addClass("success").removeClass("error");break;case"0":s.addClass("error").removeClass("success");break;case"-2":break;default:s.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(e,i){var n=t(e),o=i(),a=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};n.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:a,inputDelimiters:[",",";"],autoCompleteSource:function(e,t){lt.getAutocomplete(e.term,function(e){t(s.map(e,function(e){return e.toLine(!1)}))})},parseHook:function(e){return s.map(e,function(e){var t=$.trim(e),i=null;return""!==t?(i=new h,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:s.bind(function(e){n.data("EmailsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){n.data("EmailsTagsValue")!==e&&(n.val(e),n.data("EmailsTagsValue",e),n.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&n.inputosaurus("focus")})}},i.bindingHandlers.contactTags={init:function(e,i){var n=t(e),o=i(),a=function(e){o&&o.focusTrigger&&o.focusTrigger(e)};n.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:a,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:function(e,t){lt.getContactsTagsAutocomplete(e.term,function(e){t(s.map(e,function(e){return e.toLine(!1) +}))})},parseHook:function(e){return s.map(e,function(e){var t=$.trim(e),i=null;return""!==t?(i=new m,i.name(t),[i.toLine(!1),i]):[t,null]})},change:s.bind(function(e){n.data("ContactsTagsValue",e.target.value),o(e.target.value)},this)}),o.subscribe(function(e){n.data("ContactsTagsValue")!==e&&(n.val(e),n.data("ContactsTagsValue",e),n.inputosaurus("refresh"))}),o.focusTrigger&&o.focusTrigger.subscribe(function(e){e&&n.inputosaurus("focus")})}},i.bindingHandlers.command={init:function(e,n,o,s){var a=t(e),r=n();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(s,arguments)},update:function(e,i){var n=!0,o=t(e),s=i();n=s.enabled(),o.toggleClass("command-not-enabled",!n),n&&(n=s.canExecute(),o.toggleClass("command-can-not-be-execute",!n)),o.toggleClass("command-disabled disable disabled",!n).toggleClass("no-disabled",!!n),(o.is("input")||o.is("button"))&&o.prop("disabled",!n)}},i.extenders.trimmer=function(e){var t=i.computed({read:e,write:function(t){e($.trim(t.toString()))},owner:this});return t(e()),t},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){return t.iTimeout=0,t.subscribe(function(n){n&&(e.clearTimeout(t.iTimeout),t.iTimeout=e.setTimeout(function(){t(!1),t.iTimeout=0},$.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){return this.hasError=i.observable(!1),this.subscribe(function(e){e=$.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){return this.hasError=i.observable(!1),this.subscribe(function(e){e=$.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(e){return this.hasFuncError=i.observable(!1),$.isFunc(e)&&(this.subscribe(function(t){this.hasFuncError(!e(t))},this),this.valueHasMutated()),this},a.prototype.root=function(){return this.sBase},a.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},a.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},a.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},a.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},a.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},a.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},a.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},a.prototype.change=function(t){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+e.encodeURIComponent(t)+"/"},a.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},a.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},a.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},a.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},a.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},a.prototype.settings=function(e){var t=this.sBase+"settings";return $.isUnd(e)||""===e||(t+="/"+e),t},a.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},a.prototype.mailBox=function(e,t,i){t=$.isNormal(t)?$.pInt(t):1,i=$.pString(i);var n=this.sBase+"mailbox/";return""!==e&&(n+=encodeURI(e)),t>1&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},a.prototype.phpInfo=function(){return this.sServer+"Info"},a.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},a.prototype.getUserPicUrlFromHash=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/UserPic/"+e+"/"+this.sVersion+"/"},a.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},a.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},a.prototype.emptyContactPic=function(){return"rainloop/v/"+this.sVersion+"/static/css/images/empty-contact.png"},a.prototype.emptyFullContactPic=function(){return e.location.protocol+"//"+e.location.hostname+("80"==""+e.location.port||""==""+e.location.port?"":":"+e.location.port)+e.location.pathname+"rainloop/v/"+this.sVersion+"/static/css/images/empty-contact.png"},a.prototype.sound=function(e){return"rainloop/v/"+this.sVersion+"/static/sounds/"+e},a.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=$.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},a.prototype.notificationMailIcon=function(){return"rainloop/v/"+this.sVersion+"/static/css/images/icom-message-notification.png"},a.prototype.openPgpJs=function(){return"rainloop/v/"+this.sVersion+"/static/js/openpgp.min.js"},a.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},a.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},a.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},J.oViewModelsHooks={},J.oSimpleHooks={},J.regViewModelHook=function(e,t){t&&(t.__hookName=e)},J.addHook=function(e,t){$.isFunc(t)&&($.isArray(J.oSimpleHooks[e])||(J.oSimpleHooks[e]=[]),J.oSimpleHooks[e].push(t))},J.runHook=function(e,t){$.isArray(J.oSimpleHooks[e])&&(t=t||[],s.each(J.oSimpleHooks[e],function(e){e.apply(null,t)}))},J.mainSettingsGet=function(e){return lt?lt.settingsGet(e):null},J.remoteRequest=function(e,t,i,n,o,s){lt&<.remote().defaultRequest(e,t,i,n,o,s)},J.settingsGet=function(e,t){var i=J.mainSettingsGet("Plugins");return i=i&&$.isUnd(i[e])?null:i[e],i?$.isUnd(i[t])?null:i[t]:null},r.supported=function(){return!0},r.prototype.set=function(e,i){var n=t.cookie(z.Values.ClientSideCookieIndexName),o=!1,s=null;try{s=null===n?null:JSON.parse(n),s||(s={}),s[e]=i,t.cookie(z.Values.ClientSideCookieIndexName,JSON.stringify(s),{expires:30}),o=!0}catch(a){}return o},r.prototype.get=function(e){var i=t.cookie(z.Values.ClientSideCookieIndexName),n=null;try{n=null===i?null:JSON.parse(i),n=n&&!$.isUnd(n[e])?n[e]:null}catch(o){}return n},l.supported=function(){return!!e.localStorage},l.prototype.set=function(t,i){var n=e.localStorage[z.Values.ClientSideCookieIndexName]||null,o=!1,s=null;try{s=null===n?null:JSON.parse(n),s||(s={}),s[t]=i,e.localStorage[z.Values.ClientSideCookieIndexName]=JSON.stringify(s),o=!0}catch(a){}return o},l.prototype.get=function(t){var i=e.localStorage[z.Values.ClientSideCookieIndexName]||null,n=null;try{n=null===i?null:JSON.parse(i),n=n&&!$.isUnd(n[t])?n[t]:null}catch(o){}return n},c.prototype.oDriver=null,c.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},c.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},u.prototype.bootstart=function(){},d.prototype.sPosition="",d.prototype.sTemplate="",d.prototype.viewModelName="",d.prototype.viewModelDom=null,d.prototype.viewModelTemplate=function(){return this.sTemplate},d.prototype.viewModelPosition=function(){return this.sPosition},d.prototype.cancelCommand=d.prototype.closeCommand=function(){},d.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=lt.data().keyScope(),lt.data().keyScope(this.sDefaultKeyScope)},d.prototype.restoreKeyScope=function(){lt.data().keyScope(this.sCurrentKeyScope)},d.prototype.registerPopupKeyDown=function(){var e=this;st.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&W.EventKeyCode.Esc===t.keyCode)return $.delegateRun(e,"cancelCommand"),!1;if(W.EventKeyCode.Backspace===t.keyCode&&!$.inFocus())return!1}return!0})},p.prototype.oCross=null,p.prototype.sScreenName="",p.prototype.aViewModels=[],p.prototype.viewModels=function(){return this.aViewModels},p.prototype.screenName=function(){return this.sScreenName},p.prototype.routes=function(){return null},p.prototype.__cross=function(){return this.oCross},p.prototype.__start=function(){var e=this.routes(),t=null,i=null;$.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||$.emptyFunction,this),t=n.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},g.constructorEnd=function(e){$.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},g.prototype.sDefaultScreenName="",g.prototype.oScreens={},g.prototype.oBoot=null,g.prototype.oCurrentScreen=null,g.prototype.hideLoading=function(){t("#rl-loading").hide()},g.prototype.routeOff=function(){o.changed.active=!1},g.prototype.routeOn=function(){o.changed.active=!0},g.prototype.setBoot=function(e){return $.isNormal(e)&&(this.oBoot=e),this},g.prototype.screen=function(e){return""===e||$.isUnd(this.oScreens[e])?null:this.oScreens[e]},g.prototype.buildViewModel=function(e,n){if(e&&!e.__builded){var o=new e(n),a=o.viewModelPosition(),r=t("#rl-content #rl-"+a.toLowerCase()),l=null;e.__builded=!0,e.__vm=o,o.data=lt.data(),o.viewModelName=e.__name,r&&1===r.length?(l=t("
").addClass("rl-view-model").addClass("RL-"+o.viewModelTemplate()).hide(),l.appendTo(r),o.viewModelDom=l,e.__dom=l,"Popups"===a&&(o.cancelCommand=o.closeCommand=$.createCommand(o,function(){tt.hideScreenPopup(e)}),o.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),lt.popupVisibilityNames.push(this.viewModelName),o.viewModelDom.css("z-index",3e3+lt.popupVisibilityNames().length+10),$.delegateRun(this,"onFocus",[],500)):($.delegateRun(this,"onHide"),this.restoreKeyScope(),lt.popupVisibilityNames.remove(this.viewModelName),o.viewModelDom.css("z-index",2e3),X.tooltipTrigger(!X.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},o)),J.runHook("view-model-pre-build",[e.__name,o,l]),i.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:o.viewModelTemplate()}}},o),$.delegateRun(o,"onBuild",[l]),o&&"Popups"===a&&o.registerPopupKeyDown(),J.runHook("view-model-post-build",[e.__name,o,l])):$.log("Cannot find view model position: "+a)}return e?e.__vm:null},g.prototype.applyExternal=function(e,t){e&&t&&i.applyBindings(e,t)},g.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),J.runHook("view-model-on-hide",[e.__name,e.__vm]))},g.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),$.delegateRun(e.__vm,"onShow",t||[]),J.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},g.prototype.screenOnRoute=function(e,t){var i=this,n=null,o=null;""===$.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(n=this.screen(e),n||(n=this.screen(this.sDefaultScreenName),n&&(t=e+"/"+t,e=this.sDefaultScreenName)),n&&n.__started&&(n.__builded||(n.__builded=!0,$.isNonEmptyArray(n.viewModels())&&s.each(n.viewModels(),function(e){this.buildViewModel(e,n)},this),$.delegateRun(n,"onBuild")),s.defer(function(){i.oCurrentScreen&&($.delegateRun(i.oCurrentScreen,"onHide"),$.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),$.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=n,i.oCurrentScreen&&($.delegateRun(i.oCurrentScreen,"onShow"),J.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),$.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),$.delegateRun(e.__vm,"onShow"),$.delegateRun(e.__vm,"onFocus",[],200),J.runHook("view-model-on-show",[e.__name,e.__vm]))},i)),o=n.__cross(),o&&o.parse(t)})))},g.prototype.startScreens=function(e){t("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),J.runHook("screen-pre-start",[e.screenName(),e]),$.delegateRun(e,"onStart"),J.runHook("screen-post-start",[e.screenName(),e]))},this);var i=n.create();i.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),o.initialized.add(i.parse,i),o.changed.add(i.parse,i),o.init(),t("#rl-content").css({visibility:"visible"}),s.delay(function(){ot.removeClass("rl-started-trigger").addClass("rl-started")},50)},g.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=$.isUnd(i)?!1:!!i,($.isUnd(t)?1:!t)?(o.changed.active=!0,o[i?"replaceHash":"setHash"](e),o.setHash(e)):(o.changed.active=!1,o[i?"replaceHash":"setHash"](e),o.changed.active=!0)},g.prototype.bootstart=function(){return this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart(),this},tt=new g,h.newInstanceFromJson=function(e){var t=new h;return t.initByJson(e)?t:null},h.prototype.name="",h.prototype.email="",h.prototype.privateType=null,h.prototype.clear=function(){this.email="",this.name="",this.privateType=null},h.prototype.validate=function(){return""!==this.name||""!==this.email},h.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},h.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},h.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=W.EmailType.Facebook),null===this.privateType&&(this.privateType=W.EmailType.Default)),this.privateType},h.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},h.prototype.parse=function(e){this.clear(),e=$.trim(e);var t=/(?:"([^"]+)")? ?,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},h.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=$.trim(e.Name),this.email=$.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},h.prototype.toLine=function(e,t,i){var n="";return""!==this.email&&(t=$.isUnd(t)?!1:!!t,i=$.isUnd(i)?!1:!!i,e&&""!==this.name?n=t?'
")+'" target="_blank" tabindex="-1">'+$.encodeHtml(this.name)+"":i?$.encodeHtml(this.name):this.name:(n=this.email,""!==this.name?t?n=$.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+$.encodeHtml(n)+""+$.encodeHtml(">"):(n='"'+this.name+'" <'+n+">",i&&(n=$.encodeHtml(n))):t&&(n=''+$.encodeHtml(this.email)+""))),n},h.prototype.mailsoParse=function(e){if(e=$.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var n=e.length;return 0>t&&(t+=n),n="undefined"==typeof i?n:0>i?i+n:i+t,t>=e.length||0>t||t>n?!1:e.slice(t,n)},i=function(e,t,i,n){return 0>i&&(i+=e.length),n=void 0!==n?n:e.length,0>n&&(n=n+e.length-i),e.slice(0,i)+t.substr(0,n)+t.slice(n)+e.slice(i+n)},n="",o="",s="",a=!1,r=!1,l=!1,c=null,u=0,d=0,p=0;p0&&0===n.length&&(n=t(e,0,p)),r=!0,u=p);break;case">":r&&(d=p,o=t(e,u+1,d-u-1),e=i(e,"",u,d-u+1),d=0,p=0,u=0,r=!1);break;case"(":a||r||l||(l=!0,u=p);break;case")":l&&(d=p,s=t(e,u+1,d-u-1),e=i(e,"",u,d-u+1),d=0,p=0,u=0,l=!1);break;case"\\":p++}p++}return 0===o.length&&(c=e.match(/[^@\s]+@\S+/i),c&&c[0]?o=c[0]:n=e),o.length>0&&0===n.length&&0===s.length&&(n=e.replace(o,"")),o=$.trim(o).replace(/^[<]+/,"").replace(/[>]+$/,""),n=$.trim(n).replace(/^["']+/,"").replace(/["']+$/,""),s=$.trim(s).replace(/^[(]+/,"").replace(/[)]+$/,""),n=n.replace(/\\\\(.)/,"$1"),s=s.replace(/\\\\(.)/,"$1"),this.name=n,this.email=o,this.clearDuplicateName(),!0},h.prototype.inputoTagLine=function(){return 0(new e.Date).getTime()-d),g&&l.oRequests[g]&&(l.oRequests[g].__aborted&&(o="abort"),l.oRequests[g]=null),l.defaultResponse(i,g,o,t,s,n)}),g&&0").addClass("rl-settings-view-model").hide(),l.appendTo(r),o.data=lt.data(),o.viewModelDom=l,o.__rlSettingsData=a.__rlSettingsData,a.__dom=l,a.__builded=!0,a.__vm=o,i.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:a.__rlSettingsData.Template}}},o),$.delegateRun(o,"onBuild",[l])):$.log("Cannot find sub settings view model position: SettingsSubScreen")),o&&s.defer(function(){n.oCurrentSubScreen&&($.delegateRun(n.oCurrentSubScreen,"onHide"),n.oCurrentSubScreen.viewModelDom.hide()),n.oCurrentSubScreen=o,n.oCurrentSubScreen&&(n.oCurrentSubScreen.viewModelDom.show(),$.delegateRun(n.oCurrentSubScreen,"onShow"),$.delegateRun(n.oCurrentSubScreen,"onFocus",[],200),s.each(n.menu(),function(e){e.selected(o&&o.__rlSettingsData&&e.route===o.__rlSettingsData.Route)}),t("#rl-content .b-settings .b-content .content").scrollTop(0)),$.windowResize()})):tt.setHash(lt.link().settings(),!1,!0)},G.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&($.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},G.prototype.onBuild=function(){s.each(Z.settings,function(e){e&&e.__rlSettingsData&&!s.find(Z["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:i.observable(!1),disabled:!!s.find(Z["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=t("#rl-content #rl-settings-subscreen")},G.prototype.routes=function(){var e=s.find(Z.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=$.isUnd(i.subname)?t:$.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},s.extend(q.prototype,p.prototype),q.prototype.onShow=function(){lt.setTitle("")},s.extend(B.prototype,G.prototype),B.prototype.onShow=function(){lt.setTitle("")},s.extend(K.prototype,u.prototype),K.prototype.oSettings=null,K.prototype.oPlugins=null,K.prototype.oLocal=null,K.prototype.oLink=null,K.prototype.oSubs={},K.prototype.download=function(t){var i=null,n=null,o=navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=document.createElement("a"),i.href=t,document.createEvent&&(n=document.createEvent("MouseEvents"),n&&n.initEvent&&i.dispatchEvent))?(n.initEvent("click",!0,!0),i.dispatchEvent(n),!0):(X.bMobileDevice?(e.open(t,"_self"),e.focus()):this.iframe.attr("src",t),!0)},K.prototype.link=function(){return null===this.oLink&&(this.oLink=new a),this.oLink},K.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new c),this.oLocal},K.prototype.settingsGet=function(e){return null===this.oSettings&&(this.oSettings=$.isNormal(it)?it:{}),$.isUnd(this.oSettings[e])?null:this.oSettings[e]},K.prototype.settingsSet=function(e,t){null===this.oSettings&&(this.oSettings=$.isNormal(it)?it:{}),this.oSettings[e]=t},K.prototype.setTitle=function(t){t=($.isNormal(t)&&0} */ Utils = {}, - + /** * @type {Object.} */ @@ -69,7 +69,7 @@ var I18n = window['rainloopI18N'] || {}, $html = $('html'), - + // $body = $('body'), $window = $(window), @@ -77,18 +77,22 @@ var $document = $(window.document), 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*/ /** * @type {?RainLoopApp} */ var RL = null, - + $proxyDiv = $('
') ; /*jshint onevar: true*/ - +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @type {?} */ @@ -242,7 +246,9 @@ 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 = {}; Consts.Values = {}; Consts.DataImages = {}; @@ -360,7 +366,9 @@ 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 */ + /** * @enum {string} */ @@ -778,7 +786,9 @@ Enums.Notification = { 'UnknownNotification': 999, 'UnknownError': 999 }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + Utils.trim = $.trim; Utils.inArray = $.inArray; Utils.isArray = _.isArray; @@ -2528,7 +2538,8 @@ Utils.detectDropdownVisibility = _.debounce(function () { return oItem.hasClass('open'); })); }, 50); - + +/*jslint bitwise: true*/ // Base64 encode / decode // http://www.webtoolkit.info/ @@ -2691,7 +2702,9 @@ Base64 = { } }; -/*jslint bitwise: false*/ +/*jslint bitwise: false*/ +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + ko.bindingHandlers.tooltip = { 'init': function (oElement, fValueAccessor) { if (!Globals.bMobileDevice) @@ -3508,7 +3521,9 @@ ko.observable.fn.validateFunc = function (fFunc) return this; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -3830,7 +3845,9 @@ 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 */ + /** * @type {Object} */ @@ -3924,7 +3941,15 @@ Plugins.settingsGet = function (sPluginSection, sName) }; - + + +/** + * @constructor + * @param {Object} oElement + * @param {Function=} fOnBlur + * @param {Function=} fOnReady + * @param {Function=} fOnModeChange + */ function NewHtmlEditorWrapper(oElement, fOnBlur, fOnReady, fOnModeChange) { var self = this; @@ -4150,7 +4175,9 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus) this.setHtml('', bFocus); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @param {koProperty} oKoList @@ -4859,7 +4886,9 @@ Selector.prototype.on = function (sEventName, fCallback) { this.oCallbacks[sEventName] = fCallback; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -4933,7 +4962,9 @@ CookieDriver.prototype.get = function (sKey) return mResult; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -5004,7 +5035,9 @@ LocalStorageDriver.prototype.get = function (sKey) return mResult; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -5047,7 +5080,9 @@ 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 */ + /** * @constructor */ @@ -5060,7 +5095,9 @@ KnoinAbstractBoot.prototype.bootstart = function () { }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {string=} sPosition = '' * @param {string=} sTemplate = '' @@ -5153,7 +5190,9 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function () return true; }); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {string} sScreenName * @param {?=} aViewModels = [] @@ -5229,7 +5268,9 @@ KnoinAbstractScreen.prototype.__start = function () this.oCross = oRoute; } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -5634,7 +5675,9 @@ Knoin.prototype.bootstart = function () }; kn = new Knoin(); - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {string=} sEmail * @param {string=} sName @@ -5998,7 +6041,9 @@ 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 */ + /** * @constructor */ @@ -6122,7 +6167,9 @@ ContactModel.prototype.lineAsCcc = function () return aResult.join(' '); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {number=} iType = Enums.ContactPropertyType.Unknown * @param {string=} sTypeStr = '' @@ -6151,7 +6198,9 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder) }, this); } - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -6195,7 +6244,9 @@ 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 */ + /** * @constructor */ @@ -6431,7 +6482,9 @@ AttachmentModel.prototype.iconClass = function () return sClass; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @param {string} sId @@ -6492,7 +6545,9 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment) } return bResult; -}; +}; +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -7690,7 +7745,9 @@ 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 */ + /** * @constructor */ @@ -8022,7 +8079,9 @@ FolderModel.prototype.printableFullName = function () { return this.fullName.split(this.delimiter).join(' / '); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {string} sEmail * @param {boolean=} bCanBeDelete = true @@ -8043,7 +8102,9 @@ 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 */ + /** * @param {string} sId * @param {string} sEmail @@ -8079,14 +8140,18 @@ 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 */ + /** * @constructor */ function FilterConditionModel() { } - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -8121,7 +8186,9 @@ FilterModel.prototype.parse = function (oItem) return bResult; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {string} iIndex * @param {string} sGuID @@ -8152,7 +8219,9 @@ 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 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -8248,7 +8317,9 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder) this.selectedFolder(oFolder); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -8358,7 +8429,9 @@ PopupsFolderCreateViewModel.prototype.onFocus = function () { this.folderName.focused(true); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -8471,7 +8544,9 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType) this.notification(sNotification); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -9843,7 +9918,6 @@ PopupsComposeViewModel.prototype.prepearMessageAttachments = function (oMessage, break; } - bAdd = true; if (bAdd) { oAttachment = new ComposeAttachmentModel( @@ -9959,7 +10033,9 @@ PopupsComposeViewModel.prototype.triggerForResize = function () this.editorResizeThrottle(); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -10701,7 +10777,9 @@ PopupsContactsViewModel.prototype.onHide = function () // oItem.checked(false); // }); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -10837,7 +10915,9 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function () { this.fromFocus(true); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -10949,7 +11029,9 @@ PopupsAddAccountViewModel.prototype.onFocus = function () { this.emailFocus(true); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11035,7 +11117,9 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function () { this.key.focus(true); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11075,7 +11159,9 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey) this.key(oOpenPgpKey.armor); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11170,7 +11256,9 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function () { this.email.focus(true); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11410,7 +11498,9 @@ 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 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11558,7 +11648,9 @@ PopupsIdentityViewModel.prototype.onFocus = function () this.email.focused(true); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11618,7 +11710,9 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang) RL.data().mainLanguage(sLang); this.cancelCommand(); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11672,7 +11766,9 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function () { this.code.focused(true); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11778,7 +11874,9 @@ PopupsAskViewModel.prototype.onBuild = function () }, this)); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -11823,7 +11921,9 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom) } }, this)); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -12135,7 +12235,9 @@ LoginViewModel.prototype.selectLanguage = function () kn.showScreenPopup(PopupsLanguagesViewModel); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -12231,7 +12333,9 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function () } }); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractSystemDropDownViewModel @@ -12243,7 +12347,9 @@ function MailBoxSystemDropDownViewModel() } Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel); - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractSystemDropDownViewModel @@ -12255,7 +12361,9 @@ function SettingsSystemDropDownViewModel() } Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel); - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -12503,7 +12611,9 @@ MailBoxFolderListViewModel.prototype.contactsClick = function () kn.showScreenPopup(PopupsContactsViewModel); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -13406,7 +13516,9 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function () ; return !!oJua; -}; +}; +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -14098,7 +14210,9 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage) RL.reloadFlagsCurrentMessageListAndMessageFromCache(); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {?} oScreen * @@ -14127,7 +14241,9 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function () { kn.setHash(RL.link().inbox()); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractViewModel @@ -14158,7 +14274,9 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function () { kn.setHash(RL.link().inbox()); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14318,7 +14436,9 @@ SettingsGeneral.prototype.selectLanguage = function () { kn.showScreenPopup(PopupsLanguagesViewModel); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14368,7 +14488,9 @@ SettingsContacts.prototype.onBuild = function () //{ // //}; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14449,7 +14571,9 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove) } } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14537,7 +14661,9 @@ SettingsIdentity.prototype.onBuild = function () }, 50); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14695,7 +14821,9 @@ SettingsIdentities.prototype.onBuild = function (oDom) }); }, 50); -}; +}; +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14725,7 +14853,9 @@ SettingsFilters.prototype.addFilter = function () this.filters.push(oFilter); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -14875,7 +15005,9 @@ 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 */ + /** * @constructor */ @@ -14942,7 +15074,9 @@ 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 */ + /** * @constructor */ @@ -15047,7 +15181,9 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword)); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -15242,7 +15378,9 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder) oFolder.subScribed(false); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -15356,7 +15494,9 @@ SettingsThemes.prototype.onBuild = function () }; })); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -15424,7 +15564,9 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove) RL.reloadOpenPgpKeys(); } } -}; +}; +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -15555,7 +15697,9 @@ AbstractData.prototype.populateDataOnStart = function() this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed')); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractData @@ -16808,7 +16952,9 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword) { return this.findPrivateKeyByEmail(this.accountEmail(), sPassword); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -17082,7 +17228,9 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion) 'Version': sVersion }); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractAjaxRemoteStorage @@ -17875,7 +18023,9 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback) this.defaultRequest(fCallback, 'SocialUsers'); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor */ @@ -17959,7 +18109,9 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData) { this.oEmailsPicsHashes = oData; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractCacheStorage @@ -18277,7 +18429,9 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function this.setMessageFlagsToCache(sFolder, sUid, aFlags); } }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @param {Array} aViewModels * @constructor @@ -18457,7 +18611,9 @@ AbstractSettings.prototype.routes = function () ['', oRules] ]; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractScreen @@ -18472,7 +18628,9 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype); LoginScreen.prototype.onShow = function () { RL.setTitle(''); -}; +}; +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends KnoinAbstractScreen @@ -18643,7 +18801,9 @@ MailBoxScreen.prototype.routes = function () [/^([^\/]*)$/, {'normalize_': fNormS}] ]; }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractSettings @@ -18670,7 +18830,9 @@ 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 */ + /** * @constructor * @extends KnoinAbstractBoot @@ -19028,7 +19190,9 @@ AbstractApp.prototype.bootstart = function () ssm.ready(); }; - + +/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ + /** * @constructor * @extends AbstractApp @@ -20335,7 +20499,9 @@ 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'); $window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS); @@ -20386,9 +20552,9 @@ window['__RLBOOT'] = function (fCall) { window['__RLBOOT'] = null; }); }; - + if (window.SimplePace) { window.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/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index 85064611c..aed3c4fab 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(a,b,c,d,e,f,g,h,i,j){"use strict";function k(){this.sBase="#/",this.sVersion=Sb.settingsGet("Version"),this.sSpecSuffix=Sb.settingsGet("AuthAccountHash")||"0",this.sServer=(Sb.settingsGet("IndexFile")||"./")+"?"}function l(a,c,d,e){var f=this;f.editor=null,f.iBlurTimer=0,f.fOnBlur=c||null,f.fOnReady=d||null,f.fOnModeChange=e||null,f.$element=b(a),f.init(),f.resize=h.throttle(h.bind(f.resize,f),100)}function m(a,b,d,e,f,g){this.list=a,this.listChecked=c.computed(function(){return h.filter(this.list(),function(a){return a.checked()})},this).extend({rateLimit:0}),this.isListChecked=c.computed(function(){return 00&&-1b?b:a))},this),this.body=null,this.plainRaw="",this.isRtl=c.observable(!1),this.isHtml=c.observable(!1),this.hasImages=c.observable(!1),this.attachments=c.observableArray([]),this.isPgpSigned=c.observable(!1),this.isPgpEncrypted=c.observable(!1),this.pgpSignedVerifyStatus=c.observable(Db.SignedVerifyStatus.None),this.pgpSignedVerifyUser=c.observable(""),this.priority=c.observable(Db.MessagePriority.Normal),this.readReceipt=c.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=c.observable(0),this.threads=c.observableArray([]),this.threadsLen=c.observable(0),this.hasUnseenSubMessage=c.observable(!1),this.hasFlaggedSubMessage=c.observable(!1),this.lastInCollapsedThread=c.observable(!1),this.lastInCollapsedThreadLoading=c.observable(!1),this.threadsLenResult=c.computed(function(){var a=this.threadsLen();return 0===this.parentUid()&&a>0?a+1:""},this)}function B(){this.name=c.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=c.observable(Db.FolderType.User),this.focused=c.observable(!1),this.selected=c.observable(!1),this.edited=c.observable(!1),this.collapsed=c.observable(!0),this.subScribed=c.observable(!0),this.subFolders=c.observableArray([]),this.deleteAccess=c.observable(!1),this.actionBlink=c.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=c.observable(""),this.name.subscribe(function(a){this.nameForEdit(a)},this),this.edited.subscribe(function(a){a&&this.nameForEdit(this.name())},this),this.privateMessageCountAll=c.observable(0),this.privateMessageCountUnread=c.observable(0),this.collapsedPrivate=c.observable(!0)}function C(a,b){this.email=a,this.deleteAccess=c.observable(!1),this.canBeDalete=c.observable(b)}function D(a,b,d){this.id=a,this.email=c.observable(b),this.name=c.observable(""),this.replyTo=c.observable(""),this.bcc=c.observable(""),this.deleteAccess=c.observable(!1),this.canBeDalete=c.observable(d)}function E(){}function F(){this.enabled=c.observable(!0),this.conditions=c.observableArray([]),this.action=c.observable(Db.FiltersAction.None)}function G(a,b,d,e,f,g,h){this.index=a,this.id=d,this.guid=b,this.user=e,this.email=f,this.armor=h,this.isPrivate=!!g,this.deleteAccess=c.observable(!1)}function H(){r.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=c.observable(null),this.clearingProcess=c.observable(!1),this.clearingError=c.observable(""),this.folderFullNameForClear=c.computed(function(){var a=this.selectedFolder();return a?a.printableFullName():""},this),this.folderNameForClear=c.computed(function(){var a=this.selectedFolder();return a?a.localName():""},this),this.dangerDescHtml=c.computed(function(){return Fb.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=Fb.createCommand(this,function(){var a=this,b=this.selectedFolder();b&&(Sb.data().message(null),Sb.data().messageList([]),this.clearingProcess(!0),Sb.cache().setFolderHash(b.fullNameRaw,""),Sb.remote().folderClear(function(b,c){a.clearingProcess(!1),Db.StorageResultType.Success===b&&c&&c.Result?(Sb.reloadMessageList(!0),a.cancelCommand()):c&&c.ErrorCode?a.clearingError(Fb.getNotification(c.ErrorCode)):a.clearingError(Fb.getNotification(Db.Notification.MailServerError))},b.fullNameRaw))},function(){var a=this.selectedFolder(),b=this.clearingProcess();return!b&&null!==a}),t.constructorEnd(this)}function I(){r.call(this,"Popups","PopupsFolderCreate"),Fb.initOnStartOrLangChange(function(){this.sNoParentText=Fb.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=c.observable(""),this.folderName.focused=c.observable(!1),this.selectedParentValue=c.observable(Cb.Values.UnuseOptionValue),this.parentFolderSelectList=c.computed(function(){var a=Sb.data(),b=[],c=null,d=null,e=a.folderList(),f=function(a){return a?a.isSystemFolder()?a.name()+" "+a.manageFolderSystemName():a.name():""};return b.push(["",this.sNoParentText]),""!==a.namespace&&(c=function(b){return a.namespace!==b.fullNameRaw.substr(0,a.namespace.length)}),Sb.folderListOptionsBuilder([],e,[],b,null,c,d,f)},this),this.createFolder=Fb.createCommand(this,function(){var a=Sb.data(),b=this.selectedParentValue();""===b&&1=a?1:a},this),this.contactsPagenator=c.computed(Fb.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=c.observable(!0),this.viewClearSearch=c.observable(!1),this.viewID=c.observable(""),this.viewReadOnly=c.observable(!1),this.viewProperties=c.observableArray([]),this.viewTags=c.observable(""),this.viewTags.visibility=c.observable(!1),this.viewTags.focusTrigger=c.observable(!1),this.viewTags.focusTrigger.subscribe(function(a){a||""!==this.viewTags()?a&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=c.observable(Db.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(a){return-1a)break;b[0]&&b[1]&&b[2]&&b[1]===b[2]&&("PRIVATE"===b[1]?e.privateKeys.importKey(b[0]):"PUBLIC"===b[1]&&e.publicKeys.importKey(b[0])),a--}return e.store(),Sb.reloadOpenPgpKeys(),Fb.delegateRun(this,"cancelCommand"),!0}),t.constructorEnd(this)}function P(){r.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=c.observable(""),this.keyDom=c.observable(null),t.constructorEnd(this)}function Q(){r.call(this,"Popups","PopupsGenerateNewOpenPgpKey"),this.email=c.observable(""),this.email.focus=c.observable(""),this.email.error=c.observable(!1),this.name=c.observable(""),this.password=c.observable(""),this.keyBitLength=c.observable(2048),this.submitRequest=c.observable(!1),this.email.subscribe(function(){this.email.error(!1)},this),this.generateOpenPgpKeyCommand=Fb.createCommand(this,function(){var b=this,c="",d=null,e=Sb.data().openpgpKeyring;return this.email.error(""===Fb.trim(this.email())),!e||this.email.error()?!1:(c=this.email(),""!==this.name()&&(c=this.name()+" <"+c+">"),this.submitRequest(!0),h.delay(function(){d=a.openpgp.generateKeyPair(1,Fb.pInt(b.keyBitLength()),c,Fb.trim(b.password())),d&&d.privateKeyArmored&&(e.privateKeys.importKey(d.privateKeyArmored),e.publicKeys.importKey(d.publicKeyArmored),e.store(),Sb.reloadOpenPgpKeys(),Fb.delegateRun(b,"cancelCommand")),b.submitRequest(!1)},100),!0)}),t.constructorEnd(this)}function R(){r.call(this,"Popups","PopupsComposeOpenPgp"),this.notification=c.observable(""),this.sign=c.observable(!0),this.encrypt=c.observable(!0),this.password=c.observable(""),this.password.focus=c.observable(!1),this.buttonFocus=c.observable(!1),this.from=c.observable(""),this.to=c.observableArray([]),this.text=c.observable(""),this.resultCallback=null,this.submitRequest=c.observable(!1),this.doCommand=Fb.createCommand(this,function(){var b=this,c=!0,d=Sb.data(),e=null,f=[];this.submitRequest(!0),c&&this.sign()&&""===this.from()&&(this.notification(Fb.i18n("PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL")),c=!1),c&&this.sign()&&(e=d.findPrivateKeyByEmail(this.from(),this.password()),e||(this.notification(Fb.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR",{EMAIL:this.from()})),c=!1)),c&&this.encrypt()&&0===this.to().length&&(this.notification(Fb.i18n("PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT")),c=!1),c&&this.encrypt()&&(f=[],h.each(this.to(),function(a){var e=d.findPublicKeysByEmail(a);0===e.length&&c&&(b.notification(Fb.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR",{EMAIL:a})),c=!1),f=f.concat(e)}),!c||0!==f.length&&this.to().length===f.length||(c=!1)),h.delay(function(){if(b.resultCallback&&c)try{e&&0===f.length?b.resultCallback(a.openpgp.signClearMessage([e],b.text())):e&&00&&b>0&&a>b},this),this.hasMessages=c.computed(function(){return 0'),e.after(f),e.remove()),f&&f[0]&&(f.attr("data-href",g).attr("data-theme",a[0]),f&&f[0]&&f[0].styleSheet&&!Fb.isUnd(f[0].styleSheet.cssText)?f[0].styleSheet.cssText=a[1]:f.text(a[1])),d.themeTrigger(Db.SaveSettingsStep.TrueResult))}).always(function(){d.iTimer=a.setTimeout(function(){d.themeTrigger(Db.SaveSettingsStep.Idle)},1e3),d.oLastAjax=null})),Sb.remote().saveSettings(null,{Theme:c})},this)}function pb(){this.openpgpkeys=Sb.data().openpgpkeys,this.openpgpkeysPublic=Sb.data().openpgpkeysPublic,this.openpgpkeysPrivate=Sb.data().openpgpkeysPrivate,this.openPgpKeyForDeletion=c.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(a){a&&a.deleteAccess(!1)},function(a){a&&a.deleteAccess(!0)}]})}function qb(){this.leftPanelDisabled=c.observable(!1),this.useKeyboardShortcuts=c.observable(!0),this.keyScopeReal=c.observable(Db.KeyState.All),this.keyScopeFake=c.observable(Db.KeyState.All),this.keyScope=c.computed({owner:this,read:function(){return this.keyScopeFake()},write:function(a){Db.KeyState.Menu!==a&&(Db.KeyState.Compose===a?Fb.disableKeyFilter():Fb.restoreKeyFilter(),this.keyScopeFake(a),Ib.dropdownVisibility()&&(a=Db.KeyState.Menu)),this.keyScopeReal(a)}}),this.keyScopeReal.subscribe(function(a){j.setScope(a)}),this.leftPanelDisabled.subscribe(function(a){Sb.pub("left-panel."+(a?"off":"on"))}),Ib.dropdownVisibility.subscribe(function(a){a?(Ib.tooltipTrigger(!Ib.tooltipTrigger()),this.keyScope(Db.KeyState.Menu)):Db.KeyState.Menu===j.getScope()&&this.keyScope(this.keyScopeFake())},this),Fb.initDataConstructorBySettings(this)}function rb(){qb.call(this);var d=function(a){return function(){var b=Sb.cache().getFolderFromCacheList(a());b&&b.type(Db.FolderType.User)}},e=function(a){return function(b){var c=Sb.cache().getFolderFromCacheList(b);c&&c.type(a)}};this.devEmail="",this.devLogin="",this.devPassword="",this.accountEmail=c.observable(""),this.accountIncLogin=c.observable(""),this.accountOutLogin=c.observable(""),this.projectHash=c.observable(""),this.threading=c.observable(!1),this.lastFoldersHash="",this.remoteSuggestions=!1,this.sentFolder=c.observable(""),this.draftFolder=c.observable(""),this.spamFolder=c.observable(""),this.trashFolder=c.observable(""),this.archiveFolder=c.observable(""),this.sentFolder.subscribe(d(this.sentFolder),this,"beforeChange"),this.draftFolder.subscribe(d(this.draftFolder),this,"beforeChange"),this.spamFolder.subscribe(d(this.spamFolder),this,"beforeChange"),this.trashFolder.subscribe(d(this.trashFolder),this,"beforeChange"),this.archiveFolder.subscribe(d(this.archiveFolder),this,"beforeChange"),this.sentFolder.subscribe(e(Db.FolderType.SentItems),this),this.draftFolder.subscribe(e(Db.FolderType.Draft),this),this.spamFolder.subscribe(e(Db.FolderType.Spam),this),this.trashFolder.subscribe(e(Db.FolderType.Trash),this),this.archiveFolder.subscribe(e(Db.FolderType.Archive),this),this.draftFolderNotEnabled=c.computed(function(){return""===this.draftFolder()||Cb.Values.UnuseOptionValue===this.draftFolder()},this),this.displayName=c.observable(""),this.signature=c.observable(""),this.signatureToAll=c.observable(!1),this.replyTo=c.observable(""),this.enableTwoFactor=c.observable(!1),this.accounts=c.observableArray([]),this.accountsLoading=c.observable(!1).extend({throttle:100}),this.identities=c.observableArray([]),this.identitiesLoading=c.observable(!1).extend({throttle:100}),this.contactTags=c.observableArray([]),this.contacts=c.observableArray([]),this.contacts.loading=c.observable(!1).extend({throttle:200}),this.contacts.importing=c.observable(!1).extend({throttle:200}),this.contacts.syncing=c.observable(!1).extend({throttle:200}),this.contacts.exportingVcf=c.observable(!1).extend({throttle:200}),this.contacts.exportingCsv=c.observable(!1).extend({throttle:200}),this.allowContactsSync=c.observable(!1),this.enableContactsSync=c.observable(!1),this.contactsSyncUrl=c.observable(""),this.contactsSyncUser=c.observable(""),this.contactsSyncPass=c.observable(""),this.allowContactsSync=c.observable(!!Sb.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync=c.observable(!!Sb.settingsGet("EnableContactsSync")),this.contactsSyncUrl=c.observable(Sb.settingsGet("ContactsSyncUrl")),this.contactsSyncUser=c.observable(Sb.settingsGet("ContactsSyncUser")),this.contactsSyncPass=c.observable(Sb.settingsGet("ContactsSyncPassword")),this.namespace="",this.folderList=c.observableArray([]),this.folderList.focused=c.observable(!1),this.foldersListError=c.observable(""),this.foldersLoading=c.observable(!1),this.foldersCreating=c.observable(!1),this.foldersDeleting=c.observable(!1),this.foldersRenaming=c.observable(!1),this.foldersChanging=c.computed(function(){var a=this.foldersLoading(),b=this.foldersCreating(),c=this.foldersDeleting(),d=this.foldersRenaming();return a||b||c||d},this),this.foldersInboxUnreadCount=c.observable(0),this.currentFolder=c.observable(null).extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]}),this.currentFolderFullNameRaw=c.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=c.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=c.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=c.computed(function(){return this.currentFolder()?this.currentFolder().name():"" -},this),this.folderListSystemNames=c.computed(function(){var a=["INBOX"],b=this.folderList(),c=this.sentFolder(),d=this.draftFolder(),e=this.spamFolder(),f=this.trashFolder(),g=this.archiveFolder();return Fb.isArray(b)&&0=a?1:a},this),this.mainMessageListSearch=c.computed({read:this.messageListSearch,write:function(a){Lb.setHash(Sb.link().mailBox(this.currentFolderFullNameHash(),1,Fb.trim(a.toString())))},owner:this}),this.messageListError=c.observable(""),this.messageListLoading=c.observable(!1),this.messageListIsNotCompleted=c.observable(!1),this.messageListCompleteLoadingThrottle=c.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=c.computed(function(){var a=this.messageListLoading(),b=this.messageListIsNotCompleted();return a||b},this),this.messageListCompleteLoading.subscribe(function(a){this.messageListCompleteLoadingThrottle(a)},this),this.messageList.subscribe(h.debounce(function(a){h.each(a,function(a){a.newForAnimation()&&a.newForAnimation(!1)})},500)),this.staticMessageList=new A,this.message=c.observable(null),this.messageLoading=c.observable(!1),this.messageLoadingThrottle=c.observable(!1).extend({throttle:50}),this.message.focused=c.observable(!1),this.message.subscribe(function(b){b?Db.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.hideMessageBodies(),Db.Layout.NoPreview===Sb.data().layout()&&-10?Math.ceil(b/a*100):0},this),this.capaOpenPGP=c.observable(!1),this.openpgpkeys=c.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(a){return!(!a||a.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(a){return!(!a||!a.isPrivate)}),this.googleActions=c.observable(!1),this.googleLoggined=c.observable(!1),this.googleUserName=c.observable(""),this.facebookActions=c.observable(!1),this.facebookLoggined=c.observable(!1),this.facebookUserName=c.observable(""),this.twitterActions=c.observable(!1),this.twitterLoggined=c.observable(!1),this.twitterUserName=c.observable(""),this.customThemeType=c.observable(Db.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=h.throttle(this.purgeMessageBodyCache,3e4)}function sb(){this.oRequests={}}function tb(){sb.call(this),this.oRequests={}}function ub(){this.oEmailsPicsHashes={},this.oServices={},this.bCapaGravatar=Sb.capa(Db.Capa.Gravatar)}function vb(){ub.call(this),this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={}}function wb(a){s.call(this,"settings",a),this.menu=c.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}function xb(){s.call(this,"login",[X])}function yb(){s.call(this,"mailbox",[Z,_,ab,bb]),this.oLastRoute={}}function zb(){wb.call(this,[$,cb,db]),Fb.initOnStartOrLangChange(function(){this.sSettingsTitle=Fb.i18n("TITLES/SETTINGS")},this,function(){Sb.setTitle(this.sSettingsTitle)})}function Ab(){q.call(this),this.oSettings=null,this.oPlugins=null,this.oLocal=null,this.oLink=null,this.oSubs={},this.isLocalAutocomplete=!0,this.popupVisibilityNames=c.observableArray([]),this.popupVisibility=c.computed(function(){return 0').appendTo("body"),Pb.on("error",function(a){Sb&&a&&a.originalEvent&&a.originalEvent.message&&-1===Fb.inArray(a.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&Sb.remote().jsError(Fb.emptyFunction,a.originalEvent.message,a.originalEvent.filename,a.originalEvent.lineno,location&&location.toString?location.toString():"",Ob.attr("class"),Fb.microtime()-Ib.now)}),Qb.on("keydown",function(a){a&&a.ctrlKey&&Ob.addClass("rl-ctrl-key-pressed")}).on("keyup",function(a){a&&!a.ctrlKey&&Ob.removeClass("rl-ctrl-key-pressed")})}function Bb(){Ab.call(this),this.oData=null,this.oRemote=null,this.oCache=null,this.oMoveCache={},this.quotaDebounce=h.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=h.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=h.debounce(this.messagesMoveTrigger,500),a.setInterval(function(){Sb.pub("interval.30s")},3e4),a.setInterval(function(){Sb.pub("interval.1m")},6e4),a.setInterval(function(){Sb.pub("interval.2m")},12e4),a.setInterval(function(){Sb.pub("interval.3m")},18e4),a.setInterval(function(){Sb.pub("interval.5m")},3e5),a.setInterval(function(){Sb.pub("interval.10m")},6e5),a.setTimeout(function(){a.setInterval(function(){Sb.pub("interval.10m-after5m")},6e5)},3e5),b.wakeUp(function(){Sb.remote().jsVersion(function(b,c){Db.StorageResultType.Success===b&&c&&!c.Result&&(a.parent&&Sb.settingsGet("InIframe")?a.parent.location.reload():a.location.reload())},Sb.settingsGet("Version"))},{},36e5)}var Cb={},Db={},Eb={},Fb={},Gb={},Hb={},Ib={},Jb={settings:[],"settings-removed":[],"settings-disabled":[]},Kb=[],Lb=null,Mb=a.rainloopAppData||{},Nb=a.rainloopI18N||{},Ob=b("html"),Pb=b(a),Qb=b(a.document),Rb=a.Notification&&a.Notification.requestPermission?a.Notification:null,Sb=null,Tb=b("
");Ib.now=(new Date).getTime(),Ib.momentTrigger=c.observable(!0),Ib.dropdownVisibility=c.observable(!1).extend({rateLimit:0}),Ib.tooltipTrigger=c.observable(!1).extend({rateLimit:0}),Ib.langChangeTrigger=c.observable(!0),Ib.iAjaxErrorCount=0,Ib.iTokenErrorCount=0,Ib.iMessageBodyCacheCount=0,Ib.bUnload=!1,Ib.sUserAgent=(navigator.userAgent||"").toLowerCase(),Ib.bIsiOSDevice=-1/g,">").replace(/"/g,""").replace(/'/g,"'"):""},Fb.splitPlainText=function(a,b){var c="",d="",e=a,f=0,g=0;for(b=Fb.isUnd(b)?100:b;e.length>b;)d=e.substring(0,b),f=d.lastIndexOf(" "),g=d.lastIndexOf("\n"),-1!==g&&(f=g),-1===f&&(f=b),c+=d.substring(0,f)+"\n",e=e.substring(f+1);return c+e},Fb.timeOutAction=function(){var b={};return function(c,d,e){Fb.isUnd(b[c])&&(b[c]=0),a.clearTimeout(b[c]),b[c]=a.setTimeout(d,e)}}(),Fb.timeOutActionSecond=function(){var b={};return function(c,d,e){b[c]||(b[c]=a.setTimeout(function(){d(),b[c]=0},e))}}(),Fb.audio=function(){var b=!1;return function(c,d){if(!1===b)if(Ib.bIsiOSDevice)b=null;else{var e=!1,f=!1,g=a.Audio?new a.Audio:null;g&&g.canPlayType&&g.play?(e=""!==g.canPlayType('audio/mpeg; codecs="mp3"'),e||(f=""!==g.canPlayType('audio/ogg; codecs="vorbis"')),e||f?(b=g,b.preload="none",b.loop=!1,b.autoplay=!1,b.muted=!1,b.src=e?c:d):b=null):b=null}return b}}(),Fb.hos=function(a,b){return a&&Object.hasOwnProperty?Object.hasOwnProperty.call(a,b):!1},Fb.i18n=function(a,b,c){var d="",e=Fb.isUnd(Nb[a])?Fb.isUnd(c)?a:c:Nb[a];if(!Fb.isUnd(b)&&!Fb.isNull(b))for(d in b)Fb.hos(b,d)&&(e=e.replace("%"+d+"%",b[d]));return e},Fb.i18nToNode=function(a){h.defer(function(){b(".i18n",a).each(function(){var a=b(this),c="";c=a.data("i18n-text"),c?a.text(Fb.i18n(c)):(c=a.data("i18n-html"),c&&a.html(Fb.i18n(c)),c=a.data("i18n-placeholder"),c&&a.attr("placeholder",Fb.i18n(c)),c=a.data("i18n-title"),c&&a.attr("title",Fb.i18n(c)))})})},Fb.i18nToDoc=function(){a.rainloopI18N&&(Nb=a.rainloopI18N||{},Fb.i18nToNode(Qb),Ib.langChangeTrigger(!Ib.langChangeTrigger())),a.rainloopI18N={}},Fb.initOnStartOrLangChange=function(a,b,c){a&&a.call(b),c?Ib.langChangeTrigger.subscribe(function(){a&&a.call(b),c.call(b)}):a&&Ib.langChangeTrigger.subscribe(a,b)},Fb.inFocus=function(){return document.activeElement?(Fb.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=b(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},Fb.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var a=b(document.activeElement);a.is("input,textarea")&&document.activeElement.blur()}},Fb.removeSelection=function(){if(a&&a.getSelection){var b=a.getSelection();b&&b.removeAllRanges&&b.removeAllRanges()}else document&&document.selection&&document.selection.empty&&document.selection.empty()},Fb.replySubjectAdd=function(b,c,d){var e=null,f=Fb.trim(c);return f=null===(e=new a.RegExp("^"+b+"[\\s]?\\:(.*)$","gi").exec(c))||Fb.isUnd(e[1])?null===(e=new a.RegExp("^("+b+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(c))||Fb.isUnd(e[1])||Fb.isUnd(e[2])||Fb.isUnd(e[3])?b+": "+c:e[1]+(Fb.pInt(e[2])+1)+e[3]:b+"[2]: "+e[1],f=f.replace(/[\s]+/g," "),f=(Fb.isUnd(d)?!0:d)?Fb.fixLongSubject(f):f},Fb.fixLongSubject=function(a){var b=0,c=null;a=Fb.trim(a.replace(/[\s]+/," "));do c=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(a),(!c||Fb.isUnd(c[0]))&&(c=null),c&&(b=0,b+=Fb.isUnd(c[2])?1:0+Fb.pInt(c[2]),b+=Fb.isUnd(c[4])?1:0+Fb.pInt(c[4]),a=a.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(b>0?"["+b+"]":"")+":"));while(c);return a=a.replace(/[\s]+/," ")},Fb.roundNumber=function(a,b){return Math.round(a*Math.pow(10,b))/Math.pow(10,b)},Fb.friendlySize=function(a){return a=Fb.pInt(a),a>=1073741824?Fb.roundNumber(a/1073741824,1)+"GB":a>=1048576?Fb.roundNumber(a/1048576,1)+"MB":a>=1024?Fb.roundNumber(a/1024,0)+"KB":a+"B"},Fb.log=function(b){a.console&&a.console.log&&a.console.log(b)},Fb.getNotification=function(a,b){return a=Fb.pInt(a),Db.Notification.ClientViewError===a&&b?b:Fb.isUnd(Eb[a])?"":Eb[a]},Fb.initNotificationLanguage=function(){Eb[Db.Notification.InvalidToken]=Fb.i18n("NOTIFICATIONS/INVALID_TOKEN"),Eb[Db.Notification.AuthError]=Fb.i18n("NOTIFICATIONS/AUTH_ERROR"),Eb[Db.Notification.AccessError]=Fb.i18n("NOTIFICATIONS/ACCESS_ERROR"),Eb[Db.Notification.ConnectionError]=Fb.i18n("NOTIFICATIONS/CONNECTION_ERROR"),Eb[Db.Notification.CaptchaError]=Fb.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),Eb[Db.Notification.SocialFacebookLoginAccessDisable]=Fb.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),Eb[Db.Notification.SocialTwitterLoginAccessDisable]=Fb.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),Eb[Db.Notification.SocialGoogleLoginAccessDisable]=Fb.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),Eb[Db.Notification.DomainNotAllowed]=Fb.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),Eb[Db.Notification.AccountNotAllowed]=Fb.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),Eb[Db.Notification.AccountTwoFactorAuthRequired]=Fb.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),Eb[Db.Notification.AccountTwoFactorAuthError]=Fb.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),Eb[Db.Notification.CouldNotSaveNewPassword]=Fb.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),Eb[Db.Notification.CurrentPasswordIncorrect]=Fb.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),Eb[Db.Notification.NewPasswordShort]=Fb.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),Eb[Db.Notification.NewPasswordWeak]=Fb.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),Eb[Db.Notification.NewPasswordForbidden]=Fb.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),Eb[Db.Notification.ContactsSyncError]=Fb.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),Eb[Db.Notification.CantGetMessageList]=Fb.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),Eb[Db.Notification.CantGetMessage]=Fb.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),Eb[Db.Notification.CantDeleteMessage]=Fb.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),Eb[Db.Notification.CantMoveMessage]=Fb.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Eb[Db.Notification.CantCopyMessage]=Fb.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),Eb[Db.Notification.CantSaveMessage]=Fb.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),Eb[Db.Notification.CantSendMessage]=Fb.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),Eb[Db.Notification.InvalidRecipients]=Fb.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),Eb[Db.Notification.CantCreateFolder]=Fb.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),Eb[Db.Notification.CantRenameFolder]=Fb.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),Eb[Db.Notification.CantDeleteFolder]=Fb.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),Eb[Db.Notification.CantDeleteNonEmptyFolder]=Fb.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),Eb[Db.Notification.CantSubscribeFolder]=Fb.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),Eb[Db.Notification.CantUnsubscribeFolder]=Fb.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),Eb[Db.Notification.CantSaveSettings]=Fb.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),Eb[Db.Notification.CantSavePluginSettings]=Fb.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),Eb[Db.Notification.DomainAlreadyExists]=Fb.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),Eb[Db.Notification.CantInstallPackage]=Fb.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),Eb[Db.Notification.CantDeletePackage]=Fb.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),Eb[Db.Notification.InvalidPluginPackage]=Fb.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),Eb[Db.Notification.UnsupportedPluginPackage]=Fb.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),Eb[Db.Notification.LicensingServerIsUnavailable]=Fb.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),Eb[Db.Notification.LicensingExpired]=Fb.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),Eb[Db.Notification.LicensingBanned]=Fb.i18n("NOTIFICATIONS/LICENSING_BANNED"),Eb[Db.Notification.DemoSendMessageError]=Fb.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),Eb[Db.Notification.AccountAlreadyExists]=Fb.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),Eb[Db.Notification.MailServerError]=Fb.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),Eb[Db.Notification.UnknownNotification]=Fb.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),Eb[Db.Notification.UnknownError]=Fb.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},Fb.getUploadErrorDescByCode=function(a){var b="";switch(Fb.pInt(a)){case Db.UploadErrorCode.FileIsTooBig:b=Fb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case Db.UploadErrorCode.FilePartiallyUploaded:b=Fb.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case Db.UploadErrorCode.FileNoUploaded:b=Fb.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case Db.UploadErrorCode.MissingTempFolder:b=Fb.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case Db.UploadErrorCode.FileOnSaveingError:b=Fb.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case Db.UploadErrorCode.FileType:b=Fb.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:b=Fb.i18n("UPLOAD/ERROR_UNKNOWN")}return b},Fb.delegateRun=function(a,b,c,d){a&&a[b]&&(d=Fb.pInt(d),0>=d?a[b].apply(a,Fb.isArray(c)?c:[]):h.delay(function(){a[b].apply(a,Fb.isArray(c)?c:[])},d))},Fb.killCtrlAandS=function(b){if(b=b||a.event,b&&b.ctrlKey&&!b.shiftKey&&!b.altKey){var c=b.target||b.srcElement,d=b.keyCode||b.which;if(d===Db.EventKeyCode.S)return b.preventDefault(),void 0;if(c&&c.tagName&&c.tagName.match(/INPUT|TEXTAREA/i))return;d===Db.EventKeyCode.A&&(a.getSelection?a.getSelection().removeAllRanges():a.document.selection&&a.document.selection.clear&&a.document.selection.clear(),b.preventDefault())}},Fb.createCommand=function(a,b,d){var e=b?function(){return e.canExecute&&e.canExecute()&&b.apply(a,Array.prototype.slice.call(arguments)),!1}:function(){};return e.enabled=c.observable(!0),d=Fb.isUnd(d)?!0:d,e.canExecute=Fb.isFunc(d)?c.computed(function(){return e.enabled()&&d.call(a)}):c.computed(function(){return e.enabled()&&!!d}),e},Fb.initDataConstructorBySettings=function(b){b.editorDefaultType=c.observable(Db.EditorDefaultType.Html),b.showImages=c.observable(!1),b.interfaceAnimation=c.observable(Db.InterfaceAnimation.Full),b.contactsAutosave=c.observable(!1),Ib.sAnimationType=Db.InterfaceAnimation.Full,b.capaThemes=c.observable(!1),b.allowCustomLogin=c.observable(!1),b.allowLanguagesOnSettings=c.observable(!0),b.allowLanguagesOnLogin=c.observable(!0),b.desktopNotifications=c.observable(!1),b.useThreads=c.observable(!0),b.replySameFolder=c.observable(!0),b.useCheckboxesInList=c.observable(!0),b.layout=c.observable(Db.Layout.SidePreview),b.usePreviewPane=c.computed(function(){return Db.Layout.NoPreview!==b.layout()}),b.interfaceAnimation.subscribe(function(a){if(Ib.bMobileDevice||a===Db.InterfaceAnimation.None)Ob.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),Ib.sAnimationType=Db.InterfaceAnimation.None;else switch(a){case Db.InterfaceAnimation.Full:Ob.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),Ib.sAnimationType=a;break;case Db.InterfaceAnimation.Normal:Ob.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),Ib.sAnimationType=a}}),b.interfaceAnimation.valueHasMutated(),b.desktopNotificationsPermisions=c.computed(function(){b.desktopNotifications();var c=Db.DesktopNotifications.NotSupported;if(Rb&&Rb.permission)switch(Rb.permission.toLowerCase()){case"granted":c=Db.DesktopNotifications.Allowed;break;case"denied":c=Db.DesktopNotifications.Denied;break;case"default":c=Db.DesktopNotifications.NotAllowed}else a.webkitNotifications&&a.webkitNotifications.checkPermission&&(c=a.webkitNotifications.checkPermission());return c}),b.useDesktopNotifications=c.computed({read:function(){return b.desktopNotifications()&&Db.DesktopNotifications.Allowed===b.desktopNotificationsPermisions()},write:function(a){if(a){var c=b.desktopNotificationsPermisions();Db.DesktopNotifications.Allowed===c?b.desktopNotifications(!0):Db.DesktopNotifications.NotAllowed===c?Rb.requestPermission(function(){b.desktopNotifications.valueHasMutated(),Db.DesktopNotifications.Allowed===b.desktopNotificationsPermisions()?b.desktopNotifications()?b.desktopNotifications.valueHasMutated():b.desktopNotifications(!0):b.desktopNotifications()?b.desktopNotifications(!1):b.desktopNotifications.valueHasMutated()}):b.desktopNotifications(!1)}else b.desktopNotifications(!1)}}),b.language=c.observable(""),b.languages=c.observableArray([]),b.mainLanguage=c.computed({read:b.language,write:function(a){a!==b.language()?-1=b.diff(c,"hours")?d:b.format("L")===c.format("L")?Fb.i18n("MESSAGE_LIST/TODAY_AT",{TIME:c.format("LT")}):b.clone().subtract("days",1).format("L")===c.format("L")?Fb.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:c.format("LT")}):b.year()===c.year()?c.format("D MMM."):c.format("LL")},a)},Fb.isFolderExpanded=function(a){var b=Sb.local().get(Db.ClientSideKeyName.ExpandedFolders);return h.isArray(b)&&-1!==h.indexOf(b,a)},Fb.setExpandedFolder=function(a,b){var c=Sb.local().get(Db.ClientSideKeyName.ExpandedFolders);h.isArray(c)||(c=[]),b?(c.push(a),c=h.uniq(c)):c=h.without(c,a),Sb.local().set(Db.ClientSideKeyName.ExpandedFolders,c)},Fb.initLayoutResizer=function(a,c,d){var e=60,f=155,g=b(a),h=b(c),i=Sb.local().get(d)||null,j=function(a){a&&(g.css({width:""+a+"px"}),h.css({left:""+a+"px"}))},k=function(a){if(a)g.resizable("disable"),j(e);else{g.resizable("enable");var b=Fb.pInt(Sb.local().get(d))||f;j(b>f?b:f)}},l=function(a,b){b&&b.size&&b.size.width&&(Sb.local().set(d,b.size.width),h.css({left:""+b.size.width+"px"}))};null!==i&&j(i>f?i:f),g.resizable({helper:"ui-resizable-helper",minWidth:f,maxWidth:350,handles:"e",stop:l}),Sb.sub("left-panel.off",function(){k(!0)}),Sb.sub("left-panel.on",function(){k(!1)})},Fb.initBlockquoteSwitcher=function(a){if(a){var c=b("blockquote:not(.rl-bq-switcher)",a).filter(function(){return 0===b(this).parent().closest("blockquote",a).length});c&&0100)&&(a.addClass("rl-bq-switcher hidden-bq"),b('').insertBefore(a).click(function(){a.toggleClass("hidden-bq"),Fb.windowResize()}).after("
").before("
"))})}},Fb.removeBlockquoteSwitcher=function(a){a&&(b(a).find("blockquote.rl-bq-switcher").each(function(){b(this).removeClass("rl-bq-switcher hidden-bq")}),b(a).find(".rlBlockquoteSwitcher").each(function(){b(this).remove()}))},Fb.toggleMessageBlockquote=function(a){a&&a.find(".rlBlockquoteSwitcher").click()},Fb.extendAsViewModel=function(a,b,c){b&&(c||(c=r),b.__name=a,Gb.regViewModelHook(a,b),h.extend(b.prototype,c.prototype))},Fb.addSettingsViewModel=function(a,b,c,d,e){a.__rlSettingsData={Label:c,Template:b,Route:d,IsDefault:!!e},Jb.settings.push(a)},Fb.removeSettingsViewModel=function(a){Jb["settings-removed"].push(a)},Fb.disableSettingsViewModel=function(a){Jb["settings-disabled"].push(a)},Fb.convertThemeName=function(a){return"@custom"===a.substr(-7)&&(a=Fb.trim(a.substring(0,a.length-7))),Fb.trim(a.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," ")) -},Fb.quoteName=function(a){return a.replace(/["]/g,'\\"')},Fb.microtime=function(){return(new Date).getTime()},Fb.convertLangName=function(a,b){return Fb.i18n("LANGS_NAMES"+(!0===b?"_EN":"")+"/LANG_"+a.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,a)},Fb.fakeMd5=function(a){var b="",c="0123456789abcdefghijklmnopqrstuvwxyz";for(a=Fb.isUnd(a)?32:Fb.pInt(a);b.length>>32-b}function c(a,b){var c,d,e,f,g;return e=2147483648&a,f=2147483648&b,c=1073741824&a,d=1073741824&b,g=(1073741823&a)+(1073741823&b),c&d?2147483648^g^e^f:c|d?1073741824&g?3221225472^g^e^f:1073741824^g^e^f:g^e^f}function d(a,b,c){return a&b|~a&c}function e(a,b,c){return a&c|b&~c}function f(a,b,c){return a^b^c}function g(a,b,c){return b^(a|~c)}function h(a,e,f,g,h,i,j){return a=c(a,c(c(d(e,f,g),h),j)),c(b(a,i),e)}function i(a,d,f,g,h,i,j){return a=c(a,c(c(e(d,f,g),h),j)),c(b(a,i),d)}function j(a,d,e,g,h,i,j){return a=c(a,c(c(f(d,e,g),h),j)),c(b(a,i),d)}function k(a,d,e,f,h,i,j){return a=c(a,c(c(g(d,e,f),h),j)),c(b(a,i),d)}function l(a){for(var b,c=a.length,d=c+8,e=(d-d%64)/64,f=16*(e+1),g=Array(f-1),h=0,i=0;c>i;)b=(i-i%4)/4,h=i%4*8,g[b]=g[b]|a.charCodeAt(i)<>>29,g}function m(a){var b,c,d="",e="";for(c=0;3>=c;c++)b=a>>>8*c&255,e="0"+b.toString(16),d+=e.substr(e.length-2,2);return d}function n(a){a=a.replace(/rn/g,"n");for(var b="",c=0;cd?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b}var o,p,q,r,s,t,u,v,w,x=Array(),y=7,z=12,A=17,B=22,C=5,D=9,E=14,F=20,G=4,H=11,I=16,J=23,K=6,L=10,M=15,N=21;for(a=n(a),x=l(a),t=1732584193,u=4023233417,v=2562383102,w=271733878,o=0;o/g,">").replace(/")},Fb.draggeblePlace=function(){return b('
 
').appendTo("#rl-hidden")},Fb.defautOptionsAfterRender=function(a,c){c&&!Fb.isUnd(c.disabled)&&a&&b(a).toggleClass("disabled",c.disabled).prop("disabled",c.disabled)},Fb.windowPopupKnockout=function(c,d,e,f){var g=null,h=a.open(""),i="__OpenerApplyBindingsUid"+Fb.fakeMd5()+"__",j=b("#"+d);a[i]=function(){if(h&&h.document.body&&j&&j[0]){var d=b(h.document.body);b("#rl-content",d).html(j.html()),b("html",h.document).addClass("external "+b("html").attr("class")),Fb.i18nToNode(d),t.prototype.applyExternal(c,b("#rl-content",d)[0]),a[i]=null,f(h)}},h.document.open(),h.document.write(''+Fb.encodeHtml(e)+'
'),h.document.close(),g=h.document.createElement("script"),g.type="text/javascript",g.innerHTML="if(window&&window.opener&&window.opener['"+i+"']){window.opener['"+i+"']();window.opener['"+i+"']=null}",h.document.getElementsByTagName("head")[0].appendChild(g)},Fb.settingsSaveHelperFunction=function(a,b,c,d){return c=c||null,d=Fb.isUnd(d)?1e3:Fb.pInt(d),function(e,f,g,i,j){b.call(c,f&&f.Result?Db.SaveSettingsStep.TrueResult:Db.SaveSettingsStep.FalseResult),a&&a.call(c,e,f,g,i,j),h.delay(function(){b.call(c,Db.SaveSettingsStep.Idle)},d)}},Fb.settingsSaveHelperSimpleFunction=function(a,b){return Fb.settingsSaveHelperFunction(null,a,b,1e3)},Fb.htmlToPlain=function(a){var c="",d="> ",e=function(){if(arguments&&1\n",a.replace(/\n([> ]+)/gm,function(){return arguments&&1]*>(.|[\s\S\r\n]*)<\/div>/gim,f),a="\n"+b.trim(a)+"\n"),a}return""},g=function(){return arguments&&1/g,">"):""},h=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,f).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>(.|[\s\S\r\n]*)<\/a>/gim,h).replace(/ /gi," ").replace(/<[^>]*>/gm,"").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&").replace(/&\w{2,6};/gi,""),c.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/__bq__start__(.|[\s\S\r\n]*)__bq__end__/gm,e).replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},Fb.plainToHtml=function(a){return a.toString().replace(/&/g,"&").replace(/>/g,">").replace(/")},Fb.resizeAndCrop=function(b,c,d){var e=new a.Image;e.onload=function(){var a=[0,0],b=document.createElement("canvas"),e=b.getContext("2d");b.width=c,b.height=c,a=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],e.fillStyle="#fff",e.fillRect(0,0,c,c),e.drawImage(this,a[0]/2,a[1]/2,this.width-a[0],this.height-a[1],0,0,c,c),d(b.toDataURL("image/jpeg"))},e.src=b},Fb.computedPagenatorHelper=function(a,b){return function(){var c=0,d=0,e=2,f=[],g=a(),h=b(),i=function(a,b,c){var d={current:a===g,name:Fb.isUnd(c)?a.toString():c.toString(),custom:Fb.isUnd(c)?!1:!0,title:Fb.isUnd(c)?"":a.toString(),value:a.toString()};(Fb.isUnd(b)?0:!b)?f.unshift(d):f.push(d)};if(h>1||h>0&&g>h){for(g>h?(i(h),c=h,d=h):((3>=g||g>=h-2)&&(e+=2),i(g),c=g,d=g);e>0;)if(c-=1,d+=1,c>0&&(i(c,!1),e--),h>=d)i(d,!0),e--;else if(0>=c)break;3===c?i(2,!1):c>3&&i(Math.round((c-1)/2),!1,"..."),h-2===d?i(h-1,!0):h-2>d&&i(Math.round((h+d)/2),!0,"..."),c>1&&i(1,!1),h>d&&i(h,!0)}return f}},Fb.selectElement=function(b){if(a.getSelection){var c=a.getSelection();c.removeAllRanges();var d=document.createRange();d.selectNodeContents(b),c.addRange(d)}else if(document.selection){var e=document.body.createTextRange();e.moveToElementText(b),e.select()}},Fb.disableKeyFilter=function(){a.key&&(j.filter=function(){return Sb.data().useKeyboardShortcuts()})},Fb.restoreKeyFilter=function(){a.key&&(j.filter=function(a){if(Sb.data().useKeyboardShortcuts()){var b=a.target||a.srcElement,c=b?b.tagName:"";return c=c.toUpperCase(),!("INPUT"===c||"SELECT"===c||"TEXTAREA"===c||b&&"DIV"===c&&"editorHtmlArea"===b.className&&b.contentEditable)}return!1})},Fb.detectDropdownVisibility=h.debounce(function(){Ib.dropdownVisibility(!!h.find(Kb,function(a){return a.hasClass("open")}))},50),Hb={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(a){return Hb.encode(a).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=Hb._utf8_encode(a);j>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!==g&&(i+=String.fromCharCode(c)),64!==h&&(i+=String.fromCharCode(d));return Hb._utf8_decode(i)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0,d=a.length,e=0;d>c;c++)e=a.charCodeAt(c),128>e?b+=String.fromCharCode(e):e>127&&2048>e?(b+=String.fromCharCode(e>>6|192),b+=String.fromCharCode(63&e|128)):(b+=String.fromCharCode(e>>12|224),b+=String.fromCharCode(e>>6&63|128),b+=String.fromCharCode(63&e|128));return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b}},c.bindingHandlers.tooltip={init:function(a,d){if(!Ib.bMobileDevice){var e=b(a),f=e.data("tooltip-class")||"",g=e.data("tooltip-placement")||"top";e.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:g,trigger:"hover",title:function(){return e.is(".disabled")||Ib.dropdownVisibility()?"":''+Fb.i18n(c.utils.unwrapObservable(d()))+""}}).click(function(){e.tooltip("hide")}),Ib.tooltipTrigger.subscribe(function(){e.tooltip("hide")})}}},c.bindingHandlers.tooltip2={init:function(a,c){var d=b(a),e=d.data("tooltip-class")||"",f=d.data("tooltip-placement")||"top";d.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:f,title:function(){return d.is(".disabled")||Ib.dropdownVisibility()?"":''+c()()+""}}).click(function(){d.tooltip("hide")}),Ib.tooltipTrigger.subscribe(function(){d.tooltip("hide")})}},c.bindingHandlers.tooltip3={init:function(a){var c=b(a);c.tooltip({container:"body",trigger:"hover manual",title:function(){return c.data("tooltip3-data")||""}}),Qb.click(function(){c.tooltip("hide")}),Ib.tooltipTrigger.subscribe(function(){c.tooltip("hide")})},update:function(a,d){var e=c.utils.unwrapObservable(d());""===e?b(a).data("tooltip3-data","").tooltip("hide"):b(a).data("tooltip3-data",e).tooltip("show")}},c.bindingHandlers.registrateBootstrapDropdown={init:function(a){Kb.push(b(a))}},c.bindingHandlers.openDropdownTrigger={update:function(a,d){if(c.utils.unwrapObservable(d())){var e=b(a);e.hasClass("open")||(e.find(".dropdown-toggle").dropdown("toggle"),Fb.detectDropdownVisibility()),d()(!1)}}},c.bindingHandlers.dropdownCloser={init:function(a){b(a).closest(".dropdown").on("click",".e-item",function(){b(a).dropdown("toggle")})}},c.bindingHandlers.popover={init:function(a,d){b(a).popover(c.utils.unwrapObservable(d()))}},c.bindingHandlers.csstext={init:function(a,d){a&&a.styleSheet&&!Fb.isUnd(a.styleSheet.cssText)?a.styleSheet.cssText=c.utils.unwrapObservable(d()):b(a).text(c.utils.unwrapObservable(d()))},update:function(a,d){a&&a.styleSheet&&!Fb.isUnd(a.styleSheet.cssText)?a.styleSheet.cssText=c.utils.unwrapObservable(d()):b(a).text(c.utils.unwrapObservable(d()))}},c.bindingHandlers.resizecrop={init:function(a){b(a).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(a,c){c()(),b(a).resizecrop({width:"100",height:"100"})}},c.bindingHandlers.onEnter={init:function(c,d,e,f){b(c).on("keypress",function(e){e&&13===a.parseInt(e.keyCode,10)&&(b(c).trigger("change"),d().call(f))})}},c.bindingHandlers.onEsc={init:function(c,d,e,f){b(c).on("keypress",function(e){e&&27===a.parseInt(e.keyCode,10)&&(b(c).trigger("change"),d().call(f))})}},c.bindingHandlers.clickOnTrue={update:function(a,d){c.utils.unwrapObservable(d())&&b(a).click()}},c.bindingHandlers.modal={init:function(a,d){b(a).toggleClass("fade",!Ib.bMobileDevice).modal({keyboard:!1,show:c.utils.unwrapObservable(d())}).on("shown",function(){Fb.windowResize()}).find(".close").click(function(){d()(!1)})},update:function(a,d){b(a).modal(c.utils.unwrapObservable(d())?"show":"hide")}},c.bindingHandlers.i18nInit={init:function(a){Fb.i18nToNode(a)}},c.bindingHandlers.i18nUpdate={update:function(a,b){c.utils.unwrapObservable(b()),Fb.i18nToNode(a)}},c.bindingHandlers.link={update:function(a,d){b(a).attr("href",c.utils.unwrapObservable(d()))}},c.bindingHandlers.title={update:function(a,d){b(a).attr("title",c.utils.unwrapObservable(d()))}},c.bindingHandlers.textF={init:function(a,d){b(a).text(c.utils.unwrapObservable(d()))}},c.bindingHandlers.initDom={init:function(a,b){b()(a)}},c.bindingHandlers.initResizeTrigger={init:function(a,d){var e=c.utils.unwrapObservable(d());b(a).css({height:e[1],"min-height":e[1]})},update:function(a,d){var e=c.utils.unwrapObservable(d()),f=Fb.pInt(e[1]),g=0,h=b(a).offset().top;h>0&&(h+=Fb.pInt(e[2]),g=Pb.height()-h,g>f&&(f=g),b(a).css({height:f,"min-height":f}))}},c.bindingHandlers.appendDom={update:function(a,d){b(a).hide().empty().append(c.utils.unwrapObservable(d())).show()}},c.bindingHandlers.draggable={init:function(d,e,f){if(!Ib.bMobileDevice){var g=100,h=3,i=f(),j=i&&i.droppableSelector?i.droppableSelector:"",k={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};j&&(k.drag=function(c){b(j).each(function(){var d=null,e=null,f=b(this),i=f.offset(),j=i.top+f.height();a.clearInterval(f.data("timerScroll")),f.data("timerScroll",!1),c.pageX>=i.left&&c.pageX<=i.left+f.width()&&(c.pageY>=j-g&&c.pageY<=j&&(d=function(){f.scrollTop(f.scrollTop()+h),Fb.windowResize()},f.data("timerScroll",a.setInterval(d,10)),d()),c.pageY>=i.top&&c.pageY<=i.top+g&&(e=function(){f.scrollTop(f.scrollTop()-h),Fb.windowResize()},f.data("timerScroll",a.setInterval(e,10)),e()))})},k.stop=function(){b(j).each(function(){a.clearInterval(b(this).data("timerScroll")),b(this).data("timerScroll",!1)})}),k.helper=function(a){return e()(a&&a.target?c.dataFor(a.target):null)},b(d).draggable(k).on("mousedown",function(){Fb.removeInFocus()})}}},c.bindingHandlers.droppable={init:function(a,c,d){if(!Ib.bMobileDevice){var e=c(),f=d(),g=f&&f.droppableOver?f.droppableOver:null,h=f&&f.droppableOut?f.droppableOut:null,i={tolerance:"pointer",hoverClass:"droppableHover"};e&&(i.drop=function(a,b){e(a,b)},g&&(i.over=function(a,b){g(a,b)}),h&&(i.out=function(a,b){h(a,b)}),b(a).droppable(i))}}},c.bindingHandlers.nano={init:function(a){Ib.bDisableNanoScroll||b(a).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},c.bindingHandlers.saveTrigger={init:function(a){var c=b(a);c.data("save-trigger-type",c.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===c.data("save-trigger-type")?c.append('  ').addClass("settings-saved-trigger"):c.addClass("settings-saved-trigger-input")},update:function(a,d){var e=c.utils.unwrapObservable(d()),f=b(a);if("custom"===f.data("save-trigger-type"))switch(e.toString()){case"1":f.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":f.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":f.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:f.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(e.toString()){case"1":f.addClass("success").removeClass("error");break;case"0":f.addClass("error").removeClass("success");break;case"-2":break;default:f.removeClass("error success")}}},c.bindingHandlers.emailsTags={init:function(a,c){var d=b(a),e=c(),f=function(a){e&&e.focusTrigger&&e.focusTrigger(a)};d.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:f,inputDelimiters:[",",";"],autoCompleteSource:function(a,b){Sb.getAutocomplete(a.term,function(a){b(h.map(a,function(a){return a.toLine(!1)}))})},parseHook:function(a){return h.map(a,function(a){var b=Fb.trim(a),c=null;return""!==b?(c=new u,c.mailsoParse(b),c.clearDuplicateName(),[c.toLine(!1),c]):[b,null]})},change:h.bind(function(a){d.data("EmailsTagsValue",a.target.value),e(a.target.value)},this)}),e.subscribe(function(a){d.data("EmailsTagsValue")!==a&&(d.val(a),d.data("EmailsTagsValue",a),d.inputosaurus("refresh"))}),e.focusTrigger&&e.focusTrigger.subscribe(function(a){a&&d.inputosaurus("focus")})}},c.bindingHandlers.contactTags={init:function(a,c){var d=b(a),e=c(),f=function(a){e&&e.focusTrigger&&e.focusTrigger(a)};d.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:f,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:function(a,b){Sb.getContactsTagsAutocomplete(a.term,function(a){b(h.map(a,function(a){return a.toLine(!1)}))})},parseHook:function(a){return h.map(a,function(a){var b=Fb.trim(a),c=null;return""!==b?(c=new x,c.name(b),[c.toLine(!1),c]):[b,null]})},change:h.bind(function(a){d.data("ContactsTagsValue",a.target.value),e(a.target.value)},this)}),e.subscribe(function(a){d.data("ContactsTagsValue")!==a&&(d.val(a),d.data("ContactsTagsValue",a),d.inputosaurus("refresh"))}),e.focusTrigger&&e.focusTrigger.subscribe(function(a){a&&d.inputosaurus("focus")})}},c.bindingHandlers.command={init:function(a,d,e,f){var g=b(a),h=d();if(!h||!h.enabled||!h.canExecute)throw new Error("You are not using command function");g.addClass("command"),c.bindingHandlers[g.is("form")?"submit":"click"].init.apply(f,arguments)},update:function(a,c){var d=!0,e=b(a),f=c();d=f.enabled(),e.toggleClass("command-not-enabled",!d),d&&(d=f.canExecute(),e.toggleClass("command-can-not-be-execute",!d)),e.toggleClass("command-disabled disable disabled",!d).toggleClass("no-disabled",!!d),(e.is("input")||e.is("button"))&&e.prop("disabled",!d)}},c.extenders.trimmer=function(a){var b=c.computed({read:a,write:function(b){a(Fb.trim(b.toString()))},owner:this});return b(a()),b},c.extenders.reversible=function(a){var b=a();return a.commit=function(){b=a()},a.reverse=function(){a(b)},a.commitedValue=function(){return b},a},c.extenders.toggleSubscribe=function(a,b){return a.subscribe(b[1],b[0],"beforeChange"),a.subscribe(b[2],b[0]),a},c.extenders.falseTimeout=function(b,c){return b.iTimeout=0,b.subscribe(function(d){d&&(a.clearTimeout(b.iTimeout),b.iTimeout=a.setTimeout(function(){b(!1),b.iTimeout=0},Fb.pInt(c)))}),b},c.observable.fn.validateNone=function(){return this.hasError=c.observable(!1),this},c.observable.fn.validateEmail=function(){return this.hasError=c.observable(!1),this.subscribe(function(a){a=Fb.trim(a),this.hasError(""!==a&&!/^[^@\s]+@[^@\s]+$/.test(a))},this),this.valueHasMutated(),this},c.observable.fn.validateSimpleEmail=function(){return this.hasError=c.observable(!1),this.subscribe(function(a){a=Fb.trim(a),this.hasError(""!==a&&!/^.+@.+$/.test(a))},this),this.valueHasMutated(),this},c.observable.fn.validateFunc=function(a){return this.hasFuncError=c.observable(!1),Fb.isFunc(a)&&(this.subscribe(function(b){this.hasFuncError(!a(b))},this),this.valueHasMutated()),this},k.prototype.root=function(){return this.sBase},k.prototype.attachmentDownload=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+a},k.prototype.attachmentPreview=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+a},k.prototype.attachmentPreviewAsPlain=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+a},k.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},k.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},k.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},k.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},k.prototype.change=function(b){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+a.encodeURIComponent(b)+"/"},k.prototype.ajax=function(a){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+a},k.prototype.messageViewLink=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+a},k.prototype.messageDownloadLink=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+a},k.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},k.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},k.prototype.settings=function(a){var b=this.sBase+"settings";return Fb.isUnd(a)||""===a||(b+="/"+a),b},k.prototype.admin=function(a){var b=this.sBase;switch(a){case"AdminDomains":b+="domains";break;case"AdminSecurity":b+="security";break;case"AdminLicensing":b+="licensing"}return b},k.prototype.mailBox=function(a,b,c){b=Fb.isNormal(b)?Fb.pInt(b):1,c=Fb.pString(c);var d=this.sBase+"mailbox/";return""!==a&&(d+=encodeURI(a)),b>1&&(d=d.replace(/[\/]+$/,""),d+="/p"+b),""!==c&&(d=d.replace(/[\/]+$/,""),d+="/"+encodeURI(c)),d},k.prototype.phpInfo=function(){return this.sServer+"Info"},k.prototype.langLink=function(a){return this.sServer+"/Lang/0/"+encodeURI(a)+"/"+this.sVersion+"/"},k.prototype.getUserPicUrlFromHash=function(a){return this.sServer+"/Raw/"+this.sSpecSuffix+"/UserPic/"+a+"/"+this.sVersion+"/"},k.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},k.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},k.prototype.emptyContactPic=function(){return"rainloop/v/"+this.sVersion+"/static/css/images/empty-contact.png"},k.prototype.emptyFullContactPic=function(){return a.location.protocol+"//"+a.location.hostname+("80"==""+a.location.port||""==""+a.location.port?"":":"+a.location.port)+a.location.pathname+"rainloop/v/"+this.sVersion+"/static/css/images/empty-contact.png"},k.prototype.sound=function(a){return"rainloop/v/"+this.sVersion+"/static/sounds/"+a},k.prototype.themePreviewLink=function(a){var b="rainloop/v/"+this.sVersion+"/";return"@custom"===a.substr(-7)&&(a=Fb.trim(a.substring(0,a.length-7)),b=""),b+"themes/"+encodeURI(a)+"/images/preview.png"},k.prototype.notificationMailIcon=function(){return"rainloop/v/"+this.sVersion+"/static/css/images/icom-message-notification.png"},k.prototype.openPgpJs=function(){return"rainloop/v/"+this.sVersion+"/static/js/openpgp.min.js"},k.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},k.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},k.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},Gb.oViewModelsHooks={},Gb.oSimpleHooks={},Gb.regViewModelHook=function(a,b){b&&(b.__hookName=a)},Gb.addHook=function(a,b){Fb.isFunc(b)&&(Fb.isArray(Gb.oSimpleHooks[a])||(Gb.oSimpleHooks[a]=[]),Gb.oSimpleHooks[a].push(b))},Gb.runHook=function(a,b){Fb.isArray(Gb.oSimpleHooks[a])&&(b=b||[],h.each(Gb.oSimpleHooks[a],function(a){a.apply(null,b)}))},Gb.mainSettingsGet=function(a){return Sb?Sb.settingsGet(a):null},Gb.remoteRequest=function(a,b,c,d,e,f){Sb&&Sb.remote().defaultRequest(a,b,c,d,e,f)},Gb.settingsGet=function(a,b){var c=Gb.mainSettingsGet("Plugins");return c=c&&Fb.isUnd(c[a])?null:c[a],c?Fb.isUnd(c[b])?null:c[b]:null},l.prototype.blurTrigger=function(){if(this.fOnBlur){var b=this;a.clearTimeout(b.iBlurTimer),b.iBlurTimer=a.setTimeout(function(){b.fOnBlur()},200)}},l.prototype.focusTrigger=function(){this.fOnBlur&&a.clearTimeout(this.iBlurTimer)},l.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},l.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},l.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},l.prototype.getData=function(){return this.editor?"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain?this.editor.__plain.getRawData():this.editor.getData():""},l.prototype.modeToggle=function(a){this.editor&&(a?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"))},l.prototype.setHtml=function(a,b){this.editor&&(this.modeToggle(!0),this.editor.setData(a),b&&this.focus())},l.prototype.setPlain=function(a,b){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(a);this.editor.setData(a),b&&this.focus()}},l.prototype.init=function(){if(this.$element&&this.$element[0]){var b=this,c=Ib.oHtmlEditorDefaultConfig,d=Sb.settingsGet("Language"),e=!!Sb.settingsGet("AllowHtmlEditorSourceButton");e&&c.toolbarGroups&&!c.toolbarGroups.__SourceInited&&(c.toolbarGroups.__SourceInited=!0,c.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),c.language=Ib.oHtmlEditorLangsMap[d]||"en",b.editor=a.CKEDITOR.appendTo(b.$element[0],c),b.editor.on("key",function(a){return a&&a.data&&9===a.data.keyCode?!1:void 0}),b.editor.on("blur",function(){b.blurTrigger()}),b.editor.on("mode",function(){b.blurTrigger(),b.fOnModeChange&&b.fOnModeChange("plain"!==b.editor.mode)}),b.editor.on("focus",function(){b.focusTrigger()}),b.fOnReady&&b.editor.on("instanceReady",function(){b.editor.setKeystroke(a.CKEDITOR.CTRL+65,"selectAll"),b.fOnReady(),b.__resizable=!0,b.resize()})}},l.prototype.focus=function(){this.editor&&this.editor.focus()},l.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},l.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(a){}},l.prototype.clear=function(a){this.setHtml("",a)},m.prototype.itemSelected=function(a){this.isListChecked()?a||(this.oCallbacks.onItemSelect||this.emptyFunction)(a||null):a&&(this.oCallbacks.onItemSelect||this.emptyFunction)(a)},m.prototype.goDown=function(a){this.newSelectPosition(Db.EventKeyCode.Down,!1,a)},m.prototype.goUp=function(a){this.newSelectPosition(Db.EventKeyCode.Up,!1,a)},m.prototype.init=function(a,d,e){if(this.oContentVisible=a,this.oContentScrollable=d,e=e||"all",this.oContentVisible&&this.oContentScrollable){var f=this;b(this.oContentVisible).on("selectstart",function(a){a&&a.preventDefault&&a.preventDefault()}).on("click",this.sItemSelector,function(a){f.actionClick(c.dataFor(this),a)}).on("click",this.sItemCheckedSelector,function(a){var b=c.dataFor(this);b&&(a&&a.shiftKey?f.actionClick(b,a):(f.focusedItem(b),b.checked(!b.checked())))}),j("enter",e,function(){return f.focusedItem()&&!f.focusedItem().selected()?(f.actionClick(f.focusedItem()),!1):!0}),j("ctrl+up, command+up, ctrl+down, command+down",e,function(){return!1}),j("up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space",e,function(a,b){if(a&&b&&b.shortcut){var c=0;switch(b.shortcut){case"up":case"shift+up":c=Db.EventKeyCode.Up;break;case"down":case"shift+down":c=Db.EventKeyCode.Down;break;case"insert":c=Db.EventKeyCode.Insert;break;case"space":c=Db.EventKeyCode.Space;break;case"home":c=Db.EventKeyCode.Home;break;case"end":c=Db.EventKeyCode.End;break;case"pageup":c=Db.EventKeyCode.PageUp;break;case"pagedown":c=Db.EventKeyCode.PageDown}if(c>0)return f.newSelectPosition(c,j.shift),!1}})}},m.prototype.autoSelect=function(a){this.bAutoSelect=!!a},m.prototype.getItemUid=function(a){var b="",c=this.oCallbacks.onItemGetUid||null;return c&&a&&(b=c(a)),b.toString()},m.prototype.newSelectPosition=function(a,b,c){var d=0,e=10,f=!1,g=!1,i=null,j=this.list(),k=j?j.length:0,l=this.focusedItem();if(k>0)if(l){if(l)if(Db.EventKeyCode.Down===a||Db.EventKeyCode.Up===a||Db.EventKeyCode.Insert===a||Db.EventKeyCode.Space===a)h.each(j,function(b){if(!g)switch(a){case Db.EventKeyCode.Up:l===b?g=!0:i=b;break;case Db.EventKeyCode.Down:case Db.EventKeyCode.Insert:f?(i=b,g=!0):l===b&&(f=!0)}});else if(Db.EventKeyCode.Home===a||Db.EventKeyCode.End===a)Db.EventKeyCode.Home===a?i=j[0]:Db.EventKeyCode.End===a&&(i=j[j.length-1]);else if(Db.EventKeyCode.PageDown===a){for(;k>d;d++)if(l===j[d]){d+=e,d=d>k-1?k-1:d,i=j[d];break}}else if(Db.EventKeyCode.PageUp===a)for(d=k;d>=0;d--)if(l===j[d]){d-=e,d=0>d?0:d,i=j[d];break}}else Db.EventKeyCode.Down===a||Db.EventKeyCode.Insert===a||Db.EventKeyCode.Space===a||Db.EventKeyCode.Home===a||Db.EventKeyCode.PageUp===a?i=j[0]:(Db.EventKeyCode.Up===a||Db.EventKeyCode.End===a||Db.EventKeyCode.PageDown===a)&&(i=j[j.length-1]);i?(this.focusedItem(i),l&&(b?(Db.EventKeyCode.Up===a||Db.EventKeyCode.Down===a)&&l.checked(!l.checked()):(Db.EventKeyCode.Insert===a||Db.EventKeyCode.Space===a)&&l.checked(!l.checked())),!this.bAutoSelect&&!c||this.isListChecked()||Db.EventKeyCode.Space===a||this.selectedItem(i),this.scrollToFocused()):l&&(!b||Db.EventKeyCode.Up!==a&&Db.EventKeyCode.Down!==a?(Db.EventKeyCode.Insert===a||Db.EventKeyCode.Space===a)&&l.checked(!l.checked()):l.checked(!l.checked()),this.focusedItem(l))},m.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var a=20,c=b(this.sItemFocusedSelector,this.oContentScrollable),d=c.position(),e=this.oContentVisible.height(),f=c.outerHeight();return d&&(d.top<0||d.top+f>e)?(d.top<0?this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+d.top-a):this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+d.top-e+f+a),!0):!1},m.prototype.scrollToTop=function(a){return this.oContentVisible&&this.oContentScrollable?(a?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},m.prototype.eventClickFunction=function(a,b){var c=this.getItemUid(a),d=0,e=0,f=null,g="",h=!1,i=!1,j=[],k=!1;if(b&&b.shiftKey&&""!==c&&""!==this.sLastUid&&c!==this.sLastUid)for(j=this.list(),k=a.checked(),d=0,e=j.length;e>d;d++)f=j[d],g=this.getItemUid(f),h=!1,(g===this.sLastUid||g===c)&&(h=!0),h&&(i=!i),(i||h)&&f.checked(k); -this.sLastUid=""===c?"":c},m.prototype.actionClick=function(a,b){if(a){var c=!0,d=this.getItemUid(a);b&&(!b.shiftKey||b.ctrlKey||b.altKey?!b.ctrlKey||b.shiftKey||b.altKey||(c=!1,this.focusedItem(a),this.selectedItem()&&a!==this.selectedItem()&&this.selectedItem().checked(!0),a.checked(!a.checked())):(c=!1,""===this.sLastUid&&(this.sLastUid=d),a.checked(!a.checked()),this.eventClickFunction(a,b),this.focusedItem(a))),c&&(this.focusedItem(a),this.selectedItem(a))}},m.prototype.on=function(a,b){this.oCallbacks[a]=b},n.supported=function(){return!0},n.prototype.set=function(a,c){var d=b.cookie(Cb.Values.ClientSideCookieIndexName),e=!1,f=null;try{f=null===d?null:JSON.parse(d),f||(f={}),f[a]=c,b.cookie(Cb.Values.ClientSideCookieIndexName,JSON.stringify(f),{expires:30}),e=!0}catch(g){}return e},n.prototype.get=function(a){var c=b.cookie(Cb.Values.ClientSideCookieIndexName),d=null;try{d=null===c?null:JSON.parse(c),d=d&&!Fb.isUnd(d[a])?d[a]:null}catch(e){}return d},o.supported=function(){return!!a.localStorage},o.prototype.set=function(b,c){var d=a.localStorage[Cb.Values.ClientSideCookieIndexName]||null,e=!1,f=null;try{f=null===d?null:JSON.parse(d),f||(f={}),f[b]=c,a.localStorage[Cb.Values.ClientSideCookieIndexName]=JSON.stringify(f),e=!0}catch(g){}return e},o.prototype.get=function(b){var c=a.localStorage[Cb.Values.ClientSideCookieIndexName]||null,d=null;try{d=null===c?null:JSON.parse(c),d=d&&!Fb.isUnd(d[b])?d[b]:null}catch(e){}return d},p.prototype.oDriver=null,p.prototype.set=function(a,b){return this.oDriver?this.oDriver.set("p"+a,b):!1},p.prototype.get=function(a){return this.oDriver?this.oDriver.get("p"+a):null},q.prototype.bootstart=function(){},r.prototype.sPosition="",r.prototype.sTemplate="",r.prototype.viewModelName="",r.prototype.viewModelDom=null,r.prototype.viewModelTemplate=function(){return this.sTemplate},r.prototype.viewModelPosition=function(){return this.sPosition},r.prototype.cancelCommand=r.prototype.closeCommand=function(){},r.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=Sb.data().keyScope(),Sb.data().keyScope(this.sDefaultKeyScope)},r.prototype.restoreKeyScope=function(){Sb.data().keyScope(this.sCurrentKeyScope)},r.prototype.registerPopupKeyDown=function(){var a=this;Pb.on("keydown",function(b){if(b&&a.modalVisibility&&a.modalVisibility()){if(!this.bDisabeCloseOnEsc&&Db.EventKeyCode.Esc===b.keyCode)return Fb.delegateRun(a,"cancelCommand"),!1;if(Db.EventKeyCode.Backspace===b.keyCode&&!Fb.inFocus())return!1}return!0})},s.prototype.oCross=null,s.prototype.sScreenName="",s.prototype.aViewModels=[],s.prototype.viewModels=function(){return this.aViewModels},s.prototype.screenName=function(){return this.sScreenName},s.prototype.routes=function(){return null},s.prototype.__cross=function(){return this.oCross},s.prototype.__start=function(){var a=this.routes(),b=null,c=null;Fb.isNonEmptyArray(a)&&(c=h.bind(this.onRoute||Fb.emptyFunction,this),b=d.create(),h.each(a,function(a){b.addRoute(a[0],c).rules=a[1]}),this.oCross=b)},t.constructorEnd=function(a){Fb.isFunc(a.__constructor_end)&&a.__constructor_end.call(a)},t.prototype.sDefaultScreenName="",t.prototype.oScreens={},t.prototype.oBoot=null,t.prototype.oCurrentScreen=null,t.prototype.hideLoading=function(){b("#rl-loading").hide()},t.prototype.routeOff=function(){e.changed.active=!1},t.prototype.routeOn=function(){e.changed.active=!0},t.prototype.setBoot=function(a){return Fb.isNormal(a)&&(this.oBoot=a),this},t.prototype.screen=function(a){return""===a||Fb.isUnd(this.oScreens[a])?null:this.oScreens[a]},t.prototype.buildViewModel=function(a,d){if(a&&!a.__builded){var e=new a(d),f=e.viewModelPosition(),g=b("#rl-content #rl-"+f.toLowerCase()),i=null;a.__builded=!0,a.__vm=e,e.data=Sb.data(),e.viewModelName=a.__name,g&&1===g.length?(i=b("
").addClass("rl-view-model").addClass("RL-"+e.viewModelTemplate()).hide(),i.appendTo(g),e.viewModelDom=i,a.__dom=i,"Popups"===f&&(e.cancelCommand=e.closeCommand=Fb.createCommand(e,function(){Lb.hideScreenPopup(a)}),e.modalVisibility.subscribe(function(a){var b=this;a?(this.viewModelDom.show(),this.storeAndSetKeyScope(),Sb.popupVisibilityNames.push(this.viewModelName),e.viewModelDom.css("z-index",3e3+Sb.popupVisibilityNames().length+10),Fb.delegateRun(this,"onFocus",[],500)):(Fb.delegateRun(this,"onHide"),this.restoreKeyScope(),Sb.popupVisibilityNames.remove(this.viewModelName),e.viewModelDom.css("z-index",2e3),Ib.tooltipTrigger(!Ib.tooltipTrigger()),h.delay(function(){b.viewModelDom.hide()},300))},e)),Gb.runHook("view-model-pre-build",[a.__name,e,i]),c.applyBindingAccessorsToNode(i[0],{i18nInit:!0,template:function(){return{name:e.viewModelTemplate()}}},e),Fb.delegateRun(e,"onBuild",[i]),e&&"Popups"===f&&e.registerPopupKeyDown(),Gb.runHook("view-model-post-build",[a.__name,e,i])):Fb.log("Cannot find view model position: "+f)}return a?a.__vm:null},t.prototype.applyExternal=function(a,b){a&&b&&c.applyBindings(a,b)},t.prototype.hideScreenPopup=function(a){a&&a.__vm&&a.__dom&&(a.__vm.modalVisibility(!1),Gb.runHook("view-model-on-hide",[a.__name,a.__vm]))},t.prototype.showScreenPopup=function(a,b){a&&(this.buildViewModel(a),a.__vm&&a.__dom&&(a.__vm.modalVisibility(!0),Fb.delegateRun(a.__vm,"onShow",b||[]),Gb.runHook("view-model-on-show",[a.__name,a.__vm,b||[]])))},t.prototype.screenOnRoute=function(a,b){var c=this,d=null,e=null;""===Fb.pString(a)&&(a=this.sDefaultScreenName),""!==a&&(d=this.screen(a),d||(d=this.screen(this.sDefaultScreenName),d&&(b=a+"/"+b,a=this.sDefaultScreenName)),d&&d.__started&&(d.__builded||(d.__builded=!0,Fb.isNonEmptyArray(d.viewModels())&&h.each(d.viewModels(),function(a){this.buildViewModel(a,d)},this),Fb.delegateRun(d,"onBuild")),h.defer(function(){c.oCurrentScreen&&(Fb.delegateRun(c.oCurrentScreen,"onHide"),Fb.isNonEmptyArray(c.oCurrentScreen.viewModels())&&h.each(c.oCurrentScreen.viewModels(),function(a){a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()&&(a.__dom.hide(),a.__vm.viewModelVisibility(!1),Fb.delegateRun(a.__vm,"onHide"))})),c.oCurrentScreen=d,c.oCurrentScreen&&(Fb.delegateRun(c.oCurrentScreen,"onShow"),Gb.runHook("screen-on-show",[c.oCurrentScreen.screenName(),c.oCurrentScreen]),Fb.isNonEmptyArray(c.oCurrentScreen.viewModels())&&h.each(c.oCurrentScreen.viewModels(),function(a){a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()&&(a.__dom.show(),a.__vm.viewModelVisibility(!0),Fb.delegateRun(a.__vm,"onShow"),Fb.delegateRun(a.__vm,"onFocus",[],200),Gb.runHook("view-model-on-show",[a.__name,a.__vm]))},c)),e=d.__cross(),e&&e.parse(b)})))},t.prototype.startScreens=function(a){b("#rl-content").css({visibility:"hidden"}),h.each(a,function(a){var b=new a,c=b?b.screenName():"";b&&""!==c&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=c),this.oScreens[c]=b)},this),h.each(this.oScreens,function(a){a&&!a.__started&&a.__start&&(a.__started=!0,a.__start(),Gb.runHook("screen-pre-start",[a.screenName(),a]),Fb.delegateRun(a,"onStart"),Gb.runHook("screen-post-start",[a.screenName(),a]))},this);var c=d.create();c.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,h.bind(this.screenOnRoute,this)),e.initialized.add(c.parse,c),e.changed.add(c.parse,c),e.init(),b("#rl-content").css({visibility:"visible"}),h.delay(function(){Ob.removeClass("rl-started-trigger").addClass("rl-started")},50)},t.prototype.setHash=function(a,b,c){a="#"===a.substr(0,1)?a.substr(1):a,a="/"===a.substr(0,1)?a.substr(1):a,c=Fb.isUnd(c)?!1:!!c,(Fb.isUnd(b)?1:!b)?(e.changed.active=!0,e[c?"replaceHash":"setHash"](a),e.setHash(a)):(e.changed.active=!1,e[c?"replaceHash":"setHash"](a),e.changed.active=!0)},t.prototype.bootstart=function(){return this.oBoot&&this.oBoot.bootstart&&this.oBoot.bootstart(),this},Lb=new t,u.newInstanceFromJson=function(a){var b=new u;return b.initByJson(a)?b:null},u.prototype.name="",u.prototype.email="",u.prototype.privateType=null,u.prototype.clear=function(){this.email="",this.name="",this.privateType=null},u.prototype.validate=function(){return""!==this.name||""!==this.email},u.prototype.hash=function(a){return"#"+(a?"":this.name)+"#"+this.email+"#"},u.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},u.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=Db.EmailType.Facebook),null===this.privateType&&(this.privateType=Db.EmailType.Default)),this.privateType},u.prototype.search=function(a){return-1<(this.name+" "+this.email).toLowerCase().indexOf(a.toLowerCase())},u.prototype.parse=function(a){this.clear(),a=Fb.trim(a);var b=/(?:"([^"]+)")? ?,]+)>?,? ?/g,c=b.exec(a);c?(this.name=c[1]||"",this.email=c[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(a)&&(this.name="",this.email=a)},u.prototype.initByJson=function(a){var b=!1;return a&&"Object/Email"===a["@Object"]&&(this.name=Fb.trim(a.Name),this.email=Fb.trim(a.Email),b=""!==this.email,this.clearDuplicateName()),b},u.prototype.toLine=function(a,b,c){var d="";return""!==this.email&&(b=Fb.isUnd(b)?!1:!!b,c=Fb.isUnd(c)?!1:!!c,a&&""!==this.name?d=b?'
")+'" target="_blank" tabindex="-1">'+Fb.encodeHtml(this.name)+"":c?Fb.encodeHtml(this.name):this.name:(d=this.email,""!==this.name?b?d=Fb.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+Fb.encodeHtml(d)+""+Fb.encodeHtml(">"):(d='"'+this.name+'" <'+d+">",c&&(d=Fb.encodeHtml(d))):b&&(d=''+Fb.encodeHtml(this.email)+""))),d},u.prototype.mailsoParse=function(a){if(a=Fb.trim(a),""===a)return!1;for(var b=function(a,b,c){a+="";var d=a.length;return 0>b&&(b+=d),d="undefined"==typeof c?d:0>c?c+d:c+b,b>=a.length||0>b||b>d?!1:a.slice(b,d)},c=function(a,b,c,d){return 0>c&&(c+=a.length),d=void 0!==d?d:a.length,0>d&&(d=d+a.length-c),a.slice(0,c)+b.substr(0,d)+b.slice(d)+a.slice(c+d)},d="",e="",f="",g=!1,h=!1,i=!1,j=null,k=0,l=0,m=0;m0&&0===d.length&&(d=b(a,0,m)),h=!0,k=m);break;case">":h&&(l=m,e=b(a,k+1,l-k-1),a=c(a,"",k,l-k+1),l=0,m=0,k=0,h=!1);break;case"(":g||h||i||(i=!0,k=m);break;case")":i&&(l=m,f=b(a,k+1,l-k-1),a=c(a,"",k,l-k+1),l=0,m=0,k=0,i=!1);break;case"\\":m++}m++}return 0===e.length&&(j=a.match(/[^@\s]+@\S+/i),j&&j[0]?e=j[0]:d=a),e.length>0&&0===d.length&&0===f.length&&(d=a.replace(e,"")),e=Fb.trim(e).replace(/^[<]+/,"").replace(/[>]+$/,""),d=Fb.trim(d).replace(/^["']+/,"").replace(/["']+$/,""),f=Fb.trim(f).replace(/^[(]+/,"").replace(/[)]+$/,""),d=d.replace(/\\\\(.)/,"$1"),f=f.replace(/\\\\(.)/,"$1"),this.name=d,this.email=e,this.clearDuplicateName(),!0},u.prototype.inputoTagLine=function(){return 0+$/,""),b=!0),b},y.prototype.isImage=function(){return-1e;e++)d.push(a[e].toLine(b,c));return d.join(", ")},A.initEmailsFromJson=function(a){var b=0,c=0,d=null,e=[];if(Fb.isNonEmptyArray(a))for(b=0,c=a.length;c>b;b++)d=u.newInstanceFromJson(a[b]),d&&e.push(d);return e},A.replyHelper=function(a,b,c){if(a&&0d;d++)Fb.isUnd(b[a[d].email])&&(b[a[d].email]=!0,c.push(a[d]))},A.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(Db.MessagePriority.Normal),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(Db.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(Db.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)},A.prototype.computeSenderEmail=function(){var a=Sb.data().sentFolder(),b=Sb.data().draftFolder();this.senderEmailsString(this.folderFullNameRaw===a||this.folderFullNameRaw===b?this.toEmailsString():this.fromEmailString())},A.prototype.initByJson=function(a){var b=!1;return a&&"Object/Message"===a["@Object"]&&(this.folderFullNameRaw=a.Folder,this.uid=a.Uid,this.hash=a.Hash,this.requestHash=a.RequestHash,this.size(Fb.pInt(a.Size)),this.from=A.initEmailsFromJson(a.From),this.to=A.initEmailsFromJson(a.To),this.cc=A.initEmailsFromJson(a.Cc),this.bcc=A.initEmailsFromJson(a.Bcc),this.replyTo=A.initEmailsFromJson(a.ReplyTo),this.deliveredTo=A.initEmailsFromJson(a.DeliveredTo),this.subject(a.Subject),this.dateTimeStampInUTC(Fb.pInt(a.DateTimeStampInUTC)),this.hasAttachments(!!a.HasAttachments),this.attachmentsMainType(a.AttachmentsMainType),this.fromEmailString(A.emailsToLine(this.from,!0)),this.toEmailsString(A.emailsToLine(this.to,!0)),this.parentUid(Fb.pInt(a.ParentThread)),this.threads(Fb.isArray(a.Threads)?a.Threads:[]),this.threadsLen(Fb.pInt(a.ThreadsLen)),this.initFlagsByJson(a),this.computeSenderEmail(),b=!0),b},A.prototype.initUpdateByMessageJson=function(a){var b=!1,c=Db.MessagePriority.Normal;return a&&"Object/Message"===a["@Object"]&&(c=Fb.pInt(a.Priority),this.priority(-1b;b++)d=y.newInstanceFromJson(a["@Collection"][b]),d&&(""!==d.cidWithOutTags&&0+$/,""),b=h.find(c,function(b){return a===b.cidWithOutTags})),b||null},A.prototype.findAttachmentByContentLocation=function(a){var b=null,c=this.attachments();return Fb.isNonEmptyArray(c)&&(b=h.find(c,function(b){return a===b.contentLocation})),b||null},A.prototype.messageId=function(){return this.sMessageId},A.prototype.inReplyTo=function(){return this.sInReplyTo},A.prototype.references=function(){return this.sReferences},A.prototype.fromAsSingleEmail=function(){return Fb.isArray(this.from)&&this.from[0]?this.from[0].email:""},A.prototype.viewLink=function(){return Sb.link().messageViewLink(this.requestHash)},A.prototype.downloadLink=function(){return Sb.link().messageDownloadLink(this.requestHash)},A.prototype.replyEmails=function(a){var b=[],c=Fb.isUnd(a)?{}:a;return A.replyHelper(this.replyTo,c,b),0===b.length&&A.replyHelper(this.from,c,b),b},A.prototype.replyAllEmails=function(a){var b=[],c=[],d=Fb.isUnd(a)?{}:a;return A.replyHelper(this.replyTo,d,b),0===b.length&&A.replyHelper(this.from,d,b),A.replyHelper(this.to,d,b),A.replyHelper(this.cc,d,c),[b,c]},A.prototype.textBodyToString=function(){return this.body?this.body.html():""},A.prototype.attachmentsToStringLine=function(){var a=h.map(this.attachments(),function(a){return a.fileName+" ("+a.friendlySize+")"});return a&&0=0&&e&&!f&&d.attr("src",e)}),c&&a.setTimeout(function(){d.print()},100))})},A.prototype.printMessage=function(){this.viewPopupMessage(!0)},A.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},A.prototype.populateByMessageListItem=function(a){return this.folderFullNameRaw=a.folderFullNameRaw,this.uid=a.uid,this.hash=a.hash,this.requestHash=a.requestHash,this.subject(a.subject()),this.size(a.size()),this.dateTimeStampInUTC(a.dateTimeStampInUTC()),this.priority(a.priority()),this.fromEmailString(a.fromEmailString()),this.toEmailsString(a.toEmailsString()),this.emails=a.emails,this.from=a.from,this.to=a.to,this.cc=a.cc,this.bcc=a.bcc,this.replyTo=a.replyTo,this.deliveredTo=a.deliveredTo,this.unseen(a.unseen()),this.flagged(a.flagged()),this.answered(a.answered()),this.forwarded(a.forwarded()),this.isReadReceipt(a.isReadReceipt()),this.selected(a.selected()),this.checked(a.checked()),this.hasAttachments(a.hasAttachments()),this.attachmentsMainType(a.attachmentsMainType()),this.moment(a.moment()),this.body=null,this.priority(Db.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(a.parentUid()),this.threads(a.threads()),this.threadsLen(a.threadsLen()),this.computeSenderEmail(),this},A.prototype.showExternalImages=function(a){this.body&&this.body.data("rl-has-images")&&(a=Fb.isUnd(a)?!1:a,this.hasImages(!1),this.body.data("rl-has-images",!1),b("[data-x-src]",this.body).each(function(){a&&b(this).is("img")?b(this).addClass("lazy").attr("data-original",b(this).attr("data-x-src")).removeAttr("data-x-src"):b(this).attr("src",b(this).attr("data-x-src")).removeAttr("data-x-src")}),b("[data-x-style-url]",this.body).each(function(){var a=Fb.trim(b(this).attr("style"));a=""===a?"":";"===a.substr(-1)?a+" ":a+"; ",b(this).attr("style",a+b(this).attr("data-x-style-url")).removeAttr("data-x-style-url")}),a&&(b("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:b(".RL-MailMessageView .messageView .messageItem .content")[0]}),Pb.resize()),Fb.windowResize(500))},A.prototype.showInternalImages=function(a){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),a=Fb.isUnd(a)?!1:a;var c=this;b("[data-x-src-cid]",this.body).each(function(){var d=c.findAttachmentByCid(b(this).attr("data-x-src-cid"));d&&d.download&&(a&&b(this).is("img")?b(this).addClass("lazy").attr("data-original",d.linkPreview()):b(this).attr("src",d.linkPreview()))}),b("[data-x-src-location]",this.body).each(function(){var d=c.findAttachmentByContentLocation(b(this).attr("data-x-src-location"));d||(d=c.findAttachmentByCid(b(this).attr("data-x-src-location"))),d&&d.download&&(a&&b(this).is("img")?b(this).addClass("lazy").attr("data-original",d.linkPreview()):b(this).attr("src",d.linkPreview()))}),b("[data-x-style-cid]",this.body).each(function(){var a="",d="",e=c.findAttachmentByCid(b(this).attr("data-x-style-cid"));e&&e.linkPreview&&(d=b(this).attr("data-x-style-cid-name"),""!==d&&(a=Fb.trim(b(this).attr("style")),a=""===a?"":";"===a.substr(-1)?a+" ":a+"; ",b(this).attr("style",a+d+": url('"+e.linkPreview()+"')")))}),a&&!function(a,b){h.delay(function(){a.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:b})},300)}(b("img.lazy",c.body),b(".RL-MailMessageView .messageView .messageItem .content")[0]),Fb.windowResize(500)}},A.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),Sb.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())))},A.prototype.storePgpVerifyDataToDom=function(){this.body&&Sb.data().capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},A.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=Fb.pString(this.body.data("rl-plain-raw")),Sb.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(Db.SignedVerifyStatus.None),this.pgpSignedVerifyUser("")))},A.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var c=[],d=null,e=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",f=Sb.data().findPublicKeysByEmail(e),g=null,i=null,j="";this.pgpSignedVerifyStatus(Db.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{d=a.openpgp.cleartext.readArmored(this.plainRaw),d&&d.getText&&(this.pgpSignedVerifyStatus(f.length?Db.SignedVerifyStatus.Unverified:Db.SignedVerifyStatus.UnknownPublicKeys),c=d.verify(f),c&&0').text(j)).html(),Tb.empty(),this.replacePlaneTextBody(j)))))}catch(k){}this.storePgpVerifyDataToDom()}},A.prototype.decryptPgpEncryptedMessage=function(c){if(this.isPgpEncrypted()){var d=[],e=null,f=null,g=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",i=Sb.data().findPublicKeysByEmail(g),j=Sb.data().findSelfPrivateKey(c),k=null,l=null,m="";this.pgpSignedVerifyStatus(Db.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),j||this.pgpSignedVerifyStatus(Db.SignedVerifyStatus.UnknownPrivateKey);try{e=a.openpgp.message.readArmored(this.plainRaw),e&&j&&e.decrypt&&(this.pgpSignedVerifyStatus(Db.SignedVerifyStatus.Unverified),f=e.decrypt(j),f&&(d=f.verify(i),d&&0').text(m)).html(),Tb.empty(),this.replacePlaneTextBody(m)))}catch(n){}this.storePgpVerifyDataToDom()}},A.prototype.replacePlaneTextBody=function(a){this.body&&this.body.html(a).addClass("b-text-part plain")},A.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},B.newInstanceFromJson=function(a){var b=new B;return b.initByJson(a)?b.initComputed():null},B.prototype.initComputed=function(){return this.hasSubScribedSubfolders=c.computed(function(){return!!h.find(this.subFolders(),function(a){return a.subScribed()&&!a.isSystemFolder()})},this),this.canBeEdited=c.computed(function(){return Db.FolderType.User===this.type()&&this.existen&&this.selectable},this),this.visible=c.computed(function(){var a=this.subScribed(),b=this.hasSubScribedSubfolders();return a||b&&(!this.existen||!this.selectable)},this),this.isSystemFolder=c.computed(function(){return Db.FolderType.User!==this.type()},this),this.hidden=c.computed(function(){var a=this.isSystemFolder(),b=this.hasSubScribedSubfolders();return a&&!b||!this.selectable&&!b},this),this.selectableForFolderList=c.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=c.computed({read:this.privateMessageCountAll,write:function(a){Fb.isPosNumeric(a,!0)?this.privateMessageCountAll(a):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=c.computed({read:this.privateMessageCountUnread,write:function(a){Fb.isPosNumeric(a,!0)?this.privateMessageCountUnread(a):this.privateMessageCountUnread.valueHasMutated() -},owner:this}),this.printableUnreadCount=c.computed(function(){var a=this.messageCountAll(),b=this.messageCountUnread(),c=this.type();if(Db.FolderType.Inbox===c&&Sb.data().foldersInboxUnreadCount(b),a>0){if(Db.FolderType.Draft===c)return""+a;if(b>0&&Db.FolderType.Trash!==c&&Db.FolderType.Archive!==c&&Db.FolderType.SentItems!==c)return""+b}return""},this),this.canBeDeleted=c.computed(function(){var a=this.isSystemFolder();return!a&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=c.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){Fb.timeOutAction("folder-list-folder-visibility-change",function(){Pb.trigger("folder-list-folder-visibility-change")},100)}),this.localName=c.computed(function(){Ib.langChangeTrigger();var a=this.type(),b=this.name();if(this.isSystemFolder())switch(a){case Db.FolderType.Inbox:b=Fb.i18n("FOLDER_LIST/INBOX_NAME");break;case Db.FolderType.SentItems:b=Fb.i18n("FOLDER_LIST/SENT_NAME");break;case Db.FolderType.Draft:b=Fb.i18n("FOLDER_LIST/DRAFTS_NAME");break;case Db.FolderType.Spam:b=Fb.i18n("FOLDER_LIST/SPAM_NAME");break;case Db.FolderType.Trash:b=Fb.i18n("FOLDER_LIST/TRASH_NAME");break;case Db.FolderType.Archive:b=Fb.i18n("FOLDER_LIST/ARCHIVE_NAME")}return b},this),this.manageFolderSystemName=c.computed(function(){Ib.langChangeTrigger();var a="",b=this.type(),c=this.name();if(this.isSystemFolder())switch(b){case Db.FolderType.Inbox:a="("+Fb.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case Db.FolderType.SentItems:a="("+Fb.i18n("FOLDER_LIST/SENT_NAME")+")";break;case Db.FolderType.Draft:a="("+Fb.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case Db.FolderType.Spam:a="("+Fb.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case Db.FolderType.Trash:a="("+Fb.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case Db.FolderType.Archive:a="("+Fb.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==a&&"("+c+")"===a||"(inbox)"===a.toLowerCase())&&(a=""),a},this),this.collapsed=c.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(a){this.collapsedPrivate(a)},owner:this}),this.hasUnreadMessages=c.computed(function(){return 0"},D.prototype.formattedNameForCompose=function(){var a=this.name();return""===a?this.email():a+" ("+this.email()+")"},D.prototype.formattedNameForEmail=function(){var a=this.name();return""===a?this.email():'"'+Fb.quoteName(a)+'" <'+this.email()+">"},F.prototype.deleteCondition=function(a){this.conditions.remove(a)},F.prototype.addCondition=function(){this.conditions.push(new E)},F.prototype.parse=function(a){var b=!1;return a&&"Object/Filter"===a["@Object"]&&(this.name(Fb.pString(a.Name)),b=!0),b},G.prototype.index=0,G.prototype.id="",G.prototype.guid="",G.prototype.user="",G.prototype.email="",G.prototype.armor="",G.prototype.isPrivate=!1,Fb.extendAsViewModel("PopupsFolderClearViewModel",H),H.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},H.prototype.onShow=function(a){this.clearPopup(),a&&this.selectedFolder(a)},Fb.extendAsViewModel("PopupsFolderCreateViewModel",I),I.prototype.sNoParentText="",I.prototype.simpleFolderNameValidation=function(a){return/^[^\\\/]+$/g.test(Fb.trim(a))},I.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},I.prototype.onShow=function(){this.clearPopup()},I.prototype.onFocus=function(){this.folderName.focused(!0)},Fb.extendAsViewModel("PopupsFolderSystemViewModel",J),J.prototype.sChooseOnText="",J.prototype.sUnuseText="",J.prototype.onShow=function(a){var b="";switch(a=Fb.isUnd(a)?Db.SetSystemFoldersNotification.None:a){case Db.SetSystemFoldersNotification.Sent:b=Fb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case Db.SetSystemFoldersNotification.Draft:b=Fb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case Db.SetSystemFoldersNotification.Spam:b=Fb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case Db.SetSystemFoldersNotification.Trash:b=Fb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case Db.SetSystemFoldersNotification.Archive:b=Fb.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(b)},Fb.extendAsViewModel("PopupsComposeViewModel",K),K.prototype.openOpenPgpPopup=function(){if(this.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var a=this;Lb.showScreenPopup(R,[function(b){a.editor(function(a){a.setPlain(b)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},K.prototype.reloadDraftFolder=function(){var a=Sb.data().draftFolder();""!==a&&(Sb.cache().setFolderHash(a,""),Sb.data().currentFolderFullNameRaw()===a?Sb.reloadMessageList(!0):Sb.folderInformation(a))},K.prototype.findIdentityIdByMessage=function(a,b){var c={},d="",e=function(a){return a&&a.email&&c[a.email]?(d=c[a.email],!0):!1};if(this.bCapaAdditionalIdentities&&h.each(this.identities(),function(a){c[a.email()]=a.id}),c[Sb.data().accountEmail()]=Sb.data().accountEmail(),b)switch(a){case Db.ComposeType.Empty:d=Sb.data().accountEmail();break;case Db.ComposeType.Reply:case Db.ComposeType.ReplyAll:case Db.ComposeType.Forward:case Db.ComposeType.ForwardAsAttachment:h.find(h.union(b.to,b.cc,b.bcc,b.deliveredTo),e);break;case Db.ComposeType.Draft:h.find(h.union(b.from,b.replyTo),e)}else d=Sb.data().accountEmail();return d},K.prototype.selectIdentity=function(a){a&&this.currentIdentityID(a.optValue)},K.prototype.formattedFrom=function(a){var b=Sb.data().displayName(),c=Sb.data().accountEmail();return""===b?c:(Fb.isUnd(a)?1:!a)?b+" ("+c+")":'"'+Fb.quoteName(b)+'" <'+c+">"},K.prototype.sendMessageResponse=function(b,c){var d=!1,e="";this.sending(!1),Db.StorageResultType.Success===b&&c&&c.Result&&(d=!0,this.modalVisibility()&&Fb.delegateRun(this,"closeCommand")),this.modalVisibility()&&!d&&(c&&Db.Notification.CantSaveMessage===c.ErrorCode?(this.sendSuccessButSaveError(!0),a.alert(Fb.trim(Fb.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(e=Fb.getNotification(c&&c.ErrorCode?c.ErrorCode:Db.Notification.CantSendMessage,c&&c.ErrorMessage?c.ErrorMessage:""),this.sendError(!0),a.alert(e||Fb.getNotification(Db.Notification.CantSendMessage)))),this.reloadDraftFolder()},K.prototype.saveMessageResponse=function(b,c){var d=!1,e=null;this.saving(!1),Db.StorageResultType.Success===b&&c&&c.Result&&c.Result.NewFolder&&c.Result.NewUid&&(this.bFromDraft&&(e=Sb.data().message(),e&&this.draftFolder()===e.folderFullNameRaw&&this.draftUid()===e.uid&&Sb.data().message(null)),this.draftFolder(c.Result.NewFolder),this.draftUid(c.Result.NewUid),this.modalVisibility()&&(this.savedTime(Math.round((new a.Date).getTime()/1e3)),this.savedOrSendingText(0c;c++)e.push(a[c].toLine(!!b));return e.join(", ")};if(c=c||null,c&&Fb.isNormal(c)&&(v=Fb.isArray(c)&&1===c.length?c[0]:Fb.isArray(c)?null:c),null!==q&&(p[q]=!0,this.currentIdentityID(this.findIdentityIdByMessage(w,v))),this.reset(),Fb.isNonEmptyArray(d)&&this.to(x(d)),""!==w&&v){switch(j=v.fullFormatDateValue(),k=v.subject(),u=v.aDraftInfo,l=b(v.body).clone(),Fb.removeBlockquoteSwitcher(l),m=l.html(),w){case Db.ComposeType.Empty:break;case Db.ComposeType.Reply:this.to(x(v.replyEmails(p))),this.subject(Fb.replySubjectAdd("Re",k)),this.prepearMessageAttachments(v,w),this.aDraftInfo=["reply",v.uid,v.folderFullNameRaw],this.sInReplyTo=v.sMessageId,this.sReferences=Fb.trim(this.sInReplyTo+" "+v.sReferences);break;case Db.ComposeType.ReplyAll:o=v.replyAllEmails(p),this.to(x(o[0])),this.cc(x(o[1])),this.subject(Fb.replySubjectAdd("Re",k)),this.prepearMessageAttachments(v,w),this.aDraftInfo=["reply",v.uid,v.folderFullNameRaw],this.sInReplyTo=v.sMessageId,this.sReferences=Fb.trim(this.sInReplyTo+" "+v.references());break;case Db.ComposeType.Forward:this.subject(Fb.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(v,w),this.aDraftInfo=["forward",v.uid,v.folderFullNameRaw],this.sInReplyTo=v.sMessageId,this.sReferences=Fb.trim(this.sInReplyTo+" "+v.sReferences);break;case Db.ComposeType.ForwardAsAttachment:this.subject(Fb.replySubjectAdd("Fwd",k)),this.prepearMessageAttachments(v,w),this.aDraftInfo=["forward",v.uid,v.folderFullNameRaw],this.sInReplyTo=v.sMessageId,this.sReferences=Fb.trim(this.sInReplyTo+" "+v.sReferences);break;case Db.ComposeType.Draft:this.to(x(v.to)),this.cc(x(v.cc)),this.bcc(x(v.bcc)),this.bFromDraft=!0,this.draftFolder(v.folderFullNameRaw),this.draftUid(v.uid),this.subject(k),this.prepearMessageAttachments(v,w),this.aDraftInfo=Fb.isNonEmptyArray(u)&&3===u.length?u:null,this.sInReplyTo=v.sInReplyTo,this.sReferences=v.sReferences;break;case Db.ComposeType.EditAsNew:this.to(x(v.to)),this.cc(x(v.cc)),this.bcc(x(v.bcc)),this.subject(k),this.prepearMessageAttachments(v,w),this.aDraftInfo=Fb.isNonEmptyArray(u)&&3===u.length?u:null,this.sInReplyTo=v.sInReplyTo,this.sReferences=v.sReferences}switch(w){case Db.ComposeType.Reply:case Db.ComposeType.ReplyAll:f=v.fromToLine(!1,!0),n=Fb.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:j,EMAIL:f}),m="

"+n+":

"+m+"

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


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

"+m;break;case Db.ComposeType.ForwardAsAttachment:m=""}s&&""!==r&&Db.ComposeType.EditAsNew!==w&&Db.ComposeType.Draft!==w&&(m=this.convertSignature(r,x(v.from,!0))+"
"+m),this.editor(function(a){a.setHtml(m,!1),v.isHtml()||a.modeToggle(!1)})}else Db.ComposeType.Empty===w?(m=this.convertSignature(r),this.editor(function(a){a.setHtml(m,!1),Db.EditorDefaultType.Html!==Sb.data().editorDefaultType()&&a.modeToggle(!1)})):Fb.isNonEmptyArray(c)&&h.each(c,function(a){e.addMessageAsAttachment(a)});t=this.getAttachmentsDownloadsForUpload(),Fb.isNonEmptyArray(t)&&Sb.remote().messageUploadAttachments(function(a,b){if(Db.StorageResultType.Success===a&&b&&b.Result){var c=null,d="";if(!e.viewModelVisibility())for(d in b.Result)b.Result.hasOwnProperty(d)&&(c=e.getAttachmentById(b.Result[d]),c&&c.tempName(d))}else e.setMessageAttachmentFailedDowbloadText()},t),this.triggerForResize()},K.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},K.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},K.prototype.tryToClosePopup=function(){var a=this;Lb.showScreenPopup(V,[Fb.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){a.modalVisibility()&&Fb.delegateRun(a,"closeCommand")}])},K.prototype.onBuild=function(){this.initUploader();var a=this,c=null;j("ctrl+q, command+q",Db.KeyState.Compose,function(){return a.identitiesDropdownTrigger(!0),!1}),j("ctrl+s, command+s",Db.KeyState.Compose,function(){return a.saveCommand(),!1}),j("ctrl+enter, command+enter",Db.KeyState.Compose,function(){return a.sendCommand(),!1}),j("esc",Db.KeyState.Compose,function(){return a.tryToClosePopup(),!1}),Pb.on("resize",function(){a.triggerForResize()}),this.dropboxEnabled()&&(c=document.createElement("script"),c.type="text/javascript",c.src="https://www.dropbox.com/static/api/1/dropins.js",b(c).attr("id","dropboxjs").attr("data-app-key",Sb.settingsGet("DropboxApiKey")),document.body.appendChild(c))},K.prototype.getAttachmentById=function(a){for(var b=this.attachments(),c=0,d=b.length;d>c;c++)if(b[c]&&a===b[c].id)return b[c];return null},K.prototype.initUploader=function(){if(this.composeUploaderButton()){var a={},b=Fb.pInt(Sb.settingsGet("AttachmentLimit")),c=new g({action:Sb.link().upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});c?(c.on("onDragEnter",h.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",h.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",h.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",h.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",h.bind(function(b,c,d){var e=null;Fb.isUnd(a[b])?(e=this.getAttachmentById(b),e&&(a[b]=e)):e=a[b],e&&e.progress(" - "+Math.floor(c/d*100)+"%")},this)).on("onSelect",h.bind(function(a,d){this.dragAndDropOver(!1);var e=this,f=Fb.isUnd(d.FileName)?"":d.FileName.toString(),g=Fb.isNormal(d.Size)?Fb.pInt(d.Size):null,h=new z(a,f,g);return h.cancel=function(a){return function(){e.attachments.remove(function(b){return b&&b.id===a}),c&&c.cancel(a)}}(a),this.attachments.push(h),g>0&&b>0&&g>b?(h.error(Fb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",h.bind(function(b){var c=null;Fb.isUnd(a[b])?(c=this.getAttachmentById(b),c&&(a[b]=c)):c=a[b],c&&(c.waiting(!1),c.uploading(!0))},this)).on("onComplete",h.bind(function(b,c,d){var e="",f=null,g=null,h=this.getAttachmentById(b);g=c&&d&&d.Result&&d.Result.Attachment?d.Result.Attachment:null,f=d&&d.Result&&d.Result.ErrorCode?d.Result.ErrorCode:null,null!==f?e=Fb.getUploadErrorDescByCode(f):g||(e=Fb.i18n("UPLOAD/ERROR_UNKNOWN")),h&&(""!==e&&00&&d>0&&f>d?(e.uploading(!1),e.error(Fb.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(Sb.remote().composeUploadExternals(function(a,b){var c=!1;e.uploading(!1),Db.StorageResultType.Success===a&&b&&b.Result&&b.Result[e.id]&&(c=!0,e.tempName(b.Result[e.id])),c||e.error(Fb.getUploadErrorDescByCode(Db.UploadErrorCode.FileNoUploaded))},[a.link]),!0)},K.prototype.prepearMessageAttachments=function(a,b){if(a){var c=this,d=Fb.isNonEmptyArray(a.attachments())?a.attachments():[],e=0,f=d.length,g=null,h=null,i=!1,j=function(a){return function(){c.attachments.remove(function(b){return b&&b.id===a})}};if(Db.ComposeType.ForwardAsAttachment===b)this.addMessageAsAttachment(a);else for(;f>e;e++){switch(h=d[e],i=!1,b){case Db.ComposeType.Reply:case Db.ComposeType.ReplyAll:i=h.isLinked;break;case Db.ComposeType.Forward:case Db.ComposeType.Draft:case Db.ComposeType.EditAsNew:i=!0}i=!0,i&&(g=new z(h.download,h.fileName,h.estimatedSize,h.isInline,h.isLinked,h.cid,h.contentLocation),g.fromMessage=!0,g.cancel=j(h.download),g.waiting(!1).uploading(!0),this.attachments.push(g))}}},K.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(a){return a&&a.isLinked})},K.prototype.setMessageAttachmentFailedDowbloadText=function(){h.each(this.attachments(),function(a){a&&a.fromMessage&&a.waiting(!1).uploading(!1).error(Fb.getUploadErrorDescByCode(Db.UploadErrorCode.FileNoUploaded))},this)},K.prototype.isEmptyForm=function(a){a=Fb.isUnd(a)?!0:!!a;var b=a?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&b&&(!this.oEditor||""===this.oEditor.getData())},K.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)},K.prototype.getAttachmentsDownloadsForUpload=function(){return h.map(h.filter(this.attachments(),function(a){return a&&""===a.tempName()}),function(a){return a.id})},K.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},Fb.extendAsViewModel("PopupsContactsViewModel",L),L.prototype.getPropertyPlceholder=function(a){var b="";switch(a){case Db.ContactPropertyType.LastName:b="CONTACTS/PLACEHOLDER_ENTER_LAST_NAME";break;case Db.ContactPropertyType.FirstName:b="CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME";break;case Db.ContactPropertyType.Nick:b="CONTACTS/PLACEHOLDER_ENTER_NICK_NAME"}return b},L.prototype.addNewProperty=function(a,b){this.viewProperties.push(new w(a,b||"","",!0,this.getPropertyPlceholder(a)))},L.prototype.addNewOrFocusProperty=function(a,b){var c=h.find(this.viewProperties(),function(b){return a===b.type()});c?c.focused(!0):this.addNewProperty(a,b)},L.prototype.addNewTag=function(){this.viewTags.visibility(!0),this.viewTags.focusTrigger(!0)},L.prototype.addNewEmail=function(){this.addNewProperty(Db.ContactPropertyType.Email,"Home")},L.prototype.addNewPhone=function(){this.addNewProperty(Db.ContactPropertyType.Phone,"Mobile")},L.prototype.addNewWeb=function(){this.addNewProperty(Db.ContactPropertyType.Web)},L.prototype.addNewNickname=function(){this.addNewOrFocusProperty(Db.ContactPropertyType.Nick)},L.prototype.addNewNotes=function(){this.addNewOrFocusProperty(Db.ContactPropertyType.Note)},L.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(Db.ContactPropertyType.Birthday)},L.prototype.exportVcf=function(){Sb.download(Sb.link().exportContactsVcf())},L.prototype.exportCsv=function(){Sb.download(Sb.link().exportContactsCsv())},L.prototype.initUploader=function(){if(this.importUploaderButton()){var b=new g({action:Sb.link().uploadContacts(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,disableDragAndDrop:!0,disableMultiple:!0,disableDocumentDropPrevent:!0,clickElement:this.importUploaderButton()});b&&b.on("onStart",h.bind(function(){this.contacts.importing(!0)},this)).on("onComplete",h.bind(function(b,c,d){this.contacts.importing(!1),this.reloadContactList(),b&&c&&d&&d.Result||a.alert(Fb.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},L.prototype.removeCheckedOrSelectedContactsFromList=function(){var a=this,b=this.contacts,c=this.currentContact(),d=this.contacts().length,e=this.contactsCheckedOrSelected();0=d&&(this.bDropPageAfterDelete=!0),h.delay(function(){h.each(e,function(a){b.remove(a)})},500))},L.prototype.deleteSelectedContacts=function(){00?d:0),Fb.isNonEmptyArray(c.Result.Tags)&&(f=h.map(c.Result.Tags,function(a){var b=new x;return b.parse(a)?b:null}),f=h.compact(f))),b.contactsCount(d),b.contacts(e),b.contactTags(f),b.contacts.loading(!1),b.viewClearSearch(""!==b.search())},c,Cb.Defaults.ContactsPerPage,this.search())},L.prototype.onBuild=function(a){this.oContentVisible=b(".b-list-content",a),this.oContentScrollable=b(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,Db.KeyState.ContactList);var d=this;j("delete",Db.KeyState.ContactList,function(){return d.deleteCommand(),!1}),a.on("click",".e-pagenator .e-page",function(){var a=c.dataFor(this);a&&(d.contactsPage(Fb.pInt(a.value)),d.reloadContactList())}),this.initUploader()},L.prototype.onShow=function(){Lb.routeOff(),this.reloadContactList(!0)},L.prototype.onHide=function(){Lb.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},Fb.extendAsViewModel("PopupsAdvancedSearchViewModel",M),M.prototype.buildSearchStringValue=function(a){return-1 li"),e=c&&("tab"===c.shortcut||"right"===c.shortcut),f=d.index(d.filter(".active"));return!e&&f>0?f--:e&&f-1&&h.eq(f).removeClass("focused"),38===g&&f>0?f--:40===g&&fe)?(d.top<0?this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+d.top-a):this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+d.top-e+f+a),!0):!1},_.prototype.messagesDrop=function(a,b){if(a&&b&&b.helper){var c=b.helper.data("rl-folder"),d=Ob.hasClass("rl-ctrl-key-pressed"),e=b.helper.data("rl-uids");Fb.isNormal(c)&&""!==c&&Fb.isArray(e)&&Sb.moveMessagesToFolder(c,e,a.fullNameRaw,d)}},_.prototype.composeClick=function(){Lb.showScreenPopup(K)},_.prototype.createFolder=function(){Lb.showScreenPopup(I)},_.prototype.configureFolders=function(){Lb.setHash(Sb.link().settings("folders"))},_.prototype.contactsClick=function(){this.allowContacts&&Lb.showScreenPopup(L)},Fb.extendAsViewModel("MailBoxMessageListViewModel",ab),ab.prototype.emptySubjectValue="",ab.prototype.searchEnterAction=function(){this.mainMessageListSearch(this.sLastSearchValue),this.inputMessageListSearchFocus(!1)},ab.prototype.printableMessageCountForDeletion=function(){var a=this.messageListCheckedOrSelectedUidsWithSubMails().length;return a>1?" ("+(100>a?a:"99+")+")":""},ab.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},ab.prototype.moveSelectedMessagesToFolder=function(a,b){return this.canBeMoved()&&Sb.moveMessagesToFolder(Sb.data().currentFolderFullNameRaw(),Sb.data().messageListCheckedOrSelectedUidsWithSubMails(),a,b),!1},ab.prototype.dragAndDronHelper=function(a){a&&a.checked(!0);var b=Fb.draggeblePlace(),c=Sb.data().messageListCheckedOrSelectedUidsWithSubMails();return b.data("rl-folder",Sb.data().currentFolderFullNameRaw()),b.data("rl-uids",c),b.find(".text").text(""+c.length),h.defer(function(){var a=Sb.data().messageListCheckedOrSelectedUidsWithSubMails();b.data("rl-uids",a),b.find(".text").text(""+a.length)}),b},ab.prototype.onMessageResponse=function(a,b,c){var d=Sb.data();d.hideMessageBodies(),d.messageLoading(!1),Db.StorageResultType.Success===a&&b&&b.Result?d.setMessage(b,c):Db.StorageResultType.Unload===a?(d.message(null),d.messageError("")):Db.StorageResultType.Abort!==a&&(d.message(null),d.messageError(b&&b.ErrorCode?Fb.getNotification(b.ErrorCode):Fb.getNotification(Db.Notification.UnknownError)))},ab.prototype.populateMessageBody=function(a){a&&(Sb.remote().message(this.onMessageResponse,a.folderFullNameRaw,a.uid)?Sb.data().messageLoading(!0):Fb.log("Error: Unknown message request: "+a.folderFullNameRaw+" ~ "+a.uid+" [e-101]"))},ab.prototype.setAction=function(a,b,c){var d=[],e=null,f=Sb.cache(),g=0;if(Fb.isUnd(c)&&(c=Sb.data().messageListChecked()),d=h.map(c,function(a){return a.uid}),""!==a&&00?100>a?a:"99+":""},bb.prototype.verifyPgpSignedClearMessage=function(a){a&&a.verifyPgpSignedClearMessage()},bb.prototype.decryptPgpEncryptedMessage=function(a){a&&a.decryptPgpEncryptedMessage(this.viewPgpPassword())},bb.prototype.readReceipt=function(a){a&&""!==a.readReceipt()&&(Sb.remote().sendReadReceiptMessage(Fb.emptyFunction,a.folderFullNameRaw,a.uid,a.readReceipt(),Fb.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:a.subject()}),Fb.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":Sb.data().accountEmail()})),a.isReadReceipt(!0),Sb.cache().storeMessageFlagsToCache(a),Sb.reloadFlagsCurrentMessageListAndMessageFromCache())},Fb.extendAsViewModel("SettingsMenuViewModel",cb),cb.prototype.link=function(a){return Sb.link().settings(a)},cb.prototype.backToMailBoxClick=function(){Lb.setHash(Sb.link().inbox())},Fb.extendAsViewModel("SettingsPaneViewModel",db),db.prototype.onBuild=function(){var a=this;j("esc",Db.KeyState.Settings,function(){a.backToMailBoxClick()})},db.prototype.onShow=function(){Sb.data().message(null)},db.prototype.backToMailBoxClick=function(){Lb.setHash(Sb.link().inbox())},Fb.addSettingsViewModel(eb,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),eb.prototype.toggleLayout=function(){this.layout(Db.Layout.NoPreview===this.layout()?Db.Layout.SidePreview:Db.Layout.NoPreview)},eb.prototype.onBuild=function(){var a=this;h.delay(function(){var c=Sb.data(),d=Fb.settingsSaveHelperSimpleFunction(a.mppTrigger,a);c.language.subscribe(function(c){a.languageTrigger(Db.SaveSettingsStep.Animate),b.ajax({url:Sb.link().langLink(c),dataType:"script",cache:!0}).done(function(){Fb.i18nToDoc(),a.languageTrigger(Db.SaveSettingsStep.TrueResult)}).fail(function(){a.languageTrigger(Db.SaveSettingsStep.FalseResult)}).always(function(){h.delay(function(){a.languageTrigger(Db.SaveSettingsStep.Idle)},1e3)}),Sb.remote().saveSettings(Fb.emptyFunction,{Language:c})}),c.editorDefaultType.subscribe(function(a){Sb.remote().saveSettings(Fb.emptyFunction,{EditorDefaultType:a})}),c.messagesPerPage.subscribe(function(a){Sb.remote().saveSettings(d,{MPP:a})}),c.showImages.subscribe(function(a){Sb.remote().saveSettings(Fb.emptyFunction,{ShowImages:a?"1":"0"})}),c.interfaceAnimation.subscribe(function(a){Sb.remote().saveSettings(Fb.emptyFunction,{InterfaceAnimation:a})}),c.useDesktopNotifications.subscribe(function(a){Fb.timeOutAction("SaveDesktopNotifications",function(){Sb.remote().saveSettings(Fb.emptyFunction,{DesktopNotifications:a?"1":"0"})},3e3)}),c.replySameFolder.subscribe(function(a){Fb.timeOutAction("SaveReplySameFolder",function(){Sb.remote().saveSettings(Fb.emptyFunction,{ReplySameFolder:a?"1":"0"})},3e3)}),c.useThreads.subscribe(function(a){c.messageList([]),Sb.remote().saveSettings(Fb.emptyFunction,{UseThreads:a?"1":"0"})}),c.layout.subscribe(function(a){c.messageList([]),Sb.remote().saveSettings(Fb.emptyFunction,{Layout:a})}),c.useCheckboxesInList.subscribe(function(a){Sb.remote().saveSettings(Fb.emptyFunction,{UseCheckboxesInList:a?"1":"0"})})},50)},eb.prototype.onShow=function(){Sb.data().desktopNotifications.valueHasMutated()},eb.prototype.selectLanguage=function(){Lb.showScreenPopup(T)},Fb.addSettingsViewModel(fb,"SettingsContacts","SETTINGS_LABELS/LABEL_CONTACTS_NAME","contacts"),fb.prototype.onBuild=function(){Sb.data().contactsAutosave.subscribe(function(a){Sb.remote().saveSettings(Fb.emptyFunction,{ContactsAutosave:a?"1":"0"})})},Fb.addSettingsViewModel(gb,"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),gb.prototype.addNewAccount=function(){Lb.showScreenPopup(N)},gb.prototype.deleteAccount=function(b){if(b&&b.deleteAccess()){this.accountForDeletion(null);var c=function(a){return b===a};b&&(this.accounts.remove(c),Sb.remote().accountDelete(function(b,c){Db.StorageResultType.Success===b&&c&&c.Result&&c.Reload?(Lb.routeOff(),Lb.setHash(Sb.link().root(),!0),Lb.routeOff(),h.defer(function(){a.location.reload()})):Sb.accountsAndIdentities()},b.email))}},Fb.addSettingsViewModel(hb,"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),hb.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var a=this,b=Sb.data().signature();this.editor=new l(a.signatureDom(),function(){Sb.data().signature((a.editor.isHtml()?":HTML:":"")+a.editor.getData())},function(){":HTML:"===b.substr(0,6)?a.editor.setHtml(b.substr(6),!1):a.editor.setPlain(b,!1)})}},hb.prototype.onBuild=function(){var a=this;h.delay(function(){var b=Sb.data(),c=Fb.settingsSaveHelperSimpleFunction(a.displayNameTrigger,a),d=Fb.settingsSaveHelperSimpleFunction(a.replyTrigger,a),e=Fb.settingsSaveHelperSimpleFunction(a.signatureTrigger,a);b.displayName.subscribe(function(a){Sb.remote().saveSettings(c,{DisplayName:a})}),b.replyTo.subscribe(function(a){Sb.remote().saveSettings(d,{ReplyTo:a})}),b.signature.subscribe(function(a){Sb.remote().saveSettings(e,{Signature:a})}),b.signatureToAll.subscribe(function(a){Sb.remote().saveSettings(null,{SignatureToAll:a?"1":"0"})})},50)},Fb.addSettingsViewModel(ib,"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"),ib.prototype.addNewIdentity=function(){Lb.showScreenPopup(S)},ib.prototype.editIdentity=function(a){Lb.showScreenPopup(S,[a])},ib.prototype.deleteIdentity=function(a){if(a&&a.deleteAccess()){this.identityForDeletion(null);var b=function(b){return a===b};a&&(this.identities.remove(b),Sb.remote().identityDelete(function(){Sb.accountsAndIdentities()},a.id))}},ib.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var a=this,b=Sb.data().signature();this.editor=new l(a.signatureDom(),function(){Sb.data().signature((a.editor.isHtml()?":HTML:":"")+a.editor.getData())},function(){":HTML:"===b.substr(0,6)?a.editor.setHtml(b.substr(6),!1):a.editor.setPlain(b,!1)})}},ib.prototype.onBuild=function(a){var b=this;a.on("click",".identity-item .e-action",function(){var a=c.dataFor(this);a&&b.editIdentity(a)}),h.delay(function(){var a=Sb.data(),c=Fb.settingsSaveHelperSimpleFunction(b.displayNameTrigger,b),d=Fb.settingsSaveHelperSimpleFunction(b.replyTrigger,b),e=Fb.settingsSaveHelperSimpleFunction(b.signatureTrigger,b);a.displayName.subscribe(function(a){Sb.remote().saveSettings(c,{DisplayName:a})}),a.replyTo.subscribe(function(a){Sb.remote().saveSettings(d,{ReplyTo:a})}),a.signature.subscribe(function(a){Sb.remote().saveSettings(e,{Signature:a})}),a.signatureToAll.subscribe(function(a){Sb.remote().saveSettings(null,{SignatureToAll:a?"1":"0"})})},50)},Fb.addSettingsViewModel(jb,"SettingsFilters","SETTINGS_LABELS/LABEL_FILTERS_NAME","filters"),jb.prototype.deleteFilter=function(a){this.filters.remove(a)},jb.prototype.addFilter=function(){var a=new F;a.addCondition(),this.filters.push(a)},Fb.addSettingsViewModel(kb,"SettingsSecurity","SETTINGS_LABELS/LABEL_SECURITY_NAME","security"),kb.prototype.showSecret=function(){this.secreting(!0),Sb.remote().showTwoFactorSecret(this.onSecretResult)},kb.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},kb.prototype.createTwoFactor=function(){this.processing(!0),Sb.remote().createTwoFactor(this.onResult)},kb.prototype.enableTwoFactor=function(){this.processing(!0),Sb.remote().enableTwoFactor(this.onResult,this.viewEnable())},kb.prototype.testTwoFactor=function(){Lb.showScreenPopup(U)},kb.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),Sb.remote().clearTwoFactor(this.onResult)},kb.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},kb.prototype.onResult=function(a,b){if(this.processing(!1),this.clearing(!1),Db.StorageResultType.Success===a&&b&&b.Result?(this.viewUser(Fb.pString(b.Result.User)),this.viewEnable(!!b.Result.Enable),this.twoFactorStatus(!!b.Result.IsSet),this.viewSecret(Fb.pString(b.Result.Secret)),this.viewBackupCodes(Fb.pString(b.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(Fb.pString(b.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var c=this;this.viewEnable.subscribe(function(a){this.viewEnable.subs&&Sb.remote().enableTwoFactor(function(a,b){Db.StorageResultType.Success===a&&b&&b.Result||(c.viewEnable.subs=!1,c.viewEnable(!1),c.viewEnable.subs=!0)},a)},this)}},kb.prototype.onSecretResult=function(a,b){this.secreting(!1),Db.StorageResultType.Success===a&&b&&b.Result?(this.viewSecret(Fb.pString(b.Result.Secret)),this.viewUrl(Fb.pString(b.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},kb.prototype.onBuild=function(){this.processing(!0),Sb.remote().getTwoFactor(this.onResult)},Fb.addSettingsViewModel(lb,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),Fb.addSettingsViewModel(mb,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),mb.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},mb.prototype.onChangePasswordResponse=function(a,b){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),Db.StorageResultType.Success===a&&b&&b.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(b&&Db.Notification.CurrentPasswordIncorrect===b.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(b&&b.ErrorCode?Fb.getNotification(b.ErrorCode):Fb.getNotification(Db.Notification.CouldNotSaveNewPassword)))},Fb.addSettingsViewModel(nb,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),nb.prototype.folderEditOnEnter=function(a){var b=a?Fb.trim(a.nameForEdit()):"";""!==b&&a.name()!==b&&(Sb.local().set(Db.ClientSideKeyName.FoldersLashHash,""),Sb.data().foldersRenaming(!0),Sb.remote().folderRename(function(a,b){Sb.data().foldersRenaming(!1),Db.StorageResultType.Success===a&&b&&b.Result||Sb.data().foldersListError(b&&b.ErrorCode?Fb.getNotification(b.ErrorCode):Fb.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),Sb.folders()},a.fullNameRaw,b),Sb.cache().removeFolderFromCacheList(a.fullNameRaw),a.name(b)),a.edited(!1)},nb.prototype.folderEditOnEsc=function(a){a&&a.edited(!1)},nb.prototype.onShow=function(){Sb.data().foldersListError("")},nb.prototype.createFolder=function(){Lb.showScreenPopup(I)},nb.prototype.systemFolder=function(){Lb.showScreenPopup(J)},nb.prototype.deleteFolder=function(a){if(a&&a.canBeDeleted()&&a.deleteAccess()&&0===a.privateMessageCountAll()){this.folderForDeletion(null);var b=function(c){return a===c?!0:(c.subFolders.remove(b),!1)};a&&(Sb.local().set(Db.ClientSideKeyName.FoldersLashHash,""),Sb.data().folderList.remove(b),Sb.data().foldersDeleting(!0),Sb.remote().folderDelete(function(a,b){Sb.data().foldersDeleting(!1),Db.StorageResultType.Success===a&&b&&b.Result||Sb.data().foldersListError(b&&b.ErrorCode?Fb.getNotification(b.ErrorCode):Fb.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),Sb.folders()},a.fullNameRaw),Sb.cache().removeFolderFromCacheList(a.fullNameRaw))}else 00&&(c=this.messagesBodiesDom(),c&&(c.find(".rl-cache-class").each(function(){var c=b(this);d>c.data("rl-cache-count")&&(c.addClass("rl-cache-purge"),a++)}),a>0&&h.delay(function(){c.find(".rl-cache-purge").remove()},300)))},rb.prototype.populateDataOnStart=function(){qb.prototype.populateDataOnStart.call(this),this.accountEmail(Sb.settingsGet("Email")),this.accountIncLogin(Sb.settingsGet("IncLogin")),this.accountOutLogin(Sb.settingsGet("OutLogin")),this.projectHash(Sb.settingsGet("ProjectHash")),this.displayName(Sb.settingsGet("DisplayName")),this.replyTo(Sb.settingsGet("ReplyTo")),this.signature(Sb.settingsGet("Signature")),this.signatureToAll(!!Sb.settingsGet("SignatureToAll")),this.enableTwoFactor(!!Sb.settingsGet("EnableTwoFactor")),this.lastFoldersHash=Sb.local().get(Db.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!Sb.settingsGet("RemoteSuggestions"),this.devEmail=Sb.settingsGet("DevEmail"),this.devLogin=Sb.settingsGet("DevLogin"),this.devPassword=Sb.settingsGet("DevPassword")},rb.prototype.initUidNextAndNewMessages=function(b,c,d){if("INBOX"===b&&Fb.isNormal(c)&&""!==c){if(Fb.isArray(d)&&03)i(Sb.link().notificationMailIcon(),Sb.data().accountEmail(),Fb.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:g}));else for(;g>f;f++)i(Sb.link().notificationMailIcon(),A.emailsToLine(A.initEmailsFromJson(d[f].From),!1),d[f].Subject)}Sb.cache().setFolderUidNext(b,c)}},rb.prototype.folderResponseParseRec=function(a,b){var c=0,d=0,e=null,f=null,g="",h=[],i=[];for(c=0,d=b.length;d>c;c++)e=b[c],e&&(g=e.FullNameRaw,f=Sb.cache().getFolderFromCacheList(g),f||(f=B.newInstanceFromJson(e),f&&(Sb.cache().setFolderToCacheList(g,f),Sb.cache().setFolderFullNameRaw(f.fullNameHash,g))),f&&(f.collapsed(!Fb.isFolderExpanded(f.fullNameHash)),e.Extended&&(e.Extended.Hash&&Sb.cache().setFolderHash(f.fullNameRaw,e.Extended.Hash),Fb.isNormal(e.Extended.MessageCount)&&f.messageCountAll(e.Extended.MessageCount),Fb.isNormal(e.Extended.MessageUnseenCount)&&f.messageCountUnread(e.Extended.MessageUnseenCount)),h=e.SubFolders,h&&"Collection/FolderCollection"===h["@Object"]&&h["@Collection"]&&Fb.isArray(h["@Collection"])&&f.subFolders(this.folderResponseParseRec(a,h["@Collection"])),i.push(f)));return i},rb.prototype.setFolders=function(a){var b=[],c=!1,d=Sb.data(),e=function(a){return""===a||Cb.Values.UnuseOptionValue===a||null!==Sb.cache().getFolderFromCacheList(a)?a:""};a&&a.Result&&"Collection/FolderCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&Fb.isArray(a.Result["@Collection"])&&(Fb.isUnd(a.Result.Namespace)||(d.namespace=a.Result.Namespace),this.threading(!!Sb.settingsGet("UseImapThread")&&a.Result.IsThreadsSupported&&!0),b=this.folderResponseParseRec(d.namespace,a.Result["@Collection"]),d.folderList(b),a.Result.SystemFolders&&""==""+Sb.settingsGet("SentFolder")+Sb.settingsGet("DraftFolder")+Sb.settingsGet("SpamFolder")+Sb.settingsGet("TrashFolder")+Sb.settingsGet("ArchiveFolder")+Sb.settingsGet("NullFolder")&&(Sb.settingsSet("SentFolder",a.Result.SystemFolders[2]||null),Sb.settingsSet("DraftFolder",a.Result.SystemFolders[3]||null),Sb.settingsSet("SpamFolder",a.Result.SystemFolders[4]||null),Sb.settingsSet("TrashFolder",a.Result.SystemFolders[5]||null),Sb.settingsSet("ArchiveFolder",a.Result.SystemFolders[12]||null),c=!0),d.sentFolder(e(Sb.settingsGet("SentFolder"))),d.draftFolder(e(Sb.settingsGet("DraftFolder"))),d.spamFolder(e(Sb.settingsGet("SpamFolder"))),d.trashFolder(e(Sb.settingsGet("TrashFolder"))),d.archiveFolder(e(Sb.settingsGet("ArchiveFolder"))),c&&Sb.remote().saveSystemFolders(Fb.emptyFunction,{SentFolder:d.sentFolder(),DraftFolder:d.draftFolder(),SpamFolder:d.spamFolder(),TrashFolder:d.trashFolder(),ArchiveFolder:d.archiveFolder(),NullFolder:"NullFolder"}),Sb.local().set(Db.ClientSideKeyName.FoldersLashHash,a.Result.FoldersHash))},rb.prototype.hideMessageBodies=function(){var a=this.messagesBodiesDom();a&&a.find(".b-text-part").hide()},rb.prototype.getNextFolderNames=function(a){a=Fb.isUnd(a)?!1:!!a;var b=[],c=10,d=f().unix(),e=d-300,g=[],i=function(b){h.each(b,function(b){b&&"INBOX"!==b.fullNameRaw&&b.selectable&&b.existen&&e>b.interval&&(!a||b.subScribed())&&g.push([b.interval,b.fullNameRaw]),b&&0b[0]?1:0}),h.find(g,function(a){var e=Sb.cache().getFolderFromCacheList(a[1]);return e&&(e.interval=d,b.push(a[1])),c<=b.length}),h.uniq(b)},rb.prototype.removeMessagesFromList=function(a,b,c,d){c=Fb.isNormal(c)?c:"",d=Fb.isUnd(d)?!1:!!d,b=h.map(b,function(a){return Fb.pInt(a)});var e=0,f=Sb.data(),g=Sb.cache(),i=f.messageList(),j=Sb.cache().getFolderFromCacheList(a),k=""===c?null:g.getFolderFromCacheList(c||""),l=f.currentFolderFullNameRaw(),m=f.message(),n=l===a?h.filter(i,function(a){return a&&-10&&j.messageCountUnread(0<=j.messageCountUnread()-e?j.messageCountUnread()-e:0)),k&&(k.messageCountAll(k.messageCountAll()+b.length),e>0&&k.messageCountUnread(k.messageCountUnread()+e),k.actionBlink(!0)),0').hide().addClass("rl-cache-class"),g.data("rl-cache-count",++Ib.iMessageBodyCacheCount),Fb.isNormal(a.Result.Html)&&""!==a.Result.Html?(d=!0,g.html(a.Result.Html.toString()).addClass("b-text-part html")):Fb.isNormal(a.Result.Plain)&&""!==a.Result.Plain?(d=!1,j=a.Result.Plain.toString(),(n.isPgpSigned()||n.isPgpEncrypted())&&Sb.data().capaOpenPGP()&&Fb.isNormal(a.Result.PlainRaw)&&(n.plainRaw=Fb.pString(a.Result.PlainRaw),l=/---BEGIN PGP MESSAGE---/.test(n.plainRaw),l||(k=/-----BEGIN PGP SIGNED MESSAGE-----/.test(n.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(n.plainRaw)),Tb.empty(),k&&n.isPgpSigned()?j=Tb.append(b('
').text(n.plainRaw)).html():l&&n.isPgpEncrypted()&&(j=Tb.append(b('
').text(n.plainRaw)).html()),Tb.empty(),n.isPgpSigned(k),n.isPgpEncrypted(l)),g.html(j).addClass("b-text-part plain")):d=!1,n.isHtml(!!d),n.hasImages(!!e),n.pgpSignedVerifyStatus(Db.SignedVerifyStatus.None),n.pgpSignedVerifyUser(""),a.Result.Rtl&&(n.isRtl(!0),g.addClass("rtl-text-part")),n.body=g,n.body&&m.append(n.body),n.storeDataToDom(),f&&n.showInternalImages(!0),n.hasImages()&&this.showImages()&&n.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(n.body),this.hideMessageBodies(),n.body.show(),g&&Fb.initBlockquoteSwitcher(g)),Sb.cache().initMessageFlagsFromCache(n),n.unseen()&&Sb.setMessageSeen(n),Fb.windowResize())},rb.prototype.calculateMessageListHash=function(a){return h.map(a,function(a){return""+a.hash+"_"+a.threadsLen()+"_"+a.flagHash()}).join("|")},rb.prototype.setMessageList=function(a,b){if(a&&a.Result&&"Collection/MessageCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&Fb.isArray(a.Result["@Collection"])){var c=Sb.data(),d=Sb.cache(),e=null,g=0,h=0,i=0,j=0,k=[],l=f().unix(),m=c.staticMessageList,n=null,o=null,p=null,q=0,r=!1;for(i=Fb.pInt(a.Result.MessageResultCount),j=Fb.pInt(a.Result.Offset),Fb.isNonEmptyArray(a.Result.LastCollapsedThreadUids)&&(e=a.Result.LastCollapsedThreadUids),p=Sb.cache().getFolderFromCacheList(Fb.isNormal(a.Result.Folder)?a.Result.Folder:""),p&&!b&&(p.interval=l,Sb.cache().setFolderHash(a.Result.Folder,a.Result.FolderHash),Fb.isNormal(a.Result.MessageCount)&&p.messageCountAll(a.Result.MessageCount),Fb.isNormal(a.Result.MessageUnseenCount)&&(Fb.pInt(p.messageCountUnread())!==Fb.pInt(a.Result.MessageUnseenCount)&&(r=!0),p.messageCountUnread(a.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(p.fullNameRaw,a.Result.UidNext,a.Result.NewMessages)),r&&p&&Sb.cache().clearMessageFlagsFromCacheByFolder(p.fullNameRaw),g=0,h=a.Result["@Collection"].length;h>g;g++)n=a.Result["@Collection"][g],n&&"Object/Message"===n["@Object"]&&(o=m[g],o&&o.initByJson(n)||(o=A.newInstanceFromJson(n)),o&&(d.hasNewMessageAndRemoveFromCache(o.folderFullNameRaw,o.uid)&&5>=q&&(q++,o.newForAnimation(!0)),o.deleted(!1),b?Sb.cache().initMessageFlagsFromCache(o):Sb.cache().storeMessageFlagsToCache(o),o.lastInCollapsedThread(e&&-1(new a.Date).getTime()-l),n&&i.oRequests[n]&&(i.oRequests[n].__aborted&&(e="abort"),i.oRequests[n]=null),i.defaultResponse(c,n,e,b,f,d)}),n&&00?(this.defaultRequest(a,"Message",{},null,"Message/"+Hb.urlsafe_encode([b,c,Sb.data().projectHash(),Sb.data().threading()&&Sb.data().useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},tb.prototype.composeUploadExternals=function(a,b){this.defaultRequest(a,"ComposeUploadExternals",{Externals:b},999e3)},tb.prototype.folderInformation=function(a,b,c){var d=!0,e=Sb.cache(),f=[];Fb.isArray(c)&&0").addClass("rl-settings-view-model").hide(),i.appendTo(g),e.data=Sb.data(),e.viewModelDom=i,e.__rlSettingsData=f.__rlSettingsData,f.__dom=i,f.__builded=!0,f.__vm=e,c.applyBindingAccessorsToNode(i[0],{i18nInit:!0,template:function(){return{name:f.__rlSettingsData.Template}}},e),Fb.delegateRun(e,"onBuild",[i])):Fb.log("Cannot find sub settings view model position: SettingsSubScreen")),e&&h.defer(function(){d.oCurrentSubScreen&&(Fb.delegateRun(d.oCurrentSubScreen,"onHide"),d.oCurrentSubScreen.viewModelDom.hide()),d.oCurrentSubScreen=e,d.oCurrentSubScreen&&(d.oCurrentSubScreen.viewModelDom.show(),Fb.delegateRun(d.oCurrentSubScreen,"onShow"),Fb.delegateRun(d.oCurrentSubScreen,"onFocus",[],200),h.each(d.menu(),function(a){a.selected(e&&e.__rlSettingsData&&a.route===e.__rlSettingsData.Route)}),b("#rl-content .b-settings .b-content .content").scrollTop(0)),Fb.windowResize()})):Lb.setHash(Sb.link().settings(),!1,!0)},wb.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(Fb.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},wb.prototype.onBuild=function(){h.each(Jb.settings,function(a){a&&a.__rlSettingsData&&!h.find(Jb["settings-removed"],function(b){return b&&b===a})&&this.menu.push({route:a.__rlSettingsData.Route,label:a.__rlSettingsData.Label,selected:c.observable(!1),disabled:!!h.find(Jb["settings-disabled"],function(b){return b&&b===a})})},this),this.oViewModelPlace=b("#rl-content #rl-settings-subscreen")},wb.prototype.routes=function(){var a=h.find(Jb.settings,function(a){return a&&a.__rlSettingsData&&a.__rlSettingsData.IsDefault}),b=a?a.__rlSettingsData.Route:"general",c={subname:/^(.*)$/,normalize_:function(a,c){return c.subname=Fb.isUnd(c.subname)?b:Fb.pString(c.subname),[c.subname]}};return[["{subname}/",c],["{subname}",c],["",c]]},h.extend(xb.prototype,s.prototype),xb.prototype.onShow=function(){Sb.setTitle("")},h.extend(yb.prototype,s.prototype),yb.prototype.oLastRoute={},yb.prototype.setNewTitle=function(){var a=Sb.data().accountEmail(),b=Sb.data().foldersInboxUnreadCount();Sb.setTitle((""===a?"":(b>0?"("+b+") ":" ")+a+" - ")+Fb.i18n("TITLES/MAILBOX"))},yb.prototype.onShow=function(){this.setNewTitle(),Sb.data().keyScope(Db.KeyState.MessageList)
-},yb.prototype.onRoute=function(a,b,c,d){if(Fb.isUnd(d)?1:!d){var e=Sb.data(),f=Sb.cache().getFolderFullNameRaw(a),g=Sb.cache().getFolderFromCacheList(f);g&&(e.currentFolder(g).messageListPage(b).messageListSearch(c),Db.Layout.NoPreview===e.layout()&&e.message()&&(e.message(null),e.messageFullScreenMode(!1)),Sb.reloadMessageList())}else Db.Layout.NoPreview!==Sb.data().layout()||Sb.data().message()||Sb.historyBack()},yb.prototype.onStart=function(){var a=Sb.data(),b=function(){Fb.windowResize()};(Sb.capa(Db.Capa.AdditionalAccounts)||Sb.capa(Db.Capa.AdditionalIdentities))&&Sb.accountsAndIdentities(),h.delay(function(){"INBOX"!==a.currentFolderFullNameRaw()&&Sb.folderInformation("INBOX")},1e3),h.delay(function(){Sb.quota()},5e3),h.delay(function(){Sb.remote().appDelayStart(Fb.emptyFunction)},35e3),Ob.toggleClass("rl-no-preview-pane",Db.Layout.NoPreview===a.layout()),a.folderList.subscribe(b),a.messageList.subscribe(b),a.message.subscribe(b),a.layout.subscribe(function(a){Ob.toggleClass("rl-no-preview-pane",Db.Layout.NoPreview===a)}),a.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},yb.prototype.routes=function(){var a=function(){return["Inbox",1,"",!0]},b=function(a,b){return b[0]=Fb.pString(b[0]),b[1]=Fb.pInt(b[1]),b[1]=0>=b[1]?1:b[1],b[2]=Fb.pString(b[2]),""===a&&(b[0]="Inbox",b[1]=1),[decodeURI(b[0]),b[1],decodeURI(b[2]),!1]},c=function(a,b){return b[0]=Fb.pString(b[0]),b[1]=Fb.pString(b[1]),""===a&&(b[0]="Inbox"),[decodeURI(b[0]),1,decodeURI(b[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:b}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:b}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:c}],[/^message-preview$/,{normalize_:a}],[/^([^\/]*)$/,{normalize_:b}]]},h.extend(zb.prototype,wb.prototype),zb.prototype.onShow=function(){Sb.setTitle(this.sSettingsTitle),Sb.data().keyScope(Db.KeyState.Settings)},h.extend(Ab.prototype,q.prototype),Ab.prototype.oSettings=null,Ab.prototype.oPlugins=null,Ab.prototype.oLocal=null,Ab.prototype.oLink=null,Ab.prototype.oSubs={},Ab.prototype.download=function(b){var c=null,d=null,e=navigator.userAgent.toLowerCase();return e&&(e.indexOf("chrome")>-1||e.indexOf("chrome")>-1)&&(c=document.createElement("a"),c.href=b,document.createEvent&&(d=document.createEvent("MouseEvents"),d&&d.initEvent&&c.dispatchEvent))?(d.initEvent("click",!0,!0),c.dispatchEvent(d),!0):(Ib.bMobileDevice?(a.open(b,"_self"),a.focus()):this.iframe.attr("src",b),!0)},Ab.prototype.link=function(){return null===this.oLink&&(this.oLink=new k),this.oLink},Ab.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new p),this.oLocal},Ab.prototype.settingsGet=function(a){return null===this.oSettings&&(this.oSettings=Fb.isNormal(Mb)?Mb:{}),Fb.isUnd(this.oSettings[a])?null:this.oSettings[a]},Ab.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=Fb.isNormal(Mb)?Mb:{}),this.oSettings[a]=b},Ab.prototype.setTitle=function(b){b=(Fb.isNormal(b)&&0l;l++)q.push({id:e[l][0],name:e[l][1],system:!1,seporator:!1,disabled:!1});for(o=!0,l=0,m=b.length;m>l;l++)n=b[l],(h?h.call(null,n):!0)&&(o&&0l;l++)n=c[l],(n.subScribed()||!n.existen)&&(h?h.call(null,n):!0)&&(Db.FolderType.User===n.type()||!j||0=5?e:20,e=320>=e?e:320,a.setInterval(function(){Sb.contactsSync()},6e4*e+5e3),h.delay(function(){Sb.contactsSync()},5e3),h.delay(function(){Sb.folderInformationMultiply(!0)},500),h.delay(function(){Sb.emailsPicsHashes(),Sb.remote().servicesPics(function(a,b){Db.StorageResultType.Success===a&&b&&b.Result&&Sb.cache().setServicesData(b.Result)})},2e3),Gb.runHook("rl-start-user-screens"),Sb.pub("rl.bootstart-user-screens"),Sb.settingsGet("AccountSignMe")&&a.navigator.registerProtocolHandler&&h.delay(function(){try{a.navigator.registerProtocolHandler("mailto",a.location.protocol+"//"+a.location.host+a.location.pathname+"?mailto&to=%s",""+(Sb.settingsGet("Title")||"RainLoop"))}catch(b){}Sb.settingsGet("MailToEmail")&&Sb.mailToHelper(Sb.settingsGet("MailToEmail"))},500)):(Lb.startScreens([xb]),Gb.runHook("rl-start-login-screens"),Sb.pub("rl.bootstart-login-screens")),a.SimplePace&&a.SimplePace.set(100),Ib.bMobileDevice||h.defer(function(){Fb.initLayoutResizer("#rl-left","#rl-right",Db.ClientSideKeyName.FolderListSize)})},this))):(c=Fb.pString(Sb.settingsGet("CustomLoginLink")),c?(Lb.routeOff(),Lb.setHash(Sb.link().root(),!0),Lb.routeOff(),h.defer(function(){a.location.href=c})):(Lb.hideLoading(),Lb.startScreens([xb]),Gb.runHook("rl-start-login-screens"),Sb.pub("rl.bootstart-login-screens"),a.SimplePace&&a.SimplePace.set(100))),f&&(a["rl_"+d+"_google_service"]=function(){Sb.data().googleActions(!0),Sb.socialUsers()}),g&&(a["rl_"+d+"_facebook_service"]=function(){Sb.data().facebookActions(!0),Sb.socialUsers()}),i&&(a["rl_"+d+"_twitter_service"]=function(){Sb.data().twitterActions(!0),Sb.socialUsers()}),Sb.sub("interval.1m",function(){Ib.momentTrigger(!Ib.momentTrigger())}),Gb.runHook("rl-start-screens"),Sb.pub("rl.bootstart-end")},Sb=new Bb,Ob.addClass(Ib.bMobileDevice?"mobile":"no-mobile"),Pb.keydown(Fb.killCtrlAandS).keyup(Fb.killCtrlAandS),Pb.unload(function(){Ib.bUnload=!0}),Ob.on("click.dropdown.data-api",function(){Fb.detectDropdownVisibility()}),a.rl=a.rl||{},a.rl.addHook=Gb.addHook,a.rl.settingsGet=Gb.mainSettingsGet,a.rl.remoteRequest=Gb.remoteRequest,a.rl.pluginSettingsGet=Gb.settingsGet,a.rl.addSettingsViewModel=Fb.addSettingsViewModel,a.rl.createCommand=Fb.createCommand,a.rl.EmailModel=u,a.rl.Enums=Db,a.__RLBOOT=function(c){b(function(){a.rainloopTEMPLATES&&a.rainloopTEMPLATES[0]?(b("#rl-templates").html(a.rainloopTEMPLATES[0]),h.delay(function(){a.rainloopAppData={},a.rainloopI18N={},a.rainloopTEMPLATES={},Lb.setBoot(Sb).bootstart(),Ob.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},50)):c(!1),a.__RLBOOT=null})},a.SimplePace&&a.SimplePace.add(10)}(window,jQuery,ko,crossroads,hasher,moment,Jua,_,ifvisible,key);
\ No newline at end of file
+!function(e,t,s,i,o,n,a,r,l,c){"use strict";function u(){this.sBase="#/",this.sVersion=qt.settingsGet("Version"),this.sSpecSuffix=qt.settingsGet("AuthAccountHash")||"0",this.sServer=(qt.settingsGet("IndexFile")||"./")+"?"}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 L(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 I(){}function P(){this.enabled=s.observable(!0),this.conditions=s.observableArray([]),this.action=s.observable(Lt.FiltersAction.None)}function M(e,t,i,o,n,a,r){this.index=e,this.id=i,this.guid=t,this.user=o,this.email=n,this.armor=r,this.isPrivate=!!a,this.deleteAccess=s.observable(!1)}function D(){b.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=s.observable(null),this.clearingProcess=s.observable(!1),this.clearingError=s.observable(""),this.folderFullNameForClear=s.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=s.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=s.computed(function(){return Pt.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=Pt.createCommand(this,function(){var e=this,t=this.selectedFolder();t&&(qt.data().message(null),qt.data().messageList([]),this.clearingProcess(!0),qt.cache().setFolderHash(t.fullNameRaw,""),qt.remote().folderClear(function(t,s){e.clearingProcess(!1),Lt.StorageResultType.Success===t&&s&&s.Result?(qt.reloadMessageList(!0),e.cancelCommand()):e.clearingError(s&&s.ErrorCode?Pt.getNotification(s.ErrorCode):Pt.getNotification(Lt.Notification.MailServerError))},t.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),S.constructorEnd(this)}function O(){b.call(this,"Popups","PopupsFolderCreate"),Pt.initOnStartOrLangChange(function(){this.sNoParentText=Pt.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=s.observable(""),this.folderName.focused=s.observable(!1),this.selectedParentValue=s.observable(Rt.Values.UnuseOptionValue),this.parentFolderSelectList=s.computed(function(){var e=qt.data(),t=[],s=null,i=null,o=e.folderList(),n=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return t.push(["",this.sNoParentText]),""!==e.namespace&&(s=function(t){return e.namespace!==t.fullNameRaw.substr(0,e.namespace.length)}),qt.folderListOptionsBuilder([],o,[],t,null,s,i,n)},this),this.createFolder=Pt.createCommand(this,function(){var e=qt.data(),t=this.selectedParentValue();""===t&&1=e?1:e},this),this.contactsPagenator=s.computed(Pt.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(),qt.reloadOpenPgpKeys(),Pt.delegateRun(this,"cancelCommand"),!0}),S.constructorEnd(this)}function B(){b.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=s.observable(""),this.keyDom=s.observable(null),S.constructorEnd(this)}function G(){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=Pt.createCommand(this,function(){var t=this,s="",i=null,o=qt.data().openpgpKeyring;return this.email.error(""===Pt.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,Pt.pInt(t.keyBitLength()),s,Pt.trim(t.password())),i&&i.privateKeyArmored&&(o.privateKeys.importKey(i.privateKeyArmored),o.publicKeys.importKey(i.publicKeyArmored),o.store(),qt.reloadOpenPgpKeys(),Pt.delegateRun(t,"cancelCommand")),t.submitRequest(!1)},100),!0)}),S.constructorEnd(this)}function K(){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=Pt.createCommand(this,function(){var t=this,s=!0,i=qt.data(),o=null,n=[];this.submitRequest(!0),s&&this.sign()&&""===this.from()&&(this.notification(Pt.i18n("PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL")),s=!1),s&&this.sign()&&(o=i.findPrivateKeyByEmail(this.from(),this.password()),o||(this.notification(Pt.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR",{EMAIL:this.from()})),s=!1)),s&&this.encrypt()&&0===this.to().length&&(this.notification(Pt.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(Pt.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&&!Pt.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})),qt.remote().saveSettings(null,{Theme:s})},this)}function gt(){this.openpgpkeys=qt.data().openpgpkeys,this.openpgpkeysPublic=qt.data().openpgpkeysPublic,this.openpgpkeysPrivate=qt.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 ft(){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?Pt.disableKeyFilter():Pt.restoreKeyFilter(),this.keyScopeFake(e),Ot.dropdownVisibility()&&(e=Lt.KeyState.Menu)),this.keyScopeReal(e)}}),this.keyScopeReal.subscribe(function(e){c.setScope(e)}),this.leftPanelDisabled.subscribe(function(e){qt.pub("left-panel."+(e?"off":"on"))}),Ot.dropdownVisibility.subscribe(function(e){e?(Ot.tooltipTrigger(!Ot.tooltipTrigger()),this.keyScope(Lt.KeyState.Menu)):Lt.KeyState.Menu===c.getScope()&&this.keyScope(this.keyScopeFake())},this),Pt.initDataConstructorBySettings(this)}function bt(){ft.call(this);var i=function(e){return function(){var t=qt.cache().getFolderFromCacheList(e());t&&t.type(Lt.FolderType.User)}},o=function(e){return function(t){var s=qt.cache().getFolderFromCacheList(t);s&&s.type(e)}};this.devEmail="",this.devLogin="",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()||Rt.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.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(!!qt.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync=s.observable(!!qt.settingsGet("EnableContactsSync")),this.contactsSyncUrl=s.observable(qt.settingsGet("ContactsSyncUrl")),this.contactsSyncUser=s.observable(qt.settingsGet("ContactsSyncUser")),this.contactsSyncPass=s.observable(qt.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 Pt.isArray(t)&&0=e?1:e},this),this.mainMessageListSearch=s.computed({read:this.messageListSearch,write:function(e){Ut.setHash(qt.link().mailBox(this.currentFolderFullNameHash(),1,Pt.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===qt.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 yt(){this.oRequests={}}function St(){yt.call(this),this.oRequests={}}function vt(){this.oEmailsPicsHashes={},this.oServices={},this.bCapaGravatar=qt.capa(Lt.Capa.Gravatar)}function Ct(){vt.call(this),this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={}}function wt(e){y.call(this,"settings",e),this.menu=s.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}function Tt(){y.call(this,"login",[J])}function Ft(){y.call(this,"mailbox",[X,Z,et,tt]),this.oLastRoute={}}function At(){wt.call(this,[Q,st,it]),Pt.initOnStartOrLangChange(function(){this.sSettingsTitle=Pt.i18n("TITLES/SETTINGS")},this,function(){qt.setTitle(this.sSettingsTitle)})}function Et(){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"),Bt.on("error",function(e){qt&&e&&e.originalEvent&&e.originalEvent.message&&-1===Pt.inArray(e.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&qt.remote().jsError(Pt.emptyFunction,e.originalEvent.message,e.originalEvent.filename,e.originalEvent.lineno,location&&location.toString?location.toString():"",Ht.attr("class"),Pt.microtime()-Ot.now)}),Gt.on("keydown",function(e){e&&e.ctrlKey&&Ht.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&Ht.removeClass("rl-ctrl-key-pressed")})}function Nt(){Et.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(){qt.pub("interval.30s")},3e4),e.setInterval(function(){qt.pub("interval.1m")},6e4),e.setInterval(function(){qt.pub("interval.2m")},12e4),e.setInterval(function(){qt.pub("interval.3m")},18e4),e.setInterval(function(){qt.pub("interval.5m")},3e5),e.setInterval(function(){qt.pub("interval.10m")},6e5),e.setTimeout(function(){e.setInterval(function(){qt.pub("interval.10m-after5m")},6e5)},3e5),t.wakeUp(function(){qt.remote().jsVersion(function(t,s){Lt.StorageResultType.Success===t&&s&&!s.Result&&(e.parent&&qt.settingsGet("InIframe")?e.parent.location.reload():e.location.reload())},qt.settingsGet("Version"))},{},36e5)}var Rt={},Lt={},It={},Pt={},Mt={},Dt={},Ot={},kt={settings:[],"settings-removed":[],"settings-disabled":[]},_t=[],Ut=null,xt=e.rainloopAppData||{},Vt=e.rainloopI18N||{},Ht=t("html"),Bt=t(e),Gt=t(e.document),Kt=e.Notification&&e.Notification.requestPermission?e.Notification:null,qt=null,jt=t("
");Ot.now=(new Date).getTime(),Ot.momentTrigger=s.observable(!0),Ot.dropdownVisibility=s.observable(!1).extend({rateLimit:0}),Ot.tooltipTrigger=s.observable(!1).extend({rateLimit:0}),Ot.langChangeTrigger=s.observable(!0),Ot.iAjaxErrorCount=0,Ot.iTokenErrorCount=0,Ot.iMessageBodyCacheCount=0,Ot.bUnload=!1,Ot.sUserAgent=(navigator.userAgent||"").toLowerCase(),Ot.bIsiOSDevice=-1/g,">").replace(/"/g,""").replace(/'/g,"'"):""},Pt.splitPlainText=function(e,t){var s="",i="",o=e,n=0,a=0;for(t=Pt.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},Pt.timeOutAction=function(){var t={};return function(s,i,o){Pt.isUnd(t[s])&&(t[s]=0),e.clearTimeout(t[s]),t[s]=e.setTimeout(i,o)}}(),Pt.timeOutActionSecond=function(){var t={};return function(s,i,o){t[s]||(t[s]=e.setTimeout(function(){i(),t[s]=0},o))}}(),Pt.audio=function(){var t=!1;return function(s,i){if(!1===t)if(Ot.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}}(),Pt.hos=function(e,t){return e&&Object.hasOwnProperty?Object.hasOwnProperty.call(e,t):!1},Pt.i18n=function(e,t,s){var i="",o=Pt.isUnd(Vt[e])?Pt.isUnd(s)?e:s:Vt[e];if(!Pt.isUnd(t)&&!Pt.isNull(t))for(i in t)Pt.hos(t,i)&&(o=o.replace("%"+i+"%",t[i]));return o},Pt.i18nToNode=function(e){r.defer(function(){t(".i18n",e).each(function(){var e=t(this),s="";s=e.data("i18n-text"),s?e.text(Pt.i18n(s)):(s=e.data("i18n-html"),s&&e.html(Pt.i18n(s)),s=e.data("i18n-placeholder"),s&&e.attr("placeholder",Pt.i18n(s)),s=e.data("i18n-title"),s&&e.attr("title",Pt.i18n(s)))})})},Pt.i18nToDoc=function(){e.rainloopI18N&&(Vt=e.rainloopI18N||{},Pt.i18nToNode(Gt),Ot.langChangeTrigger(!Ot.langChangeTrigger())),e.rainloopI18N={}},Pt.initOnStartOrLangChange=function(e,t,s){e&&e.call(t),s?Ot.langChangeTrigger.subscribe(function(){e&&e.call(t),s.call(t)}):e&&Ot.langChangeTrigger.subscribe(e,t)},Pt.inFocus=function(){return document.activeElement?(Pt.isUnd(document.activeElement.__inFocusCache)&&(document.activeElement.__inFocusCache=t(document.activeElement).is("input,textarea,iframe,.cke_editable")),!!document.activeElement.__inFocusCache):!1},Pt.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var e=t(document.activeElement);e.is("input,textarea")&&document.activeElement.blur()}},Pt.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()},Pt.replySubjectAdd=function(t,s,i){var o=null,n=Pt.trim(s);return n=null===(o=new e.RegExp("^"+t+"[\\s]?\\:(.*)$","gi").exec(s))||Pt.isUnd(o[1])?null===(o=new e.RegExp("^("+t+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(s))||Pt.isUnd(o[1])||Pt.isUnd(o[2])||Pt.isUnd(o[3])?t+": "+s:o[1]+(Pt.pInt(o[2])+1)+o[3]:t+"[2]: "+o[1],n=n.replace(/[\s]+/g," "),n=(Pt.isUnd(i)?!0:i)?Pt.fixLongSubject(n):n},Pt.fixLongSubject=function(e){var t=0,s=null;e=Pt.trim(e.replace(/[\s]+/," "));do s=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!s||Pt.isUnd(s[0]))&&(s=null),s&&(t=0,t+=Pt.isUnd(s[2])?1:0+Pt.pInt(s[2]),t+=Pt.isUnd(s[4])?1:0+Pt.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]+/," ")},Pt.roundNumber=function(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)},Pt.friendlySize=function(e){return e=Pt.pInt(e),e>=1073741824?Pt.roundNumber(e/1073741824,1)+"GB":e>=1048576?Pt.roundNumber(e/1048576,1)+"MB":e>=1024?Pt.roundNumber(e/1024,0)+"KB":e+"B"},Pt.log=function(t){e.console&&e.console.log&&e.console.log(t)},Pt.getNotification=function(e,t){return e=Pt.pInt(e),Lt.Notification.ClientViewError===e&&t?t:Pt.isUnd(It[e])?"":It[e]},Pt.initNotificationLanguage=function(){It[Lt.Notification.InvalidToken]=Pt.i18n("NOTIFICATIONS/INVALID_TOKEN"),It[Lt.Notification.AuthError]=Pt.i18n("NOTIFICATIONS/AUTH_ERROR"),It[Lt.Notification.AccessError]=Pt.i18n("NOTIFICATIONS/ACCESS_ERROR"),It[Lt.Notification.ConnectionError]=Pt.i18n("NOTIFICATIONS/CONNECTION_ERROR"),It[Lt.Notification.CaptchaError]=Pt.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),It[Lt.Notification.SocialFacebookLoginAccessDisable]=Pt.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),It[Lt.Notification.SocialTwitterLoginAccessDisable]=Pt.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),It[Lt.Notification.SocialGoogleLoginAccessDisable]=Pt.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),It[Lt.Notification.DomainNotAllowed]=Pt.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),It[Lt.Notification.AccountNotAllowed]=Pt.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),It[Lt.Notification.AccountTwoFactorAuthRequired]=Pt.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),It[Lt.Notification.AccountTwoFactorAuthError]=Pt.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),It[Lt.Notification.CouldNotSaveNewPassword]=Pt.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),It[Lt.Notification.CurrentPasswordIncorrect]=Pt.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),It[Lt.Notification.NewPasswordShort]=Pt.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),It[Lt.Notification.NewPasswordWeak]=Pt.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),It[Lt.Notification.NewPasswordForbidden]=Pt.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),It[Lt.Notification.ContactsSyncError]=Pt.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),It[Lt.Notification.CantGetMessageList]=Pt.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),It[Lt.Notification.CantGetMessage]=Pt.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),It[Lt.Notification.CantDeleteMessage]=Pt.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),It[Lt.Notification.CantMoveMessage]=Pt.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),It[Lt.Notification.CantCopyMessage]=Pt.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),It[Lt.Notification.CantSaveMessage]=Pt.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),It[Lt.Notification.CantSendMessage]=Pt.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),It[Lt.Notification.InvalidRecipients]=Pt.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),It[Lt.Notification.CantCreateFolder]=Pt.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),It[Lt.Notification.CantRenameFolder]=Pt.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),It[Lt.Notification.CantDeleteFolder]=Pt.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),It[Lt.Notification.CantDeleteNonEmptyFolder]=Pt.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),It[Lt.Notification.CantSubscribeFolder]=Pt.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),It[Lt.Notification.CantUnsubscribeFolder]=Pt.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),It[Lt.Notification.CantSaveSettings]=Pt.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),It[Lt.Notification.CantSavePluginSettings]=Pt.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),It[Lt.Notification.DomainAlreadyExists]=Pt.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),It[Lt.Notification.CantInstallPackage]=Pt.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),It[Lt.Notification.CantDeletePackage]=Pt.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),It[Lt.Notification.InvalidPluginPackage]=Pt.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),It[Lt.Notification.UnsupportedPluginPackage]=Pt.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),It[Lt.Notification.LicensingServerIsUnavailable]=Pt.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),It[Lt.Notification.LicensingExpired]=Pt.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),It[Lt.Notification.LicensingBanned]=Pt.i18n("NOTIFICATIONS/LICENSING_BANNED"),It[Lt.Notification.DemoSendMessageError]=Pt.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),It[Lt.Notification.AccountAlreadyExists]=Pt.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),It[Lt.Notification.MailServerError]=Pt.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),It[Lt.Notification.UnknownNotification]=Pt.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),It[Lt.Notification.UnknownError]=Pt.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},Pt.getUploadErrorDescByCode=function(e){var t="";switch(Pt.pInt(e)){case Lt.UploadErrorCode.FileIsTooBig:t=Pt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case Lt.UploadErrorCode.FilePartiallyUploaded:t=Pt.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case Lt.UploadErrorCode.FileNoUploaded:t=Pt.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case Lt.UploadErrorCode.MissingTempFolder:t=Pt.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case Lt.UploadErrorCode.FileOnSaveingError:t=Pt.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case Lt.UploadErrorCode.FileType:t=Pt.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=Pt.i18n("UPLOAD/ERROR_UNKNOWN")}return t},Pt.delegateRun=function(e,t,s,i){e&&e[t]&&(i=Pt.pInt(i),0>=i?e[t].apply(e,Pt.isArray(s)?s:[]):r.delay(function(){e[t].apply(e,Pt.isArray(s)?s:[])},i))},Pt.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())}},Pt.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=Pt.isUnd(i)?!0:i,o.canExecute=s.computed(Pt.isFunc(i)?function(){return o.enabled()&&i.call(e)}:function(){return o.enabled()&&!!i}),o},Pt.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),Ot.sAnimationType=Lt.InterfaceAnimation.Full,t.capaThemes=s.observable(!1),t.allowCustomLogin=s.observable(!1),t.allowLanguagesOnSettings=s.observable(!0),t.allowLanguagesOnLogin=s.observable(!0),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(Ot.bMobileDevice||e===Lt.InterfaceAnimation.None)Ht.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),Ot.sAnimationType=Lt.InterfaceAnimation.None;else switch(e){case Lt.InterfaceAnimation.Full:Ht.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),Ot.sAnimationType=e;break;case Lt.InterfaceAnimation.Normal:Ht.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),Ot.sAnimationType=e}}),t.interfaceAnimation.valueHasMutated(),t.desktopNotificationsPermisions=s.computed(function(){t.desktopNotifications();var s=Lt.DesktopNotifications.NotSupported;if(Kt&&Kt.permission)switch(Kt.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?Kt.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")?Pt.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?Pt.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},Pt.isFolderExpanded=function(e){var t=qt.local().get(Lt.ClientSideKeyName.ExpandedFolders);return r.isArray(t)&&-1!==r.indexOf(t,e)},Pt.setExpandedFolder=function(e,t){var s=qt.local().get(Lt.ClientSideKeyName.ExpandedFolders);r.isArray(s)||(s=[]),t?(s.push(e),s=r.uniq(s)):s=r.without(s,e),qt.local().set(Lt.ClientSideKeyName.ExpandedFolders,s)},Pt.initLayoutResizer=function(e,s,i){var o=60,n=155,a=t(e),r=t(s),l=qt.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=Pt.pInt(qt.local().get(i))||n;c(t>n?t:n)}},d=function(e,t){t&&t.size&&t.size.width&&(qt.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}),qt.sub("left-panel.off",function(){u(!0)}),qt.sub("left-panel.on",function(){u(!1)})},Pt.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"),Pt.windowResize()}).after("
").before("
"))})}},Pt.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()}))},Pt.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},Pt.extendAsViewModel=function(e,t,s){t&&(s||(s=b),t.__name=e,Mt.regViewModelHook(e,t),r.extend(t.prototype,s.prototype))},Pt.addSettingsViewModel=function(e,t,s,i,o){e.__rlSettingsData={Label:s,Template:t,Route:i,IsDefault:!!o},kt.settings.push(e)},Pt.removeSettingsViewModel=function(e){kt["settings-removed"].push(e)},Pt.disableSettingsViewModel=function(e){kt["settings-disabled"].push(e)},Pt.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=Pt.trim(e.substring(0,e.length-7))),Pt.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," ")) +},Pt.quoteName=function(e){return e.replace(/["]/g,'\\"')},Pt.microtime=function(){return(new Date).getTime()},Pt.convertLangName=function(e,t){return Pt.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},Pt.fakeMd5=function(e){var t="",s="0123456789abcdefghijklmnopqrstuvwxyz";for(e=Pt.isUnd(e)?32:Pt.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,L=9,I=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(/")},Pt.draggeblePlace=function(){return t('
 
').appendTo("#rl-hidden")},Pt.defautOptionsAfterRender=function(e,s){s&&!Pt.isUnd(s.disabled)&&e&&t(e).toggleClass("disabled",s.disabled).prop("disabled",s.disabled)},Pt.windowPopupKnockout=function(s,i,o,n){var a=null,r=e.open(""),l="__OpenerApplyBindingsUid"+Pt.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")),Pt.i18nToNode(i),S.prototype.applyExternal(s,t("#rl-content",i)[0]),e[l]=null,n(r)}},r.document.open(),r.document.write(''+Pt.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)},Pt.settingsSaveHelperFunction=function(e,t,s,i){return s=s||null,i=Pt.isUnd(i)?1e3:Pt.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)}},Pt.settingsSaveHelperSimpleFunction=function(e,t){return Pt.settingsSaveHelperFunction(null,e,t,1e3)},Pt.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,"")},Pt.plainToHtml=function(e){return e.toString().replace(/&/g,"&").replace(/>/g,">").replace(/")},Pt.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},Pt.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:Pt.isUnd(s)?e.toString():s.toString(),custom:Pt.isUnd(s)?!1:!0,title:Pt.isUnd(s)?"":e.toString(),value:e.toString()};(Pt.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}},Pt.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()}},Pt.disableKeyFilter=function(){e.key&&(c.filter=function(){return qt.data().useKeyboardShortcuts()})},Pt.restoreKeyFilter=function(){e.key&&(c.filter=function(e){if(qt.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})},Pt.detectDropdownVisibility=r.debounce(function(){Ot.dropdownVisibility(!!r.find(_t,function(e){return e.hasClass("open")}))},50),Dt={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return Dt.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var t,s,i,o,n,a,r,l="",c=0;for(e=Dt._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 Dt._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(!Ot.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")||Ot.dropdownVisibility()?"":''+Pt.i18n(s.utils.unwrapObservable(i()))+""}}).click(function(){o.tooltip("hide")}),Ot.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")||Ot.dropdownVisibility()?"":''+s()()+""}}).click(function(){i.tooltip("hide")}),Ot.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")||""}}),Gt.click(function(){s.tooltip("hide")}),Ot.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){_t.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"),Pt.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&&!Pt.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&&!Pt.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",!Ot.bMobileDevice).modal({keyboard:!1,show:s.utils.unwrapObservable(i())}).on("shown",function(){Pt.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){Pt.i18nToNode(e)}},s.bindingHandlers.i18nUpdate={update:function(e,t){s.utils.unwrapObservable(t()),Pt.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=Pt.pInt(o[1]),a=0,r=t(e).offset().top;r>0&&(r+=Pt.pInt(o[2]),a=Bt.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(!Ot.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),Pt.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),Pt.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(){Pt.removeInFocus()})}}},s.bindingHandlers.droppable={init:function(e,s,i){if(!Ot.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){Ot.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){qt.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=Pt.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){qt.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=Pt.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(Pt.trim(t.toString()))},owner:this});return t(e()),t},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},Pt.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=Pt.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=Pt.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateFunc=function(e){return this.hasFuncError=s.observable(!1),Pt.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 Pt.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=Pt.isNormal(t)?Pt.pInt(t):1,s=Pt.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.getUserPicUrlFromHash=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/UserPic/"+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"rainloop/v/"+this.sVersion+"/static/css/images/empty-contact.png"},u.prototype.emptyFullContactPic=function(){return e.location.protocol+"//"+e.location.hostname+("80"==""+e.location.port||""==""+e.location.port?"":":"+e.location.port)+e.location.pathname+"rainloop/v/"+this.sVersion+"/static/css/images/empty-contact.png"},u.prototype.sound=function(e){return"rainloop/v/"+this.sVersion+"/static/sounds/"+e},u.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=Pt.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},u.prototype.notificationMailIcon=function(){return"rainloop/v/"+this.sVersion+"/static/css/images/icom-message-notification.png"},u.prototype.openPgpJs=function(){return"rainloop/v/"+this.sVersion+"/static/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+"/":"")},Mt.oViewModelsHooks={},Mt.oSimpleHooks={},Mt.regViewModelHook=function(e,t){t&&(t.__hookName=e)},Mt.addHook=function(e,t){Pt.isFunc(t)&&(Pt.isArray(Mt.oSimpleHooks[e])||(Mt.oSimpleHooks[e]=[]),Mt.oSimpleHooks[e].push(t))},Mt.runHook=function(e,t){Pt.isArray(Mt.oSimpleHooks[e])&&(t=t||[],r.each(Mt.oSimpleHooks[e],function(e){e.apply(null,t)}))},Mt.mainSettingsGet=function(e){return qt?qt.settingsGet(e):null},Mt.remoteRequest=function(e,t,s,i,o,n){qt&&qt.remote().defaultRequest(e,t,s,i,o,n)},Mt.settingsGet=function(e,t){var s=Mt.mainSettingsGet("Plugins");return s=s&&Pt.isUnd(s[e])?null:s[e],s?Pt.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=Ot.oHtmlEditorDefaultConfig,i=qt.settingsGet("Language"),o=!!qt.settingsGet("AllowHtmlEditorSourceButton");o&&s.toolbarGroups&&!s.toolbarGroups.__SourceInited&&(s.toolbarGroups.__SourceInited=!0,s.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),s.language=Ot.oHtmlEditorLangsMap[i]||"en",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))}},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(Rt.Values.ClientSideCookieIndexName),o=!1,n=null;try{n=null===i?null:JSON.parse(i),n||(n={}),n[e]=s,t.cookie(Rt.Values.ClientSideCookieIndexName,JSON.stringify(n),{expires:30}),o=!0}catch(a){}return o},p.prototype.get=function(e){var s=t.cookie(Rt.Values.ClientSideCookieIndexName),i=null;try{i=null===s?null:JSON.parse(s),i=i&&!Pt.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[Rt.Values.ClientSideCookieIndexName]||null,o=!1,n=null;try{n=null===i?null:JSON.parse(i),n||(n={}),n[t]=s,e.localStorage[Rt.Values.ClientSideCookieIndexName]=JSON.stringify(n),o=!0}catch(a){}return o},m.prototype.get=function(t){var s=e.localStorage[Rt.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===s?null:JSON.parse(s),i=i&&!Pt.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=qt.data().keyScope(),qt.data().keyScope(this.sDefaultKeyScope)},b.prototype.restoreKeyScope=function(){qt.data().keyScope(this.sCurrentKeyScope)},b.prototype.registerPopupKeyDown=function(){var e=this;Bt.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&Lt.EventKeyCode.Esc===t.keyCode)return Pt.delegateRun(e,"cancelCommand"),!1;if(Lt.EventKeyCode.Backspace===t.keyCode&&!Pt.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;Pt.isNonEmptyArray(e)&&(s=r.bind(this.onRoute||Pt.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){Pt.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 Pt.isNormal(e)&&(this.oBoot=e),this},S.prototype.screen=function(e){return""===e||Pt.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=qt.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=Pt.createCommand(o,function(){Ut.hideScreenPopup(e)}),o.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),qt.popupVisibilityNames.push(this.viewModelName),o.viewModelDom.css("z-index",3e3+qt.popupVisibilityNames().length+10),Pt.delegateRun(this,"onFocus",[],500)):(Pt.delegateRun(this,"onHide"),this.restoreKeyScope(),qt.popupVisibilityNames.remove(this.viewModelName),o.viewModelDom.css("z-index",2e3),Ot.tooltipTrigger(!Ot.tooltipTrigger()),r.delay(function(){t.viewModelDom.hide()},300))},o)),Mt.runHook("view-model-pre-build",[e.__name,o,l]),s.applyBindingAccessorsToNode(l[0],{i18nInit:!0,template:function(){return{name:o.viewModelTemplate()}}},o),Pt.delegateRun(o,"onBuild",[l]),o&&"Popups"===n&&o.registerPopupKeyDown(),Mt.runHook("view-model-post-build",[e.__name,o,l])):Pt.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),Mt.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),Pt.delegateRun(e.__vm,"onShow",t||[]),Mt.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},S.prototype.screenOnRoute=function(e,t){var s=this,i=null,o=null;""===Pt.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,Pt.isNonEmptyArray(i.viewModels())&&r.each(i.viewModels(),function(e){this.buildViewModel(e,i)},this),Pt.delegateRun(i,"onBuild")),r.defer(function(){s.oCurrentScreen&&(Pt.delegateRun(s.oCurrentScreen,"onHide"),Pt.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),Pt.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=i,s.oCurrentScreen&&(Pt.delegateRun(s.oCurrentScreen,"onShow"),Mt.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),Pt.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),Pt.delegateRun(e.__vm,"onShow"),Pt.delegateRun(e.__vm,"onFocus",[],200),Mt.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(),Mt.runHook("screen-pre-start",[e.screenName(),e]),Pt.delegateRun(e,"onStart"),Mt.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(){Ht.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=Pt.isUnd(s)?!1:!!s,(Pt.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},Ut=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=Pt.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=Pt.trim(e.Name),this.email=Pt.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},v.prototype.toLine=function(e,t,s){var i="";return""!==this.email&&(t=Pt.isUnd(t)?!1:!!t,s=Pt.isUnd(s)?!1:!!s,e&&""!==this.name?i=t?'
")+'" target="_blank" tabindex="-1">'+Pt.encodeHtml(this.name)+"":s?Pt.encodeHtml(this.name):this.name:(i=this.email,""!==this.name?t?i=Pt.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+Pt.encodeHtml(i)+""+Pt.encodeHtml(">"):(i='"'+this.name+'" <'+i+">",s&&(i=Pt.encodeHtml(i))):t&&(i=''+Pt.encodeHtml(this.email)+""))),i},v.prototype.mailsoParse=function(e){if(e=Pt.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=Pt.trim(o).replace(/^[<]+/,"").replace(/[>]+$/,""),i=Pt.trim(i).replace(/^["']+/,"").replace(/["']+$/,""),n=Pt.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(Pt.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++)Pt.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.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=qt.data().sentFolder(),t=qt.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.size(Pt.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(Pt.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(Pt.pInt(e.ParentThread)),this.threads(Pt.isArray(e.Threads)?e.Threads:[]),this.threadsLen(Pt.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=Pt.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 Pt.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 Pt.isArray(this.from)&&this.from[0]?this.from[0].email:""},E.prototype.viewLink=function(){return qt.link().messageViewLink(this.requestHash)},E.prototype.downloadLink=function(){return qt.link().messageDownloadLink(this.requestHash)},E.prototype.replyEmails=function(e){var t=[],s=Pt.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=Pt.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.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){this.body&&this.body.data("rl-has-images")&&(e=Pt.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t("[data-x-src]",this.body).each(function(){e&&t(this).is("img")?t(this).addClass("lazy").attr("data-original",t(this).attr("data-x-src")).removeAttr("data-x-src"):t(this).attr("src",t(this).attr("data-x-src")).removeAttr("data-x-src")}),t("[data-x-style-url]",this.body).each(function(){var e=Pt.trim(t(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",t(this).attr("style",e+t(this).attr("data-x-style-url")).removeAttr("data-x-style-url")}),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]}),Bt.resize()),Pt.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=Pt.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=Pt.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]),Pt.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),qt.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&&qt.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=Pt.pString(this.body.data("rl-plain-raw")),qt.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=qt.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(),jt.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=qt.data().findPublicKeysByEmail(a),c=qt.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(),jt.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){Pt.isPosNumeric(e,!0)?this.privateMessageCountAll(e):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=s.computed({read:this.privateMessageCountUnread,write:function(e){Pt.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&&qt.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(){Pt.timeOutAction("folder-list-folder-visibility-change",function(){Bt.trigger("folder-list-folder-visibility-change")},100)}),this.localName=s.computed(function(){Ot.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case Lt.FolderType.Inbox:t=Pt.i18n("FOLDER_LIST/INBOX_NAME");break;case Lt.FolderType.SentItems:t=Pt.i18n("FOLDER_LIST/SENT_NAME");break;case Lt.FolderType.Draft:t=Pt.i18n("FOLDER_LIST/DRAFTS_NAME");break;case Lt.FolderType.Spam:t=Pt.i18n("FOLDER_LIST/SPAM_NAME");break;case Lt.FolderType.Trash:t=Pt.i18n("FOLDER_LIST/TRASH_NAME");break;case Lt.FolderType.Archive:t=Pt.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=s.computed(function(){Ot.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case Lt.FolderType.Inbox:e="("+Pt.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case Lt.FolderType.SentItems:e="("+Pt.i18n("FOLDER_LIST/SENT_NAME")+")";break;case Lt.FolderType.Draft:e="("+Pt.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case Lt.FolderType.Spam:e="("+Pt.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case Lt.FolderType.Trash:e="("+Pt.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case Lt.FolderType.Archive:e="("+Pt.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"},L.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},L.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+Pt.quoteName(e)+'" <'+this.email()+">"},P.prototype.deleteCondition=function(e){this.conditions.remove(e)},P.prototype.addCondition=function(){this.conditions.push(new I)},P.prototype.parse=function(e){var t=!1;return e&&"Object/Filter"===e["@Object"]&&(this.name(Pt.pString(e.Name)),t=!0),t},M.prototype.index=0,M.prototype.id="",M.prototype.guid="",M.prototype.user="",M.prototype.email="",M.prototype.armor="",M.prototype.isPrivate=!1,Pt.extendAsViewModel("PopupsFolderClearViewModel",D),D.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},D.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},Pt.extendAsViewModel("PopupsFolderCreateViewModel",O),O.prototype.sNoParentText="",O.prototype.simpleFolderNameValidation=function(e){return/^[^\\\/]+$/g.test(Pt.trim(e))},O.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},O.prototype.onShow=function(){this.clearPopup()},O.prototype.onFocus=function(){this.folderName.focused(!0)},Pt.extendAsViewModel("PopupsFolderSystemViewModel",k),k.prototype.sChooseOnText="",k.prototype.sUnuseText="",k.prototype.onShow=function(e){var t="";switch(e=Pt.isUnd(e)?Lt.SetSystemFoldersNotification.None:e){case Lt.SetSystemFoldersNotification.Sent:t=Pt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case Lt.SetSystemFoldersNotification.Draft:t=Pt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case Lt.SetSystemFoldersNotification.Spam:t=Pt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case Lt.SetSystemFoldersNotification.Trash:t=Pt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case Lt.SetSystemFoldersNotification.Archive:t=Pt.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},Pt.extendAsViewModel("PopupsComposeViewModel",_),_.prototype.openOpenPgpPopup=function(){if(this.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var e=this;Ut.showScreenPopup(K,[function(t){e.editor(function(e){e.setPlain(t)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},_.prototype.reloadDraftFolder=function(){var e=qt.data().draftFolder();""!==e&&(qt.cache().setFolderHash(e,""),qt.data().currentFolderFullNameRaw()===e?qt.reloadMessageList(!0):qt.folderInformation(e))},_.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[qt.data().accountEmail()]=qt.data().accountEmail(),t)switch(e){case Lt.ComposeType.Empty:i=qt.data().accountEmail();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)}else i=qt.data().accountEmail();return i},_.prototype.selectIdentity=function(e){e&&this.currentIdentityID(e.optValue)},_.prototype.formattedFrom=function(e){var t=qt.data().displayName(),s=qt.data().accountEmail();return""===t?s:(Pt.isUnd(e)?1:!e)?t+" ("+s+")":'"'+Pt.quoteName(t)+'" <'+s+">"},_.prototype.sendMessageResponse=function(t,s){var i=!1,o="";this.sending(!1),Lt.StorageResultType.Success===t&&s&&s.Result&&(i=!0,this.modalVisibility()&&Pt.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(s&&Lt.Notification.CantSaveMessage===s.ErrorCode?(this.sendSuccessButSaveError(!0),e.alert(Pt.trim(Pt.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=Pt.getNotification(s&&s.ErrorCode?s.ErrorCode:Lt.Notification.CantSendMessage,s&&s.ErrorMessage?s.ErrorMessage:""),this.sendError(!0),e.alert(o||Pt.getNotification(Lt.Notification.CantSendMessage)))),this.reloadDraftFolder()},_.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=qt.data().message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&qt.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&&Pt.isNormal(s)&&(C=Pt.isArray(s)&&1===s.length?s[0]:Pt.isArray(s)?null:s),null!==f&&(g[f]=!0,this.currentIdentityID(this.findIdentityIdByMessage(w,C))),this.reset(),Pt.isNonEmptyArray(i)&&this.to(T(i)),""!==w&&C){switch(c=C.fullFormatDateValue(),u=C.subject(),v=C.aDraftInfo,d=t(C.body).clone(),Pt.removeBlockquoteSwitcher(d),h=d.html(),w){case Lt.ComposeType.Empty:break;case Lt.ComposeType.Reply:this.to(T(C.replyEmails(g))),this.subject(Pt.replySubjectAdd("Re",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["reply",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Pt.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(Pt.replySubjectAdd("Re",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["reply",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Pt.trim(this.sInReplyTo+" "+C.references());break;case Lt.ComposeType.Forward:this.subject(Pt.replySubjectAdd("Fwd",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["forward",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Pt.trim(this.sInReplyTo+" "+C.sReferences);break;case Lt.ComposeType.ForwardAsAttachment:this.subject(Pt.replySubjectAdd("Fwd",u)),this.prepearMessageAttachments(C,w),this.aDraftInfo=["forward",C.uid,C.folderFullNameRaw],this.sInReplyTo=C.sMessageId,this.sReferences=Pt.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=Pt.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=Pt.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=Pt.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="


"+Pt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+Pt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+n+"
"+Pt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+a+(0"+Pt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+l:"")+"
"+Pt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+Pt.encodeHtml(c)+"
"+Pt.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+Pt.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!==qt.data().editorDefaultType()&&e.modeToggle(!1)})):Pt.isNonEmptyArray(s)&&r.each(s,function(e){o.addMessageAsAttachment(e)});S=this.getAttachmentsDownloadsForUpload(),Pt.isNonEmptyArray(S)&&qt.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()},_.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},_.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},_.prototype.tryToClosePopup=function(){var e=this;Ut.showScreenPopup(W,[Pt.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&Pt.delegateRun(e,"closeCommand")}])},_.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.tryToClosePopup(),!1}),Bt.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",qt.settingsGet("DropboxApiKey")),document.body.appendChild(s))},_.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},_.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=Pt.pInt(qt.settingsGet("AttachmentLimit")),s=new a({action:qt.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;Pt.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=Pt.isUnd(i.FileName)?"":i.FileName.toString(),a=Pt.isNormal(i.Size)?Pt.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(Pt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",r.bind(function(t){var s=null;Pt.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=Pt.getUploadErrorDescByCode(n):a||(o=Pt.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&i>0&&n>i?(o.uploading(!1),o.error(Pt.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(qt.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(Pt.getUploadErrorDescByCode(Lt.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},_.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,i=Pt.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))}}},_.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},_.prototype.setMessageAttachmentFailedDowbloadText=function(){r.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(Pt.getUploadErrorDescByCode(Lt.UploadErrorCode.FileNoUploaded))},this)},_.prototype.isEmptyForm=function(e){e=Pt.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())},_.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)},_.prototype.getAttachmentsDownloadsForUpload=function(){return r.map(r.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},_.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},Pt.extendAsViewModel("PopupsContactsViewModel",U),U.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},U.prototype.addNewProperty=function(e,t){this.viewProperties.push(new w(e,t||"","",!0,this.getPropertyPlceholder(e)))},U.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)},U.prototype.addNewTag=function(){this.viewTags.visibility(!0),this.viewTags.focusTrigger(!0)},U.prototype.addNewEmail=function(){this.addNewProperty(Lt.ContactPropertyType.Email,"Home")},U.prototype.addNewPhone=function(){this.addNewProperty(Lt.ContactPropertyType.Phone,"Mobile")},U.prototype.addNewWeb=function(){this.addNewProperty(Lt.ContactPropertyType.Web)},U.prototype.addNewNickname=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Nick)},U.prototype.addNewNotes=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Note)},U.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(Lt.ContactPropertyType.Birthday)},U.prototype.exportVcf=function(){qt.download(qt.link().exportContactsVcf())},U.prototype.exportCsv=function(){qt.download(qt.link().exportContactsCsv())},U.prototype.initUploader=function(){if(this.importUploaderButton()){var t=new a({action:qt.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(Pt.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},U.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))},U.prototype.deleteSelectedContacts=function(){00?i:0),Pt.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,Rt.Defaults.ContactsPerPage,this.search())},U.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(Pt.pInt(e.value)),i.reloadContactList())}),this.initUploader()},U.prototype.onShow=function(){Ut.routeOff(),this.reloadContactList(!0)},U.prototype.onHide=function(){Ut.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},Pt.extendAsViewModel("PopupsAdvancedSearchViewModel",x),x.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},Z.prototype.messagesDrop=function(e,t){if(e&&t&&t.helper){var s=t.helper.data("rl-folder"),i=Ht.hasClass("rl-ctrl-key-pressed"),o=t.helper.data("rl-uids");Pt.isNormal(s)&&""!==s&&Pt.isArray(o)&&qt.moveMessagesToFolder(s,o,e.fullNameRaw,i)}},Z.prototype.composeClick=function(){Ut.showScreenPopup(_)},Z.prototype.createFolder=function(){Ut.showScreenPopup(O)},Z.prototype.configureFolders=function(){Ut.setHash(qt.link().settings("folders"))},Z.prototype.contactsClick=function(){this.allowContacts&&Ut.showScreenPopup(U)},Pt.extendAsViewModel("MailBoxMessageListViewModel",et),et.prototype.emptySubjectValue="",et.prototype.searchEnterAction=function(){this.mainMessageListSearch(this.sLastSearchValue),this.inputMessageListSearchFocus(!1)},et.prototype.printableMessageCountForDeletion=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>1?" ("+(100>e?e:"99+")+")":""},et.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},et.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&qt.moveMessagesToFolder(qt.data().currentFolderFullNameRaw(),qt.data().messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},et.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=Pt.draggeblePlace(),s=qt.data().messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",qt.data().currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),r.defer(function(){var e=qt.data().messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},et.prototype.onMessageResponse=function(e,t,s){var i=qt.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(Pt.getNotification(t&&t.ErrorCode?t.ErrorCode:Lt.Notification.UnknownError)))},et.prototype.populateMessageBody=function(e){e&&(qt.remote().message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?qt.data().messageLoading(!0):Pt.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},et.prototype.setAction=function(e,t,s){var i=[],o=null,n=qt.cache(),a=0;if(Pt.isUnd(s)&&(s=qt.data().messageListChecked()),i=r.map(s,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},tt.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},tt.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},tt.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(qt.remote().sendReadReceiptMessage(Pt.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),Pt.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),Pt.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":qt.data().accountEmail()})),e.isReadReceipt(!0),qt.cache().storeMessageFlagsToCache(e),qt.reloadFlagsCurrentMessageListAndMessageFromCache())},Pt.extendAsViewModel("SettingsMenuViewModel",st),st.prototype.link=function(e){return qt.link().settings(e)},st.prototype.backToMailBoxClick=function(){Ut.setHash(qt.link().inbox())},Pt.extendAsViewModel("SettingsPaneViewModel",it),it.prototype.onBuild=function(){var e=this;c("esc",Lt.KeyState.Settings,function(){e.backToMailBoxClick()})},it.prototype.onShow=function(){qt.data().message(null)},it.prototype.backToMailBoxClick=function(){Ut.setHash(qt.link().inbox())},Pt.addSettingsViewModel(ot,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),ot.prototype.toggleLayout=function(){this.layout(Lt.Layout.NoPreview===this.layout()?Lt.Layout.SidePreview:Lt.Layout.NoPreview)},ot.prototype.onBuild=function(){var e=this;r.delay(function(){var s=qt.data(),i=Pt.settingsSaveHelperSimpleFunction(e.mppTrigger,e);s.language.subscribe(function(s){e.languageTrigger(Lt.SaveSettingsStep.Animate),t.ajax({url:qt.link().langLink(s),dataType:"script",cache:!0}).done(function(){Pt.i18nToDoc(),e.languageTrigger(Lt.SaveSettingsStep.TrueResult)}).fail(function(){e.languageTrigger(Lt.SaveSettingsStep.FalseResult)}).always(function(){r.delay(function(){e.languageTrigger(Lt.SaveSettingsStep.Idle)},1e3)}),qt.remote().saveSettings(Pt.emptyFunction,{Language:s})}),s.editorDefaultType.subscribe(function(e){qt.remote().saveSettings(Pt.emptyFunction,{EditorDefaultType:e})}),s.messagesPerPage.subscribe(function(e){qt.remote().saveSettings(i,{MPP:e})}),s.showImages.subscribe(function(e){qt.remote().saveSettings(Pt.emptyFunction,{ShowImages:e?"1":"0"})}),s.interfaceAnimation.subscribe(function(e){qt.remote().saveSettings(Pt.emptyFunction,{InterfaceAnimation:e})}),s.useDesktopNotifications.subscribe(function(e){Pt.timeOutAction("SaveDesktopNotifications",function(){qt.remote().saveSettings(Pt.emptyFunction,{DesktopNotifications:e?"1":"0"})},3e3)}),s.replySameFolder.subscribe(function(e){Pt.timeOutAction("SaveReplySameFolder",function(){qt.remote().saveSettings(Pt.emptyFunction,{ReplySameFolder:e?"1":"0"})},3e3)}),s.useThreads.subscribe(function(e){s.messageList([]),qt.remote().saveSettings(Pt.emptyFunction,{UseThreads:e?"1":"0"})}),s.layout.subscribe(function(e){s.messageList([]),qt.remote().saveSettings(Pt.emptyFunction,{Layout:e})}),s.useCheckboxesInList.subscribe(function(e){qt.remote().saveSettings(Pt.emptyFunction,{UseCheckboxesInList:e?"1":"0"})})},50)},ot.prototype.onShow=function(){qt.data().desktopNotifications.valueHasMutated()},ot.prototype.selectLanguage=function(){Ut.showScreenPopup(j)},Pt.addSettingsViewModel(nt,"SettingsContacts","SETTINGS_LABELS/LABEL_CONTACTS_NAME","contacts"),nt.prototype.onBuild=function(){qt.data().contactsAutosave.subscribe(function(e){qt.remote().saveSettings(Pt.emptyFunction,{ContactsAutosave:e?"1":"0"})})},Pt.addSettingsViewModel(at,"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),at.prototype.addNewAccount=function(){Ut.showScreenPopup(V)},at.prototype.deleteAccount=function(t){if(t&&t.deleteAccess()){this.accountForDeletion(null);var s=function(e){return t===e};t&&(this.accounts.remove(s),qt.remote().accountDelete(function(t,s){Lt.StorageResultType.Success===t&&s&&s.Result&&s.Reload?(Ut.routeOff(),Ut.setHash(qt.link().root(),!0),Ut.routeOff(),r.defer(function(){e.location.reload()})):qt.accountsAndIdentities()},t.email))}},Pt.addSettingsViewModel(rt,"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),rt.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=qt.data().signature();this.editor=new d(e.signatureDom(),function(){qt.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)})}},rt.prototype.onBuild=function(){var e=this;r.delay(function(){var t=qt.data(),s=Pt.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=Pt.settingsSaveHelperSimpleFunction(e.replyTrigger,e),o=Pt.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);t.displayName.subscribe(function(e){qt.remote().saveSettings(s,{DisplayName:e})}),t.replyTo.subscribe(function(e){qt.remote().saveSettings(i,{ReplyTo:e})}),t.signature.subscribe(function(e){qt.remote().saveSettings(o,{Signature:e})}),t.signatureToAll.subscribe(function(e){qt.remote().saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},Pt.addSettingsViewModel(lt,"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"),lt.prototype.addNewIdentity=function(){Ut.showScreenPopup(q)},lt.prototype.editIdentity=function(e){Ut.showScreenPopup(q,[e])},lt.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var t=function(t){return e===t};e&&(this.identities.remove(t),qt.remote().identityDelete(function(){qt.accountsAndIdentities()},e.id))}},lt.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=qt.data().signature();this.editor=new d(e.signatureDom(),function(){qt.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(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=qt.data(),s=Pt.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=Pt.settingsSaveHelperSimpleFunction(t.replyTrigger,t),o=Pt.settingsSaveHelperSimpleFunction(t.signatureTrigger,t);e.displayName.subscribe(function(e){qt.remote().saveSettings(s,{DisplayName:e})}),e.replyTo.subscribe(function(e){qt.remote().saveSettings(i,{ReplyTo:e})}),e.signature.subscribe(function(e){qt.remote().saveSettings(o,{Signature:e})}),e.signatureToAll.subscribe(function(e){qt.remote().saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},Pt.addSettingsViewModel(ct,"SettingsFilters","SETTINGS_LABELS/LABEL_FILTERS_NAME","filters"),ct.prototype.deleteFilter=function(e){this.filters.remove(e)},ct.prototype.addFilter=function(){var e=new P;e.addCondition(),this.filters.push(e)},Pt.addSettingsViewModel(ut,"SettingsSecurity","SETTINGS_LABELS/LABEL_SECURITY_NAME","security"),ut.prototype.showSecret=function(){this.secreting(!0),qt.remote().showTwoFactorSecret(this.onSecretResult)},ut.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},ut.prototype.createTwoFactor=function(){this.processing(!0),qt.remote().createTwoFactor(this.onResult)},ut.prototype.enableTwoFactor=function(){this.processing(!0),qt.remote().enableTwoFactor(this.onResult,this.viewEnable())},ut.prototype.testTwoFactor=function(){Ut.showScreenPopup(z)},ut.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),qt.remote().clearTwoFactor(this.onResult)},ut.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},ut.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),Lt.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(Pt.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(Pt.pString(t.Result.Secret)),this.viewBackupCodes(Pt.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(Pt.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&&qt.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)}},ut.prototype.onSecretResult=function(e,t){this.secreting(!1),Lt.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(Pt.pString(t.Result.Secret)),this.viewUrl(Pt.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},ut.prototype.onBuild=function(){this.processing(!0),qt.remote().getTwoFactor(this.onResult)},Pt.addSettingsViewModel(dt,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),Pt.addSettingsViewModel(ht,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),ht.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},ht.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(Pt.getNotification(t&&t.ErrorCode?t.ErrorCode:Lt.Notification.CouldNotSaveNewPassword)))},Pt.addSettingsViewModel(pt,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),pt.prototype.folderEditOnEnter=function(e){var t=e?Pt.trim(e.nameForEdit()):"";""!==t&&e.name()!==t&&(qt.local().set(Lt.ClientSideKeyName.FoldersLashHash,""),qt.data().foldersRenaming(!0),qt.remote().folderRename(function(e,t){qt.data().foldersRenaming(!1),Lt.StorageResultType.Success===e&&t&&t.Result||qt.data().foldersListError(t&&t.ErrorCode?Pt.getNotification(t.ErrorCode):Pt.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),qt.folders()},e.fullNameRaw,t),qt.cache().removeFolderFromCacheList(e.fullNameRaw),e.name(t)),e.edited(!1)},pt.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},pt.prototype.onShow=function(){qt.data().foldersListError("")},pt.prototype.createFolder=function(){Ut.showScreenPopup(O)},pt.prototype.systemFolder=function(){Ut.showScreenPopup(k)},pt.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&&(qt.local().set(Lt.ClientSideKeyName.FoldersLashHash,""),qt.data().folderList.remove(t),qt.data().foldersDeleting(!0),qt.remote().folderDelete(function(e,t){qt.data().foldersDeleting(!1),Lt.StorageResultType.Success===e&&t&&t.Result||qt.data().foldersListError(t&&t.ErrorCode?Pt.getNotification(t.ErrorCode):Pt.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),qt.folders()},e.fullNameRaw),qt.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)))},bt.prototype.populateDataOnStart=function(){ft.prototype.populateDataOnStart.call(this),this.accountEmail(qt.settingsGet("Email")),this.accountIncLogin(qt.settingsGet("IncLogin")),this.accountOutLogin(qt.settingsGet("OutLogin")),this.projectHash(qt.settingsGet("ProjectHash")),this.displayName(qt.settingsGet("DisplayName")),this.replyTo(qt.settingsGet("ReplyTo")),this.signature(qt.settingsGet("Signature")),this.signatureToAll(!!qt.settingsGet("SignatureToAll")),this.enableTwoFactor(!!qt.settingsGet("EnableTwoFactor")),this.lastFoldersHash=qt.local().get(Lt.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!qt.settingsGet("RemoteSuggestions"),this.devEmail=qt.settingsGet("DevEmail"),this.devLogin=qt.settingsGet("DevLogin"),this.devPassword=qt.settingsGet("DevPassword")},bt.prototype.initUidNextAndNewMessages=function(t,s,i){if("INBOX"===t&&Pt.isNormal(s)&&""!==s){if(Pt.isArray(i)&&03)l(qt.link().notificationMailIcon(),qt.data().accountEmail(),Pt.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:a}));else for(;a>n;n++)l(qt.link().notificationMailIcon(),E.emailsToLine(E.initEmailsFromJson(i[n].From),!1),i[n].Subject)}qt.cache().setFolderUidNext(t,s)}},bt.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=qt.cache().getFolderFromCacheList(a),n||(n=N.newInstanceFromJson(o),n&&(qt.cache().setFolderToCacheList(a,n),qt.cache().setFolderFullNameRaw(n.fullNameHash,a))),n&&(n.collapsed(!Pt.isFolderExpanded(n.fullNameHash)),o.Extended&&(o.Extended.Hash&&qt.cache().setFolderHash(n.fullNameRaw,o.Extended.Hash),Pt.isNormal(o.Extended.MessageCount)&&n.messageCountAll(o.Extended.MessageCount),Pt.isNormal(o.Extended.MessageUnseenCount)&&n.messageCountUnread(o.Extended.MessageUnseenCount)),r=o.SubFolders,r&&"Collection/FolderCollection"===r["@Object"]&&r["@Collection"]&&Pt.isArray(r["@Collection"])&&n.subFolders(this.folderResponseParseRec(e,r["@Collection"])),l.push(n)));return l},bt.prototype.setFolders=function(e){var t=[],s=!1,i=qt.data(),o=function(e){return""===e||Rt.Values.UnuseOptionValue===e||null!==qt.cache().getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&Pt.isArray(e.Result["@Collection"])&&(Pt.isUnd(e.Result.Namespace)||(i.namespace=e.Result.Namespace),this.threading(!!qt.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(i.namespace,e.Result["@Collection"]),i.folderList(t),e.Result.SystemFolders&&""==""+qt.settingsGet("SentFolder")+qt.settingsGet("DraftFolder")+qt.settingsGet("SpamFolder")+qt.settingsGet("TrashFolder")+qt.settingsGet("ArchiveFolder")+qt.settingsGet("NullFolder")&&(qt.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),qt.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),qt.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),qt.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),qt.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),s=!0),i.sentFolder(o(qt.settingsGet("SentFolder"))),i.draftFolder(o(qt.settingsGet("DraftFolder"))),i.spamFolder(o(qt.settingsGet("SpamFolder"))),i.trashFolder(o(qt.settingsGet("TrashFolder"))),i.archiveFolder(o(qt.settingsGet("ArchiveFolder"))),s&&qt.remote().saveSystemFolders(Pt.emptyFunction,{SentFolder:i.sentFolder(),DraftFolder:i.draftFolder(),SpamFolder:i.spamFolder(),TrashFolder:i.trashFolder(),ArchiveFolder:i.archiveFolder(),NullFolder:"NullFolder"}),qt.local().set(Lt.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},bt.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},bt.prototype.getNextFolderNames=function(e){e=Pt.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=qt.cache().getFolderFromCacheList(e[1]);return o&&(o.interval=i,t.push(e[1])),s<=t.length}),r.uniq(t)},bt.prototype.removeMessagesFromList=function(e,t,s,i){s=Pt.isNormal(s)?s:"",i=Pt.isUnd(i)?!1:!!i,t=r.map(t,function(e){return Pt.pInt(e)});var o=0,n=qt.data(),a=qt.cache(),l=n.messageList(),c=qt.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",++Ot.iMessageBodyCacheCount),Pt.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,a.html(e.Result.Html.toString()).addClass("b-text-part html")):Pt.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,c=e.Result.Plain.toString(),(p.isPgpSigned()||p.isPgpEncrypted())&&qt.data().capaOpenPGP()&&Pt.isNormal(e.Result.PlainRaw)&&(p.plainRaw=Pt.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)),jt.empty(),u&&p.isPgpSigned()?c=jt.append(t('
').text(p.plainRaw)).html():d&&p.isPgpEncrypted()&&(c=jt.append(t('
').text(p.plainRaw)).html()),jt.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&&Pt.initBlockquoteSwitcher(a)),qt.cache().initMessageFlagsFromCache(p),p.unseen()&&qt.setMessageSeen(p),Pt.windowResize())},bt.prototype.calculateMessageListHash=function(e){return r.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},bt.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&Pt.isArray(e.Result["@Collection"])){var s=qt.data(),i=qt.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=Pt.pInt(e.Result.MessageResultCount),c=Pt.pInt(e.Result.Offset),Pt.isNonEmptyArray(e.Result.LastCollapsedThreadUids)&&(o=e.Result.LastCollapsedThreadUids),g=qt.cache().getFolderFromCacheList(Pt.isNormal(e.Result.Folder)?e.Result.Folder:""),g&&!t&&(g.interval=d,qt.cache().setFolderHash(e.Result.Folder,e.Result.FolderHash),Pt.isNormal(e.Result.MessageCount)&&g.messageCountAll(e.Result.MessageCount),Pt.isNormal(e.Result.MessageUnseenCount)&&(Pt.pInt(g.messageCountUnread())!==Pt.pInt(e.Result.MessageUnseenCount)&&(b=!0),g.messageCountUnread(e.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(g.fullNameRaw,e.Result.UidNext,e.Result.NewMessages)),b&&g&&qt.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?qt.cache().initMessageFlagsFromCache(m):qt.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/"+Dt.urlsafe_encode([t,s,qt.data().projectHash(),qt.data().threading()&&qt.data().useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},St.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},St.prototype.folderInformation=function(e,t,s){var i=!0,o=qt.cache(),n=[];Pt.isArray(s)&&0").addClass("rl-settings-view-model").hide(),l.appendTo(a),o.data=qt.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),Pt.delegateRun(o,"onBuild",[l])):Pt.log("Cannot find sub settings view model position: SettingsSubScreen")),o&&r.defer(function(){i.oCurrentSubScreen&&(Pt.delegateRun(i.oCurrentSubScreen,"onHide"),i.oCurrentSubScreen.viewModelDom.hide()),i.oCurrentSubScreen=o,i.oCurrentSubScreen&&(i.oCurrentSubScreen.viewModelDom.show(),Pt.delegateRun(i.oCurrentSubScreen,"onShow"),Pt.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)),Pt.windowResize()})):Ut.setHash(qt.link().settings(),!1,!0)},wt.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(Pt.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},wt.prototype.onBuild=function(){r.each(kt.settings,function(e){e&&e.__rlSettingsData&&!r.find(kt["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(kt["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=t("#rl-content #rl-settings-subscreen")},wt.prototype.routes=function(){var e=r.find(kt.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=Pt.isUnd(s.subname)?t:Pt.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},r.extend(Tt.prototype,y.prototype),Tt.prototype.onShow=function(){qt.setTitle("")},r.extend(Ft.prototype,y.prototype),Ft.prototype.oLastRoute={},Ft.prototype.setNewTitle=function(){var e=qt.data().accountEmail(),t=qt.data().foldersInboxUnreadCount();qt.setTitle((""===e?"":(t>0?"("+t+") ":" ")+e+" - ")+Pt.i18n("TITLES/MAILBOX"))},Ft.prototype.onShow=function(){this.setNewTitle(),qt.data().keyScope(Lt.KeyState.MessageList)
+},Ft.prototype.onRoute=function(e,t,s,i){if(Pt.isUnd(i)?1:!i){var o=qt.data(),n=qt.cache().getFolderFullNameRaw(e),a=qt.cache().getFolderFromCacheList(n);a&&(o.currentFolder(a).messageListPage(t).messageListSearch(s),Lt.Layout.NoPreview===o.layout()&&o.message()&&(o.message(null),o.messageFullScreenMode(!1)),qt.reloadMessageList())}else Lt.Layout.NoPreview!==qt.data().layout()||qt.data().message()||qt.historyBack()},Ft.prototype.onStart=function(){var e=qt.data(),t=function(){Pt.windowResize()};(qt.capa(Lt.Capa.AdditionalAccounts)||qt.capa(Lt.Capa.AdditionalIdentities))&&qt.accountsAndIdentities(),r.delay(function(){"INBOX"!==e.currentFolderFullNameRaw()&&qt.folderInformation("INBOX")},1e3),r.delay(function(){qt.quota()},5e3),r.delay(function(){qt.remote().appDelayStart(Pt.emptyFunction)},35e3),Ht.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){Ht.toggleClass("rl-no-preview-pane",Lt.Layout.NoPreview===e)}),e.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},Ft.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=Pt.pString(t[0]),t[1]=Pt.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=Pt.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]=Pt.pString(t[0]),t[1]=Pt.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(At.prototype,wt.prototype),At.prototype.onShow=function(){qt.setTitle(this.sSettingsTitle),qt.data().keyScope(Lt.KeyState.Settings)},r.extend(Et.prototype,f.prototype),Et.prototype.oSettings=null,Et.prototype.oPlugins=null,Et.prototype.oLocal=null,Et.prototype.oLink=null,Et.prototype.oSubs={},Et.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):(Ot.bMobileDevice?(e.open(t,"_self"),e.focus()):this.iframe.attr("src",t),!0)},Et.prototype.link=function(){return null===this.oLink&&(this.oLink=new u),this.oLink},Et.prototype.local=function(){return null===this.oLocal&&(this.oLocal=new g),this.oLocal},Et.prototype.settingsGet=function(e){return null===this.oSettings&&(this.oSettings=Pt.isNormal(xt)?xt:{}),Pt.isUnd(this.oSettings[e])?null:this.oSettings[e]},Et.prototype.settingsSet=function(e,t){null===this.oSettings&&(this.oSettings=Pt.isNormal(xt)?xt:{}),this.oSettings[e]=t},Et.prototype.setTitle=function(t){t=(Pt.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(){qt.contactsSync()},6e4*o+5e3),r.delay(function(){qt.contactsSync()},5e3),r.delay(function(){qt.folderInformationMultiply(!0)},500),r.delay(function(){qt.emailsPicsHashes(),qt.remote().servicesPics(function(e,t){Lt.StorageResultType.Success===e&&t&&t.Result&&qt.cache().setServicesData(t.Result)})},2e3),Mt.runHook("rl-start-user-screens"),qt.pub("rl.bootstart-user-screens"),qt.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",""+(qt.settingsGet("Title")||"RainLoop"))}catch(t){}qt.settingsGet("MailToEmail")&&qt.mailToHelper(qt.settingsGet("MailToEmail"))},500)):(Ut.startScreens([Tt]),Mt.runHook("rl-start-login-screens"),qt.pub("rl.bootstart-login-screens")),e.SimplePace&&e.SimplePace.set(100),Ot.bMobileDevice||r.defer(function(){Pt.initLayoutResizer("#rl-left","#rl-right",Lt.ClientSideKeyName.FolderListSize)})},this))):(s=Pt.pString(qt.settingsGet("CustomLoginLink")),s?(Ut.routeOff(),Ut.setHash(qt.link().root(),!0),Ut.routeOff(),r.defer(function(){e.location.href=s})):(Ut.hideLoading(),Ut.startScreens([Tt]),Mt.runHook("rl-start-login-screens"),qt.pub("rl.bootstart-login-screens"),e.SimplePace&&e.SimplePace.set(100))),n&&(e["rl_"+i+"_google_service"]=function(){qt.data().googleActions(!0),qt.socialUsers()}),a&&(e["rl_"+i+"_facebook_service"]=function(){qt.data().facebookActions(!0),qt.socialUsers()}),l&&(e["rl_"+i+"_twitter_service"]=function(){qt.data().twitterActions(!0),qt.socialUsers()}),qt.sub("interval.1m",function(){Ot.momentTrigger(!Ot.momentTrigger())}),Mt.runHook("rl-start-screens"),qt.pub("rl.bootstart-end")},qt=new Nt,Ht.addClass(Ot.bMobileDevice?"mobile":"no-mobile"),Bt.keydown(Pt.killCtrlAandS).keyup(Pt.killCtrlAandS),Bt.unload(function(){Ot.bUnload=!0}),Ht.on("click.dropdown.data-api",function(){Pt.detectDropdownVisibility()}),e.rl=e.rl||{},e.rl.addHook=Mt.addHook,e.rl.settingsGet=Mt.mainSettingsGet,e.rl.remoteRequest=Mt.remoteRequest,e.rl.pluginSettingsGet=Mt.settingsGet,e.rl.addSettingsViewModel=Pt.addSettingsViewModel,e.rl.createCommand=Pt.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={},Ut.setBoot(qt).bootstart(),Ht.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 1c6b26edf..5a19e5736 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;cb.progress&&b.add(b.addSpeed)},500)},b.prototype.stopAddInterval=function(){a.clearInterval(this.addInterval),this.addInterval=0},b.prototype.build=function(){if(null===this.el){var a=document.querySelector("body");a&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='
',a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el))}return this.el},b.prototype.reset=function(){return this.progress=0,this.render()},b.prototype.update=function(b){var c=a.parseInt(b,10);return c>this.progress&&(this.progress=c,this.progress=100this.progress?0:this.progress),this.render()},b.prototype.add=function(b){return this.progress+=a.parseInt(b,10),this.progress=100this.progress?0:this.progress,this.render()},b.prototype.setSpeed=function(a,b){this.addSpeed=a,this.stopProgress=b||100},b.prototype.render=function(){var b=this.build();b&&b.children&&b.children[0]&&b.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),b.className=b.className.replace("simple-pace-inactive",""),b.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),a.setTimeout(function(){b.className=b.className.replace("simple-pace-active",""),b.className+=" simple-pace-inactive"},500))},!a.SimplePace){var c=new b;a.SimplePace={sleep:function(){c.setSpeed(2,95)},set:function(a){c.update(a)},add:function(a){c.add(a)}}}}(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(a,b){function c(){}c.prototype.s=a.sessionStorage,c.prototype.t=a.top||a,c.prototype.getHash=function(){var a=null;if(this.s)a=this.s.getItem("__rlA")||null;else if(this.t){var c=this.t.name&&b&&"{"===this.t.name.toString().substr(0,1)?b.parse(this.t.name.toString()):null;a=c?c.__rlA||null:null}return a},c.prototype.setHash=function(){var c=a.rainloopAppData,d=null;this.s?this.s.setItem("__rlA",c&&c.AuthAccountHash?c.AuthAccountHash:""):this.t&&b&&(d={},d.__rlA=c&&c.AuthAccountHash?c.AuthAccountHash:"",this.t.name=b.stringify(d))},c.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},a._rlhh=new c,a.__rlah=function(){return a._rlhh?a._rlhh.getHash():null},a.__rlah_set=function(){a._rlhh&&a._rlhh.setHash()},a.__rlah_clear=function(){a._rlhh&&a._rlhh.clearHash()}}(window,window.JSON); \ No newline at end of file +!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 4378be11c..9a7238969 100644 --- a/rainloop/v/0.0.0/static/js/libs.js +++ b/rainloop/v/0.0.0/static/js/libs.js @@ -1,60 +1,60 @@ /* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-svg-touch-shiv-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-fullscreen_api */ -;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return I("flexWrap")},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!I("indexedDB",a)},s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return I("backgroundSize")},s.borderimage=function(){return I("borderImage")},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return I("animationName")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},s.cssreflections=function(){return I("boxReflect")},s.csstransforms=function(){return!!I("transform")},s.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return I("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),Modernizr.addTest("fullscreen",function(){for(var a=0;a',a,""].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return I("flexWrap")},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!I("indexedDB",a)},s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return I("backgroundSize")},s.borderimage=function(){return I("borderImage")},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return I("animationName")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},s.cssreflections=function(){return I("boxReflect")},s.csstransforms=function(){return!!I("transform")},s.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return I("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},C(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),Modernizr.addTest("fullscreen",function(){for(var a=0;au;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;ae||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); - +(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?(this._wrapped=n,void 0):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.5.2";var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var E="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:O(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},j.findWhere=function(n,t){return j.where(n,t,!0)},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>e.computed&&(e={value:n,computed:a})}),e.value},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;ae||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={},i=null==r?j.identity:k(r);return A(t,function(r,a){var o=i.call(e,r,a,t);n(u,o,r)}),u}};j.groupBy=F(function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])=0})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:new Date,a=null,i=n.apply(e,u)};return function(){var l=new Date;o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u)):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o;return function(){i=this,u=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u)))},l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u)),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=w||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var I={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};I.unescape=j.invert(I.escape);var T={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(T[n],function(t){return I[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); + /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(q),x("BeforeChange",function(e,t,i){t!==i&&(t===q?K():i===q&&K(!0))}),x(l+"."+q,function(){K()})},getIframe:function(i,n){var o=i.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(n,a,i),t.updateStatus("ready"),n}}});var Y=function(e){var i=t.items.length;return e>i-1?e-i:0>e?i+e:e},U=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,n=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,i&&i.enabled?(a+=" mfp-gallery",x(f+n,function(){i.navigateByImgClick&&t.wrap.on("click"+n,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+n,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+n,function(e,i){i.text&&(i.text=U(i.text,t.currItem.index,t.items.length))}),x(p+n,function(e,n,o,r){var a=t.items.length;o.counter=a>1?U(i.tCounter,r.index,a):""}),x("BuildControls"+n,function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(n.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+n,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+n,function(){o.off(n),t.wrap.off("click"+n),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=Y(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=Y(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;(t.direction?o:n)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?n:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=Y(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),T("LazyLoad",n),"image"===n.type&&(n.img=e('').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0,T("LazyLoadError",n)}).attr("src",n.src)),n.preloaded=!0}}}});var G="retina";e.magnificPopup.registerModule(G,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;i=isNaN(i)?i():i,i>1&&(x("ImageHasSize."+G,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})}),x("ElementParse."+G,function(t,n){n.src=e.replaceSrc(n,i)}))}}}}),function(){var t=1e3,i="ontouchstart"in window,n=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(i){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,n())}).on("touchend"+r,function(e){n(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),i&&I.off("touchmove"+r+" touchend"+r)}}()})(window.jQuery||window.Zepto); - +(function(e){var t,i,n,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",v="."+g,h="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,i){t.ev.on(g+e+v,i)},k=function(t,i,n,o){var r=document.createElement("div");return r.className="mfp-"+t,n&&(r.innerHTML=n),o?i&&i.appendChild(r):(r=e(r),i&&r.appendTo(i)),r},T=function(i,n){t.ev.triggerHandler(g+i,n),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(n)?n:[n]))},E=function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},S=function(i){return i===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=i),t.currTemplate.closeBtn},P=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},_=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var i=navigator.appVersion;t.isIE7=-1!==i.indexOf("MSIE 7."),t.isIE8=-1!==i.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=_(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document.body),o=e(document),t.popupsCache={}},open:function(i){var n;if(i.isObj===!1){t.items=i.items.toArray(),t.index=0;var r,s=i.items;for(n=0;s.length>n;n++)if(r=s[n],r.parsed&&(r=r.el[0]),r===i.el[0]){t.index=n;break}}else t.items=e.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],a="",t.ev=i.mainEl&&i.mainEl.length?i.mainEl.eq(0):o,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+v,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+v,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(n=0;l.length>n;n++){var c=l[n];c=c.charAt(0).toUpperCase()+c.slice(1),t["init"+c].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,i,n){i.close_replaceWith=S(n.type)}),a+=" mfp-close-btn-in"):t.wrap.append(S())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+v,function(e){27===e.keyCode&&t.close()}),I.on("resize"+v,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var d=t.wH=I.height(),u={};if(t.fixedContentPos&&t._hasScrollBar(d)){var m=t._getScrollbarSize();m&&(u.marginRight=m)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):u.overflow="hidden");var g=t.st.mainClass;return t.isIE7&&(g+=" mfp-ie7"),g&&t._addClassToMFP(g),t.updateItemHTML(),T("BuildControls"),e("html").css(u),t.bgOverlay.add(t.wrap).prependTo(document.body),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(h),E()):t.bgOverlay.addClass(h),o.on("focusin"+v,function(i){return i.target===t.wrap[0]||e.contains(t.wrap[0],i.target)?void 0:(E(),!1)})},16),t.isOpen=!0,t.updateSize(d),T(f),i},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var i=C+" "+h+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var n={marginRight:""};t.isIE7?e("body, html").css("overflow",""):n.overflow="",e("html").css(n)}o.off("keyup"+v+" focusin"+v),t.ev.off(v),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var o=t.st[n]?t.st[n].markup:!1;T("FirstMarkupParse",o),t.currTemplate[n]=o?e(o):!0}r&&r!==i.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(a,n),i.preloaded=!0,T(m,i),r=i.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[i]===!0?t.content.find(".mfp-close").length||t.content.append(S()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n=t.items[i],o=n.type;if(n=n.tagName?{el:e(n)}:{data:n,src:n.src},n.el){for(var r=t.types,a=0;r.length>a;a++)if(n.el.hasClass("mfp-"+r[a])){o=r[a];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=o||t.st.type||"inline",n.index=i,n.parsed=!0,t.items[i]=n,T("ElementParse",n),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var o="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(o).on(o,n)):(i.isObj=!1,i.delegate?e.off(o).on(o,i.delegate,n):(i.items=e,e.off(o).on(o,n)))},_openClick:function(i,n,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==i.which&&!i.ctrlKey&&!i.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(a>I.width())return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),o.el=e(i.mfpEl),o.delegate&&(o.items=n.find(o.delegate)),t.open(o)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var o={status:e,text:n};T("UpdateStatus",o),e=o.status,n=o.text,t.preloader.html(n),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),i=e}},_checkIfClose:function(i){if(!e(i).hasClass(y)){var n=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(n&&o)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(o&&e.contains(document,i))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_parseMarkup:function(t,i,n){var o;n.data&&(i=e.extend(n.data,i)),T(p,[t,i,n]),e.each(i,function(e,i){if(void 0===i||i===!1)return!0;if(o=e.split("_"),o.length>1){var n=t.find(v+"-"+o[0]);if(n.length>0){var r=o[1];"replaceWith"===r?n[0]!==i[0]&&n.replaceWith(i):"img"===r?n.is("img")?n.attr("src",i):n.replaceWith(''):n.attr(o[1],i)}}else t.find(v+"-"+e).html(i)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,i){return P(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(i){P();var n=e(this);if("string"==typeof i)if("open"===i){var o,r=b?n.data("magnificPopup"):n[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=n,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},n,r)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else i=e.extend(!0,{},i),b?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var O,z,M,B="inline",H=function(){M&&(z.after(M.addClass(O)).detach(),M=null)};e.magnificPopup.registerModule(B,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(B),x(l+"."+B,function(){H()})},getInline:function(i,n){if(H(),i.src){var o=t.st.inline,r=e(i.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(z||(O=o.hiddenClass,z=k(O),O="mfp-"+O),M=r.after(z).detach().removeClass(O)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("
");return i.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var L,A="ajax",F=function(){L&&n.removeClass(L)},j=function(){F(),t.req&&t.req.abort()};e.magnificPopup.registerModule(A,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){t.types.push(A),L=t.st.ajax.cursor,x(l+"."+A,j),x("BeforeChange."+A,j)},getAjax:function(i){L&&n.addClass(L),t.updateStatus("loading");var o=e.extend({url:i.src,success:function(n,o,r){var a={data:n,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),A),i.finished=!0,F(),E(),setTimeout(function(){t.wrap.addClass(h)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){F(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var N,W=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var n=t.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(t,i);if(i.el)return i.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var e=t.st.image,i=".image";t.types.push("image"),x(f+i,function(){"image"===t.currItem.type&&e.cursor&&n.addClass(e.cursor)}),x(l+i,function(){e.cursor&&n.removeClass(e.cursor),I.off("resize"+v)}),x("Resize"+i,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,N&&clearInterval(N),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],o=function(r){N&&clearInterval(N),N=setInterval(function(){return n.naturalWidth>0?(t._onImageHasSize(e),void 0):(i>200&&clearInterval(N),i++,3===i?o(10):40===i?o(50):100===i&&o(500),void 0)},r)};o(1)},getImage:function(i,n){var o=0,r=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",i.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=i.src,l.is("img")&&(i.img=i.img.clone()),i.img[0].naturalWidth>0&&(i.hasSize=!0)}return t._parseMarkup(n,{title:W(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(N&&clearInterval(N),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var R,Z=function(){return void 0===R&&(R=void 0!==document.createElement("p").style.MozTransform),R};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,i=t.st.zoom,n=".zoom";if(i.enabled&&t.supportsTransition){var o,r,a=i.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),n="all "+i.duration/1e3+"s "+i.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=n,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+n,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+n,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+n,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(i){var n;n=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=n.offset(),r=parseInt(n.css("padding-top"),10),a=parseInt(n.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:n.width(),height:(b?n.innerHeight():n[0].offsetHeight)-a-r};return Z()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var q="iframe",D="//about:blank",K=function(e){if(t.currTemplate[q]){var i=t.currTemplate[q].find("iframe");i.length&&(e||(i[0].src=D),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(q,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(q),x("BeforeChange",function(e,t,i){t!==i&&(t===q?K():i===q&&K(!0))}),x(l+"."+q,function(){K()})},getIframe:function(i,n){var o=i.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(n,a,i),t.updateStatus("ready"),n}}});var Y=function(e){var i=t.items.length;return e>i-1?e-i:0>e?i+e:e},U=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,n=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,i&&i.enabled?(a+=" mfp-gallery",x(f+n,function(){i.navigateByImgClick&&t.wrap.on("click"+n,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+n,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+n,function(e,i){i.text&&(i.text=U(i.text,t.currItem.index,t.items.length))}),x(p+n,function(e,n,o,r){var a=t.items.length;o.counter=a>1?U(i.tCounter,r.index,a):""}),x("BuildControls"+n,function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(n.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+n,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+n,function(){o.off(n),t.wrap.off("click"+n),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=Y(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=Y(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;(t.direction?o:n)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?n:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=Y(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),T("LazyLoad",n),"image"===n.type&&(n.img=e('').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0,T("LazyLoadError",n)}).attr("src",n.src)),n.preloaded=!0}}}});var G="retina";e.magnificPopup.registerModule(G,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;i=isNaN(i)?i():i,i>1&&(x("ImageHasSize."+G,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})}),x("ElementParse."+G,function(t,n){n.src=e.replaceSrc(n,i)}))}}}}),function(){var t=1e3,i="ontouchstart"in window,n=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(i){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,n())}).on("touchend"+r,function(e){n(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),i&&I.off("touchmove"+r+" touchend"+r)}}()})(window.jQuery||window.Zepto); + /*! * Bootstrap.js by @fat & @mdo * Copyright 2013 Twitter, Inc. @@ -551,8 +551,8 @@ j.r=function(a,b){var c=this.d("onSelect");if(b&&(!c||h!==c(a,b))){this.e.t(a);v !function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('