@progress/telerik-angular-report-viewer 30.26.707 → 31.26.812
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.
- package/dist/cjs/telerik-report-viewer.component.js +1 -1
- package/dist/cjs/telerik-report-viewer.component.js.map +1 -1
- package/dist/dependencies/telerikReportViewer.js +1431 -598
- package/dist/dependencies/telerikReportViewer.kendo.min.js +201 -17
- package/dist/dependencies/telerikReportViewerTemplate.html +4 -4
- package/dist/es/telerik-report-viewer.component.js +1 -1
- package/dist/es/telerik-report-viewer.component.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $ = require("jquery");
|
|
2
2
|
/*
|
|
3
|
-
* TelerikReporting v20.
|
|
3
|
+
* TelerikReporting v20.2.26.812 (https://www.telerik.com/products/reporting.aspx)
|
|
4
4
|
* Copyright 2026 Progress Software EAD. All rights reserved.
|
|
5
5
|
*
|
|
6
6
|
* Telerik Reporting commercial licenses may be obtained at
|
|
@@ -14,7 +14,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
14
14
|
|
|
15
15
|
var dist = {exports: {}};
|
|
16
16
|
|
|
17
|
-
/*! @license DOMPurify 3.4.
|
|
17
|
+
/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
|
|
18
18
|
|
|
19
19
|
var purify_cjs;
|
|
20
20
|
var hasRequiredPurify_cjs;
|
|
@@ -23,22 +23,63 @@ var telerikReportViewer = (function (exports) {
|
|
|
23
23
|
if (hasRequiredPurify_cjs) return purify_cjs;
|
|
24
24
|
hasRequiredPurify_cjs = 1;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
function _arrayLikeToArray(r, a) {
|
|
27
|
+
(null == a || a > r.length) && (a = r.length);
|
|
28
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
29
|
+
return n;
|
|
30
|
+
}
|
|
31
|
+
function _arrayWithHoles(r) {
|
|
32
|
+
if (Array.isArray(r)) return r;
|
|
33
|
+
}
|
|
34
|
+
function _iterableToArrayLimit(r, l) {
|
|
35
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
36
|
+
if (null != t) {
|
|
37
|
+
var e,
|
|
38
|
+
n,
|
|
39
|
+
i,
|
|
40
|
+
u,
|
|
41
|
+
a = [],
|
|
42
|
+
f = true,
|
|
43
|
+
o = false;
|
|
44
|
+
try {
|
|
45
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
46
|
+
} catch (r) {
|
|
47
|
+
o = true, n = r;
|
|
48
|
+
} finally {
|
|
49
|
+
try {
|
|
50
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
51
|
+
} finally {
|
|
52
|
+
if (o) throw n;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return a;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function _nonIterableRest() {
|
|
59
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
60
|
+
}
|
|
61
|
+
function _slicedToArray(r, e) {
|
|
62
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
63
|
+
}
|
|
64
|
+
function _unsupportedIterableToArray(r, a) {
|
|
65
|
+
if (r) {
|
|
66
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
67
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
68
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const entries = Object.entries,
|
|
73
|
+
setPrototypeOf = Object.setPrototypeOf,
|
|
74
|
+
isFrozen = Object.isFrozen,
|
|
75
|
+
getPrototypeOf = Object.getPrototypeOf,
|
|
76
|
+
getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
77
|
+
let freeze = Object.freeze,
|
|
78
|
+
seal = Object.seal,
|
|
79
|
+
create = Object.create; // eslint-disable-line import/no-mutable-exports
|
|
80
|
+
let _ref = typeof Reflect !== 'undefined' && Reflect,
|
|
81
|
+
apply = _ref.apply,
|
|
82
|
+
construct = _ref.construct;
|
|
42
83
|
if (!freeze) {
|
|
43
84
|
freeze = function freeze(x) {
|
|
44
85
|
return x;
|
|
@@ -175,7 +216,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
175
216
|
*/
|
|
176
217
|
function clone(object) {
|
|
177
218
|
const newObject = create(null);
|
|
178
|
-
for (const
|
|
219
|
+
for (const _ref2 of entries(object)) {
|
|
220
|
+
var _ref3 = _slicedToArray(_ref2, 2);
|
|
221
|
+
const property = _ref3[0];
|
|
222
|
+
const value = _ref3[1];
|
|
179
223
|
const isPropertyExist = objectHasOwnProperty(object, property);
|
|
180
224
|
if (isPropertyExist) {
|
|
181
225
|
if (arrayIsArray(value)) {
|
|
@@ -289,15 +333,14 @@ var telerikReportViewer = (function (exports) {
|
|
|
289
333
|
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
290
334
|
const text = freeze(['#text']);
|
|
291
335
|
|
|
292
|
-
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
|
|
293
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
336
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
|
|
337
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-orientation', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
294
338
|
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
295
339
|
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
296
340
|
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
const
|
|
300
|
-
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
341
|
+
const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
|
|
342
|
+
const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
|
|
343
|
+
const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
|
|
301
344
|
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
302
345
|
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
303
346
|
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
@@ -307,30 +350,31 @@ var telerikReportViewer = (function (exports) {
|
|
|
307
350
|
);
|
|
308
351
|
const DOCTYPE_NAME = seal(/^html$/i);
|
|
309
352
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
353
|
+
// Markup-significant character probes used by _sanitizeElements.
|
|
354
|
+
// Shared module-level instances are safe despite the sticky /g flags:
|
|
355
|
+
// unapply() resets lastIndex for RegExp receivers before every call.
|
|
356
|
+
const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
|
|
357
|
+
const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
|
|
358
|
+
const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
|
|
359
|
+
const SELF_CLOSING_TAG = seal(/\/>/i);
|
|
310
360
|
|
|
311
|
-
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
312
|
-
__proto__: null,
|
|
313
|
-
ARIA_ATTR: ARIA_ATTR,
|
|
314
|
-
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
315
|
-
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
316
|
-
DATA_ATTR: DATA_ATTR,
|
|
317
|
-
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
318
|
-
ERB_EXPR: ERB_EXPR,
|
|
319
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
320
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
321
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
322
|
-
TMPLIT_EXPR: TMPLIT_EXPR
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
/* eslint-disable @typescript-eslint/indent */
|
|
326
361
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
327
362
|
const NODE_TYPE = {
|
|
328
363
|
element: 1,
|
|
364
|
+
attribute: 2,
|
|
329
365
|
text: 3,
|
|
366
|
+
cdataSection: 4,
|
|
367
|
+
entityReference: 5,
|
|
368
|
+
// Deprecated
|
|
369
|
+
entityNode: 6,
|
|
330
370
|
// Deprecated
|
|
331
|
-
|
|
371
|
+
processingInstruction: 7,
|
|
332
372
|
comment: 8,
|
|
333
|
-
document: 9
|
|
373
|
+
document: 9,
|
|
374
|
+
documentType: 10,
|
|
375
|
+
documentFragment: 11,
|
|
376
|
+
notation: 12 // Deprecated
|
|
377
|
+
};
|
|
334
378
|
const getGlobal = function getGlobal() {
|
|
335
379
|
return typeof window === 'undefined' ? null : window;
|
|
336
380
|
};
|
|
@@ -385,10 +429,25 @@ var telerikReportViewer = (function (exports) {
|
|
|
385
429
|
uponSanitizeShadowNode: []
|
|
386
430
|
};
|
|
387
431
|
};
|
|
432
|
+
/**
|
|
433
|
+
* Resolve a set-valued configuration option: a fresh set built from
|
|
434
|
+
* cfg[key] when it is an own array property (seeded with a clone of
|
|
435
|
+
* options.base when given, case-normalized via options.transform),
|
|
436
|
+
* the fallback set otherwise.
|
|
437
|
+
*
|
|
438
|
+
* @param cfg the cloned, prototype-free configuration object
|
|
439
|
+
* @param key the configuration property to read
|
|
440
|
+
* @param fallback the set to use when the option is absent or not an array
|
|
441
|
+
* @param options transform and optional base set to merge into
|
|
442
|
+
* @returns the resolved set
|
|
443
|
+
*/
|
|
444
|
+
const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
|
|
445
|
+
return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
|
|
446
|
+
};
|
|
388
447
|
function createDOMPurify() {
|
|
389
448
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
390
449
|
const DOMPurify = root => createDOMPurify(root);
|
|
391
|
-
DOMPurify.version = '3.4.
|
|
450
|
+
DOMPurify.version = '3.4.12';
|
|
392
451
|
DOMPurify.removed = [];
|
|
393
452
|
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
394
453
|
// Not running in a browser, provide a factory function
|
|
@@ -396,28 +455,29 @@ var telerikReportViewer = (function (exports) {
|
|
|
396
455
|
DOMPurify.isSupported = false;
|
|
397
456
|
return DOMPurify;
|
|
398
457
|
}
|
|
399
|
-
let
|
|
400
|
-
document
|
|
401
|
-
} = window;
|
|
458
|
+
let document = window.document;
|
|
402
459
|
const originalDocument = document;
|
|
403
460
|
const currentScript = originalDocument.currentScript;
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
NamedNodeMap
|
|
411
|
-
HTMLFormElement
|
|
412
|
-
DOMParser,
|
|
413
|
-
trustedTypes
|
|
414
|
-
} = window;
|
|
461
|
+
window.DocumentFragment;
|
|
462
|
+
const HTMLTemplateElement = window.HTMLTemplateElement,
|
|
463
|
+
Node = window.Node,
|
|
464
|
+
Element = window.Element,
|
|
465
|
+
NodeFilter = window.NodeFilter,
|
|
466
|
+
_window$NamedNodeMap = window.NamedNodeMap;
|
|
467
|
+
_window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap;
|
|
468
|
+
window.HTMLFormElement;
|
|
469
|
+
const DOMParser = window.DOMParser,
|
|
470
|
+
trustedTypes = window.trustedTypes;
|
|
415
471
|
const ElementPrototype = Element.prototype;
|
|
416
472
|
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
417
473
|
const remove = lookupGetter(ElementPrototype, 'remove');
|
|
418
474
|
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
419
475
|
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
420
476
|
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
477
|
+
const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
|
|
478
|
+
const getAttributes = lookupGetter(ElementPrototype, 'attributes');
|
|
479
|
+
const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
|
|
480
|
+
const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
|
|
421
481
|
// As per issue #47, the web-components registry is inherited by a
|
|
422
482
|
// new document created via createHTMLDocument. As per the spec
|
|
423
483
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -432,33 +492,74 @@ var telerikReportViewer = (function (exports) {
|
|
|
432
492
|
}
|
|
433
493
|
let trustedTypesPolicy;
|
|
434
494
|
let emptyHTML = '';
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
495
|
+
// The instance's own internal Trusted Types policy. Unlike a caller-supplied
|
|
496
|
+
// `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
|
|
497
|
+
// on duplicate policy names — and is the only policy allowed to persist
|
|
498
|
+
// across configurations and survive `clearConfig()`.
|
|
499
|
+
let defaultTrustedTypesPolicy;
|
|
500
|
+
let defaultTrustedTypesPolicyResolved = false;
|
|
501
|
+
// Tracks whether we are already inside a call to the configured Trusted Types
|
|
502
|
+
// policy (`createHTML` or `createScriptURL`). If a supplied policy callback
|
|
503
|
+
// itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
|
|
504
|
+
// re-enter the policy and recurse until the stack overflows. We detect that
|
|
505
|
+
// re-entry and throw a clear, actionable error instead. The guard is shared
|
|
506
|
+
// across both callbacks, because either one re-entering `sanitize` triggers
|
|
507
|
+
// the same unbounded recursion.
|
|
508
|
+
let IN_TRUSTED_TYPES_POLICY = 0;
|
|
509
|
+
const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
|
|
510
|
+
if (IN_TRUSTED_TYPES_POLICY > 0) {
|
|
511
|
+
throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + 'Types" section of the README.');
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const _createTrustedHTML = function _createTrustedHTML(html) {
|
|
515
|
+
_assertNotInTrustedTypesPolicy();
|
|
516
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
517
|
+
try {
|
|
518
|
+
return trustedTypesPolicy.createHTML(html);
|
|
519
|
+
} finally {
|
|
520
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
|
|
524
|
+
_assertNotInTrustedTypesPolicy();
|
|
525
|
+
IN_TRUSTED_TYPES_POLICY++;
|
|
526
|
+
try {
|
|
527
|
+
return trustedTypesPolicy.createScriptURL(scriptUrl);
|
|
528
|
+
} finally {
|
|
529
|
+
IN_TRUSTED_TYPES_POLICY--;
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
// Lazily resolve (and cache) the instance's internal default policy.
|
|
533
|
+
// Resolution is attempted at most once: a successful `createPolicy` cannot be
|
|
534
|
+
// repeated (Trusted Types throws on duplicate names), and a failed or
|
|
535
|
+
// unsupported attempt must not be retried on every parse.
|
|
536
|
+
const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
|
|
537
|
+
if (!defaultTrustedTypesPolicyResolved) {
|
|
538
|
+
defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
539
|
+
defaultTrustedTypesPolicyResolved = true;
|
|
540
|
+
}
|
|
541
|
+
return defaultTrustedTypesPolicy;
|
|
542
|
+
};
|
|
543
|
+
const _document = document,
|
|
544
|
+
implementation = _document.implementation,
|
|
545
|
+
createNodeIterator = _document.createNodeIterator,
|
|
546
|
+
createDocumentFragment = _document.createDocumentFragment,
|
|
547
|
+
getElementsByTagName = _document.getElementsByTagName;
|
|
548
|
+
const importNode = originalDocument.importNode;
|
|
444
549
|
let hooks = _createHooksMap();
|
|
445
550
|
/**
|
|
446
551
|
* Expose whether this browser supports running the full DOMPurify.
|
|
447
552
|
*/
|
|
448
553
|
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
} = EXPRESSIONS;
|
|
459
|
-
let {
|
|
460
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
461
|
-
} = EXPRESSIONS;
|
|
554
|
+
const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,
|
|
555
|
+
ERB_EXPR$1 = ERB_EXPR,
|
|
556
|
+
TMPLIT_EXPR$1 = TMPLIT_EXPR,
|
|
557
|
+
DATA_ATTR$1 = DATA_ATTR,
|
|
558
|
+
ARIA_ATTR$1 = ARIA_ATTR,
|
|
559
|
+
IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,
|
|
560
|
+
ATTR_WHITESPACE$1 = ATTR_WHITESPACE,
|
|
561
|
+
CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
|
|
562
|
+
let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
|
|
462
563
|
/**
|
|
463
564
|
* We consider the elements and attributes below to be safe. Ideally
|
|
464
565
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
@@ -535,6 +636,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
535
636
|
let WHOLE_DOCUMENT = false;
|
|
536
637
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
537
638
|
let SET_CONFIG = false;
|
|
639
|
+
/* Pristine allowlist bindings captured at setConfig() time. On the
|
|
640
|
+
* persistent-config path sanitize() restores the sets from these before
|
|
641
|
+
* the per-walk hook clone-guard, so a hook's in-call widening cannot
|
|
642
|
+
* carry across calls. Null until setConfig() is called; reset by
|
|
643
|
+
* clearConfig(). */
|
|
644
|
+
let SET_CONFIG_ALLOWED_TAGS = null;
|
|
645
|
+
let SET_CONFIG_ALLOWED_ATTR = null;
|
|
538
646
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
539
647
|
* document.body. By default, browsers might move them to document.head */
|
|
540
648
|
let FORCE_BODY = false;
|
|
@@ -577,7 +685,17 @@ var telerikReportViewer = (function (exports) {
|
|
|
577
685
|
let USE_PROFILES = {};
|
|
578
686
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
579
687
|
let FORBID_CONTENTS = null;
|
|
580
|
-
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
688
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
|
|
689
|
+
// <selectedcontent> mirrors the selected <option>'s subtree, cloned by
|
|
690
|
+
// the UA (customizable <select>) — including any on* handlers — and the
|
|
691
|
+
// engine re-mirrors synchronously whenever a removal changes which
|
|
692
|
+
// option/selectedcontent is current, even inside DOMPurify's inert
|
|
693
|
+
// DOMParser document. Hoisting its children on removal re-inserts a fresh
|
|
694
|
+
// mirror target ahead of the walk, which the engine refills, looping
|
|
695
|
+
// forever (DoS) and amplifying output. Dropping its content on removal
|
|
696
|
+
// (rather than hoisting) breaks that cascade; the content is a duplicate
|
|
697
|
+
// of the option, which is sanitized on its own. See campaign-3 F1/F6.
|
|
698
|
+
'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
581
699
|
/* Tags that are safe for data: URIs */
|
|
582
700
|
let DATA_URI_TAGS = null;
|
|
583
701
|
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
@@ -593,8 +711,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
593
711
|
/* Allowed XHTML+XML namespaces */
|
|
594
712
|
let ALLOWED_NAMESPACES = null;
|
|
595
713
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
596
|
-
|
|
597
|
-
let
|
|
714
|
+
const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
715
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
|
|
716
|
+
const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
|
|
717
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
|
|
598
718
|
// Certain elements are allowed in both SVG and HTML
|
|
599
719
|
// namespace. We need to specify them explicitly
|
|
600
720
|
// so that they don't get erroneously deleted from
|
|
@@ -636,14 +756,32 @@ var telerikReportViewer = (function (exports) {
|
|
|
636
756
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
637
757
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
638
758
|
/* Set configuration parameters */
|
|
639
|
-
ALLOWED_TAGS =
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
759
|
+
ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
|
|
760
|
+
transform: transformCaseFunc
|
|
761
|
+
});
|
|
762
|
+
ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
|
|
763
|
+
transform: transformCaseFunc
|
|
764
|
+
});
|
|
765
|
+
ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
|
|
766
|
+
transform: stringToString
|
|
767
|
+
});
|
|
768
|
+
URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
|
|
769
|
+
transform: transformCaseFunc,
|
|
770
|
+
base: DEFAULT_URI_SAFE_ATTRIBUTES
|
|
771
|
+
});
|
|
772
|
+
DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
|
|
773
|
+
transform: transformCaseFunc,
|
|
774
|
+
base: DEFAULT_DATA_URI_TAGS
|
|
775
|
+
});
|
|
776
|
+
FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
|
|
777
|
+
transform: transformCaseFunc
|
|
778
|
+
});
|
|
779
|
+
FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
|
|
780
|
+
transform: transformCaseFunc
|
|
781
|
+
});
|
|
782
|
+
FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
|
|
783
|
+
transform: transformCaseFunc
|
|
784
|
+
});
|
|
647
785
|
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
|
|
648
786
|
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
649
787
|
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
@@ -662,8 +800,8 @@ var telerikReportViewer = (function (exports) {
|
|
|
662
800
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
663
801
|
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
|
|
664
802
|
NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
|
|
665
|
-
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({},
|
|
666
|
-
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({},
|
|
803
|
+
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map
|
|
804
|
+
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map
|
|
667
805
|
const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
|
|
668
806
|
CUSTOM_ELEMENT_HANDLING = create(null);
|
|
669
807
|
if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
|
|
@@ -675,6 +813,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
675
813
|
if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
|
|
676
814
|
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
|
|
677
815
|
}
|
|
816
|
+
seal(CUSTOM_ELEMENT_HANDLING);
|
|
678
817
|
if (SAFE_FOR_TEMPLATES) {
|
|
679
818
|
ALLOW_DATA_ATTR = false;
|
|
680
819
|
}
|
|
@@ -758,6 +897,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
758
897
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
759
898
|
delete FORBID_TAGS.tbody;
|
|
760
899
|
}
|
|
900
|
+
// Re-derive the active Trusted Types policy from this configuration on
|
|
901
|
+
// every parse. The active policy must never be sticky closure state that
|
|
902
|
+
// outlives the config that set it: a caller-supplied policy left in place
|
|
903
|
+
// after `clearConfig()` — or after a later call that supplied none, or
|
|
904
|
+
// `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
|
|
905
|
+
// `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
|
|
906
|
+
// See GHSA-vxr8-fq34-vvx9.
|
|
761
907
|
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
762
908
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
763
909
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
@@ -765,18 +911,45 @@ var telerikReportViewer = (function (exports) {
|
|
|
765
911
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
766
912
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
767
913
|
}
|
|
768
|
-
//
|
|
914
|
+
// A caller-supplied policy applies to this configuration only.
|
|
915
|
+
const previousTrustedTypesPolicy = trustedTypesPolicy;
|
|
769
916
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
770
|
-
// Sign local variables required by `sanitize`.
|
|
771
|
-
|
|
917
|
+
// Sign local variables required by `sanitize`. If the supplied policy's
|
|
918
|
+
// `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
|
|
919
|
+
// throws via the re-entrancy guard. Restore the previous policy first so
|
|
920
|
+
// the instance is not left in a poisoned state. See #1422.
|
|
921
|
+
try {
|
|
922
|
+
emptyHTML = _createTrustedHTML('');
|
|
923
|
+
} catch (error) {
|
|
924
|
+
trustedTypesPolicy = previousTrustedTypesPolicy;
|
|
925
|
+
throw error;
|
|
926
|
+
}
|
|
927
|
+
} else if (cfg.TRUSTED_TYPES_POLICY === null) {
|
|
928
|
+
// Explicit opt-out for this call: perform no Trusted Types signing and
|
|
929
|
+
// create nothing (so a strict `trusted-types` CSP that disallows a
|
|
930
|
+
// `dompurify` policy can still call `sanitize` from inside its own
|
|
931
|
+
// policy — see #1422). Resetting to `undefined` rather than a sticky
|
|
932
|
+
// `null` also drops any previously retained caller policy, so it cannot
|
|
933
|
+
// resurface on a later call, while still allowing the next config-less
|
|
934
|
+
// call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
|
|
935
|
+
trustedTypesPolicy = undefined;
|
|
936
|
+
emptyHTML = '';
|
|
772
937
|
} else {
|
|
773
|
-
//
|
|
938
|
+
// No policy supplied: keep the currently active policy if one is set — a
|
|
939
|
+
// previously supplied policy is intentionally sticky across config-less
|
|
940
|
+
// calls — otherwise fall back to the instance's own internal policy,
|
|
941
|
+
// created at most once. (A policy supplied for a *single* call still
|
|
942
|
+
// lingers by design; what must not linger is a policy whose configuration
|
|
943
|
+
// has been torn down via `clearConfig()`, which restores the default.)
|
|
774
944
|
if (trustedTypesPolicy === undefined) {
|
|
775
|
-
trustedTypesPolicy =
|
|
945
|
+
trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
|
|
776
946
|
}
|
|
777
|
-
//
|
|
778
|
-
|
|
779
|
-
|
|
947
|
+
// Sign internal variables only when a policy is active. A falsy policy
|
|
948
|
+
// (Trusted Types unsupported, creation failed, or an explicit opt-out)
|
|
949
|
+
// leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
|
|
950
|
+
// a non-policy and throw. See #1422.
|
|
951
|
+
if (trustedTypesPolicy && typeof emptyHTML === 'string') {
|
|
952
|
+
emptyHTML = _createTrustedHTML('');
|
|
780
953
|
}
|
|
781
954
|
}
|
|
782
955
|
// Prevent further manipulation of configuration.
|
|
@@ -791,6 +964,77 @@ var telerikReportViewer = (function (exports) {
|
|
|
791
964
|
* correctly. */
|
|
792
965
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
793
966
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
967
|
+
/**
|
|
968
|
+
* Namespace rules for an element in the SVG namespace.
|
|
969
|
+
*
|
|
970
|
+
* @param tagName the element's lowercase tag name
|
|
971
|
+
* @param parent the (possibly simulated) parent node
|
|
972
|
+
* @param parentTagName the parent's lowercase tag name
|
|
973
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
974
|
+
*/
|
|
975
|
+
const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
|
|
976
|
+
// The only way to switch from HTML namespace to SVG
|
|
977
|
+
// is via <svg>. If it happens via any other tag, then
|
|
978
|
+
// it should be killed.
|
|
979
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
980
|
+
return tagName === 'svg';
|
|
981
|
+
}
|
|
982
|
+
// The only way to switch from MathML to SVG is via <svg>
|
|
983
|
+
// if the parent is either <annotation-xml> or a MathML
|
|
984
|
+
// text integration point.
|
|
985
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
986
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
987
|
+
}
|
|
988
|
+
// We only allow elements that are defined in SVG
|
|
989
|
+
// spec. All others are disallowed in SVG namespace.
|
|
990
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
991
|
+
};
|
|
992
|
+
/**
|
|
993
|
+
* Namespace rules for an element in the MathML namespace.
|
|
994
|
+
*
|
|
995
|
+
* @param tagName the element's lowercase tag name
|
|
996
|
+
* @param parent the (possibly simulated) parent node
|
|
997
|
+
* @param parentTagName the parent's lowercase tag name
|
|
998
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
999
|
+
*/
|
|
1000
|
+
const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
|
|
1001
|
+
// The only way to switch from HTML namespace to MathML
|
|
1002
|
+
// is via <math>. If it happens via any other tag, then
|
|
1003
|
+
// it should be killed.
|
|
1004
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
1005
|
+
return tagName === 'math';
|
|
1006
|
+
}
|
|
1007
|
+
// The only way to switch from SVG to MathML is via
|
|
1008
|
+
// <math> and HTML integration points
|
|
1009
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
1010
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
1011
|
+
}
|
|
1012
|
+
// We only allow elements that are defined in MathML
|
|
1013
|
+
// spec. All others are disallowed in MathML namespace.
|
|
1014
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Namespace rules for an element in the HTML namespace.
|
|
1018
|
+
*
|
|
1019
|
+
* @param tagName the element's lowercase tag name
|
|
1020
|
+
* @param parent the (possibly simulated) parent node
|
|
1021
|
+
* @param parentTagName the parent's lowercase tag name
|
|
1022
|
+
* @returns true if a spec-compliant parser could produce this element
|
|
1023
|
+
*/
|
|
1024
|
+
const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
|
|
1025
|
+
// The only way to switch from SVG to HTML is via
|
|
1026
|
+
// HTML integration points, and from MathML to HTML
|
|
1027
|
+
// is via MathML text integration points
|
|
1028
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
1029
|
+
return false;
|
|
1030
|
+
}
|
|
1031
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
// We disallow tags that are specific for MathML
|
|
1035
|
+
// or SVG and should never appear in HTML namespace
|
|
1036
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1037
|
+
};
|
|
794
1038
|
/**
|
|
795
1039
|
* @param element a DOM element whose namespace is being checked
|
|
796
1040
|
* @returns Return false if the element has a
|
|
@@ -813,51 +1057,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
813
1057
|
return false;
|
|
814
1058
|
}
|
|
815
1059
|
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
816
|
-
|
|
817
|
-
// is via <svg>. If it happens via any other tag, then
|
|
818
|
-
// it should be killed.
|
|
819
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
820
|
-
return tagName === 'svg';
|
|
821
|
-
}
|
|
822
|
-
// The only way to switch from MathML to SVG is via`
|
|
823
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
824
|
-
// text integration points.
|
|
825
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
826
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
827
|
-
}
|
|
828
|
-
// We only allow elements that are defined in SVG
|
|
829
|
-
// spec. All others are disallowed in SVG namespace.
|
|
830
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
1060
|
+
return _checkSvgNamespace(tagName, parent, parentTagName);
|
|
831
1061
|
}
|
|
832
1062
|
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
833
|
-
|
|
834
|
-
// is via <math>. If it happens via any other tag, then
|
|
835
|
-
// it should be killed.
|
|
836
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
837
|
-
return tagName === 'math';
|
|
838
|
-
}
|
|
839
|
-
// The only way to switch from SVG to MathML is via
|
|
840
|
-
// <math> and HTML integration points
|
|
841
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
842
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
843
|
-
}
|
|
844
|
-
// We only allow elements that are defined in MathML
|
|
845
|
-
// spec. All others are disallowed in MathML namespace.
|
|
846
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
1063
|
+
return _checkMathMlNamespace(tagName, parent, parentTagName);
|
|
847
1064
|
}
|
|
848
1065
|
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
849
|
-
|
|
850
|
-
// HTML integration points, and from MathML to HTML
|
|
851
|
-
// is via MathML text integration points
|
|
852
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
853
|
-
return false;
|
|
854
|
-
}
|
|
855
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
856
|
-
return false;
|
|
857
|
-
}
|
|
858
|
-
// We disallow tags that are specific for MathML
|
|
859
|
-
// or SVG and should never appear in HTML namespace
|
|
860
|
-
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
1066
|
+
return _checkHtmlNamespace(tagName, parent, parentTagName);
|
|
861
1067
|
}
|
|
862
1068
|
// For XHTML and XML documents that support custom namespaces
|
|
863
1069
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
@@ -882,7 +1088,81 @@ var telerikReportViewer = (function (exports) {
|
|
|
882
1088
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
883
1089
|
getParentNode(node).removeChild(node);
|
|
884
1090
|
} catch (_) {
|
|
1091
|
+
/* The normal detach failed — this is reached for a parentless node
|
|
1092
|
+
(getParentNode() is null, so .removeChild throws). Element.prototype
|
|
1093
|
+
.remove() is itself a spec no-op on a parentless node, so a recorded
|
|
1094
|
+
"removal" would otherwise hand the caller back an intact,
|
|
1095
|
+
payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
|
|
1096
|
+
the style-with-element-child rule decided to kill). Fail closed by
|
|
1097
|
+
throwing — exactly as a clobbered root does at the IN_PLACE entry —
|
|
1098
|
+
rather than trying to "neutralize" the node via its own methods.
|
|
1099
|
+
Neutralizing would mean calling getAttributeNames()/removeAttribute()
|
|
1100
|
+
on the node, both of which a <form> root can clobber via a named child
|
|
1101
|
+
(and _isClobbered does not even probe getAttributeNames), so the
|
|
1102
|
+
neutralize step could itself be silently defeated, leaving the payload
|
|
1103
|
+
intact. A throw touches only the cached, clobber-safe remove() and
|
|
1104
|
+
getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
|
|
1105
|
+
to every root-kill reason. REPORT-3.
|
|
1106
|
+
This lives inside the catch, so it never fires for a normally-removed
|
|
1107
|
+
in-tree node: those have a parent, removeChild() succeeds, and the
|
|
1108
|
+
catch is not entered. Only a kept (parentless) root reaches here. */
|
|
885
1109
|
remove(node);
|
|
1110
|
+
if (!getParentNode(node)) {
|
|
1111
|
+
throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
/**
|
|
1116
|
+
* _neutralizeRoot
|
|
1117
|
+
*
|
|
1118
|
+
* Fail-closed teardown of an in-place root after the sanitize walk aborts
|
|
1119
|
+
* (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
|
|
1120
|
+
* custom element's reaction detaches a node so `_forceRemove`'s deliberate
|
|
1121
|
+
* parentless guard throws, or any other re-entrant engine mutation — would
|
|
1122
|
+
* otherwise leave the caller's *live* tree half-sanitized, with everything
|
|
1123
|
+
* after the abort point still carrying its handlers. There is no safe way
|
|
1124
|
+
* to resume the walk (the tree mutated under us), so we strip the root bare:
|
|
1125
|
+
* remove every child and every attribute, then let the caller's catch see
|
|
1126
|
+
* the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
|
|
1127
|
+
* getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
|
|
1128
|
+
*
|
|
1129
|
+
* @param root the in-place root to empty
|
|
1130
|
+
*/
|
|
1131
|
+
const _neutralizeRoot = function _neutralizeRoot(root) {
|
|
1132
|
+
/* Strip every disallowed attribute (on* handlers included) off the whole
|
|
1133
|
+
subtree BEFORE detaching anything. Detaching first would hand back
|
|
1134
|
+
handler-bearing originals (e.g. an already-loading `<img onerror>`)
|
|
1135
|
+
whose queued resource event still fires in page scope after we throw.
|
|
1136
|
+
Clobber-safe reads; a doomed clobbered node's own attributes are
|
|
1137
|
+
irrelevant while its non-clobbered descendants are reached and scrubbed. */
|
|
1138
|
+
_neutralizeSubtree(root);
|
|
1139
|
+
const childNodes = getChildNodes(root);
|
|
1140
|
+
if (childNodes) {
|
|
1141
|
+
const snapshot = [];
|
|
1142
|
+
arrayForEach(childNodes, child => {
|
|
1143
|
+
arrayPush(snapshot, child);
|
|
1144
|
+
});
|
|
1145
|
+
arrayForEach(snapshot, child => {
|
|
1146
|
+
try {
|
|
1147
|
+
remove(child);
|
|
1148
|
+
} catch (_) {
|
|
1149
|
+
/* Best-effort teardown; a still-attached child is handled below */
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
const attributes = getAttributes(root);
|
|
1154
|
+
if (attributes) {
|
|
1155
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1156
|
+
const attribute = attributes[i];
|
|
1157
|
+
const name = attribute && attribute.name;
|
|
1158
|
+
if (typeof name === 'string') {
|
|
1159
|
+
try {
|
|
1160
|
+
root.removeAttribute(name);
|
|
1161
|
+
} catch (_) {
|
|
1162
|
+
/* Clobbered removeAttribute — ignore (fail-closed best effort) */
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
886
1166
|
}
|
|
887
1167
|
};
|
|
888
1168
|
/**
|
|
@@ -917,6 +1197,148 @@ var telerikReportViewer = (function (exports) {
|
|
|
917
1197
|
}
|
|
918
1198
|
}
|
|
919
1199
|
};
|
|
1200
|
+
/**
|
|
1201
|
+
* _stripDisallowedAttributes
|
|
1202
|
+
*
|
|
1203
|
+
* Removes every attribute the active configuration does not allow from a
|
|
1204
|
+
* single element, using the same allowlist as the main attribute pass (so
|
|
1205
|
+
* `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
|
|
1206
|
+
* neutralise nodes that are being discarded from an in-place tree.
|
|
1207
|
+
*
|
|
1208
|
+
* @param element the element to strip
|
|
1209
|
+
*/
|
|
1210
|
+
const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
|
|
1211
|
+
const attributes = getAttributes(element);
|
|
1212
|
+
if (!attributes) {
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
for (let i = attributes.length - 1; i >= 0; --i) {
|
|
1216
|
+
const attribute = attributes[i];
|
|
1217
|
+
const name = attribute && attribute.name;
|
|
1218
|
+
if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
try {
|
|
1222
|
+
element.removeAttribute(name);
|
|
1223
|
+
} catch (_) {
|
|
1224
|
+
/* Clobbered removeAttribute on a doomed node — ignore */
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
/**
|
|
1229
|
+
* _neutralizeSubtree
|
|
1230
|
+
*
|
|
1231
|
+
* Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
|
|
1232
|
+
* move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
|
|
1233
|
+
* namespace, comment, processing-instruction and KEEP_CONTENT:false removals
|
|
1234
|
+
* all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
|
|
1235
|
+
* those dropped nodes are detached from the caller's LIVE tree but a
|
|
1236
|
+
* handler-bearing original among them (an `<img onerror>`/`<video>` that was
|
|
1237
|
+
* loading) keeps its queued resource event, which fires in page scope after
|
|
1238
|
+
* sanitize returns. This walks a removed subtree and strips every attribute
|
|
1239
|
+
* the active configuration does not allow — so `on*` handlers are cancelled
|
|
1240
|
+
* through the SAME allowlist that governs kept nodes, not a separate `/^on/`
|
|
1241
|
+
* blocklist. Run synchronously before sanitize returns, i.e. before any
|
|
1242
|
+
* queued event can fire. Hook-free by design: these nodes leave the output,
|
|
1243
|
+
* so firing attribute hooks for them would be surprising. Clobber-safe reads;
|
|
1244
|
+
* a doomed clobbered node may shadow `removeAttribute` (its own attributes are
|
|
1245
|
+
* irrelevant — it is discarded — while its non-clobbered descendants, e.g.
|
|
1246
|
+
* the `<img>`, are reached and scrubbed).
|
|
1247
|
+
*
|
|
1248
|
+
* @param root the root of a removed subtree to neutralise
|
|
1249
|
+
*/
|
|
1250
|
+
const _neutralizeSubtree = function _neutralizeSubtree(root) {
|
|
1251
|
+
const stack = [root];
|
|
1252
|
+
while (stack.length > 0) {
|
|
1253
|
+
const node = stack.pop();
|
|
1254
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1255
|
+
if (nodeType === NODE_TYPE.element) {
|
|
1256
|
+
_stripDisallowedAttributes(node);
|
|
1257
|
+
}
|
|
1258
|
+
const childNodes = getChildNodes(node);
|
|
1259
|
+
if (childNodes) {
|
|
1260
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1261
|
+
stack.push(childNodes[i]);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
/**
|
|
1267
|
+
* _neutralizePatchLinkage
|
|
1268
|
+
*
|
|
1269
|
+
* IN_PLACE entry pre-pass (declarative-partial-updates / streaming
|
|
1270
|
+
* hardening, https://github.com/WICG/declarative-partial-updates).
|
|
1271
|
+
*
|
|
1272
|
+
* The main walk strips patch linkage (`for`/`patchsrc`) and removes range
|
|
1273
|
+
* markers (PIs / markup comments) node-by-node, in document order, AS it
|
|
1274
|
+
* reaches each node. On a live in-place root that leaves a window: from the
|
|
1275
|
+
* moment the root is connected until the walk arrives at a given node, that
|
|
1276
|
+
* node's linkage is live. A patch applied on connection/stream can fire as
|
|
1277
|
+
* a microtask during the walk and inject or teleport an unsanitized DOM
|
|
1278
|
+
* range into a region the iterator has already passed and will not revisit,
|
|
1279
|
+
* so the post-return "tree is sanitized" contract is violated. Sweep the
|
|
1280
|
+
* whole tree once up front and sever every linkage before the walk begins,
|
|
1281
|
+
* closing that window.
|
|
1282
|
+
*
|
|
1283
|
+
* This CANNOT undo a patch that already fired before sanitize ran — that is
|
|
1284
|
+
* the irreducible "do not IN_PLACE a live-connected attacker tree" caveat —
|
|
1285
|
+
* but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML
|
|
1286
|
+
* to group with the rest of the declarative-partial-updates handling and
|
|
1287
|
+
* stay overridable, consistent with the codebase.
|
|
1288
|
+
*
|
|
1289
|
+
* Clobber-safe traversal (cached childNodes getter); per-node try/catch so a
|
|
1290
|
+
* clobbered root cannot defeat the sweep of its non-clobbered descendants.
|
|
1291
|
+
*
|
|
1292
|
+
* NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe
|
|
1293
|
+
* .html Q1): this mirrors the existing policy of keeping `for` on
|
|
1294
|
+
* <label>/<output>. If the shipping feature can drive a patch through a
|
|
1295
|
+
* surviving `for`-on-label/output + `id` pair, this pre-pass and the
|
|
1296
|
+
* attribute check at _isBasicCustomElement's caller must additionally drop
|
|
1297
|
+
* that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.
|
|
1298
|
+
*
|
|
1299
|
+
* @param root the in-place root to sweep
|
|
1300
|
+
*/
|
|
1301
|
+
const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
|
|
1302
|
+
if (!SAFE_FOR_XML) {
|
|
1303
|
+
return;
|
|
1304
|
+
}
|
|
1305
|
+
const stack = [root];
|
|
1306
|
+
while (stack.length > 0) {
|
|
1307
|
+
const node = stack.pop();
|
|
1308
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
1309
|
+
/* Remove range markers (the target side of a patch linkage): every
|
|
1310
|
+
processing instruction, and any markup-bearing comment. */
|
|
1311
|
+
if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
|
|
1312
|
+
try {
|
|
1313
|
+
remove(node);
|
|
1314
|
+
} catch (_) {
|
|
1315
|
+
/* Best-effort */
|
|
1316
|
+
}
|
|
1317
|
+
continue;
|
|
1318
|
+
}
|
|
1319
|
+
/* Strip patch-source attributes (the source side) off elements. */
|
|
1320
|
+
if (nodeType === NODE_TYPE.element) {
|
|
1321
|
+
const element = node;
|
|
1322
|
+
const lcTag = transformCaseFunc(getNodeName ? getNodeName(node) : node.nodeName);
|
|
1323
|
+
try {
|
|
1324
|
+
if (element.hasAttribute && element.hasAttribute('patchsrc')) {
|
|
1325
|
+
element.removeAttribute('patchsrc');
|
|
1326
|
+
}
|
|
1327
|
+
if (element.hasAttribute && element.hasAttribute('for') && lcTag !== 'label' && lcTag !== 'output') {
|
|
1328
|
+
element.removeAttribute('for');
|
|
1329
|
+
}
|
|
1330
|
+
} catch (_) {
|
|
1331
|
+
/* Clobbered removeAttribute/hasAttribute on a doomed node — ignore */
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
const childNodes = getChildNodes(node);
|
|
1335
|
+
if (childNodes) {
|
|
1336
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
1337
|
+
stack.push(childNodes[i]);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
920
1342
|
/**
|
|
921
1343
|
* _initDocument
|
|
922
1344
|
*
|
|
@@ -938,7 +1360,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
938
1360
|
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
939
1361
|
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
940
1362
|
}
|
|
941
|
-
const dirtyPayload = trustedTypesPolicy ?
|
|
1363
|
+
const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
|
|
942
1364
|
/*
|
|
943
1365
|
* Use the DOMParser API by default, fallback later if needs be
|
|
944
1366
|
* DOMParser not work for svg when has multiple root element.
|
|
@@ -978,29 +1400,260 @@ var telerikReportViewer = (function (exports) {
|
|
|
978
1400
|
// eslint-disable-next-line no-bitwise
|
|
979
1401
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
980
1402
|
};
|
|
1403
|
+
/**
|
|
1404
|
+
* Replace template expression syntax (mustache, ERB, template
|
|
1405
|
+
* literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
|
|
1406
|
+
* sites. Order matters: mustache, then ERB, then template literal.
|
|
1407
|
+
*
|
|
1408
|
+
* @param value the string to scrub
|
|
1409
|
+
* @returns the scrubbed string
|
|
1410
|
+
*/
|
|
1411
|
+
const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
|
|
1412
|
+
value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
|
|
1413
|
+
value = stringReplace(value, ERB_EXPR$1, ' ');
|
|
1414
|
+
value = stringReplace(value, TMPLIT_EXPR$1, ' ');
|
|
1415
|
+
return value;
|
|
1416
|
+
};
|
|
1417
|
+
/**
|
|
1418
|
+
* Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
|
|
1419
|
+
* character data of an element subtree. Used as the final safety net for
|
|
1420
|
+
* SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
|
|
1421
|
+
* which only form after text-node normalization (e.g. fragments split across
|
|
1422
|
+
* stripped elements) cannot survive into a template-evaluating framework.
|
|
1423
|
+
*
|
|
1424
|
+
* Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
|
|
1425
|
+
* in place rather than round-tripping through innerHTML. This preserves
|
|
1426
|
+
* descendant node references (important for IN_PLACE callers), avoids a
|
|
1427
|
+
* serialize/reparse cycle, and reads literal character data — which means
|
|
1428
|
+
* `<%...%>` in text content matches the ERB regex against its real bytes
|
|
1429
|
+
* instead of the HTML-entity-escaped form innerHTML would produce.
|
|
1430
|
+
*
|
|
1431
|
+
* Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
|
|
1432
|
+
* attributes is performed during the per-node `_sanitizeAttributes` pass.
|
|
1433
|
+
*
|
|
1434
|
+
* @param node The root element whose character data should be scrubbed.
|
|
1435
|
+
*/
|
|
1436
|
+
const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
|
|
1437
|
+
var _node$querySelectorAl;
|
|
1438
|
+
node.normalize();
|
|
1439
|
+
const walker = createNodeIterator.call(node.ownerDocument || node, node,
|
|
1440
|
+
// eslint-disable-next-line no-bitwise
|
|
1441
|
+
NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
|
|
1442
|
+
let currentNode = walker.nextNode();
|
|
1443
|
+
while (currentNode) {
|
|
1444
|
+
currentNode.data = _stripTemplateExpressions(currentNode.data);
|
|
1445
|
+
currentNode = walker.nextNode();
|
|
1446
|
+
}
|
|
1447
|
+
// NodeIterator does not descend into <template>.content per the DOM spec,
|
|
1448
|
+
// so we must explicitly recurse into each template's content fragment,
|
|
1449
|
+
// mirroring the approach used by _sanitizeShadowDOM.
|
|
1450
|
+
const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
|
|
1451
|
+
if (templates) {
|
|
1452
|
+
arrayForEach(templates, tmpl => {
|
|
1453
|
+
if (_isDocumentFragment(tmpl.content)) {
|
|
1454
|
+
_scrubTemplateExpressions2(tmpl.content);
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
981
1459
|
/**
|
|
982
1460
|
* _isClobbered
|
|
983
1461
|
*
|
|
1462
|
+
* Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
|
|
1463
|
+
* interface with [LegacyOverrideBuiltIns]; a descendant element with a
|
|
1464
|
+
* `name` attribute matching a prototype property shadows that property
|
|
1465
|
+
* on direct reads. We use this check at the IN_PLACE entry-point and
|
|
1466
|
+
* during attribute sanitization to refuse clobbered forms.
|
|
1467
|
+
*
|
|
984
1468
|
* @param element element to check for clobbering attacks
|
|
985
1469
|
* @return true if clobbered, false if safe
|
|
986
1470
|
*/
|
|
987
1471
|
const _isClobbered = function _isClobbered(element) {
|
|
988
|
-
|
|
1472
|
+
// Realm-independent tag-name probe. If we can't determine the tag
|
|
1473
|
+
// name at all, we can't reason about clobbering — return false
|
|
1474
|
+
// (the caller's other defences still apply).
|
|
1475
|
+
const realTagName = getNodeName ? getNodeName(element) : null;
|
|
1476
|
+
if (typeof realTagName !== 'string') {
|
|
1477
|
+
return false;
|
|
1478
|
+
}
|
|
1479
|
+
if (transformCaseFunc(realTagName) !== 'form') {
|
|
1480
|
+
return false;
|
|
1481
|
+
}
|
|
1482
|
+
return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
|
|
1483
|
+
// Realm-safe NamedNodeMap detection: equality against the cached
|
|
1484
|
+
// prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
|
|
1485
|
+
// makes the direct read diverge from the cached read; a clean form
|
|
1486
|
+
// (same-realm OR foreign-realm) has both reads pointing at the same
|
|
1487
|
+
// canonical NamedNodeMap.
|
|
1488
|
+
element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
|
|
1489
|
+
// NodeType clobbering probe. Cached Node.prototype.nodeType getter
|
|
1490
|
+
// returns the integer 1 for any Element regardless of realm; direct
|
|
1491
|
+
// read on a clobbered form (e.g. <input name="nodeType">) returns
|
|
1492
|
+
// the named child element. Cheap addition — nodeType is read from
|
|
1493
|
+
// an internal slot, no serialization cost — and removes a residual
|
|
1494
|
+
// clobbering surface used by several mXSS / PI / comment branches
|
|
1495
|
+
// in _sanitizeElements that compare currentNode.nodeType directly.
|
|
1496
|
+
element.nodeType !== getNodeType(element) ||
|
|
1497
|
+
// HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
|
|
1498
|
+
// "childNodes" shadows the prototype getter. Direct reads of
|
|
1499
|
+
// form.childNodes from a clobbered form return the named child
|
|
1500
|
+
// instead of the real NodeList, so any walk that reads it directly
|
|
1501
|
+
// skips the form's real children. Compare the direct read to the
|
|
1502
|
+
// cached Node.prototype getter — when the form's named-property
|
|
1503
|
+
// getter intercepts the read, the two values differ and we flag
|
|
1504
|
+
// the form. This catches every clobbering child type (input,
|
|
1505
|
+
// select, etc.) regardless of whether the named child happens to
|
|
1506
|
+
// carry a numeric .length, which a typeof-based probe would miss
|
|
1507
|
+
// (e.g. HTMLSelectElement.length is a defined unsigned-long).
|
|
1508
|
+
element.childNodes !== getChildNodes(element);
|
|
1509
|
+
};
|
|
1510
|
+
/**
|
|
1511
|
+
* Checks whether the given value is a DocumentFragment from any realm.
|
|
1512
|
+
*
|
|
1513
|
+
* The realm-independent replacement reads `nodeType` through the cached
|
|
1514
|
+
* Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
|
|
1515
|
+
* constant (11). nodeType is a numeric value resolved from the node's
|
|
1516
|
+
* internal slot, identical across realms for the same kind of node.
|
|
1517
|
+
*
|
|
1518
|
+
* @param value object to check
|
|
1519
|
+
* @return true if value is a DocumentFragment-shaped node from any realm
|
|
1520
|
+
*/
|
|
1521
|
+
const _isDocumentFragment = function _isDocumentFragment(value) {
|
|
1522
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
1523
|
+
return false;
|
|
1524
|
+
}
|
|
1525
|
+
try {
|
|
1526
|
+
return getNodeType(value) === NODE_TYPE.documentFragment;
|
|
1527
|
+
} catch (_) {
|
|
1528
|
+
return false;
|
|
1529
|
+
}
|
|
989
1530
|
};
|
|
990
1531
|
/**
|
|
991
|
-
* Checks whether the given object is a DOM node
|
|
1532
|
+
* Checks whether the given object is a DOM node, including nodes that
|
|
1533
|
+
* originate from a different window/realm (e.g. an iframe's
|
|
1534
|
+
* contentDocument). The previous `value instanceof Node` check was
|
|
1535
|
+
* realm-bound: nodes from a different window failed it, causing
|
|
1536
|
+
* sanitize() to silently stringify them and reset IN_PLACE to false,
|
|
1537
|
+
* returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
|
|
992
1538
|
*
|
|
993
1539
|
* @param value object to check whether it's a DOM node
|
|
994
|
-
* @return true
|
|
1540
|
+
* @return true if value is a DOM node from any realm
|
|
995
1541
|
*/
|
|
996
1542
|
const _isNode = function _isNode(value) {
|
|
997
|
-
|
|
1543
|
+
if (!getNodeType || typeof value !== 'object' || value === null) {
|
|
1544
|
+
return false;
|
|
1545
|
+
}
|
|
1546
|
+
try {
|
|
1547
|
+
return typeof getNodeType(value) === 'number';
|
|
1548
|
+
} catch (_) {
|
|
1549
|
+
return false;
|
|
1550
|
+
}
|
|
998
1551
|
};
|
|
999
1552
|
function _executeHooks(hooks, currentNode, data) {
|
|
1553
|
+
if (hooks.length === 0) {
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1000
1556
|
arrayForEach(hooks, hook => {
|
|
1001
1557
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
1002
1558
|
});
|
|
1003
1559
|
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Structural-threat checks that condemn a node regardless of the
|
|
1562
|
+
* allowlists: mXSS via namespace confusion, risky CSS construction,
|
|
1563
|
+
* processing instructions, markup-bearing comments. Pure predicate;
|
|
1564
|
+
* the caller removes. Check order is load-bearing.
|
|
1565
|
+
*
|
|
1566
|
+
* @param currentNode the node to inspect
|
|
1567
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1568
|
+
* @return true if the node must be removed
|
|
1569
|
+
*/
|
|
1570
|
+
const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
|
|
1571
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
|
1572
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
|
|
1573
|
+
return true;
|
|
1574
|
+
}
|
|
1575
|
+
/* Remove risky CSS construction leading to mXSS */
|
|
1576
|
+
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
|
|
1577
|
+
return true;
|
|
1578
|
+
}
|
|
1579
|
+
/* Remove any occurrence of processing instructions */
|
|
1580
|
+
if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
|
|
1581
|
+
return true;
|
|
1582
|
+
}
|
|
1583
|
+
/* Remove any kind of possibly harmful comments */
|
|
1584
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
|
|
1585
|
+
return true;
|
|
1586
|
+
}
|
|
1587
|
+
return false;
|
|
1588
|
+
};
|
|
1589
|
+
/**
|
|
1590
|
+
* Handle a node whose tag is forbidden or not allowlisted: keep
|
|
1591
|
+
* allowed custom elements (false return exits _sanitizeElements
|
|
1592
|
+
* early - the namespace and fallback-tag removal checks are
|
|
1593
|
+
* intentionally skipped for kept custom elements), else hoist
|
|
1594
|
+
* content per KEEP_CONTENT and remove.
|
|
1595
|
+
*
|
|
1596
|
+
* A kept custom element is the ONLY case in which this function
|
|
1597
|
+
* returns false, so the caller uses that return value to run the
|
|
1598
|
+
* afterSanitizeElements hook on the kept element and keep the
|
|
1599
|
+
* element-hook lifecycle consistent with normal allowlisted
|
|
1600
|
+
* elements (GHSA-c2j3-45gr-mqc4).
|
|
1601
|
+
*
|
|
1602
|
+
* @param currentNode the disallowed node
|
|
1603
|
+
* @param tagName the node's transformCaseFunc'd tag name
|
|
1604
|
+
* @return true if the node was removed, false if kept
|
|
1605
|
+
*/
|
|
1606
|
+
const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName) {
|
|
1607
|
+
/* Check if we have a custom element to handle */
|
|
1608
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
1609
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
1610
|
+
return false;
|
|
1611
|
+
}
|
|
1612
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
1613
|
+
return false;
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
/* Keep content except for bad-listed elements.
|
|
1617
|
+
Use the cached prototype getters exclusively — the previous code
|
|
1618
|
+
had `|| currentNode.parentNode` / `|| currentNode.childNodes`
|
|
1619
|
+
fallbacks, but the cached getters always return the canonical
|
|
1620
|
+
value (or null for a real parent-less node), so the fallback
|
|
1621
|
+
path was dead in safe cases and a clobbering surface in unsafe
|
|
1622
|
+
ones. Falsy cached results stay falsy; the `if (childNodes &&
|
|
1623
|
+
parentNode)` check already gates correctly. */
|
|
1624
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
1625
|
+
const parentNode = getParentNode(currentNode);
|
|
1626
|
+
const childNodes = getChildNodes(currentNode);
|
|
1627
|
+
if (childNodes && parentNode) {
|
|
1628
|
+
const childCount = childNodes.length;
|
|
1629
|
+
/* In-place: hoist the *original* children so the iterator visits
|
|
1630
|
+
and sanitises them through the same allowlist pass as every other
|
|
1631
|
+
node. The caller built the tree in the live document, so the
|
|
1632
|
+
originals carry already-queued resource events (`<img onerror>`,
|
|
1633
|
+
`<video>`/`<audio>` error, lazy/`onload`, …); cloning would leave
|
|
1634
|
+
those originals detached but still armed, firing in page scope
|
|
1635
|
+
while the returned tree looked clean. Moving is safe in-place: the
|
|
1636
|
+
root is pre-validated as an allowed tag and so is never the node
|
|
1637
|
+
being removed, which keeps `parentNode` inside the iterator root
|
|
1638
|
+
and the relocated child inside the serialised tree.
|
|
1639
|
+
Otherwise (string / DOM-copy paths): clone. The iterator is rooted
|
|
1640
|
+
at — and the result serialised from — `body`, so a restrictive
|
|
1641
|
+
ALLOWED_TAGS that removes `body` itself must leave its content in
|
|
1642
|
+
place, which only cloning does; and those paths parse into an
|
|
1643
|
+
inert document, so their discarded originals never had a queued
|
|
1644
|
+
event to neutralise.
|
|
1645
|
+
`childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
|
|
1646
|
+
valid whether we move (drops the trailing entry) or clone (leaves
|
|
1647
|
+
the list intact). */
|
|
1648
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
1649
|
+
const hoisted = IN_PLACE ? childNodes[i] : cloneNode(childNodes[i], true);
|
|
1650
|
+
parentNode.insertBefore(hoisted, getNextSibling(currentNode));
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
_forceRemove(currentNode);
|
|
1655
|
+
return true;
|
|
1656
|
+
};
|
|
1004
1657
|
/**
|
|
1005
1658
|
* _sanitizeElements
|
|
1006
1659
|
*
|
|
@@ -1010,85 +1663,89 @@ var telerikReportViewer = (function (exports) {
|
|
|
1010
1663
|
* @param currentNode to check for permission to exist
|
|
1011
1664
|
* @return true if node was killed, false if left alive
|
|
1012
1665
|
*/
|
|
1013
|
-
|
|
1014
|
-
|
|
1666
|
+
// eslint-disable-next-line complexity
|
|
1667
|
+
const _sanitizeElements = function _sanitizeElements(currentNode, root) {
|
|
1015
1668
|
/* Execute a hook if present */
|
|
1016
1669
|
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
1670
|
+
/* A hook may have detached the node — treat it as removed (see the
|
|
1671
|
+
detached-node comment after the uponSanitizeElement hook below). */
|
|
1672
|
+
if (currentNode !== root && getParentNode(currentNode) === null) {
|
|
1673
|
+
return true;
|
|
1674
|
+
}
|
|
1017
1675
|
/* Check if element is clobbered or can clobber */
|
|
1018
1676
|
if (_isClobbered(currentNode)) {
|
|
1019
1677
|
_forceRemove(currentNode);
|
|
1020
1678
|
return true;
|
|
1021
1679
|
}
|
|
1022
1680
|
/* Now let's check the element's type and name */
|
|
1023
|
-
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
1681
|
+
const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
|
|
1024
1682
|
/* Execute a hook if present */
|
|
1025
1683
|
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
1026
1684
|
tagName,
|
|
1027
1685
|
allowedTags: ALLOWED_TAGS
|
|
1028
1686
|
});
|
|
1029
|
-
/*
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1687
|
+
/* A hook may have detached the node from the tree — a long-standing
|
|
1688
|
+
user pattern (issue #469; draw.io-style foreignObject filtering).
|
|
1689
|
+
Per the cached, unclobberable parentNode getter the node is
|
|
1690
|
+
genuinely out of the tree, so it can reach neither the serialized
|
|
1691
|
+
output nor an IN_PLACE live tree; treat it as removed and stop
|
|
1692
|
+
processing it. Without this guard, the unsafe-node / namespace
|
|
1693
|
+
checks below would call _forceRemove on a parentless node and hit
|
|
1694
|
+
the REPORT-3 fail-closed throw — which exists for nodes DOMPurify
|
|
1695
|
+
wants gone but *cannot* detach (clobbered / parentless roots), the
|
|
1696
|
+
opposite of a node that is already safely gone. The walk root is
|
|
1697
|
+
exempt: a detached IN_PLACE root is legitimate input and must still
|
|
1698
|
+
be fully sanitized, and a kill-decision on it must keep hitting the
|
|
1699
|
+
REPORT-3 throw. Nodes detached by hooks are the hook's
|
|
1700
|
+
responsibility: they are not recorded in DOMPurify.removed and are
|
|
1701
|
+
not neutralized by the post-walk IN_PLACE pass. */
|
|
1702
|
+
if (currentNode !== root && getParentNode(currentNode) === null) {
|
|
1042
1703
|
return true;
|
|
1043
1704
|
}
|
|
1044
|
-
/* Remove
|
|
1045
|
-
if (
|
|
1705
|
+
/* Remove mXSS vectors, processing instructions and risky comments */
|
|
1706
|
+
if (_isUnsafeNode(currentNode, tagName)) {
|
|
1046
1707
|
_forceRemove(currentNode);
|
|
1047
1708
|
return true;
|
|
1048
1709
|
}
|
|
1049
1710
|
/* Remove element if anything forbids its presence */
|
|
1050
1711
|
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
const childCount = childNodes.length;
|
|
1066
|
-
for (let i = childCount - 1; i >= 0; --i) {
|
|
1067
|
-
const childClone = cloneNode(childNodes[i], true);
|
|
1068
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1712
|
+
const removed = _sanitizeDisallowedNode(currentNode, tagName);
|
|
1713
|
+
/* A false return means the node is a custom element kept via
|
|
1714
|
+
CUSTOM_ELEMENT_HANDLING - the only keep path through
|
|
1715
|
+
_sanitizeDisallowedNode. Run afterSanitizeElements on it so the
|
|
1716
|
+
element-hook lifecycle matches normal allowlisted elements: a
|
|
1717
|
+
security policy applied in this hook (e.g. stripping an attribute
|
|
1718
|
+
from every surviving element) must not silently skip kept custom
|
|
1719
|
+
elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element
|
|
1720
|
+
tail below - the hook runs, then the walker's subsequent
|
|
1721
|
+
_sanitizeAttributes pass sanitizes the element's attributes. The
|
|
1722
|
+
deliberately skipped namespace and fallback-tag removal checks stay
|
|
1723
|
+
skipped; they are removal decisions, not the hook contract. */
|
|
1724
|
+
if (removed === false) {
|
|
1725
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
1071
1726
|
}
|
|
1072
|
-
|
|
1073
|
-
return true;
|
|
1727
|
+
return removed;
|
|
1074
1728
|
}
|
|
1075
|
-
/* Check whether element has a valid namespace
|
|
1076
|
-
|
|
1729
|
+
/* Check whether element has a valid namespace.
|
|
1730
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
|
|
1731
|
+
nodeType getter rather than `instanceof Element`, which is realm-
|
|
1732
|
+
bound and short-circuits to false for any node minted in a different
|
|
1733
|
+
realm — letting a foreign-realm element with a forbidden namespace
|
|
1734
|
+
slip past the namespace check entirely. */
|
|
1735
|
+
const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
|
|
1736
|
+
if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
|
|
1077
1737
|
_forceRemove(currentNode);
|
|
1078
1738
|
return true;
|
|
1079
1739
|
}
|
|
1080
1740
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
1081
|
-
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(
|
|
1741
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
|
|
1082
1742
|
_forceRemove(currentNode);
|
|
1083
1743
|
return true;
|
|
1084
1744
|
}
|
|
1085
1745
|
/* Sanitize element content to be template-safe */
|
|
1086
1746
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
1087
1747
|
/* Get the element's text content */
|
|
1088
|
-
content = currentNode.textContent;
|
|
1089
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1090
|
-
content = stringReplace(content, expr, ' ');
|
|
1091
|
-
});
|
|
1748
|
+
const content = _stripTemplateExpressions(currentNode.textContent);
|
|
1092
1749
|
if (currentNode.textContent !== content) {
|
|
1093
1750
|
arrayPush(DOMPurify.removed, {
|
|
1094
1751
|
element: currentNode.cloneNode()
|
|
@@ -1114,6 +1771,33 @@ var telerikReportViewer = (function (exports) {
|
|
|
1114
1771
|
if (FORBID_ATTR[lcName]) {
|
|
1115
1772
|
return false;
|
|
1116
1773
|
}
|
|
1774
|
+
/* Reject declarative-partial-updates patch-linkage attributes
|
|
1775
|
+
(https://github.com/WICG/declarative-partial-updates).
|
|
1776
|
+
Empirical note (Chrome 150, verified — see
|
|
1777
|
+
test/declarative-patch-probe-v3.html): expansion is NOT applied after
|
|
1778
|
+
sanitization. For the string path it fires during sanitize()'s own
|
|
1779
|
+
parse, so the walk sees and sanitizes the fully materialized expanded
|
|
1780
|
+
tree — teleports into MathML/SVG integration points included; a
|
|
1781
|
+
weaponized `<template for>`->`<img onerror>` comes back with the handler
|
|
1782
|
+
stripped. For the IN_PLACE path it fires on connection, before the walk.
|
|
1783
|
+
Either way DOMPurify is NOT blind to the patch.
|
|
1784
|
+
This removal is therefore defense-in-depth rather than the sole barrier:
|
|
1785
|
+
it prevents live linkage from surviving into the OUTPUT and re-expanding
|
|
1786
|
+
in the caller's context, and keeps behaviour deterministic if a future
|
|
1787
|
+
engine defers expansion. `for` is legitimate only on <label>/<output>;
|
|
1788
|
+
anywhere else (notably <template for>) it links the element to a patch
|
|
1789
|
+
target and teleports or removes an arbitrary DOM range by id/marker name.
|
|
1790
|
+
`patchsrc` fetches remote markup and is treated as a script-loading
|
|
1791
|
+
mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the
|
|
1792
|
+
other structural-threat checks and stays overridable, consistent with
|
|
1793
|
+
the rest of the codebase. PI range markers are already removed by
|
|
1794
|
+
_isUnsafeNode. */
|
|
1795
|
+
if (SAFE_FOR_XML && lcName === 'patchsrc') {
|
|
1796
|
+
return false;
|
|
1797
|
+
}
|
|
1798
|
+
if (SAFE_FOR_XML && lcName === 'for' && lcTag !== 'label' && lcTag !== 'output') {
|
|
1799
|
+
return false;
|
|
1800
|
+
}
|
|
1117
1801
|
/* Make sure attribute cannot clobber */
|
|
1118
1802
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
1119
1803
|
return false;
|
|
@@ -1123,7 +1807,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1123
1807
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1124
1808
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
1125
1809
|
We don't need to check the value; it's always URI safe. */
|
|
1126
|
-
if (ALLOW_DATA_ATTR &&
|
|
1810
|
+
if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {
|
|
1127
1811
|
if (
|
|
1128
1812
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1129
1813
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
@@ -1135,7 +1819,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1135
1819
|
return false;
|
|
1136
1820
|
}
|
|
1137
1821
|
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
1138
|
-
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
|
|
1822
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if (value) {
|
|
1139
1823
|
return false;
|
|
1140
1824
|
} else ;
|
|
1141
1825
|
return true;
|
|
@@ -1153,7 +1837,64 @@ var telerikReportViewer = (function (exports) {
|
|
|
1153
1837
|
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
1154
1838
|
*/
|
|
1155
1839
|
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
1156
|
-
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT, tagName);
|
|
1840
|
+
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* Wrap an attribute value in the matching Trusted Types object when
|
|
1844
|
+
* the active policy requires it. Namespaced attributes pass through
|
|
1845
|
+
* unchanged (no TT support yet, see
|
|
1846
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
|
|
1847
|
+
*
|
|
1848
|
+
* @param lcTag lowercase tag name of the containing element
|
|
1849
|
+
* @param lcName lowercase attribute name
|
|
1850
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1851
|
+
* @param value the attribute value to wrap
|
|
1852
|
+
* @return the value, wrapped when Trusted Types demand it
|
|
1853
|
+
*/
|
|
1854
|
+
const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
|
|
1855
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
|
|
1856
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1857
|
+
case 'TrustedHTML':
|
|
1858
|
+
{
|
|
1859
|
+
return _createTrustedHTML(value);
|
|
1860
|
+
}
|
|
1861
|
+
case 'TrustedScriptURL':
|
|
1862
|
+
{
|
|
1863
|
+
return _createTrustedScriptURL(value);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
return value;
|
|
1868
|
+
};
|
|
1869
|
+
/**
|
|
1870
|
+
* Write a modified attribute value back onto the element. On
|
|
1871
|
+
* success, re-probe for clobbering introduced by the new value and
|
|
1872
|
+
* remove the element when found; otherwise pop the removal entry
|
|
1873
|
+
* recorded by the earlier _removeAttribute (long-standing pairing
|
|
1874
|
+
* with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
|
|
1875
|
+
* failure, remove the attribute instead.
|
|
1876
|
+
*
|
|
1877
|
+
* @param currentNode the element carrying the attribute
|
|
1878
|
+
* @param name the attribute name as present on the element
|
|
1879
|
+
* @param namespaceURI the attribute's namespace, if any
|
|
1880
|
+
* @param value the new attribute value
|
|
1881
|
+
*/
|
|
1882
|
+
const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
|
|
1883
|
+
try {
|
|
1884
|
+
if (namespaceURI) {
|
|
1885
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1886
|
+
} else {
|
|
1887
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1888
|
+
currentNode.setAttribute(name, value);
|
|
1889
|
+
}
|
|
1890
|
+
if (_isClobbered(currentNode)) {
|
|
1891
|
+
_forceRemove(currentNode);
|
|
1892
|
+
} else {
|
|
1893
|
+
arrayPop(DOMPurify.removed);
|
|
1894
|
+
}
|
|
1895
|
+
} catch (_) {
|
|
1896
|
+
_removeAttribute(name, currentNode);
|
|
1897
|
+
}
|
|
1157
1898
|
};
|
|
1158
1899
|
/**
|
|
1159
1900
|
* _sanitizeAttributes
|
|
@@ -1168,9 +1909,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1168
1909
|
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1169
1910
|
/* Execute a hook if present */
|
|
1170
1911
|
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
1171
|
-
const
|
|
1172
|
-
attributes
|
|
1173
|
-
} = currentNode;
|
|
1912
|
+
const attributes = currentNode.attributes;
|
|
1174
1913
|
/* Check if we have attributes; if not we might have a text node */
|
|
1175
1914
|
if (!attributes || _isClobbered(currentNode)) {
|
|
1176
1915
|
return;
|
|
@@ -1183,14 +1922,13 @@ var telerikReportViewer = (function (exports) {
|
|
|
1183
1922
|
forceKeepAttr: undefined
|
|
1184
1923
|
};
|
|
1185
1924
|
let l = attributes.length;
|
|
1925
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1186
1926
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
1187
1927
|
while (l--) {
|
|
1188
1928
|
const attr = attributes[l];
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
value: attrValue
|
|
1193
|
-
} = attr;
|
|
1929
|
+
const name = attr.name,
|
|
1930
|
+
namespaceURI = attr.namespaceURI,
|
|
1931
|
+
attrValue = attr.value;
|
|
1194
1932
|
const lcName = transformCaseFunc(name);
|
|
1195
1933
|
const initValue = attrValue;
|
|
1196
1934
|
let value = name === 'value' ? initValue : stringTrim(initValue);
|
|
@@ -1222,7 +1960,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1222
1960
|
_removeAttribute(name, currentNode);
|
|
1223
1961
|
continue;
|
|
1224
1962
|
}
|
|
1225
|
-
/* Did the hooks
|
|
1963
|
+
/* Did the hooks force-keep the attribute? */
|
|
1226
1964
|
if (hookEvent.forceKeepAttr) {
|
|
1227
1965
|
continue;
|
|
1228
1966
|
}
|
|
@@ -1232,56 +1970,24 @@ var telerikReportViewer = (function (exports) {
|
|
|
1232
1970
|
continue;
|
|
1233
1971
|
}
|
|
1234
1972
|
/* Work around a security issue in jQuery 3.0 */
|
|
1235
|
-
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(
|
|
1973
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
|
|
1236
1974
|
_removeAttribute(name, currentNode);
|
|
1237
1975
|
continue;
|
|
1238
1976
|
}
|
|
1239
1977
|
/* Sanitize attribute content to be template-safe */
|
|
1240
1978
|
if (SAFE_FOR_TEMPLATES) {
|
|
1241
|
-
|
|
1242
|
-
value = stringReplace(value, expr, ' ');
|
|
1243
|
-
});
|
|
1979
|
+
value = _stripTemplateExpressions(value);
|
|
1244
1980
|
}
|
|
1245
1981
|
/* Is `value` valid for this attribute? */
|
|
1246
|
-
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1247
1982
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1248
1983
|
_removeAttribute(name, currentNode);
|
|
1249
1984
|
continue;
|
|
1250
1985
|
}
|
|
1251
1986
|
/* Handle attributes that require Trusted Types */
|
|
1252
|
-
|
|
1253
|
-
if (namespaceURI) ; else {
|
|
1254
|
-
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1255
|
-
case 'TrustedHTML':
|
|
1256
|
-
{
|
|
1257
|
-
value = trustedTypesPolicy.createHTML(value);
|
|
1258
|
-
break;
|
|
1259
|
-
}
|
|
1260
|
-
case 'TrustedScriptURL':
|
|
1261
|
-
{
|
|
1262
|
-
value = trustedTypesPolicy.createScriptURL(value);
|
|
1263
|
-
break;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1987
|
+
value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
|
|
1268
1988
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
1269
1989
|
if (value !== initValue) {
|
|
1270
|
-
|
|
1271
|
-
if (namespaceURI) {
|
|
1272
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1273
|
-
} else {
|
|
1274
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1275
|
-
currentNode.setAttribute(name, value);
|
|
1276
|
-
}
|
|
1277
|
-
if (_isClobbered(currentNode)) {
|
|
1278
|
-
_forceRemove(currentNode);
|
|
1279
|
-
} else {
|
|
1280
|
-
arrayPop(DOMPurify.removed);
|
|
1281
|
-
}
|
|
1282
|
-
} catch (_) {
|
|
1283
|
-
_removeAttribute(name, currentNode);
|
|
1284
|
-
}
|
|
1990
|
+
_setAttributeValue(currentNode, name, namespaceURI, value);
|
|
1285
1991
|
}
|
|
1286
1992
|
}
|
|
1287
1993
|
/* Execute a hook if present */
|
|
@@ -1301,17 +2007,136 @@ var telerikReportViewer = (function (exports) {
|
|
|
1301
2007
|
/* Execute a hook if present */
|
|
1302
2008
|
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
1303
2009
|
/* Sanitize tags and elements */
|
|
1304
|
-
_sanitizeElements(shadowNode);
|
|
2010
|
+
_sanitizeElements(shadowNode, fragment);
|
|
1305
2011
|
/* Check attributes next */
|
|
1306
2012
|
_sanitizeAttributes(shadowNode);
|
|
1307
|
-
/* Deep shadow DOM detected
|
|
1308
|
-
|
|
2013
|
+
/* Deep shadow DOM detected.
|
|
2014
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
|
|
2015
|
+
DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
|
|
2016
|
+
recurse into <template>.content from foreign realms too. */
|
|
2017
|
+
if (_isDocumentFragment(shadowNode.content)) {
|
|
1309
2018
|
_sanitizeShadowDOM2(shadowNode.content);
|
|
1310
2019
|
}
|
|
2020
|
+
/* An element iterated here may itself host an attached
|
|
2021
|
+
shadow root. The default NodeIterator does not enter shadow
|
|
2022
|
+
trees, so a shadow root nested inside template.content was
|
|
2023
|
+
previously reached by no walk at all (the pre-pass at
|
|
2024
|
+
_sanitizeAttachedShadowRoots descends via childNodes, which
|
|
2025
|
+
doesn't enter template.content; the template-content recursion
|
|
2026
|
+
above iterates the content but never inspected shadowRoot).
|
|
2027
|
+
Walk it explicitly. The nodeType guard avoids reading
|
|
2028
|
+
shadowRoot off text / comment / CDATA / PI nodes that the
|
|
2029
|
+
iterator also surfaces. */
|
|
2030
|
+
const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
|
|
2031
|
+
if (shadowNodeType === NODE_TYPE.element) {
|
|
2032
|
+
const innerSr = getShadowRoot(shadowNode);
|
|
2033
|
+
if (_isDocumentFragment(innerSr)) {
|
|
2034
|
+
_sanitizeAttachedShadowRoots(innerSr);
|
|
2035
|
+
_sanitizeShadowDOM2(innerSr);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
1311
2038
|
}
|
|
1312
2039
|
/* Execute a hook if present */
|
|
1313
2040
|
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
1314
2041
|
};
|
|
2042
|
+
/**
|
|
2043
|
+
* _sanitizeAttachedShadowRoots
|
|
2044
|
+
*
|
|
2045
|
+
* Walks `root` and feeds every attached shadow root we encounter into
|
|
2046
|
+
* the existing _sanitizeShadowDOM pipeline. The default node iterator
|
|
2047
|
+
* does not descend into shadow trees, so nodes inside an attached
|
|
2048
|
+
* shadow root would otherwise be skipped entirely.
|
|
2049
|
+
*
|
|
2050
|
+
* Two real input paths put attached shadow roots in front of us:
|
|
2051
|
+
* 1. IN_PLACE on a DOM node that already has shadow roots attached.
|
|
2052
|
+
* 2. DOM-node input where importNode(dirty, true) deep-clones the
|
|
2053
|
+
* shadow root because it was created with `clonable: true`.
|
|
2054
|
+
*
|
|
2055
|
+
* This pass runs once, up front, so the main iteration loop (and the
|
|
2056
|
+
* existing _sanitizeShadowDOM template-content recursion) stay
|
|
2057
|
+
* untouched — string-input paths are not affected.
|
|
2058
|
+
*
|
|
2059
|
+
* @param root the subtree root to walk for attached shadow roots
|
|
2060
|
+
*/
|
|
2061
|
+
const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
|
|
2062
|
+
/* Iterative (explicit stack) rather than per-child recursion. DOM APIs
|
|
2063
|
+
impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
|
|
2064
|
+
built straight into the DOM — the IN_PLACE surface) deeper than the JS
|
|
2065
|
+
call-stack budget would otherwise overflow native recursion here and
|
|
2066
|
+
throw at the IN_PLACE entry pre-pass, before a single node is
|
|
2067
|
+
sanitized, leaving the caller's live tree untouched (fail-open). See
|
|
2068
|
+
campaign-3 F4. A heap stack keeps depth off the call stack.
|
|
2069
|
+
Each work item is either a node to descend into, or a deferred
|
|
2070
|
+
`_sanitizeShadowDOM` for an already-walked shadow root. The deferred
|
|
2071
|
+
form preserves the original post-order discipline: a shadow root's
|
|
2072
|
+
nested shadow roots are discovered before the outer shadow is
|
|
2073
|
+
sanitized (which may remove hosts). Pushes are in reverse of the
|
|
2074
|
+
desired processing order (LIFO): template content, then children, then
|
|
2075
|
+
the shadow-sanitize, then the shadow walk — so the order matches the
|
|
2076
|
+
previous recursion exactly. */
|
|
2077
|
+
const stack = [{
|
|
2078
|
+
node: root,
|
|
2079
|
+
shadow: null
|
|
2080
|
+
}];
|
|
2081
|
+
while (stack.length > 0) {
|
|
2082
|
+
const item = stack.pop();
|
|
2083
|
+
/* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
|
|
2084
|
+
if (item.shadow) {
|
|
2085
|
+
_sanitizeShadowDOM2(item.shadow);
|
|
2086
|
+
continue;
|
|
2087
|
+
}
|
|
2088
|
+
const node = item.node;
|
|
2089
|
+
const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
|
|
2090
|
+
const isElement = nodeType === NODE_TYPE.element;
|
|
2091
|
+
/* (pushed last → processed first) Children, snapshotted in reverse so
|
|
2092
|
+
the first child is processed first. Snapshotting matters because a
|
|
2093
|
+
hook may detach siblings mid-walk. */
|
|
2094
|
+
const childNodes = getChildNodes(node);
|
|
2095
|
+
if (childNodes) {
|
|
2096
|
+
for (let i = childNodes.length - 1; i >= 0; --i) {
|
|
2097
|
+
stack.push({
|
|
2098
|
+
node: childNodes[i],
|
|
2099
|
+
shadow: null
|
|
2100
|
+
});
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
/* (pushed before children → processed after them, matching the old
|
|
2104
|
+
"template content last" order) When the node is a <template>,
|
|
2105
|
+
descend into its content. */
|
|
2106
|
+
if (isElement) {
|
|
2107
|
+
const rootName = getNodeName ? getNodeName(node) : null;
|
|
2108
|
+
if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
|
|
2109
|
+
const content = node.content;
|
|
2110
|
+
if (_isDocumentFragment(content)) {
|
|
2111
|
+
stack.push({
|
|
2112
|
+
node: content,
|
|
2113
|
+
shadow: null
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
/* Shadow root (processed first): walk its subtree, then sanitise it.
|
|
2119
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
2120
|
+
rather than `instanceof DocumentFragment`, which is realm-bound and
|
|
2121
|
+
silently skipped foreign-realm shadow roots (e.g.
|
|
2122
|
+
iframe.contentDocument attachShadow). */
|
|
2123
|
+
if (isElement) {
|
|
2124
|
+
const sr = getShadowRoot(node);
|
|
2125
|
+
if (_isDocumentFragment(sr)) {
|
|
2126
|
+
/* Push the deferred sanitise first so it pops after the shadow
|
|
2127
|
+
walk we push next, i.e. nested shadow roots are discovered
|
|
2128
|
+
before this one is sanitised. */
|
|
2129
|
+
stack.push({
|
|
2130
|
+
node: null,
|
|
2131
|
+
shadow: sr
|
|
2132
|
+
}, {
|
|
2133
|
+
node: sr,
|
|
2134
|
+
shadow: null
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
1315
2140
|
// eslint-disable-next-line complexity
|
|
1316
2141
|
DOMPurify.sanitize = function (dirty) {
|
|
1317
2142
|
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -1338,25 +2163,90 @@ var telerikReportViewer = (function (exports) {
|
|
|
1338
2163
|
return dirty;
|
|
1339
2164
|
}
|
|
1340
2165
|
/* Assign config vars */
|
|
1341
|
-
if (
|
|
2166
|
+
if (SET_CONFIG) {
|
|
2167
|
+
/* Persistent setConfig() path: _parseConfig is skipped, so the sets are
|
|
2168
|
+
* not re-derived per call. Restore them from the pristine bindings
|
|
2169
|
+
* captured at setConfig() time so a previous call's hook clone (mutated
|
|
2170
|
+
* below) does not carry over. */
|
|
2171
|
+
ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
|
|
2172
|
+
ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
|
|
2173
|
+
} else {
|
|
1342
2174
|
_parseConfig(cfg);
|
|
1343
2175
|
}
|
|
2176
|
+
/* Clone the hook-mutable allowlists before the walk whenever an
|
|
2177
|
+
* uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS
|
|
2178
|
+
* and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so
|
|
2179
|
+
* a hook that widens them would otherwise mutate the shared set
|
|
2180
|
+
* permanently: across later calls and across every element. Cloning per
|
|
2181
|
+
* walk keeps documented in-call widening working while scoping it to the
|
|
2182
|
+
* call. A single guard for both config paths - the per-call path rebinds
|
|
2183
|
+
* the sets in _parseConfig each call, the persistent path restores them
|
|
2184
|
+
* from the captured bindings just above - so the two cannot diverge. */
|
|
2185
|
+
if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
|
|
2186
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
2187
|
+
}
|
|
2188
|
+
if (hooks.uponSanitizeAttribute.length > 0) {
|
|
2189
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
2190
|
+
}
|
|
1344
2191
|
/* Clean up removed elements */
|
|
1345
2192
|
DOMPurify.removed = [];
|
|
1346
|
-
/*
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
2193
|
+
/* Resolve IN_PLACE for this call without mutating persistent config.
|
|
2194
|
+
Writing the IN_PLACE closure variable here leaks under setConfig(),
|
|
2195
|
+
where _parseConfig is skipped on later calls: a single string call would
|
|
2196
|
+
disable in-place mode for every subsequent node call, returning a
|
|
2197
|
+
sanitized copy while leaving the caller's node — which in-place callers
|
|
2198
|
+
keep using and whose return value they ignore — unsanitized. REPORT-2. */
|
|
2199
|
+
const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
|
|
2200
|
+
if (inPlace) {
|
|
2201
|
+
/* Declarative-partial-updates / streaming pre-pass: sever every patch
|
|
2202
|
+
linkage across the live tree BEFORE the walk, so no patch can fire
|
|
2203
|
+
mid-walk and inject into an already-processed region. Runs first, so
|
|
2204
|
+
it also covers the forbidden/clobbered roots that throw below. */
|
|
2205
|
+
_neutralizePatchLinkage(dirty);
|
|
2206
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes.
|
|
2207
|
+
Read nodeName through the cached prototype getter — a clobbering
|
|
2208
|
+
child named "nodeName" on the form root would otherwise shadow
|
|
2209
|
+
the property and let this check skip the root-allowlist
|
|
2210
|
+
validation entirely. */
|
|
2211
|
+
const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
|
|
1353
2212
|
if (typeof nn === 'string') {
|
|
1354
2213
|
const tagName = transformCaseFunc(nn);
|
|
1355
2214
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
2215
|
+
/* Fail closed on a live root: neutralize handlers/children before
|
|
2216
|
+
throwing, exactly as the mid-walk abort path does. */
|
|
2217
|
+
_neutralizeRoot(dirty);
|
|
1356
2218
|
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
1357
2219
|
}
|
|
1358
2220
|
}
|
|
1359
|
-
|
|
2221
|
+
/* Pre-flight the root through _isClobbered. The iterator-driven
|
|
2222
|
+
removal path can not detach a parent-less root: _forceRemove
|
|
2223
|
+
falls through to Element.prototype.remove(), which per spec
|
|
2224
|
+
is a no-op on a node with no parent. A clobbered root would
|
|
2225
|
+
then survive the main loop with its attributes uninspected,
|
|
2226
|
+
because _sanitizeAttributes early-returns on _isClobbered. The
|
|
2227
|
+
result would be an attacker-controlled form, complete with any
|
|
2228
|
+
event-handler attributes the caller passed in, handed back to
|
|
2229
|
+
the application unsanitized. Refuse to sanitize such a root
|
|
2230
|
+
the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
|
|
2231
|
+
if (_isClobbered(dirty)) {
|
|
2232
|
+
/* Fail closed on a live clobbered root before throwing.
|
|
2233
|
+
_neutralizeRoot's reads are clobber-safe (cached getters); the
|
|
2234
|
+
form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */
|
|
2235
|
+
_neutralizeRoot(dirty);
|
|
2236
|
+
throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
|
|
2237
|
+
}
|
|
2238
|
+
/* Sanitize attached shadow roots before the main iterator runs.
|
|
2239
|
+
The iterator does not descend into shadow trees. Same fail-closed
|
|
2240
|
+
barrier as the main walk (campaign-3 F2): a custom-element reaction
|
|
2241
|
+
inside a shadow root could abort this pre-pass before the walk runs,
|
|
2242
|
+
which would otherwise leave the entire live tree unsanitized. */
|
|
2243
|
+
try {
|
|
2244
|
+
_sanitizeAttachedShadowRoots(dirty);
|
|
2245
|
+
} catch (error) {
|
|
2246
|
+
_neutralizeRoot(dirty);
|
|
2247
|
+
throw error;
|
|
2248
|
+
}
|
|
2249
|
+
} else if (_isNode(dirty)) {
|
|
1360
2250
|
/* If dirty is a DOM element, append to an empty document to avoid
|
|
1361
2251
|
elements being stripped by the parser */
|
|
1362
2252
|
body = _initDocument('<!---->');
|
|
@@ -1370,12 +2260,18 @@ var telerikReportViewer = (function (exports) {
|
|
|
1370
2260
|
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
1371
2261
|
body.appendChild(importedNode);
|
|
1372
2262
|
}
|
|
2263
|
+
/* Clonable shadow roots are deep-cloned by importNode(); sanitize
|
|
2264
|
+
them before the main iterator runs, since the iterator does not
|
|
2265
|
+
descend into shadow trees. The walk routes every read through a
|
|
2266
|
+
cached prototype getter so clobbering descendants on a form root
|
|
2267
|
+
cannot hide a shadow host from this pass. */
|
|
2268
|
+
_sanitizeAttachedShadowRoots(importedNode);
|
|
1373
2269
|
} else {
|
|
1374
2270
|
/* Exit directly if we have nothing to do */
|
|
1375
2271
|
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
1376
2272
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
1377
2273
|
dirty.indexOf('<') === -1) {
|
|
1378
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2274
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
|
|
1379
2275
|
}
|
|
1380
2276
|
/* Initialize the document to work on */
|
|
1381
2277
|
body = _initDocument(dirty);
|
|
@@ -1389,31 +2285,68 @@ var telerikReportViewer = (function (exports) {
|
|
|
1389
2285
|
_forceRemove(body.firstChild);
|
|
1390
2286
|
}
|
|
1391
2287
|
/* Get node iterator */
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
2288
|
+
const walkRoot = inPlace ? dirty : body;
|
|
2289
|
+
const nodeIterator = _createNodeIterator(walkRoot);
|
|
2290
|
+
/* Now start iterating over the created document.
|
|
2291
|
+
The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
|
|
2292
|
+
engine/custom-element mutation can detach a node mid-walk so
|
|
2293
|
+
`_forceRemove`'s parentless guard throws, aborting the loop. Without the
|
|
2294
|
+
barrier the caller's in-place tree would be left half-sanitized with the
|
|
2295
|
+
unvisited tail still armed. On any throw we fail closed — strip the
|
|
2296
|
+
in-place root bare — then rethrow so the existing throw contract is
|
|
2297
|
+
preserved. (String/DOM-copy paths never return the partial body, so the
|
|
2298
|
+
propagating throw is already fail-closed there.) */
|
|
2299
|
+
try {
|
|
2300
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
2301
|
+
/* Sanitize tags and elements */
|
|
2302
|
+
_sanitizeElements(currentNode, walkRoot);
|
|
2303
|
+
/* Check attributes next */
|
|
2304
|
+
_sanitizeAttributes(currentNode);
|
|
2305
|
+
/* Shadow DOM detected, sanitize it.
|
|
2306
|
+
Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
|
|
2307
|
+
instead of instanceof, so foreign-realm <template>.content is
|
|
2308
|
+
walked correctly. */
|
|
2309
|
+
if (_isDocumentFragment(currentNode.content)) {
|
|
2310
|
+
_sanitizeShadowDOM2(currentNode.content);
|
|
2311
|
+
}
|
|
1402
2312
|
}
|
|
2313
|
+
} catch (error) {
|
|
2314
|
+
if (inPlace) {
|
|
2315
|
+
_neutralizeRoot(dirty);
|
|
2316
|
+
/* Nodes _forceRemove'd earlier in the aborted walk are already
|
|
2317
|
+
detached from the root, so _neutralizeRoot's subtree pass does not
|
|
2318
|
+
reach them. Defuse them too, mirroring the success-path loop below. */
|
|
2319
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
2320
|
+
if (entry.element) {
|
|
2321
|
+
_neutralizeSubtree(entry.element);
|
|
2322
|
+
}
|
|
2323
|
+
});
|
|
2324
|
+
}
|
|
2325
|
+
throw error;
|
|
1403
2326
|
}
|
|
1404
2327
|
/* If we sanitized `dirty` in-place, return it. */
|
|
1405
|
-
if (
|
|
2328
|
+
if (inPlace) {
|
|
2329
|
+
/* Fail-closed completion of the audit-5 F1 fix: every node removed from
|
|
2330
|
+
the caller's live tree is detached but may still hold a queued
|
|
2331
|
+
resource-event handler that fires in page scope after we return. The
|
|
2332
|
+
move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
|
|
2333
|
+
non-allow-listed attributes off every other removed subtree (clobber,
|
|
2334
|
+
mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
|
|
2335
|
+
cancelled before any event can fire. Runs synchronously, pre-return. */
|
|
2336
|
+
arrayForEach(DOMPurify.removed, entry => {
|
|
2337
|
+
if (entry.element) {
|
|
2338
|
+
_neutralizeSubtree(entry.element);
|
|
2339
|
+
}
|
|
2340
|
+
});
|
|
2341
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2342
|
+
_scrubTemplateExpressions2(dirty);
|
|
2343
|
+
}
|
|
1406
2344
|
return dirty;
|
|
1407
2345
|
}
|
|
1408
2346
|
/* Return sanitized string or DOM */
|
|
1409
2347
|
if (RETURN_DOM) {
|
|
1410
2348
|
if (SAFE_FOR_TEMPLATES) {
|
|
1411
|
-
body
|
|
1412
|
-
let html = body.innerHTML;
|
|
1413
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1414
|
-
html = stringReplace(html, expr, ' ');
|
|
1415
|
-
});
|
|
1416
|
-
body.innerHTML = html;
|
|
2349
|
+
_scrubTemplateExpressions2(body);
|
|
1417
2350
|
}
|
|
1418
2351
|
if (RETURN_DOM_FRAGMENT) {
|
|
1419
2352
|
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
@@ -1443,20 +2376,28 @@ var telerikReportViewer = (function (exports) {
|
|
|
1443
2376
|
}
|
|
1444
2377
|
/* Sanitize final string template-safe */
|
|
1445
2378
|
if (SAFE_FOR_TEMPLATES) {
|
|
1446
|
-
|
|
1447
|
-
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
1448
|
-
});
|
|
2379
|
+
serializedHTML = _stripTemplateExpressions(serializedHTML);
|
|
1449
2380
|
}
|
|
1450
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ?
|
|
2381
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
|
|
1451
2382
|
};
|
|
1452
2383
|
DOMPurify.setConfig = function () {
|
|
1453
2384
|
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1454
2385
|
_parseConfig(cfg);
|
|
1455
2386
|
SET_CONFIG = true;
|
|
2387
|
+
SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
|
|
2388
|
+
SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
|
|
1456
2389
|
};
|
|
1457
2390
|
DOMPurify.clearConfig = function () {
|
|
1458
2391
|
CONFIG = null;
|
|
1459
2392
|
SET_CONFIG = false;
|
|
2393
|
+
SET_CONFIG_ALLOWED_TAGS = null;
|
|
2394
|
+
SET_CONFIG_ALLOWED_ATTR = null;
|
|
2395
|
+
// Drop any caller-supplied Trusted Types policy so it cannot poison later
|
|
2396
|
+
// `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
|
|
2397
|
+
// never recreated — Trusted Types throws on duplicate names) is restored by
|
|
2398
|
+
// the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
|
|
2399
|
+
trustedTypesPolicy = defaultTrustedTypesPolicy;
|
|
2400
|
+
emptyHTML = '';
|
|
1460
2401
|
};
|
|
1461
2402
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1462
2403
|
/* Initialize shared config vars if necessary. */
|
|
@@ -1471,9 +2412,19 @@ var telerikReportViewer = (function (exports) {
|
|
|
1471
2412
|
if (typeof hookFunction !== 'function') {
|
|
1472
2413
|
return;
|
|
1473
2414
|
}
|
|
2415
|
+
/* Reject unknown entry points. Without this, a non-hook key (e.g.
|
|
2416
|
+
* '__proto__') indexes off the prototype chain rather than a real
|
|
2417
|
+
* hook array, and arrayPush then writes to Object.prototype. Guard
|
|
2418
|
+
* with an own-property check against the known hook names. */
|
|
2419
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
1474
2422
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
1475
2423
|
};
|
|
1476
2424
|
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
2425
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
2426
|
+
return undefined;
|
|
2427
|
+
}
|
|
1477
2428
|
if (hookFunction !== undefined) {
|
|
1478
2429
|
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
1479
2430
|
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
@@ -1481,6 +2432,9 @@ var telerikReportViewer = (function (exports) {
|
|
|
1481
2432
|
return arrayPop(hooks[entryPoint]);
|
|
1482
2433
|
};
|
|
1483
2434
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
2435
|
+
if (!objectHasOwnProperty(hooks, entryPoint)) {
|
|
2436
|
+
return;
|
|
2437
|
+
}
|
|
1484
2438
|
hooks[entryPoint] = [];
|
|
1485
2439
|
};
|
|
1486
2440
|
DOMPurify.removeAllHooks = function () {
|
|
@@ -1497,9 +2451,9 @@ var telerikReportViewer = (function (exports) {
|
|
|
1497
2451
|
|
|
1498
2452
|
dist.exports;
|
|
1499
2453
|
(function(module, exports) {
|
|
1500
|
-
!function(e, t) {
|
|
2454
|
+
!(function(e, t) {
|
|
1501
2455
|
t(exports, requirePurify_cjs()) ;
|
|
1502
|
-
}(commonjsGlobal, function(e, t) {
|
|
2456
|
+
})(commonjsGlobal, function(e, t) {
|
|
1503
2457
|
function i(e2) {
|
|
1504
2458
|
return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
|
|
1505
2459
|
}
|
|
@@ -1628,8 +2582,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1628
2582
|
let t2 = yield e2.text(), i2 = new C(t2, e2.statusText);
|
|
1629
2583
|
return Promise.reject(i2);
|
|
1630
2584
|
}
|
|
1631
|
-
if (204 == e2.status)
|
|
1632
|
-
return Promise.resolve();
|
|
2585
|
+
if (204 == e2.status) return Promise.resolve();
|
|
1633
2586
|
return (e2.headers.get("content-type") || "").includes("application/json") ? e2.json() : e2.text();
|
|
1634
2587
|
});
|
|
1635
2588
|
}
|
|
@@ -1698,16 +2651,14 @@ var telerikReportViewer = (function (exports) {
|
|
|
1698
2651
|
}
|
|
1699
2652
|
function D(e2, t2, i2, n2) {
|
|
1700
2653
|
var r2, s2, o2, a2;
|
|
1701
|
-
if ("function" != typeof i2)
|
|
1702
|
-
throw new TypeError('"listener" argument must be a function');
|
|
2654
|
+
if ("function" != typeof i2) throw new TypeError('"listener" argument must be a function');
|
|
1703
2655
|
if ((s2 = e2._events) ? (s2.newListener && (e2.emit("newListener", t2, i2.listener ? i2.listener : i2), s2 = e2._events), o2 = s2[t2]) : (s2 = e2._events = new k(), e2._eventsCount = 0), o2) {
|
|
1704
2656
|
if ("function" == typeof o2 ? o2 = s2[t2] = n2 ? [i2, o2] : [o2, i2] : n2 ? o2.unshift(i2) : o2.push(i2), !o2.warned && (r2 = N(e2)) && r2 > 0 && o2.length > r2) {
|
|
1705
2657
|
o2.warned = true;
|
|
1706
2658
|
var l2 = new Error("Possible EventEmitter memory leak detected. " + o2.length + " " + t2 + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1707
2659
|
l2.name = "MaxListenersExceededWarning", l2.emitter = e2, l2.type = t2, l2.count = o2.length, a2 = l2, "function" == typeof console.warn ? console.warn(a2) : console.log(a2);
|
|
1708
2660
|
}
|
|
1709
|
-
} else
|
|
1710
|
-
o2 = s2[t2] = i2, ++e2._eventsCount;
|
|
2661
|
+
} else o2 = s2[t2] = i2, ++e2._eventsCount;
|
|
1711
2662
|
return e2;
|
|
1712
2663
|
}
|
|
1713
2664
|
function V(e2, t2, i2) {
|
|
@@ -1721,91 +2672,67 @@ var telerikReportViewer = (function (exports) {
|
|
|
1721
2672
|
var t2 = this._events;
|
|
1722
2673
|
if (t2) {
|
|
1723
2674
|
var i2 = t2[e2];
|
|
1724
|
-
if ("function" == typeof i2)
|
|
1725
|
-
|
|
1726
|
-
if (i2)
|
|
1727
|
-
return i2.length;
|
|
2675
|
+
if ("function" == typeof i2) return 1;
|
|
2676
|
+
if (i2) return i2.length;
|
|
1728
2677
|
}
|
|
1729
2678
|
return 0;
|
|
1730
2679
|
}
|
|
1731
2680
|
function O(e2, t2) {
|
|
1732
|
-
for (var i2 = new Array(t2); t2--; )
|
|
1733
|
-
i2[t2] = e2[t2];
|
|
2681
|
+
for (var i2 = new Array(t2); t2--; ) i2[t2] = e2[t2];
|
|
1734
2682
|
return i2;
|
|
1735
2683
|
}
|
|
1736
2684
|
k.prototype = /* @__PURE__ */ Object.create(null), x.EventEmitter = x, x.usingDomains = false, x.prototype.domain = void 0, x.prototype._events = void 0, x.prototype._maxListeners = void 0, x.defaultMaxListeners = 10, x.init = function() {
|
|
1737
2685
|
this.domain = null, x.usingDomains && (void 0).active, this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = new k(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
1738
2686
|
}, x.prototype.setMaxListeners = function(e2) {
|
|
1739
|
-
if ("number" != typeof e2 || e2 < 0 || isNaN(e2))
|
|
1740
|
-
throw new TypeError('"n" argument must be a positive number');
|
|
2687
|
+
if ("number" != typeof e2 || e2 < 0 || isNaN(e2)) throw new TypeError('"n" argument must be a positive number');
|
|
1741
2688
|
return this._maxListeners = e2, this;
|
|
1742
2689
|
}, x.prototype.getMaxListeners = function() {
|
|
1743
2690
|
return N(this);
|
|
1744
2691
|
}, x.prototype.emit = function(e2) {
|
|
1745
2692
|
var t2, i2, n2, r2, s2, o2, a2, l2 = "error" === e2;
|
|
1746
|
-
if (o2 = this._events)
|
|
1747
|
-
|
|
1748
|
-
else if (!l2)
|
|
1749
|
-
return false;
|
|
2693
|
+
if (o2 = this._events) l2 = l2 && null == o2.error;
|
|
2694
|
+
else if (!l2) return false;
|
|
1750
2695
|
if (a2 = this.domain, l2) {
|
|
1751
2696
|
if (t2 = arguments[1], !a2) {
|
|
1752
|
-
if (t2 instanceof Error)
|
|
1753
|
-
throw t2;
|
|
2697
|
+
if (t2 instanceof Error) throw t2;
|
|
1754
2698
|
var h2 = new Error('Uncaught, unspecified "error" event. (' + t2 + ")");
|
|
1755
2699
|
throw h2.context = t2, h2;
|
|
1756
2700
|
}
|
|
1757
2701
|
return t2 || (t2 = new Error('Uncaught, unspecified "error" event')), t2.domainEmitter = this, t2.domain = a2, t2.domainThrown = false, a2.emit("error", t2), false;
|
|
1758
2702
|
}
|
|
1759
|
-
if (!(i2 = o2[e2]))
|
|
1760
|
-
return false;
|
|
2703
|
+
if (!(i2 = o2[e2])) return false;
|
|
1761
2704
|
var c2 = "function" == typeof i2;
|
|
1762
2705
|
switch (n2 = arguments.length) {
|
|
1763
2706
|
case 1:
|
|
1764
|
-
!function(e3, t3, i3) {
|
|
1765
|
-
if (t3)
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
for (var n3 = e3.length, r3 = O(e3, n3), s3 = 0; s3 < n3; ++s3)
|
|
1769
|
-
r3[s3].call(i3);
|
|
1770
|
-
}(i2, c2, this);
|
|
2707
|
+
!(function(e3, t3, i3) {
|
|
2708
|
+
if (t3) e3.call(i3);
|
|
2709
|
+
else for (var n3 = e3.length, r3 = O(e3, n3), s3 = 0; s3 < n3; ++s3) r3[s3].call(i3);
|
|
2710
|
+
})(i2, c2, this);
|
|
1771
2711
|
break;
|
|
1772
2712
|
case 2:
|
|
1773
|
-
!function(e3, t3, i3, n3) {
|
|
1774
|
-
if (t3)
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
for (var r3 = e3.length, s3 = O(e3, r3), o3 = 0; o3 < r3; ++o3)
|
|
1778
|
-
s3[o3].call(i3, n3);
|
|
1779
|
-
}(i2, c2, this, arguments[1]);
|
|
2713
|
+
!(function(e3, t3, i3, n3) {
|
|
2714
|
+
if (t3) e3.call(i3, n3);
|
|
2715
|
+
else for (var r3 = e3.length, s3 = O(e3, r3), o3 = 0; o3 < r3; ++o3) s3[o3].call(i3, n3);
|
|
2716
|
+
})(i2, c2, this, arguments[1]);
|
|
1780
2717
|
break;
|
|
1781
2718
|
case 3:
|
|
1782
|
-
!function(e3, t3, i3, n3, r3) {
|
|
1783
|
-
if (t3)
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
for (var s3 = e3.length, o3 = O(e3, s3), a3 = 0; a3 < s3; ++a3)
|
|
1787
|
-
o3[a3].call(i3, n3, r3);
|
|
1788
|
-
}(i2, c2, this, arguments[1], arguments[2]);
|
|
2719
|
+
!(function(e3, t3, i3, n3, r3) {
|
|
2720
|
+
if (t3) e3.call(i3, n3, r3);
|
|
2721
|
+
else for (var s3 = e3.length, o3 = O(e3, s3), a3 = 0; a3 < s3; ++a3) o3[a3].call(i3, n3, r3);
|
|
2722
|
+
})(i2, c2, this, arguments[1], arguments[2]);
|
|
1789
2723
|
break;
|
|
1790
2724
|
case 4:
|
|
1791
|
-
!function(e3, t3, i3, n3, r3, s3) {
|
|
1792
|
-
if (t3)
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
for (var o3 = e3.length, a3 = O(e3, o3), l3 = 0; l3 < o3; ++l3)
|
|
1796
|
-
a3[l3].call(i3, n3, r3, s3);
|
|
1797
|
-
}(i2, c2, this, arguments[1], arguments[2], arguments[3]);
|
|
2725
|
+
!(function(e3, t3, i3, n3, r3, s3) {
|
|
2726
|
+
if (t3) e3.call(i3, n3, r3, s3);
|
|
2727
|
+
else for (var o3 = e3.length, a3 = O(e3, o3), l3 = 0; l3 < o3; ++l3) a3[l3].call(i3, n3, r3, s3);
|
|
2728
|
+
})(i2, c2, this, arguments[1], arguments[2], arguments[3]);
|
|
1798
2729
|
break;
|
|
1799
2730
|
default:
|
|
1800
|
-
for (r2 = new Array(n2 - 1), s2 = 1; s2 < n2; s2++)
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
else
|
|
1806
|
-
for (var r3 = e3.length, s3 = O(e3, r3), o3 = 0; o3 < r3; ++o3)
|
|
1807
|
-
s3[o3].apply(i3, n3);
|
|
1808
|
-
}(i2, c2, this, r2);
|
|
2731
|
+
for (r2 = new Array(n2 - 1), s2 = 1; s2 < n2; s2++) r2[s2 - 1] = arguments[s2];
|
|
2732
|
+
!(function(e3, t3, i3, n3) {
|
|
2733
|
+
if (t3) e3.apply(i3, n3);
|
|
2734
|
+
else for (var r3 = e3.length, s3 = O(e3, r3), o3 = 0; o3 < r3; ++o3) s3[o3].apply(i3, n3);
|
|
2735
|
+
})(i2, c2, this, r2);
|
|
1809
2736
|
}
|
|
1810
2737
|
return true;
|
|
1811
2738
|
}, x.prototype.addListener = function(e2, t2) {
|
|
@@ -1813,41 +2740,30 @@ var telerikReportViewer = (function (exports) {
|
|
|
1813
2740
|
}, x.prototype.on = x.prototype.addListener, x.prototype.prependListener = function(e2, t2) {
|
|
1814
2741
|
return D(this, e2, t2, true);
|
|
1815
2742
|
}, x.prototype.once = function(e2, t2) {
|
|
1816
|
-
if ("function" != typeof t2)
|
|
1817
|
-
throw new TypeError('"listener" argument must be a function');
|
|
2743
|
+
if ("function" != typeof t2) throw new TypeError('"listener" argument must be a function');
|
|
1818
2744
|
return this.on(e2, V(this, e2, t2)), this;
|
|
1819
2745
|
}, x.prototype.prependOnceListener = function(e2, t2) {
|
|
1820
|
-
if ("function" != typeof t2)
|
|
1821
|
-
throw new TypeError('"listener" argument must be a function');
|
|
2746
|
+
if ("function" != typeof t2) throw new TypeError('"listener" argument must be a function');
|
|
1822
2747
|
return this.prependListener(e2, V(this, e2, t2)), this;
|
|
1823
2748
|
}, x.prototype.removeListener = function(e2, t2) {
|
|
1824
2749
|
var i2, n2, r2, s2, o2;
|
|
1825
|
-
if ("function" != typeof t2)
|
|
1826
|
-
|
|
1827
|
-
if (!(
|
|
1828
|
-
|
|
1829
|
-
if (!(i2 = n2[e2]))
|
|
1830
|
-
return this;
|
|
1831
|
-
if (i2 === t2 || i2.listener && i2.listener === t2)
|
|
1832
|
-
0 === --this._eventsCount ? this._events = new k() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
|
|
2750
|
+
if ("function" != typeof t2) throw new TypeError('"listener" argument must be a function');
|
|
2751
|
+
if (!(n2 = this._events)) return this;
|
|
2752
|
+
if (!(i2 = n2[e2])) return this;
|
|
2753
|
+
if (i2 === t2 || i2.listener && i2.listener === t2) 0 === --this._eventsCount ? this._events = new k() : (delete n2[e2], n2.removeListener && this.emit("removeListener", e2, i2.listener || t2));
|
|
1833
2754
|
else if ("function" != typeof i2) {
|
|
1834
|
-
for (r2 = -1, s2 = i2.length; s2-- > 0; )
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
if (r2 < 0)
|
|
1840
|
-
return this;
|
|
2755
|
+
for (r2 = -1, s2 = i2.length; s2-- > 0; ) if (i2[s2] === t2 || i2[s2].listener && i2[s2].listener === t2) {
|
|
2756
|
+
o2 = i2[s2].listener, r2 = s2;
|
|
2757
|
+
break;
|
|
2758
|
+
}
|
|
2759
|
+
if (r2 < 0) return this;
|
|
1841
2760
|
if (1 === i2.length) {
|
|
1842
|
-
if (i2[0] = void 0, 0 === --this._eventsCount)
|
|
1843
|
-
return this._events = new k(), this;
|
|
2761
|
+
if (i2[0] = void 0, 0 === --this._eventsCount) return this._events = new k(), this;
|
|
1844
2762
|
delete n2[e2];
|
|
1845
|
-
} else
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
e3.pop();
|
|
1850
|
-
}(i2, r2);
|
|
2763
|
+
} else !(function(e3, t3) {
|
|
2764
|
+
for (var i3 = t3, n3 = i3 + 1, r3 = e3.length; n3 < r3; i3 += 1, n3 += 1) e3[i3] = e3[n3];
|
|
2765
|
+
e3.pop();
|
|
2766
|
+
})(i2, r2);
|
|
1851
2767
|
n2.removeListener && this.emit("removeListener", e2, o2 || t2);
|
|
1852
2768
|
}
|
|
1853
2769
|
return this;
|
|
@@ -1855,42 +2771,34 @@ var telerikReportViewer = (function (exports) {
|
|
|
1855
2771
|
return this.removeListener(e2, t2);
|
|
1856
2772
|
}, x.prototype.removeAllListeners = function(e2) {
|
|
1857
2773
|
var t2, i2;
|
|
1858
|
-
if (!(i2 = this._events))
|
|
1859
|
-
|
|
1860
|
-
if (!i2.removeListener)
|
|
1861
|
-
return 0 === arguments.length ? (this._events = new k(), this._eventsCount = 0) : i2[e2] && (0 === --this._eventsCount ? this._events = new k() : delete i2[e2]), this;
|
|
2774
|
+
if (!(i2 = this._events)) return this;
|
|
2775
|
+
if (!i2.removeListener) return 0 === arguments.length ? (this._events = new k(), this._eventsCount = 0) : i2[e2] && (0 === --this._eventsCount ? this._events = new k() : delete i2[e2]), this;
|
|
1862
2776
|
if (0 === arguments.length) {
|
|
1863
|
-
for (var n2, r2 = Object.keys(i2), s2 = 0; s2 < r2.length; ++s2)
|
|
1864
|
-
"removeListener" !== (n2 = r2[s2]) && this.removeAllListeners(n2);
|
|
2777
|
+
for (var n2, r2 = Object.keys(i2), s2 = 0; s2 < r2.length; ++s2) "removeListener" !== (n2 = r2[s2]) && this.removeAllListeners(n2);
|
|
1865
2778
|
return this.removeAllListeners("removeListener"), this._events = new k(), this._eventsCount = 0, this;
|
|
1866
2779
|
}
|
|
1867
|
-
if ("function" == typeof (t2 = i2[e2]))
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
this.removeListener(e2, t2[t2.length - 1]);
|
|
1872
|
-
} while (t2[0]);
|
|
2780
|
+
if ("function" == typeof (t2 = i2[e2])) this.removeListener(e2, t2);
|
|
2781
|
+
else if (t2) do {
|
|
2782
|
+
this.removeListener(e2, t2[t2.length - 1]);
|
|
2783
|
+
} while (t2[0]);
|
|
1873
2784
|
return this;
|
|
1874
2785
|
}, x.prototype.listeners = function(e2) {
|
|
1875
2786
|
var t2, i2 = this._events;
|
|
1876
|
-
return i2 && (t2 = i2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : function(e3) {
|
|
1877
|
-
for (var t3 = new Array(e3.length), i3 = 0; i3 < t3.length; ++i3)
|
|
1878
|
-
t3[i3] = e3[i3].listener || e3[i3];
|
|
2787
|
+
return i2 && (t2 = i2[e2]) ? "function" == typeof t2 ? [t2.listener || t2] : (function(e3) {
|
|
2788
|
+
for (var t3 = new Array(e3.length), i3 = 0; i3 < t3.length; ++i3) t3[i3] = e3[i3].listener || e3[i3];
|
|
1879
2789
|
return t3;
|
|
1880
|
-
}(t2) : [];
|
|
2790
|
+
})(t2) : [];
|
|
1881
2791
|
}, x.listenerCount = function(e2, t2) {
|
|
1882
2792
|
return "function" == typeof e2.listenerCount ? e2.listenerCount(t2) : F.call(e2, t2);
|
|
1883
2793
|
}, x.prototype.listenerCount = F, x.prototype.eventNames = function() {
|
|
1884
2794
|
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1885
2795
|
};
|
|
1886
|
-
const z = "function" == typeof Symbol ? Symbol.for("--[[await-event-emitter]]--") : "--[[await-event-emitter]]--";
|
|
2796
|
+
const z = "function" == typeof Symbol ? /* @__PURE__ */ Symbol.for("--[[await-event-emitter]]--") : "--[[await-event-emitter]]--";
|
|
1887
2797
|
function _(e2) {
|
|
1888
|
-
if ("string" != typeof e2 && "symbol" != typeof e2)
|
|
1889
|
-
throw new TypeError("type is not type of string or symbol!");
|
|
2798
|
+
if ("string" != typeof e2 && "symbol" != typeof e2) throw new TypeError("type is not type of string or symbol!");
|
|
1890
2799
|
}
|
|
1891
2800
|
function H(e2) {
|
|
1892
|
-
if ("function" != typeof e2)
|
|
1893
|
-
throw new TypeError("fn is not type of Function!");
|
|
2801
|
+
if ("function" != typeof e2) throw new TypeError("fn is not type of Function!");
|
|
1894
2802
|
}
|
|
1895
2803
|
function U(e2) {
|
|
1896
2804
|
return { [z]: "always", fn: e2 };
|
|
@@ -1937,8 +2845,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1937
2845
|
const i2 = this.listeners(e2);
|
|
1938
2846
|
if ("function" == typeof t2) {
|
|
1939
2847
|
let n2 = -1, r2 = false;
|
|
1940
|
-
for (; (n2 = i2.indexOf(t2)) >= 0; )
|
|
1941
|
-
i2.splice(n2, 1), this._events[e2].splice(n2, 1), r2 = true;
|
|
2848
|
+
for (; (n2 = i2.indexOf(t2)) >= 0; ) i2.splice(n2, 1), this._events[e2].splice(n2, 1), r2 = true;
|
|
1942
2849
|
return r2;
|
|
1943
2850
|
}
|
|
1944
2851
|
return delete this._events[e2];
|
|
@@ -1993,8 +2900,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
1993
2900
|
hasPdfPlugin() {
|
|
1994
2901
|
let e2 = /Firefox[/\s](\d+\.\d+)/.exec(navigator.userAgent);
|
|
1995
2902
|
if (null !== e2 && e2.length > 1) {
|
|
1996
|
-
if (parseFloat(e2[1]) >= 19)
|
|
1997
|
-
return false;
|
|
2903
|
+
if (parseFloat(e2[1]) >= 19) return false;
|
|
1998
2904
|
}
|
|
1999
2905
|
let t2 = navigator.mimeTypes["application/pdf"], i2 = null !== t2 ? t2.enabledPlugin : null;
|
|
2000
2906
|
if (i2) {
|
|
@@ -2009,9 +2915,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2009
2915
|
this.defaultPlugin = e2;
|
|
2010
2916
|
}
|
|
2011
2917
|
hasPdfPlugin() {
|
|
2012
|
-
for (let e2 of navigator.plugins)
|
|
2013
|
-
if (e2.name === this.defaultPlugin || "Adobe Acrobat" === e2.name)
|
|
2014
|
-
return true;
|
|
2918
|
+
for (let e2 of navigator.plugins) if (e2.name === this.defaultPlugin || "Adobe Acrobat" === e2.name) return true;
|
|
2015
2919
|
return false;
|
|
2016
2920
|
}
|
|
2017
2921
|
}
|
|
@@ -2025,20 +2929,19 @@ var telerikReportViewer = (function (exports) {
|
|
|
2025
2929
|
this.hasPdfPlugin = false, this.iframe = null, this.hasPdfPlugin = this.detectPdfSupport(), this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
2026
2930
|
}
|
|
2027
2931
|
detectPdfSupport() {
|
|
2028
|
-
return "boolean" == typeof navigator.pdfViewerEnabled ? navigator.pdfViewerEnabled : function() {
|
|
2932
|
+
return "boolean" == typeof navigator.pdfViewerEnabled ? navigator.pdfViewerEnabled : (function() {
|
|
2029
2933
|
if (window.navigator) {
|
|
2030
2934
|
let e2 = window.navigator.userAgent.toLowerCase();
|
|
2031
2935
|
return e2.indexOf("firefox") > -1 ? new W() : e2.indexOf("edg/") > -1 ? new Z("Microsoft Edge PDF Plugin") : e2.indexOf("chrome") > -1 ? new Z("Chrome PDF Viewer") : e2.indexOf("safari") > -1 ? new Z("WebKit built-in PDF") : new j();
|
|
2032
2936
|
}
|
|
2033
2937
|
return new j();
|
|
2034
|
-
}().hasPdfPlugin();
|
|
2938
|
+
})().hasPdfPlugin();
|
|
2035
2939
|
}
|
|
2036
2940
|
destroy() {
|
|
2037
2941
|
this.iframe = null;
|
|
2038
2942
|
}
|
|
2039
2943
|
printDesktop(e2, t2) {
|
|
2040
|
-
if (!this.hasPdfPlugin)
|
|
2041
|
-
return console.warn("Direct printing is not supported in this browser. The PDF document will be downloaded instead."), void this.printViaDownload(e2, t2);
|
|
2944
|
+
if (!this.hasPdfPlugin) return console.warn("Direct printing is not supported in this browser. The PDF document will be downloaded instead."), void this.printViaDownload(e2, t2);
|
|
2042
2945
|
let i2 = null;
|
|
2043
2946
|
this.iframe || (this.iframe = document.createElement("iframe"), this.iframe.style.display = "none", this.iframe.onload = () => {
|
|
2044
2947
|
var e3, t3;
|
|
@@ -2059,8 +2962,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2059
2962
|
if (200 === i2.status) {
|
|
2060
2963
|
let e3 = URL.createObjectURL(new Blob([i2.response], { type: "application/pdf" })), n2 = document.createElement("a");
|
|
2061
2964
|
n2.href = e3, n2.download = `${t2}.pdf`, n2.click(), URL.revokeObjectURL(e3);
|
|
2062
|
-
} else
|
|
2063
|
-
console.log("Could not retrieve PDF document for printing.");
|
|
2965
|
+
} else console.log("Could not retrieve PDF document for printing.");
|
|
2064
2966
|
}, i2.send();
|
|
2065
2967
|
}
|
|
2066
2968
|
printMobile(e2) {
|
|
@@ -2078,13 +2980,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2078
2980
|
}
|
|
2079
2981
|
class K {
|
|
2080
2982
|
constructor(e2, t2, i2) {
|
|
2081
|
-
if (this.pingMilliseconds = 0, !e2)
|
|
2082
|
-
throw "Error";
|
|
2983
|
+
if (this.pingMilliseconds = 0, !e2) throw "Error";
|
|
2083
2984
|
this.serviceClient = e2, this.clientID = t2, this.initSessionTimeout(i2);
|
|
2084
2985
|
}
|
|
2085
2986
|
initSessionTimeout(e2) {
|
|
2086
|
-
if (!isFinite(e2))
|
|
2087
|
-
throw "sessionTimeoutSeconds must be finite";
|
|
2987
|
+
if (!isFinite(e2)) throw "sessionTimeoutSeconds must be finite";
|
|
2088
2988
|
this.pingMilliseconds = e2 <= 120 ? J(e2) / 2 : J(e2 - 60);
|
|
2089
2989
|
}
|
|
2090
2990
|
start() {
|
|
@@ -2102,14 +3002,12 @@ var telerikReportViewer = (function (exports) {
|
|
|
2102
3002
|
return t2 && (n2.id = t2), ne(n2, i2), n2;
|
|
2103
3003
|
}
|
|
2104
3004
|
function ne(e2, t2) {
|
|
2105
|
-
if ("" === t2 || !e2)
|
|
2106
|
-
return;
|
|
3005
|
+
if ("" === t2 || !e2) return;
|
|
2107
3006
|
let i2 = t2.trim().split(" ");
|
|
2108
3007
|
i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.add(...i2);
|
|
2109
3008
|
}
|
|
2110
3009
|
function re(e2, t2) {
|
|
2111
|
-
if ("" === t2 || !e2)
|
|
2112
|
-
return;
|
|
3010
|
+
if ("" === t2 || !e2) return;
|
|
2113
3011
|
let i2 = t2.trim().split(" ");
|
|
2114
3012
|
i2 = i2.filter((e3) => "" !== e3.trim()), e2.classList.remove(...i2);
|
|
2115
3013
|
}
|
|
@@ -2124,11 +3022,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2124
3022
|
}
|
|
2125
3023
|
function le(e2, t2, i2, n2 = 0, r2 = 0) {
|
|
2126
3024
|
let s2 = `${n2 = n2 || 0} ${r2 = r2 || 0}`;
|
|
2127
|
-
!function(e3, t3) {
|
|
3025
|
+
!(function(e3, t3) {
|
|
2128
3026
|
e3.style.setProperty("transform", t3), e3.style.setProperty("-moz-transform", t3), e3.style.setProperty("-ms-transform", t3), e3.style.setProperty("-webkit-transform", t3), e3.style.setProperty("-o-transform", t3);
|
|
2129
|
-
}(e2, `scale(${t2 = t2 || 1}, ${i2 = i2 || 1})`), function(e3, t3) {
|
|
3027
|
+
})(e2, `scale(${t2 = t2 || 1}, ${i2 = i2 || 1})`), (function(e3, t3) {
|
|
2130
3028
|
e3.style.setProperty("transform-origin", t3), e3.style.setProperty("-moz-transform-origin", t3), e3.style.setProperty("-ms-transform-origin", t3), e3.style.setProperty("-webkit-transform-origin", t3), e3.style.setProperty("-o-transform-origin", t3);
|
|
2131
|
-
}(e2, s2);
|
|
3029
|
+
})(e2, s2);
|
|
2132
3030
|
}
|
|
2133
3031
|
function he(e2) {
|
|
2134
3032
|
let t2 = ie("div");
|
|
@@ -2137,8 +3035,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2137
3035
|
function ce(e2) {
|
|
2138
3036
|
if (e2 && e2.length < 6) {
|
|
2139
3037
|
let t3 = 1, i2 = e2.split("");
|
|
2140
|
-
for ("#" !== i2[0] && (t3 = 0); t3 < i2.length; t3++)
|
|
2141
|
-
i2[t3] = i2[t3] + i2[t3];
|
|
3038
|
+
for ("#" !== i2[0] && (t3 = 0); t3 < i2.length; t3++) i2[t3] = i2[t3] + i2[t3];
|
|
2142
3039
|
e2 = i2.join("");
|
|
2143
3040
|
}
|
|
2144
3041
|
let t2 = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e2);
|
|
@@ -2148,14 +3045,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2148
3045
|
return !!e2 && e2.indexOf(",") > -1;
|
|
2149
3046
|
}
|
|
2150
3047
|
function ue(e2) {
|
|
2151
|
-
if ("transparent" === e2.toLowerCase())
|
|
2152
|
-
|
|
2153
|
-
if (!de(e2))
|
|
2154
|
-
return 1;
|
|
3048
|
+
if ("transparent" === e2.toLowerCase()) return 0;
|
|
3049
|
+
if (!de(e2)) return 1;
|
|
2155
3050
|
if (-1 !== e2.indexOf("#")) {
|
|
2156
3051
|
let t3 = ce(e2);
|
|
2157
|
-
if (null === t3)
|
|
2158
|
-
return 1;
|
|
3052
|
+
if (null === t3) return 1;
|
|
2159
3053
|
e2 = t3;
|
|
2160
3054
|
}
|
|
2161
3055
|
let t2 = e2.split(",").map(function(e3) {
|
|
@@ -2165,13 +3059,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2165
3059
|
}
|
|
2166
3060
|
function pe(e2, t2) {
|
|
2167
3061
|
let i2 = ie("div");
|
|
2168
|
-
for (i2.innerHTML = t2; i2.childNodes.length; )
|
|
2169
|
-
e2.appendChild(i2.childNodes[0]);
|
|
3062
|
+
for (i2.innerHTML = t2; i2.childNodes.length; ) e2.appendChild(i2.childNodes[0]);
|
|
2170
3063
|
}
|
|
2171
3064
|
function ge(e2, t2) {
|
|
2172
3065
|
let i2 = ie("div");
|
|
2173
|
-
for (i2.innerHTML = t2; i2.childNodes.length; )
|
|
2174
|
-
e2.prepend(i2.childNodes[i2.childNodes.length - 1]);
|
|
3066
|
+
for (i2.innerHTML = t2; i2.childNodes.length; ) e2.prepend(i2.childNodes[i2.childNodes.length - 1]);
|
|
2175
3067
|
}
|
|
2176
3068
|
function fe(e2, t2) {
|
|
2177
3069
|
return e2 ? e2.querySelector(t2) : null;
|
|
@@ -2211,18 +3103,12 @@ var telerikReportViewer = (function (exports) {
|
|
|
2211
3103
|
}
|
|
2212
3104
|
function we(e2, t2) {
|
|
2213
3105
|
let i2, n2;
|
|
2214
|
-
if (Le(e2))
|
|
2215
|
-
|
|
2216
|
-
;
|
|
2217
|
-
else
|
|
2218
|
-
for (n2 in e2)
|
|
2219
|
-
if (false === t2.call(e2[n2], n2, e2[n2]))
|
|
2220
|
-
break;
|
|
3106
|
+
if (Le(e2)) for (i2 = e2.length, n2 = 0; n2 < i2 && false !== t2.call(e2[n2], n2, e2[n2]); n2++) ;
|
|
3107
|
+
else for (n2 in e2) if (false === t2.call(e2[n2], n2, e2[n2])) break;
|
|
2221
3108
|
return e2;
|
|
2222
3109
|
}
|
|
2223
3110
|
function Le(e2) {
|
|
2224
|
-
if (Array.isArray(e2))
|
|
2225
|
-
return true;
|
|
3111
|
+
if (Array.isArray(e2)) return true;
|
|
2226
3112
|
return "number" == typeof (!!e2 && "length" in e2 && e2.length);
|
|
2227
3113
|
}
|
|
2228
3114
|
function Te(e2) {
|
|
@@ -2236,28 +3122,26 @@ var telerikReportViewer = (function (exports) {
|
|
|
2236
3122
|
}
|
|
2237
3123
|
e.PageMode = void 0, (X = e.PageMode || (e.PageMode = {}))[X.ContinuousScroll = 0] = "ContinuousScroll", X[X.SinglePage = 1] = "SinglePage", e.PrintMode = void 0, (Y = e.PrintMode || (e.PrintMode = {}))[Y.AutoSelect = 0] = "AutoSelect", Y[Y.ForcePDFPlugin = 1] = "ForcePDFPlugin", Y[Y.ForcePDFFile = 2] = "ForcePDFFile", e.ScaleMode = void 0, (Q = e.ScaleMode || (e.ScaleMode = {}))[Q.FitPageWidth = 0] = "FitPageWidth", Q[Q.FitPage = 1] = "FitPage", Q[Q.Specific = 2] = "Specific", e.ServiceType = void 0, (ee = e.ServiceType || (e.ServiceType = {}))[ee.REST = 0] = "REST", ee[ee.ReportServer = 1] = "ReportServer", e.ViewMode = void 0, (te = e.ViewMode || (e.ViewMode = {}))[te.Interactive = 0] = "Interactive", te[te.PrintPreview = 1] = "PrintPreview";
|
|
2238
3124
|
const Ee = "System.Int64", Me = "System.Double", ke = "System.String", xe = "System.DateTime", Ne = "System.Boolean";
|
|
2239
|
-
var De = function() {
|
|
3125
|
+
var De = (function() {
|
|
2240
3126
|
var e2 = {};
|
|
2241
3127
|
function t2(e3, t3, i3, n2) {
|
|
2242
3128
|
var r2 = [].concat(t3).map(function(t4) {
|
|
2243
|
-
return function(e4, t5, i4) {
|
|
3129
|
+
return (function(e4, t5, i4) {
|
|
2244
3130
|
if (e4.availableValues) {
|
|
2245
3131
|
var n3 = false;
|
|
2246
3132
|
if (we(e4.availableValues, function(e5, r3) {
|
|
2247
3133
|
return !(n3 = i4(t5, r3.value));
|
|
2248
3134
|
}), !n3) {
|
|
2249
|
-
if (e4.allowNull && !t5)
|
|
2250
|
-
return t5;
|
|
3135
|
+
if (e4.allowNull && !t5) return t5;
|
|
2251
3136
|
throw "Please input a valid value.";
|
|
2252
3137
|
}
|
|
2253
3138
|
}
|
|
2254
3139
|
return t5;
|
|
2255
|
-
}(e3, i3(t4), n2);
|
|
3140
|
+
})(e3, i3(t4), n2);
|
|
2256
3141
|
});
|
|
2257
3142
|
if (e3.multivalue) {
|
|
2258
3143
|
if (null == t3 || 0 == t3.length) {
|
|
2259
|
-
if (e3.allowNull)
|
|
2260
|
-
return t3;
|
|
3144
|
+
if (e3.allowNull) return t3;
|
|
2261
3145
|
throw "Please input a valid value.";
|
|
2262
3146
|
}
|
|
2263
3147
|
return r2;
|
|
@@ -2270,10 +3154,8 @@ var telerikReportViewer = (function (exports) {
|
|
|
2270
3154
|
return e2[ke] = { validate: function(e3, i3) {
|
|
2271
3155
|
return t2(e3, i3, function(t3) {
|
|
2272
3156
|
if (!t3) {
|
|
2273
|
-
if (e3.allowNull)
|
|
2274
|
-
|
|
2275
|
-
if (e3.allowBlank)
|
|
2276
|
-
return "";
|
|
3157
|
+
if (e3.allowNull) return null;
|
|
3158
|
+
if (e3.allowBlank) return "";
|
|
2277
3159
|
throw "Parameter value cannot be empty.";
|
|
2278
3160
|
}
|
|
2279
3161
|
return t3;
|
|
@@ -2284,8 +3166,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2284
3166
|
return t2(e3, n2, function(t3) {
|
|
2285
3167
|
var n3 = Re(t3);
|
|
2286
3168
|
if (isNaN(n3)) {
|
|
2287
|
-
if (i2(e3, t3))
|
|
2288
|
-
return null;
|
|
3169
|
+
if (i2(e3, t3)) return null;
|
|
2289
3170
|
throw "Parameter value cannot be empty.";
|
|
2290
3171
|
}
|
|
2291
3172
|
return n3;
|
|
@@ -2296,8 +3177,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2296
3177
|
return t2(e3, n2, function(t3) {
|
|
2297
3178
|
var n3 = Te(t3);
|
|
2298
3179
|
if (isNaN(n3)) {
|
|
2299
|
-
if (i2(e3, t3))
|
|
2300
|
-
return null;
|
|
3180
|
+
if (i2(e3, t3)) return null;
|
|
2301
3181
|
throw "Parameter value cannot be empty.";
|
|
2302
3182
|
}
|
|
2303
3183
|
return n3;
|
|
@@ -2306,37 +3186,31 @@ var telerikReportViewer = (function (exports) {
|
|
|
2306
3186
|
});
|
|
2307
3187
|
} }, e2[xe] = { validate: function(e3, i3) {
|
|
2308
3188
|
return t2(e3, i3, function(t3) {
|
|
2309
|
-
if (e3.allowNull && (null === t3 || "" === t3 || void 0 === t3))
|
|
2310
|
-
|
|
2311
|
-
if (!isNaN(Date.parse(t3)))
|
|
2312
|
-
return e3.availableValues ? t3 : Ae(t3);
|
|
3189
|
+
if (e3.allowNull && (null === t3 || "" === t3 || void 0 === t3)) return null;
|
|
3190
|
+
if (!isNaN(Date.parse(t3))) return e3.availableValues ? t3 : Ae(t3);
|
|
2313
3191
|
throw "Please input a valid date.";
|
|
2314
3192
|
}, function(e4, t3) {
|
|
2315
3193
|
return e4 = Ae(e4), t3 = Ae(t3), e4.getTime() == t3.getTime();
|
|
2316
3194
|
});
|
|
2317
3195
|
} }, e2[Ne] = { validate: function(e3, n2) {
|
|
2318
3196
|
return t2(e3, n2, function(t3) {
|
|
2319
|
-
if (-1 != ["true", "false"].indexOf(String(t3).toLowerCase()))
|
|
2320
|
-
|
|
2321
|
-
if (i2(e3, t3))
|
|
2322
|
-
return null;
|
|
3197
|
+
if (-1 != ["true", "false"].indexOf(String(t3).toLowerCase())) return Boolean(t3);
|
|
3198
|
+
if (i2(e3, t3)) return null;
|
|
2323
3199
|
throw "Parameter value cannot be empty.";
|
|
2324
3200
|
}, function(e4, t3) {
|
|
2325
3201
|
return Boolean(e4) == Boolean(t3);
|
|
2326
3202
|
});
|
|
2327
3203
|
} }, { validate: function(t3, i3) {
|
|
2328
3204
|
var n2 = e2[t3.type];
|
|
2329
|
-
if (!n2)
|
|
2330
|
-
throw be("Cannot validate parameter of type {type}.", t3);
|
|
3205
|
+
if (!n2) throw be("Cannot validate parameter of type {type}.", t3);
|
|
2331
3206
|
return n2.validate(t3, i3);
|
|
2332
3207
|
} };
|
|
2333
|
-
}();
|
|
3208
|
+
})();
|
|
2334
3209
|
function Ve(e2, t2, i2) {
|
|
2335
3210
|
try {
|
|
2336
3211
|
const n2 = e2.availableValues.find((e3) => e3.value === t2);
|
|
2337
3212
|
if (!n2) {
|
|
2338
|
-
if (e2.allowNull && null === t2)
|
|
2339
|
-
return { valueMember: null, displayMember: null };
|
|
3213
|
+
if (e2.allowNull && null === t2) return { valueMember: null, displayMember: null };
|
|
2340
3214
|
throw new Error(`The available values of parameter ${i2} do not contain Value property that equals ${t2}`);
|
|
2341
3215
|
}
|
|
2342
3216
|
return { valueMember: t2, displayMember: n2.name };
|
|
@@ -2346,8 +3220,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2346
3220
|
}
|
|
2347
3221
|
function Fe(e2, t2, i2) {
|
|
2348
3222
|
const n2 = [];
|
|
2349
|
-
for (let r2 in t2)
|
|
2350
|
-
n2.push(Ve(e2, t2[r2], i2));
|
|
3223
|
+
for (let r2 in t2) n2.push(Ve(e2, t2[r2], i2));
|
|
2351
3224
|
return n2;
|
|
2352
3225
|
}
|
|
2353
3226
|
class Oe {
|
|
@@ -2447,22 +3320,19 @@ var telerikReportViewer = (function (exports) {
|
|
|
2447
3320
|
generateSkeletonScreens(e2) {
|
|
2448
3321
|
var t2;
|
|
2449
3322
|
let i2 = "", n2 = null === (t2 = this.findLastElement(".trv-report-page")) || void 0 === t2 ? void 0 : t2.dataset.page, r2 = n2 ? parseInt(n2) + 1 : 1;
|
|
2450
|
-
for (; r2 < e2; r2++)
|
|
2451
|
-
i2 += be(_e, r2);
|
|
3323
|
+
for (; r2 < e2; r2++) i2 += be(_e, r2);
|
|
2452
3324
|
pe(this.pageWrapper, i2);
|
|
2453
3325
|
}
|
|
2454
3326
|
loadMorePages() {
|
|
2455
3327
|
var e2;
|
|
2456
3328
|
let t2 = this.controller.getPageCount(), i2 = this.pageContainer.offsetHeight > this.pageWrapper.offsetHeight;
|
|
2457
|
-
if (t2 > 1)
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
} else
|
|
2465
|
-
this.loadVisiblePages(), this.scrollInProgress = false;
|
|
3329
|
+
if (t2 > 1) if (i2) {
|
|
3330
|
+
this.scrollInProgress = true;
|
|
3331
|
+
let i3 = null === (e2 = this.findLastElement(".trv-report-page")) || void 0 === e2 ? void 0 : e2.dataset.page, n2 = i3 ? parseInt(i3) + 1 : 1;
|
|
3332
|
+
n2 <= t2 && this.getAndRenderPage(n2).then(() => {
|
|
3333
|
+
this.loadMorePages(), this.scrollInProgress = false;
|
|
3334
|
+
});
|
|
3335
|
+
} else this.loadVisiblePages(), this.scrollInProgress = false;
|
|
2466
3336
|
}
|
|
2467
3337
|
loadVisiblePages() {
|
|
2468
3338
|
this.placeholder.querySelectorAll(".trv-report-page").forEach((e2) => {
|
|
@@ -2471,18 +3341,15 @@ var telerikReportViewer = (function (exports) {
|
|
|
2471
3341
|
});
|
|
2472
3342
|
}
|
|
2473
3343
|
scrolledInToView(e2) {
|
|
2474
|
-
if (!e2)
|
|
2475
|
-
return false;
|
|
3344
|
+
if (!e2) return false;
|
|
2476
3345
|
let t2 = e2.getBoundingClientRect(), i2 = e2.closest(".trv-pages-pane");
|
|
2477
|
-
if (!i2)
|
|
2478
|
-
return false;
|
|
3346
|
+
if (!i2) return false;
|
|
2479
3347
|
let n2 = i2.getBoundingClientRect(), r2 = n2.top, s2 = n2.bottom, o2 = t2.top, a2 = t2.bottom, l2 = this.additionalTopOffset + r2;
|
|
2480
3348
|
return o2 > 0 && o2 < s2 || a2 < s2 && a2 > l2;
|
|
2481
3349
|
}
|
|
2482
3350
|
render(e2, t2) {
|
|
2483
3351
|
let i2 = e2.pageNumber, n2 = this.findPageElement(i2);
|
|
2484
|
-
if (!t2 && n2 && !this.isSkeletonScreen(n2, i2))
|
|
2485
|
-
return;
|
|
3352
|
+
if (!t2 && n2 && !this.isSkeletonScreen(n2, i2)) return;
|
|
2486
3353
|
(null == this.lastLoadedPage || this.lastLoadedPage.pageNumber < e2.pageNumber) && (this.lastLoadedPage = e2), this.contentArea.updatePageStyle(this.lastLoadedPage);
|
|
2487
3354
|
let r2 = this.contentArea.renderPageElement(e2);
|
|
2488
3355
|
t2 && (this.pageWrapper.innerHTML = ""), this.pageWrapper.dataset.pageNumber = i2.toString();
|
|
@@ -2514,8 +3381,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2514
3381
|
clickPage(e2) {
|
|
2515
3382
|
var t2;
|
|
2516
3383
|
let i2 = null === (t2 = e2.target) || void 0 === t2 ? void 0 : t2.closest(".trv-report-page");
|
|
2517
|
-
if (!i2)
|
|
2518
|
-
return;
|
|
3384
|
+
if (!i2) return;
|
|
2519
3385
|
let n2 = this.currentPageNumber(), r2 = parseInt(i2.dataset.page || "");
|
|
2520
3386
|
n2 !== r2 && (this.isSkeletonScreen(i2, r2) ? this.getAndRenderPage(r2).then((e3) => {
|
|
2521
3387
|
this.setCurrentPage(e3.pageNumber);
|
|
@@ -2528,8 +3394,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2528
3394
|
i2 === e3 || n2 || (this.isSkeletonScreen(t2, e3) ? this.getAndRenderPage(e3).then((e4) => {
|
|
2529
3395
|
this.setCurrentPage(e4.pageNumber);
|
|
2530
3396
|
}) : this.setCurrentPage(e3));
|
|
2531
|
-
} else
|
|
2532
|
-
console.log("Page not found - ", t2);
|
|
3397
|
+
} else console.log("Page not found - ", t2);
|
|
2533
3398
|
}
|
|
2534
3399
|
findNewCurrentPage(e2) {
|
|
2535
3400
|
let t2 = Math.floor(e2.length / 2), i2 = this.findPageInViewPort(t2, e2);
|
|
@@ -2537,8 +3402,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2537
3402
|
}
|
|
2538
3403
|
findPageInViewPort(e2, t2) {
|
|
2539
3404
|
let i2 = t2[e2], n2 = i2.getBoundingClientRect(), r2 = i2.closest(".trv-pages-pane");
|
|
2540
|
-
if (!r2)
|
|
2541
|
-
return -1;
|
|
3405
|
+
if (!r2) return -1;
|
|
2542
3406
|
let s2 = r2.getBoundingClientRect().top, o2 = n2.top, a2 = n2.bottom, l2 = this.additionalTopOffset + s2;
|
|
2543
3407
|
return o2 <= l2 && l2 < a2 ? 0 : a2 < l2 ? -1 : 1;
|
|
2544
3408
|
}
|
|
@@ -2546,8 +3410,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2546
3410
|
if (t2 >= this.pageContainer.scrollHeight - 5) {
|
|
2547
3411
|
let t3 = parseInt(e2[e2.length - 1].dataset.page || "") + 1;
|
|
2548
3412
|
this.currentPageNumber() < t3 && t3 <= this.controller.getPageCount() && (this.addSkeletonScreen(t3, false), this.getAndRenderPage(t3));
|
|
2549
|
-
} else
|
|
2550
|
-
this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
3413
|
+
} else this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
2551
3414
|
}
|
|
2552
3415
|
scrollUp(e2) {
|
|
2553
3416
|
if (0 === this.pageContainer.scrollTop) {
|
|
@@ -2555,13 +3418,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2555
3418
|
this.currentPageNumber() > t2 && t2 >= 1 && (this.addSkeletonScreen(t2, true), this.getAndRenderPage(t2).then(() => {
|
|
2556
3419
|
this.pageContainer.scrollTop = 3;
|
|
2557
3420
|
}));
|
|
2558
|
-
} else
|
|
2559
|
-
this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
3421
|
+
} else this.advanceCurrentPage(e2), this.loadVisiblePages();
|
|
2560
3422
|
}
|
|
2561
3423
|
keepCurrentPageInToView() {
|
|
2562
3424
|
let e2 = this.findPageElement(this.currentPageNumber());
|
|
2563
|
-
if (!e2)
|
|
2564
|
-
return;
|
|
3425
|
+
if (!e2) return;
|
|
2565
3426
|
let t2 = e2.offsetTop, i2 = e2.offsetHeight, n2 = this.pageContainer.offsetHeight;
|
|
2566
3427
|
if (this.scrollInProgress = true, i2 < n2) {
|
|
2567
3428
|
t2 -= (n2 - i2) / 2;
|
|
@@ -2652,14 +3513,12 @@ var telerikReportViewer = (function (exports) {
|
|
|
2652
3513
|
updateFreezeItemsOnScroll(e2, t2, i2) {
|
|
2653
3514
|
var n2, r2;
|
|
2654
3515
|
let s2 = fe(this.placeholder, "div[data-id='" + e2 + "']");
|
|
2655
|
-
if (!s2)
|
|
2656
|
-
return;
|
|
3516
|
+
if (!s2) return;
|
|
2657
3517
|
let o2 = null === (n2 = this.placeholder) || void 0 === n2 ? void 0 : n2.querySelectorAll("[data-sticky-direction*='Horizontal'][data-sticky-id='" + e2 + "']"), a2 = null === (r2 = this.placeholder) || void 0 === r2 ? void 0 : r2.querySelectorAll("[data-sticky-direction*='Vertical'][data-sticky-id='" + e2 + "']");
|
|
2658
3518
|
if (this.isInScrollVisibleArea(s2)) {
|
|
2659
3519
|
let n3 = s2.closest(".trv-report-page"), r3 = getComputedStyle(n3), l2 = parseFloat(r3.marginLeft), h2 = parseFloat(r3.paddingTop), c2 = parseFloat(r3.paddingLeft), d2 = parseFloat(r3.borderTopWidth), u2 = parseFloat(r3.borderLeftWidth), p2 = o2.length > 0, g2 = a2.length > 0, f2 = s2.offsetTop + ((null == n3 ? void 0 : n3.offsetTop) || 0) + l2 + h2 + d2, m2 = s2.offsetLeft + ((null == n3 ? void 0 : n3.offsetLeft) || 0) + c2 + u2, v2 = t2 - f2, P2 = i2 - m2;
|
|
2660
3520
|
g2 && v2 > 0 ? t2 <= s2.offsetHeight * this.scaleFactor + f2 - this.yFrozenAreasBounds[e2] && (this.currentlyFrozenContainer.vertical[e2] = true, this.updateUIElementsPosition(a2, "top", v2 / this.scaleFactor, e2)) : this.currentlyFrozenContainer.vertical[e2] && (delete this.currentlyFrozenContainer.vertical[e2], this.updateUIElementsPosition(a2, "top", -1, e2)), p2 && P2 > 0 ? i2 <= s2.offsetWidth * this.scaleFactor + m2 - this.xFrozenAreasBounds[e2] && (this.currentlyFrozenContainer.horizontal[e2] = true, this.updateUIElementsPosition(o2, "left", P2 / this.scaleFactor, e2)) : this.currentlyFrozenContainer.horizontal[e2] && (delete this.currentlyFrozenContainer.horizontal[e2], this.updateUIElementsPosition(o2, "left", -1, e2));
|
|
2661
|
-
} else
|
|
2662
|
-
(this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2]) && this.resetToDefaultPosition(e2, o2, a2);
|
|
3521
|
+
} else (this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2]) && this.resetToDefaultPosition(e2, o2, a2);
|
|
2663
3522
|
}
|
|
2664
3523
|
resetToDefaultPosition(e2, t2, i2) {
|
|
2665
3524
|
this.updateUIElementsPosition(i2, "top", -1, e2), this.updateUIElementsPosition(t2, "left", -1, e2), delete this.currentlyFrozenContainer.horizontal[e2], delete this.currentlyFrozenContainer.vertical[e2];
|
|
@@ -2682,8 +3541,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2682
3541
|
return this.currentlyFrozenContainer.horizontal[e2] || this.currentlyFrozenContainer.vertical[e2];
|
|
2683
3542
|
}
|
|
2684
3543
|
isInScrollVisibleArea(e2) {
|
|
2685
|
-
if (!this.scrollableContainer)
|
|
2686
|
-
return false;
|
|
3544
|
+
if (!this.scrollableContainer) return false;
|
|
2687
3545
|
const t2 = e2.getBoundingClientRect(), i2 = this.scrollableContainer.getBoundingClientRect();
|
|
2688
3546
|
return this.isVisibleVertically(t2, this.scrollableContainer, i2) && this.isVisibleHorizontally(t2, this.scrollableContainer, i2);
|
|
2689
3547
|
}
|
|
@@ -2796,18 +3654,14 @@ var telerikReportViewer = (function (exports) {
|
|
|
2796
3654
|
}
|
|
2797
3655
|
findPage(t2) {
|
|
2798
3656
|
let i2 = this.pageContainer.querySelectorAll(".trv-report-page");
|
|
2799
|
-
if (this.controller.getPageMode() === e.PageMode.SinglePage)
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
let i3 = e2;
|
|
2808
|
-
if (parseInt((null == i3 ? void 0 : i3.dataset.page) || "-1") === t2)
|
|
2809
|
-
return i3;
|
|
2810
|
-
}
|
|
3657
|
+
if (this.controller.getPageMode() === e.PageMode.SinglePage) for (let e2 of Array.from(i2)) {
|
|
3658
|
+
let i3 = e2;
|
|
3659
|
+
if (this.pageNo(i3) === t2) return i3;
|
|
3660
|
+
}
|
|
3661
|
+
else for (let e2 of Array.from(i2)) {
|
|
3662
|
+
let i3 = e2;
|
|
3663
|
+
if (parseInt((null == i3 ? void 0 : i3.dataset.page) || "-1") === t2) return i3;
|
|
3664
|
+
}
|
|
2811
3665
|
return null;
|
|
2812
3666
|
}
|
|
2813
3667
|
navigateToPage(e2, t2) {
|
|
@@ -2841,13 +3695,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
2841
3695
|
e3 += n2.offsetTop, i3 += n2.offsetLeft, n2 = oe(n2);
|
|
2842
3696
|
}
|
|
2843
3697
|
this.scrollManager.getEnabled() && t2 ? this.scrollManager.navigateToElement(e3, t2) : (this.pageContainer.scrollTop = e3, this.pageContainer.scrollLeft = i3);
|
|
2844
|
-
} else
|
|
2845
|
-
this.scrollManager.getEnabled() && t2 && this.scrollManager.navigateToElement((null === (i2 = this.placeholder) || void 0 === i2 ? void 0 : i2.querySelector('[data-page="' + t2 + '"]')).offsetTop, t2);
|
|
3698
|
+
} else this.scrollManager.getEnabled() && t2 && this.scrollManager.navigateToElement((null === (i2 = this.placeholder) || void 0 === i2 ? void 0 : i2.querySelector('[data-page="' + t2 + '"]')).offsetTop, t2);
|
|
2846
3699
|
}
|
|
2847
3700
|
}
|
|
2848
3701
|
findNextFocusableElement(e2) {
|
|
2849
|
-
if (!e2)
|
|
2850
|
-
return null;
|
|
3702
|
+
if (!e2) return null;
|
|
2851
3703
|
let t2 = e2.tabIndex;
|
|
2852
3704
|
return !isNaN(t2) && t2 > -1 ? e2 : this.findNextFocusableElement(e2.nextElementSibling);
|
|
2853
3705
|
}
|
|
@@ -2883,13 +3735,10 @@ var telerikReportViewer = (function (exports) {
|
|
|
2883
3735
|
}
|
|
2884
3736
|
setPageDimensions(t2, i2 = 0) {
|
|
2885
3737
|
let n2 = i2 ? t2 : t2.querySelector("div.trv-report-page");
|
|
2886
|
-
if (!n2)
|
|
2887
|
-
return;
|
|
3738
|
+
if (!n2) return;
|
|
2888
3739
|
let r2, s2 = n2.querySelector("div.sheet"), o2 = n2.querySelector("div.trv-skeleton-wrapper");
|
|
2889
|
-
if (s2 = s2 || o2, !s2)
|
|
2890
|
-
|
|
2891
|
-
if (n2.dataset.box)
|
|
2892
|
-
r2 = JSON.parse(n2.dataset.box);
|
|
3740
|
+
if (s2 = s2 || o2, !s2) return;
|
|
3741
|
+
if (n2.dataset.box) r2 = JSON.parse(n2.dataset.box);
|
|
2893
3742
|
else {
|
|
2894
3743
|
let e2 = getComputedStyle(n2), i3 = getComputedStyle(t2);
|
|
2895
3744
|
r2 = { padLeft: ae(i3.marginLeft) + ae(e2.borderLeftWidth) + ae(e2.paddingLeft), padRight: ae(i3.marginRight) + ae(e2.borderRightWidth) + ae(e2.paddingRight), padTop: ae(i3.marginTop) + ae(e2.borderTopWidth) + ae(e2.paddingTop), padBottom: ae(i3.marginBottom) + ae(e2.borderBottomWidth) + ae(e2.paddingBottom) }, n2.dataset.box = JSON.stringify(r2);
|
|
@@ -2950,8 +3799,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
2950
3799
|
getAction(e2) {
|
|
2951
3800
|
if (this.actions) {
|
|
2952
3801
|
let t2 = this.actions.find((t3) => t3.Id === e2);
|
|
2953
|
-
if (t2)
|
|
2954
|
-
return t2;
|
|
3802
|
+
if (t2) return t2;
|
|
2955
3803
|
}
|
|
2956
3804
|
return null;
|
|
2957
3805
|
}
|
|
@@ -3059,8 +3907,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3059
3907
|
});
|
|
3060
3908
|
}
|
|
3061
3909
|
refreshReport(e2, t2, i2 = false, n2 = false) {
|
|
3062
|
-
if (n2 || this.emit("loadedReportChange"), this.cancelLoad = false, this.respectAutoRun = i2 || this.respectAutoRun, this.clientHasExpired && (this.clientHasExpired = false, this.clearClientId()), "" == this.getReport())
|
|
3063
|
-
return void this.emit("noReport");
|
|
3910
|
+
if (n2 || this.emit("loadedReportChange"), this.cancelLoad = false, this.respectAutoRun = i2 || this.respectAutoRun, this.clientHasExpired && (this.clientHasExpired = false, this.clearClientId()), "" == this.getReport()) return void this.emit("noReport");
|
|
3064
3911
|
let r2 = this.loadParameters();
|
|
3065
3912
|
r2.then((i3) => {
|
|
3066
3913
|
this.emit("parametersLoaded", i3);
|
|
@@ -3069,18 +3916,16 @@ var telerikReportViewer = (function (exports) {
|
|
|
3069
3916
|
}
|
|
3070
3917
|
processParameters(e2) {
|
|
3071
3918
|
let t2 = {}, i2 = [], n2 = false;
|
|
3072
|
-
for (let r2 of e2)
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
}
|
|
3919
|
+
for (let r2 of e2) try {
|
|
3920
|
+
let e3 = De.validate(r2, r2.value);
|
|
3921
|
+
t2[r2.id] = e3;
|
|
3922
|
+
} catch (e3) {
|
|
3923
|
+
n2 = true, i2.push(r2);
|
|
3924
|
+
}
|
|
3079
3925
|
return n2 ? this.missingOrInvalidParameters(i2) : this.setParameters(t2), n2;
|
|
3080
3926
|
}
|
|
3081
3927
|
allParametersAutoRefresh(e2) {
|
|
3082
|
-
if (!e2 || !e2.length)
|
|
3083
|
-
return true;
|
|
3928
|
+
if (!e2 || !e2.length) return true;
|
|
3084
3929
|
return Array.from(e2).every((e3) => !e3.isVisible || e3.autoRefresh);
|
|
3085
3930
|
}
|
|
3086
3931
|
allParametersValidForAutoRefresh(e2, t2) {
|
|
@@ -3092,12 +3937,11 @@ var telerikReportViewer = (function (exports) {
|
|
|
3092
3937
|
return i2;
|
|
3093
3938
|
}
|
|
3094
3939
|
hasInvalidParameter(e2) {
|
|
3095
|
-
for (const t2 of e2)
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
}
|
|
3940
|
+
for (const t2 of e2) try {
|
|
3941
|
+
De.validate(t2, t2.value);
|
|
3942
|
+
} catch (e3) {
|
|
3943
|
+
return true;
|
|
3944
|
+
}
|
|
3101
3945
|
return false;
|
|
3102
3946
|
}
|
|
3103
3947
|
refreshReportCore(e2, t2 = "", i2 = "") {
|
|
@@ -3187,23 +4031,19 @@ var telerikReportViewer = (function (exports) {
|
|
|
3187
4031
|
} catch (e3) {
|
|
3188
4032
|
return void this.raiseError(e3 instanceof Error ? e3.message : String(e3));
|
|
3189
4033
|
}
|
|
3190
|
-
if (!e2.cancel)
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
let e3 = t2.Value;
|
|
3204
|
-
window.open(e3.Url, e3.Target);
|
|
3205
|
-
} else
|
|
3206
|
-
t2.Type;
|
|
4034
|
+
if (!e2.cancel) if ("navigateToReport" === t2.Type) {
|
|
4035
|
+
this.emit("serverActionStarted");
|
|
4036
|
+
let e3 = t2.Value, i2 = this.fixDataContractJsonSerializer(e3.ParameterValues);
|
|
4037
|
+
this.respectAutoRun = true, this.emit("navigateToReport", new Oe(e3.Report, i2));
|
|
4038
|
+
} else if ("navigateToBookmark" === t2.Type) {
|
|
4039
|
+
let e3 = this.getPageForBookmark(this.bookmarkNodes, t2.Value), i2 = new h(t2.Value, "bookmark");
|
|
4040
|
+
this.navigateToPage(e3, i2);
|
|
4041
|
+
} else if ("sorting" === t2.Type) this.execServerAction(t2.Id);
|
|
4042
|
+
else if ("toggleVisibility" === t2.Type) this.execServerAction(t2.Id);
|
|
4043
|
+
else if ("navigateToUrl" === t2.Type) {
|
|
4044
|
+
let e3 = t2.Value;
|
|
4045
|
+
window.open(e3.Url, e3.Target);
|
|
4046
|
+
} else t2.Type;
|
|
3207
4047
|
}), 0);
|
|
3208
4048
|
}
|
|
3209
4049
|
reportActionEnter(e2) {
|
|
@@ -3242,8 +4082,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3242
4082
|
let t2 = this.createDeviceInfo(), i2 = new c(t2, e2);
|
|
3243
4083
|
if (yield this.emitAsync("exportStart", i2), !i2.isCancelled) {
|
|
3244
4084
|
let t3 = new d(i2.deviceInfo, i2.format);
|
|
3245
|
-
if (yield this.emitAsync("exportStarted", t3), this.emit("exportStarted", t3), t3.handled)
|
|
3246
|
-
return;
|
|
4085
|
+
if (yield this.emitAsync("exportStarted", t3), this.emit("exportStarted", t3), t3.handled) return;
|
|
3247
4086
|
this.showNotification(this.options.messages.ReportViewer_PreparingDownload), this.setUIState("ExportInProgress", true), this.exportAsync(t3.format, t3.deviceInfo).then((t4) => s(this, void 0, void 0, function* () {
|
|
3248
4087
|
let i3 = this.serviceClient.getDocumentUrl(this.clientId, this.reportInstanceId, t4);
|
|
3249
4088
|
i3 += "?response-content-disposition=attachment";
|
|
@@ -3269,9 +4108,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3269
4108
|
}
|
|
3270
4109
|
createAIThread() {
|
|
3271
4110
|
return this.serviceClient.createAIThread(this.clientId, this.reportInstanceId, this.getReport(), this.parameterValues).catch((e2) => this.raiseError(e2.exceptionMessage, false)).then((e2) => {
|
|
3272
|
-
if (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2.consentMessage && (e2.consentMessage = r.default.sanitize(e2.consentMessage, { USE_PROFILES: { html: true } }), r.default.removed && r.default.removed.length > 0 && console.warn("The AI-Powered Insights consent message was sanitized as it contained potentially malicious HTML elements or attributes.")), e2.predefinedPrompts)
|
|
3273
|
-
for (let t2 = 0; t2 < e2.predefinedPrompts.length; t2++)
|
|
3274
|
-
e2.predefinedPrompts[t2] = r.default.sanitize(e2.predefinedPrompts[t2], { USE_PROFILES: { html: true } }), r.default.removed && r.default.removed.length > 0 && console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");
|
|
4111
|
+
if (this.threadId = (null == e2 ? void 0 : e2.threadId) || "", e2.consentMessage && (e2.consentMessage = r.default.sanitize(e2.consentMessage, { USE_PROFILES: { html: true } }), r.default.removed && r.default.removed.length > 0 && console.warn("The AI-Powered Insights consent message was sanitized as it contained potentially malicious HTML elements or attributes.")), e2.predefinedPrompts) for (let t2 = 0; t2 < e2.predefinedPrompts.length; t2++) e2.predefinedPrompts[t2] = r.default.sanitize(e2.predefinedPrompts[t2], { USE_PROFILES: { html: true } }), r.default.removed && r.default.removed.length > 0 && console.warn("An AI-Powered Insights predefined prompt was sanitized as it contained potentially malicious HTML elements or attributes.");
|
|
3275
4112
|
return e2;
|
|
3276
4113
|
});
|
|
3277
4114
|
}
|
|
@@ -3323,8 +4160,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3323
4160
|
this.pageCount = 0, this.currentPageNumber = 0;
|
|
3324
4161
|
}
|
|
3325
4162
|
handleSearchRequestError(e2) {
|
|
3326
|
-
if (!Ce(e2, "System.ArgumentException"))
|
|
3327
|
-
throw this.handleRequestError(e2, "", true), null;
|
|
4163
|
+
if (!Ce(e2, "System.ArgumentException")) throw this.handleRequestError(e2, "", true), null;
|
|
3328
4164
|
this.throwPromiseError(e2);
|
|
3329
4165
|
}
|
|
3330
4166
|
throwPromiseError(e2) {
|
|
@@ -3338,15 +4174,12 @@ var telerikReportViewer = (function (exports) {
|
|
|
3338
4174
|
formatRequestError(e2, t2, i2) {
|
|
3339
4175
|
let n2 = e2.responseJSON, r2 = "";
|
|
3340
4176
|
if (n2) {
|
|
3341
|
-
if (401 == n2.status || 403 == n2.status)
|
|
3342
|
-
|
|
3343
|
-
if (Se(e2))
|
|
3344
|
-
return this.options.messages.ReportViewer_MissingOrInvalidParameter;
|
|
4177
|
+
if (401 == n2.status || 403 == n2.status) return this.options.messages.ReportViewer_ErrorUnauthorizedOrForbidden || "You don't have permission to access this report document.";
|
|
4178
|
+
if (Se(e2)) return this.options.messages.ReportViewer_MissingOrInvalidParameter;
|
|
3345
4179
|
r2 = he(n2.message);
|
|
3346
4180
|
let t3 = he(n2.exceptionMessage || n2.ExceptionMessage || n2.error_description);
|
|
3347
4181
|
t3 && (r2 ? r2 += " " + t3 : r2 = t3);
|
|
3348
|
-
} else
|
|
3349
|
-
r2 = he(e2.responseText);
|
|
4182
|
+
} else r2 = he(e2.responseText);
|
|
3350
4183
|
return (i2 || t2) && (r2 && (r2 = " " + r2), r2 = he(i2 || t2) + r2), ye(e2) && (r2 += "<br />" + this.options.messages.ReportViewer_ClientExpired), r2;
|
|
3351
4184
|
}
|
|
3352
4185
|
raiseError(e2, t2 = true) {
|
|
@@ -3408,8 +4241,7 @@ var telerikReportViewer = (function (exports) {
|
|
|
3408
4241
|
});
|
|
3409
4242
|
}
|
|
3410
4243
|
getReportParameters() {
|
|
3411
|
-
if (!this.parameterValues)
|
|
3412
|
-
return {};
|
|
4244
|
+
if (!this.parameterValues) return {};
|
|
3413
4245
|
const e2 = {}, t2 = this.getProcessedParameterValues();
|
|
3414
4246
|
for (let i2 in t2) {
|
|
3415
4247
|
const n2 = t2[i2], r2 = this.parameterValues[i2];
|
|
@@ -3446,15 +4278,12 @@ var telerikReportViewer = (function (exports) {
|
|
|
3446
4278
|
});
|
|
3447
4279
|
}
|
|
3448
4280
|
getPageForBookmark(e2, t2) {
|
|
3449
|
-
if (e2)
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
if (r2)
|
|
3456
|
-
return r2;
|
|
3457
|
-
}
|
|
4281
|
+
if (e2) for (let i2 = 0, n2 = e2.length; i2 < n2; i2++) {
|
|
4282
|
+
let n3 = e2[i2];
|
|
4283
|
+
if (n3.id === t2) return n3.page;
|
|
4284
|
+
let r2 = this.getPageForBookmark(n3.items, t2);
|
|
4285
|
+
if (r2) return r2;
|
|
4286
|
+
}
|
|
3458
4287
|
return 0;
|
|
3459
4288
|
}
|
|
3460
4289
|
fixDataContractJsonSerializer(e2) {
|
|
@@ -3640,21 +4469,20 @@ ${e3.text} (${e3.id})`;
|
|
|
3640
4469
|
}
|
|
3641
4470
|
}
|
|
3642
4471
|
validateClientID(e2) {
|
|
3643
|
-
if (!e2)
|
|
3644
|
-
throw "Invalid ClientId";
|
|
4472
|
+
if (!e2) throw "Invalid ClientId";
|
|
3645
4473
|
}
|
|
3646
4474
|
authenticatedGet(e2) {
|
|
3647
|
-
return this.login().then((t2) => (null == t2 ? void 0 : t2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedGet(e2)) : function(e3, t3) {
|
|
4475
|
+
return this.login().then((t2) => (null == t2 ? void 0 : t2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedGet(e2)) : (function(e3, t3) {
|
|
3648
4476
|
return fetch(e3, { headers: y(t3) }).then(S);
|
|
3649
|
-
}(e2, t2.access_token || t2.accessToken));
|
|
4477
|
+
})(e2, t2.access_token || t2.accessToken));
|
|
3650
4478
|
}
|
|
3651
4479
|
authenticatedPost(e2, t2) {
|
|
3652
4480
|
return this.login().then((i2) => (null == i2 ? void 0 : i2.expiresAt) < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, i2.refreshToken), this.authenticatedPost(e2, t2)) : I(e2, t2, i2.access_token || i2.accessToken));
|
|
3653
4481
|
}
|
|
3654
4482
|
authenticatedDelete(e2) {
|
|
3655
|
-
return this.login().then((t2) => t2.expiresAt < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedDelete(e2)) : function(e3, t3) {
|
|
4483
|
+
return this.login().then((t2) => t2.expiresAt < Date.now() ? (this.loginPromise = this.authStrategy.authenticatePromise(true, t2.refreshToken), this.authenticatedDelete(e2)) : (function(e3, t3) {
|
|
3656
4484
|
return fetch(e3, { method: "DELETE", headers: y(t3) }).then(S);
|
|
3657
|
-
}(e2, t2.access_token || t2.accessToken));
|
|
4485
|
+
})(e2, t2.access_token || t2.accessToken));
|
|
3658
4486
|
}
|
|
3659
4487
|
login() {
|
|
3660
4488
|
return this.loginPromise || (this.loginPromise = this.authStrategy.authenticatePromise(false, null)), this.loginPromise;
|
|
@@ -3741,11 +4569,9 @@ ${e3.text} (${e3.id})`;
|
|
|
3741
4569
|
var i2;
|
|
3742
4570
|
return e2 && e2.attributes && (null === (i2 = e2.attributes[t2]) || void 0 === i2 ? void 0 : i2.value) || "";
|
|
3743
4571
|
}, e.getElementScrollParent = me, e.getOffsetParent = oe, e.hasClass = se, e.isArray = Le, e.isExceptionOfType = Ce, e.isInternalServerError = Ie, e.isInvalidClientException = ye, e.isInvalidParameterException = Se, e.isRgbColor = de, e.keepElementInView = function(e2) {
|
|
3744
|
-
if (!e2)
|
|
3745
|
-
return;
|
|
4572
|
+
if (!e2) return;
|
|
3746
4573
|
let t2 = me(e2);
|
|
3747
|
-
if (!t2)
|
|
3748
|
-
return;
|
|
4574
|
+
if (!t2) return;
|
|
3749
4575
|
let i2 = e2.offsetTop, n2 = i2 + e2.offsetHeight, r2 = t2.scrollTop + t2.offsetHeight;
|
|
3750
4576
|
i2 < t2.scrollTop ? t2.scrollTop = i2 : n2 > r2 && (t2.scrollTop += n2 - r2);
|
|
3751
4577
|
}, e.parseToLocalDate = Ae, e.prependHtml = ge, e.removeClass = re, e.reportSourcesAreEqual = function(e2) {
|
|
@@ -4279,8 +5105,8 @@ ${e3.text} (${e3.id})`;
|
|
|
4279
5105
|
if (prefixedDataCommand && reportViewerTarget) {
|
|
4280
5106
|
var dataCommand = prefixedDataCommand.substring("telerik_ReportViewer_".length);
|
|
4281
5107
|
var reportViewer = $(reportViewerTarget).data("telerik_ReportViewer");
|
|
4282
|
-
var cmd = reportViewer.commands[dataCommand];
|
|
4283
|
-
if (cmd.getEnabled()) {
|
|
5108
|
+
var cmd = reportViewer && reportViewer.commands && reportViewer.commands[dataCommand];
|
|
5109
|
+
if (cmd && cmd.getEnabled()) {
|
|
4284
5110
|
cmd.exec($(event.currentTarget).attr("data-command-parameter"));
|
|
4285
5111
|
}
|
|
4286
5112
|
event.preventDefault();
|
|
@@ -4933,7 +5759,7 @@ ${e3.text} (${e3.id})`;
|
|
|
4933
5759
|
return true;
|
|
4934
5760
|
}
|
|
4935
5761
|
};
|
|
4936
|
-
var multivalueUtils = function() {
|
|
5762
|
+
var multivalueUtils = /* @__PURE__ */ (function() {
|
|
4937
5763
|
var lineSeparator = "\n";
|
|
4938
5764
|
return {
|
|
4939
5765
|
formatValue: (value) => {
|
|
@@ -4952,7 +5778,7 @@ ${e3.text} (${e3.id})`;
|
|
|
4952
5778
|
return ("" + text).split(lineSeparator);
|
|
4953
5779
|
}
|
|
4954
5780
|
};
|
|
4955
|
-
}();
|
|
5781
|
+
})();
|
|
4956
5782
|
function integerInputBehavior(input) {
|
|
4957
5783
|
function isValid(newValue) {
|
|
4958
5784
|
return /^(\-|\+)?([0-9]*)$/.test(newValue);
|
|
@@ -5819,7 +6645,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5819
6645
|
}
|
|
5820
6646
|
];
|
|
5821
6647
|
|
|
5822
|
-
var ParameterValidators = function() {
|
|
6648
|
+
var ParameterValidators = (function() {
|
|
5823
6649
|
var validators = {};
|
|
5824
6650
|
function validateParameter(parameter, value, validatorFunc, compareFunc) {
|
|
5825
6651
|
var values = [].concat(value).map((value1) => {
|
|
@@ -5972,7 +6798,7 @@ ${e3.text} (${e3.id})`;
|
|
|
5972
6798
|
return v.validate(parameter, value);
|
|
5973
6799
|
}
|
|
5974
6800
|
};
|
|
5975
|
-
}();
|
|
6801
|
+
})();
|
|
5976
6802
|
|
|
5977
6803
|
function PerspectiveManager(element, controller, notificationService) {
|
|
5978
6804
|
var smallMenu = element.querySelectorAll ? element.querySelectorAll(".trv-menu-small")[0] : false;
|
|
@@ -8079,7 +8905,7 @@ ${e3.text} (${e3.id})`;
|
|
|
8079
8905
|
// #endregion
|
|
8080
8906
|
}
|
|
8081
8907
|
|
|
8082
|
-
const TemplateCache = function() {
|
|
8908
|
+
const TemplateCache = /* @__PURE__ */ (function() {
|
|
8083
8909
|
var cache = {};
|
|
8084
8910
|
return {
|
|
8085
8911
|
load: (url, serviceUrl, client) => {
|
|
@@ -8109,7 +8935,7 @@ ${e3.text} (${e3.id})`;
|
|
|
8109
8935
|
return p;
|
|
8110
8936
|
}
|
|
8111
8937
|
};
|
|
8112
|
-
}();
|
|
8938
|
+
})();
|
|
8113
8939
|
|
|
8114
8940
|
class ReportViewerSettings {
|
|
8115
8941
|
// #region fields
|
|
@@ -8789,7 +9615,8 @@ ${e3.text} (${e3.id})`;
|
|
|
8789
9615
|
_initAiPrompt(promptSuggestions) {
|
|
8790
9616
|
if (this.aiPromptInitialized) {
|
|
8791
9617
|
this.kendoAiPrompt.setOptions({
|
|
8792
|
-
promptSuggestions
|
|
9618
|
+
promptSuggestions,
|
|
9619
|
+
speechToText: this.allowCustomPrompts
|
|
8793
9620
|
});
|
|
8794
9621
|
this.kendoAiPrompt.activeView(this.kendoAiPrompt.activeView());
|
|
8795
9622
|
} else {
|
|
@@ -8821,6 +9648,7 @@ ${e3.text} (${e3.id})`;
|
|
|
8821
9648
|
} }
|
|
8822
9649
|
],
|
|
8823
9650
|
promptSuggestions,
|
|
9651
|
+
speechToText: this.allowCustomPrompts,
|
|
8824
9652
|
views: [
|
|
8825
9653
|
{
|
|
8826
9654
|
type: "prompt",
|
|
@@ -9073,12 +9901,16 @@ ${e3.text} (${e3.id})`;
|
|
|
9073
9901
|
switch (iconId) {
|
|
9074
9902
|
case 0:
|
|
9075
9903
|
return ProductNotLicensedIcon();
|
|
9904
|
+
// Key icon
|
|
9076
9905
|
case 1:
|
|
9077
9906
|
return NoLicenseIcon();
|
|
9907
|
+
// Diamond icon. Currently not possible for reporting?
|
|
9078
9908
|
case 2:
|
|
9079
9909
|
return ExpiredLicenseSubscriptionIcon();
|
|
9910
|
+
// RecurringDollar icon
|
|
9080
9911
|
case 3:
|
|
9081
9912
|
return ExpiredTrialIcon();
|
|
9913
|
+
// TrialTag icon
|
|
9082
9914
|
default:
|
|
9083
9915
|
return ProductNotLicensedIcon();
|
|
9084
9916
|
}
|
|
@@ -9208,7 +10040,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9208
10040
|
if (!validateOptions(options)) {
|
|
9209
10041
|
return;
|
|
9210
10042
|
}
|
|
9211
|
-
var version = "20.
|
|
10043
|
+
var version = "20.2.26.812";
|
|
9212
10044
|
options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
|
|
9213
10045
|
settings = new ReportViewerSettings(
|
|
9214
10046
|
persistanceKey,
|
|
@@ -9645,7 +10477,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9645
10477
|
let controllerEventName = viewerAsyncEventsMapping[eventName];
|
|
9646
10478
|
controller.onAsync(controllerEventName, eventProxy(eventName));
|
|
9647
10479
|
}
|
|
9648
|
-
notificationService.on(notificationService.Events.UPDATE_UI, function($viewer2) {
|
|
10480
|
+
notificationService.on(notificationService.Events.UPDATE_UI, /* @__PURE__ */ (function($viewer2) {
|
|
9649
10481
|
return function(e, args) {
|
|
9650
10482
|
$viewer2.trigger(
|
|
9651
10483
|
{
|
|
@@ -9655,7 +10487,7 @@ ${e3.text} (${e3.id})`;
|
|
|
9655
10487
|
args
|
|
9656
10488
|
);
|
|
9657
10489
|
};
|
|
9658
|
-
}($viewer));
|
|
10490
|
+
})($viewer));
|
|
9659
10491
|
}
|
|
9660
10492
|
function attachEventHandlers() {
|
|
9661
10493
|
eventBinder(Events$1.EXPORT_BEGIN, options.exportBegin, true);
|
|
@@ -10120,6 +10952,7 @@ ${e3.text} (${e3.id})`;
|
|
|
10120
10952
|
} else {
|
|
10121
10953
|
throw "The current browser does not support the Promise feature which is required for using the Report Viewer.";
|
|
10122
10954
|
}
|
|
10955
|
+
$placeholder.data(pluginName, viewer);
|
|
10123
10956
|
return viewer;
|
|
10124
10957
|
}
|
|
10125
10958
|
function ReportViewerServiceClient(serviceClientOptions) {
|