@wavemaker/angular-app 11.14.1-21.64731 → 11.14.1-21.64741

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.
@@ -131327,7 +131327,7 @@ function requireDom$1 () {
131327
131327
  ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
131328
131328
  var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
131329
131329
  //level2
131330
- ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
131330
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
131331
131331
  ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
131332
131332
  ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
131333
131333
  ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
@@ -131377,9 +131377,10 @@ function requireDom$1 () {
131377
131377
  item: function(index) {
131378
131378
  return index >= 0 && index < this.length ? this[index] : null;
131379
131379
  },
131380
- toString:function(isHTML,nodeFilter){
131380
+ toString:function(isHTML,nodeFilter,options){
131381
+ var requireWellFormed = !!options && !!options.requireWellFormed;
131381
131382
  for(var buf = [], i = 0;i<this.length;i++){
131382
- serializeToString(this[i],buf,isHTML,nodeFilter);
131383
+ serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
131383
131384
  }
131384
131385
  return buf.join('');
131385
131386
  },
@@ -131624,13 +131625,28 @@ function requireDom$1 () {
131624
131625
  /**
131625
131626
  * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
131626
131627
  *
131627
- * __This behavior is slightly different from the in the specs__:
131628
+ * __This implementation differs from the specification:__
131628
131629
  * - this implementation is not validating names or qualified names
131629
131630
  * (when parsing XML strings, the SAX parser takes care of that)
131630
131631
  *
131632
+ * Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
131633
+ * Creation-time validation of `publicId`, `systemId` is not enforced.
131634
+ * The serializer-level check covers all mutation vectors, including direct property writes.
131635
+ * `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
131636
+ * absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
131637
+ * silently omitted from the serialized output.
131638
+ *
131631
131639
  * @param {string} qualifiedName
131632
131640
  * @param {string} [publicId]
131641
+ * The external subset public identifier. Stored verbatim including surrounding quotes.
131642
+ * When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
131643
+ * throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
131644
+ * not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
131633
131645
  * @param {string} [systemId]
131646
+ * The external subset system identifier. Stored verbatim including surrounding quotes.
131647
+ * When serialized with `requireWellFormed: true`, throws `DOMException` with code
131648
+ * `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
131649
+ * production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
131634
131650
  * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
131635
131651
  * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
131636
131652
  *
@@ -131696,18 +131712,44 @@ function requireDom$1 () {
131696
131712
  return cloneNode(this.ownerDocument||this,this,deep);
131697
131713
  },
131698
131714
  // Modified in DOM Level 2:
131699
- normalize:function(){
131700
- var child = this.firstChild;
131701
- while(child){
131702
- var next = child.nextSibling;
131703
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
131704
- this.removeChild(next);
131705
- child.appendData(next.data);
131706
- }else {
131707
- child.normalize();
131708
- child = next;
131709
- }
131710
- }
131715
+ /**
131716
+ * Puts the specified node and all of its subtree into a "normalized" form. In a normalized
131717
+ * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
131718
+ *
131719
+ * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
131720
+ * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
131721
+ * nodes.
131722
+ *
131723
+ * This method iteratively traverses all child nodes to normalize all descendant nodes within
131724
+ * the subtree.
131725
+ *
131726
+ * @throws {DOMException}
131727
+ * May throw a DOMException if operations within removeChild or appendData (which are
131728
+ * potentially invoked in this method) do not meet their specific constraints.
131729
+ * @see {@link Node.removeChild}
131730
+ * @see {@link CharacterData.appendData}
131731
+ * @see ../docs/walk-dom.md.
131732
+ */
131733
+ normalize: function () {
131734
+ walkDOM(this, null, {
131735
+ enter: function (node) {
131736
+ // Merge adjacent text children of node before walkDOM schedules them.
131737
+ // walkDOM reads lastChild/previousSibling after enter returns, so the
131738
+ // surviving post-merge children are what it descends into.
131739
+ var child = node.firstChild;
131740
+ while (child) {
131741
+ var next = child.nextSibling;
131742
+ if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
131743
+ node.removeChild(next);
131744
+ child.appendData(next.data);
131745
+ // Do not advance child: re-check new nextSibling for another text run
131746
+ } else {
131747
+ child = next;
131748
+ }
131749
+ }
131750
+ return true; // descend into surviving children
131751
+ },
131752
+ });
131711
131753
  },
131712
131754
  // Introduced in DOM Level 2:
131713
131755
  isSupported:function(feature, version){
@@ -131783,21 +131825,103 @@ function requireDom$1 () {
131783
131825
  copy(NodeType,Node.prototype);
131784
131826
 
131785
131827
  /**
131786
- * @param callback return true for continue,false for break
131787
- * @return boolean true: break visit;
131828
+ * @param {Node} node
131829
+ * Root of the subtree to visit.
131830
+ * @param {function(Node): boolean} callback
131831
+ * Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
131832
+ * @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
131788
131833
  */
131789
- function _visitNode(node,callback){
131790
- if(callback(node)){
131791
- return true;
131792
- }
131793
- if(node = node.firstChild){
131794
- do{
131795
- if(_visitNode(node,callback)){return true}
131796
- }while(node=node.nextSibling)
131797
- }
131834
+ function _visitNode(node, callback) {
131835
+ return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
131798
131836
  }
131799
131837
 
131838
+ /**
131839
+ * Depth-first pre/post-order DOM tree walker.
131840
+ *
131841
+ * Visits every node in the subtree rooted at `node`. For each node:
131842
+ *
131843
+ * 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
131844
+ * return value becomes the `context` passed to each child's `enter` call and to the matching
131845
+ * `exit` call.
131846
+ * 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
131847
+ * sibling traversal continues normally.
131848
+ * 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
131849
+ * further `enter` or `exit` calls are made.
131850
+ * 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
131851
+ * safely modify the node's own child list before the walker descends. Modifying siblings of
131852
+ * the current node or any other part of the tree produces unpredictable results: nodes already
131853
+ * queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
131854
+ * the current child list are never visited.
131855
+ * 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
131856
+ * been visited, passing the same `context` that `enter`
131857
+ * returned for that node.
131858
+ *
131859
+ * This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
131860
+ * deep trees.
131861
+ *
131862
+ * @param {Node} node
131863
+ * Root of the subtree to walk.
131864
+ * @param {*} context
131865
+ * Initial context value passed to the root node's `enter`.
131866
+ * @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
131867
+ * @returns {void | walkDOM.STOP}
131868
+ * @see ../docs/walk-dom.md.
131869
+ */
131870
+ function walkDOM(node, context, callbacks) {
131871
+ // Each stack frame is {node, context, phase}:
131872
+ // walkDOM.ENTER — call enter, then push children
131873
+ // walkDOM.EXIT — call exit
131874
+ var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
131875
+ while (stack.length > 0) {
131876
+ var frame = stack.pop();
131877
+ if (frame.phase === walkDOM.ENTER) {
131878
+ var childContext = callbacks.enter(frame.node, frame.context);
131879
+ if (childContext === walkDOM.STOP) {
131880
+ return walkDOM.STOP;
131881
+ }
131882
+ // Push exit frame before children so it fires after all children are processed (Last In First Out)
131883
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
131884
+ if (childContext === null || childContext === undefined) {
131885
+ continue; // skip children
131886
+ }
131887
+ // lastChild is read after enter returns, so enter may modify the child list.
131888
+ var child = frame.node.lastChild;
131889
+ // Traverse from lastChild backwards so that pushing onto the stack
131890
+ // naturally yields firstChild on top (processed first).
131891
+ while (child) {
131892
+ stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
131893
+ child = child.previousSibling;
131894
+ }
131895
+ } else {
131896
+ // frame.phase === walkDOM.EXIT
131897
+ if (callbacks.exit) {
131898
+ callbacks.exit(frame.node, frame.context);
131899
+ }
131900
+ }
131901
+ }
131902
+ }
131800
131903
 
131904
+ /**
131905
+ * Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
131906
+ * immediately.
131907
+ *
131908
+ * @type {symbol}
131909
+ */
131910
+ walkDOM.STOP = Symbol('walkDOM.STOP');
131911
+ /**
131912
+ * Phase constant for a stack frame that has not yet been visited.
131913
+ * The `enter` callback is called and children are scheduled.
131914
+ *
131915
+ * @type {number}
131916
+ */
131917
+ walkDOM.ENTER = 0;
131918
+ /**
131919
+ * Phase constant for a stack frame whose subtree has been fully visited.
131920
+ * The `exit` callback is called.
131921
+ *
131922
+ * @type {number}
131923
+ */
131924
+ walkDOM.EXIT = 1;
131801
131925
 
131802
131926
  function Document(){
131803
131927
  this.ownerDocument = this;
@@ -132422,6 +132546,23 @@ function requireDom$1 () {
132422
132546
  node.appendData(data);
132423
132547
  return node;
132424
132548
  },
132549
+ /**
132550
+ * Returns a ProcessingInstruction node whose target is target and data is data.
132551
+ *
132552
+ * __This implementation differs from the specification:__
132553
+ * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
132554
+ *
132555
+ * Note: When the resulting document is serialized with `requireWellFormed: true`, the
132556
+ * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
132557
+ * §3.2.1.7). Without that option the data is emitted verbatim.
132558
+ *
132559
+ * @param {string} target
132560
+ * @param {string} data
132561
+ * @returns {ProcessingInstruction}
132562
+ * @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
132563
+ * @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
132564
+ * @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
132565
+ */
132425
132566
  createProcessingInstruction : function(target,data){
132426
132567
  var node = new ProcessingInstruction();
132427
132568
  node.ownerDocument = this;
@@ -132647,6 +132788,19 @@ function requireDom$1 () {
132647
132788
  _extends(CDATASection,CharacterData);
132648
132789
 
132649
132790
 
132791
+ /**
132792
+ * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
132793
+ *
132794
+ * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
132795
+ * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
132796
+ * direct property writes succeed silently. Values are serialized verbatim when
132797
+ * `requireWellFormed` is false (the default). When the serializer is invoked with
132798
+ * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
132799
+ * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
132800
+ *
132801
+ * @class
132802
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
132803
+ */
132650
132804
  function DocumentType() {
132651
132805
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
132652
132806
  _extends(DocumentType,Node);
@@ -132677,22 +132831,45 @@ function requireDom$1 () {
132677
132831
  /**
132678
132832
  * Returns the result of serializing `node` to XML.
132679
132833
  *
132834
+ * When `options.requireWellFormed` is `true`, the serializer throws for content that would
132835
+ * produce ill-formed XML.
132836
+ *
132680
132837
  * __This implementation differs from the specification:__
132681
132838
  * - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
132682
132839
  * at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
132683
- * default behaviour). A configurable option is not yet implemented.
132840
+ * default behaviour) unless `requireWellFormed` is `true`.
132841
+ * - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
132842
+ * is only thrown to prevent injection vectors, not for all the spec mandated checks.
132684
132843
  *
132685
132844
  * @param {Node} node
132686
132845
  * @param {boolean} [isHtml]
132687
132846
  * @param {function} [nodeFilter]
132847
+ * @param {Object} [options]
132848
+ * @param {boolean} [options.requireWellFormed=false]
132849
+ * When `true`, throws for content that would produce ill-formed XML.
132688
132850
  * @returns {string}
132851
+ * @throws {DOMException}
132852
+ * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
132853
+ * - a CDATASection node's data contains `"]]>"`,
132854
+ * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
132855
+ * - a ProcessingInstruction's data contains `"?>"`,
132856
+ * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
132857
+ * production,
132858
+ * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
132859
+ * production, or
132860
+ * - a DocumentType's `internalSubset` contains `"]>"`.
132861
+ * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
132862
+ * writes succeed and are covered by the serializer-level checks above.
132689
132863
  * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
132864
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serialization
132865
+ * @see https://github.com/w3c/DOM-Parsing/issues/84
132690
132866
  */
132691
- XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
132692
- return nodeSerializeToString.call(node,isHtml,nodeFilter);
132867
+ XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
132868
+ return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
132693
132869
  };
132694
132870
  Node.prototype.toString = nodeSerializeToString;
132695
- function nodeSerializeToString(isHtml,nodeFilter){
132871
+ function nodeSerializeToString(isHtml,nodeFilter,options){
132872
+ var requireWellFormed = !!options && !!options.requireWellFormed;
132696
132873
  var buf = [];
132697
132874
  var refNode = this.nodeType == 9 && this.documentElement || this;
132698
132875
  var prefix = refNode.prefix;
@@ -132709,7 +132886,7 @@ function requireDom$1 () {
132709
132886
  ];
132710
132887
  }
132711
132888
  }
132712
- serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
132889
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
132713
132890
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
132714
132891
  return buf.join('');
132715
132892
  }
@@ -132758,271 +132935,323 @@ function requireDom$1 () {
132758
132935
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
132759
132936
  }
132760
132937
 
132761
- function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
132938
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
132762
132939
  if (!visibleNamespaces) {
132763
132940
  visibleNamespaces = [];
132764
132941
  }
132765
-
132766
- if(nodeFilter){
132767
- node = nodeFilter(node);
132768
- if(node){
132769
- if(typeof node == 'string'){
132770
- buf.push(node);
132771
- return;
132772
- }
132773
- }else {
132774
- return;
132775
- }
132776
- //buf.sort.apply(attrs, attributeSorter);
132777
- }
132778
-
132779
- switch(node.nodeType){
132780
- case ELEMENT_NODE:
132781
- var attrs = node.attributes;
132782
- var len = attrs.length;
132783
- var child = node.firstChild;
132784
- var nodeName = node.tagName;
132785
-
132786
- isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
132787
-
132788
- var prefixedNodeName = nodeName;
132789
- if (!isHTML && !node.prefix && node.namespaceURI) {
132790
- var defaultNS;
132791
- // lookup current default ns from `xmlns` attribute
132792
- for (var ai = 0; ai < attrs.length; ai++) {
132793
- if (attrs.item(ai).name === 'xmlns') {
132794
- defaultNS = attrs.item(ai).value;
132795
- break
132796
- }
132797
- }
132798
- if (!defaultNS) {
132799
- // lookup current default ns in visibleNamespaces
132800
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
132801
- var namespace = visibleNamespaces[nsi];
132802
- if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
132803
- defaultNS = namespace.namespace;
132804
- break
132942
+ walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
132943
+ enter: function (n, ctx) {
132944
+ var ns = ctx.ns;
132945
+ var html = ctx.isHTML;
132946
+
132947
+ if (nodeFilter) {
132948
+ n = nodeFilter(n);
132949
+ if (n) {
132950
+ if (typeof n == 'string') {
132951
+ buf.push(n);
132952
+ return null;
132805
132953
  }
132954
+ } else {
132955
+ return null;
132806
132956
  }
132807
132957
  }
132808
- if (defaultNS !== node.namespaceURI) {
132809
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
132810
- var namespace = visibleNamespaces[nsi];
132811
- if (namespace.namespace === node.namespaceURI) {
132812
- if (namespace.prefix) {
132813
- prefixedNodeName = namespace.prefix + ':' + nodeName;
132958
+
132959
+ switch (n.nodeType) {
132960
+ case ELEMENT_NODE:
132961
+ var attrs = n.attributes;
132962
+ var len = attrs.length;
132963
+ var nodeName = n.tagName;
132964
+
132965
+ html = NAMESPACE.isHTML(n.namespaceURI) || html;
132966
+
132967
+ var prefixedNodeName = nodeName;
132968
+ if (!html && !n.prefix && n.namespaceURI) {
132969
+ var defaultNS;
132970
+ // lookup current default ns from `xmlns` attribute
132971
+ for (var ai = 0; ai < attrs.length; ai++) {
132972
+ if (attrs.item(ai).name === 'xmlns') {
132973
+ defaultNS = attrs.item(ai).value;
132974
+ break;
132975
+ }
132976
+ }
132977
+ if (!defaultNS) {
132978
+ // lookup current default ns in visibleNamespaces
132979
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
132980
+ var nsEntry = ns[nsi];
132981
+ if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
132982
+ defaultNS = nsEntry.namespace;
132983
+ break;
132984
+ }
132985
+ }
132986
+ }
132987
+ if (defaultNS !== n.namespaceURI) {
132988
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
132989
+ var nsEntry = ns[nsi];
132990
+ if (nsEntry.namespace === n.namespaceURI) {
132991
+ if (nsEntry.prefix) {
132992
+ prefixedNodeName = nsEntry.prefix + ':' + nodeName;
132993
+ }
132994
+ break;
132995
+ }
132996
+ }
132814
132997
  }
132815
- break
132816
132998
  }
132817
- }
132818
- }
132819
- }
132820
132999
 
132821
- buf.push('<', prefixedNodeName);
133000
+ buf.push('<', prefixedNodeName);
133001
+
133002
+ // Build a fresh namespace snapshot for this element's children.
133003
+ // The slice prevents sibling elements from inheriting each other's declarations.
133004
+ var childNs = ns.slice();
133005
+ for (var i = 0; i < len; i++) {
133006
+ var attr = attrs.item(i);
133007
+ if (attr.prefix == 'xmlns') {
133008
+ childNs.push({ prefix: attr.localName, namespace: attr.value });
133009
+ } else if (attr.nodeName == 'xmlns') {
133010
+ childNs.push({ prefix: '', namespace: attr.value });
133011
+ }
133012
+ }
132822
133013
 
132823
- for(var i=0;i<len;i++){
132824
- // add namespaces for attributes
132825
- var attr = attrs.item(i);
132826
- if (attr.prefix == 'xmlns') {
132827
- visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
132828
- }else if(attr.nodeName == 'xmlns'){
132829
- visibleNamespaces.push({ prefix: '', namespace: attr.value });
132830
- }
132831
- }
133014
+ for (var i = 0; i < len; i++) {
133015
+ var attr = attrs.item(i);
133016
+ if (needNamespaceDefine(attr, html, childNs)) {
133017
+ var attrPrefix = attr.prefix || '';
133018
+ var uri = attr.namespaceURI;
133019
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
133020
+ childNs.push({ prefix: attrPrefix, namespace: uri });
133021
+ }
133022
+ // Apply nodeFilter and serialize the attribute.
133023
+ var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
133024
+ if (filteredAttr) {
133025
+ if (typeof filteredAttr === 'string') {
133026
+ buf.push(filteredAttr);
133027
+ } else {
133028
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
133029
+ }
133030
+ }
133031
+ }
132832
133032
 
132833
- for(var i=0;i<len;i++){
132834
- var attr = attrs.item(i);
132835
- if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
132836
- var prefix = attr.prefix||'';
132837
- var uri = attr.namespaceURI;
132838
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
132839
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
132840
- }
132841
- serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
132842
- }
133033
+ // add namespace for current node
133034
+ if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
133035
+ var nodePrefix = n.prefix || '';
133036
+ var uri = n.namespaceURI;
133037
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
133038
+ childNs.push({ prefix: nodePrefix, namespace: uri });
133039
+ }
132843
133040
 
132844
- // add namespace for current node
132845
- if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
132846
- var prefix = node.prefix||'';
132847
- var uri = node.namespaceURI;
132848
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
132849
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
132850
- }
133041
+ var child = n.firstChild;
133042
+ if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
133043
+ buf.push('>');
133044
+ if (html && /^script$/i.test(nodeName)) {
133045
+ // Inline serialization for <script> children; return null to skip walkDOM descent.
133046
+ while (child) {
133047
+ if (child.data) {
133048
+ buf.push(child.data);
133049
+ } else {
133050
+ serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
133051
+ }
133052
+ child = child.nextSibling;
133053
+ }
133054
+ buf.push('</', nodeName, '>');
133055
+ return null;
133056
+ }
133057
+ // Return child context; walkDOM descends and exit emits the closing tag.
133058
+ return { ns: childNs, isHTML: html, tag: prefixedNodeName };
133059
+ } else {
133060
+ buf.push('/>');
133061
+ return null;
133062
+ }
132851
133063
 
132852
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
132853
- buf.push('>');
132854
- //if is cdata child node
132855
- if(isHTML && /^script$/i.test(nodeName)){
132856
- while(child){
132857
- if(child.data){
132858
- buf.push(child.data);
132859
- }else {
132860
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
133064
+ case DOCUMENT_NODE:
133065
+ case DOCUMENT_FRAGMENT_NODE:
133066
+ // Descend into children; exit is a no-op (tag is null).
133067
+ return { ns: ns.slice(), isHTML: html, tag: null };
133068
+
133069
+ case ATTRIBUTE_NODE:
133070
+ addSerializedAttribute(buf, n.name, n.value);
133071
+ return null;
133072
+
133073
+ case TEXT_NODE:
133074
+ /**
133075
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
133076
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
133077
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
133078
+ * `&amp;` and `&lt;` respectively.
133079
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
133080
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
133081
+ * when that string is not marking the end of a CDATA section.
133082
+ *
133083
+ * In the content of elements, character data is any string of characters
133084
+ * which does not contain the start-delimiter of any markup
133085
+ * and does not include the CDATA-section-close delimiter, `]]>`.
133086
+ *
133087
+ * @see https://www.w3.org/TR/xml/#NT-CharData
133088
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
133089
+ */
133090
+ buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
133091
+ return null;
133092
+
133093
+ case CDATA_SECTION_NODE:
133094
+ if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
133095
+ throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
132861
133096
  }
132862
- child = child.nextSibling;
132863
- }
132864
- }else
132865
- {
132866
- while(child){
132867
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
132868
- child = child.nextSibling;
132869
- }
132870
- }
132871
- buf.push('</',prefixedNodeName,'>');
132872
- }else {
132873
- buf.push('/>');
132874
- }
132875
- // remove added visible namespaces
132876
- //visibleNamespaces.length = startVisibleNamespaces;
132877
- return;
132878
- case DOCUMENT_NODE:
132879
- case DOCUMENT_FRAGMENT_NODE:
132880
- var child = node.firstChild;
132881
- while(child){
132882
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
132883
- child = child.nextSibling;
132884
- }
132885
- return;
132886
- case ATTRIBUTE_NODE:
132887
- return addSerializedAttribute(buf, node.name, node.value);
132888
- case TEXT_NODE:
132889
- /**
132890
- * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
132891
- * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
132892
- * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
132893
- * `&amp;` and `&lt;` respectively.
132894
- * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
132895
- * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
132896
- * when that string is not marking the end of a CDATA section.
132897
- *
132898
- * In the content of elements, character data is any string of characters
132899
- * which does not contain the start-delimiter of any markup
132900
- * and does not include the CDATA-section-close delimiter, `]]>`.
132901
- *
132902
- * @see https://www.w3.org/TR/xml/#NT-CharData
132903
- * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
132904
- */
132905
- return buf.push(node.data
132906
- .replace(/[<&>]/g,_xmlEncoder)
132907
- );
132908
- case CDATA_SECTION_NODE:
132909
- return buf.push('<![CDATA[', node.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
132910
- case COMMENT_NODE:
132911
- return buf.push( "<!--",node.data,"-->");
132912
- case DOCUMENT_TYPE_NODE:
132913
- var pubid = node.publicId;
132914
- var sysid = node.systemId;
132915
- buf.push('<!DOCTYPE ',node.name);
132916
- if(pubid){
132917
- buf.push(' PUBLIC ', pubid);
132918
- if (sysid && sysid!='.') {
132919
- buf.push(' ', sysid);
133097
+ buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
133098
+ return null;
133099
+
133100
+ case COMMENT_NODE:
133101
+ if (requireWellFormed && n.data.indexOf('-->') !== -1) {
133102
+ throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
133103
+ }
133104
+ buf.push('<!--', n.data, '-->');
133105
+ return null;
133106
+
133107
+ case DOCUMENT_TYPE_NODE:
133108
+ if (requireWellFormed) {
133109
+ if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
133110
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
133111
+ }
133112
+ if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
133113
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
133114
+ }
133115
+ if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
133116
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
133117
+ }
133118
+ }
133119
+ var pubid = n.publicId;
133120
+ var sysid = n.systemId;
133121
+ buf.push('<!DOCTYPE ', n.name);
133122
+ if (pubid) {
133123
+ buf.push(' PUBLIC ', pubid);
133124
+ if (sysid && sysid != '.') {
133125
+ buf.push(' ', sysid);
133126
+ }
133127
+ buf.push('>');
133128
+ } else if (sysid && sysid != '.') {
133129
+ buf.push(' SYSTEM ', sysid, '>');
133130
+ } else {
133131
+ var sub = n.internalSubset;
133132
+ if (sub) {
133133
+ buf.push(' [', sub, ']');
133134
+ }
133135
+ buf.push('>');
133136
+ }
133137
+ return null;
133138
+
133139
+ case PROCESSING_INSTRUCTION_NODE:
133140
+ if (requireWellFormed && n.data.indexOf('?>') !== -1) {
133141
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
133142
+ }
133143
+ buf.push('<?', n.target, ' ', n.data, '?>');
133144
+ return null;
133145
+
133146
+ case ENTITY_REFERENCE_NODE:
133147
+ buf.push('&', n.nodeName, ';');
133148
+ return null;
133149
+
133150
+ //case ENTITY_NODE:
133151
+ //case NOTATION_NODE:
133152
+ default:
133153
+ buf.push('??', n.nodeName);
133154
+ return null;
132920
133155
  }
132921
- buf.push('>');
132922
- }else if(sysid && sysid!='.'){
132923
- buf.push(' SYSTEM ', sysid, '>');
132924
- }else {
132925
- var sub = node.internalSubset;
132926
- if(sub){
132927
- buf.push(" [",sub,"]");
133156
+ },
133157
+ exit: function (n, childCtx) {
133158
+ if (childCtx && childCtx.tag) {
133159
+ buf.push('</', childCtx.tag, '>');
132928
133160
  }
132929
- buf.push(">");
132930
- }
132931
- return;
132932
- case PROCESSING_INSTRUCTION_NODE:
132933
- return buf.push( "<?",node.target," ",node.data,"?>");
132934
- case ENTITY_REFERENCE_NODE:
132935
- return buf.push( '&',node.nodeName,';');
132936
- //case ENTITY_NODE:
132937
- //case NOTATION_NODE:
132938
- default:
132939
- buf.push('??',node.nodeName);
132940
- }
133161
+ },
133162
+ });
132941
133163
  }
132942
- function importNode(doc,node,deep){
132943
- var node2;
132944
- switch (node.nodeType) {
132945
- case ELEMENT_NODE:
132946
- node2 = node.cloneNode(false);
132947
- node2.ownerDocument = doc;
132948
- //var attrs = node2.attributes;
132949
- //var len = attrs.length;
132950
- //for(var i=0;i<len;i++){
132951
- //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
132952
- //}
132953
- case DOCUMENT_FRAGMENT_NODE:
132954
- break;
132955
- case ATTRIBUTE_NODE:
132956
- deep = true;
132957
- break;
132958
- //case ENTITY_REFERENCE_NODE:
132959
- //case PROCESSING_INSTRUCTION_NODE:
132960
- ////case TEXT_NODE:
132961
- //case CDATA_SECTION_NODE:
132962
- //case COMMENT_NODE:
132963
- // deep = false;
132964
- // break;
132965
- //case DOCUMENT_NODE:
132966
- //case DOCUMENT_TYPE_NODE:
132967
- //cannot be imported.
132968
- //case ENTITY_NODE:
132969
- //case NOTATION_NODE:
132970
- //can not hit in level3
132971
- //default:throw e;
132972
- }
132973
- if(!node2){
132974
- node2 = node.cloneNode(false);//false
132975
- }
132976
- node2.ownerDocument = doc;
132977
- node2.parentNode = null;
132978
- if(deep){
132979
- var child = node.firstChild;
132980
- while(child){
132981
- node2.appendChild(importNode(doc,child,deep));
132982
- child = child.nextSibling;
132983
- }
132984
- }
132985
- return node2;
133164
+ /**
133165
+ * Imports a node from a different document into `doc`, creating a new copy.
133166
+ * Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
133167
+ * stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
133168
+ * Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
133169
+ * always forced to `true`
133170
+ * because an attribute's value lives in a child text node.
133171
+ *
133172
+ * @param {Document} doc
133173
+ * The document that will own the imported node.
133174
+ * @param {Node} node
133175
+ * The node to import.
133176
+ * @param {boolean} deep
133177
+ * If `true`, descendants are imported recursively.
133178
+ * @returns {Node}
133179
+ * The newly imported node, now owned by `doc`.
133180
+ */
133181
+ function importNode(doc, node, deep) {
133182
+ var destRoot;
133183
+ walkDOM(node, null, {
133184
+ enter: function (srcNode, destParent) {
133185
+ // Shallow-clone the node and stamp it into the target document.
133186
+ var destNode = srcNode.cloneNode(false);
133187
+ destNode.ownerDocument = doc;
133188
+ destNode.parentNode = null;
133189
+ // capture as the root of the imported subtree or attach to parent.
133190
+ if (destParent === null) {
133191
+ destRoot = destNode;
133192
+ } else {
133193
+ destParent.appendChild(destNode);
133194
+ }
133195
+ // ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
133196
+ var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
133197
+ return shouldDeep ? destNode : null;
133198
+ },
133199
+ });
133200
+ return destRoot;
132986
133201
  }
132987
133202
  //
132988
133203
  //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
132989
133204
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
132990
- function cloneNode(doc,node,deep){
132991
- var node2 = new node.constructor();
132992
- for (var n in node) {
132993
- if (Object.prototype.hasOwnProperty.call(node, n)) {
132994
- var v = node[n];
132995
- if (typeof v != "object") {
132996
- if (v != node2[n]) {
132997
- node2[n] = v;
133205
+ function cloneNode(doc, node, deep) {
133206
+ var destRoot;
133207
+ walkDOM(node, null, {
133208
+ enter: function (srcNode, destParent) {
133209
+ // 1. Create a blank node of the same type and copy all scalar own properties.
133210
+ var destNode = new srcNode.constructor();
133211
+ for (var n in srcNode) {
133212
+ if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
133213
+ var v = srcNode[n];
133214
+ if (typeof v != 'object') {
133215
+ if (v != destNode[n]) {
133216
+ destNode[n] = v;
133217
+ }
133218
+ }
132998
133219
  }
132999
133220
  }
133000
- }
133001
- }
133002
- if(node.childNodes){
133003
- node2.childNodes = new NodeList();
133004
- }
133005
- node2.ownerDocument = doc;
133006
- switch (node2.nodeType) {
133007
- case ELEMENT_NODE:
133008
- var attrs = node.attributes;
133009
- var attrs2 = node2.attributes = new NamedNodeMap();
133010
- var len = attrs.length;
133011
- attrs2._ownerElement = node2;
133012
- for(var i=0;i<len;i++){
133013
- node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
133014
- }
133015
- break; case ATTRIBUTE_NODE:
133016
- deep = true;
133017
- }
133018
- if(deep){
133019
- var child = node.firstChild;
133020
- while(child){
133021
- node2.appendChild(cloneNode(doc,child,deep));
133022
- child = child.nextSibling;
133023
- }
133024
- }
133025
- return node2;
133221
+ if (srcNode.childNodes) {
133222
+ destNode.childNodes = new NodeList();
133223
+ }
133224
+ destNode.ownerDocument = doc;
133225
+ // 2. Handle node-type-specific setup.
133226
+ // Attributes are not DOM children, so they are cloned inline here
133227
+ // rather than by walkDOM descent.
133228
+ // ATTRIBUTE_NODE forces deep=true so its own children are walked.
133229
+ var shouldDeep = deep;
133230
+ switch (destNode.nodeType) {
133231
+ case ELEMENT_NODE:
133232
+ var attrs = srcNode.attributes;
133233
+ var attrs2 = (destNode.attributes = new NamedNodeMap());
133234
+ var len = attrs.length;
133235
+ attrs2._ownerElement = destNode;
133236
+ for (var i = 0; i < len; i++) {
133237
+ destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
133238
+ }
133239
+ break;
133240
+ case ATTRIBUTE_NODE:
133241
+ shouldDeep = true;
133242
+ }
133243
+ // 3. Attach to parent, or capture as the root of the cloned subtree.
133244
+ if (destParent !== null) {
133245
+ destParent.appendChild(destNode);
133246
+ } else {
133247
+ destRoot = destNode;
133248
+ }
133249
+ // 4. Return destNode as the context for children (causes walkDOM to descend),
133250
+ // or null to skip children (shallow clone).
133251
+ return shouldDeep ? destNode : null;
133252
+ },
133253
+ });
133254
+ return destRoot;
133026
133255
  }
133027
133256
 
133028
133257
  function __set__(object,key,value){
@@ -133038,49 +133267,55 @@ function requireDom$1 () {
133038
133267
  }
133039
133268
  });
133040
133269
 
133041
- Object.defineProperty(Node.prototype,'textContent',{
133042
- get:function(){
133043
- return getTextContent(this);
133270
+ /**
133271
+ * The text content of this node and its descendants.
133272
+ *
133273
+ * Setting `textContent` on an element or document fragment replaces all child nodes with a
133274
+ * single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
133275
+ *
133276
+ * @type {string | null}
133277
+ * @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
133278
+ */
133279
+ Object.defineProperty(Node.prototype, 'textContent', {
133280
+ get: function () {
133281
+ if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
133282
+ var buf = [];
133283
+ walkDOM(this, null, {
133284
+ enter: function (n) {
133285
+ if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
133286
+ return true; // enter children
133287
+ }
133288
+ if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
133289
+ return null; // excluded from text content
133290
+ }
133291
+ buf.push(n.nodeValue);
133292
+ },
133293
+ });
133294
+ return buf.join('');
133295
+ }
133296
+ return this.nodeValue;
133044
133297
  },
133045
133298
 
133046
- set:function(data){
133047
- switch(this.nodeType){
133048
- case ELEMENT_NODE:
133049
- case DOCUMENT_FRAGMENT_NODE:
133050
- while(this.firstChild){
133051
- this.removeChild(this.firstChild);
133052
- }
133053
- if(data || String(data)){
133054
- this.appendChild(this.ownerDocument.createTextNode(data));
133055
- }
133056
- break;
133299
+ set: function (data) {
133300
+ switch (this.nodeType) {
133301
+ case ELEMENT_NODE:
133302
+ case DOCUMENT_FRAGMENT_NODE:
133303
+ while (this.firstChild) {
133304
+ this.removeChild(this.firstChild);
133305
+ }
133306
+ if (data || String(data)) {
133307
+ this.appendChild(this.ownerDocument.createTextNode(data));
133308
+ }
133309
+ break;
133057
133310
 
133058
- default:
133059
- this.data = data;
133060
- this.value = data;
133061
- this.nodeValue = data;
133311
+ default:
133312
+ this.data = data;
133313
+ this.value = data;
133314
+ this.nodeValue = data;
133062
133315
  }
133063
- }
133316
+ },
133064
133317
  });
133065
133318
 
133066
- function getTextContent(node){
133067
- switch(node.nodeType){
133068
- case ELEMENT_NODE:
133069
- case DOCUMENT_FRAGMENT_NODE:
133070
- var buf = [];
133071
- node = node.firstChild;
133072
- while(node){
133073
- if(node.nodeType!==7 && node.nodeType !==8){
133074
- buf.push(getTextContent(node));
133075
- }
133076
- node = node.nextSibling;
133077
- }
133078
- return buf.join('');
133079
- default:
133080
- return node.nodeValue;
133081
- }
133082
- }
133083
-
133084
133319
  __set__ = function(object,key,value){
133085
133320
  //console.log(value)
133086
133321
  object['$$'+key] = value;
@@ -133096,6 +133331,7 @@ function requireDom$1 () {
133096
133331
  dom$1.Element = Element;
133097
133332
  dom$1.Node = Node;
133098
133333
  dom$1.NodeList = NodeList;
133334
+ dom$1.walkDOM = walkDOM;
133099
133335
  dom$1.XMLSerializer = XMLSerializer;
133100
133336
  //}
133101
133337
  return dom$1;
@@ -147912,13 +148148,13 @@ const FIRST_TIME_WATCH$1 = {};
147912
148148
  Object.freeze(FIRST_TIME_WATCH$1);
147913
148149
  const arrayConsumer$1 = (listenerFn, restExpr, newVal, oldVal) => {
147914
148150
  let data = newVal, formattedData;
147915
- if (isArray$1(data)) {
148151
+ if (_.isArray(data)) {
147916
148152
  formattedData = data.map(function (datum) {
147917
148153
  return findValueOf$1(datum, restExpr);
147918
148154
  });
147919
148155
  // If resulting structure is an array of array, flatten it
147920
- if (isArray$1(formattedData[0])) {
147921
- formattedData = flatten$2(formattedData);
148156
+ if (_.isArray(formattedData[0])) {
148157
+ formattedData = _.flatten(formattedData);
147922
148158
  }
147923
148159
  listenerFn(formattedData, oldVal);
147924
148160
  }
@@ -147963,6 +148199,19 @@ const $watch$1 = (expr, $scope, $locals, listener, identifier = watchIdGenerator
147963
148199
  };
147964
148200
  const $unwatch$1 = identifier => registry$1.delete(identifier);
147965
148201
  window.watchRegistry = registry$1;
148202
+ window.__WM_DEBUG_WATCHERS__ = false;
148203
+ /*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
148204
+ if (force) {
148205
+ triggerWatchers(ignoreMuted);
148206
+ } else {
148207
+
148208
+ if (skipWatchers) {
148209
+ skipWatchers = false;
148210
+ return;
148211
+ }
148212
+ debouncedTriggerWatchers();
148213
+ }
148214
+ };*/
147966
148215
  const $appDigest$1 = (() => {
147967
148216
  return (force) => {
147968
148217
  {
@@ -148025,8 +148274,8 @@ var Operation$1;
148025
148274
  const DataSource$1 = {
148026
148275
  Operation: Operation$1
148027
148276
  };
148028
- class App {
148029
- }
148277
+ let App$1 = class App {
148278
+ };
148030
148279
  let AbstractI18nService$1 = class AbstractI18nService {
148031
148280
  };
148032
148281
 
@@ -148044,6 +148293,7 @@ const REGEX$1 = {
148044
148293
  SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
148045
148294
  SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
148046
148295
  VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
148296
+ VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
148047
148297
  REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
148048
148298
  DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
148049
148299
  ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
@@ -148266,6 +148516,9 @@ const isVideoFile$1 = (fileName) => {
148266
148516
  const isValidWebURL$1 = (url) => {
148267
148517
  return (REGEX$1.VALID_WEB_URL).test(url);
148268
148518
  };
148519
+ const isValidImageUrl$1 = (url) => {
148520
+ return (REGEX$1.VALID_IMAGE_URL).test(url?.trim());
148521
+ };
148269
148522
  /*This function returns the url to the resource after checking the validity of url*/
148270
148523
  const getResourceURL$1 = (urlString) => {
148271
148524
  return urlString;
@@ -149519,6 +149772,7 @@ var Utils$1 = /*#__PURE__*/Object.freeze({
149519
149772
  isPageable: isPageable$1,
149520
149773
  isSafari: isSafari$1,
149521
149774
  isTablet: isTablet$1,
149775
+ isValidImageUrl: isValidImageUrl$1,
149522
149776
  isValidWebURL: isValidWebURL$1,
149523
149777
  isVideoFile: isVideoFile$1,
149524
149778
  loadScript: loadScript$1,
@@ -150753,14 +151007,14 @@ class ToDatePipe extends WmPipe {
150753
151007
  }
150754
151008
  return this.returnFn('', arguments, this.app.Variables);
150755
151009
  }
150756
- constructor(datePipe, i18nService, customPipeManager) {
151010
+ constructor(datePipe, i18nService, app, customPipeManager) {
150757
151011
  super('toDate', customPipeManager);
150758
151012
  this.datePipe = datePipe;
150759
151013
  this.i18nService = i18nService;
151014
+ this.app = app;
150760
151015
  this.customPipeManager = customPipeManager;
150761
- this.app = inject(App);
150762
151016
  }
150763
- static { this.ɵfac = function ToDatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ToDatePipe)(ɵɵdirectiveInject(DatePipe, 16), ɵɵdirectiveInject(AbstractI18nService$1, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
151017
+ static { this.ɵfac = function ToDatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ToDatePipe)(ɵɵdirectiveInject(DatePipe, 16), ɵɵdirectiveInject(AbstractI18nService$1, 16), ɵɵdirectiveInject(App$1, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
150764
151018
  static { this.ɵpipe = /*@__PURE__*/ ɵɵdefinePipe({ name: "toDate", type: ToDatePipe, pure: true, standalone: true }); }
150765
151019
  }
150766
151020
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ToDatePipe, [{
@@ -150769,7 +151023,7 @@ class ToDatePipe extends WmPipe {
150769
151023
  standalone: true,
150770
151024
  name: 'toDate'
150771
151025
  }]
150772
- }], () => [{ type: DatePipe }, { type: AbstractI18nService$1 }, { type: CustomPipeManager$1 }], null); })();
151026
+ }], () => [{ type: DatePipe }, { type: AbstractI18nService$1 }, { type: App$1 }, { type: CustomPipeManager$1 }], null); })();
150773
151027
  class ToNumberPipe {
150774
151028
  transform(data, fracSize) {
150775
151029
  if (fracSize && !String(fracSize).match(/^(\d+)?\.((\d+)(-(\d+))?)?$/)) {
@@ -150857,9 +151111,9 @@ class SuffixPipe {
150857
151111
  * Custom pipe: It is work as interceptor between the user custom pipe function and angular pipe
150858
151112
  */
150859
151113
  class CustomPipe {
150860
- constructor(custmeUserPipe) {
151114
+ constructor(app, custmeUserPipe) {
151115
+ this.app = app;
150861
151116
  this.custmeUserPipe = custmeUserPipe;
150862
- this.app = inject(App);
150863
151117
  }
150864
151118
  transform(data, pipename) {
150865
151119
  let argumentArr = [];
@@ -150879,7 +151133,7 @@ class CustomPipe {
150879
151133
  return data;
150880
151134
  }
150881
151135
  }
150882
- static { this.ɵfac = function CustomPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomPipe)(ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
151136
+ static { this.ɵfac = function CustomPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomPipe)(ɵɵdirectiveInject(App$1, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
150883
151137
  static { this.ɵpipe = /*@__PURE__*/ ɵɵdefinePipe({ name: "custom", type: CustomPipe, pure: true, standalone: true }); }
150884
151138
  }
150885
151139
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CustomPipe, [{
@@ -150888,7 +151142,7 @@ class CustomPipe {
150888
151142
  standalone: true,
150889
151143
  name: 'custom'
150890
151144
  }]
150891
- }], () => [{ type: CustomPipeManager$1 }], null); })();
151145
+ }], () => [{ type: App$1 }, { type: CustomPipeManager$1 }], null); })();
150892
151146
  class TimeFromNowPipe {
150893
151147
  transform(data) {
150894
151148
  let timestamp;
@@ -188063,7 +188317,7 @@ function requireDom () {
188063
188317
  ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
188064
188318
  var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
188065
188319
  //level2
188066
- ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
188320
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
188067
188321
  ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
188068
188322
  ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
188069
188323
  ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
@@ -188113,9 +188367,10 @@ function requireDom () {
188113
188367
  item: function(index) {
188114
188368
  return index >= 0 && index < this.length ? this[index] : null;
188115
188369
  },
188116
- toString:function(isHTML,nodeFilter){
188370
+ toString:function(isHTML,nodeFilter,options){
188371
+ var requireWellFormed = !!options && !!options.requireWellFormed;
188117
188372
  for(var buf = [], i = 0;i<this.length;i++){
188118
- serializeToString(this[i],buf,isHTML,nodeFilter);
188373
+ serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
188119
188374
  }
188120
188375
  return buf.join('');
188121
188376
  },
@@ -188360,13 +188615,28 @@ function requireDom () {
188360
188615
  /**
188361
188616
  * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
188362
188617
  *
188363
- * __This behavior is slightly different from the in the specs__:
188618
+ * __This implementation differs from the specification:__
188364
188619
  * - this implementation is not validating names or qualified names
188365
188620
  * (when parsing XML strings, the SAX parser takes care of that)
188366
188621
  *
188622
+ * Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
188623
+ * Creation-time validation of `publicId`, `systemId` is not enforced.
188624
+ * The serializer-level check covers all mutation vectors, including direct property writes.
188625
+ * `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
188626
+ * absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
188627
+ * silently omitted from the serialized output.
188628
+ *
188367
188629
  * @param {string} qualifiedName
188368
188630
  * @param {string} [publicId]
188631
+ * The external subset public identifier. Stored verbatim including surrounding quotes.
188632
+ * When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
188633
+ * throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
188634
+ * not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
188369
188635
  * @param {string} [systemId]
188636
+ * The external subset system identifier. Stored verbatim including surrounding quotes.
188637
+ * When serialized with `requireWellFormed: true`, throws `DOMException` with code
188638
+ * `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
188639
+ * production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
188370
188640
  * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
188371
188641
  * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
188372
188642
  *
@@ -188432,18 +188702,44 @@ function requireDom () {
188432
188702
  return cloneNode(this.ownerDocument||this,this,deep);
188433
188703
  },
188434
188704
  // Modified in DOM Level 2:
188435
- normalize:function(){
188436
- var child = this.firstChild;
188437
- while(child){
188438
- var next = child.nextSibling;
188439
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
188440
- this.removeChild(next);
188441
- child.appendData(next.data);
188442
- }else {
188443
- child.normalize();
188444
- child = next;
188445
- }
188446
- }
188705
+ /**
188706
+ * Puts the specified node and all of its subtree into a "normalized" form. In a normalized
188707
+ * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
188708
+ *
188709
+ * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
188710
+ * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
188711
+ * nodes.
188712
+ *
188713
+ * This method iteratively traverses all child nodes to normalize all descendant nodes within
188714
+ * the subtree.
188715
+ *
188716
+ * @throws {DOMException}
188717
+ * May throw a DOMException if operations within removeChild or appendData (which are
188718
+ * potentially invoked in this method) do not meet their specific constraints.
188719
+ * @see {@link Node.removeChild}
188720
+ * @see {@link CharacterData.appendData}
188721
+ * @see ../docs/walk-dom.md.
188722
+ */
188723
+ normalize: function () {
188724
+ walkDOM(this, null, {
188725
+ enter: function (node) {
188726
+ // Merge adjacent text children of node before walkDOM schedules them.
188727
+ // walkDOM reads lastChild/previousSibling after enter returns, so the
188728
+ // surviving post-merge children are what it descends into.
188729
+ var child = node.firstChild;
188730
+ while (child) {
188731
+ var next = child.nextSibling;
188732
+ if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
188733
+ node.removeChild(next);
188734
+ child.appendData(next.data);
188735
+ // Do not advance child: re-check new nextSibling for another text run
188736
+ } else {
188737
+ child = next;
188738
+ }
188739
+ }
188740
+ return true; // descend into surviving children
188741
+ },
188742
+ });
188447
188743
  },
188448
188744
  // Introduced in DOM Level 2:
188449
188745
  isSupported:function(feature, version){
@@ -188519,21 +188815,103 @@ function requireDom () {
188519
188815
  copy(NodeType,Node.prototype);
188520
188816
 
188521
188817
  /**
188522
- * @param callback return true for continue,false for break
188523
- * @return boolean true: break visit;
188818
+ * @param {Node} node
188819
+ * Root of the subtree to visit.
188820
+ * @param {function(Node): boolean} callback
188821
+ * Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
188822
+ * @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
188524
188823
  */
188525
- function _visitNode(node,callback){
188526
- if(callback(node)){
188527
- return true;
188528
- }
188529
- if(node = node.firstChild){
188530
- do{
188531
- if(_visitNode(node,callback)){return true}
188532
- }while(node=node.nextSibling)
188533
- }
188824
+ function _visitNode(node, callback) {
188825
+ return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
188534
188826
  }
188535
188827
 
188828
+ /**
188829
+ * Depth-first pre/post-order DOM tree walker.
188830
+ *
188831
+ * Visits every node in the subtree rooted at `node`. For each node:
188832
+ *
188833
+ * 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
188834
+ * return value becomes the `context` passed to each child's `enter` call and to the matching
188835
+ * `exit` call.
188836
+ * 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
188837
+ * sibling traversal continues normally.
188838
+ * 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
188839
+ * further `enter` or `exit` calls are made.
188840
+ * 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
188841
+ * safely modify the node's own child list before the walker descends. Modifying siblings of
188842
+ * the current node or any other part of the tree produces unpredictable results: nodes already
188843
+ * queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
188844
+ * the current child list are never visited.
188845
+ * 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
188846
+ * been visited, passing the same `context` that `enter`
188847
+ * returned for that node.
188848
+ *
188849
+ * This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
188850
+ * deep trees.
188851
+ *
188852
+ * @param {Node} node
188853
+ * Root of the subtree to walk.
188854
+ * @param {*} context
188855
+ * Initial context value passed to the root node's `enter`.
188856
+ * @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
188857
+ * @returns {void | walkDOM.STOP}
188858
+ * @see ../docs/walk-dom.md.
188859
+ */
188860
+ function walkDOM(node, context, callbacks) {
188861
+ // Each stack frame is {node, context, phase}:
188862
+ // walkDOM.ENTER — call enter, then push children
188863
+ // walkDOM.EXIT — call exit
188864
+ var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
188865
+ while (stack.length > 0) {
188866
+ var frame = stack.pop();
188867
+ if (frame.phase === walkDOM.ENTER) {
188868
+ var childContext = callbacks.enter(frame.node, frame.context);
188869
+ if (childContext === walkDOM.STOP) {
188870
+ return walkDOM.STOP;
188871
+ }
188872
+ // Push exit frame before children so it fires after all children are processed (Last In First Out)
188873
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
188874
+ if (childContext === null || childContext === undefined) {
188875
+ continue; // skip children
188876
+ }
188877
+ // lastChild is read after enter returns, so enter may modify the child list.
188878
+ var child = frame.node.lastChild;
188879
+ // Traverse from lastChild backwards so that pushing onto the stack
188880
+ // naturally yields firstChild on top (processed first).
188881
+ while (child) {
188882
+ stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
188883
+ child = child.previousSibling;
188884
+ }
188885
+ } else {
188886
+ // frame.phase === walkDOM.EXIT
188887
+ if (callbacks.exit) {
188888
+ callbacks.exit(frame.node, frame.context);
188889
+ }
188890
+ }
188891
+ }
188892
+ }
188536
188893
 
188894
+ /**
188895
+ * Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
188896
+ * immediately.
188897
+ *
188898
+ * @type {symbol}
188899
+ */
188900
+ walkDOM.STOP = Symbol('walkDOM.STOP');
188901
+ /**
188902
+ * Phase constant for a stack frame that has not yet been visited.
188903
+ * The `enter` callback is called and children are scheduled.
188904
+ *
188905
+ * @type {number}
188906
+ */
188907
+ walkDOM.ENTER = 0;
188908
+ /**
188909
+ * Phase constant for a stack frame whose subtree has been fully visited.
188910
+ * The `exit` callback is called.
188911
+ *
188912
+ * @type {number}
188913
+ */
188914
+ walkDOM.EXIT = 1;
188537
188915
 
188538
188916
  function Document(){
188539
188917
  this.ownerDocument = this;
@@ -189158,6 +189536,23 @@ function requireDom () {
189158
189536
  node.appendData(data);
189159
189537
  return node;
189160
189538
  },
189539
+ /**
189540
+ * Returns a ProcessingInstruction node whose target is target and data is data.
189541
+ *
189542
+ * __This implementation differs from the specification:__
189543
+ * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
189544
+ *
189545
+ * Note: When the resulting document is serialized with `requireWellFormed: true`, the
189546
+ * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
189547
+ * §3.2.1.7). Without that option the data is emitted verbatim.
189548
+ *
189549
+ * @param {string} target
189550
+ * @param {string} data
189551
+ * @returns {ProcessingInstruction}
189552
+ * @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
189553
+ * @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
189554
+ * @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
189555
+ */
189161
189556
  createProcessingInstruction : function(target,data){
189162
189557
  var node = new ProcessingInstruction();
189163
189558
  node.ownerDocument = this;
@@ -189383,6 +189778,19 @@ function requireDom () {
189383
189778
  _extends(CDATASection,CharacterData);
189384
189779
 
189385
189780
 
189781
+ /**
189782
+ * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
189783
+ *
189784
+ * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
189785
+ * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
189786
+ * direct property writes succeed silently. Values are serialized verbatim when
189787
+ * `requireWellFormed` is false (the default). When the serializer is invoked with
189788
+ * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
189789
+ * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
189790
+ *
189791
+ * @class
189792
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
189793
+ */
189386
189794
  function DocumentType() {
189387
189795
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
189388
189796
  _extends(DocumentType,Node);
@@ -189413,22 +189821,45 @@ function requireDom () {
189413
189821
  /**
189414
189822
  * Returns the result of serializing `node` to XML.
189415
189823
  *
189824
+ * When `options.requireWellFormed` is `true`, the serializer throws for content that would
189825
+ * produce ill-formed XML.
189826
+ *
189416
189827
  * __This implementation differs from the specification:__
189417
189828
  * - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
189418
189829
  * at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
189419
- * default behaviour). A configurable option is not yet implemented.
189830
+ * default behaviour) unless `requireWellFormed` is `true`.
189831
+ * - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
189832
+ * is only thrown to prevent injection vectors, not for all the spec mandated checks.
189420
189833
  *
189421
189834
  * @param {Node} node
189422
189835
  * @param {boolean} [isHtml]
189423
189836
  * @param {function} [nodeFilter]
189837
+ * @param {Object} [options]
189838
+ * @param {boolean} [options.requireWellFormed=false]
189839
+ * When `true`, throws for content that would produce ill-formed XML.
189424
189840
  * @returns {string}
189841
+ * @throws {DOMException}
189842
+ * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
189843
+ * - a CDATASection node's data contains `"]]>"`,
189844
+ * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
189845
+ * - a ProcessingInstruction's data contains `"?>"`,
189846
+ * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
189847
+ * production,
189848
+ * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
189849
+ * production, or
189850
+ * - a DocumentType's `internalSubset` contains `"]>"`.
189851
+ * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
189852
+ * writes succeed and are covered by the serializer-level checks above.
189425
189853
  * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
189854
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serialization
189855
+ * @see https://github.com/w3c/DOM-Parsing/issues/84
189426
189856
  */
189427
- XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
189428
- return nodeSerializeToString.call(node,isHtml,nodeFilter);
189857
+ XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
189858
+ return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
189429
189859
  };
189430
189860
  Node.prototype.toString = nodeSerializeToString;
189431
- function nodeSerializeToString(isHtml,nodeFilter){
189861
+ function nodeSerializeToString(isHtml,nodeFilter,options){
189862
+ var requireWellFormed = !!options && !!options.requireWellFormed;
189432
189863
  var buf = [];
189433
189864
  var refNode = this.nodeType == 9 && this.documentElement || this;
189434
189865
  var prefix = refNode.prefix;
@@ -189445,7 +189876,7 @@ function requireDom () {
189445
189876
  ];
189446
189877
  }
189447
189878
  }
189448
- serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
189879
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
189449
189880
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
189450
189881
  return buf.join('');
189451
189882
  }
@@ -189494,271 +189925,323 @@ function requireDom () {
189494
189925
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
189495
189926
  }
189496
189927
 
189497
- function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
189928
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
189498
189929
  if (!visibleNamespaces) {
189499
189930
  visibleNamespaces = [];
189500
189931
  }
189501
-
189502
- if(nodeFilter){
189503
- node = nodeFilter(node);
189504
- if(node){
189505
- if(typeof node == 'string'){
189506
- buf.push(node);
189507
- return;
189508
- }
189509
- }else {
189510
- return;
189511
- }
189512
- //buf.sort.apply(attrs, attributeSorter);
189513
- }
189514
-
189515
- switch(node.nodeType){
189516
- case ELEMENT_NODE:
189517
- var attrs = node.attributes;
189518
- var len = attrs.length;
189519
- var child = node.firstChild;
189520
- var nodeName = node.tagName;
189521
-
189522
- isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
189523
-
189524
- var prefixedNodeName = nodeName;
189525
- if (!isHTML && !node.prefix && node.namespaceURI) {
189526
- var defaultNS;
189527
- // lookup current default ns from `xmlns` attribute
189528
- for (var ai = 0; ai < attrs.length; ai++) {
189529
- if (attrs.item(ai).name === 'xmlns') {
189530
- defaultNS = attrs.item(ai).value;
189531
- break
189532
- }
189533
- }
189534
- if (!defaultNS) {
189535
- // lookup current default ns in visibleNamespaces
189536
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
189537
- var namespace = visibleNamespaces[nsi];
189538
- if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
189539
- defaultNS = namespace.namespace;
189540
- break
189932
+ walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
189933
+ enter: function (n, ctx) {
189934
+ var ns = ctx.ns;
189935
+ var html = ctx.isHTML;
189936
+
189937
+ if (nodeFilter) {
189938
+ n = nodeFilter(n);
189939
+ if (n) {
189940
+ if (typeof n == 'string') {
189941
+ buf.push(n);
189942
+ return null;
189541
189943
  }
189944
+ } else {
189945
+ return null;
189542
189946
  }
189543
189947
  }
189544
- if (defaultNS !== node.namespaceURI) {
189545
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
189546
- var namespace = visibleNamespaces[nsi];
189547
- if (namespace.namespace === node.namespaceURI) {
189548
- if (namespace.prefix) {
189549
- prefixedNodeName = namespace.prefix + ':' + nodeName;
189948
+
189949
+ switch (n.nodeType) {
189950
+ case ELEMENT_NODE:
189951
+ var attrs = n.attributes;
189952
+ var len = attrs.length;
189953
+ var nodeName = n.tagName;
189954
+
189955
+ html = NAMESPACE.isHTML(n.namespaceURI) || html;
189956
+
189957
+ var prefixedNodeName = nodeName;
189958
+ if (!html && !n.prefix && n.namespaceURI) {
189959
+ var defaultNS;
189960
+ // lookup current default ns from `xmlns` attribute
189961
+ for (var ai = 0; ai < attrs.length; ai++) {
189962
+ if (attrs.item(ai).name === 'xmlns') {
189963
+ defaultNS = attrs.item(ai).value;
189964
+ break;
189965
+ }
189966
+ }
189967
+ if (!defaultNS) {
189968
+ // lookup current default ns in visibleNamespaces
189969
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
189970
+ var nsEntry = ns[nsi];
189971
+ if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
189972
+ defaultNS = nsEntry.namespace;
189973
+ break;
189974
+ }
189975
+ }
189976
+ }
189977
+ if (defaultNS !== n.namespaceURI) {
189978
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
189979
+ var nsEntry = ns[nsi];
189980
+ if (nsEntry.namespace === n.namespaceURI) {
189981
+ if (nsEntry.prefix) {
189982
+ prefixedNodeName = nsEntry.prefix + ':' + nodeName;
189983
+ }
189984
+ break;
189985
+ }
189986
+ }
189550
189987
  }
189551
- break
189552
189988
  }
189553
- }
189554
- }
189555
- }
189556
189989
 
189557
- buf.push('<', prefixedNodeName);
189990
+ buf.push('<', prefixedNodeName);
189991
+
189992
+ // Build a fresh namespace snapshot for this element's children.
189993
+ // The slice prevents sibling elements from inheriting each other's declarations.
189994
+ var childNs = ns.slice();
189995
+ for (var i = 0; i < len; i++) {
189996
+ var attr = attrs.item(i);
189997
+ if (attr.prefix == 'xmlns') {
189998
+ childNs.push({ prefix: attr.localName, namespace: attr.value });
189999
+ } else if (attr.nodeName == 'xmlns') {
190000
+ childNs.push({ prefix: '', namespace: attr.value });
190001
+ }
190002
+ }
189558
190003
 
189559
- for(var i=0;i<len;i++){
189560
- // add namespaces for attributes
189561
- var attr = attrs.item(i);
189562
- if (attr.prefix == 'xmlns') {
189563
- visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
189564
- }else if(attr.nodeName == 'xmlns'){
189565
- visibleNamespaces.push({ prefix: '', namespace: attr.value });
189566
- }
189567
- }
190004
+ for (var i = 0; i < len; i++) {
190005
+ var attr = attrs.item(i);
190006
+ if (needNamespaceDefine(attr, html, childNs)) {
190007
+ var attrPrefix = attr.prefix || '';
190008
+ var uri = attr.namespaceURI;
190009
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
190010
+ childNs.push({ prefix: attrPrefix, namespace: uri });
190011
+ }
190012
+ // Apply nodeFilter and serialize the attribute.
190013
+ var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
190014
+ if (filteredAttr) {
190015
+ if (typeof filteredAttr === 'string') {
190016
+ buf.push(filteredAttr);
190017
+ } else {
190018
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
190019
+ }
190020
+ }
190021
+ }
189568
190022
 
189569
- for(var i=0;i<len;i++){
189570
- var attr = attrs.item(i);
189571
- if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
189572
- var prefix = attr.prefix||'';
189573
- var uri = attr.namespaceURI;
189574
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
189575
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
189576
- }
189577
- serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
189578
- }
190023
+ // add namespace for current node
190024
+ if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
190025
+ var nodePrefix = n.prefix || '';
190026
+ var uri = n.namespaceURI;
190027
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
190028
+ childNs.push({ prefix: nodePrefix, namespace: uri });
190029
+ }
189579
190030
 
189580
- // add namespace for current node
189581
- if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
189582
- var prefix = node.prefix||'';
189583
- var uri = node.namespaceURI;
189584
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
189585
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
189586
- }
190031
+ var child = n.firstChild;
190032
+ if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
190033
+ buf.push('>');
190034
+ if (html && /^script$/i.test(nodeName)) {
190035
+ // Inline serialization for <script> children; return null to skip walkDOM descent.
190036
+ while (child) {
190037
+ if (child.data) {
190038
+ buf.push(child.data);
190039
+ } else {
190040
+ serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
190041
+ }
190042
+ child = child.nextSibling;
190043
+ }
190044
+ buf.push('</', nodeName, '>');
190045
+ return null;
190046
+ }
190047
+ // Return child context; walkDOM descends and exit emits the closing tag.
190048
+ return { ns: childNs, isHTML: html, tag: prefixedNodeName };
190049
+ } else {
190050
+ buf.push('/>');
190051
+ return null;
190052
+ }
189587
190053
 
189588
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
189589
- buf.push('>');
189590
- //if is cdata child node
189591
- if(isHTML && /^script$/i.test(nodeName)){
189592
- while(child){
189593
- if(child.data){
189594
- buf.push(child.data);
189595
- }else {
189596
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
190054
+ case DOCUMENT_NODE:
190055
+ case DOCUMENT_FRAGMENT_NODE:
190056
+ // Descend into children; exit is a no-op (tag is null).
190057
+ return { ns: ns.slice(), isHTML: html, tag: null };
190058
+
190059
+ case ATTRIBUTE_NODE:
190060
+ addSerializedAttribute(buf, n.name, n.value);
190061
+ return null;
190062
+
190063
+ case TEXT_NODE:
190064
+ /**
190065
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
190066
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
190067
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
190068
+ * `&amp;` and `&lt;` respectively.
190069
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
190070
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
190071
+ * when that string is not marking the end of a CDATA section.
190072
+ *
190073
+ * In the content of elements, character data is any string of characters
190074
+ * which does not contain the start-delimiter of any markup
190075
+ * and does not include the CDATA-section-close delimiter, `]]>`.
190076
+ *
190077
+ * @see https://www.w3.org/TR/xml/#NT-CharData
190078
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
190079
+ */
190080
+ buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
190081
+ return null;
190082
+
190083
+ case CDATA_SECTION_NODE:
190084
+ if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
190085
+ throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
189597
190086
  }
189598
- child = child.nextSibling;
189599
- }
189600
- }else
189601
- {
189602
- while(child){
189603
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
189604
- child = child.nextSibling;
189605
- }
189606
- }
189607
- buf.push('</',prefixedNodeName,'>');
189608
- }else {
189609
- buf.push('/>');
189610
- }
189611
- // remove added visible namespaces
189612
- //visibleNamespaces.length = startVisibleNamespaces;
189613
- return;
189614
- case DOCUMENT_NODE:
189615
- case DOCUMENT_FRAGMENT_NODE:
189616
- var child = node.firstChild;
189617
- while(child){
189618
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
189619
- child = child.nextSibling;
189620
- }
189621
- return;
189622
- case ATTRIBUTE_NODE:
189623
- return addSerializedAttribute(buf, node.name, node.value);
189624
- case TEXT_NODE:
189625
- /**
189626
- * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
189627
- * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
189628
- * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
189629
- * `&amp;` and `&lt;` respectively.
189630
- * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
189631
- * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
189632
- * when that string is not marking the end of a CDATA section.
189633
- *
189634
- * In the content of elements, character data is any string of characters
189635
- * which does not contain the start-delimiter of any markup
189636
- * and does not include the CDATA-section-close delimiter, `]]>`.
189637
- *
189638
- * @see https://www.w3.org/TR/xml/#NT-CharData
189639
- * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
189640
- */
189641
- return buf.push(node.data
189642
- .replace(/[<&>]/g,_xmlEncoder)
189643
- );
189644
- case CDATA_SECTION_NODE:
189645
- return buf.push('<![CDATA[', node.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
189646
- case COMMENT_NODE:
189647
- return buf.push( "<!--",node.data,"-->");
189648
- case DOCUMENT_TYPE_NODE:
189649
- var pubid = node.publicId;
189650
- var sysid = node.systemId;
189651
- buf.push('<!DOCTYPE ',node.name);
189652
- if(pubid){
189653
- buf.push(' PUBLIC ', pubid);
189654
- if (sysid && sysid!='.') {
189655
- buf.push(' ', sysid);
190087
+ buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
190088
+ return null;
190089
+
190090
+ case COMMENT_NODE:
190091
+ if (requireWellFormed && n.data.indexOf('-->') !== -1) {
190092
+ throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
190093
+ }
190094
+ buf.push('<!--', n.data, '-->');
190095
+ return null;
190096
+
190097
+ case DOCUMENT_TYPE_NODE:
190098
+ if (requireWellFormed) {
190099
+ if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
190100
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
190101
+ }
190102
+ if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
190103
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
190104
+ }
190105
+ if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
190106
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
190107
+ }
190108
+ }
190109
+ var pubid = n.publicId;
190110
+ var sysid = n.systemId;
190111
+ buf.push('<!DOCTYPE ', n.name);
190112
+ if (pubid) {
190113
+ buf.push(' PUBLIC ', pubid);
190114
+ if (sysid && sysid != '.') {
190115
+ buf.push(' ', sysid);
190116
+ }
190117
+ buf.push('>');
190118
+ } else if (sysid && sysid != '.') {
190119
+ buf.push(' SYSTEM ', sysid, '>');
190120
+ } else {
190121
+ var sub = n.internalSubset;
190122
+ if (sub) {
190123
+ buf.push(' [', sub, ']');
190124
+ }
190125
+ buf.push('>');
190126
+ }
190127
+ return null;
190128
+
190129
+ case PROCESSING_INSTRUCTION_NODE:
190130
+ if (requireWellFormed && n.data.indexOf('?>') !== -1) {
190131
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
190132
+ }
190133
+ buf.push('<?', n.target, ' ', n.data, '?>');
190134
+ return null;
190135
+
190136
+ case ENTITY_REFERENCE_NODE:
190137
+ buf.push('&', n.nodeName, ';');
190138
+ return null;
190139
+
190140
+ //case ENTITY_NODE:
190141
+ //case NOTATION_NODE:
190142
+ default:
190143
+ buf.push('??', n.nodeName);
190144
+ return null;
189656
190145
  }
189657
- buf.push('>');
189658
- }else if(sysid && sysid!='.'){
189659
- buf.push(' SYSTEM ', sysid, '>');
189660
- }else {
189661
- var sub = node.internalSubset;
189662
- if(sub){
189663
- buf.push(" [",sub,"]");
190146
+ },
190147
+ exit: function (n, childCtx) {
190148
+ if (childCtx && childCtx.tag) {
190149
+ buf.push('</', childCtx.tag, '>');
189664
190150
  }
189665
- buf.push(">");
189666
- }
189667
- return;
189668
- case PROCESSING_INSTRUCTION_NODE:
189669
- return buf.push( "<?",node.target," ",node.data,"?>");
189670
- case ENTITY_REFERENCE_NODE:
189671
- return buf.push( '&',node.nodeName,';');
189672
- //case ENTITY_NODE:
189673
- //case NOTATION_NODE:
189674
- default:
189675
- buf.push('??',node.nodeName);
189676
- }
190151
+ },
190152
+ });
189677
190153
  }
189678
- function importNode(doc,node,deep){
189679
- var node2;
189680
- switch (node.nodeType) {
189681
- case ELEMENT_NODE:
189682
- node2 = node.cloneNode(false);
189683
- node2.ownerDocument = doc;
189684
- //var attrs = node2.attributes;
189685
- //var len = attrs.length;
189686
- //for(var i=0;i<len;i++){
189687
- //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
189688
- //}
189689
- case DOCUMENT_FRAGMENT_NODE:
189690
- break;
189691
- case ATTRIBUTE_NODE:
189692
- deep = true;
189693
- break;
189694
- //case ENTITY_REFERENCE_NODE:
189695
- //case PROCESSING_INSTRUCTION_NODE:
189696
- ////case TEXT_NODE:
189697
- //case CDATA_SECTION_NODE:
189698
- //case COMMENT_NODE:
189699
- // deep = false;
189700
- // break;
189701
- //case DOCUMENT_NODE:
189702
- //case DOCUMENT_TYPE_NODE:
189703
- //cannot be imported.
189704
- //case ENTITY_NODE:
189705
- //case NOTATION_NODE:
189706
- //can not hit in level3
189707
- //default:throw e;
189708
- }
189709
- if(!node2){
189710
- node2 = node.cloneNode(false);//false
189711
- }
189712
- node2.ownerDocument = doc;
189713
- node2.parentNode = null;
189714
- if(deep){
189715
- var child = node.firstChild;
189716
- while(child){
189717
- node2.appendChild(importNode(doc,child,deep));
189718
- child = child.nextSibling;
189719
- }
189720
- }
189721
- return node2;
190154
+ /**
190155
+ * Imports a node from a different document into `doc`, creating a new copy.
190156
+ * Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
190157
+ * stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
190158
+ * Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
190159
+ * always forced to `true`
190160
+ * because an attribute's value lives in a child text node.
190161
+ *
190162
+ * @param {Document} doc
190163
+ * The document that will own the imported node.
190164
+ * @param {Node} node
190165
+ * The node to import.
190166
+ * @param {boolean} deep
190167
+ * If `true`, descendants are imported recursively.
190168
+ * @returns {Node}
190169
+ * The newly imported node, now owned by `doc`.
190170
+ */
190171
+ function importNode(doc, node, deep) {
190172
+ var destRoot;
190173
+ walkDOM(node, null, {
190174
+ enter: function (srcNode, destParent) {
190175
+ // Shallow-clone the node and stamp it into the target document.
190176
+ var destNode = srcNode.cloneNode(false);
190177
+ destNode.ownerDocument = doc;
190178
+ destNode.parentNode = null;
190179
+ // capture as the root of the imported subtree or attach to parent.
190180
+ if (destParent === null) {
190181
+ destRoot = destNode;
190182
+ } else {
190183
+ destParent.appendChild(destNode);
190184
+ }
190185
+ // ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
190186
+ var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
190187
+ return shouldDeep ? destNode : null;
190188
+ },
190189
+ });
190190
+ return destRoot;
189722
190191
  }
189723
190192
  //
189724
190193
  //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
189725
190194
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
189726
- function cloneNode(doc,node,deep){
189727
- var node2 = new node.constructor();
189728
- for (var n in node) {
189729
- if (Object.prototype.hasOwnProperty.call(node, n)) {
189730
- var v = node[n];
189731
- if (typeof v != "object") {
189732
- if (v != node2[n]) {
189733
- node2[n] = v;
190195
+ function cloneNode(doc, node, deep) {
190196
+ var destRoot;
190197
+ walkDOM(node, null, {
190198
+ enter: function (srcNode, destParent) {
190199
+ // 1. Create a blank node of the same type and copy all scalar own properties.
190200
+ var destNode = new srcNode.constructor();
190201
+ for (var n in srcNode) {
190202
+ if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
190203
+ var v = srcNode[n];
190204
+ if (typeof v != 'object') {
190205
+ if (v != destNode[n]) {
190206
+ destNode[n] = v;
190207
+ }
190208
+ }
189734
190209
  }
189735
190210
  }
189736
- }
189737
- }
189738
- if(node.childNodes){
189739
- node2.childNodes = new NodeList();
189740
- }
189741
- node2.ownerDocument = doc;
189742
- switch (node2.nodeType) {
189743
- case ELEMENT_NODE:
189744
- var attrs = node.attributes;
189745
- var attrs2 = node2.attributes = new NamedNodeMap();
189746
- var len = attrs.length;
189747
- attrs2._ownerElement = node2;
189748
- for(var i=0;i<len;i++){
189749
- node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
189750
- }
189751
- break; case ATTRIBUTE_NODE:
189752
- deep = true;
189753
- }
189754
- if(deep){
189755
- var child = node.firstChild;
189756
- while(child){
189757
- node2.appendChild(cloneNode(doc,child,deep));
189758
- child = child.nextSibling;
189759
- }
189760
- }
189761
- return node2;
190211
+ if (srcNode.childNodes) {
190212
+ destNode.childNodes = new NodeList();
190213
+ }
190214
+ destNode.ownerDocument = doc;
190215
+ // 2. Handle node-type-specific setup.
190216
+ // Attributes are not DOM children, so they are cloned inline here
190217
+ // rather than by walkDOM descent.
190218
+ // ATTRIBUTE_NODE forces deep=true so its own children are walked.
190219
+ var shouldDeep = deep;
190220
+ switch (destNode.nodeType) {
190221
+ case ELEMENT_NODE:
190222
+ var attrs = srcNode.attributes;
190223
+ var attrs2 = (destNode.attributes = new NamedNodeMap());
190224
+ var len = attrs.length;
190225
+ attrs2._ownerElement = destNode;
190226
+ for (var i = 0; i < len; i++) {
190227
+ destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
190228
+ }
190229
+ break;
190230
+ case ATTRIBUTE_NODE:
190231
+ shouldDeep = true;
190232
+ }
190233
+ // 3. Attach to parent, or capture as the root of the cloned subtree.
190234
+ if (destParent !== null) {
190235
+ destParent.appendChild(destNode);
190236
+ } else {
190237
+ destRoot = destNode;
190238
+ }
190239
+ // 4. Return destNode as the context for children (causes walkDOM to descend),
190240
+ // or null to skip children (shallow clone).
190241
+ return shouldDeep ? destNode : null;
190242
+ },
190243
+ });
190244
+ return destRoot;
189762
190245
  }
189763
190246
 
189764
190247
  function __set__(object,key,value){
@@ -189774,49 +190257,55 @@ function requireDom () {
189774
190257
  }
189775
190258
  });
189776
190259
 
189777
- Object.defineProperty(Node.prototype,'textContent',{
189778
- get:function(){
189779
- return getTextContent(this);
190260
+ /**
190261
+ * The text content of this node and its descendants.
190262
+ *
190263
+ * Setting `textContent` on an element or document fragment replaces all child nodes with a
190264
+ * single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
190265
+ *
190266
+ * @type {string | null}
190267
+ * @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
190268
+ */
190269
+ Object.defineProperty(Node.prototype, 'textContent', {
190270
+ get: function () {
190271
+ if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
190272
+ var buf = [];
190273
+ walkDOM(this, null, {
190274
+ enter: function (n) {
190275
+ if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
190276
+ return true; // enter children
190277
+ }
190278
+ if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
190279
+ return null; // excluded from text content
190280
+ }
190281
+ buf.push(n.nodeValue);
190282
+ },
190283
+ });
190284
+ return buf.join('');
190285
+ }
190286
+ return this.nodeValue;
189780
190287
  },
189781
190288
 
189782
- set:function(data){
189783
- switch(this.nodeType){
189784
- case ELEMENT_NODE:
189785
- case DOCUMENT_FRAGMENT_NODE:
189786
- while(this.firstChild){
189787
- this.removeChild(this.firstChild);
189788
- }
189789
- if(data || String(data)){
189790
- this.appendChild(this.ownerDocument.createTextNode(data));
189791
- }
189792
- break;
190289
+ set: function (data) {
190290
+ switch (this.nodeType) {
190291
+ case ELEMENT_NODE:
190292
+ case DOCUMENT_FRAGMENT_NODE:
190293
+ while (this.firstChild) {
190294
+ this.removeChild(this.firstChild);
190295
+ }
190296
+ if (data || String(data)) {
190297
+ this.appendChild(this.ownerDocument.createTextNode(data));
190298
+ }
190299
+ break;
189793
190300
 
189794
- default:
189795
- this.data = data;
189796
- this.value = data;
189797
- this.nodeValue = data;
190301
+ default:
190302
+ this.data = data;
190303
+ this.value = data;
190304
+ this.nodeValue = data;
189798
190305
  }
189799
- }
190306
+ },
189800
190307
  });
189801
190308
 
189802
- function getTextContent(node){
189803
- switch(node.nodeType){
189804
- case ELEMENT_NODE:
189805
- case DOCUMENT_FRAGMENT_NODE:
189806
- var buf = [];
189807
- node = node.firstChild;
189808
- while(node){
189809
- if(node.nodeType!==7 && node.nodeType !==8){
189810
- buf.push(getTextContent(node));
189811
- }
189812
- node = node.nextSibling;
189813
- }
189814
- return buf.join('');
189815
- default:
189816
- return node.nodeValue;
189817
- }
189818
- }
189819
-
189820
190309
  __set__ = function(object,key,value){
189821
190310
  //console.log(value)
189822
190311
  object['$$'+key] = value;
@@ -189832,6 +190321,7 @@ function requireDom () {
189832
190321
  dom.Element = Element;
189833
190322
  dom.Node = Node;
189834
190323
  dom.NodeList = NodeList;
190324
+ dom.walkDOM = walkDOM;
189835
190325
  dom.XMLSerializer = XMLSerializer;
189836
190326
  //}
189837
190327
  return dom;
@@ -203583,13 +204073,13 @@ const FIRST_TIME_WATCH = {};
203583
204073
  Object.freeze(FIRST_TIME_WATCH);
203584
204074
  const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
203585
204075
  let data = newVal, formattedData;
203586
- if (isArray(data)) {
204076
+ if (_.isArray(data)) {
203587
204077
  formattedData = data.map(function (datum) {
203588
204078
  return findValueOf(datum, restExpr);
203589
204079
  });
203590
204080
  // If resulting structure is an array of array, flatten it
203591
- if (isArray(formattedData[0])) {
203592
- formattedData = flatten(formattedData);
204081
+ if (_.isArray(formattedData[0])) {
204082
+ formattedData = _.flatten(formattedData);
203593
204083
  }
203594
204084
  listenerFn(formattedData, oldVal);
203595
204085
  }
@@ -203634,6 +204124,19 @@ const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.n
203634
204124
  };
203635
204125
  const $unwatch = identifier => registry.delete(identifier);
203636
204126
  window.watchRegistry = registry;
204127
+ window.__WM_DEBUG_WATCHERS__ = false;
204128
+ /*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
204129
+ if (force) {
204130
+ triggerWatchers(ignoreMuted);
204131
+ } else {
204132
+
204133
+ if (skipWatchers) {
204134
+ skipWatchers = false;
204135
+ return;
204136
+ }
204137
+ debouncedTriggerWatchers();
204138
+ }
204139
+ };*/
203637
204140
  const $appDigest = (() => {
203638
204141
  return (force) => {
203639
204142
  {
@@ -203696,6 +204199,8 @@ var Operation;
203696
204199
  const DataSource = {
203697
204200
  Operation
203698
204201
  };
204202
+ class App {
204203
+ }
203699
204204
  class AbstractI18nService {
203700
204205
  }
203701
204206
 
@@ -203713,6 +204218,7 @@ const REGEX = {
203713
204218
  SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
203714
204219
  SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
203715
204220
  VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
204221
+ VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
203716
204222
  REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
203717
204223
  DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
203718
204224
  ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
@@ -203935,6 +204441,9 @@ const isVideoFile = (fileName) => {
203935
204441
  const isValidWebURL = (url) => {
203936
204442
  return (REGEX.VALID_WEB_URL).test(url);
203937
204443
  };
204444
+ const isValidImageUrl = (url) => {
204445
+ return (REGEX.VALID_IMAGE_URL).test(url?.trim());
204446
+ };
203938
204447
  /*This function returns the url to the resource after checking the validity of url*/
203939
204448
  const getResourceURL = (urlString) => {
203940
204449
  return urlString;
@@ -205188,6 +205697,7 @@ var Utils = /*#__PURE__*/Object.freeze({
205188
205697
  isPageable: isPageable,
205189
205698
  isSafari: isSafari,
205190
205699
  isTablet: isTablet,
205700
+ isValidImageUrl: isValidImageUrl,
205191
205701
  isValidWebURL: isValidWebURL,
205192
205702
  isVideoFile: isVideoFile,
205193
205703
  loadScript: loadScript,
@@ -208027,7 +208537,7 @@ class PipeProvider {
208027
208537
  this.preparePipeMeta(CurrencyPipe$1, 'currency', true, [this._locale]),
208028
208538
  this.preparePipeMeta(DatePipe$1, 'date', true, [this._locale]),
208029
208539
  this.preparePipeMeta(ToDatePipe, 'toDate', true, [
208030
- new DatePipe$1(this._locale), undefined, this.injector.get(CustomPipeManager)
208540
+ new DatePipe$1(this._locale), undefined, this.injector.get(App), this.injector.get(CustomPipeManager)
208031
208541
  ]),
208032
208542
  this.preparePipeMeta(ToNumberPipe, 'toNumber', true, [
208033
208543
  new DecimalPipe$1(this._locale),
@@ -208044,7 +208554,7 @@ class PipeProvider {
208044
208554
  new DecimalPipe$1(this._locale)
208045
208555
  ]),
208046
208556
  this.preparePipeMeta(StringToNumberPipe, 'stringToNumber', true),
208047
- this.preparePipeMeta(CustomPipe, 'custom', true, [this.injector.get(CustomPipeManager)]),
208557
+ this.preparePipeMeta(CustomPipe, 'custom', true, [this.injector.get(App), this.injector.get(CustomPipeManager)]),
208048
208558
  this.preparePipeMeta(TrustAsPipe, 'trustAs', true, [this.domSanitizer]),
208049
208559
  this.preparePipeMeta(SanitizePipe, 'sanitize', true, [this.domSanitizer]),
208050
208560
  this.preparePipeMeta(TemplateReplacePipe, 'templateReplace', true),