import { Quaternion, Vector3 } from "@vived/core";
import { StylusEntity } from "../../Stylus";
import { makeTransform3DPM } from "../../Transform3D";
import { makeHoverLabelMouse, makeHoverLabelTouch, makeStylusHoverLabelController, } from "../Controllers";
import { makeHoverLabelEntity } from "../Entities";
import { makeAllowHoverLabelPM, makeScreenHoverLabelPM, makeWorldHoverLabelPM, } from "../PM";
import { makeToggleAllowHoverLabel, makeTryShowHoverLabel, SerializeAllowHoverLabel, } from "../UseCases";
export function setupHoverLabel(appObjects, options) {
    const hoverLabelAO = appObjects.getOrCreate("HoverLabel");
    // Entity
    const hoverLabelEntity = makeHoverLabelEntity(hoverLabelAO);
    // UC
    if (options?.tryShowFactory) {
        options.tryShowFactory(hoverLabelAO);
    }
    else {
        makeTryShowHoverLabel(hoverLabelAO);
    }
    makeToggleAllowHoverLabel(hoverLabelAO);
    new SerializeAllowHoverLabel(hoverLabelAO);
    // PM
    makeWorldHoverLabelPM(hoverLabelAO);
    makeScreenHoverLabelPM(hoverLabelAO);
    makeAllowHoverLabelPM(hoverLabelAO);
    makeTransform3DPM(hoverLabelAO);
    // Controller
    makeHoverLabelMouse(hoverLabelAO);
    makeHoverLabelTouch(hoverLabelAO);
    makeStylusHoverLabelController(hoverLabelAO);
    const stylus = StylusEntity.get(appObjects);
    if (!stylus) {
        appObjects.submitError("setupHoverLabel", "StylusEntity needs to be setup before Hover Label");
    }
    else {
        hoverLabelEntity.transform.parent = stylus.transform;
        hoverLabelEntity.transform.localPosition = Vector3.Zero();
        hoverLabelEntity.transform.localRotation = Quaternion.Identity();
        hoverLabelEntity.transform.localScale = Vector3.One();
    }
    return hoverLabelEntity;
}
//# sourceMappingURL=setupHoverLabel.js.map