"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useFire3PWorkflowsClickEvent = useFire3PWorkflowsClickEvent;
exports.useSmartLinkEvents = useSmartLinkEvents;
var _react = require("react");
var _analyticsNext = require("@atlaskit/analytics-next");
var _analytics = require("../../utils/analytics/analytics");
function useSmartLinkEvents() {
  /**
   * this utility maybe extended in the future to include
   * more contextual info about SLs
   */
  var events = (0, _react.useMemo)(function () {
    return new _analytics.SmartLinkEvents();
  }, []);
  return events;
}
function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) {
  var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
    createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
  return function () {
    var smartlinkClickAnalyticsEvent = createAnalyticsEvent({
      action: 'clicked',
      actionSubject: 'smartLink',
      actionSubjectId: 'smartlinkClickAnalyticsWorkflows',
      eventType: 'ui',
      attributes: {
        eventName: 'smartLinkClickAnalyticsThirdPartyWorkflows',
        firstPartyIdentifier: firstPartyIdentifier
      },
      nonPrivacySafeAttributes: {
        thirdPartyARI: thirdPartyARI
      }
    });
    smartlinkClickAnalyticsEvent.fire('media');
  };
}