"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const html_1 = __importDefault(require("../../../../client/html"));
class Anchor extends html_1.default {
    constructor($props, $system) {
        super($props, $system, $system.api.document.createElement('a'), $system.style['anchor'], {
            rel: 'noreferer',
        }, {
            href: (href) => {
                if (href) {
                    this.$element.href = href;
                }
                else {
                    this.$element.removeAttribute('href');
                }
            },
            target: (target) => {
                if (target) {
                    this.$element.target = target;
                }
                else {
                    this.$element.removeAttribute('target');
                }
            },
        });
        const { href, target, className } = this.$props;
        if (className !== undefined) {
            this.$element.className = className;
        }
        if (href !== undefined) {
            this.$element.setAttribute('href', href);
        }
        if (target !== undefined) {
            this.$element.setAttribute('target', target);
        }
    }
}
exports.default = Anchor;
//# sourceMappingURL=Component.js.map