text: "use strict";var _globalThis = function (Object) {function get() {var _global = this || self;delete Object.prototype.__magic__;return _global;}if (typeof globalThis === "object") {return globalThis;}if (this) {return get();} else {Object.defineProperty(Object.prototype, "__magic__", { configurable: true, get: get });var _global = __magic__;return _global;}}(Object);var e = "undefined" != typeof _globalThis ? _globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {},t = require("atom-package-deps").install,n = require("path"),i = require("url"),s = require("disposable-event"),r = require("assert"),o = require("electron").shell,l = require("atom"),a = l.CompositeDisposable,c = l.Emitter,u = l.Disposable,d = l.Range;Object.defineProperty(exports, "__esModule", { value: !0 });var h = function () {atom.config.get("linter-ui-default.useBusySignal") && atom.packages.getLoadedPackage("linter-ui-default").metadata["package-deps"].push("busy-signal");const e = window.requestIdleCallback(function () {er.delete(e), atom.inSpecMode() || t("linter-ui-default");});er.add(e);};exports.activate = h;var p = function () {er.forEach(e => window.cancelIdleCallback(e)), er.clear();for (const e of tr) e.dispose();tr.clear();};exports.deactivate = p;var f = function () {const e = new Qs.default();tr.add(e), nr && e.signal.attach(nr);return e;};exports.provideUI = f;var g = function () {return Array.from(tr).map(e => e.intentions);};exports.provideIntentions = g;var m = function (e) {nr = e, tr.forEach(function (e) {e.signal.attach(nr);});};exports.consumeSignal = m;var v = function (e) {ir = e, tr.forEach(function (e) {e.statusBar.attach(ir);});};exports.consumeStatusBar = v;var b = {};Object.defineProperty(b, "__esModule", { value: !0 });var w = void 0;b.default = w;var k = {};Object.defineProperty(k, "__esModule", { value: !0 });var y = void 0;k.default = y;var x = {};Object.defineProperty(x, "__esModule", { value: !0 });var _ = void 0;x.default = _;var S = {};Object.defineProperty(S, "__esModule", { value: !0 });var P = Z;S.$range = P;var E = G;S.$file = E;var C = function () {const e = getSelection();e && atom.clipboard.write(e.toString());};S.copySelection = C;var T = K;S.getPathOfMessage = T;var M = function () {let e = atom.workspace.getCenter().getActivePaneItem();const t = null !== e && atom.workspace.isTextEditor(e);!t && e && F && e.getURI && "atom://linter-ui-default" === e.getURI() && (!F.isAlive || F.isAlive()) ? e = F : F = e;return t ? e : null;};S.getActiveTextEditor = M;var O = function (e) {const t = new Map(),n = [];for (const s of e.editors) {var i;const e = null !== (i = s.textEditor.getPath()) && void 0 !== i ? i : "";t.has(e) ? t.get(e).editors.push(s) : (t.set(e, { added: [], removed: [], editors: [s] }), n.push(e));}return { editorsMap: t, filePaths: n };};S.getEditorsMap = O;var A = function (e, t, n = null) {const i = [];return e.forEach(function (e) {e && e.location && (null !== t && G(e) !== t || n && e.severity !== n || i.push(e));}), i;};S.filterMessages = A;var $ = function (e, t, n) {const i = [],s = "Point" === n.constructor.name ? new d(n, n) : d.fromObject(n);return e.forEach(function (e) {const n = G(e),r = Z(e);n && r && n === t && "function" == typeof r.intersectsWith && r.intersectsWith(s) && i.push(e);}), i;};S.filterMessagesByRangeOrPoint = $;var L = Y;S.openFile = L;var z = function (e, t = !1) {let n, i;if (t) {if (!e.reference || !e.reference.file) return void console.warn("[Linter-UI-Default] Message does not have a valid reference. Ignoring");n = e.reference.file, i = e.reference.position;} else {const t = Z(e);n = G(e), t && (i = t.start);}n && Y(n, i);};S.visitMessage = z;var I = function (e) {2 === e.version && e.url && o.openExternal(e.url);};S.openExternally = I;var D = function (e, t) {const n = t[0],i = "asc" === t[1] ? 1 : -1;return e.sort(function (e, t) {if ("severity" === n) {const n = q[e.severity],s = q[t.severity];if (n !== s) return i * (n > s ? 1 : -1);}if ("linterName" === n) {const n = e.severity.localeCompare(t.severity);if (0 !== n) return i * n;}if ("file" === n) {const n = K(e),s = n.length,r = K(t),o = r.length;if (s !== o) return i * (s > o ? 1 : -1);if (n !== r) return i * n.localeCompare(r);}if ("line" === n) {const n = Z(e),s = Z(t);if (n && !s) return 1;if (s && !n) return -1;if (n && s) {if (n.start.row !== s.start.row) return i * (n.start.row > s.start.row ? 1 : -1);if (n.start.column !== s.start.column) return i * (n.start.column > s.start.column ? 1 : -1);}}return 0;});};S.sortMessages = D;var R = function (e) {return e.sort(function (e, t) {return void 0 === e.priority || void 0 === t.priority ? 0 : t.priority - e.priority;});};S.sortSolutions = R;var j = function (e, t) {if ("apply" in t) return t.apply(), !0;const n = t.position,i = t.replaceWith;if ("currentText" in t) {const i = t.currentText,s = e.getTextInBufferRange(n);if (i !== s) return console.warn("[linter-ui-default] Not applying fix because text did not match the expected one", "expected", i, "but got", s), !1;}return e.setTextInBufferRange(n, i), !0;};S.applySolution = j;var N = function (e) {const t = e.getLineCount();if (e.largeFileMode || t >= X) return !0;const n = e.getBuffer();for (let e = 0, i = t; e < i; e++) if (n.lineLengthForRow(e) > J) return !0;return !1;};S.isLargeFile = N;var B = (H = void 0, W = S.severityScore = H, U = S.severityNames = W, V = S.WORKSPACE_URI = U, S.DOCK_ALLOWED_LOCATIONS = V);S.DOCK_DEFAULT_LOCATION = B;let F = null;const q = { error: 3, warning: 2, info: 1 };var H = q;S.severityScore = H;var W = { error: "Error", warning: "Warning", info: "Info" };S.severityNames = W;var U = "atom://linter-ui-default";S.WORKSPACE_URI = U;var V = ["center", "bottom"];S.DOCK_ALLOWED_LOCATIONS = V;function Z(e) {return e.location.position;}function G(e) {return e.location.file;}function K(e) {return atom.project.relativizePath(G(e) || "")[1];}function Y(e, t) {const n = { searchAllPanes: !0 };t && (n.initialLine = t.row, n.initialColumn = t.column), atom.workspace.open(e, n);}B = "bottom", S.DOCK_DEFAULT_LOCATION = B;const X = atom.config.get("linter-ui-default.largeFileLineCount"),J = atom.config.get("linter-ui-default.longLineLength");_ = class {constructor() {this.emitter = new c(), this.messages = [], this.filteredMessages = [], this.subscriptions = new a(), this.panelRepresents = void 0;let e = null;this.subscriptions.add(atom.config.observe("linter-ui-default.panelRepresents", e => {const t = void 0 !== this.panelRepresents;this.panelRepresents = e, t && this.update();}), atom.workspace.getCenter().observeActivePaneItem(() => {e && (e.dispose(), e = null);const t = (0, S.getActiveTextEditor)();if (t) {"Entire Project" !== this.panelRepresents && this.update();let n = -1;e = t.onDidChangeCursorPosition(({ newBufferPosition: e }) => {n !== e.row && "Current Line" === this.panelRepresents && (n = e.row, this.update());});}("Entire Project" !== this.panelRepresents || t) && this.update();}), new u(function () {e && e.dispose();}));}getFilteredMessages() {let e = [];if ("Entire Project" === this.panelRepresents) e = this.messages;else if ("Current File" === this.panelRepresents) {const t = (0, S.getActiveTextEditor)();if (!t) return [];e = (0, S.filterMessages)(this.messages, t.getPath());} else if ("Current Line" === this.panelRepresents) {const t = (0, S.getActiveTextEditor)();if (!t) return [];const n = t.getCursors()[0].getBufferRow();e = (0, S.filterMessagesByRangeOrPoint)(this.messages, t.getPath(), d.fromObject([[n, 0], [n, 1 / 0]]));}return e;}update(e = null) {Array.isArray(e) && (this.messages = e), this.filteredMessages = this.getFilteredMessages(), this.emitter.emit("observe-messages", this.filteredMessages);}onDidChangeMessages(e) {return this.emitter.on("observe-messages", e);}dispose() {this.subscriptions.dispose();}}, x.default = _;var Q = Wt(x = x.default),ee = {};Object.defineProperty(ee, "__esModule", { value: !0 });var te = void 0;ee.default = te;const ne = (e, t) => e === t;let ie = null,se = ze;const re = {},oe = { owned: null, cleanups: null, context: null, owner: null },[le, ae] = be(!1, !0);var ce = null,ue = null;let de,he = null,pe = null,fe = null,ge = null,me = 0;function ve(e, t) {t && (ce = t);const n = ue,i = ce,s = 0 === e.length ? oe : { owned: null, cleanups: null, context: null, owner: i, attached: !!t };let r;ce = s, ue = null;try {Le(() => r = e(() => je(s)), !0);} finally {ue = n, ce = i;}return r;}function be(e, t, n) {const i = { value: e, observers: null, observerSlots: null, pending: re, comparator: t ? "function" == typeof t ? t : ne : void 0 };return [Ce.bind(i), Te.bind(i)];}function we(e, t) {Me(Ae(e, t, !0));}function ke(e, t) {Me(Ae(e, t, !1));}function ye(e, t, n) {const i = Ae(e, t, !0);return i.pending = re, i.observers = null, i.observerSlots = null, i.state = 0, i.comparator = n ? "function" == typeof n ? n : ne : void 0, Me(i), Ce.bind(i);}function xe(e) {if (he) return e();const t = he = [],n = e();return he = null, Le(() => {for (let e = 0; e < t.length; e += 1) {const n = t[e];if (n.pending !== re) {const e = n.pending;n.pending = re, Te.call(n, e);}}}, !1), n;}function _e(e) {let t,n = ue;return ue = null, t = e(), ue = n, t;}function Se(e) {!function (e, t) {if (_globalThis._$HYDRATION && _globalThis._$HYDRATION.asyncSSR) return;se = Ie;const n = Ae(e, t, !1),i = de && Fe(ce, de.id);i && (n.suspense = i), n.user = !0, fe && fe.push(n);}(() => _e(e));}function Pe(e) {return null === ce || (null === ce.cleanups ? ce.cleanups = [e] : ce.cleanups.push(e)), e;}function Ee(e) {const t = Symbol("context");return { id: t, Provider: He(t), defaultValue: e };}function Ce() {if (this.state && this.sources) {const e = pe;pe = null, 1 === this.state ? Me(this) : De(this), pe = e;}if (ue) {const e = this.observers ? this.observers.length : 0;ue.sources ? (ue.sources.push(this), ue.sourceSlots.push(e)) : (ue.sources = [this], ue.sourceSlots = [e]), this.observers ? (this.observers.push(ue), this.observerSlots.push(ue.sources.length - 1)) : (this.observers = [ue], this.observerSlots = [ue.sources.length - 1]);}return ge && ge.running && ge.sources.has(this) ? this.tValue : this.value;}function Te(e, t) {if (this.comparator) if (ge && ge.running && ge.sources.has(this)) {if (this.comparator(this.tValue, e)) return e;} else if (this.comparator(this.value, e)) return e;return he ? (this.pending === re && he.push(this), this.pending = e, e) : (ge ? ((ge.running || !t && ge.sources.has(this)) && (ge.sources.add(this), this.tValue = e), ge.running || (this.value = e)) : this.value = e, !this.observers || pe && !this.observers.length || Le(() => {for (let e = 0; e < this.observers.length; e += 1) {const t = this.observers[e];ge && ge.running && ge.disposed.has(t) || (t.observers && 2 !== t.state && Re(t), t.state = 1, t.pure ? pe.push(t) : fe.push(t));}if (pe.length > 1e6) throw pe = [], new Error("Potential Infinite Loop Detected.");}, !1), e);}function Me(e) {if (!e.fn) return;je(e);const t = ce,n = ue,i = me;ue = ce = e, Oe(e, e.value, i), ge && !ge.running && ge.sources.has(e) && (ge.running = !0, Oe(e, e.tValue, i), ge.running = !1), ue = n, ce = t;}function Oe(e, t, n) {let i;try {i = e.fn(t);} catch (e) {Be(e);}(!e.updatedAt || e.updatedAt <= n) && (e.observers && e.observers.length ? Te.call(e, i, !0) : ge && ge.running && e.pure ? (ge.sources.add(e), e.tValue = i) : e.value = i, e.updatedAt = n);}function Ae(e, t, n) {const i = { fn: e, state: 1, updatedAt: null, owned: null, sources: null, sourceSlots: null, cleanups: null, value: t, owner: ce, context: null, pure: n };return null === ce || ce !== oe && (ge && ge.running && ce.pure ? ce.tOwned ? ce.tOwned.push(i) : ce.tOwned = [i] : ce.owned ? ce.owned.push(i) : ce.owned = [i]), i;}function $e(e) {let t,n = 1 === e.state && e;if (e.suspense && _e(e.suspense.inFallback)) return e.suspense.effects.push(e);const i = ge && ge.running;for (; (e.fn || i && e.attached) && (e = e.owner);) {if (i && ge.disposed.has(e)) return;2 === e.state ? t = e : 1 === e.state && (n = e, t = void 0);}if (t) {const s = pe;if (pe = null, De(t), pe = s, !n || 1 !== n.state) return;if (i) for (e = n; (e.fn || e.attached) && (e = e.owner);) if (ge.disposed.has(e)) return;}n && Me(n);}function Le(e, t) {if (pe) return e();let n = !1;t || (pe = []), fe ? n = !0 : fe = [], me++;try {e();} catch (e) {Be(e);} finally {if (pe && (ze(pe), pe = null), n) return;if (ge && ge.running) {if (ge.promises.size) return ge.running = !1, ge.effects.push.apply(ge.effects, fe), fe = null, void ae(!0);const e = ge.sources;ge = null, xe(() => {e.forEach(e => {if (e.value = e.tValue, e.owned) for (let t = 0, n = e.owned.length; t < n; t++) je(e.owned[t]);e.tOwned && (e.owned = e.tOwned), delete e.tValue, delete e.tOwned;}), ae(!1);});}fe.length ? xe(() => {se(fe), fe = null;}) : fe = null;}}function ze(e) {for (let t = 0; t < e.length; t++) $e(e[t]);}function Ie(e) {let t,n = 0;for (t = 0; t < e.length; t++) {const i = e[t];i.user ? e[n++] = i : $e(i);}const i = e.length;for (t = 0; t < n; t++) $e(e[t]);for (t = i; t < e.length; t++) $e(e[t]);}function De(e) {e.state = 0;for (let t = 0; t < e.sources.length; t += 1) {const n = e.sources[t];n.sources && (1 === n.state ? $e(n) : 2 === n.state && De(n));}}function Re(e) {for (let t = 0; t < e.observers.length; t += 1) {const n = e.observers[t];n.state || (n.state = 2, n.observers && Re(n));}}function je(e) {let t;if (e.sources) for (; e.sources.length;) {const t = e.sources.pop(),n = e.sourceSlots.pop(),i = t.observers;if (i && i.length) {const e = i.pop(),s = t.observerSlots.pop();n < i.length && (e.sourceSlots[s] = n, i[n] = e, t.observerSlots[n] = s);}}if (ge && ge.running && e.pure) {if (e.tOwned) {for (t = 0; t < e.tOwned.length; t++) je(e.tOwned[t]);delete e.tOwned;}Ne(e, !0);} else if (e.owned) {for (t = 0; t < e.owned.length; t++) je(e.owned[t]);e.owned = null;}if (e.cleanups) {for (t = 0; t < e.cleanups.length; t++) e.cleanups[t]();e.cleanups = null;}e.state = 0, e.context = null;}function Ne(e, t) {if (t || (e.state = 0, ge.disposed.add(e)), e.owned) for (let t = 0; t < e.owned.length; t++) Ne(e.owned[t]);}function Be(e) {const t = ie && Fe(ce, ie);if (!t) throw e;t.forEach(t => t(e));}function Fe(e, t) {return e && (e.context && e.context[t] || e.owner && Fe(e.owner, t));}function qe(e) {if ("function" == typeof e) return qe(e());if (Array.isArray(e)) {const t = [];for (let n = 0; n < e.length; n++) {let i = qe(e[n]);Array.isArray(i) ? t.push.apply(t, i) : t.push(i);}return t;}return e;}function He(e) {return function (t) {return ye(() => {ce.context = { [e]: t.value };const n = ye(() => t.children);return ye(() => qe(n()));});};}const We = Symbol("state-raw"),Ue = Symbol("state-node"),Ve = Symbol("state-proxy"),Ze = Symbol("state-name");function Ge(e, t, n, i) {let s = e[Ve];if (!s && (Object.defineProperty(e, Ve, { value: s = new Proxy(e, i || Qe) }), n)) {let t = Object.keys(e),n = Object.getOwnPropertyDescriptors(e);for (let i = 0, r = t.length; i < r; i++) {const r = t[i];if (n[r].get) {const t = ye(n[r].get.bind(s), void 0, !0);Object.defineProperty(e, r, { get: t });}if (n[r].set) {const t = n[r].set,i = e => xe(() => t.call(s, e));Object.defineProperty(e, r, { set: i });}}}return s;}function Ke(e) {return null != e && "object" == typeof e && (!e.__proto__ || e.__proto__ === Object.prototype || Array.isArray(e));}function Ye(e, t) {let n, i, s, r;if (n = null != e && e[We]) return n;if (!Ke(e)) return e;if (Array.isArray(e)) {Object.isFrozen(e) && (e = e.slice(0));for (let n = 0, r = e.length; n < r; n++) s = e[n], (i = Ye(s, t)) !== s && (e[n] = i);} else {Object.isFrozen(e) && (e = Object.assign({}, e));let n = Object.keys(e),o = t && Object.getOwnPropertyDescriptors(e);for (let l = 0, a = n.length; l < a; l++) r = n[l], t && o[r].get || (s = e[r], (i = Ye(s, t)) !== s && (e[r] = i));}return e;}function Xe(e) {let t = e[Ue];return t || Object.defineProperty(e, Ue, { value: t = {} }), t;}function Je(e, t) {const n = Reflect.getOwnPropertyDescriptor(e, t);return !n || n.get || t === Ve || t === Ue || t === Ze || (delete n.value, delete n.writable, n.get = () => e[t]), n;}const Qe = { get: function (e, t, n) {if (t === We) return e;if (t === Ve) return n;const i = e[t];if (t === Ue || "__proto__" === t) return i;const s = Ke(i);if (ue && ("function" != typeof i || e.hasOwnProperty(t))) {let n, r;s && (n = Xe(i)) && (r = n._ || (n._ = be()), r[0]()), n = Xe(e), r = n[t] || (n[t] = be()), r[0]();}return s ? Ge(i) : i;}, set: function () {return !0;}, deleteProperty: function () {return !0;}, getOwnPropertyDescriptor: Je };function et(e, t, n) {if (e[t] === n) return;const i = Array.isArray(e) || !(t in e);void 0 === n ? delete e[t] : e[t] = n;let s,r = Xe(e);(s = r[t]) && s[1](n), i && (s = r._) && s[1]();}function tt(e, t, n = []) {let i,s = e;if (t.length > 1) {i = t.shift();const r = typeof i,o = Array.isArray(e);if (Array.isArray(i)) {for (let s = 0; s < i.length; s++) tt(e, [i[s]].concat(t), [i[s]].concat(n));return;}if (o && "function" === r) {for (let s = 0; s < e.length; s++) i(e[s], s) && tt(e, [s].concat(t), [s].concat(n));return;}if (o && "object" === r) {const { from: s = 0, to: r = e.length - 1, by: o = 1 } = i;for (let i = s; i <= r; i += o) tt(e, [i].concat(t), [i].concat(n));return;}if (t.length > 1) return void tt(e[i], t, [i].concat(n));s = e[i], n = [i].concat(n);}let r = t[0];"function" == typeof r && (r = r(s, n), r === s) || void 0 === i && null == r || (r = Ye(r), void 0 === i || Ke(s) && Ke(r) && !Array.isArray(r) ? function (e, t) {const n = Object.keys(t);for (let i = 0; i < n.length; i += 1) {const s = n[i];et(e, s, t[s]);}}(s, r) : et(e, i, r));}function nt(e, t) {const n = Ye(e || {}, !0);return [Ge(n, 0, !0), function (...e) {xe(() => tt(n, e));}];}const it = Symbol("fallback");function st(e, t) {return _e(() => e(t));}function rt(e) {const t = "fallback" in e && { fallback: () => e.fallback };return ye(function (e, t, n = {}) {let i = [],s = [],r = [],o = 0,l = t.length > 1 ? [] : null,a = ce;return Pe(() => {for (let e = 0, t = r.length; e < t; e++) r[e]();}), () => {let c,u,d = e() || [];return _e(() => {let e,t,p,f,g,m,v,b,w,k = d.length;if (0 === k) {if (0 !== o) {for (c = 0; c < o; c++) r[c]();r = [], i = [], s = [], o = 0, l && (l = []);}n.fallback && (i = [it], s[0] = ve(e => (r[0] = e, n.fallback()), a), o = 1);} else if (0 === o) {for (u = 0; u < k; u++) i[u] = d[u], s[u] = ve(h, a);o = k;} else {for (p = new Array(k), f = new Array(k), l && (g = new Array(k)), m = 0, v = Math.min(o, k); m < v && i[m] === d[m]; m++);for (v = o - 1, b = k - 1; v >= m && b >= m && i[v] === d[b]; v--, b--) p[b] = s[v], f[b] = r[v], l && (g[b] = l[v]);for (e = new Map(), t = new Array(b + 1), u = b; u >= m; u--) w = d[u], c = e.get(w), t[u] = void 0 === c ? -1 : c, e.set(w, u);for (c = m; c <= v; c++) w = i[c], u = e.get(w), void 0 !== u && -1 !== u ? (p[u] = s[c], f[u] = r[c], l && (g[u] = l[c]), u = t[u], e.set(w, u)) : r[c]();for (u = m; u < k; u++) u in p ? (s[u] = p[u], r[u] = f[u], l && (l[u] = g[u], l[u](u))) : s[u] = ve(h, a);o = s.length = k, i = d.slice(0);}return s;});function h(e) {if (r[u] = e, l) {const [e, n] = be(u, !0);return l[u] = n, t(d[u], e);}return t(d[u]);}};}(() => e.each, e.children, t || void 0));}Ee();new Set(["className", "indeterminate", "value", "allowfullscreen", "allowpaymentrequest", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "ismap", "itemscope", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected", "truespeed"]), new Set(["innerHTML", "textContent", "innerText", "children"]), new Set(["abort", "animationstart", "animationend", "animationiteration", "blur", "change", "copy", "cut", "error", "focus", "gotpointercapture", "load", "loadend", "loadstart", "lostpointercapture", "mouseenter", "mouseleave", "paste", "pointerenter", "pointerleave", "progress", "reset", "scroll", "select", "submit", "toggle", "transitionstart", "transitioncancel", "transitionend", "transitionrun"]), new Set(["altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "set", "stop", "svg", "switch", "symbol", "text", "textPath", "tref", "tspan", "use", "view", "vkern"]);function ot(e, t) {return ye(e, void 0, t);}function lt(e, t, n) {let i = n.length,s = t.length,r = i,o = 0,l = 0,a = t[s - 1].nextSibling,c = null;for (; o < s || l < r;) if (s === o) {const t = r < i ? l ? n[l - 1].nextSibling : n[r - l] : a;for (; l < r;) e.insertBefore(n[l++], t);} else if (r === l) for (; o < s;) c && c.has(t[o]) || e.removeChild(t[o]), o++;else if (t[o] === n[l]) o++, l++;else if (t[s - 1] === n[r - 1]) s--, r--;else if (t[o] === n[r - 1] && n[l] === t[s - 1]) {const i = t[--s].nextSibling;e.insertBefore(n[l++], t[o++].nextSibling), e.insertBefore(n[--r], i), t[s] = n[r];} else {if (!c) {c = new Map();let e = l;for (; e < r;) c.set(n[e], e++);}const i = c.get(t[o]);if (null != i) {if (l < i && i < r) {let a,u = o,d = 1;for (; ++u < s && u < r && null != (a = c.get(t[u])) && a === i + d;) d++;if (d > i - l) {const s = t[o];for (; l < i;) e.insertBefore(n[l++], s);} else e.replaceChild(n[l++], t[o++]);} else o++;} else e.removeChild(t[o++]);}}const at = new Set();let ct = null;function ut(e, t, n) {let i;return ve(s => {i = s, gt(t, e(), t.firstChild ? null : void 0, n);}), () => {i(), t.textContent = "";};}function dt(e, t, n) {const i = document.createElement("template");if (i.innerHTML = e, t && i.innerHTML.split("<").length - 1 !== t) throw `Template html does not match input:\n${i.innerHTML}\n\n${e}`;let s = i.content.firstChild;return n && (s = s.firstChild), s;}function ht(e) {for (let t = 0, n = e.length; t < n; t++) {const n = e[t];at.has(n) || (at.add(n), document.addEventListener(n, mt));}}function pt(e, t, n) {!1 === n || null == n ? e.removeAttribute(t) : e.setAttribute(t, n);}function ft(e, t, n) {const i = e.style;if ("string" == typeof t) return i.cssText = t;let s, r;if (null != n && "string" != typeof n) {for (r in t) s = t[r], s !== n[r] && i.setProperty(r, s);for (r in n) null == t[r] && i.removeProperty(r);} else for (r in t) i.setProperty(r, t[r]);return t;}function gt(e, t, n, i) {if (void 0 === n || i || (i = []), "function" != typeof t) return vt(e, t, i, n);ke(i => vt(e, t(), i, n), i);}function mt(e) {const t = `__${e.type}`;let n = e.composedPath && e.composedPath()[0] || e.target;for (e.target !== n && Object.defineProperty(e, "target", { configurable: !0, value: n }), Object.defineProperty(e, "currentTarget", { configurable: !0, get: function () {return n;} }); null !== n;) {const i = n[t];if (i) {const s = n[`${t}Data`];if (void 0 !== s ? i(s, e) : i(e), e.cancelBubble) return;}n = n.host && n.host !== n && n.host instanceof Node ? n.host : n.parentNode;}}function vt(e, t, n, i, s) {for (; "function" == typeof n;) n = n();if (t === n) return n;const r = typeof t,o = void 0 !== i;if (e = o && n[0] && n[0].parentNode || e, "string" === r || "number" === r) {if ("number" === r && (t = t.toString()), o) {let s = n[0];s && 3 === s.nodeType ? s.data = t : s = document.createTextNode(t), n = kt(e, n, i, s);} else n = "" !== n && "string" == typeof n ? e.firstChild.data = t : e.textContent = t;} else if (null == t || "boolean" === r) {if (ct && ct.context && ct.context.registry) return n;n = kt(e, n, i);} else {if ("function" === r) return ke(() => {let s = t();for (; "function" == typeof s;) s = s();n = vt(e, s, n, i);}), () => n;if (Array.isArray(t)) {const r = [];if (bt(r, t, s)) return ke(() => n = vt(e, r, n, i, !0)), () => n;if (ct && ct.context && ct.context.registry && n.length) return n;if (0 === r.length) {if (n = kt(e, n, i), o) return n;} else Array.isArray(n) ? 0 === n.length ? wt(e, r, i) : lt(e, n, r) : null == n || "" === n ? wt(e, r) : lt(e, o && n || [e.firstChild], r);n = r;} else if (t instanceof Node) {if (Array.isArray(n)) {if (o) return n = kt(e, n, i, t);kt(e, n, null, t);} else null != n && "" !== n && e.firstChild ? e.replaceChild(t, e.firstChild) : e.appendChild(t);n = t;} else console.warn("Skipped inserting", t);}return n;}function bt(e, t, n) {let i = !1;for (let s = 0, r = t.length; s < r; s++) {let r,o = t[s];if (o instanceof Node) e.push(o);else if (null == o || !0 === o || !1 === o) ;else if (Array.isArray(o)) i = bt(e, o) || i;else if ("string" == (r = typeof o)) e.push(document.createTextNode(o));else if ("function" === r) {if (n) {for (; "function" == typeof o;) o = o();i = bt(e, Array.isArray(o) ? o : [o]) || i;} else e.push(o), i = !0;} else e.push(document.createTextNode(o.toString()));}return i;}function wt(e, t, n) {for (let i = 0, s = t.length; i < s; i++) e.insertBefore(t[i], n);}function kt(e, t, n, i) {if (void 0 === n) return e.textContent = "";const s = i || document.createTextNode("");if (t.length) {let i = !1;for (let r = t.length - 1; r >= 0; r--) {const o = t[r];if (s !== o) {const t = o.parentNode === e;i || r ? t && e.removeChild(o) : t ? e.replaceChild(s, o) : e.insertBefore(s, n);} else i = !0;}} else e.insertBefore(s, n);return [s];}var yt = {},xt = dt;Object.defineProperty(yt, "__esModule", { value: !0 });var _t = function (e) {const [t, n] = be(e.delegate.filteredMessages);Se(() => {e.delegate.onDidChangeMessages(e => {n(e);});});const i = [{ id: "severity", label: "Severity" }, { id: "linterName", label: "Provider" }, { id: "excerpt", label: "Description", onClick: Ft, sortable: !1 }, { id: "line", label: "Line", onClick: Ft }];"Entire Project" === e.delegate.panelRepresents && i.push({ id: "file", label: "File", onClick: Ft });return (() => {const e = jt.cloneNode(!0);return pt(e, "tabindex", -1), e.style.setProperty("overflowY", "scroll"), e.style.setProperty("height", "100%"), gt(e, st(Mt, { get rows() {return t();}, columns: i, defaultSortDirection: ["severity", "asc"], rowSorter: S.sortMessages, accessors: !0, getRowID: e => e.key, bodyRenderer: Bt, style: { width: "100%" }, className: "linter dark" })), e;})();};yt.PanelComponent = _t;const St = dt("<table><thead><tr></tr></thead><tbody></tbody></table>", 8),Pt = dt("<th></th>", 2),Et = dt("<tr></tr>", 2),Ct = dt("<td></td>", 2),Tt = dt('<span class="sort-icon"></span>', 2);function Mt(e) {var t;const [n, i] = be(),[s, r] = be(e.rows);function o() {const t = n();return void 0 !== t ? t : void 0 !== e.defaultSortDirection ? e.defaultSortDirection : [null, null];}we(() => {r(e.rows);});const l = null !== (t = e.rowSorter) && void 0 !== t ? t : Rt;function a() {const t = o();null === t[0] && void 0 !== e.defaultSortDirection ? r(l(s(), e.defaultSortDirection)) : null !== t[0] && r(l(s(), t));}const { headerRenderer: c = zt, bodyRenderer: u = It, getRowID: d = Dt, accessors: h } = e;return void 0 === e.columns && (e.columns = function (e, t = 0) {const n = e[t],i = Object.keys(n),s = i.length,r = new Array(s);for (let e = 0; e < s; e++) r[e] = { id: i[e] };return r;}(e.rows, e.representitiveRowNumber)), a(), (() => {const t = St.cloneNode(!0),n = t.firstChild,r = n.firstChild,l = n.nextSibling;return gt(r, st(rt, { get each() {return e.columns;}, children: e => {const t = !1 !== e.sortable;return (() => {const n = Pt.cloneNode(!0);var s;return n.__click = t ? (s = e.id, e => {i(function (e, t, n) {const i = e[0],s = e[1];return n ? e = [null, null] : i === t ? e[1] = "asc" === s ? "desc" : "asc" : e = [t, "asc"], e;}(o(), s, e.shiftKey)), a();}) : void 0, n.className = t ? "sortable" : void 0, gt(n, () => c(e), null), gt(n, () => t ? function (e, t) {let n;return n = null === e[0] || e[0] !== t ? $t : "asc" === e[1] ? At : Ot, (() => {const e = Tt.cloneNode(!0);return gt(e, n), e;})();}(o(), e.id) : void 0, null), ke(() => pt(n, "id", h ? String(e.id) : void 0)), n;})();} })), gt(l, st(rt, { get each() {return s();}, children: t => {const n = function (e) {return h ? d(e) : void 0;}(t);return (() => {const i = Et.cloneNode(!0);return pt(i, "id", n), gt(i, st(rt, { get each() {return e.columns;}, children: e => (() => {const i = Ct.cloneNode(!0);return i.__click = void 0 !== e.onClick ? n => e.onClick(n, t) : void 0, gt(i, () => u(t, e.id)), ke(() => pt(i, "id", n ? `${n}.${e.id}` : void 0)), i;})() })), i;})();} })), ke(n => {var i;const s = `solid-simple-table ${null !== (i = e.className) && void 0 !== i ? i : ""}`,r = e.style;return s !== n._v$ && (t.className = n._v$ = s), n._v$2 = ft(t, r, n._v$2), n;}, { _v$: void 0, _v$2: void 0 }), t;})();}const Ot = "↑",At = "↓",$t = "⇅";function Lt(e) {return "string" == typeof e ? e : JSON.stringify(e);}function zt(e) {var t;return null !== (t = e.label) && void 0 !== t ? t : e.id;}function It(e, t) {return Lt("object" == typeof e ? e[t] : e);}function Dt(e) {return Lt(e);}function Rt(e, t) {if (!e.length) return e;const n = t[0];return e = "object" == typeof e[0] ? e.sort((e, t) => {const i = e[n],s = t[n];return i == s ? 0 : i < s ? -1 : 1;}) : e.sort(), "desc" === t[1] ? e.reverse() : e;}ht(["click"]);const jt = xt('<div id="linter-panel"></div>', 2),Nt = xt("<div></div>", 2);function Bt(e, t) {const n = (0, S.$range)(e);switch (t) {case "file":return (0, S.getPathOfMessage)(e);case "line":return n ? `${n.start.row + 1}:${n.start.column + 1}` : "";case "excerpt":return e.excerpt;case "severity":return (() => {const t = Nt.cloneNode(!0);return gt(t, () => S.severityNames[e.severity]), ke(() => t.className = `solid-simple-table linter ${e.severity}`), t;})();default:return e[t];}}function Ft(e, t) {"A" !== e.target.tagName && (("darwin" === process.platform ? e.metaKey : e.ctrlKey) ? e.shiftKey ? (0, S.openExternally)(t) : (0, S.visitMessage)(t, !0) : (0, S.visitMessage)(t));}function qt(e) {const t = atom.workspace.paneContainerForItem(e);return t && "object" == typeof t.state && "number" == typeof t.state.size && "function" == typeof t.render ? t : null;}te = class {constructor(e) {this.element = document.createElement("div"), this.subscriptions = new a(), this.panelHeight = 100, this.alwaysTakeMinimumSpace = !0, this.lastSetPaneHeight = void 0, this.subscriptions.add(atom.config.observe("linter-ui-default.panelHeight", e => {const t = "number" == typeof this.panelHeight;this.panelHeight = e, t && this.doPanelResize(!0);}), atom.config.observe("linter-ui-default.alwaysTakeMinimumSpace", e => {this.alwaysTakeMinimumSpace = e;})), this.doPanelResize(), ut(() => st(yt.PanelComponent, { delegate: e }), this.element);}doPanelResize(e = !1) {const t = qt(this);if (null === t) return;let n = null;const i = atom.views.getView(t);if (i && this.alwaysTakeMinimumSpace) {const e = i.querySelector(".list-inline.tab-bar.inset-panel"),t = e ? e.getClientRects()[0] : null,s = this.element.querySelector("table"),r = s ? s.getClientRects()[0] : null;t && r && (n = t.height + r.height + 1);}let s = null;const r = null === n || e ? this.panelHeight : Math.min(n, this.panelHeight);null === this.lastSetPaneHeight || t.state.size === this.lastSetPaneHeight || e || (s = t.state.size), this.lastSetPaneHeight = r, t.state.size = r, t.render(t.state), null !== s && atom.config.set("linter-ui-default.panelHeight", s);}getURI() {return S.WORKSPACE_URI;}getTitle() {return "Linter";}getDefaultLocation() {return S.DOCK_DEFAULT_LOCATION;}getAllowedLocations() {return S.DOCK_ALLOWED_LOCATIONS;}getPreferredHeight() {return atom.config.get("linter-ui-default.panelHeight");}dispose() {this.subscriptions.dispose();const e = qt(this);var t;null === e || this.alwaysTakeMinimumSpace || e.state.size === this.panelHeight || (atom.config.set("linter-ui-default.panelHeight", e.state.size), null === (t = e.paneForItem(this)) || void 0 === t || t.destroyItem(this, !0));}}, ee.default = te;var Ht = Wt(ee = ee.default);function Wt(e) {return e && e.__esModule ? e : { default: e };}y = class {constructor() {this.panel = null, this.element = document.createElement("div"), this.delegate = new Q.default(), this.messages = [], this.deactivating = !1, this.subscriptions = new a(), this.showPanelConfig = !0, this.hidePanelWhenEmpty = !0, this.showPanelStateMessages = !1, this.activationTimer = void 0, this.subscriptions.add(this.delegate, atom.config.observe("linter-ui-default.hidePanelWhenEmpty", e => {this.hidePanelWhenEmpty = e, this.refresh();}), atom.workspace.onDidDestroyPane(({ pane: e }) => {(null === this.panel || e.getItems().includes(this.panel)) && !this.deactivating && (this.panel = null, atom.config.set("linter-ui-default.showPanel", !1));}), atom.workspace.onDidDestroyPaneItem(({ item: e }) => {e instanceof Ht.default && !this.deactivating && (this.panel = null, atom.config.set("linter-ui-default.showPanel", !1));}), atom.config.observe("linter-ui-default.showPanel", e => {this.showPanelConfig = e, this.refresh();}), atom.workspace.getCenter().observeActivePaneItem(() => {this.showPanelStateMessages = Boolean(this.delegate.filteredMessages.length), this.refresh();})), this.activationTimer = window.requestIdleCallback(() => {let e = !0;const t = atom.workspace.getBottomDock();this.subscriptions.add(t.onDidChangeActivePaneItem(t => {if (!this.panel || "bottom" !== this.getPanelLocation()) return;if (e) return void (e = !1);t === this.panel !== this.showPanelConfig && atom.config.set("linter-ui-default.showPanel", !this.showPanelConfig);}), t.onDidChangeVisible(e => {if (!this.panel || "bottom" !== this.getPanelLocation()) return;if (!e && this.showPanelConfig && this.hidePanelWhenEmpty && !this.showPanelStateMessages) return;if (t.getActivePaneItem() !== this.panel) return;e !== this.showPanelConfig && atom.config.set("linter-ui-default.showPanel", !this.showPanelConfig);})), this.activate();});}getPanelLocation() {if (!this.panel) return null;const e = atom.workspace.paneContainerForItem(this.panel);return e && e.location || null;}async activate() {this.panel || (this.panel = new Ht.default(this.delegate), await atom.workspace.open(this.panel, { activatePane: !1, activateItem: !1, searchAllPanes: !0 }), this.update(), this.refresh());}update(e = null) {e && (this.messages = e), this.delegate.update(this.messages), this.showPanelStateMessages = Boolean(this.delegate.filteredMessages.length), this.refresh();}async refresh() {const e = this.panel;if (null === e) return void (this.showPanelConfig && (await this.activate()));const t = atom.workspace.paneContainerForItem(e);if (!t || "bottom" !== t.location) return;const n = t.getActivePaneItem() === e,i = this.showPanelConfig,s = !this.hidePanelWhenEmpty || this.showPanelStateMessages;if (i && s) {var r;if (!n) null === (r = t.paneForItem(e)) || void 0 === r || r.activateItem(e);t.show(), e.doPanelResize();} else n && t.hide();}dispose() {this.deactivating = !0, this.panel && this.panel.dispose(), this.subscriptions.dispose(), window.cancelIdleCallback(this.activationTimer);}}, k.default = y;var Ut = Js(k = k.default),Vt = {};Object.defineProperty(Vt, "__esModule", { value: !0 });var Zt = void 0;Vt.default = Zt;var Gt,Kt = (Gt = r) && Gt.__esModule ? Gt : { default: Gt };Zt = class {constructor() {this.messages = [], this.subscriptions = new a(), this.subscriptions.add(atom.commands.add("atom-workspace", { "linter-ui-default:next": () => this.move(!0, !0), "linter-ui-default:previous": () => this.move(!1, !0), "linter-ui-default:next-error": () => this.move(!0, !0, "error"), "linter-ui-default:previous-error": () => this.move(!1, !0, "error"), "linter-ui-default:next-warning": () => this.move(!0, !0, "warning"), "linter-ui-default:previous-warning": () => this.move(!1, !0, "warning"), "linter-ui-default:next-info": () => this.move(!0, !0, "info"), "linter-ui-default:previous-info": () => this.move(!1, !0, "info"), "linter-ui-default:next-in-current-file": () => this.move(!0, !1), "linter-ui-default:previous-in-current-file": () => this.move(!1, !1), "linter-ui-default:next-error-in-current-file": () => this.move(!0, !1, "error"), "linter-ui-default:previous-error-in-current-file": () => this.move(!1, !1, "error"), "linter-ui-default:next-warning-in-current-file": () => this.move(!0, !1, "warning"), "linter-ui-default:previous-warning-in-current-file": () => this.move(!1, !1, "warning"), "linter-ui-default:next-info-in-current-file": () => this.move(!0, !1, "info"), "linter-ui-default:previous-info-in-current-file": () => this.move(!1, !1, "info"), "linter-ui-default:toggle-panel": () => {atom.config.set("linter-ui-default.showPanel", !atom.config.get("linter-ui-default.showPanel"));}, "linter-ui-default:expand-tooltip": function () {}, "linter-ui-default:collapse-tooltip": function () {} }), atom.commands.add("atom-text-editor:not([mini])", { "linter-ui-default:apply-all-solutions": () => this.applyAllSolutions() }), atom.commands.add("#linter-panel", { "core:copy": () => {const e = document.getSelection();e && atom.clipboard.write(e.toString());} }));}applyAllSolutions() {const e = (0, S.getActiveTextEditor)();(0, Kt.default)(e, "textEditor was null on a command supposed to run on text-editors only");(0, S.sortMessages)((0, S.filterMessages)(this.messages, e.getPath()), ["line", "desc"]).forEach(function (t) {2 === t.version && t.solutions && t.solutions.length && (0, S.applySolution)(e, (0, S.sortSolutions)(t.solutions)[0]);});}move(e, t, n = null) {const i = (0, S.getActiveTextEditor)(),s = i && i.getPath() || NaN,r = (0, S.sortMessages)((0, S.filterMessages)(this.messages, t ? null : s, n), ["file", "asc"]),o = e ? -1 : 1;if (!i) {const t = e ? r[0] : r[r.length - 1];return void (t && (0, S.visitMessage)(t));}const l = i.getCursorBufferPosition();e || r.reverse();let a = null,c = !1;for (let e = 0, t = r.length; e < t; e++) {const t = r[e],n = (0, S.$file)(t),i = (0, S.$range)(t);if (c || n !== s || (c = !0), n && i) {if (c && n !== s) {a = t;break;}if (n === s && l.compare(i.start) === o) {a = t;break;}}}!a && r.length && (a = r[0]), a && (0, S.visitMessage)(a);}update(e) {this.messages = e;}dispose() {this.subscriptions.dispose();}}, Vt.default = Zt;var Yt = Js(Vt = Vt.default),Xt = {};Object.defineProperty(Xt, "__esModule", { value: !0 });var Jt = void 0;Xt.default = Jt;var Qt = {};Object.defineProperty(Qt, "__esModule", { value: !0 });var en = void 0;Qt.default = en;var tn = {};Object.defineProperty(tn, "__esModule", { value: !0 });var nn = function (e) {const t = document.createElement("a");return t.classList.add(`icon-${e}`), t.appendChild(document.createTextNode("")), t;};tn.getElement = nn;var sn = function (e) {if (e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = rn();if (t && t.has(e)) return t.get(e);var n = {},i = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var s in e) if (Object.prototype.hasOwnProperty.call(e, s)) {var r = i ? Object.getOwnPropertyDescriptor(e, s) : null;r && (r.get || r.set) ? Object.defineProperty(n, s, r) : n[s] = e[s];}n.default = e, t && t.set(e, n);return n;}(tn);function rn() {if ("function" != typeof WeakMap) return null;var e = new WeakMap();return rn = function () {return e;}, e;}en = class {constructor() {this.item = document.createElement("div"), this.itemErrors = sn.getElement("stop"), this.itemWarnings = sn.getElement("alert"), this.itemInfos = sn.getElement("info"), this.emitter = new c(), this.subscriptions = new a(), this.item.appendChild(this.itemErrors), this.item.appendChild(this.itemWarnings), this.item.appendChild(this.itemInfos), this.item.classList.add("inline-block"), this.item.classList.add("linter-status-count"), this.subscriptions.add(this.emitter, atom.tooltips.add(this.itemErrors, { title: "Linter Errors" }), atom.tooltips.add(this.itemWarnings, { title: "Linter Warnings" }), atom.tooltips.add(this.itemInfos, { title: "Linter Infos" })), this.itemErrors.onclick = () => this.emitter.emit("click", "error"), this.itemWarnings.onclick = () => this.emitter.emit("click", "warning"), this.itemInfos.onclick = () => this.emitter.emit("click", "info"), this.update(0, 0, 0);}setVisibility(e, t) {t ? this.item.classList.remove(`hide-${e}`) : this.item.classList.add(`hide-${e}`);}update(e, t, n) {this.itemErrors.childNodes[0].textContent = String(e), this.itemWarnings.childNodes[0].textContent = String(t), this.itemInfos.childNodes[0].textContent = String(n), e ? this.itemErrors.classList.add("text-error") : this.itemErrors.classList.remove("text-error"), t ? this.itemWarnings.classList.add("text-warning") : this.itemWarnings.classList.remove("text-warning"), n ? this.itemInfos.classList.add("text-info") : this.itemInfos.classList.remove("text-info");}onDidClick(e) {return this.emitter.on("click", e);}dispose() {this.subscriptions.dispose();}}, Qt.default = en;var on = function (e) {return e && e.__esModule ? e : { default: e };}(Qt = Qt.default);Jt = class {constructor() {this.element = new on.default(), this.messages = [], this.subscriptions = new a(), this.statusBarRepresents = void 0, this.statusBarClickBehavior = void 0, this.subscriptions.add(this.element, atom.config.observe("linter-ui-default.statusBarRepresents", e => {const t = void 0 !== this.statusBarRepresents;this.statusBarRepresents = e, t && this.update();}), atom.config.observe("linter-ui-default.statusBarClickBehavior", e => {const t = void 0 !== this.statusBarClickBehavior;this.statusBarClickBehavior = e, t && this.update();}), atom.config.observe("linter-ui-default.showStatusBar", e => {this.element.setVisibility("config", e);}), atom.workspace.getCenter().observeActivePaneItem(e => {const t = atom.workspace.isTextEditor(e);this.element.setVisibility("pane", t), t && "Current File" === this.statusBarRepresents && this.update();})), this.element.onDidClick(e => {const t = atom.views.getView(atom.workspace);if ("Toggle Panel" === this.statusBarClickBehavior) atom.commands.dispatch(t, "linter-ui-default:toggle-panel");else if ("Toggle Status Bar Scope" === this.statusBarClickBehavior) atom.config.set("linter-ui-default.statusBarRepresents", "Entire Project" === this.statusBarRepresents ? "Current File" : "Entire Project");else {const n = "Current File" === this.statusBarRepresents ? "-in-current-file" : "";atom.commands.dispatch(t, `linter-ui-default:next-${e}${n}`);}});}update(e = null) {e ? this.messages = e : e = this.messages;const t = { error: 0, warning: 0, info: 0 },n = (0, S.getActiveTextEditor)(),i = n && n.getPath() || NaN;e.forEach(e => {"Entire Project" !== this.statusBarRepresents && (0, S.$file)(e) !== i || ("error" === e.severity ? t.error++ : "warning" === e.severity ? t.warning++ : t.info++);}), this.element.update(t.error, t.warning, t.info);}attach(e) {let t = null;this.subscriptions.add(atom.config.observe("linter-ui-default.statusBarPosition", n => {t && t.destroy(), t = e[`add${n}Tile`]({ item: this.element.item, priority: "Left" === n ? 0 : 1e3 });})), this.subscriptions.add(new u(function () {t && t.destroy();}));}dispose() {this.subscriptions.dispose();}}, Xt.default = Jt;var ln = Js(Xt = Xt.default),an = {};Object.defineProperty(an, "__esModule", { value: !0 });var cn = void 0;an.default = cn;cn = class {constructor() {this.provider = void 0, this.executing = new Set(), this.providerTitles = new Set(), this.useBusySignal = !0, this.subscriptions = new a(), this.subscriptions.add(atom.config.observe("linter-ui-default.useBusySignal", e => {this.useBusySignal = e;}));}attach(e) {this.provider = e.create(), this.update();}update() {const e = this.provider;if (!e) return;if (!this.useBusySignal) return;const t = new Map(),n = new Set();for (const { filePath: e, linter: n } of this.executing) {let i = t.get(e);i || t.set(e, i = []), i.push(n.name);}for (const [i, s] of t) {const t = i ? ` on ${atom.project.relativizePath(i)[1]}` : "";s.forEach(i => {const s = `${i}${t}`;n.add(s), this.providerTitles.has(s) || (this.providerTitles.add(s), e.add(s));});}this.providerTitles.forEach(t => {n.has(t) || (e.remove(t), this.providerTitles.delete(t));}), t.clear();}getExecuting(e, t) {for (const n of this.executing) if (n.linter === e && n.filePath === t) return n;return null;}didBeginLinting(e, t) {this.getExecuting(e, t) || (this.executing.add({ linter: e, filePath: t }), this.update());}didFinishLinting(e, t) {const n = this.getExecuting(e, t);n && (this.executing.delete(n), this.update());}dispose() {this.provider && this.provider.clear(), this.providerTitles.clear(), this.executing.clear(), this.subscriptions.dispose();}}, an.default = cn;var un = Js(an = an.default),dn = {};Object.defineProperty(dn, "__esModule", { value: !0 });var hn = void 0;dn.default = hn;hn = class {constructor() {this.messages = [], this.grammarScopes = ["*"];}getIntentions({ textEditor: e, bufferPosition: t }) {let n = [];const i = (0, S.filterMessages)(this.messages, e.getPath());for (const s of i) {if (!(s.solutions && s.solutions.length)) continue;const i = (0, S.$range)(s);if (!(i && i.containsPoint(t))) continue;let r = [];2 === s.version && s.solutions && s.solutions.length && (r = s.solutions);const o = s.linterName || "Linter";n = n.concat(r.map(t => ({ priority: t.priority ? t.priority + 200 : 200, icon: "tools", title: t.title || `Fix ${o} issue`, selected: function () {(0, S.applySolution)(e, t);} })));}return n;}update(e) {this.messages = e;}}, dn.default = hn;var pn = Js(dn = dn.default),fn = {};Object.defineProperty(fn, "__esModule", { value: !0 });var gn = void 0;fn.default = gn;var mn = {};Object.defineProperty(mn, "__esModule", { value: !0 });var vn = void 0;mn.default = vn;var bn, wn;wn = function (e) {var t = typeof e;return null != e && ("object" == t || "function" == t);};var kn,yn = {},xn = "object" == typeof e && e && e.Object === Object && e,_n = "object" == typeof self && self && self.Object === Object && self,Sn = xn || _n || Function("return this")();kn = function () {return yn.Date.now();};var Pn,En = /\s/;var Cn = function (e) {for (var t = e.length; t-- && En.test(e.charAt(t)););return t;},Tn = /^\s+/;Pn = function (e) {return e ? e.slice(0, Cn(e) + 1).replace(Tn, "") : e;};var Mn,On,An = Mn = (yn = Sn).Symbol,$n = Object.prototype,Ln = $n.hasOwnProperty,zn = $n.toString,In = An ? An.toStringTag : void 0;On = function (e) {var t = Ln.call(e, In),n = e[In];try {e[In] = void 0;var i = !0;} catch (e) {}var s = zn.call(e);return i && (t ? e[In] = n : delete e[In]), s;};var Dn = Object.prototype.toString;var Rn = On,jn = function (e) {return Dn.call(e);},Nn = Mn ? Mn.toStringTag : void 0;var Bn = function (e) {return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : Nn && Nn in Object(e) ? Rn(e) : jn(e);},Fn = function (e) {return null != e && "object" == typeof e;};var qn = Pn,Hn = wn,Wn = function (e) {return "symbol" == typeof e || Fn(e) && "[object Symbol]" == Bn(e);},Un = /^[-+]0x[0-9a-f]+$/i,Vn = /^0b[01]+$/i,Zn = /^0o[0-7]+$/i,Gn = parseInt;var Kn = wn,Yn = kn,Xn = function (e) {if ("number" == typeof e) return e;if (Wn(e)) return NaN;if (Hn(e)) {var t = "function" == typeof e.valueOf ? e.valueOf() : e;e = Hn(t) ? t + "" : t;}if ("string" != typeof e) return 0 === e ? e : +e;e = qn(e);var n = Vn.test(e);return n || Zn.test(e) ? Gn(e.slice(2), n ? 2 : 8) : Un.test(e) ? NaN : +e;},Jn = Math.max,Qn = Math.min;var ei = Ls(bn = function (e, t, n) {var i,s,r,o,l,a,c = 0,u = !1,d = !1,h = !0;if ("function" != typeof e) throw new TypeError("Expected a function");function p(t) {var n = i,r = s;return i = s = void 0, c = t, o = e.apply(r, n);}function f(e) {return c = e, l = setTimeout(m, t), u ? p(e) : o;}function g(e) {var n = e - a;return void 0 === a || n >= t || n < 0 || d && e - c >= r;}function m() {var e = Yn();if (g(e)) return v(e);l = setTimeout(m, function (e) {var n = t - (e - a);return d ? Qn(n, r - (e - c)) : n;}(e));}function v(e) {return l = void 0, h && i ? p(e) : (i = s = void 0, o);}function b() {var e = Yn(),n = g(e);if (i = arguments, s = this, a = e, n) {if (void 0 === l) return f(a);if (d) return clearTimeout(l), l = setTimeout(m, t), p(a);}return void 0 === l && (l = setTimeout(m, t)), o;}return t = Xn(t) || 0, Kn(n) && (u = !!n.leading, r = (d = "maxWait" in n) ? Jn(Xn(n.maxWait) || 0, t) : r, h = "trailing" in n ? !!n.trailing : h), b.cancel = function () {void 0 !== l && clearTimeout(l), c = 0, i = a = s = l = void 0;}, b.flush = function () {return void 0 === l ? o : v(Yn());}, b;}),ti = Ls(s),ni = {},ii = dt;Object.defineProperty(ni, "__esModule", { value: !0 });var si = void 0;ni.default = si;var ri = {};Object.defineProperty(ri, "__esModule", { value: !0 });var oi = void 0;ri.default = oi;oi = class {constructor() {this.emitter = new c(), this.expanded = !1, this.subscriptions = new a(), this.showProviderName = void 0, this.subscriptions.add(this.emitter, atom.config.observe("linter-ui-default.showProviderName", e => {const t = void 0 !== this.showProviderName;this.showProviderName = e, t && this.emitter.emit("should-update");}), atom.commands.add("atom-workspace", { "linter-ui-default:expand-tooltip": e => {var t;this.expanded || (this.expanded = !0, this.emitter.emit("should-expand"), null != e && null !== (t = e.originalEvent) && void 0 !== t && t.isTrusted && document.body.addEventListener("keyup", function e() {document.body.removeEventListener("keyup", e), atom.commands.dispatch(atom.views.getView(atom.workspace), "linter-ui-default:collapse-tooltip");}, { passive: !0 }));}, "linter-ui-default:collapse-tooltip": () => {this.expanded = !1, this.emitter.emit("should-collapse");} }));}onShouldUpdate(e) {return this.emitter.on("should-update", e);}onShouldExpand(e) {return this.emitter.on("should-expand", e);}onShouldCollapse(e) {return this.emitter.on("should-collapse", e);}dispose() {this.emitter.dispose();}}, ri.default = oi;var li = Cs(ri = ri.default),ai = {},ci = dt,ui = ht;Object.defineProperty(ai, "__esModule", { value: !0 });var di = function (e) {const [t, n] = nt({ description: "", descriptionShow: !1 }),[i, s] = be(!1);async function r(o = null) {const l = !t.descriptionShow,a = t.description || e.message.description;if (l || o) {if ("string" == typeof a || o) {const e = (0, ts.default)(o || a);n({ description: e, descriptionShow: !0 });} else if ("function" == typeof a) {if (n({ ...t, descriptionShow: !0 }), i()) return;s(!0);const e = await a();if ("string" != typeof e) throw new Error("Expected result to be string, got: " + typeof e);try {await r(e);} catch (e) {console.log("[Linter] Error getting descriptions", e), s(!1), t.descriptionShow && (await r());}} else console.error("[Linter] Invalid description detected, expected string or function but got:", typeof a);} else n({ ...t, descriptionShow: !1 });}Se(() => {e.delegate.onShouldUpdate(() => {n({ description: "", descriptionShow: !1 });}), e.delegate.onShouldExpand(async () => {t.descriptionShow || (await r());}), e.delegate.onShouldCollapse(async () => {t.descriptionShow && (await r());});});const { message: o, delegate: l } = e;return (() => {const e = ls.cloneNode(!0),n = e.firstChild,i = n.firstChild,s = i.firstChild,a = i.nextSibling;return e.__click = ps, gt(n, (() => {const e = ot(() => !!o.description, !0);return () => e() && (() => {const e = as.cloneNode(!0),n = e.firstChild;return e.__click = () => r(), ke(() => n.className = "icon linter-icon icon-" + (t.descriptionShow ? "chevron-down" : "chevron-right")), e;})();})(), i), gt(n, (() => {const e = ot(() => !!function (e) {if (2 === e.version && e.solutions && e.solutions.length) return !0;return !1;}(o), !0);return () => e() && st(ns.FixButton, { onClick: () => function (e) {const t = (0, S.getActiveTextEditor)();null !== t && 2 === e.version && e.solutions && e.solutions.length && (0, S.applySolution)(t, (0, S.sortSolutions)(e.solutions)[0]);}(o) });})(), i), gt(s, () => l.showProviderName ? `${o.linterName}: ` : ""), gt(i, () => o.excerpt, null), gt(a, (() => {const e = ot(() => !(!o.reference || !o.reference.file), !0);return () => e() && (() => {const e = cs.cloneNode(!0);return e.__click = () => (0, S.visitMessage)(o, !0), e;})();})(), null), gt(a, (() => {const e = ot(() => !!o.url, !0);return () => e() && (() => {const e = us.cloneNode(!0);return e.__click = () => (0, S.openExternally)(o), e;})();})(), null), gt(e, (() => {const e = ot(() => !!t.descriptionShow, !0);return () => e() && (() => {const e = ds.cloneNode(!0);return ke(() => e.innerHTML = t.description || "Loading..."), e;})();})(), null), ke(() => n.className = `linter-excerpt ${o.severity}`), e;})();};ai.default = di;var hi,pi,fi = function (e) {if (e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = hs();if (t && t.has(e)) return t.get(e);var n = {},i = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var s in e) if (Object.prototype.hasOwnProperty.call(e, s)) {var r = i ? Object.getOwnPropertyDescriptor(e, s) : null;r && (r.get || r.set) ? Object.defineProperty(n, s, r) : n[s] = e[s];}n.default = e, t && t.set(e, n);return n;}(i),gi = {};function mi() {return { baseUrl: null, breaks: !1, gfm: !0, headerIds: !0, headerPrefix: "", highlight: null, langPrefix: "language-", mangle: !0, pedantic: !1, renderer: null, sanitize: !1, sanitizer: null, silent: !1, smartLists: !1, smartypants: !1, tokenizer: null, walkTokens: null, xhtml: !1 };}gi = { defaults: { baseUrl: null, breaks: !1, gfm: !0, headerIds: !0, headerPrefix: "", highlight: null, langPrefix: "language-", mangle: !0, pedantic: !1, renderer: null, sanitize: !1, sanitizer: null, silent: !1, smartLists: !1, smartypants: !1, tokenizer: null, walkTokens: null, xhtml: !1 }, getDefaults: mi, changeDefaults: function (e) {pi = e, gi.defaults = pi;} };var vi = {};const bi = /[&<>"']/,wi = /[&<>"']/g,ki = /[<>"']|&(?!#?\w+;)/,yi = /[<>"']|&(?!#?\w+;)/g,xi = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" },_i = e => xi[e];const Si = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Pi(e) {return e.replace(Si, (e, t) => "colon" === (t = t.toLowerCase()) ? ":" : "#" === t.charAt(0) ? "x" === t.charAt(1) ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : "");}const Ei = /(^|[^\[])\^/g;const Ci = /[^\w:]/g,Ti = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const Mi = {},Oi = /^[^:]+:\/*[^/]*$/,Ai = /^([^:]+:)[\s\S]*$/,$i = /^([^:]+:\/*[^/]*)[\s\S]*$/;function Li(e, t) {Mi[" " + e] || (Oi.test(e) ? Mi[" " + e] = e + "/" : Mi[" " + e] = zi(e, "/", !0));const n = -1 === (e = Mi[" " + e]).indexOf(":");return "//" === t.substring(0, 2) ? n ? t : e.replace(Ai, "$1") + t : "/" === t.charAt(0) ? n ? t : e.replace($i, "$1") + t : e + t;}function zi(e, t, n) {const i = e.length;if (0 === i) return "";let s = 0;for (; s < i;) {const r = e.charAt(i - s - 1);if (r !== t || n) {if (r === t || !n) break;s++;} else s++;}return e.substr(0, i - s);}function Ii(e, t, n) {const i = t.href,s = t.title ? vi.escape(t.title) : null,r = e[1].replace(/\\([\[\]])/g, "$1");return "!" !== e[0].charAt(0) ? { type: "link", raw: n, href: i, title: s, text: r } : { type: "image", raw: n, href: i, title: s, text: vi.escape(r) };}vi = { escape: function (e, t) {if (t) {if (bi.test(e)) return e.replace(wi, _i);} else if (ki.test(e)) return e.replace(yi, _i);return e;}, unescape: Pi, edit: function (e, t) {e = e.source || e, t = t || "";const n = { replace: (t, i) => (i = (i = i.source || i).replace(Ei, "$1"), e = e.replace(t, i), n), getRegex: () => new RegExp(e, t) };return n;}, cleanUrl: function (e, t, n) {if (e) {let e;try {e = decodeURIComponent(Pi(n)).replace(Ci, "").toLowerCase();} catch (e) {return null;}if (0 === e.indexOf("javascript:") || 0 === e.indexOf("vbscript:") || 0 === e.indexOf("data:")) return null;}t && !Ti.test(n) && (n = Li(t, n));try {n = encodeURI(n).replace(/%25/g, "%");} catch (e) {return null;}return n;}, resolveUrl: Li, noopTest: { exec: function () {} }, merge: function (e) {let t,n,i = 1;for (; i < arguments.length; i++) for (n in t = arguments[i], t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);return e;}, splitCells: function (e, t) {const n = e.replace(/\|/g, (e, t, n) => {let i = !1,s = t;for (; --s >= 0 && "\\" === n[s];) i = !i;return i ? "|" : " |";}).split(/ \|/);let i = 0;if (n.length > t) n.splice(t);else for (; n.length < t;) n.push("");for (; i < n.length; i++) n[i] = n[i].trim().replace(/\\\|/g, "|");return n;}, rtrim: zi, findClosingBracket: function (e, t) {if (-1 === e.indexOf(t[1])) return -1;const n = e.length;let i = 0,s = 0;for (; s < n; s++) if ("\\" === e[s]) s++;else if (e[s] === t[0]) i++;else if (e[s] === t[1] && (i--, i < 0)) return s;return -1;}, checkSanitizeDeprecation: function (e) {e && e.sanitize && !e.silent && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options");}, repeatString: function (e, t) {if (t < 1) return "";let n = "";for (; t > 1;) 1 & t && (n += e), t >>= 1, e += e;return n + e;} };const Di = hi = class {constructor(e) {this.options = e || pi;}space(e) {const t = this.rules.block.newline.exec(e);if (t) return t[0].length > 1 ? { type: "space", raw: t[0] } : { raw: "\n" };}code(e) {const t = this.rules.block.code.exec(e);if (t) {const e = t[0].replace(/^ {1,4}/gm, "");return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? e : vi.rtrim(e, "\n") };}}fences(e) {const t = this.rules.block.fences.exec(e);if (t) {const e = t[0],n = function (e, t) {const n = e.match(/^(\s+)(?:```)/);if (null === n) return t;const i = n[1];return t.split("\n").map(e => {const t = e.match(/^\s+/);if (null === t) return e;const [n] = t;return n.length >= i.length ? e.slice(i.length) : e;}).join("\n");}(e, t[3] || "");return { type: "code", raw: e, lang: t[2] ? t[2].trim() : t[2], text: n };}}heading(e) {const t = this.rules.block.heading.exec(e);if (t) {let e = t[2].trim();if (/#$/.test(e)) {const t = vi.rtrim(e, "#");this.options.pedantic ? e = t.trim() : t && !/ $/.test(t) || (e = t.trim());}return { type: "heading", raw: t[0], depth: t[1].length, text: e };}}nptable(e) {const t = this.rules.block.nptable.exec(e);if (t) {const e = { type: "table", header: vi.splitCells(t[1].replace(/^ *| *\| *$/g, "")), align: t[2].replace(/^ *|\| *$/g, "").split(/ *\| */), cells: t[3] ? t[3].replace(/\n$/, "").split("\n") : [], raw: t[0] };if (e.header.length === e.align.length) {let t,n = e.align.length;for (t = 0; t < n; t++) /^ *-+: *$/.test(e.align[t]) ? e.align[t] = "right" : /^ *:-+: *$/.test(e.align[t]) ? e.align[t] = "center" : /^ *:-+ *$/.test(e.align[t]) ? e.align[t] = "left" : e.align[t] = null;for (n = e.cells.length, t = 0; t < n; t++) e.cells[t] = vi.splitCells(e.cells[t], e.header.length);return e;}}}hr(e) {const t = this.rules.block.hr.exec(e);if (t) return { type: "hr", raw: t[0] };}blockquote(e) {const t = this.rules.block.blockquote.exec(e);if (t) {const e = t[0].replace(/^ *> ?/gm, "");return { type: "blockquote", raw: t[0], text: e };}}list(e) {const t = this.rules.block.list.exec(e);if (t) {let e = t[0];const n = t[2],i = n.length > 1,s = { type: "list", raw: e, ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] },r = t[0].match(this.rules.block.item);let o,l,a,c,u,d,h,p,f,g = !1,m = r.length;a = this.rules.block.listItemStart.exec(r[0]);for (let t = 0; t < m; t++) {if (o = r[t], e = o, this.options.pedantic || (f = o.match(new RegExp("\\n\\s*\\n {0," + (a[0].length - 1) + "}\\S")), f && (u = o.length - f.index + r.slice(t + 1).join("\n").length, s.raw = s.raw.substring(0, s.raw.length - u), o = o.substring(0, f.index), e = o, m = t + 1)), t !== m - 1) {if (c = this.rules.block.listItemStart.exec(r[t + 1]), this.options.pedantic ? c[1].length > a[1].length : c[1].length >= a[0].length || c[1].length > 3) {r.splice(t, 2, r[t] + (!this.options.pedantic && c[1].length < a[0].length && !r[t].match(/\n$/) ? "" : "\n") + r[t + 1]), t--, m--;continue;}(!this.options.pedantic || this.options.smartLists ? c[2][c[2].length - 1] !== n[n.length - 1] : i === (1 === c[2].length)) && (u = r.slice(t + 1).join("\n").length, s.raw = s.raw.substring(0, s.raw.length - u), t = m - 1), a = c;}l = o.length, o = o.replace(/^ *([*+-]|\d+[.)]) ?/, ""), ~o.indexOf("\n ") && (l -= o.length, o = this.options.pedantic ? o.replace(/^ {1,4}/gm, "") : o.replace(new RegExp("^ {1," + l + "}", "gm"), "")), o = vi.rtrim(o, "\n"), t !== m - 1 && (e += "\n"), d = g || /\n\n(?!\s*$)/.test(e), t !== m - 1 && (g = "\n\n" === e.slice(-2), d || (d = g)), d && (s.loose = !0), this.options.gfm && (h = /^\[[ xX]\] /.test(o), p = void 0, h && (p = " " !== o[1], o = o.replace(/^\[[ xX]\] +/, ""))), s.items.push({ type: "list_item", raw: e, task: h, checked: p, loose: d, text: o });}return s;}}html(e) {const t = this.rules.block.html.exec(e);if (t) return { type: this.options.sanitize ? "paragraph" : "html", raw: t[0], pre: !this.options.sanitizer && ("pre" === t[1] || "script" === t[1] || "style" === t[1]), text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(t[0]) : vi.escape(t[0]) : t[0] };}def(e) {const t = this.rules.block.def.exec(e);if (t) {t[3] && (t[3] = t[3].substring(1, t[3].length - 1));return { tag: t[1].toLowerCase().replace(/\s+/g, " "), raw: t[0], href: t[2], title: t[3] };}}table(e) {const t = this.rules.block.table.exec(e);if (t) {const e = { type: "table", header: vi.splitCells(t[1].replace(/^ *| *\| *$/g, "")), align: t[2].replace(/^ *|\| *$/g, "").split(/ *\| */), cells: t[3] ? t[3].replace(/\n$/, "").split("\n") : [] };if (e.header.length === e.align.length) {e.raw = t[0];let n,i = e.align.length;for (n = 0; n < i; n++) /^ *-+: *$/.test(e.align[n]) ? e.align[n] = "right" : /^ *:-+: *$/.test(e.align[n]) ? e.align[n] = "center" : /^ *:-+ *$/.test(e.align[n]) ? e.align[n] = "left" : e.align[n] = null;for (i = e.cells.length, n = 0; n < i; n++) e.cells[n] = vi.splitCells(e.cells[n].replace(/^ *\| *| *\| *$/g, ""), e.header.length);return e;}}}lheading(e) {const t = this.rules.block.lheading.exec(e);if (t) return { type: "heading", raw: t[0], depth: "=" === t[2].charAt(0) ? 1 : 2, text: t[1] };}paragraph(e) {const t = this.rules.block.paragraph.exec(e);if (t) return { type: "paragraph", raw: t[0], text: "\n" === t[1].charAt(t[1].length - 1) ? t[1].slice(0, -1) : t[1] };}text(e) {const t = this.rules.block.text.exec(e);if (t) return { type: "text", raw: t[0], text: t[0] };}escape(e) {const t = this.rules.inline.escape.exec(e);if (t) return { type: "escape", raw: t[0], text: vi.escape(t[1]) };}tag(e, t, n) {const i = this.rules.inline.tag.exec(e);if (i) return !t && /^<a /i.test(i[0]) ? t = !0 : t && /^<\/a>/i.test(i[0]) && (t = !1), !n && /^<(pre|code|kbd|script)(\s|>)/i.test(i[0]) ? n = !0 : n && /^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0]) && (n = !1), { type: this.options.sanitize ? "text" : "html", raw: i[0], inLink: t, inRawBlock: n, text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(i[0]) : vi.escape(i[0]) : i[0] };}link(e) {const t = this.rules.inline.link.exec(e);if (t) {const e = t[2].trim();if (!this.options.pedantic && /^</.test(e)) {if (!/>$/.test(e)) return;const t = vi.rtrim(e.slice(0, -1), "\\");if ((e.length - t.length) % 2 == 0) return;} else {const e = vi.findClosingBracket(t[2], "()");if (e > -1) {const n = (0 === t[0].indexOf("!") ? 5 : 4) + t[1].length + e;t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";}}let n = t[2],i = "";if (this.options.pedantic) {const e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e && (n = e[1], i = e[3]);} else i = t[3] ? t[3].slice(1, -1) : "";return n = n.trim(), /^</.test(n) && (n = this.options.pedantic && !/>$/.test(e) ? n.slice(1) : n.slice(1, -1)), Ii(t, { href: n ? n.replace(this.rules.inline._escapes, "$1") : n, title: i ? i.replace(this.rules.inline._escapes, "$1") : i }, t[0]);}}reflink(e, t) {let n;if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {let e = (n[2] || n[1]).replace(/\s+/g, " ");if (e = t[e.toLowerCase()], !e || !e.href) {const e = n[0].charAt(0);return { type: "text", raw: e, text: e };}return Ii(n, e, n[0]);}}emStrong(e, t, n = "") {let i = this.rules.inline.emStrong.lDelim.exec(e);if (!i) return;if (i[3] && n.match(/[\p{L}\p{N}]/u)) return;const s = i[1] || i[2] || "";if (!s || s && ("" === n || this.rules.inline.punctuation.exec(n))) {const n = i[0].length - 1;let s,r,o = n,l = 0;const a = "*" === i[0][0] ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd;for (a.lastIndex = 0, t = t.slice(-1 * e.length + n); null != (i = a.exec(t));) if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], s) if (r = s.length, i[3] || i[4]) o += r;else if (!((i[5] || i[6]) && n % 3) || (n + r) % 3) {if (o -= r, !(o > 0)) {if (o + l - r <= 0 && !t.slice(a.lastIndex).match(a) && (r = Math.min(r, r + o + l)), Math.min(n, r) % 2) return { type: "em", raw: e.slice(0, n + i.index + r + 1), text: e.slice(1, n + i.index + r) };if (Math.min(n, r) % 2 == 0) return { type: "strong", raw: e.slice(0, n + i.index + r + 1), text: e.slice(2, n + i.index + r - 1) };}} else l += r;}}codespan(e) {const t = this.rules.inline.code.exec(e);if (t) {let e = t[2].replace(/\n/g, " ");const n = /[^ ]/.test(e),i = /^ /.test(e) && / $/.test(e);return n && i && (e = e.substring(1, e.length - 1)), e = vi.escape(e, !0), { type: "codespan", raw: t[0], text: e };}}br(e) {const t = this.rules.inline.br.exec(e);if (t) return { type: "br", raw: t[0] };}del(e) {const t = this.rules.inline.del.exec(e);if (t) return { type: "del", raw: t[0], text: t[2] };}autolink(e, t) {const n = this.rules.inline.autolink.exec(e);if (n) {let e, i;return "@" === n[2] ? (e = vi.escape(this.options.mangle ? t(n[1]) : n[1]), i = "mailto:" + e) : (e = vi.escape(n[1]), i = e), { type: "link", raw: n[0], text: e, href: i, tokens: [{ type: "text", raw: e, text: e }] };}}url(e, t) {let n;if (n = this.rules.inline.url.exec(e)) {let e, i;if ("@" === n[2]) e = vi.escape(this.options.mangle ? t(n[0]) : n[0]), i = "mailto:" + e;else {let t;do {t = n[0], n[0] = this.rules.inline._backpedal.exec(n[0])[0];} while (t !== n[0]);e = vi.escape(n[0]), i = "www." === n[1] ? "http://" + e : e;}return { type: "link", raw: n[0], text: e, href: i, tokens: [{ type: "text", raw: e, text: e }] };}}inlineText(e, t, n) {const i = this.rules.inline.text.exec(e);if (i) {let e;return e = t ? this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(i[0]) : vi.escape(i[0]) : i[0] : vi.escape(this.options.smartypants ? n(i[0]) : i[0]), { type: "text", raw: i[0], text: e };}}};var Ri;const ji = { newline: /^(?: *(?:\n|$))+/, code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/, html: "^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))", def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, nptable: vi.noopTest, table: vi.noopTest, lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/, text: /^[^\n]+/, _label: /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/, _title: /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/ };ji.def = vi.edit(ji.def).replace("label", ji._label).replace("title", ji._title).getRegex(), ji.bullet = /(?:[*+-]|\d{1,9}[.)])/, ji.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/, ji.item = vi.edit(ji.item, "gm").replace(/bull/g, ji.bullet).getRegex(), ji.listItemStart = vi.edit(/^( *)(bull) */).replace("bull", ji.bullet).getRegex(), ji.list = vi.edit(ji.list).replace(/bull/g, ji.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + ji.def.source + ")").getRegex(), ji._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ji._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/, ji.html = vi.edit(ji.html, "i").replace("comment", ji._comment).replace("tag", ji._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ji.paragraph = vi.edit(ji._paragraph).replace("hr", ji.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag", ji._tag).getRegex(), ji.blockquote = vi.edit(ji.blockquote).replace("paragraph", ji.paragraph).getRegex(), ji.normal = vi.merge({}, ji), ji.gfm = vi.merge({}, ji.normal, { nptable: "^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)", table: "^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)" }), ji.gfm.nptable = vi.edit(ji.gfm.nptable).replace("hr", ji.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag", ji._tag).getRegex(), ji.gfm.table = vi.edit(ji.gfm.table).replace("hr", ji.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag", ji._tag).getRegex(), ji.pedantic = vi.merge({}, ji.normal, { html: vi.edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", ji._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: vi.noopTest, paragraph: vi.edit(ji.normal._paragraph).replace("hr", ji.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ji.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex() });const Ni = { escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: vi.noopTest, tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, reflinkSearch: "reflink|nolink(?!\\()", emStrong: { lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/, rDelimAst: /\_\_[^_]*?\*[^_]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/, rDelimUnd: /\*\*[^*]*?\_[^*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/ }, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: vi.noopTest, text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, punctuation: /^([\spunctuation])/ };function Bi(e) {return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");}function Fi(e) {let t,n,i = "";const s = e.length;for (t = 0; t < s; t++) n = e.charCodeAt(t), Math.random() > .5 && (n = "x" + n.toString(16)), i += "&#" + n + ";";return i;}Ni._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~", Ni.punctuation = vi.edit(Ni.punctuation).replace(/punctuation/g, Ni._punctuation).getRegex(), Ni.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g, Ni.escapedEmSt = /\\\*|\\_/g, Ni._comment = vi.edit(ji._comment).replace("(?:--\x3e|$)", "--\x3e").getRegex(), Ni.emStrong.lDelim = vi.edit(Ni.emStrong.lDelim).replace(/punct/g, Ni._punctuation).getRegex(), Ni.emStrong.rDelimAst = vi.edit(Ni.emStrong.rDelimAst, "g").replace(/punct/g, Ni._punctuation).getRegex(), Ni.emStrong.rDelimUnd = vi.edit(Ni.emStrong.rDelimUnd, "g").replace(/punct/g, Ni._punctuation).getRegex(), Ni._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g, Ni._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/, Ni._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/, Ni.autolink = vi.edit(Ni.autolink).replace("scheme", Ni._scheme).replace("email", Ni._email).getRegex(), Ni._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/, Ni.tag = vi.edit(Ni.tag).replace("comment", Ni._comment).replace("attribute", Ni._attribute).getRegex(), Ni._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ni._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/, Ni._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/, Ni.link = vi.edit(Ni.link).replace("label", Ni._label).replace("href", Ni._href).replace("title", Ni._title).getRegex(), Ni.reflink = vi.edit(Ni.reflink).replace("label", Ni._label).getRegex(), Ni.reflinkSearch = vi.edit(Ni.reflinkSearch, "g").replace("reflink", Ni.reflink).replace("nolink", Ni.nolink).getRegex(), Ni.normal = vi.merge({}, Ni), Ni.pedantic = vi.merge({}, Ni.normal, { strong: { start: /^__|\*\*/, middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, endAst: /\*\*(?!\*)/g, endUnd: /__(?!_)/g }, em: { start: /^_|\*/, middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/, endAst: /\*(?!\*)/g, endUnd: /_(?!_)/g }, link: vi.edit(/^!?\[(label)\]\((.*?)\)/).replace("label", Ni._label).getRegex(), reflink: vi.edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ni._label).getRegex() }), Ni.gfm = vi.merge({}, Ni.normal, { escape: vi.edit(Ni.escape).replace("])", "~|])").getRegex(), _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/ }), Ni.gfm.url = vi.edit(Ni.gfm.url, "i").replace("email", Ni.gfm._extended_email).getRegex(), Ni.breaks = vi.merge({}, Ni.gfm, { br: vi.edit(Ni.br).replace("{2,}", "*").getRegex(), text: vi.edit(Ni.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }), Ri = { block: ji, inline: Ni };const qi = class e {constructor(e) {this.tokens = [], this.tokens.links = Object.create(null), this.options = e || pi, this.options.tokenizer = this.options.tokenizer || new Di(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options;const t = { block: Ri.block.normal, inline: Ri.inline.normal };this.options.pedantic ? (t.block = Ri.block.pedantic, t.inline = Ri.inline.pedantic) : this.options.gfm && (t.block = Ri.block.gfm, this.options.breaks ? t.inline = Ri.inline.breaks : t.inline = Ri.inline.gfm), this.tokenizer.rules = t;}static get rules() {return { block: Ri.block, inline: Ri.inline };}static lex(t, n) {return new e(n).lex(t);}static lexInline(t, n) {return new e(n).inlineTokens(t);}lex(e) {return e = e.replace(/\r\n|\r/g, "\n").replace(/\t/g, "    "), this.blockTokens(e, this.tokens, !0), this.inline(this.tokens), this.tokens;}blockTokens(e, t = [], n = !0) {let i, s, r, o;for (this.options.pedantic && (e = e.replace(/^ +$/gm, "")); e;) if (i = this.tokenizer.space(e)) e = e.substring(i.raw.length), i.type && t.push(i);else if (i = this.tokenizer.code(e)) e = e.substring(i.raw.length), o = t[t.length - 1], o && "paragraph" === o.type ? (o.raw += "\n" + i.raw, o.text += "\n" + i.text) : t.push(i);else if (i = this.tokenizer.fences(e)) e = e.substring(i.raw.length), t.push(i);else if (i = this.tokenizer.heading(e)) e = e.substring(i.raw.length), t.push(i);else if (i = this.tokenizer.nptable(e)) e = e.substring(i.raw.length), t.push(i);else if (i = this.tokenizer.hr(e)) e = e.substring(i.raw.length), t.push(i);else if (i = this.tokenizer.blockquote(e)) e = e.substring(i.raw.length), i.tokens = this.blockTokens(i.text, [], n), t.push(i);else if (i = this.tokenizer.list(e)) {for (e = e.substring(i.raw.length), r = i.items.length, s = 0; s < r; s++) i.items[s].tokens = this.blockTokens(i.items[s].text, [], !1);t.push(i);} else if (i = this.tokenizer.html(e)) e = e.substring(i.raw.length), t.push(i);else if (n && (i = this.tokenizer.def(e))) e = e.substring(i.raw.length), this.tokens.links[i.tag] || (this.tokens.links[i.tag] = { href: i.href, title: i.title });else if (i = this.tokenizer.table(e)) e = e.substring(i.raw.length), t.push(i);else if (i = this.tokenizer.lheading(e)) e = e.substring(i.raw.length), t.push(i);else if (n && (i = this.tokenizer.paragraph(e))) e = e.substring(i.raw.length), t.push(i);else if (i = this.tokenizer.text(e)) e = e.substring(i.raw.length), o = t[t.length - 1], o && "text" === o.type ? (o.raw += "\n" + i.raw, o.text += "\n" + i.text) : t.push(i);else if (e) {const t = "Infinite loop on byte: " + e.charCodeAt(0);if (this.options.silent) {console.error(t);break;}throw new Error(t);}return t;}inline(e) {let t, n, i, s, r, o;const l = e.length;for (t = 0; t < l; t++) switch (o = e[t], o.type) {case "paragraph":case "text":case "heading":o.tokens = [], this.inlineTokens(o.text, o.tokens);break;case "table":for (o.tokens = { header: [], cells: [] }, s = o.header.length, n = 0; n < s; n++) o.tokens.header[n] = [], this.inlineTokens(o.header[n], o.tokens.header[n]);for (s = o.cells.length, n = 0; n < s; n++) for (r = o.cells[n], o.tokens.cells[n] = [], i = 0; i < r.length; i++) o.tokens.cells[n][i] = [], this.inlineTokens(r[i], o.tokens.cells[n][i]);break;case "blockquote":this.inline(o.tokens);break;case "list":for (s = o.items.length, n = 0; n < s; n++) this.inline(o.items[n].tokens);}return e;}inlineTokens(e, t = [], n = !1, i = !1) {let s,r,o,l,a,c = e;if (this.tokens.links) {const e = Object.keys(this.tokens.links);if (e.length > 0) for (; null != (o = this.tokenizer.rules.inline.reflinkSearch.exec(c));) e.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) && (c = c.slice(0, o.index) + "[" + vi.repeatString("a", o[0].length - 2) + "]" + c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));}for (; null != (o = this.tokenizer.rules.inline.blockSkip.exec(c));) c = c.slice(0, o.index) + "[" + vi.repeatString("a", o[0].length - 2) + "]" + c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for (; null != (o = this.tokenizer.rules.inline.escapedEmSt.exec(c));) c = c.slice(0, o.index) + "++" + c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for (; e;) if (l || (a = ""), l = !1, s = this.tokenizer.escape(e)) e = e.substring(s.raw.length), t.push(s);else if (s = this.tokenizer.tag(e, n, i)) {e = e.substring(s.raw.length), n = s.inLink, i = s.inRawBlock;const r = t[t.length - 1];r && "text" === s.type && "text" === r.type ? (r.raw += s.raw, r.text += s.text) : t.push(s);} else if (s = this.tokenizer.link(e)) e = e.substring(s.raw.length), "link" === s.type && (s.tokens = this.inlineTokens(s.text, [], !0, i)), t.push(s);else if (s = this.tokenizer.reflink(e, this.tokens.links)) {e = e.substring(s.raw.length);const n = t[t.length - 1];"link" === s.type ? (s.tokens = this.inlineTokens(s.text, [], !0, i), t.push(s)) : n && "text" === s.type && "text" === n.type ? (n.raw += s.raw, n.text += s.text) : t.push(s);} else if (s = this.tokenizer.emStrong(e, c, a)) e = e.substring(s.raw.length), s.tokens = this.inlineTokens(s.text, [], n, i), t.push(s);else if (s = this.tokenizer.codespan(e)) e = e.substring(s.raw.length), t.push(s);else if (s = this.tokenizer.br(e)) e = e.substring(s.raw.length), t.push(s);else if (s = this.tokenizer.del(e)) e = e.substring(s.raw.length), s.tokens = this.inlineTokens(s.text, [], n, i), t.push(s);else if (s = this.tokenizer.autolink(e, Fi)) e = e.substring(s.raw.length), t.push(s);else if (n || !(s = this.tokenizer.url(e, Fi))) {if (s = this.tokenizer.inlineText(e, i, Bi)) e = e.substring(s.raw.length), "_" !== s.raw.slice(-1) && (a = s.raw.slice(-1)), l = !0, r = t[t.length - 1], r && "text" === r.type ? (r.raw += s.raw, r.text += s.text) : t.push(s);else if (e) {const t = "Infinite loop on byte: " + e.charCodeAt(0);if (this.options.silent) {console.error(t);break;}throw new Error(t);}} else e = e.substring(s.raw.length), t.push(s);return t;}};var Hi;const Wi = Hi = class {constructor(e) {this.options = e || pi;}code(e, t, n) {const i = (t || "").match(/\S*/)[0];if (this.options.highlight) {const t = this.options.highlight(e, i);null != t && t !== e && (n = !0, e = t);}return e = e.replace(/\n$/, "") + "\n", i ? '<pre><code class="' + this.options.langPrefix + vi.escape(i, !0) + '">' + (n ? e : vi.escape(e, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? e : vi.escape(e, !0)) + "</code></pre>\n";}blockquote(e) {return "<blockquote>\n" + e + "</blockquote>\n";}html(e) {return e;}heading(e, t, n, i) {return this.options.headerIds ? "<h" + t + ' id="' + this.options.headerPrefix + i.slug(n) + '">' + e + "</h" + t + ">\n" : "<h" + t + ">" + e + "</h" + t + ">\n";}hr() {return this.options.xhtml ? "<hr/>\n" : "<hr>\n";}list(e, t, n) {const i = t ? "ol" : "ul";return "<" + i + (t && 1 !== n ? ' start="' + n + '"' : "") + ">\n" + e + "</" + i + ">\n";}listitem(e) {return "<li>" + e + "</li>\n";}checkbox(e) {return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"' + (this.options.xhtml ? " /" : "") + "> ";}paragraph(e) {return "<p>" + e + "</p>\n";}table(e, t) {return t && (t = "<tbody>" + t + "</tbody>"), "<table>\n<thead>\n" + e + "</thead>\n" + t + "</table>\n";}tablerow(e) {return "<tr>\n" + e + "</tr>\n";}tablecell(e, t) {const n = t.header ? "th" : "td";return (t.align ? "<" + n + ' align="' + t.align + '">' : "<" + n + ">") + e + "</" + n + ">\n";}strong(e) {return "<strong>" + e + "</strong>";}em(e) {return "<em>" + e + "</em>";}codespan(e) {return "<code>" + e + "</code>";}br() {return this.options.xhtml ? "<br/>" : "<br>";}del(e) {return "<del>" + e + "</del>";}link(e, t, n) {if (null === (e = vi.cleanUrl(this.options.sanitize, this.options.baseUrl, e))) return n;let i = '<a href="' + vi.escape(e) + '"';return t && (i += ' title="' + t + '"'), i += ">" + n + "</a>", i;}image(e, t, n) {if (null === (e = vi.cleanUrl(this.options.sanitize, this.options.baseUrl, e))) return n;let i = '<img src="' + e + '" alt="' + n + '"';return t && (i += ' title="' + t + '"'), i += this.options.xhtml ? "/>" : ">", i;}text(e) {return e;}};var Ui;const Vi = Ui = class {strong(e) {return e;}em(e) {return e;}codespan(e) {return e;}del(e) {return e;}html(e) {return e;}text(e) {return e;}link(e, t, n) {return "" + n;}image(e, t, n) {return "" + n;}br() {return "";}};var Zi;const Gi = Zi = class {constructor() {this.seen = {};}serialize(e) {return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-");}getNextSafeSlug(e, t) {let n = e,i = 0;if (this.seen.hasOwnProperty(n)) {i = this.seen[e];do {i++, n = e + "-" + i;} while (this.seen.hasOwnProperty(n));}return t || (this.seen[e] = i, this.seen[n] = 0), n;}slug(e, t = {}) {const n = this.serialize(e);return this.getNextSafeSlug(n, t.dryrun);}},Ki = class e {constructor(e) {this.options = e || pi, this.options.renderer = this.options.renderer || new Wi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Vi(), this.slugger = new Gi();}static parse(t, n) {return new e(n).parse(t);}static parseInline(t, n) {return new e(n).parseInline(t);}parse(e, t = !0) {let n,i,s,r,o,l,a,c,u,d,h,p,f,g,m,v,b,w,k = "";const y = e.length;for (n = 0; n < y; n++) switch (d = e[n], d.type) {case "space":continue;case "hr":k += this.renderer.hr();continue;case "heading":k += this.renderer.heading(this.parseInline(d.tokens), d.depth, vi.unescape(this.parseInline(d.tokens, this.textRenderer)), this.slugger);continue;case "code":k += this.renderer.code(d.text, d.lang, d.escaped);continue;case "table":for (c = "", a = "", r = d.header.length, i = 0; i < r; i++) a += this.renderer.tablecell(this.parseInline(d.tokens.header[i]), { header: !0, align: d.align[i] });for (c += this.renderer.tablerow(a), u = "", r = d.cells.length, i = 0; i < r; i++) {for (l = d.tokens.cells[i], a = "", o = l.length, s = 0; s < o; s++) a += this.renderer.tablecell(this.parseInline(l[s]), { header: !1, align: d.align[s] });u += this.renderer.tablerow(a);}k += this.renderer.table(c, u);continue;case "blockquote":u = this.parse(d.tokens), k += this.renderer.blockquote(u);continue;case "list":for (h = d.ordered, p = d.start, f = d.loose, r = d.items.length, u = "", i = 0; i < r; i++) m = d.items[i], v = m.checked, b = m.task, g = "", m.task && (w = this.renderer.checkbox(v), f ? m.tokens.length > 0 && "text" === m.tokens[0].type ? (m.tokens[0].text = w + " " + m.tokens[0].text, m.tokens[0].tokens && m.tokens[0].tokens.length > 0 && "text" === m.tokens[0].tokens[0].type && (m.tokens[0].tokens[0].text = w + " " + m.tokens[0].tokens[0].text)) : m.tokens.unshift({ type: "text", text: w }) : g += w), g += this.parse(m.tokens, f), u += this.renderer.listitem(g, b, v);k += this.renderer.list(u, h, p);continue;case "html":k += this.renderer.html(d.text);continue;case "paragraph":k += this.renderer.paragraph(this.parseInline(d.tokens));continue;case "text":for (u = d.tokens ? this.parseInline(d.tokens) : d.text; n + 1 < y && "text" === e[n + 1].type;) d = e[++n], u += "\n" + (d.tokens ? this.parseInline(d.tokens) : d.text);k += t ? this.renderer.paragraph(u) : u;continue;default:{const e = 'Token with "' + d.type + '" type was not found.';if (this.options.silent) return void console.error(e);throw new Error(e);}}return k;}parseInline(e, t) {t = t || this.renderer;let n,i,s = "";const r = e.length;for (n = 0; n < r; n++) switch (i = e[n], i.type) {case "escape":s += t.text(i.text);break;case "html":s += t.html(i.text);break;case "link":s += t.link(i.href, i.title, this.parseInline(i.tokens, t));break;case "image":s += t.image(i.href, i.title, i.text);break;case "strong":s += t.strong(this.parseInline(i.tokens, t));break;case "em":s += t.em(this.parseInline(i.tokens, t));break;case "codespan":s += t.codespan(i.text);break;case "br":s += t.br();break;case "del":s += t.del(this.parseInline(i.tokens, t));break;case "text":s += t.text(i.text);break;default:{const e = 'Token with "' + i.type + '" type was not found.';if (this.options.silent) return void console.error(e);throw new Error(e);}}return s;}},Yi = hi,Xi = Hi,Ji = Ui,Qi = Zi;function es(e, t, n) {if (null == e) throw new Error("marked(): input parameter is undefined or null");if ("string" != typeof e) throw new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected");if ("function" == typeof t && (n = t, t = null), t = vi.merge({}, es.defaults, t || {}), vi.checkSanitizeDeprecation(t), n) {const i = t.highlight;let s;try {s = qi.lex(e, t);} catch (e) {return n(e);}const r = function (e) {let r;if (!e) try {r = Ki.parse(s, t);} catch (t) {e = t;}return t.highlight = i, e ? n(e) : n(null, r);};if (!i || i.length < 3) return r();if (delete t.highlight, !s.length) return r();let o = 0;return es.walkTokens(s, function (e) {"code" === e.type && (o++, setTimeout(() => {i(e.text, e.lang, function (t, n) {if (t) return r(t);null != n && n !== e.text && (e.text = n, e.escaped = !0), o--, 0 === o && r();});}, 0));}), void (0 === o && r());}try {const n = qi.lex(e, t);return t.walkTokens && es.walkTokens(n, t.walkTokens), Ki.parse(n, t);} catch (e) {if (e.message += "\nPlease report this to https://github.com/markedjs/marked.", t.silent) return "<p>An error occurred:</p><pre>" + vi.escape(e.message + "", !0) + "</pre>";throw e;}}es.options = es.setOptions = function (e) {return vi.merge(es.defaults, e), gi.changeDefaults(es.defaults), es;}, es.getDefaults = gi.getDefaults, es.defaults = pi, es.use = function (e) {const t = vi.merge({}, e);if (e.renderer) {const n = es.defaults.renderer || new Xi();for (const t in e.renderer) {const i = n[t];n[t] = (...s) => {let r = e.renderer[t].apply(n, s);return !1 === r && (r = i.apply(n, s)), r;};}t.renderer = n;}if (e.tokenizer) {const n = es.defaults.tokenizer || new Yi();for (const t in e.tokenizer) {const i = n[t];n[t] = (...s) => {let r = e.tokenizer[t].apply(n, s);return !1 === r && (r = i.apply(n, s)), r;};}t.tokenizer = n;}if (e.walkTokens) {const n = es.defaults.walkTokens;t.walkTokens = t => {e.walkTokens(t), n && n(t);};}es.setOptions(t);}, es.walkTokens = function (e, t) {for (const n of e) switch (t(n), n.type) {case "table":for (const e of n.tokens.header) es.walkTokens(e, t);for (const e of n.tokens.cells) for (const n of e) es.walkTokens(n, t);break;case "list":es.walkTokens(n.items, t);break;default:n.tokens && es.walkTokens(n.tokens, t);}}, es.parseInline = function (e, t) {if (null == e) throw new Error("marked.parseInline(): input parameter is undefined or null");if ("string" != typeof e) throw new Error("marked.parseInline(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected");t = vi.merge({}, es.defaults, t || {}), vi.checkSanitizeDeprecation(t);try {const n = qi.lexInline(e, t);return t.walkTokens && es.walkTokens(n, t.walkTokens), Ki.parseInline(n, t);} catch (e) {if (e.message += "\nPlease report this to https://github.com/markedjs/marked.", t.silent) return "<p>An error occurred:</p><pre>" + vi.escape(e.message + "", !0) + "</pre>";throw e;}}, es.Parser = Ki, es.parser = Ki.parse, es.Renderer = Xi, es.TextRenderer = Ji, es.Lexer = qi, es.lexer = qi.lex, es.Tokenizer = Yi, es.Slugger = Qi, es.parse = es;var ts = function (e) {return e && e.__esModule ? e : { default: e };}(es),ns = {},is = dt,ss = ht;Object.defineProperty(ns, "__esModule", { value: !0 });var rs = function (e) {return (() => {const t = os.cloneNode(!0);return t.__click = e.onClick, t;})();};ns.FixButton = rs;const os = is('<button class="btn fix-btn">Fix</button>', 2);ss(["click"]);const ls = ci('<div class="linter-message"><div><div class="linter-text"><div class="provider-name"></div></div><div class="linter-buttons-right"></div></div></div>', 10),as = ci('<a href="#"><span></span></a>', 4),cs = ci('<a href="#"><span class="icon linter-icon icon-alignment-aligned-to"></span></a>', 4),us = ci('<a href="#"><span class="icon linter-icon icon-link"></span></a>', 4),ds = ci('<div class="linter-line"></div>', 2);function hs() {if ("function" != typeof WeakMap) return null;var e = new WeakMap();return hs = function () {return e;}, e;}function ps(e) {if (!(e.target instanceof HTMLElement)) return;const t = function (e) {for (; e && !e.classList.contains("linter-line");) {if (e instanceof HTMLAnchorElement) return e.href;e = e.parentElement;}return null;}(e.target);if (!t) return;const { protocol: n, hostname: i, query: s } = fi.parse(t, !0);if ("atom:" === n && "linter" === i && s && s.file) {const { file: e, row: t, column: n } = s;(0, S.openFile)(Array.isArray(e) ? e[0] : e, { row: t ? parseInt(Array.isArray(t) ? t[0] : t, 10) : 0, column: n ? parseInt(Array.isArray(n) ? n[0] : n, 10) : 0 });}}ui(["click"]);var fs = Cs(ai = ai.default),gs = {};Object.defineProperty(gs, "__esModule", { value: !0 });var ms = (vs = void 0, ws = gs.makeOverlaySelectable = vs, ys = gs.overlayFocusFix = ws, _s = gs.focusEditor = ys, Ss = gs.blurEditor = _s, gs.makeOverLayCopyable = Ss);gs.copyListener = ms;var vs = function (e, t, n = !0) {t.setAttribute("tabindex", "-1"), t.style.userSelect && "none" !== t.style.userSelect || (t.style.userSelect = "text"), n && bs(e, t), t.classList.add("native-key-bindings");};function bs(e, t) {const n = atom.views.getView(e).getComponent();t.addEventListener("mousedown", () => {xs(n), t.addEventListener("mouseleave", () => {ks(n);});});}gs.makeOverlaySelectable = vs;var ws = bs;function ks(e) {null == e || e.didFocus();}gs.overlayFocusFix = ws;var ys = ks;function xs(e) {null == e || e.didBlurHiddenInput({ relatedTarget: null });}gs.focusEditor = ys;var _s = xs;gs.blurEditor = _s;var Ss = function (e) {e.addEventListener("mouseenter", () => {e.addEventListener("keydown", Ps);}), e.addEventListener("mouseleave", () => {e.removeEventListener("keydown", Ps);});};async function Ps(e) {var t, n;if (e.preventDefault(), e.ctrlKey && "c" === e.key) {const e = null !== (n = null === (t = document.getSelection()) || void 0 === t ? void 0 : t.toString()) && void 0 !== n ? n : "";await navigator.clipboard.writeText(e);}}gs.makeOverLayCopyable = Ss, ms = Ps, gs.copyListener = ms;const Es = ii('<div class="linter-messages"></div>', 2);function Cs(e) {return e && e.__esModule ? e : { default: e };}si = class {constructor(e, t, n) {this.marker = void 0, this.element = document.createElement("div"), this.emitter = new c(), this.messages = void 0, this.subscriptions = new a(), this.messages = e, this.marker = n.markBufferRange([t, t]), this.marker.onDidDestroy(() => this.emitter.emit("did-destroy"));const i = new li.default();(0, gs.makeOverlaySelectable)(n, this.element), this.element.id = "linter-tooltip", n.decorateMarker(this.marker, { type: "overlay", item: this.element }), this.subscriptions.add(this.emitter, i);const s = [];e.forEach(e => {2 === e.version && s.push(st(fs.default, { get key() {return e.key;}, delegate: i, message: e }));}), ut(() => (() => {const e = Es.cloneNode(!0);return gt(e, s), e;})(), this.element), setTimeout(() => {const e = this.element.getBoundingClientRect().height,i = n.getLineHeightInPixels();if (e < (t.row - n.getFirstVisibleScreenRow()) * i) {const t = this.element.parentElement;t && (t.style.transform = `translateY(-${2 + i + e}px)`);} else {const e = n.getElement().querySelector(".datatip-overlay");if (e) {const t = this.element.parentElement;t && (t.style.transform = `translateY(${e.clientHeight}px)`);}}this.element.style.visibility = "visible";}, 50);}isValid(e, t) {if (1 !== this.messages.length || !t.has(this.messages[0].key)) return !1;const n = (0, S.$range)(this.messages[0]);return Boolean(n && n.containsPoint(e));}onDidDestroy(e) {return this.emitter.on("did-destroy", e);}dispose() {this.emitter.emit("did-destroy"), this.subscriptions.dispose();}}, ni.default = si;var Ts = Ls(ni = ni.default),Ms = {};Object.defineProperty(Ms, "__esModule", { value: !0 });var Os = function (e, t, n) {const i = n.getComponent().pixelPositionForMouseEvent(e),s = n.getComponent().screenPositionForPixelPosition(i);if (Number.isNaN(s.row) || Number.isNaN(s.column)) return null;const r = n.pixelPositionForScreenPosition(s),o = i.top - r.top,l = i.left - r.left;if ((0 === o || o > 0 && o < 20 || o < 0 && o > -20) && (0 === l || l > 0 && l < 20 || l < 0 && l > -20)) return t.bufferPositionForScreenPosition(s);return null;};Ms.getBufferPositionFromMouseEvent = Os;var As = function ({ event: e, editor: t, editorElement: n, tooltipElement: i, screenPosition: s }) {const r = n.getComponent().pixelPositionForMouseEvent(e),o = n.pixelPositionForScreenPosition(s),l = r.top - o.top,a = r.left - o.left,c = t.getLineHeightInPixels(),u = i.offsetHeight + c,d = i.offsetWidth;if (l > 0) {if (l > u + 1.5 * c) return !1;} else if (l < 0 && l < -1.5 * c) return !1;if (a > 0) {if (a > d + 30) return !1;} else if (a < 0 && a < -30) return !1;return !0;};Ms.mouseEventNearPosition = As;var $s = function (e, t) {let n = e;do {if (n.matches(t)) return !0;n = n.parentElement;} while (n && "HTML" !== n.nodeName);return !1;};Ms.hasParent = $s;function Ls(e) {return e && e.__esModule ? e : { default: e };}vn = class {constructor(e) {this.textEditor = void 0, this.gutter = null, this.tooltip = null, this.emitter = new c(), this.markers = new Map(), this.messages = new Map(), this.showTooltip = !0, this.subscriptions = new a(), this.cursorPosition = null, this.gutterPosition = void 0, this.tooltipFollows = "Both", this.showDecorations = void 0, this.showProviderName = !0, this.ignoreTooltipInvocation = !1, this.currentLineMarker = null, this.lastRange = void 0, this.lastIsEmpty = void 0, this.lastCursorPositions = new WeakMap(), this.textEditor = e;let t = null;this.subscriptions.add(this.emitter, e.onDidDestroy(() => {this.dispose();}), new u(function () {var e;null === (e = t) || void 0 === e || e.dispose();}), atom.config.observe("linter-ui-default.showProviderName", e => {this.showProviderName = e;}), atom.config.observe("linter-ui-default.showDecorations", e => {const t = void 0 !== this.showDecorations;this.showDecorations = e, t && this.updateGutter();}), atom.config.observe("linter-ui-default.gutterPosition", e => {const t = void 0 !== this.gutterPosition;this.gutterPosition = e, t && this.updateGutter();}), atom.config.observe("linter-ui-default.showTooltip", e => {this.showTooltip = e, !this.showTooltip && this.tooltip && this.removeTooltip();}), atom.config.observe("linter-ui-default.tooltipFollows", e => {this.tooltipFollows = e, t && t.dispose(), t = new a(), "Mouse" !== e && "Both" !== e || t.add(this.listenForMouseMovement()), "Keyboard" !== e && "Both" !== e || t.add(this.listenForKeyboardMovement()), this.removeTooltip();}), e.onDidChangeCursorPosition(({ cursor: e, newBufferPosition: t }) => {const n = this.lastCursorPositions.get(e);n && n.isEqual(t) || (this.lastCursorPositions.set(e, t), this.ignoreTooltipInvocation = !1), "Mouse" === this.tooltipFollows && this.removeTooltip();}), e.getBuffer().onDidChangeText(() => {e.getCursors().forEach(e => {this.lastCursorPositions.set(e, e.getBufferPosition());}), "Mouse" !== this.tooltipFollows && (this.ignoreTooltipInvocation = !0, this.removeTooltip());})), this.updateGutter(), this.listenForCurrentLine();}listenForCurrentLine() {this.subscriptions.add(this.textEditor.observeCursors(e => {const t = ({ start: e, end: t }) => {const n = this.gutter;if (!n || this.subscriptions.disposed) return;const i = d.fromObject([e, t]),s = d.fromObject([[e.row, 0], [t.row, 1 / 0]]),r = i.isEmpty();if (e.row !== t.row && 0 === i.end.column && s.end.row--, this.lastRange && this.lastRange.isEqual(s) && r === this.lastIsEmpty) return;this.currentLineMarker && (this.currentLineMarker.destroy(), this.currentLineMarker = null), this.lastRange = s, this.lastIsEmpty = r, this.currentLineMarker = this.textEditor.markScreenRange(s, { invalidate: "never" });const o = document.createElement("span");o.className = "line-number cursor-line linter-cursor-line " + (r ? "cursor-line-no-selection" : ""), n.decorateMarker(this.currentLineMarker, { item: o, class: "linter-row" });},n = e.getMarker(),i = new a();i.add(n.onDidChange(({ newHeadScreenPosition: e, newTailScreenPosition: n }) => {t({ start: e, end: n });})), i.add(e.onDidDestroy(() => {this.subscriptions.remove(i), i.dispose();})), i.add(new u(() => {this.currentLineMarker && (this.currentLineMarker.destroy(), this.currentLineMarker = null);})), this.subscriptions.add(i), t(n.getScreenRange());}));}listenForMouseMovement() {const e = atom.views.getView(this.textEditor);return (0, ti.default)(e, "mousemove", (0, ei.default)(t => {if (!e.getComponent() || this.subscriptions.disposed || !(0, Ms.hasParent)(t.target, "div.scroll-view")) return;const n = this.tooltip;n && (0, Ms.mouseEventNearPosition)({ event: t, editor: this.textEditor, editorElement: e, tooltipElement: n.element, screenPosition: n.marker.getStartScreenPosition() }) || (this.cursorPosition = (0, Ms.getBufferPositionFromMouseEvent)(t, this.textEditor, e), this.ignoreTooltipInvocation = !1, this.cursorPosition ? this.updateTooltip(this.cursorPosition) : this.removeTooltip());}, 100), { passive: !0 });}listenForKeyboardMovement() {return this.textEditor.onDidChangeCursorPosition((0, ei.default)(({ newBufferPosition: e }) => {this.cursorPosition = e, this.updateTooltip(e);}, 16));}updateGutter() {if (this.removeGutter(), !this.showDecorations) return void (this.gutter = null);const e = "Left" === this.gutterPosition ? -100 : 100;this.gutter = this.textEditor.addGutter({ name: "linter-ui-default", priority: e }), this.markers.forEach((e, t) => {const n = this.messages.get(t);if (n) for (const t of e) this.decorateMarker(n, t, "gutter");});}removeGutter() {if (this.gutter) try {this.gutter.destroy();} catch (e) {}}updateTooltip(e) {if (!e || this.tooltip && this.tooltip.isValid(e, this.messages)) return;if (this.removeTooltip(), !this.showTooltip) return;if (this.ignoreTooltipInvocation) return;const t = (0, S.filterMessagesByRangeOrPoint)(this.messages, this.textEditor.getPath(), e);if (!t.length) return;this.tooltip = new Ts.default(t, e, this.textEditor);const n = this.tooltip.marker;t.forEach(e => {this.saveMarker(e.key, n);}), this.tooltip.onDidDestroy(() => {this.tooltip = null;});}removeTooltip() {this.tooltip && this.tooltip.marker.destroy();}apply(e, t) {const n = this.textEditor.getBuffer();for (let e = 0, n = t.length; e < n; e++) {const n = t[e];this.destroyMarker(n.key);}for (let t = 0, i = e.length; t < i; t++) {const i = e[t],s = (0, S.$range)(i);if (!s) continue;const r = n.markRange(s, { invalidate: "never" });this.decorateMarker(i, r), r.onDidChange(({ oldHeadPosition: e, newHeadPosition: t, isValid: n }) => {!n || 0 === t.row && 0 !== e.row || 2 === i.version && (i.location.position = r.previousEventState.range);});}this.updateTooltip(this.cursorPosition);}decorateMarker(e, t, n = "both") {this.saveMarker(e.key, t), this.messages.set(e.key, e), "both" !== n && "editor" !== n || this.textEditor.decorateMarker(t, { type: "text", class: `linter-highlight linter-${e.severity}` });const i = this.gutter;if (i && ("both" === n || "gutter" === n)) {const n = document.createElement("span");n.className = `linter-gutter linter-gutter-${e.severity} icon icon-${e.icon || "primitive-dot"}`, i.decorateMarker(t, { class: "linter-row", item: n });}}saveMarker(e, t) {const n = this.markers.get(e) || [];n.push(t), this.markers.set(e, n);}destroyMarker(e) {const t = this.markers.get(e);t && t.forEach(e => {e && e.destroy();}), this.markers.delete(e), this.messages.delete(e);}onDidDestroy(e) {return this.emitter.on("did-destroy", e);}dispose() {this.emitter.emit("did-destroy"), this.subscriptions.dispose(), this.removeGutter(), this.removeTooltip();}}, mn.default = vn;var zs = function (e) {return e && e.__esModule ? e : { default: e };}(mn = mn.default);gn = class {constructor() {this.editors = new Set(), this.messages = [], this.firstRender = !0, this.subscriptions = new a(), this.subscriptions.add(atom.workspace.observeTextEditors(e => {if ((0, S.isLargeFile)(e)) {const t = atom.notifications.addWarning("Linter: Large/Minified file detected", { detail: "Adding inline linter markers are skipped for this file for performance reasons (linter pane is still active)", dismissable: !0, buttons: [{ text: "Force enable", onDidClick: () => {this.getEditor(e), t.dismiss();} }, { text: "Change threshold", onDidClick: async () => {var e;await atom.workspace.open("atom://config/packages/linter-ui-default"), null === (e = document.querySelectorAll(".control-group")[16]) || void 0 === e || e.scrollIntoView(), t.dismiss();} }] });setTimeout(() => {t.dismiss();}, 5e3);} else this.getEditor(e);}), atom.workspace.getCenter().observeActivePaneItem(e => {this.editors.forEach(t => {t.textEditor !== e && t.removeTooltip();});}));}isFirstRender() {return this.firstRender;}update({ messages: e, added: t, removed: n }) {this.messages = e, this.firstRender = !1;const { editorsMap: i, filePaths: s } = (0, S.getEditorsMap)(this);t.forEach(function (e) {if (!e || !e.location) return;const t = (0, S.$file)(e);t && i.has(t) && i.get(t).added.push(e);}), n.forEach(function (e) {if (!e || !e.location) return;const t = (0, S.$file)(e);t && i.has(t) && i.get(t).removed.push(e);}), s.forEach(function (e) {if (i.has(e)) {const { added: t, removed: n, editors: s } = i.get(e);(t.length || n.length) && s.forEach(e => e.apply(t, n));}});}getEditor(e) {for (const t of this.editors) if (t.textEditor === e) return t;const t = new zs.default(e);return this.editors.add(t), t.onDidDestroy(() => {this.editors.delete(t);}), t.subscriptions.add(e.onDidChangePath(() => {t.dispose(), this.getEditor(e);})), t.subscriptions.add(e.onDidChangeGrammar(() => {t.dispose(), this.getEditor(e);})), t.apply((0, S.filterMessages)(this.messages, e.getPath()), []), t;}dispose() {for (const e of this.editors) e.dispose();this.subscriptions.dispose();}}, fn.default = gn;var Is = Js(fn = fn.default),Ds = {};Object.defineProperty(Ds, "__esModule", { value: !0 });var Rs = void 0;Ds.default = Rs;var js = Ks(bn),Ns = Ks(s),Bs = {};Object.defineProperty(Bs, "__esModule", { value: !0 });var Fs = Vs;Bs.getChunks = Fs;var qs = Zs;Bs.getChunksByProjects = qs;var Hs = Gs;Bs.mergeChange = Hs;var Ws = function (e, t) {const n = {},i = atom.project.getPaths();return t.forEach(function (t) {const s = (0, S.$file)(t);if (s) {("Files" === e ? [s] : Zs(s, i)).forEach(e => Gs(n, e, t.severity));}}), n;};Bs.calculateDecorations = Ws;var Us = function (e) {return e && e.__esModule ? e : { default: e };}(n);function Vs(e, t) {const n = [],i = e.split(Us.default.sep);for (; i.length;) {const e = i.join(Us.default.sep);if (e && (n.push(e), e === t)) break;i.pop();}return n;}function Zs(e, t) {const n = t.find(t => e.startsWith(t));return n ? Vs(e, n) : [e];}function Gs(e, t, n) {e[t] || (e[t] = { info: !1, error: !1, warning: !1 }), e[t][n] = !0;}function Ks(e) {return e && e.__esModule ? e : { default: e };}class Ys {constructor() {this.messages = [], this.decorations = {}, this.subscriptions = new a(), this.decorateOnTreeView = void 0, this.subscriptions.add(atom.config.observe("linter-ui-default.decorateOnTreeView", e => {if (void 0 === this.decorateOnTreeView) this.decorateOnTreeView = e;else if ("None" === e) this.update([]), this.decorateOnTreeView = e;else {const t = this.messages;this.decorateOnTreeView = e, this.update(t);}})), setTimeout(() => {const e = Ys.getElement();e && this.subscriptions.add((0, Ns.default)(e, "click", (0, js.default)(() => {this.update();}), { passive: !0 }));}, 100);}update(e = null) {Array.isArray(e) && (this.messages = e);const t = this.messages,n = Ys.getElement(),i = this.decorateOnTreeView;n && "None" !== i && this.applyDecorations((0, Bs.calculateDecorations)(i, t));}applyDecorations(e) {const t = Ys.getElement();if (!t) return;const n = {},i = {};Object.keys(this.decorations).forEach(i => {if ({}.hasOwnProperty.call(this.decorations, i) && !e[i]) {const e = n[i] || (n[i] = Ys.getElementByPath(t, i));e && function (e) {var t;null === (t = e.querySelector("linter-decoration")) || void 0 === t || t.remove();}(e);}}), Object.keys(e).forEach(s => {if (!{}.hasOwnProperty.call(e, s)) return;const r = n[s] || (n[s] = Ys.getElementByPath(t, s));r && (!function (e, t, n = !1) {let i = null;n && (i = e.querySelector("linter-decoration"));null !== i ? i.className = "" : (i = document.createElement("linter-decoration"), e.appendChild(i));t.error ? i.classList.add("linter-error") : t.warning ? i.classList.add("linter-warning") : t.info && i.classList.add("linter-info");}(r, e[s], Boolean(this.decorations[s])), i[s] = e[s]);}), this.decorations = i;}dispose() {this.subscriptions.dispose();}static getElement() {return document.querySelector(".tree-view");}static getElementByPath(e, t) {return e.querySelector(`[data-path=${CSS.escape(t)}]`);}}Rs = Ys, Ds.default = Rs;var Xs = Js(Ds = Ds.default);function Js(e) {return e && e.__esModule ? e : { default: e };}w = class {constructor() {this.name = "Linter", this.panel = void 0, this.signal = new un.default(), this.editors = void 0, this.treeview = void 0, this.commands = new Yt.default(), this.messages = [], this.statusBar = new ln.default(), this.intentions = new pn.default(), this.subscriptions = new a(), this.idleCallbacks = new Set(), this.subscriptions.add(this.signal, this.commands, this.statusBar);const e = window.requestIdleCallback(() => {this.idleCallbacks.delete(e), this.panel = new Ut.default(), this.panel.update(this.messages);});this.idleCallbacks.add(e);const t = window.requestIdleCallback(() => {this.idleCallbacks.delete(t), this.subscriptions.add(atom.config.observe("linter-ui-default.showDecorations", e => {e && !this.editors ? (this.editors = new Is.default(), this.editors.update({ added: this.messages, removed: [], messages: this.messages })) : !e && this.editors && (this.editors.dispose(), this.editors = null);}));});this.idleCallbacks.add(t);}render(e) {const t = this.editors;this.messages = e.messages, t && (t.isFirstRender() ? t.update({ added: e.messages, removed: [], messages: e.messages }) : t.update(e)), this.treeview || (this.treeview = new Xs.default(), this.subscriptions.add(this.treeview)), this.treeview.update(e.messages), this.panel && this.panel.update(e.messages), this.commands.update(e.messages), this.intentions.update(e.messages), this.statusBar.update(e.messages);}didBeginLinting(e, t) {this.signal.didBeginLinting(e, t);}didFinishLinting(e, t) {this.signal.didFinishLinting(e, t);}dispose() {this.idleCallbacks.forEach(e => window.cancelIdleCallback(e)), this.idleCallbacks.clear(), this.subscriptions.dispose(), this.panel && this.panel.dispose(), this.editors && this.editors.dispose();}}, b.default = w;var Qs = function (e) {return e && e.__esModule ? e : { default: e };}(b = b.default);const er = new Set(),tr = new Set();let nr, ir;