"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("../..");
var PDFAnnotationAppearance = /** @class */ (function () {
    function PDFAnnotationAppearance(dict) {
        this.dict = dict;
    }
    PDFAnnotationAppearance.fromDict = function (dict) {
        return new PDFAnnotationAppearance(dict);
    };
    PDFAnnotationAppearance.prototype.N = function () {
        var normalAppearance = this.dict.lookup(core_1.PDFName.N);
        if (normalAppearance instanceof core_1.PDFDict) {
            return this.dict.lookup(core_1.PDFName.N, core_1.PDFDict);
        }
        return this.dict.lookup(core_1.PDFName.N, core_1.PDFStream);
    };
    PDFAnnotationAppearance.prototype.getNormal = function () {
        return this.N();
    };
    PDFAnnotationAppearance.prototype.D = function () {
        var downAppearance = this.dict.lookup(core_1.PDFName.D);
        if (downAppearance instanceof core_1.PDFDict) {
            return this.dict.lookup(core_1.PDFName.D, core_1.PDFDict);
        }
        else if (downAppearance instanceof core_1.PDFStream) {
            return this.dict.lookup(core_1.PDFName.D, core_1.PDFStream);
        }
        return this.N();
    };
    PDFAnnotationAppearance.prototype.getDown = function () {
        return this.D();
    };
    PDFAnnotationAppearance.prototype.R = function () {
        var rolloverAppearance = this.dict.lookup(core_1.PDFName.R);
        if (rolloverAppearance instanceof core_1.PDFDict) {
            return this.dict.lookup(core_1.PDFName.R, core_1.PDFDict);
        }
        else if (rolloverAppearance instanceof core_1.PDFStream) {
            return this.dict.lookup(core_1.PDFName.R, core_1.PDFStream);
        }
        return this.N();
    };
    PDFAnnotationAppearance.prototype.getRollover = function () {
        return this.R();
    };
    return PDFAnnotationAppearance;
}());
exports.default = PDFAnnotationAppearance;
//# sourceMappingURL=PDFAnnotationAppearance.js.map