<?php

// phpcs:disable Generic.Files.LineLength.TooLong

/** @var Map $block */
/** @var Escaper $escaper */

use Macopedia\OrlenShipping\Block\Map;
use Macopedia\OrlenShipping\Model\Carrier\OrlenShipping;
use Magento\Framework\Escaper;
?>
<?php if ($block->canShow()): ?>
    <link rel="stylesheet" href="<?= $escaper->escapeUrl($block->getViewFileUrl('Macopedia_OrlenShipping::css/orlen.css')) ?>"/>
    <div data-bind="scope: 'orlen-map'"
         data-mage-init='{
        "Magento_Ui/js/core/app": {
                "components": {
                    "orlen-map": {
                        "component": "Macopedia_OrlenShipping/js/map",
                        "saveUrl": "<?= $escaper->escapeUrl($block->getUrl('orlenshipping/point/save')); ?>",
                        "carrierCode": "<?= $escaper->escapeJs(OrlenShipping::CODE) ?>",
                        "modalSelector": ".orlen-map-modal",
                        "token": "<?= $escaper->escapeJs($block->getToken()) ?>"
                    }
                }
            }
        }'>
        <!-- ko template: getTemplate() --><!-- /ko -->
    </div>
<?php endif; ?>
