'use strict';

const referenceField = require('./reference-field-1239b0c3.js');
const BaseField = require('./BaseField-381327a9.js');
require('./index-2eea69a0.js');
const index$4 = require('./index-0783d14f.js');
const index$3 = require('./index-e8e4d80b.js');
const index$2 = require('./index-9d3d3d15.js');
const index$1 = require('./index-9fd84b93.js');
const index = require('./index-61f9621a.js');
const date = require('./date-a24d7714.js');

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

exports.generateFieldModelFromRawData = generateFieldModelFromRawData;
