<div class="popups">
	<div class="modal hide b-compose" data-backdrop="static" data-bind="modal: modalVisibility, css: {'loading': saving() || sending()}">
		<div class="modal-header b-header-toolbar g-ui-user-select-none">
			<a class="btn btn-large button-send" data-bind="command: sendCommand, css: {'btn-danger': sendError, 'btn-warning': sendSuccessButSaveError }">
				<i data-bind="css: {'icon-paper-plane': !sending(), 'icon-spinner animated big': sending(), 'icon-white': sendError() || sendSuccessButSaveError()}"></i>
				&nbsp;&nbsp;
				<span class="i18n" data-i18n-text="COMPOSE/BUTTON_SEND"></span>
			</a>
			<a class="btn button-save" data-bind="command: saveCommand, css: {'btn-danger': savedError }">
				<i data-bind="css: {'icon-floppy': !saving(), 'icon-spinner animated': saving(), 'icon-white': savedError()}"></i>
				&nbsp;&nbsp;
				<span class="i18n" data-i18n-text="COMPOSE/BUTTON_SAVE"></span>
			</a>
			<a class="btn button-close pull-right" data-tooltip-placement="bottom" data-bind="click: tryToClosePopup, tooltip: 'COMPOSE/BUTTON_CANCEL'">
				<i class="icon-remove"></i>
			</a>
			<a class="btn button-skip pull-right" data-tooltip-placement="bottom" data-bind="command: skipCommand, tooltip: 'COMPOSE/BUTTON_MINIMIZE'">
				<i class="icon-down"></i>
			</a>
			<a class="btn btn-danger button-delete button-delete-transitions" data-bind="command: deleteCommand">
				<i class="icon-trash icon-white"></i>
			</a>
			<span class="saved-text" data-bind="text: savedOrSendingText, css: { 'errorDesc': savedError }"></span>
		</div>
		<div class="modal-body">
			<div>
				<div class="b-header g-ui-user-select-none">
					<div class="g-ui-table">
						<div class="e-row" style="height: 40px;">
							<div class="e-cell e-label">
								<label class="control-label">
									<span class="i18n" data-i18n-text="COMPOSE/TITLE_FROM"></span>
								</label>
							</div>
							<div class="e-cell e-value">
								<div class="dropdown pull-left" data-bind="registrateBootstrapDropdown: true, openDropdownTrigger: identitiesDropdownTrigger">
									<a class="dropdown-toggle g-ui-dropdown e-identity" href="#" tabindex="-1"
										id="identity-label-id" role="button" data-toggle="dropdown"
										data-bind="text: currentIdentityString, dropdownCloser: true, css: {'multiply': 1 < identitiesOptions().length }">
									</a>
									<!-- ko if: 1 < identitiesOptions().length -->
										<ul class="dropdown-menu g-ui-menu" role="menu" aria-labelledby="identity-label-id">
											<!-- ko foreach: identitiesOptions -->
												<li class="e-item" role="presentation">
													<a class="e-link menuitem" tabindex="-1" href="javascript:void(0);" data-bind="click: function (oIdentity) { $root.selectIdentity(oIdentity); return true; }">
														<span data-bind="text: optText"></span>
													</a>
												</li>
											<!-- /ko -->
										</ul>
									<!-- /ko -->
								</div>
								<div class="btn-group dropdown colored-toggle pull-right" style="margin-right: 4px;">
									<a class="btn dropdown-toggle buttonMore" data-toggle="dropdown">
										<i class="icon-list"></i>
									</a>
									<ul class="dropdown-menu g-ui-menu" role="menu">
										<li class="e-item" data-bind="click: function () { requestReadReceipt(!requestReadReceipt()); }">
											<a class="e-link">
												<i class="icon-checkbox-unchecked" data-bind="css: {'icon-checkbox-checked': requestReadReceipt(), 'icon-checkbox-unchecked': !requestReadReceipt() }"></i>
												&nbsp;&nbsp;
												<span class="i18n" data-i18n-text="COMPOSE/BUTTON_REQUEST_READ_RECEIPT"></span>
											</a>
										</li>
										<li class="e-item" data-bind="click: function () { markAsImportant(!markAsImportant()); }">
											<a class="e-link">
												<i class="icon-checkbox-unchecked" data-bind="css: {'icon-checkbox-checked': markAsImportant(), 'icon-checkbox-unchecked': !markAsImportant() }"></i>
												&nbsp;&nbsp;
												<span class="i18n" data-i18n-text="COMPOSE/BUTTON_MARK_AS_IMPORTANT"></span>
											</a>
										</li>
										<li class="divider" data-bind="visible: capaOpenPGP"></li>
										<li class="e-item" data-bind="visible: capaOpenPGP, click: openOpenPgpPopup, css: {'disabled': isHtml()}">
											<a class="e-link">
												<i class="icon-key"></i>
												&nbsp;&nbsp;
												<span class="i18n" data-i18n-text="COMPOSE/BUTTON_OPEN_PGP"></span>
											</a>
										</li>
									</ul>
								</div>
								<div class="btn-group pull-right">&nbsp;</div>
								<div class="btn-group pull-right">
									<a class="btn" data-tooltip-placement="bottom" data-bind="visible: allowContacts, command: contactsCommand, tooltip: 'FOLDER_LIST/BUTTON_CONTACTS'">
										<i class="icon-address-book"></i>
									</a>
								</div>
								<div class="btn-group pull-right">&nbsp;</div>
								<span class="pull-right">
									<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_CC"
										data-bind="visible: !showCc(), click: function () { showCc(true); }"></span>
									&nbsp;&nbsp;
									<span class="i18n g-ui-link" data-i18n-text="COMPOSE/TITLE_BCC"
										data-bind="visible: !showBcc(), click: function () { showBcc(true); }"></span>
								</span>
							</div>
						</div>
						<div class="e-row">
							<div class="e-cell e-label">
								<label class="control-label">
									<span class="i18n" data-i18n-text="COMPOSE/TITLE_TO"></span>
								</label>
							</div>
							<div class="e-cell e-value">
								<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="emailsTags: to, emailsTagsFilter: to.focusTrigger, autoCompleteSource: emailsSource" />
								<span class="help-block error-desc" data-bind="visible: emptyToError">
									<span class="i18n" data-i18n-text="COMPOSE/EMPTY_TO_ERROR_DESC"></span>
								</span>
							</div>
						</div>
						<div class="e-row cc-row" data-bind="visible: showCc">
							<div class="e-cell e-label">
								<span class="i18n" data-i18n-text="COMPOSE/TITLE_CC"></span>
							</div>
							<div class="e-cell e-value">
								<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="emailsTags: cc, autoCompleteSource: emailsSource" />
							</div>
						</div>
						<div class="e-row bcc-row" data-bind="visible: showBcc">
							<div class="e-cell e-label">
								<span class="i18n" data-i18n-text="COMPOSE/TITLE_BCC"></span>
							</div>
							<div class="e-cell e-value">
								<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="emailsTags: bcc, autoCompleteSource: emailsSource" />
							</div>
						</div>
						<div class="e-row reply-to-row" data-bind="visible: false">
							<div class="e-cell e-label">
								<span class="i18n" data-i18n-text="COMPOSE/TITLE_REPLY_TO"></span>
							</div>
							<div class="e-cell e-value">
								<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" data-bind="emailsTags: replyTo, autoCompleteSource: emailsSource" />
							</div>
						</div>
						<div class="e-row">
							<div class="e-cell e-label">
								<span class="i18n" data-i18n-text="COMPOSE/TITLE_SUBJECT"></span>
							</div>
							<div class="e-cell e-value">
								<input type="text" size="70" autocomplete="off" data-bind="textInput: subject" />
							</div>
						</div>
						<div class="e-row">
							<div class="e-cell e-label"></div>
							<div class="e-cell e-value">
								<div>
									<div class="b-attachment-place" data-bind="visible: addAttachmentEnabled() && dragAndDropEnabled() && dragAndDropVisible(), initDom: composeUploaderDropPlace, css: {'dragAndDropOver': dragAndDropOver}">
										<span class="i18n" data-i18n-text="COMPOSE/ATTACH_DROP_FILES_DESC"></span>
									</div>
									<div class="pull-left">
										<div class="btn-group" data-toggle="buttons-radio">
											<button type="button" class="btn" data-bind="click: function () { attachmentsPlace(false); },
												css: { 'active': !attachmentsPlace() }">
												<i class="icon-file-text"></i>
											</button>
											<button type="button" class="btn" data-bind="click: function () { attachmentsPlace(true); },
												css: { 'btn-danger': 0 < attachmentsInErrorCount(), 'active': attachmentsPlace() }">
												<span data-bind="visible: 0 < attachmentsCount()">
													<b data-bind="text: attachmentsCount"></b>
													&nbsp;&nbsp;
												</span>
												<i data-bind="css: { 'icon-attachment': 0 === attachmentsInProcessCount(), 'icon-spinner animated': 0 < attachmentsInProcessCount(), 'icon-white': 0 < attachmentsInErrorCount() }"></i>
											</button>
										</div>
										<span class="help-block error-desc" data-bind="visible: attachmentsInProcessError">
											<span class="i18n" data-i18n-text="COMPOSE/ATTACHMENTS_UPLOAD_ERROR_DESC"></span>
										</span>
										<span class="help-block error-desc" data-bind="visible: !attachmentsInProcessError() && attachmentsInErrorError()">
											<span class="i18n" data-i18n-text="COMPOSE/ATTACHMENTS_ERROR_DESC"></span>
										</span>
									</div>
									<div class="pull-right" style="margin-right: 4px;">
										<div class="btn-group pull-right">
											<a class="btn" data-tooltip-placement="top" data-bind="visible: addAttachmentEnabled(), initDom: composeUploaderButton, tooltip: 'COMPOSE/ATTACH_FILES'">
												<i class="icon-attachment"></i>
											</a>
											<a class="btn" data-tooltip-placement="top" data-bind="visible: dropboxEnabled, command: dropboxCommand, tooltip: 'COMPOSE/DROPBOX'">
												<i class="icon-dropbox"></i>
											</a>
											<a class="btn" data-tooltip-placement="top" data-bind="visible: driveEnabled() && driveVisible(), command: driveCommand, tooltip: 'COMPOSE/GOOGLE_DRIVE'">
												<i class="icon-google-drive"></i>
											</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div class="attachmentAreaParent b-content" style="height: 200px; min-height: 200px" data-bind="nano: true, visible: attachmentsPlace, initResizeTrigger: [resizer(), 200, 47]">
					<div class="content g-scrollbox">
						<div class="content-wrapper">
							<ul class="attachmentList" data-bind="template: { name: 'ComposeAttachment', foreach: attachments }"></ul>
							<div class="no-attachments-desc" data-bind="visible: 0 === attachments().length">
								<span class="i18n" data-i18n-text="COMPOSE/NO_ATTACHMENTS_HERE_DESC"></span>
							</div>
						</div>
					</div>
				</div>

				<div class="textAreaParent" style="height: 200px; min-height: 200px"
					data-bind="visible: !attachmentsPlace(), initDom: composeEditorArea, initResizeTrigger: [resizer(), 200, 30]"></div>
			</div>
		</div>
	</div>
</div>