@angular/platform-server
Version:
Angular - library for using Angular in Node.js
14 lines (12 loc) • 341 kB
JavaScript
/**
* @license Angular v21.0.3
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { ɵsetRootDomAdapter as _setRootDomAdapter, DOCUMENT, XhrFactory, PlatformLocation, ɵgetDOM as _getDOM, ɵPLATFORM_SERVER_ID as _PLATFORM_SERVER_ID, ViewportScroller, ɵNullViewportScroller as _NullViewportScroller } from '@angular/common';
import * as i0 from '@angular/core';
import { InjectionToken, inject, Injector, ɵstartMeasuring as _startMeasuring, ɵstopMeasuring as _stopMeasuring, Injectable, Inject, APP_ID, TransferState, PLATFORM_ID, PLATFORM_INITIALIZER, NgModule, ɵsetDocument as _setDocument, createPlatformFactory, platformCore, Testability, ɵTESTABILITY as _TESTABILITY } from '@angular/core';
import { ɵBrowserDomAdapter as _BrowserDomAdapter, EventManagerPlugin, EVENT_MANAGER_PLUGINS, BrowserModule } from '@angular/platform-browser';
import { ɵHTTP_ROOT_INTERCEPTOR_FNS as _HTTP_ROOT_INTERCEPTOR_FNS } from '@angular/common/http';
import { Subject } from 'rxjs';
function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var lib={};var Event_1;var hasRequiredEvent;function requireEvent(){if(hasRequiredEvent)return Event_1;hasRequiredEvent=1;Event_1=Event;Event.CAPTURING_PHASE=1;Event.AT_TARGET=2;Event.BUBBLING_PHASE=3;function Event(type,dictionary){this.type='';this.target=null;this.currentTarget=null;this.eventPhase=Event.AT_TARGET;this.bubbles=false;this.cancelable=false;this.isTrusted=false;this.defaultPrevented=false;this.timeStamp=Date.now();this._propagationStopped=false;this._immediatePropagationStopped=false;this._initialized=true;this._dispatching=false;if(type)this.type=type;if(dictionary){for(var p in dictionary){this[p]=dictionary[p];}}}Event.prototype=Object.create(Object.prototype,{constructor:{value:Event},stopPropagation:{value:function stopPropagation(){this._propagationStopped=true;}},stopImmediatePropagation:{value:function stopImmediatePropagation(){this._propagationStopped=true;this._immediatePropagationStopped=true;}},preventDefault:{value:function preventDefault(){if(this.cancelable)this.defaultPrevented=true;}},initEvent:{value:function initEvent(type,bubbles,cancelable){this._initialized=true;if(this._dispatching)return;this._propagationStopped=false;this._immediatePropagationStopped=false;this.defaultPrevented=false;this.isTrusted=false;this.target=null;this.type=type;this.bubbles=bubbles;this.cancelable=cancelable;}}});return Event_1;}var UIEvent_1;var hasRequiredUIEvent;function requireUIEvent(){if(hasRequiredUIEvent)return UIEvent_1;hasRequiredUIEvent=1;var Event=requireEvent();UIEvent_1=UIEvent;function UIEvent(){Event.call(this);this.view=null;this.detail=0;}UIEvent.prototype=Object.create(Event.prototype,{constructor:{value:UIEvent},initUIEvent:{value:function(type,bubbles,cancelable,view,detail){this.initEvent(type,bubbles,cancelable);this.view=view;this.detail=detail;}}});return UIEvent_1;}var MouseEvent_1;var hasRequiredMouseEvent;function requireMouseEvent(){if(hasRequiredMouseEvent)return MouseEvent_1;hasRequiredMouseEvent=1;var UIEvent=requireUIEvent();MouseEvent_1=MouseEvent;function MouseEvent(){UIEvent.call(this);this.screenX=this.screenY=this.clientX=this.clientY=0;this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=false;this.button=0;this.buttons=1;this.relatedTarget=null;}MouseEvent.prototype=Object.create(UIEvent.prototype,{constructor:{value:MouseEvent},initMouseEvent:{value:function(type,bubbles,cancelable,view,detail,screenX,screenY,clientX,clientY,ctrlKey,altKey,shiftKey,metaKey,button,relatedTarget){this.initEvent(type,bubbles,cancelable,view,detail);this.screenX=screenX;this.screenY=screenY;this.clientX=clientX;this.clientY=clientY;this.ctrlKey=ctrlKey;this.altKey=altKey;this.shiftKey=shiftKey;this.metaKey=metaKey;this.button=button;switch(button){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2;break;default:this.buttons=0;break;}this.relatedTarget=relatedTarget;}},getModifierState:{value:function(key){switch(key){case"Alt":return this.altKey;case"Control":return this.ctrlKey;case"Shift":return this.shiftKey;case"Meta":return this.metaKey;default:return false;}}}});return MouseEvent_1;}var utils={};var config={};var hasRequiredConfig;function requireConfig(){if(hasRequiredConfig)return config;hasRequiredConfig=1;config.isApiWritable=!globalThis.__domino_frozen__;return config;}var hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var isApiWritable=requireConfig().isApiWritable;utils.NAMESPACE={HTML:'http://www.w3.org/1999/xhtml',XML:'http://www.w3.org/XML/1998/namespace',XMLNS:'http://www.w3.org/2000/xmlns/',MATHML:'http://www.w3.org/1998/Math/MathML',SVG:'http://www.w3.org/2000/svg',XLINK:'http://www.w3.org/1999/xlink'};utils.IndexSizeError=()=>{throw new DOMException('The index is not in the allowed range','IndexSizeError');};utils.HierarchyRequestError=()=>{throw new DOMException('The node tree hierarchy is not correct','HierarchyRequestError');};utils.WrongDocumentError=()=>{throw new DOMException('The object is in the wrong Document','WrongDocumentError');};utils.InvalidCharacterError=()=>{throw new DOMException('The string contains invalid characters','InvalidCharacterError');};utils.NoModificationAllowedError=()=>{throw new DOMException('The object cannot be modified','NoModificationAllowedError');};utils.NotFoundError=()=>{throw new DOMException('The object can not be found here','NotFoundError');};utils.NotSupportedError=()=>{throw new DOMException('The operation is not supported','NotSupportedError');};utils.InvalidStateError=()=>{throw new DOMException('The object is in an invalid state','InvalidStateError');};utils.SyntaxError=()=>{throw new DOMException('The string did not match the expected pattern','SyntaxError');};utils.InvalidModificationError=()=>{throw new DOMException('The object can not be modified in this way','InvalidModificationError');};utils.NamespaceError=()=>{throw new DOMException('The operation is not allowed by Namespaces in XML','NamespaceError');};utils.InvalidAccessError=()=>{throw new DOMException('The object does not support the operation or argument','InvalidAccessError');};utils.TypeMismatchError=()=>{throw new DOMException('The type of the object does not match the expected type','TypeMismatchError');};utils.SecurityError=()=>{throw new DOMException('The operation is insecure','SecurityError');};utils.NetworkError=()=>{throw new DOMException('A network error occurred','NetworkError');};utils.AbortError=()=>{throw new DOMException('The operation was aborted','AbortError');};utils.UrlMismatchError=()=>{throw new DOMException('The given URL does not match another URL','URLMismatchError');};utils.QuotaExceededError=()=>{throw new DOMException('The quota has been exceeded','QuotaExceededError');};utils.TimeoutError=()=>{throw new DOMException('The operation timed out','TimeoutError');};utils.InvalidNodeTypeError=()=>{throw new DOMException('The node is of an invalid type','InvalidNodeTypeError');};utils.DataCloneError=()=>{throw new DOMException('The object can not be cloned','DataCloneError');};utils.InUseAttributeError=()=>{throw new DOMException('The attribute is already in use','InUseAttributeError');};utils.nyi=function(){throw new Error('NotYetImplemented');};utils.shouldOverride=function(){throw new Error('Abstract function; should be overriding in subclass.');};utils.assert=function(expr,msg){if(!expr){throw new Error('Assertion failed: '+(msg||'')+'\n'+new Error().stack);}};utils.expose=function(src,c){for(var n in src){Object.defineProperty(c.prototype,n,{value:src[n],writable:isApiWritable});}};utils.merge=function(a,b){for(var n in b){a[n]=b[n];}};utils.documentOrder=function(n,m){return 3-(n.compareDocumentPosition(m)&6);};utils.toASCIILowerCase=function(s){return s.replace(/[A-Z]+/g,function(c){return c.toLowerCase();});};utils.toASCIIUpperCase=function(s){return s.replace(/[a-z]+/g,function(c){return c.toUpperCase();});};return utils;}var EventTarget_1;var hasRequiredEventTarget;function requireEventTarget(){if(hasRequiredEventTarget)return EventTarget_1;hasRequiredEventTarget=1;var Event=requireEvent();var MouseEvent=requireMouseEvent();var utils=requireUtils();EventTarget_1=EventTarget;function EventTarget(){}EventTarget.prototype={addEventListener:function addEventListener(type,listener,capture){if(!listener)return;if(capture===undefined)capture=false;if(!this._listeners)this._listeners=Object.create(null);if(!this._listeners[type])this._listeners[type]=[];var list=this._listeners[type];for(var i=0,n=list.length;i<n;i++){var l=list[i];if(l.listener===listener&&l.capture===capture)return;}var obj={listener:listener,capture:capture};if(typeof listener==='function')obj.f=listener;list.push(obj);},removeEventListener:function removeEventListener(type,listener,capture){if(capture===undefined)capture=false;if(this._listeners){var list=this._listeners[type];if(list){for(var i=0,n=list.length;i<n;i++){var l=list[i];if(l.listener===listener&&l.capture===capture){if(list.length===1){this._listeners[type]=undefined;}else {list.splice(i,1);}return;}}}}},dispatchEvent:function dispatchEvent(event){return this._dispatchEvent(event,false);},_dispatchEvent:function _dispatchEvent(event,trusted){if(typeof trusted!=='boolean')trusted=false;function invoke(target,event){var type=event.type,phase=event.eventPhase;event.currentTarget=target;if(phase!==Event.CAPTURING_PHASE&&target._handlers&&target._handlers[type]){var handler=target._handlers[type];var rv;if(typeof handler==='function'){rv=handler.call(event.currentTarget,event);}else {var f=handler.handleEvent;if(typeof f!=='function')throw new TypeError('handleEvent property of '+'event handler object is'+'not a function.');rv=f.call(handler,event);}switch(event.type){case'mouseover':if(rv===true)event.preventDefault();break;case'beforeunload':default:if(rv===false)event.preventDefault();break;}}var list=target._listeners&&target._listeners[type];if(!list)return;list=list.slice();for(var i=0,n=list.length;i<n;i++){if(event._immediatePropagationStopped)return;var l=list[i];if(phase===Event.CAPTURING_PHASE&&!l.capture||phase===Event.BUBBLING_PHASE&&l.capture)continue;if(l.f){l.f.call(event.currentTarget,event);}else {var fn=l.listener.handleEvent;if(typeof fn!=='function')throw new TypeError('handleEvent property of event listener object is not a function.');fn.call(l.listener,event);}}}if(!event._initialized||event._dispatching)utils.InvalidStateError();event.isTrusted=trusted;event._dispatching=true;event.target=this;var ancestors=[];for(var n=this.parentNode;n;n=n.parentNode)ancestors.push(n);event.eventPhase=Event.CAPTURING_PHASE;for(var i=ancestors.length-1;i>=0;i--){invoke(ancestors[i],event);if(event._propagationStopped)break;}if(!event._propagationStopped){event.eventPhase=Event.AT_TARGET;invoke(this,event);}if(event.bubbles&&!event._propagationStopped){event.eventPhase=Event.BUBBLING_PHASE;for(var ii=0,nn=ancestors.length;ii<nn;ii++){invoke(ancestors[ii],event);if(event._propagationStopped)break;}}event._dispatching=false;event.eventPhase=Event.AT_TARGET;event.currentTarget=null;if(trusted&&!event.defaultPrevented&&event instanceof MouseEvent){switch(event.type){case'mousedown':this._armed={x:event.clientX,y:event.clientY,t:event.timeStamp};break;case'mouseout':case'mouseover':this._armed=null;break;case'mouseup':if(this._isClick(event))this._doClick(event);this._armed=null;break;}}return !event.defaultPrevented;},_isClick:function(event){return this._armed!==null&&event.type==='mouseup'&&event.isTrusted&&event.button===0&&event.timeStamp-this._armed.t<1000&&Math.abs(event.clientX-this._armed.x)<10&&Math.abs(event.clientY-this._armed.Y)<10;},_doClick:function(event){if(this._click_in_progress)return;this._click_in_progress=true;var activated=this;while(activated&&!activated._post_click_activation_steps)activated=activated.parentNode;if(activated&&activated._pre_click_activation_steps){activated._pre_click_activation_steps();}var click=this.ownerDocument.createEvent('MouseEvent');click.initMouseEvent('click',true,true,this.ownerDocument.defaultView,1,event.screenX,event.screenY,event.clientX,event.clientY,event.ctrlKey,event.altKey,event.shiftKey,event.metaKey,event.button,null);var result=this._dispatchEvent(click,true);if(activated){if(result){if(activated._post_click_activation_steps)activated._post_click_activation_steps(click);}else {if(activated._cancelled_activation_steps)activated._cancelled_activation_steps();}}},_setEventHandler:function _setEventHandler(type,handler){if(!this._handlers)this._handlers=Object.create(null);this._handlers[type]=handler;},_getEventHandler:function _getEventHandler(type){return this._handlers&&this._handlers[type]||null;}};return EventTarget_1;}var LinkedList={exports:{}};var hasRequiredLinkedList;function requireLinkedList(){if(hasRequiredLinkedList)return LinkedList.exports;hasRequiredLinkedList=1;var utils=requireUtils();var LinkedList$1=LinkedList.exports={valid:function(a){utils.assert(a,"list falsy");utils.assert(a._previousSibling,"previous falsy");utils.assert(a._nextSibling,"next falsy");return true;},insertBefore:function(a,b){utils.assert(LinkedList$1.valid(a)&&LinkedList$1.valid(b));var a_first=a,a_last=a._previousSibling;var b_first=b,b_last=b._previousSibling;a_first._previousSibling=b_last;a_last._nextSibling=b_first;b_last._nextSibling=a_first;b_first._previousSibling=a_last;utils.assert(LinkedList$1.valid(a)&&LinkedList$1.valid(b));},replace:function(a,b){utils.assert(LinkedList$1.valid(a)&&(b===null||LinkedList$1.valid(b)));if(b!==null){LinkedList$1.insertBefore(b,a);}LinkedList$1.remove(a);utils.assert(LinkedList$1.valid(a)&&(b===null||LinkedList$1.valid(b)));},remove:function(a){utils.assert(LinkedList$1.valid(a));var prev=a._previousSibling;if(prev===a){return;}var next=a._nextSibling;prev._nextSibling=next;next._previousSibling=prev;a._previousSibling=a._nextSibling=a;utils.assert(LinkedList$1.valid(a));}};return LinkedList.exports;}var NodeUtils;var hasRequiredNodeUtils;function requireNodeUtils(){if(hasRequiredNodeUtils)return NodeUtils;hasRequiredNodeUtils=1;NodeUtils={serializeOne:serializeOne,ɵescapeMatchingClosingTag:escapeMatchingClosingTag,ɵescapeClosingCommentTag:escapeClosingCommentTag,ɵescapeProcessingInstructionContent:escapeProcessingInstructionContent};var utils=requireUtils();var NAMESPACE=utils.NAMESPACE;var hasRawContent={STYLE:true,SCRIPT:true,XMP:true,IFRAME:true,NOEMBED:true,NOFRAMES:true,PLAINTEXT:true};var emptyElements={area:true,base:true,basefont:true,bgsound:true,br:true,col:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true};var extraNewLine={};const ESCAPE_REGEXP=/[&<>\u00A0]/g;const ESCAPE_ATTR_REGEXP=/[&"<>\u00A0]/g;function escape(s){if(!ESCAPE_REGEXP.test(s)){return s;}return s.replace(ESCAPE_REGEXP,c=>{switch(c){case"&":return "&";case"<":return "<";case">":return ">";case"\u00A0":return " ";}});}function escapeAttr(s){if(!ESCAPE_ATTR_REGEXP.test(s)){return s;}return s.replace(ESCAPE_ATTR_REGEXP,c=>{switch(c){case"<":return "<";case">":return ">";case"&":return "&";case'"':return """;case"\u00A0":return " ";}});}function attrname(a){var ns=a.namespaceURI;if(!ns)return a.localName;if(ns===NAMESPACE.XML)return 'xml:'+a.localName;if(ns===NAMESPACE.XLINK)return 'xlink:'+a.localName;if(ns===NAMESPACE.XMLNS){if(a.localName==='xmlns')return 'xmlns';else return 'xmlns:'+a.localName;}return a.name;}function escapeMatchingClosingTag(rawText,parentTag){const parentClosingTag='</'+parentTag;if(!rawText.toLowerCase().includes(parentClosingTag)){return rawText;}const result=[...rawText];const matches=rawText.matchAll(new RegExp(parentClosingTag,'ig'));for(const match of matches){result[match.index]='<';}return result.join('');}const CLOSING_COMMENT_REGEXP=/--!?>/;function escapeClosingCommentTag(rawContent){if(!CLOSING_COMMENT_REGEXP.test(rawContent)){return rawContent;}return rawContent.replace(/(--\!?)>/g,'$1>');}function escapeProcessingInstructionContent(rawContent){return rawContent.includes('>')?rawContent.replaceAll('>','>'):rawContent;}function serializeOne(kid,parent){var s='';switch(kid.nodeType){case 1:var ns=kid.namespaceURI;var html=ns===NAMESPACE.HTML;var tagname=html||ns===NAMESPACE.SVG||ns===NAMESPACE.MATHML?kid.localName:kid.tagName;s+='<'+tagname;for(var j=0,k=kid._numattrs;j<k;j++){var a=kid._attr(j);s+=' '+attrname(a);if(a.value!==undefined)s+='="'+escapeAttr(a.value)+'"';}s+='>';if(!(html&&emptyElements[tagname])){var ss=kid.serialize();if(hasRawContent[tagname.toUpperCase()]){ss=escapeMatchingClosingTag(ss,tagname);}if(html&&extraNewLine[tagname]&&ss.charAt(0)==='\n')s+='\n';s+=ss;s+='</'+tagname+'>';}break;case 3:case 4:var parenttag;if(parent.nodeType===1&&parent.namespaceURI===NAMESPACE.HTML)parenttag=parent.tagName;else parenttag='';if(hasRawContent[parenttag]||parenttag==='NOSCRIPT'&&parent.ownerDocument._scripting_enabled){s+=kid.data;}else {s+=escape(kid.data);}break;case 8:s+='<!--'+escapeClosingCommentTag(kid.data)+'-->';break;case 7:const content=escapeProcessingInstructionContent(kid.data);s+='<?'+kid.target+' '+content+'?>';break;case 10:s+='<!DOCTYPE '+kid.name;s+='>';break;default:utils.InvalidStateError();}return s;}return NodeUtils;}var Node_1;var hasRequiredNode;function requireNode(){if(hasRequiredNode)return Node_1;hasRequiredNode=1;Node_1=Node;var EventTarget=requireEventTarget();var LinkedList=requireLinkedList();var NodeUtils=requireNodeUtils();var utils=requireUtils();function Node(){EventTarget.call(this);this.parentNode=null;this._nextSibling=this._previousSibling=this;this._index=undefined;}var ELEMENT_NODE=Node.ELEMENT_NODE=1;var ATTRIBUTE_NODE=Node.ATTRIBUTE_NODE=2;var TEXT_NODE=Node.TEXT_NODE=3;var CDATA_SECTION_NODE=Node.CDATA_SECTION_NODE=4;var ENTITY_REFERENCE_NODE=Node.ENTITY_REFERENCE_NODE=5;var ENTITY_NODE=Node.ENTITY_NODE=6;var PROCESSING_INSTRUCTION_NODE=Node.PROCESSING_INSTRUCTION_NODE=7;var COMMENT_NODE=Node.COMMENT_NODE=8;var DOCUMENT_NODE=Node.DOCUMENT_NODE=9;var DOCUMENT_TYPE_NODE=Node.DOCUMENT_TYPE_NODE=10;var DOCUMENT_FRAGMENT_NODE=Node.DOCUMENT_FRAGMENT_NODE=11;var NOTATION_NODE=Node.NOTATION_NODE=12;var DOCUMENT_POSITION_DISCONNECTED=Node.DOCUMENT_POSITION_DISCONNECTED=0x01;var DOCUMENT_POSITION_PRECEDING=Node.DOCUMENT_POSITION_PRECEDING=0x02;var DOCUMENT_POSITION_FOLLOWING=Node.DOCUMENT_POSITION_FOLLOWING=0x04;var DOCUMENT_POSITION_CONTAINS=Node.DOCUMENT_POSITION_CONTAINS=0x08;var DOCUMENT_POSITION_CONTAINED_BY=Node.DOCUMENT_POSITION_CONTAINED_BY=0x10;var DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=0x20;Node.prototype=Object.create(EventTarget.prototype,{baseURI:{get:utils.nyi},parentElement:{get:function(){return this.parentNode&&this.parentNode.nodeType===ELEMENT_NODE?this.parentNode:null;}},hasChildNodes:{value:utils.shouldOverride},firstChild:{get:utils.shouldOverride},lastChild:{get:utils.shouldOverride},isConnected:{get:function(){let node=this;while(node!=null){if(node.nodeType===Node.DOCUMENT_NODE){return true;}node=node.parentNode;if(node!=null&&node.nodeType===Node.DOCUMENT_FRAGMENT_NODE){node=node.host;}}return false;}},previousSibling:{get:function(){var parent=this.parentNode;if(!parent)return null;if(this===parent.firstChild)return null;return this._previousSibling;}},nextSibling:{get:function(){var parent=this.parentNode,next=this._nextSibling;if(!parent)return null;if(next===parent.firstChild)return null;return next;}},textContent:{get:function(){return null;},set:function(v){}},innerText:{get:function(){return null;},set:function(v){}},_countChildrenOfType:{value:function(type){var sum=0;for(var kid=this.firstChild;kid!==null;kid=kid.nextSibling){if(kid.nodeType===type)sum++;}return sum;}},_ensureInsertValid:{value:function _ensureInsertValid(node,child,isPreinsert){var parent=this,i,kid;if(!node.nodeType)throw new TypeError('not a node');switch(parent.nodeType){case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:case ELEMENT_NODE:break;default:utils.HierarchyRequestError();}if(node.isAncestor(parent))utils.HierarchyRequestError();if(child!==null||!isPreinsert){if(child.parentNode!==parent)utils.NotFoundError();}switch(node.nodeType){case DOCUMENT_FRAGMENT_NODE:case DOCUMENT_TYPE_NODE:case ELEMENT_NODE:case TEXT_NODE:case PROCESSING_INSTRUCTION_NODE:case COMMENT_NODE:break;default:utils.HierarchyRequestError();}if(parent.nodeType===DOCUMENT_NODE){switch(node.nodeType){case TEXT_NODE:utils.HierarchyRequestError();break;case DOCUMENT_FRAGMENT_NODE:if(node._countChildrenOfType(TEXT_NODE)>0)utils.HierarchyRequestError();switch(node._countChildrenOfType(ELEMENT_NODE)){case 0:break;case 1:if(child!==null){if(isPreinsert&&child.nodeType===DOCUMENT_TYPE_NODE)utils.HierarchyRequestError();for(kid=child.nextSibling;kid!==null;kid=kid.nextSibling){if(kid.nodeType===DOCUMENT_TYPE_NODE)utils.HierarchyRequestError();}}i=parent._countChildrenOfType(ELEMENT_NODE);if(isPreinsert){if(i>0)utils.HierarchyRequestError();}else {if(i>1||i===1&&child.nodeType!==ELEMENT_NODE)utils.HierarchyRequestError();}break;default:utils.HierarchyRequestError();}break;case ELEMENT_NODE:if(child!==null){if(isPreinsert&&child.nodeType===DOCUMENT_TYPE_NODE)utils.HierarchyRequestError();for(kid=child.nextSibling;kid!==null;kid=kid.nextSibling){if(kid.nodeType===DOCUMENT_TYPE_NODE)utils.HierarchyRequestError();}}i=parent._countChildrenOfType(ELEMENT_NODE);if(isPreinsert){if(i>0)utils.HierarchyRequestError();}else {if(i>1||i===1&&child.nodeType!==ELEMENT_NODE)utils.HierarchyRequestError();}break;case DOCUMENT_TYPE_NODE:if(child===null){if(parent._countChildrenOfType(ELEMENT_NODE))utils.HierarchyRequestError();}else {for(kid=parent.firstChild;kid!==null;kid=kid.nextSibling){if(kid===child)break;if(kid.nodeType===ELEMENT_NODE)utils.HierarchyRequestError();}}i=parent._countChildrenOfType(DOCUMENT_TYPE_NODE);if(isPreinsert){if(i>0)utils.HierarchyRequestError();}else {if(i>1||i===1&&child.nodeType!==DOCUMENT_TYPE_NODE)utils.HierarchyRequestError();}break;}}else {if(node.nodeType===DOCUMENT_TYPE_NODE)utils.HierarchyRequestError();}}},insertBefore:{value:function insertBefore(node,child){var parent=this;parent._ensureInsertValid(node,child,true);var refChild=child;if(refChild===node){refChild=node.nextSibling;}parent.doc.adoptNode(node);node._insertOrReplace(parent,refChild,false);return node;}},appendChild:{value:function(child){return this.insertBefore(child,null);}},_appendChild:{value:function(child){child._insertOrReplace(this,null,false);}},removeChild:{value:function removeChild(child){var parent=this;if(!child.nodeType)throw new TypeError('not a node');if(child.parentNode!==parent)utils.NotFoundError();child.remove();return child;}},replaceChild:{value:function replaceChild(node,child){var parent=this;parent._ensureInsertValid(node,child,false);if(node.doc!==parent.doc){parent.doc.adoptNode(node);}node._insertOrReplace(parent,child,true);return child;}},contains:{value:function contains(node){if(node===null){return false;}if(this===node){return true;}return (this.compareDocumentPosition(node)&DOCUMENT_POSITION_CONTAINED_BY)!==0;}},compareDocumentPosition:{value:function compareDocumentPosition(that){if(this===that)return 0;if(this.doc!==that.doc||this.rooted!==that.rooted)return DOCUMENT_POSITION_DISCONNECTED+DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;var these=[],those=[];for(var n=this;n!==null;n=n.parentNode)these.push(n);for(n=that;n!==null;n=n.parentNode)those.push(n);these.reverse();those.reverse();if(these[0]!==those[0])return DOCUMENT_POSITION_DISCONNECTED+DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;n=Math.min(these.length,those.length);for(var i=1;i<n;i++){if(these[i]!==those[i]){if(these[i].index<those[i].index)return DOCUMENT_POSITION_FOLLOWING;else return DOCUMENT_POSITION_PRECEDING;}}if(these.length<those.length)return DOCUMENT_POSITION_FOLLOWING+DOCUMENT_POSITION_CONTAINED_BY;else return DOCUMENT_POSITION_PRECEDING+DOCUMENT_POSITION_CONTAINS;}},isSameNode:{value:function isSameNode(node){return this===node;}},isEqualNode:{value:function isEqualNode(node){if(!node)return false;if(node.nodeType!==this.nodeType)return false;if(!this.isEqual(node))return false;for(var c1=this.firstChild,c2=node.firstChild;c1&&c2;c1=c1.nextSibling,c2=c2.nextSibling){if(!c1.isEqualNode(c2))return false;}return c1===null&&c2===null;}},cloneNode:{value:function(deep){var clone=this.clone();if(deep){for(var kid=this.firstChild;kid!==null;kid=kid.nextSibling){clone._appendChild(kid.cloneNode(true));}}return clone;}},lookupPrefix:{value:function lookupPrefix(ns){var e;if(ns===''||ns===null||ns===undefined)return null;switch(this.nodeType){case ELEMENT_NODE:return this._lookupNamespacePrefix(ns,this);case DOCUMENT_NODE:e=this.documentElement;return e?e.lookupPrefix(ns):null;case ENTITY_NODE:case NOTATION_NODE:case DOCUMENT_FRAGMENT_NODE:case DOCUMENT_TYPE_NODE:return null;case ATTRIBUTE_NODE:e=this.ownerElement;return e?e.lookupPrefix(ns):null;default:e=this.parentElement;return e?e.lookupPrefix(ns):null;}}},lookupNamespaceURI:{value:function lookupNamespaceURI(prefix){if(prefix===''||prefix===undefined){prefix=null;}var e;switch(this.nodeType){case ELEMENT_NODE:return utils.shouldOverride();case DOCUMENT_NODE:e=this.documentElement;return e?e.lookupNamespaceURI(prefix):null;case ENTITY_NODE:case NOTATION_NODE:case DOCUMENT_TYPE_NODE:case DOCUMENT_FRAGMENT_NODE:return null;case ATTRIBUTE_NODE:e=this.ownerElement;return e?e.lookupNamespaceURI(prefix):null;default:e=this.parentElement;return e?e.lookupNamespaceURI(prefix):null;}}},isDefaultNamespace:{value:function isDefaultNamespace(ns){if(ns===''||ns===undefined){ns=null;}var defaultNamespace=this.lookupNamespaceURI(null);return defaultNamespace===ns;}},index:{get:function(){var parent=this.parentNode;if(this===parent.firstChild)return 0;var kids=parent.childNodes;if(this._index===undefined||kids[this._index]!==this){for(var i=0;i<kids.length;i++){kids[i]._index=i;}utils.assert(kids[this._index]===this);}return this._index;}},isAncestor:{value:function(that){if(this.doc!==that.doc)return false;if(this.rooted!==that.rooted)return false;for(var e=that;e;e=e.parentNode){if(e===this)return true;}return false;}},ensureSameDoc:{value:function(that){if(that.ownerDocument===null){that.ownerDocument=this.doc;}else if(that.ownerDocument!==this.doc){utils.WrongDocumentError();}}},removeChildren:{value:utils.shouldOverride},_insertOrReplace:{value:function _insertOrReplace(parent,before,isReplace){var child=this,before_index,i;if(child.nodeType===DOCUMENT_FRAGMENT_NODE&&child.rooted){utils.HierarchyRequestError();}if(parent._childNodes){before_index=before===null?parent._childNodes.length:before.index;if(child.parentNode===parent){var child_index=child.index;if(child_index<before_index){before_index--;}}}if(isReplace){if(before.rooted)before.doc.mutateRemove(before);before.parentNode=null;}var n=before;if(n===null){n=parent.firstChild;}var bothRooted=child.rooted&&parent.rooted;if(child.nodeType===DOCUMENT_FRAGMENT_NODE){var spliceArgs=[0,isReplace?1:0],next;for(var kid=child.firstChild;kid!==null;kid=next){next=kid.nextSibling;spliceArgs.push(kid);kid.parentNode=parent;}var len=spliceArgs.length;if(isReplace){LinkedList.replace(n,len>2?spliceArgs[2]:null);}else if(len>2&&n!==null){LinkedList.insertBefore(spliceArgs[2],n);}if(parent._childNodes){spliceArgs[0]=before===null?parent._childNodes.length:before._index;parent._childNodes.splice.apply(parent._childNodes,spliceArgs);for(i=2;i<len;i++){spliceArgs[i]._index=spliceArgs[0]+(i-2);}}else if(parent._firstChild===before){if(len>2){parent._firstChild=spliceArgs[2];}else if(isReplace){parent._firstChild=null;}}if(child._childNodes){child._childNodes.length=0;}else {child._firstChild=null;}if(parent.rooted){parent.modify();for(i=2;i<len;i++){parent.doc.mutateInsert(spliceArgs[i]);}}}else {if(before===child){return;}if(bothRooted){child._remove();}else if(child.parentNode){child.remove();}child.parentNode=parent;if(isReplace){LinkedList.replace(n,child);if(parent._childNodes){child._index=before_index;parent._childNodes[before_index]=child;}else if(parent._firstChild===before){parent._firstChild=child;}}else {if(n!==null){LinkedList.insertBefore(child,n);}if(parent._childNodes){child._index=before_index;parent._childNodes.splice(before_index,0,child);}else if(parent._firstChild===before){parent._firstChild=child;}}if(bothRooted){parent.modify();parent.doc.mutateMove(child);}else if(parent.rooted){parent.modify();parent.doc.mutateInsert(child);}}}},lastModTime:{get:function(){if(!this._lastModTime){this._lastModTime=this.doc.modclock;}return this._lastModTime;}},modify:{value:function(){if(this.doc.modclock){var time=++this.doc.modclock;for(var n=this;n;n=n.parentElement){if(n._lastModTime){n._lastModTime=time;}}}}},doc:{get:function(){return this.ownerDocument||this;}},rooted:{get:function(){return !!this._nid;}},normalize:{value:function(){var next;for(var child=this.firstChild;child!==null;child=next){next=child.nextSibling;if(child.normalize){child.normalize();}if(child.nodeType!==Node.TEXT_NODE){continue;}if(child.nodeValue===""){this.removeChild(child);continue;}var prevChild=child.previousSibling;if(prevChild===null){continue;}else if(prevChild.nodeType===Node.TEXT_NODE){prevChild.appendData(child.nodeValue);this.removeChild(child);}}}},serialize:{value:function(){if(this._innerHTML){return this._innerHTML;}var s='';for(var kid=this.firstChild;kid!==null;kid=kid.nextSibling){s+=NodeUtils.serializeOne(kid,this);}return s;}},outerHTML:{get:function(){return NodeUtils.serializeOne(this,{nodeType:0});},set:utils.nyi},ELEMENT_NODE:{value:ELEMENT_NODE},ATTRIBUTE_NODE:{value:ATTRIBUTE_NODE},TEXT_NODE:{value:TEXT_NODE},CDATA_SECTION_NODE:{value:CDATA_SECTION_NODE},ENTITY_REFERENCE_NODE:{value:ENTITY_REFERENCE_NODE},ENTITY_NODE:{value:ENTITY_NODE},PROCESSING_INSTRUCTION_NODE:{value:PROCESSING_INSTRUCTION_NODE},COMMENT_NODE:{value:COMMENT_NODE},DOCUMENT_NODE:{value:DOCUMENT_NODE},DOCUMENT_TYPE_NODE:{value:DOCUMENT_TYPE_NODE},DOCUMENT_FRAGMENT_NODE:{value:DOCUMENT_FRAGMENT_NODE},NOTATION_NODE:{value:NOTATION_NODE},DOCUMENT_POSITION_DISCONNECTED:{value:DOCUMENT_POSITION_DISCONNECTED},DOCUMENT_POSITION_PRECEDING:{value:DOCUMENT_POSITION_PRECEDING},DOCUMENT_POSITION_FOLLOWING:{value:DOCUMENT_POSITION_FOLLOWING},DOCUMENT_POSITION_CONTAINS:{value:DOCUMENT_POSITION_CONTAINS},DOCUMENT_POSITION_CONTAINED_BY:{value:DOCUMENT_POSITION_CONTAINED_BY},DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:{value:DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}});return Node_1;}var NodeList_es6;var hasRequiredNodeList_es6;function requireNodeList_es6(){if(hasRequiredNodeList_es6)return NodeList_es6;hasRequiredNodeList_es6=1;NodeList_es6=class NodeList extends Array{constructor(a){super(a&&a.length||0);if(a){for(var idx in a){this[idx]=a[idx];}}}item(i){return this[i]||null;}};return NodeList_es6;}var NodeList_es5;var hasRequiredNodeList_es5;function requireNodeList_es5(){if(hasRequiredNodeList_es5)return NodeList_es5;hasRequiredNodeList_es5=1;function item(i){return this[i]||null;}function NodeList(a){if(!a)a=[];a.item=item;return a;}NodeList_es5=NodeList;return NodeList_es5;}var NodeList_1;var hasRequiredNodeList;function requireNodeList(){if(hasRequiredNodeList)return NodeList_1;hasRequiredNodeList=1;var NodeList;try{NodeList=requireNodeList_es6();}catch(e){NodeList=requireNodeList_es5();}NodeList_1=NodeList;return NodeList_1;}var ContainerNode_1;var hasRequiredContainerNode;function requireContainerNode(){if(hasRequiredContainerNode)return ContainerNode_1;hasRequiredContainerNode=1;ContainerNode_1=ContainerNode;var Node=requireNode();var NodeList=requireNodeList();function ContainerNode(){Node.call(this);this._firstChild=this._childNodes=null;}ContainerNode.prototype=Object.create(Node.prototype,{hasChildNodes:{value:function(){if(this._childNodes){return this._childNodes.length>0;}return this._firstChild!==null;}},childNodes:{get:function(){this._ensureChildNodes();return this._childNodes;}},firstChild:{get:function(){if(this._childNodes){return this._childNodes.length===0?null:this._childNodes[0];}return this._firstChild;}},lastChild:{get:function(){var kids=this._childNodes,first;if(kids){return kids.length===0?null:kids[kids.length-1];}first=this._firstChild;if(first===null){return null;}return first._previousSibling;}},_ensureChildNodes:{value:function(){if(this._childNodes){return;}var first=this._firstChild,kid=first,childNodes=this._childNodes=new NodeList();if(first)do{childNodes.push(kid);kid=kid._nextSibling;}while(kid!==first);this._firstChild=null;}},removeChildren:{value:function removeChildren(){var root=this.rooted?this.ownerDocument:null,next=this.firstChild,kid;while(next!==null){kid=next;next=kid.nextSibling;if(root)root.mutateRemove(kid);kid.parentNode=null;}if(this._childNodes){this._childNodes.length=0;}else {this._firstChild=null;}this.modify();}}});return ContainerNode_1;}var xmlnames={};var hasRequiredXmlnames;function requireXmlnames(){if(hasRequiredXmlnames)return xmlnames;hasRequiredXmlnames=1;xmlnames.isValidName=isValidName;xmlnames.isValidQName=isValidQName;var simplename=/^[_:A-Za-z][-.:\w]+$/;var simpleqname=/^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/;var ncnamestartchars="_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD";var ncnamechars="-._A-Za-z0-9\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0300-\u037D\u037F-\u1FFF\u200C\u200D\u203f\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD";var ncname="["+ncnamestartchars+"]["+ncnamechars+"]*";var namestartchars=ncnamestartchars+":";var namechars=ncnamechars+":";var name=new RegExp("^["+namestartchars+"]"+"["+namechars+"]*$");var qname=new RegExp("^("+ncname+"|"+ncname+":"+ncname+")$");var hassurrogates=/[\uD800-\uDB7F\uDC00-\uDFFF]/;var surrogatechars=/[\uD800-\uDB7F\uDC00-\uDFFF]/g;var surrogatepairs=/[\uD800-\uDB7F][\uDC00-\uDFFF]/g;ncnamestartchars+="\uD800-\uDB7F\uDC00-\uDFFF";ncnamechars+="\uD800-\uDB7F\uDC00-\uDFFF";ncname="["+ncnamestartchars+"]["+ncnamechars+"]*";namestartchars=ncnamestartchars+":";namechars=ncnamechars+":";var surrogatename=new RegExp("^["+namestartchars+"]"+"["+namechars+"]*$");var surrogateqname=new RegExp("^("+ncname+"|"+ncname+":"+ncname+")$");function isValidName(s){if(simplename.test(s))return true;if(name.test(s))return true;if(!hassurrogates.test(s))return false;if(!surrogatename.test(s))return false;var chars=s.match(surrogatechars),pairs=s.match(surrogatepairs);return pairs!==null&&2*pairs.length===chars.length;}function isValidQName(s){if(simpleqname.test(s))return true;if(qname.test(s))return true;if(!hassurrogates.test(s))return false;if(!surrogateqname.test(s))return false;var chars=s.match(surrogatechars),pairs=s.match(surrogatepairs);return pairs!==null&&2*pairs.length===chars.length;}return xmlnames;}var attributes={};var hasRequiredAttributes;function requireAttributes(){if(hasRequiredAttributes)return attributes;hasRequiredAttributes=1;var utils=requireUtils();attributes.property=function(attr){if(Array.isArray(attr.type)){var valid=Object.create(null);attr.type.forEach(function(val){valid[val.value||val]=val.alias||val;});var missingValueDefault=attr.missing;if(missingValueDefault===undefined){missingValueDefault=null;}var invalidValueDefault=attr.invalid;if(invalidValueDefault===undefined){invalidValueDefault=missingValueDefault;}return {get:function(){var v=this._getattr(attr.name);if(v===null)return missingValueDefault;v=valid[v.toLowerCase()];if(v!==undefined)return v;if(invalidValueDefault!==null)return invalidValueDefault;return v;},set:function(v){this._setattr(attr.name,v);}};}else if(attr.type===Boolean){return {get:function(){return this.hasAttribute(attr.name);},set:function(v){if(v){this._setattr(attr.name,'');}else {this.removeAttribute(attr.name);}}};}else if(attr.type===Number||attr.type==="long"||attr.type==="unsigned long"||attr.type==="limited unsigned long with fallback"){return numberPropDesc(attr);}else if(!attr.type||attr.type===String){return {get:function(){return this._getattr(attr.name)||'';},set:function(v){if(attr.treatNullAsEmptyString&&v===null){v='';}this._setattr(attr.name,v);}};}else if(typeof attr.type==='function'){return attr.type(attr.name,attr);}throw new Error('Invalid attribute definition');};function numberPropDesc(a){var def;if(typeof a.default==='function'){def=a.default;}else if(typeof a.default==='number'){def=function(){return a.default;};}else {def=function(){utils.assert(false,typeof a.default);};}var unsigned_long=a.type==='unsigned long';var signed_long=a.type==='long';var unsigned_fallback=a.type==='limited unsigned long with fallback';var min=a.min,max=a.max,setmin=a.setmin;if(min===undefined){if(unsigned_long)min=0;if(signed_long)min=-2147483648;if(unsigned_fallback)min=1;}if(max===undefined){if(unsigned_long||signed_long||unsigned_fallback)max=0x7FFFFFFF;}return {get:function(){var v=this._getattr(a.name);var n=a.float?parseFloat(v):parseInt(v,10);if(v===null||!isFinite(n)||min!==undefined&&n<min||max!==undefined&&n>max){return def.call(this);}if(unsigned_long||signed_long||unsigned_fallback){if(!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v)){return def.call(this);}n=n|0;}return n;},set:function(v){if(!a.float){v=Math.floor(v);}if(setmin!==undefined&&v<setmin){utils.IndexSizeError(a.name+' set to '+v);}if(unsigned_long){v=v<0||v>0x7FFFFFFF?def.call(this):v|0;}else if(unsigned_fallback){v=v<1||v>0x7FFFFFFF?def.call(this):v|0;}else if(signed_long){v=v<-2147483648||v>0x7FFFFFFF?def.call(this):v|0;}this._setattr(a.name,String(v));}};}attributes.registerChangeHandler=function(c,name,handler){var p=c.prototype;if(!Object.prototype.hasOwnProperty.call(p,'_attributeChangeHandlers')){p._attributeChangeHandlers=Object.create(p._attributeChangeHandlers||null);}p._attributeChangeHandlers[name]=handler;};return attributes;}var FilteredElementList_1;var hasRequiredFilteredElementList;function requireFilteredElementList(){if(hasRequiredFilteredElementList)return FilteredElementList_1;hasRequiredFilteredElementList=1;FilteredElementList_1=FilteredElementList;var Node=requireNode();function FilteredElementList(root,filter){this.root=root;this.filter=filter;this.lastModTime=root.lastModTime;this.done=false;this.cache=[];this.traverse();}FilteredElementList.prototype=Object.create(Object.prototype,{length:{get:function(){this.checkcache();if(!this.done)this.traverse();return this.cache.length;}},item:{value:function(n){this.checkcache();if(!this.done&&n>=this.cache.length){this.traverse();}return this.cache[n];}},checkcache:{value:function(){if(this.lastModTime!==this.root.lastModTime){for(var i=this.cache.length-1;i>=0;i--){this[i]=undefined;}this.cache.length=0;this.done=false;this.lastModTime=this.root.lastModTime;}}},traverse:{value:function(n){if(n!==undefined)n++;var elt;while((elt=this.next())!==null){this[this.cache.length]=elt;this.cache.push(elt);if(n&&this.cache.length===n)return;}this.done=true;}},next:{value:function(){var start=this.cache.length===0?this.root:this.cache[this.cache.length-1];var elt;if(start.nodeType===Node.DOCUMENT_NODE)elt=start.documentElement;else elt=start.nextElement(this.root);while(elt){if(this.filter(elt)){return elt;}elt=elt.nextElement(this.root);}return null;}}});return FilteredElementList_1;}var DOMTokenList_1;var hasRequiredDOMTokenList;function requireDOMTokenList(){if(hasRequiredDOMTokenList)return DOMTokenList_1;hasRequiredDOMTokenList=1;var utils=requireUtils();DOMTokenList_1=DOMTokenList;function DOMTokenList(getter,setter){this._getString=getter;this._setString=setter;this._length=0;this._lastStringValue='';this._update();}Object.defineProperties(DOMTokenList.prototype,{length:{get:function(){return this._length;}},item:{value:function(index){var list=getList(this);if(index<0||index>=list.length){return null;}return list[index];}},contains:{value:function(token){token=String(token);var list=getList(this);return list.indexOf(token)>-1;}},add:{value:function(){var list=getList(this);for(var i=0,len=arguments.length;i<len;i++){var token=handleErrors(arguments[i]);if(list.indexOf(token)<0){list.push(token);}}this._update(list);}},remove:{value:function(){var list=getList(this);for(var i=0,len=arguments.length;i<len;i++){var token=handleErrors(arguments[i]);var index=list.indexOf(token);if(index>-1){list.splice(index,1);}}this._update(list);}},toggle:{value:function toggle(token,force){token=handleErrors(token);if(this.contains(token)){if(force===undefined||force===false){this.remove(token);return false;}return true;}else {if(force===undefined||force===true){this.add(token);return true;}return false;}}},replace:{value:function replace(token,newToken){if(String(newToken)===''){utils.SyntaxError();}token=handleErrors(token);newToken=handleErrors(newToken);var list=getList(this);var idx=list.indexOf(token);if(idx<0){return false;}var idx2=list.indexOf(newToken);if(idx2<0){list[idx]=newToken;}else {if(idx<idx2){list[idx]=newToken;list.splice(idx2,1);}else {list.splice(idx,1);}}this._update(list);return true;}},toString:{value:function(){return this._getString();}},value:{get:function(){return this._getString();},set:function(v){this._setString(v);this._update();}},_update:{value:function(list){if(list){fixIndex(this,list);this._setString(list.join(" ").trim());}else {fixIndex(this,getList(this));}this._lastStringValue=this._getString();}}});function fixIndex(clist,list){var oldLength=clist._length;var i;clist._length=list.length;for(i=0;i<list.length;i++){clist[i]=list[i];}for(;i<oldLength;i++){clist[i]=undefined;}}function handleErrors(token){token=String(token);if(token===""){utils.SyntaxError();}if(/[ \t\r\n\f]/.test(token)){utils.InvalidCharacterError();}return token;}function toArray(clist){var length=clist._length;var arr=Array(length);for(var i=0;i<length;i++){arr[i]=clist[i];}return arr;}function getList(clist){var strProp=clist._getString();if(strProp===clist._lastStringValue){return toArray(clist);}var str=strProp.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g,'');if(str===""){return [];}else {var seen=Object.create(null);return str.split(/[ \t\r\n\f]+/g).filter(function(n){var key='$'+n;if(seen[key]){return false;}seen[key]=true;return true;});}}return DOMTokenList_1;}var select={exports:{}};var hasRequiredSelect;function requireSelect(){if(hasRequiredSelect)return select.exports;hasRequiredSelect=1;(function(module,exports){var window=Object.create(null,{location:{get:function(){throw new Error('window.location is not supported.');}}});var compareDocumentPosition=function(a,b){return a.compareDocumentPosition(b);};var order=function(a,b){return compareDocumentPosition(a,b)&2?1:-1;};var next=function(el){while((el=el.nextSibling)&&el.nodeType!==1);return el;};var prev=function(el){while((el=el.previousSibling)&&el.nodeType!==1);return el;};var child=function(el){if(el=el.firstChild){while(el.nodeType!==1&&(el=el.nextSibling));}return el;};var lastChild=function(el){if(el=el.lastChild){while(el.nodeType!==1&&(el=el.previousSibling));}return el;};var parentIsElement=function(n){if(!n.parentNode){return false;}var nodeType=n.parentNode.nodeType;return nodeType===1||nodeType===9;};var unquote=function(str){if(!str)return str;var ch=str[0];if(ch==='"'||ch==='\''){if(str[str.length-1]===ch){str=str.slice(1,-1);}else {str=str.slice(1);}return str.replace(rules.str_escape,function(s){var m=/^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(s);if(!m){return s.slice(1);}if(m[2]){return '';}var cp=parseInt(m[1],16);return String.fromCodePoint?String.fromCodePoint(cp):String.fromCharCode(cp);});}else if(rules.ident.test(str)){return decodeid(str);}else {return str;}};var decodeid=function(str){return str.replace(rules.escape,function(s){var m=/^\\([0-9A-Fa-f]+)/.exec(s);if(!m){return s[1];}var cp=parseInt(m[1],16);return String.fromCodePoint?String.fromCodePoint(cp):String.fromCharCode(cp);});};var indexOf=function(){if(Array.prototype.indexOf){return Array.prototype.indexOf;}return function(obj,item){var i=this.length;while(i--){if(this[i]===item)return i;}return -1;};}();var makeInside=function(start,end){var regex=rules.inside.source.replace(/</g,start).replace(/>/g,end);return new RegExp(regex);};var replace=function(regex,name,val){regex=regex.source;regex=regex.replace(name,val.source||val);return new RegExp(regex);};var truncateUrl=function(url,num){return url.replace(/^(?:\w+:\/\/|\/+)/,'').replace(/(?:\/+|\/*#.*?)$/,'').split('/',num).join('/');};var parseNth=function(param_,test){var param=param_.replace(/\s+/g,''),cap;if(param==='even'){param='2n+0';}else if(param==='odd'){param='2n+1';}else if(param.indexOf('n')===-1){param='0n'+param;}cap=/^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param);return {group:cap[1]==='-'?-(cap[2]||1):+(cap[2]||1),offset:cap[4]?cap[3]==='-'?-cap[4]:+cap[4]:0};};var nth=function(param_,test,last){var param=parseNth(param_),group=param.group,offset=param.offset,find=!last?child:lastChild,advance=!last?next:prev;return function(el){if(!parentIsElement(el))return;var rel=find(el.parentNode),pos=0;while(rel){if(test(rel,el))pos++;if(rel===el){pos-=offset;return group&&pos?pos%group===0&&pos<0===group<0:!pos;}rel=advance(rel);}};};var selectors={'*':function(){return function(){return true;};}(),'type':function(type){type=type.toLowerCase();return function(el){return el.nodeName.toLowerCase()===type;};},'attr':function(key,op,val,i){op=operators[op];return function(el){var attr;switch(key){case'for':attr=el.htmlFor;break;case'class':attr=el.className;if(attr===''&&el.getAttribute('class')==null){attr=null;}break;case'href':case'src':attr=el.getAttribute(key,2);break;case'title':attr=el.getAttribute('title')||null;break;case'id':case'lang':case'dir':case'accessKey':case'hidden':case'tabIndex':case'style':if(el.getAttribute){attr=el.getAttribute(key);break;}default:if(el.hasAttribute&&!el.hasAttribute(key)){break;}attr=el[key]!=null?el[key]:el.getAttribute&&el.getAttribute(key);break;}if(attr==null)return;attr=attr+'';if(i){attr=attr.toLowerCase();val=val.toLowerCase();}return op(attr,val);};},':first-child':function(el){return !prev(el)&&parentIsElement(el);},':last-child':function(el){return !next(el)&&parentIsElement(el);},':only-child':function(el){return !prev(el)&&!next(el)&&parentIsElement(el);},':nth-child':function(param,last){return nth(param,function(){return true;},last);},':nth-last-child':function(param){return selectors[':nth-child'](param,true);},':root':function(el){return el.ownerDocument.documentElement===el;},':empty':function(el){return !el.firstChild;},':not':function(sel){var test=compileGroup(sel);return function(el){return !test(el);};},':first-of-type':function(el){if(!parentIsElement(el))return;var type=el.nodeName;while(el=prev(el)){if(el.nodeName===type)return;}return true;},':last-of-type':function(el){if(!parentIsElement(el))return;var type=el.nodeName;while(el=next(el)){if(el.nodeName===type)return;}return true;},':only-of-type':function(el){return selectors[':first-of-type'](el)&&selectors[':last-of-type'](el);},':nth-of-type':function(param,last){return nth(param,function(rel,el){return rel.nodeName===el.nodeName;},last);},':nth-last-of-type':function(param){return selectors[':nth-of-type'](param,true);},':checked':function(el){return !!(el.checked||el.selected);},':indeterminate':function(el){return !selectors[':checked'](el);},':enabled':function(el){return !el.disabled&&el.type!=='hidden';},':disabled':function(el){return !!el.disabled;},':target':function(el){return el.id===window.location.hash.substring(1);},':focus':function(el){return el===el.ownerDocument.activeElement;},':is':function(sel){return compileGroup(sel);},':matches':function(sel){return selectors[':is'](sel);},':nth-match':function(param,last){var args=param.split(/\s*,\s*/),arg=args.shift(),test=compileGroup(args.join(','));return nth(arg,test,last);},':nth-last-match':function(param){return selectors[':nth-match'](param,true);},':links-here':function(el){return el+''===window.location+'';},':lang':function(param){return function(el){while(el){if(el.lang)return el.lang.indexOf(param)===0;el=el.parentNode;}};},':dir':function(param){return function(el){while(el){if(el.dir)return el.dir===param;el=el.parentNode;}};},':scope':function(el,con){var context=con||el.ownerDocument;if(context.nodeType===9){return el===context.documentElement;}return el===context;},':any-link':function(el){return typeof el.href==='string';},':local-link':function(el){if(el.nodeName){return el.href&&el.host===window.location.host;}var param=+el+1;return function(el){if(!el.href)return;var url=window.location+'',href=el+'';return truncateUrl(url,param)===truncateUrl(href,param);};},':default':function(el){return !!el.defaultSelected;},':valid':function(el){return el.willValidate||el.validity&&el.validity.valid;},':invalid':function(el){return !selectors[':valid'](el);},':in-range':function(el){return el.value>el.min&&el.value<=el.max;},':out-of-range':function(el){return !selectors[':in-range'](el);},':required':function(el){return !!el.required;},':optional':function(el){return !el.required;},':read-only':function(el){if(el.readOnly)return true;var attr=el.getAttribute('contenteditable'),prop=el.contentEditable,name=el.nodeName.toLowerCase();name=name!=='input'&&name!=='textarea';return (name||el.disabled)&&attr==null&&prop!=='true';},':read-write':function(el){return !selectors[':read-only'](el);},':hover':function(){throw new Error(':hover is not supported.');},':active':function(){throw new Error(':active is not supported.');},':link':function(){throw new Error(':link is not supported.');},':visited':function(){throw new Error(':visited is not supported.');},':column':function(){throw new Error(':column is not supported.');},':nth-column':function(){throw new Error(':nth-column is not supported.');},':nth-l