// Generated ESM version of ua-parser-js/browser-detection
// DO NOT EDIT THIS FILE!
// Source: /src/browser-detection/browser-detection.js

//////////////////////////////////////////////////////
/*  browser-detection submodule of UAParser.js v2.0.10
    https://github.com/faisalman/ua-parser-js
    Author: Faisal Salman <f@faisalman.com>
    AGPLv3 License */
/////////////////////////////////////////////////////

/*jshint esversion: 6 */ 

import { UAParser } from '../main/ua-parser.mjs';
import { EngineName } from '../enums/ua-parser-enums.mjs';
import { isStandalonePWA } from 'is-standalone-pwa';
import { isFromEU } from 'detect-europe-js';

const isChromeFamily = val => !!(
    (typeof val === 'string' ? 
        new UAParser(val).getEngine() : 
        val.engine
    )?.is(EngineName.BLINK));

const isElectron = () => !!(
    // in node.js environment
    (typeof process !== 'undefined' && process.versions?.hasOwnProperty('electron')) ||
    // in browser environment
    (typeof navigator !== 'undefined' && / electron\//i.test(navigator.userAgent))
);

export { 
    isChromeFamily,
    isElectron,
    isFromEU,
    isStandalonePWA
}