Skip to content
Snippets Groups Projects
index.js 7.35 MiB
Newer Older
  • Learn to ignore specific revisions
  • Hugo NOUTS's avatar
    Hugo NOUTS committed
          return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
        };
    
        return XMLDTDEntity;
    
      })(XMLNode);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1524 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLDTDElement, XMLNode,
        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;
    
    
    build-token's avatar
    build-token committed
      XMLNode = __webpack_require__(1512);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLDTDElement = (function(superClass) {
        extend(XMLDTDElement, superClass);
    
        function XMLDTDElement(parent, name, value) {
          XMLDTDElement.__super__.constructor.call(this, parent);
          if (name == null) {
            throw new Error("Missing DTD element name. " + this.debugInfo());
          }
          if (!value) {
            value = '(#PCDATA)';
          }
          if (Array.isArray(value)) {
            value = '(' + value.join(',') + ')';
          }
          this.name = this.stringify.name(name);
          this.type = NodeType.ElementDeclaration;
          this.value = this.stringify.dtdElementValue(value);
        }
    
        XMLDTDElement.prototype.toString = function(options) {
          return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
        };
    
        return XMLDTDElement;
    
      })(XMLNode);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1525 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLDTDNotation, XMLNode,
        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;
    
    
    build-token's avatar
    build-token committed
      XMLNode = __webpack_require__(1512);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLDTDNotation = (function(superClass) {
        extend(XMLDTDNotation, superClass);
    
        function XMLDTDNotation(parent, name, value) {
          XMLDTDNotation.__super__.constructor.call(this, parent);
          if (name == null) {
            throw new Error("Missing DTD notation name. " + this.debugInfo(name));
          }
          if (!value.pubID && !value.sysID) {
            throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
          }
          this.name = this.stringify.name(name);
          this.type = NodeType.NotationDeclaration;
          if (value.pubID != null) {
            this.pubID = this.stringify.dtdPubID(value.pubID);
          }
          if (value.sysID != null) {
            this.sysID = this.stringify.dtdSysID(value.sysID);
          }
        }
    
        Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
          get: function() {
            return this.pubID;
          }
        });
    
        Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
          get: function() {
            return this.sysID;
          }
        });
    
        XMLDTDNotation.prototype.toString = function(options) {
          return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
        };
    
        return XMLDTDNotation;
    
      })(XMLNode);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1526 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLNode, XMLRaw,
        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;
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLNode = __webpack_require__(1512);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLRaw = (function(superClass) {
        extend(XMLRaw, superClass);
    
        function XMLRaw(parent, text) {
          XMLRaw.__super__.constructor.call(this, parent);
          if (text == null) {
            throw new Error("Missing raw text. " + this.debugInfo());
          }
          this.type = NodeType.Raw;
          this.value = this.stringify.raw(text);
        }
    
        XMLRaw.prototype.clone = function() {
          return Object.create(this);
        };
    
        XMLRaw.prototype.toString = function(options) {
          return this.options.writer.raw(this, this.options.writer.filterOptions(options));
        };
    
        return XMLRaw;
    
      })(XMLNode);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1527 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLCharacterData, XMLText,
        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;
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLCharacterData = __webpack_require__(1518);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLText = (function(superClass) {
        extend(XMLText, superClass);
    
        function XMLText(parent, text) {
          XMLText.__super__.constructor.call(this, parent);
          if (text == null) {
            throw new Error("Missing element text. " + this.debugInfo());
          }
          this.name = "#text";
          this.type = NodeType.Text;
          this.value = this.stringify.text(text);
        }
    
        Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
          get: function() {
            throw new Error("This DOM method is not implemented." + this.debugInfo());
          }
        });
    
        Object.defineProperty(XMLText.prototype, 'wholeText', {
          get: function() {
            var next, prev, str;
            str = '';
            prev = this.previousSibling;
            while (prev) {
              str = prev.data + str;
              prev = prev.previousSibling;
            }
            str += this.data;
            next = this.nextSibling;
            while (next) {
              str = str + next.data;
              next = next.nextSibling;
            }
            return str;
          }
        });
    
        XMLText.prototype.clone = function() {
          return Object.create(this);
        };
    
        XMLText.prototype.toString = function(options) {
          return this.options.writer.text(this, this.options.writer.filterOptions(options));
        };
    
        XMLText.prototype.splitText = function(offset) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLText.prototype.replaceWholeText = function(content) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        return XMLText;
    
      })(XMLCharacterData);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1528 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLCharacterData, XMLProcessingInstruction,
        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;
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLCharacterData = __webpack_require__(1518);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLProcessingInstruction = (function(superClass) {
        extend(XMLProcessingInstruction, superClass);
    
        function XMLProcessingInstruction(parent, target, value) {
          XMLProcessingInstruction.__super__.constructor.call(this, parent);
          if (target == null) {
            throw new Error("Missing instruction target. " + this.debugInfo());
          }
          this.type = NodeType.ProcessingInstruction;
          this.target = this.stringify.insTarget(target);
          this.name = this.target;
          if (value) {
            this.value = this.stringify.insValue(value);
          }
        }
    
        XMLProcessingInstruction.prototype.clone = function() {
          return Object.create(this);
        };
    
        XMLProcessingInstruction.prototype.toString = function(options) {
          return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
        };
    
        XMLProcessingInstruction.prototype.isEqualNode = function(node) {
          if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
            return false;
          }
          if (node.target !== this.target) {
            return false;
          }
          return true;
        };
    
        return XMLProcessingInstruction;
    
      })(XMLCharacterData);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1529 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLDummy, XMLNode,
        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;
    
    
    build-token's avatar
    build-token committed
      XMLNode = __webpack_require__(1512);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLDummy = (function(superClass) {
        extend(XMLDummy, superClass);
    
        function XMLDummy(parent) {
          XMLDummy.__super__.constructor.call(this, parent);
          this.type = NodeType.Dummy;
        }
    
        XMLDummy.prototype.clone = function() {
          return Object.create(this);
        };
    
        XMLDummy.prototype.toString = function(options) {
          return '';
        };
    
        return XMLDummy;
    
      })(XMLNode);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1530 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var XMLNodeList;
    
      module.exports = XMLNodeList = (function() {
        function XMLNodeList(nodes) {
          this.nodes = nodes;
        }
    
        Object.defineProperty(XMLNodeList.prototype, 'length', {
          get: function() {
            return this.nodes.length || 0;
          }
        });
    
        XMLNodeList.prototype.clone = function() {
          return this.nodes = null;
        };
    
        XMLNodeList.prototype.item = function(index) {
          return this.nodes[index] || null;
        };
    
        return XMLNodeList;
    
      })();
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1531 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      module.exports = {
        Disconnected: 1,
        Preceding: 2,
        Following: 4,
        Contains: 8,
        ContainedBy: 16,
        ImplementationSpecific: 32
      };
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1532 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    217375 217376 217377 217378 217379 217380 217381 217382 217383 217384 217385 217386 217387 217388 217389 217390 217391 217392 217393 217394 217395 217396 217397 217398 217399 217400 217401 217402 217403 217404 217405 217406 217407 217408 217409 217410 217411 217412 217413 217414 217415 217416 217417 217418 217419 217420 217421 217422 217423 217424 217425 217426 217427 217428 217429 217430 217431 217432 217433 217434 217435 217436 217437 217438 217439 217440 217441 217442 217443 217444 217445 217446 217447 217448 217449 217450 217451 217452 217453 217454 217455 217456 217457 217458 217459 217460 217461 217462 217463 217464 217465 217466 217467 217468 217469 217470 217471 217472 217473 217474 217475 217476 217477 217478 217479 217480 217481 217482 217483 217484 217485 217486 217487 217488 217489 217490 217491 217492 217493 217494 217495 217496 217497 217498 217499 217500 217501 217502 217503 217504 217505 217506 217507 217508 217509 217510 217511 217512 217513 217514 217515 217516 217517 217518 217519 217520 217521 217522 217523 217524 217525 217526 217527 217528 217529 217530 217531 217532 217533 217534 217535 217536 217537 217538 217539 217540 217541 217542 217543 217544 217545 217546 217547 217548 217549 217550 217551 217552 217553 217554 217555 217556 217557 217558 217559 217560 217561 217562 217563 217564 217565 217566 217567 217568 217569 217570 217571 217572 217573 217574 217575 217576 217577 217578 217579 217580 217581 217582 217583 217584 217585 217586 217587 217588 217589 217590 217591 217592 217593 217594 217595 217596 217597 217598 217599 217600 217601 217602 217603 217604 217605 217606 217607 217608 217609 217610 217611 217612 217613 217614 217615 217616 217617 217618 217619
    /***/ (function(module) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var XMLStringifier,
        bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
        hasProp = {}.hasOwnProperty;
    
      module.exports = XMLStringifier = (function() {
        function XMLStringifier(options) {
          this.assertLegalName = bind(this.assertLegalName, this);
          this.assertLegalChar = bind(this.assertLegalChar, this);
          var key, ref, value;
          options || (options = {});
          this.options = options;
          if (!this.options.version) {
            this.options.version = '1.0';
          }
          ref = options.stringify || {};
          for (key in ref) {
            if (!hasProp.call(ref, key)) continue;
            value = ref[key];
            this[key] = value;
          }
        }
    
        XMLStringifier.prototype.name = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalName('' + val || '');
        };
    
        XMLStringifier.prototype.text = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar(this.textEscape('' + val || ''));
        };
    
        XMLStringifier.prototype.cdata = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          val = '' + val || '';
          val = val.replace(']]>', ']]]]><![CDATA[>');
          return this.assertLegalChar(val);
        };
    
        XMLStringifier.prototype.comment = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          val = '' + val || '';
          if (val.match(/--/)) {
            throw new Error("Comment text cannot contain double-hypen: " + val);
          }
          return this.assertLegalChar(val);
        };
    
        XMLStringifier.prototype.raw = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return '' + val || '';
        };
    
        XMLStringifier.prototype.attValue = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar(this.attEscape(val = '' + val || ''));
        };
    
        XMLStringifier.prototype.insTarget = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.insValue = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          val = '' + val || '';
          if (val.match(/\?>/)) {
            throw new Error("Invalid processing instruction value: " + val);
          }
          return this.assertLegalChar(val);
        };
    
        XMLStringifier.prototype.xmlVersion = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          val = '' + val || '';
          if (!val.match(/1\.[0-9]+/)) {
            throw new Error("Invalid version number: " + val);
          }
          return val;
        };
    
        XMLStringifier.prototype.xmlEncoding = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          val = '' + val || '';
          if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
            throw new Error("Invalid encoding: " + val);
          }
          return this.assertLegalChar(val);
        };
    
        XMLStringifier.prototype.xmlStandalone = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          if (val) {
            return "yes";
          } else {
            return "no";
          }
        };
    
        XMLStringifier.prototype.dtdPubID = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.dtdSysID = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.dtdElementValue = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.dtdAttType = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.dtdAttDefault = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.dtdEntityValue = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.dtdNData = function(val) {
          if (this.options.noValidation) {
            return val;
          }
          return this.assertLegalChar('' + val || '');
        };
    
        XMLStringifier.prototype.convertAttKey = '@';
    
        XMLStringifier.prototype.convertPIKey = '?';
    
        XMLStringifier.prototype.convertTextKey = '#text';
    
        XMLStringifier.prototype.convertCDataKey = '#cdata';
    
        XMLStringifier.prototype.convertCommentKey = '#comment';
    
        XMLStringifier.prototype.convertRawKey = '#raw';
    
        XMLStringifier.prototype.assertLegalChar = function(str) {
          var regex, res;
          if (this.options.noValidation) {
            return str;
          }
          regex = '';
          if (this.options.version === '1.0') {
            regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
            if (res = str.match(regex)) {
              throw new Error("Invalid character in string: " + str + " at index " + res.index);
            }
          } else if (this.options.version === '1.1') {
            regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
            if (res = str.match(regex)) {
              throw new Error("Invalid character in string: " + str + " at index " + res.index);
            }
          }
          return str;
        };
    
        XMLStringifier.prototype.assertLegalName = function(str) {
          var regex;
          if (this.options.noValidation) {
            return str;
          }
          this.assertLegalChar(str);
          regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
          if (!str.match(regex)) {
            throw new Error("Invalid character in name");
          }
          return str;
        };
    
        XMLStringifier.prototype.textEscape = function(str) {
          var ampregex;
          if (this.options.noValidation) {
            return str;
          }
          ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
          return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
        };
    
        XMLStringifier.prototype.attEscape = function(str) {
          var ampregex;
          if (this.options.noValidation) {
            return str;
          }
          ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
          return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
        };
    
        return XMLStringifier;
    
      })();
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1533 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var XMLStringWriter, 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;
    
    
    build-token's avatar
    build-token committed
      XMLWriterBase = __webpack_require__(1534);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLStringWriter = (function(superClass) {
        extend(XMLStringWriter, superClass);
    
        function XMLStringWriter(options) {
          XMLStringWriter.__super__.constructor.call(this, options);
        }
    
        XMLStringWriter.prototype.document = function(doc, options) {
          var child, i, len, r, ref;
          options = this.filterOptions(options);
          r = '';
          ref = doc.children;
          for (i = 0, len = ref.length; i < len; i++) {
            child = ref[i];
            r += this.writeChildNode(child, options, 0);
          }
          if (options.pretty && r.slice(-options.newline.length) === options.newline) {
            r = r.slice(0, -options.newline.length);
          }
          return r;
        };
    
        return XMLStringWriter;
    
      })(XMLWriterBase);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1534 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign,
        hasProp = {}.hasOwnProperty;
    
    
    build-token's avatar
    build-token committed
      assign = (__webpack_require__(1506).assign);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDeclaration = __webpack_require__(1520);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDocType = __webpack_require__(1521);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLCData = __webpack_require__(1517);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLComment = __webpack_require__(1519);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLElement = __webpack_require__(1513);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLRaw = __webpack_require__(1526);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLText = __webpack_require__(1527);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLProcessingInstruction = __webpack_require__(1528);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDummy = __webpack_require__(1529);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDTDAttList = __webpack_require__(1522);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDTDElement = __webpack_require__(1524);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDTDEntity = __webpack_require__(1523);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDTDNotation = __webpack_require__(1525);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      WriterState = __webpack_require__(1535);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    217700 217701 217702 217703 217704 217705 217706 217707 217708 217709 217710 217711 217712 217713 217714 217715 217716 217717 217718 217719 217720 217721 217722 217723 217724 217725 217726 217727 217728 217729 217730 217731 217732 217733 217734 217735 217736 217737 217738 217739 217740 217741 217742 217743 217744 217745 217746 217747 217748 217749 217750 217751 217752 217753 217754 217755 217756 217757 217758 217759 217760 217761 217762 217763 217764 217765 217766 217767 217768 217769 217770 217771 217772 217773 217774 217775 217776 217777 217778 217779 217780 217781 217782 217783 217784 217785 217786 217787 217788 217789 217790 217791 217792 217793 217794 217795 217796 217797 217798 217799 217800 217801 217802 217803 217804 217805 217806 217807 217808 217809 217810 217811 217812 217813 217814 217815 217816 217817 217818 217819 217820 217821 217822 217823 217824 217825 217826 217827 217828 217829 217830 217831 217832 217833 217834 217835 217836 217837 217838 217839 217840 217841 217842 217843 217844 217845 217846 217847 217848 217849 217850 217851 217852 217853 217854 217855 217856 217857 217858 217859 217860 217861 217862 217863 217864 217865 217866 217867 217868 217869 217870 217871 217872 217873 217874 217875 217876 217877 217878 217879 217880 217881 217882 217883 217884 217885 217886 217887 217888 217889 217890 217891 217892 217893 217894 217895 217896 217897 217898 217899 217900 217901 217902 217903 217904 217905 217906 217907 217908 217909 217910 217911 217912 217913 217914 217915 217916 217917 217918 217919 217920 217921 217922 217923 217924 217925 217926 217927 217928 217929 217930 217931 217932 217933 217934 217935 217936 217937 217938 217939 217940 217941 217942 217943 217944 217945 217946 217947 217948 217949 217950 217951 217952 217953 217954 217955 217956 217957 217958 217959 217960 217961 217962 217963 217964 217965 217966 217967 217968 217969 217970 217971 217972 217973 217974 217975 217976 217977 217978 217979 217980 217981 217982 217983 217984 217985 217986 217987 217988 217989 217990 217991 217992 217993 217994 217995 217996 217997 217998 217999 218000
    
      module.exports = XMLWriterBase = (function() {
        function XMLWriterBase(options) {
          var key, ref, value;
          options || (options = {});
          this.options = options;
          ref = options.writer || {};
          for (key in ref) {
            if (!hasProp.call(ref, key)) continue;
            value = ref[key];
            this["_" + key] = this[key];
            this[key] = value;
          }
        }
    
        XMLWriterBase.prototype.filterOptions = function(options) {
          var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6;
          options || (options = {});
          options = assign({}, this.options, options);
          filteredOptions = {
            writer: this
          };
          filteredOptions.pretty = options.pretty || false;
          filteredOptions.allowEmpty = options.allowEmpty || false;
          filteredOptions.indent = (ref = options.indent) != null ? ref : '  ';
          filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : '\n';
          filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
          filteredOptions.dontPrettyTextNodes = (ref3 = (ref4 = options.dontPrettyTextNodes) != null ? ref4 : options.dontprettytextnodes) != null ? ref3 : 0;
          filteredOptions.spaceBeforeSlash = (ref5 = (ref6 = options.spaceBeforeSlash) != null ? ref6 : options.spacebeforeslash) != null ? ref5 : '';
          if (filteredOptions.spaceBeforeSlash === true) {
            filteredOptions.spaceBeforeSlash = ' ';
          }
          filteredOptions.suppressPrettyCount = 0;
          filteredOptions.user = {};
          filteredOptions.state = WriterState.None;
          return filteredOptions;
        };
    
        XMLWriterBase.prototype.indent = function(node, options, level) {
          var indentLevel;
          if (!options.pretty || options.suppressPrettyCount) {
            return '';
          } else if (options.pretty) {
            indentLevel = (level || 0) + options.offset + 1;
            if (indentLevel > 0) {
              return new Array(indentLevel).join(options.indent);
            }
          }
          return '';
        };
    
        XMLWriterBase.prototype.endline = function(node, options, level) {
          if (!options.pretty || options.suppressPrettyCount) {
            return '';
          } else {
            return options.newline;
          }
        };
    
        XMLWriterBase.prototype.attribute = function(att, options, level) {
          var r;
          this.openAttribute(att, options, level);
          r = ' ' + att.name + '="' + att.value + '"';
          this.closeAttribute(att, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.cdata = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level) + '<![CDATA[';
          options.state = WriterState.InsideTag;
          r += node.value;
          options.state = WriterState.CloseTag;
          r += ']]>' + this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.comment = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level) + '<!-- ';
          options.state = WriterState.InsideTag;
          r += node.value;
          options.state = WriterState.CloseTag;
          r += ' -->' + this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.declaration = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level) + '<?xml';
          options.state = WriterState.InsideTag;
          r += ' version="' + node.version + '"';
          if (node.encoding != null) {
            r += ' encoding="' + node.encoding + '"';
          }
          if (node.standalone != null) {
            r += ' standalone="' + node.standalone + '"';
          }
          options.state = WriterState.CloseTag;
          r += options.spaceBeforeSlash + '?>';
          r += this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.docType = function(node, options, level) {
          var child, i, len, r, ref;
          level || (level = 0);
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level);
          r += '<!DOCTYPE ' + node.root().name;
          if (node.pubID && node.sysID) {
            r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
          } else if (node.sysID) {
            r += ' SYSTEM "' + node.sysID + '"';
          }
          if (node.children.length > 0) {
            r += ' [';
            r += this.endline(node, options, level);
            options.state = WriterState.InsideTag;
            ref = node.children;
            for (i = 0, len = ref.length; i < len; i++) {
              child = ref[i];
              r += this.writeChildNode(child, options, level + 1);
            }
            options.state = WriterState.CloseTag;
            r += ']';
          }
          options.state = WriterState.CloseTag;
          r += options.spaceBeforeSlash + '>';
          r += this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.element = function(node, options, level) {
          var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;
          level || (level = 0);
          prettySuppressed = false;
          r = '';
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r += this.indent(node, options, level) + '<' + node.name;
          ref = node.attribs;
          for (name in ref) {
            if (!hasProp.call(ref, name)) continue;
            att = ref[name];
            r += 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) {
              r += '>';
              options.state = WriterState.CloseTag;
              r += '</' + node.name + '>' + this.endline(node, options, level);
            } else {
              options.state = WriterState.CloseTag;
              r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);
            }
          } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {
            r += '>';
            options.state = WriterState.InsideTag;
            options.suppressPrettyCount++;
            prettySuppressed = true;
            r += this.writeChildNode(firstChildNode, options, level + 1);
            options.suppressPrettyCount--;
            prettySuppressed = false;
            options.state = WriterState.CloseTag;
            r += '</' + node.name + '>' + this.endline(node, options, level);
          } else {
            if (options.dontPrettyTextNodes) {
              ref1 = node.children;
              for (i = 0, len = ref1.length; i < len; i++) {
                child = ref1[i];
                if ((child.type === NodeType.Text || child.type === NodeType.Raw) && (child.value != null)) {
                  options.suppressPrettyCount++;
                  prettySuppressed = true;
                  break;
                }
              }
            }
            r += '>' + this.endline(node, options, level);
            options.state = WriterState.InsideTag;
            ref2 = node.children;
            for (j = 0, len1 = ref2.length; j < len1; j++) {
              child = ref2[j];
              r += this.writeChildNode(child, options, level + 1);
            }
            options.state = WriterState.CloseTag;
            r += this.indent(node, options, level) + '</' + node.name + '>';
            if (prettySuppressed) {
              options.suppressPrettyCount--;
            }
            r += this.endline(node, options, level);
            options.state = WriterState.None;
          }
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.writeChildNode = function(node, options, level) {
          switch (node.type) {
            case NodeType.CData:
              return this.cdata(node, options, level);
            case NodeType.Comment:
              return this.comment(node, options, level);
            case NodeType.Element:
              return this.element(node, options, level);
            case NodeType.Raw:
              return this.raw(node, options, level);
            case NodeType.Text:
              return this.text(node, options, level);
            case NodeType.ProcessingInstruction:
              return this.processingInstruction(node, options, level);
            case NodeType.Dummy:
              return '';
            case NodeType.Declaration:
              return this.declaration(node, options, level);
            case NodeType.DocType:
              return this.docType(node, options, level);
            case NodeType.AttributeDeclaration:
              return this.dtdAttList(node, options, level);
            case NodeType.ElementDeclaration:
              return this.dtdElement(node, options, level);
            case NodeType.EntityDeclaration:
              return this.dtdEntity(node, options, level);
            case NodeType.NotationDeclaration:
              return this.dtdNotation(node, options, level);
            default:
              throw new Error("Unknown XML node type: " + node.constructor.name);
          }
        };
    
        XMLWriterBase.prototype.processingInstruction = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level) + '<?';
          options.state = WriterState.InsideTag;
          r += node.target;
          if (node.value) {
            r += ' ' + node.value;
          }
          options.state = WriterState.CloseTag;
          r += options.spaceBeforeSlash + '?>';
          r += this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.raw = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level);
          options.state = WriterState.InsideTag;
          r += node.value;
          options.state = WriterState.CloseTag;
          r += this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.text = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level);
          options.state = WriterState.InsideTag;
          r += node.value;
          options.state = WriterState.CloseTag;
          r += this.endline(node, options, level);
          options.state = WriterState.None;
          this.closeNode(node, options, level);
          return r;
        };
    
        XMLWriterBase.prototype.dtdAttList = function(node, options, level) {
          var r;
          this.openNode(node, options, level);
          options.state = WriterState.OpenTag;
          r = this.indent(node, options, level) + '<!ATTLIST';
          options.state = WriterState.InsideTag;