@slyte/html-parser 2.0.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4027 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ "./lib/htmlParser.js"
6
+ /*!***************************!*\
7
+ !*** ./lib/htmlParser.js ***!
8
+ \***************************/
9
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
10
+
11
+ __webpack_require__.r(__webpack_exports__);
12
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14
+ /* harmony export */ });
15
+ //ignorei18n_start
16
+ //BabelCodeStarts
17
+ function _wrapRegExp() {
18
+ _wrapRegExp = function (e, r) {
19
+ return new BabelRegExp(e, void 0, r);
20
+ };
21
+ var e = RegExp.prototype,
22
+ r = new WeakMap();
23
+
24
+ function BabelRegExp(e, t, p) {
25
+ var o = RegExp(e, t);
26
+ return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);
27
+ }
28
+
29
+ function buildGroups(e, t) {
30
+ var p = r.get(t);
31
+ return Object.keys(p).reduce(function (r, t) {
32
+ var o = p[t];
33
+ if ("number" == typeof o){
34
+ r[t] = e[o]
35
+ }
36
+ else {
37
+ for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) {i++;}
38
+ r[t] = e[o[i]];
39
+ }
40
+ return r;
41
+ }, Object.create(null));
42
+ }
43
+ return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {
44
+ var t = e.exec.call(this, r);
45
+ if (t) {
46
+ t.groups = buildGroups(t, this);
47
+ var p = t.indices;
48
+ p && (p.groups = buildGroups(p, this));
49
+ }
50
+ return t;
51
+ }, BabelRegExp.prototype[Symbol.replace] = function (t, p) {
52
+ if ("string" == typeof p) {
53
+ var o = r.get(this);
54
+ return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) {
55
+ var t = o[r];
56
+ return "$" + (Array.isArray(t) ? t.join("$") : t);
57
+ }));
58
+ }
59
+ if ("function" == typeof p) {
60
+ var i = this;
61
+ return e[Symbol.replace].call(this, t, function () {
62
+ var e = arguments;
63
+ return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);
64
+ });
65
+ }
66
+ return e[Symbol.replace].call(this, t, p);
67
+ }, _wrapRegExp.apply(this, arguments);
68
+ }
69
+
70
+ function _inherits(subClass, superClass) {
71
+ if (typeof superClass !== "function" && superClass !== null) {
72
+ throw new TypeError("Super expression must either be null or a function");
73
+ }
74
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
75
+ constructor: {
76
+ value: subClass,
77
+ writable: true,
78
+ configurable: true
79
+ }
80
+ });
81
+ Object.defineProperty(subClass, "prototype", {
82
+ writable: false
83
+ });
84
+ if (superClass) {
85
+ _setPrototypeOf(subClass, superClass)
86
+ };
87
+ }
88
+
89
+ function _setPrototypeOf(o, p) {
90
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
91
+ o.__proto__ = p;
92
+ return o;
93
+ };
94
+ return _setPrototypeOf(o, p);
95
+ }
96
+ //BabelCodeEnds
97
+
98
+ const HTMLParser = (function () {
99
+ const regexFor = {
100
+ endTag: /*#__PURE__*/ _wrapRegExp(/^<\/([a-zA-z][-a-zA-Z0-9_]*)((?:\s*[a-zA-Z_:!0-9,][-a-zA-Z0-9_:%."'`;]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>]+))?)*)\s*(\/?)>/, {
101
+ nodeName: 1,
102
+ attributes: 2
103
+ }),
104
+ attr: /([a-zA-Z0-9_:!'"},@{$][-a-zA-Z0-9_:."'`%;{]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g
105
+ },
106
+ svgCamelCaseTags = {
107
+ "filterunits": "filterUnits",
108
+ "allowreorder": "allowReorder",
109
+ "attributename": "attributeName",
110
+ "attributetype": "attributeType",
111
+ "autoreverse": "autoReverse",
112
+ "basefrequency": "baseFrequency",
113
+ "baseprofile": "baseProfile",
114
+ "calcmode": "calcMode",
115
+ "clippathunits": "clipPathUnits",
116
+ "contentScriptType": "contentScriptType",
117
+ "contentstyletype": "contentStyleType",
118
+ "diffuseconstant": "diffuseConstant",
119
+ "edgemode": "edgeMode",
120
+ "externalresourcesrequired": "externalResourcesRequired",
121
+ "filterres": "filterRes",
122
+ "filterUnits": "filterUnits",
123
+ "glyphref": "glyphRef",
124
+ "gradienttransform": "gradientTransform",
125
+ "gradientunits": "gradientUnits",
126
+ "kernelmatrix": "kernelMatrix",
127
+ "kernelunitlength": "kernelUnitLength",
128
+ "keypoints": "keyPoints",
129
+ "keysplines": "keySplines",
130
+ "keytimes": "keyTimes",
131
+ "lengthadjust": "lengthAdjust",
132
+ "limitingconeangle": "limitingConeAngle",
133
+ "markerheight": "markerHeight",
134
+ "markerunits": "markerUnits",
135
+ "markerwidth": "markerWidth",
136
+ "maskcontentunits": "maskContentUnits",
137
+ "maskunits": "maskUnits",
138
+ "patterncontentunits": "patternContentUnits",
139
+ "patterntransform": "patternTransform",
140
+ "patternunits": "patternUnits",
141
+ "pointsatx": "pointsAtX",
142
+ "pointsaty": "pointsAtY",
143
+ "pointsatz": "pointsAtZ",
144
+ "preservealpha": "preserveAlpha",
145
+ "preserveaspectratio": "preserveAspectRatio",
146
+ "primitiveunits": "primitiveUnits",
147
+ "repeatcount": "repeatCount",
148
+ "repeatdur": "repeatDur",
149
+ "requiredextensions": "requiredExtensions",
150
+ "requiredfeatures": "requiredFeatures",
151
+ "specularconstant": "specularConstant",
152
+ "specularexponent": "specularExponent",
153
+ "spreadmethod": "spreadMethod",
154
+ "startoffset": "startOffset",
155
+ "stddeviation": "stdDeviation",
156
+ "stitchtiles": "stitchTiles",
157
+ "surfacescale": "surfaceScale",
158
+ "systemlanguage": "systemLanguage",
159
+ "tablevalues": "tableValues",
160
+ "textlength": "textLength",
161
+ "viewbox": "viewBox",
162
+ "viewtarget": "viewTarget",
163
+ "xchannelselector": "xChannelSelector",
164
+ "ychannelselector": "yChannelSelector",
165
+ "refx": "refX",
166
+ "refy": "refY",
167
+ "targetx": "targetX",
168
+ "targety": "targetY",
169
+ "numoctaves": "numOctaves",
170
+ "zoomandpan": "zoomAndPan",
171
+ },
172
+ chromeChangedTags = {
173
+ "image": "img"
174
+ },
175
+ createMapFor = function (array) {
176
+ return array.reduce(function (acc, item) {
177
+ acc[item] = true;
178
+ return acc;
179
+ }, {});
180
+ },
181
+ dasherize = function(string,fancyComponent,attr) {
182
+ let lowerTagName, specifiedComponentCheck = typeof fancyComponent == "object";
183
+ if( string &&
184
+ !svgCamelCaseTags[lowerTagName = string.toLowerCase()] &&
185
+ !svgMiddleMen[lowerTagName] &&
186
+ (!specifiedComponentCheck || fancyComponent[string]) &&
187
+ (!attr || !string.match(/^on/gm))
188
+ ){
189
+ if(!cache_d[string]){
190
+ cache_d[string] = string.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
191
+ string!= cache_d[string] && console.log(string);
192
+ }
193
+ return cache_d[string];
194
+ }
195
+ return string;
196
+ },
197
+ svgMiddleMen = createMapFor(['foreignobject']),
198
+ svgSelfClosingTags = createMapFor([
199
+ 'title',
200
+ "animate",
201
+ "animateColor",
202
+ "animateTransform",
203
+ "circle",
204
+ "ellipse",
205
+ "feBlend",
206
+ "feColorMatrix",
207
+ "feComponentTransfer",
208
+ "feComposite",
209
+ "feConvolveMatrix",
210
+ "feDiffuseLighting",
211
+ "feDisplacementMap",
212
+ "feDistantLight",
213
+ "feFlood",
214
+ "feFuncA",
215
+ "feFuncB",
216
+ "feFuncG",
217
+ "feFuncR",
218
+ "feGaussianBlur",
219
+ "feImage",
220
+ "feMergeNode",
221
+ "feMorphology",
222
+ "feOffset",
223
+ "fePointLight",
224
+ "feSpecularLighting",
225
+ "feSpotLight",
226
+ "feTile",
227
+ "feTurbulence",
228
+ "line",
229
+ "path",
230
+ "polygon",
231
+ "polyline",
232
+ "rect",
233
+ "stop",
234
+ "use"
235
+ ]),
236
+ tableTags = createMapFor(["tbody", "thead", "tfoot", "colgroup", "caption", "tr", "th", "td", "col"]),
237
+ EMPTY_ELEMENTS = createMapFor([
238
+ "area",
239
+ "base",
240
+ "basefont",
241
+ "br",
242
+ "col",
243
+ "frame",
244
+ "hr",
245
+ "img",
246
+ "image",
247
+ "track",
248
+ "input",
249
+ "link",
250
+ "meta",
251
+ "param",
252
+ "embed",
253
+ "command",
254
+ "keygen",
255
+ "source",
256
+ "wbr",
257
+ // "circle",
258
+ // "ellipse",
259
+ // "line",
260
+ // "polyline",
261
+ // "rect",
262
+ ]),
263
+ SELF_CLOSING = createMapFor([
264
+ "colgroup",
265
+ "dd",
266
+ "dt",
267
+ "li",
268
+ "options",
269
+ "p",
270
+ ]),
271
+ SPECIAL_ELEMENTS = createMapFor([
272
+ 'style',
273
+ 'script'
274
+ ]),
275
+ nodeStartStack = [];
276
+
277
+ let cache_d = {},cache_c = {},
278
+ paragraphTagStarted = 0,
279
+ willHaveUnclosedClosingTag = false,
280
+ checkClosingTag = false,
281
+ selfClosingTags = createMapFor(['style', 'area', 'base', 'br', 'col', 'embed', 'hr', 'input', 'keygen', 'link', 'meta', 'param', 'wbr', 'img', 'track', 'image']),
282
+ notAllowedTagsInsideParagraphTag = createMapFor(["div", "table", "body", "h1", "h2", "h3", "h4", "h5", "h6", "ul", "li"]);
283
+ function countStartingSpaces(str) {
284
+ return (str.match(/^\s*/) || [''])[0].length;
285
+ }
286
+ function countTrailingSpaces(str) {
287
+ return (str.match(/\s*$/) || [''])[0].length;
288
+ }
289
+
290
+ return function (htmlString, callbacks, options, errorObj, lineIndex = 1, colIndex = 0) {
291
+ let {emberFlag, fileName, withoutTableProcessing, fancyComponent} = options,
292
+ hasUnparsedChars,
293
+ match,
294
+ mismatchColIndex = {},
295
+ stack = [],
296
+ seenSVGBefore = 0,
297
+ seenSvgMiddleMenBefore = 0,
298
+ seenTableBefore = 0,
299
+ stringInPrevLoopState = htmlString,
300
+ elemStack = [],
301
+ excludeSelfClosingTag = createMapFor(options.excludeSelfClosingTag || []);
302
+ stack.getLastItem = function () {
303
+ return this[this.length - 1];
304
+ };
305
+ elemStack.getLastItem = function () {
306
+ return this[this.length - 1];
307
+ }
308
+ function validateTagName(str, errorObject) {
309
+ str = str.trim()
310
+ if (str.length == 0 || !(/^[a-zA-Z_][-a-zA-Z0-9_]*$/).test(str)) {
311
+ errorObject.bool = false;
312
+ errorObject.error = "Invalid tag name :`" + "<" + str + "`";
313
+ errorObject.fromParser = true;
314
+ return false;
315
+ }
316
+ if(seenSVGBefore && str.toLowerCase() == "image"){
317
+ return "image";
318
+ }
319
+ return chromeChangedTags[str] ? chromeChangedTags[str] : str;
320
+ }
321
+
322
+ function getStartTag(str) {
323
+ try {
324
+ let foundTagName = false,
325
+ tagName = "",
326
+ errorObject = {
327
+ bool: true
328
+ },
329
+ doubleQuotesStarted = false,
330
+ dIndex = 0,
331
+ singleQuotesStarted = false,
332
+ sIndex = 0,
333
+ mustacheStarted = 0,
334
+ mIndex = 0,
335
+ attrStartIndex = 0,
336
+ tickStarted = false;
337
+
338
+ for (let i = 0; i < str.length; i++) {
339
+ if (!foundTagName) {
340
+ if (/\s/.test(str[i]) || str[i] == "/") {
341
+ tagName = validateTagName(tagName, errorObject)
342
+ if (!tagName) return errorObject;
343
+ foundTagName = true
344
+ attrStartIndex = i;
345
+ continue;
346
+ }
347
+ if (str[i] == ">") {
348
+ tagName = validateTagName(tagName, errorObject)
349
+ if (!tagName) return errorObject;
350
+ let res = ["<" + str.substring(0, i + 1), tagName, "", "", "<" + str];
351
+ res.bool = true;
352
+ return res;
353
+ }
354
+ if (str[i] == "/" && str[i + 1] == ">") {
355
+ tagName = validateTagName(tagName, errorObject)
356
+ if (!tagName) return errorObject;
357
+ let res = ["<" + str.substring(0, i + 1), tagName, "", "/", "<" + str];
358
+ res.bool = true;
359
+ return res;
360
+ }
361
+ tagName += str[i];
362
+ continue;
363
+ }
364
+ if (str[i] == "`" && str[i - 1] != "\\" && !doubleQuotesStarted && !singleQuotesStarted) {
365
+ tickStarted = !tickStarted;
366
+ sIndex = i + 1;
367
+ }
368
+ if (str[i] == "'" && str[i - 1] != "\\" && !doubleQuotesStarted && !tickStarted) {
369
+ singleQuotesStarted = !singleQuotesStarted;
370
+ sIndex = i + 1;
371
+ }
372
+ if (str[i] == '"' && str[i - 1] != "\\" && !singleQuotesStarted && !tickStarted) {
373
+ doubleQuotesStarted = !doubleQuotesStarted;
374
+ dIndex = i + 1;
375
+ }
376
+ if (!tickStarted && !singleQuotesStarted && !doubleQuotesStarted && str[i] == "{" && str[i + 1] == "{") {
377
+ mustacheStarted = true;
378
+ mIndex = i;
379
+ }
380
+ if (!tickStarted && !singleQuotesStarted && !doubleQuotesStarted && str[i] == "}" && str[i + 1] == "}") {
381
+ mustacheStarted = false;
382
+ }
383
+ if (!tickStarted && !singleQuotesStarted && !doubleQuotesStarted && !mustacheStarted && str[i] == "<") {
384
+ errorObject.bool = false;
385
+ errorObject.error = "Unclosed `>` for the tag `" + tagName + "`";
386
+ errorObject.fromParser = true;
387
+ let temp = str.substr(0, i).split("\n");
388
+ lineIndex += (temp.length - 1);
389
+ colIndex = temp[temp.length - 1].length;
390
+ return errorObject;
391
+ }
392
+ if (!tickStarted && !singleQuotesStarted && !doubleQuotesStarted && !mustacheStarted && str[i] == ">") {
393
+ let res = [];
394
+ if (str[i - 1] == "/") {
395
+ res = ["<" + str.substring(0, i + 1), tagName, str.substring(attrStartIndex, i - 1), "/", "<" + str];
396
+ res.bool = true;
397
+ return res;
398
+ }
399
+ res = ["<" + str.substring(0, i + 1), tagName, str.substring(attrStartIndex, i), "", "<" + str]
400
+ res.bool = true;
401
+ return res;
402
+ }
403
+ }
404
+ errorObject.bool = false;
405
+ let temp;
406
+ if (singleQuotesStarted) {
407
+ errorObject.error = "Unclosed Single Quote ";
408
+ temp = str.substr(0, sIndex).split("\n");
409
+ lineIndex += (temp.length - 1);
410
+ colIndex = temp[temp.length - 1].length;
411
+ errorObject.index = str.substring(0, sIndex);
412
+ } else if (doubleQuotesStarted) {
413
+ errorObject.error = "Unclosed Double Quote ";
414
+ temp = str.substr(0, dIndex).split("\n");
415
+ lineIndex += (temp.length - 1);
416
+ colIndex = temp[temp.length - 1].length;
417
+ errorObject.index = str.substring(0, dIndex);
418
+ } else if (mustacheStarted) {
419
+ errorObject.error = "Unclosed Mustache ";
420
+ temp = str.substr(0, mIndex).split("\n");
421
+ lineIndex += (temp.length - 1);
422
+ colIndex = temp[temp.length - 1].length;
423
+ errorObject.index = str.substring(0, mIndex);
424
+ } else {
425
+ errorObject.error = "Unclosed tag `>`";
426
+ }
427
+ return errorObject;
428
+ } catch (e) {
429
+ console.log("Error in parsing")
430
+ }
431
+ }
432
+
433
+ function parseStartTag(tag, tagName, rest, unary) {
434
+ if (tagName) {
435
+ fancyComponent && (tagName = dasherize(tagName, fancyComponent));
436
+ let lowerTagName = tagName.toLowerCase();
437
+ if (lowerTagName == "svg") {
438
+ seenSVGBefore++;
439
+ }
440
+ // if (lowerTagName == "pre") {
441
+ // seenPreBefore = true;
442
+ // }
443
+ if (lowerTagName == "table") {
444
+ seenTableBefore += 1;
445
+ }
446
+ if (svgMiddleMen[lowerTagName]) {
447
+ seenSvgMiddleMenBefore++;
448
+ }
449
+ if (seenSVGBefore == 0 && tagName.toLowerCase) {
450
+ tagName = lowerTagName;
451
+ }
452
+ }
453
+ // @Handle3055 to get precise line and column number
454
+ // if(tagName && !seenPreBefore){
455
+ // tagName = tagName.replace(/\r?\n|\r/g,' ').replace(/\s+/g,' ');
456
+ // if (tag) {
457
+ // tag = tag.replace(/\r?\n|\r/g, ' ').replace(/\s+/g, ' ');
458
+ // }
459
+ // }
460
+ if (unary && !seenSVGBefore && svgSelfClosingTags[tagName]) {
461
+ let err = new Error("Error: Invalid svg tag " + tag + ".....");
462
+ err.fromParser = true;
463
+ throw err;
464
+ }
465
+ if (stack.getLastItem() == tagName && SELF_CLOSING[tagName]) {
466
+ parseEndTag("", tagName);
467
+ }
468
+ let matchRes;
469
+ if (tag && (matchRes = tag.match(/(?!({{)|"|'.*)\n(?!.*(}})|"|')/g))) {
470
+ lineIndex = lineIndex + matchRes.length;
471
+ colIndex = matchRes[matchRes.length - 1].length;
472
+ }
473
+ let col = colIndex;
474
+ if (tag) {
475
+ colIndex = colIndex + tag.length;
476
+ }
477
+
478
+ unary = EMPTY_ELEMENTS[tagName] || !!unary;
479
+ if (!unary) {
480
+ stack.push(tagName);
481
+ if (tagName != "p") {
482
+ elemStack.push(tagName);
483
+ }
484
+ }
485
+ let attrs = [];
486
+ let matchES = rest.match(/\s*$/),eS = "";//end of node space
487
+ if(matchES){
488
+ eS = matchES[0];
489
+ }
490
+ rest.replace(regexFor.attr, function (match, name) {
491
+ const arg2 = arguments[2];
492
+ const arg3 = arguments[3];
493
+ const arg4 = arguments[4];
494
+ const value = arg2 ? arg2 : (arg3 ? arg3 : (arg4 ? arg4 : ''));
495
+ let quote = name.indexOf("'"),
496
+ err,
497
+ nullCheck = (arg2 == undefined) && (arg3 == undefined) && (arg4 == undefined),
498
+ indexOfValue = tag.indexOf(value),
499
+ attrStartIndex = col+indexOfValue;
500
+ for (let index=indexOfValue; index>=0;index--){
501
+ if(tag[index] == "\n"){
502
+ attrStartIndex = indexOfValue-index;
503
+ break;
504
+ }
505
+ }
506
+ if (quote !== -1) {
507
+ err = new Error("Error: Unclosed Single quote in " + tag + "....." + "</" + tagName + ">");
508
+ err.fromParser = true;
509
+ err.lineIndex = lineIndex;
510
+ err.colIndex = colIndex;
511
+ throw err;
512
+ }
513
+ quote = name.indexOf('"')
514
+ if (quote !== -1) {
515
+ err = new Error("Error: Unclosed Double quote in " + tag.substring(0, 100) + "....." /* + "....." + "</" + tagName+ ">"*/ );
516
+ err.fromParser = true;
517
+ err.lineIndex = lineIndex;
518
+ err.colIndex = colIndex;
519
+ throw err;
520
+ }
521
+ if (name.indexOf("{{") == 0) {
522
+ err = new Error("Error: Invalid Mustache : " + name + "...");
523
+ err.fromParser = true;
524
+ err.lineIndex = lineIndex;
525
+ err.colIndex = colIndex;
526
+ throw err;
527
+ }
528
+ fancyComponent && (name = dasherize(name,false,true));
529
+ if (seenSVGBefore > 0 && svgCamelCaseTags[name.toLowerCase()]) {
530
+ name = svgCamelCaseTags[name.toLowerCase()];
531
+ } else {
532
+ name = name.toLowerCase();
533
+ }
534
+ let indexOfEqual = match.indexOf("=");
535
+ let startChar;
536
+ if(indexOfEqual != -1){
537
+ let afterEqualTo = match.slice(indexOfEqual+1);
538
+ startChar = afterEqualTo.match(/\S/);
539
+ if(startChar){
540
+ startChar = startChar[0];
541
+ } else {
542
+ startChar = "";
543
+ }
544
+ }
545
+ let obj = {
546
+ name: name,
547
+ value: value,//.replace(/"/g, "&quot;"),
548
+ escaped: value.replace(/(^|[^\\])"/g, '$1\\\"'),
549
+ attrStartIndex,
550
+ startChar,
551
+ nullCheck
552
+ }
553
+ if(options.withoutTemplateConversion){
554
+ let before = rest.split(match);
555
+ if(indexOfEqual != -1){
556
+ let beforeEqualTo = match.slice(0, indexOfEqual);
557
+ let afterEqualTo = match.slice(indexOfEqual+1);
558
+ obj.sBE = countTrailingSpaces(beforeEqualTo);
559
+ obj.sAE = countStartingSpaces(afterEqualTo);
560
+ }
561
+ if(before.length){
562
+ obj.sB = before[0].match(/\s*$/)[0]; //space before
563
+ }
564
+ }
565
+ if (name == "lyte-if" || (name == "is" && value == "if") || name == "lyte-switch" || (name == "is" && value == "switch") || name == "lyte-for" || (name == "is" && value == "for") || name == "lyte-for-in" || (name == "is" && value == "forIn")) {
566
+ obj.errorInfo = {
567
+ name: "errorInfo",
568
+ details: {
569
+ tagName: tagName,
570
+ name: name,
571
+ value: value.replace(/"/g, "&quot;")
572
+ }
573
+ }
574
+ }
575
+ attrs.push(obj);
576
+ });
577
+ if (callbacks.start) {
578
+ if (tag && tag.match(/<.*\/>/g)) {
579
+ if (!(selfClosingTags[tagName] || svgSelfClosingTags[tagName] || excludeSelfClosingTag[tagName])) {
580
+ let err = new Error("Invalid self-closing tag `" + tagName + "` in " + (tag + htmlString).substring(0, 100) + "...");
581
+ err.fromParser = true;
582
+ err.lineIndex = lineIndex;
583
+ err.colIndex = colIndex;
584
+ throw err;
585
+ }
586
+ } else {
587
+ if (!selfClosingTags[tagName]) {
588
+ nodeStartStack.push(tagName);
589
+ }
590
+ }
591
+ if (checkClosingTag) {
592
+ attrs.push({
593
+ name: "checkClosingTag",
594
+ value: "true",
595
+ escaped: "true"
596
+ });
597
+ }
598
+ callbacks.start(tagName, attrs, unary, seenSVGBefore, lineIndex, col, eS);
599
+ }
600
+ }
601
+
602
+ function parseEndTag(tag, tagName) {
603
+ if (tagName) {
604
+ fancyComponent && (tagName = dasherize(tagName, fancyComponent));
605
+ let lowerTagName = tagName.toLowerCase();
606
+ if (lowerTagName == "svg") {
607
+ seenSVGBefore--;
608
+ }
609
+ if (svgMiddleMen[lowerTagName]) {
610
+ seenSvgMiddleMenBefore--;
611
+ }
612
+ if (lowerTagName == "table") {
613
+ seenTableBefore--;
614
+ }
615
+ // if (lowerTagName == "pre") {
616
+ // seenPreBefore = false;
617
+ // }
618
+ if (seenSVGBefore == 0 && tagName.toLowerCase) {
619
+ tagName = lowerTagName;
620
+ }
621
+ if (tagName != "p" && !EMPTY_ELEMENTS[tagName]) {
622
+ let lastElem = elemStack.pop();
623
+ if (lastElem.toLowerCase() != tagName.toLowerCase()) {
624
+ if (tagName != "template") {
625
+ let i = elemStack.length - 1;
626
+ for (; i >= 0; i--) {
627
+ if (elemStack[i] == tagName) {
628
+ break;
629
+ }
630
+ }
631
+ let removeIndex = i;
632
+ for (; i > 0; i--) {
633
+ if (elemStack[i] == "template") {
634
+ elemStack.splice(removeIndex, 1);
635
+ break;
636
+ }
637
+ }
638
+ elemStack.push(lastElem);
639
+ return;
640
+ }
641
+ }
642
+ }
643
+ }
644
+ if (tag) {
645
+ colIndex += tag.length;
646
+ }
647
+ let pos;
648
+ if (!tagName) {
649
+ pos = 0;
650
+ } else {
651
+ for (pos = stack.length - 1; pos >= 0; pos--) {
652
+ if (stack[pos] == tagName) {
653
+ break;
654
+ }
655
+ }
656
+ }
657
+ if (pos >= 0) {
658
+ for (let i = stack.length - 1; i >= pos; i--) {
659
+ if (callbacks.end) {
660
+ callbacks.end(stack[i], stack[i] != tagName, this && this.misMatchCase ? this.misMatchCase : null, ((seenSvgMiddleMenBefore > 0) ? 0 : seenSVGBefore));
661
+ }
662
+ }
663
+ stack.length = pos;
664
+ }
665
+ else if (tagName == "br") {
666
+ parseStartTag(null, tagName, "", null);
667
+ }
668
+ }
669
+ const replacerFn = function (all, text) {
670
+ let matchRes;
671
+ if (text && (matchRes = text.match(/(?!({{)|"|'.*)\n(?!.*(}})|"|')/g))) {
672
+ lineIndex += matchRes.length;
673
+ colIndex = matchRes[matchRes.length - 1].length;
674
+ }
675
+ text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2");
676
+ let col = colIndex;
677
+ colIndex += text.length;
678
+
679
+ if (callbacks.chars) {
680
+ callbacks.chars(text, lineIndex, col, checkClosingTag);
681
+ }
682
+ return "";
683
+ }
684
+ if (emberFlag && htmlString.indexOf("{{!--")) {
685
+ htmlString = htmlString.replace(/{{!--[\s\S]*?--}}/g, "");
686
+ }
687
+ while (htmlString) {
688
+ hasUnparsedChars = true;
689
+ if (!stack.getLastItem() || !SPECIAL_ELEMENTS[stack.getLastItem()]) {
690
+ let checkStr = htmlString.substring(0, 5);
691
+ if (checkStr.indexOf("<!--")== 0) {
692
+ let index = htmlString.indexOf("-->");
693
+ if (index >= 0) {
694
+ if (callbacks.comment) {
695
+ let col = colIndex;
696
+ colIndex += htmlString.substring(4, index).length + 7;
697
+ callbacks.comment(htmlString.substring(4, index), lineIndex, col);
698
+ let matchRes = htmlString.substring(4, index).match(/\n/g)
699
+ if (matchRes) {
700
+ lineIndex = lineIndex + matchRes.length;
701
+ colIndex = matchRes[matchRes.length - 1].length;
702
+ }
703
+ }
704
+ htmlString = htmlString.substring(index + 3);
705
+ hasUnparsedChars = false;
706
+ }
707
+ }else if(checkStr.indexOf("<?xml") == 0){
708
+ let index = htmlString.indexOf("?>");
709
+ if(index>=0){
710
+ if(callbacks.comment){
711
+ let col = colIndex,matchedString,match;
712
+ colIndex += htmlString.substring(5, index).length + 7;
713
+ callbacks.comment("___PI:XMLStarts___"+(matchedString = htmlString.substring(5,index))+"___PI:XMLEnds___",lineIndex,col,true);//PI ~ Parser Internals
714
+ if(match = matchedString.match(/\n/g)){
715
+ lineIndex = lineIndex + match.length;
716
+ colIndex = 0;
717
+ }
718
+ htmlString = htmlString.substring(index + 2);
719
+ hasUnparsedChars = false;
720
+ }
721
+ }
722
+ } else if (checkStr.indexOf("</") == 0) {
723
+ match = htmlString.match(regexFor.endTag);
724
+ if (match) {
725
+ let misMatchCase = false;
726
+ if (match[1] == "p") {
727
+ paragraphTagStarted = 0;
728
+ }
729
+ if (paragraphTagStarted == 2 && match[1] == "template") {
730
+ paragraphTagStarted = 1;
731
+ }
732
+ if (match[1] == "p" && stack.getLastItem() != "p" && willHaveUnclosedClosingTag) {
733
+ parseStartTag(null, "p", "", null);
734
+ }
735
+ if (match[1] == "checkClosingTag") {
736
+ checkClosingTag = false;
737
+ htmlString = htmlString.substring(match[0].length);
738
+ continue;
739
+ }
740
+ let check = fancyComponent ? dasherize(match[1], fancyComponent) : match[1];
741
+ if (seenSVGBefore == 0 && check && check.toLowerCase) {
742
+ check = check.toLowerCase();
743
+ }
744
+ if (check != stack.getLastItem() && !EMPTY_ELEMENTS[check]) {
745
+ let err = new Error("Unclosed `" + elemStack.getLastItem() + "` in " + htmlString.substring(0, 100) + "...");
746
+ err.fromParser = true;
747
+ err.lineIndex = lineIndex;
748
+ err.colIndex = colIndex;
749
+ throw err;
750
+ }
751
+ if (match[1] == "template" && elemStack.getLastItem() != "template" && match[1] != "p" && !EMPTY_ELEMENTS[match[1]]) {
752
+ let match2 = htmlString.match(`<\/\s*` + elemStack.getLastItem() + `\s*>`);
753
+ if (match2) {
754
+ htmlString = htmlString.replace(match2[0], "</checkClosingTag>");
755
+ checkClosingTag = true;
756
+ htmlString = htmlString.replace(match[0], match2[0]);
757
+ htmlString = htmlString.substring(0, match2[0].length) + match[0] + htmlString.substring(match2[0].length);
758
+ match = htmlString.match(regexFor.endTag);
759
+ stringInPrevLoopState = undefined;
760
+ misMatchCase = true;
761
+ }
762
+ }
763
+ htmlString = htmlString.substring(match[0].length);
764
+
765
+ match[0].replace(regexFor.endTag, parseEndTag.bind({
766
+ misMatchCase: misMatchCase
767
+ }));
768
+ hasUnparsedChars = false;
769
+ }
770
+ } else if (checkStr.indexOf("<") == 0) {
771
+ match = getStartTag(htmlString.slice(1));
772
+ if (match.bool) {
773
+ if (paragraphTagStarted == 1 && match[1] != "p" && notAllowedTagsInsideParagraphTag[match[1]]) {
774
+ paragraphTagStarted = 0;
775
+ parseEndTag(null, "p");
776
+ willHaveUnclosedClosingTag = true;
777
+ }
778
+ htmlString = htmlString.substring(match[0].length);
779
+ if (match[1] == "template") {
780
+ while (htmlString.match(/^[^<]*?<\/br\s*>/)) {
781
+ htmlString = htmlString.replace(/<\/br\s*>/, "");
782
+ }
783
+ }
784
+ if (!withoutTableProcessing) {
785
+ if (stack.getLastItem() != "template" && seenTableBefore == 0 && tableTags[match[1]]) {
786
+ if (errorObj) {
787
+ errorObj.warnings.push({
788
+ message: "Warning: Misplaced " + match[1] + " tag in " + match[0] + "....." + "</" + match[1] + ">" + ((fileName && fileName.trim().length != 0) ? "\n\t at Component: " + fileName : "")
789
+ });
790
+ } else {
791
+ console.warn("Warning: Misplaced " + match[1] + " tag in " + match[0] + "....." + "</" + match[1] + ">" + ((fileName && fileName.trim().length != 0) ? "\n\t at Component: " + fileName : ""));
792
+ }
793
+ }
794
+ }
795
+ parseStartTag(match[0], match[1], match[2], match[3]);
796
+ hasUnparsedChars = false;
797
+ if (match[1] == "p") {
798
+ paragraphTagStarted = 1;
799
+ }
800
+ if (paragraphTagStarted == 1 && match[1] == "template") {
801
+ paragraphTagStarted = 2;
802
+ }
803
+ } else {
804
+ let err = new Error(match.error + ((match.index) ? " in <" + match.index.substring(0, (match.index.indexOf(">") != -1) ? match.index.indexOf(">") + 1 : 51) + "....." : ""));
805
+ err.fromParser = true;
806
+ err.lineIndex = lineIndex;
807
+ err.colIndex = colIndex;
808
+ throw err;
809
+ }
810
+ }
811
+ if (hasUnparsedChars) {
812
+ let hasSeenOpenMustache = false,
813
+ newLineCount = 0,
814
+ index,
815
+ mustacheIndex = {};
816
+ for (let i = 0; i < htmlString.length; i++) {
817
+ if (htmlString[i] == "\n") {
818
+ newLineCount++;
819
+ }
820
+ if (htmlString[i] == '{' && htmlString[i + 1] == '{') {
821
+ hasSeenOpenMustache = true;
822
+ mustacheIndex = {
823
+ colIndex: i - newLineCount,
824
+ lineIndex: lineIndex + newLineCount
825
+ };
826
+ }
827
+ if (htmlString[i] == '}' && htmlString[i + 1] == '}') {
828
+ hasSeenOpenMustache = false;
829
+ }
830
+ if (htmlString[i] == '<' && !hasSeenOpenMustache) {
831
+ index = i;
832
+ break;
833
+ }
834
+ }
835
+ if (hasSeenOpenMustache) {
836
+ let err = new Error("Unclosed Mustache at " + htmlString.substring(mustacheIndex.colIndex, mustacheIndex.colIndex + 50));
837
+ err.fromParser = true;
838
+ err.lineIndex = mustacheIndex.lineIndex;
839
+ err.colIndex = (mustacheIndex.lineIndex == lineIndex) ? /* <h1>check{{{}</h1> */ colIndex + mustacheIndex.colIndex : /* <h1>che\nck{{{}</h1> */ mustacheIndex.colIndex;
840
+ throw err;
841
+ }
842
+ if (!index) {
843
+ mismatchColIndex = {
844
+ colIndex,
845
+ lineIndex
846
+ };
847
+ index = htmlString.length;
848
+ newLineCount = 0;
849
+ }
850
+ let text = index < 0 ? htmlString : htmlString.substring(0, index);
851
+ htmlString = index < 0 ? "" : htmlString.substring(index);
852
+ if (callbacks.chars) {
853
+ // @Handle3055 to get precise line and column number
854
+ // if(!seenPreBefore && text){
855
+ // text = text.replace(/\r?\n|\r/g,' ').replace(/\s+/g,' ');
856
+ // }
857
+ callbacks.chars(text, lineIndex, colIndex, checkClosingTag);
858
+ colIndex = colIndex + text.length;
859
+ if (newLineCount) {
860
+ lineIndex += newLineCount;
861
+ colIndex = 0;
862
+ }
863
+ }
864
+ }
865
+ } else {
866
+ htmlString = htmlString.replace(new RegExp("([\\s\\S]*?)<\/" + stack.getLastItem() + "[^>]*>"), replacerFn);
867
+ parseEndTag("", stack.getLastItem());
868
+ }
869
+ if (htmlString == stringInPrevLoopState) {
870
+ throw "Parse Error: " + htmlString.substring(0, 100) + "...";
871
+ }
872
+ stringInPrevLoopState = htmlString;
873
+ }
874
+ if (stack.length > 0) {
875
+ let err = new Error("Unclosed `" + elemStack.getLastItem() + "` in " + htmlString.substring(0, 100) + "..." + ((fileName && fileName.trim().length != 0) ? "\n\t at Component: " + fileName : ""));
876
+ err.lineIndex = mismatchColIndex.lineIndex || lineIndex;
877
+ err.colIndex = mismatchColIndex.colIndex || colIndex;
878
+ throw err;
879
+ }
880
+ parseEndTag();
881
+ }
882
+ }());
883
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HTMLParser);
884
+ //ignorei18n_end
885
+
886
+ /***/ },
887
+
888
+ /***/ "./src/HandleMustache.js"
889
+ /*!*******************************!*\
890
+ !*** ./src/HandleMustache.js ***!
891
+ \*******************************/
892
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
893
+
894
+ __webpack_require__.r(__webpack_exports__);
895
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
896
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
897
+ /* harmony export */ });
898
+ let errorType = ["Empty Mustache Not allowed", "missing ',' in helper function parameters", "Unexpected token ", "Misplaced ','", "Callback invocation is not supported", "Only helper function calls are allowed", "Syntax error encountered while accessing object", "Syntax Error invalid '.' Dot operator", `String started and never closed`, "Syntax Error unmatched ", " Array Without indexing ", "Syntax Error"],
899
+ capturedError = undefined;
900
+ function isAlpha(str){
901
+ return /^[a-zA-Z]$/.test(str);
902
+ }
903
+ function isAlphaNumeric(str) {
904
+ return /^[a-zA-Z0-9]$/.test(str);
905
+ }
906
+ function isNumeric(code) {
907
+ return /^[0-9]$/.test(code);
908
+ }
909
+
910
+ function validKeysString(val) {
911
+ return isAlphaNumeric(val) || "!@#$%^&*_+-=".indexOf(val) != -1;
912
+ }
913
+
914
+ function isValidSquareBracket(val) {
915
+ return isAlphaNumeric(val) || val == "]" || val == ")" || val == "_" || val == "$" || val == " ";
916
+ }
917
+
918
+ function isValidDot(val) {
919
+ return isValidSquareBracket(val) || "!@#$%^&*_+-=".indexOf(val) != -1;
920
+ }
921
+
922
+ function updateSqBracket(val) {
923
+ for (let i = 0; i < val.length; i++) {
924
+ val[i]++;
925
+ }
926
+ return val;
927
+ }
928
+
929
+ function isValidVariableName(name) {
930
+ return /^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(name);
931
+ }
932
+ function createErroObj(errType,errorIndex,offset = "",bool = false){
933
+ return {
934
+ bool,
935
+ errType,
936
+ errorIndex,
937
+ err : errorType[errType] + offset
938
+ }
939
+ }
940
+ function getObservedAttributes(str, check) {
941
+ let observedAttributes = [],
942
+ string = "",
943
+ variableStarted = false,
944
+ doubleQuoteStringStarted = false,
945
+ singleQuoteStringStarted = false,
946
+ dotStarted = false;
947
+
948
+ for (let i = 0; i < str.length; i++) {
949
+ if (str[i] == "'" && str[i - 1] != "\\") {
950
+ doubleQuoteStringStarted = !doubleQuoteStringStarted;
951
+ } else if (str[i] == '"' && str[i - 1] != "\\") {
952
+ singleQuoteStringStarted = !singleQuoteStringStarted;
953
+ } else if (!doubleQuoteStringStarted && !singleQuoteStringStarted) {
954
+ if (isAlphaNumeric(str[i]) || str[i] == '_') {
955
+ variableStarted = true;
956
+ string += str[i];
957
+ } else {
958
+ if (str[i] == " ") {
959
+ continue;
960
+ }
961
+
962
+ if (dotStarted) {
963
+ string = ""
964
+ if (str[i] != ".") {
965
+ dotStarted = false;
966
+ } else {
967
+ continue;
968
+ }
969
+ }
970
+ if (str[i] == ".") {
971
+ dotStarted = true;
972
+ }
973
+ if (string.length > 0 && str[i] != '(' && isValidVariableName(string)) {
974
+
975
+ check.observedAttributes[string] = true;
976
+ }
977
+ variableStarted = false;
978
+ }
979
+ }
980
+ if (!variableStarted) {
981
+ string = "";
982
+ }
983
+ }
984
+ return observedAttributes
985
+ }
986
+
987
+ function checkForMixedCase(val) {
988
+ let seenDoubleQuotes = false,
989
+ seenSingleQuotes = false,
990
+ mustacheStarted = false,
991
+ mixedCase = false,
992
+ slashCount = 0,
993
+ mustacheSpots = [],
994
+ res = "",
995
+ mus={};
996
+ for (let i = 0; i < val.length; i++) {
997
+ if (mustacheStarted ) {
998
+ if(((seenDoubleQuotes || seenSingleQuotes) || val[i].match(/\S/))){
999
+ res += val[i];
1000
+ }
1001
+ else if (val[i+1] && val[i].match(/\s/) && /^\s*\+\+|--|[+\-*/%\w]|\*\*/.test(val[i+1])) {
1002
+ res += val[i];
1003
+ }
1004
+ }
1005
+ if (val[i - 1] != "\\" && val[i] == "{" && val[i + 1] == "{" && !seenDoubleQuotes && !seenSingleQuotes) {
1006
+ if(mustacheStarted){
1007
+ let dynamicValue;
1008
+ if(mus && mus.index && mus.index[0]!=undefined){
1009
+ dynamicValue = val.substring(mus.index[0], i);
1010
+ }
1011
+ return {
1012
+ bool:false,
1013
+ dynamicValue,
1014
+ errorIndex:i,
1015
+ err:"Invalid dynamic value inside dynamic value `{{`"
1016
+ };
1017
+ }
1018
+ if (!mixedCase && i != 0) {
1019
+ mixedCase = true
1020
+ }
1021
+ mus = {}
1022
+ mus.index = [i];
1023
+ mustacheStarted = true;
1024
+ }
1025
+ if (val[i] == "}" && val[i + 1] == "}" && !seenDoubleQuotes && !seenSingleQuotes && mustacheStarted) {
1026
+ if (!mixedCase && i + 1 != val.length - 1) {
1027
+ mixedCase = true
1028
+ }
1029
+ mus.index[1] = i + 1;
1030
+ mus.orgMus = val.substring(mus.index[0],mus.index[1]+1);
1031
+ mus.mus = "{"+res+"}";
1032
+ res = "";
1033
+ mustacheSpots.push(mus);
1034
+ mustacheStarted = false;
1035
+ }
1036
+ if (val[i] == "\\") {
1037
+ slashCount++;
1038
+ }
1039
+ if (val[i - 1] != "\\" || (val[i - 1] == "\\" && slashCount % 2 == 0)) {
1040
+ if (val[i] == "'" && !seenDoubleQuotes && mustacheStarted) {
1041
+ seenSingleQuotes = !seenSingleQuotes;
1042
+ }
1043
+ if (val[i] == '"' && !seenSingleQuotes && mustacheStarted) {
1044
+ seenDoubleQuotes = !seenDoubleQuotes;
1045
+ }
1046
+ }
1047
+ if (val[i] != "\\") {
1048
+ slashCount = 0;
1049
+ }
1050
+
1051
+ }
1052
+ return {
1053
+ bool:true,
1054
+ mixedCase: mixedCase,
1055
+ mustacheSpots: mustacheSpots
1056
+ };
1057
+ }
1058
+
1059
+ function getLineAndColIndex(val, obj, mSpot) {
1060
+ let beforeContextSplit = val.substring(0, mSpot).split("\n");
1061
+ return {
1062
+ colIndex: (beforeContextSplit.length - 1) ? beforeContextSplit[beforeContextSplit.length - 1].length : obj.colIndex + mSpot,
1063
+ lineIndex: obj.lineIndex + beforeContextSplit.length - 1
1064
+ };
1065
+ }
1066
+
1067
+ function syntaxCheckWorkerNew(val, check = undefined, errorObj = {mustacheSyntax:{arr:[],obj:{}}}, index = {},attr) {
1068
+ if (!check.Compile) {
1069
+ // console.error("Error: `can't get trimAttr scope`");
1070
+ return {
1071
+ text: val
1072
+ };
1073
+ } else {
1074
+ let syn = undefined,
1075
+ observedAttributes = undefined,
1076
+ mixedCaseCheck = false,
1077
+ origMustache = val;
1078
+ if (val.indexOf("{{") !== -1) {
1079
+ attr && (val = val.trim().replace(/^@nbsp@|@nbsp@$/gm,""));
1080
+ let tempCopy, valCopy = val,
1081
+ res = checkForMixedCase(val);
1082
+ if (res.bool) {
1083
+ const {
1084
+ mixedCase,
1085
+ mustacheSpots
1086
+ } = res;
1087
+ mixedCaseCheck = mixedCase;
1088
+ if (mustacheSpots.length && mustacheSpots.length > 0) {
1089
+ for (let j = 0; j < mustacheSpots.length; j++) {
1090
+ let mustache = mustacheSpots[j].mus,
1091
+ x = mustache,
1092
+ spots = mustacheSpots[j].index;
1093
+ if(mustache.match(/\&|\||\!|\=|\+|-|\*|\/|<|>|\?|:|%/gm)){
1094
+ x = check.Compile.trimAttr(mustache, [], {}, undefined, "", check);
1095
+
1096
+ }
1097
+ val = val.replace(mustacheSpots[j].orgMus, () => {
1098
+ return x;
1099
+ });
1100
+ tempCopy = x;
1101
+ syn = processAttr(x);
1102
+ if (!syn.bool) {
1103
+ if (errorObj.hasOwnProperty("mustacheSyntax")) {
1104
+ syn = Object.assign(syn, getLineAndColIndex(val, index, spots[0]));
1105
+ syn.dynamicValue = x;
1106
+ syn.fileName = check.fileName;
1107
+ syn.musEnd = getLineAndColIndex(val, index, spots[1]);
1108
+ errorObj.mustacheSyntax.arr.push(syn);
1109
+ if (errorObj.mustacheSyntax.obj[errorType[syn.errType]]) {
1110
+ errorObj.mustacheSyntax.obj[errorType[syn.errType]].push(check.fileName)
1111
+ } else {
1112
+ errorObj.mustacheSyntax.obj[errorType[syn.errType]] = [check.fileName]
1113
+ }
1114
+ }
1115
+ }
1116
+ if (check && check.emberFlag && ((syn && syn.bool) || (!capturedError))) {
1117
+ getObservedAttributes(tempCopy, check);
1118
+ }
1119
+
1120
+ }
1121
+ } else {
1122
+ syn = processAttr(val);
1123
+ if (!syn.bool) {
1124
+ syn.dynamicValue = val;
1125
+ if ( errorObj.hasOwnProperty("mustacheSyntax") ) {
1126
+ syn = Object.assign(syn, getLineAndColIndex(val, index, val.indexOf("{{")));
1127
+ syn.fileName = check.fileName;
1128
+ errorObj.mustacheSyntax.arr.push(syn);
1129
+ if (errorObj.mustacheSyntax.obj[errorType[syn.errType]]) {
1130
+ errorObj.mustacheSyntax.obj[errorType[syn.errType]].push(check.fileName)
1131
+ } else {
1132
+ errorObj.mustacheSyntax.obj[errorType[syn.errType]] = [check.fileName]
1133
+ }
1134
+ }
1135
+ }
1136
+ }
1137
+ }
1138
+ else{
1139
+ res = Object.assign(res, getLineAndColIndex(val, index, val.indexOf("{{")));
1140
+ if(!res.dynamicValue){
1141
+ res.dynamicValue = val;
1142
+ }
1143
+ res.fileName = check.fileName;
1144
+ errorObj.mustacheSyntax.arr.push(res);
1145
+ if (errorObj.mustacheSyntax.obj[res.err]) {
1146
+ errorObj.mustacheSyntax.obj[res.err].push(check.fileName)
1147
+ } else {
1148
+ errorObj.mustacheSyntax.obj[res.err] = [check.fileName]
1149
+ }
1150
+ }
1151
+ }
1152
+ if (!check.fromInternal && check.withoutTemplateConversion) {
1153
+ val = origMustache;
1154
+ }
1155
+ val = val.replace(/@nbsp@/gm, "&nbsp;");
1156
+ let res = {
1157
+ text: val,
1158
+ type: syn ? ((mixedCaseCheck) ? "Mixed" : syn.type) : syn,
1159
+ "observedAttributes": (observedAttributes && observedAttributes.length > 0) ? observedAttributes : undefined
1160
+ }
1161
+ if(res.type == "helper"){
1162
+ res.capturedHelper = syn.capturedHelper;
1163
+ }
1164
+ return res;
1165
+ }
1166
+ }
1167
+
1168
+ function processAttr(val) {
1169
+ let parsingMustache,
1170
+ mustacheIndex = 0,
1171
+ typeStarted,
1172
+ type = null,
1173
+ mustache = 0,
1174
+ retObj = {
1175
+ mustache: 0,
1176
+ bool: true,
1177
+ err: null,
1178
+ errorIndex: 0
1179
+ },
1180
+ valueBeforeSpace = undefined,
1181
+ stringStartIndex = 0,
1182
+ seenTextBeforeNextcomma = undefined,
1183
+ seenTokenBefore = false,
1184
+ stringStartCheck = false,
1185
+ dotStarted = false,
1186
+ IdentifierStarted = false,
1187
+ hashStarted = false,
1188
+ prevToken = "",
1189
+ capturedToken = "",
1190
+ capturedHelper;
1191
+ if (val == '{{}}') {
1192
+ return createErroObj(0,0);
1193
+ }
1194
+ for (let i = 0; i < val.length; i++) {
1195
+ if (parsingMustache) {
1196
+ if ((validKeysString(val[i]))) {
1197
+ if ((!stringStarted && !dotStarted && "!@%^&*+-=".indexOf(val[i]) != -1) || (val[i - 1] == " " && seenTokenBefore) || (stringStartCheck && val[i - 1] == " ")) {
1198
+ return createErroObj(2, i, val[i]);
1199
+ }
1200
+ if (!stringStarted) {
1201
+ seenTokenBefore = true;
1202
+ capturedToken+=val[i];
1203
+ }
1204
+
1205
+ } else if (val[i] != " ") {
1206
+ if (!stringStarted && (val[i] == "'" || val[i] == '"')) {
1207
+ if (val[i - 1] == " " && seenTokenBefore) {
1208
+ return createErroObj(2, i, val[i]);
1209
+ }
1210
+ }
1211
+ if (!stringStarted && val[i] == ".") {
1212
+ dotStarted = true;
1213
+ } else {
1214
+ dotStarted = false;
1215
+ }
1216
+ stringStartCheck = false;
1217
+ seenTokenBefore = false;
1218
+ if(capturedToken){
1219
+ prevToken = capturedToken;
1220
+ }
1221
+ capturedToken="";
1222
+ }
1223
+ if (seenTextBeforeNextcomma == false && val[i] != " " && val[i] != ",") {
1224
+ seenTextBeforeNextcomma = true;
1225
+ }
1226
+ if (sqBrackets.length > 0 && ![" ", "]", "["].includes(val[i])) {
1227
+ sqBrackets = updateSqBracket(sqBrackets);
1228
+ }
1229
+ if (spaceStarted && val[i] == "," && !stringStarted) {
1230
+ spaceStarted = false;
1231
+ valueBeforeSpace = undefined;
1232
+ }
1233
+ if (!stringStarted && !commaSeen && (isAlphaNumeric(val[i]) || val[i]=="#") && ((valueBeforeSpace && isAlphaNumeric(valueBeforeSpace)) || (valueBeforeSpace && ["'", '"'].includes(valueBeforeSpace)) || ["'", '"'].includes(val[i - 1]))) {
1234
+ return createErroObj(2, i, val[i]);
1235
+ }
1236
+ if (spaceStarted && ![",", " "].includes(val[i]) && !stringStarted && !commaSeen && paranthesis != 0) {
1237
+
1238
+ if (val[i] == "(" || val[i] == "[" || ((val[i] == ")" || val[i]=="'" || val[i] == '"') && paranthesis >= 1) || (val[i] == "]" && squareBracketCount >= 1) || isAlphaNumeric(val[i]) || val[i] == "_") {
1239
+ spaceStarted = false;
1240
+ valueBeforeSpace = undefined;
1241
+ }
1242
+ else {
1243
+ return createErroObj(2, i, val[i]);
1244
+ }
1245
+ } else if (!stringStarted && "," == val[i] && paranthesis == 0) {
1246
+ return createErroObj(3, i);
1247
+ } else if (!stringStarted && val[i] == ',') {
1248
+ seenTextBeforeNextcomma = false;
1249
+ commaSeen = true;
1250
+ }
1251
+ if (checkThis) {
1252
+ if (![",", " ", "}"].includes(val[i])) {
1253
+ if ([")", "]"].includes(checkThis) || (['"', "'"].includes(checkThis) && !stringStarted)) {
1254
+ if (((val[i] == ")" && paranthesis >= 0) || (val[i] == "]" && sqBrackets.length > 0) || (val[i] == '[') || (val[i] == '.'))) {
1255
+ checkThis = undefined;
1256
+ }
1257
+ else if (!commaSeen && !spaceStarted && !stringStarted && !(!stringStarted && checkThis == '"') && !(!stringStarted && checkThis == "'")) {
1258
+ if (paranthesis > 0 && checkThis == ']') {
1259
+ return createErroObj(4, i);
1260
+ } else {
1261
+ if (val[i] == '(' && checkThis == ')') {
1262
+ return createErroObj(11, i);
1263
+ }
1264
+ if (val[i] == ']' && checkThis == ')') {
1265
+ return createErroObj(5, i);
1266
+ }
1267
+ if ((val[i] == ']' && checkThis != ']') || (val[i] == ')' && checkThis != ')')) {
1268
+ return createErroObj(11, i);
1269
+ }
1270
+ if (val[i - 1] == ')') {
1271
+ return createErroObj(2,i,val[i]);
1272
+ }
1273
+
1274
+ }
1275
+ }
1276
+ } else if (checkThis == '.') {
1277
+ if (val[i].toUpperCase() != val[i].toLowerCase() || "!@#$%^&*_+-={[".indexOf(val[i]) != -1 || isNumeric(val[i])) {
1278
+ checkThis = undefined;
1279
+ } else if (!spaceStarted) {
1280
+ return createErroObj(6, i);
1281
+ }
1282
+ }
1283
+ } else if (!stringStarted && val[i] == "," && paranthesis == 0) {
1284
+ return createErroObj(11, i);
1285
+
1286
+ } else if (!stringStarted && val[i] == ',') {
1287
+ checkThis = undefined;
1288
+ }
1289
+ }
1290
+ if (paranthesis == 0 && val[i - 1] == ')' && ['.', '['].includes(val[i])) {
1291
+ type = "Extra Helper";
1292
+ }
1293
+ if(hashStarted){
1294
+ if(!(isAlpha(val[i]) || val[i] == "_")){
1295
+ return {
1296
+ bool: false,
1297
+ err: `Invalid character '${val[i]}' after #`,
1298
+ errorIndex: i + 1
1299
+ };
1300
+ }
1301
+ hashStarted = false;
1302
+ }
1303
+ if (val[i] == "\\") {
1304
+ i = i + 1;
1305
+ } else if (val[i] == "'") {
1306
+ if (lastString != '"') {
1307
+ if (!stringStarted) {
1308
+ if(!(paranthesis>0 || (squareBracket && squareBracket.length>0))){
1309
+ return createErroObj(2, i, "'");
1310
+ }
1311
+ stringStarted = true;
1312
+ stringStartIndex = i;
1313
+ lastString = "'";
1314
+ } else {
1315
+ let count = undefined;
1316
+ if (val[i - 1] == "\\") {
1317
+ count = 0;
1318
+ for (let j = i - 1; j >= 0; j--) {
1319
+ if (val[j] == "\\") {
1320
+ count++;
1321
+ } else {
1322
+ break;
1323
+ }
1324
+ }
1325
+ }
1326
+ if (count == undefined || count % 2 == 0) {
1327
+ stringStarted = false;
1328
+ stringStartCheck = true;
1329
+ lastString = undefined;
1330
+ }
1331
+ }
1332
+
1333
+ }
1334
+ } else if (val[i] == '"') {
1335
+ if (lastString != "'") {
1336
+ if (!stringStarted) {
1337
+ if(!(paranthesis>0 || (squareBracket && squareBracket.length>0))){
1338
+ return createErroObj(2, i, '"');
1339
+ }
1340
+ stringStarted = true;
1341
+ stringStartIndex = i;
1342
+ lastString = '"'
1343
+ } else {
1344
+ let count = undefined;
1345
+ if (val[i - 1] == "\\") {
1346
+ count = 0;
1347
+ for (let j = i - 1; j >= 0; j--) {
1348
+ if (val[j] == "\\") {
1349
+ count++;
1350
+ } else {
1351
+ break;
1352
+ }
1353
+ }
1354
+ }
1355
+ if (count == undefined || count % 2 == 0) {
1356
+ stringStarted = false;
1357
+ stringStartCheck = true;
1358
+ lastString = undefined;
1359
+ }
1360
+ }
1361
+ }
1362
+ } else if (val[i] == "{" && !stringStarted && dotStarted) {
1363
+ return createErroObj(2, i, "'{' bracket ");
1364
+ } else if (val[i] == "{" && stringStarted && val[i - 1] == "{") {
1365
+ retObj.mustache++;
1366
+ } else if (val[i] == "}" && val[i - 1] == "}" && !stringStarted) {
1367
+ if (curlyBracket.length) {
1368
+ return createErroObj(9, i, "'(' bracket ");
1369
+ }
1370
+ if (squareBracket.length) {
1371
+ return createErroObj(9, i, "'[' bracket ");
1372
+ }
1373
+ parsingMustache = false;
1374
+
1375
+ } else if (val[i] == "[" && !stringStarted) {
1376
+ if (isValidSquareBracket(val[i - 1])) {
1377
+ squareBracket.push("[");
1378
+ sqBrackets.push(0);
1379
+ }
1380
+ if (!typeStarted) {
1381
+ typeStarted = 1
1382
+ }
1383
+ if (typeStarted == 1) {
1384
+ if (!squareBracketCount && squareBracketCount != 0) {
1385
+ squareBracketCount = 1
1386
+ } else {
1387
+ squareBracketCount += 1;
1388
+ }
1389
+
1390
+ if (squareBracketCount > 1) {
1391
+ type = "Multi-dimensional array"
1392
+ }
1393
+
1394
+ }
1395
+
1396
+ } else if (val[i] == "]" && !stringStarted) {
1397
+ let check;
1398
+ if (squareBracket.length) {
1399
+ squareBracket.pop();
1400
+ check = sqBrackets.pop();
1401
+ } else {
1402
+ return createErroObj(9, i, "']' bracket ");
1403
+ }
1404
+ if (check == 0) {
1405
+ return createErroObj(10, i);
1406
+ }
1407
+ squareBracketCount -= 1;
1408
+
1409
+ } else if (val[i] == "(" && !stringStarted) {
1410
+ if (i > 0 && (isAlphaNumeric(val[i - 1]) || val[i] == '_')) {
1411
+ curlyBracket.push('(');
1412
+ } else {
1413
+ return createErroObj(2, i, val[i]);
1414
+ }
1415
+ paranthesis += 1
1416
+ if (paranthesisLog == 0) {
1417
+ continue;
1418
+ }
1419
+ if (!typeStarted) {
1420
+ typeStarted = 2
1421
+ }
1422
+ if (typeStarted == 1 && squareBracketCount > 0) {
1423
+ type = "Multi-dimensional array"
1424
+ }
1425
+ if (typeStarted == 3 && sqBrackets.length == 0) {
1426
+ return createErroObj(5, dotIndex);
1427
+ }
1428
+ if (typeStarted == 2) {
1429
+ if (!paranthesisLog && paranthesisLog != 0) {
1430
+ paranthesisLog = 1
1431
+ } else {
1432
+ paranthesisLog += 1;
1433
+ }
1434
+ if(paranthesisLog == 1){
1435
+ if(!capturedHelper){
1436
+ capturedHelper = prevToken;
1437
+ }
1438
+ }
1439
+ if (paranthesisLog > 1) {
1440
+ type = "helper";
1441
+ }
1442
+ }
1443
+ } else if (val[i] == ")" && !stringStarted) {
1444
+ if (curlyBracket.length) {
1445
+ curlyBracket.pop();
1446
+ } else {
1447
+ return createErroObj(9, i, "')' bracket ");
1448
+ }
1449
+ paranthesis -= 1;
1450
+ paranthesisLog -= 1;
1451
+ if (!typeStarted) {
1452
+ typeStarted = 2;
1453
+ }
1454
+ if (typeStarted == 2) {
1455
+ if (paranthesisLog == 0 && !type) {
1456
+ type = "helper";
1457
+ }
1458
+ }
1459
+ } else if (val[i] == "." && !stringStarted) {
1460
+
1461
+ if (!isValidDot(val[i - 1])) {
1462
+ return createErroObj(7, i);
1463
+ }
1464
+ if (!typeStarted) {
1465
+ typeStarted = 3;
1466
+ }
1467
+ if (typeStarted == 1 && sqBrackets.length > 0) {
1468
+ type = "Multi-dimensional array"
1469
+ }
1470
+ dotIndex = i;
1471
+ } else if (val[i] == "#" && !stringStarted) {
1472
+ if(dotStarted || IdentifierStarted){
1473
+ return createErroObj(2, i, "'#' operator");
1474
+ }
1475
+ hashStarted = true;
1476
+ }
1477
+ if((isAlphaNumeric(val[i]) || val[i] == "_") && !stringStarted){
1478
+ if(val[i + 1] == "'" || val[i + 1] == '"'){
1479
+ return createErroObj(2, i + 1, val[i + 1]);
1480
+ }
1481
+ IdentifierStarted = true;
1482
+ } else {
1483
+ IdentifierStarted = false;
1484
+ }
1485
+ if (!stringStarted && commaSeen && ![" ", ","].includes(val[i])) {
1486
+ commaSeen = false;
1487
+ seenTextBeforeNextcomma = undefined;
1488
+ spaceStarted = false;
1489
+ valueBeforeSpace = undefined;
1490
+ }
1491
+ if (paranthesis > 0) {
1492
+ if (val[i + 1] == " " && !stringStarted) {
1493
+ spaceStarted = true;
1494
+ valueBeforeSpace = val[i];
1495
+ continue;
1496
+ }
1497
+ if (spaceStarted) {
1498
+ continue;
1499
+ }
1500
+
1501
+ };
1502
+ if (!stringStarted && paranthesis >= 0 && [")", "]", ".", "'", '"'].includes(val[i])) {
1503
+ checkThis = val[i];
1504
+
1505
+ }
1506
+
1507
+ } else if ((val[i] == "{" && val[i - 1] == "{" && val[i - 2] != "\\")) {
1508
+ mustache++;
1509
+ var curlyBracket = [],
1510
+ squareBracket = [],
1511
+ stringStarted, lastString,
1512
+ paranthesis = 0,
1513
+ squareBracketCount,
1514
+ spaceStarted, checkThis, paranthesisLog,
1515
+ sqBrackets = [],
1516
+ commaSeen,
1517
+ dotIndex;
1518
+ typeStarted = null;
1519
+ type = null;
1520
+ parsingMustache = true;
1521
+ checkThis = undefined;
1522
+ mustacheIndex = i;
1523
+ }
1524
+ }
1525
+ if (stringStarted) {
1526
+ return createErroObj(8, stringStartIndex);
1527
+ }
1528
+ if (parsingMustache) {
1529
+ return createErroObj(9, mustacheIndex, "'{' bracket");
1530
+ }
1531
+ if (!type) {
1532
+ type = "Normal Data"
1533
+ }
1534
+ if (mustache > 1) {
1535
+ type = "mixed mustache";
1536
+ }
1537
+ retObj.type = type;
1538
+ if(type == "helper"){
1539
+ retObj.capturedHelper = capturedHelper;
1540
+ }
1541
+ return retObj;
1542
+ }
1543
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (syntaxCheckWorkerNew);
1544
+
1545
+ /***/ },
1546
+
1547
+ /***/ "./src/decodeHtmlEntities.js"
1548
+ /*!***********************************!*\
1549
+ !*** ./src/decodeHtmlEntities.js ***!
1550
+ \***********************************/
1551
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1552
+
1553
+ __webpack_require__.r(__webpack_exports__);
1554
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1555
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1556
+ /* harmony export */ });
1557
+ let regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;
1558
+ let decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','fcy':'\u0444','Fcy':'\u0424','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','ffr':'\uD835\uDD23','Ffr':'\uD835\uDD09','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','fopf':'\uD835\uDD57','Fopf':'\uD835\uDD3D','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\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','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','gamma':'\u03B3','Gamma':'\u0393','gammad':'\u03DD','Gammad':'\u03DC','gap':'\u2A86','gbreve':'\u011F','Gbreve':'\u011E','Gcedil':'\u0122','gcirc':'\u011D','Gcirc':'\u011C','gcy':'\u0433','Gcy':'\u0413','gdot':'\u0121','Gdot':'\u0120','ge':'\u2265','gE':'\u2267','gel':'\u22DB','gEl':'\u2A8C','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','ges':'\u2A7E','gescc':'\u2AA9','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','gfr':'\uD835\uDD24','Gfr':'\uD835\uDD0A','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','gjcy':'\u0453','GJcy':'\u0403','gl':'\u2277','gla':'\u2AA5','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','gopf':'\uD835\uDD58','Gopf':'\uD835\uDD3E','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','gscr':'\u210A','Gscr':'\uD835\uDCA2','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gt':'>','Gt':'\u226B','GT':'>','gtcc':'\u2AA7','gtcir':'\u2A7A','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','hardcy':'\u044A','HARDcy':'\u042A','harr':'\u2194','hArr':'\u21D4','harrcir':'\u2948','harrw':'\u21AD','Hat':'^','hbar':'\u210F','hcirc':'\u0125','Hcirc':'\u0124','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','hstrok':'\u0127','Hstrok':'\u0126','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','iacute':'\xED','Iacute':'\xCD','ic':'\u2063','icirc':'\xEE','Icirc':'\xCE','icy':'\u0438','Icy':'\u0418','Idot':'\u0130','iecy':'\u0435','IEcy':'\u0415','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','igrave':'\xEC','Igrave':'\xCC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','ijlig':'\u0133','IJlig':'\u0132','Im':'\u2111','imacr':'\u012B','Imacr':'\u012A','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','in':'\u2208','incare':'\u2105','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','int':'\u222B','Int':'\u222C','intcal':'\u22BA','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','iocy':'\u0451','IOcy':'\u0401','iogon':'\u012F','Iogon':'\u012E','iopf':'\uD835\uDD5A','Iopf':'\uD835\uDD40','iota':'\u03B9','Iota':'\u0399','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','itilde':'\u0129','Itilde':'\u0128','iukcy':'\u0456','Iukcy':'\u0406','iuml':'\xEF','Iuml':'\xCF','jcirc':'\u0135','Jcirc':'\u0134','jcy':'\u0439','Jcy':'\u0419','jfr':'\uD835\uDD27','Jfr':'\uD835\uDD0D','jmath':'\u0237','jopf':'\uD835\uDD5B','Jopf':'\uD835\uDD41','jscr':'\uD835\uDCBF','Jscr':'\uD835\uDCA5','jsercy':'\u0458','Jsercy':'\u0408','jukcy':'\u0454','Jukcy':'\u0404','kappa':'\u03BA','Kappa':'\u039A','kappav':'\u03F0','kcedil':'\u0137','Kcedil':'\u0136','kcy':'\u043A','Kcy':'\u041A','kfr':'\uD835\uDD28','Kfr':'\uD835\uDD0E','kgreen':'\u0138','khcy':'\u0445','KHcy':'\u0425','kjcy':'\u045C','KJcy':'\u040C','kopf':'\uD835\uDD5C','Kopf':'\uD835\uDD42','kscr':'\uD835\uDCC0','Kscr':'\uD835\uDCA6','lAarr':'\u21DA','lacute':'\u013A','Lacute':'\u0139','laemptyv':'\u29B4','lagran':'\u2112','lambda':'\u03BB','Lambda':'\u039B','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larr':'\u2190','lArr':'\u21D0','Larr':'\u219E','larrb':'\u21E4','larrbfs':'\u291F','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','lat':'\u2AAB','latail':'\u2919','lAtail':'\u291B','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','lcaron':'\u013E','Lcaron':'\u013D','lcedil':'\u013C','Lcedil':'\u013B','lceil':'\u2308','lcub':'{','lcy':'\u043B','Lcy':'\u041B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','leftarrow':'\u2190','Leftarrow':'\u21D0','LeftArrow':'\u2190','LeftArrowBar':'\u21E4','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVector':'\u21C3','LeftDownVectorBar':'\u2959','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','Leftrightarrow':'\u21D4','LeftRightArrow':'\u2194','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTee':'\u22A3','LeftTeeArrow':'\u21A4','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangle':'\u22B2','LeftTriangleBar':'\u29CF','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVector':'\u21BF','LeftUpVectorBar':'\u2958','LeftVector':'\u21BC','LeftVectorBar':'\u2952','leg':'\u22DA','lEg':'\u2A8B','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','les':'\u2A7D','lescc':'\u2AA8','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','lfr':'\uD835\uDD29','Lfr':'\uD835\uDD0F','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','ljcy':'\u0459','LJcy':'\u0409','ll':'\u226A','Ll':'\u22D8','llarr':'\u21C7','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','lmidot':'\u0140','Lmidot':'\u013F','lmoust':'\u23B0','lmoustache':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','Longleftarrow':'\u27F8','LongLeftArrow':'\u27F5','longleftrightarrow':'\u27F7','Longleftrightarrow':'\u27FA','LongLeftRightArrow':'\u27F7','longmapsto':'\u27FC','longrightarrow':'\u27F6','Longrightarrow':'\u27F9','LongRightArrow':'\u27F6','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','lopf':'\uD835\uDD5D','Lopf':'\uD835\uDD43','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','lstrok':'\u0142','Lstrok':'\u0141','lt':'<','Lt':'\u226A','LT':'<','ltcc':'\u2AA6','ltcir':'\u2A79','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','map':'\u21A6','Map':'\u2905','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','mcy':'\u043C','Mcy':'\u041C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','mfr':'\uD835\uDD2A','Mfr':'\uD835\uDD10','mho':'\u2127','micro':'\xB5','mid':'\u2223','midast':'*','midcir':'\u2AF0','middot':'\xB7','minus':'\u2212','minusb':'\u229F','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','mopf':'\uD835\uDD5E','Mopf':'\uD835\uDD44','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','mu':'\u03BC','Mu':'\u039C','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','nacute':'\u0144','Nacute':'\u0143','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natur':'\u266E','natural':'\u266E','naturals':'\u2115','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','ncaron':'\u0148','Ncaron':'\u0147','ncedil':'\u0146','Ncedil':'\u0145','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','ncy':'\u043D','Ncy':'\u041D','ndash':'\u2013','ne':'\u2260','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','nfr':'\uD835\uDD2B','Nfr':'\uD835\uDD11','nge':'\u2271','ngE':'\u2267\u0338','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','ngt':'\u226F','nGt':'\u226B\u20D2','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','njcy':'\u045A','NJcy':'\u040A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nle':'\u2270','nlE':'\u2266\u0338','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nlt':'\u226E','nLt':'\u226A\u20D2','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','not':'\xAC','Not':'\u2AEC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangle':'\u22EA','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangle':'\u22EB','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','npar':'\u2226','nparallel':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','npre':'\u2AAF\u0338','nprec':'\u2280','npreceq':'\u2AAF\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrc':'\u2933\u0338','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','nscr':'\uD835\uDCC3','Nscr':'\uD835\uDCA9','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsube':'\u2288','nsubE':'\u2AC5\u0338','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupe':'\u2289','nsupE':'\u2AC6\u0338','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','ntilde':'\xF1','Ntilde':'\xD1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','nu':'\u03BD','Nu':'\u039D','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','oacute':'\xF3','Oacute':'\xD3','oast':'\u229B','ocir':'\u229A','ocirc':'\xF4','Ocirc':'\xD4','ocy':'\u043E','Ocy':'\u041E','odash':'\u229D','odblac':'\u0151','Odblac':'\u0150','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','oelig':'\u0153','OElig':'\u0152','ofcir':'\u29BF','ofr':'\uD835\uDD2C','Ofr':'\uD835\uDD12','ogon':'\u02DB','ograve':'\xF2','Ograve':'\xD2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','omacr':'\u014D','Omacr':'\u014C','omega':'\u03C9','Omega':'\u03A9','omicron':'\u03BF','Omicron':'\u039F','omid':'\u29B6','ominus':'\u2296','oopf':'\uD835\uDD60','Oopf':'\uD835\uDD46','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','or':'\u2228','Or':'\u2A54','orarr':'\u21BB','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','oscr':'\u2134','Oscr':'\uD835\uDCAA','oslash':'\xF8','Oslash':'\xD8','osol':'\u2298','otilde':'\xF5','Otilde':'\xD5','otimes':'\u2297','Otimes':'\u2A37','otimesas':'\u2A36','ouml':'\xF6','Ouml':'\xD6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','par':'\u2225','para':'\xB6','parallel':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','pcy':'\u043F','Pcy':'\u041F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','pfr':'\uD835\uDD2D','Pfr':'\uD835\uDD13','phi':'\u03C6','Phi':'\u03A6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','pi':'\u03C0','Pi':'\u03A0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plus':'+','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','pr':'\u227A','Pr':'\u2ABB','prap':'\u2AB7','prcue':'\u227C','pre':'\u2AAF','prE':'\u2AB3','prec':'\u227A','precapprox':'\u2AB7','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportion':'\u2237','Proportional':'\u221D','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','pscr':'\uD835\uDCC5','Pscr':'\uD835\uDCAB','psi':'\u03C8','Psi':'\u03A8','puncsp':'\u2008','qfr':'\uD835\uDD2E','Qfr':'\uD835\uDD14','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','qscr':'\uD835\uDCC6','Qscr':'\uD835\uDCAC','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','racute':'\u0155','Racute':'\u0154','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarr':'\u2192','rArr':'\u21D2','Rarr':'\u21A0','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','rarrtl':'\u21A3','Rarrtl':'\u2916','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','rcaron':'\u0159','Rcaron':'\u0158','rcedil':'\u0157','Rcedil':'\u0156','rceil':'\u2309','rcub':'}','rcy':'\u0440','Rcy':'\u0420','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','Re':'\u211C','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','rho':'\u03C1','Rho':'\u03A1','rhov':'\u03F1','RightAngleBracket':'\u27E9','rightarrow':'\u2192','Rightarrow':'\u21D2','RightArrow':'\u2192','RightArrowBar':'\u21E5','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVector':'\u21C2','RightDownVectorBar':'\u2955','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTee':'\u22A2','RightTeeArrow':'\u21A6','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangle':'\u22B3','RightTriangleBar':'\u29D0','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVector':'\u21BE','RightUpVectorBar':'\u2954','RightVector':'\u21C0','RightVectorBar':'\u2953','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoust':'\u23B1','rmoustache':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','sacute':'\u015B','Sacute':'\u015A','sbquo':'\u201A','sc':'\u227B','Sc':'\u2ABC','scap':'\u2AB8','scaron':'\u0161','Scaron':'\u0160','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','scedil':'\u015F','Scedil':'\u015E','scirc':'\u015D','Scirc':'\u015C','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','scy':'\u0441','Scy':'\u0421','sdot':'\u22C5','sdotb':'\u22A1','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','sfr':'\uD835\uDD30','Sfr':'\uD835\uDD16','sfrown':'\u2322','sharp':'\u266F','shchcy':'\u0449','SHCHcy':'\u0429','shcy':'\u0448','SHcy':'\u0428','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','sigma':'\u03C3','Sigma':'\u03A3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','softcy':'\u044C','SOFTcy':'\u042C','sol':'/','solb':'\u29C4','solbar':'\u233F','sopf':'\uD835\uDD64','Sopf':'\uD835\uDD4A','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','squ':'\u25A1','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squf':'\u25AA','srarr':'\u2192','sscr':'\uD835\uDCC8','Sscr':'\uD835\uDCAE','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','star':'\u2606','Star':'\u22C6','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','sube':'\u2286','subE':'\u2AC5','subedot':'\u2AC3','submult':'\u2AC1','subne':'\u228A','subnE':'\u2ACB','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succ':'\u227B','succapprox':'\u2AB8','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup':'\u2283','Sup':'\u22D1','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','supdot':'\u2ABE','supdsub':'\u2AD8','supe':'\u2287','supE':'\u2AC6','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supne':'\u228B','supnE':'\u2ACC','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','tau':'\u03C4','Tau':'\u03A4','tbrk':'\u23B4','tcaron':'\u0165','Tcaron':'\u0164','tcedil':'\u0163','Tcedil':'\u0162','tcy':'\u0442','Tcy':'\u0422','tdot':'\u20DB','telrec':'\u2315','tfr':'\uD835\uDD31','Tfr':'\uD835\uDD17','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','theta':'\u03B8','Theta':'\u0398','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','thinsp':'\u2009','ThinSpace':'\u2009','thkap':'\u2248','thksim':'\u223C','thorn':'\xFE','THORN':'\xDE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','times':'\xD7','timesb':'\u22A0','timesbar':'\u2A31','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','top':'\u22A4','topbot':'\u2336','topcir':'\u2AF1','topf':'\uD835\uDD65','Topf':'\uD835\uDD4B','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','tscr':'\uD835\uDCC9','Tscr':'\uD835\uDCAF','tscy':'\u0446','TScy':'\u0426','tshcy':'\u045B','TSHcy':'\u040B','tstrok':'\u0167','Tstrok':'\u0166','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','uacute':'\xFA','Uacute':'\xDA','uarr':'\u2191','uArr':'\u21D1','Uarr':'\u219F','Uarrocir':'\u2949','ubrcy':'\u045E','Ubrcy':'\u040E','ubreve':'\u016D','Ubreve':'\u016C','ucirc':'\xFB','Ucirc':'\xDB','ucy':'\u0443','Ucy':'\u0423','udarr':'\u21C5','udblac':'\u0171','Udblac':'\u0170','udhar':'\u296E','ufisht':'\u297E','ufr':'\uD835\uDD32','Ufr':'\uD835\uDD18','ugrave':'\xF9','Ugrave':'\xD9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','umacr':'\u016B','Umacr':'\u016A','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','uogon':'\u0173','Uogon':'\u0172','uopf':'\uD835\uDD66','Uopf':'\uD835\uDD4C','uparrow':'\u2191','Uparrow':'\u21D1','UpArrow':'\u2191','UpArrowBar':'\u2912','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','Updownarrow':'\u21D5','UpDownArrow':'\u2195','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','upsilon':'\u03C5','Upsilon':'\u03A5','UpTee':'\u22A5','UpTeeArrow':'\u21A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','uring':'\u016F','Uring':'\u016E','urtri':'\u25F9','uscr':'\uD835\uDCCA','Uscr':'\uD835\uDCB0','utdot':'\u22F0','utilde':'\u0169','Utilde':'\u0168','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','uuml':'\xFC','Uuml':'\xDC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','vcy':'\u0432','Vcy':'\u0412','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','vee':'\u2228','Vee':'\u22C1','veebar':'\u22BB','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','vfr':'\uD835\uDD33','Vfr':'\uD835\uDD19','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','vopf':'\uD835\uDD67','Vopf':'\uD835\uDD4D','vprop':'\u221D','vrtri':'\u22B3','vscr':'\uD835\uDCCB','Vscr':'\uD835\uDCB1','vsubne':'\u228A\uFE00','vsubnE':'\u2ACB\uFE00','vsupne':'\u228B\uFE00','vsupnE':'\u2ACC\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','wcirc':'\u0175','Wcirc':'\u0174','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','wfr':'\uD835\uDD34','Wfr':'\uD835\uDD1A','wopf':'\uD835\uDD68','Wopf':'\uD835\uDD4E','wp':'\u2118','wr':'\u2240','wreath':'\u2240','wscr':'\uD835\uDCCC','Wscr':'\uD835\uDCB2','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','xfr':'\uD835\uDD35','Xfr':'\uD835\uDD1B','xharr':'\u27F7','xhArr':'\u27FA','xi':'\u03BE','Xi':'\u039E','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','xopf':'\uD835\uDD69','Xopf':'\uD835\uDD4F','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','xscr':'\uD835\uDCCD','Xscr':'\uD835\uDCB3','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','yacute':'\xFD','Yacute':'\xDD','yacy':'\u044F','YAcy':'\u042F','ycirc':'\u0177','Ycirc':'\u0176','ycy':'\u044B','Ycy':'\u042B','yen':'\xA5','yfr':'\uD835\uDD36','Yfr':'\uD835\uDD1C','yicy':'\u0457','YIcy':'\u0407','yopf':'\uD835\uDD6A','Yopf':'\uD835\uDD50','yscr':'\uD835\uDCCE','Yscr':'\uD835\uDCB4','yucy':'\u044E','YUcy':'\u042E','yuml':'\xFF','Yuml':'\u0178','zacute':'\u017A','Zacute':'\u0179','zcaron':'\u017E','Zcaron':'\u017D','zcy':'\u0437','Zcy':'\u0417','zdot':'\u017C','Zdot':'\u017B','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','zeta':'\u03B6','Zeta':'\u0396','zfr':'\uD835\uDD37','Zfr':'\u2128','zhcy':'\u0436','ZHcy':'\u0416','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','zscr':'\uD835\uDCCF','Zscr':'\uD835\uDCB5','zwj':'\u200D','zwnj':'\u200C'};
1559
+
1560
+ let codePointToSymbol = function(codePoint,flag) {
1561
+ return String.fromCodePoint(flag ? codePoint : "0x" + codePoint);
1562
+
1563
+ }
1564
+ const createMapFor = function (array) {
1565
+ return array.reduce(function (acc, item) {
1566
+ acc[item] = true;
1567
+ return acc;
1568
+ }, {});
1569
+ }
1570
+ let withoutSemicolonAcceptedString = createMapFor(['amp', 'lt', 'gt', 'quot']);
1571
+ let convertSemicolonAcceptedString = createMapFor(['not','sup1','cent','pound','curren','yen','brvbar','sect','uml','copy','ordf','laquo','shy','reg','macr','deg','plusmn','sup2','sup3','acute','micro','para','middot','cedil','ordm','raquo','frac14','frac12','frac34','iquest','Agrave','Aacute','Acirc','Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute','Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde','Ograve','Oacute','Ocirc','Otilde','Ouml','times','Oslash','Ugrave','Uacute','Ucirc','Uuml','Yacute','THORN','szlig','agrave','aacute','acirc','atilde','auml','aring','ccedil','aelig','egrave','eacute','ecirc','euml','igrave','iacute','icirc','iuml','eth','ntilde','ograve','oacute','ocirc','otilde','ouml','divide','oslash','ugrave','uacute','ucirc','uuml','yacute','thorn','yuml']);
1572
+
1573
+ let decode = function (str,fromTextNode = false) {
1574
+ return str.replace(regexDecode, function(normalText, match1, matchWithoutSemiColon, $3, match2, semiColon1, match3, semiColon2) {
1575
+ if (match1) {
1576
+ return decodeMap[match1];
1577
+ }
1578
+ if ((match2) || (match3)) {
1579
+ return codePointToSymbol(match2 ? match2 : match3, match2 ? true : false);
1580
+ }
1581
+ if(!fromTextNode && matchWithoutSemiColon && $3.length==0 && withoutSemicolonAcceptedString[matchWithoutSemiColon]){
1582
+ return '&'+matchWithoutSemiColon+';';
1583
+ }
1584
+
1585
+ if(fromTextNode && matchWithoutSemiColon && withoutSemicolonAcceptedString[matchWithoutSemiColon]){
1586
+ return '&'+matchWithoutSemiColon+';'+$3;
1587
+ }
1588
+ if(fromTextNode && matchWithoutSemiColon && convertSemicolonAcceptedString[matchWithoutSemiColon]){
1589
+
1590
+ return decodeMap[matchWithoutSemiColon]+$3;
1591
+ }
1592
+ return normalText;
1593
+ });
1594
+ };
1595
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({decode:decode});
1596
+ // console.time("sample")
1597
+ // console.log(decode('welcome-comp'))
1598
+ // console.timeEnd("sample")
1599
+
1600
+ /***/ },
1601
+
1602
+ /***/ "./src/htmlToJsObjectLyteRendered.js"
1603
+ /*!*******************************************!*\
1604
+ !*** ./src/htmlToJsObjectLyteRendered.js ***!
1605
+ \*******************************************/
1606
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1607
+
1608
+ __webpack_require__.r(__webpack_exports__);
1609
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1610
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
1611
+ /* harmony export */ htmlToJsObjectLyteRendered: () => (/* binding */ htmlToJsObjectLyteRendered)
1612
+ /* harmony export */ });
1613
+ /* harmony import */ var _lib_htmlParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lib/htmlParser.js */ "./lib/htmlParser.js");
1614
+ /* harmony import */ var _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodeStructClass.js */ "./src/nodeStructClass.js");
1615
+ /* harmony import */ var _HandleMustache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HandleMustache.js */ "./src/HandleMustache.js");
1616
+ /* harmony import */ var _decodeHtmlEntities_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./decodeHtmlEntities.js */ "./src/decodeHtmlEntities.js");
1617
+ //ignorei18n_start
1618
+
1619
+ /*
1620
+ pageBuilder : data,callbacks,preventSpaceText
1621
+ */
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+ const MAX_DEPTH = 512;
1628
+ const createMapFor = function (array) {
1629
+ return array.reduce(function (acc, item) {
1630
+ acc[item] = true;
1631
+ return acc;
1632
+ }, {});
1633
+ }
1634
+ let observedAttributes = {},
1635
+ tagsTable = {
1636
+ "table": ["tbody", "thead", "tfoot", "colgroup", "template"],
1637
+ "tbody": ["tr", "template"],
1638
+ "tr": ["td", "th", "template"],
1639
+ "thead": ["tr", "template"],
1640
+ "tfoot": ["tr", "template"],
1641
+ "colgroup": ["col", "template"]
1642
+ },
1643
+ tagLevel = {
1644
+ "td": 0,
1645
+ "th": 0,
1646
+ "tr": 1,
1647
+ "tbody": 2,
1648
+ "thead": 2,
1649
+ "tfoot": 2,
1650
+ "colgroup": 2
1651
+ },
1652
+ tableTags = ["tbody", "thead", "tfoot", "colgroup", "caption"],
1653
+ allTableTags = createMapFor(tableTags.concat([ "tr", "th", "td", "col", "table", "template"])),
1654
+ removedTableTags = ["body"],
1655
+ ls = [],
1656
+ styleTagStarted = false;
1657
+ tableTags = createMapFor(tableTags);
1658
+
1659
+ function removeUnwantedTags(obj, depth = 0) {
1660
+ if (depth > MAX_DEPTH) {
1661
+ throw new Error("Parse Error: HTML nesting depth exceeds the maximum allowed (" + MAX_DEPTH + ").");
1662
+ }
1663
+ if (!obj || obj.tag == "td" || obj.tag == "th") {
1664
+ return
1665
+ };
1666
+ if (obj.tag != "input" && obj.parent.tag && obj.tag && tagsTable[obj.parent.tag] && tagsTable[obj.parent.tag].indexOf(obj.tag) == -1) {
1667
+ if(allTableTags[obj.parent.tag.toLowerCase()] && allTableTags[obj.tag.toLowerCase()] && tagLevel[obj.parent.tag.toLowerCase()] <= tagLevel[obj.tag.toLowerCase()]){
1668
+ throw new Error("Invalid tag " + obj.tagName + " inside " + obj.parent.tagName);
1669
+ }
1670
+ ls.push(obj);
1671
+ obj.remove();
1672
+ }
1673
+ if (obj.tag == "input" && obj.attr.type != "hidden") {
1674
+ ls.push(obj);
1675
+ obj.remove();
1676
+ }
1677
+ if(obj.child){
1678
+ for (let i of obj.children) {
1679
+ removeUnwantedTags(i, depth + 1);
1680
+ }
1681
+ }
1682
+ }
1683
+
1684
+ function processTable(obj, tag, check) {
1685
+ let samp = obj.querySelectorAll(tag, true);
1686
+ for (let node of samp) {
1687
+ let child = node.child[0]
1688
+ let flag = false;
1689
+ while (child) {
1690
+ if (removedTableTags.indexOf(child.tag) != -1) {
1691
+ flag = true;
1692
+ let index = node.child.indexOf(child);
1693
+ let temp = ((node.child.slice(0, index)).concat(child.child)).concat(node.child.slice(index + 1));
1694
+
1695
+ node.child = []
1696
+ for (let childToPush of temp) {
1697
+ node.appendChild(childToPush);
1698
+ }
1699
+ child = node.child[index];
1700
+ continue;
1701
+ }
1702
+ child = child.next
1703
+ }
1704
+ if (flag) {
1705
+ child = node.child[0];
1706
+ while (child) {
1707
+ if (child.next && child.node == "#text" && child.next.node == "#text") {
1708
+ child.text = child.text + child.next.text;
1709
+ child.next.remove();
1710
+ }
1711
+ child = child.next
1712
+ }
1713
+ }
1714
+ child = node.child[0]
1715
+ if (child && child.node != "#element") {
1716
+ child = child.nextElementSibling;
1717
+ }
1718
+ let ptr = child;
1719
+ let checkerTemplateAsFirstNode = true;
1720
+ let targObj = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
1721
+ tag: check,
1722
+ node: "#element"
1723
+ })
1724
+ while (child) {
1725
+
1726
+ if ((check == "tr") && child.tag == "template") {
1727
+ child = child.nextElementSibling;
1728
+ ptr = child
1729
+ continue;
1730
+ }
1731
+ if (checkerTemplateAsFirstNode && child.tag == "template") {
1732
+ child = child.nextElementSibling;
1733
+ ptr = child
1734
+ continue;
1735
+ }
1736
+ checkerTemplateAsFirstNode = false;
1737
+ if (allTableTags[child.tag] && !tableTags[child.tag] && ((child.tag != check && child.tag != "col") || (flag && child.tag == "col"))) {
1738
+ let temp = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"](child);
1739
+ if (temp.child) {
1740
+ for (let i of temp.child) {
1741
+ i.parent = temp;
1742
+ }
1743
+ }
1744
+ targObj.appendChild(temp);
1745
+
1746
+ } else if (child.node != "#text") {
1747
+ if (targObj.child && ptr) {
1748
+ ptr.replaceWith(targObj);
1749
+ targObj = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
1750
+ tag: check,
1751
+ node: "#element"
1752
+ })
1753
+ }
1754
+ while (child) {
1755
+ child = child.nextElementSibling;
1756
+ if (child && child.tag != check && child.tag !="template") {
1757
+ break;
1758
+ }
1759
+ }
1760
+ ptr = child;
1761
+ if (!child) {
1762
+ break;
1763
+ } else {
1764
+ continue;
1765
+ }
1766
+ } else if (child.node == "#text") {
1767
+
1768
+ let temp = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"](child);
1769
+ if (temp.child) {
1770
+ for (let i of temp.child) {
1771
+ i.parent = temp;
1772
+ }
1773
+ }
1774
+ targObj.appendChild(temp);
1775
+ }
1776
+ let temp = child.next;
1777
+ if (child != ptr) {
1778
+ child.remove();
1779
+ }
1780
+ child = temp;
1781
+ }
1782
+ if (targObj.child && ptr) {
1783
+ ptr.replaceWith(targObj);
1784
+ }
1785
+ };
1786
+ if (check === "tbody") {
1787
+ let checkParent = obj.querySelectorAll(check, true);
1788
+ for (let tbody of checkParent) {
1789
+ let tbodyParent = tbody.parent;
1790
+ if (tbodyParent.tag != "table" && tbodyParent.tag != "template") {
1791
+ if (tbody.parent.parent) {
1792
+ let index = tbody.parent.parent.child.indexOf(tbody.parent);
1793
+ let child = tbody.parent.parent.child
1794
+ let temp = []
1795
+ let tbodyNext = null;
1796
+ tbodyParent.child.splice(tbodyParent.child.indexOf(tbody), 1);
1797
+ // ;
1798
+ if (tbody.next && tbody.next.node == "#text") {
1799
+ tbodyNext = tbody.next;
1800
+ tbodyParent.child.splice(tbodyParent.child.indexOf(tbody.next), 1);
1801
+ }
1802
+ let tbodyPushed = false;
1803
+ function push_tBody(){
1804
+ temp.push(tbody);
1805
+ if (tbodyNext) {
1806
+ temp.push(tbodyNext)
1807
+ };
1808
+ }
1809
+ for (let i = 0; i < child.length; i++) {
1810
+ if (i == index + 1) {
1811
+ tbodyPushed = true;
1812
+ push_tBody();
1813
+ temp.push(child[i]);
1814
+ } else {
1815
+ temp.push(child[i]);
1816
+ }
1817
+ }
1818
+ if(!tbodyPushed){
1819
+ push_tBody();
1820
+ }
1821
+ tbody.parent.parent.child = []
1822
+ let parent = tbody.parent.parent
1823
+ for (let i = 0; i < temp.length; i++) {
1824
+ parent.appendChild(temp[i]);
1825
+ }
1826
+
1827
+ }
1828
+ }
1829
+ }
1830
+ }
1831
+ }
1832
+
1833
+ function processUnwantedTags(obj) {
1834
+ let samp = obj.querySelectorAll("table", true);
1835
+ for (let node of samp) {
1836
+ ls = []
1837
+ removeUnwantedTags(node);
1838
+ let temp = [];
1839
+ let index = node.parent.child.indexOf(node);
1840
+ temp = (node.parent.child.slice(0, index)).concat(ls).concat(node.parent.child.slice(index, node.parent.child.length));
1841
+
1842
+ node.parent.child = [];
1843
+ for (let i of temp) {
1844
+ node.parent.appendChild(i);
1845
+ }
1846
+ }
1847
+ }
1848
+
1849
+ function processTableTag(obj) {
1850
+ processTable(obj, "table", "tbody")
1851
+ processTable(obj, "thead", "tr");
1852
+ processTable(obj, "tbody", "tr")
1853
+ processTable(obj, "table", "colgroup", true)
1854
+ processUnwantedTags(obj);
1855
+
1856
+ }
1857
+
1858
+ function processSelect(obj) {
1859
+ let check = {
1860
+ "opt": function (obj) {
1861
+ if (!obj || !obj.child || !obj.child.length) {
1862
+ return;
1863
+ }
1864
+ let child = (obj.child[0].node == "#text") ? obj.child[0].nextElementSibling : obj.child[0];
1865
+ let ptr = undefined;
1866
+ let text = ""
1867
+ while (child) {
1868
+ if (child.tag != "template" && child.node != "#text") {
1869
+ let response = this.other(child);
1870
+ if (child.node != "#text" && !ptr && child.tag != "template" && typeof response != "object") {
1871
+ ptr = child;
1872
+ }
1873
+ if (typeof response == "object") {
1874
+ child.replaceWith(new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"](response))
1875
+ if (ptr) {
1876
+ let index = ptr.parent.child.indexOf(ptr);
1877
+ ptr.replaceWith(new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
1878
+ node: "#text",
1879
+ text: text
1880
+ }));
1881
+ this.text(ptr.parent.child[index]);
1882
+ }
1883
+ ptr = undefined;
1884
+ text = ""
1885
+ } else {
1886
+ text += (" " + response.trim() + " ");
1887
+ if (child != ptr) {
1888
+ child.remove();
1889
+ }
1890
+ }
1891
+ } else if (child.tag == "template") {
1892
+ if (ptr) {
1893
+ let index = ptr.parent.child.indexOf(ptr);
1894
+ ptr.replaceWith(new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
1895
+ node: "#text",
1896
+ text: text
1897
+ }));
1898
+ this.text(ptr.parent.child[index]);
1899
+ }
1900
+ ptr = undefined;
1901
+ text = ""
1902
+ } else if (child.node == "#text" && child.text.trim().length > 0) {
1903
+ let index = child.parent.child.indexOf(child);
1904
+ this.text(child.parent.child[index]);
1905
+ }
1906
+ child = child.next;
1907
+ }
1908
+ if (ptr && text.trim().length > 0) {
1909
+ let index = ptr.parent.child.indexOf(ptr);
1910
+ ptr.replaceWith(new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
1911
+ node: "#text",
1912
+ text: text
1913
+ }));
1914
+ this.text(ptr.parent.child[index]);
1915
+ }
1916
+ },
1917
+ "text": function (obj) {
1918
+ let child = obj.prev;
1919
+ let prevText = "";
1920
+ while (child) {
1921
+ if (child.node != "#text") {
1922
+ break;
1923
+ }
1924
+ prevText = " " + child.text.trim() + prevText + " ";
1925
+ let temp = child;
1926
+ child.remove();
1927
+ child = temp.prev;
1928
+ }
1929
+ child = obj.next;
1930
+ let nextText = "";
1931
+ while (child) {
1932
+ if (child.node != "#text") {
1933
+ break;
1934
+ }
1935
+ nextText = " " + nextText + child.text.trim() + " ";
1936
+ let temp = child;
1937
+ child.remove();
1938
+ child = temp.next;
1939
+ }
1940
+ obj.text = prevText.trim() + obj.text + nextText.trim();
1941
+ },
1942
+ "other": function (obj, text = "") {
1943
+ if (!obj) {
1944
+ return text;
1945
+ }
1946
+ if (obj.tag == "template") {
1947
+ return obj;
1948
+ }
1949
+ if (obj.node == "#text" && obj.text.trim().length > 0) {
1950
+ text += (" " + obj.text.trim() + " ");
1951
+ }
1952
+ if (!obj.child) {
1953
+ return text;
1954
+ }
1955
+ let child = obj.child
1956
+ for (let i of child) {
1957
+ text = this.other(i, text);
1958
+ if (typeof res == "object") {
1959
+ return res;
1960
+ }
1961
+ }
1962
+ return text;
1963
+ }
1964
+ }
1965
+ if (obj.child) {
1966
+ let child = obj.child[0];
1967
+ while (child) {
1968
+ if (child.node != "#text") {
1969
+ if (child.tag == "option" || child.tag == "optgroup") {
1970
+ check.opt(child)
1971
+ } else if (child.tag != "template") {
1972
+ let response = check.other(child);
1973
+ if (typeof response == "object") {
1974
+ child.replaceWith(new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"](response))
1975
+ } else {
1976
+ let index = child.parent.child.indexOf(child);
1977
+ child.replaceWith(new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
1978
+ node: "#text",
1979
+ text: response
1980
+ }));
1981
+ check.text(child.parent.child[index]);
1982
+ }
1983
+ }
1984
+ }
1985
+ child = child.next;
1986
+ }
1987
+ }
1988
+ }
1989
+
1990
+ function processSelectTags(obj) {
1991
+ let samp = obj.querySelectorAll("select", true);
1992
+ for (let select of samp) {
1993
+ processSelect(select);
1994
+ }
1995
+ }
1996
+ const htmlToJsObjectLyteRendered = (function () {
1997
+ function removeDOCTYPE(html) {
1998
+ return html
1999
+ .replace(/<!doctype.*\>\n/, '')
2000
+ .replace(/<!DOCTYPE.*\>\n/, '');
2001
+ }
2002
+ const convertToHtml = function (json, customHooks, checks) {
2003
+ if (checks && checks.attrWithoutValue) {
2004
+ checks.attrWithoutValue = createMapFor(checks.attrWithoutValue);
2005
+ }
2006
+ return getHtml(json, customHooks, checks);
2007
+ }
2008
+ const getHtml = function (json, customHooks, checks ,styleStarted = false) {
2009
+ customHooks = customHooks || {
2010
+ handlers: {}
2011
+ };
2012
+ if (typeof json === 'object' && json !== null && !Array.isArray(json)) {
2013
+ // Empty Elements - HTML 4.01
2014
+ if(json.tag == "style"){
2015
+ styleStarted = true;
2016
+ }
2017
+ let empty = ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'embed', 'source', "track"],
2018
+ attr = '',
2019
+ attrType = json.attrType;
2020
+ if (json.attr) {
2021
+ let errorinfo;
2022
+ if (json.attr.errorinfo) {
2023
+ errorinfo = Object.assign(json.attr.errorinfo);
2024
+ delete json.attr.errorinfo;
2025
+ }
2026
+ let spaceBetweenAttr = json.spaceBetweenAttr;
2027
+ const prependSpace = function (res, spaceCheckKey) {
2028
+ if (spaceBetweenAttr) {
2029
+ let sp = spaceBetweenAttr[spaceCheckKey];
2030
+ return ((sp && sp.sB) || " ") + res;
2031
+ }
2032
+ return res;
2033
+ };
2034
+ attr = Object.keys(json.attr).map(function (key) {
2035
+ let spaceCheckKey = key.toLowerCase();
2036
+ let value = json.attr[key],
2037
+ closers = '"';
2038
+ if (Array.isArray(value)) {
2039
+ value = value.join(' ');
2040
+ }
2041
+ if (!checks || !checks.withoutTemplateConversion) {
2042
+ value = value.replace(/&lt;/g, "<");
2043
+ value = value.replace(/&gt;/g, ">");
2044
+ value = value.replace(/"/g, "&quot;");
2045
+ value = value.replace(/&apos;/gm, "'");
2046
+ value = value.replace(/&(?!quot;)(?!amp;)(?![gl]t;)(?![Oo][Ee]lig;)(?![Ss]caron;)(?!Yuml;)(?!circ;)(?!tilde;)(?!e[mn]sp;)(?!thinsp;)(?!zwnj;)(?!zwj;)(?![hl]rm;)(?!rlm;)(?![mn]dash;)(?![rl]squo;)(?!sbquo;)(?![rbl]dquo;)(?![dD]agger;)(?!permil;)(?![rl]saquo;)(?!euro;)(?!nbsp;)(?!apos;)(?!cent;)(?!pound;)(?!yen;)(?!copy;)(?!reg;)/gm, "&amp;")
2047
+ } else {
2048
+ if (attrType && attrType.___nullCheck___ && attrType.___nullCheck___[key]) {
2049
+ return prependSpace(key, spaceCheckKey);
2050
+ }
2051
+ if (checks.attrWithoutValue && checks.attrWithoutValue[key] && value == "") {
2052
+ return prependSpace(key, spaceCheckKey);
2053
+ }
2054
+ if (attrType && attrType.___attrStart___) {
2055
+ let valCloser = attrType.___attrStart___[key];
2056
+ if (valCloser) {
2057
+ closers = (valCloser === "'" || valCloser === '"') ? valCloser : "";
2058
+ }
2059
+ }
2060
+ }
2061
+
2062
+ let sBE = "", sAE = "";
2063
+ if (spaceBetweenAttr) {
2064
+ let sp = spaceBetweenAttr[spaceCheckKey];
2065
+ if (sp) {
2066
+ if (sp.sBE) {
2067
+ sBE = " ".repeat(sp.sBE);
2068
+ }
2069
+ if (sp.sAE) {
2070
+ sAE = " ".repeat(sp.sAE);
2071
+ }
2072
+ }
2073
+ }
2074
+ return prependSpace(key + sBE + "=" + sAE + closers + value + closers, spaceCheckKey);
2075
+ }).join(spaceBetweenAttr ? "" : ' ');
2076
+ if (errorinfo) {
2077
+ json.attr.errorInfo = errorinfo;
2078
+ }
2079
+ if (json.eS) {
2080
+ attr = attr + json.eS;
2081
+ }
2082
+ if (attr !== '' && !spaceBetweenAttr) {
2083
+ attr = ' ' + attr;
2084
+ }
2085
+ }
2086
+ let child = '';
2087
+ const convertChild = function () {
2088
+ let ptr = json.child || json.content.child
2089
+ if (ptr) {
2090
+ child = ptr.map(function (item) {
2091
+ return getHtml(item, customHooks, checks,styleStarted);
2092
+ }).join('');
2093
+ }
2094
+ }
2095
+ if (json.node === '#element') {
2096
+ let tag = json.tag;
2097
+ const handler = (customHooks.handlers || {})[json.node];
2098
+ if (typeof handler === 'function') {
2099
+ const output = handler(json);
2100
+ if (output !== null) {
2101
+ return output;
2102
+ }
2103
+ }
2104
+
2105
+ convertChild();
2106
+ if (empty.indexOf(tag) > -1) {
2107
+ // empty element
2108
+ return '<' + json.tag + attr + '>';
2109
+ }
2110
+
2111
+ // non empty element
2112
+ let open = '<' + json.tag + attr + '>';
2113
+ let close = '</' + json.tag + '>';
2114
+ return open + child + close;
2115
+ }
2116
+
2117
+ if (json.node === '#text') {
2118
+ if (!styleStarted && (!checks || !checks.withoutTemplateConversion)) {
2119
+ json.text = json.text.replace(/</g, "&lt;");
2120
+ json.text = json.text.replace(/>/g, "&gt;");
2121
+ json.text = json.text.replace(/&quot;/g, '"');
2122
+ json.text = json.text.replace(/&(?!quot;)(?!amp;)(?![gl]t;)(?![Oo][Ee]lig;)(?![Ss]caron;)(?!Yuml;)(?!circ;)(?!tilde;)(?!e[mn]sp;)(?!thinsp;)(?!zwnj;)(?!zwj;)(?![hl]rm;)(?!rlm;)(?![mn]dash;)(?![rl]squo;)(?!sbquo;)(?![rbl]dquo;)(?![dD]agger;)(?!permil;)(?![rl]saquo;)(?!euro;)(?!nbsp;)(?!apos;)(?!cent;)(?!pound;)(?!yen;)(?!copy;)(?!reg;)/gm, "&amp;");
2123
+ }
2124
+ return json.text;
2125
+ }
2126
+
2127
+ if (json.node === 'html') {
2128
+ return json.html;
2129
+ }
2130
+
2131
+ if (json.node === '#comment') {
2132
+ let text = json.text;
2133
+ if(text && text.startsWith("___PI:XMLStarts___")){
2134
+ return json.text.replace("___PI:XMLStarts___","<?xml").replace("___PI:XMLEnds___","?>");
2135
+ }
2136
+ return '<!--' + json.text + '-->';
2137
+ }
2138
+
2139
+ if (json.node === 'root') {
2140
+ const handler = (customHooks.handlers || {})[json.node];
2141
+ if (typeof handler === 'function') {
2142
+ const output = handler(json);
2143
+ if (output !== null) {
2144
+ return output;
2145
+ }
2146
+ }
2147
+ convertChild();
2148
+ return child;
2149
+ }
2150
+
2151
+ } else {
2152
+ throw new Error("Invalid value. Expected object");
2153
+ }
2154
+ }
2155
+ const find = (obj, find) => {
2156
+ if (obj) {
2157
+ let ls = Object.keys(obj);
2158
+ for (let i = 0; i < ls.length; i++) {
2159
+ if (ls[i] == find) {
2160
+ return true;
2161
+ }
2162
+ }
2163
+ }
2164
+ return false;
2165
+ }
2166
+ // Strict-mode XSS guards (default on; set check.strict = false to opt out for trusted templates)
2167
+ const STRICT_DANGEROUS_TAGS = createMapFor(["script", "object", "embed", "applet"]);
2168
+ const SAFE_DATA_IMAGE_RE = /^data:image\/(?:png|jpe?g|gif|webp|bmp|x-icon|vnd\.microsoft\.icon)[;,]/i;
2169
+ const EVENT_ATTR_RE = /^on[a-z0-9_-]+$/i;
2170
+
2171
+ const decodeNumericHexEntity = function (_, h) {
2172
+ const code = parseInt(h, 16);
2173
+ return Number.isFinite(code) ? String.fromCharCode(code) : "";
2174
+ };
2175
+ const decodeNumericDecEntity = function (_, d) {
2176
+ const code = parseInt(d, 10);
2177
+ return Number.isFinite(code) ? String.fromCharCode(code) : "";
2178
+ };
2179
+ const decodeHtmlForStrictCheck = function (value) {
2180
+ let s = String(value == null ? "" : value);
2181
+ for (let i = 0; i < 3; i++) {
2182
+ const next = s
2183
+ .replace(/&#x([0-9a-fA-F]+);?/g, decodeNumericHexEntity)
2184
+ .replace(/&#(\d+);?/g, decodeNumericDecEntity)
2185
+ .replace(/&colon;/gi, ":")
2186
+ .replace(/&Tab;/gi, "\t")
2187
+ .replace(/&NewLine;/gi, "\n")
2188
+ .replace(/&lt;/gi, "<")
2189
+ .replace(/&gt;/gi, ">")
2190
+ .replace(/&quot;/gi, '"')
2191
+ .replace(/&apos;/gi, "'")
2192
+ .replace(/&amp;/gi, "&");
2193
+ if (next === s) {
2194
+ break;
2195
+ }
2196
+ s = next;
2197
+ }
2198
+ return s;
2199
+ };
2200
+
2201
+ const normalizeForDangerousUrl = function (value) {
2202
+ return decodeHtmlForStrictCheck(value).replace(
2203
+ /[\u0000-\u0020\u00a0\u1680\u180e\u2000-\u200f\u2028-\u202f\u205f\u3000\ufeff]/g,
2204
+ ""
2205
+ );
2206
+ };
2207
+
2208
+ const getDangerousUrlMatch = function (value) {
2209
+ const s = normalizeForDangerousUrl(value).toLowerCase();
2210
+ let match = s.match(/^(?:javascript|vbscript|livescript|mocha)\s*:/);
2211
+ if (match) {
2212
+ return match[0];
2213
+ }
2214
+ if (/^data\s*:/.test(s)) {
2215
+ if (SAFE_DATA_IMAGE_RE.test(s) && !/^data\s*:\s*image\/svg\+xml/i.test(s)) {
2216
+ return null;
2217
+ }
2218
+ return "data:";
2219
+ }
2220
+ return null;
2221
+ };
2222
+
2223
+ const isDangerousSrcdoc = function (value) {
2224
+ // Keep whitespace so patterns like "x onerror=" still match; strip only for scheme checks
2225
+ const s = decodeHtmlForStrictCheck(value).toLowerCase();
2226
+ if (/<script\b/.test(s)) {
2227
+ return true;
2228
+ }
2229
+ if (/\bon[a-z0-9_-]+\s*=/.test(s)) {
2230
+ return true;
2231
+ }
2232
+ const compact = s.replace(
2233
+ /[\u0000-\u0020\u00a0\u1680\u180e\u2000-\u200f\u2028-\u202f\u205f\u3000\ufeff]/g,
2234
+ ""
2235
+ );
2236
+ if (/(?:javascript|vbscript|livescript|mocha):/.test(compact)) {
2237
+ return true;
2238
+ }
2239
+ if (/data:(?:text\/html|application\/xhtml|image\/svg)/.test(compact)) {
2240
+ return true;
2241
+ }
2242
+ if (/<(?:iframe|object|embed|svg|math|link|meta|base|form|applet)\b/.test(s)) {
2243
+ return true;
2244
+ }
2245
+ return false;
2246
+ };
2247
+
2248
+ const throwStrictError = function (message, lineIndex, colIndex, value) {
2249
+ const err = new Error(message);
2250
+ err.strict = true;
2251
+ err.lineIndex = lineIndex;
2252
+ err.colIndex = colIndex;
2253
+ err.value = value;
2254
+ throw err;
2255
+ };
2256
+ const convertToObject = function (html, check = {
2257
+ enhanced: false,
2258
+ fromSub: false,
2259
+ withoutTemplateConversion: false,
2260
+ pageBuilder: {},
2261
+ withLineIndex: false,
2262
+ withColumnIndex: false,
2263
+ emberFlag: false,
2264
+ fileName: "",
2265
+ fromCLI: false,
2266
+ withoutTableProcessing: false,
2267
+ ide: false
2268
+ }, errorObj = {mustacheSyntax:{arr:[],obj:{}}},captureChildComponent) {
2269
+ observedAttributes = {};
2270
+ let cbe = check.callbacks || {};
2271
+ if (!check.Compile) {
2272
+ if(errorObj.warnings){
2273
+ errorObj.warnings.push({
2274
+ message: "Compile object is missing, so syntax checking for `Dynamic Value` is being skipped."
2275
+ });
2276
+ }
2277
+ }
2278
+ if (typeof html === "string" || html instanceof String) {
2279
+ if (check) {
2280
+ check.fromMain = true;
2281
+ check.observedAttributes = observedAttributes;
2282
+ check.fromParser = true;
2283
+ check.syntaxCheckWorkerNew = _HandleMustache_js__WEBPACK_IMPORTED_MODULE_2__["default"];
2284
+
2285
+ }
2286
+
2287
+ let isOptionCallBackPresent = false,
2288
+ optionsData,
2289
+ optionsCallBacks,preventSpaceText,cliVersion = check.cliVersion;
2290
+ if (check.pageBuilder) {
2291
+ preventSpaceText = check.pageBuilder.preventSpaceText;
2292
+ optionsData = check.pageBuilder.data;
2293
+ optionsCallBacks = check.pageBuilder.callbacks;
2294
+ if (optionsCallBacks && typeof optionsCallBacks == 'object' && Object.keys(optionsCallBacks).length > 0) {
2295
+ isOptionCallBackPresent = true;
2296
+ }
2297
+ }
2298
+ html = removeDOCTYPE(html);
2299
+ const bufferArray = [],
2300
+ results = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
2301
+ node: 'root',
2302
+ child: [],
2303
+ check
2304
+ });
2305
+ if (check.Compile) {
2306
+ (0,_nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__.setNodeCompile)(results, check.Compile);
2307
+ }
2308
+ if (check.fromSub && check.hasParentSvg) {
2309
+ results.hasParentSvg = check.hasParentSvg;
2310
+ }
2311
+ if (check.fromCLI) {
2312
+ //To remove body tag inside a component
2313
+ let match = html.match(/<body\s?.*?>/gm);
2314
+ if (match) {
2315
+ if (errorObj.warnings) {
2316
+ errorObj.warnings.push({
2317
+ message: "Warning: Misplaced body tag in " + match[0] + "....." + "</body>"
2318
+ });
2319
+ }
2320
+ html = html.replace(/<body\s?.*?>/gm, "");
2321
+ html = html.replace(/<\/body\s*>/gm, "");
2322
+ }
2323
+
2324
+ }
2325
+ if (check.enhanced) {
2326
+ results.parent = null;
2327
+ results.prev = null;
2328
+ results.next = null;
2329
+ if (check.withLineIndex) {
2330
+ results.lineIndex = 0
2331
+ };
2332
+ if (check.withColumnIndex) {
2333
+ results.colIndex = 0
2334
+ };
2335
+ }
2336
+
2337
+
2338
+ ;(0,_lib_htmlParser_js__WEBPACK_IMPORTED_MODULE_0__["default"])(html, {
2339
+ start: function (tag, attrs, unary, seenSVGBefore, lineIndex, colIndex, eS) {
2340
+ let parent = bufferArray[0] || results;
2341
+ if (check.strict && STRICT_DANGEROUS_TAGS[String(tag).toLowerCase()]) {
2342
+ throwStrictError(
2343
+ "Strict-Mode: blocked <" + tag + "> — this tag is not allowed.",
2344
+ lineIndex,
2345
+ colIndex,
2346
+ tag
2347
+ );
2348
+ }
2349
+ if (tag == "style") {
2350
+ styleTagStarted = true;
2351
+ }
2352
+ if (captureChildComponent && Array.isArray(captureChildComponent) && tag && tag.indexOf("-") != -1 && captureChildComponent.indexOf(tag) == -1) {
2353
+ captureChildComponent.push(tag);
2354
+ }
2355
+ const node = (tag != "template" && (seenSVGBefore > 0 || check.hasParentSvg)) ? new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
2356
+ node: '#element',
2357
+ tag: tag,
2358
+ child: [],
2359
+ attrType: {},
2360
+ check
2361
+ }) : new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
2362
+ node: '#element',
2363
+ tag: tag,
2364
+ child: [],
2365
+ cont: [],
2366
+ attrType: {},
2367
+ check
2368
+ });
2369
+ if(node.tag == "table"){
2370
+ check.hasSeenTable = true;
2371
+ }
2372
+ if(node.select == "select"){
2373
+ check.hasSeenSelect = true;
2374
+ }
2375
+ if (check.Compile) {
2376
+ (0,_nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__.setNodeCompile)(node, check.Compile);
2377
+ }
2378
+ if (tag == "template" && seenSVGBefore == 0 && !check.hasParentSvg) {
2379
+ node.content = node.createDocumentFragment();
2380
+ }
2381
+ if (check.enhanced) {
2382
+ node.parent = parent;
2383
+ node.prev = (parent.child && parent.child[parent.child.length - 1]) ? parent.child[parent.child.length - 1] : null;
2384
+ node.next = null;
2385
+ if (check.withLineIndex) {
2386
+ node.lineIndex = lineIndex
2387
+ };
2388
+ if (check.withColumnIndex) {
2389
+ node.colIndex = colIndex
2390
+ };
2391
+ node.attrType = {};
2392
+ }
2393
+ let attrType = {};
2394
+ let spaceBetweenAttr;
2395
+ if(!check.fromInternal && check.withoutTemplateConversion){
2396
+ attrType = {
2397
+ ___attrStart___: {},
2398
+ ___nullCheck___: {}
2399
+ }
2400
+ node.spaceBetweenAttr = spaceBetweenAttr = {};
2401
+ node.eS = eS || "";
2402
+ }
2403
+ let errorInfo = undefined;
2404
+ if (attrs.length !== 0) {
2405
+ node.attr = attrs.reduce(function (acc, attr) {
2406
+ let name = attr.name;
2407
+ let value = attr.value;
2408
+ const nodeData = node.data;
2409
+ if(spaceBetweenAttr){
2410
+ spaceBetweenAttr[name.toLowerCase()] = {sB: attr.sB, sBE: attr.sBE, sAE: attr.sAE};
2411
+ }
2412
+ if (attr.errorInfo) {
2413
+ node.errorInfo = attr.errorInfo;
2414
+ }
2415
+ let actValue = value;
2416
+
2417
+ //attrProcessStarts
2418
+ value = value
2419
+ .replace(/&nbsp;/gm, "@nbsp@")
2420
+ .replace(/&#160;?/gm, "@nbsp@")
2421
+ .replace(/&#xa0;?/gm, "@nbsp@")
2422
+ .replace('.{}', '____lyteinternal____')
2423
+ .replace(/\.\s*\[\s*\]/gm, '._LIB_')
2424
+ .replace(/\.\s*\*/gm,'._LIS_');
2425
+ value = _decodeHtmlEntities_js__WEBPACK_IMPORTED_MODULE_3__["default"].decode(value);
2426
+ let _colIndex = attr.attrStartIndex || colIndex;
2427
+ let res = (0,_HandleMustache_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value, check, errorObj, {
2428
+ lineIndex,
2429
+ colIndex: _colIndex
2430
+ },true);
2431
+ //attrProcessEnds
2432
+
2433
+ let _value,_name;
2434
+ if(cbe.attr && typeof cbe.attr === 'function'){
2435
+ let response = cbe.attr({
2436
+ attrName: name,
2437
+ processedValue: value,
2438
+ originalValue: actValue
2439
+ });
2440
+ if(response != undefined){
2441
+ if(typeof response === 'object'){
2442
+ _value = response.attrValue;
2443
+ if(response.attrName != undefined){
2444
+ _name = response.attrName;
2445
+ }
2446
+ if(response.attrValue != undefined){
2447
+ _value = response.attrValue;
2448
+ }
2449
+ } else if (typeof response === 'string'){
2450
+ _value = response;
2451
+ }
2452
+ }
2453
+ }
2454
+
2455
+ if(_value != undefined){
2456
+ value = _value;
2457
+ } else {
2458
+ value = res.text;
2459
+ }
2460
+
2461
+ if(_name != undefined){
2462
+ name = _name;
2463
+ }
2464
+
2465
+ if(value){
2466
+ value = value
2467
+ .replace(/_LIB_/g,"[]")
2468
+ .replace(/_LIS_/g,"*");
2469
+ }
2470
+ if(check.strict){
2471
+ const attrName = String(name == null ? "" : name).trim();
2472
+ const attrValue = value == null ? "" : value;
2473
+ if(EVENT_ATTR_RE.test(attrName)){
2474
+ const isActionHelper =
2475
+ (res.type == "helper" && res.capturedHelper == "action") ||
2476
+ /^\s*\{\{\s*action\s*\(/i.test(String(attrValue));
2477
+ if(!isActionHelper){
2478
+ throwStrictError(
2479
+ "Strict-Mode: Invalid "+attrName+" usage. Expected events inside {{action(…)}} inside "+node.tag,
2480
+ lineIndex,
2481
+ _colIndex,
2482
+ attrValue
2483
+ );
2484
+ }
2485
+ }
2486
+ if(tag == "iframe" && attrName.toLowerCase() == "srcdoc" && isDangerousSrcdoc(attrValue)){
2487
+ throwStrictError(
2488
+ "Strict-Mode: blocked <iframe srcdoc> — inline scripts or active content detected. Remove inline JS or use a safe external script.",
2489
+ lineIndex,
2490
+ _colIndex,
2491
+ attrValue
2492
+ );
2493
+ }
2494
+ const dangerousUrl = getDangerousUrlMatch(attrValue);
2495
+ if(dangerousUrl){
2496
+ throwStrictError(
2497
+ `Strict-Mode: blocked "${dangerousUrl}" URL — inline execution is not allowed.`,
2498
+ lineIndex,
2499
+ _colIndex,
2500
+ attrValue
2501
+ );
2502
+ }
2503
+ }
2504
+ if (!acc[name] || (nodeData && nodeData[name])) {
2505
+ if (isOptionCallBackPresent && optionsCallBacks[name] && typeof optionsCallBacks[name] === 'function') {
2506
+ try {
2507
+ value = optionsCallBacks[name](value);
2508
+ } catch (e) {
2509
+ console.error("Invalid callback");
2510
+ return;
2511
+ }
2512
+ }
2513
+ if (optionsData && optionsData[name]) {
2514
+ const keyVal = optionsData[name];
2515
+ node.data = node.data || {};
2516
+ node.data[keyVal] = value;
2517
+
2518
+ } else {
2519
+ acc[name] = value;
2520
+ attrType[name] = res.type;
2521
+ if (!check.fromInternal && check.withoutTemplateConversion){
2522
+ attrType.___attrStart___[name] = attr.startChar;
2523
+ if(attr.nullCheck){
2524
+ attrType.___nullCheck___[name] = true;
2525
+ }
2526
+ }
2527
+ }
2528
+ }
2529
+ return acc;
2530
+ }, {});
2531
+ if (errorInfo) {
2532
+ node.errorInfo = errorInfo;
2533
+ }
2534
+
2535
+ }
2536
+
2537
+ node.attrType = attrType;
2538
+ if (check.enhanced && parent.child && parent.child.length) {
2539
+ parent.child[parent.child.length - 1].next = node;
2540
+ }
2541
+
2542
+ if (unary) {
2543
+ let parent = bufferArray[0] || results;
2544
+ if (parent.child === void 0) {
2545
+ parent.child = [];
2546
+ }
2547
+ parent.child.push(node);
2548
+ } else {
2549
+ bufferArray.unshift(node);
2550
+ }
2551
+ },
2552
+ end: function (tag, flag, misMatchCase, seenSVGBefore) {
2553
+ if (tag == "style") {
2554
+ styleTagStarted = false;
2555
+ }
2556
+ let node = bufferArray.shift();
2557
+ if (node.parent && node.parent.node == "#element" && allTableTags[node.parent.tag.toLowerCase()] && allTableTags[node.tag.toLowerCase()] && tagLevel[node.tag] <= 1 && tagLevel[node.parent.tag.toLowerCase()] <= tagLevel[node.tag.toLowerCase()]) {
2558
+ let err = new Error("Error: Invalid tag " + node.tagName + " inside " + node.parent.tagName);
2559
+ err.fromParser = true;
2560
+ throw err;
2561
+ }
2562
+ if (flag) {
2563
+ node.setAttribute("lt-prop-MisMatchLastParent", "true");
2564
+ }
2565
+ if (misMatchCase) {
2566
+ node.setAttribute("lt-prop-MisMatchClosingTags", "true");
2567
+ }
2568
+ if (node.tag !== tag) {
2569
+ let err = new Error('Mismatch in end tag :' + tag);
2570
+ err.fromParser = true;
2571
+ throw err;
2572
+ }
2573
+ if (node.tag == "template" && seenSVGBefore == 0 && !check.hasParentSvg) {
2574
+ let child = node.child;
2575
+ if (!node.content) {
2576
+ node.content = node.createDocumentFragment();
2577
+ }
2578
+ node.content.appendChildArr(child);
2579
+ delete node.child;
2580
+ }
2581
+ if (bufferArray.length === 0) {
2582
+ results.child.push(node);
2583
+ } else {
2584
+ const parent = bufferArray[0];
2585
+ if (parent.child === void 0) {
2586
+ parent.child = [];
2587
+ }
2588
+ parent.child.push(node);
2589
+ }
2590
+ let txtChild;
2591
+ if (
2592
+ node.tag &&
2593
+ (node.tag == "pre" || node.tag == "textarea" || node.tag == "listing") &&
2594
+ node.child &&
2595
+ node.child.length &&
2596
+ (txtChild = node.child[0]).node == "#text" &&
2597
+ txtChild.text &&
2598
+ (txtChild.text[0] == "\n" || txtChild.text[0] == "\r")
2599
+ ) {
2600
+ let text = txtChild.text;
2601
+ text = text.replace(/^(?:(?:\r\n)|\r|\n)/,"");
2602
+ txtChild.text = text;
2603
+ if(!text){
2604
+ node.child = node.child.slice(1);
2605
+ txtChild.parent = null;
2606
+ txtChild.prev = null;
2607
+ if(txtChild.next){
2608
+ txtChild.next.prev = null;
2609
+ }
2610
+ txtChild.next = null;
2611
+ }
2612
+ }
2613
+ },
2614
+ chars: function (text, lineIndex, colIndex, checkClosingTag) {
2615
+ let trimmedContent;
2616
+ if (preventSpaceText==true || check.trimSpaces) {
2617
+ trimmedContent = text.trim();
2618
+ if(trimmedContent == ""){
2619
+ return;
2620
+ }
2621
+ (check.trimSpaces) && (text = trimmedContent);
2622
+ }
2623
+ let parent = bufferArray[0] || results;
2624
+ const node = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
2625
+ node: '#text',
2626
+ text: text,
2627
+ attrType: ""
2628
+ });
2629
+ if (check.Compile) {
2630
+ (0,_nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__.setNodeCompile)(node, check.Compile);
2631
+ }
2632
+ // @newChanges
2633
+ if (styleTagStarted) {
2634
+ node.style = true;
2635
+ }
2636
+ text = text
2637
+ .replace(/&nbsp;?/gm, "@nbsp@")
2638
+ .replace(/&#160;?/gm, "@nbsp@")
2639
+ .replace(/&#xa0;?/gm, "@nbsp@")
2640
+ .replace('.{}', '____lyteinternal____')
2641
+ .replace(/\.\s*\[\s*\]/gm, '._LIB_')
2642
+ .replace(/\.\s*\*/gm,'._LIS_');
2643
+ node.text = _decodeHtmlEntities_js__WEBPACK_IMPORTED_MODULE_3__["default"].decode(text, true);
2644
+ if (check.enhanced) {
2645
+ node.parent = parent;
2646
+ node.prev = (parent.child && parent.child[parent.child.length - 1]) ? parent.child[parent.child.length - 1] : null;
2647
+ node.next = null;
2648
+ if (check.withLineIndex) {
2649
+ node.lineIndex = lineIndex
2650
+ };
2651
+ if (check.withColumnIndex) {
2652
+ node.colIndex = colIndex
2653
+ };
2654
+ }
2655
+ if (check.enhanced && parent.child && parent.child.length) {
2656
+ parent.child[parent.child.length - 1].next = node;
2657
+ }
2658
+ if (bufferArray.length === 0) {
2659
+ results.child.push(node);
2660
+ } else {
2661
+ const parent = bufferArray[0] || results;
2662
+ if (parent.child === void 0) {
2663
+ parent.child = [];
2664
+ }
2665
+ parent.child.push(node);
2666
+ }
2667
+
2668
+ let res = (0,_HandleMustache_js__WEBPACK_IMPORTED_MODULE_2__["default"])(node.text, check, errorObj, {
2669
+ lineIndex,
2670
+ colIndex
2671
+ });
2672
+ if(preventSpaceText==true){
2673
+ node.text = trimmedContent;
2674
+ }
2675
+ else{
2676
+ node.attrType = (res.type) ? res.type : "";
2677
+ let _text = res.text;
2678
+ if(_text){
2679
+ _text = _text
2680
+ .replace(/_LIB_/g,"[]")
2681
+ .replace(/_LIS_/g,"*");
2682
+ }
2683
+ node.text = _text;
2684
+
2685
+ if (node.prev && node.prev.node == "#text") {
2686
+ let text = node.prev.text;
2687
+ node.text = text + node.text;
2688
+ node.prev.remove();
2689
+ }
2690
+ let nodeValue = node.text;
2691
+ if (nodeValue) {
2692
+ let mustacheValues = nodeValue.match(/{{[^}]*?(?:(?:('|")[^\1]*?\1)[^}]*?)*}}/g); //'
2693
+ if (mustacheValues) {
2694
+ let newNodeArray = [],
2695
+ lastIndex = 0,
2696
+ offset = 0,
2697
+ flag = false;
2698
+ for (let i = 0; i < mustacheValues.length; i++) {
2699
+ let mustacheStartIndex = nodeValue.indexOf(mustacheValues[i]),
2700
+ mustacheEndIndex = mustacheStartIndex + mustacheValues[i].length;
2701
+ if (mustacheStartIndex) {
2702
+ flag = true;
2703
+ newNodeArray.push(node.createTextNode(nodeValue.substring(0, mustacheStartIndex), {
2704
+ parent: node.parent,
2705
+ lineIndex: (check.withLineIndex) ? lineIndex : undefined,
2706
+ colIndex: (check.withColumnIndex) ? colIndex + offset : undefined,
2707
+ attrType: ""
2708
+ }));
2709
+ }
2710
+ newNodeArray.push(node.createTextNode(nodeValue.substring(mustacheStartIndex, mustacheEndIndex), {
2711
+ parent: node.parent,
2712
+ lineIndex: (check.withLineIndex) ? lineIndex : undefined,
2713
+ colIndex: (check.withColumnIndex) ? colIndex + mustacheStartIndex + offset : undefined,
2714
+ attrType: res.type
2715
+ }));
2716
+ offset = offset + mustacheEndIndex;
2717
+ nodeValue = nodeValue.substring(mustacheEndIndex);
2718
+ lastIndex = colIndex + offset;
2719
+ }
2720
+ newNodeArray.push(node.createTextNode(nodeValue, {
2721
+ parent: node.parent,
2722
+ lineIndex: (check.withLineIndex) ? lineIndex : undefined,
2723
+ colIndex: (check.withColumnIndex) ? lastIndex : undefined,
2724
+ attrType: ""
2725
+ }));
2726
+ for (let i = 0; i < newNodeArray.length - 1; i++) {
2727
+ newNodeArray[i].next = newNodeArray[i + 1];
2728
+ }
2729
+ for (let i = 1; i < newNodeArray.length; i++) {
2730
+ newNodeArray[i].prev = newNodeArray[i - 1];
2731
+ }
2732
+ if (node.parent && node.parent.child) {
2733
+ if (flag && node.prev) {
2734
+ let lastChild = node.prev;
2735
+ lastChild.next = newNodeArray[0];
2736
+ newNodeArray[0].prev = lastChild;
2737
+ }
2738
+ let ls = node.parent.child,
2739
+ index = node.parent.child.indexOf(node),
2740
+ args = [index, 1].concat(newNodeArray);
2741
+ Array.prototype.splice.apply(ls, args);
2742
+ }
2743
+ }
2744
+ }
2745
+ }
2746
+ },
2747
+ comment: function (text, lineIndex, colIndex) {
2748
+ if (!check.withoutComment) {
2749
+ let par;
2750
+ const node = new _nodeStructClass_js__WEBPACK_IMPORTED_MODULE_1__["default"]({
2751
+ node: '#comment',
2752
+ text: text
2753
+ });
2754
+ par = bufferArray[0] || results;
2755
+ if (check.enhanced) {
2756
+ node.parent = par;
2757
+ node.prev = (par.child && par.child[par.child.length - 1]) ? par.child[par.child.length - 1] : null;
2758
+ node.next = null;
2759
+ if (check.withLineIndex) {
2760
+ node.lineIndex = lineIndex
2761
+ };
2762
+ if (check.withColumnIndex) {
2763
+ node.colIndex = colIndex
2764
+ };
2765
+ }
2766
+ if (check.enhanced && par.child && par.child.length) {
2767
+ par.child[par.child.length - 1].next = node;
2768
+ }
2769
+ const parent = bufferArray[0] || results;
2770
+ if (parent.child === void 0) {
2771
+ parent.child = [];
2772
+ }
2773
+ parent.child.push(node);
2774
+ }
2775
+ }
2776
+ },
2777
+ check, errorObj);
2778
+ if (!check.withoutTableProcessing) {
2779
+ if(check.hasSeenTable){
2780
+ processTableTag(results);
2781
+ }
2782
+ if(check.hasSeenSelector){
2783
+ processSelectTags(results);
2784
+ }
2785
+ }
2786
+ let s;
2787
+ if (!check.withoutTemplateConversion) {
2788
+ let comp;
2789
+ if(check.isElemental){
2790
+ comp = results.querySelector("template[@elemental='" + check.fileName + "']");
2791
+ } else {
2792
+ comp = results.querySelector("template[tag-name='" + check.fileName + "']");
2793
+ }
2794
+ if (!comp) {
2795
+ throw new Error("Cannot find template " + check.fileName);
2796
+ }
2797
+ let nextElement = comp.nextElementSibling;
2798
+ if(cliVersion == 4){
2799
+ if(!check.isElemental){
2800
+ if (nextElement && nextElement.tagName == "TEMPLATE" && nextElement.hasAttribute("view-port-template")) {
2801
+ errorObj.warnings.push({
2802
+ message: "Depricated Syntax : 'view-port-template' found in " + check.fileName + " . Migrate your app to using latest slyte-migrator."
2803
+ });
2804
+ let viewPortIf = comp.createElement("template");
2805
+ viewPortIf.setAttribute("lyte-if", "{{lyteViewPort}}");
2806
+ viewPortIf.setAttribute("__vp", "c-old");
2807
+ viewPortIf.content.appendChild(comp.createElement("dummy-port-element"));
2808
+ viewPortIf.content.appendChild(nextElement.content);
2809
+ viewPortIf.content.appendChild(comp.createElement("dummy-port-element"));
2810
+ let falseCase = comp.createElement("template");
2811
+ falseCase.setAttribute("lyte-else", "");
2812
+ falseCase.content.appendChild(comp.content);
2813
+ comp.innerHTML = "";
2814
+ comp.content.appendChild(viewPortIf);
2815
+ comp.content.appendChild(falseCase);
2816
+ nextElement.remove();
2817
+ } else if (nextElement && nextElement.tagName == "TEMPLATE" && nextElement.attributes["@view-out"]) {
2818
+ let viewPortIf = comp.createElement("template"); //actual content
2819
+ let attrVal = comp.getAttribute("@view-in");
2820
+ if (attrVal.startsWith("{{")) {
2821
+ attrVal = attrVal.substring(2, attrVal.length - 2);
2822
+ viewPortIf.setAttribute("lyte-if", "{{lyteViewPort(" + attrVal + ")}}");
2823
+ } else if (attrVal === "") {
2824
+ ;
2825
+ viewPortIf.setAttribute("lyte-if", "{{lyteViewPort()}}");
2826
+ } else {
2827
+ viewPortIf.setAttribute("lyte-if", "{{lyteViewPort(" + attrVal + ")}}");
2828
+ }
2829
+ viewPortIf.setAttribute("__vp", "c-new");
2830
+ viewPortIf.content.appendChild(comp.content);
2831
+ comp.removeAttribute("@view-in");
2832
+
2833
+ let viewPortElse = comp.createElement("template"); //loading
2834
+ viewPortElse.setAttribute("lyte-else", "");
2835
+
2836
+ viewPortElse.content.appendChild(comp.createElement("dummy-port-element"));
2837
+ viewPortElse.content.appendChild(nextElement.content);
2838
+ viewPortElse.content.appendChild(comp.createElement("dummy-port-element"));
2839
+
2840
+ comp.innerHTML = "";
2841
+
2842
+ comp.content.appendChild(viewPortIf);
2843
+ comp.content.appendChild(viewPortElse);
2844
+ nextElement.remove();
2845
+ comp.setAttribute("__vp", "c-new");
2846
+ }
2847
+ }
2848
+ } else {
2849
+ if(nextElement && nextElement.tagName == "TEMPLATE" && nextElement.hasAttribute("view-port-template")) {
2850
+ let viewPortIf = comp.createElement("template");
2851
+ viewPortIf.setAttribute("is", "if");
2852
+ viewPortIf.setAttribute("value", "{{lyteViewPort}}");
2853
+ let trueCase = comp.createElement("template");
2854
+ trueCase.setAttribute("case", "true");
2855
+ trueCase.content.appendChild(comp.createElement("dummy-port-element"));
2856
+ trueCase.content.appendChild(nextElement.content);
2857
+ trueCase.content.appendChild(comp.createElement("dummy-port-element"));
2858
+ viewPortIf.content.appendChild(trueCase);
2859
+ let falseCase = comp.createElement("template");
2860
+ falseCase.setAttribute("case", "false");
2861
+ // falseCase.innerHTML = comp.innerHTML;
2862
+ falseCase.content.appendChild(comp.content);
2863
+ viewPortIf.content.appendChild(falseCase);
2864
+ comp.innerHTML = "";
2865
+ comp.content.appendChild(viewPortIf);
2866
+ nextElement.remove();
2867
+ }
2868
+ }
2869
+ check.Compile.splitTextNodes(comp.content, errorObj.warnings, undefined, check, errorObj, undefined);
2870
+ s = results.querySelectorAll("[lyte-else]", true);
2871
+ for (let i = 0; i < s.length; i++) {
2872
+ let node = s[i]
2873
+ if (node && !(node.previousElementSibling && (find(node.previousElementSibling, "lyte-if") || find(node.previousElementSibling, "lyte-else-if")))) {
2874
+ let temp = node.cloneNode();
2875
+ temp.innerHTML = "...";
2876
+ if (errorObj && errorObj.warnings && check.fromCLI) {
2877
+ errorObj.warnings.push({
2878
+ message: "Parse Warning : `lyte-else` without `lyte-if` in " + temp.outerHTML
2879
+ });
2880
+ } else {
2881
+ console.warn("Parse Warning : `lyte-else` without `lyte-if` in " + temp.outerHTML);
2882
+ }
2883
+ }
2884
+ }
2885
+
2886
+ s = results.querySelectorAll("[lyte-else-if]", true)
2887
+ for (let i = 0; i < s.length; i++) {
2888
+ let node = s[i]
2889
+ if (node && !(node.previousElementSibling && (find(node.previousElementSibling, "lyte-if") || find(node.previousElementSibling, "lyte-else-if")))) {
2890
+ let temp = node.cloneNode();
2891
+ temp.innerHTML = "...";
2892
+ if (errorObj && errorObj.warnings && check.fromCLI) {
2893
+ errorObj.warnings.push({
2894
+ message: "Parse Warning : `lyte-else-if` without `lyte-if` in " + temp.outerHTML
2895
+ });
2896
+ } else {
2897
+ console.warn("Parse Warning : `lyte-else-if` without `lyte-if` in " + temp.outerHTML);
2898
+ }
2899
+ }
2900
+ }
2901
+ }
2902
+ if (check.emberFlag) {
2903
+ let objAttr = check.observedAttributes;
2904
+ delete objAttr.this;
2905
+ results.observedAttributes = Object.keys(objAttr);
2906
+ }
2907
+ return results;
2908
+ } else {
2909
+ throw new Error("Error: Invalid value. Expected string");
2910
+ }
2911
+ }
2912
+
2913
+ const API = {
2914
+ toHtml: convertToHtml,
2915
+ toObject: convertToObject,
2916
+ processTable: processTableTag
2917
+ }
2918
+ return API;
2919
+ }());
2920
+
2921
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (htmlToJsObjectLyteRendered);
2922
+ //ignorei18n_end
2923
+
2924
+ /***/ },
2925
+
2926
+ /***/ "./src/nodeStructClass.js"
2927
+ /*!********************************!*\
2928
+ !*** ./src/nodeStructClass.js ***!
2929
+ \********************************/
2930
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2931
+
2932
+ __webpack_require__.r(__webpack_exports__);
2933
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2934
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
2935
+ /* harmony export */ getNodeCompile: () => (/* binding */ getNodeCompile),
2936
+ /* harmony export */ setNodeCompile: () => (/* binding */ setNodeCompile)
2937
+ /* harmony export */ });
2938
+ /* harmony import */ var _htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./htmlToJsObjectLyteRendered.js */ "./src/htmlToJsObjectLyteRendered.js");
2939
+
2940
+ const MAX_DEPTH = 512;
2941
+ let dNegateItems = {
2942
+ '__events__':true,
2943
+ 'errorInfo':true,
2944
+ 'attr':true,
2945
+ 'node':true,
2946
+ 'text':true,
2947
+ 'attrType':true,
2948
+ // 'parent':true,
2949
+ // 'prev':true,
2950
+ // 'next':true,
2951
+ 'cont':true,
2952
+ '_parent':true,
2953
+ 'child':true
2954
+ }
2955
+
2956
+ // Skip keys that can pollute Object.prototype when copied via defineProperty
2957
+ let dangerousCloneKeys = {
2958
+ '__proto__': true,
2959
+ 'constructor': true,
2960
+ 'prototype': true
2961
+ };
2962
+
2963
+ function setNodeCompile(node, compile) {
2964
+ if (!node || !compile) {
2965
+ return;
2966
+ }
2967
+ Object.defineProperty(node, 'Compile', {
2968
+ value: compile,
2969
+ writable: true,
2970
+ configurable: true,
2971
+ enumerable: false
2972
+ });
2973
+ }
2974
+
2975
+ function getNodeCompile(node) {
2976
+ if (!node || !Object.prototype.hasOwnProperty.call(node, 'Compile')) {
2977
+ return undefined;
2978
+ }
2979
+ return node.Compile;
2980
+ }
2981
+
2982
+ /**
2983
+ * Parse HTML for public DOM-like setters (innerHTML / outerHTML).
2984
+ * Inherits the host node's strict policy from `_opt` (same as toObject: default true).
2985
+ */
2986
+ function resolveNodeStrict(node) {
2987
+ return node && node._opt && node._opt.strict;
2988
+ }
2989
+
2990
+ function parseHtmlFromSetter(hostNode, html) {
2991
+ const tagName = hostNode.tagName;
2992
+ return _htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObject(String(html == null ? "" : html), {
2993
+ fromInternal: true,
2994
+ enhanced: true,
2995
+ withoutTableProcessing: true,
2996
+ withoutTemplateConversion: true,
2997
+ hasParentSvg: tagName == tagName.toLowerCase(),
2998
+ fromSub: true,
2999
+ Compile: getNodeCompile(hostNode),
3000
+ strict: resolveNodeStrict(hostNode)
3001
+ }).childNodes;
3002
+ }
3003
+
3004
+ function inheritNodeOpt(fromNode, toNode) {
3005
+ if (fromNode && toNode && fromNode._opt && Object.keys(fromNode._opt).length) {
3006
+ toNode._opt = { ...fromNode._opt };
3007
+ }
3008
+ }
3009
+
3010
+ function deepCopyObject( obj ) {
3011
+ let current, copies = [{source : obj, target : Object.create(Object.getPrototypeOf(obj))}], keys, propertyIndex, descriptor, nextSource, sourceReferences = [obj];
3012
+ let cloneObject = copies[0].target, targetReferences = [cloneObject];
3013
+ let referenceChecker = new WeakMap();
3014
+ while(current = copies.shift()){
3015
+ keys = Object.getOwnPropertyNames(current.source);
3016
+ for(propertyIndex = 0; propertyIndex < keys.length; propertyIndex++){
3017
+ if (dangerousCloneKeys[keys[propertyIndex]]) {
3018
+ continue;
3019
+ }
3020
+ descriptor = Object.getOwnPropertyDescriptor(current.source, keys[propertyIndex]);
3021
+ if(!descriptor.value || typeof descriptor.value != "object"){
3022
+ Object.defineProperty(current.target, keys[propertyIndex], descriptor);
3023
+ continue;
3024
+ }
3025
+ nextSource = descriptor.value;
3026
+ descriptor.value = Array.isArray(nextSource) ? [] : Object.create(Object.getPrototypeOf(nextSource));
3027
+ let indexOf = referenceChecker.get(nextSource);
3028
+ if(indexOf){
3029
+ descriptor.value = targetReferences[indexOf];
3030
+ Object.defineProperty(current.target, keys[propertyIndex], descriptor);
3031
+ continue;
3032
+ }
3033
+ sourceReferences.push(nextSource);
3034
+ referenceChecker.set(nextSource,sourceReferences.length-1);
3035
+ targetReferences.push(descriptor.value);
3036
+ Object.defineProperty(current.target, keys[propertyIndex], descriptor);
3037
+ let res = {source : nextSource, target : descriptor.value};
3038
+ if(keys[propertyIndex] == "child"){
3039
+ res._parent = current.source;
3040
+ }
3041
+ if(current._parent){
3042
+ res.parent = current._parent;
3043
+ }
3044
+ if(current.parent){
3045
+ current.source.parent = current.parent;
3046
+ }
3047
+ if (dNegateItems[keys[propertyIndex]] || !(current.source instanceof Node)) {
3048
+ copies.push(res);
3049
+ }
3050
+ }
3051
+ }
3052
+ return cloneObject;
3053
+ }
3054
+ function getSelectorType(selector){
3055
+ let index;
3056
+ if(selector[0]=='.') { return {_attr:"class",_attrVal:selector.substring(1),single:1}; }
3057
+ else if(selector[0]=='#') { return {_attr:"id",_attrVal:selector.substring(1),single:1}; }
3058
+ else if((index = selector.search('\\[')) != -1){
3059
+ let tagName;
3060
+ if(index != 0){
3061
+ [tagName,selector] = selector.split('[');
3062
+ tagName = tagName.trim();
3063
+ selector = "["+selector;
3064
+ }
3065
+ let res;
3066
+ if(selector.search('=')!=-1){
3067
+ let searchItem = selector.substring(1,selector.length-1).split("=");
3068
+ let attr = searchItem[0];
3069
+ let attrVal = searchItem[1].replace(/^"+|"+$/g, '');
3070
+ attrVal = attrVal.replace(/^'+|'+$/g, '');
3071
+ res = {_attr:attr,_attrVal:attrVal,single:1};
3072
+ }
3073
+ else {
3074
+ let attr = selector.substring(1,selector.length-1);
3075
+ res = {_attr:attr,_attrVal:null,single:2};
3076
+ }
3077
+ if(tagName){
3078
+ res.tagName = tagName;
3079
+ }
3080
+ return res;
3081
+ };
3082
+ return {tagName:selector,_attrVal:null,single:3};
3083
+ }
3084
+ function deepCopyNode(obj,hasSeenSvg){
3085
+ if(!obj){return}
3086
+ obj = new Node(obj);
3087
+ if(hasSeenSvg && obj.tag == "template" && obj.cont){
3088
+ let temp = obj.content.childNodes,ls = obj.child = [];
3089
+ obj.child = temp;
3090
+ delete obj.cont;
3091
+ }
3092
+ if(!hasSeenSvg && obj.tag == "template" && obj.child ){
3093
+ let temp = obj.child;
3094
+ obj.content = obj.createDocumentFragment();
3095
+ obj.cont.child=temp;
3096
+ delete obj.child;
3097
+ }
3098
+ if(obj.tag == "svg"){
3099
+ hasSeenSvg = hasSeenSvg || true;
3100
+ }
3101
+ let prev;
3102
+ if(obj.content){
3103
+ obj.content = new Node(obj.content);
3104
+ let ls = [];
3105
+ for(let i in obj.content.child){
3106
+ let ref = obj.content.child[i] = deepCopyNode(obj.content.child[i],hasSeenSvg);
3107
+ if(prev){
3108
+ prev.next = ref;
3109
+ }
3110
+ ref.parent = obj.content;
3111
+ ref.prev = prev;
3112
+ prev = ref;
3113
+ ls.push(ref);
3114
+ }
3115
+ obj.content.child = ls;
3116
+
3117
+ }
3118
+ else if (obj.childNodes){
3119
+ let ls = [];
3120
+ for(let i in obj.child){
3121
+ let ref = obj.child[i] = deepCopyNode(obj.child[i],hasSeenSvg);
3122
+ if(prev){
3123
+ prev.next = ref;
3124
+ }
3125
+ ref.parent = obj;
3126
+ ref.prev = prev;
3127
+ prev = ref;
3128
+ ls.push(ref);
3129
+ }
3130
+ obj.child = ls;
3131
+ }
3132
+ return obj;
3133
+ }
3134
+ class Node{
3135
+ _opt = {};
3136
+ constructor(obj) {
3137
+ this.node = obj.node;
3138
+ (obj.hasOwnProperty("parent")) ? this.parent = obj.parent : this.parent = null;
3139
+ (obj.hasOwnProperty("prev")) ? this.prev = obj.prev : this.prev = null;
3140
+ (obj.hasOwnProperty("next")) ? this.next = obj.next : this.next = null;
3141
+ if (obj.hasOwnProperty("tag")) { this.tag = obj.tag; }
3142
+ if(obj.hasOwnProperty("text")) { this.text = obj.text; }
3143
+ if(obj.hasOwnProperty("attr")) { this.attr = Object.assign({},obj.attr); }
3144
+ if(obj.hasOwnProperty("child")) { this.child = obj.child; }
3145
+ if(obj.hasOwnProperty("attrType")) { this.attrType = Object.assign({},obj.attrType) }
3146
+ else if(obj.node == "#element"){
3147
+ this.attrType = {};
3148
+ }
3149
+ {
3150
+ const compile = getNodeCompile(obj);
3151
+ if (compile) {
3152
+ setNodeCompile(this, compile);
3153
+ }
3154
+ }
3155
+ if(obj.check){
3156
+ this._opt = {...obj.check};
3157
+ }
3158
+ if(obj.hasOwnProperty("errorInfo")){ this.errorInfo = obj.errorInfo}
3159
+ if(obj.hasOwnProperty("cont")){this.cont = obj.content}
3160
+ }
3161
+ /**
3162
+ * @param {{}} check
3163
+ */
3164
+ set setOpt(opt){
3165
+ if(opt){
3166
+ this._opt = {...opt};
3167
+ }
3168
+ }
3169
+ refreshNode(NodeStruct = false){
3170
+ let nodes = this.querySelectorAll("tbody",true);
3171
+ let ds = {};
3172
+ let value = null;
3173
+ for(let node of nodes){
3174
+ let parent = node.parent || node._parent
3175
+ let index = parent.child.indexOf(node);
3176
+ let temp = null;
3177
+ let count = 0;
3178
+ if (parent.tag != "table"){
3179
+ parent.child.splice(parent.child.indexOf(node), 1);
3180
+ let ptr = parent;
3181
+ while(parent){
3182
+ if (parent.tag == "table" && temp) {
3183
+ let ls = []
3184
+ index = parent.child.indexOf(temp);
3185
+ if (parent.hasAttribute("haveChangesInTbody")) {
3186
+ value = parent.attr.haveChangesInTbody;
3187
+ }
3188
+ else {
3189
+ count++;
3190
+ parent.setAttribute("haveChangesInTbody", count.toString());
3191
+ value = count.toString();
3192
+ }
3193
+ if(ds[value]){
3194
+ ds[value].push({ node: node, index: index});
3195
+ }
3196
+ else{
3197
+ ds[value] = [{ node: node, index: index}]
3198
+ }
3199
+ if(node.next && node.next.node == "#text"){
3200
+ ds[value].push({ node: node.next, index: index});
3201
+ ptr.child.splice(ptr.child.indexOf(node.next), 1);
3202
+ }
3203
+ break;
3204
+ };
3205
+ temp = parent;
3206
+ parent = parent.parent
3207
+ }
3208
+ }
3209
+ }
3210
+ let ls = [];
3211
+ for(let i in ds){
3212
+ let parent = this.querySelector("[haveChangesInTbody=" + i + "]",true);
3213
+ let key = parent.attr.haveChangesInTbody;
3214
+ let childToAdd = []
3215
+ let index = null
3216
+ for(let j of ds[i]){
3217
+ childToAdd.push(j.node);
3218
+ index = j.index
3219
+ }
3220
+ let child = parent.child
3221
+ if (index == child.length - 1) {
3222
+ ls = child.concat(childToAdd);
3223
+ }
3224
+ else{
3225
+ ls = (child.slice(0,index)).concat(childToAdd).concat(child.slice(index));
3226
+ }
3227
+ parent.child = []
3228
+ for (let j = 0; j < ls.length;j++){
3229
+ parent.appendChild(ls[j]);
3230
+ }
3231
+ parent.removeAttribute("haveChangesInTbody");
3232
+ }
3233
+ _htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__["default"].processTable(this);
3234
+ if (NodeStruct) {
3235
+ let list = [];
3236
+ list.push(this);
3237
+ while (list.length > 0) {
3238
+ let obj = list.splice(0, 1);
3239
+ if (obj.child) {
3240
+ for (let child of obj.child) {
3241
+ child = new Node(child);
3242
+ list.push(child);
3243
+ }
3244
+ }
3245
+ }
3246
+ }
3247
+ }
3248
+
3249
+ get content(){
3250
+ return this.cont;
3251
+ }
3252
+
3253
+ set content(docFag){
3254
+ this.cont = docFag;
3255
+ docFag._parent = this;
3256
+ }
3257
+
3258
+ get children(){
3259
+ if(this.child){
3260
+ let obj = this.child;
3261
+ let res = [];
3262
+ for(let i=0; i<obj.length; i++){
3263
+ if(obj[i].node== "#element") { res.push(obj[i]) }
3264
+ }
3265
+ return res;
3266
+ }
3267
+ return [];
3268
+ }
3269
+
3270
+ //.childNodes
3271
+ get childNodes(){
3272
+ return this.child;
3273
+ }
3274
+ //.outerObj()
3275
+ get outerObj(){
3276
+ return (this.node!= "#document-fragment")?/*deepCopyNode(*/this/*)*/:undefined;
3277
+ }
3278
+
3279
+ set outerObj(obj){
3280
+ if(obj){
3281
+ let tagName = this.tagName;
3282
+ obj = obj.childNodes;
3283
+ // let obj = htmlToJsObjectLyteRendered.toObject(html, { fromInternal:true, enhanced: true,withoutTableProcessing:true,withoutTemplateConversion:true,hasParentSvg:(tagName == tagName.toLowerCase()),fromSub:true ,Compile: this.__proto__.Compile}).childNodes;
3284
+ if (this.node != "#document-fragment") {
3285
+ let child = this.parent.childNodes;
3286
+ let index = child.indexOf(this);
3287
+ // child = [child.slice(0, index+1),...obj,child.slice(index+1)];
3288
+ let secondHalf = child.slice(index + 1);
3289
+ this.parent.child = child.slice(0, index);
3290
+ for(let i of obj){
3291
+ this.parent.appendChild(deepCopyNode(i,(tagName == tagName.toLowerCase())));
3292
+ }
3293
+ for(let i of secondHalf){
3294
+ this.parent.appendChild(i);
3295
+ }
3296
+ }
3297
+ }
3298
+ }
3299
+ //.outerHTML()
3300
+ get outerHTML(){
3301
+ return (this.node!= "#document-fragment")?_htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__["default"].toHtml(this):undefined;
3302
+ }
3303
+
3304
+ set outerHTML(html){
3305
+ let obj = parseHtmlFromSetter(this, html);
3306
+ if (this.node != "#document-fragment") {
3307
+ let child = this.parent.childNodes;
3308
+ let index = child.indexOf(this);
3309
+ // child = [child.slice(0, index+1),...obj,child.slice(index+1)];
3310
+ let secondHalf = child.slice(index + 1);
3311
+ this.parent.child = child.slice(0, index);
3312
+ for(let i of obj){
3313
+ this.parent.appendChild(i);
3314
+ }
3315
+ for(let i of secondHalf){
3316
+ this.parent.appendChild(i);
3317
+ }
3318
+ }
3319
+ }
3320
+
3321
+ //.innerObj()
3322
+ get innerObj(){
3323
+ let obj = this;
3324
+ obj = (!obj.content) ? obj.childNodes : obj.content.childNodes;
3325
+ return obj;
3326
+ }
3327
+
3328
+ set innerObj(obj){
3329
+ let tagName = this.tagName;
3330
+ if (tagName == "TEMPLATE") {
3331
+ this.content.child = [];
3332
+ if(obj.length != undefined){
3333
+ for(let i of obj){
3334
+ this.content.appendChild(deepCopyNode(i,(tagName == tagName.toLowerCase())));
3335
+ }
3336
+ }
3337
+ else{
3338
+ this.content.appendChild(deepCopyNode(obj,(tagName == tagName.toLowerCase())));
3339
+ }
3340
+ }
3341
+ else {
3342
+ this.child = []
3343
+ if(obj.length != undefined){
3344
+ for(let i of obj){
3345
+ this.appendChild(deepCopyNode(i,(tagName == tagName.toLowerCase())));
3346
+ }
3347
+ }
3348
+ else{
3349
+ this.appendChild(deepCopyNode(obj,(tagName == tagName.toLowerCase())));
3350
+ }
3351
+ }
3352
+ }
3353
+
3354
+ //.innerHTML()
3355
+ get innerHTML(){
3356
+ let res = "";
3357
+ let obj = this;
3358
+ obj = (!obj.content) ? obj.childNodes : obj.content.childNodes;
3359
+ for(let i=0; i<obj.length; i++){
3360
+ res += _htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__["default"].toHtml(obj[i]);
3361
+ }
3362
+ return res;
3363
+ }
3364
+
3365
+ set innerHTML(html){
3366
+ let tagName = this.tagName
3367
+ let obj = parseHtmlFromSetter(this, html);
3368
+ if (tagName == "TEMPLATE" && this.content) {
3369
+ this.content.child = [];
3370
+ this.content.appendChildArr(obj);
3371
+ }
3372
+ else {
3373
+ this.child = []
3374
+ this.appendChildArr(obj);
3375
+ }
3376
+ }
3377
+ prepend(child,deleteInPreviousParent){
3378
+ if (child.parent && child.parent.child && deleteInPreviousParent) {
3379
+ child.remove();
3380
+ }
3381
+ if(child.node == "#document-fragment"){
3382
+ return this.appendChildArr(child.child);
3383
+ }
3384
+ if (this.child && this.child.length) {
3385
+ for(let i of this.child){
3386
+ if(i==child){
3387
+ i.remove();
3388
+ break;
3389
+ }
3390
+ }
3391
+ let next = this.child[0];
3392
+ next.prev = child;
3393
+ child.parent = this;
3394
+ child.prev = null;
3395
+ child.next = next;
3396
+ }
3397
+ else {
3398
+ this.child = [];
3399
+ child.parent = this;
3400
+ child.prev = null;
3401
+ child.next = null;
3402
+ }
3403
+ this.child.unshift(child);
3404
+ if(child){
3405
+ child.setOpt = this._opt;
3406
+ }
3407
+ return this;
3408
+ }
3409
+ //replaceChild()
3410
+ replaceChild(newChild){
3411
+ let oldChild=this;
3412
+ newChild.parent=this.parent;
3413
+ newChild.prev=this.prev;
3414
+ newChild.next=this.next;
3415
+ let index=this.parent.child.indexOf(this);
3416
+ this.parent.child.splice(index,1,newChild);
3417
+ if(this.next)
3418
+ { this.next.prev = newChild; }
3419
+ if(this.prev)
3420
+ { this.prev.next = newChild; }
3421
+
3422
+ newChild.content.appendChild(oldChild);
3423
+ return newChild;
3424
+ }
3425
+ //.appendChild()
3426
+ appendChild(child,deleteInPreviousParent){
3427
+ if (child.parent && child.parent.child && deleteInPreviousParent) {
3428
+ child.remove();
3429
+ }
3430
+ if(child.node == "#document-fragment"){
3431
+ return this.appendChildArr(child.child);
3432
+ }
3433
+ if (this.child && this.child.length) {
3434
+ for(let i of this.child){
3435
+ if(i==child){
3436
+ i.remove();
3437
+ break;
3438
+ }
3439
+ }
3440
+ let prev = this.child[this.child.length-1];
3441
+ child.parent = this;
3442
+ child.prev = prev;
3443
+ child.next = null;
3444
+ prev.next = child;
3445
+ }
3446
+ else {
3447
+ this.child = [];
3448
+ child.parent = this;
3449
+ child.prev = null;
3450
+ child.next = null;
3451
+ }
3452
+ this.child.push(child);
3453
+ if(child){
3454
+ child.setOpt = this._opt;
3455
+ }
3456
+ return this;
3457
+ }
3458
+
3459
+ appendChildArr(childArr){
3460
+ for(let i=0; i<childArr.length;i++){
3461
+ this.appendChild(childArr[i]);
3462
+ }
3463
+ return this;
3464
+ }
3465
+
3466
+ //.hasAttribute()
3467
+ hasAttribute(attr){
3468
+ return (this.attr && this.attr[attr] != undefined)? true : false;
3469
+ }
3470
+
3471
+ //.hasAttributes()
3472
+ hasAttributes(){
3473
+ return (this.attr && Object.keys(this.attr).length > 0) ? true : false;
3474
+ }
3475
+ //.getAttribute()
3476
+ getAttribute(attr){
3477
+ return (this.attr && this.attr[attr] != undefined) ? this.attr[attr] : null;
3478
+ }
3479
+
3480
+ //.hasChildNodes()
3481
+ hasChildNodes(){
3482
+ return (this.childNodes && this.childNodes.length > 0) ? true : false;
3483
+ }
3484
+
3485
+ get firstChild(){
3486
+ return (this.child[0]) ? this.child[0] : null;
3487
+ }
3488
+
3489
+ //.setAttribute()
3490
+ setAttribute(attr,value){
3491
+ if(!this.attr) { this.attr = {}; }
3492
+ if(this._opt && !this._opt.fromInternal && this._opt.withoutTemplateConversion && typeof value == "string"){
3493
+ let singleQuot = value.indexOf("'");
3494
+ let doubleQuot = value.indexOf('"');
3495
+ if (!this.attrType) {
3496
+ this.attrType = { ___attrStart___: {},___nullCheck___:{} };
3497
+ } else if (!this.attrType.___attrStart___) {
3498
+ this.attrType.___attrStart___ = {};
3499
+ }
3500
+ else if(!this.attrType.___nullCheck___){
3501
+ this.attrType.___nullCheck___ = {};
3502
+ }
3503
+ this.attrType.___attrStart___[attr] = singleQuot!=-1 && doubleQuot!=-1 ? undefined : singleQuot!=-1 ? '"' : doubleQuot!=-1 ? "'" : undefined;
3504
+ }
3505
+ if (typeof value == "string" || typeof value == "number") {
3506
+ this.attr[attr] = value.toString();
3507
+ }
3508
+ else{
3509
+ this.attr[attr] =JSON.stringify(value);
3510
+ }
3511
+ return;
3512
+ }
3513
+
3514
+ //.tagName()
3515
+ get tagName(){
3516
+ if(this.tag){
3517
+ let tag = this.tag;
3518
+ if(tag == "svg"){
3519
+ return tag.toLowerCase();
3520
+ }
3521
+ let obj = this;
3522
+ if(!obj.replacedNode){
3523
+ while(obj){
3524
+ if(obj.tag == "svg" || obj.hasParentSvg) { return tag.toLowerCase(); }
3525
+ if(obj.tag =="foreignObject"){
3526
+ break;
3527
+ }
3528
+ obj = obj.parent;
3529
+ }
3530
+ }
3531
+ return tag.toUpperCase();
3532
+ }
3533
+ return null;
3534
+ }
3535
+
3536
+ //.nextSibling()
3537
+ get nextSibling(){
3538
+ return this.next;
3539
+ }
3540
+
3541
+ //.nextElementSibling()
3542
+ get nextElementSibling(){
3543
+ let obj = this.next;
3544
+ while (obj) {
3545
+ if(obj.node == "#element") { return obj; }
3546
+ obj = obj.next;
3547
+ }
3548
+ return null;
3549
+ }
3550
+
3551
+ //.previousSibling()
3552
+ get previousSibling(){
3553
+ return this.prev;
3554
+ }
3555
+
3556
+ //.previousElementSibling()
3557
+ get previousElementSibling(){
3558
+ let obj = this.prev;
3559
+ while(obj){
3560
+ if(obj.node == "#element") { return obj; }
3561
+ obj = obj.prev;
3562
+ }
3563
+ return null;
3564
+ }
3565
+ updateNode(newNode){
3566
+ let parent = this.parent
3567
+ let ind = parent.child.indexOf(this);
3568
+ newNode.prev = this.prev;
3569
+ newNode.next = this.next;
3570
+ newNode.parent = parent;
3571
+ if(this.prev){
3572
+ this.prev.next = newNode;
3573
+ }
3574
+ parent.child.splice(ind,1,newNode)
3575
+ }
3576
+ //.parentElement()
3577
+ get parentElement(){
3578
+ return (this.parent && this.parent.node=="#element")? this.parent : null;
3579
+ }
3580
+
3581
+ //.parentNode()
3582
+ get parentNode(){
3583
+ return this.parent;
3584
+ }
3585
+
3586
+ nodeParentHasSvg() {
3587
+ let obj = this
3588
+ while(obj){
3589
+ if(this.tag == "svg") { return true; }
3590
+ obj = obj.parent;
3591
+ }
3592
+ return false;
3593
+ }
3594
+
3595
+ deepCopyObject(){
3596
+ return new Node(this);
3597
+ }
3598
+ //.nodeName()
3599
+ get nodeName() {
3600
+ let obj = this;
3601
+ if(this.nodeType==2 || this.nodeType == 3){
3602
+ return this.node;
3603
+ }
3604
+ if(obj.node && obj.node!="#document-fragment" && obj.tagName){
3605
+ let node = obj.tagName.toUpperCase();
3606
+ while(obj){
3607
+ if(obj.tag == "svg") { return node.toLowerCase(); }
3608
+ obj = obj.parent;
3609
+ }
3610
+ return node.toUpperCase();
3611
+ }
3612
+ return null;
3613
+ }
3614
+
3615
+ //.nodeType()
3616
+ get nodeType(){
3617
+ let check = {"#element":1,'#text':3,'#comment':8,attr:2,'#document-fragment':11};
3618
+ return check[this.node] || ((this.ownerElement)? 2:undefined);
3619
+ }
3620
+
3621
+ //.nodeValue()
3622
+ get nodeValue(){
3623
+ if(this.nodeType==8 || this.nodeType==3) { return this.text; }
3624
+ if(this.nodeType==2){
3625
+ return this.value;
3626
+ }
3627
+ return null;
3628
+ }
3629
+
3630
+ set nodeValue(textValue){
3631
+ if(this.nodeType == 8 || this.nodeType == 3){
3632
+ this.text = textValue;
3633
+ }
3634
+ if(this.nodeType == 2){
3635
+ this.ownerElement.setAttribute(this.nodeName, textValue);
3636
+ }
3637
+ }
3638
+ //.remove()
3639
+ remove(){
3640
+ let index = this.parent.child.indexOf(this);
3641
+ if(this.prev) {
3642
+ this.prev.next = this.next;
3643
+ }
3644
+ if(this.next) {
3645
+ this.next.prev = this.prev;
3646
+ }
3647
+ this.parent.child.splice(index,1);
3648
+ }
3649
+ get firstElementSibling(){
3650
+ for (let i = 0; i < this.child.length;i++){
3651
+ if(this.child[i].node == "#element"){
3652
+ return this.child[i];
3653
+ }
3654
+ }
3655
+ return undefined;
3656
+ }
3657
+ //.removeAttribute()
3658
+ removeAttribute(attr){
3659
+ if (this.attr) {
3660
+ delete this.attr[attr];
3661
+ }
3662
+ if(this.attr && Object.keys(this.attr).length==0) { delete this.attr; }
3663
+ }
3664
+ //.replaceWith()
3665
+ replaceWith(newNode) {
3666
+ newNode.parent = this.parent;
3667
+ newNode.prev = this.prev;
3668
+ newNode.next = this.next;
3669
+ this.replacedNode = true;
3670
+ newNode.replacedNode = true;
3671
+ let index = this.parent.child.indexOf(this);
3672
+ this.parent.child.splice(index,1,newNode)
3673
+ if(this.next)
3674
+ { this.next.prev = newNode; }
3675
+ if(this.prev)
3676
+ { this.prev.next = newNode; }
3677
+ }
3678
+
3679
+ //.attributes()
3680
+ get attributes(){
3681
+ let attr = this.attr;
3682
+ let res = [];
3683
+ for(let i in attr){
3684
+ res[i] = this.createAttribute(i);
3685
+ res[i].value = (attr[i]) ? attr[i] : "";
3686
+ res.push(res[i]);
3687
+ }
3688
+ return (this.attr)?res:[];
3689
+ }
3690
+
3691
+ //.localName()
3692
+ get localName(){
3693
+ return this.tag?this.tag:null;
3694
+ }
3695
+
3696
+ //.cloneNode()
3697
+ cloneNode(flag){
3698
+ let res={}
3699
+ res = new Node((flag)?deepCopyObject(this):this);
3700
+
3701
+ if(this.attr)
3702
+ { res.attr = Object.assign({},this.attr )};
3703
+ if(this.parent)
3704
+ { res.parent = null; }
3705
+ if(this.prev)
3706
+ { res.prev = null; }
3707
+ if(this.next)
3708
+ { res.next = null; }
3709
+ if(res.tagName == "TEMPLATE" && !flag){
3710
+ res.content = this.createDocumentFragment();
3711
+ }
3712
+ return res;
3713
+ }
3714
+
3715
+ createAttribute(nodeName){
3716
+ let temp = new Node({node:nodeName});
3717
+ temp.value = "";
3718
+ temp.name = nodeName;
3719
+ temp.ownerElement = this
3720
+ return temp;
3721
+ }
3722
+
3723
+ createDocumentFragment(){
3724
+ let node = new Node({ node: "#document-fragment", child: [], cont: [] });
3725
+ setNodeCompile(node, getNodeCompile(this));
3726
+ inheritNodeOpt(this, node);
3727
+ return node;
3728
+ }
3729
+
3730
+ //.createElement()
3731
+ createElement(tag,options = {next:null,prev:null,parent:null,attr:{}}){
3732
+
3733
+ let node = {};
3734
+ if (options.attr)
3735
+ { node = { node: "#element", tag: tag.toLowerCase(), prev: options.prev, next: options.next, parent: options.parent, attr: options.attr }; }
3736
+ else
3737
+ { node = { node: "#element", tag: tag.toLowerCase(), prev: options.prev, next: options.next, parent: options.parent, attr: {} }; }
3738
+
3739
+ if(options.attrType){
3740
+ node.attrType = options.attrType
3741
+ }
3742
+ if (options.errorInfo) {
3743
+ node.errorInfo = options.errorInfo;
3744
+ }
3745
+ node = new Node(node);
3746
+ setNodeCompile(node, getNodeCompile(this));
3747
+ inheritNodeOpt(this, node);
3748
+ if(node.tag == "template"){
3749
+ node.content = this.createDocumentFragment();
3750
+ }else{
3751
+ node.child = [];
3752
+ }
3753
+ return node;
3754
+ }
3755
+ //.createTextNode()
3756
+ createTextNode(text,options = {next:null,prev:null,parent:null}){
3757
+ let node = new Node({node:"#text",prev:options.prev,next:options.next,parent:options.parent,text:text});
3758
+ setNodeCompile(node, getNodeCompile(this));
3759
+ inheritNodeOpt(this, node);
3760
+ node.attrType = options.attrType
3761
+ if(options.lineIndex){
3762
+ node.lineIndex = options.lineIndex;
3763
+ }
3764
+ if(options.colIndex){
3765
+ node.colIndex = options.colIndex;
3766
+ }
3767
+ return node;
3768
+ }
3769
+
3770
+ //.querySelector()
3771
+ findItem(dontCheckTemplate,obj,attr,attrVal,single = 1,tag = undefined){
3772
+ if (dontCheckTemplate && obj.tag == "template" && obj.tagName == "TEMPLATE") {
3773
+ obj = obj.content.child;
3774
+ }
3775
+ else {
3776
+ obj = obj.child;
3777
+ }
3778
+ if (!obj || (obj.attr && obj.attr.dontConsiderForDefault == "true")) { return null; }
3779
+ let res = null;
3780
+ for(let i=0; i<obj.length; i++){
3781
+ if (obj[i].attr && obj[i].attr.dontConsiderForDefault == "true") { continue; }
3782
+ if(single==1 && obj[i].attr && obj[i].attr[attr]==attrVal)
3783
+ { return obj[i]; }
3784
+ if(single==2 && obj[i].attr && this.find(obj[i].attr, attr))
3785
+ { return obj[i]; }
3786
+ if(single==3 && obj[i].tag == attr)
3787
+ { return obj[i]; }
3788
+ if(single==4 && obj[i].attr && obj[i].attr[attr]==attrVal && obj[i].tag == tag)
3789
+ { return obj[i]; }
3790
+ else {
3791
+ res = this.findItem(dontCheckTemplate, obj[i], attr, attrVal, single, tag);
3792
+ }
3793
+ if(res) { break; }
3794
+ }
3795
+ return res;
3796
+ }
3797
+
3798
+ querySelector(selector,dontCheckTemplate=false) {
3799
+ if(selector[0]=='.') { return this.findItem(dontCheckTemplate,this,"class",selector.substring(1)); }
3800
+ else if(selector[0]=='#') { return this.findItem(dontCheckTemplate,this,"id",selector.substring(1)); }
3801
+ else if(selector[0]=='['){
3802
+ if(selector.search('=')!=-1){
3803
+ let searchItem = selector.substring(1,selector.length-1).split("=");
3804
+ let attr = searchItem[0];
3805
+ let attrVal = searchItem[1].replace(/^"+|"+$/g, '');
3806
+ attrVal = attrVal.replace(/^'+|'+$/g, '');
3807
+ return this.findItem(dontCheckTemplate,this,attr,attrVal);
3808
+ }
3809
+ else {
3810
+ let attr = selector.substring(1, selector.length - 1);
3811
+ return this.findItem(dontCheckTemplate,this, attr, null, 2);
3812
+ }
3813
+ }
3814
+ else if(selector.match(/^\w+\[.+=.+]$/gm)){
3815
+ selector = selector.split("[");
3816
+ let tag = selector[0];
3817
+ selector = selector[1].split("=");
3818
+ let attr = selector[0].replace(/^"+|"+$/g, '').replace(/^'+|'+$/g, '');
3819
+ let attrVal = selector[1].substring(0,selector[1].length-1).replace(/^"+|"+$/g, '').replace(/^'+|'+$/g, '');
3820
+
3821
+ return this.findItem(dontCheckTemplate,this, attr, attrVal, 4, tag);
3822
+ }
3823
+ return this.findItem(dontCheckTemplate,this,selector,null,3);
3824
+ }
3825
+
3826
+ find(obj, find){
3827
+ if (obj) {
3828
+ for (let i in obj) {
3829
+ if (i == find) {
3830
+ return true;
3831
+ }
3832
+ }
3833
+ }
3834
+ return false;
3835
+ }
3836
+
3837
+ //.querySelectorAll()
3838
+ findAll(obj,listToCheck,dontCheckTemplate,result = [],depth = 0){
3839
+ if (depth > MAX_DEPTH) {
3840
+ throw new Error("Parse Error: HTML nesting depth exceeds the maximum allowed (" + MAX_DEPTH + ").");
3841
+ }
3842
+ obj = ((obj.tag == "template" && dontCheckTemplate && obj.tagName == "TEMPLATE") ? obj.content.child : obj.child);
3843
+ if(!obj){ return result;}
3844
+ for (let i=0; i<obj.length; i++){
3845
+ for(let lsItem of listToCheck){
3846
+ let {single,_attr,_attrVal,tagName} = lsItem;
3847
+ let tagNameCheck = (tagName==undefined || obj[i].tag==tagName);
3848
+ if(single == 1 && obj[i].attr && obj[i].attr[_attr] == _attrVal && tagNameCheck)
3849
+ { result.push(obj[i]); break; }
3850
+ else if (single == 2 && obj[i].attr && this.find(obj[i].attr, _attr) && tagNameCheck)
3851
+ { result.push(obj[i]); break; }
3852
+ else if(single == 3 && obj[i].tag == tagName)
3853
+ { result.push(obj[i]); break; }
3854
+ }
3855
+ this.findAll(obj[i],listToCheck,dontCheckTemplate,result,depth + 1);
3856
+ }
3857
+ return result;
3858
+ }
3859
+ querySelectorAll(selector,dontCheckTemplate){
3860
+ let multiList = [];
3861
+ if((multiList = selector.split(',')).length>1){
3862
+ for(let index in multiList){
3863
+ multiList[index] = getSelectorType(multiList[index].trim());
3864
+ }
3865
+ return this.findAll(this,multiList,dontCheckTemplate);
3866
+ }
3867
+ return this.findAll(this,[getSelectorType(selector)],dontCheckTemplate);
3868
+ }
3869
+
3870
+ //Cases
3871
+ // let defaultCase = node.querySelectorChildren("[default]")
3872
+ // let isBreak = currentCase.querySelectorChildren("template[is=break]");
3873
+ // let isBreak = dCaseTemplate.querySelectorChildren("template[is=break]");
3874
+
3875
+ querySelectorChildren(string){
3876
+ let children = this.child;
3877
+ if(string.startsWith("#")){
3878
+ return;
3879
+ }else if(string.startsWith("[")){
3880
+ let attrString = string.slice(1,string.length-1)
3881
+ for(let i=0; i<children.length; i++){
3882
+ if(children[i].attr && children[i].attr.hasOwnProperty(attrString)){
3883
+ return children[i];
3884
+ }
3885
+ }
3886
+ }else if(string.indexOf("[") != -1){
3887
+ let arr = string.split("[");
3888
+ let tagName = arr[0];
3889
+ let attrString = arr[1].slice(0,arr[1].length-1);
3890
+ let attrStringArr = attrString.split("=");
3891
+ let attrName = attrStringArr[0];
3892
+ let attrVal = attrStringArr[1];
3893
+ for(let i=0; i<children.length; i++){
3894
+ if(children[i].tag && children[i].tag == tagName){
3895
+ if(children[i].attr[attrName] && children[i].attr[attrName] == attrVal){
3896
+ return children[i];
3897
+ }
3898
+ }
3899
+ }
3900
+ }
3901
+ }
3902
+
3903
+ // Cases
3904
+ // let cases = node.querySelectorAllChildren("[case]")
3905
+ querySelectorAllChildren(string){
3906
+ let children = this.child,
3907
+ output = [];
3908
+ if(string.startsWith("#")){
3909
+ return output;
3910
+ }else if(string.startsWith("[")){
3911
+ let attrString = string.slice(1,string.length-1)
3912
+ for(let i=0; i<children.length; i++){
3913
+ if(children[i].attr && children[i].attr[attrString]){
3914
+ output.push(children[i])
3915
+ }
3916
+ }
3917
+ }
3918
+ return output;
3919
+ }
3920
+ json2html(obj) { return _htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__["default"].toHtml(obj) }
3921
+ }
3922
+
3923
+
3924
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Node);
3925
+
3926
+ /***/ }
3927
+
3928
+ /******/ });
3929
+ /************************************************************************/
3930
+ /******/ // The module cache
3931
+ /******/ const __webpack_module_cache__ = {};
3932
+ /******/
3933
+ /******/ // The require function
3934
+ /******/ function __webpack_require__(moduleId) {
3935
+ /******/ // Check if module is in cache
3936
+ /******/ const cachedModule = __webpack_module_cache__[moduleId];
3937
+ /******/ if (cachedModule !== undefined) {
3938
+ /******/ return cachedModule.exports;
3939
+ /******/ }
3940
+ /******/ // Create a new module (and put it into the cache)
3941
+ /******/ const module = __webpack_module_cache__[moduleId] = {
3942
+ /******/ // no module.id needed
3943
+ /******/ // no module.loaded needed
3944
+ /******/ exports: {}
3945
+ /******/ };
3946
+ /******/
3947
+ /******/ // Execute the module function
3948
+ /******/ if (!(moduleId in __webpack_modules__)) {
3949
+ /******/ delete __webpack_module_cache__[moduleId];
3950
+ /******/ const e = new Error("Cannot find module '" + moduleId + "'");
3951
+ /******/ e.code = 'MODULE_NOT_FOUND';
3952
+ /******/ throw e;
3953
+ /******/ }
3954
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3955
+ /******/
3956
+ /******/ // Return the exports of the module
3957
+ /******/ return module.exports;
3958
+ /******/ }
3959
+ /******/
3960
+ /************************************************************************/
3961
+ /******/ /* webpack/runtime/define property getters */
3962
+ /******/ (() => {
3963
+ /******/ // define getter/value functions for harmony exports
3964
+ /******/ __webpack_require__.d = (exports, definition) => {
3965
+ /******/ if(Array.isArray(definition)) {
3966
+ /******/ var i = 0;
3967
+ /******/ while(i < definition.length) {
3968
+ /******/ var key = definition[i++];
3969
+ /******/ var binding = definition[i++];
3970
+ /******/ if(!__webpack_require__.o(exports, key)) {
3971
+ /******/ if(binding === 0) {
3972
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
3973
+ /******/ } else {
3974
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
3975
+ /******/ }
3976
+ /******/ } else if(binding === 0) { i++; }
3977
+ /******/ }
3978
+ /******/ } else {
3979
+ /******/ for(var key in definition) {
3980
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
3981
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
3982
+ /******/ }
3983
+ /******/ }
3984
+ /******/ }
3985
+ /******/ };
3986
+ /******/ })();
3987
+ /******/
3988
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
3989
+ /******/ (() => {
3990
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
3991
+ /******/ })();
3992
+ /******/
3993
+ /******/ /* webpack/runtime/make namespace object */
3994
+ /******/ (() => {
3995
+ /******/ // define __esModule on exports
3996
+ /******/ __webpack_require__.r = (exports) => {
3997
+ /******/ if(Symbol.toStringTag) {
3998
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3999
+ /******/ }
4000
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
4001
+ /******/ };
4002
+ /******/ })();
4003
+ /******/
4004
+ /************************************************************************/
4005
+ let __webpack_exports__ = {};
4006
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
4007
+ (() => {
4008
+ /*!******************!*\
4009
+ !*** ./index.js ***!
4010
+ \******************/
4011
+ __webpack_require__.r(__webpack_exports__);
4012
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4013
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4014
+ /* harmony export */ });
4015
+ /* harmony import */ var _src_htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/htmlToJsObjectLyteRendered.js */ "./src/htmlToJsObjectLyteRendered.js");
4016
+ /* harmony import */ var _src_decodeHtmlEntities_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./src/decodeHtmlEntities.js */ "./src/decodeHtmlEntities.js");
4017
+
4018
+
4019
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
4020
+ "htmlToJsObjectLyteRendered" : _src_htmlToJsObjectLyteRendered_js__WEBPACK_IMPORTED_MODULE_0__["default"],
4021
+ "decodeHtmlEntities": _src_decodeHtmlEntities_js__WEBPACK_IMPORTED_MODULE_1__["default"]
4022
+ });
4023
+ })();
4024
+
4025
+ this.htmlParser = __webpack_exports__["default"];
4026
+ /******/ })()
4027
+ ;