UNPKG

@sheetxl/studio-vanilla

Version:

SheetXL Studio - Vanilla entry point for integrating SheetXL UI.

1,015 lines 101 kB
/** * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.7.27 * * (C) 2025-present SheetXL Inc. & Michael T. Ford * License: The license can be found at https://www.sheetxl.com/license. */ var nr, _ = {}, ne = {}; function ke() { if (nr) return ne; function S(a, m) { return m === void 0 && (m = Object), m && typeof m.getOwnPropertyDescriptors == "function" && (a = m.create(null, m.getOwnPropertyDescriptors(a))), m && typeof m.freeze == "function" ? m.freeze(a) : a; } function c(a, m) { return Object.prototype.hasOwnProperty.call(a, m); } nr = 1; var I = S({ allowfullscreen: !0, async: !0, autofocus: !0, autoplay: !0, checked: !0, controls: !0, default: !0, defer: !0, disabled: !0, formnovalidate: !0, hidden: !0, ismap: !0, itemscope: !0, loop: !0, multiple: !0, muted: !0, nomodule: !0, novalidate: !0, open: !0, playsinline: !0, readonly: !0, required: !0, reversed: !0, selected: !0 }), R = S({ area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 }), g = S({ script: !1, style: !1, textarea: !0, title: !0 }); function h(a) { return a === H.HTML; } var H = S({ HTML: "text/html", XML_APPLICATION: "application/xml", XML_TEXT: "text/xml", XML_XHTML_APPLICATION: "application/xhtml+xml", XML_SVG_IMAGE: "image/svg+xml" }), $ = Object.keys(H).map(function(a) { return H[a]; }), z = S({ HTML: "http://www.w3.org/1999/xhtml", SVG: "http://www.w3.org/2000/svg", XML: "http://www.w3.org/XML/1998/namespace", XMLNS: "http://www.w3.org/2000/xmlns/" }); return ne.assign = function(a, m) { if (a === null || typeof a != "object") throw new TypeError("target is not an object"); for (var p in m) c(m, p) && (a[p] = m[p]); return a; }, ne.find = function(a, m, p) { if (p === void 0 && (p = Array.prototype), a && typeof p.find == "function") return p.find.call(a, m); for (var ae = 0; ae < a.length; ae++) if (c(a, ae)) { var q = a[ae]; if (m.call(void 0, q, ae, a)) return q; } }, ne.freeze = S, ne.HTML_BOOLEAN_ATTRIBUTES = I, ne.HTML_RAW_TEXT_ELEMENTS = g, ne.HTML_VOID_ELEMENTS = R, ne.hasDefaultHTMLNamespace = function(a) { return h(a) || a === H.XML_XHTML_APPLICATION; }, ne.hasOwn = c, ne.isHTMLBooleanAttribute = function(a) { return c(I, a.toLowerCase()); }, ne.isHTMLRawTextElement = function(a) { var m = a.toLowerCase(); return c(g, m) && !g[m]; }, ne.isHTMLEscapableRawTextElement = function(a) { var m = a.toLowerCase(); return c(g, m) && g[m]; }, ne.isHTMLMimeType = h, ne.isHTMLVoidElement = function(a) { return c(R, a.toLowerCase()); }, ne.isValidMimeType = function(a) { return $.indexOf(a) > -1; }, ne.MIME_TYPE = H, ne.NAMESPACE = z, ne; } var or, Ue = {}; function Xe() { if (or) return Ue; function S(a, m) { a.prototype = Object.create(Error.prototype, { constructor: { value: a }, name: { value: a.name, enumerable: !0, writable: m } }); } or = 1; var c = ke().freeze({ Error: "Error", IndexSizeError: "IndexSizeError", DomstringSizeError: "DomstringSizeError", HierarchyRequestError: "HierarchyRequestError", WrongDocumentError: "WrongDocumentError", InvalidCharacterError: "InvalidCharacterError", NoDataAllowedError: "NoDataAllowedError", NoModificationAllowedError: "NoModificationAllowedError", NotFoundError: "NotFoundError", NotSupportedError: "NotSupportedError", InUseAttributeError: "InUseAttributeError", InvalidStateError: "InvalidStateError", SyntaxError: "SyntaxError", InvalidModificationError: "InvalidModificationError", NamespaceError: "NamespaceError", InvalidAccessError: "InvalidAccessError", ValidationError: "ValidationError", TypeMismatchError: "TypeMismatchError", SecurityError: "SecurityError", NetworkError: "NetworkError", AbortError: "AbortError", URLMismatchError: "URLMismatchError", QuotaExceededError: "QuotaExceededError", TimeoutError: "TimeoutError", InvalidNodeTypeError: "InvalidNodeTypeError", DataCloneError: "DataCloneError", EncodingError: "EncodingError", NotReadableError: "NotReadableError", UnknownError: "UnknownError", ConstraintError: "ConstraintError", DataError: "DataError", TransactionInactiveError: "TransactionInactiveError", ReadOnlyError: "ReadOnlyError", VersionError: "VersionError", OperationError: "OperationError", NotAllowedError: "NotAllowedError", OptOutError: "OptOutError" }), I = Object.keys(c); function R(a) { return typeof a == "number" && a >= 1 && a <= 25; } function g(a, m) { var p; R(a) ? (this.name = I[a], this.message = m || "") : (this.message = a, this.name = typeof (p = m) == "string" && p.substring(p.length - c.Error.length) === c.Error ? m : c.Error), Error.captureStackTrace && Error.captureStackTrace(this, g); } S(g, !0), Object.defineProperties(g.prototype, { code: { enumerable: !0, get: function() { var a = I.indexOf(this.name); return R(a) ? a : 0; } } }); for (var h = { INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, WRONG_DOCUMENT_ERR: 4, INVALID_CHARACTER_ERR: 5, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, INUSE_ATTRIBUTE_ERR: 10, INVALID_STATE_ERR: 11, SYNTAX_ERR: 12, INVALID_MODIFICATION_ERR: 13, NAMESPACE_ERR: 14, INVALID_ACCESS_ERR: 15, VALIDATION_ERR: 16, TYPE_MISMATCH_ERR: 17, SECURITY_ERR: 18, NETWORK_ERR: 19, ABORT_ERR: 20, URL_MISMATCH_ERR: 21, QUOTA_EXCEEDED_ERR: 22, TIMEOUT_ERR: 23, INVALID_NODE_TYPE_ERR: 24, DATA_CLONE_ERR: 25 }, H = Object.entries(h), $ = 0; $ < H.length; $++) g[H[$][0]] = H[$][1]; function z(a, m) { this.message = a, this.locator = m, Error.captureStackTrace && Error.captureStackTrace(this, z); } return S(z), Ue.DOMException = g, Ue.DOMExceptionName = c, Ue.ExceptionCode = h, Ue.ParseError = z, Ue; } var ar, ir, Z = {}, O = {}; function fr() { if (ar) return O; function S(k) { try { typeof k != "function" && (k = RegExp); var V = new k("𝌆", "u").exec("𝌆"); return !!V && V[0].length === 2; } catch { } return !1; } ar = 1; var c = S(); function I(k) { if (k.source[0] !== "[") throw new Error(k + " can not be used with chars"); return k.source.slice(1, k.source.lastIndexOf("]")); } function R(k, V) { if (k.source[0] !== "[") throw new Error("/" + k.source + "/ can not be used with chars_without"); if (!V || typeof V != "string") throw new Error(JSON.stringify(V) + " is not a valid search"); if (k.source.indexOf(V) === -1) throw new Error('"' + V + '" is not is /' + k.source + "/"); if (V === "-" && k.source.indexOf(V) !== 1) throw new Error('"' + V + '" is not at the first postion of /' + k.source + "/"); return new RegExp(k.source.replace(V, ""), c ? "u" : ""); } function g(k) { var V = this; return new RegExp(Array.prototype.slice.call(arguments).map(function(le) { var be = typeof le == "string"; if (be && V === void 0 && le === "|") throw new Error("use regg instead of reg to wrap expressions with `|`!"); return be ? le : le.source; }).join(""), c ? "mu" : "m"); } function h(k) { if (arguments.length === 0) throw new Error("no parameters provided"); return g.apply(h, ["(?:"].concat(Array.prototype.slice.call(arguments), [")"])); } var H = /[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/; c && (H = g("[", I(H), "\\u{10000}-\\u{10FFFF}", "]")); var $ = /[\x20\x09\x0D\x0A]/, z = I($), a = g($, "+"), m = g($, "*"), p = /[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; c && (p = g("[", I(p), "\\u{10000}-\\u{10FFFF}", "]")); var ae = g("[", I(p), I(/[-.0-9\xB7]/), I(/[\u0300-\u036F\u203F-\u2040]/), "]"), q = g(p, ae, "*"), Q = g(ae, "+"), Ee = g("&", q, ";"), ue = h(/&#[0-9]+;|&#x[0-9a-fA-F]+;/), ce = h(Ee, "|", ue), ie = g("%", q, ";"), l = h(g('"', h(/[^%&"]/, "|", ie, "|", ce), "*", '"'), "|", g("'", h(/[^%&']/, "|", ie, "|", ce), "*", "'")), y = h('"', h(/[^<&"]/, "|", ce), "*", '"', "|", "'", h(/[^<&']/, "|", ce), "*", "'"), o = g(R(p, ":"), R(ae, ":"), "*"), i = g(o, h(":", o), "?"), d = g("^", i, "$"), N = g("(", i, ")"), T = h(/"[^"]*"|'[^']*'/), u = g(/^<\?/, "(", q, ")", h(a, "(", H, "*?)"), "?", /\?>/), D = /[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/, E = h('"', D, '*"', "|", "'", R(D, "'"), "*'"), w = "<!--", A = g(w, h(R(H, "-"), "|", g("-", R(H, "-"))), "*", "-->"), f = "#PCDATA", F = h(g(/\(/, m, f, h(m, /\|/, m, i), "*", m, /\)\*/), "|", g(/\(/, m, f, m, /\)/)), C = h("EMPTY", "|", "ANY", "|", F, "|", g(/\([^>]+\)/, /[?*+]?/)), oe = g("<!ELEMENT", a, h(i, "|", ie), a, h(C, "|", ie), m, ">"), U = g("NOTATION", a, /\(/, m, q, h(m, /\|/, m, q), "*", m, /\)/), ee = g(/\(/, m, Q, h(m, /\|/, m, Q), "*", m, /\)/), re = h(U, "|", ee), M = h(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/, "|", re), K = h(/#REQUIRED|#IMPLIED/, "|", h(h("#FIXED", a), "?", y)), G = g("<!ATTLIST", a, q, h(a, q, a, M, a, K), "*", m, ">"), Y = "about:legacy-compat", ve = h('"' + Y + '"', "|", "'" + Y + "'"), Ne = "SYSTEM", fe = "PUBLIC", v = h(h(Ne, a, T), "|", h(fe, a, E, a, T)), Te = g("^", h(h(Ne, a, "(?<SystemLiteralOnly>", T, ")"), "|", h(fe, a, "(?<PubidLiteral>", E, ")", a, "(?<SystemLiteral>", T, ")"))), me = h(a, "NDATA", a, q), se = "<!ENTITY", xe = g(se, a, q, a, h(l, "|", h(v, me, "?")), m, ">"), ye = h(l, "|", v), De = h(xe, "|", g(se, a, "%", a, q, a, ye, m, ">")), pe = g(fe, a, E), X = g("<!NOTATION", a, q, a, h(v, "|", pe), m, ">"), ge = g(m, "=", m), Se = /1[.]\d+/, Re = g(a, "version", ge, h("'", Se, "'", "|", '"', Se, '"')), Ae = /[A-Za-z][-A-Za-z0-9._]*/, Ie = g(/^<\?xml/, Re, h(a, "encoding", ge, h('"', Ae, '"', "|", "'", Ae, "'")), "?", h(a, "standalone", ge, h("'", h("yes", "|", "no"), "'", "|", '"', h("yes", "|", "no"), '"')), "?", m, /\?>/), L = g(H, "*?", /\]\]>/), J = g(/<!\[CDATA\[/, L); return O.chars = I, O.chars_without = R, O.detectUnicodeSupport = S, O.reg = g, O.regg = h, O.ABOUT_LEGACY_COMPAT = Y, O.ABOUT_LEGACY_COMPAT_SystemLiteral = ve, O.AttlistDecl = G, O.CDATA_START = "<![CDATA[", O.CDATA_END = "]]>", O.CDSect = J, O.Char = H, O.Comment = A, O.COMMENT_START = w, O.COMMENT_END = "-->", O.DOCTYPE_DECL_START = "<!DOCTYPE", O.elementdecl = oe, O.EntityDecl = De, O.EntityValue = l, O.ExternalID = v, O.ExternalID_match = Te, O.Name = q, O.NotationDecl = X, O.Reference = ce, O.PEReference = ie, O.PI = u, O.PUBLIC = fe, O.PubidLiteral = E, O.QName = i, O.QName_exact = d, O.QName_group = N, O.S = a, O.SChar_s = z, O.S_OPT = m, O.SYSTEM = Ne, O.SystemLiteral = T, O.UNICODE_REPLACEMENT_CHARACTER = "�", O.UNICODE_SUPPORT = c, O.XMLDecl = Ie, O; } function mr() { if (ir) return Z; ir = 1; var S = ke(), c = S.find, I = S.hasDefaultHTMLNamespace, R = S.hasOwn, g = S.isHTMLMimeType, h = S.isHTMLRawTextElement, H = S.isHTMLVoidElement, $ = S.MIME_TYPE, z = S.NAMESPACE, a = Symbol(), m = Xe(), p = m.DOMException, ae = m.DOMExceptionName, q = fr(); function Q(e) { if (e !== a) throw new TypeError("Illegal constructor"); } function Ee(e) { return e !== ""; } function ue(e, r) { return R(e, r) || (e[r] = !0), e; } function ce(e) { if (!e) return []; var r, t = (r = e) ? r.split(/[\t\n\f\r ]+/).filter(Ee) : []; return Object.keys(t.reduce(ue, {})); } function ie(e) { if (!q.QName_exact.test(e)) throw new p(p.INVALID_CHARACTER_ERR, 'invalid character in qualified name "' + e + '"'); } function l(e, r) { ie(r), e = e || null; var t = null, n = r; if (r.indexOf(":") >= 0) { var s = r.split(":"); t = s[0], n = s[1]; } if (t !== null && e === null) throw new p(p.NAMESPACE_ERR, "prefix is non-null and namespace is null"); if (t === "xml" && e !== S.NAMESPACE.XML) throw new p(p.NAMESPACE_ERR, 'prefix is "xml" and namespace is not the XML namespace'); if ((t === "xmlns" || r === "xmlns") && e !== S.NAMESPACE.XMLNS) throw new p(p.NAMESPACE_ERR, 'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace'); if (e === S.NAMESPACE.XMLNS && t !== "xmlns" && r !== "xmlns") throw new p(p.NAMESPACE_ERR, 'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"'); return [e, t, n]; } function y(e, r) { for (var t in e) R(e, t) && (r[t] = e[t]); } function o(e, r) { var t = e.prototype; if (!(t instanceof r)) { let n = function() { }; n.prototype = r.prototype, y(t, n = new n()), e.prototype = t = n; } t.constructor != e && (typeof e != "function" && console.error("unknown Class:" + e), t.constructor = e); } var i = {}, d = i.ELEMENT_NODE = 1, N = i.ATTRIBUTE_NODE = 2, T = i.TEXT_NODE = 3, u = i.CDATA_SECTION_NODE = 4, D = i.ENTITY_REFERENCE_NODE = 5, E = i.ENTITY_NODE = 6, w = i.PROCESSING_INSTRUCTION_NODE = 7, A = i.COMMENT_NODE = 8, f = i.DOCUMENT_NODE = 9, F = i.DOCUMENT_TYPE_NODE = 10, C = i.DOCUMENT_FRAGMENT_NODE = 11, oe = i.NOTATION_NODE = 12, U = S.freeze({ DOCUMENT_POSITION_DISCONNECTED: 1, DOCUMENT_POSITION_PRECEDING: 2, DOCUMENT_POSITION_FOLLOWING: 4, DOCUMENT_POSITION_CONTAINS: 8, DOCUMENT_POSITION_CONTAINED_BY: 16, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32 }); function ee(e, r) { if (r.length < e.length) return ee(r, e); var t = null; for (var n in e) { if (e[n] !== r[n]) return t; t = e[n]; } return t; } function re(e) { return e.guid || (e.guid = Math.random()), e.guid; } function M() { } function K(e, r) { this._node = e, this._refresh = r, G(this); } function G(e) { var r = e._node._inc || e._node.ownerDocument._inc; if (e._inc !== r) { var t = e._refresh(e._node); if (rr(e, "length", t.length), !e.$$length || t.length < e.$$length) for (var n = t.length; n in e; n++) R(e, n) && delete e[n]; y(t, e), e._inc = r; } } function Y() { } function ve(e, r) { for (var t = 0; t < e.length; ) { if (e[t] === r) return t; t++; } } function Ne(e, r, t) { var n = ve(r, t); if (n >= 0) { for (var s = r.length - 1; n <= s; ) r[n] = r[++n]; if (r.length = s, e) { var b = e.ownerDocument; b && xe(b, e, t), t.ownerElement = null; } } } function fe() { } function v(e) { Q(e); } function Te(e) { return (e == "<" ? "&lt;" : e == ">" && "&gt;") || e == "&" && "&amp;" || e == '"' && "&quot;" || "&#" + e.charCodeAt() + ";"; } function me(e, r) { if (r(e)) return !0; if (e = e.firstChild) do if (me(e, r)) return !0; while (e = e.nextSibling); } function se(e, r) { Q(e); var t = r || {}; this.ownerDocument = this, this.contentType = t.contentType || $.XML_APPLICATION, this.type = g(this.contentType) ? "html" : "xml"; } function xe(e, r, t, n) { e && e._inc++, t.namespaceURI === z.XMLNS && delete r._nsMap[t.prefix ? t.localName : ""]; } function ye(e, r, t) { if (e && e._inc) { e._inc++; var n = r.childNodes; if (t && !t.nextSibling) n[n.length++] = t; else { for (var s = r.firstChild, b = 0; s; ) n[b++] = s, s = s.nextSibling; n.length = b, delete n[n.length]; } } } function De(e, r) { if (e !== r.parentNode) throw new p(p.NOT_FOUND_ERR, "child's parent is not parent"); var t = r.previousSibling, n = r.nextSibling; return t ? t.nextSibling = n : e.firstChild = n, n ? n.previousSibling = t : e.lastChild = t, ye(e.ownerDocument, e), r.parentNode = null, r.previousSibling = null, r.nextSibling = null, r; } function pe(e) { return e && e.nodeType === v.DOCUMENT_TYPE_NODE; } function X(e) { return e && e.nodeType === v.ELEMENT_NODE; } function ge(e) { return e && e.nodeType === v.TEXT_NODE; } function Se(e, r) { var t = e.childNodes || []; if (c(t, X) || pe(r)) return !1; var n = c(t, pe); return !(r && n && t.indexOf(n) > t.indexOf(r)); } function Re(e, r) { var t = e.childNodes || []; if (c(t, function(s) { return X(s) && s !== r; })) return !1; var n = c(t, pe); return !(r && n && t.indexOf(n) > t.indexOf(r)); } function Ae(e, r, t) { var n = e.childNodes || [], s = r.childNodes || []; if (r.nodeType === v.DOCUMENT_FRAGMENT_NODE) { var b = s.filter(X); if (b.length > 1 || c(s, ge)) throw new p(p.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment"); if (b.length === 1 && !Se(e, t)) throw new p(p.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype"); } if (X(r) && !Se(e, t)) throw new p(p.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype"); if (pe(r)) { if (c(n, pe)) throw new p(p.HIERARCHY_REQUEST_ERR, "Only one doctype is allowed"); var P = c(n, X); if (t && n.indexOf(P) < n.indexOf(t)) throw new p(p.HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element"); if (!t && P) throw new p(p.HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present"); } } function Ie(e, r, t) { var n = e.childNodes || [], s = r.childNodes || []; if (r.nodeType === v.DOCUMENT_FRAGMENT_NODE) { var b = s.filter(X); if (b.length > 1 || c(s, ge)) throw new p(p.HIERARCHY_REQUEST_ERR, "More than one element or text in fragment"); if (b.length === 1 && !Re(e, t)) throw new p(p.HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype"); } if (X(r) && !Re(e, t)) throw new p(p.HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype"); if (pe(r)) { if (c(n, function(x) { return pe(x) && x !== t; })) throw new p(p.HIERARCHY_REQUEST_ERR, "Only one doctype is allowed"); var P = c(n, X); if (t && n.indexOf(P) < n.indexOf(t)) throw new p(p.HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element"); } } function L(e, r, t, n) { (function(B, W, j) { if (!(de = B) || de.nodeType !== v.DOCUMENT_NODE && de.nodeType !== v.DOCUMENT_FRAGMENT_NODE && de.nodeType !== v.ELEMENT_NODE) throw new p(p.HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + B.nodeType); var de; if (j && j.parentNode !== B) throw new p(p.NOT_FOUND_ERR, "child not in parent"); if (!(function(te) { return te && (te.nodeType === v.CDATA_SECTION_NODE || te.nodeType === v.COMMENT_NODE || te.nodeType === v.DOCUMENT_FRAGMENT_NODE || te.nodeType === v.DOCUMENT_TYPE_NODE || te.nodeType === v.ELEMENT_NODE || te.nodeType === v.PROCESSING_INSTRUCTION_NODE || te.nodeType === v.TEXT_NODE); })(W) || pe(W) && B.nodeType !== v.DOCUMENT_NODE) throw new p(p.HIERARCHY_REQUEST_ERR, "Unexpected node type " + W.nodeType + " for parent node type " + B.nodeType); })(e, r, t), e.nodeType === v.DOCUMENT_NODE && (n || Ae)(e, r, t); var s = r.parentNode; if (s && s.removeChild(r), r.nodeType === C) { var b = r.firstChild; if (b == null) return r; var P = r.lastChild; } else b = P = r; var x = t ? t.previousSibling : e.lastChild; b.previousSibling = x, P.nextSibling = t, x ? x.nextSibling = b : e.firstChild = b, t == null ? e.lastChild = P : t.previousSibling = P; do b.parentNode = e; while (b !== P && (b = b.nextSibling)); return ye(e.ownerDocument || e, e, r), r.nodeType == C && (r.firstChild = r.lastChild = null), r; } function J(e) { Q(e), this._nsMap = /* @__PURE__ */ Object.create(null); } function k(e) { Q(e), this.namespaceURI = null, this.prefix = null, this.ownerElement = null; } function V(e) { Q(e); } function le(e) { Q(e); } function be(e) { Q(e); } function _e(e) { Q(e); } function Be(e) { Q(e); } function je(e) { Q(e); } function ze(e) { Q(e); } function Fe(e) { Q(e); } function He(e) { Q(e); } function Ge(e) { Q(e); } function $e() { } function Je(e) { var r = [], t = this.nodeType === f && this.documentElement || this, n = t.prefix, s = t.namespaceURI; if (s && n == null && (n = t.lookupPrefix(s)) == null) var b = [{ namespace: s, prefix: null }]; return Le(this, r, e, b), r.join(""); } function Ke(e, r, t) { var n = e.prefix || "", s = e.namespaceURI; if (!s || n === "xml" && s === z.XML || s === z.XMLNS) return !1; for (var b = t.length; b--; ) { var P = t[b]; if (P.prefix === n) return P.namespace !== s; } return !0; } function Qe(e, r, t) { e.push(" ", r, '="', t.replace(/[<>&"\t\n\r]/g, Te), '"'); } function Le(e, r, t, n) { n || (n = []); var s = (e.nodeType === f ? e : e.ownerDocument).type === "html"; if (t) { if (!(e = t(e))) return; if (typeof e == "string") return void r.push(e); } switch (e.nodeType) { case d: var b = e.attributes, P = b.length, x = e.firstChild, B = e.tagName, W = B; if (!s && !e.prefix && e.namespaceURI) { for (var j, de = 0; de < b.length; de++) if (b.item(de).name === "xmlns") { j = b.item(de).value; break; } if (!j) { for (var te = n.length - 1; te >= 0; te--) if ((he = n[te]).prefix === "" && he.namespace === e.namespaceURI) { j = he.namespace; break; } } if (j !== e.namespaceURI) for (te = n.length - 1; te >= 0; te--) { var he; if ((he = n[te]).namespace === e.namespaceURI) { he.prefix && (W = he.prefix + ":" + B); break; } } } r.push("<", W); for (var Oe = 0; Oe < P; Oe++) (we = b.item(Oe)).prefix == "xmlns" ? n.push({ prefix: we.localName, namespace: we.value }) : we.nodeName == "xmlns" && n.push({ prefix: "", namespace: we.value }); for (Oe = 0; Oe < P; Oe++) { var we, Me, Ye; Ke(we = b.item(Oe), 0, n) && (Qe(r, (Me = we.prefix || "") ? "xmlns:" + Me : "xmlns", Ye = we.namespaceURI), n.push({ prefix: Me, namespace: Ye })), Le(we, r, t, n); } B === W && Ke(e, 0, n) && (Qe(r, (Me = e.prefix || "") ? "xmlns:" + Me : "xmlns", Ye = e.namespaceURI), n.push({ prefix: Me, namespace: Ye })); var Ze = !x; if (Ze && (s || e.namespaceURI === z.HTML) && (Ze = H(B)), Ze) r.push("/>"); else { if (r.push(">"), s && h(B)) for (; x; ) x.data ? r.push(x.data) : Le(x, r, t, n.slice()), x = x.nextSibling; else for (; x; ) Le(x, r, t, n.slice()), x = x.nextSibling; r.push("</", W, ">"); } return; case f: case C: for (x = e.firstChild; x; ) Le(x, r, t, n.slice()), x = x.nextSibling; return; case N: return Qe(r, e.name, e.value); case T: return r.push(e.data.replace(/[<&>]/g, Te)); case u: return r.push(q.CDATA_START, e.data, q.CDATA_END); case A: return r.push(q.COMMENT_START, e.data, q.COMMENT_END); case F: var tr = e.publicId, qe = e.systemId; return r.push(q.DOCTYPE_DECL_START, " ", e.name), tr ? (r.push(" ", q.PUBLIC, " ", tr), qe && qe !== "." && r.push(" ", qe)) : qe && qe !== "." && r.push(" ", q.SYSTEM, " ", qe), e.internalSubset && r.push(" [", e.internalSubset, "]"), void r.push(">"); case w: return r.push("<?", e.target, " ", e.data, "?>"); case D: return r.push("&", e.nodeName, ";"); default: r.push("??", e.nodeName); } } function er(e, r, t) { var n; switch (r.nodeType) { case d: (n = r.cloneNode(!1)).ownerDocument = e; case C: break; case N: t = !0; } if (n || (n = r.cloneNode(!1)), n.ownerDocument = e, n.parentNode = null, t) for (var s = r.firstChild; s; ) n.appendChild(er(e, s, t)), s = s.nextSibling; return n; } function We(e, r, t) { var n = new r.constructor(a); for (var s in r) if (R(r, s)) { var b = r[s]; typeof b != "object" && b != n[s] && (n[s] = b); } switch (r.childNodes && (n.childNodes = new M()), n.ownerDocument = e, n.nodeType) { case d: var P = r.attributes, x = n.attributes = new Y(), B = P.length; x._ownerElement = n; for (var W = 0; W < B; W++) n.setAttributeNode(We(e, P.item(W), !0)); break; case N: t = !0; } if (t) for (var j = r.firstChild; j; ) n.appendChild(We(e, j, t)), j = j.nextSibling; return n; } function rr(e, r, t) { e[r] = t; } M.prototype = { length: 0, item: function(e) { return e >= 0 && e < this.length ? this[e] : null; }, toString: function(e) { for (var r = [], t = 0; t < this.length; t++) Le(this[t], r, e); return r.join(""); }, filter: function(e) { return Array.prototype.filter.call(this, e); }, indexOf: function(e) { return Array.prototype.indexOf.call(this, e); } }, M.prototype[Symbol.iterator] = function() { var e = this, r = 0; return { next: function() { return r < e.length ? { value: e[r++], done: !1 } : { done: !0 }; }, return: function() { return { done: !0 }; } }; }, K.prototype.item = function(e) { return G(this), this[e] || null; }, o(K, M), Y.prototype = { length: 0, item: M.prototype.item, getNamedItem: function(e) { this._ownerElement && this._ownerElement._isInHTMLDocumentAndNamespace() && (e = e.toLowerCase()); for (var r = 0; r < this.length; ) { var t = this[r]; if (t.nodeName === e) return t; r++; } return null; }, setNamedItem: function(e) { var r = e.ownerElement; if (r && r !== this._ownerElement) throw new p(p.INUSE_ATTRIBUTE_ERR); var t = this.getNamedItemNS(e.namespaceURI, e.localName); return t === e ? e : ((function(n, s, b, P) { if (P ? s[ve(s, P)] = b : (s[s.length] = b, s.length++), n) { b.ownerElement = n; var x = n.ownerDocument; x && (P && xe(x, n, P), W = n, j = b, (B = x) && B._inc++, j.namespaceURI === z.XMLNS && (W._nsMap[j.prefix ? j.localName : ""] = j.value)); } var B, W, j; })(this._ownerElement, this, e, t), t); }, setNamedItemNS: function(e) { return this.setNamedItem(e); }, removeNamedItem: function(e) { var r = this.getNamedItem(e); if (!r) throw new p(p.NOT_FOUND_ERR, e); return Ne(this._ownerElement, this, r), r; }, removeNamedItemNS: function(e, r) { var t = this.getNamedItemNS(e, r); if (!t) throw new p(p.NOT_FOUND_ERR, e ? e + " : " + r : r); return Ne(this._ownerElement, this, t), t; }, getNamedItemNS: function(e, r) { e || (e = null); for (var t = 0; t < this.length; ) { var n = this[t]; if (n.localName === r && n.namespaceURI === e) return n; t++; } return null; } }, Y.prototype[Symbol.iterator] = function() { var e = this, r = 0; return { next: function() { return r < e.length ? { value: e[r++], done: !1 } : { done: !0 }; }, return: function() { return { done: !0 }; } }; }, fe.prototype = { hasFeature: function(e, r) { return !0; }, createDocument: function(e, r, t) { var n = $.XML_APPLICATION; e === z.HTML ? n = $.XML_XHTML_APPLICATION : e === z.SVG && (n = $.XML_SVG_IMAGE); var s = new se(a, { contentType: n }); if (s.implementation = this, s.childNodes = new M(), s.doctype = t || null, t && s.appendChild(t), r) { var b = s.createElementNS(e, r); s.appendChild(b); } return s; }, createDocumentType: function(e, r, t, n) { ie(e); var s = new Be(a); return s.name = e, s.nodeName = e, s.publicId = r || "", s.systemId = t || "", s.internalSubset = n || "", s.childNodes = new M(), s; }, createHTMLDocument: function(e) { var r = new se(a, { contentType: $.HTML }); if (r.implementation = this, r.childNodes = new M(), e !== !1) { r.doctype = this.createDocumentType("html"), r.doctype.ownerDocument = r, r.appendChild(r.doctype); var t = r.createElement("html"); r.appendChild(t); var n = r.createElement("head"); if (t.appendChild(n), typeof e == "string") { var s = r.createElement("title"); s.appendChild(r.createTextNode(e)), n.appendChild(s); } t.appendChild(r.createElement("body")); } return r; } }, v.prototype = { firstChild: null, lastChild: null, previousSibling: null, nextSibling: null, parentNode: null, get parentElement() { return this.parentNode && this.parentNode.nodeType === this.ELEMENT_NODE ? this.parentNode : null; }, childNodes: null, ownerDocument: null, nodeValue: null, namespaceURI: null, prefix: null, localName: null, baseURI: "about:blank", get isConnected() { var e = this.getRootNode(); return e && e.nodeType === e.DOCUMENT_NODE; }, contains: function(e) { if (!e) return !1; var r = e; do { if (this === r) return !0; r = e.parentNode; } while (r); return !1; }, getRootNode: function(e) { var r = this; do { if (!r.parentNode) return r; r = r.parentNode; } while (r); }, isEqualNode: function(e) { if (!e || this.nodeType !== e.nodeType) return !1; switch (this.nodeType) { case this.DOCUMENT_TYPE_NODE: if (this.name !== e.name || this.publicId !== e.publicId || this.systemId !== e.systemId) return !1; break; case this.ELEMENT_NODE: if (this.namespaceURI !== e.namespaceURI || this.prefix !== e.prefix || this.localName !== e.localName || this.attributes.length !== e.attributes.length) return !1; for (var r = 0; r < this.attributes.length; r++) { var t = this.attributes.item(r); if (!t.isEqualNode(e.getAttributeNodeNS(t.namespaceURI, t.localName))) return !1; } break; case this.ATTRIBUTE_NODE: if (this.namespaceURI !== e.namespaceURI || this.localName !== e.localName || this.value !== e.value) return !1; break; case this.PROCESSING_INSTRUCTION_NODE: if (this.target !== e.target || this.data !== e.data) return !1; break; case this.TEXT_NODE: case this.COMMENT_NODE: if (this.data !== e.data) return !1; } if (this.childNodes.length !== e.childNodes.length) return !1; for (r = 0; r < this.childNodes.length; r++) if (!this.childNodes[r].isEqualNode(e.childNodes[r])) return !1; return !0; }, isSameNode: function(e) { return this === e; }, insertBefore: function(e, r) { return L(this, e, r); }, replaceChild: function(e, r) { L(this, e, r, Ie), r && this.removeChild(r); }, removeChild: function(e) { return De(this, e); }, appendChild: function(e) { return this.insertBefore(e, null); }, hasChildNodes: function() { return this.firstChild != null; }, cloneNode: function(e) { return We(this.ownerDocument || this, this, e); }, normalize: function() { for (var e = this.firstChild; e; ) { var r = e.nextSibling; r && r.nodeType == T && e.nodeType == T ? (this.removeChild(r), e.appendData(r.data)) : (e.normalize(), e = r); } }, isSupported: function(e, r) { return this.ownerDocument.implementation.hasFeature(e, r); }, lookupPrefix: function(e) { for (var r = this; r; ) { var t = r._nsMap; if (t) { for (var n in t) if (R(t, n) && t[n] === e) return n; } r = r.nodeType == N ? r.ownerDocument : r.parentNode; } return null; }, lookupNamespaceURI: function(e) { for (var r = this; r; ) { var t = r._nsMap; if (t && R(t, e)) return t[e]; r = r.nodeType == N ? r.ownerDocument : r.parentNode; } return null; }, isDefaultNamespace: function(e) { return this.lookupPrefix(e) == null; }, compareDocumentPosition: function(e) { if (this === e) return 0; var r = e, t = this, n = null, s = null; if (r instanceof k && (r = (n = r).ownerElement), t instanceof k && (t = (s = t).ownerElement, n && r && t === r)) for (var b, P = 0; b = t.attributes[P]; P++) { if (b === n) return U.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + U.DOCUMENT_POSITION_PRECEDING; if (b === s) return U.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + U.DOCUMENT_POSITION_FOLLOWING; } if (!r || !t || t.ownerDocument !== r.ownerDocument) return U.DOCUMENT_POSITION_DISCONNECTED + U.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + (re(t.ownerDocument) > re(r.ownerDocument) ? U.DOCUMENT_POSITION_FOLLOWING : U.DOCUMENT_POSITION_PRECEDING); if (s && r === t) return U.DOCUMENT_POSITION_CONTAINS + U.DOCUMENT_POSITION_PRECEDING; if (n && r === t) return U.DOCUMENT_POSITION_CONTAINED_BY + U.DOCUMENT_POSITION_FOLLOWING; for (var x = [], B = r.parentNode; B; ) { if (!s && B === t) return U.DOCUMENT_POSITION_CONTAINED_BY + U.DOCUMENT_POSITION_FOLLOWING; x.push(B), B = B.parentNode; } x.reverse(); for (var W = [], j = t.parentNode; j; ) { if (!n && j === r) return U.DOCUMENT_POSITION_CONTAINS + U.DOCUMENT_POSITION_PRECEDING; W.push(j), j = j.parentNode; } W.reverse(); var de = ee(x, W); for (var te in de.childNodes) { var he = de.childNodes[te]; if (he === t) return U.DOCUMENT_POSITION_FOLLOWING; if (he === r) return U.DOCUMENT_POSITION_PRECEDING; if (W.indexOf(he) >= 0) return U.DOCUMENT_POSITION_FOLLOWING; if (x.indexOf(he) >= 0) return U.DOCUMENT_POSITION_PRECEDING; } return 0; } }, y(i, v), y(i, v.prototype), y(U, v), y(U, v.prototype), se.prototype = { implementation: null, nodeName: "#document", nodeType: f, doctype: null, documentElement: null, _inc: 1, insertBefore: function(e, r) { if (e.nodeType === C) { for (var t = e.firstChild; t; ) { var n = t.nextSibling; this.insertBefore(t, r), t = n; } return e; } return L(this, e, r), e.ownerDocument = this, this.documentElement === null && e.nodeType === d && (this.documentElement = e), e; }, removeChild: function(e) { var r = De(this, e); return r === this.documentElement && (this.documentElement = null), r; }, replaceChild: function(e, r) { L(this, e, r, Ie), e.ownerDocument = this, r && this.removeChild(r), X(e) && (this.documentElement = e); }, importNode: function(e, r) { return er(this, e, r); }, getElementById: function(e) { var r = null; return me(this.documentElement, function(t) { if (t.nodeType == d && t.getAttribute("id") == e) return r = t, !0; }), r; }, createElement: function(e) { var r = new J(a); return r.ownerDocument = this, this.type === "html" && (e = e.toLowerCase()), I(this.contentType) && (r.namespaceURI = z.HTML), r.nodeName = e, r.tagName = e, r.localName = e, r.childNodes = new M(), (r.attributes = new Y())._ownerElement = r, r; }, createDocumentFragment: function() { var e = new He(a); return e.ownerDocument = this, e.childNodes = new M(), e; }, createTextNode: function(e) { var r = new le(a); return r.ownerDocument = this, r.childNodes = new M(), r.appendData(e), r; }, createComment: function(e) { var r = new be(a); return r.ownerDocument = this, r.childNodes = new M(), r.appendData(e), r; }, createCDATASection: function(e) { var r = new _e(a); return r.ownerDocument = this, r.childNodes = new M(), r.appendData(e), r; }, createProcessingInstruction: function(e, r) { var t = new Ge(a); return t.ownerDocument = this, t.childNodes = new M(), t.nodeName = t.target = e, t.nodeValue = t.data = r, t; }, createAttribute: function(e) { if (!q.QName_exact.test(e)) throw new p(p.INVALID_CHARACTER_ERR, 'invalid character in name "' + e + '"'); return this.type === "html" && (e = e.toLowerCase()), this._createAttribute(e); }, _createAttribute: function(e) { var r = new k(a); return r.ownerDocument = this, r.childNodes = new M(), r.name = e, r.nodeName = e, r.localName = e, r.specified = !0, r; }, createEntityReference: function(e) { if (!q.Name.test(e)) throw new p(p.INVALID_CHARACTER_ERR, 'not a valid xml name "' + e + '"'); if (this.type === "html") throw new p("document is an html document", ae.NotSupportedError); var r = new Fe(a); return r.ownerDocument = this, r.childNodes = new M(), r.nodeName = e, r; }, createElementNS: function(e, r) { var t = l(e, r), n = new J(a), s = n.attributes = new Y(); return n.childNodes = new M(), n.ownerDocument = this, n.nodeName = r, n.tagName = r, n.namespaceURI = t[0], n.prefix = t[1], n.localName = t[2], s._ownerElement = n, n; }, createAttributeNS: function(e, r) { var t = l(e, r), n = new k(a); return n.ownerDocument = this, n.childNodes = new M(), n.nodeName = r, n.name = r, n.specified = !0, n.namespaceURI = t[0], n.prefix = t[1], n.localName = t[2], n; } }, o(se, v), J.prototype = { nodeType: d, attributes: null, getQualifiedName: function() { return this.prefix ? this.prefix + ":" + this.localName : this.localName; }, _isInHTMLDocumentAndNamespace: function() { return this.ownerDocument.type === "html" && this.namespaceURI === z.HTML; }, hasAttributes: function() { return !(!this.attributes || !this.attributes.length); }, hasAttribute: function(e) { return !!this.getAttributeNode(e); }, getAttribute: function(e) { var r = this.getAttributeNode(e); return r ? r.value : null; }, getAttributeNode: function(e) { return this._isInHTMLDocumentAndNamespace() && (e = e.toLowerCase()), this.attributes.getNamedItem(e); }, setAttribute: function(e, r) { this._isInHTMLDocumentAndNamespace() && (e = e.toLowerCase()); var t = this.getAttributeNode(e); t ? t.value = t.nodeValue = "" + r : ((t = this.ownerDocument._createAttribute(e)).value = t.nodeValue = "" + r, this.setAttributeNode(t)); }, removeAttribute: function(e) { var r = this.getAttributeNode(e); r && this.removeAttributeNode(r); }, setAttributeNode: function(e) { return this.attributes.setNamedItem(e); }, setAttributeNodeNS: function(e) { return this.attributes.setNamedItemNS(e); }, removeAttributeNode: function(e) { return this.attributes.removeNamedItem(e.nodeName); }, removeAttributeNS: function(e, r) { var t = this.getAttributeNodeNS(e, r); t && this.removeAttributeNode(t); }, hasAttributeNS: function(e, r) { return this.getAttributeNodeNS(e, r) != null; }, getAttributeNS: function(e, r) { var t = this.getAttributeNodeNS(e, r); return t ? t.value : null; }, setAttributeNS: function(e, r, t) { var n = l(e, r)[2], s = this.getAttributeNodeNS(e, n); s ? s.value = s.nodeValue = "" + t : ((s = this.ownerDocument.createAttributeNS(e, r)).value = s.nodeValue = "" + t, this.setAttributeNode(s)); }, getAttributeNodeNS: function(e, r) { return this.attributes.getNamedItemNS(e, r); }, getElementsByClassName: function(e) { var r = ce(e); return new K(this, function(t) { var n = []; return r.length > 0 && me(t, function(s) { if (s !== t && s.nodeType === d) { var b = s.getAttribute("class"); if (b) { var P = e === b; if (!P) { var x = ce(b); P = r.every((B = x, function(W) { return B && B.indexOf(W) !== -1; })); } P && n.push(s); } } var B; }), n; }); }, getElementsByTagName: function(e) { var r = (this.nodeType === f ? this : this.ownerDocument).type === "html", t = e.toLowerCase(); return new K(this, function(n) { var s = []; return me(n, function(b) { b !== n && b.nodeType === d && (e === "*" || b.getQualifiedName() === (r && b.namespaceURI === z.HTML ? t : e)) && s.push(b); }), s; }); }, getElementsByTagNameNS: function(e, r) { return new K(this, function(t) { var n = []; return me(t, function(s) { s === t || s.nodeType !== d || e !== "*" && s.namespaceURI !== e || r !== "*" && s.localName != r || n.push(s); }), n; }); } }, se.prototype.getElementsByClassName = J.prototype.getElementsByClassName, se.prototype.getElementsByTagName = J.prototype.getElementsByTagName, se.prototype.getElementsByTagNameNS = J.prototype.getElementsByTagNameNS, o(J, v), k.prototype.nodeType = N, o(k, v), V.prototype = { data: "", substringData: function(e, r) { return this.data.substring(e, e + r); }, appendData: function(e) { e = this.data + e, this.nodeValue = this.data = e, this.length = e.length; }, insertData: function(e, r) { this.replaceData(e, 0, r); }, deleteData: function(e, r) { this.replaceData(e, r, ""); }, replaceData: function(e, r, t) { t = this.data.substring(0, e) + t + this.data.substring(e + r), this.nodeValue = this.data = t, this.length = t.length; } }, o(V, v), le.prototype = { nodeName: "#text", nodeType: T, splitText: function(e) { var r = this.data, t = r.substring(e); r = r.substring(0, e), this.data = this.nodeValue = r, this.length = r.length; var n = this.ownerDocument.createTextNode(t); return this.parentNode && this.parentNode.insertBefore(n, this.nextSibling), n; } }, o(le, V), be.prototype = { nodeName: "#comment", nodeType: A }, o(be, V), _e.prototype = { nodeName: "#cdata-section", nodeType: u }, o(_e, le), Be.prototype.nodeType = F, o(Be, v), je.prototype.nodeType = oe, o(je, v), ze.prototype.nodeType = E, o(ze, v), Fe.prototype.nodeType = D, o(Fe, v), He.prototype.nodeName = "#document-fragment", He.prototype.nodeType = C, o(He, v), Ge.prototype.nodeType = w, o(Ge, V), $e.prototype.serializeToString = function(e, r) { return Je.call(e, r); }, v.prototype.toString = Je; try { if (Object.defineProperty) { let e = function(r) { switch (r.nodeType) { case d: case C: var t = []; for (r = r.firstChild; r; ) r.nodeType !== 7 && r.nodeType !== 8 && t.push(e(r)), r = r.nextSibling; return t.join(""); default: return r.nodeValue; } }; Object.defineProperty(K.prototype, "length", { get: function() { return G(this), this.$$length; } }), Object.defineProperty(v.prototype, "textContent", { get: function() { return e(this); }, set: function(r) { switch (this.nodeType) { case d: case C: for (; this.firstChild; ) this.removeChild(this.firstChild); (r || String(r)) && this.appendChild(this.ownerDocument.createTextNode(r)); break; default: this.data = r, this.value = r, this.nodeValue = r; } } }), rr = function(r, t, n) { r["$$" + t] = n; }; } } catch { } return Z._updateLiveList = G, Z.Attr = k, Z.CDATASection = _e, Z.CharacterData = V, Z.Comment = be, Z.Document = se, Z.DocumentFragment = He, Z.DocumentType = Be, Z.DOMImplementation = fe, Z.Element = J, Z.Entity = ze, Z.EntityReference = Fe, Z.LiveNodeList = K, Z.NamedNodeMap = Y, Z.Node = v, Z.NodeList = M, Z.Notation = je, Z.Text = le, Z.ProcessingInstruction = Ge, Z.XMLSerializer = $e, Z; } var sr, Ce = {}, lr = {}, cr, ur, pr, Ve = {}; function hr() { if (cr) return Ve; cr = 1; var S = ke(), c = fr(), I = Xe(), R = S.isHTMLEscapableRawTextElement, g = S.isHTMLMimeType, h = S.isHTMLRawTextElement, H = S.hasOwn, $ = S.NAMESPACE, z = I.ParseError, a = I.DOMException; function m() { } m.prototype = { parse: function(o, i, d) { var N = this.domBuilder; N.startDocument(), ue(i, i = /* @__PURE__ */ Object.create(null)), (function(T, u, D, E, w) { var A = g(E.mimeType); function f(L) { var J = L[L.length - 1] === ";" ? L : L + ";"; if (!A && J !== L) return w.error("EntityRef: expecting ;"), L; var k = c.Reference.exec(J); if (!k || k[0].length !== J.length) return w.error("entity not matching Reference production: " + L), L; var V = J.slice(1, -1); return H(D, V) ? D[V] : V.charAt(0) === "#" ? (function(le) { if (le > 65535) { var be = 55296 + ((le -= 65536) >> 10), _e = 56320 + (1023 & le); return String.fromCharCode(be, _e); } return String.fromCharCode(le); })(parseInt(V.substring(1).replace("x", "0x"))) : (w.error("entity not found:" + L), L); } function F(L) { if (L > G) { var J = T.substring(G, L).replace(p, f); ee && re(G), E.characters(J, 0, L - G), G = L; } } T.indexOf(c.UNICODE_REPLACEMENT_CHARACTER) >= 0 && w.warning("Unicode replacement character detected, source encoding issues?"); var C = 0, oe = 0, U = /\r\n?|\n|$/g, ee = E.locator; function re(L, J) { for (; L >= oe && (J = U.exec(T)); ) C = oe, oe = J.index + J[0].length, ee.lineNumber++; ee.columnNumber = L - C + 1; } for (var M = [{ currentNSMap: u }], K = [], G = 0; ; ) { try { var Y = T.indexOf("<", G); if (Y < 0) { if (!A && K.length > 0) return w.fatalError("unclosed xml tag(s): " + K.join(", ")); if (!T.substring(G).match(/^\s*$/)) { var ve = E.doc, Ne = ve.createTextNode(T.substring(G)); if (ve.documentElement) return w.error("Extra content at the end of the document"); ve.appendChild(Ne), E.currentElement = Ne; } return; } if (Y > G) { var fe = T.substring(G, Y); A || K.length !== 0 || (fe = fe.replace(new RegExp(c.S_OPT.source, "g"), "")) && w.error("Unexpected content outside root element: '" + fe + "'"), F(Y); } switch (T.charAt(Y + 1)) { case "/": var v = T.indexOf(">", Y + 2), Te = T.substring(Y + 2, v > 0 ? v : void 0); if (!Te) return w.fatalError("end tag name missing"); var me = v > 0 && c.reg("^", c.QName_group, c.S_OPT, "$").exec(Te); if (!me) return w.fatalError('end tag name contains invalid characters: "' + Te + '"'); if (!E.currentElement && !E.doc.documentElement) return; var se = K[K.length - 1] || E.currentElement.tagName || E.doc.documentElement.tagName || ""; if (se !== me[1]) { var xe = me[1].toLowerCase(); if (!A || se.toLowerCase() !== xe) return w.fatalError('Opening and ending tag mismatch: "' + se + '" != "' + Te + '"'); } var ye = M.pop(); K.pop(); var De = ye.localNSMap; if (E.endElement(ye.uri, ye.localName, se), De) for (var pe in De) H(De, pe) && E.endPrefixMapping(pe); v++; break; case "?": ee && re(Y), v = l(T, Y, E, w); break; case "!": ee && re(Y), v = ie(T, Y, E, w, A); break; default: ee && re(Y); var X = new y(), ge = M[M.length - 1].currentNSMap, Se = (v = q(T, Y, X, ge, f, w, A), X.length); if (X.closed || (A && S.isHTMLVoidElement(X.tagName) ? X.closed = !0 : K.push(X.tagName)), ee && Se) { for (var Re = ae(ee, {}), Ae = 0; Ae < Se; Ae++) { var Ie = X[Ae]; re(Ie.offset), Ie.locator = ae(ee, {}); } E.locator = Re, Q(X, E, ge) && M.push(X), E.locator = ee; } else Q(X, E, ge) && M.push(X); A && !X.closed ? v = Ee(T, v, X.tagName, f, E) : v++; } } catch (L) { if (L instanceof z) throw L; if (L instanceof a) throw new z(L.name + ": " + L.message, E.locator, L); w.error("element parse error: " + L), v = -1; } v > G ? G = v : F(Math.max(Y, G) + 1); } })(o, i, d, N, this.errorHandler), N.endDocument(); } }; var p = /&#?\w+;?/g; function ae(o, i) { return i.lineNumber = o.lineNumber, i.columnNumber = o.columnNumber, i; } function q(o, i, d, N, T, u, D) { function E(oe, U, ee) { return H(d.attributeNames, oe) ? u.fatalError("Attribute " + oe + " redefined") : !D && U.indexOf("<") >= 0 ? u.fatalError("Unescaped '<' not allowed in attributes values") : void d.addValue(oe, U.replace(/[\t\n\r]/g, " ").replace(p, T), ee); } for (var w, A = ++i, f = 0; ; ) { var F = o.charAt(A); switch (F) { case "=": if (f === 1) w = o.slice(i, A), f = 3; else { if (f !== 2) throw new Error("attribute equal must after attrName"); f = 3; } break; case "'": case '"': if (f === 3 || f === 1) { if (f === 1 && (u.warning('attribute value must after "="'), w = o.slice(i, A)), i = A + 1, !((A = o.indexOf(F, i)) > 0)) throw new Error("attribute value no end '" + F + "' match"); E(w, C = o.slice(i, A), i - 1), f = 5; } else { if (f != 4) throw new Error('attribute value must after "="'); E(w, C = o.slice(i, A), i), u.warning('attribute "' + w + '" missed start quot(' + F + ")!!"), i = A + 1, f = 5; } break; case "/": switch (f) { case 0: d.setTagName(o.slice(i, A)); case 5: case 6: case 7: f = 7, d.closed = !0; case 4: case 1: break; case 2: d.closed = !0; break; default: throw new Error("attribute invalid close char('/')"); } break; case "": return u.error("unexpected end of input"), f == 0 && d.setTagName(o.slice(i, A)), A; case ">": swit