UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

4 lines 241 kB
var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),t=e(((e,t)=>{t.exports=n,n.CAPTURING_PHASE=1,n.AT_TARGET=2,n.BUBBLING_PHASE=3;function n(e,t){if(this.type=``,this.target=null,this.currentTarget=null,this.eventPhase=n.AT_TARGET,this.bubbles=!1,this.cancelable=!1,this.isTrusted=!1,this.defaultPrevented=!1,this.timeStamp=Date.now(),this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._initialized=!0,this._dispatching=!1,e&&(this.type=e),t)for(var r in t)this[r]=t[r]}n.prototype=Object.create(Object.prototype,{constructor:{value:n},stopPropagation:{value:function(){this._propagationStopped=!0}},stopImmediatePropagation:{value:function(){this._propagationStopped=!0,this._immediatePropagationStopped=!0}},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0)}},initEvent:{value:function(e,t,n){this._initialized=!0,!this._dispatching&&(this._propagationStopped=!1,this._immediatePropagationStopped=!1,this.defaultPrevented=!1,this.isTrusted=!1,this.target=null,this.type=e,this.bubbles=t,this.cancelable=n)}}})})),n=e(((e,n)=>{var r=t();n.exports=i;function i(){r.call(this),this.view=null,this.detail=0}i.prototype=Object.create(r.prototype,{constructor:{value:i},initUIEvent:{value:function(e,t,n,r,i){this.initEvent(e,t,n),this.view=r,this.detail=i}}})})),r=e(((e,t)=>{var r=n();t.exports=i;function i(){r.call(this),this.screenX=this.screenY=this.clientX=this.clientY=0,this.ctrlKey=this.altKey=this.shiftKey=this.metaKey=!1,this.button=0,this.buttons=1,this.relatedTarget=null}i.prototype=Object.create(r.prototype,{constructor:{value:i},initMouseEvent:{value:function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){switch(this.initEvent(e,t,n,r,i),this.screenX=a,this.screenY=o,this.clientX=s,this.clientY=c,this.ctrlKey=l,this.altKey=u,this.shiftKey=d,this.metaKey=f,this.button=p,p){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=m}},getModifierState:{value:function(e){switch(e){case`Alt`:return this.altKey;case`Control`:return this.ctrlKey;case`Shift`:return this.shiftKey;case`Meta`:return this.metaKey;default:return!1}}}})})),i=e(((e,t)=>{t.exports=E;var n=1,r=3,i=4,a=5,o=7,s=8,c=9,l=11,u=12,d=13,f=14,p=15,m=17,h=18,g=19,_=20,v=21,y=22,b=23,x=24,S=25,C=[null,`INDEX_SIZE_ERR`,null,`HIERARCHY_REQUEST_ERR`,`WRONG_DOCUMENT_ERR`,`INVALID_CHARACTER_ERR`,null,`NO_MODIFICATION_ALLOWED_ERR`,`NOT_FOUND_ERR`,`NOT_SUPPORTED_ERR`,`INUSE_ATTRIBUTE_ERR`,`INVALID_STATE_ERR`,`SYNTAX_ERR`,`INVALID_MODIFICATION_ERR`,`NAMESPACE_ERR`,`INVALID_ACCESS_ERR`,null,`TYPE_MISMATCH_ERR`,`SECURITY_ERR`,`NETWORK_ERR`,`ABORT_ERR`,`URL_MISMATCH_ERR`,`QUOTA_EXCEEDED_ERR`,`TIMEOUT_ERR`,`INVALID_NODE_TYPE_ERR`,`DATA_CLONE_ERR`],w=[null,`INDEX_SIZE_ERR (1): the index is not in the allowed range`,null,`HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model`,`WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required`,`INVALID_CHARACTER_ERR (5): the string contains invalid characters`,null,`NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified`,`NOT_FOUND_ERR (8): the object can not be found here`,`NOT_SUPPORTED_ERR (9): this operation is not supported`,`INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute`,`INVALID_STATE_ERR (11): the object is in an invalid state`,`SYNTAX_ERR (12): the string did not match the expected pattern`,`INVALID_MODIFICATION_ERR (13): the object can not be modified in this way`,`NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML`,`INVALID_ACCESS_ERR (15): the object does not support the operation or argument`,null,`TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type`,`SECURITY_ERR (18): the operation is insecure`,`NETWORK_ERR (19): a network error occurred`,`ABORT_ERR (20): the user aborted an operation`,`URL_MISMATCH_ERR (21): the given URL does not match another URL`,`QUOTA_EXCEEDED_ERR (22): the quota has been exceeded`,`TIMEOUT_ERR (23): a timeout occurred`,`INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation`,`DATA_CLONE_ERR (25): the object can not be cloned.`],T={INDEX_SIZE_ERR:n,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:r,WRONG_DOCUMENT_ERR:i,INVALID_CHARACTER_ERR:a,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:o,NOT_FOUND_ERR:s,NOT_SUPPORTED_ERR:c,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:l,SYNTAX_ERR:u,INVALID_MODIFICATION_ERR:d,NAMESPACE_ERR:f,INVALID_ACCESS_ERR:p,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:m,SECURITY_ERR:h,NETWORK_ERR:g,ABORT_ERR:_,URL_MISMATCH_ERR:v,QUOTA_EXCEEDED_ERR:y,TIMEOUT_ERR:b,INVALID_NODE_TYPE_ERR:x,DATA_CLONE_ERR:S};function E(e){Error.call(this),Error.captureStackTrace(this,this.constructor),this.code=e,this.message=w[e],this.name=C[e]}for(var D in E.prototype.__proto__=Error.prototype,T){var ee={value:T[D]};Object.defineProperty(E,D,ee),Object.defineProperty(E.prototype,D,ee)}})),a=e((e=>{e.isApiWritable=!globalThis.__domino_frozen__})),o=e((e=>{var t=i(),n=t,r=a().isApiWritable;e.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`},e.IndexSizeError=function(){throw new t(n.INDEX_SIZE_ERR)},e.HierarchyRequestError=function(){throw new t(n.HIERARCHY_REQUEST_ERR)},e.WrongDocumentError=function(){throw new t(n.WRONG_DOCUMENT_ERR)},e.InvalidCharacterError=function(){throw new t(n.INVALID_CHARACTER_ERR)},e.NoModificationAllowedError=function(){throw new t(n.NO_MODIFICATION_ALLOWED_ERR)},e.NotFoundError=function(){throw new t(n.NOT_FOUND_ERR)},e.NotSupportedError=function(){throw new t(n.NOT_SUPPORTED_ERR)},e.InvalidStateError=function(){throw new t(n.INVALID_STATE_ERR)},e.SyntaxError=function(){throw new t(n.SYNTAX_ERR)},e.InvalidModificationError=function(){throw new t(n.INVALID_MODIFICATION_ERR)},e.NamespaceError=function(){throw new t(n.NAMESPACE_ERR)},e.InvalidAccessError=function(){throw new t(n.INVALID_ACCESS_ERR)},e.TypeMismatchError=function(){throw new t(n.TYPE_MISMATCH_ERR)},e.SecurityError=function(){throw new t(n.SECURITY_ERR)},e.NetworkError=function(){throw new t(n.NETWORK_ERR)},e.AbortError=function(){throw new t(n.ABORT_ERR)},e.UrlMismatchError=function(){throw new t(n.URL_MISMATCH_ERR)},e.QuotaExceededError=function(){throw new t(n.QUOTA_EXCEEDED_ERR)},e.TimeoutError=function(){throw new t(n.TIMEOUT_ERR)},e.InvalidNodeTypeError=function(){throw new t(n.INVALID_NODE_TYPE_ERR)},e.DataCloneError=function(){throw new t(n.DATA_CLONE_ERR)},e.nyi=function(){throw Error(`NotYetImplemented`)},e.shouldOverride=function(){throw Error(`Abstract function; should be overriding in subclass.`)},e.assert=function(e,t){if(!e)throw Error(`Assertion failed: `+(t||``)+` `+Error().stack)},e.expose=function(e,t){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],writable:r})},e.merge=function(e,t){for(var n in t)e[n]=t[n]},e.documentOrder=function(e,t){return 3-(e.compareDocumentPosition(t)&6)},e.toASCIILowerCase=function(e){return e.replace(/[A-Z]+/g,function(e){return e.toLowerCase()})},e.toASCIIUpperCase=function(e){return e.replace(/[a-z]+/g,function(e){return e.toUpperCase()})}})),s=e(((e,n)=>{var i=t(),a=r(),s=o();n.exports=c;function c(){}c.prototype={addEventListener:function(e,t,n){if(t){n===void 0&&(n=!1),this._listeners||=Object.create(null),this._listeners[e]||(this._listeners[e]=[]);for(var r=this._listeners[e],i=0,a=r.length;i<a;i++){var o=r[i];if(o.listener===t&&o.capture===n)return}var s={listener:t,capture:n};typeof t==`function`&&(s.f=t),r.push(s)}},removeEventListener:function(e,t,n){if(n===void 0&&(n=!1),this._listeners){var r=this._listeners[e];if(r)for(var i=0,a=r.length;i<a;i++){var o=r[i];if(o.listener===t&&o.capture===n){r.length===1?this._listeners[e]=void 0:r.splice(i,1);return}}}},dispatchEvent:function(e){return this._dispatchEvent(e,!1)},_dispatchEvent:function(e,t){typeof t!=`boolean`&&(t=!1);function n(e,t){var n=t.type,r=t.eventPhase;if(t.currentTarget=e,r!==i.CAPTURING_PHASE&&e._handlers&&e._handlers[n]){var a=e._handlers[n],o;if(typeof a==`function`)o=a.call(t.currentTarget,t);else{var s=a.handleEvent;if(typeof s!=`function`)throw TypeError(`handleEvent property of event handler object isnot a function.`);o=s.call(a,t)}switch(t.type){case`mouseover`:o===!0&&t.preventDefault();break;default:o===!1&&t.preventDefault();break}}var c=e._listeners&&e._listeners[n];if(c){c=c.slice();for(var l=0,u=c.length;l<u;l++){if(t._immediatePropagationStopped)return;var d=c[l];if(!(r===i.CAPTURING_PHASE&&!d.capture||r===i.BUBBLING_PHASE&&d.capture))if(d.f)d.f.call(t.currentTarget,t);else{var f=d.listener.handleEvent;if(typeof f!=`function`)throw TypeError(`handleEvent property of event listener object is not a function.`);f.call(d.listener,t)}}}}(!e._initialized||e._dispatching)&&s.InvalidStateError(),e.isTrusted=t,e._dispatching=!0,e.target=this;for(var r=[],o=this.parentNode;o;o=o.parentNode)r.push(o);e.eventPhase=i.CAPTURING_PHASE;for(var c=r.length-1;c>=0&&(n(r[c],e),!e._propagationStopped);c--);if(e._propagationStopped||(e.eventPhase=i.AT_TARGET,n(this,e)),e.bubbles&&!e._propagationStopped){e.eventPhase=i.BUBBLING_PHASE;for(var l=0,u=r.length;l<u&&(n(r[l],e),!e._propagationStopped);l++);}if(e._dispatching=!1,e.eventPhase=i.AT_TARGET,e.currentTarget=null,t&&!e.defaultPrevented&&e instanceof a)switch(e.type){case`mousedown`:this._armed={x:e.clientX,y:e.clientY,t:e.timeStamp};break;case`mouseout`:case`mouseover`:this._armed=null;break;case`mouseup`:this._isClick(e)&&this._doClick(e),this._armed=null;break}return!e.defaultPrevented},_isClick:function(e){return this._armed!==null&&e.type===`mouseup`&&e.isTrusted&&e.button===0&&e.timeStamp-this._armed.t<1e3&&Math.abs(e.clientX-this._armed.x)<10&&Math.abs(e.clientY-this._armed.Y)<10},_doClick:function(e){if(!this._click_in_progress){this._click_in_progress=!0;for(var t=this;t&&!t._post_click_activation_steps;)t=t.parentNode;t&&t._pre_click_activation_steps&&t._pre_click_activation_steps();var n=this.ownerDocument.createEvent(`MouseEvent`);n.initMouseEvent(`click`,!0,!0,this.ownerDocument.defaultView,1,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,null);var r=this._dispatchEvent(n,!0);t&&(r?t._post_click_activation_steps&&t._post_click_activation_steps(n):t._cancelled_activation_steps&&t._cancelled_activation_steps())}},_setEventHandler:function(e,t){this._handlers||=Object.create(null),this._handlers[e]=t},_getEventHandler:function(e){return this._handlers&&this._handlers[e]||null}}})),c=e(((e,t)=>{var n=o(),r=t.exports={valid:function(e){return n.assert(e,`list falsy`),n.assert(e._previousSibling,`previous falsy`),n.assert(e._nextSibling,`next falsy`),!0},insertBefore:function(e,t){n.assert(r.valid(e)&&r.valid(t));var i=e,a=e._previousSibling,o=t,s=t._previousSibling;i._previousSibling=s,a._nextSibling=o,s._nextSibling=i,o._previousSibling=a,n.assert(r.valid(e)&&r.valid(t))},replace:function(e,t){n.assert(r.valid(e)&&(t===null||r.valid(t))),t!==null&&r.insertBefore(t,e),r.remove(e),n.assert(r.valid(e)&&(t===null||r.valid(t)))},remove:function(e){n.assert(r.valid(e));var t=e._previousSibling;if(t!==e){var i=e._nextSibling;t._nextSibling=i,i._previousSibling=t,e._previousSibling=e._nextSibling=e,n.assert(r.valid(e))}}}})),l=e(((e,t)=>{t.exports={serializeOne:_,ɵescapeMatchingClosingTag:p,ɵescapeClosingCommentTag:h,ɵescapeProcessingInstructionContent:g};var n=o(),r=n.NAMESPACE,i={STYLE:!0,SCRIPT:!0,XMP:!0,IFRAME:!0,NOEMBED:!0,NOFRAMES:!0,PLAINTEXT:!0},a={area:!0,base:!0,basefont:!0,bgsound:!0,br:!0,col:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},s={};let c=/[&<>\u00A0]/g,l=/[&"<>\u00A0]/g;function u(e){return c.test(e)?e.replace(c,e=>{switch(e){case`&`:return`&amp;`;case`<`:return`&lt;`;case`>`:return`&gt;`;case`\xA0`:return`&nbsp;`}}):e}function d(e){return l.test(e)?e.replace(l,e=>{switch(e){case`<`:return`&lt;`;case`>`:return`&gt;`;case`&`:return`&amp;`;case`"`:return`&quot;`;case`\xA0`:return`&nbsp;`}}):e}function f(e){var t=e.namespaceURI;return t?t===r.XML?`xml:`+e.localName:t===r.XLINK?`xlink:`+e.localName:t===r.XMLNS?e.localName===`xmlns`?`xmlns`:`xmlns:`+e.localName:e.name:e.localName}function p(e,t){let n=`</`+t;if(!e.toLowerCase().includes(n))return e;let r=[...e],i=e.matchAll(new RegExp(n,`ig`));for(let e of i)r[e.index]=`&lt;`;return r.join(``)}let m=/--!?>/;function h(e){return m.test(e)?e.replace(/(--\!?)>/g,`$1&gt;`):e}function g(e){return e.includes(`>`)?e.replaceAll(`>`,`&gt;`):e}function _(e,t){var o=``;switch(e.nodeType){case 1:var c=e.namespaceURI,l=c===r.HTML,m=l||c===r.SVG||c===r.MATHML?e.localName:e.tagName;o+=`<`+m;for(var _=0,v=e._numattrs;_<v;_++){var y=e._attr(_);o+=` `+f(y),y.value!==void 0&&(o+=`="`+d(y.value)+`"`)}if(o+=`>`,!(l&&a[m])){var b=e.serialize();i[m.toUpperCase()]&&(b=p(b,m)),l&&s[m]&&b.charAt(0)===` `&&(o+=` `),o+=b,o+=`</`+m+`>`}break;case 3:case 4:var x=t.nodeType===1&&t.namespaceURI===r.HTML?t.tagName:``;i[x]||x===`NOSCRIPT`&&t.ownerDocument._scripting_enabled?o+=e.data:o+=u(e.data);break;case 8:o+=`<!--`+h(e.data)+`-->`;break;case 7:let S=g(e.data);o+=`<?`+e.target+` `+S+`?>`;break;case 10:o+=`<!DOCTYPE `+e.name,o+=`>`;break;default:n.InvalidStateError()}return o}})),u=e(((e,t)=>{t.exports=u;var n=s(),r=c(),i=l(),a=o();function u(){n.call(this),this.parentNode=null,this._nextSibling=this._previousSibling=this,this._index=void 0}var d=u.ELEMENT_NODE=1,f=u.ATTRIBUTE_NODE=2,p=u.TEXT_NODE=3,m=u.CDATA_SECTION_NODE=4,h=u.ENTITY_REFERENCE_NODE=5,g=u.ENTITY_NODE=6,_=u.PROCESSING_INSTRUCTION_NODE=7,v=u.COMMENT_NODE=8,y=u.DOCUMENT_NODE=9,b=u.DOCUMENT_TYPE_NODE=10,x=u.DOCUMENT_FRAGMENT_NODE=11,S=u.NOTATION_NODE=12,C=u.DOCUMENT_POSITION_DISCONNECTED=1,w=u.DOCUMENT_POSITION_PRECEDING=2,T=u.DOCUMENT_POSITION_FOLLOWING=4,E=u.DOCUMENT_POSITION_CONTAINS=8,D=u.DOCUMENT_POSITION_CONTAINED_BY=16,ee=u.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;u.prototype=Object.create(n.prototype,{baseURI:{get:a.nyi},parentElement:{get:function(){return this.parentNode&&this.parentNode.nodeType===d?this.parentNode:null}},hasChildNodes:{value:a.shouldOverride},firstChild:{get:a.shouldOverride},lastChild:{get:a.shouldOverride},isConnected:{get:function(){let e=this;for(;e!=null;){if(e.nodeType===u.DOCUMENT_NODE)return!0;e=e.parentNode,e!=null&&e.nodeType===u.DOCUMENT_FRAGMENT_NODE&&(e=e.host)}return!1}},previousSibling:{get:function(){var e=this.parentNode;return!e||this===e.firstChild?null:this._previousSibling}},nextSibling:{get:function(){var e=this.parentNode,t=this._nextSibling;return!e||t===e.firstChild?null:t}},textContent:{get:function(){return null},set:function(e){}},innerText:{get:function(){return null},set:function(e){}},_countChildrenOfType:{value:function(e){for(var t=0,n=this.firstChild;n!==null;n=n.nextSibling)n.nodeType===e&&t++;return t}},_ensureInsertValid:{value:function(e,t,n){var r=this,i,o;if(!e.nodeType)throw TypeError(`not a node`);switch(r.nodeType){case y:case x:case d:break;default:a.HierarchyRequestError()}switch(e.isAncestor(r)&&a.HierarchyRequestError(),(t!==null||!n)&&t.parentNode!==r&&a.NotFoundError(),e.nodeType){case x:case b:case d:case p:case _:case v:break;default:a.HierarchyRequestError()}if(r.nodeType===y)switch(e.nodeType){case p:a.HierarchyRequestError();break;case x:switch(e._countChildrenOfType(p)>0&&a.HierarchyRequestError(),e._countChildrenOfType(d)){case 0:break;case 1:if(t!==null)for(n&&t.nodeType===b&&a.HierarchyRequestError(),o=t.nextSibling;o!==null;o=o.nextSibling)o.nodeType===b&&a.HierarchyRequestError();i=r._countChildrenOfType(d),n?i>0&&a.HierarchyRequestError():(i>1||i===1&&t.nodeType!==d)&&a.HierarchyRequestError();break;default:a.HierarchyRequestError()}break;case d:if(t!==null)for(n&&t.nodeType===b&&a.HierarchyRequestError(),o=t.nextSibling;o!==null;o=o.nextSibling)o.nodeType===b&&a.HierarchyRequestError();i=r._countChildrenOfType(d),n?i>0&&a.HierarchyRequestError():(i>1||i===1&&t.nodeType!==d)&&a.HierarchyRequestError();break;case b:if(t===null)r._countChildrenOfType(d)&&a.HierarchyRequestError();else for(o=r.firstChild;o!==null&&o!==t;o=o.nextSibling)o.nodeType===d&&a.HierarchyRequestError();i=r._countChildrenOfType(b),n?i>0&&a.HierarchyRequestError():(i>1||i===1&&t.nodeType!==b)&&a.HierarchyRequestError();break}else e.nodeType===b&&a.HierarchyRequestError()}},insertBefore:{value:function(e,t){var n=this;n._ensureInsertValid(e,t,!0);var r=t;return r===e&&(r=e.nextSibling),n.doc.adoptNode(e),e._insertOrReplace(n,r,!1),e}},appendChild:{value:function(e){return this.insertBefore(e,null)}},_appendChild:{value:function(e){e._insertOrReplace(this,null,!1)}},removeChild:{value:function(e){var t=this;if(!e.nodeType)throw TypeError(`not a node`);return e.parentNode!==t&&a.NotFoundError(),e.remove(),e}},replaceChild:{value:function(e,t){var n=this;return n._ensureInsertValid(e,t,!1),e.doc!==n.doc&&n.doc.adoptNode(e),e._insertOrReplace(n,t,!0),t}},contains:{value:function(e){return e===null?!1:this===e?!0:(this.compareDocumentPosition(e)&D)!==0}},compareDocumentPosition:{value:function(e){if(this===e)return 0;if(this.doc!==e.doc||this.rooted!==e.rooted)return C+ee;for(var t=[],n=[],r=this;r!==null;r=r.parentNode)t.push(r);for(r=e;r!==null;r=r.parentNode)n.push(r);if(t.reverse(),n.reverse(),t[0]!==n[0])return C+ee;r=Math.min(t.length,n.length);for(var i=1;i<r;i++)if(t[i]!==n[i])return t[i].index<n[i].index?T:w;return t.length<n.length?T+D:w+E}},isSameNode:{value:function(e){return this===e}},isEqualNode:{value:function(e){if(!e||e.nodeType!==this.nodeType||!this.isEqual(e))return!1;for(var t=this.firstChild,n=e.firstChild;t&&n;t=t.nextSibling,n=n.nextSibling)if(!t.isEqualNode(n))return!1;return t===null&&n===null}},cloneNode:{value:function(e){var t=this.clone();if(e)for(var n=this.firstChild;n!==null;n=n.nextSibling)t._appendChild(n.cloneNode(!0));return t}},lookupPrefix:{value:function(e){var t;if(e===``||e==null)return null;switch(this.nodeType){case d:return this._lookupNamespacePrefix(e,this);case y:return t=this.documentElement,t?t.lookupPrefix(e):null;case g:case S:case x:case b:return null;case f:return t=this.ownerElement,t?t.lookupPrefix(e):null;default:return t=this.parentElement,t?t.lookupPrefix(e):null}}},lookupNamespaceURI:{value:function(e){(e===``||e===void 0)&&(e=null);var t;switch(this.nodeType){case d:return a.shouldOverride();case y:return t=this.documentElement,t?t.lookupNamespaceURI(e):null;case g:case S:case b:case x:return null;case f:return t=this.ownerElement,t?t.lookupNamespaceURI(e):null;default:return t=this.parentElement,t?t.lookupNamespaceURI(e):null}}},isDefaultNamespace:{value:function(e){return(e===``||e===void 0)&&(e=null),this.lookupNamespaceURI(null)===e}},index:{get:function(){var e=this.parentNode;if(this===e.firstChild)return 0;var t=e.childNodes;if(this._index===void 0||t[this._index]!==this){for(var n=0;n<t.length;n++)t[n]._index=n;a.assert(t[this._index]===this)}return this._index}},isAncestor:{value:function(e){if(this.doc!==e.doc||this.rooted!==e.rooted)return!1;for(var t=e;t;t=t.parentNode)if(t===this)return!0;return!1}},ensureSameDoc:{value:function(e){e.ownerDocument===null?e.ownerDocument=this.doc:e.ownerDocument!==this.doc&&a.WrongDocumentError()}},removeChildren:{value:a.shouldOverride},_insertOrReplace:{value:function(e,t,n){var i=this,o,s;i.nodeType===x&&i.rooted&&a.HierarchyRequestError(),e._childNodes&&(o=t===null?e._childNodes.length:t.index,i.parentNode===e&&i.index<o&&o--),n&&(t.rooted&&t.doc.mutateRemove(t),t.parentNode=null);var c=t;c===null&&(c=e.firstChild);var l=i.rooted&&e.rooted;if(i.nodeType===x){for(var u=[0,+!!n],d,f=i.firstChild;f!==null;f=d)d=f.nextSibling,u.push(f),f.parentNode=e;var p=u.length;if(n?r.replace(c,p>2?u[2]:null):p>2&&c!==null&&r.insertBefore(u[2],c),e._childNodes)for(u[0]=t===null?e._childNodes.length:t._index,e._childNodes.splice.apply(e._childNodes,u),s=2;s<p;s++)u[s]._index=u[0]+(s-2);else e._firstChild===t&&(p>2?e._firstChild=u[2]:n&&(e._firstChild=null));if(i._childNodes?i._childNodes.length=0:i._firstChild=null,e.rooted)for(e.modify(),s=2;s<p;s++)e.doc.mutateInsert(u[s])}else{if(t===i)return;l?i._remove():i.parentNode&&i.remove(),i.parentNode=e,n?(r.replace(c,i),e._childNodes?(i._index=o,e._childNodes[o]=i):e._firstChild===t&&(e._firstChild=i)):(c!==null&&r.insertBefore(i,c),e._childNodes?(i._index=o,e._childNodes.splice(o,0,i)):e._firstChild===t&&(e._firstChild=i)),l?(e.modify(),e.doc.mutateMove(i)):e.rooted&&(e.modify(),e.doc.mutateInsert(i))}}},lastModTime:{get:function(){return this._lastModTime||=this.doc.modclock,this._lastModTime}},modify:{value:function(){if(this.doc.modclock)for(var e=++this.doc.modclock,t=this;t;t=t.parentElement)t._lastModTime&&=e}},doc:{get:function(){return this.ownerDocument||this}},rooted:{get:function(){return!!this._nid}},normalize:{value:function(){for(var e,t=this.firstChild;t!==null;t=e)if(e=t.nextSibling,t.normalize&&t.normalize(),t.nodeType===u.TEXT_NODE){if(t.nodeValue===``){this.removeChild(t);continue}var n=t.previousSibling;n!==null&&n.nodeType===u.TEXT_NODE&&(n.appendData(t.nodeValue),this.removeChild(t))}}},serialize:{value:function(){if(this._innerHTML)return this._innerHTML;for(var e=``,t=this.firstChild;t!==null;t=t.nextSibling)e+=i.serializeOne(t,this);return e}},outerHTML:{get:function(){return i.serializeOne(this,{nodeType:0})},set:a.nyi},ELEMENT_NODE:{value:d},ATTRIBUTE_NODE:{value:f},TEXT_NODE:{value:p},CDATA_SECTION_NODE:{value:m},ENTITY_REFERENCE_NODE:{value:h},ENTITY_NODE:{value:g},PROCESSING_INSTRUCTION_NODE:{value:_},COMMENT_NODE:{value:v},DOCUMENT_NODE:{value:y},DOCUMENT_TYPE_NODE:{value:b},DOCUMENT_FRAGMENT_NODE:{value:x},NOTATION_NODE:{value:S},DOCUMENT_POSITION_DISCONNECTED:{value:C},DOCUMENT_POSITION_PRECEDING:{value:w},DOCUMENT_POSITION_FOLLOWING:{value:T},DOCUMENT_POSITION_CONTAINS:{value:E},DOCUMENT_POSITION_CONTAINED_BY:{value:D},DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:{value:ee}})})),d=e(((e,t)=>{t.exports=class extends Array{constructor(e){if(super(e&&e.length||0),e)for(var t in e)this[t]=e[t]}item(e){return this[e]||null}}})),f=e(((e,t)=>{function n(e){return this[e]||null}function r(e){return e||=[],e.item=n,e}t.exports=r})),p=e(((e,t)=>{var n;try{n=d()}catch{n=f()}t.exports=n})),m=e(((e,t)=>{t.exports=i;var n=u(),r=p();function i(){n.call(this),this._firstChild=this._childNodes=null}i.prototype=Object.create(n.prototype,{hasChildNodes:{value:function(){return this._childNodes?this._childNodes.length>0:this._firstChild!==null}},childNodes:{get:function(){return this._ensureChildNodes(),this._childNodes}},firstChild:{get:function(){return this._childNodes?this._childNodes.length===0?null:this._childNodes[0]:this._firstChild}},lastChild:{get:function(){var e=this._childNodes,t;return e?e.length===0?null:e[e.length-1]:(t=this._firstChild,t===null?null:t._previousSibling)}},_ensureChildNodes:{value:function(){if(!this._childNodes){var e=this._firstChild,t=e,n=this._childNodes=new r;if(e)do n.push(t),t=t._nextSibling;while(t!==e);this._firstChild=null}}},removeChildren:{value:function(){for(var e=this.rooted?this.ownerDocument:null,t=this.firstChild,n;t!==null;)n=t,t=n.nextSibling,e&&e.mutateRemove(n),n.parentNode=null;this._childNodes?this._childNodes.length=0:this._firstChild=null,this.modify()}}})})),h=e((e=>{e.isValidName=h,e.isValidQName=g;var t=/^[_:A-Za-z][-.:\w]+$/,n=/^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/,r=`_A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,i=`-._A-Za-z0-9·À-ÖØ-öø-˿̀-ͽͿ-῿‌‍‿⁀⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,a=`[`+r+`][`+i+`]*`,o=r+`:`,s=i+`:`,c=RegExp(`^[`+o+`][`+s+`]*$`),l=RegExp(`^(`+a+`|`+a+`:`+a+`)$`),u=/[\uD800-\uDB7F\uDC00-\uDFFF]/,d=/[\uD800-\uDB7F\uDC00-\uDFFF]/g,f=/[\uD800-\uDB7F][\uDC00-\uDFFF]/g;r+=`\ud800-󯰀-\udfff`,i+=`\ud800-󯰀-\udfff`,a=`[`+r+`][`+i+`]*`,o=r+`:`,s=i+`:`;var p=RegExp(`^[`+o+`][`+s+`]*$`),m=RegExp(`^(`+a+`|`+a+`:`+a+`)$`);function h(e){if(t.test(e)||c.test(e))return!0;if(!u.test(e)||!p.test(e))return!1;var n=e.match(d),r=e.match(f);return r!==null&&2*r.length===n.length}function g(e){if(n.test(e)||l.test(e))return!0;if(!u.test(e)||!m.test(e))return!1;var t=e.match(d),r=e.match(f);return r!==null&&2*r.length===t.length}})),g=e((e=>{var t=o();e.property=function(e){if(Array.isArray(e.type)){var t=Object.create(null);e.type.forEach(function(e){t[e.value||e]=e.alias||e});var r=e.missing;r===void 0&&(r=null);var i=e.invalid;return i===void 0&&(i=r),{get:function(){var n=this._getattr(e.name);return n===null?r:(n=t[n.toLowerCase()],n===void 0?i===null?n:i:n)},set:function(t){this._setattr(e.name,t)}}}else if(e.type===Boolean)return{get:function(){return this.hasAttribute(e.name)},set:function(t){t?this._setattr(e.name,``):this.removeAttribute(e.name)}};else if(e.type===Number||e.type===`long`||e.type===`unsigned long`||e.type===`limited unsigned long with fallback`)return n(e);else if(!e.type||e.type===String)return{get:function(){return this._getattr(e.name)||``},set:function(t){e.treatNullAsEmptyString&&t===null&&(t=``),this._setattr(e.name,t)}};else if(typeof e.type==`function`)return e.type(e.name,e);throw Error(`Invalid attribute definition`)};function n(e){var n=typeof e.default==`function`?e.default:typeof e.default==`number`?function(){return e.default}:function(){t.assert(!1,typeof e.default)},r=e.type===`unsigned long`,i=e.type===`long`,a=e.type===`limited unsigned long with fallback`,o=e.min,s=e.max,c=e.setmin;return o===void 0&&(r&&(o=0),i&&(o=-2147483648),a&&(o=1)),s===void 0&&(r||i||a)&&(s=2147483647),{get:function(){var t=this._getattr(e.name),c=e.float?parseFloat(t):parseInt(t,10);if(t===null||!isFinite(c)||o!==void 0&&c<o||s!==void 0&&c>s)return n.call(this);if(r||i||a){if(!/^[ \t\n\f\r]*[-+]?[0-9]/.test(t))return n.call(this);c|=0}return c},set:function(o){e.float||(o=Math.floor(o)),c!==void 0&&o<c&&t.IndexSizeError(e.name+` set to `+o),r?o=o<0||o>2147483647?n.call(this):o|0:a?o=o<1||o>2147483647?n.call(this):o|0:i&&(o=o<-2147483648||o>2147483647?n.call(this):o|0),this._setattr(e.name,String(o))}}}e.registerChangeHandler=function(e,t,n){var r=e.prototype;Object.prototype.hasOwnProperty.call(r,`_attributeChangeHandlers`)||(r._attributeChangeHandlers=Object.create(r._attributeChangeHandlers||null)),r._attributeChangeHandlers[t]=n}})),_=e(((e,t)=>{t.exports=r;var n=u();function r(e,t){this.root=e,this.filter=t,this.lastModTime=e.lastModTime,this.done=!1,this.cache=[],this.traverse()}r.prototype=Object.create(Object.prototype,{length:{get:function(){return this.checkcache(),this.done||this.traverse(),this.cache.length}},item:{value:function(e){return this.checkcache(),!this.done&&e>=this.cache.length&&this.traverse(),this.cache[e]}},checkcache:{value:function(){if(this.lastModTime!==this.root.lastModTime){for(var e=this.cache.length-1;e>=0;e--)this[e]=void 0;this.cache.length=0,this.done=!1,this.lastModTime=this.root.lastModTime}}},traverse:{value:function(e){e!==void 0&&e++;for(var t;(t=this.next())!==null;)if(this[this.cache.length]=t,this.cache.push(t),e&&this.cache.length===e)return;this.done=!0}},next:{value:function(){for(var e=this.cache.length===0?this.root:this.cache[this.cache.length-1],t=e.nodeType===n.DOCUMENT_NODE?e.documentElement:e.nextElement(this.root);t;){if(this.filter(t))return t;t=t.nextElement(this.root)}return null}}})})),v=e(((e,t)=>{var n=o();t.exports=r;function r(e,t){this._getString=e,this._setString=t,this._length=0,this._lastStringValue=``,this._update()}Object.defineProperties(r.prototype,{length:{get:function(){return this._length}},item:{value:function(e){var t=c(this);return e<0||e>=t.length?null:t[e]}},contains:{value:function(e){return e=String(e),c(this).indexOf(e)>-1}},add:{value:function(){for(var e=c(this),t=0,n=arguments.length;t<n;t++){var r=a(arguments[t]);e.indexOf(r)<0&&e.push(r)}this._update(e)}},remove:{value:function(){for(var e=c(this),t=0,n=arguments.length;t<n;t++){var r=a(arguments[t]),i=e.indexOf(r);i>-1&&e.splice(i,1)}this._update(e)}},toggle:{value:function(e,t){return e=a(e),this.contains(e)?t===void 0||t===!1?(this.remove(e),!1):!0:t===void 0||t===!0?(this.add(e),!0):!1}},replace:{value:function(e,t){String(t)===``&&n.SyntaxError(),e=a(e),t=a(t);var r=c(this),i=r.indexOf(e);if(i<0)return!1;var o=r.indexOf(t);return o<0?r[i]=t:i<o?(r[i]=t,r.splice(o,1)):r.splice(i,1),this._update(r),!0}},toString:{value:function(){return this._getString()}},value:{get:function(){return this._getString()},set:function(e){this._setString(e),this._update()}},_update:{value:function(e){e?(i(this,e),this._setString(e.join(` `).trim())):i(this,c(this)),this._lastStringValue=this._getString()}}});function i(e,t){var n=e._length,r;for(e._length=t.length,r=0;r<t.length;r++)e[r]=t[r];for(;r<n;r++)e[r]=void 0}function a(e){return e=String(e),e===``&&n.SyntaxError(),/[ \t\r\n\f]/.test(e)&&n.InvalidCharacterError(),e}function s(e){for(var t=e._length,n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}function c(e){var t=e._getString();if(t===e._lastStringValue)return s(e);var n=t.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g,``);if(n===``)return[];var r=Object.create(null);return n.split(/[ \t\r\n\f]+/g).filter(function(e){var t=`$`+e;return r[t]?!1:(r[t]=!0,!0)})}})),y=e(((e,t)=>{var n=Object.create(null,{location:{get:function(){throw Error(`window.location is not supported.`)}}}),r=function(e,t){return e.compareDocumentPosition(t)},i=function(e,t){return r(e,t)&2?1:-1},a=function(e){for(;(e=e.nextSibling)&&e.nodeType!==1;);return e},o=function(e){for(;(e=e.previousSibling)&&e.nodeType!==1;);return e},s=function(e){if(e=e.firstChild)for(;e.nodeType!==1&&(e=e.nextSibling););return e},c=function(e){if(e=e.lastChild)for(;e.nodeType!==1&&(e=e.previousSibling););return e},l=function(e){if(!e.parentNode)return!1;var t=e.parentNode.nodeType;return t===1||t===9},u=function(e){if(!e)return e;var t=e[0];return t===`"`||t===`'`?(e=e[e.length-1]===t?e.slice(1,-1):e.slice(1),e.replace(x.str_escape,function(e){var t=/^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(e);if(!t)return e.slice(1);if(t[2])return``;var n=parseInt(t[1],16);return String.fromCodePoint?String.fromCodePoint(n):String.fromCharCode(n)})):x.ident.test(e)?d(e):e},d=function(e){return e.replace(x.escape,function(e){var t=/^\\([0-9A-Fa-f]+)/.exec(e);if(!t)return e[1];var n=parseInt(t[1],16);return String.fromCodePoint?String.fromCodePoint(n):String.fromCharCode(n)})},f=(function(){return Array.prototype.indexOf?Array.prototype.indexOf:function(e,t){for(var n=this.length;n--;)if(this[n]===t)return n;return-1}})(),p=function(e,t){var n=x.inside.source.replace(/</g,e).replace(/>/g,t);return new RegExp(n)},m=function(e,t,n){return e=e.source,e=e.replace(t,n.source||n),new RegExp(e)},h=function(e,t){return e.replace(/^(?:\w+:\/\/|\/+)/,``).replace(/(?:\/+|\/*#.*?)$/,``).split(`/`,t).join(`/`)},g=function(e,t){var n=e.replace(/\s+/g,``),r;return n===`even`?n=`2n+0`:n===`odd`?n=`2n+1`:n.indexOf(`n`)===-1&&(n=`0n`+n),r=/^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(n),{group:r[1]===`-`?-(r[2]||1):+(r[2]||1),offset:r[4]?r[3]===`-`?-r[4]:+r[4]:0}},_=function(e,t,n){var r=g(e),i=r.group,u=r.offset,d=n?c:s,f=n?o:a;return function(e){if(l(e))for(var n=d(e.parentNode),r=0;n;){if(t(n,e)&&r++,n===e)return r-=u,i&&r?r%i===0&&r<0==i<0:!r;n=f(n)}}},v={"*":(function(){return function(){return!0}})(),type:function(e){return e=e.toLowerCase(),function(t){return t.nodeName.toLowerCase()===e}},attr:function(e,t,n,r){return t=y[t],function(i){var a;switch(e){case`for`:a=i.htmlFor;break;case`class`:a=i.className,a===``&&i.getAttribute(`class`)==null&&(a=null);break;case`href`:case`src`:a=i.getAttribute(e,2);break;case`title`:a=i.getAttribute(`title`)||null;break;case`id`:case`lang`:case`dir`:case`accessKey`:case`hidden`:case`tabIndex`:case`style`:if(i.getAttribute){a=i.getAttribute(e);break}default:if(i.hasAttribute&&!i.hasAttribute(e))break;a=i[e]==null?i.getAttribute&&i.getAttribute(e):i[e];break}if(a!=null)return a+=``,r&&(a=a.toLowerCase(),n=n.toLowerCase()),t(a,n)}},":first-child":function(e){return!o(e)&&l(e)},":last-child":function(e){return!a(e)&&l(e)},":only-child":function(e){return!o(e)&&!a(e)&&l(e)},":nth-child":function(e,t){return _(e,function(){return!0},t)},":nth-last-child":function(e){return v[`:nth-child`](e,!0)},":root":function(e){return e.ownerDocument.documentElement===e},":empty":function(e){return!e.firstChild},":not":function(e){var t=D(e);return function(e){return!t(e)}},":first-of-type":function(e){if(l(e)){for(var t=e.nodeName;e=o(e);)if(e.nodeName===t)return;return!0}},":last-of-type":function(e){if(l(e)){for(var t=e.nodeName;e=a(e);)if(e.nodeName===t)return;return!0}},":only-of-type":function(e){return v[`:first-of-type`](e)&&v[`:last-of-type`](e)},":nth-of-type":function(e,t){return _(e,function(e,t){return e.nodeName===t.nodeName},t)},":nth-last-of-type":function(e){return v[`:nth-of-type`](e,!0)},":checked":function(e){return!!(e.checked||e.selected)},":indeterminate":function(e){return!v[`:checked`](e)},":enabled":function(e){return!e.disabled&&e.type!==`hidden`},":disabled":function(e){return!!e.disabled},":target":function(e){return e.id===n.location.hash.substring(1)},":focus":function(e){return e===e.ownerDocument.activeElement},":is":function(e){return D(e)},":matches":function(e){return v[`:is`](e)},":nth-match":function(e,t){var n=e.split(/\s*,\s*/);return _(n.shift(),D(n.join(`,`)),t)},":nth-last-match":function(e){return v[`:nth-match`](e,!0)},":links-here":function(e){return e+``==n.location+``},":lang":function(e){return function(t){for(;t;){if(t.lang)return t.lang.indexOf(e)===0;t=t.parentNode}}},":dir":function(e){return function(t){for(;t;){if(t.dir)return t.dir===e;t=t.parentNode}}},":scope":function(e,t){var n=t||e.ownerDocument;return n.nodeType===9?e===n.documentElement:e===n},":any-link":function(e){return typeof e.href==`string`},":local-link":function(e){if(e.nodeName)return e.href&&e.host===n.location.host;var t=+e+1;return function(e){if(e.href){var r=n.location+``,i=e+``;return h(r,t)===h(i,t)}}},":default":function(e){return!!e.defaultSelected},":valid":function(e){return e.willValidate||e.validity&&e.validity.valid},":invalid":function(e){return!v[`:valid`](e)},":in-range":function(e){return e.value>e.min&&e.value<=e.max},":out-of-range":function(e){return!v[`:in-range`](e)},":required":function(e){return!!e.required},":optional":function(e){return!e.required},":read-only":function(e){if(e.readOnly)return!0;var t=e.getAttribute(`contenteditable`),n=e.contentEditable,r=e.nodeName.toLowerCase();return r=r!==`input`&&r!==`textarea`,(r||e.disabled)&&t==null&&n!==`true`},":read-write":function(e){return!v[`:read-only`](e)},":hover":function(){throw Error(`:hover is not supported.`)},":active":function(){throw Error(`:active is not supported.`)},":link":function(){throw Error(`:link is not supported.`)},":visited":function(){throw Error(`:visited is not supported.`)},":column":function(){throw Error(`:column is not supported.`)},":nth-column":function(){throw Error(`:nth-column is not supported.`)},":nth-last-column":function(){throw Error(`:nth-last-column is not supported.`)},":current":function(){throw Error(`:current is not supported.`)},":past":function(){throw Error(`:past is not supported.`)},":future":function(){throw Error(`:future is not supported.`)},":contains":function(e){return function(t){return(t.innerText||t.textContent||t.value||``).indexOf(e)!==-1}},":has":function(e){return function(t){return ee(e,t).length>0}}},y={"-":function(){return!0},"=":function(e,t){return e===t},"*=":function(e,t){return e.indexOf(t)!==-1},"~=":function(e,t){var n,r,i,a;for(r=0;;r=n+1){if(n=e.indexOf(t,r),n===-1)return!1;if(i=e[n-1],a=e[n+t.length],(!i||i===` `)&&(!a||a===` `))return!0}},"|=":function(e,t){var n=e.indexOf(t),r;if(n===0)return r=e[n+t.length],r===`-`||!r},"^=":function(e,t){return e.indexOf(t)===0},"$=":function(e,t){var n=e.lastIndexOf(t);return n!==-1&&n+t.length===e.length},"!=":function(e,t){return e!==t}},b={" ":function(e){return function(t){for(;t=t.parentNode;)if(e(t))return t}},">":function(e){return function(t){if(t=t.parentNode)return e(t)&&t}},"+":function(e){return function(t){if(t=o(t))return e(t)&&t}},"~":function(e){return function(t){for(;t=o(t);)if(e(t))return t}},noop:function(e){return function(t){return e(t)&&t}},ref:function(e,t){var n;function r(e){for(var t=e.ownerDocument.getElementsByTagName(`*`),i=t.length;i--;)if(n=t[i],r.test(e))return n=null,!0;n=null}return r.combinator=function(r){if(!(!n||!n.getAttribute)){var i=n.getAttribute(t)||``;if(i[0]===`#`&&(i=i.substring(1)),i===r.id&&e(n))return n}},r}},x={escape:/\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g,str_escape:/(escape)|\\(\n|\r\n?|\f)/g,nonascii:/[\u00A0-\uFFFF]/,cssid:/(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/,qname:/^ *(cssid|\*)/,simple:/^(?:([.#]cssid)|pseudo|attr)/,ref:/^ *\/(cssid)\/ */,combinator:/^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/,attr:/^\[(cssid)(?:([^\w]?=)(inside))?\]/,pseudo:/^(:cssid)(?:\((inside)\))?/,inside:/(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/,ident:/^(cssid)$/};x.cssid=m(x.cssid,`nonascii`,x.nonascii),x.cssid=m(x.cssid,`escape`,x.escape),x.qname=m(x.qname,`cssid`,x.cssid),x.simple=m(x.simple,`cssid`,x.cssid),x.ref=m(x.ref,`cssid`,x.cssid),x.attr=m(x.attr,`cssid`,x.cssid),x.pseudo=m(x.pseudo,`cssid`,x.cssid),x.inside=m(x.inside,`[^"'>]*`,x.inside),x.attr=m(x.attr,`inside`,p(`\\[`,`\\]`)),x.pseudo=m(x.pseudo,`inside`,p(`\\(`,`\\)`)),x.simple=m(x.simple,`pseudo`,x.pseudo),x.simple=m(x.simple,`attr`,x.attr),x.ident=m(x.ident,`cssid`,x.cssid),x.str_escape=m(x.str_escape,`escape`,x.escape);var S=function(e){for(var t=e.replace(/^\s+|\s+$/g,``),n,r=[],i=[],a,o,s,c,l;t;){if(s=x.qname.exec(t))t=t.substring(s[0].length),o=d(s[1]),i.push(C(o,!0));else if(s=x.simple.exec(t))t=t.substring(s[0].length),o=`*`,i.push(C(o,!0)),i.push(C(s));else throw SyntaxError(`Invalid selector.`);for(;s=x.simple.exec(t);)t=t.substring(s[0].length),i.push(C(s));if(t[0]===`!`&&(t=t.substring(1),a=E(),a.qname=o,i.push(a.simple)),s=x.ref.exec(t)){t=t.substring(s[0].length),l=b.ref(w(i),d(s[1])),r.push(l.combinator),i=[];continue}if(s=x.combinator.exec(t)){if(t=t.substring(s[0].length),c=s[1]||s[2]||s[3],c===`,`){r.push(b.noop(w(i)));break}}else c=`noop`;if(!b[c])throw SyntaxError(`Bad combinator.`);r.push(b[c](w(i))),i=[]}return n=T(r),n.qname=o,n.sel=t,a&&(a.lname=n.qname,a.test=n,a.qname=a.qname,a.sel=n.sel,n=a),l&&(l.test=n,l.qname=n.qname,l.sel=n.sel,n=l),n},C=function(e,t){if(t)return e===`*`?v[`*`]:v.type(e);if(e[1])return e[1][0]===`.`?v.attr(`class`,`~=`,d(e[1].substring(1)),!1):v.attr(`id`,`=`,d(e[1].substring(1)),!1);if(e[2])return e[3]?v[d(e[2])](u(e[3])):v[d(e[2])];if(e[4]){var n=e[6],r=/["'\s]\s*I$/i.test(n);return r&&(n=n.replace(/\s*I$/i,``)),v.attr(d(e[4]),e[5]||`-`,u(n),r)}throw SyntaxError(`Unknown Selector.`)},w=function(e){var t=e.length,n;return t<2?e[0]:function(r){if(r){for(n=0;n<t;n++)if(!e[n](r))return;return!0}}},T=function(e){return e.length<2?function(t){return!!e[0](t)}:function(t){for(var n=e.length;n--;)if(!(t=e[n](t)))return;return!0}},E=function(){var e;function t(n){for(var r=n.ownerDocument.getElementsByTagName(t.lname),i=r.length;i--;)if(t.test(r[i])&&e===n)return e=null,!0;e=null}return t.simple=function(t){return e=t,!0},t},D=function(e){for(var t=S(e),n=[t];t.sel;)t=S(t.sel),n.push(t);return n.length<2?t:function(e){for(var t=n.length,r=0;r<t;r++)if(n[r](e))return!0}},ee=function(e,t){for(var n=[],r=S(e),a=t.getElementsByTagName(r.qname),o=0,s;s=a[o++];)r(s)&&n.push(s);if(r.sel){for(;r.sel;)for(r=S(r.sel),a=t.getElementsByTagName(r.qname),o=0;s=a[o++];)r(s)&&f.call(n,s)===-1&&n.push(s);n.sort(i)}return n};t.exports=e=function(e,t){var n,r;if(t.nodeType!==11&&e.indexOf(` `)===-1){if(e[0]===`#`&&t.rooted&&/^#[A-Z_][-A-Z0-9_]*$/i.test(e)&&t.doc._hasMultipleElementsWithId&&(n=e.substring(1),!t.doc._hasMultipleElementsWithId(n)))return r=t.doc.getElementById(n),r?[r]:[];if(e[0]===`.`&&/^\.\w+$/.test(e))return t.getElementsByClassName(e.substring(1));if(/^\w+$/.test(e))return t.getElementsByTagName(e)}return ee(e,t)},e.selectors=v,e.operators=y,e.combinators=b,e.matches=function(e,t){var n={sel:t};do if(n=S(n.sel),n(e))return!0;while(n.sel);return!1}})),b=e(((e,t)=>{var n=u(),r=c(),i=function(e,t){for(var r=e.createDocumentFragment(),i=0;i<t.length;i++){var a=t[i],o=a instanceof n;r.appendChild(o?a:e.createTextNode(String(a)))}return r};t.exports={after:{value:function(){var e=Array.prototype.slice.call(arguments),t=this.parentNode,n=this.nextSibling;if(t!==null){for(;n&&e.some(function(e){return e===n});)n=n.nextSibling;var r=i(this.doc,e);t.insertBefore(r,n)}}},before:{value:function(){var e=Array.prototype.slice.call(arguments),t=this.parentNode,n=this.previousSibling;if(t!==null){for(;n&&e.some(function(e){return e===n});)n=n.previousSibling;var r=i(this.doc,e),a=n?n.nextSibling:t.firstChild;t.insertBefore(r,a)}}},remove:{value:function(){this.parentNode!==null&&(this.doc&&(this.doc._preremoveNodeIterators(this),this.rooted&&this.doc.mutateRemove(this)),this._remove(),this.parentNode=null)}},_remove:{value:function(){var e=this.parentNode;e!==null&&(e._childNodes?e._childNodes.splice(this.index,1):e._firstChild===this&&(this._nextSibling===this?e._firstChild=null:e._firstChild=this._nextSibling),r.remove(this),e.modify())}},replaceWith:{value:function(){var e=Array.prototype.slice.call(arguments),t=this.parentNode,n=this.nextSibling;if(t!==null){for(;n&&e.some(function(e){return e===n});)n=n.nextSibling;var r=i(this.doc,e);this.parentNode===t?t.replaceChild(r,this):t.insertBefore(r,n)}}}}})),x=e(((e,t)=>{var n=u();t.exports={nextElementSibling:{get:function(){if(this.parentNode){for(var e=this.nextSibling;e!==null;e=e.nextSibling)if(e.nodeType===n.ELEMENT_NODE)return e}return null}},previousElementSibling:{get:function(){if(this.parentNode){for(var e=this.previousSibling;e!==null;e=e.previousSibling)if(e.nodeType===n.ELEMENT_NODE)return e}return null}}}})),S=e(((e,t)=>{t.exports=r;var n=o();function r(e){this.element=e}Object.defineProperties(r.prototype,{length:{get:n.shouldOverride},item:{value:n.shouldOverride},getNamedItem:{value:function(e){return this.element.getAttributeNode(e)}},getNamedItemNS:{value:function(e,t){return this.element.getAttributeNodeNS(e,t)}},setNamedItem:{value:n.nyi},setNamedItemNS:{value:n.nyi},removeNamedItem:{value:function(e){var t=this.element.getAttributeNode(e);if(t)return this.element.removeAttribute(e),t;n.NotFoundError()}},removeNamedItemNS:{value:function(e,t){var r=this.element.getAttributeNodeNS(e,t);if(r)return this.element.removeAttributeNS(e,t),r;n.NotFoundError()}}})})),C=e(((e,t)=>{t.exports=O;var n=h(),r=o(),a=r.NAMESPACE,s=g(),c=u(),d=p(),f=l(),C=_(),w=i(),T=v(),E=y(),D=m(),ee=b(),te=x(),ne=S(),re=Object.create(null);function O(e,t,n,r){D.call(this),this.nodeType=c.ELEMENT_NODE,this.ownerDocument=e,this.localName=t,this.namespaceURI=n,this.prefix=r,this._tagName=void 0,this._attrsByQName=Object.create(null),this._attrsByLName=Object.create(null),this._attrKeys=[]}function ie(e,t){if(e.nodeType===c.TEXT_NODE)t.push(e._data);else for(var n=0,r=e.childNodes.length;n<r;n++)ie(e.childNodes[n],t)}O.prototype=Object.create(D.prototype,{isHTML:{get:function(){return this.namespaceURI===a.HTML&&this.ownerDocument.isHTML}},tagName:{get:function(){if(this._tagName===void 0){var e=this.prefix===null?this.localName:this.prefix+`:`+this.localName;if(this.isHTML){var t=re[e];t||(re[e]=t=r.toASCIIUpperCase(e)),e=t}this._tagName=e}return this._tagName}},nodeName:{get:function(){return this.tagName}},nodeValue:{get:function(){return null},set:function(){}},textContent:{get:function(){var e=[];return ie(this,e),e.join(``)},set:function(e){this.removeChildren(),e!=null&&e!==``&&this._appendChild(this.ownerDocument.createTextNode(e))}},innerText:{get:function(){var e=[];return ie(this,e),e.join(``).replace(/[ \t\n\f\r]+/g,` `).trim()},set:function(e){this.removeChildren(),e!=null&&e!==``&&this._appendChild(this.ownerDocument.createTextNode(e))}},innerHTML:{get:function(){return this.serialize()},set:r.nyi},outerHTML:{get:function(){return f.serializeOne(this,{nodeType:0})},set:function(e){var t=this.ownerDocument,n=this.parentNode;if(n!==null){n.nodeType===c.DOCUMENT_NODE&&r.NoModificationAllowedError(),n.nodeType===c.DOCUMENT_FRAGMENT_NODE&&(n=n.ownerDocument.createElement(`body`));var i=t.implementation.mozHTMLParser(t._address,n);i.parse(e===null?``:String(e),!0),this.replaceWith(i._asDocumentFragment())}}},_insertAdjacent:{value:function(e,t){var n=!1;switch(e){case`beforebegin`:n=!0;case`afterend`:var i=this.parentNode;return i===null?null:i.insertBefore(t,n?this:this.nextSibling);case`afterbegin`:n=!0;case`beforeend`:return this.insertBefore(t,n?this.firstChild:null);default:return r.SyntaxError()}}},insertAdjacentElement:{value:function(e,t){if(t.nodeType!==c.ELEMENT_NODE)throw TypeError(`not an element`);return e=r.toASCIILowerCase(String(e)),this._insertAdjacent(e,t)}},insertAdjacentText:{value:function(e,t){var n=this.ownerDocument.createTextNode(t);e=r.toASCIILowerCase(String(e)),this._insertAdjacent(e,n)}},insertAdjacentHTML:{value:function(e,t){e=r.toASCIILowerCase(String(e)),t=String(t);var n;switch(e){case`beforebegin`:case`afterend`:n=this.parentNode,(n===null||n.nodeType===c.DOCUMENT_NODE)&&r.NoModificationAllowedError();break;case`afterbegin`:case`beforeend`:n=this;break;default:r.SyntaxError()}(!(n instanceof O)||n.ownerDocument.isHTML&&n.localName===`html`&&n.namespaceURI===a.HTML)&&(n=n.ownerDocument.createElementNS(a.HTML,`body`));var i=this.ownerDocument.implementation.mozHTMLParser(this.ownerDocument._address,n);i.parse(t,!0),this._insertAdjacent(e,i._asDocumentFragment())}},children:{get:function(){return this._children||=new se(this),this._children}},attributes:{get:function(){return this._attributes||=new oe(this),this._attributes}},firstElementChild:{get:function(){for(var e=this.firstChild;e!==null;e=e.nextSibling)if(e.nodeType===c.ELEMENT_NODE)return e;return null}},lastElementChild:{get:function(){for(var e=this.lastChild;e!==null;e=e.previousSibling)if(e.nodeType===c.ELEMENT_NODE)return e;return null}},childElementCount:{get:function(){return this.children.length}},nextElement:{value:function(e){e||=this.ownerDocument.documentElement;var t=this.firstElementChild;if(!t){if(this===e)return null;t=this.nextElementSibling}if(t)return t;for(var n=this.parentElement;n&&n!==e;n=n.parentElement)if(t=n.nextElementSibling,t)return t;return null}},getElementsByTagName:{value:function(e){var t;return e?(t=e===`*`?function(){return!0}:this.isHTML?le(e):ce(e),new C(this,t)):new d}},getElementsByTagNameNS:{value:function(e,t){var n=e===`*`&&t===`*`?function(){return!0}:e===`*`?ce(t):t===`*`?k(e):A(e,t);return new C(this,n)}},getElementsByClassName:{value:function(e){return e=String(e).trim(),e===``?new d:(e=e.split(/[ \t\r\n\f]+/),new C(this,j(e)))}},getElementsByName:{value:function(e){return new C(this,M(String(e)))}},clone:{value:function(){for(var e=this.namespaceURI!==a.HTML||this.prefix||!this.ownerDocument.isHTML?this.ownerDocument.createElementNS(this.namespaceURI,this.prefix===null?this.localName:this.prefix+`:`+this.localName):this.ownerDocument.createElement(this.localName),t=0,n=this._attrKeys.length;t<n;t++){var r=this._attrKeys[t],i=this._attrsByLName[r].cloneNode();i._setOwnerElement(e),e._attrsByLName[r]=i,e._addQName(i)}return e._attrKeys=this._attrKeys.concat(),e}},isEqual:{value:function(e){if(this.localName!==e.localName||this.namespaceURI!==e.namespaceURI||this.prefix!==e.prefix||this._numattrs!==e._numattrs)return!1;for(var t=0,n=this._numattrs;t<n;t++){var r=this._attr(t);if(!e.hasAttributeNS(r.namespaceURI,r.localName)||e.getAttributeNS(r.namespaceURI,r.localName)!==r.value)return!1}return!0}},_lookupNamespacePrefix:{value:function(e,t){if(this.namespaceURI&&this.namespaceURI===e&&this.prefix!==null&&t.lookupNamespaceURI(this.prefix)===e)return this.prefix;for(var n=0,r=this._numattrs;n<r;n++){var i=this._attr(n);if(i.prefix===`xmlns`&&i.value===e&&t.lookupNamespaceURI(i.localName)===e)return i.localName}var a=this.parentElement;return a?a._lookupNamespacePrefix(e,t):null}},lookupNamespaceURI:{value:function(e){if((e===``||e===void 0)&&(e=null),this.namespaceURI!==null&&this.prefix===e)return this.namespaceURI;for(var t=0,n=this._numattrs;t<n;t++){var r=this._attr(t);if(r.namespaceURI===a.XMLNS&&(r.prefix===`xmlns`&&r.localName===e||e===null&&r.prefix===null&&r.localName===`xmlns`))return r.value||null}var i=this.parentElement;return i?i.lookupNamespaceURI(e):null}},getAttribute:{value:function(e){var t=this.getAttributeNode(e);return t?t.value:null}},getAttributeNS:{value:function(e,t){var n=this.getAttributeNodeNS(e,t);return n?n.value:null}},getAttributeNode:{value:function(e){e=String(e),/[A-Z]/.test(e)&&this.isHTML&&(e=r.toASCIILowerCase(e));var t=this._attrsByQName[e];return t?(Array.isArray(t)&&(t=t[0]),t):null}},getAttributeNodeNS:{value:function(e,t){return e=e==null?``:String(e),t=String(t),this._attrsByLName[e+`|`+t]||null}},hasAttribute:{value:function(e){return e=String(e),/[A-Z]/.test(e)&&this.isHTML&&(e=r.toASCIILowerCase(e)),this._attrsByQName[e]!==void 0}},hasAttributeNS:{value:function(e,t){e=e==null?``:String(e),t=String(t);var n=e+`|`+t;return this._attrsByLName[n]!==void 0}},hasAttributes:{value:function(){return this._numattrs>0}},toggleAttribute:{value:function(e,t){return e=String(e),n.isValidName(e)||r.InvalidCharacterError(),/[A-Z]/.test(e)&&this.isHTML&&(e=r.toASCIILowerCase(e)),this._attrsByQName[e]===void 0?t===void 0||t===!0?(this._setAttribute(e,``),!0):!1:t===void 0||t===!1?(this.removeAttribute(e),!1):!0}},_setAttribute:{value:function(e,t){var n=this._attrsByQName[e],r;n?Array.isArray(n)&&(n=n[0]):(n=this._newattr(e),r=!0),n.value=t,this._attributes&&(this._attributes[e]=n),r&&this._newattrhook&&this._newattrhook(e,t)}},setAttribute:{value:fu