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4B,CAuP1B,OAAO,QAAQ,WACjB,SAAS,UAAY,UACrB,SAAS,aAAe,aACxB,SAAS,sBAAwB,uBACjC,SAAS,oBAAsB,qBAC/B,SAAS,oBAAsB,qBAC/B,SAAS,MAAQ,eAAe,QAChC,SAAS,QAAU,iBAAiB,QACpC,IAAI,SAAW,QAAQ,QAAU","file":"/npm/terra-hookshot@5.44.0/lib/Hookshot.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/terra-hookshot@5.44.0/lib/Hookshot.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));\nvar _react = _interopRequireDefault(require(\"react\"));\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\nvar _reactPortal = require(\"react-portal\");\nvar _HookshotContent = _interopRequireDefault(require(\"./HookshotContent\"));\nvar _HookshotUtils = _interopRequireDefault(require(\"./_HookshotUtils\"));\nfunction _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nvar VERTICAL_ATTACHMENTS = ['top', 'middle', 'bottom'];\nvar HORIZONTAL_ATTACHMENTS = ['start', 'center', 'end'];\nvar ATTACHMENT_BEHAVIORS = ['auto', 'flip', 'push', 'none'];\nvar propTypes = {\n  /**\n   * How the content should be positioned when the primary attachment is not available.\n   * Valid values:\n   *  'auto': returns 180 degrees, returns rotate 90 degree, returns rotate -90 degrees, returns primary attachment\n   *  'flip': returns 180 degrees, returns primary attachment\n   *  'push': pushes content to remain within the bounding rect, returns primary attachment\n   *  'none': returns primary attachment\n   */\n  attachmentBehavior: _propTypes.default.oneOf(ATTACHMENT_BEHAVIORS),\n  /**\n   * Value in px of the margin to place between the target and the content.\n   */\n  attachmentMargin: _propTypes.default.number,\n  /**\n   * Reference to the bounding container. Defaults to window unless attachment behavior is set to none.\n   */\n  boundingRef: _propTypes.default.func,\n  /**\n   * The HookshotContent to be attached.\n   */\n  children: _propTypes.default.element.isRequired,\n  /**\n   * Object containing the vertical and horizontal attachment values for the content.\n   * Valid values: { horizontal: ['start', 'center', 'end'], vertical: ['top', 'middle', 'bottom'] }.\n   */\n  contentAttachment: _propTypes.default.shape({\n    horizontal: _propTypes.default.oneOf(HORIZONTAL_ATTACHMENTS),\n    vertical: _propTypes.default.oneOf(VERTICAL_ATTACHMENTS)\n  }).isRequired,\n  /**\n   * Object containing the vertical and horizontal offset values in px for the content.\n   */\n  contentOffset: _propTypes.default.shape({\n    horizontal: _propTypes.default.number,\n    vertical: _propTypes.default.number\n  }),\n  /**\n   * Determines whether the content should be actively positioned via hookshot.\n   */\n  isEnabled: _propTypes.default.bool,\n  /**\n   * Should the content be presented.\n   */\n  isOpen: _propTypes.default.bool,\n  /**\n   * Callback function when the content has been positioned.\n   */\n  onPosition: _propTypes.default.func,\n  /**\n   * Client coordinates to serve as the anchor point for the hookshot'd content.\n   */\n  targetCoordinates: _propTypes.default.shape({\n    x: _propTypes.default.number.isRequired,\n    y: _propTypes.default.number.isRequired\n  }),\n  /**\n   * Element to serve as the anchor point for the hookshot'd content. (If targetCoordinates are provided, this is ignored.)\n   */\n  targetRef: _propTypes.default.func,\n  /**\n   * Object containing the vertical and horizontal attachment values for the target.\n   * Valid values: { horizontal: ['start', 'center', 'end'], vertical: ['top', 'middle', 'bottom'] }.\n   * If targetCoordinates are provided { horizontal: 'center', vertical: 'middle' } will be applied.\n   */\n  targetAttachment: _propTypes.default.shape({\n    horizontal: _propTypes.default.oneOf(HORIZONTAL_ATTACHMENTS),\n    vertical: _propTypes.default.oneOf(VERTICAL_ATTACHMENTS)\n  }),\n  /**\n   * Object containing the vertical and horizontal offset values in px for the target.\n   */\n  targetOffset: _propTypes.default.shape({\n    horizontal: _propTypes.default.number,\n    vertical: _propTypes.default.number\n  })\n};\nvar defaultProps = {\n  attachmentMargin: 0,\n  attachmentBehavior: 'auto',\n  contentOffset: {\n    horizontal: 0,\n    vertical: 0\n  },\n  isEnabled: false,\n  isOpen: false,\n  targetOffset: {\n    horizontal: 0,\n    vertical: 0\n  }\n};\nvar Hookshot = /*#__PURE__*/function (_React$Component) {\n  function Hookshot(props) {\n    var _this;\n    (0, _classCallCheck2.default)(this, Hookshot);\n    _this = _callSuper(this, Hookshot, [props]);\n    _this.setContentNode = _this.setContentNode.bind(_this);\n    _this.getNodeRects = _this.getNodeRects.bind(_this);\n    _this.update = _this.update.bind(_this);\n    _this.tick = _this.tick.bind(_this);\n    _this.getBoundingRef = _this.getBoundingRef.bind(_this);\n    _this.getTargetRef = _this.getTargetRef.bind(_this);\n    _this.getValidBoundingRect = _this.getValidBoundingRect.bind(_this);\n    _this.getValidTargetRect = _this.getValidTargetRect.bind(_this);\n    _this.listenersAdded = false;\n    _this.lastCall = null;\n    _this.lastDuration = null;\n    _this.pendingTimeout = null;\n    return _this;\n  }\n  (0, _inherits2.default)(Hookshot, _React$Component);\n  return (0, _createClass2.default)(Hookshot, [{\n    key: \"componentDidMount\",\n    value: function componentDidMount() {\n      if (this.props.isEnabled && this.props.isOpen) {\n        if (!this.listenersAdded) {\n          this.enableListeners();\n        }\n        this.update();\n      }\n    }\n  }, {\n    key: \"componentDidUpdate\",\n    value: function componentDidUpdate() {\n      if (this.props.isEnabled && this.props.isOpen) {\n        if (!this.listenersAdded) {\n          this.enableListeners();\n        }\n        this.update();\n      } else {\n        this.disableListeners();\n      }\n    }\n  }, {\n    key: \"componentWillUnmount\",\n    value: function componentWillUnmount() {\n      this.disableListeners();\n    }\n  }, {\n    key: \"setContentNode\",\n    value: function setContentNode(node) {\n      this.contentNode = node;\n    }\n  }, {\n    key: \"getBoundingRef\",\n    value: function getBoundingRef() {\n      return this.props.boundingRef ? this.props.boundingRef() : undefined;\n    }\n  }, {\n    key: \"getTargetRef\",\n    value: function getTargetRef() {\n      return this.props.targetRef ? this.props.targetRef() : undefined;\n    }\n  }, {\n    key: \"getValidBoundingRect\",\n    value: function getValidBoundingRect() {\n      if (this.props.attachmentBehavior === 'none') {\n        return undefined;\n      }\n      return _HookshotUtils.default.getBoundingRect(this.getBoundingRef() || 'window');\n    }\n  }, {\n    key: \"getValidTargetRect\",\n    value: function getValidTargetRect() {\n      if (this.props.targetCoordinates) {\n        return _HookshotUtils.default.getRectFromCoords(this.props.targetCoordinates);\n      }\n      return _HookshotUtils.default.getBounds(this.getTargetRef());\n    }\n  }, {\n    key: \"getNodeRects\",\n    value: function getNodeRects(resetContentCache) {\n      return {\n        contentRect: resetContentCache ? _HookshotUtils.default.getBounds(this.contentNode) : this.cachedRects.contentRect,\n        targetRect: this.getValidTargetRect(),\n        boundingRect: this.getValidBoundingRect()\n      };\n    }\n  }, {\n    key: \"tick\",\n    value: function tick(event) {\n      if (this.lastDuration && this.lastDuration > 16) {\n        // Throttle to 60fps, in order to handle safari and mobile performance\n        this.lastDuration = Math.min(this.lastDuration - 16, 100);\n\n        // Just in case this is the last event, remember to position just once more\n        this.pendingTimeout = setTimeout(this.tick, 100);\n        return;\n      }\n      if (this.lastCall && performance.now() - this.lastCall < 10) {\n        // Some browsers call events a little too frequently, refuse to run more than is reasonable\n        return;\n      }\n      if (this.pendingTimeout != null) {\n        clearTimeout(this.pendingTimeout);\n        this.pendingTimeout = null;\n      }\n      this.lastCall = performance.now();\n      this.update(event);\n      this.lastDuration = performance.now() - this.lastCall;\n    }\n  }, {\n    key: \"enableListeners\",\n    value: function enableListeners() {\n      var _this2 = this;\n      var childElement = this.getTargetRef() || this.getBoundingRef();\n      if (!childElement) {\n        return;\n      }\n      ['resize', 'scroll', 'touchmove'].forEach(function (event) {\n        return window.addEventListener(event, _this2.tick);\n      });\n      this.parentListeners = [];\n      var scrollParents = _HookshotUtils.default.getScrollParents(childElement);\n      scrollParents.forEach(function (parent) {\n        if (parent !== childElement.ownerDocument) {\n          parent.addEventListener('scroll', _this2.tick);\n          _this2.parentListeners.push(parent);\n        }\n      });\n      this.listenersAdded = true;\n    }\n  }, {\n    key: \"disableListeners\",\n    value: function disableListeners() {\n      var _this3 = this;\n      ['resize', 'scroll', 'touchmove'].forEach(function (event) {\n        return window.removeEventListener(event, _this3.tick);\n      });\n      if (this.parentListeners) {\n        this.parentListeners.forEach(function (parent) {\n          parent.removeEventListener('scroll', _this3.tick);\n        });\n        this.parentListeners = null;\n      }\n      this.listenersAdded = false;\n    }\n  }, {\n    key: \"position\",\n    value: function position(event, resetContentCache) {\n      this.cachedRects = this.getNodeRects(resetContentCache);\n      this.content.rect = this.cachedRects.contentRect;\n      this.target.rect = this.cachedRects.targetRect;\n      var result = _HookshotUtils.default.positionStyleFromBounds(this.cachedRects.boundingRect, this.content, this.target, this.props.attachmentMargin, this.props.attachmentBehavior);\n      var styleUpdated = false;\n      var newTransform = \"translate3d(\".concat(result.style.left, \", \").concat(result.style.top, \", 0px)\");\n      if (this.contentNode.style.transform !== newTransform) {\n        this.contentNode.style.transform = newTransform;\n        styleUpdated = true;\n      }\n      if (this.contentNode.style.opacity !== '1') {\n        this.contentNode.style.opacity = '1';\n        styleUpdated = true;\n      }\n      if (styleUpdated) {\n        this.cachedRects.contentRect = _HookshotUtils.default.getBounds(this.contentNode);\n        result.positions.content.rect = this.cachedRects.contentRect;\n      }\n      if (this.props.onPosition) {\n        this.props.onPosition(event, result.positions);\n      }\n    }\n  }, {\n    key: \"update\",\n    value: function update(event) {\n      if (!this.getTargetRef() && !this.props.targetCoordinates || !this.contentNode) {\n        return;\n      }\n      this.updateHookshot(event);\n    }\n  }, {\n    key: \"updateHookshot\",\n    value: function updateHookshot(event) {\n      var resetCache = !event || event.type !== 'scroll' && event.type !== 'touchmove';\n      this.position(event, resetCache);\n    }\n  }, {\n    key: \"cloneContent\",\n    value: function cloneContent(content) {\n      return /*#__PURE__*/_react.default.cloneElement(content, {\n        refCallback: this.wrappedRefCallback(content),\n        disableOnClickOutside: !content.props.onOutsideClick\n      });\n    }\n  }, {\n    key: \"wrappedRefCallback\",\n    value: function wrappedRefCallback(content) {\n      var _this4 = this;\n      var initialRefCallback = content.props.refCallback;\n      return function (node) {\n        _this4.setContentNode(node);\n        if (initialRefCallback) {\n          initialRefCallback(node);\n        }\n      };\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      /* eslint-disable no-unused-vars */\n      var _this$props = this.props,\n        attachmentBehavior = _this$props.attachmentBehavior,\n        attachmentMargin = _this$props.attachmentMargin,\n        boundingRef = _this$props.boundingRef,\n        children = _this$props.children,\n        contentAttachment = _this$props.contentAttachment,\n        contentOffset = _this$props.contentOffset,\n        isEnabled = _this$props.isEnabled,\n        isOpen = _this$props.isOpen,\n        targetCoordinates = _this$props.targetCoordinates,\n        targetRef = _this$props.targetRef,\n        targetAttachment = _this$props.targetAttachment,\n        targetOffset = _this$props.targetOffset,\n        onPosition = _this$props.onPosition;\n      /* eslint-enable no-unused-vars */\n      if (!isOpen) {\n        return null;\n      }\n      var isRTL = document.getElementsByTagName('html')[0].getAttribute('dir') === 'rtl';\n      this.content = {\n        offset: _HookshotUtils.default.getDirectionalOffset(contentOffset, isRTL),\n        attachment: _HookshotUtils.default.getDirectionalAttachment(contentAttachment, isRTL)\n      };\n      this.target = {\n        offset: _HookshotUtils.default.getDirectionalOffset(targetOffset, isRTL)\n      };\n      if (targetCoordinates) {\n        this.target.attachment = _HookshotUtils.default.coordinateAttachment;\n      } else if (targetAttachment) {\n        this.target.attachment = _HookshotUtils.default.getDirectionalAttachment(targetAttachment, isRTL);\n      } else {\n        this.target.attachment = _HookshotUtils.default.mirrorAttachment(this.content.attachment);\n      }\n      return /*#__PURE__*/_react.default.createElement(_reactPortal.Portal, {\n        isOpened: isOpen\n      }, this.cloneContent(children));\n    }\n  }]);\n}(_react.default.Component);\nHookshot.propTypes = propTypes;\nHookshot.defaultProps = defaultProps;\nHookshot.horizontalAttachments = HORIZONTAL_ATTACHMENTS;\nHookshot.verticalAttachments = VERTICAL_ATTACHMENTS;\nHookshot.attachmentBehaviors = ATTACHMENT_BEHAVIORS;\nHookshot.Utils = _HookshotUtils.default;\nHookshot.Content = _HookshotContent.default;\nvar _default = exports.default = Hookshot;"]}