import _extends from "@babel/runtime/helpers/esm/extends";
import React from 'react';
import { toProps } from '../core';
import EventListener from '../event/EventListener';

function toTextProps(_ref) {
  var align = _ref.align,
      alphaTest = _ref.alphaTest,
      anchor = _ref.anchor,
      baseline = _ref.baseline,
      color = _ref.color,
      font = _ref.font,
      fontImage = _ref.fontImage,
      height = _ref.height,
      letterSpacing = _ref.letterSpacing,
      lineHeight = _ref.lineHeight,
      opacity = _ref.opacity,
      shader = _ref.shader,
      side = _ref.side,
      tabSize = _ref.tabSize,
      transparent = _ref.transparent,
      value = _ref.value,
      whiteSpace = _ref.whiteSpace,
      width = _ref.width,
      wrapCount = _ref.wrapCount,
      wrapPixels = _ref.wrapPixels,
      zOffset = _ref.zOffset;
  return {
    align: align,
    'alpha-test': alphaTest,
    anchor: anchor,
    baseline: baseline,
    color: color,
    font: font,
    'font-image': fontImage,
    height: height,
    'letter-spacing': letterSpacing,
    'line-height': lineHeight,
    opacity: opacity,
    shader: shader,
    side: side,
    'tab-size': tabSize,
    transparent: transparent,
    value: value,
    'white-space': whiteSpace,
    width: width,
    'wrap-count': wrapCount,
    'wrap-pixels': wrapPixels,
    'z-offset': zOffset
  };
}
/**
 * Wraps the [text component](https://aframe.io/docs/1.3.0/components/text.html).
 *
 * @see https://aframe.io/docs/1.3.0/primitives/a-text.html\
 *
 * @example
 * ```tsx
 * <Text value="Hello, World!" />
 * ```
 */


export var Text = function Text(props) {
  var textKeys = ['align', 'alphaTest', 'anchor', 'baseline', 'color', 'font', 'fontImage', 'height', 'letterSpacing', 'lineHeight', 'opacity', 'shader', 'side', 'tabSize', 'transparent', 'value', 'whiteSpace', 'width', 'wrapCount', 'wrapPixels', 'zOffset'];
  var children = props.children;
  return /*#__PURE__*/React.createElement(EventListener, _extends({
    primitive: "a-text"
  }, toProps(props, textKeys), toTextProps(props)), children);
};