"use strict";
const common_vendor = require("../../../common/vendor.js");
const sheep_index = require("../../index.js");
require("../../api/index.js");
require("../../api/distri/score.js");
require("../../request/index.js");
require("../../config/index.js");
require("../../store/index.js");
require("../../store/app.js");
require("../../api/promotion/diy.js");
require("../../platform/index.js");
require("../../platform/provider/wechat/index.js");
require("../../platform/provider/wechat/miniProgram.js");
require("../../api/member/auth.js");
require("../../api/member/social.js");
require("../../api/member/user.js");
require("../../platform/provider/apple/index.js");
require("../../platform/share.js");
require("../../router/index.js");
require("../../hooks/useModal.js");
require("../../helper/index.js");
require("../../helper/test.js");
require("../../helper/digit.js");
require("../../api/member/signin.js");
require("../../helper/throttle.js");
require("../../url/index.js");
require("../../platform/pay.js");
require("../../api/pay/order.js");
require("../../store/user.js");
require("../../store/cart.js");
require("../../api/trade/cart.js");
require("../../api/pay/wallet.js");
require("../../api/trade/order.js");
require("../../api/promotion/coupon.js");
require("../../store/sys.js");
require("../../store/modal.js");
require("../../api/distri/share.js");
require("../../api/distri/team.js");
require("../../api/infra/file.js");
require("../../api/member/address.js");
require("../../api/member/point.js");
require("../../api/migration/app.js");
require("../../api/migration/chat.js");
require("../../api/migration/index.js");
require("../../api/migration/third.js");
require("../../api/pay/channel.js");
require("../../api/product/category.js");
require("../../api/product/comment.js");
require("../../api/product/favorite.js");
require("../../api/product/history.js");
require("../../api/product/spu.js");
require("../../api/promotion/activity.js");
require("../../api/promotion/article.js");
require("../../api/promotion/bargain.js");
require("../../api/promotion/combination.js");
require("../../api/promotion/rewardActivity.js");
require("../../api/promotion/seckill.js");
require("../../api/system/area.js");
require("../../api/system/voice.js");
require("../../api/trade/afterSale.js");
require("../../api/trade/brokerage.js");
require("../../api/trade/config.js");
require("../../api/trade/delivery.js");
require("../../config/zIndex.js");
if (!Array) {
  const _easycom_su_tabbar_item2 = common_vendor.resolveComponent("su-tabbar-item");
  const _easycom_su_tabbar2 = common_vendor.resolveComponent("su-tabbar");
  (_easycom_su_tabbar_item2 + _easycom_su_tabbar2)();
}
const _easycom_su_tabbar_item = () => "../../ui/su-tabbar-item/su-tabbar-item.js";
const _easycom_su_tabbar = () => "../../ui/su-tabbar/su-tabbar.js";
if (!Math) {
  (_easycom_su_tabbar_item + _easycom_su_tabbar)();
}
const _sfc_main = {
  __name: "s-tabbar",
  props: {
    path: String,
    default: ""
  },
  setup(__props) {
    const tabbar = common_vendor.computed(() => {
      var _a;
      return (_a = sheep_index.sheep.$store("app").template.basic) == null ? void 0 : _a.tabbar;
    });
    const tabbarStyle = common_vendor.computed(() => {
      const backgroundStyle = tabbar.value.style;
      if (backgroundStyle.bgType === "color") {
        return { background: backgroundStyle.bgColor };
      }
      if (backgroundStyle.bgType === "img")
        return {
          background: `url(${sheep_index.sheep.$url.cdn(
            backgroundStyle.bgImg
          )}) no-repeat top center / 100% auto`
        };
    });
    const getTabbarCenter = (index) => {
      if (common_vendor.unref(tabbar).mode !== 2)
        return false;
      return common_vendor.unref(tabbar).items % 2 > 0 ? Math.ceil(common_vendor.unref(tabbar).items.length / 2) === index + 1 : false;
    };
    return (_ctx, _cache) => {
      var _a, _b, _c, _d;
      return common_vendor.e({
        a: ((_b = (_a = tabbar.value) == null ? void 0 : _a.items) == null ? void 0 : _b.length) > 0
      }, ((_d = (_c = tabbar.value) == null ? void 0 : _c.items) == null ? void 0 : _d.length) > 0 ? {
        b: common_vendor.f(tabbar.value.items, (item, index, i0) => {
          return {
            a: common_vendor.unref(sheep_index.sheep).$url.cdn(item.activeIconUrl),
            b: common_vendor.unref(sheep_index.sheep).$url.cdn(item.iconUrl),
            c: item.text,
            d: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go(item.url), item.text),
            e: "2c28bd42-1-" + i0 + ",2c28bd42-0",
            f: common_vendor.p({
              text: item.text,
              name: item.url,
              isCenter: getTabbarCenter(index),
              centerImage: common_vendor.unref(sheep_index.sheep).$url.cdn(item.iconUrl)
            })
          };
        }),
        c: common_vendor.p({
          value: __props.path,
          fixed: true,
          placeholder: true,
          safeAreaInsetBottom: true,
          inactiveColor: tabbar.value.style.color,
          activeColor: tabbar.value.style.activeColor,
          midTabBar: tabbar.value.mode === 2,
          customStyle: tabbarStyle.value
        })
      } : {});
    };
  }
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/zx/mall-front-app/sheep/components/s-tabbar/s-tabbar.vue"]]);
wx.createComponent(Component);
