import { R as ReferenceField } from './reference-field-a5b414d1.js';
import { B as BaseField } from './BaseField-0b01dc2c.js';
import './index-61dcd269.js';
import { M as MultipleChoiceField } from './index-4e451db4.js';
import { S as SectionHeaderField, R as RangeField, N as NumberField } from './index-32d8b974.js';
import { S as SingleChoiceField } from './index-23baeeef.js';
import { S as SubFormField } from './index-09efdc01.js';
import { T as TextField } from './index-150b6a59.js';
import { D as DateField } from './date-1bc489bd.js';

function generateFieldModelFromRawData(fieldData) {
  if (!fieldData) {
    return undefined;
  }
  switch (fieldData.type) {
    case DateField.type:
      return Object.assign(Object.create(DateField.prototype), fieldData);
    case MultipleChoiceField.type:
      return Object.assign(Object.create(MultipleChoiceField.prototype), fieldData);
    case NumberField.type:
      return Object.assign(Object.create(NumberField.prototype), fieldData);
    case RangeField.type:
      return Object.assign(Object.create(RangeField.prototype), fieldData);
    case SectionHeaderField.type:
      return Object.assign(Object.create(SectionHeaderField.prototype), fieldData);
    case SingleChoiceField.type:
      return Object.assign(Object.create(SingleChoiceField.prototype), fieldData);
    case SubFormField.type:
      return Object.assign(Object.create(SubFormField.prototype), fieldData);
    case TextField.type:
      return Object.assign(Object.create(TextField.prototype), fieldData);
    case ReferenceField.type:
      return Object.assign(Object.create(ReferenceField.prototype), fieldData);
    default:
      return Object.assign(Object.create(BaseField.prototype), fieldData);
  }
}

export { generateFieldModelFromRawData as g };
