"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NvPicPrXform = void 0;
const base_xform_1 = require("../base-xform.js");
const c_nv_pr_xform_1 = require("./c-nv-pr-xform.js");
const c_nv_pic_pr_xform_1 = require("./c-nv-pic-pr-xform.js");
class NvPicPrXform extends base_xform_1.BaseXform {
    constructor() {
        super();
        this.map = {
            "xdr:cNvPr": new c_nv_pr_xform_1.CNvPrXform(),
            "xdr:cNvPicPr": new c_nv_pic_pr_xform_1.CNvPicPrXform()
        };
    }
    get tag() {
        return "xdr:nvPicPr";
    }
    render(xmlStream, model) {
        xmlStream.openNode(this.tag);
        this.map["xdr:cNvPr"].render(xmlStream, model);
        this.map["xdr:cNvPicPr"].render(xmlStream, model);
        xmlStream.closeNode();
    }
    parseOpen(node) {
        if (this.parser) {
            this.parser.parseOpen(node);
            return true;
        }
        switch (node.name) {
            case this.tag:
                this.reset();
                break;
            default:
                this.parser = this.map[node.name];
                if (this.parser) {
                    this.parser.parseOpen(node);
                }
                break;
        }
        return true;
    }
    parseText() { }
    parseClose(name) {
        if (this.parser) {
            if (!this.parser.parseClose(name)) {
                this.parser = undefined;
            }
            return true;
        }
        switch (name) {
            case this.tag:
                this.model = this.map["xdr:cNvPr"].model;
                return false;
            default:
                return true;
        }
    }
}
exports.NvPicPrXform = NvPicPrXform;
