"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "selectText", {
    enumerable: true,
    get: function() {
        return selectText;
    }
});
var _utils = require("../../../utils");
var selectText = function selectText(node) {
    if (!_utils.canUseDOM) {
        return;
    }
    setTimeout(function() {
        var body = document.body;
        if (window.getSelection && document.createRange) {
            var range = document.createRange();
            range.selectNodeContents(node);
            var selection = window.getSelection();
            selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
            selection === null || selection === void 0 ? void 0 : selection.addRange(range);
        } else if (body.createTextRange) {
            var range1 = body.createTextRange();
            range1.moveToElementText(node);
            range1.select();
        }
    });
};
