"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.getSuffix = exports.getPrefix = exports.default = 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 _constants = require("./constants");
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 _getPrefix = base => base.$("[data-hook=\"".concat(_constants.dataHooks.prefix, "\"]"));
exports.getPrefix = _getPrefix;
var _getSuffix = base => base.$("[data-hook=\"".concat(_constants.dataHooks.suffix, "\"]"));
exports.getSuffix = _getSuffix;
var _default = base => {
  return _objectSpread(_objectSpread({}, (0, _unidriver.baseUniDriverFactory)(base)), {}, {
    getText: () => base.text(),
    /** Returns the text of the title */
    getTitleText: function () {
      var _getTitleText = (0, _asyncToGenerator2.default)(function* () {
        return base.$("[data-hook=\"".concat(_constants.dataHooks.title, "\"]")).text();
      });
      function getTitleText() {
        return _getTitleText.apply(this, arguments);
      }
      return getTitleText;
    }(),
    getPrefix: () => _getPrefix(base),
    getSuffix: () => _getSuffix(base),
    hover: () => base.hover(),
    isSelected: function () {
      var _isSelected = (0, _asyncToGenerator2.default)(function* () {
        return (yield base.attr('data-selected')) === 'true';
      });
      function isSelected() {
        return _isSelected.apply(this, arguments);
      }
      return isSelected;
    }(),
    isDisabled: function () {
      var _isDisabled = (0, _asyncToGenerator2.default)(function* () {
        return (yield base.attr('disabled')) !== null;
      });
      function isDisabled() {
        return _isDisabled.apply(this, arguments);
      }
      return isDisabled;
    }()
  });
};
exports.default = _default;
//# sourceMappingURL=SidebarSectionItem.uni.driver.js.map