@nsshunt/stsuxvue 1.0.133 → 1.0.134

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/stsuxvue.cjs CHANGED
@@ -6043,7 +6043,7 @@ var import_ansi_to_html = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin
6043
6043
  return Filter;
6044
6044
  }();
6045
6045
  })))(), 1);
6046
- /*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */
6046
+ /*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */
6047
6047
  function _arrayLikeToArray(r, a) {
6048
6048
  (null == a || a > r.length) && (a = r.length);
6049
6049
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -7038,7 +7038,7 @@ var _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallback)
7038
7038
  function createDOMPurify() {
7039
7039
  let window = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal$1();
7040
7040
  const DOMPurify = (root) => createDOMPurify(root);
7041
- DOMPurify.version = "3.4.14";
7041
+ DOMPurify.version = "3.4.15";
7042
7042
  DOMPurify.removed = [];
7043
7043
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
7044
7044
  DOMPurify.isSupported = false;
@@ -7055,6 +7055,7 @@ function createDOMPurify() {
7055
7055
  const ElementPrototype = Element.prototype;
7056
7056
  const cloneNode = lookupGetter(ElementPrototype, "cloneNode");
7057
7057
  const remove = lookupGetter(ElementPrototype, "remove");
7058
+ const removeAttributeNode = lookupGetter(ElementPrototype, "removeAttributeNode");
7058
7059
  const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
7059
7060
  const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
7060
7061
  const getParentNode = lookupGetter(ElementPrototype, "parentNode");
@@ -7509,7 +7510,7 @@ function createDOMPurify() {
7509
7510
  */
7510
7511
  const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
7511
7512
  try {
7512
- element.removeAttributeNode(attribute);
7513
+ removeAttributeNode(element, attribute);
7513
7514
  } catch (_) {
7514
7515
  try {
7515
7516
  element.removeAttribute(name);
@@ -7582,7 +7583,7 @@ function createDOMPurify() {
7582
7583
  from: element
7583
7584
  });
7584
7585
  try {
7585
- if (attr) element.removeAttributeNode(attr);
7586
+ if (attr) removeAttributeNode(element, attr);
7586
7587
  else element.removeAttribute(name);
7587
7588
  } catch (_) {
7588
7589
  try {
@@ -7828,7 +7829,7 @@ function createDOMPurify() {
7828
7829
  const realTagName = getNodeName ? getNodeName(element) : null;
7829
7830
  if (typeof realTagName !== "string") return false;
7830
7831
  if (transformCaseFunc(realTagName) !== "form") return false;
7831
- return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);
7832
+ return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.removeAttributeNode !== "function" || typeof element.getAttributeNode !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || element.nodeType !== getNodeType(element) || element.childNodes !== getChildNodes(element);
7832
7833
  };
7833
7834
  /**
7834
7835
  * Checks whether the given value is a DocumentFragment from any realm.
@@ -8113,24 +8114,38 @@ function createDOMPurify() {
8113
8114
  /**
8114
8115
  * Write a modified attribute value back onto the element. On
8115
8116
  * success, re-probe for clobbering introduced by the new value and
8116
- * remove the element when found; otherwise pop the removal entry
8117
- * recorded by the earlier _removeAttribute (long-standing pairing
8118
- * with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
8117
+ * remove the element when found; otherwise, when this writeback is the
8118
+ * recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the
8119
+ * removal entry that path recorded so it does not show as removed. On
8119
8120
  * failure, remove the attribute instead.
8120
8121
  *
8122
+ * Returns true only on a clean write (the value was set and the new value
8123
+ * introduced no clobbering). The caller uses that, together with its own
8124
+ * knowledge of whether this attribute pushed a DOMPurify.removed record, to
8125
+ * decide whether to pop that record. The pop must happen ONLY for the
8126
+ * named-prop remove-and-recreate; popping on any other value change (trim,
8127
+ * template scrubbing, Trusted Types) would consume an unrelated _forceRemove
8128
+ * subtree-cleanup record and let that detached subtree keep a live event
8129
+ * handler through the IN_PLACE neutralization pass (SO-001).
8130
+ *
8121
8131
  * @param currentNode the element carrying the attribute
8122
8132
  * @param name the attribute name as present on the element
8123
8133
  * @param namespaceURI the attribute's namespace, if any
8124
8134
  * @param value the new attribute value
8135
+ * @return true if the value was written without introducing clobbering
8125
8136
  */
8126
8137
  const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
8127
8138
  try {
8128
8139
  if (namespaceURI) currentNode.setAttributeNS(namespaceURI, name, value);
8129
8140
  else currentNode.setAttribute(name, value);
8130
- if (_isClobbered(currentNode)) _forceRemove(currentNode);
8131
- else arrayPop(DOMPurify.removed);
8141
+ if (_isClobbered(currentNode)) {
8142
+ _forceRemove(currentNode);
8143
+ return false;
8144
+ }
8145
+ return true;
8132
8146
  } catch (_) {
8133
8147
  _removeAttribute(name, currentNode);
8148
+ return false;
8134
8149
  }
8135
8150
  };
8136
8151
  /**
@@ -8163,6 +8178,7 @@ function createDOMPurify() {
8163
8178
  const lcName = transformCaseFunc(name);
8164
8179
  const initValue = attrValue;
8165
8180
  let value = name === "value" ? initValue : stringTrim(initValue);
8181
+ let recreatedNamedProp = false;
8166
8182
  hookEvent.attrName = lcName;
8167
8183
  hookEvent.attrValue = value;
8168
8184
  hookEvent.keepAttr = true;
@@ -8172,6 +8188,7 @@ function createDOMPurify() {
8172
8188
  if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
8173
8189
  _removeAttribute(name, currentNode, attr);
8174
8190
  value = SANITIZE_NAMED_PROPS_PREFIX + value;
8191
+ recreatedNamedProp = true;
8175
8192
  }
8176
8193
  if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
8177
8194
  _removeAttribute(name, currentNode, attr);
@@ -8196,7 +8213,9 @@ function createDOMPurify() {
8196
8213
  continue;
8197
8214
  }
8198
8215
  value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
8199
- if (value !== initValue) _setAttributeValue(currentNode, name, namespaceURI, value);
8216
+ if (value !== initValue) {
8217
+ if (_setAttributeValue(currentNode, name, namespaceURI, value) && recreatedNamedProp) arrayPop(DOMPurify.removed);
8218
+ }
8200
8219
  }
8201
8220
  _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
8202
8221
  };
@@ -8330,7 +8349,7 @@ function createDOMPurify() {
8330
8349
  if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") body = importedNode;
8331
8350
  else if (importedNode.nodeName === "HTML") body = importedNode;
8332
8351
  else body.appendChild(importedNode);
8333
- _sanitizeAttachedShadowRoots(importedNode);
8352
+ _sanitizeAttachedShadowRoots(body);
8334
8353
  } else {
8335
8354
  if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
8336
8355
  body = _initDocument(dirty);