/* Minification failed. Returning unminified contents.
(2,7-15): run-time error JS1004: Expected ';': function
(6,11-19): run-time error JS1004: Expected ';': function
(33,56-66): run-time error JS1004: Expected ';': tryRequest
 */
// Determines if the user is likely using an ad block extension
async function checkAdBlocker() {
    // Used to cache the result
    let isBlocked;

    async function tryRequest() {
        try {
            return fetch(
                //new Request("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js", {
                new Request("https://yandex.ru/ads/system/context.js", {
                  method: 'HEAD',
                  mode: 'no-cors'
              }))
              .then(function(response) {
                  // Google Ads request succeeded, so likely no ad blocker
                  isBlocked = false;
                  return isBlocked;
              }).catch(function(e) {
                  // Request failed, likely due to ad blocker
                  isBlocked = true;
                  return isBlocked;
              });
        } catch (error) {
            // fetch API error; possible fetch not supported (old browser)
            // Marking as a blocker since there was an error and so
            // we can prevent continued requests when this function is run
            console.log(error);
            isBlocked = true;
            return isBlocked;
        }
    }

    return isBlocked !== undefined ? isBlocked : await tryRequest();
};
