const require_useEngineContext = require("../../../hooks/useEngineContext.js");
const require_urlUtils = require("../dataSourceForm/urlUtils.js");
//#region src/components/dataSourceComponents/hooks/useFormSettingParams.ts
const scopeMap = {
	saas: "saas",
	org: "organization",
	biz: "business",
	channel: "channel",
	board: "board"
};
const useFormSettingParams = () => {
	var _context$appHelper, _app$history;
	const { getApp } = (_context$appHelper = require_useEngineContext.default().appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils;
	const app = getApp === null || getApp === void 0 ? void 0 : getApp();
	const params = app === null || app === void 0 || (_app$history = app.history) === null || _app$history === void 0 ? void 0 : _app$history.useParams();
	const queryParams = require_urlUtils.getUrlParams();
	const businessCode = (queryParams === null || queryParams === void 0 ? void 0 : queryParams.biz) || (queryParams === null || queryParams === void 0 ? void 0 : queryParams.business_code);
	const channelCode = queryParams === null || queryParams === void 0 ? void 0 : queryParams.channel;
	const scope = scopeMap[params === null || params === void 0 ? void 0 : params.scope];
	const originTarget = businessCode && channelCode ? `${businessCode}+${channelCode}` : businessCode || channelCode;
	return {
		businessCode,
		channelCode,
		scope,
		target: ["organization", "saas"].includes(scope) ? void 0 : originTarget
	};
};
//#endregion
exports.default = useFormSettingParams;
