"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isPerformanceAPIAvailable = isPerformanceAPIAvailable;
Object.defineProperty(exports, "isPerformanceObserverAvailable", {
  enumerable: true,
  get: function get() {
    return _isPerformanceObserverAvailable.isPerformanceObserverAvailable;
  }
});
exports.isPerformanceObserverLongTaskAvailable = isPerformanceObserverLongTaskAvailable;
var _isPerformanceObserverAvailable = require("./isPerformanceObserverAvailable");
var hasRequiredPerformanceAPIs;
function isPerformanceAPIAvailable() {
  if (hasRequiredPerformanceAPIs === undefined) {
    hasRequiredPerformanceAPIs = typeof window !== 'undefined' && 'performance' in window && ['measure', 'clearMeasures', 'clearMarks', 'getEntriesByName', 'getEntriesByType', 'now'
    // Ignored via go/ees005
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    ].every(function (api) {
      return !!performance[api];
    });
  }
  return hasRequiredPerformanceAPIs;
}
function isPerformanceObserverLongTaskAvailable() {
  return (0, _isPerformanceObserverAvailable.isPerformanceObserverAvailable)() && PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.includes('longtask');
}
// eslint-disable-next-line @atlaskit/editor/no-re-export