"use strict"; (function(K, M, A, la) { const D = function() { const w = {}; return { register: function(r, E) { w[r] = E; }, require: function(r) { var E; if (!(E = w[r])) throw Error("Bad module [" + r + "]"); return E; }, include: function(r) { return w[r]; }, noop: function() {} }; }(); D.register("1", function(w, r, E) { function y(p) { const t = typeof p; if ("string" === t) if (/[^ <>!=()%^&|?:n0-9]/.test(p)) console.error("Invalid plural: " + p); else return new Function("n", "return " + p); "function" !== t && (p = function(e) { return 1 != e; }); return p; } w.init = function(p) { function t(l, m, q) { return (l = g[l]) && l[q] ? l[q] : m || ""; } function e(l) { return t(l, l, 0); } function b(l, m) { return t(m + "" + l, l, 0); } function k(l, m, q) { q = Number(p(q)); isNaN(q) && (q = 0); return t(l, q ? m : l, q); } p = y(p); let g = {}; return { __: e, _x: b, _n: k, _: e, x: b, n: k, load: function(l) { g = l || {}; return this; }, pluraleq: function(l) { p = y(l); return this; } }; }; return w; }({}, K, M)); D.register("2", function(w, r, E) { w.ie = function() { return !1; }; w.init = function() { return w; }; return w; }({}, K, M)); D.register("3", function(w, r, E) { Number.prototype.format = function(y, p, t) { var e = Math.pow(10, y || 0); y = []; e = String(Math.round(e * this) / e); var b = e.split("."); e = b[0]; b = b[1]; let k = e.length; do { y.unshift(e.substring(k - 3, k)); } while (0 < (k -= 3)); e = y.join(t || ","); if (b) { { t = b; y = t.length; let g; for (;"0" === t.charAt(--y); ) g = y; g && (t = t.substring(0, g)); b = t; } b && (e += (p || ".") + b); } return e; }; Number.prototype.percent = function(y) { let p = 0, t = this && y ? this / y * 100 : 0; if (0 === t) return "0"; if (100 === t) return "100"; if (99 < t) t = Math.min(t, 99.9), y = t.format(++p); else if (.5 > t) { t = Math.max(t, 1e-4); do { y = t.format(++p); } while ("0" === y && 4 > p); y = y.substring(1); } else y = t.format(0); return y; }; return w; }({}, K, M)); D.register("4", function(w, r, E) { Array.prototype.indexOf || (Array.prototype.indexOf = function(y) { if (null == this) throw new TypeError(); var p = Object(this), t = p.length >>> 0; if (0 === t) return -1; var e = 0; 1 < arguments.length && (e = Number(arguments[1]), e != e ? e = 0 : 0 != e && Infinity != e && -Infinity != e && (e = (0 < e || -1) * Math.floor(Math.abs(e)))); if (e >= t) return -1; for (e = 0 <= e ? e : Math.max(t - Math.abs(e), 0); e < t; e++) if (e in p && p[e] === y) return e; return -1; }); return w; }({}, K, M)); D.register("5", function(w, r, E) { E = r.JSON; E || (E = { parse: A.parseJSON, stringify: null }, r.JSON = E); w.parse = E.parse; w.stringify = E.stringify; return w; }({}, K, M)); D.register("6", function(w, r, E) { w.trim = function(y, p) { for (p || (p = " \n"); y && -1 !== p.indexOf(y.charAt(0)); ) y = y.substring(1); for (;y && -1 !== p.indexOf(y.slice(-1)); ) y = y.substring(0, y.length - 1); return y; }; w.sprintf = function(y) { return w.vsprintf(y, [].slice.call(arguments, 1)); }; w.vsprintf = function(y, p) { let t = 0; return y.replace(/%(?:([1-9][0-9]*)\$)?([sud%])/g, function(e, b, k) { if ("%" === k) return "%"; e = b ? p[Number(b) - 1] : p[t++]; return null != e ? String(e) : "s" === k ? "" : "0"; }); }; return w; }({}, K, M)); D.register("1a", function(w, r, E) { function y(p) { return function(t, e) { let b = t[p] || 0; for (;(t = t.offsetParent) && t !== (e || E.body); ) b += t[p] || 0; return b; }; } w.top = y("offsetTop"); w.left = y("offsetLeft"); w.el = function(p, t) { p = E.createElement(p || "div"); t && (p.className = t); return p; }; w.txt = function(p) { return E.createTextNode(p || ""); }; w.rect = function(p) { return p.getBoundingClientRect(); }; return w; }({}, K, M)); D.register("7", function(w, r, E) { function y(c, d, h) { function n() { v(); C = setTimeout(d, h); } function v() { C && clearTimeout(C); C = 0; } let C = 0; n(); A(c).on("mouseenter", v).on("mouseleave", n); return { die: function() { v(); A(c).off("mouseenter mouseleave"); } }; } function p(c, d) { c.fadeTo(d, 0, function() { c.slideUp(d, function() { c.remove(); A(r).triggerHandler("resize"); }); }); return c; } function t(c, d) { function h(G) { q[B] = null; p(A(c), 250); C && C.die(); var H; if (H = G) G.stopPropagation(), G.preventDefault(), H = !1; return H; } function n(G) { C && C.die(); return C = y(c, h, G); } const v = A(c); let C, B, z, F = v.find("button"); 0 === F.length && (v.addClass("is-dismissible"), F = A('
")) n = v; } return n; }; h._setContent = h.setContent; h.setContent = function(n, v) { return this._setContent(g(n), v); }; k ? (y(h, k), k.reset()) : t(h); A(c).removeClass("loading"); } let m, q = !1, x = "", u = !1, f = b.parentNode, a = f.parentNode, c = f.appendChild(E.createElement("div")), d = a.insertBefore(E.createElement("nav"), f); d.id = "_tb" + String(++e); A(f).addClass("has-proxy has-mce"); A(c).addClass("mce-content-body loading").html(g(b.value)); w.load(function(h) { if (!h) throw Error("Failed to load HTML editor"); c && h.init({ inline: !0, target: c, hidden_input: !1, theme: "modern", skin: !1, plugins: "link lists", browser_spellcheck: !0, menubar: !1, fixed_toolbar_container: "#" + d.id, toolbar: "formatselect | bold italic link unlink | bullist numlist outdent indent", block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h4;Heading 4=h4;Heading 5=h5;Heading 6=h6;", forced_root_block: "p", relative_urls: !1, convert_urls: !1, remove_script_host: !1, document_base_url: "", allow_script_urls: !1, formats: { alignleft: { classes: "alignleft" }, alignright: { selector: "p,h1,h2,h3,h4,span,strong,em,a", classes: "alignright" }, aligncenter: { selector: "p,h1,h2,h3,h4,span,strong,em,a", classes: "aligncenter" }, strikethrough: { inline: "del" } }, fix_list_elements: !0, extended_valid_elements: "span,b,i,u,loco:script", entities: "38,amp,60,lt,62,gt,160,nbsp", entity_encoding: "named", keep_styles: !1, init_instance_callback: l }); }); return { val: function(h) { h = g(h); null == m ? (b.value = h, A(c).html(h)) : m.getContent() !== h && m.setContent(h); k && k.val(h); return this; }, kill: function() { m && (k && k.val(m.getContent()), p(m), m.destroy(), m = null); c && (f.removeChild(c), A(f).removeClass("has-proxy has-mce"), c = null); d && (a.removeChild(d), d = null); return this; }, enable: function(h) { k = h; m && y(m, h); return this; }, disable: function() { m && t(m); k = null; return this; }, focus: function() { m && k && m.focus(); return this; }, invs: function(h) { h = h || !1; q !== h && (q = h, A(f)[h ? "addClass" : "removeClass"]("show-invs")); return this; } }; }; return w; }({}, K, M)); D.register("34", function(w, r, E) { w.init = function(y, p) { function t(a) { x !== a && (f.textContent = a.format(0), x = a, a = 0 === a ? "empty" : 0 === p || a < p ? "lt" : p === a ? "eq" : "gt", a !== q && (q = a, u.className = "wg-count is-" + a)); } function e(a) { m && (u.removeChild(m), m = null); 0 < a && (m = u.appendChild(g.el("span").appendChild(g.txt(" / " + a.format(0))))); p = a; } function b(a, c) { t(c.length); } function k() { q = ""; x = -1; t(y.val().length); } const g = D.require("1a"), l = A(y.parent()).on("changing", b); let m, q, x, u = g.el("div"), f = u.appendChild(g.el("span")); l.append(u); e(p); k(); return { ping: function(a) { null != a && a !== p && (p = a, e(a)); k(); }, kill: function() { const a = l && l[0]; a && u && u.parentNode === a && (l.off("changing", b), a.removeChild(u)); } }; }; return w; }({}, K, M)); D.register("2f", function(w, r, E) { function y(e) { function b() { f && (q.off("input", k), f = !1); } function k() { const c = e.value; c !== a && (q.trigger("changing", [ c, a ]), a = c); } function g() { k(); f && u !== a && q.trigger("changed", [ a ]); } function l() { t = e; u = a; f || (q.on("input", k), f = !0); q.trigger("editFocus"); x.addClass("has-focus"); return !0; } function m() { t === e && (t = null); q.trigger("editBlur"); x.removeClass("has-focus"); f && (g(), b()); return !0; } const q = A(e), x = A(e.parentNode); let u, f = !1, a = e.value; q.on("blur", m).on("focus", l); return { val: function(c) { a !== c && (e.value = c, q.triggerHandler("input"), a = c); return !0; }, kill: function() { b(); q.off("blur", m).off("focus", l); }, fire: function() { a = null; k(); }, ping: g, blur: m, focus: l, reset: function() { u = a = e.value; } }; } function p(e) { this.e = e; } let t; w._new = function(e) { return new p(e); }; w.init = function(e) { const b = new p(e); e.disabled ? (e.removeAttribute("disabled"), b.disable()) : e.readOnly ? b.disable() : b.enable(); return b; }; r = p.prototype; r.destroy = function() { this.unlisten(); const e = this.p; e && (e.kill(), this.p = null); this.nocount(); this.e = null; }; r.reload = function(e, b) { let k = this.l; this.nocount(); k && !b && (this.disable(), k = null); this.val(e || ""); b && !k && this.enable(); return this; }; r.val = function(e) { const b = this.e; if (null == e) return b.value; const k = this.l, g = this.p; g && g.val(e); k && k.val(e); k || b.value === e || (b.value = e, A(b).triggerHandler("input")); return this; }; r.fire = function() { this.l && this.l.fire(); return this; }; r.ping = function() { this.l && this.l.ping(); return this; }; r.focus = function() { const e = this.p; e ? e.focus() : A(this.e).focus(); }; r.focused = function() { return t && t === this.el; }; r.parent = function() { return this.e.parentNode; }; r.attr = function(e, b) { const k = this.e; if (1 === arguments.length) return k.getAttribute(e); null == b ? k.removeAttribute(e) : k.setAttribute(e, b); return this; }; r.editable = function() { return !!this.l; }; r.enable = function() { const e = this.p; this.e.removeAttribute("readonly"); this.listen(); e && e.enable && e.enable(this.l); return this; }; r.disable = function() { const e = this.p; this.e.setAttribute("readonly", !0); this.unlisten(); e && e.disable && e.disable(); return this; }; r.listen = function() { const e = this.l; e && e.kill(); this.l = y(this.e); return this; }; r.unlisten = function() { const e = this.l; e && (e.kill(), this.l = null); return this; }; r.setInvs = function(e, b) { const k = this.i || !1; if (b || k !== e) this._i && (this._i.kill(), delete this._i), (b = this.p) && b.invs ? b.invs(e) : e && (this._i = D.require("32").init(this.e)), this.i = e; return this; }; r.getInvs = function() { return this.i || !1; }; r.setMode = function(e) { let b = this.p, k = this.i || !1; e !== (this.m || "") && (this.m = e, b && b.kill(), this.p = b = "code" === e ? D.require("10").init(this.e, this.l, this["%"]) : "html" === e ? D.require("33").init(this.e, this.l) : null, this.setInvs(k, !0), t && this.focus()); return this; }; r.setStrf = function(e) { this["%"] = e; "code" === this.m && this.p.strf(e); return this; }; r.name = function(e) { this.e.setAttribute("name", e); return this; }; r.placeholder = function(e) { this.e.setAttribute("placeholder", e); return this; }; r.redraw = function() { const e = this.p; e && e.resize && e.resize(); }; r.counter = function(e) { let b = this.c; b ? b.ping(e) : this.c = D.require("34").init(this, e); e = String(e || "0"); "0" === e ? this.e.removeAttribute("maxlength") : e !== this.e.getAttribute("maxlength") && this.e.setAttribute("maxlength", e); return this; }; r.nocount = function() { const e = this.c; e && (e.kill(), this.c = null, this.e.removeAttribute("maxlength")); }; return w; }({}, K, M)); D.register("30", function(w, r, E) { function y(f) { const a = r.console; a && a.error && a.error(f); } function p(f) { const a = E.createElement("div"); f && a.setAttribute("class", f); return a; } function t(f) { return function() { f.resize(); return this; }; } function e(f) { return function(a) { let c = a.target, d = c.$index; for (;null == d && "DIV" !== c.nodeName && (c = c.parentElement); ) d = c.$index; null != d && (a.stopImmediatePropagation(), f.select(d)); return !0; }; } function b(f) { return function() { f.redrawDirty() && f.redraw(); return !0; }; } function k(f) { return function(a) { var c = a.keyCode; if (40 === c) c = 1; else if (38 === c) c = -1; else return !0; if (a.shiftKey || a.ctrlKey || a.metaKey || a.altKey) return !0; f.selectNext(c); a.stopPropagation(); a.preventDefault(); return !1; }; } function g(f, a, c) { function d(h) { y("row[" + h + "] disappeared"); return { cellVal: function() { return ""; } }; } return function(h) { const n = a || 0, v = c ? -1 : 1, C = f.rows || []; h.sort(function(B, z) { return v * (C[B] || d(B)).cellVal(n).localeCompare((C[z] || d(z)).cellVal(n)); }); }; } function l(f) { this.w = f; } function m(f) { this.t = f; this.length = 0; } function q(f, a, c) { let d = E.createElement("div"); d.className = c || ""; this._ = d; this.d = a || []; this.i = f || 0; this.length = a.length; } function x(f) { this.live = f; this.rows = []; } w.create = function(f) { return new l(f); }; var u = l.prototype; u.init = function(f) { let a = this.w, c = a.id; var d = a.splity(c + "-thead", c + "-tbody"), h = d[0]; d = d[1]; let n = [], v = [], C = [], B = []; if (f) this.ds = f, this.idxs = v, this._idxs = null; else if (!(f = this.ds)) throw Error("No datasource"); h.css.push("wg-thead"); d.css.push("wg-tbody"); f.eachCol(function(O, R, I) { C[O] = c + "-col-" + R; B[O] = I || R; }); var z = p(); let F = -1, G = C.length, H = p("wg-cols"), J = h.splitx.apply(h, C); for (;++F < G; ) J[F].header(B[F]), H.appendChild(z.cloneNode(!1)).setAttribute("for", C[F]); f.eachRow(function(O, R, I) { n[O] = new q(O, R, I); v[O] = O; }); this.rows = n; this.cols = H; this.ww = null; this.root = z = d.body; this.head = h; h.redraw = t(this); a.css.push("is-table"); a.restyle(); h = d.fixed = J[0].bodyY() || 25; a.lock().resize(h, d); this.sc ? this._re_sort(G) : f.sort && f.sort(v); this.redrawDirty(); this.render(); A(z).attr("tabindex", "-1").on("keydown", k(this)).on("mousedown", e(this)).on("scroll", b(this)); return this; }; u.clear = function() { const f = this.pages || []; let a = f.length; for (;0 !== a--; ) f[a].destroy(); this.pages = []; this.sy = this.mx = this.mn = this.vh = null; void 0; return this; }; u.render = function() { let f, a = [], c = this.rows || [], d = -1, h, n = this.idxs, v = n.length, C = this.idxr = {}, B = this.r, z = this._r, F = this.root, G = this.cols; for (;++d < v; ) { if (0 === d % 100) { var H = G.cloneNode(!0); f = new x(H); f.i = a.length; f.h = 2200; f.insert(F); a.push(f); } h = n[d]; C[h] = d; H = c[h]; if (null == H) throw Error("Render error, no data at [" + h + "]"); H.page = f; f.rows.push(H); } f && 100 !== f.size() && f.sleepH(22); this.pages = a; this.mx = this.mn = null; this.redrawDirty(); this.redraw(); null == B ? null != z && (H = c[z]) && H.page && (delete this._r, this.select(z, !0)) : (H = c[B]) && H.page ? this.select(B, !0) : (this.deselect(!1), this._r = B); return this; }; u.resize = function() { let f = -1, a = this.ww || (this.ww = []); var c = this.w; let d = c.cells[0], h = d.body.childNodes, n = h.length, v = this.pages || [], C = v.length; for (c.redraw.call(d); ++f < n; ) a[f] = h[f].style.width; if (C) { c = this.mx; for (f = this.mn; f <= c; f++) v[f].widths(a); this.redrawDirty() && this.redraw(); } }; u.redrawDirty = function() { let f = !1; var a = this.root; const c = a.scrollTop; a = a.clientHeight; this.sy !== c && (f = !0, this.sy = c); this.vh !== a && (f = !0, this.vh = a); return f; }; u.redraw = function() { let f = 0, a = -1, c = null, d = null, h = this.ww; var n = this.sy; let v = this.mn, C = this.mx, B = Math.max(0, n - 100); n = this.vh + n + 100; let z, F = this.pages || [], G = F.length; for (;++a < G && !(f > n); ) z = F[a], f += z.height(), f < B || (null === c && (c = a), d = a, z.rendered || z.render(h)); if (v !== c) { if (null !== v && c > v) for (a = v; a < c; a++) { z = F[a]; if (!z) throw Error("Shit!"); z.rendered && z.sleep(); } this.mn = c; } if (C !== d) { if (null !== C && d < C) for (a = C; a > d; a--) z = F[a], z.rendered && z.sleep(); this.mx = d; } }; u.selected = function() { return this.r; }; u.thead = function() { return this.w.cells[0]; }; u.tbody = function() { return this.w.cells[1]; }; u.tr = function(f) { return (f = this.row(f)) ? f.cells() : []; }; u.row = function(f) { return this.rows[f]; }; u.td = function(f, a) { return this.tr(f)[a]; }; u.next = function(f, a, c) { null == c && (c = this.r || 0); const d = this.idxs, h = d.length; let n = c = (this.idxr || {})[c]; for (;c !== (n += f) && !(0 <= n && h > n); ) if (a && h) n = 1 === f ? -1 : h, a = !1; else return null; c = d[n]; return null == c || null == this.rows[c] ? (y("Bad next: [" + n + "] does not map to data row"), null) : c; }; u.selectNext = function(f, a, c) { f = this.next(f, a, null); null != f && this.r !== f && this.select(f, c); return this; }; u.deselect = function(f) { const a = this.r; null != a && (this.r = null, A(this.tr(a)).removeClass("selected"), this.w.fire("wgRowDeselect", [ a, f ])); return this; }; u.selectRow = function(f, a) { return this.select(this.idxs[f], a); }; u.select = function(f, a) { const c = this.rows[f]; var d = c && c.page; if (!d) return this.deselect(!1), y("Row is filtered out"), this; this.deselect(!0); let h, n = this.w.cells[1]; d.rendered || (h = d.top(), n.scrollY(h), this.redrawDirty() && this.redraw()); if (!c.rendered) return d.rendered || y("Failed to render page"), y("Row [" + c.i + "] not rendered"), this; d = c.cells(); A(d).addClass("selected"); this.r = f; a || (h = n.scrollY(), A(this.root).focus(), h !== n.scrollY() && n.scrollY(h)); n.scrollTo(d[0], !0); this.w.fire("wgRowSelect", [ f, c.data() ]); return this; }; u.unfilter = function() { this._idxs && (this.idxs = this._sort(this._idxs), this._idxs = null, this.clear().render()); return this; }; u.filter = function(f) { this._idxs || (this._idxs = this.idxs); this.idxs = this._sort(f); return this.clear().render(); }; u.each = function(f) { let a, c = -1; const d = this.rows || [], h = this.idxs || [], n = h.length; for (;++c < n; ) a = h[c], f(d[a], c, a); return this; }; u.sortable = function(f) { const a = this.sc || (this.sc = new m(this)); a.has(f) || a.add(f); return this; }; u._re_sort = function(f) { let a = -1, c = this.sc, d = c.active; for (this.sc = c = new m(this); ++a < f; ) c.add(a); d && (a = this.head.indexOf(d.id), -1 === a && (a = Math.min(d.idx, f - 1)), this.sort(a, d.desc)); return this; }; u._sort = function(f, a) { a ? (this.s = a, a(f)) : (a = this.s) && a(f); return f; }; u.sort = function(f, a) { this._sort(this.idxs, g(this, f, a)); this.sc.activate(f, a); return this; }; u = null; u = m.prototype; u.has = function(f) { return null != this[f]; }; u.add = function(f) { const a = this, c = a.t.head.cells[f]; a[f] = { desc: null, idx: f, id: c.id }; a.length++; c.addClass("wg-sortable").on("click", function(d) { if ("header" === d.target.nodeName.toLowerCase()) return d.stopImmediatePropagation(), a.toggle(f), !1; }); return a; }; u.toggle = function(f) { this.t.sort(f, !this[f].desc).clear().render(); return this; }; u.activate = function(f, a) { let c, d = this.active, h = this[f], n = this.t.head.cells; d && (c = n[d.idx]) && (c.removeClass(d.css), d !== h && c.restyle()); (c = n[f]) ? (h.desc = a, this.active = h, f = "wg-" + (a ? "desc" : "asc"), c.addClass(f).restyle(), h.css = f) : this.active = null; return this; }; u = null; u = q.prototype; u.render = function(f) { let a, c = [], d = this._, h = this.length; if (d) { for (this.c = c; 0 !== h--; ) a = d.cloneNode(!1), c[h] = this.update(h, a), a.$index = this.i, f[h].appendChild(a); this._ = null; } else for (c = this.c; 0 !== h--; ) f[h].appendChild(c[h]); this.rendered = !0; return this; }; u.update = function(f, a) { a = a || this.c[f] || {}; f = (this.d[f] || function() {})() || " "; null == f.innerHTML ? a.textContent = f : a.innerHTML = f.innerHTML; return a; }; u.cells = function() { return this.c || [ this._ ]; }; u.data = function() { const f = [], a = this.length; let c = -1; for (;++c < a; ) f[c] = this.cellVal(c); return f; }; u.destroy = function() { this.page = null; this.rendered = !1; }; u.cellVal = function(f) { f = this.d[f]() || ""; return String(f.textContent || f); }; u = null; u = x.prototype; u.size = function() { return this.rows.length; }; u.insert = function(f) { const a = this.h, c = p("wg-dead"); c.style.height = String(a) + "px"; f.appendChild(c); return this.dead = c; }; u.top = function() { return (this.rendered ? this.live : this.dead).offsetTop; }; u.height = function() { let f = this.h; null == f && (this.h = f = this.rendered ? this.live.firstChild.offsetHeight : this.dead.offsetHeight); f || y("row has zero height"); return f; }; u.render = function(f) { let a, c = -1, d = this.rows, h = d.length; const n = this.dead, v = this.live, C = v.childNodes; for (;++c < h; ) a = d[c], a.rendered || a.render(C); h = f.length; for (c = 0; c < h; c++) C[c].style.width = f[c]; n.parentNode.replaceChild(v, n); this.rendered = !0; this.h = null; return this; }; u.sleep = function() { const f = this.height(), a = this.live, c = this.dead; c.style.height = String(f) + "px"; a.parentNode.replaceChild(c, a); this.rendered = !1; this.h = f; return this; }; u.sleepH = function(f) { f *= this.rows.length; const a = this.dead; a && (a.style.height = String(f) + "px"); this.rendered || (this.h = f); return this; }; u.widths = function(f) { const a = this.live.childNodes; let c = f.length; for (;0 !== c--; ) a[c].style.width = f[c]; return this; }; u.destroy = function() { var f = this.rendered ? this.live : this.dead; const a = this.rows; f.parentNode.removeChild(f); for (f = a.length; 0 !== f--; ) a[f].destroy(); }; return w; }({}, K, M)); D.register("2b", function(w, r, E) { function y(d, h) { var n = d.id; let v = n && u[n], C = v && v.parent(); if (!v || !C) return null; var B = 1 === C.dir; n = B ? "X" : "Y"; let z = "page" + n; B = B ? x : q; let F = B(C.el); n = h["offset" + n]; let G = C.el, H = G.className; null == n && (n = h[z] - B(d)); n && (F += n); G.className = H + " is-resizing"; return { done: function() { G.className = H; }, move: function(J) { C.resize(J[z] - F, v); return !0; } }; } function p(d) { function h() { A(E).off("mousemove", n); c && (c.done(), c = null); return !0; } function n(v) { c ? c.move(v) : h(); return !0; } if (c) return !0; c = y(d.target, d); if (!c) return !0; A(E).one("mouseup", h).on("mousemove", n); return e(d); } function t(d, h) { const n = h.type; "touchmove" === n ? c && c.move(h) : "touchstart" === n ? c = y(d.target, h) : "touchend" === n && c && (c.done(), c = null); } function e(d) { d.stopPropagation(); d.preventDefault(); return !1; } function b(d) { f && f.redraw(); d && d.redraw(); return f = d; } function k(d, h) { const n = A(h); n.on("editFocus", function(v) { v.stopPropagation(); n.trigger("wgFocus", [ b(d) ]); }).on("editBlur", function(v) { v.stopPropagation(); n.trigger("wgBlur", [ b(null) ]); }); } function g(d) { const h = d.id, n = d.className, v = n ? [ n ] : []; this.id = h; this.el = d; this.pos = this.index = 0; this._cn = n; this.css = v.concat("wg-cell"); u[h] = this; this.clear(); } const l = D.include("2d") || D.require("2"), m = D.require("1a"), q = m.top, x = m.left, u = {}; let f, a = 0, c = !1; w.init = function(d) { const h = new g(d); h.redraw(); D.require("2e").ok(function(n) { n.dragger(d, t); }); A(d).on("mousedown", p); return h; }; r = g.prototype; r.fire = function(d, h) { d = A.Event(d); d.cell = this; A(this.el).trigger(d, h); return this; }; r.each = function(d) { let h = -1; const n = this.cells, v = n.length; for (;++h < v; ) d(n[h], h); return this; }; r.indexOf = function(d) { return (d = u[d.id || String(d)]) && d.pid === this.id ? d.index : -1; }; r.on = function() { return this.$("on", arguments); }; r.off = function() { return this.$("off", arguments); }; r.find = function(d) { return A(this.el).find(d); }; r.$ = function(d, h) { A.fn[d].apply(A(this.el), h); return this; }; r.addClass = function(d) { this.css.push(d); return this; }; r.removeClass = function(d) { d = this.css.indexOf(d); -1 !== d && this.css.splice(d, 1); return this; }; r.parent = function() { return this.pid && u[this.pid]; }; r.splitx = function() { return this._split(1, arguments); }; r.splity = function() { return this._split(2, arguments); }; r._split = function(d, h) { (this.length || this.field) && this.clear(); let n = -1; let v = h.length, C = 1 / v, B = 0; for (;++n < v; ) { var z = m.el(); this.body.appendChild(z); var F = z; { var G = h[n]; let H = 1, J = G; for (;u[G]; ) G = J + "-" + ++H; } F.id = G; z = new g(z); z.index = n; z.pid = this.id; z._locale(this.lang, this.rtl); z.pos = B; B += C; this.cells.push(z); this.length++; } this.dir = d; this.redraw(); return this.cells; }; r.count = function() { return this.cells && this.cells.length || 0; }; r.destroy = function() { this.clear(); delete u[this.id]; const d = this.el; d.innerHTML = ""; this.body = null; d.className = this._cn || ""; A(d).off(); return this; }; r.exists = function() { return this === u[this.id]; }; r.clear = function() { const d = this.el, h = this.cells, n = this.field, v = this.body, C = this.nav; let B = this.length || 0; for (;0 !== B--; ) delete u[h[B].destroy().id]; this.cells = []; this.length = 0; C && (d.removeChild(C), this.nav = null); v && (n && (n.destroy(), this.counter = this.field = null), this.table && (this.table = null), d === v.parentNode && d.removeChild(v)); this.body = d.appendChild(m.el("", "wg-body")); this._h = null; return this; }; r.resize = function(d, h) { if (!h && (h = this.cells[1], !h)) return; var n = h.index; let v = this.cells, C = A(this.el)[1 === this.dir ? "width" : "height"](), B = v[n + 1]; n = v[n - 1]; h.pos = Math.min((B ? B.pos * C : C) - ((h.body || h.el.firstChild).offsetTop || 0), Math.max(n ? n.pos * C : 0, d)) / C; this.redraw(); this.fire("wgResize"); return this; }; r.distribute = function(d) { let h = -1, n = 0, v; const C = this.cells, B = d.length; for (;++h < B && (v = C[++n]); ) v.pos = Math.max(0, Math.min(1, d[h])); this.redraw(); return this; }; r.distribution = function() { let d = [], h = 0; const n = this.cells, v = n.length - 1; for (;h < v; ) d[h] = n[++h].pos; return d; }; r.restyle = function() { var d = this.css.concat(); 0 === this.index ? d.push("first") : d.push("not-first"); this.dir && (d.push("wg-split"), 2 === this.dir ? d.push("wg-split-y") : d.push("wg-split-x")); this.t && d.push("has-title"); this.nav && d.push("has-nav"); this.field && (d.push("is-field"), this.field.editable() ? d.push("is-editable") : d.push("is-readonly")); d = d.join(" "); d !== this._css && (this._css = d, this.el.className = d); return this; }; r.redraw = function(d) { this.restyle(); const h = this.el; var n = this.body, v = this.field; if (n) { var C = h.clientWidth || 0, B = h.clientHeight || 0, z = n.offsetTop || 0; B = z > B ? 0 : B - z; if (this._h !== B) { this._h = B; n.style.height = String(B) + "px"; var F = v; } this._w !== C && (this._w = C, F = v); F && F.redraw(); } n = this.length; C = 1; B = this.nav; for (z = 2 === this.dir ? "height" : "width"; 0 !== n--; ) v = this.cells[n], B ? F = 1 : (v.fixed && (v.pos = v.fixed / A(h)[z]()), F = C - v.pos, C = v.pos), v.el.style[z] = String(100 * F) + "%", v.redraw(d); return this; }; r.contents = function(d, h) { const n = this.el; let v = this.body; if (null == d) return v.innerHTML; this.length ? this.clear() : v && (n.removeChild(v), v = null); v || (this.body = v = n.appendChild(m.el("", h || "wg-content")), this._h = null, (h = this.lang) && this._locale(h, this.rtl, !0)); "string" === typeof d ? A(v)._html(d) : d && this.append(d); this.redraw(); return this; }; r.textarea = function(d, h) { let n = this.field; if (n) { var v = n.editable(); n.reload(d, h); v !== h && this.restyle(); } else this.length && this.clear(), v = m.el("textarea"), v.setAttribute("wrap", "virtual"), v.setAttribute("autocomplete", "off"), v.setAttribute("id", "wg" + String(++a)), v.value = d, this.contents(v), n = D.require("2f")._new(v)[h ? "enable" : "disable"](), k(this, v), this.field = n, this.restyle(); this.lang || this.locale("en"); return n; }; r.locale = function(d) { d = D.require("29").cast(d); return this._locale(String(d), d.isRTL()); }; r._locale = function(d, h, n) { const v = this.body; if (n || d !== this.lang) this.lang = d, v && v.setAttribute("lang", d); if (n || h !== this.rtl) this.rtl = h, v && v.setAttribute("dir", h ? "RTL" : "LTR"); return this; }; r.editable = function() { let d = this.field; if (d) return d.editable() ? d : null; const h = this.cells; let n = this.navigated(); if (null != n) return h[n].editable(); n = -1; const v = h.length; for (;++n < v && (d = h[n].editable(), null == d); ); return d; }; r.eachTextarea = function(d) { const h = this.field; h ? d(h) : this.each(function(n) { n.eachTextarea(d); }); return this; }; r.append = function(d) { d && (d.nodeType ? l.init(this.body.appendChild(d)) : l.init(A(d).appendTo(this.body))); return this; }; r.prepend = function(d) { const h = this.body; if (d.nodeType) { const n = h.firstChild; l.init(n ? h.insertBefore(d, n) : h.appendChild(d)); } else l.init(A(d).prependTo(h)); return this; }; r.before = function(d) { const h = this.body; d.nodeType ? l.init(this.el.insertBefore(d, h)) : l.init(A(d).insertBefore(h)); return this; }; r.header = function(d, h) { if (null == d && null == h) return this.el.getElementsByTagName("header")[0]; this.t = m.txt(d || ""); this.el.insertBefore(m.el("header", h), this.body).appendChild(this.t); this.redraw(); return this; }; r.toolbar = function() { const d = this.header(), h = d.getElementsByTagName("nav"); return 0 === h.length ? d.appendChild(m.el("nav")) : h[0]; }; r.title = function(d) { const h = this.t; if (h) return h.nodeValue = d || "", h; this.header(d); return this.t; }; r.titled = function() { return this.t && this.t.nodeValue; }; r.bodyY = function() { return q(this.body, this.el); }; r.scrollY = function(d) { if (la === d) return this.body.scrollTop; this.body.scrollTop = d; }; r.tabulate = function(d) { let h = this.table; h ? h.clear() : h = D.require("30").create(this); h.init(d); return this.table = h; }; r.lock = function() { this.body.className += " locked"; return this; }; r.scrollTo = function(d, h) { let n = this.body; var v = n.scrollTop; let C = q(d, n); if (v > C) v = C; else { const B = n.clientHeight; d = C + A(d).outerHeight(); if (B + v < d) v = d - B; else return; } h ? n.scrollTop = v : A(n).stop(!0).animate({ scrollTop: v }, 250); }; r.navigize = function(d, h) { function n(H) { const J = B[H], O = C[H], R = A(J.el).show(); O.addClass("active"); F = H; G.data("idx", H); J.fire("wgTabSelect", [ H ]); return R; } const v = this, C = [], B = v.cells; let z = v.nav, F; z && v.el.removeChild(z); z = v.nav = v.el.insertBefore(m.el("nav", "wg-tabs"), v.body); const G = A(z).on("click", function(H) { const J = A(H.target).data("idx"); if (null == J) return !0; if (null != F) { { const O = C[F]; A(B[F].el).hide(); O.removeClass("active"); } } n(J); v.redraw(); return e(H); }); null == h && (h = G.data("idx") || 0); v.each(function(H, J) { C[J] = A('').data("idx", J).text(d[J]).appendTo(G); H.pos = 0; A(H.el).hide(); }); n(B[h] ? h : 0); v.lock(); v.redraw(); return v; }; r.navigated = function() { const d = this.nav; if (d) return A(d).data("idx"); }; r = null; return w; }({}, K, M)); D.register("1d", function(w, r, E) { function y(a, c) { a.stopPropagation(); q = c; return !0; } function p(a) { const c = "Zero One Two Few Many Other".split(" "); return [ null, [ c[5] ], [ c[1], c[5] ], [ c[1], c[3], c[5] ], [ c[1], c[3], c[4], c[5] ], [ c[1], c[2], c[3], c[4], c[5] ] ][a] || c; } function t(a) { const c = []; a && (a.saved() || c.push("po-unsaved"), a.fuzzy() ? c.push("po-fuzzy") : a.hasFlag() && c.push("po-flagged"), a.valid() || c.push("po-error"), a.translation() || c.push("po-empty"), a.comment() && c.push("po-comment")); return c.join(" "); } function e(a, c, d) { c = A(a.title(c).parentNode); let h = c.find("span.lang"); d ? (d = D.require("29").cast(d), h.length || (h = A("").prependTo(c)), h.attr("lang", d.lang).attr("class", d.getIcon() || "lang region region-" + (d.region || "zz").toLowerCase())) : (h.remove(), d = "en"); a.locale(d); return c; } function b(a, c, d) { c.on("click", function(h) { const n = a.fire(d, [ h.target ]); n || h.preventDefault(); return n; }); } function k(a, c, d, h) { let n = a[c]; return d.length ? (n || (n = h.find("div.meta"), n.length || (n = A('').insertAfter(h.header())), b(a, n, "poMeta"), a[c] = n), n.html(d.join("\n")).show(), !0) : n && n.text() ? (n.text("").hide(), !0) : !1; } function g() { this.dirty = 0; } D.require("3"); const l = D.require("28").html, m = D.require("6").sprintf; let q, x; w.extend = function(a) { return a.prototype = new g(); }; w.localise = function(a) { x = a; return w; }; const u = function() { const a = E.createElement("p"), c = /(src|href|on[a-z]+)\s*=/gi; return function(d) { a.innerHTML = d.replace(c, "data-x-loco-$1="); const h = a.textContent.trim(); return h ? h.replace("data-x-loco-", "") : d.trim(); }; }(), f = g.prototype = D.require("2a").init([ "getListColumns", "getListHeadings", "getListEntry" ], [ "editable", "t" ]); f.init = function() { this.$t = null; this.localise(); this.editable = { source: !0, target: !0 }; this.mode = ""; this.html = !1; return this; }; f.t = function() { return this.$t || x || D.require("1").init(); }; f.localise = function(a) { a || (a = this.t()); const c = []; c[0] = a._x("Source text", "Editor") + ":"; c[3] = a._x("%s translation", "Editor") + ":"; c[4] = a._x("Context", "Editor") + ":"; c[5] = a._x("Comments", "Editor") + ":"; c[1] = a._x("Single", "Editor") + ":"; c[2] = a._x("Plural", "Editor") + ":"; c[6] = a._x("Untranslated", "Editor"); c[7] = a._x("Translated", "Editor"); c[8] = a._x("Toggle Fuzzy", "Editor"); c[9] = a._x("Suggest translation", "Editor"); this.labels = c; this.$t = a; return this; }; f.setRootCell = function(a) { function c(h) { d.redraw(!0, h); return !0; } const d = D.require("2b").init(a); A(r).on("resize", c); this.redraw = c; A(a).on("wgFocus wgBlur", y); this.destroy = function() { d.destroy(); A(r).off("resize", c); }; this.rootDiv = a; return d; }; f.$ = function() { return A(this.rootDiv); }; f.setListCell = function(a) { const c = this; c.listCell = a; a.on("wgRowSelect", function(d, h) { (d = c.po.row(h)) && d !== c.active && c.loadMessage(d); }).on("wgRowDeselect", function(d, h, n) { n || c.loadNothing(); }); }; f.setSourceCell = function(a) { this.sourceCell = a; }; f.setTargetCell = function(a) { this.targetCell = a; }; f.next = function(a, c, d) { const h = this.listTable, n = this.po; let v = h.selected(), C = v, B; for (;null != (v = h.next(a, d, v)); ) { if (C === v) { v = null; break; } if (c && (B = n.row(v), B.translated(0))) continue; break; } null != v && h.select(v, !0); return v; }; f.select = function(a) { this.listTable.select(a); this.focus(); }; f.current = function(a) { const c = this.active; if (null == a) return c; a ? a.is(c) ? (this.reloadMessage(a), this.focus()) : (this.loadMessage(a), a = this.po.indexOf(a), -1 !== a && this.select(a)) : this.unloadActive(); return this; }; f.getTargetOffset = function() { if (this.active) return this.targetCell && this.targetCell.navigated() || 0; }; f.getTargetEditable = function() { return this.editable.target && this.targetCell && this.targetCell.editable(); }; f.getSourceEditable = function() { return this.editable.source && this.sourceCell && this.sourceCell.editable(); }; f.getContextEditable = function() { return this.editable.context && this.contextCell && this.contextCell.editable(); }; f.getFirstEditable = function() { return this.getTargetEditable() || this.getSourceEditable() || this.getContextEditable(); }; f.searchable = function(a) { a && (this.dict = a, this.po && this.rebuildSearch()); return this.dict && !0; }; f.rebuildSearch = function() { const a = this.po.rows, c = a.length, d = this.dict; d.clear(); let h = -1; for (;++h < c; ) d.add(h, a[h].toText()); }; f.filtered = function() { return this.lastSearch || ""; }; f.filter = function(a, c) { const d = this.listTable, h = this.lastFound, n = this.lastSearch || ""; let v, C; a ? (C = this.dict.find(a), v = C.length, v === h && 0 === a.indexOf(n) ? c = !0 : d.filter(C)) : (v = this.po.length, d.unfilter()); this.lastFound = v; this.lastSearch = a; c || this.fire("poFilter", [ a, v ]); return v; }; f.countFiltered = function() { return this.lastSearch ? this.lastFound : this.po.length; }; f.unsave = function(a, c) { let d = !1; if (a) { if (d = a.saved(c)) this.dirty++, a.unsave(c), this.fire("poUnsaved", [ a, c ]); this.reCssRow(a); } return d; }; f.reCssRow = function(a) { var c = this.po.indexOf(a); if ((c = this.listTable.tr(c)) && c.length) { var d = t(a); a = c[0].className; d = a.replace(/(?:^| +)po-[a-z]+/g, "") + " " + d; d !== a && A(c).attr("class", d); } }; f.save = function(a) { const c = this.po; if (this.dirty || a) { const d = [], h = [], n = this.listTable; c.each(function(v, C, B) { C.err && d.push(C); C.saved() || (C.save(), (C = (v = n.row(B)) && v.page) && C.live ? h[C.i] = C.live : v && A(v.cells()).removeClass("po-unsaved")); }); h.length && A(h).find("div.po-unsaved").removeClass("po-unsaved"); this.dirty = 0; this.invalid = d.length ? d : null; this.fire("poSave", []); } return c; }; f.fire = function(a, c) { const d = this.handle; if (d && d[a] && !1 === d[a].apply(this, c || [])) return !1; a = A.Event(a); this.$().trigger(a, c); return !a.isDefaultPrevented(); }; f.on = function(a, c) { this.$().on(a, c); return this; }; f.getSorter = function() { return null; }; f.setLocales = function(a, c) { const d = this.labels; a && a !== this.sourceLocale && (this.sourceLocale = a, this.sourceCell && e(this.sourceCell, d[0], a)); c && c !== this.targetLocale && (this.targetLocale = c, a = m(d[3], c.label || "Target"), this.targetCell && e(this.targetCell, a, c)); }; f.reload = function() { const a = this; var c = a.listCell; const d = a.po; var h = d && d.locale() || a.targetLocale, n = d && d.source() || a.sourceLocale; const v = h && h.isRTL(), C = d && d.length || 0; if (!d || !d.row) return c && c.clear().header("Error").contents("Invalid messages list"), !1; a.setLocales(n, h); a.lastSearch && (a.lastSearch = "", a.lastFound = C, a.fire("poFilter", [ "", C ])); n = (h = a.listTable) && h.thead().distribution(); let B = []; a.listTable = h = c.tabulate({ eachCol: function(z) { const F = a.getListColumns(), G = a.getListHeadings(); for (const H in F) { const J = F[H]; z(J, H, G[J]); } }, eachRow: function(z) { d.each(function(F, G) { a.validate(G) && B.push(G); z(G.idx, a.getListEntry(G), t(G)); }); }, sort: a.getSorter() }); c = a.getListColumns(); for (const z in c) h.sortable(c[z]); n && h.thead().distribute(n); h.tbody().$(v ? "addClass" : "removeClass", [ "is-rtl" ]); a.invalid = B.length ? B : null; return !!C; }; f.load = function(a, c) { this.po = a; this.dict && this.rebuildSearch(); this.reload() && (-1 !== c ? this.listTable.selectRow(c || 0) : this.active && this.unloadActive()); }; f.pasteMessage = function(a) { this.validate(a); if (this.active === a) { let c = this.sourceCell, d = 0; c && c.eachTextarea(function(h) { h.val(a.source(null, d++)); }); (c = this.contextCell) && c.eachTextarea(function(h) { h.val(a.context()); }); if (c = this.targetCell) d = 0, c.eachTextarea(function(h) { h.val(a.translation(d++)); }); } this.updateListCell(a, "source"); this.updateListCell(a, "target"); return this; }; f.reloadMessage = function(a) { const c = this.sourceCell, d = this.targetCell; this.pasteMessage(a); c && this.setSrcMeta(a, c) && c.redraw(); if (d) { var h = d.navigated() || 0; h = this.setTrgMeta(a, h, d); !c && this.setSrcMeta(a, d) && (h = !0); h && (d.redraw(), this.reCssRow(a)); } return this; }; f.setStatus = function() { return null; }; f.setSrcMeta = function(a, c) { const d = []; var h = this.labels, n = a.context(); let v = [], C = a.tags(), B = C && C.length; n && (v.push("" + l(h[4]) + ""), v.push('' + l(n) + "")); if (B && this.getTag) for (v.push("Tagged:"), h = -1; ++h < B; ) (n = this.getTag(C[h])) && v.push("" + l(n.mod_name) + ""); v.length && d.push('"); if (this.getMono() && (n = a.refs()) && (C = n.split(/\s/), B = C.length)) { for (v = []; 0 <= --B; ) n = C[B], v.push("" + l(n) + "");
d.push('");
}
(n = a.format()) && "no-" !== n.substring(0, 3) && d.push('');
(n = a.notes()) && d.push('");
return k(this, "$smeta", d, c);
};
f.setTrgMeta = function(a, c, d) {
const h = [], n = (c = a.errors(c)) && c.length;
if (n) for (let v = 0; v < n; v++) h.push('");
a.tcmt && h.push('");
return k(this, "$tmeta", h, d);
};
f.loadMessage = function(a) {
function c(N) {
if ("=" === N.charAt(0)) {
const L = N.split(" ");
N = L[0].substring(1);
L[0] = [ "Zero", "One", "Two" ][Number(N)] || N;
N = L.join(" ");
}
return N;
}
function d(N, L) {
const S = ma;
var P = da[0];
N.off();
N.titled() !== P && e(N, P, L || "en");
P = !1;
z.setSrcMeta(a, N) && (P = !0);
if (a.plural()) {
P = -1;
let U = [], V = [];
const Y = N.id + "-";
L = a.sourceForms() || L && L.plurals || p(2);
const ea = L.length;
if (2 !== ea || "=" === L[0].charAt(0) && "=1" !== L[0]) for (;++P < ea; ) U[P] = Y + String(P),
V[P] = c(L[P].split(" ", 1)[0]) + ":"; else U = [ Y + "-0", Y + "-1" ], V = [ da[1], da[2] ];
N.splity.apply(N, U);
N.each(function(fa, aa) {
fa.header(V[aa]).textarea(a.source(null, aa), S).setStrf(J).setMode(ba).setInvs(G);
});
N.lock();
S && N.each(function(fa, aa) {
h(fa, aa);
});
} else P && N.redraw(), N.textarea(a.source(), S).setStrf(J).setMode(ba).setInvs(G),
S && h(N, 0);
}
function h(N, L) {
N.on("changing", function(S, P) {
a.source(P, L);
0 === L && z.updateListCell(a, "source");
z.unsave(a, L);
}).on("changed", function() {
0 === L && z.po.reIndex(a);
z.dict && z.rebuildSearch();
z.fire("poUpdate", [ a ]);
});
}
function n(N, L, S, P) {
Z && L.eachTextarea(function(V) {
V.ping();
});
L.off("changing").off("changed");
var U = m(da[3], S.label || "Target");
L.titled() !== U && e(L, U, S);
U = !1;
!N && z.setSrcMeta(a, L) && (U = !0);
z.setTrgMeta(a, P, L) && (U = !0);
z.setStatus(a, P);
if (1 !== S.nplurals && a.pluralized()) {
N = function(W) {
W < aa && (Y.push(c(fa[W])), V.push(ea + String(W)));
};
let V = [], Y = [];
const ea = L.id + "-", fa = a.targetForms() || S.plurals || p(S.nplurals), aa = fa.length;
for (a.eachMsg(N); (S = V.length) < aa; ) N(S);
L.splitx.apply(L, V);
L.each(function(W, ca) {
const na = Z && !a.disabled(ca);
W.textarea(a.translation(ca), na).setStrf(J).setMode(ba).setInvs(G);
Z && v(W, ca);
});
L.navigize(Y, P || null).on("wgTabSelect", function(W, ca) {
(W = Z && W.cell.editable()) && W.focus();
z.setTrgMeta(a, ca, L);
z.setStatus(a, ca);
z.fire("poTab", [ ca ]);
});
} else U && L.redraw(), L.textarea(a.translation(), Z && !a.disabled(0)).setStrf(J).setMode(ba).setInvs(G),
Z && v(L, 0);
}
function v(N, L) {
function S() {
P = null;
z.validate(a);
const V = a.errors(L).join(" ");
U !== V && (U = V, z.setTrgMeta(a, L, N) && N.redraw(), z.reCssRow(a));
}
let P, U = a.errors(L).join(" ");
N.on("changing", function(V, Y, ea) {
P && (clearTimeout(P), P = null);
a.translate(Y, L);
0 === L && z.updateListCell(a, "target");
a.fuzzy(L) && a.saved(L) ? z.fuzzy(!1, a, L) : z.unsave(a, L);
"" === Y ? (z.fire("poEmpty", [ !0, a, L ]), z.setStatus(a, L)) : "" === ea && (z.fire("poEmpty", [ !1, a, L ]),
z.setStatus(a, L));
P = setTimeout(S, U ? 300 : 1e3);
}).on("changed", function() {
z.dict && z.rebuildSearch();
z.fire("poUpdate", [ a ]);
});
}
function C(N) {
N.off();
const L = da[4];
N.titled() !== L && (e(N, L), z.setStatus(null));
N.textarea(a.context(), !0).setMode(ba).setInvs(G);
oa && N.on("changing", function(S, P) {
a.context(P);
z.updateListCell(a, "source");
z.unsave(a, ha);
}).on("changed", function() {
z.po.reIndex(a);
z.dict && z.rebuildSearch();
z.fire("poUpdate", [ a ]);
});
}
function B(N) {
const L = da[5];
N.titled() !== L && e(N, L);
N.off().on("changing", function(S, P) {
a.comment(P);
z.fire("poComment", [ a, P ]);
z.unsave(a, ha);
}).textarea(a.comment(), !0);
}
const z = this;
var F = a.isHTML();
const G = z.inv || !1, H = this.fmt || null, J = a.format() || null, O = a.is(z.active), R = z.sourceCell, I = z.targetCell, Q = z.contextCell, X = z.commentCell, Z = z.editable.target, ma = z.editable.source, oa = z.editable.context, pa = z.sourceLocale, ka = z.targetLocale, da = z.labels;
let ha = 0, ba = z.mode, ia = q;
z.html !== F && (z.html = F, "code" !== z.mode && (ba = F ? "html" : "", z.setMode(ba)));
z.active = a;
R && d(R, pa);
Q && C(Q);
I && ka && (ha = I.navigated() || 0, n(R, I, ka, ha));
X && B(X);
ia && (ia.exists() || (ia = ia.parent()), (F = ia.editable()) && F.focus());
H !== J && (this.fmt = J);
O || z.fire("poSelected", [ a, ha ]);
};
f.unloadActive = function() {
function a(d) {
d && d.text("").hide();
}
function c(d) {
d && d.off().clear();
}
a(this.$smeta);
a(this.$tmeta);
c(this.sourceCell);
c(this.contextCell);
c(this.targetCell);
this.commentCell && this.commentCell.off();
this.active && (this.fire("poDeselected", [ this.active ]), this.active = null);
return this;
};
f.loadNothing = function() {
const a = this.t(), c = this.mode || "", d = this.inv || !1, h = this.fmt;
this.unloadActive();
this.setStatus(null);
let n = this.commentCell;
n && n.textarea("", !1);
if (n = this.sourceCell) n.textarea("", !1).setStrf(h).setMode(c).setInvs(d), n.title(a._x("Source text not loaded", "Editor") + ":");
if (n = this.contextCell) n.textarea("", !1).setMode(c).setInvs(d), n.title(a._x("Context not loaded", "Editor") + ":");
if (n = this.targetCell) n.textarea("", !1).setStrf(h).setMode(c).setInvs(d), n.title(a._x("Translation not loaded", "Editor") + ":");
this.fire("poSelected", [ null ]);
};
f.updateListCell = function(a, c) {
c = this.getListColumns()[c];
a = this.po.indexOf(a);
(a = this.listTable.row(a)) && a.rendered && a.update(c);
};
f.cellText = function(a) {
return (a = -1 !== a.indexOf("<") || -1 !== a.indexOf("&") ? u(a) : a.trim()) || " ";
};
f.fuzzy = function(a, c, d) {
c = c || this.active;
const h = c.fuzzy(d);
!0 !== a || h ? !1 === a && h && this.flag(0, c, d) && this.fire("poFuzzy", [ c, !1, d ]) : this.flag(4, c, d) && this.fire("poFuzzy", [ c, !0, d ]);
return h;
};
f.flag = function(a, c, d) {
if (!c) {
c = this.active;
d = this.getTargetOffset();
if (null == d) return null;
d && c.targetForms() && (d = 0);
}
const h = c.flagged(d);
if (null == a) return h;
if (h === a || a && !c.translated(d) || !this.fire("poFlag", [ a, h, c, d ])) return !1;
c.flag(a, d);
this.fire("poUpdate", [ c ]) && this.unsave(c, d);
this.setStatus(c, d);
return !0;
};
f.add = function(a, c) {
let d, h = this.po.get(a, c);
h ? d = this.po.indexOf(h) : (d = this.po.length, h = this.po.add(a, c), this.load(this.po, -1),
this.fire("poAdd", [ h ]), this.fire("poUpdate", [ h ]));
this.lastSearch && this.filter("");
this.listTable.select(d);
return h;
};
f.del = function(a) {
if (a = a || this.active) {
var c = this.lastSearch, d = this.po.del(a);
null != d && (this.unsave(a), this.fire("poDel", [ a ]), this.fire("poUpdate", [ a ]),
this.reload(), this.dict && this.rebuildSearch(), this.active && this.active.equals(a) && this.unloadActive(),
this.po.length && (c && this.filter(c), this.active || (d = Math.min(d, this.po.length - 1),
this.listTable.select(d))));
}
};
f.setMono = function(a) {
return this.setMode(a ? "code" : this.html ? "html" : "");
};
f.setMode = function(a) {
if (this.mode !== a) {
this.mode = a;
this.callTextareas(function(h) {
h.setMode(a);
});
const c = this.active, d = this.sourceCell;
c && c.refs() && d && this.setSrcMeta(c, d) && d.redraw();
this.fire("poMode", [ a ]);
}
return this;
};
f.getMono = function() {
return "code" === this.mode;
};
f.setInvs = function(a) {
(this.inv || !1) !== a && (this.inv = a, this.callTextareas(function(c) {
c.setInvs(a);
}), this.fire("poInvs", [ a ]));
return this;
};
f.getInvs = function() {
return this.inv || !1;
};
f.callTextareas = function(a) {
var c = this.targetCell;
c && c.eachTextarea(a);
(c = this.contextCell) && c.eachTextarea(a);
(c = this.sourceCell) && c.eachTextarea(a);
return this;
};
f.focus = function() {
const a = this.getTargetEditable();
a && a.focus();
return this;
};
f.validate = function(a) {
return 0;
};
return w;
}({}, K, M));
D.register("1e", function(w, r, E) {
w.init = function() {
const y = /%([1-9]\d*\$)?[s%]/, p = /%([1-9]\d*\$)?(?:'.|[-+0 ])*\d*(?:\.\d+)?(.|$)/g;
return {
parse: function(t, e) {
const b = e && e.count || 0;
e = e && e.types || {};
let k = !0, g = 0, l = 0;
for (var m; null != (m = p.exec(t)); ) {
const q = m[2];
if ("%" !== q || "%%" !== m[0]) {
if ("" === q || -1 === "suxXbcdeEfFgGo".indexOf(q)) {
k = !1;
break;
}
null == m[1] ? m = ++l : (m = parseInt(m[1]), g = Math.max(g, m));
null == e[m] && (e[m] = {});
e[m][q] = !0;
}
}
if (k) return {
valid: !0,
count: Math.max(g, l, b),
types: e
};
p.lastIndex = 0;
return {
valid: !1,
count: 0,
types: {}
};
},
sniff: function(t) {
return y.test(t);
}
};
};
return w;
}({}, K, M));
D.register("d", function(w, r, E) {
function y() {
this.init();
}
function p(g) {
g = A('');
D.require("c").init(g);
return g;
}
function t(g) {
return p("cloud").attr("title", g.labels[8] + " (Ctrl-U)").on("click", function(l) {
l.preventDefault();
g.focus().fuzzy(!g.fuzzy());
});
}
function e(g) {
return p("robot").attr("title", g.labels[9] + " (Ctrl-J)").on("click", function(l) {
l.preventDefault();
g.fire("poHint");
});
}
function b(g, l) {
return D.require("6").vsprintf(g, l);
}
w.init = function(g) {
const l = new y();
g = l.setRootCell(g);
var m = g.splity("po-list", "po-edit");
let q = m[0], x = m[1];
m = x.splitx("po-trans", "po-comment");
var u = m[0];
let f = m[1].header("Loading..");
m = u.splity("po-source", "po-target");
u = m[0].header("Loading..");
m = m[1].header("Loading..");
g.distribute([ .34 ]);
x.distribute([ .8 ]);
l.setListCell(q);
l.setSourceCell(u);
l.setTargetCell(m);
l.commentCell = f;
l.editable.source = !1;
return l;
};
r = y.prototype = D.require("1d").extend(y);
r.getListHeadings = function() {
const g = this.t(), l = [ g._x("Source text", "Editor") ];
this.targetLocale && (l[1] = g._x("Translation", "Editor"));
return l;
};
r.getListColumns = function() {
const g = {
source: 0
};
this.targetLocale && (g.target = 1);
return g;
};
r.getListEntry = function(g) {
const l = this.cellText, m = [ function() {
let q, x = l(g.source() || ""), u = g.context();
return u ? (q = E.createElement("p"), q.appendChild(E.createElement("mark")).innerText = u,
q.appendChild(E.createTextNode(" " + x)), q) : x;
} ];
this.targetLocale && (m[1] = function() {
return l(g.translation() || "");
});
return m;
};
r.stats = function() {
let g = this.po, l = g.length, m = 0, q = 0, x = 0;
g.each(function(u, f) {
f.fuzzy() ? x++ : f.translated() ? m++ : q++;
});
return {
t: l,
p: m.percent(l) + "%",
f: x,
u: q
};
};
r.unlock = function() {
const g = this.targetLocale;
this._unlocked || (this.editable = {
source: !0,
context: !0,
target: !1
}, this.po && this.po.unlock(), this.contextCell = this.targetCell, delete this.targetCell,
g && (this._unlocked = g, delete this.targetLocale, this.reload(), this.fire("poLock", [ !1 ])),
this.active && this.loadMessage(this.active));
};
r.lock = function() {
const g = this._unlocked;
g && (this.targetLocale = g, delete this._unlocked, this.po && this.po.lock(g),
this.editable = {
source: !1,
context: !1,
target: !0
}, this.targetCell = this.contextCell, delete this.contextCell, this.reload(), this.fire("poLock", [ !0, g ]),
this.active && this.loadMessage(this.active));
};
r.locked = function() {
return !this._unlocked;
};
r.setStatus = function(g) {
let l = this.$tnav;
if (null == g) l && (l.remove(), this.$tnav = null); else {
l || (this.$tnav = l = A("").append(t(this)).append(e(this)).appendTo(this.targetCell.header()));
var m = [];
g.translated() ? g.fuzzy() && m.push("po-fuzzy") : m.push("po-empty");
l.attr("class", m.join(" "));
}
};
r.getSorter = function() {
function g(q, x) {
const u = q.weight(), f = x.weight();
return u === f ? l(q, x) : u > f ? -1 : 1;
}
function l(q, x) {
return q.hash().localeCompare(x.hash());
}
const m = this;
return function(q) {
const x = m.po, u = m.locked() ? g : l;
q.sort(function(f, a) {
return u(x.row(f), x.row(a));
});
};
};
r.validate = function(g) {
g.err = null;
if (g.untranslated(0)) return 0;
const l = [];
let m = this.validateMessagePrintf(g, l);
m && (g.err = l);
return m;
};
r.validateMessagePrintf = function(g, l) {
const m = g.format();
if ("no-" === m.substring(0, 3)) return 0;
const q = g.msgid(), x = g.msgidPlural();
null == k && (k = D.require("1e").init());
var u = k;
if (!("" !== m || u.sniff(q) || "" !== x && u.sniff(x))) return 0;
let f = 0, a = u.parse(q);
x && a.valid && (a = u.parse(x, a));
if (!a.valid) return 0;
let c = a.count;
if (0 !== c || "" !== m) {
var d = this;
g.eachMsg(function(h, n) {
l[h] = [];
if ("" !== n) {
n = u.parse(n);
var v = n.count;
h = l[h];
if (n.valid) if (v > c) h.push(b(d.t()._("Too many placeholders; source text formatting suggests a maximum of %s"), [ c ])),
f++; else if (v < c && "" === x) h.push(b(d.t()._("Missing placeholders; source text formatting suggests at least %s"), [ c ])),
f++; else {
v = a.types;
for (const C in n.types) for (const B in n.types[C]) if (null == v[C] || null == v[C][B]) {
h.push(d.t()._("Mismatching placeholder type; check against source text formatting"));
f++;
return;
}
} else h.push(d.t()._("Possible syntax error in string formatting")), f++;
}
});
return f;
}
};
r.handle = {};
let k;
return w;
}({}, K, M));
D.register("e", function(w, r, E) {
const y = {
copy: 66,
clear: 75,
save: 83,
fuzzy: 85,
next: 40,
prev: 38,
enter: 13,
invis: 73,
hint: 74
}, p = {
38: !0,
40: !0,
73: !0
}, t = {
66: function(e, b) {
if (e = b.current()) e.normalize(), b.focus().pasteMessage(e);
},
75: function(e, b) {
if (e = b.current()) e.untranslate(), b.focus().pasteMessage(e);
},
85: function(e, b) {
b.focus().fuzzy(!b.fuzzy());
},
13: function(e, b) {
b.getFirstEditable() && b.next(1, !0, !0);
},
40: function(e, b) {
e = e.shiftKey;
b.next(1, e, e);
},
38: function(e, b) {
e = e.shiftKey;
b.next(-1, e, e);
},
73: function(e, b) {
if (!e.shiftKey) return !1;
b.setInvs(!b.getInvs());
}
};
w.init = function(e, b) {
function k(l) {
if (l.isDefaultPrevented() || !l.metaKey && !l.ctrlKey) return !0;
const m = l.which;
if (!g[m]) return !0;
const q = t[m];
if (!q || l.altKey || l.shiftKey && !p[m] || !1 === q(l, e)) return !0;
l.stopPropagation();
l.preventDefault();
return !1;
}
const g = {};
A(b || r).on("keydown", k);
return {
add: function(l, m) {
t[y[l]] = m;
return this;
},
enable: function() {
for (const l in arguments) g[y[arguments[l]]] = !0;
return this;
},
disable: function() {
A(b || r).off("keydown", k);
e = b = null;
for (const l in t) g[l] = !1;
}
};
};
return w;
}({}, K, M));
D.register("1f", function(w, r, E) {
function y() {
this.reIndex([]);
}
w.init = function() {
return new y();
};
r = y.prototype;
r.reIndex = function(p) {
const t = {}, e = p.length;
let b = -1;
for (;++b < e; ) t[p[b]] = b;
this.keys = p;
this.length = b;
this.ords = t;
};
r.key = function(p, t) {
if (null == t) return this.keys[p];
const e = this.keys[p], b = this.ords[t];
if (t !== e) {
if (null != b) throw Error("Clash with item at [" + b + "]");
this.keys[p] = t;
delete this.ords[e];
this.ords[t] = p;
}
return p;
};
r.indexOf = function(p) {
p = this.ords[p];
return null == p ? -1 : p;
};
r.add = function(p, t) {
let e = this.ords[p];
null == e && (this.keys[this.length] = p, e = this.ords[p] = this.length++);
this[e] = t;
return e;
};
r.get = function(p) {
return this[this.ords[p]];
};
r.has = function(p) {
return null != this.ords[p];
};
r.del = function(p) {
this.cut(this.ords[p], 1);
};
r.cut = function(p, t) {
t = t || 1;
const e = [].splice.call(this, p, t);
this.keys.splice(p, t);
this.reIndex(this.keys);
return e;
};
r.each = function(p) {
const t = this.keys, e = this.length;
let b = -1;
for (;++b < e; ) p(t[b], this[b], b);
return this;
};
r.sort = function(p) {
const t = this.length, e = this.keys, b = this.ords, k = [];
let g = -1;
for (;++g < t; ) k[g] = [ this[g], e[g] ];
k.sort(function(m, q) {
return p(m[0], q[0]);
});
for (g = 0; g < t; g++) {
var l = k[g];
this[g] = l[0];
l = l[1];
e[g] = l;
b[l] = g;
}
return this;
};
r.join = function(p) {
return [].join.call(this, p);
};
return w;
}({}, K, M));
D.register("20", function(w, r, E) {
function y(p, t) {
var e = new RegExp("^.{0," + (p - 1) + "}[" + t + "]"), b = new RegExp("^[^" + t + "]+");
return function(k, g) {
for (var l = k.length, m; l > p; ) {
m = e.exec(k) || b.exec(k);
if (null == m) break;
m = m[0];
g.push(m);
m = m.length;
l -= m;
k = k.substring(m);
}
0 !== l && g.push(k);
return g;
};
}
w.create = function(p) {
function t(q) {
return g[q] || "\\" + q;
}
var e = /(?:\r\n|[\r\n\v\f\u2028\u2029])/g, b = /[ \r\n]+/g, k = /[\t\v\f\x07\x08\\"]/g, g = {
"\t": "\\t",
"\v": "\\v",
"\f": "\\f",
"": "\\a",
"\b": "\\b"
};
if (null == p || isNaN(p = Number(p))) p = 79;
if (0 < p) {
var l = y(p - 3, " ");
var m = y(p - 2, "-– \\.,:;\\?!\\)\\]\\}\\>");
}
return {
pair: function(q, x) {
if (!x) return q + ' ""';
x = x.replace(k, t);
var u = 0;
x = x.replace(e, function() {
u++;
return "\\n\n";
});
if (!(u || p && p < x.length + q.length + 3)) return q + ' "' + x + '"';
q = [ q + ' "' ];
x = x.split("\n");
if (m) for (var f = -1, a = x.length; ++f < a; ) m(x[f], q); else q = q.concat(x);
return q.join('"\n"') + '"';
},
prefix: function(q, x) {
q = q.split(e);
return x + q.join("\n" + x);
},
refs: function(q) {
q = q.replace(b, " ", q);
l && (q = l(q, []).join("\n#: "));
return "#: " + q;
}
};
};
return w;
}({}, K, M));
D.register("2c", function(w, r, E) {
function y() {
this.length = 0;
}
w.init = function() {
return new y();
};
r = y.prototype;
r.push = function(p) {
this[this.length++] = p;
return this;
};
r.sort = function(p) {
[].sort.call(this, p);
return this;
};
r.each = function(p) {
for (var t = -1, e = this.length; ++t < e; ) p(t, this[t]);
return this;
};
return w;
}({}, K, M));
D.register("21", function(w, r, E) {
function y() {}
w.extend = function(p) {
return p.prototype = new y();
};
r = y.prototype = D.require("2a").init([ "load" ]);
r.row = function(p) {
return this.rows[p];
};
r.lock = function(p) {
return this.locale(p || {
lang: "zxx",
label: "",
nplurals: 2,
pluraleq: "n!=1"
});
};
r.unlock = function() {
const p = this.loc;
this.loc = null;
return p;
};
r.locale = function(p) {
null == p ? p = this.loc : this.loc = p = D.require("29").cast(p);
return p;
};
r.source = function(p) {
null == p ? p = this.src || D.require("29").cast({
lang: "en",
label: "English",
nplurals: 2,
pluraleq: "n!=1"
}) : this.src = p = D.require("29").cast(p);
return p;
};
r.each = function(p) {
this.rows.each(p);
return this;
};
r.indexOf = function(p) {
"object" !== typeof p && (p = this.get(p));
if (!p) return -1;
null == p.idx && (p.idx = this.rows.indexOf(p.hash()));
return p.idx;
};
r.get = function(p) {
return this.rows && this.rows.get(p);
};
r.has = function(p) {
return this.rows && this.rows.has(p);
};
r.del = function(p) {
p = this.indexOf(p);
if (-1 !== p) {
const t = this.rows.cut(p, 1);
if (t && t.length) return this.length = this.rows.length, this.rows.each(function(e, b, k) {
b.idx = k;
}), p;
}
};
r.reIndex = function(p, t) {
const e = p.hash(), b = this.indexOf(p), k = this.rows.indexOf(e);
return k === b ? b : -1 !== k ? (t = (t || 0) + 1, p.source("Error, duplicate " + String(t) + ": " + p.source()),
this.reIndex(p, t)) : this.rows.key(b, e);
};
r.sort = function(p) {
this.rows.sort(p);
return this;
};
r.export = function() {
const p = this.rows, t = p.length, e = D.require("2c").init();
let b = -1;
for (;++b < t; ) e.push(p[b]);
return e;
};
return w;
}({}, K, M));
D.register("22", function(w, r, E) {
function y(e, b, k) {
if (null == k) return e[b] || "";
e[b] = k || "";
return e;
}
function p() {
this._id = this.id = "";
}
function t(e, b) {
const k = e.length;
let g = -1;
for (;++g < k; ) b(g, e[g]);
}
w.extend = function(e) {
return e.prototype = new p();
};
r = p.prototype;
r.flag = function(e, b) {
const k = this.flg || (this.flg = []);
if (null != b) k[b] = e; else for (b = Math.max(k.length, this.src.length, this.msg.length); 0 !== b--; ) k[b] = e;
return this;
};
r.flagged = function(e) {
return (this.flg || [])[e || 0] || 0;
};
r.hasFlag = function() {
const e = this.flg || [];
let b = e.length;
for (;0 !== b--; ) if (this.isFlag(e[b])) return !0;
return !1;
};
r.isFlag = function(e) {
return 0 < e;
};
r.flags = function() {
const e = {}, b = [], k = this.flg || [];
let g = k.length;
for (;0 !== g--; ) {
const l = k[g];
e[l] || (e[l] = !0, b.push(l));
}
return b;
};
r.flaggedAs = function(e, b) {
const k = this.flg || [];
if (null != b) return e === k[b] || 0;
for (b = k.length; 0 !== b--; ) if (k[b] === e) return !0;
return !1;
};
r.fuzzy = function(e, b) {
const k = this.flaggedAs(4, e);
null != b && this.flag(b ? 4 : 0, e);
return k;
};
r.source = function(e, b) {
if (null == e) return this.src[b || 0] || "";
this.src[b || 0] = e;
return this;
};
r.plural = function(e, b) {
if (null == e) return this.src[b || 1] || "";
this.src[b || 1] = e || "";
return this;
};
r.sourceForms = function() {
return this.srcF;
};
r.targetForms = function() {
return this.msgF;
};
r.each = function(e) {
const b = this.src, k = this.msg, g = Math.max(b.length, k.length);
let l = -1;
for (;++l < g; ) e(l, b[l], k[l]);
return this;
};
r.eachSrc = function(e) {
t(this.src, e);
return this;
};
r.eachMsg = function(e) {
t(this.msg, e);
return this;
};
r.count = function() {
return Math.max(this.src.length, this.msg.length);
};
r.pluralized = function() {
return 1 < this.src.length || 1 < this.msg.length;
};
r.translate = function(e, b) {
this.msg[b || 0] = e || "";
return this;
};
r.untranslate = function(e) {
if (null != e) this.msg[e] = ""; else {
const b = this.msg, k = b.length;
for (e = 0; e < k; e++) b[e] = "";
}
return this;
};
r.translation = function(e) {
return this.msg[e || 0] || "";
};
r.errors = function(e) {
return this.err && this.err[e || 0] || [];
};
r.valid = function() {
return null == this.err;
};
r.translated = function(e) {
if (null != e) return !!this.msg[e];
const b = this.msg, k = b.length;
for (e = 0; e < k; e++) if (!b[e]) return !1;
return !0;
};
r.untranslated = function(e) {
if (null != e) return !this.msg[e];
const b = this.msg, k = b.length;
for (e = 0; e < k; e++) if (b[e]) return !1;
return !0;
};
r.comment = function(e) {
return y(this, "cmt", e);
};
r.notes = function(e) {
return y(this, "xcmt", e);
};
r.refs = function(e) {
return y(this, "rf", e);
};
r.format = function(e) {
return y(this, "fmt", e);
};
r.context = function(e) {
return y(this, "ctx", e);
};
r.tags = function() {
return this.tg;
};
r.getMax = function(e) {
return (this.mx || [ 0 ])[e] || 0;
};
r.toString = r.toText = function() {
return this.src.concat(this.msg, [ this.id, this.ctx ]).join(" ");
};
r.weight = function() {
let e = 0;
this.translation() || (e += 2);
this.fuzzy() && (e += 1);
return e;
};
r.equals = function(e) {
return this === e || this.hash() === e.hash();
};
r.hash = function() {
return this.id;
};
r.normalize = function() {
let e = -1, b = this.msg.length;
for (;++e < b; ) this.msg[e] = this.src[Math.min(e, 1)] || "";
};
r.disabled = function(e) {
return !!(this.lck || [])[e || 0];
};
r.disable = function(e) {
(this.lck || (this.lck = []))[e || 0] = !0;
return this;
};
r.saved = function(e) {
const b = this.drt;
if (null == b) return !0;
if (null != e) return !b[e];
for (e = b.length; 0 !== e--; ) if (b[e]) return !1;
return !0;
};
r.unsave = function(e) {
(this.drt || (this.drt = []))[e || 0] = !0;
return this;
};
r.save = function(e) {
null == e ? this.drt = null : (this.drt || (this.drt = []))[e] = !1;
return this;
};
r.is = function(e) {
return e && (e === this || e.idx === this.idx);
};
r.isHTML = function(e) {
if (null == e) return this.htm || !1;
this.htm = e;
};
r = null;
return w;
}({}, K, M));
D.register("f", function(w, r, E) {
function y(g) {
return {
"Project-Id-Version": "PACKAGE VERSION",
"Report-Msgid-Bugs-To": "",
"POT-Creation-Date": g || "",
"PO-Revision-Date": g || "",
"Last-Translator": "",
"Language-Team": "",
Language: "",
"Plural-Forms": "",
"MIME-Version": "1.0",
"Content-Type": "text/plain; charset=UTF-8",
"Content-Transfer-Encoding": "8bit"
};
}
function p(g, l) {
g = g || "";
l && (g += "\0" + l);
return g;
}
function t(g) {
const l = r.console;
l && l.error && l.error(g.message || String(g));
}
function e(g) {
return D.require("20").create(g);
}
function b(g) {
this.locale(g);
this.clear();
this.head = y(this.now());
}
function k(g, l) {
this.src = [ g || "" ];
this.msg = [ l || "" ];
}
w.create = function(g) {
return new b(g);
};
E = D.require("21").extend(b);
E.clear = function() {
this.rows = D.require("1f").init();
this.length = 0;
return this;
};
E.now = function() {
function g(f, a) {
for (f = String(f); f.length < a; ) f = "0" + f;
return f;
}
var l = new Date();
const m = l.getUTCFullYear(), q = l.getUTCMonth() + 1, x = l.getUTCDate(), u = l.getUTCHours();
l = l.getUTCMinutes();
return g(m, 4) + "-" + g(q, 2) + "-" + g(x, 2) + " " + g(u, 2) + ":" + g(l, 2) + "+0000";
};
E.header = function(g, l) {
const m = this.head || (this.head = {});
if (null == l) return this.headers()[g] || "";
m[g] = l || "";
return this;
};
E.headers = function(g) {
const l = this.now(), m = this.head || (this.head = y(l));
if (null != g) {
for (x in g) m[x] = g[x];
return this;
}
const q = this.locale();
g = {};
for (x in m) g[x] = String(m[x]);
if (q) {
g.Language = String(q) || "zxx";
g["Language-Team"] = q.label || g.Language;
g["Plural-Forms"] = "nplurals=" + (q.nplurals || "2") + "; plural=" + (q.pluraleq || "n!=1") + ";";
var x = "PO-Revision-Date";
} else g.Language = "", g["Plural-Forms"] = "nplurals=INTEGER; plural=EXPRESSION;",
g["PO-Revision-Date"] = "YEAR-MO-DA HO:MI+ZONE", x = "POT-Creation-Date";
g[x] || (g[x] = l);
g["X-Generator"] = "Loco https://localise.biz/";
return g;
};
E.get = function(g, l) {
g = p(g, l);
return this.rows.get(g);
};
E.add = function(g, l) {
g instanceof k || (g = new k(g));
l && g.context(l);
l = g.hash();
this.rows.get(l) ? t("Duplicate message at index " + this.indexOf(g)) : (g.idx = this.rows.add(l, g),
this.length = this.rows.length);
return g;
};
E.load = function(g) {
let l = -1, m, q;
var x;
let u, f, a, c = (x = this.locale()) && x.nplurals || 2, d = [];
for (;++l < g.length; ) m = g[l], null == m.parent ? (q = m.source || m.id, x = m.target || "",
u = m.context, q || u ? (f = new k(q, x), f._id = m._id, u && f.context(u), m.flag && f.flag(m.flag, 0),
m.comment && f.comment(m.comment), m.notes && f.notes(m.notes), m.refs && f.refs(m.refs),
f.format(m.format), m.message = f, this.add(f), m.prev && m.prev[0] && (f.prev(m.prev[0].source, m.prev[0].context),
m.prev[1] && f._src.push(m.prev[1].source || ""))) : 0 === l && "object" === typeof x && (this.head = x,
this.headcmt = m.comment)) : d.push(m);
for (l = -1; ++l < d.length; ) try {
m = d[l];
q = m.source || m.id;
f = g[m.parent] && g[m.parent].message;
if (!f) throw Error("parent missing for plural " + q);
a = m.plural;
1 === a && f.plural(q);
a >= c || (m.flag && f.flag(m.flag, a), f.translate(m.target || "", a), m.format && !f.format() && f.format(m.format));
} catch (h) {
t(h);
}
return this;
};
E.wrap = function(g) {
this.fmtr = e(g);
return this;
};
E.toString = function() {
var g, l = this.locale(), m = [], q = [], x = this.headers(), u = !l, f = l && l.nplurals || 2, a = this.fmtr || e();
x[l ? "PO-Revision-Date" : "POT-Creation-Date"] = this.now();
for (g in x) q.push(g + ": " + x[g]);
q = new k("", q.join("\n"));
q.comment(this.headcmt || "");
u && q.fuzzy(0, !0);
m.push(q.toString());
m.push("");
this.rows.each(function(c, d) {
c && (m.push(d.cat(a, u, f)), m.push(""));
});
return m.join("\n");
};
E = D.require("22").extend(k);
E.msgid = function() {
return this.src[0];
};
E.msgidPlural = function() {
return this.src[1] || "";
};
E.prev = function(g, l) {
this._src = [ g || "" ];
this._ctx = l;
};
E.hash = function() {
return p(this.source(), this.context());
};
E.toString = function() {
return this.cat(e());
};
E.cat = function(g, l, m) {
var q = [], x;
(x = this.cmt) && q.push(g.prefix(x, "# "));
(x = this.xcmt) && q.push(g.prefix(x, "#. "));
var u = this.rf;
if (x = this._id) u += (u ? " " : "") + "loco:" + x;
u && /\S/.test(u) && q.push(g.refs(u));
!l && this.fuzzy() && q.push("#, fuzzy");
(x = this.fmt) && q.push("#, " + x + "-format");
(x = this._ctx) && q.push(g.prefix(g.pair("msgctxt", x), "#| "));
if (x = this._src) x[0] && q.push(g.prefix(g.pair("msgid", x[0]), "#| ")), x[1] && q.push(g.prefix(g.pair("msgid_plural", x[1]), "#| "));
(x = this.ctx) && q.push(g.pair("msgctxt", x));
q.push(g.pair("msgid", this.src[0]));
if (null == this.src[1]) q.push(g.pair("msgstr", l ? "" : this.msg[0])); else for (u = -1,
q.push(g.pair("msgid_plural", this.src[1])), x = this.msg || [ "", "" ], m = m || x.length; ++u < m; ) q.push(g.pair("msgstr[" + u + "]", l ? "" : x[u] || ""));
return q.join("\n");
};
E.compare = function(g, l) {
let m = this.weight(), q = g.weight();
if (m > q) return 1;
if (m < q) return -1;
if (l) {
m = this.hash().toLowerCase();
q = g.hash().toLowerCase();
if (m < q) return 1;
if (m > q) return -1;
}
return 0;
};
E.copy = function() {
let g = new k(), l, m;
for (l in this) this.hasOwnProperty(l) && ((m = this[l]) && m.concat && (m = m.concat()),
g[l] = m);
return g;
};
return w;
}({}, K, M));
D.register("11", function(w, r, E) {
w.init = function(y, p) {
function t() {
return g || (g = A('').dialog({
dialogClass: "loco-modal loco-modal-wide",
modal: !0,
autoOpen: !1,
closeOnEscape: !0,
resizable: !1,
height: 500
}));
}
function e(l, m, q) {
l = A("").text(q);
t().dialog("close").html("").dialog("option", "title", "Error").append(l).dialog("open");
}
function b(l) {
const m = l && l.code;
if (m) {
for (var q = m.length, x = A("