"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Avatar {
    onCreate(input) {
        this.state = {
            imagePlacement: input.knownAspectRatio &&
                (input.knownAspectRatio < 3 / 4 ||
                    input.knownAspectRatio > 4 / 3)
                ? "fit"
                : "cover",
        };
    }
    handleImageLoad(_event, el) {
        const aspectRatio = el.naturalWidth / el.naturalHeight;
        if (aspectRatio < 3 / 4 || aspectRatio > 4 / 3) {
            this.state.imagePlacement = "fit";
        }
        else {
            this.state.imagePlacement = "cover";
        }
    }
}
module.exports = Avatar;
