<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php $_element = $block->getElement(); ?>
<div class="rule-tree">
    <fieldset id="<?php echo $_element->getHtmlId() ?>" <?php /* @escapeNotVerified */ echo $_element->serialize(['class']) ?> class="fieldset">
        <legend class="legend"><span><?php /* @escapeNotVerified */ echo $_element->getLegend() ?></span></legend>
        <br>
    <?php if ($_element->getComment()): ?>
        <div class="messages">
            <div class="message message-notice"><?php echo $block->escapeHtml($_element->getComment()) ?></div>
        </div>
    <?php endif; ?>
    <div class="rule-tree-wrapper">
        <?php echo $_element->getChildrenHtml() ?>
    </div>
	<div class="field-service" value-scope="<?php /* @escapeNotVerified */ echo $block->getScopeLabel()?>"></div>
    </fieldset>
</div>
<script>
require([
    "Magento_Rule/rules",
    "prototype"
], function(VarienRulesForm){

window.<?php echo $_element->getHtmlId() ?> = new VarienRulesForm('<?php echo $_element->getHtmlId() ?>', '<?php /* @escapeNotVerified */ echo $block->getNewChildUrl() ?>');
<?php if ($_element->getReadonly()): ?>
    <?php echo $_element->getHtmlId() ?>.setReadonly(true);
<?php endif; ?>
});
</script>
