@wavemaker/angular-app 11.14.3-rc.6401 → 11.14.4-rc.647538

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.
@@ -33117,7 +33117,7 @@ function verifySemanticsOfNgModuleDef$1(moduleType, allowDuplicateDeclarationsIn
33117
33117
  verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
33118
33118
  verifySemanticsOfNgModuleDef$1(modOrStandaloneCmpt, false, moduleType);
33119
33119
  });
33120
- const exports$1 = maybeUnwrapFn$1(ngModuleDef.exports);
33120
+ const exports = maybeUnwrapFn$1(ngModuleDef.exports);
33121
33121
  declarations.forEach(verifyDeclarationsHaveDefinitions);
33122
33122
  declarations.forEach(verifyDirectivesHaveSelector);
33123
33123
  declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
@@ -33125,7 +33125,7 @@ function verifySemanticsOfNgModuleDef$1(moduleType, allowDuplicateDeclarationsIn
33125
33125
  ...declarations.map(resolveForwardRef$1),
33126
33126
  ...flatten$3(imports.map(computeCombinedExports$1)).map(resolveForwardRef$1),
33127
33127
  ];
33128
- exports$1.forEach(verifyExportsAreDeclaredOrReExported);
33128
+ exports.forEach(verifyExportsAreDeclaredOrReExported);
33129
33129
  declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
33130
33130
  const ngModule = getAnnotation$1(moduleType, 'NgModule');
33131
33131
  if (ngModule) {
@@ -81193,7 +81193,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
81193
81193
  verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
81194
81194
  verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
81195
81195
  });
81196
- const exports$1 = maybeUnwrapFn(ngModuleDef.exports);
81196
+ const exports = maybeUnwrapFn(ngModuleDef.exports);
81197
81197
  declarations.forEach(verifyDeclarationsHaveDefinitions);
81198
81198
  declarations.forEach(verifyDirectivesHaveSelector);
81199
81199
  declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
@@ -81201,7 +81201,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
81201
81201
  ...declarations.map(resolveForwardRef),
81202
81202
  ...flatten$1(imports.map(computeCombinedExports)).map(resolveForwardRef),
81203
81203
  ];
81204
- exports$1.forEach(verifyExportsAreDeclaredOrReExported);
81204
+ exports.forEach(verifyExportsAreDeclaredOrReExported);
81205
81205
  declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
81206
81206
  const ngModule = getAnnotation(moduleType, 'NgModule');
81207
81207
  if (ngModule) {
@@ -102019,14 +102019,14 @@ function createNgModuleType$1(meta) {
102019
102019
  if (meta.kind === R3NgModuleMetadataKind$1.Local) {
102020
102020
  return new ExpressionType$1$1(meta.type.value);
102021
102021
  }
102022
- const { type: moduleType, declarations, exports: exports$1, imports, includeImportTypes, publicDeclarationTypes, } = meta;
102022
+ const { type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes, } = meta;
102023
102023
  return new ExpressionType$1$1(importExpr$1(Identifiers$1.NgModuleDeclaration, [
102024
102024
  new ExpressionType$1$1(moduleType.type),
102025
102025
  publicDeclarationTypes === null
102026
102026
  ? tupleTypeOf$1(declarations)
102027
102027
  : tupleOfTypes$1(publicDeclarationTypes),
102028
102028
  includeImportTypes ? tupleTypeOf$1(imports) : NONE_TYPE$1,
102029
- tupleTypeOf$1(exports$1),
102029
+ tupleTypeOf$1(exports),
102030
102030
  ]));
102031
102031
  }
102032
102032
  /**
@@ -131288,14 +131288,14 @@ function requireDom$1 () {
131288
131288
  ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
131289
131289
  var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
131290
131290
  ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
131291
- ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
131291
+ var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
131292
131292
  ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
131293
131293
  ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
131294
131294
  var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
131295
131295
  ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
131296
131296
  var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
131297
131297
  //level2
131298
- ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
131298
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
131299
131299
  ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
131300
131300
  ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
131301
131301
  ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
@@ -131345,9 +131345,10 @@ function requireDom$1 () {
131345
131345
  item: function(index) {
131346
131346
  return index >= 0 && index < this.length ? this[index] : null;
131347
131347
  },
131348
- toString:function(isHTML,nodeFilter){
131348
+ toString:function(isHTML,nodeFilter,options){
131349
+ var requireWellFormed = !!options && !!options.requireWellFormed;
131349
131350
  for(var buf = [], i = 0;i<this.length;i++){
131350
- serializeToString(this[i],buf,isHTML,nodeFilter);
131351
+ serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
131351
131352
  }
131352
131353
  return buf.join('');
131353
131354
  },
@@ -131592,13 +131593,28 @@ function requireDom$1 () {
131592
131593
  /**
131593
131594
  * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
131594
131595
  *
131595
- * __This behavior is slightly different from the in the specs__:
131596
+ * __This implementation differs from the specification:__
131596
131597
  * - this implementation is not validating names or qualified names
131597
131598
  * (when parsing XML strings, the SAX parser takes care of that)
131598
131599
  *
131600
+ * Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
131601
+ * Creation-time validation of `publicId`, `systemId` is not enforced.
131602
+ * The serializer-level check covers all mutation vectors, including direct property writes.
131603
+ * `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
131604
+ * absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
131605
+ * silently omitted from the serialized output.
131606
+ *
131599
131607
  * @param {string} qualifiedName
131600
131608
  * @param {string} [publicId]
131609
+ * The external subset public identifier. Stored verbatim including surrounding quotes.
131610
+ * When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
131611
+ * throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
131612
+ * not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
131601
131613
  * @param {string} [systemId]
131614
+ * The external subset system identifier. Stored verbatim including surrounding quotes.
131615
+ * When serialized with `requireWellFormed: true`, throws `DOMException` with code
131616
+ * `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
131617
+ * production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
131602
131618
  * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
131603
131619
  * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
131604
131620
  *
@@ -131664,18 +131680,44 @@ function requireDom$1 () {
131664
131680
  return cloneNode(this.ownerDocument||this,this,deep);
131665
131681
  },
131666
131682
  // Modified in DOM Level 2:
131667
- normalize:function(){
131668
- var child = this.firstChild;
131669
- while(child){
131670
- var next = child.nextSibling;
131671
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
131672
- this.removeChild(next);
131673
- child.appendData(next.data);
131674
- }else {
131675
- child.normalize();
131676
- child = next;
131677
- }
131678
- }
131683
+ /**
131684
+ * Puts the specified node and all of its subtree into a "normalized" form. In a normalized
131685
+ * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
131686
+ *
131687
+ * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
131688
+ * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
131689
+ * nodes.
131690
+ *
131691
+ * This method iteratively traverses all child nodes to normalize all descendant nodes within
131692
+ * the subtree.
131693
+ *
131694
+ * @throws {DOMException}
131695
+ * May throw a DOMException if operations within removeChild or appendData (which are
131696
+ * potentially invoked in this method) do not meet their specific constraints.
131697
+ * @see {@link Node.removeChild}
131698
+ * @see {@link CharacterData.appendData}
131699
+ * @see ../docs/walk-dom.md.
131700
+ */
131701
+ normalize: function () {
131702
+ walkDOM(this, null, {
131703
+ enter: function (node) {
131704
+ // Merge adjacent text children of node before walkDOM schedules them.
131705
+ // walkDOM reads lastChild/previousSibling after enter returns, so the
131706
+ // surviving post-merge children are what it descends into.
131707
+ var child = node.firstChild;
131708
+ while (child) {
131709
+ var next = child.nextSibling;
131710
+ if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
131711
+ node.removeChild(next);
131712
+ child.appendData(next.data);
131713
+ // Do not advance child: re-check new nextSibling for another text run
131714
+ } else {
131715
+ child = next;
131716
+ }
131717
+ }
131718
+ return true; // descend into surviving children
131719
+ },
131720
+ });
131679
131721
  },
131680
131722
  // Introduced in DOM Level 2:
131681
131723
  isSupported:function(feature, version){
@@ -131751,21 +131793,103 @@ function requireDom$1 () {
131751
131793
  copy(NodeType,Node.prototype);
131752
131794
 
131753
131795
  /**
131754
- * @param callback return true for continue,false for break
131755
- * @return boolean true: break visit;
131796
+ * @param {Node} node
131797
+ * Root of the subtree to visit.
131798
+ * @param {function(Node): boolean} callback
131799
+ * Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
131800
+ * @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
131756
131801
  */
131757
- function _visitNode(node,callback){
131758
- if(callback(node)){
131759
- return true;
131760
- }
131761
- if(node = node.firstChild){
131762
- do{
131763
- if(_visitNode(node,callback)){return true}
131764
- }while(node=node.nextSibling)
131765
- }
131802
+ function _visitNode(node, callback) {
131803
+ return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
131766
131804
  }
131767
131805
 
131806
+ /**
131807
+ * Depth-first pre/post-order DOM tree walker.
131808
+ *
131809
+ * Visits every node in the subtree rooted at `node`. For each node:
131810
+ *
131811
+ * 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
131812
+ * return value becomes the `context` passed to each child's `enter` call and to the matching
131813
+ * `exit` call.
131814
+ * 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
131815
+ * sibling traversal continues normally.
131816
+ * 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
131817
+ * further `enter` or `exit` calls are made.
131818
+ * 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
131819
+ * safely modify the node's own child list before the walker descends. Modifying siblings of
131820
+ * the current node or any other part of the tree produces unpredictable results: nodes already
131821
+ * queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
131822
+ * the current child list are never visited.
131823
+ * 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
131824
+ * been visited, passing the same `context` that `enter`
131825
+ * returned for that node.
131826
+ *
131827
+ * This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
131828
+ * deep trees.
131829
+ *
131830
+ * @param {Node} node
131831
+ * Root of the subtree to walk.
131832
+ * @param {*} context
131833
+ * Initial context value passed to the root node's `enter`.
131834
+ * @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
131835
+ * @returns {void | walkDOM.STOP}
131836
+ * @see ../docs/walk-dom.md.
131837
+ */
131838
+ function walkDOM(node, context, callbacks) {
131839
+ // Each stack frame is {node, context, phase}:
131840
+ // walkDOM.ENTER — call enter, then push children
131841
+ // walkDOM.EXIT — call exit
131842
+ var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
131843
+ while (stack.length > 0) {
131844
+ var frame = stack.pop();
131845
+ if (frame.phase === walkDOM.ENTER) {
131846
+ var childContext = callbacks.enter(frame.node, frame.context);
131847
+ if (childContext === walkDOM.STOP) {
131848
+ return walkDOM.STOP;
131849
+ }
131850
+ // Push exit frame before children so it fires after all children are processed (Last In First Out)
131851
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
131852
+ if (childContext === null || childContext === undefined) {
131853
+ continue; // skip children
131854
+ }
131855
+ // lastChild is read after enter returns, so enter may modify the child list.
131856
+ var child = frame.node.lastChild;
131857
+ // Traverse from lastChild backwards so that pushing onto the stack
131858
+ // naturally yields firstChild on top (processed first).
131859
+ while (child) {
131860
+ stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
131861
+ child = child.previousSibling;
131862
+ }
131863
+ } else {
131864
+ // frame.phase === walkDOM.EXIT
131865
+ if (callbacks.exit) {
131866
+ callbacks.exit(frame.node, frame.context);
131867
+ }
131868
+ }
131869
+ }
131870
+ }
131768
131871
 
131872
+ /**
131873
+ * Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
131874
+ * immediately.
131875
+ *
131876
+ * @type {symbol}
131877
+ */
131878
+ walkDOM.STOP = Symbol('walkDOM.STOP');
131879
+ /**
131880
+ * Phase constant for a stack frame that has not yet been visited.
131881
+ * The `enter` callback is called and children are scheduled.
131882
+ *
131883
+ * @type {number}
131884
+ */
131885
+ walkDOM.ENTER = 0;
131886
+ /**
131887
+ * Phase constant for a stack frame whose subtree has been fully visited.
131888
+ * The `exit` callback is called.
131889
+ *
131890
+ * @type {number}
131891
+ */
131892
+ walkDOM.EXIT = 1;
131769
131893
 
131770
131894
  function Document(){
131771
131895
  this.ownerDocument = this;
@@ -132369,12 +132493,44 @@ function requireDom$1 () {
132369
132493
  node.appendData(data);
132370
132494
  return node;
132371
132495
  },
132496
+ /**
132497
+ * Returns a new CDATASection node whose data is `data`.
132498
+ *
132499
+ * __This implementation differs from the specification:__
132500
+ * - calling this method on an HTML document does not throw `NotSupportedError`.
132501
+ *
132502
+ * @param {string} data
132503
+ * @returns {CDATASection}
132504
+ * @throws DOMException with code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
132505
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
132506
+ * @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
132507
+ */
132372
132508
  createCDATASection : function(data){
132509
+ if (data.indexOf(']]>') !== -1) {
132510
+ throw new DOMException(INVALID_CHARACTER_ERR, 'data contains "]]>"');
132511
+ }
132373
132512
  var node = new CDATASection();
132374
132513
  node.ownerDocument = this;
132375
132514
  node.appendData(data);
132376
132515
  return node;
132377
132516
  },
132517
+ /**
132518
+ * Returns a ProcessingInstruction node whose target is target and data is data.
132519
+ *
132520
+ * __This implementation differs from the specification:__
132521
+ * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
132522
+ *
132523
+ * Note: When the resulting document is serialized with `requireWellFormed: true`, the
132524
+ * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
132525
+ * §3.2.1.7). Without that option the data is emitted verbatim.
132526
+ *
132527
+ * @param {string} target
132528
+ * @param {string} data
132529
+ * @returns {ProcessingInstruction}
132530
+ * @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
132531
+ * @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
132532
+ * @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
132533
+ */
132378
132534
  createProcessingInstruction : function(target,data){
132379
132535
  var node = new ProcessingInstruction();
132380
132536
  node.ownerDocument = this;
@@ -132600,6 +132756,19 @@ function requireDom$1 () {
132600
132756
  _extends(CDATASection,CharacterData);
132601
132757
 
132602
132758
 
132759
+ /**
132760
+ * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
132761
+ *
132762
+ * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
132763
+ * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
132764
+ * direct property writes succeed silently. Values are serialized verbatim when
132765
+ * `requireWellFormed` is false (the default). When the serializer is invoked with
132766
+ * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
132767
+ * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
132768
+ *
132769
+ * @class
132770
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
132771
+ */
132603
132772
  function DocumentType() {
132604
132773
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
132605
132774
  _extends(DocumentType,Node);
@@ -132627,11 +132796,48 @@ function requireDom$1 () {
132627
132796
  ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
132628
132797
  _extends(ProcessingInstruction,Node);
132629
132798
  function XMLSerializer(){}
132630
- XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
132631
- return nodeSerializeToString.call(node,isHtml,nodeFilter);
132799
+ /**
132800
+ * Returns the result of serializing `node` to XML.
132801
+ *
132802
+ * When `options.requireWellFormed` is `true`, the serializer throws for content that would
132803
+ * produce ill-formed XML.
132804
+ *
132805
+ * __This implementation differs from the specification:__
132806
+ * - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
132807
+ * at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
132808
+ * default behaviour) unless `requireWellFormed` is `true`.
132809
+ * - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
132810
+ * is only thrown to prevent injection vectors, not for all the spec mandated checks.
132811
+ *
132812
+ * @param {Node} node
132813
+ * @param {boolean} [isHtml]
132814
+ * @param {function} [nodeFilter]
132815
+ * @param {Object} [options]
132816
+ * @param {boolean} [options.requireWellFormed=false]
132817
+ * When `true`, throws for content that would produce ill-formed XML.
132818
+ * @returns {string}
132819
+ * @throws {DOMException}
132820
+ * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
132821
+ * - a CDATASection node's data contains `"]]>"`,
132822
+ * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
132823
+ * - a ProcessingInstruction's data contains `"?>"`,
132824
+ * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
132825
+ * production,
132826
+ * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
132827
+ * production, or
132828
+ * - a DocumentType's `internalSubset` contains `"]>"`.
132829
+ * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
132830
+ * writes succeed and are covered by the serializer-level checks above.
132831
+ * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
132832
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serialization
132833
+ * @see https://github.com/w3c/DOM-Parsing/issues/84
132834
+ */
132835
+ XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
132836
+ return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
132632
132837
  };
132633
132838
  Node.prototype.toString = nodeSerializeToString;
132634
- function nodeSerializeToString(isHtml,nodeFilter){
132839
+ function nodeSerializeToString(isHtml,nodeFilter,options){
132840
+ var requireWellFormed = !!options && !!options.requireWellFormed;
132635
132841
  var buf = [];
132636
132842
  var refNode = this.nodeType == 9 && this.documentElement || this;
132637
132843
  var prefix = refNode.prefix;
@@ -132648,7 +132854,7 @@ function requireDom$1 () {
132648
132854
  ];
132649
132855
  }
132650
132856
  }
132651
- serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
132857
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
132652
132858
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
132653
132859
  return buf.join('');
132654
132860
  }
@@ -132697,271 +132903,323 @@ function requireDom$1 () {
132697
132903
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
132698
132904
  }
132699
132905
 
132700
- function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
132906
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
132701
132907
  if (!visibleNamespaces) {
132702
132908
  visibleNamespaces = [];
132703
132909
  }
132704
-
132705
- if(nodeFilter){
132706
- node = nodeFilter(node);
132707
- if(node){
132708
- if(typeof node == 'string'){
132709
- buf.push(node);
132710
- return;
132711
- }
132712
- }else {
132713
- return;
132714
- }
132715
- //buf.sort.apply(attrs, attributeSorter);
132716
- }
132717
-
132718
- switch(node.nodeType){
132719
- case ELEMENT_NODE:
132720
- var attrs = node.attributes;
132721
- var len = attrs.length;
132722
- var child = node.firstChild;
132723
- var nodeName = node.tagName;
132724
-
132725
- isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
132726
-
132727
- var prefixedNodeName = nodeName;
132728
- if (!isHTML && !node.prefix && node.namespaceURI) {
132729
- var defaultNS;
132730
- // lookup current default ns from `xmlns` attribute
132731
- for (var ai = 0; ai < attrs.length; ai++) {
132732
- if (attrs.item(ai).name === 'xmlns') {
132733
- defaultNS = attrs.item(ai).value;
132734
- break
132735
- }
132736
- }
132737
- if (!defaultNS) {
132738
- // lookup current default ns in visibleNamespaces
132739
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
132740
- var namespace = visibleNamespaces[nsi];
132741
- if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
132742
- defaultNS = namespace.namespace;
132743
- break
132910
+ walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
132911
+ enter: function (n, ctx) {
132912
+ var ns = ctx.ns;
132913
+ var html = ctx.isHTML;
132914
+
132915
+ if (nodeFilter) {
132916
+ n = nodeFilter(n);
132917
+ if (n) {
132918
+ if (typeof n == 'string') {
132919
+ buf.push(n);
132920
+ return null;
132744
132921
  }
132922
+ } else {
132923
+ return null;
132745
132924
  }
132746
132925
  }
132747
- if (defaultNS !== node.namespaceURI) {
132748
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
132749
- var namespace = visibleNamespaces[nsi];
132750
- if (namespace.namespace === node.namespaceURI) {
132751
- if (namespace.prefix) {
132752
- prefixedNodeName = namespace.prefix + ':' + nodeName;
132926
+
132927
+ switch (n.nodeType) {
132928
+ case ELEMENT_NODE:
132929
+ var attrs = n.attributes;
132930
+ var len = attrs.length;
132931
+ var nodeName = n.tagName;
132932
+
132933
+ html = NAMESPACE.isHTML(n.namespaceURI) || html;
132934
+
132935
+ var prefixedNodeName = nodeName;
132936
+ if (!html && !n.prefix && n.namespaceURI) {
132937
+ var defaultNS;
132938
+ // lookup current default ns from `xmlns` attribute
132939
+ for (var ai = 0; ai < attrs.length; ai++) {
132940
+ if (attrs.item(ai).name === 'xmlns') {
132941
+ defaultNS = attrs.item(ai).value;
132942
+ break;
132943
+ }
132944
+ }
132945
+ if (!defaultNS) {
132946
+ // lookup current default ns in visibleNamespaces
132947
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
132948
+ var nsEntry = ns[nsi];
132949
+ if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
132950
+ defaultNS = nsEntry.namespace;
132951
+ break;
132952
+ }
132953
+ }
132954
+ }
132955
+ if (defaultNS !== n.namespaceURI) {
132956
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
132957
+ var nsEntry = ns[nsi];
132958
+ if (nsEntry.namespace === n.namespaceURI) {
132959
+ if (nsEntry.prefix) {
132960
+ prefixedNodeName = nsEntry.prefix + ':' + nodeName;
132961
+ }
132962
+ break;
132963
+ }
132964
+ }
132753
132965
  }
132754
- break
132755
132966
  }
132756
- }
132757
- }
132758
- }
132759
132967
 
132760
- buf.push('<', prefixedNodeName);
132968
+ buf.push('<', prefixedNodeName);
132969
+
132970
+ // Build a fresh namespace snapshot for this element's children.
132971
+ // The slice prevents sibling elements from inheriting each other's declarations.
132972
+ var childNs = ns.slice();
132973
+ for (var i = 0; i < len; i++) {
132974
+ var attr = attrs.item(i);
132975
+ if (attr.prefix == 'xmlns') {
132976
+ childNs.push({ prefix: attr.localName, namespace: attr.value });
132977
+ } else if (attr.nodeName == 'xmlns') {
132978
+ childNs.push({ prefix: '', namespace: attr.value });
132979
+ }
132980
+ }
132761
132981
 
132762
- for(var i=0;i<len;i++){
132763
- // add namespaces for attributes
132764
- var attr = attrs.item(i);
132765
- if (attr.prefix == 'xmlns') {
132766
- visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
132767
- }else if(attr.nodeName == 'xmlns'){
132768
- visibleNamespaces.push({ prefix: '', namespace: attr.value });
132769
- }
132770
- }
132982
+ for (var i = 0; i < len; i++) {
132983
+ var attr = attrs.item(i);
132984
+ if (needNamespaceDefine(attr, html, childNs)) {
132985
+ var attrPrefix = attr.prefix || '';
132986
+ var uri = attr.namespaceURI;
132987
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
132988
+ childNs.push({ prefix: attrPrefix, namespace: uri });
132989
+ }
132990
+ // Apply nodeFilter and serialize the attribute.
132991
+ var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
132992
+ if (filteredAttr) {
132993
+ if (typeof filteredAttr === 'string') {
132994
+ buf.push(filteredAttr);
132995
+ } else {
132996
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
132997
+ }
132998
+ }
132999
+ }
132771
133000
 
132772
- for(var i=0;i<len;i++){
132773
- var attr = attrs.item(i);
132774
- if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
132775
- var prefix = attr.prefix||'';
132776
- var uri = attr.namespaceURI;
132777
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
132778
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
132779
- }
132780
- serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
132781
- }
133001
+ // add namespace for current node
133002
+ if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
133003
+ var nodePrefix = n.prefix || '';
133004
+ var uri = n.namespaceURI;
133005
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
133006
+ childNs.push({ prefix: nodePrefix, namespace: uri });
133007
+ }
132782
133008
 
132783
- // add namespace for current node
132784
- if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
132785
- var prefix = node.prefix||'';
132786
- var uri = node.namespaceURI;
132787
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
132788
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
132789
- }
133009
+ var child = n.firstChild;
133010
+ if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
133011
+ buf.push('>');
133012
+ if (html && /^script$/i.test(nodeName)) {
133013
+ // Inline serialization for <script> children; return null to skip walkDOM descent.
133014
+ while (child) {
133015
+ if (child.data) {
133016
+ buf.push(child.data);
133017
+ } else {
133018
+ serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
133019
+ }
133020
+ child = child.nextSibling;
133021
+ }
133022
+ buf.push('</', nodeName, '>');
133023
+ return null;
133024
+ }
133025
+ // Return child context; walkDOM descends and exit emits the closing tag.
133026
+ return { ns: childNs, isHTML: html, tag: prefixedNodeName };
133027
+ } else {
133028
+ buf.push('/>');
133029
+ return null;
133030
+ }
132790
133031
 
132791
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
132792
- buf.push('>');
132793
- //if is cdata child node
132794
- if(isHTML && /^script$/i.test(nodeName)){
132795
- while(child){
132796
- if(child.data){
132797
- buf.push(child.data);
132798
- }else {
132799
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
133032
+ case DOCUMENT_NODE:
133033
+ case DOCUMENT_FRAGMENT_NODE:
133034
+ // Descend into children; exit is a no-op (tag is null).
133035
+ return { ns: ns.slice(), isHTML: html, tag: null };
133036
+
133037
+ case ATTRIBUTE_NODE:
133038
+ addSerializedAttribute(buf, n.name, n.value);
133039
+ return null;
133040
+
133041
+ case TEXT_NODE:
133042
+ /**
133043
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
133044
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
133045
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
133046
+ * `&amp;` and `&lt;` respectively.
133047
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
133048
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
133049
+ * when that string is not marking the end of a CDATA section.
133050
+ *
133051
+ * In the content of elements, character data is any string of characters
133052
+ * which does not contain the start-delimiter of any markup
133053
+ * and does not include the CDATA-section-close delimiter, `]]>`.
133054
+ *
133055
+ * @see https://www.w3.org/TR/xml/#NT-CharData
133056
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
133057
+ */
133058
+ buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
133059
+ return null;
133060
+
133061
+ case CDATA_SECTION_NODE:
133062
+ if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
133063
+ throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
132800
133064
  }
132801
- child = child.nextSibling;
132802
- }
132803
- }else
132804
- {
132805
- while(child){
132806
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
132807
- child = child.nextSibling;
132808
- }
132809
- }
132810
- buf.push('</',prefixedNodeName,'>');
132811
- }else {
132812
- buf.push('/>');
132813
- }
132814
- // remove added visible namespaces
132815
- //visibleNamespaces.length = startVisibleNamespaces;
132816
- return;
132817
- case DOCUMENT_NODE:
132818
- case DOCUMENT_FRAGMENT_NODE:
132819
- var child = node.firstChild;
132820
- while(child){
132821
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
132822
- child = child.nextSibling;
132823
- }
132824
- return;
132825
- case ATTRIBUTE_NODE:
132826
- return addSerializedAttribute(buf, node.name, node.value);
132827
- case TEXT_NODE:
132828
- /**
132829
- * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
132830
- * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
132831
- * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
132832
- * `&amp;` and `&lt;` respectively.
132833
- * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
132834
- * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
132835
- * when that string is not marking the end of a CDATA section.
132836
- *
132837
- * In the content of elements, character data is any string of characters
132838
- * which does not contain the start-delimiter of any markup
132839
- * and does not include the CDATA-section-close delimiter, `]]>`.
132840
- *
132841
- * @see https://www.w3.org/TR/xml/#NT-CharData
132842
- * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
132843
- */
132844
- return buf.push(node.data
132845
- .replace(/[<&>]/g,_xmlEncoder)
132846
- );
132847
- case CDATA_SECTION_NODE:
132848
- return buf.push( '<![CDATA[',node.data,']]>');
132849
- case COMMENT_NODE:
132850
- return buf.push( "<!--",node.data,"-->");
132851
- case DOCUMENT_TYPE_NODE:
132852
- var pubid = node.publicId;
132853
- var sysid = node.systemId;
132854
- buf.push('<!DOCTYPE ',node.name);
132855
- if(pubid){
132856
- buf.push(' PUBLIC ', pubid);
132857
- if (sysid && sysid!='.') {
132858
- buf.push(' ', sysid);
133065
+ buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
133066
+ return null;
133067
+
133068
+ case COMMENT_NODE:
133069
+ if (requireWellFormed && n.data.indexOf('-->') !== -1) {
133070
+ throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
133071
+ }
133072
+ buf.push('<!--', n.data, '-->');
133073
+ return null;
133074
+
133075
+ case DOCUMENT_TYPE_NODE:
133076
+ if (requireWellFormed) {
133077
+ if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
133078
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
133079
+ }
133080
+ if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
133081
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
133082
+ }
133083
+ if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
133084
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
133085
+ }
133086
+ }
133087
+ var pubid = n.publicId;
133088
+ var sysid = n.systemId;
133089
+ buf.push('<!DOCTYPE ', n.name);
133090
+ if (pubid) {
133091
+ buf.push(' PUBLIC ', pubid);
133092
+ if (sysid && sysid != '.') {
133093
+ buf.push(' ', sysid);
133094
+ }
133095
+ buf.push('>');
133096
+ } else if (sysid && sysid != '.') {
133097
+ buf.push(' SYSTEM ', sysid, '>');
133098
+ } else {
133099
+ var sub = n.internalSubset;
133100
+ if (sub) {
133101
+ buf.push(' [', sub, ']');
133102
+ }
133103
+ buf.push('>');
133104
+ }
133105
+ return null;
133106
+
133107
+ case PROCESSING_INSTRUCTION_NODE:
133108
+ if (requireWellFormed && n.data.indexOf('?>') !== -1) {
133109
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
133110
+ }
133111
+ buf.push('<?', n.target, ' ', n.data, '?>');
133112
+ return null;
133113
+
133114
+ case ENTITY_REFERENCE_NODE:
133115
+ buf.push('&', n.nodeName, ';');
133116
+ return null;
133117
+
133118
+ //case ENTITY_NODE:
133119
+ //case NOTATION_NODE:
133120
+ default:
133121
+ buf.push('??', n.nodeName);
133122
+ return null;
132859
133123
  }
132860
- buf.push('>');
132861
- }else if(sysid && sysid!='.'){
132862
- buf.push(' SYSTEM ', sysid, '>');
132863
- }else {
132864
- var sub = node.internalSubset;
132865
- if(sub){
132866
- buf.push(" [",sub,"]");
133124
+ },
133125
+ exit: function (n, childCtx) {
133126
+ if (childCtx && childCtx.tag) {
133127
+ buf.push('</', childCtx.tag, '>');
132867
133128
  }
132868
- buf.push(">");
132869
- }
132870
- return;
132871
- case PROCESSING_INSTRUCTION_NODE:
132872
- return buf.push( "<?",node.target," ",node.data,"?>");
132873
- case ENTITY_REFERENCE_NODE:
132874
- return buf.push( '&',node.nodeName,';');
132875
- //case ENTITY_NODE:
132876
- //case NOTATION_NODE:
132877
- default:
132878
- buf.push('??',node.nodeName);
132879
- }
133129
+ },
133130
+ });
132880
133131
  }
132881
- function importNode(doc,node,deep){
132882
- var node2;
132883
- switch (node.nodeType) {
132884
- case ELEMENT_NODE:
132885
- node2 = node.cloneNode(false);
132886
- node2.ownerDocument = doc;
132887
- //var attrs = node2.attributes;
132888
- //var len = attrs.length;
132889
- //for(var i=0;i<len;i++){
132890
- //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
132891
- //}
132892
- case DOCUMENT_FRAGMENT_NODE:
132893
- break;
132894
- case ATTRIBUTE_NODE:
132895
- deep = true;
132896
- break;
132897
- //case ENTITY_REFERENCE_NODE:
132898
- //case PROCESSING_INSTRUCTION_NODE:
132899
- ////case TEXT_NODE:
132900
- //case CDATA_SECTION_NODE:
132901
- //case COMMENT_NODE:
132902
- // deep = false;
132903
- // break;
132904
- //case DOCUMENT_NODE:
132905
- //case DOCUMENT_TYPE_NODE:
132906
- //cannot be imported.
132907
- //case ENTITY_NODE:
132908
- //case NOTATION_NODE:
132909
- //can not hit in level3
132910
- //default:throw e;
132911
- }
132912
- if(!node2){
132913
- node2 = node.cloneNode(false);//false
132914
- }
132915
- node2.ownerDocument = doc;
132916
- node2.parentNode = null;
132917
- if(deep){
132918
- var child = node.firstChild;
132919
- while(child){
132920
- node2.appendChild(importNode(doc,child,deep));
132921
- child = child.nextSibling;
132922
- }
132923
- }
132924
- return node2;
133132
+ /**
133133
+ * Imports a node from a different document into `doc`, creating a new copy.
133134
+ * Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
133135
+ * stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
133136
+ * Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
133137
+ * always forced to `true`
133138
+ * because an attribute's value lives in a child text node.
133139
+ *
133140
+ * @param {Document} doc
133141
+ * The document that will own the imported node.
133142
+ * @param {Node} node
133143
+ * The node to import.
133144
+ * @param {boolean} deep
133145
+ * If `true`, descendants are imported recursively.
133146
+ * @returns {Node}
133147
+ * The newly imported node, now owned by `doc`.
133148
+ */
133149
+ function importNode(doc, node, deep) {
133150
+ var destRoot;
133151
+ walkDOM(node, null, {
133152
+ enter: function (srcNode, destParent) {
133153
+ // Shallow-clone the node and stamp it into the target document.
133154
+ var destNode = srcNode.cloneNode(false);
133155
+ destNode.ownerDocument = doc;
133156
+ destNode.parentNode = null;
133157
+ // capture as the root of the imported subtree or attach to parent.
133158
+ if (destParent === null) {
133159
+ destRoot = destNode;
133160
+ } else {
133161
+ destParent.appendChild(destNode);
133162
+ }
133163
+ // ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
133164
+ var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
133165
+ return shouldDeep ? destNode : null;
133166
+ },
133167
+ });
133168
+ return destRoot;
132925
133169
  }
132926
133170
  //
132927
133171
  //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
132928
133172
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
132929
- function cloneNode(doc,node,deep){
132930
- var node2 = new node.constructor();
132931
- for (var n in node) {
132932
- if (Object.prototype.hasOwnProperty.call(node, n)) {
132933
- var v = node[n];
132934
- if (typeof v != "object") {
132935
- if (v != node2[n]) {
132936
- node2[n] = v;
133173
+ function cloneNode(doc, node, deep) {
133174
+ var destRoot;
133175
+ walkDOM(node, null, {
133176
+ enter: function (srcNode, destParent) {
133177
+ // 1. Create a blank node of the same type and copy all scalar own properties.
133178
+ var destNode = new srcNode.constructor();
133179
+ for (var n in srcNode) {
133180
+ if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
133181
+ var v = srcNode[n];
133182
+ if (typeof v != 'object') {
133183
+ if (v != destNode[n]) {
133184
+ destNode[n] = v;
133185
+ }
133186
+ }
132937
133187
  }
132938
133188
  }
132939
- }
132940
- }
132941
- if(node.childNodes){
132942
- node2.childNodes = new NodeList();
132943
- }
132944
- node2.ownerDocument = doc;
132945
- switch (node2.nodeType) {
132946
- case ELEMENT_NODE:
132947
- var attrs = node.attributes;
132948
- var attrs2 = node2.attributes = new NamedNodeMap();
132949
- var len = attrs.length;
132950
- attrs2._ownerElement = node2;
132951
- for(var i=0;i<len;i++){
132952
- node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
132953
- }
132954
- break; case ATTRIBUTE_NODE:
132955
- deep = true;
132956
- }
132957
- if(deep){
132958
- var child = node.firstChild;
132959
- while(child){
132960
- node2.appendChild(cloneNode(doc,child,deep));
132961
- child = child.nextSibling;
132962
- }
132963
- }
132964
- return node2;
133189
+ if (srcNode.childNodes) {
133190
+ destNode.childNodes = new NodeList();
133191
+ }
133192
+ destNode.ownerDocument = doc;
133193
+ // 2. Handle node-type-specific setup.
133194
+ // Attributes are not DOM children, so they are cloned inline here
133195
+ // rather than by walkDOM descent.
133196
+ // ATTRIBUTE_NODE forces deep=true so its own children are walked.
133197
+ var shouldDeep = deep;
133198
+ switch (destNode.nodeType) {
133199
+ case ELEMENT_NODE:
133200
+ var attrs = srcNode.attributes;
133201
+ var attrs2 = (destNode.attributes = new NamedNodeMap());
133202
+ var len = attrs.length;
133203
+ attrs2._ownerElement = destNode;
133204
+ for (var i = 0; i < len; i++) {
133205
+ destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
133206
+ }
133207
+ break;
133208
+ case ATTRIBUTE_NODE:
133209
+ shouldDeep = true;
133210
+ }
133211
+ // 3. Attach to parent, or capture as the root of the cloned subtree.
133212
+ if (destParent !== null) {
133213
+ destParent.appendChild(destNode);
133214
+ } else {
133215
+ destRoot = destNode;
133216
+ }
133217
+ // 4. Return destNode as the context for children (causes walkDOM to descend),
133218
+ // or null to skip children (shallow clone).
133219
+ return shouldDeep ? destNode : null;
133220
+ },
133221
+ });
133222
+ return destRoot;
132965
133223
  }
132966
133224
 
132967
133225
  function __set__(object,key,value){
@@ -132977,49 +133235,55 @@ function requireDom$1 () {
132977
133235
  }
132978
133236
  });
132979
133237
 
132980
- Object.defineProperty(Node.prototype,'textContent',{
132981
- get:function(){
132982
- return getTextContent(this);
133238
+ /**
133239
+ * The text content of this node and its descendants.
133240
+ *
133241
+ * Setting `textContent` on an element or document fragment replaces all child nodes with a
133242
+ * single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
133243
+ *
133244
+ * @type {string | null}
133245
+ * @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
133246
+ */
133247
+ Object.defineProperty(Node.prototype, 'textContent', {
133248
+ get: function () {
133249
+ if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
133250
+ var buf = [];
133251
+ walkDOM(this, null, {
133252
+ enter: function (n) {
133253
+ if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
133254
+ return true; // enter children
133255
+ }
133256
+ if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
133257
+ return null; // excluded from text content
133258
+ }
133259
+ buf.push(n.nodeValue);
133260
+ },
133261
+ });
133262
+ return buf.join('');
133263
+ }
133264
+ return this.nodeValue;
132983
133265
  },
132984
133266
 
132985
- set:function(data){
132986
- switch(this.nodeType){
132987
- case ELEMENT_NODE:
132988
- case DOCUMENT_FRAGMENT_NODE:
132989
- while(this.firstChild){
132990
- this.removeChild(this.firstChild);
132991
- }
132992
- if(data || String(data)){
132993
- this.appendChild(this.ownerDocument.createTextNode(data));
132994
- }
132995
- break;
133267
+ set: function (data) {
133268
+ switch (this.nodeType) {
133269
+ case ELEMENT_NODE:
133270
+ case DOCUMENT_FRAGMENT_NODE:
133271
+ while (this.firstChild) {
133272
+ this.removeChild(this.firstChild);
133273
+ }
133274
+ if (data || String(data)) {
133275
+ this.appendChild(this.ownerDocument.createTextNode(data));
133276
+ }
133277
+ break;
132996
133278
 
132997
- default:
132998
- this.data = data;
132999
- this.value = data;
133000
- this.nodeValue = data;
133279
+ default:
133280
+ this.data = data;
133281
+ this.value = data;
133282
+ this.nodeValue = data;
133001
133283
  }
133002
- }
133284
+ },
133003
133285
  });
133004
133286
 
133005
- function getTextContent(node){
133006
- switch(node.nodeType){
133007
- case ELEMENT_NODE:
133008
- case DOCUMENT_FRAGMENT_NODE:
133009
- var buf = [];
133010
- node = node.firstChild;
133011
- while(node){
133012
- if(node.nodeType!==7 && node.nodeType !==8){
133013
- buf.push(getTextContent(node));
133014
- }
133015
- node = node.nextSibling;
133016
- }
133017
- return buf.join('');
133018
- default:
133019
- return node.nodeValue;
133020
- }
133021
- }
133022
-
133023
133287
  __set__ = function(object,key,value){
133024
133288
  //console.log(value)
133025
133289
  object['$$'+key] = value;
@@ -133035,6 +133299,7 @@ function requireDom$1 () {
133035
133299
  dom$1.Element = Element;
133036
133300
  dom$1.Node = Node;
133037
133301
  dom$1.NodeList = NodeList;
133302
+ dom$1.walkDOM = walkDOM;
133038
133303
  dom$1.XMLSerializer = XMLSerializer;
133039
133304
  //}
133040
133305
  return dom$1;
@@ -133049,7 +133314,7 @@ var hasRequiredEntities$1;
133049
133314
  function requireEntities$1 () {
133050
133315
  if (hasRequiredEntities$1) return entities$1;
133051
133316
  hasRequiredEntities$1 = 1;
133052
- (function (exports$1) {
133317
+ (function (exports) {
133053
133318
 
133054
133319
  var freeze = requireConventions$1().freeze;
133055
133320
 
@@ -133060,7 +133325,7 @@ function requireEntities$1 () {
133060
133325
  * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
133061
133326
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
133062
133327
  */
133063
- exports$1.XML_ENTITIES = freeze({
133328
+ exports.XML_ENTITIES = freeze({
133064
133329
  amp: '&',
133065
133330
  apos: "'",
133066
133331
  gt: '>',
@@ -133082,7 +133347,7 @@ function requireEntities$1 () {
133082
133347
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
133083
133348
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
133084
133349
  */
133085
- exports$1.HTML_ENTITIES = freeze({
133350
+ exports.HTML_ENTITIES = freeze({
133086
133351
  Aacute: '\u00C1',
133087
133352
  aacute: '\u00E1',
133088
133353
  Abreve: '\u0102',
@@ -135214,7 +135479,7 @@ function requireEntities$1 () {
135214
135479
  * @deprecated use `HTML_ENTITIES` instead
135215
135480
  * @see HTML_ENTITIES
135216
135481
  */
135217
- exports$1.entityMap = exports$1.HTML_ENTITIES;
135482
+ exports.entityMap = exports.HTML_ENTITIES;
135218
135483
  } (entities$1));
135219
135484
  return entities$1;
135220
135485
  }
@@ -135825,7 +136090,7 @@ function requireSax$1 () {
135825
136090
  function parseInstruction(source,start,domBuilder){
135826
136091
  var end = source.indexOf('?>',start);
135827
136092
  if(end){
135828
- var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
136093
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
135829
136094
  if(match){
135830
136095
  match[0].length;
135831
136096
  domBuilder.processingInstruction(match[1], match[2]) ;
@@ -137022,7 +137287,7 @@ var hasRequiredMoment$1;
137022
137287
  function requireMoment$1 () {
137023
137288
  if (hasRequiredMoment$1) return moment$2.exports;
137024
137289
  hasRequiredMoment$1 = 1;
137025
- (function (module, exports$1) {
137290
+ (function (module, exports) {
137026
137291
  (function (global, factory) {
137027
137292
  module.exports = factory() ;
137028
137293
  }(this, (function () {
@@ -142712,7 +142977,7 @@ function requireMomentTimezone$1 () {
142712
142977
  hasRequiredMomentTimezone$1 = 1;
142713
142978
  (function (module) {
142714
142979
  //! moment-timezone.js
142715
- //! version : 0.6.0
142980
+ //! version : 0.6.2
142716
142981
  //! Copyright (c) JS Foundation and other contributors
142717
142982
  //! license : MIT
142718
142983
  //! github.com/moment/moment-timezone
@@ -142738,7 +143003,7 @@ function requireMomentTimezone$1 () {
142738
143003
  // return moment;
142739
143004
  // }
142740
143005
 
142741
- var VERSION = "0.6.0",
143006
+ var VERSION = "0.6.2",
142742
143007
  zones = {},
142743
143008
  links = {},
142744
143009
  countries = {},
@@ -147299,11 +147564,11 @@ const CURRENCY_INFO = {
147299
147564
  }
147300
147565
  };
147301
147566
 
147302
- const $RAF$1 = window.requestAnimationFrame;
147567
+ const $RAF$1$1 = window.requestAnimationFrame;
147303
147568
  const $RAFQueue$1 = [];
147304
147569
  const invokeLater$1 = fn => {
147305
147570
  if (!$RAFQueue$1.length) {
147306
- $RAF$1(() => {
147571
+ $RAF$1$1(() => {
147307
147572
  $RAFQueue$1.forEach(f => f());
147308
147573
  $RAFQueue$1.length = 0;
147309
147574
  });
@@ -147311,23 +147576,7 @@ const invokeLater$1 = fn => {
147311
147576
  $RAFQueue$1.push(fn);
147312
147577
  };
147313
147578
  const setAttr$1 = (node, attrName, val, sync) => {
147314
- const task = () => {
147315
- if (node instanceof Element) {
147316
- // Handle tabindex specifically - ensure it's a valid string representation
147317
- if (attrName === 'tabindex') {
147318
- // Convert to string, handling 0, null, undefined, and NaN
147319
- if (val === null || val === undefined || (typeof val === 'number' && isNaN(val))) {
147320
- node.removeAttribute(attrName);
147321
- }
147322
- else {
147323
- node.setAttribute(attrName, String(val));
147324
- }
147325
- }
147326
- else {
147327
- node.setAttribute(attrName, val);
147328
- }
147329
- }
147330
- };
147579
+ const task = () => node instanceof Element && node.setAttribute(attrName, val);
147331
147580
  invokeLater$1(task);
147332
147581
  };
147333
147582
 
@@ -147861,220 +148110,70 @@ const getFnForEventExpr$1 = (expr) => {
147861
148110
  return fnExecutor$1(expr, ExpressionType$2.Action);
147862
148111
  };
147863
148112
 
147864
- // Constants
147865
- const WIDGET_ID_REGEX$1 = /^(widget-[^_]+)/;
147866
- const WIDGET_PROPERTY_REGEX$1 = /^widget-[^_]+_(.+)$/;
147867
- const ARRAY_INDEX_PLACEHOLDER$1 = '[$i]';
147868
- const ARRAY_INDEX_ZERO$1 = '[0]';
147869
148113
  const registry$1 = new Map();
147870
148114
  const watchIdGenerator$1 = new IDGenerator$1('watch-id-');
147871
- const FIRST_TIME_WATCH$1 = Object.freeze({});
147872
- /**
147873
- * Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
147874
- */
147875
- const getWidgetId$1 = (identifier) => {
147876
- if (!identifier || typeof identifier !== 'string') {
147877
- return null;
147878
- }
147879
- const match = identifier.match(WIDGET_ID_REGEX$1);
147880
- return match ? match[1] : null;
147881
- };
147882
- /**
147883
- * Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
147884
- */
147885
- const getPropertyName$1 = (identifier) => {
147886
- if (!identifier || typeof identifier !== 'string') {
147887
- return identifier;
147888
- }
147889
- const match = identifier.match(WIDGET_PROPERTY_REGEX$1);
147890
- return match ? match[1] : identifier;
147891
- };
147892
- /**
147893
- * Array consumer wrapper for array-based expressions
147894
- */
148115
+ const FIRST_TIME_WATCH$1 = {};
148116
+ Object.freeze(FIRST_TIME_WATCH$1);
147895
148117
  const arrayConsumer$1 = (listenerFn, restExpr, newVal, oldVal) => {
147896
- if (!isArray$1(newVal)) {
147897
- return;
147898
- }
147899
- let formattedData = newVal.map(datum => findValueOf$1(datum, restExpr));
147900
- // Flatten if result is array of arrays
147901
- if (isArray$1(formattedData[0])) {
147902
- formattedData = flatten$2(formattedData);
148118
+ let data = newVal, formattedData;
148119
+ if (isArray$1(data)) {
148120
+ formattedData = data.map(function (datum) {
148121
+ return findValueOf$1(datum, restExpr);
148122
+ });
148123
+ // If resulting structure is an array of array, flatten it
148124
+ if (isArray$1(formattedData[0])) {
148125
+ formattedData = flatten$2(formattedData);
148126
+ }
148127
+ listenerFn(formattedData, oldVal);
147903
148128
  }
147904
- listenerFn(formattedData, oldVal);
147905
148129
  };
147906
- /**
147907
- * Updates watch info for array expressions
147908
- */
147909
- const getUpdatedWatchInfo$1 = (expr, acceptsArray, listener) => {
147910
- const regex = /\[\$i\]/g;
148130
+ const getUpdatedWatcInfo$1 = (expr, acceptsArray, listener) => {
148131
+ // listener doesn't accept array
148132
+ // replace all `[$i]` with `[0]` and return the expression
148133
+ let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
147911
148134
  if (!acceptsArray) {
147912
148135
  return {
147913
- expr: expr.replace(regex, ARRAY_INDEX_ZERO$1),
147914
- listener
148136
+ 'expr': expr.replace(regex, $0),
148137
+ 'listener': listener
147915
148138
  };
147916
148139
  }
147917
- const lastIndex = expr.lastIndexOf(ARRAY_INDEX_PLACEHOLDER$1);
147918
- const baseExpr = expr.substring(0, lastIndex).replace(ARRAY_INDEX_PLACEHOLDER$1, ARRAY_INDEX_ZERO$1);
147919
- const restExpr = expr.substring(lastIndex + 5);
147920
- const arrayConsumerFn = restExpr
147921
- ? arrayConsumer$1.bind(undefined, listener, restExpr)
147922
- : listener;
148140
+ // listener accepts array
148141
+ // replace all except the last `[$i]` with `[0]` and return the expression.
148142
+ var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
148143
+ if (restExpr) {
148144
+ arrayConsumerFn = arrayConsumer$1.bind(undefined, listener, restExpr);
148145
+ }
147923
148146
  return {
147924
- expr: baseExpr,
147925
- listener: arrayConsumerFn
148147
+ 'expr': _expr,
148148
+ 'listener': arrayConsumerFn
147926
148149
  };
147927
148150
  };
147928
- /**
147929
- * Determines if an expression is static (doesn't need to be watched)
147930
- */
147931
- const STATIC_EXPRESSION_NAMES$1 = [
147932
- "row.getProperty('investment')",
147933
- "row.getProperty('factsheetLink')",
147934
- "row.getProperty('isRebalanceEligible')"
147935
- ];
147936
- const isStaticExpression$1 = (expr) => {
147937
- if (typeof expr !== 'string') {
147938
- return false;
147939
- }
147940
- const trimmedExpr = expr.trim();
147941
- // Expressions that always evaluate to localization strings
147942
- // if (trimmedExpr.includes('appLocale')) {
147943
- // return true;
147944
- // }
147945
- // Hard-coded static expression names
147946
- if (STATIC_EXPRESSION_NAMES$1.includes(trimmedExpr)) {
147947
- return true;
147948
- }
147949
- return false;
147950
- };
147951
- /**
147952
- * Gets the scope type from the scope object
147953
- */
147954
- const getScopeType$1 = ($scope) => {
147955
- if (!$scope) {
147956
- return null;
147957
- }
147958
- if ($scope.pageName)
147959
- return 'Page';
147960
- if ($scope.prefabName)
147961
- return 'Prefab';
147962
- if ($scope.partialName)
147963
- return 'Partial';
147964
- // Check for App scope
147965
- if ($scope.Variables !== undefined &&
147966
- $scope.Actions !== undefined &&
147967
- !$scope.pageName &&
147968
- !$scope.prefabName &&
147969
- !$scope.partialName) {
147970
- return 'App';
147971
- }
147972
- if ($scope.constructor?.name === 'AppRef') {
147973
- return 'App';
147974
- }
147975
- return null;
147976
- };
147977
- /**
147978
- * Gets scope name based on scope type
147979
- */
147980
- const getScopeName$1 = ($scope, scopeType) => {
147981
- if (!scopeType || !$scope) {
147982
- return null;
147983
- }
147984
- switch (scopeType) {
147985
- case 'Prefab': return $scope.prefabName || null;
147986
- case 'Partial': return $scope.partialName || null;
147987
- case 'Page': return $scope.pageName || null;
147988
- default: return null;
147989
- }
147990
- };
147991
- /**
147992
- * Main watch function
147993
- */
147994
148151
  const $watch$1 = (expr, $scope, $locals, listener, identifier = watchIdGenerator$1.nextUid(), doNotClone = false, config = {}, isMuted) => {
147995
- // Handle array expressions
147996
- if (expr.includes(ARRAY_INDEX_PLACEHOLDER$1)) {
147997
- const watchInfo = getUpdatedWatchInfo$1(expr, config.arrayType || config.isList || false, listener);
148152
+ if (expr.indexOf('[$i]') !== -1) {
148153
+ let watchInfo = getUpdatedWatcInfo$1(expr, config && (config.arrayType || config.isList), listener);
147998
148154
  expr = watchInfo.expr;
147999
148155
  listener = watchInfo.listener;
148000
148156
  }
148001
- // Handle static expressions
148002
- if (isStaticExpression$1(expr)) {
148003
- try {
148004
- const fn = $parseExpr$1(expr);
148005
- const staticValue = fn($scope, $locals);
148006
- listener(staticValue, FIRST_TIME_WATCH$1);
148007
- }
148008
- catch (e) {
148009
- console.warn(`Error evaluating static expression '${expr}':`, e);
148010
- listener(undefined, FIRST_TIME_WATCH$1);
148011
- }
148012
- return () => { }; // No-op unsubscribe
148013
- }
148014
148157
  const fn = $parseExpr$1();
148015
- const scopeType = getScopeType$1($scope);
148016
- const scopeName = getScopeName$1($scope, scopeType);
148017
- const watchInfo = {
148018
- fn: fn.bind(null, $scope, $locals),
148158
+ registry$1.set(identifier, {
148159
+ fn: fn.bind(expr, $scope, $locals),
148019
148160
  listener,
148020
148161
  expr,
148021
148162
  last: FIRST_TIME_WATCH$1,
148022
148163
  doNotClone,
148023
- isMuted,
148024
- scopeType,
148025
- scopeName
148026
- };
148027
- // Store in registry
148028
- const widgetId = getWidgetId$1(identifier);
148029
- if (widgetId) {
148030
- const propertyName = getPropertyName$1(identifier);
148031
- if (!registry$1.has(widgetId)) {
148032
- registry$1.set(widgetId, {});
148033
- }
148034
- const widgetGroup = registry$1.get(widgetId);
148035
- widgetGroup[propertyName] = watchInfo;
148036
- }
148037
- else {
148038
- registry$1.set(identifier, watchInfo);
148039
- }
148164
+ isMuted: isMuted
148165
+ });
148040
148166
  return () => $unwatch$1(identifier);
148041
148167
  };
148042
- /**
148043
- * Unwatches a single identifier
148044
- */
148045
- const $unwatch$1 = (identifier) => {
148046
- const widgetId = getWidgetId$1(identifier);
148047
- if (widgetId) {
148048
- const propertyName = getPropertyName$1(identifier);
148049
- const widgetGroup = registry$1.get(widgetId);
148050
- if (widgetGroup && typeof widgetGroup === 'object' && !widgetGroup.fn) {
148051
- const watchInfo = widgetGroup[propertyName];
148052
- if (watchInfo) {
148053
- delete widgetGroup[propertyName];
148054
- // Clean up empty widget groups
148055
- if (Object.keys(widgetGroup).length === 0) {
148056
- registry$1.delete(widgetId);
148057
- }
148058
- return true;
148059
- }
148060
- }
148061
- }
148062
- // Fallback to direct lookup
148063
- if (registry$1.has(identifier)) {
148064
- registry$1.delete(identifier);
148065
- return true;
148066
- }
148067
- return false;
148068
- };
148168
+ const $unwatch$1 = identifier => registry$1.delete(identifier);
148169
+ window.watchRegistry = registry$1;
148069
148170
  const $appDigest$1 = (() => {
148070
- return (force = false) => {
148171
+ return (force) => {
148071
148172
  {
148072
148173
  return;
148073
148174
  }
148074
148175
  };
148075
148176
  })();
148076
- // Export registry for debugging
148077
- window.watchRegistry = registry$1;
148078
148177
 
148079
148178
  var ComponentType$1;
148080
148179
  (function (ComponentType) {
@@ -148130,8 +148229,8 @@ var Operation$1;
148130
148229
  const DataSource$1 = {
148131
148230
  Operation: Operation$1
148132
148231
  };
148133
- let App$1 = class App {
148134
- };
148232
+ class App {
148233
+ }
148135
148234
  let AbstractI18nService$1 = class AbstractI18nService {
148136
148235
  };
148137
148236
 
@@ -148149,7 +148248,6 @@ const REGEX$1 = {
148149
148248
  SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
148150
148249
  SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
148151
148250
  VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
148152
- VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
148153
148251
  REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
148154
148252
  DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
148155
148253
  ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
@@ -148372,9 +148470,6 @@ const isVideoFile$1 = (fileName) => {
148372
148470
  const isValidWebURL$1 = (url) => {
148373
148471
  return (REGEX$1.VALID_WEB_URL).test(url);
148374
148472
  };
148375
- const isValidImageUrl$1 = (url) => {
148376
- return (REGEX$1.VALID_IMAGE_URL).test(url?.trim());
148377
- };
148378
148473
  /*This function returns the url to the resource after checking the validity of url*/
148379
148474
  const getResourceURL$1 = (urlString) => {
148380
148475
  return urlString;
@@ -149628,7 +149723,6 @@ var Utils$1 = /*#__PURE__*/Object.freeze({
149628
149723
  isPageable: isPageable$1,
149629
149724
  isSafari: isSafari$1,
149630
149725
  isTablet: isTablet$1,
149631
- isValidImageUrl: isValidImageUrl$1,
149632
149726
  isValidWebURL: isValidWebURL$1,
149633
149727
  isVideoFile: isVideoFile$1,
149634
149728
  loadScript: loadScript$1,
@@ -149722,10 +149816,7 @@ let EventNotifier$1 = class EventNotifier {
149722
149816
  return noop$6;
149723
149817
  }
149724
149818
  destroy() {
149725
- this._subject.next(null); // optional
149726
- this._subject.complete(); // clears all observers
149727
- this._isInitialized = false;
149728
- this._eventsBeforeInit = [];
149819
+ this._subject.complete();
149729
149820
  }
149730
149821
  };
149731
149822
  let MINIMUM_TAB_WIDTH$1 = 768;
@@ -149740,11 +149831,9 @@ let Viewport$1 = class Viewport {
149740
149831
  this.isTabletType = false;
149741
149832
  this._eventNotifier = new EventNotifier$1(true);
149742
149833
  this.setScreenType();
149743
- // MEMORY LEAK FIX: Store bound function reference for proper removal
149744
- this.boundResizeFn = this.resizeFn.bind(this);
149745
- window.addEventListener("resize" /* ViewportEvent.RESIZE */, this.boundResizeFn);
149746
- this.mediaQuery = window.matchMedia('(orientation: portrait)');
149747
- if (this.mediaQuery.matches) {
149834
+ window.addEventListener("resize" /* ViewportEvent.RESIZE */, this.resizeFn.bind(this));
149835
+ const query = window.matchMedia('(orientation: portrait)');
149836
+ if (query.matches) {
149748
149837
  this.orientation.isPortrait = true;
149749
149838
  }
149750
149839
  else {
@@ -149752,10 +149841,8 @@ let Viewport$1 = class Viewport {
149752
149841
  }
149753
149842
  // Add a media query change listener
149754
149843
  // addEventListener is not supported ios browser
149755
- if (this.mediaQuery.addEventListener) {
149756
- // MEMORY LEAK FIX: Store bound function reference for proper removal
149757
- this.boundOrientationChange = ($event) => this.orientationChange($event, !$event.matches);
149758
- this.mediaQuery.addEventListener('change', this.boundOrientationChange);
149844
+ if (query.addEventListener) {
149845
+ query.addEventListener('change', $event => this.orientationChange($event, !$event.matches));
149759
149846
  }
149760
149847
  }
149761
149848
  update(selectedViewPort) {
@@ -149782,14 +149869,14 @@ let Viewport$1 = class Viewport {
149782
149869
  return this._eventNotifier.subscribe(eventName, callback);
149783
149870
  }
149784
149871
  notify(eventName, ...data) {
149785
- this._eventNotifier.notify(eventName, ...data);
149872
+ this._eventNotifier.notify.apply(this._eventNotifier, arguments);
149786
149873
  }
149787
149874
  setScreenType() {
149788
149875
  const $el = document.querySelector('.wm-app');
149789
149876
  this.screenWidth = $el.clientWidth;
149790
149877
  this.screenHeight = $el.clientHeight;
149791
- // const minValue = this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight;
149792
- // const maxValue = this.screenWidth > this.screenHeight ? this.screenWidth : this.screenHeight;
149878
+ this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight;
149879
+ this.screenWidth > this.screenHeight ? this.screenWidth : this.screenHeight;
149793
149880
  this.isTabletType = false;
149794
149881
  this.isMobileType = false;
149795
149882
  if (get$2(this.selectedViewPort, 'deviceCategory')) {
@@ -149821,17 +149908,7 @@ let Viewport$1 = class Viewport {
149821
149908
  }
149822
149909
  ngOnDestroy() {
149823
149910
  this._eventNotifier.destroy();
149824
- // MEMORY LEAK FIX: Remove resize event listener using stored bound function reference
149825
- if (this.boundResizeFn) {
149826
- window.removeEventListener('resize', this.boundResizeFn);
149827
- this.boundResizeFn = null;
149828
- }
149829
- // MEMORY LEAK FIX: Remove media query orientation change listener
149830
- if (this.mediaQuery && this.boundOrientationChange && this.mediaQuery.removeEventListener) {
149831
- this.mediaQuery.removeEventListener('change', this.boundOrientationChange);
149832
- this.boundOrientationChange = null;
149833
- }
149834
- this.mediaQuery = null;
149911
+ window.removeEventListener('resize', this.resizeFn);
149835
149912
  }
149836
149913
  static { this.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Viewport, deps: [], target: FactoryTarget$2.Injectable }); }
149837
149914
  static { this.ɵprov = ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Viewport, providedIn: 'root' }); }
@@ -150887,7 +150964,7 @@ class ToDatePipe extends WmPipe {
150887
150964
  this.app = app;
150888
150965
  this.customPipeManager = customPipeManager;
150889
150966
  }
150890
- 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)); }; }
150967
+ static { this.ɵfac = function ToDatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ToDatePipe)(ɵɵdirectiveInject(DatePipe, 16), ɵɵdirectiveInject(AbstractI18nService$1, 16), ɵɵdirectiveInject(App, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
150891
150968
  static { this.ɵpipe = /*@__PURE__*/ ɵɵdefinePipe({ name: "toDate", type: ToDatePipe, pure: true, standalone: true }); }
150892
150969
  }
150893
150970
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ToDatePipe, [{
@@ -150896,7 +150973,7 @@ class ToDatePipe extends WmPipe {
150896
150973
  standalone: true,
150897
150974
  name: 'toDate'
150898
150975
  }]
150899
- }], () => [{ type: DatePipe }, { type: AbstractI18nService$1 }, { type: App$1 }, { type: CustomPipeManager$1 }], null); })();
150976
+ }], () => [{ type: DatePipe }, { type: AbstractI18nService$1 }, { type: App }, { type: CustomPipeManager$1 }], null); })();
150900
150977
  class ToNumberPipe {
150901
150978
  transform(data, fracSize) {
150902
150979
  if (fracSize && !String(fracSize).match(/^(\d+)?\.((\d+)(-(\d+))?)?$/)) {
@@ -151006,7 +151083,7 @@ class CustomPipe {
151006
151083
  return data;
151007
151084
  }
151008
151085
  }
151009
- static { this.ɵfac = function CustomPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomPipe)(ɵɵdirectiveInject(App$1, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
151086
+ static { this.ɵfac = function CustomPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CustomPipe)(ɵɵdirectiveInject(App, 16), ɵɵdirectiveInject(CustomPipeManager$1, 16)); }; }
151010
151087
  static { this.ɵpipe = /*@__PURE__*/ ɵɵdefinePipe({ name: "custom", type: CustomPipe, pure: true, standalone: true }); }
151011
151088
  }
151012
151089
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(CustomPipe, [{
@@ -151015,7 +151092,7 @@ class CustomPipe {
151015
151092
  standalone: true,
151016
151093
  name: 'custom'
151017
151094
  }]
151018
- }], () => [{ type: App$1 }, { type: CustomPipeManager$1 }], null); })();
151095
+ }], () => [{ type: App }, { type: CustomPipeManager$1 }], null); })();
151019
151096
  class TimeFromNowPipe {
151020
151097
  transform(data) {
151021
151098
  let timestamp;
@@ -158882,14 +158959,14 @@ function createNgModuleType(meta) {
158882
158959
  if (meta.kind === R3NgModuleMetadataKind.Local) {
158883
158960
  return new ExpressionType$1(meta.type.value);
158884
158961
  }
158885
- const { type: moduleType, declarations, exports: exports$1, imports, includeImportTypes, publicDeclarationTypes, } = meta;
158962
+ const { type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes, } = meta;
158886
158963
  return new ExpressionType$1(importExpr(Identifiers.NgModuleDeclaration, [
158887
158964
  new ExpressionType$1(moduleType.type),
158888
158965
  publicDeclarationTypes === null
158889
158966
  ? tupleTypeOf(declarations)
158890
158967
  : tupleOfTypes(publicDeclarationTypes),
158891
158968
  includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE,
158892
- tupleTypeOf(exports$1),
158969
+ tupleTypeOf(exports),
158893
158970
  ]));
158894
158971
  }
158895
158972
  /**
@@ -188151,14 +188228,14 @@ function requireDom () {
188151
188228
  ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
188152
188229
  var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
188153
188230
  ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
188154
- ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
188231
+ var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
188155
188232
  ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
188156
188233
  ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
188157
188234
  var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
188158
188235
  ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
188159
188236
  var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
188160
188237
  //level2
188161
- ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
188238
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
188162
188239
  ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
188163
188240
  ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
188164
188241
  ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
@@ -188208,9 +188285,10 @@ function requireDom () {
188208
188285
  item: function(index) {
188209
188286
  return index >= 0 && index < this.length ? this[index] : null;
188210
188287
  },
188211
- toString:function(isHTML,nodeFilter){
188288
+ toString:function(isHTML,nodeFilter,options){
188289
+ var requireWellFormed = !!options && !!options.requireWellFormed;
188212
188290
  for(var buf = [], i = 0;i<this.length;i++){
188213
- serializeToString(this[i],buf,isHTML,nodeFilter);
188291
+ serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
188214
188292
  }
188215
188293
  return buf.join('');
188216
188294
  },
@@ -188455,13 +188533,28 @@ function requireDom () {
188455
188533
  /**
188456
188534
  * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
188457
188535
  *
188458
- * __This behavior is slightly different from the in the specs__:
188536
+ * __This implementation differs from the specification:__
188459
188537
  * - this implementation is not validating names or qualified names
188460
188538
  * (when parsing XML strings, the SAX parser takes care of that)
188461
188539
  *
188540
+ * Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
188541
+ * Creation-time validation of `publicId`, `systemId` is not enforced.
188542
+ * The serializer-level check covers all mutation vectors, including direct property writes.
188543
+ * `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
188544
+ * absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
188545
+ * silently omitted from the serialized output.
188546
+ *
188462
188547
  * @param {string} qualifiedName
188463
188548
  * @param {string} [publicId]
188549
+ * The external subset public identifier. Stored verbatim including surrounding quotes.
188550
+ * When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
188551
+ * throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
188552
+ * not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
188464
188553
  * @param {string} [systemId]
188554
+ * The external subset system identifier. Stored verbatim including surrounding quotes.
188555
+ * When serialized with `requireWellFormed: true`, throws `DOMException` with code
188556
+ * `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
188557
+ * production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
188465
188558
  * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
188466
188559
  * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
188467
188560
  *
@@ -188527,18 +188620,44 @@ function requireDom () {
188527
188620
  return cloneNode(this.ownerDocument||this,this,deep);
188528
188621
  },
188529
188622
  // Modified in DOM Level 2:
188530
- normalize:function(){
188531
- var child = this.firstChild;
188532
- while(child){
188533
- var next = child.nextSibling;
188534
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
188535
- this.removeChild(next);
188536
- child.appendData(next.data);
188537
- }else {
188538
- child.normalize();
188539
- child = next;
188540
- }
188541
- }
188623
+ /**
188624
+ * Puts the specified node and all of its subtree into a "normalized" form. In a normalized
188625
+ * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
188626
+ *
188627
+ * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
188628
+ * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
188629
+ * nodes.
188630
+ *
188631
+ * This method iteratively traverses all child nodes to normalize all descendant nodes within
188632
+ * the subtree.
188633
+ *
188634
+ * @throws {DOMException}
188635
+ * May throw a DOMException if operations within removeChild or appendData (which are
188636
+ * potentially invoked in this method) do not meet their specific constraints.
188637
+ * @see {@link Node.removeChild}
188638
+ * @see {@link CharacterData.appendData}
188639
+ * @see ../docs/walk-dom.md.
188640
+ */
188641
+ normalize: function () {
188642
+ walkDOM(this, null, {
188643
+ enter: function (node) {
188644
+ // Merge adjacent text children of node before walkDOM schedules them.
188645
+ // walkDOM reads lastChild/previousSibling after enter returns, so the
188646
+ // surviving post-merge children are what it descends into.
188647
+ var child = node.firstChild;
188648
+ while (child) {
188649
+ var next = child.nextSibling;
188650
+ if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
188651
+ node.removeChild(next);
188652
+ child.appendData(next.data);
188653
+ // Do not advance child: re-check new nextSibling for another text run
188654
+ } else {
188655
+ child = next;
188656
+ }
188657
+ }
188658
+ return true; // descend into surviving children
188659
+ },
188660
+ });
188542
188661
  },
188543
188662
  // Introduced in DOM Level 2:
188544
188663
  isSupported:function(feature, version){
@@ -188614,21 +188733,103 @@ function requireDom () {
188614
188733
  copy(NodeType,Node.prototype);
188615
188734
 
188616
188735
  /**
188617
- * @param callback return true for continue,false for break
188618
- * @return boolean true: break visit;
188736
+ * @param {Node} node
188737
+ * Root of the subtree to visit.
188738
+ * @param {function(Node): boolean} callback
188739
+ * Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
188740
+ * @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
188619
188741
  */
188620
- function _visitNode(node,callback){
188621
- if(callback(node)){
188622
- return true;
188623
- }
188624
- if(node = node.firstChild){
188625
- do{
188626
- if(_visitNode(node,callback)){return true}
188627
- }while(node=node.nextSibling)
188628
- }
188742
+ function _visitNode(node, callback) {
188743
+ return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
188629
188744
  }
188630
188745
 
188746
+ /**
188747
+ * Depth-first pre/post-order DOM tree walker.
188748
+ *
188749
+ * Visits every node in the subtree rooted at `node`. For each node:
188750
+ *
188751
+ * 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
188752
+ * return value becomes the `context` passed to each child's `enter` call and to the matching
188753
+ * `exit` call.
188754
+ * 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
188755
+ * sibling traversal continues normally.
188756
+ * 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
188757
+ * further `enter` or `exit` calls are made.
188758
+ * 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
188759
+ * safely modify the node's own child list before the walker descends. Modifying siblings of
188760
+ * the current node or any other part of the tree produces unpredictable results: nodes already
188761
+ * queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
188762
+ * the current child list are never visited.
188763
+ * 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
188764
+ * been visited, passing the same `context` that `enter`
188765
+ * returned for that node.
188766
+ *
188767
+ * This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
188768
+ * deep trees.
188769
+ *
188770
+ * @param {Node} node
188771
+ * Root of the subtree to walk.
188772
+ * @param {*} context
188773
+ * Initial context value passed to the root node's `enter`.
188774
+ * @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
188775
+ * @returns {void | walkDOM.STOP}
188776
+ * @see ../docs/walk-dom.md.
188777
+ */
188778
+ function walkDOM(node, context, callbacks) {
188779
+ // Each stack frame is {node, context, phase}:
188780
+ // walkDOM.ENTER — call enter, then push children
188781
+ // walkDOM.EXIT — call exit
188782
+ var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
188783
+ while (stack.length > 0) {
188784
+ var frame = stack.pop();
188785
+ if (frame.phase === walkDOM.ENTER) {
188786
+ var childContext = callbacks.enter(frame.node, frame.context);
188787
+ if (childContext === walkDOM.STOP) {
188788
+ return walkDOM.STOP;
188789
+ }
188790
+ // Push exit frame before children so it fires after all children are processed (Last In First Out)
188791
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
188792
+ if (childContext === null || childContext === undefined) {
188793
+ continue; // skip children
188794
+ }
188795
+ // lastChild is read after enter returns, so enter may modify the child list.
188796
+ var child = frame.node.lastChild;
188797
+ // Traverse from lastChild backwards so that pushing onto the stack
188798
+ // naturally yields firstChild on top (processed first).
188799
+ while (child) {
188800
+ stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
188801
+ child = child.previousSibling;
188802
+ }
188803
+ } else {
188804
+ // frame.phase === walkDOM.EXIT
188805
+ if (callbacks.exit) {
188806
+ callbacks.exit(frame.node, frame.context);
188807
+ }
188808
+ }
188809
+ }
188810
+ }
188631
188811
 
188812
+ /**
188813
+ * Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
188814
+ * immediately.
188815
+ *
188816
+ * @type {symbol}
188817
+ */
188818
+ walkDOM.STOP = Symbol('walkDOM.STOP');
188819
+ /**
188820
+ * Phase constant for a stack frame that has not yet been visited.
188821
+ * The `enter` callback is called and children are scheduled.
188822
+ *
188823
+ * @type {number}
188824
+ */
188825
+ walkDOM.ENTER = 0;
188826
+ /**
188827
+ * Phase constant for a stack frame whose subtree has been fully visited.
188828
+ * The `exit` callback is called.
188829
+ *
188830
+ * @type {number}
188831
+ */
188832
+ walkDOM.EXIT = 1;
188632
188833
 
188633
188834
  function Document(){
188634
188835
  this.ownerDocument = this;
@@ -189232,12 +189433,44 @@ function requireDom () {
189232
189433
  node.appendData(data);
189233
189434
  return node;
189234
189435
  },
189436
+ /**
189437
+ * Returns a new CDATASection node whose data is `data`.
189438
+ *
189439
+ * __This implementation differs from the specification:__
189440
+ * - calling this method on an HTML document does not throw `NotSupportedError`.
189441
+ *
189442
+ * @param {string} data
189443
+ * @returns {CDATASection}
189444
+ * @throws DOMException with code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
189445
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
189446
+ * @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
189447
+ */
189235
189448
  createCDATASection : function(data){
189449
+ if (data.indexOf(']]>') !== -1) {
189450
+ throw new DOMException(INVALID_CHARACTER_ERR, 'data contains "]]>"');
189451
+ }
189236
189452
  var node = new CDATASection();
189237
189453
  node.ownerDocument = this;
189238
189454
  node.appendData(data);
189239
189455
  return node;
189240
189456
  },
189457
+ /**
189458
+ * Returns a ProcessingInstruction node whose target is target and data is data.
189459
+ *
189460
+ * __This implementation differs from the specification:__
189461
+ * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
189462
+ *
189463
+ * Note: When the resulting document is serialized with `requireWellFormed: true`, the
189464
+ * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
189465
+ * §3.2.1.7). Without that option the data is emitted verbatim.
189466
+ *
189467
+ * @param {string} target
189468
+ * @param {string} data
189469
+ * @returns {ProcessingInstruction}
189470
+ * @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
189471
+ * @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
189472
+ * @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
189473
+ */
189241
189474
  createProcessingInstruction : function(target,data){
189242
189475
  var node = new ProcessingInstruction();
189243
189476
  node.ownerDocument = this;
@@ -189463,6 +189696,19 @@ function requireDom () {
189463
189696
  _extends(CDATASection,CharacterData);
189464
189697
 
189465
189698
 
189699
+ /**
189700
+ * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
189701
+ *
189702
+ * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
189703
+ * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
189704
+ * direct property writes succeed silently. Values are serialized verbatim when
189705
+ * `requireWellFormed` is false (the default). When the serializer is invoked with
189706
+ * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
189707
+ * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
189708
+ *
189709
+ * @class
189710
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
189711
+ */
189466
189712
  function DocumentType() {
189467
189713
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
189468
189714
  _extends(DocumentType,Node);
@@ -189490,11 +189736,48 @@ function requireDom () {
189490
189736
  ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
189491
189737
  _extends(ProcessingInstruction,Node);
189492
189738
  function XMLSerializer(){}
189493
- XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
189494
- return nodeSerializeToString.call(node,isHtml,nodeFilter);
189739
+ /**
189740
+ * Returns the result of serializing `node` to XML.
189741
+ *
189742
+ * When `options.requireWellFormed` is `true`, the serializer throws for content that would
189743
+ * produce ill-formed XML.
189744
+ *
189745
+ * __This implementation differs from the specification:__
189746
+ * - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
189747
+ * at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
189748
+ * default behaviour) unless `requireWellFormed` is `true`.
189749
+ * - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
189750
+ * is only thrown to prevent injection vectors, not for all the spec mandated checks.
189751
+ *
189752
+ * @param {Node} node
189753
+ * @param {boolean} [isHtml]
189754
+ * @param {function} [nodeFilter]
189755
+ * @param {Object} [options]
189756
+ * @param {boolean} [options.requireWellFormed=false]
189757
+ * When `true`, throws for content that would produce ill-formed XML.
189758
+ * @returns {string}
189759
+ * @throws {DOMException}
189760
+ * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
189761
+ * - a CDATASection node's data contains `"]]>"`,
189762
+ * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
189763
+ * - a ProcessingInstruction's data contains `"?>"`,
189764
+ * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
189765
+ * production,
189766
+ * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
189767
+ * production, or
189768
+ * - a DocumentType's `internalSubset` contains `"]>"`.
189769
+ * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
189770
+ * writes succeed and are covered by the serializer-level checks above.
189771
+ * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
189772
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serialization
189773
+ * @see https://github.com/w3c/DOM-Parsing/issues/84
189774
+ */
189775
+ XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
189776
+ return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
189495
189777
  };
189496
189778
  Node.prototype.toString = nodeSerializeToString;
189497
- function nodeSerializeToString(isHtml,nodeFilter){
189779
+ function nodeSerializeToString(isHtml,nodeFilter,options){
189780
+ var requireWellFormed = !!options && !!options.requireWellFormed;
189498
189781
  var buf = [];
189499
189782
  var refNode = this.nodeType == 9 && this.documentElement || this;
189500
189783
  var prefix = refNode.prefix;
@@ -189511,7 +189794,7 @@ function requireDom () {
189511
189794
  ];
189512
189795
  }
189513
189796
  }
189514
- serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
189797
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
189515
189798
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
189516
189799
  return buf.join('');
189517
189800
  }
@@ -189560,271 +189843,323 @@ function requireDom () {
189560
189843
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
189561
189844
  }
189562
189845
 
189563
- function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
189846
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
189564
189847
  if (!visibleNamespaces) {
189565
189848
  visibleNamespaces = [];
189566
189849
  }
189567
-
189568
- if(nodeFilter){
189569
- node = nodeFilter(node);
189570
- if(node){
189571
- if(typeof node == 'string'){
189572
- buf.push(node);
189573
- return;
189574
- }
189575
- }else {
189576
- return;
189577
- }
189578
- //buf.sort.apply(attrs, attributeSorter);
189579
- }
189580
-
189581
- switch(node.nodeType){
189582
- case ELEMENT_NODE:
189583
- var attrs = node.attributes;
189584
- var len = attrs.length;
189585
- var child = node.firstChild;
189586
- var nodeName = node.tagName;
189587
-
189588
- isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
189589
-
189590
- var prefixedNodeName = nodeName;
189591
- if (!isHTML && !node.prefix && node.namespaceURI) {
189592
- var defaultNS;
189593
- // lookup current default ns from `xmlns` attribute
189594
- for (var ai = 0; ai < attrs.length; ai++) {
189595
- if (attrs.item(ai).name === 'xmlns') {
189596
- defaultNS = attrs.item(ai).value;
189597
- break
189598
- }
189599
- }
189600
- if (!defaultNS) {
189601
- // lookup current default ns in visibleNamespaces
189602
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
189603
- var namespace = visibleNamespaces[nsi];
189604
- if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
189605
- defaultNS = namespace.namespace;
189606
- break
189850
+ walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
189851
+ enter: function (n, ctx) {
189852
+ var ns = ctx.ns;
189853
+ var html = ctx.isHTML;
189854
+
189855
+ if (nodeFilter) {
189856
+ n = nodeFilter(n);
189857
+ if (n) {
189858
+ if (typeof n == 'string') {
189859
+ buf.push(n);
189860
+ return null;
189607
189861
  }
189862
+ } else {
189863
+ return null;
189608
189864
  }
189609
189865
  }
189610
- if (defaultNS !== node.namespaceURI) {
189611
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
189612
- var namespace = visibleNamespaces[nsi];
189613
- if (namespace.namespace === node.namespaceURI) {
189614
- if (namespace.prefix) {
189615
- prefixedNodeName = namespace.prefix + ':' + nodeName;
189866
+
189867
+ switch (n.nodeType) {
189868
+ case ELEMENT_NODE:
189869
+ var attrs = n.attributes;
189870
+ var len = attrs.length;
189871
+ var nodeName = n.tagName;
189872
+
189873
+ html = NAMESPACE.isHTML(n.namespaceURI) || html;
189874
+
189875
+ var prefixedNodeName = nodeName;
189876
+ if (!html && !n.prefix && n.namespaceURI) {
189877
+ var defaultNS;
189878
+ // lookup current default ns from `xmlns` attribute
189879
+ for (var ai = 0; ai < attrs.length; ai++) {
189880
+ if (attrs.item(ai).name === 'xmlns') {
189881
+ defaultNS = attrs.item(ai).value;
189882
+ break;
189883
+ }
189884
+ }
189885
+ if (!defaultNS) {
189886
+ // lookup current default ns in visibleNamespaces
189887
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
189888
+ var nsEntry = ns[nsi];
189889
+ if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
189890
+ defaultNS = nsEntry.namespace;
189891
+ break;
189892
+ }
189893
+ }
189894
+ }
189895
+ if (defaultNS !== n.namespaceURI) {
189896
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
189897
+ var nsEntry = ns[nsi];
189898
+ if (nsEntry.namespace === n.namespaceURI) {
189899
+ if (nsEntry.prefix) {
189900
+ prefixedNodeName = nsEntry.prefix + ':' + nodeName;
189901
+ }
189902
+ break;
189903
+ }
189904
+ }
189616
189905
  }
189617
- break
189618
189906
  }
189619
- }
189620
- }
189621
- }
189622
189907
 
189623
- buf.push('<', prefixedNodeName);
189908
+ buf.push('<', prefixedNodeName);
189909
+
189910
+ // Build a fresh namespace snapshot for this element's children.
189911
+ // The slice prevents sibling elements from inheriting each other's declarations.
189912
+ var childNs = ns.slice();
189913
+ for (var i = 0; i < len; i++) {
189914
+ var attr = attrs.item(i);
189915
+ if (attr.prefix == 'xmlns') {
189916
+ childNs.push({ prefix: attr.localName, namespace: attr.value });
189917
+ } else if (attr.nodeName == 'xmlns') {
189918
+ childNs.push({ prefix: '', namespace: attr.value });
189919
+ }
189920
+ }
189624
189921
 
189625
- for(var i=0;i<len;i++){
189626
- // add namespaces for attributes
189627
- var attr = attrs.item(i);
189628
- if (attr.prefix == 'xmlns') {
189629
- visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
189630
- }else if(attr.nodeName == 'xmlns'){
189631
- visibleNamespaces.push({ prefix: '', namespace: attr.value });
189632
- }
189633
- }
189922
+ for (var i = 0; i < len; i++) {
189923
+ var attr = attrs.item(i);
189924
+ if (needNamespaceDefine(attr, html, childNs)) {
189925
+ var attrPrefix = attr.prefix || '';
189926
+ var uri = attr.namespaceURI;
189927
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
189928
+ childNs.push({ prefix: attrPrefix, namespace: uri });
189929
+ }
189930
+ // Apply nodeFilter and serialize the attribute.
189931
+ var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
189932
+ if (filteredAttr) {
189933
+ if (typeof filteredAttr === 'string') {
189934
+ buf.push(filteredAttr);
189935
+ } else {
189936
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
189937
+ }
189938
+ }
189939
+ }
189634
189940
 
189635
- for(var i=0;i<len;i++){
189636
- var attr = attrs.item(i);
189637
- if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
189638
- var prefix = attr.prefix||'';
189639
- var uri = attr.namespaceURI;
189640
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
189641
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
189642
- }
189643
- serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
189644
- }
189941
+ // add namespace for current node
189942
+ if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
189943
+ var nodePrefix = n.prefix || '';
189944
+ var uri = n.namespaceURI;
189945
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
189946
+ childNs.push({ prefix: nodePrefix, namespace: uri });
189947
+ }
189645
189948
 
189646
- // add namespace for current node
189647
- if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
189648
- var prefix = node.prefix||'';
189649
- var uri = node.namespaceURI;
189650
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
189651
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
189652
- }
189949
+ var child = n.firstChild;
189950
+ if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
189951
+ buf.push('>');
189952
+ if (html && /^script$/i.test(nodeName)) {
189953
+ // Inline serialization for <script> children; return null to skip walkDOM descent.
189954
+ while (child) {
189955
+ if (child.data) {
189956
+ buf.push(child.data);
189957
+ } else {
189958
+ serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
189959
+ }
189960
+ child = child.nextSibling;
189961
+ }
189962
+ buf.push('</', nodeName, '>');
189963
+ return null;
189964
+ }
189965
+ // Return child context; walkDOM descends and exit emits the closing tag.
189966
+ return { ns: childNs, isHTML: html, tag: prefixedNodeName };
189967
+ } else {
189968
+ buf.push('/>');
189969
+ return null;
189970
+ }
189653
189971
 
189654
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
189655
- buf.push('>');
189656
- //if is cdata child node
189657
- if(isHTML && /^script$/i.test(nodeName)){
189658
- while(child){
189659
- if(child.data){
189660
- buf.push(child.data);
189661
- }else {
189662
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
189972
+ case DOCUMENT_NODE:
189973
+ case DOCUMENT_FRAGMENT_NODE:
189974
+ // Descend into children; exit is a no-op (tag is null).
189975
+ return { ns: ns.slice(), isHTML: html, tag: null };
189976
+
189977
+ case ATTRIBUTE_NODE:
189978
+ addSerializedAttribute(buf, n.name, n.value);
189979
+ return null;
189980
+
189981
+ case TEXT_NODE:
189982
+ /**
189983
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
189984
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
189985
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
189986
+ * `&amp;` and `&lt;` respectively.
189987
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
189988
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
189989
+ * when that string is not marking the end of a CDATA section.
189990
+ *
189991
+ * In the content of elements, character data is any string of characters
189992
+ * which does not contain the start-delimiter of any markup
189993
+ * and does not include the CDATA-section-close delimiter, `]]>`.
189994
+ *
189995
+ * @see https://www.w3.org/TR/xml/#NT-CharData
189996
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
189997
+ */
189998
+ buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
189999
+ return null;
190000
+
190001
+ case CDATA_SECTION_NODE:
190002
+ if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
190003
+ throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
189663
190004
  }
189664
- child = child.nextSibling;
189665
- }
189666
- }else
189667
- {
189668
- while(child){
189669
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
189670
- child = child.nextSibling;
189671
- }
189672
- }
189673
- buf.push('</',prefixedNodeName,'>');
189674
- }else {
189675
- buf.push('/>');
189676
- }
189677
- // remove added visible namespaces
189678
- //visibleNamespaces.length = startVisibleNamespaces;
189679
- return;
189680
- case DOCUMENT_NODE:
189681
- case DOCUMENT_FRAGMENT_NODE:
189682
- var child = node.firstChild;
189683
- while(child){
189684
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
189685
- child = child.nextSibling;
189686
- }
189687
- return;
189688
- case ATTRIBUTE_NODE:
189689
- return addSerializedAttribute(buf, node.name, node.value);
189690
- case TEXT_NODE:
189691
- /**
189692
- * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
189693
- * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
189694
- * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
189695
- * `&amp;` and `&lt;` respectively.
189696
- * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
189697
- * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
189698
- * when that string is not marking the end of a CDATA section.
189699
- *
189700
- * In the content of elements, character data is any string of characters
189701
- * which does not contain the start-delimiter of any markup
189702
- * and does not include the CDATA-section-close delimiter, `]]>`.
189703
- *
189704
- * @see https://www.w3.org/TR/xml/#NT-CharData
189705
- * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
189706
- */
189707
- return buf.push(node.data
189708
- .replace(/[<&>]/g,_xmlEncoder)
189709
- );
189710
- case CDATA_SECTION_NODE:
189711
- return buf.push( '<![CDATA[',node.data,']]>');
189712
- case COMMENT_NODE:
189713
- return buf.push( "<!--",node.data,"-->");
189714
- case DOCUMENT_TYPE_NODE:
189715
- var pubid = node.publicId;
189716
- var sysid = node.systemId;
189717
- buf.push('<!DOCTYPE ',node.name);
189718
- if(pubid){
189719
- buf.push(' PUBLIC ', pubid);
189720
- if (sysid && sysid!='.') {
189721
- buf.push(' ', sysid);
190005
+ buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
190006
+ return null;
190007
+
190008
+ case COMMENT_NODE:
190009
+ if (requireWellFormed && n.data.indexOf('-->') !== -1) {
190010
+ throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
190011
+ }
190012
+ buf.push('<!--', n.data, '-->');
190013
+ return null;
190014
+
190015
+ case DOCUMENT_TYPE_NODE:
190016
+ if (requireWellFormed) {
190017
+ if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
190018
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
190019
+ }
190020
+ if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
190021
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
190022
+ }
190023
+ if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
190024
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
190025
+ }
190026
+ }
190027
+ var pubid = n.publicId;
190028
+ var sysid = n.systemId;
190029
+ buf.push('<!DOCTYPE ', n.name);
190030
+ if (pubid) {
190031
+ buf.push(' PUBLIC ', pubid);
190032
+ if (sysid && sysid != '.') {
190033
+ buf.push(' ', sysid);
190034
+ }
190035
+ buf.push('>');
190036
+ } else if (sysid && sysid != '.') {
190037
+ buf.push(' SYSTEM ', sysid, '>');
190038
+ } else {
190039
+ var sub = n.internalSubset;
190040
+ if (sub) {
190041
+ buf.push(' [', sub, ']');
190042
+ }
190043
+ buf.push('>');
190044
+ }
190045
+ return null;
190046
+
190047
+ case PROCESSING_INSTRUCTION_NODE:
190048
+ if (requireWellFormed && n.data.indexOf('?>') !== -1) {
190049
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
190050
+ }
190051
+ buf.push('<?', n.target, ' ', n.data, '?>');
190052
+ return null;
190053
+
190054
+ case ENTITY_REFERENCE_NODE:
190055
+ buf.push('&', n.nodeName, ';');
190056
+ return null;
190057
+
190058
+ //case ENTITY_NODE:
190059
+ //case NOTATION_NODE:
190060
+ default:
190061
+ buf.push('??', n.nodeName);
190062
+ return null;
189722
190063
  }
189723
- buf.push('>');
189724
- }else if(sysid && sysid!='.'){
189725
- buf.push(' SYSTEM ', sysid, '>');
189726
- }else {
189727
- var sub = node.internalSubset;
189728
- if(sub){
189729
- buf.push(" [",sub,"]");
190064
+ },
190065
+ exit: function (n, childCtx) {
190066
+ if (childCtx && childCtx.tag) {
190067
+ buf.push('</', childCtx.tag, '>');
189730
190068
  }
189731
- buf.push(">");
189732
- }
189733
- return;
189734
- case PROCESSING_INSTRUCTION_NODE:
189735
- return buf.push( "<?",node.target," ",node.data,"?>");
189736
- case ENTITY_REFERENCE_NODE:
189737
- return buf.push( '&',node.nodeName,';');
189738
- //case ENTITY_NODE:
189739
- //case NOTATION_NODE:
189740
- default:
189741
- buf.push('??',node.nodeName);
189742
- }
190069
+ },
190070
+ });
189743
190071
  }
189744
- function importNode(doc,node,deep){
189745
- var node2;
189746
- switch (node.nodeType) {
189747
- case ELEMENT_NODE:
189748
- node2 = node.cloneNode(false);
189749
- node2.ownerDocument = doc;
189750
- //var attrs = node2.attributes;
189751
- //var len = attrs.length;
189752
- //for(var i=0;i<len;i++){
189753
- //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
189754
- //}
189755
- case DOCUMENT_FRAGMENT_NODE:
189756
- break;
189757
- case ATTRIBUTE_NODE:
189758
- deep = true;
189759
- break;
189760
- //case ENTITY_REFERENCE_NODE:
189761
- //case PROCESSING_INSTRUCTION_NODE:
189762
- ////case TEXT_NODE:
189763
- //case CDATA_SECTION_NODE:
189764
- //case COMMENT_NODE:
189765
- // deep = false;
189766
- // break;
189767
- //case DOCUMENT_NODE:
189768
- //case DOCUMENT_TYPE_NODE:
189769
- //cannot be imported.
189770
- //case ENTITY_NODE:
189771
- //case NOTATION_NODE:
189772
- //can not hit in level3
189773
- //default:throw e;
189774
- }
189775
- if(!node2){
189776
- node2 = node.cloneNode(false);//false
189777
- }
189778
- node2.ownerDocument = doc;
189779
- node2.parentNode = null;
189780
- if(deep){
189781
- var child = node.firstChild;
189782
- while(child){
189783
- node2.appendChild(importNode(doc,child,deep));
189784
- child = child.nextSibling;
189785
- }
189786
- }
189787
- return node2;
190072
+ /**
190073
+ * Imports a node from a different document into `doc`, creating a new copy.
190074
+ * Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
190075
+ * stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
190076
+ * Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
190077
+ * always forced to `true`
190078
+ * because an attribute's value lives in a child text node.
190079
+ *
190080
+ * @param {Document} doc
190081
+ * The document that will own the imported node.
190082
+ * @param {Node} node
190083
+ * The node to import.
190084
+ * @param {boolean} deep
190085
+ * If `true`, descendants are imported recursively.
190086
+ * @returns {Node}
190087
+ * The newly imported node, now owned by `doc`.
190088
+ */
190089
+ function importNode(doc, node, deep) {
190090
+ var destRoot;
190091
+ walkDOM(node, null, {
190092
+ enter: function (srcNode, destParent) {
190093
+ // Shallow-clone the node and stamp it into the target document.
190094
+ var destNode = srcNode.cloneNode(false);
190095
+ destNode.ownerDocument = doc;
190096
+ destNode.parentNode = null;
190097
+ // capture as the root of the imported subtree or attach to parent.
190098
+ if (destParent === null) {
190099
+ destRoot = destNode;
190100
+ } else {
190101
+ destParent.appendChild(destNode);
190102
+ }
190103
+ // ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
190104
+ var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
190105
+ return shouldDeep ? destNode : null;
190106
+ },
190107
+ });
190108
+ return destRoot;
189788
190109
  }
189789
190110
  //
189790
190111
  //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
189791
190112
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
189792
- function cloneNode(doc,node,deep){
189793
- var node2 = new node.constructor();
189794
- for (var n in node) {
189795
- if (Object.prototype.hasOwnProperty.call(node, n)) {
189796
- var v = node[n];
189797
- if (typeof v != "object") {
189798
- if (v != node2[n]) {
189799
- node2[n] = v;
190113
+ function cloneNode(doc, node, deep) {
190114
+ var destRoot;
190115
+ walkDOM(node, null, {
190116
+ enter: function (srcNode, destParent) {
190117
+ // 1. Create a blank node of the same type and copy all scalar own properties.
190118
+ var destNode = new srcNode.constructor();
190119
+ for (var n in srcNode) {
190120
+ if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
190121
+ var v = srcNode[n];
190122
+ if (typeof v != 'object') {
190123
+ if (v != destNode[n]) {
190124
+ destNode[n] = v;
190125
+ }
190126
+ }
189800
190127
  }
189801
190128
  }
189802
- }
189803
- }
189804
- if(node.childNodes){
189805
- node2.childNodes = new NodeList();
189806
- }
189807
- node2.ownerDocument = doc;
189808
- switch (node2.nodeType) {
189809
- case ELEMENT_NODE:
189810
- var attrs = node.attributes;
189811
- var attrs2 = node2.attributes = new NamedNodeMap();
189812
- var len = attrs.length;
189813
- attrs2._ownerElement = node2;
189814
- for(var i=0;i<len;i++){
189815
- node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
189816
- }
189817
- break; case ATTRIBUTE_NODE:
189818
- deep = true;
189819
- }
189820
- if(deep){
189821
- var child = node.firstChild;
189822
- while(child){
189823
- node2.appendChild(cloneNode(doc,child,deep));
189824
- child = child.nextSibling;
189825
- }
189826
- }
189827
- return node2;
190129
+ if (srcNode.childNodes) {
190130
+ destNode.childNodes = new NodeList();
190131
+ }
190132
+ destNode.ownerDocument = doc;
190133
+ // 2. Handle node-type-specific setup.
190134
+ // Attributes are not DOM children, so they are cloned inline here
190135
+ // rather than by walkDOM descent.
190136
+ // ATTRIBUTE_NODE forces deep=true so its own children are walked.
190137
+ var shouldDeep = deep;
190138
+ switch (destNode.nodeType) {
190139
+ case ELEMENT_NODE:
190140
+ var attrs = srcNode.attributes;
190141
+ var attrs2 = (destNode.attributes = new NamedNodeMap());
190142
+ var len = attrs.length;
190143
+ attrs2._ownerElement = destNode;
190144
+ for (var i = 0; i < len; i++) {
190145
+ destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
190146
+ }
190147
+ break;
190148
+ case ATTRIBUTE_NODE:
190149
+ shouldDeep = true;
190150
+ }
190151
+ // 3. Attach to parent, or capture as the root of the cloned subtree.
190152
+ if (destParent !== null) {
190153
+ destParent.appendChild(destNode);
190154
+ } else {
190155
+ destRoot = destNode;
190156
+ }
190157
+ // 4. Return destNode as the context for children (causes walkDOM to descend),
190158
+ // or null to skip children (shallow clone).
190159
+ return shouldDeep ? destNode : null;
190160
+ },
190161
+ });
190162
+ return destRoot;
189828
190163
  }
189829
190164
 
189830
190165
  function __set__(object,key,value){
@@ -189840,49 +190175,55 @@ function requireDom () {
189840
190175
  }
189841
190176
  });
189842
190177
 
189843
- Object.defineProperty(Node.prototype,'textContent',{
189844
- get:function(){
189845
- return getTextContent(this);
190178
+ /**
190179
+ * The text content of this node and its descendants.
190180
+ *
190181
+ * Setting `textContent` on an element or document fragment replaces all child nodes with a
190182
+ * single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
190183
+ *
190184
+ * @type {string | null}
190185
+ * @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
190186
+ */
190187
+ Object.defineProperty(Node.prototype, 'textContent', {
190188
+ get: function () {
190189
+ if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
190190
+ var buf = [];
190191
+ walkDOM(this, null, {
190192
+ enter: function (n) {
190193
+ if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
190194
+ return true; // enter children
190195
+ }
190196
+ if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
190197
+ return null; // excluded from text content
190198
+ }
190199
+ buf.push(n.nodeValue);
190200
+ },
190201
+ });
190202
+ return buf.join('');
190203
+ }
190204
+ return this.nodeValue;
189846
190205
  },
189847
190206
 
189848
- set:function(data){
189849
- switch(this.nodeType){
189850
- case ELEMENT_NODE:
189851
- case DOCUMENT_FRAGMENT_NODE:
189852
- while(this.firstChild){
189853
- this.removeChild(this.firstChild);
189854
- }
189855
- if(data || String(data)){
189856
- this.appendChild(this.ownerDocument.createTextNode(data));
189857
- }
189858
- break;
190207
+ set: function (data) {
190208
+ switch (this.nodeType) {
190209
+ case ELEMENT_NODE:
190210
+ case DOCUMENT_FRAGMENT_NODE:
190211
+ while (this.firstChild) {
190212
+ this.removeChild(this.firstChild);
190213
+ }
190214
+ if (data || String(data)) {
190215
+ this.appendChild(this.ownerDocument.createTextNode(data));
190216
+ }
190217
+ break;
189859
190218
 
189860
- default:
189861
- this.data = data;
189862
- this.value = data;
189863
- this.nodeValue = data;
190219
+ default:
190220
+ this.data = data;
190221
+ this.value = data;
190222
+ this.nodeValue = data;
189864
190223
  }
189865
- }
190224
+ },
189866
190225
  });
189867
190226
 
189868
- function getTextContent(node){
189869
- switch(node.nodeType){
189870
- case ELEMENT_NODE:
189871
- case DOCUMENT_FRAGMENT_NODE:
189872
- var buf = [];
189873
- node = node.firstChild;
189874
- while(node){
189875
- if(node.nodeType!==7 && node.nodeType !==8){
189876
- buf.push(getTextContent(node));
189877
- }
189878
- node = node.nextSibling;
189879
- }
189880
- return buf.join('');
189881
- default:
189882
- return node.nodeValue;
189883
- }
189884
- }
189885
-
189886
190227
  __set__ = function(object,key,value){
189887
190228
  //console.log(value)
189888
190229
  object['$$'+key] = value;
@@ -189898,6 +190239,7 @@ function requireDom () {
189898
190239
  dom.Element = Element;
189899
190240
  dom.Node = Node;
189900
190241
  dom.NodeList = NodeList;
190242
+ dom.walkDOM = walkDOM;
189901
190243
  dom.XMLSerializer = XMLSerializer;
189902
190244
  //}
189903
190245
  return dom;
@@ -189912,7 +190254,7 @@ var hasRequiredEntities;
189912
190254
  function requireEntities () {
189913
190255
  if (hasRequiredEntities) return entities;
189914
190256
  hasRequiredEntities = 1;
189915
- (function (exports$1) {
190257
+ (function (exports) {
189916
190258
 
189917
190259
  var freeze = requireConventions().freeze;
189918
190260
 
@@ -189923,7 +190265,7 @@ function requireEntities () {
189923
190265
  * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
189924
190266
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
189925
190267
  */
189926
- exports$1.XML_ENTITIES = freeze({
190268
+ exports.XML_ENTITIES = freeze({
189927
190269
  amp: '&',
189928
190270
  apos: "'",
189929
190271
  gt: '>',
@@ -189945,7 +190287,7 @@ function requireEntities () {
189945
190287
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
189946
190288
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
189947
190289
  */
189948
- exports$1.HTML_ENTITIES = freeze({
190290
+ exports.HTML_ENTITIES = freeze({
189949
190291
  Aacute: '\u00C1',
189950
190292
  aacute: '\u00E1',
189951
190293
  Abreve: '\u0102',
@@ -192077,7 +192419,7 @@ function requireEntities () {
192077
192419
  * @deprecated use `HTML_ENTITIES` instead
192078
192420
  * @see HTML_ENTITIES
192079
192421
  */
192080
- exports$1.entityMap = exports$1.HTML_ENTITIES;
192422
+ exports.entityMap = exports.HTML_ENTITIES;
192081
192423
  } (entities));
192082
192424
  return entities;
192083
192425
  }
@@ -192688,7 +193030,7 @@ function requireSax () {
192688
193030
  function parseInstruction(source,start,domBuilder){
192689
193031
  var end = source.indexOf('?>',start);
192690
193032
  if(end){
192691
- var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
193033
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
192692
193034
  if(match){
192693
193035
  match[0].length;
192694
193036
  domBuilder.processingInstruction(match[1], match[2]) ;
@@ -193885,7 +194227,7 @@ var hasRequiredMoment;
193885
194227
  function requireMoment () {
193886
194228
  if (hasRequiredMoment) return moment$1.exports;
193887
194229
  hasRequiredMoment = 1;
193888
- (function (module, exports$1) {
194230
+ (function (module, exports) {
193889
194231
  (function (global, factory) {
193890
194232
  module.exports = factory() ;
193891
194233
  }(this, (function () {
@@ -199575,7 +199917,7 @@ function requireMomentTimezone () {
199575
199917
  hasRequiredMomentTimezone = 1;
199576
199918
  (function (module) {
199577
199919
  //! moment-timezone.js
199578
- //! version : 0.6.0
199920
+ //! version : 0.6.2
199579
199921
  //! Copyright (c) JS Foundation and other contributors
199580
199922
  //! license : MIT
199581
199923
  //! github.com/moment/moment-timezone
@@ -199601,7 +199943,7 @@ function requireMomentTimezone () {
199601
199943
  // return moment;
199602
199944
  // }
199603
199945
 
199604
- var VERSION = "0.6.0",
199946
+ var VERSION = "0.6.2",
199605
199947
  zones = {},
199606
199948
  links = {},
199607
199949
  countries = {},
@@ -203097,11 +203439,11 @@ var DEFAULT_FORMATS;
203097
203439
  DEFAULT_FORMATS["DATE_TIME"] = "yyyy-MM-dd HH:mm:ss";
203098
203440
  })(DEFAULT_FORMATS || (DEFAULT_FORMATS = {}));
203099
203441
 
203100
- const $RAF = window.requestAnimationFrame;
203442
+ const $RAF$1 = window.requestAnimationFrame;
203101
203443
  const $RAFQueue = [];
203102
203444
  const invokeLater = fn => {
203103
203445
  if (!$RAFQueue.length) {
203104
- $RAF(() => {
203446
+ $RAF$1(() => {
203105
203447
  $RAFQueue.forEach(f => f());
203106
203448
  $RAFQueue.length = 0;
203107
203449
  });
@@ -203109,23 +203451,7 @@ const invokeLater = fn => {
203109
203451
  $RAFQueue.push(fn);
203110
203452
  };
203111
203453
  const setAttr = (node, attrName, val, sync) => {
203112
- const task = () => {
203113
- if (node instanceof Element) {
203114
- // Handle tabindex specifically - ensure it's a valid string representation
203115
- if (attrName === 'tabindex') {
203116
- // Convert to string, handling 0, null, undefined, and NaN
203117
- if (val === null || val === undefined || (typeof val === 'number' && isNaN(val))) {
203118
- node.removeAttribute(attrName);
203119
- }
203120
- else {
203121
- node.setAttribute(attrName, String(val));
203122
- }
203123
- }
203124
- else {
203125
- node.setAttribute(attrName, val);
203126
- }
203127
- }
203128
- };
203454
+ const task = () => node instanceof Element && node.setAttribute(attrName, val);
203129
203455
  invokeLater(task);
203130
203456
  };
203131
203457
 
@@ -203659,220 +203985,70 @@ const getFnForEventExpr = (expr) => {
203659
203985
  return fnExecutor(expr, ExpressionType.Action);
203660
203986
  };
203661
203987
 
203662
- // Constants
203663
- const WIDGET_ID_REGEX = /^(widget-[^_]+)/;
203664
- const WIDGET_PROPERTY_REGEX = /^widget-[^_]+_(.+)$/;
203665
- const ARRAY_INDEX_PLACEHOLDER = '[$i]';
203666
- const ARRAY_INDEX_ZERO = '[0]';
203667
203988
  const registry = new Map();
203668
203989
  const watchIdGenerator = new IDGenerator('watch-id-');
203669
- const FIRST_TIME_WATCH = Object.freeze({});
203670
- /**
203671
- * Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
203672
- */
203673
- const getWidgetId = (identifier) => {
203674
- if (!identifier || typeof identifier !== 'string') {
203675
- return null;
203676
- }
203677
- const match = identifier.match(WIDGET_ID_REGEX);
203678
- return match ? match[1] : null;
203679
- };
203680
- /**
203681
- * Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
203682
- */
203683
- const getPropertyName = (identifier) => {
203684
- if (!identifier || typeof identifier !== 'string') {
203685
- return identifier;
203686
- }
203687
- const match = identifier.match(WIDGET_PROPERTY_REGEX);
203688
- return match ? match[1] : identifier;
203689
- };
203690
- /**
203691
- * Array consumer wrapper for array-based expressions
203692
- */
203990
+ const FIRST_TIME_WATCH = {};
203991
+ Object.freeze(FIRST_TIME_WATCH);
203693
203992
  const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
203694
- if (!isArray(newVal)) {
203695
- return;
203696
- }
203697
- let formattedData = newVal.map(datum => findValueOf(datum, restExpr));
203698
- // Flatten if result is array of arrays
203699
- if (isArray(formattedData[0])) {
203700
- formattedData = flatten(formattedData);
203993
+ let data = newVal, formattedData;
203994
+ if (isArray(data)) {
203995
+ formattedData = data.map(function (datum) {
203996
+ return findValueOf(datum, restExpr);
203997
+ });
203998
+ // If resulting structure is an array of array, flatten it
203999
+ if (isArray(formattedData[0])) {
204000
+ formattedData = flatten(formattedData);
204001
+ }
204002
+ listenerFn(formattedData, oldVal);
203701
204003
  }
203702
- listenerFn(formattedData, oldVal);
203703
204004
  };
203704
- /**
203705
- * Updates watch info for array expressions
203706
- */
203707
- const getUpdatedWatchInfo = (expr, acceptsArray, listener) => {
203708
- const regex = /\[\$i\]/g;
204005
+ const getUpdatedWatcInfo = (expr, acceptsArray, listener) => {
204006
+ // listener doesn't accept array
204007
+ // replace all `[$i]` with `[0]` and return the expression
204008
+ let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
203709
204009
  if (!acceptsArray) {
203710
204010
  return {
203711
- expr: expr.replace(regex, ARRAY_INDEX_ZERO),
203712
- listener
204011
+ 'expr': expr.replace(regex, $0),
204012
+ 'listener': listener
203713
204013
  };
203714
204014
  }
203715
- const lastIndex = expr.lastIndexOf(ARRAY_INDEX_PLACEHOLDER);
203716
- const baseExpr = expr.substring(0, lastIndex).replace(ARRAY_INDEX_PLACEHOLDER, ARRAY_INDEX_ZERO);
203717
- const restExpr = expr.substring(lastIndex + 5);
203718
- const arrayConsumerFn = restExpr
203719
- ? arrayConsumer.bind(undefined, listener, restExpr)
203720
- : listener;
204015
+ // listener accepts array
204016
+ // replace all except the last `[$i]` with `[0]` and return the expression.
204017
+ var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
204018
+ if (restExpr) {
204019
+ arrayConsumerFn = arrayConsumer.bind(undefined, listener, restExpr);
204020
+ }
203721
204021
  return {
203722
- expr: baseExpr,
203723
- listener: arrayConsumerFn
204022
+ 'expr': _expr,
204023
+ 'listener': arrayConsumerFn
203724
204024
  };
203725
204025
  };
203726
- /**
203727
- * Determines if an expression is static (doesn't need to be watched)
203728
- */
203729
- const STATIC_EXPRESSION_NAMES = [
203730
- "row.getProperty('investment')",
203731
- "row.getProperty('factsheetLink')",
203732
- "row.getProperty('isRebalanceEligible')"
203733
- ];
203734
- const isStaticExpression = (expr) => {
203735
- if (typeof expr !== 'string') {
203736
- return false;
203737
- }
203738
- const trimmedExpr = expr.trim();
203739
- // Expressions that always evaluate to localization strings
203740
- // if (trimmedExpr.includes('appLocale')) {
203741
- // return true;
203742
- // }
203743
- // Hard-coded static expression names
203744
- if (STATIC_EXPRESSION_NAMES.includes(trimmedExpr)) {
203745
- return true;
203746
- }
203747
- return false;
203748
- };
203749
- /**
203750
- * Gets the scope type from the scope object
203751
- */
203752
- const getScopeType = ($scope) => {
203753
- if (!$scope) {
203754
- return null;
203755
- }
203756
- if ($scope.pageName)
203757
- return 'Page';
203758
- if ($scope.prefabName)
203759
- return 'Prefab';
203760
- if ($scope.partialName)
203761
- return 'Partial';
203762
- // Check for App scope
203763
- if ($scope.Variables !== undefined &&
203764
- $scope.Actions !== undefined &&
203765
- !$scope.pageName &&
203766
- !$scope.prefabName &&
203767
- !$scope.partialName) {
203768
- return 'App';
203769
- }
203770
- if ($scope.constructor?.name === 'AppRef') {
203771
- return 'App';
203772
- }
203773
- return null;
203774
- };
203775
- /**
203776
- * Gets scope name based on scope type
203777
- */
203778
- const getScopeName = ($scope, scopeType) => {
203779
- if (!scopeType || !$scope) {
203780
- return null;
203781
- }
203782
- switch (scopeType) {
203783
- case 'Prefab': return $scope.prefabName || null;
203784
- case 'Partial': return $scope.partialName || null;
203785
- case 'Page': return $scope.pageName || null;
203786
- default: return null;
203787
- }
203788
- };
203789
- /**
203790
- * Main watch function
203791
- */
203792
204026
  const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.nextUid(), doNotClone = false, config = {}, isMuted) => {
203793
- // Handle array expressions
203794
- if (expr.includes(ARRAY_INDEX_PLACEHOLDER)) {
203795
- const watchInfo = getUpdatedWatchInfo(expr, config.arrayType || config.isList || false, listener);
204027
+ if (expr.indexOf('[$i]') !== -1) {
204028
+ let watchInfo = getUpdatedWatcInfo(expr, config && (config.arrayType || config.isList), listener);
203796
204029
  expr = watchInfo.expr;
203797
204030
  listener = watchInfo.listener;
203798
204031
  }
203799
- // Handle static expressions
203800
- if (isStaticExpression(expr)) {
203801
- try {
203802
- const fn = $parseExpr(expr);
203803
- const staticValue = fn($scope, $locals);
203804
- listener(staticValue, FIRST_TIME_WATCH);
203805
- }
203806
- catch (e) {
203807
- console.warn(`Error evaluating static expression '${expr}':`, e);
203808
- listener(undefined, FIRST_TIME_WATCH);
203809
- }
203810
- return () => { }; // No-op unsubscribe
203811
- }
203812
204032
  const fn = $parseExpr();
203813
- const scopeType = getScopeType($scope);
203814
- const scopeName = getScopeName($scope, scopeType);
203815
- const watchInfo = {
203816
- fn: fn.bind(null, $scope, $locals),
204033
+ registry.set(identifier, {
204034
+ fn: fn.bind(expr, $scope, $locals),
203817
204035
  listener,
203818
204036
  expr,
203819
204037
  last: FIRST_TIME_WATCH,
203820
204038
  doNotClone,
203821
- isMuted,
203822
- scopeType,
203823
- scopeName
203824
- };
203825
- // Store in registry
203826
- const widgetId = getWidgetId(identifier);
203827
- if (widgetId) {
203828
- const propertyName = getPropertyName(identifier);
203829
- if (!registry.has(widgetId)) {
203830
- registry.set(widgetId, {});
203831
- }
203832
- const widgetGroup = registry.get(widgetId);
203833
- widgetGroup[propertyName] = watchInfo;
203834
- }
203835
- else {
203836
- registry.set(identifier, watchInfo);
203837
- }
204039
+ isMuted: isMuted
204040
+ });
203838
204041
  return () => $unwatch(identifier);
203839
204042
  };
203840
- /**
203841
- * Unwatches a single identifier
203842
- */
203843
- const $unwatch = (identifier) => {
203844
- const widgetId = getWidgetId(identifier);
203845
- if (widgetId) {
203846
- const propertyName = getPropertyName(identifier);
203847
- const widgetGroup = registry.get(widgetId);
203848
- if (widgetGroup && typeof widgetGroup === 'object' && !widgetGroup.fn) {
203849
- const watchInfo = widgetGroup[propertyName];
203850
- if (watchInfo) {
203851
- delete widgetGroup[propertyName];
203852
- // Clean up empty widget groups
203853
- if (Object.keys(widgetGroup).length === 0) {
203854
- registry.delete(widgetId);
203855
- }
203856
- return true;
203857
- }
203858
- }
203859
- }
203860
- // Fallback to direct lookup
203861
- if (registry.has(identifier)) {
203862
- registry.delete(identifier);
203863
- return true;
203864
- }
203865
- return false;
203866
- };
204043
+ const $unwatch = identifier => registry.delete(identifier);
204044
+ window.watchRegistry = registry;
203867
204045
  const $appDigest = (() => {
203868
- return (force = false) => {
204046
+ return (force) => {
203869
204047
  {
203870
204048
  return;
203871
204049
  }
203872
204050
  };
203873
204051
  })();
203874
- // Export registry for debugging
203875
- window.watchRegistry = registry;
203876
204052
 
203877
204053
  var ComponentType;
203878
204054
  (function (ComponentType) {
@@ -203928,8 +204104,6 @@ var Operation;
203928
204104
  const DataSource = {
203929
204105
  Operation
203930
204106
  };
203931
- class App {
203932
- }
203933
204107
  class AbstractI18nService {
203934
204108
  }
203935
204109
 
@@ -203947,7 +204121,6 @@ const REGEX = {
203947
204121
  SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
203948
204122
  SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
203949
204123
  VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
203950
- VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
203951
204124
  REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
203952
204125
  DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
203953
204126
  ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
@@ -204170,9 +204343,6 @@ const isVideoFile = (fileName) => {
204170
204343
  const isValidWebURL = (url) => {
204171
204344
  return (REGEX.VALID_WEB_URL).test(url);
204172
204345
  };
204173
- const isValidImageUrl = (url) => {
204174
- return (REGEX.VALID_IMAGE_URL).test(url?.trim());
204175
- };
204176
204346
  /*This function returns the url to the resource after checking the validity of url*/
204177
204347
  const getResourceURL = (urlString) => {
204178
204348
  return urlString;
@@ -205426,7 +205596,6 @@ var Utils = /*#__PURE__*/Object.freeze({
205426
205596
  isPageable: isPageable,
205427
205597
  isSafari: isSafari,
205428
205598
  isTablet: isTablet,
205429
- isValidImageUrl: isValidImageUrl,
205430
205599
  isValidWebURL: isValidWebURL,
205431
205600
  isVideoFile: isVideoFile,
205432
205601
  loadScript: loadScript,
@@ -205520,10 +205689,7 @@ class EventNotifier {
205520
205689
  return noop;
205521
205690
  }
205522
205691
  destroy() {
205523
- this._subject.next(null); // optional
205524
- this._subject.complete(); // clears all observers
205525
- this._isInitialized = false;
205526
- this._eventsBeforeInit = [];
205692
+ this._subject.complete();
205527
205693
  }
205528
205694
  }
205529
205695
  let MINIMUM_TAB_WIDTH = 768;
@@ -205538,11 +205704,9 @@ class Viewport {
205538
205704
  this.isTabletType = false;
205539
205705
  this._eventNotifier = new EventNotifier(true);
205540
205706
  this.setScreenType();
205541
- // MEMORY LEAK FIX: Store bound function reference for proper removal
205542
- this.boundResizeFn = this.resizeFn.bind(this);
205543
- window.addEventListener("resize" /* ViewportEvent.RESIZE */, this.boundResizeFn);
205544
- this.mediaQuery = window.matchMedia('(orientation: portrait)');
205545
- if (this.mediaQuery.matches) {
205707
+ window.addEventListener("resize" /* ViewportEvent.RESIZE */, this.resizeFn.bind(this));
205708
+ const query = window.matchMedia('(orientation: portrait)');
205709
+ if (query.matches) {
205546
205710
  this.orientation.isPortrait = true;
205547
205711
  }
205548
205712
  else {
@@ -205550,10 +205714,8 @@ class Viewport {
205550
205714
  }
205551
205715
  // Add a media query change listener
205552
205716
  // addEventListener is not supported ios browser
205553
- if (this.mediaQuery.addEventListener) {
205554
- // MEMORY LEAK FIX: Store bound function reference for proper removal
205555
- this.boundOrientationChange = ($event) => this.orientationChange($event, !$event.matches);
205556
- this.mediaQuery.addEventListener('change', this.boundOrientationChange);
205717
+ if (query.addEventListener) {
205718
+ query.addEventListener('change', $event => this.orientationChange($event, !$event.matches));
205557
205719
  }
205558
205720
  }
205559
205721
  update(selectedViewPort) {
@@ -205580,14 +205742,14 @@ class Viewport {
205580
205742
  return this._eventNotifier.subscribe(eventName, callback);
205581
205743
  }
205582
205744
  notify(eventName, ...data) {
205583
- this._eventNotifier.notify(eventName, ...data);
205745
+ this._eventNotifier.notify.apply(this._eventNotifier, arguments);
205584
205746
  }
205585
205747
  setScreenType() {
205586
205748
  const $el = document.querySelector('.wm-app');
205587
205749
  this.screenWidth = $el.clientWidth;
205588
205750
  this.screenHeight = $el.clientHeight;
205589
- // const minValue = this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight;
205590
- // const maxValue = this.screenWidth > this.screenHeight ? this.screenWidth : this.screenHeight;
205751
+ this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight;
205752
+ this.screenWidth > this.screenHeight ? this.screenWidth : this.screenHeight;
205591
205753
  this.isTabletType = false;
205592
205754
  this.isMobileType = false;
205593
205755
  if (get(this.selectedViewPort, 'deviceCategory')) {
@@ -205619,17 +205781,7 @@ class Viewport {
205619
205781
  }
205620
205782
  ngOnDestroy() {
205621
205783
  this._eventNotifier.destroy();
205622
- // MEMORY LEAK FIX: Remove resize event listener using stored bound function reference
205623
- if (this.boundResizeFn) {
205624
- window.removeEventListener('resize', this.boundResizeFn);
205625
- this.boundResizeFn = null;
205626
- }
205627
- // MEMORY LEAK FIX: Remove media query orientation change listener
205628
- if (this.mediaQuery && this.boundOrientationChange && this.mediaQuery.removeEventListener) {
205629
- this.mediaQuery.removeEventListener('change', this.boundOrientationChange);
205630
- this.boundOrientationChange = null;
205631
- }
205632
- this.mediaQuery = null;
205784
+ window.removeEventListener('resize', this.resizeFn);
205633
205785
  }
205634
205786
  static { this.ɵfac = ɵɵngDeclareFactory$1({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0$1, type: Viewport, deps: [], target: FactoryTarget$4.Injectable }); }
205635
205787
  static { this.ɵprov = ɵɵngDeclareInjectable$1({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0$1, type: Viewport, providedIn: 'root' }); }
@@ -208283,10 +208435,7 @@ class PipeProvider {
208283
208435
  this.preparePipeMeta(CurrencyPipe$1, 'currency', true, [this._locale]),
208284
208436
  this.preparePipeMeta(DatePipe$1, 'date', true, [this._locale]),
208285
208437
  this.preparePipeMeta(ToDatePipe, 'toDate', true, [
208286
- new DatePipe$1(this._locale),
208287
- undefined,
208288
- this.injector.get(App),
208289
- this.injector.get(CustomPipeManager)
208438
+ new DatePipe$1(this._locale), undefined, this.injector.get(CustomPipeManager)
208290
208439
  ]),
208291
208440
  this.preparePipeMeta(ToNumberPipe, 'toNumber', true, [
208292
208441
  new DecimalPipe$1(this._locale),
@@ -208303,7 +208452,7 @@ class PipeProvider {
208303
208452
  new DecimalPipe$1(this._locale)
208304
208453
  ]),
208305
208454
  this.preparePipeMeta(StringToNumberPipe, 'stringToNumber', true),
208306
- this.preparePipeMeta(CustomPipe, 'custom', true, [this.injector.get(App), this.injector.get(CustomPipeManager)]),
208455
+ this.preparePipeMeta(CustomPipe, 'custom', true, [this.injector.get(CustomPipeManager)]),
208307
208456
  this.preparePipeMeta(TrustAsPipe, 'trustAs', true, [this.domSanitizer]),
208308
208457
  this.preparePipeMeta(SanitizePipe, 'sanitize', true, [this.domSanitizer]),
208309
208458
  this.preparePipeMeta(TemplateReplacePipe, 'templateReplace', true),