(function (root, factory) { if (typeof define === 'function' && define.amd) define(['exports', 'kotlin'], factory); else if (typeof exports === 'object') factory(module.exports, require('kotlin')); else { if (typeof kotlin === 'undefined') { throw new Error("Error loading module 'xmlpullparserkmp-js-legacy'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'xmlpullparserkmp-js-legacy'."); }root['xmlpullparserkmp-js-legacy'] = factory(typeof this['xmlpullparserkmp-js-legacy'] === 'undefined' ? {} : this['xmlpullparserkmp-js-legacy'], kotlin); } }(this, function (_, Kotlin) { 'use strict'; var Kind_OBJECT = Kotlin.Kind.OBJECT; var Kind_CLASS = Kotlin.Kind.CLASS; var Kind_INTERFACE = Kotlin.Kind.INTERFACE; var Exception_init = Kotlin.kotlin.Exception_init_pdl1vj$; var Exception = Kotlin.kotlin.Exception; var IllegalStateException_init = Kotlin.kotlin.IllegalStateException_init_pdl1vj$; var LinkedHashMap_init = Kotlin.kotlin.collections.LinkedHashMap_init_q3lmfv$; var throwUPAE = Kotlin.throwUPAE; var startsWith = Kotlin.kotlin.text.startsWith_7epoxm$; var equals = Kotlin.equals; var last = Kotlin.kotlin.collections.last_2p1efm$; var removeLastOrNull = Kotlin.kotlin.collections.removeLastOrNull_vvxzk3$; var indexOf = Kotlin.kotlin.collections.indexOf_bv23uc$; var reverse = Kotlin.kotlin.collections.reverse_vvxzk3$; var asList = Kotlin.org.w3c.dom.asList_kt9thq$; var IndexOutOfBoundsException_init = Kotlin.kotlin.IndexOutOfBoundsException_init; var contains = Kotlin.kotlin.text.contains_li3zpu$; var isBlank = Kotlin.kotlin.text.isBlank_gw00vp$; var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_287e2$; var emptyList = Kotlin.kotlin.collections.emptyList_287e2$; var LinkedHashSet_init = Kotlin.kotlin.collections.LinkedHashSet_init_287e2$; XmlPullParserException.prototype = Object.create(Exception.prototype); XmlPullParserException.prototype.constructor = XmlPullParserException; function XmlPullParserConstants() { XmlPullParserConstants_instance = this; this.START_DOCUMENT = 0; this.END_DOCUMENT = 1; this.START_TAG = 2; this.END_TAG = 3; this.TEXT = 4; this.CDSECT = 5; this.DOCDECL = 10; this.ENTITY_REF = 6; this.FEATURE_PROCESS_NAMESPACES = 'http://xmlpull.org/v1/doc/features.html#process-namespaces'; this.PROPERTY_STANDALONE = 'http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone'; this.PROPERTY_VERSION = 'http://xmlpull.org/v1/doc/properties.html#xmldecl-version'; } XmlPullParserConstants.$metadata$ = { kind: Kind_OBJECT, simpleName: 'XmlPullParserConstants', interfaces: [] }; var XmlPullParserConstants_instance = null; function XmlPullParserConstants_getInstance() { if (XmlPullParserConstants_instance === null) { new XmlPullParserConstants(); }return XmlPullParserConstants_instance; } function ParserEvent() { this.eventNode = null; this.eventNodeDepth = -1; this.eventType = -1; } ParserEvent.$metadata$ = { kind: Kind_CLASS, simpleName: 'ParserEvent', interfaces: [] }; function XmlPullParser() { } XmlPullParser.$metadata$ = { kind: Kind_INTERFACE, simpleName: 'XmlPullParser', interfaces: [] }; function XmlPullParserException(message) { Exception_init(message, this); this.name = 'XmlPullParserException'; } XmlPullParserException.$metadata$ = { kind: Kind_CLASS, simpleName: 'XmlPullParserException', interfaces: [Exception] }; function setInputString($receiver, xmlString) { $receiver.setInput_61zpoe$(xmlString); } function XmlPullParserFactory() { XmlPullParserFactory$Companion_getInstance(); this.features_naxo9$_0 = LinkedHashMap_init(); } XmlPullParserFactory.prototype.setFeature_ivxn3r$ = function (name, state) { this.features_naxo9$_0.put_xwzc9p$(name, state); }; XmlPullParserFactory.prototype.getFeature_61zpoe$ = function (name) { var tmp$; return (tmp$ = this.features_naxo9$_0.get_11rb$(name)) != null ? tmp$ : false; }; XmlPullParserFactory.prototype.setNamespaceAware_6taknv$ = function (awareness) { this.setFeature_ivxn3r$(XmlPullParserFactory$Companion_getInstance().FEATURE_NAMESPACE, awareness); }; XmlPullParserFactory.prototype.isNamespaceAware = function () { return this.getFeature_61zpoe$(XmlPullParserFactory$Companion_getInstance().FEATURE_NAMESPACE); }; XmlPullParserFactory.prototype.setValidating_6taknv$ = function (validating) { this.setFeature_ivxn3r$(XmlPullParserFactory$Companion_getInstance().FEATURE_VALIDATING, validating); }; XmlPullParserFactory.prototype.isValidating = function () { return this.getFeature_61zpoe$(XmlPullParserFactory$Companion_getInstance().FEATURE_VALIDATING); }; XmlPullParserFactory.prototype.newPullParser = function () { var xpp = new XmlPullParserJsImpl(); var tmp$; tmp$ = this.features_naxo9$_0.entries.iterator(); while (tmp$.hasNext()) { var element = tmp$.next(); xpp.setFeature_ivxn3r$(element.key, element.value); } return xpp; }; XmlPullParserFactory.prototype.newSerializer = function () { throw IllegalStateException_init('Not available on Javascript yet'); }; function XmlPullParserFactory$Companion() { XmlPullParserFactory$Companion_instance = this; this.FEATURE_VALIDATING = 'http://xmlpull.org/v1/doc/features.html#validation'; this.FEATURE_NAMESPACE = 'http://xmlpull.org/v1/doc/features.html#process-namespaces'; } XmlPullParserFactory$Companion.prototype.newInstance = function () { return new XmlPullParserFactory(); }; XmlPullParserFactory$Companion.$metadata$ = { kind: Kind_OBJECT, simpleName: 'Companion', interfaces: [] }; var XmlPullParserFactory$Companion_instance = null; function XmlPullParserFactory$Companion_getInstance() { if (XmlPullParserFactory$Companion_instance === null) { new XmlPullParserFactory$Companion(); }return XmlPullParserFactory$Companion_instance; } XmlPullParserFactory.$metadata$ = { kind: Kind_CLASS, simpleName: 'XmlPullParserFactory', interfaces: [] }; function XmlPullParserJsImpl() { this.treeWalker_pdgf4x$_0 = this.treeWalker_pdgf4x$_0; this.document_yfpuna$_0 = this.document_yfpuna$_0; this.eventsStack_0 = ArrayList_init(); this.parentNodesStack_0 = ArrayList_init(); this.nextNode_0 = null; this.currentEvent_0 = null; this.lastParentNode_0 = null; this.processNsp_0 = false; this.relaxed_0 = true; } Object.defineProperty(XmlPullParserJsImpl.prototype, 'treeWalker_0', { configurable: true, get: function () { if (this.treeWalker_pdgf4x$_0 == null) return throwUPAE('treeWalker'); return this.treeWalker_pdgf4x$_0; }, set: function (treeWalker) { this.treeWalker_pdgf4x$_0 = treeWalker; } }); Object.defineProperty(XmlPullParserJsImpl.prototype, 'document_0', { configurable: true, get: function () { if (this.document_yfpuna$_0 == null) return throwUPAE('document'); return this.document_yfpuna$_0; }, set: function (document) { this.document_yfpuna$_0 = document; } }); function XmlPullParserJsImpl$setInput$lambda(it) { return NodeFilter.FILTER_ACCEPT; } XmlPullParserJsImpl.prototype.setInput_61zpoe$ = function (content) { this.document_0 = (new DOMParser()).parseFromString(content, 'text/' + (startsWith(content, '