'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('./core-1276587e.js');

const AlGraphEditor = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.nodes = null;
        this.angles = null;
        this.edges = null;
        this.selected = null;
    }
    _getSelectedNode() {
        if (this.selected && this.nodes) {
            const n = this.nodes.get(this.selected);
            if (n) {
                return [this.selected, n];
            }
        }
        return null;
    }
    _getSelectedEdge() {
        if (this.selected && this.edges) {
            const e = this.edges.get(this.selected);
            if (e) {
                return [this.selected, e];
            }
        }
        return null;
    }
    _getSelectedAngle() {
        if (this.selected && this.angles) {
            const a = this.angles.get(this.selected);
            if (a) {
                return [this.selected, a];
            }
        }
        return null;
    }
    render() {
        return [
            core.h("al-node-list", { nodes: this.nodes, selected: this.selected }),
            core.h("ion-item-divider", null),
            core.h("al-node-editor", { node: this._getSelectedNode() }),
            core.h("al-edge-editor", { edge: this._getSelectedEdge() }),
            core.h("al-angle-editor", { angle: this._getSelectedAngle() })
        ];
    }
    static get style() { return ""; }
};

exports.al_graph_editor = AlGraphEditor;
