import { focusedElementContext } from "./focusedElementContext.js";
import { ContextMixin } from "./ContextMixin.js";
import { TWMixin } from "./TWMixin2.js";
import { provide } from "@lit/context";
import { LitElement, css, html } from "lit";
import { customElement } from "lit/decorators.js";
import _decorate from "@oxc-project/runtime/helpers/decorate";
let EFPreview = class EFPreview$1 extends ContextMixin(TWMixin(LitElement)) {
	static {
		this.styles = [css`
      :host {
        position: relative;
        display: block;
        cursor: crosshair;
      }
    `];
	}
	constructor() {
		super();
		this.addEventListener("mouseover", (e) => {
			const target = e.target;
			const timegroup = target.closest("ef-timegroup");
			if (target !== this && timegroup) this.focusedElement = target;
		});
		this.addEventListener("mouseout", (e) => {
			const relatedTarget = e.relatedTarget;
			const targetingTimegroup = relatedTarget?.closest("ef-timegroup");
			if (!this.contains(relatedTarget) || relatedTarget === this || !targetingTimegroup) this.focusedElement = void 0;
		});
	}
	render() {
		return html`<slot></slot>`;
	}
};
_decorate([provide({ context: focusedElementContext })], EFPreview.prototype, "focusedElement", void 0);
EFPreview = _decorate([customElement("ef-preview")], EFPreview);
export { EFPreview };
