"use strict";

exports.__esModule = true;
exports["default"] = void 0;

var _services = require("../services");

var PoseEstimationController = /*#__PURE__*/function () {
  function PoseEstimationController(canvasRef, videoRef, onInit, props) {
    // super(props);
    if (!PoseEstimationController._instance) {
      PoseEstimationController._instance = this;
      this.onInit = onInit;
      this.holistic = new _services.MediaPipeHolistic(videoRef, canvasRef, props);
    }

    return PoseEstimationController._instance;
  }

  var _proto = PoseEstimationController.prototype;

  _proto.getValueToReturn = function getValueToReturn(_ref) {
    var key = _ref.key,
        neutralAngle = _ref.neutralAngle,
        minAcceptableAngle = _ref.minAcceptableAngle,
        maxAcceptableAngle = _ref.maxAcceptableAngle,
        acceptableAngle = _ref.acceptableAngle;
    return {
      key: key,
      angle: {
        result: this.holistic.angleValue,
        neutralAngle: neutralAngle,
        minAcceptableAngle: minAcceptableAngle,
        maxAcceptableAngle: maxAcceptableAngle,
        acceptableAngle: acceptableAngle
      }
    };
  };

  PoseEstimationController.getInstance = function getInstance() {
    return this._instance;
  };

  return PoseEstimationController;
}();

var _default = PoseEstimationController;
exports["default"] = _default;
module.exports = exports.default;