/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { ServiceBundle } from "#general";
import { Ble } from "#protocol";
import { NodeJsBle } from "./NodeJsBle.js";
function nodejsBle(env) {
  let installed = false;
  let instance = void 0;
  env.vars.use(() => {
    const shouldInstall = env.vars.boolean("ble.enable");
    if (shouldInstall === installed) {
      return;
    }
    if (shouldInstall) {
      instance = new NodeJsBle({ environment: env });
      env.set(Ble, instance);
    } else {
      env.delete(Ble, instance);
      instance = void 0;
    }
    installed = shouldInstall;
  });
}
ServiceBundle.default.add(nodejsBle);
//# sourceMappingURL=install.js.map
