import { BaseView } from "../BaseView.js";
export class AssemblerView extends BaseView {
    constructor(options) {
        super(options);
    }
    get visible() {
        return this.state.get("visible", false);
    }
    get source() {
        return super.source;
    }
    get globals() {
        return this.source.root.context.globals;
    }
    get isDefaultView() {
        return this.state.get("isDefaultView", false);
    }
    get hasBeenViewed() {
        return this.state.get("hasBeenViewed", false);
    }
    set hasBeenViewed(value) {
        this.state.set("hasBeenViewed", value);
    }
    get hasFocus() {
        return this.state.get("hasFocus", false);
    }
    set hasFocus(value) {
        this.state.set("hasFocus", value);
    }
    template() {
        return `<div class="-fb-layout-group"></div>`;
    }
    show() {
        this.node.show();
        this.focusView();
    }
    hide() {
        this.node.hide();
    }
    onActivate(e) {
        super.onActivate(e);
    }
    onComplete(e) {
        super.onComplete(e);
        if (this.isDefaultView) {
            this.focusView();
        }
        this.node.css({
            display: this.visible ? "block" : "none"
        });
    }
    focusView() {
        this.hasFocus = true;
        if (!this.hasBeenViewed) {
            this.onInitialView();
            this.hasBeenViewed = true;
        }
        this.onFocusedView();
    }
    onInitialView() {
    }
    onFocusedView() {
    }
}
