Skip to content
Snippets Groups Projects
index.js 7.57 MiB
Newer Older
  • Learn to ignore specific revisions
  • Hugo NOUTS's avatar
    Hugo NOUTS committed
          } else {
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            this.closeNode(this.openTags[this.currentLevel]);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          delete this.openTags[this.currentLevel];
          this.currentLevel--;
          return this;
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.end = function() {
          while (this.currentLevel >= 0) {
            this.up();
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          return this.onEnd();
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.openCurrent = function() {
          if (this.currentNode) {
            this.currentNode.children = true;
            return this.openNode(this.currentNode);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.openNode = function(node) {
          var att, chunk, name, ref1;
          if (!node.isOpen) {
            if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
              this.root = node;
            }
            chunk = '';
            if (node.type === NodeType.Element) {
              this.writerOptions.state = WriterState.OpenTag;
              chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
              ref1 = node.attribs;
              for (name in ref1) {
                if (!hasProp.call(ref1, name)) continue;
                att = ref1[name];
                chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
              }
              chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
              this.writerOptions.state = WriterState.InsideTag;
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            } else {
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
              this.writerOptions.state = WriterState.OpenTag;
              chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
              if (node.pubID && node.sysID) {
                chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
              } else if (node.sysID) {
                chunk += ' SYSTEM "' + node.sysID + '"';
              }
              if (node.children) {
                chunk += ' [';
                this.writerOptions.state = WriterState.InsideTag;
              } else {
                this.writerOptions.state = WriterState.CloseTag;
                chunk += '>';
              }
              chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            this.onData(chunk, this.currentLevel);
            return node.isOpen = true;
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.closeNode = function(node) {
          var chunk;
          if (!node.isClosed) {
            chunk = '';
            this.writerOptions.state = WriterState.CloseTag;
            if (node.type === NodeType.Element) {
              chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            } else {
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
              chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            this.writerOptions.state = WriterState.None;
            this.onData(chunk, this.currentLevel);
            return node.isClosed = true;
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.onData = function(chunk, level) {
          this.documentStarted = true;
          return this.onDataCallback(chunk, level + 1);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.onEnd = function() {
          this.documentCompleted = true;
          return this.onEndCallback();
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.debugInfo = function(name) {
          if (name == null) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            return "";
          } else {
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            return "node: <" + name + ">";
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.ele = function() {
          return this.element.apply(this, arguments);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.nod = function(name, attributes, text) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.node(name, attributes, text);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.txt = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.text(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.dat = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.cdata(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.com = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.comment(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.ins = function(target, value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.instruction(target, value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {
          return this.declaration(version, encoding, standalone);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {
          return this.doctype(root, pubID, sysID);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.e = function(name, attributes, text) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.element(name, attributes, text);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.n = function(name, attributes, text) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.node(name, attributes, text);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.t = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.text(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.d = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.cdata(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.c = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.comment(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.r = function(value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.raw(value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.i = function(target, value) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.instruction(target, value);
        };
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.att = function() {
          if (this.currentNode && this.currentNode.type === NodeType.DocType) {
            return this.attList.apply(this, arguments);
          } else {
            return this.attribute.apply(this, arguments);
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.a = function() {
          if (this.currentNode && this.currentNode.type === NodeType.DocType) {
            return this.attList.apply(this, arguments);
          } else {
            return this.attribute.apply(this, arguments);
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.ent = function(name, value) {
          return this.entity(name, value);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.pent = function(name, value) {
          return this.pEntity(name, value);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLDocumentCB.prototype.not = function(name, value) {
          return this.notation(name, value);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        return XMLDocumentCB;
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      })();
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    }).call(this);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    /***/ }),
    /* 1548 */
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,
        extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
        hasProp = {}.hasOwnProperty;
    
      NodeType = __webpack_require__(1525);
    
      XMLWriterBase = __webpack_require__(1545);
    
      WriterState = __webpack_require__(1546);
    
      module.exports = XMLStreamWriter = (function(superClass) {
        extend(XMLStreamWriter, superClass);
    
        function XMLStreamWriter(stream, options) {
          this.stream = stream;
          XMLStreamWriter.__super__.constructor.call(this, options);
        }
    
        XMLStreamWriter.prototype.endline = function(node, options, level) {
          if (node.isLastRootNode && options.state === WriterState.CloseTag) {
            return '';
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          } else {
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            return XMLStreamWriter.__super__.endline.call(this, node, options, level);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.document = function(doc, options) {
          var child, i, j, k, len, len1, ref, ref1, results;
          ref = doc.children;
          for (i = j = 0, len = ref.length; j < len; i = ++j) {
            child = ref[i];
            child.isLastRootNode = i === doc.children.length - 1;
          }
          options = this.filterOptions(options);
          ref1 = doc.children;
          results = [];
          for (k = 0, len1 = ref1.length; k < len1; k++) {
            child = ref1[k];
            results.push(this.writeChildNode(child, options, 0));
          }
          return results;
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.attribute = function(att, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.cdata = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.comment = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.declaration = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level));
        };
    
        XMLStreamWriter.prototype.docType = function(node, options, level) {
          var child, j, len, ref;
          level || (level = 0);
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          this.stream.write(this.indent(node, options, level));
          this.stream.write('<!DOCTYPE ' + node.root().name);
          if (node.pubID && node.sysID) {
            this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
          } else if (node.sysID) {
            this.stream.write(' SYSTEM "' + node.sysID + '"');
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          if (node.children.length > 0) {
            this.stream.write(' [');
            this.stream.write(this.endline(node, options, level));
            options.state = WriterState.InsideTag;
            ref = node.children;
            for (j = 0, len = ref.length; j < len; j++) {
              child = ref[j];
              this.writeChildNode(child, options, level + 1);
            }
            options.state = WriterState.CloseTag;
            this.stream.write(']');
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          options.state = WriterState.CloseTag;
          this.stream.write(options.spaceBeforeSlash + '>');
          this.stream.write(this.endline(node, options, level));
          options.state = WriterState.None;
          return this.closeNode(node, options, level);
        };
    
        XMLStreamWriter.prototype.element = function(node, options, level) {
          var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1;
          level || (level = 0);
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          this.stream.write(this.indent(node, options, level) + '<' + node.name);
          ref = node.attribs;
          for (name in ref) {
            if (!hasProp.call(ref, name)) continue;
            att = ref[name];
            this.attribute(att, options, level);
          }
          childNodeCount = node.children.length;
          firstChildNode = childNodeCount === 0 ? null : node.children[0];
          if (childNodeCount === 0 || node.children.every(function(e) {
            return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';
          })) {
            if (options.allowEmpty) {
              this.stream.write('>');
              options.state = WriterState.CloseTag;
              this.stream.write('</' + node.name + '>');
            } else {
              options.state = WriterState.CloseTag;
              this.stream.write(options.spaceBeforeSlash + '/>');
            }
          } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {
            this.stream.write('>');
            options.state = WriterState.InsideTag;
            options.suppressPrettyCount++;
            prettySuppressed = true;
            this.writeChildNode(firstChildNode, options, level + 1);
            options.suppressPrettyCount--;
            prettySuppressed = false;
            options.state = WriterState.CloseTag;
            this.stream.write('</' + node.name + '>');
          } else {
            this.stream.write('>' + this.endline(node, options, level));
            options.state = WriterState.InsideTag;
            ref1 = node.children;
            for (j = 0, len = ref1.length; j < len; j++) {
              child = ref1[j];
              this.writeChildNode(child, options, level + 1);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            options.state = WriterState.CloseTag;
            this.stream.write(this.indent(node, options, level) + '</' + node.name + '>');
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          this.stream.write(this.endline(node, options, level));
          options.state = WriterState.None;
          return this.closeNode(node, options, level);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.processingInstruction = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.raw = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.text = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.dtdAttList = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.dtdElement = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.dtdEntity = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        XMLStreamWriter.prototype.dtdNotation = function(node, options, level) {
          return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level));
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        return XMLStreamWriter;
    
      })(XMLWriterBase);
    
    }).call(this);
    
    
    /***/ }),
    /* 1549 */
    /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      "use strict";
      var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate,
        bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
        extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
        hasProp = {}.hasOwnProperty;
    
      sax = __webpack_require__(1550);
    
      events = __webpack_require__(250);
    
      bom = __webpack_require__(1551);
    
      processors = __webpack_require__(1552);
    
      setImmediate = (__webpack_require__(1553).setImmediate);
    
      defaults = (__webpack_require__(1514).defaults);
    
      isEmpty = function(thing) {
        return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0;
      };
    
      processItem = function(processors, item, key) {
        var i, len, process;
        for (i = 0, len = processors.length; i < len; i++) {
          process = processors[i];
          item = process(item, key);
        }
        return item;
      };
    
      exports.Parser = (function(superClass) {
        extend(Parser, superClass);
    
        function Parser(opts) {
          this.parseStringPromise = bind(this.parseStringPromise, this);
          this.parseString = bind(this.parseString, this);
          this.reset = bind(this.reset, this);
          this.assignOrPush = bind(this.assignOrPush, this);
          this.processAsync = bind(this.processAsync, this);
          var key, ref, value;
          if (!(this instanceof exports.Parser)) {
            return new exports.Parser(opts);
          }
          this.options = {};
          ref = defaults["0.2"];
          for (key in ref) {
            if (!hasProp.call(ref, key)) continue;
            value = ref[key];
            this.options[key] = value;
          }
          for (key in opts) {
            if (!hasProp.call(opts, key)) continue;
            value = opts[key];
            this.options[key] = value;
          }
          if (this.options.xmlns) {
            this.options.xmlnskey = this.options.attrkey + "ns";
          }
          if (this.options.normalizeTags) {
            if (!this.options.tagNameProcessors) {
              this.options.tagNameProcessors = [];
            }
            this.options.tagNameProcessors.unshift(processors.normalize);
          }
          this.reset();
        }
    
        Parser.prototype.processAsync = function() {
          var chunk, err;
          try {
            if (this.remaining.length <= this.options.chunkSize) {
              chunk = this.remaining;
              this.remaining = '';
              this.saxParser = this.saxParser.write(chunk);
              return this.saxParser.close();
            } else {
              chunk = this.remaining.substr(0, this.options.chunkSize);
              this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
              this.saxParser = this.saxParser.write(chunk);
              return setImmediate(this.processAsync);
            }
          } catch (error1) {
            err = error1;
            if (!this.saxParser.errThrown) {
              this.saxParser.errThrown = true;
              return this.emit(err);
            }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        Parser.prototype.assignOrPush = function(obj, key, newValue) {
          if (!(key in obj)) {
            if (!this.options.explicitArray) {
              return obj[key] = newValue;
            } else {
              return obj[key] = [newValue];
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
            }
          } else {
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
            if (!(obj[key] instanceof Array)) {
              obj[key] = [obj[key]];
            }
            return obj[key].push(newValue);
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        Parser.prototype.reset = function() {
          var attrkey, charkey, ontext, stack;
          this.removeAllListeners();
          this.saxParser = sax.parser(this.options.strict, {
            trim: false,
            normalize: false,
            xmlns: this.options.xmlns
          });
          this.saxParser.errThrown = false;
          this.saxParser.onerror = (function(_this) {
            return function(error) {
              _this.saxParser.resume();
              if (!_this.saxParser.errThrown) {
                _this.saxParser.errThrown = true;
                return _this.emit("error", error);
              }
            };
          })(this);
          this.saxParser.onend = (function(_this) {
            return function() {
              if (!_this.saxParser.ended) {
                _this.saxParser.ended = true;
                return _this.emit("end", _this.resultObject);
              }
            };
          })(this);
          this.saxParser.ended = false;
          this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
          this.resultObject = null;
          stack = [];
          attrkey = this.options.attrkey;
          charkey = this.options.charkey;
          this.saxParser.onopentag = (function(_this) {
            return function(node) {
              var key, newValue, obj, processedKey, ref;
              obj = {};
              obj[charkey] = "";
              if (!_this.options.ignoreAttrs) {
                ref = node.attributes;
                for (key in ref) {
                  if (!hasProp.call(ref, key)) continue;
                  if (!(attrkey in obj) && !_this.options.mergeAttrs) {
                    obj[attrkey] = {};
                  }
                  newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
                  processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
                  if (_this.options.mergeAttrs) {
                    _this.assignOrPush(obj, processedKey, newValue);
                  } else {
                    obj[attrkey][processedKey] = newValue;
                  }
                }
              }
              obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
              if (_this.options.xmlns) {
                obj[_this.options.xmlnskey] = {
                  uri: node.uri,
                  local: node.local
                };
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
              }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
              return stack.push(obj);
            };
          })(this);
          this.saxParser.onclosetag = (function(_this) {
            return function() {
              var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
              obj = stack.pop();
              nodeName = obj["#name"];
              if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
                delete obj["#name"];
              }
              if (obj.cdata === true) {
                cdata = obj.cdata;
                delete obj.cdata;
              }
              s = stack[stack.length - 1];
              if (obj[charkey].match(/^\s*$/) && !cdata) {
                emptyStr = obj[charkey];
                delete obj[charkey];
              } else {
                if (_this.options.trim) {
                  obj[charkey] = obj[charkey].trim();
                }
                if (_this.options.normalize) {
                  obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
                }
                obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
                if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
                  obj = obj[charkey];
                }
              }
              if (isEmpty(obj)) {
                obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
              }
              if (_this.options.validator != null) {
                xpath = "/" + ((function() {
                  var i, len, results;
                  results = [];
                  for (i = 0, len = stack.length; i < len; i++) {
                    node = stack[i];
                    results.push(node["#name"]);
                  }
                  return results;
                })()).concat(nodeName).join("/");
                (function() {
                  var err;
                  try {
                    return obj = _this.options.validator(xpath, s && s[nodeName], obj);
                  } catch (error1) {
                    err = error1;
                    return _this.emit("error", err);
                  }
                })();
              }
              if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
                if (!_this.options.preserveChildrenOrder) {
                  node = {};
                  if (_this.options.attrkey in obj) {
                    node[_this.options.attrkey] = obj[_this.options.attrkey];
                    delete obj[_this.options.attrkey];
                  }
                  if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
                    node[_this.options.charkey] = obj[_this.options.charkey];
                    delete obj[_this.options.charkey];
                  }
                  if (Object.getOwnPropertyNames(obj).length > 0) {
                    node[_this.options.childkey] = obj;
                  }
                  obj = node;
                } else if (s) {
                  s[_this.options.childkey] = s[_this.options.childkey] || [];
                  objClone = {};
                  for (key in obj) {
                    if (!hasProp.call(obj, key)) continue;
                    objClone[key] = obj[key];
                  }
                  s[_this.options.childkey].push(objClone);
                  delete obj["#name"];
                  if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
                    obj = obj[charkey];
                  }
                }
              }
              if (stack.length > 0) {
                return _this.assignOrPush(s, nodeName, obj);
              } else {
                if (_this.options.explicitRoot) {
                  old = obj;
                  obj = {};
                  obj[nodeName] = old;
                }
                _this.resultObject = obj;
                _this.saxParser.ended = true;
                return _this.emit("end", _this.resultObject);
              }
            };
          })(this);
          ontext = (function(_this) {
            return function(text) {
              var charChild, s;
              s = stack[stack.length - 1];
              if (s) {
                s[charkey] += text;
                if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) {
                  s[_this.options.childkey] = s[_this.options.childkey] || [];
                  charChild = {
                    '#name': '__text__'
                  };
                  charChild[charkey] = text;
                  if (_this.options.normalize) {
                    charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
                  }
                  s[_this.options.childkey].push(charChild);
                }
                return s;
              }
            };
          })(this);
          this.saxParser.ontext = ontext;
          return this.saxParser.oncdata = (function(_this) {
            return function(text) {
              var s;
              s = ontext(text);
              if (s) {
                return s.cdata = true;
              }
            };
          })(this);
        };
    
        Parser.prototype.parseString = function(str, cb) {
          var err;
          if ((cb != null) && typeof cb === "function") {
            this.on("end", function(result) {
              this.reset();
              return cb(null, result);
            });
            this.on("error", function(err) {
              this.reset();
              return cb(err);
            });
          }
          try {
            str = str.toString();
            if (str.trim() === '') {
              this.emit("end", null);
              return true;
            }
            str = bom.stripBOM(str);
            if (this.options.async) {
              this.remaining = str;
              setImmediate(this.processAsync);
              return this.saxParser;
            }
            return this.saxParser.write(str).close();
          } catch (error1) {
            err = error1;
            if (!(this.saxParser.errThrown || this.saxParser.ended)) {
              this.emit('error', err);
              return this.saxParser.errThrown = true;
            } else if (this.saxParser.ended) {
              throw err;
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        Parser.prototype.parseStringPromise = function(str) {
          return new Promise((function(_this) {
            return function(resolve, reject) {
              return _this.parseString(str, function(err, value) {
                if (err) {
                  return reject(err);
                } else {
                  return resolve(value);
                }
              });
            };
          })(this));
        };
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        return Parser;
    
      })(events);
    
      exports.parseString = function(str, a, b) {
        var cb, options, parser;
        if (b != null) {
          if (typeof b === 'function') {
            cb = b;
          }
          if (typeof a === 'object') {
            options = a;
          }
        } else {
          if (typeof a === 'function') {
            cb = a;
          }
          options = {};
        }
        parser = new exports.Parser(options);
        return parser.parseString(str, cb);
      };
    
      exports.parseStringPromise = function(str, a) {
        var options, parser;
        if (typeof a === 'object') {
          options = a;
        }
        parser = new exports.Parser(options);
        return parser.parseStringPromise(str);
      };
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    /* 1550 */
    /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
    ;(function (sax) { // wrapper for non-node envs
      sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
      sax.SAXParser = SAXParser
      sax.SAXStream = SAXStream
      sax.createStream = createStream
    
      // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
      // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
      // since that's the earliest that a buffer overrun could occur.  This way, checks are
      // as rare as required, but as often as necessary to ensure never crossing this bound.
      // Furthermore, buffers are only tested at most once per write(), so passing a very
      // large string into write() might have undesirable effects, but this is manageable by
      // the caller, so it is assumed to be safe.  Thus, a call to write() may, in the extreme
      // edge case, result in creating at most one complete copy of the string passed in.
      // Set to Infinity to have unlimited buffers.
      sax.MAX_BUFFER_LENGTH = 64 * 1024
    
      var buffers = [
        'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
        'procInstName', 'procInstBody', 'entity', 'attribName',
        'attribValue', 'cdata', 'script'
      ]
    
      sax.EVENTS = [
        'text',
        'processinginstruction',
        'sgmldeclaration',
        'doctype',
        'comment',
        'opentagstart',
        'attribute',
        'opentag',
        'closetag',
        'opencdata',
        'cdata',
        'closecdata',
        'error',
        'end',
        'ready',
        'script',
        'opennamespace',
        'closenamespace'
      ]
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      function SAXParser (strict, opt) {
        if (!(this instanceof SAXParser)) {
          return new SAXParser(strict, opt)
        }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        var parser = this
        clearBuffers(parser)
        parser.q = parser.c = ''
        parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
        parser.opt = opt || {}
        parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
        parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
        parser.tags = []
        parser.closed = parser.closedRoot = parser.sawRoot = false
        parser.tag = parser.error = null
        parser.strict = !!strict
        parser.noscript = !!(strict || parser.opt.noscript)
        parser.state = S.BEGIN
        parser.strictEntities = parser.opt.strictEntities
        parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
        parser.attribList = []
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        // namespaces form a prototype chain.
        // it always points at the current tag,
        // which protos to its parent tag.
        if (parser.opt.xmlns) {
          parser.ns = Object.create(rootNS)
        }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        // mostly just for error reporting
        parser.trackPosition = parser.opt.position !== false
        if (parser.trackPosition) {
          parser.position = parser.line = parser.column = 0
        }
        emit(parser, 'onready')
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      if (!Object.create) {
        Object.create = function (o) {
          function F () {}
          F.prototype = o
          var newf = new F()
          return newf
        }
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      if (!Object.keys) {
        Object.keys = function (o) {
          var a = []
          for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
          return a
        }
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      function checkBufferLength (parser) {
        var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
        var maxActual = 0
        for (var i = 0, l = buffers.length; i < l; i++) {
          var len = parser[buffers[i]].length
          if (len > maxAllowed) {
            // Text/cdata nodes can get big, and since they're buffered,
            // we can get here under normal conditions.
            // Avoid issues by emitting the text node now,
            // so at least it won't get any bigger.
            switch (buffers[i]) {
              case 'textNode':
                closeText(parser)
                break
    
              case 'cdata':
                emitNode(parser, 'oncdata', parser.cdata)
                parser.cdata = ''
                break
    
              case 'script':
                emitNode(parser, 'onscript', parser.script)
                parser.script = ''
                break
    
              default:
                error(parser, 'Max buffer length exceeded: ' + buffers[i])
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          maxActual = Math.max(maxActual, len)
        }
        // schedule the next check for the earliest possible buffer overrun.
        var m = sax.MAX_BUFFER_LENGTH - maxActual
        parser.bufferCheckPosition = m + parser.position
      }
    
      function clearBuffers (parser) {
        for (var i = 0, l = buffers.length; i < l; i++) {
          parser[buffers[i]] = ''
        }
      }
    
      function flushBuffers (parser) {
        closeText(parser)
        if (parser.cdata !== '') {
          emitNode(parser, 'oncdata', parser.cdata)
          parser.cdata = ''
        }
        if (parser.script !== '') {
          emitNode(parser, 'onscript', parser.script)
          parser.script = ''
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
        }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      SAXParser.prototype = {
        end: function () { end(this) },
        write: write,
        resume: function () { this.error = null; return this },
        close: function () { return this.write(null) },
        flush: function () { flushBuffers(this) }
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      var Stream
      try {
        Stream = (__webpack_require__(82).Stream)
      } catch (ex) {
        Stream = function () {}
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      var streamWraps = sax.EVENTS.filter(function (ev) {
        return ev !== 'error' && ev !== 'end'
      })
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      function createStream (strict, opt) {
        return new SAXStream(strict, opt)
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      function SAXStream (strict, opt) {
        if (!(this instanceof SAXStream)) {
          return new SAXStream(strict, opt)
        }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        Stream.apply(this)
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        this._parser = new SAXParser(strict, opt)
        this.writable = true
        this.readable = true
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        var me = this
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        this._parser.onend = function () {
          me.emit('end')
        }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        this._parser.onerror = function (er) {
          me.emit('error', er)
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          // if didn't throw, then means error was handled.
          // go ahead and clear error, so we can write again.
          me._parser.error = null
        }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        this._decoder = null
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
        streamWraps.forEach(function (ev) {
          Object.defineProperty(me, 'on' + ev, {
            get: function () {
              return me._parser['on' + ev]
            },
            set: function (h) {
              if (!h) {
                me.removeAllListeners(ev)
                me._parser['on' + ev] = h
                return h
              }
              me.on(ev, h)
            },
            enumerable: true,
            configurable: false
          })
        })
      }
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      SAXStream.prototype = Object.create(Stream.prototype, {
        constructor: {
          value: SAXStream
        }
      })
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
      SAXStream.prototype.write = function (data) {
        if (typeof Buffer === 'function' &&
          typeof Buffer.isBuffer === 'function' &&
          Buffer.isBuffer(data)) {
          if (!this._decoder) {
            var SD = (__webpack_require__(939).StringDecoder)
            this._decoder = new SD('utf8')
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
          }
    
    Hugo SUBTIL's avatar
    Hugo SUBTIL committed
          data = this._decoder.write(data)