constructor(win, extLog, jsonHighlight) {
    //#region --- Class variables ---
    __publicField(this, "version", "7.4.1-src");
    // List of tags and attributes not in sanitise defaults but allowed in uibuilder.
    __publicField(this, "sanitiseExtraTags", ["uib-var"]);
    __publicField(this, "sanitiseExtraAttribs", ["variable", "report", "undefined"]);
    /** Optional Markdown-IT Plugins */
    __publicField(this, "ui_md_plugins");
    if (win) _a.win = win;
    else {
      throw new Error("Ui:constructor. Current environment does not include `window`, UI functions cannot be used.");
    }
    _a.doc = _a.win.document;
    if (extLog) _a.log = extLog;
    else _a.log = function() {
      return function() {
      };
    };
    if (jsonHighlight) this.syntaxHighlight = jsonHighlight;
    else this.syntaxHighlight = function() {
    };
    if (_a.win["markdownit"]) {
      _a.mdOpts = {
        html: true,
        xhtmlOut: false,
        linkify: true,
        _highlight: true,
        _strict: false,
        _view: "html",
        langPrefix: "language-",
        // NB: the highlightjs (hljs) library must be loaded before markdown-it for this to work
        highlight: function(str, lang) {
          if (lang && window["hljs"] && window["hljs"].getLanguage(lang)) {
            try {
              return `<pre class="">
                                    <code class="hljs border">${window["hljs"].highlight(str, { language: lang, ignoreIllegals: true }).value}</code></pre>`;
            } finally {
            }
          }
          return `<pre class="hljs border"><code>${_a.md.utils.escapeHtml(str).trim()}</code></pre>`;
        }
      };
      _a.md = _a.win["markdownit"](_a.mdOpts);
    }
  }
Called when `new Ui(...)` is called
@param {globalThis} win Either the browser global window or jsdom dom.window
@param {Function} [extLog] A function that returns a function for logging
@param {Function} [jsonHighlight] A function that returns a highlighted HTML of JSON input