import { AppObjectPM, getSingletonComponent, } from "@vived/core";
import { HoverLabelEntity } from "../Entities/HoverLabelEntity";
export class AllowHoverLabelPM extends AppObjectPM {
}
AllowHoverLabelPM.type = "AllowHoverLabelPM";
AllowHoverLabelPM.get = (appObjects) => getSingletonComponent(AllowHoverLabelPM.type, appObjects);
export function makeAllowHoverLabelPM(appObject) {
    return new AllowHoverLabelPMImp(appObject);
}
class AllowHoverLabelPMImp extends AllowHoverLabelPM {
    get hoverLabelEntity() {
        return this.getCachedSingleton(HoverLabelEntity.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, AllowHoverLabelPM.type);
        this.onEntityChange = () => {
            if (!this.hoverLabelEntity)
                return;
            this.doUpdateView(this.hoverLabelEntity.allowHoverLabel);
        };
        this.hoverLabelEntity?.addChangeObserver(this.onEntityChange);
        this.onEntityChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=AllowHoverLabelPM.js.map