import { settings } from '../../settings/settings.mjs';
import '../../utils/settings.mjs';
import { isMobile } from '../../utils/is_mobile/index.mjs';
import '../../constants.mjs';
import '../../color.mjs';
import '../../utils/color/premultiply.mjs';
import '../../utils/media/BoundingBox.mjs';

function maxRecommendedTextures(max) {
  let allowMax = true;
  const navigator = settings.ADAPTER.getNavigator();
  if (isMobile.tablet || isMobile.phone) {
    if (isMobile.apple.device) {
      const match = navigator.userAgent.match(/OS (\d+)_(\d+)?/);
      if (match) {
        const majorVersion = parseInt(match[1], 10);
        if (majorVersion < 11) {
          allowMax = false;
        }
      }
    }
    if (isMobile.android.device) {
      const match = navigator.userAgent.match(/Android\s([0-9.]*)/);
      if (match) {
        const majorVersion = parseInt(match[1], 10);
        if (majorVersion < 7) {
          allowMax = false;
        }
      }
    }
  }
  return allowMax ? max : 4;
}

export { maxRecommendedTextures };
//# sourceMappingURL=maxRecommendedTextures.mjs.map
