/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { EndpointInitializer } from "#endpoint/properties/EndpointInitializer.js";
import { ImplementationError, NotImplementedError } from "#general";
import { ClientEndpointInitializer } from "./client/ClientEndpointInitializer.js";
import { ClientNodeLifecycle } from "./ClientNodeLifecycle.js";
import { Node } from "./Node.js";
import { ServerNode } from "./ServerNode.js";
class ClientNode extends Node {
  #fabricId;
  #nodeId;
  constructor(options) {
    super({
      id: `${options.fabricId}:${options.nodeId}`,
      number: 0,
      type: Node.CommonRootEndpoint,
      owner: options.owner
    });
    this.#fabricId = options.fabricId;
    this.#nodeId = options.nodeId;
    this.env.set(EndpointInitializer, new ClientEndpointInitializer());
  }
  get fabricId() {
    return this.#fabricId;
  }
  get nodeId() {
    return this.#nodeId;
  }
  get lifecycle() {
    return super.lifecycle;
  }
  get owner() {
    return super.owner;
  }
  set owner(node) {
    if (!(node instanceof ServerNode)) {
      throw new ImplementationError("Client node owner must be a server node");
    }
    super.owner = node;
  }
  createRuntime() {
    throw new NotImplementedError();
  }
  get container() {
    return this.owner?.nodes;
  }
  createLifecycle() {
    return new ClientNodeLifecycle(this);
  }
}
export {
  ClientNode
};
//# sourceMappingURL=ClientNode.js.map
