import {ViewerCamerasController} from "./utils/CamerasController";
import {ViewerEventsController} from "./utils/EventsController";
import {WebGLController} from "./utils/WebglController";
const HOVERED_CLASS_NAME = "hovered";
const TypedViewer2 = class {
  constructor(_container, _scene, _camera_node) {
    this._container = _container;
    this._scene = _scene;
    this._camera_node = _camera_node;
    this._active = false;
    this._id = TypedViewer2._next_viewer_id++;
    this._scene.viewersRegister.registerViewer(this);
  }
  active() {
    return this._active;
  }
  activate() {
    this._active = true;
  }
  deactivate() {
    this._active = false;
  }
  get camerasController() {
    return this._cameras_controller = this._cameras_controller || new ViewerCamerasController(this);
  }
  get controlsController() {
    return this._controls_controller;
  }
  get eventsController() {
    return this._events_controller = this._events_controller || new ViewerEventsController(this);
  }
  get webglController() {
    return this._webgl_controller = this._webgl_controller || new WebGLController(this);
  }
  container() {
    return this._container;
  }
  scene() {
    return this._scene;
  }
  canvas() {
    return this._canvas;
  }
  cameraNode() {
    return this._camera_node;
  }
  get cameraControlsController() {
    return void 0;
  }
  id() {
    return this._id;
  }
  dispose() {
    this._scene.viewersRegister.unregisterViewer(this);
    this.eventsController.dispose();
    let child;
    while (child = this._container.children[0]) {
      this._container.removeChild(child);
    }
  }
  resetContainerClass() {
    this.container().classList.remove(HOVERED_CLASS_NAME);
  }
  setContainerClassHovered() {
    this.container().classList.add(HOVERED_CLASS_NAME);
  }
};
export let TypedViewer = TypedViewer2;
TypedViewer._next_viewer_id = 0;
