/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

'use strict';

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

const ANCHOR_SHARP_REGEXP = /#(\S+)$/;
function getOffsetTop(target, container) {
  const {
    top
  } = target.getBoundingClientRect();
  if (container === window) {
    return top - document.documentElement.clientTop;
  }
  return top - container.getBoundingClientRect().top;
}

exports.ANCHOR_SHARP_REGEXP = ANCHOR_SHARP_REGEXP;
exports.getOffsetTop = getOffsetTop;
//# sourceMappingURL=utils.js.map
