/* empty css                                               */
/* empty css                                                */
/* empty css                                               */
/* empty css                                                  */
import { createBlock, openBlock, mergeProps, createSlots, renderList, withCtx, renderSlot } from "vue";
import { pageHistory } from "../../../utils/pageHistory.mjs";
import emitter from "../../../utils/eventBus.mjs";
/* empty css             */
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
import { NavBar } from "../../../../node_modules/vant/es/nav-bar/index.mjs";
const _sfc_main = {
  __name: "NavBar",
  props: {
    isLeftBack: {
      type: Boolean,
      default: false
    },
    leftBackText: {
      type: String,
      default: ""
    },
    isRightButton: {
      type: Boolean,
      default: false
    },
    rightButtonText: {
      type: String,
      default: ""
    }
  },
  setup(__props) {
    const onClickLeft = () => {
      const prevPage = pageHistory.back();
      if (prevPage) {
        emitter.emit("loadPage", prevPage.id);
      }
    };
    return (_ctx, _cache) => {
      const _component_van_nav_bar = NavBar;
      return openBlock(), createBlock(_component_van_nav_bar, mergeProps(_ctx.$attrs, {
        "left-arrow": __props.isLeftBack,
        "left-text": __props.isLeftBack ? __props.leftBackText : "",
        "right-text": __props.isRightButton ? __props.rightButtonText : "",
        fixed: false,
        "safe-area-inset-top": "",
        clickable: "",
        onClickLeft
      }), createSlots({ _: 2 }, [
        renderList(_ctx.$slots, (item, key) => {
          return {
            name: key,
            fn: withCtx(() => [
              renderSlot(_ctx.$slots, key, {}, void 0, true)
            ])
          };
        })
      ]), 1040, ["left-arrow", "left-text", "right-text"]);
    };
  }
};
const _NavBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f6340561"]]);
export {
  _NavBar as default
};
