import { jsx } from "react/jsx-runtime";
import {
  GroupDefinition
} from "@makeswift/controls";
import { ControlValue } from "./control";
function GroupControlValue({ definition, data, children, control }) {
  return Object.entries(definition.config.props).reduceRight(
    (renderFn, [key, controlDefinition]) => (shapeControlValue) => /* @__PURE__ */ jsx(
      ControlValue,
      {
        definition: controlDefinition,
        data: data != null ? GroupDefinition.propsData(data)[key] : void 0,
        control: control?.child(key),
        children: (value) => renderFn({ ...shapeControlValue, [key]: value })
      }
    ),
    children
  )({});
}
export {
  GroupControlValue
};
//# sourceMappingURL=group.js.map