text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  function urlIsPresent() {
      if (typeof window.URL === 'undefined') {
          return false;
      }
      try {
          var url = new window.URL('http://contoso.com?a=b');
          return url.searchParams.get('a') === 'b';
      }
      catch (e) {
          return false;
      }
  }
  function urlSearchParamsIsPresent() {
      if (typeof window['URLSearchParams'] === 'undefined') {
          return false;
      }
      try {
          new URLSearchParams('?a=b&c=d'); // tslint:disable-line:no-unused-expression
          return true;
      }
      catch (e) {
          return false;
      }
  }
  /**
   * Fills the window.URL class if it doesn't already exist or if its implementation is incorrect
   */
  function fillUrlIfNecessary(URL) {
      // 'window' isn't defined in mocha test
      if (typeof window !== 'undefined' && (!urlIsPresent() || !urlSearchParamsIsPresent())) {
          window.URL = URL();
      }
  }
  exports.fillUrlIfNecessary = fillUrlIfNecessary;
  /**
   * Fills the window.URLSearchParams class if it doesn't already exist or if its implementation is incorrect
   */
  // tslint:disable-next-line:no-any variable-name
  function fillUrlSearchParamsIfNecessary(URLSearchParams) {
      if (typeof window !== 'undefined' && (!urlIsPresent() || !urlSearchParamsIsPresent())) {
          window['URLSearchParams'] = URLSearchParams(); // tslint:disable-line:no-string-literal
      }
  }
  exports.fillUrlSearchParamsIfNecessary = fillUrlSearchParamsIfNecessary;
  
  //# sourceMappingURL=UrlFillHelper.js.map
  