/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
//#region ../css/dist/runtimeConfig/hookMetadata.mjs
/*! © 2026 Yahoo, Inc. UDS CSS v0.0.0-development */
const defineRuntimeHookMetadata = (metadata) => metadata;
const runtimeHookMetadata = defineRuntimeHookMetadata({
	useBottomSheetConfig: {
		defaultProps: {},
		selectorParamValues: { variant: ["default"] },
		tokenConfigPath: ["bottomSheet", "variables"],
		fields: { backgroundColor: {
			bindingSelector: "bottomSheet.backgroundColor",
			selectorTemplates: ["bottomSheet.backgroundColor.${variant}"],
			tokenSource: {
				variableTemplate: "variant/${variant}/root",
				valuePath: [
					"backgroundColor",
					"rest",
					"value"
				]
			}
		} }
	},
	useToastConfig: {
		defaultProps: {
			size: "toast.defaultSize",
			variant: "toast.defaultVariant"
		},
		defaultPropSources: {
			size: [
				"toast",
				"defaults",
				"size"
			],
			variant: [
				"toast",
				"defaults",
				"variant"
			]
		},
		selectorParamValues: {
			size: ["default"],
			variant: [
				"success",
				"error",
				"info",
				"warning",
				"loading"
			]
		},
		tokenConfigPath: ["toast", "variables"],
		fields: {
			autoClose: {
				bindingSelector: "toast.autoClose",
				selectorTemplates: ["toast.autoClose"],
				staticValue: 6e3
			},
			position: {
				bindingSelector: "toast.position",
				selectorTemplates: ["toast.position"],
				staticValue: "bottom-center"
			},
			size: {
				bindingSelector: "toast.defaultSize",
				selectorTemplates: ["toast.defaultSize"]
			},
			variant: {
				bindingSelector: "toast.defaultVariant",
				selectorTemplates: ["toast.defaultVariant"]
			},
			textVariant: {
				bindingSelector: "toast.textVariant.${size}",
				selectorTemplates: ["toast.textVariant.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/label",
					valuePath: [
						"textVariant",
						"rest",
						"value"
					]
				}
			},
			textColor: {
				bindingSelector: "toast.textColor.${variant}",
				selectorTemplates: ["toast.textColor.${variant}"],
				tokenSource: {
					variableTemplate: "variant/${variant}/root",
					valuePath: [
						"color",
						"rest",
						"value"
					]
				}
			},
			iconSize: {
				bindingSelector: "toast.iconSize.${size}",
				selectorTemplates: ["toast.iconSize.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/icon",
					valuePath: [
						"size",
						"rest",
						"value"
					]
				}
			},
			buttonSize: {
				bindingSelector: "toast.buttonSize.${size}",
				selectorTemplates: ["toast.buttonSize.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/actionButton",
					valuePath: [
						"buttonSize",
						"rest",
						"value"
					]
				}
			},
			buttonVariant: {
				bindingSelector: "toast.buttonVariant.${variant}",
				selectorTemplates: ["toast.buttonVariant.${variant}"],
				tokenSource: {
					variableTemplate: "variant/${variant}/actionButton",
					valuePath: [
						"buttonVariant",
						"rest",
						"value"
					]
				}
			},
			iconVariant: {
				bindingSelector: "toast.iconVariant.${variant}",
				selectorTemplates: ["toast.iconVariant.${variant}"],
				tokenSource: {
					variableTemplate: "variant/${variant}/icon",
					valuePath: [
						"iconVariant",
						"rest",
						"value"
					]
				}
			},
			backgroundColor: {
				bindingSelector: "toast.backgroundColor",
				selectorTemplates: ["toast.backgroundColor.${variant}"],
				tokenSource: {
					variableTemplate: "variant/${variant}/root",
					valuePath: [
						"backgroundColor",
						"rest",
						"value"
					]
				}
			}
		}
	},
	useTooltipConfig: {
		defaultProps: {},
		selectorParamValues: { size: ["default"] },
		tokenConfigPath: ["tooltip", "variables"],
		fields: {
			animationDuration: {
				bindingSelector: "tooltip.animationDuration",
				selectorTemplates: ["tooltip.animationDuration"],
				staticValue: 200
			},
			placement: {
				bindingSelector: "tooltip.placement",
				selectorTemplates: ["tooltip.placement"],
				staticValue: "top"
			},
			borderRadius: {
				bindingSelector: "tooltip.borderRadius",
				selectorTemplates: ["tooltip.borderRadius.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/svg",
					valuePath: [
						"borderRadius",
						"rest",
						"value"
					],
					transformConfigPath: [
						"scaleMode",
						"medium",
						"borderRadius"
					]
				}
			}
		}
	},
	usePopoverConfig: {
		defaultProps: {
			size: "popover.defaultSize",
			variant: "popover.defaultVariant"
		},
		defaultPropValues: {
			size: "default",
			variant: "default"
		},
		selectorParamValues: { size: ["default"] },
		tokenConfigPath: ["popover", "variables"],
		fields: {
			animationDuration: {
				bindingSelector: "popover.animationDuration",
				selectorTemplates: ["popover.animationDuration"],
				staticValue: 200
			},
			placement: {
				bindingSelector: "popover.placement",
				selectorTemplates: ["popover.placement"],
				staticValue: "top"
			},
			size: {
				bindingSelector: "popover.defaultSize",
				selectorTemplates: ["popover.defaultSize"]
			},
			variant: {
				bindingSelector: "popover.defaultVariant",
				selectorTemplates: ["popover.defaultVariant"]
			},
			borderRadius: {
				bindingSelector: "popover.borderRadius.${size}",
				selectorTemplates: ["popover.borderRadius.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/svgBase",
					valuePath: [
						"borderRadius",
						"rest",
						"value"
					],
					transformConfigPath: [
						"scaleMode",
						"medium",
						"borderRadius"
					]
				}
			},
			gap: {
				bindingSelector: "popover.gap.${size}",
				selectorTemplates: ["popover.gap.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/contentWrapper",
					valuePath: [
						"gap",
						"rest",
						"value"
					]
				}
			},
			spacingHorizontal: {
				bindingSelector: "popover.spacingHorizontal.${size}",
				selectorTemplates: ["popover.spacingHorizontal.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/contentWrapper",
					valuePath: [
						"spacingHorizontal",
						"rest",
						"value"
					]
				}
			},
			spacingVertical: {
				bindingSelector: "popover.spacingVertical.${size}",
				selectorTemplates: ["popover.spacingVertical.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/contentWrapper",
					valuePath: [
						"spacingVertical",
						"rest",
						"value"
					]
				}
			},
			dismissButtonSpacing: {
				bindingSelector: "popover.dismissButtonSpacing.${size}",
				selectorTemplates: ["popover.dismissButtonSpacing.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/closeIconContainer",
					valuePath: [
						"spacing",
						"rest",
						"value"
					]
				}
			},
			dismissIconSize: {
				bindingSelector: "popover.dismissIconSize.${size}",
				selectorTemplates: ["popover.dismissIconSize.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/closeIcon",
					valuePath: [
						"size",
						"rest",
						"value"
					],
					transformConfigPath: [
						"scaleMode",
						"medium",
						"iconSizes"
					]
				}
			}
		}
	},
	useModalConfig: {
		defaultProps: {
			size: "modal.defaultSize",
			variant: "modal.defaultVariant"
		},
		defaultPropValues: {
			size: "default",
			variant: "default"
		},
		selectorParamValues: { size: ["default"] },
		tokenConfigPath: ["modal", "variables"],
		fields: {
			size: {
				bindingSelector: "modal.defaultSize",
				selectorTemplates: ["modal.defaultSize"]
			},
			variant: {
				bindingSelector: "modal.defaultVariant",
				selectorTemplates: ["modal.defaultVariant"]
			},
			gutter: {
				bindingSelector: "modal.gutter.${size}",
				selectorTemplates: ["modal.gutter.${size}"],
				tokenSource: {
					variableTemplate: "size/${size}/scrim",
					valuePath: [
						"spacing",
						"rest",
						"value"
					]
				}
			}
		}
	}
});
const getNestedValue = (value, path) => {
	return path.reduce((currentValue, segment) => {
		if (typeof currentValue !== "object" || currentValue === null) return;
		return currentValue[segment];
	}, value);
};
const isRuntimeConfigValue = (value) => {
	return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
};
const getRuntimeHookConfig = (hookName) => {
	return runtimeHookMetadata[hookName] ?? null;
};
const getRuntimeSelectorParamValues = (hookName, paramName) => {
	return [...runtimeHookMetadata[hookName].selectorParamValues?.[paramName] ?? []];
};
const expandRuntimeSelectorTemplate = (template, params = {}) => {
	return template.replace(/\$\{(\w+)\}/g, (match, paramName) => params[paramName] ?? match);
};
const getRuntimeDefaultPropSelector = (hookName, propName, params = {}) => {
	const selector = getRuntimeHookConfig(hookName)?.defaultProps[propName];
	return selector ? expandRuntimeSelectorTemplate(selector, params) : null;
};
const getRuntimeDefaultPropValue = (config, hookName, propName) => {
	const hookConfig = getRuntimeHookConfig(hookName);
	const configuredValue = getNestedValue(config, hookConfig?.defaultPropSources?.[propName] ?? []);
	if (isRuntimeConfigValue(configuredValue)) return configuredValue;
	const staticValue = hookConfig?.defaultPropValues?.[propName];
	return staticValue === void 0 ? void 0 : staticValue;
};
const getRuntimeFieldSelector = (hookName, fieldName, params = {}) => {
	const selectorTemplate = getRuntimeHookConfig(hookName)?.fields[fieldName]?.selectorTemplates[0];
	return selectorTemplate ? expandRuntimeSelectorTemplate(selectorTemplate, params) : null;
};
const getRuntimeFieldStaticValue = (hookName, fieldName) => {
	return getRuntimeHookConfig(hookName)?.fields[fieldName]?.staticValue ?? null;
};
const getRuntimeFieldTokenValue = (config, hookName, fieldName, params = {}) => {
	const hookConfig = getRuntimeHookConfig(hookName);
	const tokenConfigPath = hookConfig?.tokenConfigPath;
	const tokenSource = hookConfig?.fields[fieldName]?.tokenSource;
	if (!tokenConfigPath || !tokenSource) return;
	const variableTemplate = expandRuntimeSelectorTemplate(tokenSource.variableTemplate, params);
	const rawValue = getNestedValue(getNestedValue(config, [...tokenConfigPath, variableTemplate]), tokenSource.valuePath);
	if (rawValue === void 0) return;
	if (!tokenSource.transformConfigPath) return isRuntimeConfigValue(rawValue) ? rawValue : void 0;
	const transformedValue = getNestedValue(tokenSource.transformConfigPath.reduce((currentValue, segment) => {
		if (typeof currentValue !== "object" || currentValue === null) return;
		return currentValue[segment];
	}, config), [String(rawValue)]);
	return isRuntimeConfigValue(transformedValue) ? transformedValue : void 0;
};
//#endregion
export { getRuntimeDefaultPropSelector, getRuntimeDefaultPropValue, getRuntimeFieldSelector, getRuntimeFieldStaticValue, getRuntimeFieldTokenValue, getRuntimeSelectorParamValues };
