'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var canUseDOM = require('../../../utils/canUseDOM.js');

var clearSelection = function clearSelection() {
  if (!canUseDOM.canUseDOM) {
    return;
  }
  var doc = document;
  if (window.getSelection) {
    var _window$getSelection;
    (_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();
  } else if (doc.selection) {
    doc.selection.empty();
  }
};

exports.clearSelection = clearSelection;
