const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
//#region src/plus/saasDevice/devicePlanning/types.ts
const EMPTY_I18N = {
	original: "",
	en: "",
	"zh-CN": "",
	"zh-HK": "",
	ja: "",
	pt: ""
};
const DEVICE_KIND_OPTIONS = ["smart"];
const toLangDict = (val) => {
	if (!val) return require_objectSpread2._objectSpread2({}, EMPTY_I18N);
	if (typeof val === "string") return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, EMPTY_I18N), {}, {
		original: val,
		en: val
	});
	return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, EMPTY_I18N), val);
};
const validateI18nRequired = (message) => (_rule, value) => {
	if (!value) return Promise.reject(new Error(message));
	if (typeof value === "string") return value.trim() ? Promise.resolve() : Promise.reject(new Error(message));
	const filled = Object.entries(value).some(([key, val]) => key !== "original" && typeof val === "string" && val.trim() !== "");
	const original = typeof (value === null || value === void 0 ? void 0 : value.original) === "string" && value.original.trim() !== "";
	return filled || original ? Promise.resolve() : Promise.reject(new Error(message));
};
//#endregion
exports.DEVICE_KIND_OPTIONS = DEVICE_KIND_OPTIONS;
exports.EMPTY_I18N = EMPTY_I18N;
exports.toLangDict = toLangDict;
exports.validateI18nRequired = validateI18nRequired;
