"use strict";
/**
 * Nav lock event handler
 *
 *  Copyright (C) 2010-2019 R-T Specialty, LLC.
 *
 *  This file is part of the Liza Data Collection Framework
 *
 *  Liza is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.NavFreezeEventHandler = void 0;
/**
 * Handles nav freeze events
 */
var NavFreezeEventHandler = /** @class */ (function () {
    /**
     * Initializes with client that will delegate the event
     *
     * @param client - client object
     */
    function NavFreezeEventHandler(_client) {
        this._client = _client;
    }
    /**
     * Handles nav freezing
     *
     * @param type - event id; ignored
     * @param c    - continuation to invoke on completion
     * @param data - event data
     */
    NavFreezeEventHandler.prototype.handle = function (_type, c, data) {
        if (this._client.getQuote().isLocked()) {
            c();
            return this;
        }
        var lock_msg = data.value || 'Navigation is locked';
        var notify_content = this._client.getDocument().createElement('div');
        notify_content.innerHTML = '<div class="text">' + lock_msg + '</div>';
        this._client.getUi().showNotifyBar(notify_content).freezeNav();
        c();
        return this;
    };
    return NavFreezeEventHandler;
}());
exports.NavFreezeEventHandler = NavFreezeEventHandler;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTmF2RnJlZXplRXZlbnRIYW5kbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiTmF2RnJlZXplRXZlbnRIYW5kbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW1CRzs7O0FBTUg7O0dBRUc7QUFDSDtJQUNF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