<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
<?= $this->section('content'); ?>
<!--Content Body-->
<div class="row" id="viewMaquinistaMaquinaTarea" data-id="<?= $ot_tarea->id ?>">
    
    <input type="hidden" id="impresoras" value='<?= json_encode($impresoras, JSON_HEX_APOS | JSON_HEX_QUOT) ?>'>

    <div class="nav-align-top">
        <ul class="nav nav-pills mb-4 nav-fill" role="tablist">
            <li class="nav-item mb-1 mb-sm-0">
                <button
                    type="button"
                    class="nav-link active"
                    role="tab"
                    data-bs-toggle="tab"
                    data-bs-target="#navs-tarea"
                    aria-controls="navs-tarea"
                    aria-selected="true">
                    <span class="d-none d-sm-inline-flex align-items-center">
                        Tarea
                    </span>
                    <i class="icon-base ti tabler-home icon-sm d-sm-none"></i>
                </button>
            </li>
            <li class="nav-item mb-1 mb-sm-0">
                <button
                    type="button"
                    class="nav-link"
                    role="tab"
                    data-bs-toggle="tab"
                    data-bs-target="#navs-chat"
                    aria-controls="navs-chat"
                    aria-selected="false">
                    <span class="d-none d-sm-inline-flex align-items-center">Mensajería</span>
                </button>
            </li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane fade show active" id="navs-tarea">
                <div class="container-fluid h-100">
                    <?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
                    <div class="row mb-2 h-100 d-flex flex-wrap">
                        <?php if ($ot_tarea?->maquina_actual()?->etiqueta_envio): ?>
                            <div class="col-md-12 d-flex justify-content-end mb-2">
                                <button id="btn-print-labels" class="btn-primary btn d-flex justify-content-evenly gap-2" data-id="<?=$ot_tarea?->maquina_actual()->id?>"><span class="ti ti-barcode ti-lg"></span><?= lang('Produccion.print_label') ?></button>
                            </div>
                        <?php endif; ?>
                        <div class="col-md-6 tarea-card-info-block">
                            <?= view("/themes/vuexy/components/cards/tarea_card.php") ?>
                        </div>
                        <div class="col-md-6 tarea-card-action-block">
                            <?= view("/themes/vuexy/components/cards/tarea_card_actions.php") ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade show" id="navs-chat">
                <div class="col-md-12 section-block">
                    <?= view("themes/vuexy/components/chat_internal_orden_trabajo", data: ["modelId" => $ot->id, "type" => "orden_trabajo"]) ?>
                </div>
            </div>
        </div>
    </div>
</div>

<?= $this->endSection() ?>

<?= $this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/maquinista.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/notiflix/notiflix.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />


<?= $this->endSection() ?>

<?= $this->section("additionalExternalJs") ?>
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.js") ?>"></script>
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewTareaView.js") ?>"></script>

<?= $this->endSection() ?>