"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HLinkClickXform = void 0;
const base_xform_1 = require("../base-xform.js");
class HLinkClickXform extends base_xform_1.BaseXform {
    constructor() {
        super();
        this.model = {};
    }
    get tag() {
        return "a:hlinkClick";
    }
    render(xmlStream, model) {
        if (!(model.hyperlinks && model.hyperlinks.rId)) {
            return;
        }
        xmlStream.leafNode(this.tag, {
            "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
            "r:id": model.hyperlinks.rId,
            tooltip: model.hyperlinks.tooltip
        });
    }
    parseOpen(node) {
        switch (node.name) {
            case this.tag:
                this.model = {
                    hyperlinks: {
                        rId: node.attributes["r:id"],
                        tooltip: node.attributes.tooltip
                    }
                };
                return true;
            default:
                return true;
        }
    }
    parseText() { }
    parseClose() {
        return false;
    }
}
exports.HLinkClickXform = HLinkClickXform;
