<template name="visitorInfo">
	{{#if editing}}
		{{> visitorEdit (editDetails)}}
	{{/if}}
	{{#if forwarding}}
		{{> visitorForward (forwardDetails)}}
	{{/if}}
	<div class="user-view {{showDetail}}">
		<div class="about clearfix">
			{{#with user}}
				<div class="info">
					{{#if name}}
						<h3 title="{{name}}"><i class="status-{{status}}"></i> {{name}}</h3>
						<p class="secondary-font-color">{{username}}</p>
					{{else}}
						<h3 title="{{username}}"><i class="status-{{status}}"></i> {{username}}</h3>
					{{/if}}
					<ul>
						{{#if utc}}<li><i class="icon-clock"></i>{{userTime}} (UTC {{utc}})</li>{{/if}}
						{{#each visitorEmails}} <li><i class="icon-mail"></i> {{address}}{{#if verified}}&nbsp;<i class="icon-ok success-color"></i>{{/if}}</li> {{/each}}
						{{#each phone}} <li><i class="icon-phone"></i> {{phoneNumber}}</li> {{/each}}
						{{#if lastLogin}} <li><i class="icon-calendar"></i> {{_ "Created_at"}}: {{createdAt}}</li> {{/if}}
						{{#if lastLogin}} <li><i class="icon-calendar"></i> {{_ "Last_login"}}: {{lastLogin}}</li> {{/if}}
						{{#if ip}}<li><i class="icon-laptop"></i><span>{{ip}}</span></li>{{/if}}
						{{#if os}}<li><i class="{{osIcon}}"></i><span>{{os}}</span></li>{{/if}}
						{{#if browser}}<li><i class="{{browserIcon}}"></i><span>{{browser}}</span></li>{{/if}}
					</ul>
				</div>
			{{/with}}

			{{#with room}}
				<div class="info">
					<ul>
						{{#if facebook}} <li><i class="icon-facebook"></i>{{_ "Facebook_Page"}}: {{facebook.page.name}}</li> {{/if}}
						{{#if sms}} <li><i class="icon-mobile"></i>{{_ "SMS_Enabled"}}</li> {{/if}}
						{{#if topic}} <li><strong>{{_ "Topic"}}</strong>: {{{RocketChatMarkdown topic}}}</li> {{/if}}
						{{#if tags}} <li><strong>{{_ "Tags"}}</strong>: {{joinTags}}</li> {{/if}}
					</ul>
				</div>
			{{/with}}
		</div>

		{{#if canSeeButtons}}
			<nav class="centered-buttons">
				<button class='button button-block edit-livechat'><span><i class='icon-edit'></i> {{_ "Edit"}}</span></button>
				{{#if roomOpen}}
					<button class='button button-block close-livechat'><span><i class='icon-download'></i> {{_ "Close"}}</span></button>
					<button class="button button-block forward-livechat"><span><i class="icon-forward"></i> {{_ "Forward"}}</span></button>
				{{/if}}

				{{#if guestPool}}
					<button class="button button-block return-inquiry"><span><i class="icon-ccw"></i> {{_ "Return"}}</span></button>
				{{/if}}
			</nav>
		{{/if}}

		{{#if customFields}}
			<div class="visitor-custom-fields">
				<h4>{{_ "Custom_Fields"}}</h4>

				<div class="visitor-scroll">
					<ul>
						{{#each customFields}}
							<li>{{label}}: {{value}}</li>
						{{/each}}
					</ul>
				</div>
			</div>
		{{/if}}

		{{> visitorNavigation .}}
	</div>
</template>
