var getPrimaryType = (e) => Array.isArray(e) ? e[0] : e;
const useArrayDefaultValue = (t) => {
	if (!t) return "";
	let n = getPrimaryType(t.type);
	if (n === "object") {
		let n = {};
		return t.properties && Object.entries(t.properties).forEach(([t, r]) => {
			if (r.default !== void 0) n[t] = r.default;
			else switch (getPrimaryType(r.type)) {
				case "string":
					n[t] = "";
					break;
				case "number":
				case "integer":
					n[t] = 0;
					break;
				case "boolean":
					n[t] = !1;
					break;
				case "array":
					n[t] = [];
					break;
				case "object":
					n[t] = {};
					break;
				default: n[t] = "";
			}
		}), n;
	}
	if (n === "array") return [];
	if (t.default !== void 0) return t.default;
	switch (n) {
		case "string": return "";
		case "number":
		case "integer": return 0;
		case "boolean": return !1;
		case "array": return [];
		case "object": return {};
		default: return "";
	}
};
export { useArrayDefaultValue };
