diff --git a/.github/actions/tests/split_tests/dist/index.js b/.github/actions/tests/split_tests/dist/index.js index 68fb51f..3a2c9ed 100644 --- a/.github/actions/tests/split_tests/dist/index.js +++ b/.github/actions/tests/split_tests/dist/index.js @@ -19444,6 +19444,1475 @@ function getPositionFromMatch(match) { return match.startIndex + match[1].length; } +// node_modules/@nodable/entities/src/entities.js +var BASIC_LATIN = { + amp: "&", + AMP: "&", + lt: "<", + LT: "<", + gt: ">", + GT: ">", + quot: '"', + QUOT: '"', + apos: "'", + lsquo: "\u2018", + rsquo: "\u2019", + ldquo: "\u201C", + rdquo: "\u201D", + lsquor: "\u201A", + rsquor: "\u2019", + ldquor: "\u201E", + bdquo: "\u201E", + comma: ",", + period: ".", + colon: ":", + semi: ";", + excl: "!", + quest: "?", + num: "#", + dollar: "$", + percent: "%", + amp: "&", + ast: "*", + commat: "@", + lowbar: "_", + verbar: "|", + vert: "|", + sol: "/", + bsol: "\\", + lbrace: "{", + rbrace: "}", + lbrack: "[", + rbrack: "]", + lpar: "(", + rpar: ")", + nbsp: "\xA0", + iexcl: "\xA1", + cent: "\xA2", + pound: "\xA3", + curren: "\xA4", + yen: "\xA5", + brvbar: "\xA6", + sect: "\xA7", + uml: "\xA8", + copy: "\xA9", + COPY: "\xA9", + ordf: "\xAA", + laquo: "\xAB", + not: "\xAC", + shy: "\xAD", + reg: "\xAE", + REG: "\xAE", + macr: "\xAF", + deg: "\xB0", + plusmn: "\xB1", + sup2: "\xB2", + sup3: "\xB3", + acute: "\xB4", + micro: "\xB5", + para: "\xB6", + middot: "\xB7", + cedil: "\xB8", + sup1: "\xB9", + ordm: "\xBA", + raquo: "\xBB", + frac14: "\xBC", + frac12: "\xBD", + half: "\xBD", + frac34: "\xBE", + iquest: "\xBF", + times: "\xD7", + div: "\xF7", + divide: "\xF7" +}; +var LATIN_ACCENTS = { + Agrave: "\xC0", + agrave: "\xE0", + Aacute: "\xC1", + aacute: "\xE1", + Acirc: "\xC2", + acirc: "\xE2", + Atilde: "\xC3", + atilde: "\xE3", + Auml: "\xC4", + auml: "\xE4", + Aring: "\xC5", + aring: "\xE5", + AElig: "\xC6", + aelig: "\xE6", + Ccedil: "\xC7", + ccedil: "\xE7", + Egrave: "\xC8", + egrave: "\xE8", + Eacute: "\xC9", + eacute: "\xE9", + Ecirc: "\xCA", + ecirc: "\xEA", + Euml: "\xCB", + euml: "\xEB", + Igrave: "\xCC", + igrave: "\xEC", + Iacute: "\xCD", + iacute: "\xED", + Icirc: "\xCE", + icirc: "\xEE", + Iuml: "\xCF", + iuml: "\xEF", + ETH: "\xD0", + eth: "\xF0", + Ntilde: "\xD1", + ntilde: "\xF1", + Ograve: "\xD2", + ograve: "\xF2", + Oacute: "\xD3", + oacute: "\xF3", + Ocirc: "\xD4", + ocirc: "\xF4", + Otilde: "\xD5", + otilde: "\xF5", + Ouml: "\xD6", + ouml: "\xF6", + Oslash: "\xD8", + oslash: "\xF8", + Ugrave: "\xD9", + ugrave: "\xF9", + Uacute: "\xDA", + uacute: "\xFA", + Ucirc: "\xDB", + ucirc: "\xFB", + Uuml: "\xDC", + uuml: "\xFC", + Yacute: "\xDD", + yacute: "\xFD", + THORN: "\xDE", + thorn: "\xFE", + szlig: "\xDF", + yuml: "\xFF", + Yuml: "\u0178" +}; +var LATIN_EXTENDED = { + Amacr: "\u0100", + amacr: "\u0101", + Abreve: "\u0102", + abreve: "\u0103", + Aogon: "\u0104", + aogon: "\u0105", + Cacute: "\u0106", + cacute: "\u0107", + Ccirc: "\u0108", + ccirc: "\u0109", + Cdot: "\u010A", + cdot: "\u010B", + Ccaron: "\u010C", + ccaron: "\u010D", + Dcaron: "\u010E", + dcaron: "\u010F", + Dstrok: "\u0110", + dstrok: "\u0111", + Emacr: "\u0112", + emacr: "\u0113", + Ecaron: "\u011A", + ecaron: "\u011B", + Edot: "\u0116", + edot: "\u0117", + Eogon: "\u0118", + eogon: "\u0119", + Gcirc: "\u011C", + gcirc: "\u011D", + Gbreve: "\u011E", + gbreve: "\u011F", + Gdot: "\u0120", + gdot: "\u0121", + Gcedil: "\u0122", + Hcirc: "\u0124", + hcirc: "\u0125", + Hstrok: "\u0126", + hstrok: "\u0127", + Itilde: "\u0128", + itilde: "\u0129", + Imacr: "\u012A", + imacr: "\u012B", + Iogon: "\u012E", + iogon: "\u012F", + Idot: "\u0130", + IJlig: "\u0132", + ijlig: "\u0133", + Jcirc: "\u0134", + jcirc: "\u0135", + Kcedil: "\u0136", + kcedil: "\u0137", + kgreen: "\u0138", + Lacute: "\u0139", + lacute: "\u013A", + Lcedil: "\u013B", + lcedil: "\u013C", + Lcaron: "\u013D", + lcaron: "\u013E", + Lmidot: "\u013F", + lmidot: "\u0140", + Lstrok: "\u0141", + lstrok: "\u0142", + Nacute: "\u0143", + nacute: "\u0144", + Ncaron: "\u0147", + ncaron: "\u0148", + Ncedil: "\u0145", + ncedil: "\u0146", + ENG: "\u014A", + eng: "\u014B", + Omacr: "\u014C", + omacr: "\u014D", + Odblac: "\u0150", + odblac: "\u0151", + OElig: "\u0152", + oelig: "\u0153", + Racute: "\u0154", + racute: "\u0155", + Rcaron: "\u0158", + rcaron: "\u0159", + Rcedil: "\u0156", + rcedil: "\u0157", + Sacute: "\u015A", + sacute: "\u015B", + Scirc: "\u015C", + scirc: "\u015D", + Scedil: "\u015E", + scedil: "\u015F", + Scaron: "\u0160", + scaron: "\u0161", + Tcedil: "\u0162", + tcedil: "\u0163", + Tcaron: "\u0164", + tcaron: "\u0165", + Tstrok: "\u0166", + tstrok: "\u0167", + Utilde: "\u0168", + utilde: "\u0169", + Umacr: "\u016A", + umacr: "\u016B", + Ubreve: "\u016C", + ubreve: "\u016D", + Uring: "\u016E", + uring: "\u016F", + Udblac: "\u0170", + udblac: "\u0171", + Uogon: "\u0172", + uogon: "\u0173", + Wcirc: "\u0174", + wcirc: "\u0175", + Ycirc: "\u0176", + ycirc: "\u0177", + Zacute: "\u0179", + zacute: "\u017A", + Zdot: "\u017B", + zdot: "\u017C", + Zcaron: "\u017D", + zcaron: "\u017E" +}; +var GREEK = { + Alpha: "\u0391", + alpha: "\u03B1", + Beta: "\u0392", + beta: "\u03B2", + Gamma: "\u0393", + gamma: "\u03B3", + Delta: "\u0394", + delta: "\u03B4", + Epsilon: "\u0395", + epsilon: "\u03B5", + epsiv: "\u03F5", + varepsilon: "\u03F5", + Zeta: "\u0396", + zeta: "\u03B6", + Eta: "\u0397", + eta: "\u03B7", + Theta: "\u0398", + theta: "\u03B8", + thetasym: "\u03D1", + vartheta: "\u03D1", + Iota: "\u0399", + iota: "\u03B9", + Kappa: "\u039A", + kappa: "\u03BA", + kappav: "\u03F0", + varkappa: "\u03F0", + Lambda: "\u039B", + lambda: "\u03BB", + Mu: "\u039C", + mu: "\u03BC", + Nu: "\u039D", + nu: "\u03BD", + Xi: "\u039E", + xi: "\u03BE", + Omicron: "\u039F", + omicron: "\u03BF", + Pi: "\u03A0", + pi: "\u03C0", + piv: "\u03D6", + varpi: "\u03D6", + Rho: "\u03A1", + rho: "\u03C1", + rhov: "\u03F1", + varrho: "\u03F1", + Sigma: "\u03A3", + sigma: "\u03C3", + sigmaf: "\u03C2", + sigmav: "\u03C2", + varsigma: "\u03C2", + Tau: "\u03A4", + tau: "\u03C4", + Upsilon: "\u03A5", + upsilon: "\u03C5", + upsi: "\u03C5", + Upsi: "\u03D2", + upsih: "\u03D2", + Phi: "\u03A6", + phi: "\u03C6", + phiv: "\u03D5", + varphi: "\u03D5", + Chi: "\u03A7", + chi: "\u03C7", + Psi: "\u03A8", + psi: "\u03C8", + Omega: "\u03A9", + omega: "\u03C9", + ohm: "\u03A9", + Gammad: "\u03DC", + gammad: "\u03DD", + digamma: "\u03DD" +}; +var CYRILLIC = { + Afr: "\u{1D504}", + afr: "\u{1D51E}", + Acy: "\u0410", + acy: "\u0430", + Bcy: "\u0411", + bcy: "\u0431", + Vcy: "\u0412", + vcy: "\u0432", + Gcy: "\u0413", + gcy: "\u0433", + Dcy: "\u0414", + dcy: "\u0434", + IEcy: "\u0415", + iecy: "\u0435", + IOcy: "\u0401", + iocy: "\u0451", + ZHcy: "\u0416", + zhcy: "\u0436", + Zcy: "\u0417", + zcy: "\u0437", + Icy: "\u0418", + icy: "\u0438", + Jcy: "\u0419", + jcy: "\u0439", + Kcy: "\u041A", + kcy: "\u043A", + Lcy: "\u041B", + lcy: "\u043B", + Mcy: "\u041C", + mcy: "\u043C", + Ncy: "\u041D", + ncy: "\u043D", + Ocy: "\u041E", + ocy: "\u043E", + Pcy: "\u041F", + pcy: "\u043F", + Rcy: "\u0420", + rcy: "\u0440", + Scy: "\u0421", + scy: "\u0441", + Tcy: "\u0422", + tcy: "\u0442", + Ucy: "\u0423", + ucy: "\u0443", + Fcy: "\u0424", + fcy: "\u0444", + KHcy: "\u0425", + khcy: "\u0445", + TScy: "\u0426", + tscy: "\u0446", + CHcy: "\u0427", + chcy: "\u0447", + SHcy: "\u0428", + shcy: "\u0448", + SHCHcy: "\u0429", + shchcy: "\u0449", + HARDcy: "\u042A", + hardcy: "\u044A", + Ycy: "\u042B", + ycy: "\u044B", + SOFTcy: "\u042C", + softcy: "\u044C", + Ecy: "\u042D", + ecy: "\u044D", + YUcy: "\u042E", + yucy: "\u044E", + YAcy: "\u042F", + yacy: "\u044F", + DJcy: "\u0402", + djcy: "\u0452", + GJcy: "\u0403", + gjcy: "\u0453", + Jukcy: "\u0404", + jukcy: "\u0454", + DScy: "\u0405", + dscy: "\u0455", + Iukcy: "\u0406", + iukcy: "\u0456", + YIcy: "\u0407", + yicy: "\u0457", + Jsercy: "\u0408", + jsercy: "\u0458", + LJcy: "\u0409", + ljcy: "\u0459", + NJcy: "\u040A", + njcy: "\u045A", + TSHcy: "\u040B", + tshcy: "\u045B", + KJcy: "\u040C", + kjcy: "\u045C", + Ubrcy: "\u040E", + ubrcy: "\u045E", + DZcy: "\u040F", + dzcy: "\u045F" +}; +var MATH = { + plus: "+", + minus: "\u2212", + mnplus: "\u2213", + mp: "\u2213", + pm: "\xB1", + times: "\xD7", + div: "\xF7", + divide: "\xF7", + sdot: "\u22C5", + star: "\u2606", + starf: "\u2605", + bigstar: "\u2605", + lowast: "\u2217", + ast: "*", + midast: "*", + compfn: "\u2218", + smallcircle: "\u2218", + bullet: "\u2022", + bull: "\u2022", + nbsp: "\xA0", + hellip: "\u2026", + mldr: "\u2026", + prime: "\u2032", + Prime: "\u2033", + tprime: "\u2034", + bprime: "\u2035", + backprime: "\u2035", + minus: "\u2212", + minusd: "\u2238", + dotminus: "\u2238", + plusdo: "\u2214", + dotplus: "\u2214", + plusmn: "\xB1", + minusplus: "\u2213", + mnplus: "\u2213", + mp: "\u2213", + setminus: "\u2216", + smallsetminus: "\u2216", + Backslash: "\u2216", + setmn: "\u2216", + ssetmn: "\u2216", + lowbar: "_", + verbar: "|", + vert: "|", + VerticalLine: "|", + colon: ":", + Colon: "\u2237", + Proportion: "\u2237", + ratio: "\u2236", + equals: "=", + ne: "\u2260", + nequiv: "\u2262", + equiv: "\u2261", + Congruent: "\u2261", + sim: "\u223C", + thicksim: "\u223C", + thksim: "\u223C", + sime: "\u2243", + simeq: "\u2243", + TildeEqual: "\u2243", + asymp: "\u2248", + approx: "\u2248", + thickapprox: "\u2248", + thkap: "\u2248", + TildeTilde: "\u2248", + ncong: "\u2247", + cong: "\u2245", + TildeFullEqual: "\u2245", + asympeq: "\u224D", + CupCap: "\u224D", + bump: "\u224E", + Bumpeq: "\u224E", + HumpDownHump: "\u224E", + bumpe: "\u224F", + bumpeq: "\u224F", + HumpEqual: "\u224F", + dotminus: "\u2238", + minusd: "\u2238", + plusdo: "\u2214", + dotplus: "\u2214", + le: "\u2264", + LessEqual: "\u2264", + ge: "\u2265", + GreaterEqual: "\u2265", + lesseqgtr: "\u22DA", + lesseqqgtr: "\u2A8B", + greater: ">", + less: "<" +}; +var MATH_ADVANCED = { + alefsym: "\u2135", + aleph: "\u2135", + beth: "\u2136", + gimel: "\u2137", + daleth: "\u2138", + forall: "\u2200", + ForAll: "\u2200", + part: "\u2202", + PartialD: "\u2202", + exist: "\u2203", + Exists: "\u2203", + nexist: "\u2204", + nexists: "\u2204", + empty: "\u2205", + emptyset: "\u2205", + emptyv: "\u2205", + varnothing: "\u2205", + nabla: "\u2207", + Del: "\u2207", + isin: "\u2208", + isinv: "\u2208", + in: "\u2208", + Element: "\u2208", + notin: "\u2209", + notinva: "\u2209", + ni: "\u220B", + niv: "\u220B", + SuchThat: "\u220B", + ReverseElement: "\u220B", + notni: "\u220C", + notniva: "\u220C", + prod: "\u220F", + Product: "\u220F", + coprod: "\u2210", + Coproduct: "\u2210", + sum: "\u2211", + Sum: "\u2211", + minus: "\u2212", + mp: "\u2213", + plusdo: "\u2214", + dotplus: "\u2214", + setminus: "\u2216", + lowast: "\u2217", + radic: "\u221A", + Sqrt: "\u221A", + prop: "\u221D", + propto: "\u221D", + Proportional: "\u221D", + varpropto: "\u221D", + infin: "\u221E", + infintie: "\u29DD", + ang: "\u2220", + angle: "\u2220", + angmsd: "\u2221", + measuredangle: "\u2221", + angsph: "\u2222", + mid: "\u2223", + VerticalBar: "\u2223", + nmid: "\u2224", + nsmid: "\u2224", + npar: "\u2226", + parallel: "\u2225", + spar: "\u2225", + nparallel: "\u2226", + nspar: "\u2226", + and: "\u2227", + wedge: "\u2227", + or: "\u2228", + vee: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + Integral: "\u222B", + conint: "\u222E", + ContourIntegral: "\u222E", + Conint: "\u222F", + DoubleContourIntegral: "\u222F", + Cconint: "\u2230", + there4: "\u2234", + therefore: "\u2234", + Therefore: "\u2234", + becaus: "\u2235", + because: "\u2235", + Because: "\u2235", + ratio: "\u2236", + Proportion: "\u2237", + minusd: "\u2238", + dotminus: "\u2238", + mDDot: "\u223A", + homtht: "\u223B", + sim: "\u223C", + bsimg: "\u223D", + backsim: "\u223D", + ac: "\u223E", + mstpos: "\u223E", + acd: "\u223F", + VerticalTilde: "\u2240", + wr: "\u2240", + wreath: "\u2240", + nsime: "\u2244", + nsimeq: "\u2244", + nsimeq: "\u2244", + ncong: "\u2247", + simne: "\u2246", + ncongdot: "\u2A6D\u0338", + ngsim: "\u2275", + nsim: "\u2241", + napprox: "\u2249", + nap: "\u2249", + ngeq: "\u2271", + nge: "\u2271", + nleq: "\u2270", + nle: "\u2270", + ngtr: "\u226F", + ngt: "\u226F", + nless: "\u226E", + nlt: "\u226E", + nprec: "\u2280", + npr: "\u2280", + nsucc: "\u2281", + nsc: "\u2281" +}; +var ARROWS = { + larr: "\u2190", + leftarrow: "\u2190", + LeftArrow: "\u2190", + uarr: "\u2191", + uparrow: "\u2191", + UpArrow: "\u2191", + rarr: "\u2192", + rightarrow: "\u2192", + RightArrow: "\u2192", + darr: "\u2193", + downarrow: "\u2193", + DownArrow: "\u2193", + harr: "\u2194", + leftrightarrow: "\u2194", + LeftRightArrow: "\u2194", + varr: "\u2195", + updownarrow: "\u2195", + UpDownArrow: "\u2195", + nwarr: "\u2196", + nwarrow: "\u2196", + UpperLeftArrow: "\u2196", + nearr: "\u2197", + nearrow: "\u2197", + UpperRightArrow: "\u2197", + searr: "\u2198", + searrow: "\u2198", + LowerRightArrow: "\u2198", + swarr: "\u2199", + swarrow: "\u2199", + LowerLeftArrow: "\u2199", + lArr: "\u21D0", + Leftarrow: "\u21D0", + uArr: "\u21D1", + Uparrow: "\u21D1", + rArr: "\u21D2", + Rightarrow: "\u21D2", + dArr: "\u21D3", + Downarrow: "\u21D3", + hArr: "\u21D4", + Leftrightarrow: "\u21D4", + iff: "\u21D4", + vArr: "\u21D5", + Updownarrow: "\u21D5", + lAarr: "\u21DA", + Lleftarrow: "\u21DA", + rAarr: "\u21DB", + Rrightarrow: "\u21DB", + lrarr: "\u21C6", + leftrightarrows: "\u21C6", + rlarr: "\u21C4", + rightleftarrows: "\u21C4", + lrhar: "\u21CB", + leftrightharpoons: "\u21CB", + ReverseEquilibrium: "\u21CB", + rlhar: "\u21CC", + rightleftharpoons: "\u21CC", + Equilibrium: "\u21CC", + udarr: "\u21C5", + UpArrowDownArrow: "\u21C5", + duarr: "\u21F5", + DownArrowUpArrow: "\u21F5", + llarr: "\u21C7", + leftleftarrows: "\u21C7", + rrarr: "\u21C9", + rightrightarrows: "\u21C9", + ddarr: "\u21CA", + downdownarrows: "\u21CA", + har: "\u21BD", + lhard: "\u21BD", + leftharpoondown: "\u21BD", + lharu: "\u21BC", + leftharpoonup: "\u21BC", + rhard: "\u21C1", + rightharpoondown: "\u21C1", + rharu: "\u21C0", + rightharpoonup: "\u21C0", + lsh: "\u21B0", + Lsh: "\u21B0", + rsh: "\u21B1", + Rsh: "\u21B1", + ldsh: "\u21B2", + rdsh: "\u21B3", + hookleftarrow: "\u21A9", + hookrightarrow: "\u21AA", + mapstoleft: "\u21A4", + mapstoup: "\u21A5", + map: "\u21A6", + mapsto: "\u21A6", + mapstodown: "\u21A7", + crarr: "\u21B5", + nwarrow: "\u2196", + nearrow: "\u2197", + searrow: "\u2198", + swarrow: "\u2199", + nleftarrow: "\u219A", + nleftrightarrow: "\u21AE", + nrightarrow: "\u219B", + nrarr: "\u219B", + larrtl: "\u21A2", + rarrtl: "\u21A3", + leftarrowtail: "\u21A2", + rightarrowtail: "\u21A3", + twoheadleftarrow: "\u219E", + twoheadrightarrow: "\u21A0", + Larr: "\u219E", + Rarr: "\u21A0", + larrhk: "\u21A9", + rarrhk: "\u21AA", + larrlp: "\u21AB", + looparrowleft: "\u21AB", + rarrlp: "\u21AC", + looparrowright: "\u21AC", + harrw: "\u21AD", + leftrightsquigarrow: "\u21AD", + nrarrw: "\u219D\u0338", + rarrw: "\u219D", + rightsquigarrow: "\u219D", + larrbfs: "\u291F", + rarrbfs: "\u2920", + nvHarr: "\u2904", + nvlArr: "\u2902", + nvrArr: "\u2903", + larrfs: "\u291D", + rarrfs: "\u291E", + Map: "\u2905", + larrsim: "\u2973", + rarrsim: "\u2974", + harrcir: "\u2948", + Uarrocir: "\u2949", + lurdshar: "\u294A", + ldrdhar: "\u2967", + ldrushar: "\u294B", + rdldhar: "\u2969", + lrhard: "\u296D", + rlhar: "\u21CC", + uharr: "\u21BE", + uharl: "\u21BF", + dharr: "\u21C2", + dharl: "\u21C3", + Uarr: "\u219F", + Darr: "\u21A1", + zigrarr: "\u21DD", + nwArr: "\u21D6", + neArr: "\u21D7", + seArr: "\u21D8", + swArr: "\u21D9", + nharr: "\u21AE", + nhArr: "\u21CE", + nlarr: "\u219A", + nlArr: "\u21CD", + nrarr: "\u219B", + nrArr: "\u21CF", + larrb: "\u21E4", + LeftArrowBar: "\u21E4", + rarrb: "\u21E5", + RightArrowBar: "\u21E5" +}; +var SHAPES = { + square: "\u25A1", + Square: "\u25A1", + squ: "\u25A1", + squf: "\u25AA", + squarf: "\u25AA", + blacksquar: "\u25AA", + blacksquare: "\u25AA", + FilledVerySmallSquare: "\u25AA", + blk34: "\u2593", + blk12: "\u2592", + blk14: "\u2591", + block: "\u2588", + srect: "\u25AD", + rect: "\u25AD", + sdot: "\u22C5", + sdotb: "\u22A1", + dotsquare: "\u22A1", + triangle: "\u25B5", + tri: "\u25B5", + trine: "\u25B5", + utri: "\u25B5", + triangledown: "\u25BF", + dtri: "\u25BF", + tridown: "\u25BF", + triangleleft: "\u25C3", + ltri: "\u25C3", + triangleright: "\u25B9", + rtri: "\u25B9", + blacktriangle: "\u25B4", + utrif: "\u25B4", + blacktriangledown: "\u25BE", + dtrif: "\u25BE", + blacktriangleleft: "\u25C2", + ltrif: "\u25C2", + blacktriangleright: "\u25B8", + rtrif: "\u25B8", + loz: "\u25CA", + lozenge: "\u25CA", + blacklozenge: "\u29EB", + lozf: "\u29EB", + bigcirc: "\u25EF", + xcirc: "\u25EF", + circ: "\u02C6", + Circle: "\u25CB", + cir: "\u25CB", + o: "\u25CB", + bullet: "\u2022", + bull: "\u2022", + hellip: "\u2026", + mldr: "\u2026", + nldr: "\u2025", + boxh: "\u2500", + HorizontalLine: "\u2500", + boxv: "\u2502", + boxdr: "\u250C", + boxdl: "\u2510", + boxur: "\u2514", + boxul: "\u2518", + boxvr: "\u251C", + boxvl: "\u2524", + boxhd: "\u252C", + boxhu: "\u2534", + boxvh: "\u253C", + boxH: "\u2550", + boxV: "\u2551", + boxdR: "\u2552", + boxDr: "\u2553", + boxDR: "\u2554", + boxDl: "\u2555", + boxdL: "\u2556", + boxDL: "\u2557", + boxuR: "\u2558", + boxUr: "\u2559", + boxUR: "\u255A", + boxUl: "\u255C", + boxuL: "\u255B", + boxUL: "\u255D", + boxvR: "\u255E", + boxVr: "\u255F", + boxVR: "\u2560", + boxVl: "\u2562", + boxvL: "\u2561", + boxVL: "\u2563", + boxHd: "\u2564", + boxhD: "\u2565", + boxHD: "\u2566", + boxHu: "\u2567", + boxhU: "\u2568", + boxHU: "\u2569", + boxvH: "\u256A", + boxVh: "\u256B", + boxVH: "\u256C" +}; +var PUNCTUATION = { + excl: "!", + iexcl: "\xA1", + brvbar: "\xA6", + sect: "\xA7", + uml: "\xA8", + copy: "\xA9", + ordf: "\xAA", + laquo: "\xAB", + not: "\xAC", + shy: "\xAD", + reg: "\xAE", + macr: "\xAF", + deg: "\xB0", + plusmn: "\xB1", + sup2: "\xB2", + sup3: "\xB3", + acute: "\xB4", + micro: "\xB5", + para: "\xB6", + middot: "\xB7", + cedil: "\xB8", + sup1: "\xB9", + ordm: "\xBA", + raquo: "\xBB", + frac14: "\xBC", + frac12: "\xBD", + frac34: "\xBE", + iquest: "\xBF", + nbsp: "\xA0", + comma: ",", + period: ".", + colon: ":", + semi: ";", + vert: "|", + Verbar: "\u2016", + verbar: "|", + dblac: "\u02DD", + circ: "\u02C6", + caron: "\u02C7", + breve: "\u02D8", + dot: "\u02D9", + ring: "\u02DA", + ogon: "\u02DB", + tilde: "\u02DC", + DiacriticalGrave: "`", + DiacriticalAcute: "\xB4", + DiacriticalTilde: "\u02DC", + DiacriticalDot: "\u02D9", + DiacriticalDoubleAcute: "\u02DD", + grave: "`", + acute: "\xB4" +}; +var CURRENCY = { + cent: "\xA2", + pound: "\xA3", + curren: "\xA4", + yen: "\xA5", + euro: "\u20AC", + dollar: "$", + euro: "\u20AC", + fnof: "\u0192", + inr: "\u20B9", + af: "\u060B", + birr: "\u1265\u122D", + peso: "\u20B1", + rub: "\u20BD", + won: "\u20A9", + yuan: "\xA5", + cedil: "\xB8" +}; +var FRACTIONS = { + frac12: "\xBD", + half: "\xBD", + frac13: "\u2153", + frac14: "\xBC", + frac15: "\u2155", + frac16: "\u2159", + frac18: "\u215B", + frac23: "\u2154", + frac25: "\u2156", + frac34: "\xBE", + frac35: "\u2157", + frac38: "\u215C", + frac45: "\u2158", + frac56: "\u215A", + frac58: "\u215D", + frac78: "\u215E", + frasl: "\u2044" +}; +var MISC_SYMBOLS = { + trade: "\u2122", + TRADE: "\u2122", + telrec: "\u2315", + target: "\u2316", + ulcorn: "\u231C", + ulcorner: "\u231C", + urcorn: "\u231D", + urcorner: "\u231D", + dlcorn: "\u231E", + llcorner: "\u231E", + drcorn: "\u231F", + lrcorner: "\u231F", + intercal: "\u22BA", + intcal: "\u22BA", + oplus: "\u2295", + CirclePlus: "\u2295", + ominus: "\u2296", + CircleMinus: "\u2296", + otimes: "\u2297", + CircleTimes: "\u2297", + osol: "\u2298", + odot: "\u2299", + CircleDot: "\u2299", + oast: "\u229B", + circledast: "\u229B", + odash: "\u229D", + circleddash: "\u229D", + ocirc: "\u229A", + circledcirc: "\u229A", + boxplus: "\u229E", + plusb: "\u229E", + boxminus: "\u229F", + minusb: "\u229F", + boxtimes: "\u22A0", + timesb: "\u22A0", + boxdot: "\u22A1", + sdotb: "\u22A1", + veebar: "\u22BB", + vee: "\u2228", + barvee: "\u22BD", + and: "\u2227", + wedge: "\u2227", + Cap: "\u22D2", + Cup: "\u22D3", + Fork: "\u22D4", + pitchfork: "\u22D4", + epar: "\u22D5", + ltlarr: "\u2976", + nvap: "\u224D\u20D2", + nvsim: "\u223C\u20D2", + nvge: "\u2265\u20D2", + nvle: "\u2264\u20D2", + nvlt: "<\u20D2", + nvgt: ">\u20D2", + nvltrie: "\u22B4\u20D2", + nvrtrie: "\u22B5\u20D2", + Vdash: "\u22A9", + dashv: "\u22A3", + vDash: "\u22A8", + Vdash: "\u22A9", + Vvdash: "\u22AA", + nvdash: "\u22AC", + nvDash: "\u22AD", + nVdash: "\u22AE", + nVDash: "\u22AF" +}; +var ALL_ENTITIES = { + ...BASIC_LATIN, + ...LATIN_ACCENTS, + ...LATIN_EXTENDED, + ...GREEK, + ...CYRILLIC, + ...MATH, + ...MATH_ADVANCED, + ...ARROWS, + ...SHAPES, + ...PUNCTUATION, + ...CURRENCY, + ...FRACTIONS, + ...MISC_SYMBOLS +}; +var XML = { + amp: "&", + apos: "'", + gt: ">", + lt: "<", + quot: '"' +}; +var COMMON_HTML = { + nbsp: "\xA0", + copy: "\xA9", + reg: "\xAE", + trade: "\u2122", + mdash: "\u2014", + ndash: "\u2013", + hellip: "\u2026", + laquo: "\xAB", + raquo: "\xBB", + lsquo: "\u2018", + rsquo: "\u2019", + ldquo: "\u201C", + rdquo: "\u201D", + bull: "\u2022", + para: "\xB6", + sect: "\xA7", + deg: "\xB0", + frac12: "\xBD", + frac14: "\xBC", + frac34: "\xBE" +}; + +// node_modules/@nodable/entities/src/EntityDecoder.js +var SPECIAL_CHARS = new Set("!?\\\\/[]$%{}^&*()<>|+"); +function validateEntityName(name) { + if (name[0] === "#") { + throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`); + } + for (const ch of name) { + if (SPECIAL_CHARS.has(ch)) { + throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`); + } + } + return name; +} +function mergeEntityMaps(...maps) { + const out = /* @__PURE__ */ Object.create(null); + for (const map of maps) { + if (!map) continue; + for (const key of Object.keys(map)) { + const raw = map[key]; + if (typeof raw === "string") { + out[key] = raw; + } else if (raw && typeof raw === "object" && raw.val !== void 0) { + const val = raw.val; + if (typeof val === "string") { + out[key] = val; + } + } + } + } + return out; +} +var LIMIT_TIER_EXTERNAL = "external"; +var LIMIT_TIER_BASE = "base"; +var LIMIT_TIER_ALL = "all"; +function parseLimitTiers(raw) { + if (!raw || raw === LIMIT_TIER_EXTERNAL) return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]); + if (raw === LIMIT_TIER_ALL) return /* @__PURE__ */ new Set([LIMIT_TIER_ALL]); + if (raw === LIMIT_TIER_BASE) return /* @__PURE__ */ new Set([LIMIT_TIER_BASE]); + if (Array.isArray(raw)) return new Set(raw); + return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]); +} +var NCR_LEVEL = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 }); +var XML10_ALLOWED_C0 = /* @__PURE__ */ new Set([9, 10, 13]); +function parseNCRConfig(ncr) { + if (!ncr) { + return { xmlVersion: 1, onLevel: NCR_LEVEL.allow, nullLevel: NCR_LEVEL.remove }; + } + const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1; + const onLevel = NCR_LEVEL[ncr.onNCR] ?? NCR_LEVEL.allow; + const nullLevel = NCR_LEVEL[ncr.nullNCR] ?? NCR_LEVEL.remove; + const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove); + return { xmlVersion, onLevel, nullLevel: clampedNull }; +} +var EntityDecoder = class { + /** + * @param {object} [options] + * @param {object|null} [options.namedEntities] — extra named entities merged into base map + * @param {object} [options.limit] — security limits + * @param {number} [options.limit.maxTotalExpansions=0] — 0 = unlimited + * @param {number} [options.limit.maxExpandedLength=0] — 0 = unlimited + * @param {'external'|'base'|'all'|string[]} [options.limit.applyLimitsTo='external'] + * Which entity tiers count against the security limits: + * - 'external' (default) — only input/runtime + persistent external entities + * - 'base' — only DEFAULT_XML_ENTITIES + namedEntities + * - 'all' — every entity regardless of tier + * - string[] — explicit combination, e.g. ['external', 'base'] + * @param {((resolved: string, original: string) => string)|null} [options.postCheck=null] + * @param {string[]} [options.remove=[]] — entity names (e.g. ['nbsp', '#13']) to delete (replace with empty string) + * @param {string[]} [options.leave=[]] — entity names to keep as literal (unchanged in output) + * @param {object} [options.ncr] — Numeric Character Reference controls + * @param {1.0|1.1} [options.ncr.xmlVersion=1.0] + * XML version governing which codepoint ranges are restricted: + * - 1.0 — C0 controls U+0001–U+001F (except U+0009/000A/000D) are prohibited + * - 1.1 — C0 controls are allowed when written as NCRs; C1 (U+007F–U+009F) decoded as-is + * @param {'allow'|'leave'|'remove'|'throw'} [options.ncr.onNCR='allow'] + * Base action for numeric references. Severity order: allow < leave < remove < throw. + * For codepoint ranges that carry a minimum level (surrogates → remove, XML 1.0 C0 → remove), + * the effective action is max(onNCR, rangeMinimum). + * @param {'remove'|'throw'} [options.ncr.nullNCR='remove'] + * Action for U+0000 (null). 'allow' and 'leave' are clamped to 'remove' since null is never safe. + */ + constructor(options = {}) { + this._limit = options.limit || {}; + this._maxTotalExpansions = this._limit.maxTotalExpansions || 0; + this._maxExpandedLength = this._limit.maxExpandedLength || 0; + this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r) => r; + this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL); + this._numericAllowed = options.numericAllowed ?? true; + this._baseMap = mergeEntityMaps(XML, options.namedEntities || null); + this._externalMap = /* @__PURE__ */ Object.create(null); + this._inputMap = /* @__PURE__ */ Object.create(null); + this._totalExpansions = 0; + this._expandedLength = 0; + this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []); + this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []); + const ncrCfg = parseNCRConfig(options.ncr); + this._ncrXmlVersion = ncrCfg.xmlVersion; + this._ncrOnLevel = ncrCfg.onLevel; + this._ncrNullLevel = ncrCfg.nullLevel; + } + // ------------------------------------------------------------------------- + // Persistent external entity registration + // ------------------------------------------------------------------------- + /** + * Replace the full set of persistent external entities. + * All keys are validated — throws on invalid characters. + * @param {Record} map + */ + setExternalEntities(map) { + if (map) { + for (const key of Object.keys(map)) { + validateEntityName(key); + } + } + this._externalMap = mergeEntityMaps(map); + } + /** + * Add a single persistent external entity. + * @param {string} key + * @param {string} value + */ + addExternalEntity(key, value) { + validateEntityName(key); + if (typeof value === "string" && value.indexOf("&") === -1) { + this._externalMap[key] = value; + } + } + // ------------------------------------------------------------------------- + // Input / runtime entity registration (per document) + // ------------------------------------------------------------------------- + /** + * Inject DOCTYPE entities for the current document. + * Also resets per-document expansion counters. + * @param {Record} map + */ + addInputEntities(map) { + this._totalExpansions = 0; + this._expandedLength = 0; + this._inputMap = mergeEntityMaps(map); + } + // ------------------------------------------------------------------------- + // Per-document reset + // ------------------------------------------------------------------------- + /** + * Wipe input/runtime entities and reset counters. + * Call this before processing each new document. + * @returns {this} + */ + reset() { + this._inputMap = /* @__PURE__ */ Object.create(null); + this._totalExpansions = 0; + this._expandedLength = 0; + return this; + } + // ------------------------------------------------------------------------- + // XML version (can be set after construction, e.g. once parser reads ) + // ------------------------------------------------------------------------- + /** + * Update the XML version used for NCR classification. + * Call this as soon as the document's `` declaration is parsed. + * @param {1.0|1.1|number} version + */ + setXmlVersion(version) { + this._ncrXmlVersion = version === 1.1 ? 1.1 : 1; + } + // ------------------------------------------------------------------------- + // Primary API + // ------------------------------------------------------------------------- + /** + * Replace all entity references in `str` in a single pass. + * + * @param {string} str + * @returns {string} + */ + decode(str) { + if (typeof str !== "string" || str.length === 0) return str; + const original = str; + const chunks = []; + const len = str.length; + let last = 0; + let i = 0; + const limitExpansions = this._maxTotalExpansions > 0; + const limitLength = this._maxExpandedLength > 0; + const checkLimits = limitExpansions || limitLength; + while (i < len) { + if (str.charCodeAt(i) !== 38) { + i++; + continue; + } + let j = i + 1; + while (j < len && str.charCodeAt(j) !== 59 && j - i <= 32) j++; + if (j >= len || str.charCodeAt(j) !== 59) { + i++; + continue; + } + const token = str.slice(i + 1, j); + if (token.length === 0) { + i++; + continue; + } + let replacement; + let tier; + if (this._removeSet.has(token)) { + replacement = ""; + if (tier === void 0) { + tier = LIMIT_TIER_EXTERNAL; + } + } else if (this._leaveSet.has(token)) { + i++; + continue; + } else if (token.charCodeAt(0) === 35) { + const ncrResult = this._resolveNCR(token); + if (ncrResult === void 0) { + i++; + continue; + } + replacement = ncrResult; + tier = LIMIT_TIER_BASE; + } else { + const resolved = this._resolveName(token); + replacement = resolved?.value; + tier = resolved?.tier; + } + if (replacement === void 0) { + i++; + continue; + } + if (i > last) chunks.push(str.slice(last, i)); + chunks.push(replacement); + last = j + 1; + i = last; + if (checkLimits && this._tierCounts(tier)) { + if (limitExpansions) { + this._totalExpansions++; + if (this._totalExpansions > this._maxTotalExpansions) { + throw new Error( + `[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}` + ); + } + } + if (limitLength) { + const delta = replacement.length - (token.length + 2); + if (delta > 0) { + this._expandedLength += delta; + if (this._expandedLength > this._maxExpandedLength) { + throw new Error( + `[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}` + ); + } + } + } + } + } + if (last < len) chunks.push(str.slice(last)); + const result = chunks.length === 0 ? str : chunks.join(""); + return this._postCheck(result, original); + } + // ------------------------------------------------------------------------- + // Private: limit tier check + // ------------------------------------------------------------------------- + /** + * Returns true if a resolved entity of the given tier should count + * against the expansion/length limits. + * @param {string} tier — LIMIT_TIER_EXTERNAL | LIMIT_TIER_BASE + * @returns {boolean} + */ + _tierCounts(tier) { + if (this._limitTiers.has(LIMIT_TIER_ALL)) return true; + return this._limitTiers.has(tier); + } + // ------------------------------------------------------------------------- + // Private: entity resolution + // ------------------------------------------------------------------------- + /** + * Resolve a named entity token (without & and ;). + * Priority: inputMap > externalMap > baseMap + * Returns the resolved value tagged with its limit tier. + * + * @param {string} name + * @returns {{ value: string, tier: string }|undefined} + */ + _resolveName(name) { + if (name in this._inputMap) return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL }; + if (name in this._externalMap) return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL }; + if (name in this._baseMap) return { value: this._baseMap[name], tier: LIMIT_TIER_BASE }; + return void 0; + } + /** + * Classify a codepoint and return the minimum action level that must be applied. + * Returns -1 when no minimum is imposed (normal allow path). + * + * Ranges checked (in priority order): + * 1. U+0000 — null, governed by nullNCR (always ≥ remove) + * 2. U+D800–U+DFFF — surrogates, always prohibited (min: remove) + * 3. U+0001–U+001F \ {0x09,0x0A,0x0D} — XML 1.0 restricted C0 (min: remove) + * (skipped in XML 1.1 — C0 controls are allowed when written as NCRs) + * + * @param {number} cp — codepoint + * @returns {number} — minimum NCR_LEVEL value, or -1 for no restriction + */ + _classifyNCR(cp) { + if (cp === 0) return this._ncrNullLevel; + if (cp >= 55296 && cp <= 57343) return NCR_LEVEL.remove; + if (this._ncrXmlVersion === 1) { + if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C0.has(cp)) return NCR_LEVEL.remove; + } + return -1; + } + /** + * Execute a resolved NCR action. + * + * @param {number} action — NCR_LEVEL value + * @param {string} token — raw token (e.g. '#38') for error messages + * @param {number} cp — codepoint, used only for error messages + * @returns {string|undefined} + * - decoded character string → 'allow' + * - '' → 'remove' + * - undefined → 'leave' (caller must skip past '&' only) + * - throws Error → 'throw' + */ + _applyNCRAction(action, token, cp) { + switch (action) { + case NCR_LEVEL.allow: + return String.fromCodePoint(cp); + case NCR_LEVEL.remove: + return ""; + case NCR_LEVEL.leave: + return void 0; + // signal: keep literal + case NCR_LEVEL.throw: + throw new Error( + `[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})` + ); + default: + return String.fromCodePoint(cp); + } + } + /** + * Full NCR resolution pipeline for a numeric token. + * + * Steps: + * 1. Parse the codepoint (decimal or hex). + * 2. Validate the raw codepoint range (NaN, <0, >0x10FFFF). + * 3. If numericAllowed is false and no minimum restriction applies → leave as-is. + * 4. Classify the codepoint to find the minimum required action level. + * 5. Resolve effective action = max(onNCR, minimum). + * 6. Apply and return. + * + * @param {string} token — e.g. '#38', '#x26', '#X26' + * @returns {string|undefined} + * - string (incl. '') — replacement ('' = remove) + * - undefined — leave original &token; as-is + */ + _resolveNCR(token) { + const second = token.charCodeAt(1); + let cp; + if (second === 120 || second === 88) { + cp = parseInt(token.slice(2), 16); + } else { + cp = parseInt(token.slice(1), 10); + } + if (Number.isNaN(cp) || cp < 0 || cp > 1114111) return void 0; + const minimum = this._classifyNCR(cp); + if (!this._numericAllowed && minimum < NCR_LEVEL.remove) return void 0; + const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum); + return this._applyNCRAction(effective, token, cp); + } +}; + // node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js var defaultOnDangerousProperty = (name) => { if (DANGEROUS_PROPERTY_NAMES.includes(name)) { @@ -19486,6 +20955,7 @@ var defaultOptions2 = { unpairedTags: [], processEntities: true, htmlEntities: false, + entityDecoder: null, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, @@ -19517,18 +20987,19 @@ function validatePropertyName(propertyName, optionName) { ); } } -function normalizeProcessEntities(value) { +function normalizeProcessEntities(value, htmlEntities) { if (typeof value === "boolean") { return { enabled: value, // true or false maxEntitySize: 1e4, - maxExpansionDepth: 10, - maxTotalExpansions: 1e3, + maxExpansionDepth: 1e4, + maxTotalExpansions: Infinity, maxExpandedLength: 1e5, - maxEntityCount: 100, + maxEntityCount: 1e3, allowedTags: null, - tagFilter: null + tagFilter: null, + appliesTo: "all" }; } if (typeof value === "object" && value !== null) { @@ -19540,7 +21011,8 @@ function normalizeProcessEntities(value) { maxExpandedLength: Math.max(1, value.maxExpandedLength ?? 1e5), maxEntityCount: Math.max(1, value.maxEntityCount ?? 1e3), allowedTags: value.allowedTags ?? null, - tagFilter: value.tagFilter ?? null + tagFilter: value.tagFilter ?? null, + appliesTo: value.appliesTo ?? "all" }; } return normalizeProcessEntities(true); @@ -19562,7 +21034,7 @@ var buildOptions = function(options) { if (built.onDangerousProperty === null) { built.onDangerousProperty = defaultOnDangerousProperty; } - built.processEntities = normalizeProcessEntities(built.processEntities); + built.processEntities = normalizeProcessEntities(built.processEntities, built.htmlEntities); built.unpairedTagsSet = new Set(built.unpairedTags); if (built.stopNodes && Array.isArray(built.stopNodes)) { built.stopNodes = built.stopNodes.map((node) => { @@ -19635,11 +21107,7 @@ var DocTypeReader = class { `Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})` ); } - const escaped = entityName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - entities[entityName] = { - regx: RegExp(`&${escaped};`, "g"), - val - }; + entities[entityName] = val; entityCount++; } } else if (hasBody && hasSeq(xmlData, "!ELEMENT", i)) { @@ -19689,7 +21157,7 @@ var DocTypeReader = class { i++; } let entityName = xmlData.substring(startIndex, i); - validateEntityName(entityName); + validateEntityName2(entityName); i = skipWhitespace(xmlData, i); if (!this.suppressValidationErr) { if (xmlData.substring(i, i + 6).toUpperCase() === "SYSTEM") { @@ -19715,7 +21183,7 @@ var DocTypeReader = class { i++; } let notationName = xmlData.substring(startIndex, i); - !this.suppressValidationErr && validateEntityName(notationName); + !this.suppressValidationErr && validateEntityName2(notationName); i = skipWhitespace(xmlData, i); const identifierType = xmlData.substring(i, i + 6).toUpperCase(); if (!this.suppressValidationErr && identifierType !== "SYSTEM" && identifierType !== "PUBLIC") { @@ -19797,14 +21265,14 @@ var DocTypeReader = class { i++; } let elementName = xmlData.substring(startIndex, i); - validateEntityName(elementName); + validateEntityName2(elementName); i = skipWhitespace(xmlData, i); startIndex = i; while (i < xmlData.length && !/\s/.test(xmlData[i])) { i++; } let attributeName = xmlData.substring(startIndex, i); - if (!validateEntityName(attributeName)) { + if (!validateEntityName2(attributeName)) { throw new Error(`Invalid attribute name: "${attributeName}"`); } i = skipWhitespace(xmlData, i); @@ -19825,7 +21293,7 @@ var DocTypeReader = class { } let notation = xmlData.substring(startIndex2, i); notation = notation.trim(); - if (!validateEntityName(notation)) { + if (!validateEntityName2(notation)) { throw new Error(`Invalid notation name: "${notation}"`); } allowedNotations.push(notation); @@ -19882,7 +21350,7 @@ function hasSeq(data, seq, i) { } return true; } -function validateEntityName(name) { +function validateEntityName2(name) { if (isName(name)) return name; else @@ -20799,314 +22267,6 @@ var Matcher = class { } }; -// node_modules/@nodable/entities/src/EntityReplacer.js -var DEFAULT_XML_ENTITIES = { - apos: { regex: /&(apos|#0*39|#x0*27);/g, val: "'" }, - gt: { regex: /&(gt|#0*62|#x0*3[Ee]);/g, val: ">" }, - lt: { regex: /&(lt|#0*60|#x0*3[Cc]);/g, val: "<" }, - quot: { regex: /&(quot|#0*34|#x0*22);/g, val: '"' } -}; -var AMP_ENTITY = { regex: /&(amp|#0*38|#x0*26);/g, val: "&" }; -var SPECIAL_CHARS = new Set("!?\\\\/[]$%{}^&*()<>|+"); -function validateEntityName2(name) { - for (const ch of name) { - if (SPECIAL_CHARS.has(ch)) { - throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`); - } - } - return name; -} -function escapeForRegex(str) { - return str.replace(/[.\-+*:]/g, "\\$&"); -} -function resolveTable(option, builtIn, enabledByDefault = false) { - if (option === false || option === null) return null; - if (option === true) return builtIn; - if (option === void 0) return enabledByDefault ? builtIn : null; - if (typeof option === "object") return option; - return null; -} -function resolveApplyLimitsTo(spec) { - if (spec === "all") return "all"; - if (typeof spec === "string") return /* @__PURE__ */ new Set([spec]); - if (Array.isArray(spec)) return new Set(spec); - return /* @__PURE__ */ new Set(["external"]); -} -function buildEntries(map) { - const entries = []; - for (const key of Object.keys(map)) { - const raw = map[key]; - if (typeof raw === "object" && raw !== null && raw.val !== void 0) { - entries.push([key, { regex: raw.regex ?? raw.regx, val: raw.val }]); - } else if (typeof raw === "string") { - if (raw.indexOf("&") !== -1) continue; - validateEntityName2(key); - entries.push([key, { - regex: new RegExp("&" + escapeForRegex(key) + ";", "g"), - val: raw - }]); - } - } - return entries; -} -var EntityReplacer = class { - /** - * @param {object} [options] - * @param {boolean|object|null} [options.default=true] - * @param {boolean|object|null} [options.amp=true] - * @param {boolean|object|null} [options.system=false] - * @param {number} [options.maxTotalExpansions=0] - * @param {number} [options.maxExpandedLength=0] - * @param {'external'|'all'|string[]} [options.applyLimitsTo='external'] - * @param {((resolved: string, original: string) => string)|null} [options.postCheck=null] - */ - constructor(options = {}) { - this._defaultTable = resolveTable(options.default, DEFAULT_XML_ENTITIES, true); - this._systemTable = resolveTable(options.system, null, false); - this._ampEnabled = options.amp !== false && options.amp !== null; - this._maxTotalExpansions = options.maxTotalExpansions || 0; - this._maxExpandedLength = options.maxExpandedLength || 0; - this._applyLimitsTo = resolveApplyLimitsTo(options.applyLimitsTo ?? "external"); - this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r) => r; - this._limitExternal = this._applyLimitsTo === "all" || this._applyLimitsTo instanceof Set && this._applyLimitsTo.has("external"); - this._limitSystem = this._applyLimitsTo === "all" || this._applyLimitsTo instanceof Set && this._applyLimitsTo.has("system"); - this._limitDefault = this._applyLimitsTo === "all" || this._applyLimitsTo instanceof Set && this._applyLimitsTo.has("default"); - this._defaultEntries = this._defaultTable ? Object.entries(this._defaultTable) : []; - this._systemEntries = this._systemTable ? Object.entries(this._systemTable) : []; - this._persistentEntries = []; - this._inputEntries = []; - this._totalExpansions = 0; - this._expandedLength = 0; - } - // ------------------------------------------------------------------------- - // Persistent external entity registration (survives across documents) - // ------------------------------------------------------------------------- - /** - * Replace the full set of persistent external entities. - * These are never wiped between documents. - * - * @param {Record} map - */ - setExternalEntities(map) { - this._persistentEntries = buildEntries(map); - } - /** - * Add a single persistent external entity without disturbing existing ones. - * - * @param {string} key — bare entity name, e.g. `'copy'` - * @param {string} value — replacement string, e.g. `'©'` - */ - addExternalEntity(key, value) { - validateEntityName2(key); - if (typeof value === "string" && value.indexOf("&") === -1) { - this._persistentEntries.push([key, { - regex: new RegExp("&" + escapeForRegex(key) + ";", "g"), - val: value - }]); - } - } - // ------------------------------------------------------------------------- - // Input / runtime entity registration (per document) - // ------------------------------------------------------------------------- - /** - * Inject DOCTYPE (input/runtime) entities for the current document. - * These are stored separately from persistent entities and wiped on the - * next `getInstance()` call so they never leak into subsequent documents. - * - * Also resets per-document expansion counters. - * - * @param {Record} map - */ - addInputEntities(map) { - this._totalExpansions = 0; - this._expandedLength = 0; - this._inputEntries = buildEntries(map); - } - // ------------------------------------------------------------------------- - // getInstance — builder factory integration point - // ------------------------------------------------------------------------- - /** - * Reset all per-document state (input entities + expansion counters) and - * return `this`. - * - * The builder factory calls this each time it creates a new builder instance - * so DOCTYPE entities from a previous document are never carried over. - * - */ - reset() { - this._inputEntries = []; - this._totalExpansions = 0; - this._expandedLength = 0; - } - // ------------------------------------------------------------------------- - // Primary API - // ------------------------------------------------------------------------- - /** - * Replace all entity references in `str`. - * - * Processing order: - * 1. persistent external - * 2. input / runtime (DOCTYPE) - * 3. system - * 4. default (lt/gt/apos/quot) - * 5. amp - * 6. postCheck hook - * - * @param {string} str - * @returns {string} - */ - replace(str) { - if (typeof str !== "string" || str.length === 0) return str; - if (str.indexOf("&") === -1) return str; - const original = str; - if (this._persistentEntries.length > 0) { - str = this._applyEntries(str, this._persistentEntries, this._limitExternal); - } - if (this._inputEntries.length > 0 && str.indexOf("&") !== -1) { - str = this._applyEntries(str, this._inputEntries, this._limitExternal); - } - if (this._defaultEntries.length > 0 && str.indexOf("&") !== -1) { - str = this._applyEntries(str, this._defaultEntries, this._limitDefault); - } - if (this._systemEntries.length > 0 && str.indexOf("&") !== -1) { - str = this._applyEntries(str, this._systemEntries, this._limitSystem); - } - if (this._ampEnabled && str.indexOf("&") !== -1) { - str = str.replace(AMP_ENTITY.regex, AMP_ENTITY.val); - } - str = this._postCheck(str, original); - return str; - } - /** - * - * @param {string} val - * @returns - */ - parse(val) { - return this.replace(val); - } - // ------------------------------------------------------------------------- - // Private helpers - // ------------------------------------------------------------------------- - _applyEntries(str, entries, track) { - const limitExpansions = track && this._maxTotalExpansions > 0; - const limitLength = track && this._maxExpandedLength > 0; - const trackAny = limitExpansions || limitLength; - for (let i = 0; i < entries.length; i++) { - if (str.indexOf("&") === -1) break; - const entity = entries[i][1]; - if (!trackAny) { - str = str.replace(entity.regex, entity.val); - continue; - } - if (limitExpansions && !limitLength) { - let count = 0; - str = str.replace(entity.regex, (...args) => { - count++; - return typeof entity.val === "function" ? entity.val(...args) : entity.val; - }); - if (count > 0) { - this._totalExpansions += count; - if (this._totalExpansions > this._maxTotalExpansions) { - throw new Error( - `[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}` - ); - } - } - } else if (limitLength && !limitExpansions) { - const before = str.length; - str = str.replace(entity.regex, entity.val); - const delta = str.length - before; - if (delta > 0) { - this._expandedLength += delta; - if (this._expandedLength > this._maxExpandedLength) { - throw new Error( - `[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}` - ); - } - } - } else { - const before = str.length; - let count = 0; - str = str.replace(entity.regex, (...args) => { - count++; - return typeof entity.val === "function" ? entity.val(...args) : entity.val; - }); - if (count > 0) { - this._totalExpansions += count; - if (this._totalExpansions > this._maxTotalExpansions) { - throw new Error( - `[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}` - ); - } - } - const delta = str.length - before; - if (delta > 0) { - this._expandedLength += delta; - if (this._expandedLength > this._maxExpandedLength) { - throw new Error( - `[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}` - ); - } - } - } - } - return str; - } -}; - -// node_modules/@nodable/entities/src/groups.js -var COMMON_HTML = { - nbsp: { regex: /&(nbsp|#0*160|#x0*[Aa]0);/g, val: "\xA0" }, - copy: { regex: /&(copy|#0*169|#x0*[Aa]9);/g, val: "\xA9" }, - reg: { regex: /&(reg|#0*174|#x0*[Aa][Ee]);/g, val: "\xAE" }, - trade: { regex: /&(trade|#0*8482|#x0*2122);/g, val: "\u2122" }, - mdash: { regex: /&(mdash|#0*8212|#x0*2014);/g, val: "\u2014" }, - ndash: { regex: /&(ndash|#0*8211|#x0*2013);/g, val: "\u2013" }, - hellip: { regex: /&(hellip|#0*8230|#x0*2026);/g, val: "\u2026" }, - laquo: { regex: /&(laquo|#0*171|#x0*[Aa][Bb]);/g, val: "\xAB" }, - raquo: { regex: /&(raquo|#0*187|#x0*[Bb][Bb]);/g, val: "\xBB" }, - lsquo: { regex: /&(lsquo|#0*8216|#x0*2018);/g, val: "\u2018" }, - rsquo: { regex: /&(rsquo|#0*8217|#x0*2019);/g, val: "\u2019" }, - ldquo: { regex: /&(ldquo|#0*8220|#x0*201[Cc]);/g, val: "\u201C" }, - rdquo: { regex: /&(rdquo|#0*8221|#x0*201[Dd]);/g, val: "\u201D" }, - bull: { regex: /&(bull|#0*8226|#x0*2022);/g, val: "\u2022" }, - para: { regex: /&(para|#0*182|#x0*[Bb]6);/g, val: "\xB6" }, - sect: { regex: /&(sect|#0*167|#x0*[Aa]7);/g, val: "\xA7" }, - deg: { regex: /&(deg|#0*176|#x0*[Bb]0);/g, val: "\xB0" }, - frac12: { regex: /&(frac12|#0*189|#x0*[Bb][Dd]);/g, val: "\xBD" }, - frac14: { regex: /&(frac14|#0*188|#x0*[Bb][Cc]);/g, val: "\xBC" }, - frac34: { regex: /&(frac34|#0*190|#x0*[Bb][Ee]);/g, val: "\xBE" }, - inr: { regex: /&(inr|#0*8377);/g, val: "\u20B9" } -}; -var CURRENCY_ENTITIES = { - cent: { regex: /&(cent|#0*162|#x0*[Aa]2);/g, val: "\xA2" }, - pound: { regex: /&(pound|#0*163|#x0*[Aa]3);/g, val: "\xA3" }, - yen: { regex: /&(yen|#0*165|#x0*[Aa]5);/g, val: "\xA5" }, - euro: { regex: /&(euro|#0*8364|#x0*20[Aa][Cc]);/g, val: "\u20AC" }, - inr: { regex: /&(inr|#0*8377|#x0*20[Bb]9);/g, val: "\u20B9" }, - curren: { regex: /&(curren|#0*164|#x0*[Aa]4);/g, val: "\xA4" }, - fnof: { regex: /&(fnof|#0*402|#x0*192);/g, val: "\u0192" } -}; -var NUMERIC_ENTITIES = { - num_dec: { - regex: /�*([0-9]{1,7});/g, - val: (_, s) => fromCodePoint(s, 10, "&#") - }, - num_hex: { - regex: /�*([0-9a-fA-F]{1,6});/g, - val: (_, s) => fromCodePoint(s, 16, "&#x") - } -}; -function fromCodePoint(str, base, prefix) { - const codePoint = Number.parseInt(str, base); - if (codePoint >= 0 && codePoint <= 1114111) { - return String.fromCodePoint(codePoint); - } else { - return prefix + str + ";"; - } -} - // node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js function extractRawAttributes(prefixedAttrs, options) { if (!prefixedAttrs) return {}; @@ -21135,7 +22295,7 @@ function extractNamespace(rawTagName) { return void 0; } var OrderedObjParser = class { - constructor(options) { + constructor(options, externalEntities) { this.options = options; this.currentNode = null; this.tagsNodeStack = []; @@ -21151,15 +22311,23 @@ var OrderedObjParser = class { this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); this.entityExpansionCount = 0; this.currentExpandedLength = 0; - this.entityReplacer = new EntityReplacer({ - default: true, - // amp: true, - system: this.options.htmlEntities ? { ...COMMON_HTML, ...NUMERIC_ENTITIES, ...CURRENCY_ENTITIES } : {}, - maxTotalExpansions: this.options.processEntities.maxTotalExpansions, - maxExpandedLength: this.options.processEntities.maxExpandedLength, - applyLimitsTo: "all" - //postCheck: resolved => resolved - }); + let namedEntities = { ...XML }; + if (this.options.entityDecoder) { + this.entityDecoder = this.options.entityDecoder; + } else { + if (typeof this.options.htmlEntities === "object") namedEntities = this.options.htmlEntities; + else if (this.options.htmlEntities === true) namedEntities = { ...COMMON_HTML, ...CURRENCY }; + this.entityDecoder = new EntityDecoder({ + namedEntities: { ...namedEntities, ...externalEntities }, + numericAllowed: this.options.htmlEntities, + limit: { + maxTotalExpansions: this.options.processEntities.maxTotalExpansions, + maxExpandedLength: this.options.processEntities.maxExpandedLength, + applyLimitsTo: this.options.processEntities.appliesTo + } + //postCheck: resolved => resolved + }); + } this.matcher = new Matcher(); this.readonlyMatcher = this.matcher.readOnly(); this.isCurrentNodeStopNode = false; @@ -21219,9 +22387,9 @@ function resolveNameSpace(tagname) { return tagname; } var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); -function buildAttributesMap(attrStr, jPath, tagName) { +function buildAttributesMap(attrStr, jPath, tagName, force = false) { const options = this.options; - if (options.ignoreAttributes !== true && typeof attrStr === "string") { + if (force === true || options.ignoreAttributes !== true && typeof attrStr === "string") { const matches = getAllMatches(attrStr, attrsRegx); const len = matches.length; const attrs = {}; @@ -21272,7 +22440,7 @@ function buildAttributesMap(attrStr, jPath, tagName) { } } if (!hasAttrs) return; - if (options.attributesGroupName) { + if (options.attributesGroupName && !options.preserveOrder) { const attrCollection = {}; attrCollection[options.attributesGroupName] = attrs; return attrCollection; @@ -21286,6 +22454,7 @@ var parseXml = function(xmlData) { let currentNode = xmlObj; let textData = ""; this.matcher.reset(); + this.entityDecoder.reset(); this.entityExpansionCount = 0; this.currentExpandedLength = 0; const options = this.options; @@ -21325,12 +22494,17 @@ var parseXml = function(xmlData) { let tagData = readTagExp(xmlData, i, false, "?>"); if (!tagData) throw new Error("Pi Tag is not closed."); textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher); + const attsMap = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName, true); + if (attsMap) { + const ver = attsMap[this.options.attributeNamePrefix + "version"]; + this.entityDecoder.setXmlVersion(Number(ver) || 1); + } if (options.ignoreDeclaration && tagData.tagName === "?xml" || options.ignorePiTags) { } else { const childNode = new XmlNode(tagData.tagName); childNode.add(options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName); + if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && options.ignoreAttributes !== true) { + childNode[":@"] = attsMap; } this.addChild(currentNode, childNode, this.readonlyMatcher, i); } @@ -21345,7 +22519,7 @@ var parseXml = function(xmlData) { i = endIndex; } else if (c1 === 33 && xmlData.charCodeAt(i + 2) === 68) { const result = docTypeReader.readDocType(xmlData, i); - this.entityReplacer.addInputEntities(result.entities); + this.entityDecoder.addInputEntities(result.entities); i = result.i; } else if (c1 === 33 && xmlData.charCodeAt(i + 2) === 91) { const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; @@ -21504,7 +22678,7 @@ function replaceEntitiesValue(val, tagName, jPath) { return val; } } - return this.entityReplacer.replace(val); + return this.entityDecoder.decode(val); } function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) { if (textData) { @@ -21529,10 +22703,11 @@ function isItStopNode() { } function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { let attrBoundary = 0; - const chars = []; const len = xmlData.length; const closeCode0 = closingChar.charCodeAt(0); const closeCode1 = closingChar.length > 1 ? closingChar.charCodeAt(1) : -1; + let result = ""; + let segmentStart = i; for (let index = i; index < len; index++) { const code = xmlData.charCodeAt(index); if (attrBoundary) { @@ -21542,16 +22717,17 @@ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { } else if (code === closeCode0) { if (closeCode1 !== -1) { if (xmlData.charCodeAt(index + 1) === closeCode1) { - return { data: String.fromCharCode(...chars), index }; + result += xmlData.substring(segmentStart, index); + return { data: result, index }; } } else { - return { data: String.fromCharCode(...chars), index }; + result += xmlData.substring(segmentStart, index); + return { data: result, index }; } - } else if (code === 9) { - chars.push(32); - continue; + } else if (code === 9 && !attrBoundary) { + result += xmlData.substring(segmentStart, index) + " "; + segmentStart = index + 1; } - chars.push(code); } } function findClosingIndex(xmlData, str, i, errMsg) { @@ -21804,8 +22980,7 @@ var XMLParser = class { throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); } } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.entityReplacer.setExternalEntities(this.externalEntities); + const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities); const orderedResult = orderedObjParser.parseXml(xmlData); if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; else return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher); diff --git a/.github/actions/tests/split_tests/package-lock.json b/.github/actions/tests/split_tests/package-lock.json index c3435eb..615a306 100644 --- a/.github/actions/tests/split_tests/package-lock.json +++ b/.github/actions/tests/split_tests/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "dependencies": { "@actions/core": "^3.0.1", - "fast-xml-parser": "^5.7.1" + "fast-xml-parser": "^5.7.2" }, "devDependencies": { "@types/node": "^25.6.0", @@ -574,9 +574,9 @@ } }, "node_modules/fast-xml-parser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.7.1.tgz", - "integrity": "sha512-8Cc3f8GUGUULg34pBch/KGyPLglS+OFs05deyOlY7fL2MTagYPKrVQNmR1fLF/yJ9PH5ZSTd3YDF6pnmeZU+zA==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.7.2.tgz", + "integrity": "sha512-P7oW7tLbYnhOLQk/Gv7cZgzgMPP/XN03K02/Jy6Y/NHzyIAIpxuZIM/YqAkfiXFPxA2CTm7NtCijK9EDu09u2w==", "funding": [ { "type": "github", diff --git a/.github/actions/tests/split_tests/package.json b/.github/actions/tests/split_tests/package.json index 2e843e0..b140d24 100644 --- a/.github/actions/tests/split_tests/package.json +++ b/.github/actions/tests/split_tests/package.json @@ -7,11 +7,11 @@ }, "dependencies": { "@actions/core": "^3.0.1", - "fast-xml-parser": "^5.7.1" + "fast-xml-parser": "^5.7.2" }, "devDependencies": { "@types/node": "^25.6.0", - "typescript": "^6.0.2", - "esbuild": "^0.28.0" + "esbuild": "^0.28.0", + "typescript": "^6.0.2" } } diff --git a/.github/actions/tests/split_tests/tsconfig.json b/.github/actions/tests/split_tests/tsconfig.json index 562bd43..d589960 100644 --- a/.github/actions/tests/split_tests/tsconfig.json +++ b/.github/actions/tests/split_tests/tsconfig.json @@ -7,6 +7,7 @@ "strict": true, "skipLibCheck": true, "outDir": "./dist", + "types": ["node"] }, "include": [ "./src"