import { ACTION_SUBJECT, EVENT_TYPE } from '../../analytics';
import { createDispatch } from '../../event-dispatcher';
import { analyticsEventKey } from '../../utils';
export const sendMBEAnalyticsEvent = (action, node, eventDispatcher, attributes) => {
  const analyticsDispatch = createDispatch(eventDispatcher);
  analyticsDispatch(analyticsEventKey, {
    payload: {
      action,
      actionSubject: ACTION_SUBJECT.MULTI_BODIED_EXTENSION,
      eventType: EVENT_TYPE.TRACK,
      attributes: {
        extensionType: node.attrs.extensionType,
        extensionKey: node.attrs.extensionKey,
        localId: node.attrs.localId,
        currentFramesCount: node.content.childCount,
        ...attributes
      }
    }
  });
};