<template name="livechatIntegrations">
	{{#requiresPermission 'view-livechat-manager'}}
		<div class="rocket-form">
			<h2>{{_ "Webhooks"}}</h2>
			<p>
				{{_ "You_can_use_webhooks_to_easily_integrate_livechat_with_your_CRM"}}
				<a href="https://rocket.chat/docs/administrator-guides/livechat/#integrations">{{_ "Click_here"}}</a> {{_ "to_see_more_details_on_how_to_integrate"}}
			</p>

			<form id="integration-form">
				<div class="input-line">
					<label for="webhookUrl">{{_ "Webhook_URL"}}</label>
					<div>
						<input type="url" name="webhookUrl" id="webhookUrl" value="{{webhookUrl}}" placeholder="https://yourdomain.com/webhook/entrypoint">
					</div>
				</div>
				<div class="input-line">
					<label for="secretToken">{{_ "Secret_token"}}</label>
					<div>
						<input type="text" name="secretToken" id="secretToken" value="{{secretToken}}">
					</div>
				</div>
				<div class="input-line">
					<label for="sendOnClose">
						<input type="checkbox" name="sendOnClose" id="sendOnClose" value="1" checked="{{sendOnCloseChecked}}">
						{{_ "Send_request_on_chat_close"}}
					</label>
				</div>
				<div class="input-line">
					<label for="sendOnOffline">
						<input type="checkbox" name="sendOnOffline" id="sendOnOffline" value="1" checked="{{sendOnOfflineChecked}}">
						{{_ "Send_request_on_offline_messages"}}
					</label>
				</div>
				<div class="input-line">
					<label for="sendOnVisitorMessage">
						<input type="checkbox" name="sendOnVisitorMessage" id="sendOnVisitorMessage" value="1" checked="{{sendOnVisitorMessageChecked}}">
						{{_ "Send_request_on_visitor_message"}}
					</label>
				</div>
				<div class="input-line">
					<label for="sendOnAgentMessage">
						<input type="checkbox" name="sendOnAgentMessage" id="sendOnAgentMessage" value="1" checked="{{sendOnAgentMessageChecked}}">
						{{_ "Send_request_on_agent_message"}}
					</label>
				</div>
				<div class="submit">
					<button class="button danger reset-settings" type="button"><i class="icon-ccw"></i>{{_ "Reset"}}</button>
					<button class="button secondary test" type="button" disabled="{{disableTest}}">{{_ "Send_Test"}}</button>
					<button class="button primary save"><i class="icon-floppy"></i>{{_ "Save"}}</button>
				</div>
			</form>
		</div>
	{{/requiresPermission}}
</template>
