<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<div data-bind="scope: 'messages'">
    <!-- ko if: cookieMessagesObservable() && cookieMessagesObservable().length > 0 -->
    <div aria-atomic="true" role="alert" class="messages" data-bind="foreach: {
        data: cookieMessagesObservable(), as: 'message' }, visible: updateHeight()">
		<div data-bind="attr: {
            class: 'message-' + message.type + ' ' + message.type + ' message',
            'data-ui-id': 'message-' + message.type
        }">
			<div data-bind="html: $parent.prepareMessageForHtml(message.text)"></div>
			<div data-bind="visible: $parent.closeMessage()" style="display: none" data-action="close"
				 class="ox-overlay-close-btn" aria-label="Close Message"><span></span></div>
		</div>
	</div>
	<!-- /ko -->
	<div aria-atomic="true" role="alert" class="messages" data-bind="foreach: {
        data: messages().messages, as: 'message'
    }, visible: updateHeight(), afterRender: purgeMessages">
		<div data-bind="attr: {
            class: 'message-' + message.type + ' ' + message.type + ' message',
            'data-ui-id': 'message-' + message.type
        }">
			<div data-bind="html: $parent.prepareMessageForHtml(message.text)"></div>
			<div data-bind="visible: $parent.closeMessage()" style="display: none" data-action="close"
				 class="ox-overlay-close-btn" aria-label="Close Message" ><span></span></div>
		</div>
	</div>
</div>
<script type="text/x-magento-init">
    {
        "*": {
            "Magento_Ui/js/core/app": {
                "components": {
                        "messages": {
                            "component": "Magento_Theme/js/view/messages"
                        }
                    }
                }
            }
    }
</script>
