'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var vueRouter = require('vue-router');
var pinia = require('pinia');
require('../../../../stores/index.js');
var themeConfig = require('../../../../stores/themeConfig.js');

var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "transverse",
  setup(__props) {
    const LayoutHeader = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/header.vue.js'); }));
    const LayoutMain = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/main.vue.js'); }));
    const layoutMainRef = vue.ref();
    const storesThemeConfig = themeConfig.useThemeConfig();
    const { themeConfig: themeConfig$1 } = pinia.storeToRefs(storesThemeConfig);
    const route = vueRouter.useRoute();
    const updateScrollbar = () => {
      layoutMainRef.value.layoutMainScrollbarRef.update();
    };
    const initScrollBarHeight = () => {
      vue.nextTick(() => {
        setTimeout(() => {
          updateScrollbar();
          layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
        }, 500);
      });
    };
    vue.onMounted(() => {
      initScrollBarHeight();
    });
    vue.watch(
      () => route.path,
      () => {
        initScrollBarHeight();
      }
    );
    vue.watch(
      () => themeConfig$1.value.isTagsview,
      () => {
        vue.nextTick(() => {
          updateScrollbar();
        });
      },
      {
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_el_container = vue.resolveComponent("el-container");
      return vue.openBlock(), vue.createBlock(_component_el_container, { class: "layout-container flex-center layout-backtop" }, {
        default: vue.withCtx(() => [
          vue.createVNode(vue.unref(LayoutHeader)),
          vue.createVNode(
            vue.unref(LayoutMain),
            {
              ref_key: "layoutMainRef",
              ref: layoutMainRef
            },
            null,
            512
            /* NEED_PATCH */
          )
        ]),
        _: 1
        /* STABLE */
      });
    };
  }
});

exports.default = _sfc_main;
