starplate
Version:
View engine built on incremental-dom
2 lines • 241 kB
JavaScript
!function(l){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=l();else if("function"==typeof define&&define.amd)define([],l);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.starplate=l()}}(function(){return function l(e,t,n){function r(i,o){if(!t[i]){if(!e[i]){var s="function"==typeof require&&require;if(!o&&s)return s(i,!0);if(c)return c(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var T=t[i]={exports:{}};e[i][0].call(T.exports,function(l){var t=e[i][1][l];return r(t?t:l)},T,T.exports,l,e,t,n)}return t[i].exports}for(var c="function"==typeof require&&require,i=0;i<n.length;i++)r(n[i]);return r}({1:[function(l,e,t){"use strict";function n(l){return l&&l.__esModule?l:{"default":l}}Object.defineProperty(t,"__esModule",{value:!0});var r=l("./template"),c=n(r),i=l("./parser"),o=n(i),s=l("./view"),a=n(s);t.Template=c["default"],t.Parser=o["default"],t.View=a["default"]},{"./parser":2,"./template":3,"./view":4}],2:[function(l,e,t){"use strict";function n(l){return l&&l.__esModule?l:{"default":l}}function r(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function c(l,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(l,e):l.__proto__=e)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function l(l,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}}(),o=function(l,e,t){for(var n=!0;n;){var r=l,c=e,i=t;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,c);if(void 0!==o){if("value"in o)return o.value;var s=o.get;return void 0===s?void 0:s.call(i)}var a=Object.getPrototypeOf(r);if(null===a)return void 0;l=a,e=c,t=i,n=!0,o=a=void 0}},s=l("parse5"),a=n(s),T=l("incremental-dom"),E=function(){return Math.abs(Math.random()*Date.now()|1).toString("16")},h=function(l){return"function"==typeof l?l:function(){return void 0}},u=null,p=function(l){function e(){r(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,a["default"].TreeAdapters.htmlparser2),this.patches=new Map}return c(e,l),i(e,null,[{key:"sharedInstance",value:function(){return u=u||new e}}]),i(e,[{key:"createPatch",value:function(l){function e(l){var t=[],n=l.attribs?l.attribs.id:E(),r=l.attribs,c=(l.parent,Boolean(l.children?l.children.length:0));if(r&&Object.keys(r).length)for(var o in r)r[o]&&t.push(o,r[o]);if("tag"==l.type)i(function(){return T.elementOpen.apply(void 0,[l.name,n,null].concat(t))}),c&&l.children.forEach(e),i(function(){return T.elementClose(l.name)});else if("text"==l.type&&l.data)i(function(){return T.text(l.data)});else if("script"!=l.type)throw new TypeError("Unhandled node type "+l.type+".")}var t=l;if(!this.hasPatch(l))return this.getPatch(l);l instanceof HTMLElement&&(t=l.innerHTML),t=String(t).replace(/\n/g," ").replace(/\r/g," ");var n=this.parseFragment(t),r=n.children,c=[],i=function(l){return c.push(l)},o=function(l,e){e=h(e),T.patch(l,function(){c.forEach(function(l){return l()}),e()})};return r.forEach(e),this.patches.set(l,o),o}},{key:"hasPatch",value:function(l){return 0==this.patches.has(l)}},{key:"getPatch",value:function(l){return this.patches.get(l)||null}}]),e}(a["default"].Parser);t["default"]=p,e.exports=t["default"]},{"incremental-dom":7,parse5:8}],3:[function(l,e,t){"use strict";function n(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function r(l){var e=String();if("function"==typeof l)return l;if(null==l||"object"!=typeof l){if("string"==typeof l)try{return JSON.stringify(JSON.parse(l))}catch(t){}return JSON.stringify(l)}if("object"==typeof l){for(var n in l)l[n]=r(l[n]);if(Array.isArray(l)){e+="[";for(var n in l)e+=l[n]+", ";e+="]"}else{e+="{";for(var n in l)e+=n+": "+l[n]+", ";e+="}"}}return e}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function l(l,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}}(),i=l("./view"),o=function(l){return null!=l&&"object"==typeof l?l:{}},s=function(){function l(e){n(this,l),this.source=null,this.render=null,this.define(e)}return c(l,null,[{key:"createPartial",value:function(l){var e=this;return"string"==typeof l&&(l=l.replace(RegExp("`","g","\\`"))),function(t,n){t=o(t),n=n||e;var c=l,s=Object.keys(t).filter(function(l){return 0==i.helpers.has(l)}).map(function(l){var e=r(t[l]);return l+" = "+e}),a=!0,T=!1,E=void 0;try{for(var h,u=i.helpers.entries()[Symbol.iterator]();!(a=(h=u.next()).done);a=!0){var p=h.value;s.push(p[0]+" = "+r(p[1]))}}catch(m){T=!0,E=m}finally{try{!a&&u["return"]&&u["return"]()}finally{if(T)throw E}}s=s.length?"var "+s.join(", ")+";":"","string"==typeof l&&(l=l.replace(/\#\{/g,"${")),"function"!=typeof c&&(c=new Function("data","'use strict'; "+s+" return `"+l+"`"));var _="'use strict'; return wrap.call(this, data);",A=new Function("data","wrap",_);return String(A.call(n,t,c)||"")}}}]),c(l,[{key:"define",value:function(e){return this.source=e,this.render=l.createPartial(e),this}},{key:"toString",value:function(){return String(this.source||"")}},{key:"valueOf",value:function(){return this.source}}]),l}();t["default"]=s,e.exports=t["default"]},{"./view":4}],4:[function(l,e,t){"use strict";function n(l){return l&&l.__esModule?l:{"default":l}}function r(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function c(l,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(l,e):l.__proto__=e)}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function l(l,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(l,n.key,n)}}return function(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}}(),o=function(l,e,t){for(var n=!0;n;){var r=l,c=e,i=t;n=!1,null===r&&(r=Function.prototype);var o=Object.getOwnPropertyDescriptor(r,c);if(void 0!==o){if("value"in o)return o.value;var s=o.get;return void 0===s?void 0:s.call(i)}var a=Object.getPrototypeOf(r);if(null===a)return void 0;l=a,e=c,t=i,n=!0,o=a=void 0}},s=l("events"),a=l("./template"),T=n(a),E=l("./parser"),h=n(E),u=function(l){return"string"==typeof l?new Text(l):l&&l.length&&l[0]?l[0]:l},p=function(l){var e=document.createElement("body"),t=document.createDocumentFragment(),n=null;try{e.innerHTML=l,t.appendChild(e),n=e.children}catch(r){}return(n&&n.length>1?n:n[0])||l},m=function f(l,e){for(var t in e)"object"==typeof e[t]&&"object"==typeof l[t]?f(l[t],e[t]):l[t]="object"==typeof e[t]?f(Array.isArray(e[t])?[]:{},e[t]):e[t];return l},_=function(l){return m(Array.isArray(l)?[]:{},l)},A=new Map;t.helpers=A;var d=function(l){function e(l){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];r(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this),0==l instanceof T["default"]&&(l=new T["default"](l)),this.model=t||{},this.template=l,this.domElement=u(p(this.template.render(this.model)))}return c(e,l),i(e,null,[{key:"helper",value:function(l,t){if(l&&t){if("function"!=typeof t)throw new TypeError("Expecting definition to be a function.");if("string"!=typeof l)throw new TypeError("Expecting name to be a string.");return A.set(l,t),e}if(l)return A.get(l)||null;throw new TypeError("Expecting at least 1 argument.")}}]),i(e,[{key:"render",value:function(){var l=arguments.length<=0||void 0===arguments[0]?document.body:arguments[0],e=this.domElement;if(0==l instanceof Element)throw new TypeError("Expecting a DOM Element.");return 0==l.contains(e)&&l.appendChild(e),this}},{key:"update",value:function(l){return this.model=m(this.model||{},l||{}),this.patch(p(this.template.render(_(this.model)))),this}},{key:"patch",value:function t(l){var e=this.domElement,n=h["default"].sharedInstance(),t=n.createPatch(l);return t(e),this}},{key:"destroy",value:function(){var l=this.domElement,e=l&&l.parentElement;return e&&l&&e.contains(l)&&e.removeChild(l),this}},{key:"toString",value:function(){return String(this.domElement?this.domElement.outerHTML||"":"")}},{key:"valueOf",value:function(){return this.domElement}}]),e}(s.EventEmitter);t["default"]=d},{"./parser":2,"./template":3,events:5}],5:[function(l,e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(l){return"function"==typeof l}function r(l){return"number"==typeof l}function c(l){return"object"==typeof l&&null!==l}function i(l){return void 0===l}e.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(l){if(!r(l)||0>l||isNaN(l))throw TypeError("n must be a positive number");return this._maxListeners=l,this},t.prototype.emit=function(l){var e,t,r,o,s,a;if(this._events||(this._events={}),"error"===l&&(!this._events.error||c(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(t=this._events[l],i(t))return!1;if(n(t))switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),s=1;r>s;s++)o[s-1]=arguments[s];t.apply(this,o)}else if(c(t)){for(r=arguments.length,o=new Array(r-1),s=1;r>s;s++)o[s-1]=arguments[s];for(a=t.slice(),r=a.length,s=0;r>s;s++)a[s].apply(this,o)}return!0},t.prototype.addListener=function(l,e){var r;if(!n(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",l,n(e.listener)?e.listener:e),this._events[l]?c(this._events[l])?this._events[l].push(e):this._events[l]=[this._events[l],e]:this._events[l]=e,c(this._events[l])&&!this._events[l].warned){var r;r=i(this._maxListeners)?t.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[l].length>r&&(this._events[l].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[l].length),"function"==typeof console.trace&&console.trace())}return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(l,e){function t(){this.removeListener(l,t),r||(r=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var r=!1;return t.listener=e,this.on(l,t),this},t.prototype.removeListener=function(l,e){var t,r,i,o;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[l])return this;if(t=this._events[l],i=t.length,r=-1,t===e||n(t.listener)&&t.listener===e)delete this._events[l],this._events.removeListener&&this.emit("removeListener",l,e);else if(c(t)){for(o=i;o-->0;)if(t[o]===e||t[o].listener&&t[o].listener===e){r=o;break}if(0>r)return this;1===t.length?(t.length=0,delete this._events[l]):t.splice(r,1),this._events.removeListener&&this.emit("removeListener",l,e)}return this},t.prototype.removeAllListeners=function(l){var e,t;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[l]&&delete this._events[l],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(t=this._events[l],n(t))this.removeListener(l,t);else for(;t.length;)this.removeListener(l,t[t.length-1]);return delete this._events[l],this},t.prototype.listeners=function(l){var e;return e=this._events&&this._events[l]?n(this._events[l])?[this._events[l]]:this._events[l].slice():[]},t.listenerCount=function(l,e){var t;return t=l._events&&l._events[e]?n(l._events[e])?1:l._events[e].length:0}},{}],6:[function(l,e){function t(){a=!1,i.length?s=i.concat(s):T=-1,s.length&&n()}function n(){if(!a){var l=setTimeout(t);a=!0;for(var e=s.length;e;){for(i=s,s=[];++T<e;)i&&i[T].run();T=-1,e=s.length}i=null,a=!1,clearTimeout(l)}}function r(l,e){this.fun=l,this.array=e}function c(){}var i,o=e.exports={},s=[],a=!1,T=-1;o.nextTick=function(l){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];s.push(new r(l,e)),1!==s.length||a||setTimeout(n,0)},r.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=c,o.addListener=c,o.once=c,o.off=c,o.removeListener=c,o.removeAllListeners=c,o.emit=c,o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],7:[function(l,e,t){(function(l){"use strict";function e(l){this.stack_=[],this.root=l,this.currentNode=l}function n(l,n){this.walker=new e(l),this.doc=l.ownerDocument,this.nsStack_=[void 0],this.prevContext=n,this.created=t.notifications.nodesCreated&&[],this.deleted=t.notifications.nodesDeleted&&[]}function r(l,e){this.attrs=h(),this.attrsArr=[],this.newAttrs=h(),this.key=e,this.keyMap=null,this.keyMapValid=!0,this.lastVisitedChild=null,this.nodeName=l,this.text=null}t.notifications={nodesCreated:null,nodesDeleted:null},e.prototype.getCurrentParent=function(){return this.stack_[this.stack_.length-1]},e.prototype.firstChild=function(){this.stack_.push(this.currentNode),this.currentNode=this.currentNode.firstChild},e.prototype.nextSibling=function(){this.currentNode=this.currentNode.nextSibling},e.prototype.parentNode=function(){this.currentNode=this.stack_.pop()},n.prototype.getCurrentNamespace=function(){return this.nsStack_[this.nsStack_.length-1]},n.prototype.enterNamespace=function(l){this.nsStack_.push(l)},n.prototype.exitNamespace=function(){this.nsStack_.pop()},n.prototype.markCreated=function(l){this.created&&this.created.push(l)},n.prototype.markDeleted=function(l){this.deleted&&this.deleted.push(l)},n.prototype.notifyChanges=function(){this.created&&this.created.length>0&&t.notifications.nodesCreated(this.created),this.deleted&&this.deleted.length>0&&t.notifications.nodesDeleted(this.deleted)};var c,i=function(l){c=new n(l,c)},o=function(){c=c.prevContext},s=function(){return c},a=Object.prototype.hasOwnProperty,T=Object.create,E=function(l,e){return a.call(l,e)},h=function(){return T(null)},u=function(l,e,t){var n=new r(e,t);return l.__incrementalDOMData=n,n},p=function(l){var e=l.__incrementalDOMData;if(!e){var t=l.nodeName.toLowerCase(),n=null;l instanceof Element&&(n=l.getAttribute("key")),e=u(l,t,n)}return e};t.symbols={"default":"__default",placeholder:"__placeholder"},t.applyAttr=function(l,e,t){null==t?l.removeAttribute(e):l.setAttribute(e,t)},t.applyProp=function(l,e,t){l[e]=t};var m=function(l,e,t){if("string"==typeof t)l.style.cssText=t;else{l.style.cssText="";var n=l.style;for(var r in t)E(t,r)&&(n[r]=t[r])}},_=function(l,e,n){var r=typeof n;"object"===r||"function"===r?t.applyProp(l,e,n):t.applyAttr(l,e,n)},A=function(l,e,n){var r=p(l),c=r.attrs;if(c[e]!==n){var i=t.attributes[e]||t.attributes[t.symbols["default"]];i(l,e,n),c[e]=n}};t.attributes=h(),t.attributes[t.symbols["default"]]=_,t.attributes[t.symbols.placeholder]=function(){},t.attributes.style=m;var d="http://www.w3.org/2000/svg",f=function(l){"svg"===l?s().enterNamespace(d):"foreignObject"===l&&s().enterNamespace(void 0)},N=function(l){("svg"===l||"foreignObject"===l)&&s().exitNamespace()},C=function(l){return"svg"===l?d:s().getCurrentNamespace()},O=function(l,e,t,n){var r,c=C(e);if(r=c?l.createElementNS(c,e):l.createElement(e),u(r,e,t),n)for(var i=0;i<n.length;i+=2)A(r,n[i],n[i+1]);return r},g=function(l,e,t,n){return"#text"===e?l.createTextNode(""):O(l,e,t,n)},L=function(l){for(var e=h(),t=l.children,n=t.length,r=0;n>r;r+=1){var c=t[r],i=p(c).key;i&&(e[i]=c)}return e},R=function(l){var e=p(l);return e.keyMap||(e.keyMap=L(l)),e.keyMap},S=function(l,e){return e&&R(l)[e]},M=function(l,e,t){R(l)[e]=t};if("production"!==l.env.NODE_ENV)var k=function(l,e,t){var n=p(l).nodeName;if(n!==e)throw new Error('Was expecting node with key "'+t+'" to be a '+e+", not a "+n+".")};var I=function(l,e,t){var n=p(l);return t==n.key&&e===n.nodeName},v=function(e,t,n){var r,c=s(),i=c.walker,o=i.currentNode,a=i.getCurrentParent();if(o&&I(o,e,t))r=o;else{var T=S(a,t);T?("production"!==l.env.NODE_ENV&&k(T,e,t),r=T):(r=g(c.doc,e,t,n),t&&M(a,t,r),c.markCreated(r)),o&&p(o).key?(a.replaceChild(r,o),p(a).keyMapValid=!1):a.insertBefore(r,o),i.currentNode=r}return r},P=function(l){var e,n=s(),r=n.walker,c=p(l),i=c.keyMap,o=c.keyMapValid,a=c.lastVisitedChild,T=l.lastChild;if(c.lastVisitedChild=null,!(T===a&&o||c.attrs[t.symbols.placeholder]&&r.currentNode!==r.root)){for(;T!==a;)l.removeChild(T),n.markDeleted(T),e=p(T).key,e&&delete i[e],T=l.lastChild;for(e in i)T=i[e],T.parentNode||(n.markDeleted(T),delete i[e]);c.keyMapValid=!0}},H=function(l){var e=p(l);f(e.nodeName)},y=function(l){var e=p(l);N(e.nodeName)},D=function(l){var e=s(),t=e.walker,n=t.getCurrentParent(),r=p(n);r.lastVisitedChild=l},F=function(){var l=s(),e=l.walker;H(e.currentNode),e.firstChild()},b=function(){var l=s(),e=l.walker;D(e.currentNode),e.nextSibling()},G=function(){var l=s(),e=l.walker;e.parentNode(),y(e.currentNode)};if("production"!==l.env.NODE_ENV)var U=function(l){var e=s().walker.getCurrentParent();if(e){for(var t=[];e&&e!==l;)t.push(e.nodeName.toLowerCase()),e=e.parentNode;throw new Error("One or more tags were not closed:\n"+t.join("\n"))}};t.patch=function(e,t,n){i(e),F(),t(n),G(),P(e),"production"!==l.env.NODE_ENV&&U(e),s().notifyChanges(),o()};var x=3,B=[];if("production"!==l.env.NODE_ENV)var K=!1,w=function(){if(K)throw new Error("Was not expecting a call to attr or elementOpenEnd, they must follow a call to elementOpenStart.")},Y=function(){if(!K)throw new Error("Was expecting a call to attr or elementOpenEnd. elementOpenStart must be followed by zero or more calls to attr, then one call to elementOpenEnd.")},Q=function(l){if(!l)throw new Error("Placeholder elements must have a key specified.")},X=function(l){var e=s(),t=e.walker,n=t.getCurrentParent(),r=p(n);if(l!==r.nodeName)throw new Error("Received a call to close "+l+" but "+r.nodeName+" was open.")},z=function(){K=!0},j=function(){K=!1};t.elementOpen=function(e,t,n){"production"!==l.env.NODE_ENV&&w();for(var r=v(e,t,n),c=p(r),i=c.attrsArr,o=!1,s=x,a=0;s<arguments.length;s+=1,a+=1)if(i[a]!==arguments[s]){o=!0;break}for(;s<arguments.length;s+=1,a+=1)i[a]=arguments[s];if(a<i.length&&(o=!0,i.length=a),o){var T,E=c.newAttrs;for(T in E)E[T]=void 0;for(s=x;s<arguments.length;s+=2)E[arguments[s]]=arguments[s+1];for(T in E)A(r,T,E[T])}return F(),r},t.elementOpenStart=function(e,t,n){"production"!==l.env.NODE_ENV&&(w(),z()),B[0]=e,B[1]=t,B[2]=n},t.attr=function(e,t){"production"!==l.env.NODE_ENV&&Y(),B.push(e,t)},t.elementOpenEnd=function(){"production"!==l.env.NODE_ENV&&(Y(),j());var e=t.elementOpen.apply(null,B);return B.length=0,e},t.elementClose=function(e){"production"!==l.env.NODE_ENV&&(w(),X(e)),G();var t=s().walker.currentNode;return P(t),b(),t},t.elementVoid=function(){var l=t.elementOpen.apply(null,arguments);return t.elementClose.apply(null,arguments),l},t.elementPlaceholder=function(e,n){"production"!==l.env.NODE_ENV&&Q(n);var r=t.elementOpen.apply(null,arguments);return A(r,t.symbols.placeholder,!0),t.elementClose.apply(null,arguments),r},t.text=function(e){"production"!==l.env.NODE_ENV&&w();var t=v("#text",null),n=p(t);if(n.text!==e){n.text=e;for(var r=e,c=1;c<arguments.length;c+=1)r=arguments[c](r);t.data=r}return b(),t}}).call(this,l("_process"))},{_process:6}],8:[function(l,e,t){"use strict";t.Parser=l("./lib/tree_construction/parser"),t.SimpleApiParser=l("./lib/simple_api/simple_api_parser"),t.TreeSerializer=t.Serializer=l("./lib/serialization/serializer"),t.JsDomParser=l("./lib/jsdom/jsdom_parser"),t.TreeAdapters={"default":l("./lib/tree_adapters/default"),htmlparser2:l("./lib/tree_adapters/htmlparser2")}},{"./lib/jsdom/jsdom_parser":14,"./lib/serialization/serializer":16,"./lib/simple_api/simple_api_parser":17,"./lib/tree_adapters/default":23,"./lib/tree_adapters/htmlparser2":24,"./lib/tree_construction/parser":28}],9:[function(l,e,t){"use strict";function n(l){var e=-1!==l.indexOf('"')?"'":'"';return e+l+e}var r="html",c="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",i=["+//silmaril//dtd html pro v0r11 19970101//en","-//advasoft ltd//dtd html 3.0 aswedit + extensions//en","-//as//dtd html 3.0 aswedit + extensions//en","-//ietf//dtd html 2.0 level 1//en","-//ietf//dtd html 2.0 level 2//en","-//ietf//dtd html 2.0 strict level 1//en","-//ietf//dtd html 2.0 strict level 2//en","-//ietf//dtd html 2.0 strict//en","-//ietf//dtd html 2.0//en","-//ietf//dtd html 2.1e//en","-//ietf//dtd html 3.0//en","-//ietf//dtd html 3.0//en//","-//ietf//dtd html 3.2 final//en","-//ietf//dtd html 3.2//en","-//ietf//dtd html 3//en","-//ietf//dtd html level 0//en","-//ietf//dtd html level 0//en//2.0","-//ietf//dtd html level 1//en","-//ietf//dtd html level 1//en//2.0","-//ietf//dtd html level 2//en","-//ietf//dtd html level 2//en//2.0","-//ietf//dtd html level 3//en","-//ietf//dtd html level 3//en//3.0","-//ietf//dtd html strict level 0//en","-//ietf//dtd html strict level 0//en//2.0","-//ietf//dtd html strict level 1//en","-//ietf//dtd html strict level 1//en//2.0","-//ietf//dtd html strict level 2//en","-//ietf//dtd html strict level 2//en//2.0","-//ietf//dtd html strict level 3//en","-//ietf//dtd html strict level 3//en//3.0","-//ietf//dtd html strict//en","-//ietf//dtd html strict//en//2.0","-//ietf//dtd html strict//en//3.0","-//ietf//dtd html//en","-//ietf//dtd html//en//2.0","-//ietf//dtd html//en//3.0","-//metrius//dtd metrius presentational//en","-//microsoft//dtd internet explorer 2.0 html strict//en","-//microsoft//dtd internet explorer 2.0 html//en","-//microsoft//dtd internet explorer 2.0 tables//en","-//microsoft//dtd internet explorer 3.0 html strict//en","-//microsoft//dtd internet explorer 3.0 html//en","-//microsoft//dtd internet explorer 3.0 tables//en","-//netscape comm. corp.//dtd html//en","-//netscape comm. corp.//dtd strict html//en","-//o'reilly and associates//dtd html 2.0//en","-//o'reilly and associates//dtd html extended 1.0//en","-//spyglass//dtd html 2.0 extended//en","-//sq//dtd html 2.0 hotmetal + extensions//en","-//sun microsystems corp.//dtd hotjava html//en","-//sun microsystems corp.//dtd hotjava strict html//en","-//w3c//dtd html 3 1995-03-24//en","-//w3c//dtd html 3.2 draft//en","-//w3c//dtd html 3.2 final//en","-//w3c//dtd html 3.2//en","-//w3c//dtd html 3.2s draft//en","-//w3c//dtd html 4.0 frameset//en","-//w3c//dtd html 4.0 transitional//en","-//w3c//dtd html experimental 19960712//en","-//w3c//dtd html experimental 970421//en","-//w3c//dtd w3 html//en","-//w3o//dtd w3 html 3.0//en","-//w3o//dtd w3 html 3.0//en//","-//webtechs//dtd mozilla html 2.0//en","-//webtechs//dtd mozilla html//en"],o=["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],s=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"];t.isQuirks=function(l,e,t){if(l!==r)return!0;if(t&&t.toLowerCase()===c)return!0;if(null!==e){if(e=e.toLowerCase(),s.indexOf(e)>-1)return!0;var n=i;null===t&&(n=n.concat(o));for(var a=0;a<n.length;a++)if(0===e.indexOf(n[a]))return!0}return!1},t.serializeContent=function(l,e,t){var r="!DOCTYPE "+l;return null!==e?r+=" PUBLIC "+n(e):null!==t&&(r+=" SYSTEM"),null!==t&&(r+=" "+n(t)),r}},{}],10:[function(l,e,t){"use strict";var n=l("../tokenization/tokenizer"),r=l("./html"),c=r.TAG_NAMES,i=r.NAMESPACES,o=r.ATTRS,s={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},a="definitionurl",T="definitionURL",E={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",externalresourcesrequired:"externalResourcesRequired",filterres:"filterRes",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},h={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:i.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:i.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:i.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:i.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:i.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:i.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:i.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:i.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:i.XML},"xml:space":{prefix:"xml",name:"space",namespace:i.XML},xmlns:{prefix:"",name:"xmlns",namespace:i.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:i.XMLNS}},u={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},p={};p[c.B]=!0,p[c.BIG]=!0,p[c.BLOCKQUOTE]=!0,p[c.BODY]=!0,p[c.BR]=!0,p[c.CENTER]=!0,p[c.CODE]=!0,p[c.DD]=!0,p[c.DIV]=!0,p[c.DL]=!0,p[c.DT]=!0,p[c.EM]=!0,p[c.EMBED]=!0,p[c.H1]=!0,p[c.H2]=!0,p[c.H3]=!0,p[c.H4]=!0,p[c.H5]=!0,p[c.H6]=!0,p[c.HEAD]=!0,p[c.HR]=!0,p[c.I]=!0,p[c.IMG]=!0,p[c.LI]=!0,p[c.LISTING]=!0,p[c.MENU]=!0,p[c.META]=!0,p[c.NOBR]=!0,p[c.OL]=!0,p[c.P]=!0,p[c.PRE]=!0,p[c.RUBY]=!0,p[c.S]=!0,p[c.SMALL]=!0,p[c.SPAN]=!0,p[c.STRONG]=!0,p[c.STRIKE]=!0,p[c.SUB]=!0,p[c.SUP]=!0,p[c.TABLE]=!0,p[c.TT]=!0,p[c.U]=!0,p[c.UL]=!0,p[c.VAR]=!0,t.causesExit=function(l){var e=l.tagName;return e!==c.FONT||null===n.getTokenAttr(l,o.COLOR)&&null===n.getTokenAttr(l,o.SIZE)&&null===n.getTokenAttr(l,o.FACE)?p[e]:!0},t.adjustTokenMathMLAttrs=function(l){for(var e=0;e<l.attrs.length;e++)if(l.attrs[e].name===a){l.attrs[e].name=T;break}},t.adjustTokenSVGAttrs=function(l){for(var e=0;e<l.attrs.length;e++){var t=E[l.attrs[e].name];t&&(l.attrs[e].name=t)}},t.adjustTokenXMLAttrs=function(l){for(var e=0;e<l.attrs.length;e++){var t=h[l.attrs[e].name];t&&(l.attrs[e].prefix=t.prefix,l.attrs[e].name=t.name,l.attrs[e].namespace=t.namespace)}},t.adjustTokenSVGTagName=function(l){var e=u[l.tagName];e&&(l.tagName=e)},t.isMathMLTextIntegrationPoint=function(l,e){return e===i.MATHML&&(l===c.MI||l===c.MO||l===c.MN||l===c.MS||l===c.MTEXT)},t.isHtmlIntegrationPoint=function(l,e,t){if(e===i.MATHML&&l===c.ANNOTATION_XML)for(var n=0;n<t.length;n++)if(t[n].name===o.ENCODING){var r=t[n].value.toLowerCase();return r===s.TEXT_HTML||r===s.APPLICATION_XML}return e===i.SVG&&(l===c.FOREIGN_OBJECT||l===c.DESC||l===c.TITLE)}},{"../tokenization/tokenizer":22,"./html":11}],11:[function(l,e,t){"use strict";var n=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"};var r=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",COMMAND:"command",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",ISINDEX:"isindex",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",MENUITEM:"menuitem",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RP:"rp",RT:"rt",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"},c=t.SPECIAL_ELEMENTS={};c[n.HTML]={},c[n.HTML][r.ADDRESS]=!0,c[n.HTML][r.APPLET]=!0,c[n.HTML][r.AREA]=!0,c[n.HTML][r.ARTICLE]=!0,c[n.HTML][r.ASIDE]=!0,c[n.HTML][r.BASE]=!0,c[n.HTML][r.BASEFONT]=!0,c[n.HTML][r.BGSOUND]=!0,c[n.HTML][r.BLOCKQUOTE]=!0,c[n.HTML][r.BODY]=!0,c[n.HTML][r.BR]=!0,c[n.HTML][r.BUTTON]=!0,c[n.HTML][r.CAPTION]=!0,c[n.HTML][r.CENTER]=!0,c[n.HTML][r.COL]=!0,c[n.HTML][r.COLGROUP]=!0,c[n.HTML][r.DD]=!0,c[n.HTML][r.DETAILS]=!0,
c[n.HTML][r.DIR]=!0,c[n.HTML][r.DIV]=!0,c[n.HTML][r.DL]=!0,c[n.HTML][r.DT]=!0,c[n.HTML][r.EMBED]=!0,c[n.HTML][r.FIELDSET]=!0,c[n.HTML][r.FIGCAPTION]=!0,c[n.HTML][r.FIGURE]=!0,c[n.HTML][r.FOOTER]=!0,c[n.HTML][r.FORM]=!0,c[n.HTML][r.FRAME]=!0,c[n.HTML][r.FRAMESET]=!0,c[n.HTML][r.H1]=!0,c[n.HTML][r.H2]=!0,c[n.HTML][r.H3]=!0,c[n.HTML][r.H4]=!0,c[n.HTML][r.H5]=!0,c[n.HTML][r.H6]=!0,c[n.HTML][r.HEAD]=!0,c[n.HTML][r.HEADER]=!0,c[n.HTML][r.HGROUP]=!0,c[n.HTML][r.HR]=!0,c[n.HTML][r.HTML]=!0,c[n.HTML][r.IFRAME]=!0,c[n.HTML][r.IMG]=!0,c[n.HTML][r.INPUT]=!0,c[n.HTML][r.ISINDEX]=!0,c[n.HTML][r.LI]=!0,c[n.HTML][r.LINK]=!0,c[n.HTML][r.LISTING]=!0,c[n.HTML][r.MAIN]=!0,c[n.HTML][r.MARQUEE]=!0,c[n.HTML][r.MENU]=!0,c[n.HTML][r.MENUITEM]=!0,c[n.HTML][r.META]=!0,c[n.HTML][r.NAV]=!0,c[n.HTML][r.NOEMBED]=!0,c[n.HTML][r.NOFRAMES]=!0,c[n.HTML][r.NOSCRIPT]=!0,c[n.HTML][r.OBJECT]=!0,c[n.HTML][r.OL]=!0,c[n.HTML][r.P]=!0,c[n.HTML][r.PARAM]=!0,c[n.HTML][r.PLAINTEXT]=!0,c[n.HTML][r.PRE]=!0,c[n.HTML][r.SCRIPT]=!0,c[n.HTML][r.SECTION]=!0,c[n.HTML][r.SELECT]=!0,c[n.HTML][r.SOURCE]=!0,c[n.HTML][r.STYLE]=!0,c[n.HTML][r.SUMMARY]=!0,c[n.HTML][r.TABLE]=!0,c[n.HTML][r.TBODY]=!0,c[n.HTML][r.TD]=!0,c[n.HTML][r.TEMPLATE]=!0,c[n.HTML][r.TEXTAREA]=!0,c[n.HTML][r.TFOOT]=!0,c[n.HTML][r.TH]=!0,c[n.HTML][r.THEAD]=!0,c[n.HTML][r.TITLE]=!0,c[n.HTML][r.TR]=!0,c[n.HTML][r.TRACK]=!0,c[n.HTML][r.UL]=!0,c[n.HTML][r.WBR]=!0,c[n.HTML][r.XMP]=!0,c[n.MATHML]={},c[n.MATHML][r.MI]=!0,c[n.MATHML][r.MO]=!0,c[n.MATHML][r.MN]=!0,c[n.MATHML][r.MS]=!0,c[n.MATHML][r.MTEXT]=!0,c[n.MATHML][r.ANNOTATION_XML]=!0,c[n.SVG]={},c[n.SVG][r.TITLE]=!0,c[n.SVG][r.FOREIGN_OBJECT]=!0,c[n.SVG][r.DESC]=!0},{}],12:[function(l,e,t){"use strict";t.REPLACEMENT_CHARACTER="�",t.CODE_POINTS={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,BOM:65279,REPLACEMENT_CHARACTER:65533},t.CODE_POINT_SEQUENCES={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],CDATA_END_STRING:[93,93,62],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]}},{}],13:[function(l,e,t){"use strict";t.mergeOptions=function(l,e){return e=e||{},[l,e].reduce(function(l,e){return Object.keys(e).forEach(function(t){l[t]=e[t]}),l},{})}},{}],14:[function(l,e,t){(function(e){"use strict";var n=l("../tree_construction/parser"),r=l("./parsing_unit");t.parseDocument=function(l,t){var c=new n(t),i=new r(c);return c._runParsingLoop=function(){for(i.parsingLoopLock=!0;!i.suspended&&!this.stopped;)this._iterateParsingLoop();i.parsingLoopLock=!1,this.stopped&&i.callback(this.document)},e.nextTick(function(){c.parse(l)}),i},t.parseInnerHtml=function(l,e,t){var r=new n(t);return r.parseFragment(l,e)}}).call(this,l("_process"))},{"../tree_construction/parser":28,"./parsing_unit":15,_process:6}],15:[function(l,e){"use strict";var t=e.exports=function(l){this.parser=l,this.suspended=!1,this.parsingLoopLock=!1,this.callback=null};t.prototype._stateGuard=function(l){if(this.suspended&&l)throw new Error("parse5: Parser was already suspended. Please, check your control flow logic.");if(!this.suspended&&!l)throw new Error("parse5: Parser was already resumed. Please, check your control flow logic.");return l},t.prototype.suspend=function(){return this.suspended=this._stateGuard(!0),this},t.prototype.resume=function(){return this.suspended=this._stateGuard(!1),this.parsingLoopLock||this.parser._runParsingLoop(),this},t.prototype.documentWrite=function(l){return this.parser.tokenizer.preprocessor.write(l),this},t.prototype.handleScripts=function(l){return this.parser.scriptHandler=l,this},t.prototype.done=function(l){return this.callback=l,this}},{}],16:[function(l,e){"use strict";function t(l,e){return l=l.replace(T,"&").replace(E," "),l=e?l.replace(h,"""):l.replace(u,"<").replace(p,">")}var n=l("../tree_adapters/default"),r=l("../common/doctype"),c=l("../common/utils"),i=l("../common/html"),o=i.TAG_NAMES,s=i.NAMESPACES,a={encodeHtmlEntities:!0},T=/&/g,E=/\u00a0/g,h=/"/g,u=/</g,p=/>/g,m=e.exports=function(l,e){this.treeAdapter=l||n,this.options=c.mergeOptions(a,e)};m.prototype.serialize=function(l){return this.html="",this._serializeChildNodes(l),this.html},m.prototype._serializeChildNodes=function(l){var e=this.treeAdapter.getChildNodes(l);if(e)for(var t=0,n=e.length;n>t;t++){var r=e[t];this.treeAdapter.isElementNode(r)?this._serializeElement(r):this.treeAdapter.isTextNode(r)?this._serializeTextNode(r):this.treeAdapter.isCommentNode(r)?this._serializeCommentNode(r):this.treeAdapter.isDocumentTypeNode(r)&&this._serializeDocumentTypeNode(r)}},m.prototype._serializeElement=function(l){var e=this.treeAdapter.getTagName(l),t=this.treeAdapter.getNamespaceURI(l),n=t===s.HTML||t===s.SVG||t===s.MATHML?e:t+":"+e;if(this.html+="<"+n,this._serializeAttributes(l),this.html+=">",e!==o.AREA&&e!==o.BASE&&e!==o.BASEFONT&&e!==o.BGSOUND&&e!==o.BR&&e!==o.BR&&e!==o.COL&&e!==o.EMBED&&e!==o.FRAME&&e!==o.HR&&e!==o.IMG&&e!==o.INPUT&&e!==o.KEYGEN&&e!==o.LINK&&e!==o.MENUITEM&&e!==o.META&&e!==o.PARAM&&e!==o.SOURCE&&e!==o.TRACK&&e!==o.WBR){if(e===o.PRE||e===o.TEXTAREA||e===o.LISTING){var r=this.treeAdapter.getFirstChild(l);if(r&&this.treeAdapter.isTextNode(r)){var c=this.treeAdapter.getTextNodeContent(r);"\n"===c[0]&&(this.html+="\n")}}var i=e===o.TEMPLATE&&t===s.HTML?this.treeAdapter.getChildNodes(l)[0]:l;this._serializeChildNodes(i),this.html+="</"+n+">"}},m.prototype._serializeAttributes=function(l){for(var e=this.treeAdapter.getAttrList(l),n=0,r=e.length;r>n;n++){var c=e[n],i=this.options.encodeHtmlEntities?t(c.value,!0):c.value;this.html+=" ",c.namespace?c.namespace===s.XML?this.html+="xml:"+c.name:c.namespace===s.XMLNS?("xmlns"!==c.name&&(this.html+="xmlns:"),this.html+=c.name):this.html+=c.namespace===s.XLINK?"xlink:"+c.name:c.namespace+":"+c.name:this.html+=c.name,this.html+='="'+i+'"'}},m.prototype._serializeTextNode=function(l){var e=this.treeAdapter.getTextNodeContent(l),n=this.treeAdapter.getParentNode(l),r=void 0;n&&this.treeAdapter.isElementNode(n)&&(r=this.treeAdapter.getTagName(n)),this.html+=r===o.STYLE||r===o.SCRIPT||r===o.XMP||r===o.IFRAME||r===o.NOEMBED||r===o.NOFRAMES||r===o.PLAINTEXT||r===o.NOSCRIPT?e:this.options.encodeHtmlEntities?t(e,!1):e},m.prototype._serializeCommentNode=function(l){this.html+="<!--"+this.treeAdapter.getCommentNodeContent(l)+"-->"},m.prototype._serializeDocumentTypeNode=function(l){var e=this.treeAdapter.getDocumentTypeNodeName(l),t=this.treeAdapter.getDocumentTypeNodePublicId(l),n=this.treeAdapter.getDocumentTypeNodeSystemId(l);this.html+="<"+r.serializeContent(e,t,n)+">"}},{"../common/doctype":9,"../common/html":11,"../common/utils":13,"../tree_adapters/default":23}],17:[function(l,e){"use strict";function t(){}var n=l("../tokenization/tokenizer"),r=l("./tokenizer_proxy"),c=l("../common/utils"),i={decodeHtmlEntities:!0,locationInfo:!1},o=e.exports=function(l,e){this.options=c.mergeOptions(i,e),this.handlers={doctype:this._wrapHandler(l.doctype),startTag:this._wrapHandler(l.startTag),endTag:this._wrapHandler(l.endTag),text:this._wrapHandler(l.text),comment:this._wrapHandler(l.comment)}};o.prototype._wrapHandler=function(l){var e=this;return l=l||t,this.options.locationInfo?function(){var t=Array.prototype.slice.call(arguments);t.push(e.currentTokenLocation),l.apply(l,t)}:l},o.prototype.parse=function(l){var e=null;this._reset(l);do e=this.tokenizerProxy.getNextToken(),e.type===n.CHARACTER_TOKEN||e.type===n.WHITESPACE_CHARACTER_TOKEN||e.type===n.NULL_CHARACTER_TOKEN?(this.options.locationInfo&&(null===this.pendingText?this.currentTokenLocation=e.location:this.currentTokenLocation.end=e.location.end),this.pendingText=(this.pendingText||"")+e.chars):(this._emitPendingText(),this._handleToken(e));while(e.type!==n.EOF_TOKEN)},o.prototype._handleToken=function(l){this.options.locationInfo&&(this.currentTokenLocation=l.location),l.type===n.START_TAG_TOKEN?this.handlers.startTag(l.tagName,l.attrs,l.selfClosing):l.type===n.END_TAG_TOKEN?this.handlers.endTag(l.tagName):l.type===n.COMMENT_TOKEN?this.handlers.comment(l.data):l.type===n.DOCTYPE_TOKEN&&this.handlers.doctype(l.name,l.publicId,l.systemId)},o.prototype._reset=function(l){this.tokenizerProxy=new r(l,this.options),this.pendingText=null,this.currentTokenLocation=null},o.prototype._emitPendingText=function(){null!==this.pendingText&&(this.handlers.text(this.pendingText),this.pendingText=null)}},{"../common/utils":13,"../tokenization/tokenizer":22,"./tokenizer_proxy":18}],18:[function(l,e){"use strict";var t=l("../tokenization/tokenizer"),n=l("../common/foreign_content"),r=l("../common/unicode"),c=l("../common/html"),i=c.TAG_NAMES,o=c.NAMESPACES,s=e.exports=function(l,e){this.tokenizer=new t(l,e),this.namespaceStack=[],this.namespaceStackTop=-1,this.currentNamespace=null,this.inForeignContent=!1};s.prototype.getNextToken=function(){var l=this.tokenizer.getNextToken();return l.type===t.START_TAG_TOKEN?this._handleStartTagToken(l):l.type===t.END_TAG_TOKEN?this._handleEndTagToken(l):l.type===t.NULL_CHARACTER_TOKEN&&this.inForeignContent&&(l.type=t.CHARACTER_TOKEN,l.chars=r.REPLACEMENT_CHARACTER),l},s.prototype._enterNamespace=function(l){this.namespaceStackTop++,this.namespaceStack.push(l),this.inForeignContent=l!==o.HTML,this.currentNamespace=l,this.tokenizer.allowCDATA=this.inForeignContent},s.prototype._leaveCurrentNamespace=function(){this.namespaceStackTop--,this.namespaceStack.pop(),this.currentNamespace=this.namespaceStack[this.namespaceStackTop],this.inForeignContent=this.currentNamespace!==o.HTML,this.tokenizer.allowCDATA=this.inForeignContent},s.prototype._ensureTokenizerMode=function(l){l===i.TEXTAREA||l===i.TITLE?this.tokenizer.state=t.MODE.RCDATA:l===i.PLAINTEXT?this.tokenizer.state=t.MODE.PLAINTEXT:l===i.SCRIPT?this.tokenizer.state=t.MODE.SCRIPT_DATA:(l===i.STYLE||l===i.IFRAME||l===i.XMP||l===i.NOEMBED||l===i.NOFRAMES||l===i.NOSCRIPT)&&(this.tokenizer.state=t.MODE.RAWTEXT)},s.prototype._handleStartTagToken=function(l){var e=l.tagName;e===i.SVG?this._enterNamespace(o.SVG):e===i.MATH?this._enterNamespace(o.MATHML):this.inForeignContent?n.causesExit(l)?this._leaveCurrentNamespace():(n.isMathMLTextIntegrationPoint(e,this.currentNamespace)||n.isHtmlIntegrationPoint(e,this.currentNamespace,l.attrs))&&this._enterNamespace(o.HTML):this._ensureTokenizerMode(e)},s.prototype._handleEndTagToken=function(l){var e=l.tagName;if(this.inForeignContent)(e===i.SVG&&this.currentNamespace===o.SVG||e===i.MATH&&this.currentNamespace===o.MATHML)&&this._leaveCurrentNamespace();else{var r=this.namespaceStack[this.namespaceStackTop-1];n.isMathMLTextIntegrationPoint(e,r)||n.isHtmlIntegrationPoint(e,r,l.attrs)?this._leaveCurrentNamespace():e===i.SCRIPT&&(this.tokenizer.state=t.MODE.DATA)}}},{"../common/foreign_content":10,"../common/html":11,"../common/unicode":12,"../tokenization/tokenizer":22}],19:[function(l,e,t){"use strict";t.assign=function(l){var e=Object.getPrototypeOf(l);l.tokenStartLoc=-1,l._attachLocationInfo=function(l){l.location={start:this.tokenStartLoc,end:-1}},l._createStartTagToken=function(l){e._createStartTagToken.call(this,l),this._attachLocationInfo(this.currentToken)},l._createEndTagToken=function(l){e._createEndTagToken.call(this,l),this._attachLocationInfo(this.currentToken)},l._createCommentToken=function(){e._createCommentToken.call(this),this._attachLocationInfo(this.currentToken)},l._createDoctypeToken=function(l){e._createDoctypeToken.call(this,l),this._attachLocationInfo(this.currentToken)},l._createCharacterToken=function(l,t){e._createCharacterToken.call(this,l,t),this._attachLocationInfo(this.currentCharacterToken)},l._emitCurrentToken=function(){this.currentCharacterToken&&(this.currentCharacterToken.location.end=this.currentToken.location.start),this.currentToken.location.end=this.preprocessor.pos+1,e._emitCurrentToken.call(this)},l._emitCurrentCharacterToken=function(){this.currentCharacterToken&&-1===this.currentCharacterToken.location.end&&(this.currentCharacterToken.location.end=this.preprocessor.pos),e._emitCurrentCharacterToken.call(this)},Object.keys(e.MODE).map(function(l){return e.MODE[l]}).forEach(function(t){l[t]=function(l){this.tokenStartLoc=this.preprocessor.pos,e[t].call(this,l)}})}},{}],20:[function(l,e){"use strict";e.exports={65:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[193]}},c:[193]}}}}}}}}},98:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[258]}}}}}}}}}}},99:{l:{105:{l:{114:{l:{99:{l:{59:{c:[194]}},c:[194]}}}}},121:{l:{59:{c:[1040]}}}}},69:{l:{108:{l:{105:{l:{103:{l:{59:{c:[198]}},c:[198]}}}}}}},102:{l:{114:{l:{59:{c:[120068]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[192]}},c:[192]}}}}}}}}},108:{l:{112:{l:{104:{l:{97:{l:{59:{c:[913]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[256]}}}}}}}}},77:{l:{80:{l:{59:{c:[38]}},c:[38]}}},110:{l:{100:{l:{59:{c:[10835]}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[260]}}}}}}},112:{l:{102:{l:{59:{c:[120120]}}}}}}},112:{l:{112:{l:{108:{l:{121:{l:{70:{l:{117:{l:{110:{l:{99:{l:{116:{l:{105:{l:{111:{l:{110:{l:{59:{c:[8289]}}}}}}}}}}}}}}}}}}}}}}}}},114:{l:{105:{l:{110:{l:{103:{l:{59:{c:[197]}},c:[197]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119964]}}}}},115:{l:{105:{l:{103:{l:{110:{l:{59:{c:[8788]}}}}}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[195]}},c:[195]}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[196]}},c:[196]}}}}}}},97:{l:{97:{l:{99:{l:{117:{l:{116:{l:{101:{l:{59:{c:[225]}},c:[225]}}}}}}}}},98:{l:{114:{l:{101:{l:{118:{l:{101:{l:{59:{c:[259]}}}}}}}}}}},99:{l:{59:{c:[8766]},100:{l:{59:{c:[8767]}}},69:{l:{59:{c:[8766,819]}}},105:{l:{114:{l:{99:{l:{59:{c:[226]}},c:[226]}}}}},117:{l:{116:{l:{101:{l:{59:{c:[180]}},c:[180]}}}}},121:{l:{59:{c:[1072]}}}}},101:{l:{108:{l:{105:{l:{103:{l:{59:{c:[230]}},c:[230]}}}}}}},102:{l:{59:{c:[8289]},114:{l:{59:{c:[120094]}}}}},103:{l:{114:{l:{97:{l:{118:{l:{101:{l:{59:{c:[224]}},c:[224]}}}}}}}}},108:{l:{101:{l:{102:{l:{115:{l:{121:{l:{109:{l:{59:{c:[8501]}}}}}}}}},112:{l:{104:{l:{59:{c:[8501]}}}}}}},112:{l:{104:{l:{97:{l:{59:{c:[945]}}}}}}}}},109:{l:{97:{l:{99:{l:{114:{l:{59:{c:[257]}}}}},108:{l:{103:{l:{59:{c:[10815]}}}}}}},112:{l:{59:{c:[38]}},c:[38]}}},110:{l:{100:{l:{97:{l:{110:{l:{100:{l:{59:{c:[10837]}}}}}}},59:{c:[8743]},100:{l:{59:{c:[10844]}}},115:{l:{108:{l:{111:{l:{112:{l:{101:{l:{59:{c:[10840]}}}}}}}}}}},118:{l:{59:{c:[10842]}}}}},103:{l:{59:{c:[8736]},101:{l:{59:{c:[10660]}}},108:{l:{101:{l:{59:{c:[8736]}}}}},109:{l:{115:{l:{100:{l:{97:{l:{97:{l:{59:{c:[10664]}}},98:{l:{59:{c:[10665]}}},99:{l:{59:{c:[10666]}}},100:{l:{59:{c:[10667]}}},101:{l:{59:{c:[10668]}}},102:{l:{59:{c:[10669]}}},103:{l:{59:{c:[10670]}}},104:{l:{59:{c:[10671]}}}}},59:{c:[8737]}}}}}}},114:{l:{116:{l:{59:{c:[8735]},118:{l:{98:{l:{59:{c:[8894]},100:{l:{59:{c:[10653]}}}}}}}}}}},115:{l:{112:{l:{104:{l:{59:{c:[8738]}}}}},116:{l:{59:{c:[197]}}}}},122:{l:{97:{l:{114:{l:{114:{l:{59:{c:[9084]}}}}}}}}}}}}},111:{l:{103:{l:{111:{l:{110:{l:{59:{c:[261]}}}}}}},112:{l:{102:{l:{59:{c:[120146]}}}}}}},112:{l:{97:{l:{99:{l:{105:{l:{114:{l:{59:{c:[10863]}}}}}}}}},59:{c:[8776]},69:{l:{59:{c:[10864]}}},101:{l:{59:{c:[8778]}}},105:{l:{100:{l:{59:{c:[8779]}}}}},111:{l:{115:{l:{59:{c:[39]}}}}},112:{l:{114:{l:{111:{l:{120:{l:{59:{c:[8776]},101:{l:{113:{l:{59:{c:[8778]}}}}}}}}}}}}}}},114:{l:{105:{l:{110:{l:{103:{l:{59:{c:[229]}},c:[229]}}}}}}},115:{l:{99:{l:{114:{l:{59:{c:[119990]}}}}},116:{l:{59:{c:[42]}}},121:{l:{109:{l:{112:{l:{59:{c:[8776]},101:{l:{113:{l:{59:{c:[8781]}}}}}}}}}}}}},116:{l:{105:{l:{108:{l:{100:{l:{101:{l:{59:{c:[227]}},c:[227]}}}}}}}}},117:{l:{109:{l:{108:{l:{59:{c:[228]}},c:[228]}}}}},119:{l:{99:{l:{111:{l:{110:{l:{105:{l:{110:{l:{116:{l:{59:{c:[8755]}}}}}}}}}}}}},105:{l:{110:{l:{116:{l:{59:{c:[10769]}}}}}}}}}}},98:{l:{97:{l:{99:{l:{107:{l:{99:{l:{111:{l:{110:{l:{103:{l:{59:{c:[8780]}}}}}}}}},101:{l:{112:{l:{115:{l:{105:{l:{108:{l:{111:{l:{110:{l:{59:{c:[1014]}}}}}}}}}}}}}}},112:{l:{114:{l:{105:{l:{109:{l:{101:{l:{59:{c:[8245]}}}}}}}}}}},115:{l:{105:{l:{109:{l:{59:{c:[8765]},101:{l:{113:{l:{59:{c:[8909]}}}}}}}}}}}}}}},114:{l:{118:{l:{101:{l:{101:{l:{59:{c:[8893]}}}}}}},119:{l:{101:{l:{100:{l:{59:{c:[8965]},103:{l:{101:{l:{59:{c:[8965]}}}}}}}}}}}}}}},98:{l:{114:{l:{107:{l:{59:{c:[9141]},116:{l:{98:{l:{114:{l:{107:{l:{59:{c:[9142]}}}}}}}}}}}}}}},99:{l:{111:{l:{110:{l:{103:{l:{59:{c:[8780]}}}}}}},121:{l:{59:{c:[1073]}}}}},100:{l:{113:{l:{117:{l:{111:{l:{59:{c:[8222]}}}}}}}}},101:{l:{99:{l:{97:{l:{117:{l:{115:{l:{59:{c:[8757]},101:{l:{59:{c:[8757]}}}}}}}}}}},109:{l:{112:{l:{116:{l:{121:{l:{118:{l:{59:{c:[10672]}}}}}}}}}}},112:{l:{115:{l:{105:{l:{59:{c:[1014]}}}}}}},114:{l:{110:{l:{111:{l:{117:{l:{59:{c:[8492]}}}}}}}}},116:{l:{97:{l:{59:{c:[946]}}},104:{l:{59:{c:[8502]}}},119:{l:{101:{l:{101:{l:{110:{l:{59:{c:[8812]}}}}}}}}}}}}},102:{l:{114:{l:{59:{c:[120095]}}}}},105:{l:{103:{l:{99:{l:{97:{l:{112:{l:{59:{c:[8898]}}}}},105:{l:{114:{l:{99:{l:{59:{c:[9711]}}}}}}},117:{l:{112:{l:{59:{c:[8899]}}}}}}},111:{l:{100:{l:{111:{l:{116:{l:{59:{c:[10752]}}}}}}},112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10753]}}}}}}}}},116:{l:{105:{l:{109:{l:{101:{l:{115:{l:{59:{c:[10754]}}}}}}}}}}}}},115:{l:{113:{l:{99:{l:{117:{l:{112:{l:{59:{c:[10758]}}}}}}}}},116:{l:{97:{l:{114:{l:{59:{c:[9733]}}}}}}}}},116:{l:{114:{l:{105:{l:{97:{l:{110:{l:{103:{l:{108:{l:{101:{l:{100:{l:{111:{l:{119:{l:{110:{l:{59:{c:[9661]}}}}}}}}},117:{l:{112:{l:{59:{c:[9651]}}}}}}}}}}}}}}}}}}}}},117:{l:{112:{l:{108:{l:{117:{l:{115:{l:{59:{c:[10756]}}}}}}}}}}},118:{l:{101:{l:{101:{l:{59:{c:[8897]}}}}}}},119:{l:{101:{l:{100:{l:{103:{l:{101:{l:{59:{c:[8896]}}}}}}}}}}}}}}},107:{l:{97:{l:{114:{l:{111:{l:{119:{l:{59:{c:[10509]}}}}}}}}}}},108:{l:{97:{l:{99:{l:{107:{l:{108:{l