import { AppObjectPM, getSingletonComponent, } from "@vived/core";
import { ZSpaceEntity } from "../Entities/ZSpaceEntity";
export class ZSpaceIsSupportedPM extends AppObjectPM {
}
ZSpaceIsSupportedPM.type = "ZSpaceIsSupportedPM";
ZSpaceIsSupportedPM.get = (appObjects) => getSingletonComponent(ZSpaceIsSupportedPM.type, appObjects);
export function makeZSpaceIsSupportedPM(appObject) {
    return new ZSpaceIsSupportedPMImp(appObject);
}
class ZSpaceIsSupportedPMImp extends ZSpaceIsSupportedPM {
    get zSpaceEntity() {
        return this.getCachedSingleton(ZSpaceEntity.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, ZSpaceIsSupportedPM.type);
        this.onZSpaceChange = () => {
            if (!this.zSpaceEntity)
                return;
            this.doUpdateView(this.zSpaceEntity.isSupported);
        };
        this.zSpaceEntity?.addChangeObserver(this.onZSpaceChange);
        this.onZSpaceChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=ZSpaceIsSupportedPM.js.map