require("./chunk-9hOWP6kD.cjs");
let lucide_react = require("lucide-react");
//#region ../core/src/registries/property-schema-types.ts
/**
* Property field type constant - single source of truth for field types.
* Use PROPERTY_FIELD_TYPES.text instead of "text" for type-safe comparisons.
*/
const PROPERTY_FIELD_TYPES = {
	text: "text",
	textarea: "textarea",
	number: "number",
	boolean: "boolean",
	select: "select",
	color: "color",
	range: "range",
	dataSource: "dataSource",
	resource: "resource",
	image: "image",
	alignment: "alignment",
	slider: "slider",
	colorPicker: "colorPicker",
	sectionHeader: "sectionHeader",
	separator: "separator",
	buttonGroup: "buttonGroup",
	colorSelect: "colorSelect",
	sectionLayoutSelect: "sectionLayoutSelect",
	background: "background",
	contentPosition: "contentPosition",
	textSizeSelect: "textSizeSelect",
	cssUnit: "cssUnit",
	fontPicker: "fontPicker",
	stringArray: "stringArray",
	borderRadius: "borderRadius",
	screenPicker: "screenPicker"
};
/**
* Runtime validation for property field types.
* @param value - The value to check
* @returns true if value is a valid PropertyFieldType
*/
function isPropertyFieldType(value) {
	return Object.values(PROPERTY_FIELD_TYPES).includes(value);
}
/**
* Group label for fields that override theme-derived styling.
* Rendered last within a tab and collapsed by default so the primary
* configuration surface stays clean.
*/
const CUSTOM_STYLING_GROUP = "Custom styling";
/**
* Group property fields by their group property.
*
* Fields flagged with `advanced: true` are collected into the
* `CUSTOM_STYLING_GROUP` bucket regardless of their declared `group`,
* and that bucket is always placed last so it renders at the bottom of
* the tab. Non-advanced fields keep their author-declared group and
* their relative insertion order, including fields that explicitly use
* `CUSTOM_STYLING_GROUP`.
*/
function groupPropertyFields(fields) {
	const grouped = {};
	const advancedFields = [];
	fields.forEach((field) => {
		if (field.advanced) {
			advancedFields.push(field);
			return;
		}
		const group = field.group || "General";
		if (!grouped[group]) grouped[group] = [];
		grouped[group].push(field);
	});
	if (advancedFields.length > 0) {
		const customStylingFields = grouped["Custom styling"] ?? [];
		delete grouped[CUSTOM_STYLING_GROUP];
		grouped[CUSTOM_STYLING_GROUP] = [...customStylingFields, ...advancedFields];
	}
	return grouped;
}
/**
* Extract current values from widget props based on property fields
*/
function extractPropertyValues(widget, fields) {
	const values = {};
	fields.forEach((field) => {
		if (field.type === "borderRadius") {
			for (const subKey of Object.values(field.keys)) {
				const subValue = widget.props[subKey];
				values[subKey] = subValue !== void 0 ? subValue : field.defaultValue;
			}
			return;
		}
		if (field.type === "dataSource") {
			values[field.key] = widget.dataSource;
			return;
		}
		const value = widget.props[field.key];
		values[field.key] = value !== void 0 ? value : field.defaultValue;
	});
	return values;
}
/**
* Apply property values to widget props
*/
function applyPropertyValues(widget, values) {
	return {
		...widget,
		props: {
			...widget.props,
			...values
		}
	};
}
//#endregion
//#region ../core/src/registries/field-helpers.ts
const getColorField = (props) => {
	return {
		...props,
		type: "colorSelect"
	};
};
const getBorderRadiusField = (props) => {
	return {
		advanced: true,
		...props,
		type: "buttonGroup",
		options: [
			{
				icon: lucide_react.Ban,
				ariaLabel: "No radius",
				value: "none"
			},
			{
				label: "SM",
				value: "sm"
			},
			{
				label: "MD",
				value: "md"
			},
			{
				label: "LG",
				value: "lg"
			},
			{
				label: "XL",
				value: "xl"
			},
			{
				label: "FULL",
				value: "full"
			}
		]
	};
};
const getPaddingField = (props) => {
	return {
		advanced: true,
		...props,
		type: "buttonGroup",
		options: [
			{
				icon: lucide_react.Ban,
				ariaLabel: "No padding",
				value: 0
			},
			{
				label: "SM",
				value: 2
			},
			{
				label: "MD",
				value: 4
			},
			{
				label: "LG",
				value: 6
			},
			{
				label: "XL",
				value: 8
			},
			{
				label: "FULL",
				value: 10
			}
		]
	};
};
const getButtonSizeField = (props) => {
	return {
		...props,
		type: "buttonGroup",
		options: [
			{
				label: "SM",
				value: "sm"
			},
			{
				label: "MD",
				value: "default"
			},
			{
				label: "LG",
				value: "lg"
			},
			{
				label: "XL",
				value: "xl"
			}
		]
	};
};
const getFontWeightField = (props) => {
	return {
		...props,
		type: "buttonGroup",
		options: [
			{
				label: "Normal",
				value: "normal"
			},
			{
				label: "Medium",
				value: "medium"
			},
			{
				label: "Semibold",
				value: "semibold"
			},
			{
				label: "Bold",
				value: "bold"
			}
		]
	};
};
const getFontSizeField = (props) => {
	return {
		...props,
		type: "textSizeSelect"
	};
};
const getGapField = (props) => {
	return {
		...props,
		type: "buttonGroup",
		options: [
			{
				icon: lucide_react.Ban,
				ariaLabel: "No gap",
				value: "none"
			},
			{
				label: "XS",
				value: "xs"
			},
			{
				label: "SM",
				value: "sm"
			},
			{
				label: "MD",
				value: "md"
			},
			{
				label: "LG",
				value: "lg"
			},
			{
				label: "XL",
				value: "xl"
			}
		]
	};
};
const getHeightField = (props) => {
	return {
		...props,
		type: "cssUnit",
		allowedUnits: [
			"px",
			"vh",
			"rem"
		],
		minByUnit: {
			px: 10,
			vh: 1,
			rem: 1
		},
		maxByUnit: {
			px: 1200,
			vh: 100,
			rem: 75
		},
		stepByUnit: {
			px: 10,
			vh: 1,
			rem: 1
		}
	};
};
const getBorderRadiusCompositeField = (props) => {
	return {
		advanced: true,
		...props,
		type: "borderRadius",
		keys: props.keys ?? {
			topLeft: "borderRadiusTL",
			topRight: "borderRadiusTR",
			bottomLeft: "borderRadiusBL",
			bottomRight: "borderRadiusBR"
		}
	};
};
/**
* Gap value mapping - use `as const satisfies` for compile-time validation
* with literal type preservation.
*/
const gapValues = {
	none: 0,
	xs: 1,
	sm: 2,
	md: 4,
	lg: 6,
	xl: 8
};
const getBorderWidthField = (props) => ({
	advanced: true,
	...props,
	type: "buttonGroup",
	options: [
		{
			icon: lucide_react.Ban,
			ariaLabel: "No border",
			value: "none"
		},
		{
			label: "THIN",
			value: "thin"
		},
		{
			label: "MD",
			value: "medium"
		},
		{
			label: "THICK",
			value: "thick"
		}
	]
});
const getBorderColorField = getColorField;
/**
* Border width class mapping - full literal Tailwind classes for scanner.
*/
const borderWidthClasses = {
	none: "border-0",
	thin: "border",
	medium: "border-2",
	thick: "border-4"
};
/**
* Border color class mapping - full literal Tailwind classes for scanner.
*/
const borderColorClasses = {
	background: "border-background",
	foreground: "border-foreground",
	primary: "border-primary",
	secondary: "border-secondary",
	accent: "border-accent",
	border: "border-border",
	muted: "border-muted",
	destructive: "border-destructive",
	transparent: "border-transparent"
};
//#endregion
Object.defineProperty(exports, "PROPERTY_FIELD_TYPES", {
	enumerable: true,
	get: function() {
		return PROPERTY_FIELD_TYPES;
	}
});
Object.defineProperty(exports, "applyPropertyValues", {
	enumerable: true,
	get: function() {
		return applyPropertyValues;
	}
});
Object.defineProperty(exports, "borderColorClasses", {
	enumerable: true,
	get: function() {
		return borderColorClasses;
	}
});
Object.defineProperty(exports, "borderWidthClasses", {
	enumerable: true,
	get: function() {
		return borderWidthClasses;
	}
});
Object.defineProperty(exports, "extractPropertyValues", {
	enumerable: true,
	get: function() {
		return extractPropertyValues;
	}
});
Object.defineProperty(exports, "gapValues", {
	enumerable: true,
	get: function() {
		return gapValues;
	}
});
Object.defineProperty(exports, "getBorderColorField", {
	enumerable: true,
	get: function() {
		return getBorderColorField;
	}
});
Object.defineProperty(exports, "getBorderRadiusCompositeField", {
	enumerable: true,
	get: function() {
		return getBorderRadiusCompositeField;
	}
});
Object.defineProperty(exports, "getBorderRadiusField", {
	enumerable: true,
	get: function() {
		return getBorderRadiusField;
	}
});
Object.defineProperty(exports, "getBorderWidthField", {
	enumerable: true,
	get: function() {
		return getBorderWidthField;
	}
});
Object.defineProperty(exports, "getButtonSizeField", {
	enumerable: true,
	get: function() {
		return getButtonSizeField;
	}
});
Object.defineProperty(exports, "getColorField", {
	enumerable: true,
	get: function() {
		return getColorField;
	}
});
Object.defineProperty(exports, "getFontSizeField", {
	enumerable: true,
	get: function() {
		return getFontSizeField;
	}
});
Object.defineProperty(exports, "getFontWeightField", {
	enumerable: true,
	get: function() {
		return getFontWeightField;
	}
});
Object.defineProperty(exports, "getGapField", {
	enumerable: true,
	get: function() {
		return getGapField;
	}
});
Object.defineProperty(exports, "getHeightField", {
	enumerable: true,
	get: function() {
		return getHeightField;
	}
});
Object.defineProperty(exports, "getPaddingField", {
	enumerable: true,
	get: function() {
		return getPaddingField;
	}
});
Object.defineProperty(exports, "groupPropertyFields", {
	enumerable: true,
	get: function() {
		return groupPropertyFields;
	}
});
Object.defineProperty(exports, "isPropertyFieldType", {
	enumerable: true,
	get: function() {
		return isPropertyFieldType;
	}
});

//# sourceMappingURL=registries-DgzzKX8_.cjs.map