/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
const URL_PARAM = "dev";
class DevModeServiceImpl {
  constructor() {
    this._listeners = /* @__PURE__ */ new Set();
  }
  get active() {
    const value = new URLSearchParams(window.location.search).get(URL_PARAM);
    return value !== null && value !== "";
  }
  setActive(on) {
    const url = new URL(window.location.href);
    if (on) {
      url.searchParams.set(URL_PARAM, "on");
    } else {
      url.searchParams.delete(URL_PARAM);
    }
    history.replaceState(null, "", url.toString());
    const active = this.active;
    this._listeners.forEach((cb) => cb(active));
  }
  subscribe(callback) {
    this._listeners.add(callback);
    return () => {
      this._listeners.delete(callback);
    };
  }
}
const DevModeService = new DevModeServiceImpl();
export {
  DevModeService
};
//# sourceMappingURL=dev-mode-service.js.map
