"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.dragHandleUniDriverFactory = void 0;
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _unidriver = require("../utils/test-utils/unidriver");
var _TooltipUni = require("../Tooltip/Tooltip.uni.driver");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var dragHandleUniDriverFactory = (base, body) => {
  var getButton = () => base.$('[data-hook="drag-handle-button"]');
  var getTooltipDriver = () => (0, _TooltipUni.tooltipDriverFactory)(base, body);
  return _objectSpread(_objectSpread({}, (0, _unidriver.baseUniDriverFactory)(base)), {}, {
    getButton,
    click: () => getButton().click(),
    hover: () => getButton().hover(),
    getTooltipDriver,
    isTooltipEnabled: () => getTooltipDriver().tooltipExists(),
    getTooltipContent: () => getTooltipDriver().getTooltipText(),
    getDisabled: function () {
      var _getDisabled = (0, _asyncToGenerator2.default)(function* () {
        var value = yield getButton().attr('data-disabled');
        return value === 'true';
      });
      function getDisabled() {
        return _getDisabled.apply(this, arguments);
      }
      return getDisabled;
    }()
  });
};
exports.dragHandleUniDriverFactory = dragHandleUniDriverFactory;
//# sourceMappingURL=DragHandle.uni.driver.js.map