const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
let lodash = require("lodash");
lodash = require_runtime.__toESM(lodash);
//#region src/components/ticketBooking/sync.ts
/**
* 格式化同步前的数据
*/
const formatSyncData = (store) => {
	return JSON.stringify({ modalState: {
		client: store.modalState.client,
		date: store.modalState.date,
		pet: store.modalState.pet,
		notes: store.modalState.notes,
		contacts_info: store.modalState.contacts_info,
		service: { value: store.modalState.service.value }
	} });
};
/**
* 将传递的数据和现有store进行合并
*/
const mergeSyncData = (store, data) => {
	let _data = typeof data === "string" ? JSON.parse(data) : data;
	return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, store), {}, { modalState: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, store.modalState), {}, {
		client: _data.modalState.client,
		date: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, store.modalState.date), {}, { value: (0, dayjs.default)(_data.modalState.date.value) }),
		pet: _data.modalState.pet,
		notes: _data.modalState.notes,
		contacts_info: _data.modalState.contacts_info,
		service: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, store.modalState.service), {}, { value: _data.modalState.service.value.map((item) => {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, { _extend: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item._extend), {}, {
				start_date: (0, dayjs.default)(item._extend.start_date),
				startDate: (0, dayjs.default)(item._extend.startDate),
				endDate: (0, dayjs.default)(item._extend.endDate)
			}) });
		}) })
	}) });
};
//#endregion
exports.formatSyncData = formatSyncData;
exports.mergeSyncData = mergeSyncData;
