const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_model = require("../model.js");
const require_detailContent = require("../resources/detail/detailContent.js");
const require_serve = require("./serve.js");
let react = require("react");
react = require_runtime.__toESM(react);
let ahooks = require("ahooks");
require("./index.less");
//#region src/components/schedules/openHours/index.tsx
const OpenHours = react.default.forwardRef((props, ref) => {
	const { state } = (0, react.useContext)(require_model.Context);
	const tabKey = state === null || state === void 0 ? void 0 : state.tabKey;
	const detailContentRef = (0, react.useRef)(null);
	const _getOpenHoursSchedule = (0, ahooks.useRequest)(require_serve.getOpenHoursSchedule, {
		manual: true,
		onSuccess: (result) => {
			var _detailContentRef$cur, _detailContentRef$cur2;
			const data = (result === null || result === void 0 ? void 0 : result.data) || {};
			detailContentRef === null || detailContentRef === void 0 || (_detailContentRef$cur = detailContentRef.current) === null || _detailContentRef$cur === void 0 || (_detailContentRef$cur2 = _detailContentRef$cur.setFieldsValue) === null || _detailContentRef$cur2 === void 0 || _detailContentRef$cur2.call(_detailContentRef$cur, data);
		}
	});
	(0, react.useImperativeHandle)(ref, () => {
		return { getIsEdit: () => detailContentRef.current.getIsEdit() };
	});
	(0, react.useEffect)(() => {
		_getOpenHoursSchedule.run();
	}, []);
	return /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__schedules-component-openHours" }, /* @__PURE__ */ react.default.createElement(require_detailContent.default, {
		isAutoSetCalendarData: tabKey === "openHours",
		tabKey,
		ref: detailContentRef,
		loading: _getOpenHoursSchedule.loading,
		drawerContainer: document.querySelector(".pisell-lowcode__schedules-component-openHours")
	}));
});
//#endregion
exports.default = OpenHours;
