const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_useEngineContext = require("../../../../hooks/useEngineContext.js");
const require_utils = require("../../utils.js");
const require_index = require("../Divider/index.js");
const require_index$1 = require("../AmountFooter/index.js");
const require_utils$1 = require("./utils.js");
let react = require("react");
react = require_runtime.__toESM(react);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/productCard/components/MultiDay/index.tsx
const prefix = "pisell-lowcode-";
const MultiDay = ({ dataSource, hideDivider }) => {
	var _context$appHelper;
	const { items, symbol, locale } = dataSource;
	const context = require_useEngineContext.default();
	const utils = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
	!(utils === null || utils === void 0) && utils.translationOriginal || utils === null || utils === void 0 || utils.translation;
	/**
	* @title: 商品单价 + 套餐价格
	* @description:
	* @param {*} useMemo
	* @return {*}
	* @Author: WangHan
	* @Date: 2024-12-28 23:00
	*/
	const lists = (0, react.useMemo)(() => {
		if (!(items === null || items === void 0 ? void 0 : items.length)) return [];
		return require_utils$1.formatDateRanges(items);
	}, [items]);
	return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${prefix}multi-day-wrap`) }, lists === null || lists === void 0 ? void 0 : lists.map((m, index) => {
		return /* @__PURE__ */ react.default.createElement("div", { key: index }, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "inside" }), /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${prefix}multi-day`) }, /* @__PURE__ */ react.default.createElement("div", null, require_utils.formatMultiDayDate(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, m), {}, { locale }))), /* @__PURE__ */ react.default.createElement(require_index$1.default, {
			item: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, m), {}, { symbol }),
			hideDivider: true
		})));
	}), /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${prefix}multi-day-total-wrap`) }, /* @__PURE__ */ react.default.createElement(require_index$1.default, {
		item: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, dataSource), {}, { num: 1 }),
		type: "total",
		isOnlyTotal: true
	})));
};
//#endregion
exports.default = MultiDay;
