class n {
  /**
   * Returns the passed fuzzy date as a data object.
   *
   * @param date
   *
   * @returns {{end_date, _destroy, accuracy, description, range, id, start_date}}
   */
  toData(r) {
    return {
      id: r.id,
      accuracy: r.accuracy,
      description: r.description,
      end_date: r.endDate,
      range: r.range,
      start_date: r.startDate,
      _destroy: r._destroy
    };
  }
  /**
   * Returns the passed date as a FuzzyDate input date.
   *
   * @param date
   *
   * @returns {{endDate: *, _destroy, accuracy, description, range, id, startDate: *}|null}
   */
  toFuzzyDate(r) {
    return r ? {
      id: r.id,
      accuracy: r.accuracy,
      description: r.description,
      endDate: r.end_date,
      range: r.range,
      startDate: r.start_date,
      _destroy: r._destroy
    } : null;
  }
  /**
   * Returns the passed FuzzyDateable object for PUT/POST requests.
   *
   * @param dateable
   * @param attribute
   *
   * @returns {{}}
   */
  toPayload(r, t) {
    const a = r[t];
    return a ? {
      [t]: this.toData(a)
    } : null;
  }
}
const c = new n();
export {
  c as default
};
//# sourceMappingURL=index.es19.js.map
