text: import {
    Debouncer,
    enqueueDebouncer,
    idlePeriod
  } from "./chunk-RUXXNLZ4.js";
  import {
    DirMixin
  } from "./chunk-GBF7XL6S.js";
  
  // node_modules/.pnpm/@vaadin/vaadin-development-mode-detector@2.0.4/node_modules/@vaadin/vaadin-development-mode-detector/vaadin-development-mode-detector.js
  var DEV_MODE_CODE_REGEXP = /\/\*\*\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i;
  var FlowClients = window.Vaadin && window.Vaadin.Flow && window.Vaadin.Flow.clients;
  function isMinified() {
    function test() {
      return true;
    }
    return uncommentAndRun(test);
  }
  function isDevelopmentMode() {
    try {
      if (isForcedDevelopmentMode()) {
        return true;
      }
      if (!isLocalhost()) {
        return false;
      }
      if (FlowClients) {
        return !isFlowProductionMode();
      }
      return !isMinified();
    } catch (e) {
      return false;
    }
  }
  function isForcedDevelopmentMode() {
    return localStorage.getItem("vaadin.developmentmode.force");
  }
  function isLocalhost() {
    return ["localhost", "127.0.0.1"].indexOf(window.location.hostname) >= 0;
  }
  function isFlowProductionMode() {
    if (FlowClients) {
      const productionModeApps = Object.keys(FlowClients).map((key) => FlowClients[key]).filter((client) => client.productionMode);
      if (productionModeApps.length > 0) {
        return true;
      }
    }
    return false;
  }
  function uncommentAndRun(callback, args) {
    if (typeof callback !== "function") {
      return;
    }
    const match = DEV_MODE_CODE_REGEXP.exec(callback.toString());
    if (match) {
      try {
        callback = new Function(match[1]);
      } catch (e) {
        console.log("vaadin-development-mode-detector: uncommentAndRun() failed", e);
      }
    }
    return callback(args);
  }
  window["Vaadin"] = window["Vaadin"] || {};
  var runIfDevelopmentMode = function(callback, args) {
    if (window.Vaadin.developmentMode) {
      return uncommentAndRun(callback, args);
    }
  };
  if (window.Vaadin.developmentMode === void 0) {
    window.Vaadin.developmentMode = isDevelopmentMode();
  }
  
  // node_modules/.pnpm/@vaadin/vaadin-usage-statistics@2.1.0/node_modules/@vaadin/vaadin-usage-statistics/vaadin-usage-statistics-collect.js
  function maybeGatherAndSendStats() {
  }
  var usageStatistics = function() {
    if (typeof runIfDevelopmentMode === "function") {
      return runIfDevelopmentMode(maybeGatherAndSendStats);
    }
  };
  
  // node_modules/.pnpm/@vaadin/component-base@22.0.0-beta2/node_modules/@vaadin/component-base/src/element-mixin.js
  window.Vaadin = window.Vaadin || {};
  window.Vaadin.registrations = window.Vaadin.registrations || [];
  window.Vaadin.developmentModeCallback = window.Vaadin.developmentModeCallback || {};
  window.Vaadin.developmentModeCallback["vaadin-usage-statistics"] = function() {
    usageStatistics();
  };
  var statsJob;
  var registered = new Set();
  var ElementMixin = (superClass) => class VaadinElementMixin extends DirMixin(superClass) {
    static get version() {
      return "22.0.0-beta2";
    }
    static finalize() {
      super.finalize();
      const { is } = this;
      if (is && !registered.has(is)) {
        window.Vaadin.registrations.push(this);
        registered.add(is);
        if (window.Vaadin.developmentModeCallback) {
          statsJob = Debouncer.debounce(statsJob, idlePeriod, () => {
            window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]();
          });
          enqueueDebouncer(statsJob);
        }
      }
    }
    constructor() {
      super();
      this.__controllers = new Set();
      if (document.doctype === null) {
        console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.');
      }
    }
    connectedCallback() {
      super.connectedCallback();
      this.__controllers.forEach((c) => {
        c.hostConnected && c.hostConnected();
      });
    }
    disconnectedCallback() {
      super.disconnectedCallback();
      this.__controllers.forEach((c) => {
        c.hostDisconnected && c.hostDisconnected();
      });
    }
    addController(controller) {
      this.__controllers.add(controller);
      if (this.$ !== void 0 && this.isConnected && controller.hostConnected) {
        controller.hostConnected();
      }
    }
    removeController(controller) {
      this.__controllers.delete(controller);
    }
  };
  
  export {
    runIfDevelopmentMode,
    ElementMixin
  };
  /**
   * @license
   * Copyright (c) 2021 Vaadin Ltd.
   * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
   */
  //# sourceMappingURL=chunk-6TGXYB6C.js.map
  