@appbaseio/reactivesearch-vue 3.3.7-beta.2 → 3.5.0
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/@appbaseio/reactivesearch-vue.umd.js +296 -515
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +13 -6
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/ReactiveList.js +3 -1
- package/dist/cjs/{SearchBox-17eeed1a.js → SearchBox-9278c775.js} +3 -1
- package/dist/cjs/SearchBox.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{install-3b410ce1.js → install-76c077bf.js} +1 -1
- package/dist/cjs/install.js +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/components/result/ReactiveList.d.ts +2 -0
- package/dist/components/search/SearchBox.d.ts +2 -0
- package/dist/es/ReactiveList.js +3 -1
- package/dist/es/{SearchBox-81bbbe04.js → SearchBox-559e0865.js} +7 -5
- package/dist/es/SearchBox.js +1 -1
- package/dist/es/index.js +3 -3
- package/dist/es/{install-16ae86fa.js → install-6b4e5b04.js} +1 -1
- package/dist/es/install.js +2 -2
- package/dist/es/version.js +1 -1
- package/package.json +6 -3
|
@@ -708,7 +708,7 @@
|
|
|
708
708
|
var SET_RAW_DATA = 'SET_RAW_DATA';
|
|
709
709
|
var SET_POPULAR_SUGGESTIONS = 'SET_POPULAR_SUGGESTIONS';
|
|
710
710
|
var SET_DEFAULT_POPULAR_SUGGESTIONS = 'SET_DEFAULT_POPULAR_SUGGESTIONS';
|
|
711
|
-
var SET_QUERY_TO_HITS
|
|
711
|
+
var SET_QUERY_TO_HITS = 'SET_QUERY_TO_HITS';
|
|
712
712
|
var RECENT_SEARCHES_SUCCESS = 'RECENT_SEARCHES_SUCCESS';
|
|
713
713
|
var RECENT_SEARCHES_ERROR = 'RECENT_SEARCHES_ERROR';
|
|
714
714
|
var SET_VALUE = 'SET_VALUE';
|
|
@@ -933,7 +933,7 @@
|
|
|
933
933
|
// common
|
|
934
934
|
'type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'compoundClause',
|
|
935
935
|
// Specific to ReactiveList
|
|
936
|
-
'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
936
|
+
'dataField', 'includeFields', 'excludeFields', 'size', 'candidates', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
937
937
|
// Specific to DataSearch
|
|
938
938
|
'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'vectorDataField', 'imageValue',
|
|
939
939
|
// Specific to Category Search
|
|
@@ -1595,7 +1595,7 @@
|
|
|
1595
1595
|
function queryToHitsReducer() {
|
|
1596
1596
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1597
1597
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
1598
|
-
if (action.type === SET_QUERY_TO_HITS
|
|
1598
|
+
if (action.type === SET_QUERY_TO_HITS) {
|
|
1599
1599
|
return _objectSpread$e(_objectSpread$e({}, state), {}, _defineProperty({}, action.component, action.query));
|
|
1600
1600
|
} else if (action.type === REMOVE_COMPONENT) {
|
|
1601
1601
|
var _action$component = action.component;
|
|
@@ -4919,7 +4919,7 @@
|
|
|
4919
4919
|
// dataField is a required field for components other than search
|
|
4920
4920
|
// TODO: Revisit this logic based on the Appbase version
|
|
4921
4921
|
// dataField is no longer a required field in RS API
|
|
4922
|
-
if (props.componentType !== componentTypes.AIAnswer && !isSearchComponent(props.componentType) && !props.dataField) {
|
|
4922
|
+
if (props.componentType !== componentTypes.AIAnswer && !isSearchComponent(props.componentType) && !props.dataField && !props.vectorDataField) {
|
|
4923
4923
|
return null;
|
|
4924
4924
|
}
|
|
4925
4925
|
var endpoint;
|
|
@@ -5017,7 +5017,8 @@
|
|
|
5017
5017
|
execute: true
|
|
5018
5018
|
}) : {}), queryType !== queryTypes.suggestion ? {
|
|
5019
5019
|
vectorDataField: props.vectorDataField || undefined,
|
|
5020
|
-
imageValue: props.imageValue || undefined
|
|
5020
|
+
imageValue: props.imageValue || undefined,
|
|
5021
|
+
candidates: props.candidates || props.size || undefined
|
|
5021
5022
|
} : {});
|
|
5022
5023
|
}
|
|
5023
5024
|
return null;
|
|
@@ -5548,8 +5549,6 @@
|
|
|
5548
5549
|
};
|
|
5549
5550
|
};
|
|
5550
5551
|
|
|
5551
|
-
var SET_QUERY_TO_HITS = 'SET_QUERY_TO_HITS';
|
|
5552
|
-
|
|
5553
5552
|
function updateAggs(component, aggregations) {
|
|
5554
5553
|
var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
5555
5554
|
return {
|
|
@@ -7699,7 +7698,7 @@
|
|
|
7699
7698
|
// common
|
|
7700
7699
|
'type', 'componentType', 'aggregationField', 'aggregationSize', 'distinctField', 'distinctFieldConfig', 'index', 'aggregations', 'compoundClause',
|
|
7701
7700
|
// Specific to ReactiveList
|
|
7702
|
-
'dataField', 'includeFields', 'excludeFields', 'size', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
7701
|
+
'dataField', 'includeFields', 'excludeFields', 'size', 'candidates', 'from', 'sortBy', 'sortOptions', 'pagination',
|
|
7703
7702
|
// Specific to DataSearch
|
|
7704
7703
|
'autoFocus', 'autosuggest', 'debounce', 'defaultValue', 'defaultSuggestions', 'fieldWeights', 'filterLabel', 'fuzziness', 'highlight', 'highlightConfig', 'highlightField', 'nestedField', 'placeholder', 'queryFormat', 'searchOperators', 'enableSynonyms', 'enableQuerySuggestions', 'queryString', 'vectorDataField', 'imageValue',
|
|
7705
7704
|
// Specific to Category Search
|
|
@@ -14305,7 +14304,8 @@
|
|
|
14305
14304
|
className: types.string,
|
|
14306
14305
|
componentId: types.stringRequired,
|
|
14307
14306
|
compoundClause: types.compoundClause,
|
|
14308
|
-
dataField: types.
|
|
14307
|
+
dataField: types.string,
|
|
14308
|
+
vectorDataField: types.string,
|
|
14309
14309
|
aggregationField: types.string,
|
|
14310
14310
|
aggregationSize: Q.number,
|
|
14311
14311
|
defaultQuery: types.func,
|
|
@@ -14328,6 +14328,7 @@
|
|
|
14328
14328
|
showResultStats: Q.bool.def(true),
|
|
14329
14329
|
showEndPage: Q.bool.def(false),
|
|
14330
14330
|
size: Q.number.def(10),
|
|
14331
|
+
candidates: Q.number.def(10),
|
|
14331
14332
|
sortBy: types.sortBy,
|
|
14332
14333
|
sortOptions: types.sortOptions,
|
|
14333
14334
|
URLParams: Q.bool.def(false),
|
|
@@ -18288,7 +18289,7 @@
|
|
|
18288
18289
|
}
|
|
18289
18290
|
|
|
18290
18291
|
var purify = createCommonjsModule(function (module, exports) {
|
|
18291
|
-
/*! @license DOMPurify 3.
|
|
18292
|
+
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
|
18292
18293
|
|
|
18293
18294
|
(function (global, factory) {
|
|
18294
18295
|
module.exports = factory() ;
|
|
@@ -18326,8 +18327,10 @@
|
|
|
18326
18327
|
};
|
|
18327
18328
|
}
|
|
18328
18329
|
var arrayForEach = unapply(Array.prototype.forEach);
|
|
18330
|
+
var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
18329
18331
|
var arrayPop = unapply(Array.prototype.pop);
|
|
18330
18332
|
var arrayPush = unapply(Array.prototype.push);
|
|
18333
|
+
var arraySplice = unapply(Array.prototype.splice);
|
|
18331
18334
|
var stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
18332
18335
|
var stringToString = unapply(String.prototype.toString);
|
|
18333
18336
|
var stringMatch = unapply(String.prototype.match);
|
|
@@ -18337,12 +18340,11 @@
|
|
|
18337
18340
|
var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
18338
18341
|
var regExpTest = unapply(RegExp.prototype.test);
|
|
18339
18342
|
var typeErrorCreate = unconstruct(TypeError);
|
|
18340
|
-
|
|
18341
18343
|
/**
|
|
18342
18344
|
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
18343
18345
|
*
|
|
18344
|
-
* @param
|
|
18345
|
-
* @returns
|
|
18346
|
+
* @param func - The function to be wrapped and called.
|
|
18347
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
18346
18348
|
*/
|
|
18347
18349
|
function unapply(func) {
|
|
18348
18350
|
return function (thisArg) {
|
|
@@ -18352,12 +18354,11 @@
|
|
|
18352
18354
|
return apply(func, thisArg, args);
|
|
18353
18355
|
};
|
|
18354
18356
|
}
|
|
18355
|
-
|
|
18356
18357
|
/**
|
|
18357
18358
|
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
18358
18359
|
*
|
|
18359
|
-
* @param
|
|
18360
|
-
* @returns
|
|
18360
|
+
* @param func - The constructor function to be wrapped and called.
|
|
18361
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
18361
18362
|
*/
|
|
18362
18363
|
function unconstruct(func) {
|
|
18363
18364
|
return function () {
|
|
@@ -18367,14 +18368,13 @@
|
|
|
18367
18368
|
return construct(func, args);
|
|
18368
18369
|
};
|
|
18369
18370
|
}
|
|
18370
|
-
|
|
18371
18371
|
/**
|
|
18372
18372
|
* Add properties to a lookup table
|
|
18373
18373
|
*
|
|
18374
|
-
* @param
|
|
18375
|
-
* @param
|
|
18376
|
-
* @param
|
|
18377
|
-
* @returns
|
|
18374
|
+
* @param set - The set to which elements will be added.
|
|
18375
|
+
* @param array - The array containing elements to be added to the set.
|
|
18376
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
18377
|
+
* @returns The modified set with added elements.
|
|
18378
18378
|
*/
|
|
18379
18379
|
function addToSet(set, array) {
|
|
18380
18380
|
var transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
|
@@ -18401,12 +18401,11 @@
|
|
|
18401
18401
|
}
|
|
18402
18402
|
return set;
|
|
18403
18403
|
}
|
|
18404
|
-
|
|
18405
18404
|
/**
|
|
18406
18405
|
* Clean up an array to harden against CSPP
|
|
18407
18406
|
*
|
|
18408
|
-
* @param
|
|
18409
|
-
* @returns
|
|
18407
|
+
* @param array - The array to be cleaned.
|
|
18408
|
+
* @returns The cleaned version of the array
|
|
18410
18409
|
*/
|
|
18411
18410
|
function cleanArray(array) {
|
|
18412
18411
|
for (var index = 0; index < array.length; index++) {
|
|
@@ -18417,12 +18416,11 @@
|
|
|
18417
18416
|
}
|
|
18418
18417
|
return array;
|
|
18419
18418
|
}
|
|
18420
|
-
|
|
18421
18419
|
/**
|
|
18422
18420
|
* Shallow clone an object
|
|
18423
18421
|
*
|
|
18424
|
-
* @param
|
|
18425
|
-
* @returns
|
|
18422
|
+
* @param object - The object to be cloned.
|
|
18423
|
+
* @returns A new object that copies the original.
|
|
18426
18424
|
*/
|
|
18427
18425
|
function clone(object) {
|
|
18428
18426
|
var newObject = create(null);
|
|
@@ -18443,13 +18441,12 @@
|
|
|
18443
18441
|
}
|
|
18444
18442
|
return newObject;
|
|
18445
18443
|
}
|
|
18446
|
-
|
|
18447
18444
|
/**
|
|
18448
18445
|
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
18449
18446
|
*
|
|
18450
|
-
* @param
|
|
18451
|
-
* @param
|
|
18452
|
-
* @returns
|
|
18447
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
|
18448
|
+
* @param prop - The property name for which to find the getter function.
|
|
18449
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
|
18453
18450
|
*/
|
|
18454
18451
|
function lookupGetter(object, prop) {
|
|
18455
18452
|
while (object !== null) {
|
|
@@ -18470,32 +18467,28 @@
|
|
|
18470
18467
|
return fallbackValue;
|
|
18471
18468
|
}
|
|
18472
18469
|
var html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
18473
|
-
|
|
18474
|
-
// SVG
|
|
18475
18470
|
var svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
18476
18471
|
var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
18477
|
-
|
|
18478
18472
|
// List of SVG elements that are disallowed by default.
|
|
18479
18473
|
// We still need to know them so that we can do namespace
|
|
18480
18474
|
// checks properly in case one wants to add them to
|
|
18481
18475
|
// allow-list.
|
|
18482
18476
|
var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
|
18483
18477
|
var mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
|
18484
|
-
|
|
18485
18478
|
// Similarly to SVG, we want to know all MathML elements,
|
|
18486
18479
|
// even those that we disallow by default.
|
|
18487
18480
|
var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
18488
18481
|
var text = freeze(['#text']);
|
|
18489
18482
|
var 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', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', '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', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
18490
|
-
var svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', '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', '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', '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', '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', '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', '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']);
|
|
18483
|
+
var 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', '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']);
|
|
18491
18484
|
var mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', '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']);
|
|
18492
18485
|
var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
18493
18486
|
|
|
18494
18487
|
// eslint-disable-next-line unicorn/better-regex
|
|
18495
18488
|
var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
18496
18489
|
var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
18497
|
-
var TMPLIT_EXPR = seal(
|
|
18498
|
-
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]
|
|
18490
|
+
var TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
18491
|
+
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
18499
18492
|
var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
18500
18493
|
var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
18501
18494
|
);
|
|
@@ -18506,18 +18499,19 @@
|
|
|
18506
18499
|
var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
18507
18500
|
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
18508
18501
|
__proto__: null,
|
|
18509
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
18510
|
-
ERB_EXPR: ERB_EXPR,
|
|
18511
|
-
TMPLIT_EXPR: TMPLIT_EXPR,
|
|
18512
|
-
DATA_ATTR: DATA_ATTR,
|
|
18513
18502
|
ARIA_ATTR: ARIA_ATTR,
|
|
18514
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
18515
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
18516
18503
|
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
18504
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
18505
|
+
DATA_ATTR: DATA_ATTR,
|
|
18517
18506
|
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
18518
|
-
|
|
18507
|
+
ERB_EXPR: ERB_EXPR,
|
|
18508
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
18509
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
18510
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
18511
|
+
TMPLIT_EXPR: TMPLIT_EXPR
|
|
18519
18512
|
});
|
|
18520
18513
|
|
|
18514
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
18521
18515
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
18522
18516
|
var NODE_TYPE = {
|
|
18523
18517
|
element: 1,
|
|
@@ -18538,20 +18532,18 @@
|
|
|
18538
18532
|
var getGlobal = function getGlobal() {
|
|
18539
18533
|
return typeof window === 'undefined' ? null : window;
|
|
18540
18534
|
};
|
|
18541
|
-
|
|
18542
18535
|
/**
|
|
18543
18536
|
* Creates a no-op policy for internal use only.
|
|
18544
18537
|
* Don't export this function outside this module!
|
|
18545
|
-
* @param
|
|
18546
|
-
* @param
|
|
18547
|
-
* @return
|
|
18538
|
+
* @param trustedTypes The policy factory.
|
|
18539
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
18540
|
+
* @return The policy created (or null, if Trusted Types
|
|
18548
18541
|
* are not supported or creating the policy failed).
|
|
18549
18542
|
*/
|
|
18550
18543
|
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
|
18551
18544
|
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
18552
18545
|
return null;
|
|
18553
18546
|
}
|
|
18554
|
-
|
|
18555
18547
|
// Allow the callers to control the unique policy name
|
|
18556
18548
|
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
18557
18549
|
// Policy creation with duplicate names throws in Trusted Types.
|
|
@@ -18578,24 +18570,27 @@
|
|
|
18578
18570
|
return null;
|
|
18579
18571
|
}
|
|
18580
18572
|
};
|
|
18573
|
+
var _createHooksMap = function _createHooksMap() {
|
|
18574
|
+
return {
|
|
18575
|
+
afterSanitizeAttributes: [],
|
|
18576
|
+
afterSanitizeElements: [],
|
|
18577
|
+
afterSanitizeShadowDOM: [],
|
|
18578
|
+
beforeSanitizeAttributes: [],
|
|
18579
|
+
beforeSanitizeElements: [],
|
|
18580
|
+
beforeSanitizeShadowDOM: [],
|
|
18581
|
+
uponSanitizeAttribute: [],
|
|
18582
|
+
uponSanitizeElement: [],
|
|
18583
|
+
uponSanitizeShadowNode: []
|
|
18584
|
+
};
|
|
18585
|
+
};
|
|
18581
18586
|
function createDOMPurify() {
|
|
18582
18587
|
var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
18583
18588
|
var DOMPurify = function DOMPurify(root) {
|
|
18584
18589
|
return createDOMPurify(root);
|
|
18585
18590
|
};
|
|
18586
|
-
|
|
18587
|
-
/**
|
|
18588
|
-
* Version label, exposed for easier checks
|
|
18589
|
-
* if DOMPurify is up to date or not
|
|
18590
|
-
*/
|
|
18591
|
-
DOMPurify.version = '3.1.5';
|
|
18592
|
-
|
|
18593
|
-
/**
|
|
18594
|
-
* Array of elements that DOMPurify removed during sanitation.
|
|
18595
|
-
* Empty if nothing was removed.
|
|
18596
|
-
*/
|
|
18591
|
+
DOMPurify.version = '3.2.4';
|
|
18597
18592
|
DOMPurify.removed = [];
|
|
18598
|
-
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
|
|
18593
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
18599
18594
|
// Not running in a browser, provide a factory function
|
|
18600
18595
|
// so that you can pass your own Window
|
|
18601
18596
|
DOMPurify.isSupported = false;
|
|
@@ -18616,10 +18611,10 @@
|
|
|
18616
18611
|
trustedTypes = window.trustedTypes;
|
|
18617
18612
|
var ElementPrototype = Element.prototype;
|
|
18618
18613
|
var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
18614
|
+
var remove = lookupGetter(ElementPrototype, 'remove');
|
|
18619
18615
|
var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
18620
18616
|
var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
18621
18617
|
var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
18622
|
-
|
|
18623
18618
|
// As per issue #47, the web-components registry is inherited by a
|
|
18624
18619
|
// new document created via createHTMLDocument. As per the spec
|
|
18625
18620
|
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
@@ -18640,8 +18635,7 @@
|
|
|
18640
18635
|
createDocumentFragment = _document.createDocumentFragment,
|
|
18641
18636
|
getElementsByTagName = _document.getElementsByTagName;
|
|
18642
18637
|
var importNode = originalDocument.importNode;
|
|
18643
|
-
var hooks =
|
|
18644
|
-
|
|
18638
|
+
var hooks = _createHooksMap();
|
|
18645
18639
|
/**
|
|
18646
18640
|
* Expose whether this browser supports running the full DOMPurify.
|
|
18647
18641
|
*/
|
|
@@ -18655,22 +18649,18 @@
|
|
|
18655
18649
|
ATTR_WHITESPACE = EXPRESSIONS.ATTR_WHITESPACE,
|
|
18656
18650
|
CUSTOM_ELEMENT = EXPRESSIONS.CUSTOM_ELEMENT;
|
|
18657
18651
|
var IS_ALLOWED_URI$1 = EXPRESSIONS.IS_ALLOWED_URI;
|
|
18658
|
-
|
|
18659
18652
|
/**
|
|
18660
18653
|
* We consider the elements and attributes below to be safe. Ideally
|
|
18661
18654
|
* don't add any new ones but feel free to remove unwanted ones.
|
|
18662
18655
|
*/
|
|
18663
|
-
|
|
18664
18656
|
/* allowed element names */
|
|
18665
18657
|
var ALLOWED_TAGS = null;
|
|
18666
18658
|
var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(html$1, svg$1, svgFilters, mathMl$1, text));
|
|
18667
|
-
|
|
18668
18659
|
/* Allowed attribute names */
|
|
18669
18660
|
var ALLOWED_ATTR = null;
|
|
18670
18661
|
var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(html, svg, mathMl, xml));
|
|
18671
|
-
|
|
18672
18662
|
/*
|
|
18673
|
-
* Configure how
|
|
18663
|
+
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
|
18674
18664
|
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
18675
18665
|
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
|
18676
18666
|
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
@@ -18695,65 +18685,49 @@
|
|
|
18695
18685
|
value: false
|
|
18696
18686
|
}
|
|
18697
18687
|
}));
|
|
18698
|
-
|
|
18699
18688
|
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
18700
18689
|
var FORBID_TAGS = null;
|
|
18701
|
-
|
|
18702
18690
|
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
18703
18691
|
var FORBID_ATTR = null;
|
|
18704
|
-
|
|
18705
18692
|
/* Decide if ARIA attributes are okay */
|
|
18706
18693
|
var ALLOW_ARIA_ATTR = true;
|
|
18707
|
-
|
|
18708
18694
|
/* Decide if custom data attributes are okay */
|
|
18709
18695
|
var ALLOW_DATA_ATTR = true;
|
|
18710
|
-
|
|
18711
18696
|
/* Decide if unknown protocols are okay */
|
|
18712
18697
|
var ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
18713
|
-
|
|
18714
18698
|
/* Decide if self-closing tags in attributes are allowed.
|
|
18715
18699
|
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
18716
18700
|
var ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
18717
|
-
|
|
18718
18701
|
/* Output should be safe for common template engines.
|
|
18719
18702
|
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
18720
18703
|
*/
|
|
18721
18704
|
var SAFE_FOR_TEMPLATES = false;
|
|
18722
|
-
|
|
18723
18705
|
/* Output should be safe even for XML used within HTML and alike.
|
|
18724
18706
|
* This means, DOMPurify removes comments when containing risky content.
|
|
18725
18707
|
*/
|
|
18726
18708
|
var SAFE_FOR_XML = true;
|
|
18727
|
-
|
|
18728
18709
|
/* Decide if document with <html>... should be returned */
|
|
18729
18710
|
var WHOLE_DOCUMENT = false;
|
|
18730
|
-
|
|
18731
18711
|
/* Track whether config is already set on this instance of DOMPurify. */
|
|
18732
18712
|
var SET_CONFIG = false;
|
|
18733
|
-
|
|
18734
18713
|
/* Decide if all elements (e.g. style, script) must be children of
|
|
18735
18714
|
* document.body. By default, browsers might move them to document.head */
|
|
18736
18715
|
var FORCE_BODY = false;
|
|
18737
|
-
|
|
18738
18716
|
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
18739
18717
|
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
18740
18718
|
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
18741
18719
|
*/
|
|
18742
18720
|
var RETURN_DOM = false;
|
|
18743
|
-
|
|
18744
18721
|
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
18745
18722
|
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
18746
18723
|
var RETURN_DOM_FRAGMENT = false;
|
|
18747
|
-
|
|
18748
18724
|
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
18749
18725
|
* case Trusted Types are not supported */
|
|
18750
18726
|
var RETURN_TRUSTED_TYPE = false;
|
|
18751
|
-
|
|
18752
18727
|
/* Output should be free from DOM clobbering attacks?
|
|
18753
18728
|
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
18754
18729
|
*/
|
|
18755
18730
|
var SANITIZE_DOM = true;
|
|
18756
|
-
|
|
18757
18731
|
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
18758
18732
|
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
18759
18733
|
*
|
|
@@ -18769,25 +18743,19 @@
|
|
|
18769
18743
|
*/
|
|
18770
18744
|
var SANITIZE_NAMED_PROPS = false;
|
|
18771
18745
|
var SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
18772
|
-
|
|
18773
18746
|
/* Keep element content when removing element? */
|
|
18774
18747
|
var KEEP_CONTENT = true;
|
|
18775
|
-
|
|
18776
18748
|
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
18777
18749
|
* of importing it into a new Document and returning a sanitized copy */
|
|
18778
18750
|
var IN_PLACE = false;
|
|
18779
|
-
|
|
18780
18751
|
/* Allow usage of profiles like html, svg and mathMl */
|
|
18781
18752
|
var USE_PROFILES = {};
|
|
18782
|
-
|
|
18783
18753
|
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
18784
18754
|
var FORBID_CONTENTS = null;
|
|
18785
18755
|
var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
18786
|
-
|
|
18787
18756
|
/* Tags that are safe for data: URIs */
|
|
18788
18757
|
var DATA_URI_TAGS = null;
|
|
18789
18758
|
var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
18790
|
-
|
|
18791
18759
|
/* Attributes safe for values like "javascript:" */
|
|
18792
18760
|
var URI_SAFE_ATTRIBUTES = null;
|
|
18793
18761
|
var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
@@ -18797,32 +18765,33 @@
|
|
|
18797
18765
|
/* Document namespace */
|
|
18798
18766
|
var NAMESPACE = HTML_NAMESPACE;
|
|
18799
18767
|
var IS_EMPTY_INPUT = false;
|
|
18800
|
-
|
|
18801
18768
|
/* Allowed XHTML+XML namespaces */
|
|
18802
18769
|
var ALLOWED_NAMESPACES = null;
|
|
18803
18770
|
var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
18804
|
-
|
|
18771
|
+
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
18772
|
+
var HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
|
18773
|
+
// Certain elements are allowed in both SVG and HTML
|
|
18774
|
+
// namespace. We need to specify them explicitly
|
|
18775
|
+
// so that they don't get erroneously deleted from
|
|
18776
|
+
// HTML namespace.
|
|
18777
|
+
var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
18805
18778
|
/* Parsing of strict XHTML documents */
|
|
18806
18779
|
var PARSER_MEDIA_TYPE = null;
|
|
18807
18780
|
var SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
18808
18781
|
var DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
18809
18782
|
var transformCaseFunc = null;
|
|
18810
|
-
|
|
18811
18783
|
/* Keep a reference to config to pass to hooks */
|
|
18812
18784
|
var CONFIG = null;
|
|
18813
|
-
|
|
18814
18785
|
/* Ideally, do not touch anything below this line */
|
|
18815
18786
|
/* ______________________________________________ */
|
|
18816
|
-
|
|
18817
18787
|
var formElement = document.createElement('form');
|
|
18818
18788
|
var isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
18819
18789
|
return testValue instanceof RegExp || testValue instanceof Function;
|
|
18820
18790
|
};
|
|
18821
|
-
|
|
18822
18791
|
/**
|
|
18823
18792
|
* _parseConfig
|
|
18824
18793
|
*
|
|
18825
|
-
* @param
|
|
18794
|
+
* @param cfg optional config literal
|
|
18826
18795
|
*/
|
|
18827
18796
|
// eslint-disable-next-line complexity
|
|
18828
18797
|
var _parseConfig = function _parseConfig() {
|
|
@@ -18830,39 +18799,23 @@
|
|
|
18830
18799
|
if (CONFIG && CONFIG === cfg) {
|
|
18831
18800
|
return;
|
|
18832
18801
|
}
|
|
18833
|
-
|
|
18834
18802
|
/* Shield configuration object from tampering */
|
|
18835
18803
|
if (!cfg || typeof cfg !== 'object') {
|
|
18836
18804
|
cfg = {};
|
|
18837
18805
|
}
|
|
18838
|
-
|
|
18839
18806
|
/* Shield configuration object from prototype pollution */
|
|
18840
18807
|
cfg = clone(cfg);
|
|
18841
18808
|
PARSER_MEDIA_TYPE =
|
|
18842
18809
|
// eslint-disable-next-line unicorn/prefer-includes
|
|
18843
18810
|
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
18844
|
-
|
|
18845
18811
|
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
18846
18812
|
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
18847
|
-
|
|
18848
18813
|
/* Set configuration parameters */
|
|
18849
18814
|
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
18850
18815
|
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
18851
18816
|
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
18852
|
-
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),
|
|
18853
|
-
|
|
18854
|
-
cfg.ADD_URI_SAFE_ATTR,
|
|
18855
|
-
// eslint-disable-line indent
|
|
18856
|
-
transformCaseFunc // eslint-disable-line indent
|
|
18857
|
-
) // eslint-disable-line indent
|
|
18858
|
-
: DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
18859
|
-
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),
|
|
18860
|
-
// eslint-disable-line indent
|
|
18861
|
-
cfg.ADD_DATA_URI_TAGS,
|
|
18862
|
-
// eslint-disable-line indent
|
|
18863
|
-
transformCaseFunc // eslint-disable-line indent
|
|
18864
|
-
) // eslint-disable-line indent
|
|
18865
|
-
: DEFAULT_DATA_URI_TAGS;
|
|
18817
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
18818
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
18866
18819
|
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
18867
18820
|
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
|
18868
18821
|
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
|
@@ -18884,6 +18837,8 @@
|
|
|
18884
18837
|
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
18885
18838
|
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
18886
18839
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
18840
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
18841
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
18887
18842
|
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
18888
18843
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
18889
18844
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
@@ -18900,7 +18855,6 @@
|
|
|
18900
18855
|
if (RETURN_DOM_FRAGMENT) {
|
|
18901
18856
|
RETURN_DOM = true;
|
|
18902
18857
|
}
|
|
18903
|
-
|
|
18904
18858
|
/* Parse profile info */
|
|
18905
18859
|
if (USE_PROFILES) {
|
|
18906
18860
|
ALLOWED_TAGS = addToSet({}, text);
|
|
@@ -18925,7 +18879,6 @@
|
|
|
18925
18879
|
addToSet(ALLOWED_ATTR, xml);
|
|
18926
18880
|
}
|
|
18927
18881
|
}
|
|
18928
|
-
|
|
18929
18882
|
/* Merge configuration parameters */
|
|
18930
18883
|
if (cfg.ADD_TAGS) {
|
|
18931
18884
|
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
@@ -18948,17 +18901,14 @@
|
|
|
18948
18901
|
}
|
|
18949
18902
|
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
18950
18903
|
}
|
|
18951
|
-
|
|
18952
18904
|
/* Add #text in case KEEP_CONTENT is set to true */
|
|
18953
18905
|
if (KEEP_CONTENT) {
|
|
18954
18906
|
ALLOWED_TAGS['#text'] = true;
|
|
18955
18907
|
}
|
|
18956
|
-
|
|
18957
18908
|
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
|
18958
18909
|
if (WHOLE_DOCUMENT) {
|
|
18959
18910
|
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
|
18960
18911
|
}
|
|
18961
|
-
|
|
18962
18912
|
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
|
18963
18913
|
if (ALLOWED_TAGS.table) {
|
|
18964
18914
|
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
@@ -18971,10 +18921,8 @@
|
|
|
18971
18921
|
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
18972
18922
|
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
18973
18923
|
}
|
|
18974
|
-
|
|
18975
18924
|
// Overwrite existing TrustedTypes policy.
|
|
18976
18925
|
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
18977
|
-
|
|
18978
18926
|
// Sign local variables required by `sanitize`.
|
|
18979
18927
|
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
18980
18928
|
} else {
|
|
@@ -18982,13 +18930,11 @@
|
|
|
18982
18930
|
if (trustedTypesPolicy === undefined) {
|
|
18983
18931
|
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
18984
18932
|
}
|
|
18985
|
-
|
|
18986
18933
|
// If creating the internal policy succeeded sign internal variables.
|
|
18987
18934
|
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
|
18988
18935
|
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
18989
18936
|
}
|
|
18990
18937
|
}
|
|
18991
|
-
|
|
18992
18938
|
// Prevent further manipulation of configuration.
|
|
18993
18939
|
// Not available in IE8, Safari 5, etc.
|
|
18994
18940
|
if (freeze) {
|
|
@@ -18996,30 +18942,19 @@
|
|
|
18996
18942
|
}
|
|
18997
18943
|
CONFIG = cfg;
|
|
18998
18944
|
};
|
|
18999
|
-
var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
19000
|
-
var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);
|
|
19001
|
-
|
|
19002
|
-
// Certain elements are allowed in both SVG and HTML
|
|
19003
|
-
// namespace. We need to specify them explicitly
|
|
19004
|
-
// so that they don't get erroneously deleted from
|
|
19005
|
-
// HTML namespace.
|
|
19006
|
-
var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
19007
|
-
|
|
19008
18945
|
/* Keep track of all possible SVG and MathML tags
|
|
19009
18946
|
* so that we can perform the namespace checks
|
|
19010
18947
|
* correctly. */
|
|
19011
18948
|
var ALL_SVG_TAGS = addToSet({}, [].concat(svg$1, svgFilters, svgDisallowed));
|
|
19012
18949
|
var ALL_MATHML_TAGS = addToSet({}, [].concat(mathMl$1, mathMlDisallowed));
|
|
19013
|
-
|
|
19014
18950
|
/**
|
|
19015
|
-
* @param
|
|
19016
|
-
* @returns
|
|
18951
|
+
* @param element a DOM element whose namespace is being checked
|
|
18952
|
+
* @returns Return false if the element has a
|
|
19017
18953
|
* namespace that a spec-compliant parser would never
|
|
19018
18954
|
* return. Return true otherwise.
|
|
19019
18955
|
*/
|
|
19020
18956
|
var _checkValidNamespace = function _checkValidNamespace(element) {
|
|
19021
18957
|
var parent = getParentNode(element);
|
|
19022
|
-
|
|
19023
18958
|
// In JSDOM, if we're inside shadow DOM, then parentNode
|
|
19024
18959
|
// can be null. We just simulate parent in this case.
|
|
19025
18960
|
if (!parent || !parent.tagName) {
|
|
@@ -19040,14 +18975,12 @@
|
|
|
19040
18975
|
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
19041
18976
|
return tagName === 'svg';
|
|
19042
18977
|
}
|
|
19043
|
-
|
|
19044
18978
|
// The only way to switch from MathML to SVG is via`
|
|
19045
18979
|
// svg if parent is either <annotation-xml> or MathML
|
|
19046
18980
|
// text integration points.
|
|
19047
18981
|
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
19048
18982
|
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
19049
18983
|
}
|
|
19050
|
-
|
|
19051
18984
|
// We only allow elements that are defined in SVG
|
|
19052
18985
|
// spec. All others are disallowed in SVG namespace.
|
|
19053
18986
|
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
@@ -19059,13 +18992,11 @@
|
|
|
19059
18992
|
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
19060
18993
|
return tagName === 'math';
|
|
19061
18994
|
}
|
|
19062
|
-
|
|
19063
18995
|
// The only way to switch from SVG to MathML is via
|
|
19064
18996
|
// <math> and HTML integration points
|
|
19065
18997
|
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
19066
18998
|
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
19067
18999
|
}
|
|
19068
|
-
|
|
19069
19000
|
// We only allow elements that are defined in MathML
|
|
19070
19001
|
// spec. All others are disallowed in MathML namespace.
|
|
19071
19002
|
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
@@ -19080,28 +19011,24 @@
|
|
|
19080
19011
|
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
19081
19012
|
return false;
|
|
19082
19013
|
}
|
|
19083
|
-
|
|
19084
19014
|
// We disallow tags that are specific for MathML
|
|
19085
19015
|
// or SVG and should never appear in HTML namespace
|
|
19086
19016
|
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
19087
19017
|
}
|
|
19088
|
-
|
|
19089
19018
|
// For XHTML and XML documents that support custom namespaces
|
|
19090
19019
|
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
19091
19020
|
return true;
|
|
19092
19021
|
}
|
|
19093
|
-
|
|
19094
19022
|
// The code should never reach this place (this means
|
|
19095
19023
|
// that the element somehow got namespace that is not
|
|
19096
19024
|
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
|
19097
19025
|
// Return false just in case.
|
|
19098
19026
|
return false;
|
|
19099
19027
|
};
|
|
19100
|
-
|
|
19101
19028
|
/**
|
|
19102
19029
|
* _forceRemove
|
|
19103
19030
|
*
|
|
19104
|
-
* @param
|
|
19031
|
+
* @param node a DOM node
|
|
19105
19032
|
*/
|
|
19106
19033
|
var _forceRemove = function _forceRemove(node) {
|
|
19107
19034
|
arrayPush(DOMPurify.removed, {
|
|
@@ -19109,51 +19036,48 @@
|
|
|
19109
19036
|
});
|
|
19110
19037
|
try {
|
|
19111
19038
|
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
19112
|
-
node.
|
|
19039
|
+
getParentNode(node).removeChild(node);
|
|
19113
19040
|
} catch (_) {
|
|
19114
|
-
|
|
19041
|
+
remove(node);
|
|
19115
19042
|
}
|
|
19116
19043
|
};
|
|
19117
|
-
|
|
19118
19044
|
/**
|
|
19119
19045
|
* _removeAttribute
|
|
19120
19046
|
*
|
|
19121
|
-
* @param
|
|
19122
|
-
* @param
|
|
19047
|
+
* @param name an Attribute name
|
|
19048
|
+
* @param element a DOM node
|
|
19123
19049
|
*/
|
|
19124
|
-
var _removeAttribute = function _removeAttribute(name,
|
|
19050
|
+
var _removeAttribute = function _removeAttribute(name, element) {
|
|
19125
19051
|
try {
|
|
19126
19052
|
arrayPush(DOMPurify.removed, {
|
|
19127
|
-
attribute:
|
|
19128
|
-
from:
|
|
19053
|
+
attribute: element.getAttributeNode(name),
|
|
19054
|
+
from: element
|
|
19129
19055
|
});
|
|
19130
19056
|
} catch (_) {
|
|
19131
19057
|
arrayPush(DOMPurify.removed, {
|
|
19132
19058
|
attribute: null,
|
|
19133
|
-
from:
|
|
19059
|
+
from: element
|
|
19134
19060
|
});
|
|
19135
19061
|
}
|
|
19136
|
-
|
|
19137
|
-
|
|
19138
|
-
|
|
19139
|
-
if (name === 'is' && !ALLOWED_ATTR[name]) {
|
|
19062
|
+
element.removeAttribute(name);
|
|
19063
|
+
// We void attribute values for unremovable "is" attributes
|
|
19064
|
+
if (name === 'is') {
|
|
19140
19065
|
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
19141
19066
|
try {
|
|
19142
|
-
_forceRemove(
|
|
19067
|
+
_forceRemove(element);
|
|
19143
19068
|
} catch (_) {}
|
|
19144
19069
|
} else {
|
|
19145
19070
|
try {
|
|
19146
|
-
|
|
19071
|
+
element.setAttribute(name, '');
|
|
19147
19072
|
} catch (_) {}
|
|
19148
19073
|
}
|
|
19149
19074
|
}
|
|
19150
19075
|
};
|
|
19151
|
-
|
|
19152
19076
|
/**
|
|
19153
19077
|
* _initDocument
|
|
19154
19078
|
*
|
|
19155
|
-
* @param
|
|
19156
|
-
* @return
|
|
19079
|
+
* @param dirty - a string of dirty markup
|
|
19080
|
+
* @return a DOM, filled with the dirty markup
|
|
19157
19081
|
*/
|
|
19158
19082
|
var _initDocument = function _initDocument(dirty) {
|
|
19159
19083
|
/* Create a HTML document */
|
|
@@ -19180,7 +19104,6 @@
|
|
|
19180
19104
|
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
19181
19105
|
} catch (_) {}
|
|
19182
19106
|
}
|
|
19183
|
-
|
|
19184
19107
|
/* Use createHTMLDocument in case DOMParser is not available */
|
|
19185
19108
|
if (!doc || !doc.documentElement) {
|
|
19186
19109
|
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
|
@@ -19194,112 +19117,86 @@
|
|
|
19194
19117
|
if (dirty && leadingWhitespace) {
|
|
19195
19118
|
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
19196
19119
|
}
|
|
19197
|
-
|
|
19198
19120
|
/* Work on whole document or just its body */
|
|
19199
19121
|
if (NAMESPACE === HTML_NAMESPACE) {
|
|
19200
19122
|
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
|
19201
19123
|
}
|
|
19202
19124
|
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
19203
19125
|
};
|
|
19204
|
-
|
|
19205
19126
|
/**
|
|
19206
19127
|
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
19207
19128
|
*
|
|
19208
|
-
* @param
|
|
19209
|
-
* @return
|
|
19129
|
+
* @param root The root element or node to start traversing on.
|
|
19130
|
+
* @return The created NodeIterator
|
|
19210
19131
|
*/
|
|
19211
19132
|
var _createNodeIterator = function _createNodeIterator(root) {
|
|
19212
19133
|
return createNodeIterator.call(root.ownerDocument || root, root,
|
|
19213
19134
|
// eslint-disable-next-line no-bitwise
|
|
19214
19135
|
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
19215
19136
|
};
|
|
19216
|
-
|
|
19217
19137
|
/**
|
|
19218
19138
|
* _isClobbered
|
|
19219
19139
|
*
|
|
19220
|
-
* @param
|
|
19221
|
-
* @return
|
|
19140
|
+
* @param element element to check for clobbering attacks
|
|
19141
|
+
* @return true if clobbered, false if safe
|
|
19222
19142
|
*/
|
|
19223
|
-
var _isClobbered = function _isClobbered(
|
|
19224
|
-
return
|
|
19143
|
+
var _isClobbered = function _isClobbered(element) {
|
|
19144
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
|
|
19225
19145
|
};
|
|
19226
|
-
|
|
19227
19146
|
/**
|
|
19228
19147
|
* Checks whether the given object is a DOM node.
|
|
19229
19148
|
*
|
|
19230
|
-
* @param
|
|
19231
|
-
* @return
|
|
19149
|
+
* @param value object to check whether it's a DOM node
|
|
19150
|
+
* @return true is object is a DOM node
|
|
19232
19151
|
*/
|
|
19233
|
-
var _isNode = function _isNode(
|
|
19234
|
-
return typeof Node === 'function' &&
|
|
19152
|
+
var _isNode = function _isNode(value) {
|
|
19153
|
+
return typeof Node === 'function' && value instanceof Node;
|
|
19235
19154
|
};
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
* _executeHook
|
|
19239
|
-
* Execute user configurable hooks
|
|
19240
|
-
*
|
|
19241
|
-
* @param {String} entryPoint Name of the hook's entry point
|
|
19242
|
-
* @param {Node} currentNode node to work on with the hook
|
|
19243
|
-
* @param {Object} data additional hook parameters
|
|
19244
|
-
*/
|
|
19245
|
-
var _executeHook = function _executeHook(entryPoint, currentNode, data) {
|
|
19246
|
-
if (!hooks[entryPoint]) {
|
|
19247
|
-
return;
|
|
19248
|
-
}
|
|
19249
|
-
arrayForEach(hooks[entryPoint], function (hook) {
|
|
19155
|
+
function _executeHooks(hooks, currentNode, data) {
|
|
19156
|
+
arrayForEach(hooks, function (hook) {
|
|
19250
19157
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
19251
19158
|
});
|
|
19252
|
-
}
|
|
19253
|
-
|
|
19159
|
+
}
|
|
19254
19160
|
/**
|
|
19255
19161
|
* _sanitizeElements
|
|
19256
19162
|
*
|
|
19257
19163
|
* @protect nodeName
|
|
19258
19164
|
* @protect textContent
|
|
19259
19165
|
* @protect removeChild
|
|
19260
|
-
*
|
|
19261
|
-
* @
|
|
19262
|
-
* @return {Boolean} true if node was killed, false if left alive
|
|
19166
|
+
* @param currentNode to check for permission to exist
|
|
19167
|
+
* @return true if node was killed, false if left alive
|
|
19263
19168
|
*/
|
|
19264
19169
|
var _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
19265
19170
|
var content = null;
|
|
19266
|
-
|
|
19267
19171
|
/* Execute a hook if present */
|
|
19268
|
-
|
|
19269
|
-
|
|
19172
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
19270
19173
|
/* Check if element is clobbered or can clobber */
|
|
19271
19174
|
if (_isClobbered(currentNode)) {
|
|
19272
19175
|
_forceRemove(currentNode);
|
|
19273
19176
|
return true;
|
|
19274
19177
|
}
|
|
19275
|
-
|
|
19276
19178
|
/* Now let's check the element's type and name */
|
|
19277
19179
|
var tagName = transformCaseFunc(currentNode.nodeName);
|
|
19278
|
-
|
|
19279
19180
|
/* Execute a hook if present */
|
|
19280
|
-
|
|
19181
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
19281
19182
|
tagName: tagName,
|
|
19282
19183
|
allowedTags: ALLOWED_TAGS
|
|
19283
19184
|
});
|
|
19284
|
-
|
|
19285
19185
|
/* Detect mXSS attempts abusing namespace confusion */
|
|
19286
19186
|
if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
|
|
19287
19187
|
_forceRemove(currentNode);
|
|
19288
19188
|
return true;
|
|
19289
19189
|
}
|
|
19290
|
-
|
|
19291
|
-
/* Remove any ocurrence of processing instructions */
|
|
19190
|
+
/* Remove any occurrence of processing instructions */
|
|
19292
19191
|
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
19293
19192
|
_forceRemove(currentNode);
|
|
19294
19193
|
return true;
|
|
19295
19194
|
}
|
|
19296
|
-
|
|
19297
19195
|
/* Remove any kind of possibly harmful comments */
|
|
19298
19196
|
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
19299
19197
|
_forceRemove(currentNode);
|
|
19300
19198
|
return true;
|
|
19301
19199
|
}
|
|
19302
|
-
|
|
19303
19200
|
/* Remove element if anything forbids its presence */
|
|
19304
19201
|
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
19305
19202
|
/* Check if we have a custom element to handle */
|
|
@@ -19311,7 +19208,6 @@
|
|
|
19311
19208
|
return false;
|
|
19312
19209
|
}
|
|
19313
19210
|
}
|
|
19314
|
-
|
|
19315
19211
|
/* Keep content except for bad-listed elements */
|
|
19316
19212
|
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
19317
19213
|
var parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
@@ -19328,19 +19224,16 @@
|
|
|
19328
19224
|
_forceRemove(currentNode);
|
|
19329
19225
|
return true;
|
|
19330
19226
|
}
|
|
19331
|
-
|
|
19332
19227
|
/* Check whether element has a valid namespace */
|
|
19333
19228
|
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
19334
19229
|
_forceRemove(currentNode);
|
|
19335
19230
|
return true;
|
|
19336
19231
|
}
|
|
19337
|
-
|
|
19338
19232
|
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
19339
19233
|
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
19340
19234
|
_forceRemove(currentNode);
|
|
19341
19235
|
return true;
|
|
19342
19236
|
}
|
|
19343
|
-
|
|
19344
19237
|
/* Sanitize element content to be template-safe */
|
|
19345
19238
|
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
19346
19239
|
/* Get the element's text content */
|
|
@@ -19355,19 +19248,17 @@
|
|
|
19355
19248
|
currentNode.textContent = content;
|
|
19356
19249
|
}
|
|
19357
19250
|
}
|
|
19358
|
-
|
|
19359
19251
|
/* Execute a hook if present */
|
|
19360
|
-
|
|
19252
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
19361
19253
|
return false;
|
|
19362
19254
|
};
|
|
19363
|
-
|
|
19364
19255
|
/**
|
|
19365
19256
|
* _isValidAttribute
|
|
19366
19257
|
*
|
|
19367
|
-
* @param
|
|
19368
|
-
* @param
|
|
19369
|
-
* @param
|
|
19370
|
-
* @return
|
|
19258
|
+
* @param lcTag Lowercase tag name of containing element.
|
|
19259
|
+
* @param lcName Lowercase attribute name.
|
|
19260
|
+
* @param value Attribute value.
|
|
19261
|
+
* @return Returns true if `value` is valid, otherwise false.
|
|
19371
19262
|
*/
|
|
19372
19263
|
// eslint-disable-next-line complexity
|
|
19373
19264
|
var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
@@ -19375,7 +19266,6 @@
|
|
|
19375
19266
|
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
19376
19267
|
return false;
|
|
19377
19268
|
}
|
|
19378
|
-
|
|
19379
19269
|
/* Allow valid data-* attributes: At least one character after "-"
|
|
19380
19270
|
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
19381
19271
|
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
@@ -19397,19 +19287,17 @@
|
|
|
19397
19287
|
}
|
|
19398
19288
|
return true;
|
|
19399
19289
|
};
|
|
19400
|
-
|
|
19401
19290
|
/**
|
|
19402
19291
|
* _isBasicCustomElement
|
|
19403
19292
|
* checks if at least one dash is included in tagName, and it's not the first char
|
|
19404
19293
|
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
19405
19294
|
*
|
|
19406
|
-
* @param
|
|
19407
|
-
* @returns
|
|
19295
|
+
* @param tagName name of the tag of the node to sanitize
|
|
19296
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
19408
19297
|
*/
|
|
19409
19298
|
var _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
19410
19299
|
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
|
19411
19300
|
};
|
|
19412
|
-
|
|
19413
19301
|
/**
|
|
19414
19302
|
* _sanitizeAttributes
|
|
19415
19303
|
*
|
|
@@ -19418,25 +19306,24 @@
|
|
|
19418
19306
|
* @protect removeAttribute
|
|
19419
19307
|
* @protect setAttribute
|
|
19420
19308
|
*
|
|
19421
|
-
* @param
|
|
19309
|
+
* @param currentNode to sanitize
|
|
19422
19310
|
*/
|
|
19423
19311
|
var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
19424
19312
|
/* Execute a hook if present */
|
|
19425
|
-
|
|
19313
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
19426
19314
|
var attributes = currentNode.attributes;
|
|
19427
|
-
|
|
19428
19315
|
/* Check if we have attributes; if not we might have a text node */
|
|
19429
|
-
if (!attributes) {
|
|
19316
|
+
if (!attributes || _isClobbered(currentNode)) {
|
|
19430
19317
|
return;
|
|
19431
19318
|
}
|
|
19432
19319
|
var hookEvent = {
|
|
19433
19320
|
attrName: '',
|
|
19434
19321
|
attrValue: '',
|
|
19435
19322
|
keepAttr: true,
|
|
19436
|
-
allowedAttributes: ALLOWED_ATTR
|
|
19323
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
19324
|
+
forceKeepAttr: undefined
|
|
19437
19325
|
};
|
|
19438
19326
|
var l = attributes.length;
|
|
19439
|
-
|
|
19440
19327
|
/* Go backwards over all attributes; safely remove bad ones */
|
|
19441
19328
|
var _loop = function _loop() {
|
|
19442
19329
|
var attr = attributes[l];
|
|
@@ -19445,63 +19332,53 @@
|
|
|
19445
19332
|
attrValue = attr.value;
|
|
19446
19333
|
var lcName = transformCaseFunc(name);
|
|
19447
19334
|
var value = name === 'value' ? attrValue : stringTrim(attrValue);
|
|
19448
|
-
|
|
19449
19335
|
/* Execute a hook if present */
|
|
19450
19336
|
hookEvent.attrName = lcName;
|
|
19451
19337
|
hookEvent.attrValue = value;
|
|
19452
19338
|
hookEvent.keepAttr = true;
|
|
19453
19339
|
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
|
19454
|
-
|
|
19340
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
19455
19341
|
value = hookEvent.attrValue;
|
|
19342
|
+
/* Full DOM Clobbering protection via namespace isolation,
|
|
19343
|
+
* Prefix id and name attributes with `user-content-`
|
|
19344
|
+
*/
|
|
19345
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
19346
|
+
// Remove the attribute with this value
|
|
19347
|
+
_removeAttribute(name, currentNode);
|
|
19348
|
+
// Prefix the value and later re-create the attribute with the sanitized value
|
|
19349
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
19350
|
+
}
|
|
19351
|
+
/* Work around a security issue with comments inside attributes */
|
|
19352
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
19353
|
+
_removeAttribute(name, currentNode);
|
|
19354
|
+
return 0; // continue
|
|
19355
|
+
}
|
|
19456
19356
|
/* Did the hooks approve of the attribute? */
|
|
19457
19357
|
if (hookEvent.forceKeepAttr) {
|
|
19458
19358
|
return 0; // continue
|
|
19459
19359
|
}
|
|
19460
|
-
|
|
19461
19360
|
/* Remove attribute */
|
|
19462
19361
|
_removeAttribute(name, currentNode);
|
|
19463
|
-
|
|
19464
19362
|
/* Did the hooks approve of the attribute? */
|
|
19465
19363
|
if (!hookEvent.keepAttr) {
|
|
19466
19364
|
return 0; // continue
|
|
19467
19365
|
}
|
|
19468
|
-
|
|
19469
19366
|
/* Work around a security issue in jQuery 3.0 */
|
|
19470
19367
|
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
19471
19368
|
_removeAttribute(name, currentNode);
|
|
19472
19369
|
return 0; // continue
|
|
19473
19370
|
}
|
|
19474
|
-
|
|
19475
|
-
/* Work around a security issue with comments inside attributes */
|
|
19476
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
19477
|
-
_removeAttribute(name, currentNode);
|
|
19478
|
-
return 0; // continue
|
|
19479
|
-
}
|
|
19480
|
-
|
|
19481
19371
|
/* Sanitize attribute content to be template-safe */
|
|
19482
19372
|
if (SAFE_FOR_TEMPLATES) {
|
|
19483
19373
|
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], function (expr) {
|
|
19484
19374
|
value = stringReplace(value, expr, ' ');
|
|
19485
19375
|
});
|
|
19486
19376
|
}
|
|
19487
|
-
|
|
19488
19377
|
/* Is `value` valid for this attribute? */
|
|
19489
19378
|
var lcTag = transformCaseFunc(currentNode.nodeName);
|
|
19490
19379
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
19491
19380
|
return 0; // continue
|
|
19492
19381
|
}
|
|
19493
|
-
|
|
19494
|
-
/* Full DOM Clobbering protection via namespace isolation,
|
|
19495
|
-
* Prefix id and name attributes with `user-content-`
|
|
19496
|
-
*/
|
|
19497
|
-
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
19498
|
-
// Remove the attribute with this value
|
|
19499
|
-
_removeAttribute(name, currentNode);
|
|
19500
|
-
|
|
19501
|
-
// Prefix the value and later re-create the attribute with the sanitized value
|
|
19502
|
-
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
19503
|
-
}
|
|
19504
|
-
|
|
19505
19382
|
/* Handle attributes that require Trusted Types */
|
|
19506
19383
|
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
19507
19384
|
if (namespaceURI) ;else {
|
|
@@ -19519,7 +19396,6 @@
|
|
|
19519
19396
|
}
|
|
19520
19397
|
}
|
|
19521
19398
|
}
|
|
19522
|
-
|
|
19523
19399
|
/* Handle invalid data-* attribute set by try-catching it */
|
|
19524
19400
|
try {
|
|
19525
19401
|
if (namespaceURI) {
|
|
@@ -19540,51 +19416,34 @@
|
|
|
19540
19416
|
_ret = _loop();
|
|
19541
19417
|
if (_ret === 0) continue;
|
|
19542
19418
|
}
|
|
19543
|
-
|
|
19544
19419
|
/* Execute a hook if present */
|
|
19545
|
-
|
|
19420
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
19546
19421
|
};
|
|
19547
|
-
|
|
19548
19422
|
/**
|
|
19549
19423
|
* _sanitizeShadowDOM
|
|
19550
19424
|
*
|
|
19551
|
-
* @param
|
|
19425
|
+
* @param fragment to iterate over recursively
|
|
19552
19426
|
*/
|
|
19553
19427
|
var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
19554
19428
|
var shadowNode = null;
|
|
19555
19429
|
var shadowIterator = _createNodeIterator(fragment);
|
|
19556
|
-
|
|
19557
19430
|
/* Execute a hook if present */
|
|
19558
|
-
|
|
19431
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
19559
19432
|
while (shadowNode = shadowIterator.nextNode()) {
|
|
19560
19433
|
/* Execute a hook if present */
|
|
19561
|
-
|
|
19562
|
-
|
|
19434
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
19563
19435
|
/* Sanitize tags and elements */
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19436
|
+
_sanitizeElements(shadowNode);
|
|
19437
|
+
/* Check attributes next */
|
|
19438
|
+
_sanitizeAttributes(shadowNode);
|
|
19568
19439
|
/* Deep shadow DOM detected */
|
|
19569
19440
|
if (shadowNode.content instanceof DocumentFragment) {
|
|
19570
19441
|
_sanitizeShadowDOM(shadowNode.content);
|
|
19571
19442
|
}
|
|
19572
|
-
|
|
19573
|
-
/* Check attributes, sanitize if necessary */
|
|
19574
|
-
_sanitizeAttributes(shadowNode);
|
|
19575
19443
|
}
|
|
19576
|
-
|
|
19577
19444
|
/* Execute a hook if present */
|
|
19578
|
-
|
|
19445
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
19579
19446
|
};
|
|
19580
|
-
|
|
19581
|
-
/**
|
|
19582
|
-
* Sanitize
|
|
19583
|
-
* Public method providing core sanitation functionality
|
|
19584
|
-
*
|
|
19585
|
-
* @param {String|Node} dirty string or DOM node
|
|
19586
|
-
* @param {Object} cfg object
|
|
19587
|
-
*/
|
|
19588
19447
|
// eslint-disable-next-line complexity
|
|
19589
19448
|
DOMPurify.sanitize = function (dirty) {
|
|
19590
19449
|
var cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -19599,7 +19458,6 @@
|
|
|
19599
19458
|
if (IS_EMPTY_INPUT) {
|
|
19600
19459
|
dirty = '<!-->';
|
|
19601
19460
|
}
|
|
19602
|
-
|
|
19603
19461
|
/* Stringify, in case dirty is an object */
|
|
19604
19462
|
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
19605
19463
|
if (typeof dirty.toString === 'function') {
|
|
@@ -19611,20 +19469,16 @@
|
|
|
19611
19469
|
throw typeErrorCreate('toString is not a function');
|
|
19612
19470
|
}
|
|
19613
19471
|
}
|
|
19614
|
-
|
|
19615
19472
|
/* Return dirty HTML if DOMPurify cannot run */
|
|
19616
19473
|
if (!DOMPurify.isSupported) {
|
|
19617
19474
|
return dirty;
|
|
19618
19475
|
}
|
|
19619
|
-
|
|
19620
19476
|
/* Assign config vars */
|
|
19621
19477
|
if (!SET_CONFIG) {
|
|
19622
19478
|
_parseConfig(cfg);
|
|
19623
19479
|
}
|
|
19624
|
-
|
|
19625
19480
|
/* Clean up removed elements */
|
|
19626
19481
|
DOMPurify.removed = [];
|
|
19627
|
-
|
|
19628
19482
|
/* Check if dirty is correctly typed for IN_PLACE */
|
|
19629
19483
|
if (typeof dirty === 'string') {
|
|
19630
19484
|
IN_PLACE = false;
|
|
@@ -19658,45 +19512,34 @@
|
|
|
19658
19512
|
dirty.indexOf('<') === -1) {
|
|
19659
19513
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
19660
19514
|
}
|
|
19661
|
-
|
|
19662
19515
|
/* Initialize the document to work on */
|
|
19663
19516
|
body = _initDocument(dirty);
|
|
19664
|
-
|
|
19665
19517
|
/* Check we have a DOM node from the data */
|
|
19666
19518
|
if (!body) {
|
|
19667
19519
|
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
|
19668
19520
|
}
|
|
19669
19521
|
}
|
|
19670
|
-
|
|
19671
19522
|
/* Remove first element node (ours) if FORCE_BODY is set */
|
|
19672
19523
|
if (body && FORCE_BODY) {
|
|
19673
19524
|
_forceRemove(body.firstChild);
|
|
19674
19525
|
}
|
|
19675
|
-
|
|
19676
19526
|
/* Get node iterator */
|
|
19677
19527
|
var nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
19678
|
-
|
|
19679
19528
|
/* Now start iterating over the created document */
|
|
19680
19529
|
while (currentNode = nodeIterator.nextNode()) {
|
|
19681
19530
|
/* Sanitize tags and elements */
|
|
19682
|
-
|
|
19683
|
-
|
|
19684
|
-
|
|
19685
|
-
|
|
19531
|
+
_sanitizeElements(currentNode);
|
|
19532
|
+
/* Check attributes next */
|
|
19533
|
+
_sanitizeAttributes(currentNode);
|
|
19686
19534
|
/* Shadow DOM detected, sanitize it */
|
|
19687
19535
|
if (currentNode.content instanceof DocumentFragment) {
|
|
19688
19536
|
_sanitizeShadowDOM(currentNode.content);
|
|
19689
19537
|
}
|
|
19690
|
-
|
|
19691
|
-
/* Check attributes, sanitize if necessary */
|
|
19692
|
-
_sanitizeAttributes(currentNode);
|
|
19693
19538
|
}
|
|
19694
|
-
|
|
19695
19539
|
/* If we sanitized `dirty` in-place, return it. */
|
|
19696
19540
|
if (IN_PLACE) {
|
|
19697
19541
|
return dirty;
|
|
19698
19542
|
}
|
|
19699
|
-
|
|
19700
19543
|
/* Return sanitized string or DOM */
|
|
19701
19544
|
if (RETURN_DOM) {
|
|
19702
19545
|
if (RETURN_DOM_FRAGMENT) {
|
|
@@ -19721,12 +19564,10 @@
|
|
|
19721
19564
|
return returnNode;
|
|
19722
19565
|
}
|
|
19723
19566
|
var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
19724
|
-
|
|
19725
19567
|
/* Serialize doctype if allowed */
|
|
19726
19568
|
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
19727
19569
|
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
|
19728
19570
|
}
|
|
19729
|
-
|
|
19730
19571
|
/* Sanitize final string template-safe */
|
|
19731
19572
|
if (SAFE_FOR_TEMPLATES) {
|
|
19732
19573
|
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], function (expr) {
|
|
@@ -19735,39 +19576,15 @@
|
|
|
19735
19576
|
}
|
|
19736
19577
|
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
19737
19578
|
};
|
|
19738
|
-
|
|
19739
|
-
/**
|
|
19740
|
-
* Public method to set the configuration once
|
|
19741
|
-
* setConfig
|
|
19742
|
-
*
|
|
19743
|
-
* @param {Object} cfg configuration object
|
|
19744
|
-
*/
|
|
19745
19579
|
DOMPurify.setConfig = function () {
|
|
19746
19580
|
var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19747
19581
|
_parseConfig(cfg);
|
|
19748
19582
|
SET_CONFIG = true;
|
|
19749
19583
|
};
|
|
19750
|
-
|
|
19751
|
-
/**
|
|
19752
|
-
* Public method to remove the configuration
|
|
19753
|
-
* clearConfig
|
|
19754
|
-
*
|
|
19755
|
-
*/
|
|
19756
19584
|
DOMPurify.clearConfig = function () {
|
|
19757
19585
|
CONFIG = null;
|
|
19758
19586
|
SET_CONFIG = false;
|
|
19759
19587
|
};
|
|
19760
|
-
|
|
19761
|
-
/**
|
|
19762
|
-
* Public method to check if an attribute value is valid.
|
|
19763
|
-
* Uses last set config, if any. Otherwise, uses config defaults.
|
|
19764
|
-
* isValidAttribute
|
|
19765
|
-
*
|
|
19766
|
-
* @param {String} tag Tag name of containing element.
|
|
19767
|
-
* @param {String} attr Attribute name.
|
|
19768
|
-
* @param {String} value Attribute value.
|
|
19769
|
-
* @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
|
|
19770
|
-
*/
|
|
19771
19588
|
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
19772
19589
|
/* Initialize shared config vars if necessary. */
|
|
19773
19590
|
if (!CONFIG) {
|
|
@@ -19777,54 +19594,24 @@
|
|
|
19777
19594
|
var lcName = transformCaseFunc(attr);
|
|
19778
19595
|
return _isValidAttribute(lcTag, lcName, value);
|
|
19779
19596
|
};
|
|
19780
|
-
|
|
19781
|
-
/**
|
|
19782
|
-
* AddHook
|
|
19783
|
-
* Public method to add DOMPurify hooks
|
|
19784
|
-
*
|
|
19785
|
-
* @param {String} entryPoint entry point for the hook to add
|
|
19786
|
-
* @param {Function} hookFunction function to execute
|
|
19787
|
-
*/
|
|
19788
19597
|
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
|
19789
19598
|
if (typeof hookFunction !== 'function') {
|
|
19790
19599
|
return;
|
|
19791
19600
|
}
|
|
19792
|
-
hooks[entryPoint] = hooks[entryPoint] || [];
|
|
19793
19601
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
19794
19602
|
};
|
|
19795
|
-
|
|
19796
|
-
|
|
19797
|
-
|
|
19798
|
-
|
|
19799
|
-
* (pops it from the stack of hooks if more are present)
|
|
19800
|
-
*
|
|
19801
|
-
* @param {String} entryPoint entry point for the hook to remove
|
|
19802
|
-
* @return {Function} removed(popped) hook
|
|
19803
|
-
*/
|
|
19804
|
-
DOMPurify.removeHook = function (entryPoint) {
|
|
19805
|
-
if (hooks[entryPoint]) {
|
|
19806
|
-
return arrayPop(hooks[entryPoint]);
|
|
19603
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
19604
|
+
if (hookFunction !== undefined) {
|
|
19605
|
+
var index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
19606
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
19807
19607
|
}
|
|
19608
|
+
return arrayPop(hooks[entryPoint]);
|
|
19808
19609
|
};
|
|
19809
|
-
|
|
19810
|
-
/**
|
|
19811
|
-
* RemoveHooks
|
|
19812
|
-
* Public method to remove all DOMPurify hooks at a given entryPoint
|
|
19813
|
-
*
|
|
19814
|
-
* @param {String} entryPoint entry point for the hooks to remove
|
|
19815
|
-
*/
|
|
19816
19610
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
19817
|
-
|
|
19818
|
-
hooks[entryPoint] = [];
|
|
19819
|
-
}
|
|
19611
|
+
hooks[entryPoint] = [];
|
|
19820
19612
|
};
|
|
19821
|
-
|
|
19822
|
-
/**
|
|
19823
|
-
* RemoveAllHooks
|
|
19824
|
-
* Public method to remove all DOMPurify hooks
|
|
19825
|
-
*/
|
|
19826
19613
|
DOMPurify.removeAllHooks = function () {
|
|
19827
|
-
hooks =
|
|
19614
|
+
hooks = _createHooksMap();
|
|
19828
19615
|
};
|
|
19829
19616
|
return DOMPurify;
|
|
19830
19617
|
}
|
|
@@ -19835,12 +19622,6 @@
|
|
|
19835
19622
|
|
|
19836
19623
|
var browser = window.DOMPurify || (window.DOMPurify = purify["default"] || purify);
|
|
19837
19624
|
|
|
19838
|
-
var DOMPurify = /*#__PURE__*/Object.freeze({
|
|
19839
|
-
__proto__: null,
|
|
19840
|
-
'default': browser,
|
|
19841
|
-
__moduleExports: browser
|
|
19842
|
-
});
|
|
19843
|
-
|
|
19844
19625
|
var textarea;
|
|
19845
19626
|
function decodeEntity(name) {
|
|
19846
19627
|
textarea = textarea || document.createElement('textarea');
|
|
@@ -26886,7 +26667,7 @@
|
|
|
26886
26667
|
if (typeof renderItem === 'function') {
|
|
26887
26668
|
var jsxEl = renderItem(newSuggestion);
|
|
26888
26669
|
var innerValue = innerText(jsxEl);
|
|
26889
|
-
newSuggestion.value =
|
|
26670
|
+
newSuggestion.value = browser.sanitize(innerValue);
|
|
26890
26671
|
}
|
|
26891
26672
|
return newSuggestion;
|
|
26892
26673
|
}
|
|
@@ -26926,9 +26707,11 @@
|
|
|
26926
26707
|
field: Q.string,
|
|
26927
26708
|
weight: Q.number
|
|
26928
26709
|
})]),
|
|
26710
|
+
vectorDataField: Q.string,
|
|
26929
26711
|
aggregationField: types.string,
|
|
26930
26712
|
aggregationSize: Q.number,
|
|
26931
26713
|
size: Q.number,
|
|
26714
|
+
candidates: Q.number,
|
|
26932
26715
|
debounce: Q.number.def(0),
|
|
26933
26716
|
defaultValue: types.string,
|
|
26934
26717
|
excludeFields: types.excludeFields,
|
|
@@ -28226,7 +28009,7 @@
|
|
|
28226
28009
|
"style": {
|
|
28227
28010
|
display: 'flex'
|
|
28228
28011
|
},
|
|
28229
|
-
"innerHTML":
|
|
28012
|
+
"innerHTML": browser.sanitize(item.icon)
|
|
28230
28013
|
}, null);
|
|
28231
28014
|
};
|
|
28232
28015
|
}
|
|
@@ -28237,7 +28020,7 @@
|
|
|
28237
28020
|
"style": {
|
|
28238
28021
|
maxWidth: '30px'
|
|
28239
28022
|
},
|
|
28240
|
-
"src":
|
|
28023
|
+
"src": browser.sanitize(item.iconURL),
|
|
28241
28024
|
"alt": item.value
|
|
28242
28025
|
}, null)
|
|
28243
28026
|
);
|
|
@@ -28275,7 +28058,7 @@
|
|
|
28275
28058
|
}), !_this19.showAIScreen && _this19.parsedSuggestions.map(function (item, itemIndex) {
|
|
28276
28059
|
var index = indexOffset + itemIndex;
|
|
28277
28060
|
if (Array.isArray(item)) {
|
|
28278
|
-
var sectionHtml =
|
|
28061
|
+
var sectionHtml = browser.sanitize(item[0].sectionLabel);
|
|
28279
28062
|
indexOffset += item.length - 1;
|
|
28280
28063
|
return vue.createVNode("div", {
|
|
28281
28064
|
"key": "section-" + itemIndex,
|
|
@@ -44993,12 +44776,21 @@
|
|
|
44993
44776
|
ReactiveGoogleMap.componentType = componentTypes$1.reactiveMap;
|
|
44994
44777
|
|
|
44995
44778
|
var _PatchFlagNames, _slotFlagsText;
|
|
44996
|
-
|
|
44997
|
-
|
|
44998
|
-
|
|
44999
|
-
|
|
45000
|
-
|
|
45001
|
-
|
|
44779
|
+
/**
|
|
44780
|
+
* @vue/shared v3.5.13
|
|
44781
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
44782
|
+
* @license MIT
|
|
44783
|
+
**/
|
|
44784
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
44785
|
+
// @__NO_SIDE_EFFECTS__
|
|
44786
|
+
function makeMap(str) {
|
|
44787
|
+
var map = /* @__PURE__ */Object.create(null);
|
|
44788
|
+
for (var _iterator = _createForOfIteratorHelperLoose(str.split(",")), _step; !(_step = _iterator()).done;) {
|
|
44789
|
+
var key = _step.value;
|
|
44790
|
+
map[key] = 1;
|
|
44791
|
+
}
|
|
44792
|
+
return function (val) {
|
|
44793
|
+
return val in map;
|
|
45002
44794
|
};
|
|
45003
44795
|
}
|
|
45004
44796
|
var EMPTY_OBJ = Object.freeze({}) ;
|
|
@@ -45070,14 +44862,13 @@
|
|
|
45070
44862
|
return ret;
|
|
45071
44863
|
}
|
|
45072
44864
|
function stringifyStyle(styles) {
|
|
44865
|
+
if (!styles) return "";
|
|
44866
|
+
if (isString(styles)) return styles;
|
|
45073
44867
|
var ret = "";
|
|
45074
|
-
if (!styles || isString(styles)) {
|
|
45075
|
-
return ret;
|
|
45076
|
-
}
|
|
45077
44868
|
for (var key in styles) {
|
|
45078
44869
|
var value = styles[key];
|
|
45079
|
-
var normalizedKey = key.startsWith("--") ? key : hyphenate(key);
|
|
45080
44870
|
if (isString(value) || typeof value === "number") {
|
|
44871
|
+
var normalizedKey = key.startsWith("--") ? key : hyphenate(key);
|
|
45081
44872
|
ret += normalizedKey + ":" + value + ";";
|
|
45082
44873
|
}
|
|
45083
44874
|
}
|
|
@@ -45130,6 +44921,13 @@
|
|
|
45130
44921
|
htmlFor: "for",
|
|
45131
44922
|
httpEquiv: "http-equiv"
|
|
45132
44923
|
};
|
|
44924
|
+
function isRenderableAttrValue(value) {
|
|
44925
|
+
if (value == null) {
|
|
44926
|
+
return false;
|
|
44927
|
+
}
|
|
44928
|
+
var type = typeof value;
|
|
44929
|
+
return type === "string" || type === "number" || type === "boolean";
|
|
44930
|
+
}
|
|
45133
44931
|
var escapeRE = /["'&<>]/;
|
|
45134
44932
|
function escapeHtml$1(string) {
|
|
45135
44933
|
var str = "" + string;
|
|
@@ -45175,7 +44973,7 @@
|
|
|
45175
44973
|
}
|
|
45176
44974
|
|
|
45177
44975
|
var _ErrorTypeStrings;
|
|
45178
|
-
var shouldIgnoreProp = makeMap(",key,ref,innerHTML,textContent,ref_key,ref_for");
|
|
44976
|
+
var shouldIgnoreProp = /* @__PURE__ */makeMap(",key,ref,innerHTML,textContent,ref_key,ref_for");
|
|
45179
44977
|
function ssrRenderAttrs(props, tag) {
|
|
45180
44978
|
var ret = "";
|
|
45181
44979
|
for (var key in props) {
|
|
@@ -45187,6 +44985,8 @@
|
|
|
45187
44985
|
ret += " class=\"" + ssrRenderClass(value) + "\"";
|
|
45188
44986
|
} else if (key === "style") {
|
|
45189
44987
|
ret += " style=\"" + ssrRenderStyle(value) + "\"";
|
|
44988
|
+
} else if (key === "className") {
|
|
44989
|
+
ret += " class=\"" + String(value) + "\"";
|
|
45190
44990
|
} else {
|
|
45191
44991
|
ret += ssrRenderDynamicAttr(key, value, tag);
|
|
45192
44992
|
}
|
|
@@ -45194,7 +44994,7 @@
|
|
|
45194
44994
|
return ret;
|
|
45195
44995
|
}
|
|
45196
44996
|
function ssrRenderDynamicAttr(key, value, tag) {
|
|
45197
|
-
if (!
|
|
44997
|
+
if (!isRenderableAttrValue(value)) {
|
|
45198
44998
|
return "";
|
|
45199
44999
|
}
|
|
45200
45000
|
var attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
|
|
@@ -45207,13 +45007,6 @@
|
|
|
45207
45007
|
return "";
|
|
45208
45008
|
}
|
|
45209
45009
|
}
|
|
45210
|
-
function isRenderableValue(value) {
|
|
45211
|
-
if (value == null) {
|
|
45212
|
-
return false;
|
|
45213
|
-
}
|
|
45214
|
-
var type = typeof value;
|
|
45215
|
-
return type === "string" || type === "number" || type === "boolean";
|
|
45216
|
-
}
|
|
45217
45010
|
function ssrRenderClass(raw) {
|
|
45218
45011
|
return escapeHtml$1(normalizeClass(raw));
|
|
45219
45012
|
}
|
|
@@ -45227,6 +45020,7 @@
|
|
|
45227
45020
|
var styles = normalizeStyle(raw);
|
|
45228
45021
|
return escapeHtml$1(stringifyStyle(styles));
|
|
45229
45022
|
}
|
|
45023
|
+
var ensureValidVNode = vue.ssrUtils.ensureValidVNode;
|
|
45230
45024
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
45231
45025
|
parentPush("<!--teleport start-->");
|
|
45232
45026
|
var context = parentComponent.appContext.provides[vue.ssrContextKey];
|
|
@@ -45236,11 +45030,12 @@
|
|
|
45236
45030
|
var teleportContent;
|
|
45237
45031
|
if (disabled) {
|
|
45238
45032
|
contentRenderFn(parentPush);
|
|
45239
|
-
teleportContent = "<!--teleport anchor-->";
|
|
45033
|
+
teleportContent = "<!--teleport start anchor--><!--teleport anchor-->";
|
|
45240
45034
|
} else {
|
|
45241
45035
|
var _createBuffer = createBuffer(),
|
|
45242
45036
|
getBuffer = _createBuffer.getBuffer,
|
|
45243
45037
|
push = _createBuffer.push;
|
|
45038
|
+
push("<!--teleport start anchor-->");
|
|
45244
45039
|
contentRenderFn(push);
|
|
45245
45040
|
push("<!--teleport anchor-->");
|
|
45246
45041
|
teleportContent = getBuffer();
|
|
@@ -45248,7 +45043,7 @@
|
|
|
45248
45043
|
targetBuffer.splice(bufferIndex, 0, teleportContent);
|
|
45249
45044
|
parentPush("<!--teleport end-->");
|
|
45250
45045
|
}
|
|
45251
|
-
var ErrorTypeStrings = (_ErrorTypeStrings = {}, _ErrorTypeStrings["sp"] = "serverPrefetch hook", _ErrorTypeStrings["bc"] = "beforeCreate hook", _ErrorTypeStrings["c"] = "created hook", _ErrorTypeStrings["bm"] = "beforeMount hook", _ErrorTypeStrings["m"] = "mounted hook", _ErrorTypeStrings["bu"] = "beforeUpdate hook", _ErrorTypeStrings["u"] = "updated", _ErrorTypeStrings["bum"] = "beforeUnmount hook", _ErrorTypeStrings["um"] = "unmounted hook", _ErrorTypeStrings["a"] = "activated hook", _ErrorTypeStrings["da"] = "deactivated hook", _ErrorTypeStrings["ec"] = "errorCaptured hook", _ErrorTypeStrings["rtc"] = "renderTracked hook", _ErrorTypeStrings["rtg"] = "renderTriggered hook", _ErrorTypeStrings[0] = "setup function", _ErrorTypeStrings[1] = "render function", _ErrorTypeStrings[2] = "watcher getter", _ErrorTypeStrings[3] = "watcher callback", _ErrorTypeStrings[4] = "watcher cleanup function", _ErrorTypeStrings[5] = "native event handler", _ErrorTypeStrings[6] = "component event handler", _ErrorTypeStrings[7] = "vnode hook", _ErrorTypeStrings[8] = "directive hook", _ErrorTypeStrings[9] = "transition hook", _ErrorTypeStrings[10] = "app errorHandler", _ErrorTypeStrings[11] = "app warnHandler", _ErrorTypeStrings[12] = "ref function", _ErrorTypeStrings[13] = "async component loader", _ErrorTypeStrings[14] = "scheduler flush
|
|
45046
|
+
var ErrorTypeStrings = (_ErrorTypeStrings = {}, _ErrorTypeStrings["sp"] = "serverPrefetch hook", _ErrorTypeStrings["bc"] = "beforeCreate hook", _ErrorTypeStrings["c"] = "created hook", _ErrorTypeStrings["bm"] = "beforeMount hook", _ErrorTypeStrings["m"] = "mounted hook", _ErrorTypeStrings["bu"] = "beforeUpdate hook", _ErrorTypeStrings["u"] = "updated", _ErrorTypeStrings["bum"] = "beforeUnmount hook", _ErrorTypeStrings["um"] = "unmounted hook", _ErrorTypeStrings["a"] = "activated hook", _ErrorTypeStrings["da"] = "deactivated hook", _ErrorTypeStrings["ec"] = "errorCaptured hook", _ErrorTypeStrings["rtc"] = "renderTracked hook", _ErrorTypeStrings["rtg"] = "renderTriggered hook", _ErrorTypeStrings[0] = "setup function", _ErrorTypeStrings[1] = "render function", _ErrorTypeStrings[2] = "watcher getter", _ErrorTypeStrings[3] = "watcher callback", _ErrorTypeStrings[4] = "watcher cleanup function", _ErrorTypeStrings[5] = "native event handler", _ErrorTypeStrings[6] = "component event handler", _ErrorTypeStrings[7] = "vnode hook", _ErrorTypeStrings[8] = "directive hook", _ErrorTypeStrings[9] = "transition hook", _ErrorTypeStrings[10] = "app errorHandler", _ErrorTypeStrings[11] = "app warnHandler", _ErrorTypeStrings[12] = "ref function", _ErrorTypeStrings[13] = "async component loader", _ErrorTypeStrings[14] = "scheduler flush", _ErrorTypeStrings[15] = "component update", _ErrorTypeStrings[16] = "app unmount cleanup function", _ErrorTypeStrings);
|
|
45252
45047
|
{
|
|
45253
45048
|
var g$2 = getGlobalThis();
|
|
45254
45049
|
var registerGlobalSetter = function registerGlobalSetter(key, setter) {
|
|
@@ -45277,7 +45072,9 @@
|
|
|
45277
45072
|
setCurrentRenderingInstance = vue.ssrUtils.setCurrentRenderingInstance,
|
|
45278
45073
|
setupComponent = vue.ssrUtils.setupComponent,
|
|
45279
45074
|
renderComponentRoot = vue.ssrUtils.renderComponentRoot,
|
|
45280
|
-
normalizeVNode = vue.ssrUtils.normalizeVNode
|
|
45075
|
+
normalizeVNode = vue.ssrUtils.normalizeVNode,
|
|
45076
|
+
pushWarningContext = vue.ssrUtils.pushWarningContext,
|
|
45077
|
+
popWarningContext = vue.ssrUtils.popWarningContext;
|
|
45281
45078
|
function createBuffer() {
|
|
45282
45079
|
var appendable = false;
|
|
45283
45080
|
var buffer = [];
|
|
@@ -45289,9 +45086,9 @@
|
|
|
45289
45086
|
var isStringItem = isString(item);
|
|
45290
45087
|
if (appendable && isStringItem) {
|
|
45291
45088
|
buffer[buffer.length - 1] += item;
|
|
45292
|
-
|
|
45293
|
-
buffer.push(item);
|
|
45089
|
+
return;
|
|
45294
45090
|
}
|
|
45091
|
+
buffer.push(item);
|
|
45295
45092
|
appendable = isStringItem;
|
|
45296
45093
|
if (isPromise(item) || isArray(item) && item.hasAsync) {
|
|
45297
45094
|
buffer.hasAsync = true;
|
|
@@ -45303,20 +45100,22 @@
|
|
|
45303
45100
|
if (parentComponent === void 0) {
|
|
45304
45101
|
parentComponent = null;
|
|
45305
45102
|
}
|
|
45306
|
-
var instance = createComponentInstance(vnode, parentComponent, null);
|
|
45103
|
+
var instance = vnode.component = createComponentInstance(vnode, parentComponent, null);
|
|
45104
|
+
pushWarningContext(vnode);
|
|
45307
45105
|
var res = setupComponent(instance, true
|
|
45308
45106
|
/* isSSR */);
|
|
45107
|
+
popWarningContext();
|
|
45309
45108
|
var hasAsyncSetup = isPromise(res);
|
|
45310
45109
|
var prefetches = instance.sp;
|
|
45311
45110
|
if (hasAsyncSetup || prefetches) {
|
|
45312
|
-
var p =
|
|
45313
|
-
|
|
45314
|
-
|
|
45111
|
+
var p = Promise.resolve(res).then(function () {
|
|
45112
|
+
if (hasAsyncSetup) prefetches = instance.sp;
|
|
45113
|
+
if (prefetches) {
|
|
45315
45114
|
return Promise.all(prefetches.map(function (prefetch) {
|
|
45316
45115
|
return prefetch.call(instance.proxy);
|
|
45317
45116
|
}));
|
|
45318
|
-
}
|
|
45319
|
-
}
|
|
45117
|
+
}
|
|
45118
|
+
})["catch"](NOOP);
|
|
45320
45119
|
return p.then(function () {
|
|
45321
45120
|
return renderComponentSubTree(instance, slotScopeId);
|
|
45322
45121
|
});
|
|
@@ -45325,6 +45124,7 @@
|
|
|
45325
45124
|
}
|
|
45326
45125
|
}
|
|
45327
45126
|
function renderComponentSubTree(instance, slotScopeId) {
|
|
45127
|
+
pushWarningContext(instance.vnode);
|
|
45328
45128
|
var comp = instance.type;
|
|
45329
45129
|
var _createBuffer2 = createBuffer(),
|
|
45330
45130
|
getBuffer = _createBuffer2.getBuffer,
|
|
@@ -45343,13 +45143,6 @@
|
|
|
45343
45143
|
if ((!instance.render || instance.render === NOOP) && !instance.ssrRender && !comp.ssrRender && isString(comp.template)) {
|
|
45344
45144
|
comp.ssrRender = ssrCompile(comp.template);
|
|
45345
45145
|
}
|
|
45346
|
-
for (var _iterator = _createForOfIteratorHelperLoose(instance.scope.effects), _step; !(_step = _iterator()).done;) {
|
|
45347
|
-
var e = _step.value;
|
|
45348
|
-
if (e.computed) {
|
|
45349
|
-
e.computed._dirty = true;
|
|
45350
|
-
e.computed._cacheable = true;
|
|
45351
|
-
}
|
|
45352
|
-
}
|
|
45353
45146
|
var ssrRender = instance.ssrRender || comp.ssrRender;
|
|
45354
45147
|
if (ssrRender) {
|
|
45355
45148
|
var attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
|
|
@@ -45373,7 +45166,10 @@
|
|
|
45373
45166
|
}
|
|
45374
45167
|
if (slotScopeId) {
|
|
45375
45168
|
if (!hasCloned) attrs = _extends({}, attrs);
|
|
45376
|
-
|
|
45169
|
+
var slotScopeIdList = slotScopeId.trim().split(" ");
|
|
45170
|
+
for (var i = 0; i < slotScopeIdList.length; i++) {
|
|
45171
|
+
attrs[slotScopeIdList[i]] = "";
|
|
45172
|
+
}
|
|
45377
45173
|
}
|
|
45378
45174
|
var prev = setCurrentRenderingInstance(instance);
|
|
45379
45175
|
try {
|
|
@@ -45391,12 +45187,18 @@
|
|
|
45391
45187
|
push("<!---->");
|
|
45392
45188
|
}
|
|
45393
45189
|
}
|
|
45190
|
+
popWarningContext();
|
|
45394
45191
|
return getBuffer();
|
|
45395
45192
|
}
|
|
45396
45193
|
function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
45397
45194
|
var type = vnode.type,
|
|
45398
45195
|
shapeFlag = vnode.shapeFlag,
|
|
45399
|
-
children = vnode.children
|
|
45196
|
+
children = vnode.children,
|
|
45197
|
+
dirs = vnode.dirs,
|
|
45198
|
+
props = vnode.props;
|
|
45199
|
+
if (dirs) {
|
|
45200
|
+
vnode.props = applySSRDirectives(vnode, props, dirs);
|
|
45201
|
+
}
|
|
45400
45202
|
switch (type) {
|
|
45401
45203
|
case vue.Text:
|
|
45402
45204
|
push(escapeHtml$1(children));
|
|
@@ -45439,12 +45241,8 @@
|
|
|
45439
45241
|
var props = vnode.props,
|
|
45440
45242
|
children = vnode.children,
|
|
45441
45243
|
shapeFlag = vnode.shapeFlag,
|
|
45442
|
-
scopeId = vnode.scopeId
|
|
45443
|
-
dirs = vnode.dirs;
|
|
45244
|
+
scopeId = vnode.scopeId;
|
|
45444
45245
|
var openTag = "<" + tag;
|
|
45445
|
-
if (dirs) {
|
|
45446
|
-
props = applySSRDirectives(vnode, props, dirs);
|
|
45447
|
-
}
|
|
45448
45246
|
if (props) {
|
|
45449
45247
|
openTag += ssrRenderAttrs(props, tag);
|
|
45450
45248
|
}
|
|
@@ -45518,64 +45316,46 @@
|
|
|
45518
45316
|
}, target, disabled || disabled === "", parentComponent);
|
|
45519
45317
|
}
|
|
45520
45318
|
var isVNode$1 = vue.ssrUtils.isVNode;
|
|
45521
|
-
function
|
|
45522
|
-
|
|
45523
|
-
|
|
45524
|
-
|
|
45525
|
-
|
|
45526
|
-
|
|
45527
|
-
|
|
45528
|
-
|
|
45529
|
-
|
|
45530
|
-
|
|
45531
|
-
|
|
45532
|
-
|
|
45533
|
-
|
|
45534
|
-
|
|
45535
|
-
|
|
45536
|
-
|
|
45537
|
-
|
|
45538
|
-
|
|
45539
|
-
break;
|
|
45540
|
-
}
|
|
45541
|
-
item = buffer[i];
|
|
45542
|
-
if (!isPromise(item)) {
|
|
45543
|
-
_context3.next = 9;
|
|
45544
|
-
break;
|
|
45545
|
-
}
|
|
45546
|
-
_context3.next = 8;
|
|
45547
|
-
return item;
|
|
45548
|
-
case 8:
|
|
45549
|
-
item = _context3.sent;
|
|
45550
|
-
case 9:
|
|
45551
|
-
if (!isString(item)) {
|
|
45552
|
-
_context3.next = 13;
|
|
45553
|
-
break;
|
|
45554
|
-
}
|
|
45555
|
-
ret += item;
|
|
45556
|
-
_context3.next = 17;
|
|
45557
|
-
break;
|
|
45558
|
-
case 13:
|
|
45559
|
-
_context3.t0 = ret;
|
|
45560
|
-
_context3.next = 16;
|
|
45561
|
-
return unrollBuffer$1(item);
|
|
45562
|
-
case 16:
|
|
45563
|
-
ret = _context3.t0 += _context3.sent;
|
|
45564
|
-
case 17:
|
|
45565
|
-
i++;
|
|
45566
|
-
_context3.next = 3;
|
|
45567
|
-
break;
|
|
45568
|
-
case 20:
|
|
45569
|
-
return _context3.abrupt("return", ret);
|
|
45570
|
-
case 23:
|
|
45571
|
-
return _context3.abrupt("return", unrollBufferSync$1(buffer));
|
|
45572
|
-
case 24:
|
|
45573
|
-
case "end":
|
|
45574
|
-
return _context3.stop();
|
|
45319
|
+
function nestedUnrollBuffer(buffer, parentRet, startIndex) {
|
|
45320
|
+
if (!buffer.hasAsync) {
|
|
45321
|
+
return parentRet + unrollBufferSync$1(buffer);
|
|
45322
|
+
}
|
|
45323
|
+
var ret = parentRet;
|
|
45324
|
+
var _loop = function _loop(i) {
|
|
45325
|
+
var item = buffer[i];
|
|
45326
|
+
if (isString(item)) {
|
|
45327
|
+
ret += item;
|
|
45328
|
+
return 0; // continue
|
|
45329
|
+
}
|
|
45330
|
+
if (isPromise(item)) {
|
|
45331
|
+
return {
|
|
45332
|
+
v: item.then(function (nestedItem) {
|
|
45333
|
+
buffer[i] = nestedItem;
|
|
45334
|
+
return nestedUnrollBuffer(buffer, ret, i);
|
|
45335
|
+
})
|
|
45336
|
+
};
|
|
45575
45337
|
}
|
|
45576
|
-
|
|
45577
|
-
|
|
45578
|
-
|
|
45338
|
+
var result = nestedUnrollBuffer(item, ret, 0);
|
|
45339
|
+
if (isPromise(result)) {
|
|
45340
|
+
return {
|
|
45341
|
+
v: result.then(function (nestedItem) {
|
|
45342
|
+
buffer[i] = nestedItem;
|
|
45343
|
+
return nestedUnrollBuffer(buffer, "", i);
|
|
45344
|
+
})
|
|
45345
|
+
};
|
|
45346
|
+
}
|
|
45347
|
+
ret = result;
|
|
45348
|
+
},
|
|
45349
|
+
_ret;
|
|
45350
|
+
for (var i = startIndex; i < buffer.length; i += 1) {
|
|
45351
|
+
_ret = _loop(i);
|
|
45352
|
+
if (_ret === 0) continue;
|
|
45353
|
+
if (_ret) return _ret.v;
|
|
45354
|
+
}
|
|
45355
|
+
return ret;
|
|
45356
|
+
}
|
|
45357
|
+
function unrollBuffer$1(buffer) {
|
|
45358
|
+
return nestedUnrollBuffer(buffer, "", 0);
|
|
45579
45359
|
}
|
|
45580
45360
|
function unrollBufferSync$1(buffer) {
|
|
45581
45361
|
var ret = "";
|
|
@@ -45589,23 +45369,23 @@
|
|
|
45589
45369
|
}
|
|
45590
45370
|
return ret;
|
|
45591
45371
|
}
|
|
45592
|
-
function renderToString(
|
|
45372
|
+
function renderToString(_x3, _x4) {
|
|
45593
45373
|
return _renderToString.apply(this, arguments);
|
|
45594
45374
|
}
|
|
45595
45375
|
function _renderToString() {
|
|
45596
|
-
_renderToString = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
45597
|
-
var vnode, buffer, result,
|
|
45598
|
-
return _regeneratorRuntime().wrap(function
|
|
45599
|
-
while (1) switch (
|
|
45376
|
+
_renderToString = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(input, context) {
|
|
45377
|
+
var vnode, buffer, result, _iterator2, _step2, unwatch;
|
|
45378
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
45379
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
45600
45380
|
case 0:
|
|
45601
45381
|
if (context === void 0) {
|
|
45602
45382
|
context = {};
|
|
45603
45383
|
}
|
|
45604
45384
|
if (!isVNode$1(input)) {
|
|
45605
|
-
|
|
45385
|
+
_context3.next = 3;
|
|
45606
45386
|
break;
|
|
45607
45387
|
}
|
|
45608
|
-
return
|
|
45388
|
+
return _context3.abrupt("return", renderToString(vue.createApp({
|
|
45609
45389
|
render: function render() {
|
|
45610
45390
|
return input;
|
|
45611
45391
|
}
|
|
@@ -45614,69 +45394,69 @@
|
|
|
45614
45394
|
vnode = vue.createVNode(input._component, input._props);
|
|
45615
45395
|
vnode.appContext = input._context;
|
|
45616
45396
|
input.provide(vue.ssrContextKey, context);
|
|
45617
|
-
|
|
45397
|
+
_context3.next = 8;
|
|
45618
45398
|
return renderComponentVNode(vnode);
|
|
45619
45399
|
case 8:
|
|
45620
|
-
buffer =
|
|
45621
|
-
|
|
45400
|
+
buffer = _context3.sent;
|
|
45401
|
+
_context3.next = 11;
|
|
45622
45402
|
return unrollBuffer$1(buffer);
|
|
45623
45403
|
case 11:
|
|
45624
|
-
result =
|
|
45625
|
-
|
|
45404
|
+
result = _context3.sent;
|
|
45405
|
+
_context3.next = 14;
|
|
45626
45406
|
return resolveTeleports(context);
|
|
45627
45407
|
case 14:
|
|
45628
45408
|
if (context.__watcherHandles) {
|
|
45629
|
-
for (
|
|
45630
|
-
unwatch =
|
|
45409
|
+
for (_iterator2 = _createForOfIteratorHelperLoose(context.__watcherHandles); !(_step2 = _iterator2()).done;) {
|
|
45410
|
+
unwatch = _step2.value;
|
|
45631
45411
|
unwatch();
|
|
45632
45412
|
}
|
|
45633
45413
|
}
|
|
45634
|
-
return
|
|
45414
|
+
return _context3.abrupt("return", result);
|
|
45635
45415
|
case 16:
|
|
45636
45416
|
case "end":
|
|
45637
|
-
return
|
|
45417
|
+
return _context3.stop();
|
|
45638
45418
|
}
|
|
45639
|
-
},
|
|
45419
|
+
}, _callee3);
|
|
45640
45420
|
}));
|
|
45641
45421
|
return _renderToString.apply(this, arguments);
|
|
45642
45422
|
}
|
|
45643
|
-
function resolveTeleports(
|
|
45423
|
+
function resolveTeleports(_x5) {
|
|
45644
45424
|
return _resolveTeleports.apply(this, arguments);
|
|
45645
45425
|
}
|
|
45646
45426
|
function _resolveTeleports() {
|
|
45647
|
-
_resolveTeleports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
45427
|
+
_resolveTeleports = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(context) {
|
|
45648
45428
|
var key;
|
|
45649
|
-
return _regeneratorRuntime().wrap(function
|
|
45650
|
-
while (1) switch (
|
|
45429
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
45430
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
45651
45431
|
case 0:
|
|
45652
45432
|
if (!context.__teleportBuffers) {
|
|
45653
|
-
|
|
45433
|
+
_context4.next = 14;
|
|
45654
45434
|
break;
|
|
45655
45435
|
}
|
|
45656
45436
|
context.teleports = context.teleports || {};
|
|
45657
|
-
|
|
45437
|
+
_context4.t0 = _regeneratorRuntime().keys(context.__teleportBuffers);
|
|
45658
45438
|
case 3:
|
|
45659
|
-
if ((
|
|
45660
|
-
|
|
45439
|
+
if ((_context4.t1 = _context4.t0()).done) {
|
|
45440
|
+
_context4.next = 14;
|
|
45661
45441
|
break;
|
|
45662
45442
|
}
|
|
45663
|
-
key =
|
|
45664
|
-
|
|
45665
|
-
|
|
45443
|
+
key = _context4.t1.value;
|
|
45444
|
+
_context4.t2 = unrollBuffer$1;
|
|
45445
|
+
_context4.next = 8;
|
|
45666
45446
|
return Promise.all([context.__teleportBuffers[key]]);
|
|
45667
45447
|
case 8:
|
|
45668
|
-
|
|
45669
|
-
|
|
45670
|
-
return (0,
|
|
45448
|
+
_context4.t3 = _context4.sent;
|
|
45449
|
+
_context4.next = 11;
|
|
45450
|
+
return (0, _context4.t2)(_context4.t3);
|
|
45671
45451
|
case 11:
|
|
45672
|
-
context.teleports[key] =
|
|
45673
|
-
|
|
45452
|
+
context.teleports[key] = _context4.sent;
|
|
45453
|
+
_context4.next = 3;
|
|
45674
45454
|
break;
|
|
45675
45455
|
case 14:
|
|
45676
45456
|
case "end":
|
|
45677
|
-
return
|
|
45457
|
+
return _context4.stop();
|
|
45678
45458
|
}
|
|
45679
|
-
},
|
|
45459
|
+
}, _callee4);
|
|
45680
45460
|
}));
|
|
45681
45461
|
return _resolveTeleports.apply(this, arguments);
|
|
45682
45462
|
}
|
|
@@ -46419,7 +46199,7 @@
|
|
|
46419
46199
|
// dataField is a required field for components other than search
|
|
46420
46200
|
// TODO: Revisit this logic based on the Appbase version
|
|
46421
46201
|
// dataField is no longer a required field in RS API
|
|
46422
|
-
if (props.componentType !== componentTypes$6.AIAnswer && !isSearchComponent$1(props.componentType) && !props.dataField) {
|
|
46202
|
+
if (props.componentType !== componentTypes$6.AIAnswer && !isSearchComponent$1(props.componentType) && !props.dataField && !props.vectorDataField) {
|
|
46423
46203
|
return null;
|
|
46424
46204
|
}
|
|
46425
46205
|
var endpoint;
|
|
@@ -46517,7 +46297,8 @@
|
|
|
46517
46297
|
execute: true
|
|
46518
46298
|
}) : {}), queryType !== queryTypes$3.suggestion ? {
|
|
46519
46299
|
vectorDataField: props.vectorDataField || undefined,
|
|
46520
|
-
imageValue: props.imageValue || undefined
|
|
46300
|
+
imageValue: props.imageValue || undefined,
|
|
46301
|
+
candidates: props.candidates || props.size || undefined
|
|
46521
46302
|
} : {});
|
|
46522
46303
|
}
|
|
46523
46304
|
return null;
|
|
@@ -47262,7 +47043,7 @@
|
|
|
47262
47043
|
}, queryString, renderFunction);
|
|
47263
47044
|
}
|
|
47264
47045
|
|
|
47265
|
-
var version = "3.
|
|
47046
|
+
var version = "3.5.0";
|
|
47266
47047
|
|
|
47267
47048
|
var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4, TreeListConnected, AIConnected];
|
|
47268
47049
|
function install$1 (Vue) {
|