smartdown
Version:
A library for translating, rendering and interacting with Smartdown documents. Smartdown is an extension of Markdown that provides richer media support and reactive programming capability.
2 lines • 93 kB
JavaScript
/*! For license information please see webcomponents-sd-ce.js.LICENSE.txt */
(function(){"use strict";var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}function n(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function r(e){if(!(e instanceof Array)){e=n(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}var o=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function i(){}function a(e){return e.__shady||(e.__shady=new i),e.__shady}function s(e){return e&&e.__shady}i.prototype.toJSON=function(){return{}};var l=window.ShadyDOM||{};l.Ka=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var u,d=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");l.j=!!(d&&d.configurable&&d.get),l.ka=l.force||!l.Ka,l.s=l.noPatch||!1,l.R=l.preferPerformance,l.ma="on-demand"===l.s;var h=l.querySelectorImplementation;function c(){return Document.prototype.msElementsFromPoint?"msElementsFromPoint":"elementsFromPoint"}function f(e){return(e=s(e))&&void 0!==e.firstChild}function _(e){return e instanceof ShadowRoot}function p(e){return(e=(e=s(e))&&e.root)&&dn(e)}u=-1<["native","selectorEngine"].indexOf(h)?h:void 0,l.$a=u,l.za=navigator.userAgent.match("Trident");var m=Element.prototype,v=m.matches||m.matchesSelector||m.mozMatchesSelector||m.msMatchesSelector||m.oMatchesSelector||m.webkitMatchesSelector,y=document.createTextNode(""),g=0,b=[];function E(e){b.push(e),y.textContent=g++}new MutationObserver((function(){for(;b.length;)try{b.shift()()}catch(e){throw y.textContent=g++,e}})).observe(y,{characterData:!0});var N=document.contains?function(e,t){return e.__shady_native_contains(t)}:function(e,t){return e===t||e.documentElement&&e.documentElement.__shady_native_contains(t)};function w(e,t){for(;t;){if(t==e)return!0;t=t.__shady_parentNode}return!1}function C(e){for(var t=e.length-1;0<=t;t--){var r=e[t],o=r.getAttribute("id")||r.getAttribute("name");o&&"length"!==o&&isNaN(o)&&(e[o]=r)}return e.item=function(t){return e[t]},e.namedItem=function(t){if("length"!==t&&isNaN(t)&&e[t])return e[t];for(var r=n(e),o=r.next();!o.done;o=r.next())if(((o=o.value).getAttribute("id")||o.getAttribute("name"))==t)return o;return null},e}function S(e){var t=[];for(e=e.__shady_native_firstChild;e;e=e.__shady_native_nextSibling)t.push(e);return t}function T(e){var t=[];for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling)t.push(e);return t}function O(e,t,n){if(n.configurable=!0,n.value)e[t]=n.value;else try{Object.defineProperty(e,t,n)}catch(e){}}function x(e,t,n,r){for(var o in n=void 0===n?"":n,t)r&&0<=r.indexOf(o)||O(e,n+o,t[o])}function D(e,t){for(var n in t)n in e&&O(e,n,t[n])}function M(e){var t={};return Object.getOwnPropertyNames(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t}function P(e,t){for(var n,r=Object.getOwnPropertyNames(t),o=0;o<r.length;o++)e[n=r[o]]=t[n]}function A(e){return e instanceof Node?e:document.createTextNode(""+e)}function L(e){for(var t=[],r=0;r<arguments.length;++r)t[r]=arguments[r];if(1===t.length)return A(t[0]);r=document.createDocumentFragment();for(var o=(t=n(t)).next();!o.done;o=t.next())r.appendChild(A(o.value));return r}function j(e){var t;for(t=void 0===t?1:t;0<t;t--)e=e.reduce((function(e,t){return Array.isArray(t)?e.push.apply(e,r(t)):e.push(t),e}),[]);return e}var R,k=[];function F(e){R||(R=!0,E(H)),k.push(e)}function H(){R=!1;for(var e=!!k.length;k.length;)k.shift()();return e}function I(){this.g=!1,this.addedNodes=[],this.removedNodes=[],this.aa=new Set}H.list=k,I.prototype.flush=function(){if(this.g){this.g=!1;var e=this.takeRecords();e.length&&this.aa.forEach((function(t){t(e)}))}},I.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var e=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];return this.addedNodes=[],this.removedNodes=[],e}return[]};var B=/[&\u00A0"]/g,U=/[&\u00A0<>]/g;function q(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case" ":return" "}}function W(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return t}var V=W("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),G=W("style script xmp iframe noembed noframes plaintext noscript".split(" "));function X(e,t){"template"===e.localName&&(e=e.content);for(var n="",r=t?t(e):e.childNodes,o=0,i=r.length,a=void 0;o<i&&(a=r[o]);o++){e:{var s=a,l=e,u=t;switch(s.nodeType){case Node.ELEMENT_NODE:for(var d,h="<"+(l=s.localName),c=s.attributes,f=0;d=c[f];f++)h+=" "+d.name+'="'+d.value.replace(B,q)+'"';h+=">",s=V[l]?h:h+X(s,u)+"</"+l+">";break e;case Node.TEXT_NODE:s=s.data,s=l&&G[l.localName]?s:s.replace(U,q);break e;case Node.COMMENT_NODE:s="\x3c!--"+s.data+"--\x3e";break e;default:throw window.console.error(s),Error("not implemented")}}n+=s}return n}var z=l.j,J={querySelector:function(e){return this.__shady_native_querySelector(e)},querySelectorAll:function(e){return this.__shady_native_querySelectorAll(e)}},K={};function $(e){K[e]=function(t){return t["__shady_native_"+e]}}function Y(e,t){for(var n in x(e,t,"__shady_native_"),t)$(n)}function Z(e,t){t=void 0===t?[]:t;for(var n=0;n<t.length;n++){var r=t[n],o=Object.getOwnPropertyDescriptor(e,r);o&&(Object.defineProperty(e,"__shady_native_"+r,o),o.value?J[r]||(J[r]=o.value):$(r))}}var Q=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),ee=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),te=document.implementation.createHTMLDocument("inert");function ne(e){for(var t;t=e.__shady_native_firstChild;)e.__shady_native_removeChild(t)}var re=["firstElementChild","lastElementChild","children","childElementCount"],oe=["querySelector","querySelectorAll","append","prepend","replaceChildren"],ie=M({get childNodes(){return this.__shady_childNodes},get firstChild(){return this.__shady_firstChild},get lastChild(){return this.__shady_lastChild},get childElementCount(){return this.__shady_childElementCount},get children(){return this.__shady_children},get firstElementChild(){return this.__shady_firstElementChild},get lastElementChild(){return this.__shady_lastElementChild},get shadowRoot(){return this.__shady_shadowRoot}}),ae=M({get textContent(){return this.__shady_textContent},set textContent(e){this.__shady_textContent=e},get innerHTML(){return this.__shady_innerHTML},set innerHTML(e){this.__shady_innerHTML=e}}),se=M({get parentElement(){return this.__shady_parentElement},get parentNode(){return this.__shady_parentNode},get nextSibling(){return this.__shady_nextSibling},get previousSibling(){return this.__shady_previousSibling},get nextElementSibling(){return this.__shady_nextElementSibling},get previousElementSibling(){return this.__shady_previousElementSibling},get className(){return this.__shady_className},set className(e){this.__shady_className=e}});function le(e){for(var t in e){var n=e[t];n&&(n.enumerable=!1)}}le(ie),le(ae),le(se);var ue,de=l.j||!0===l.s,he=de?function(){}:function(e){var t=a(e);t.Ba||(t.Ba=!0,D(e,se))},ce=de?function(){}:function(e){var t=a(e);t.Aa||(t.Aa=!0,D(e,ie),window.customElements&&window.customElements.polyfillWrapFlushCallback&&!l.s||D(e,ae))},fe="__eventWrappers"+Date.now(),_e=(ue=Object.getOwnPropertyDescriptor(Event.prototype,"composed"))?function(e){return ue.get.call(e)}:null,pe=function(){function e(){}var t=!1,n={get capture(){return t=!0,!1}};return window.addEventListener("test",e,n),window.removeEventListener("test",e,n),t}();function me(e){if(null===e||"object"!=typeof e&&"function"!=typeof e)var t=!!e,n=!1;else{t=!!e.capture,n=!!e.once;var r=e.G}return{xa:r,capture:t,once:n,wa:pe?e:t}}var ve={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},ye={DOMAttrModified:!0,DOMAttributeNameChanged:!0,DOMCharacterDataModified:!0,DOMElementNameChanged:!0,DOMNodeInserted:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemoved:!0,DOMNodeRemovedFromDocument:!0,DOMSubtreeModified:!0};function ge(e){return e instanceof Node?e.__shady_getRootNode():e}function be(e,t){var n=[],r=e;for(e=ge(e);r;)n.push(r),r=r.__shady_assignedSlot?r.__shady_assignedSlot:r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host&&(t||r!==e)?r.host:r.__shady_parentNode;return n[n.length-1]===document&&n.push(window),n}function Ee(e,t){if(!_)return e;e=be(e,!0);for(var n,r,o=0,i=void 0,a=void 0;o<t.length;o++)if((r=ge(n=t[o]))!==i&&(a=e.indexOf(r),i=r),!_(r)||-1<a)return n}var Ne={get composed(){return void 0===this.__composed&&(_e?this.__composed="focusin"===this.type||"focusout"===this.type||_e(this):!1!==this.isTrusted&&(this.__composed=ve[this.type])),this.__composed||!1},composedPath:function(){return this.__composedPath||(this.__composedPath=be(this.__target,this.composed)),this.__composedPath},get target(){return Ee(this.currentTarget||this.__previousCurrentTarget,this.composedPath())},get relatedTarget(){return this.__relatedTarget?(this.__relatedTargetComposedPath||(this.__relatedTargetComposedPath=be(this.__relatedTarget,!0)),Ee(this.currentTarget||this.__previousCurrentTarget,this.__relatedTargetComposedPath)):null},stopPropagation:function(){Event.prototype.stopPropagation.call(this),this.fa=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this),this.fa=this.__immediatePropagationStopped=!0}},we=l.j&&Object.getOwnPropertyDescriptor(Event.prototype,"eventPhase");function Ce(e){function t(t,n){return(t=new e(t,n)).__composed=n&&!!n.composed,t}return t.__proto__=e,t.prototype=e.prototype,t}we&&(Object.defineProperty(Ne,"eventPhase",{get:function(){return this.currentTarget===this.target?Event.AT_TARGET:this.__shady_native_eventPhase},enumerable:!0,configurable:!0}),Object.defineProperty(Ne,"__shady_native_eventPhase",we));var Se={focus:!0,blur:!0};function Te(e){return e.__target!==e.target||e.__relatedTarget!==e.relatedTarget}function Oe(e,t,n){if(n=t.__handlers&&t.__handlers[e.type]&&t.__handlers[e.type][n])for(var r,o=0;(r=n[o])&&(!Te(e)||e.target!==e.relatedTarget)&&(r.call(t,e),!e.__immediatePropagationStopped);o++);}var xe=new Event("e").hasOwnProperty("currentTarget");function De(e){var t=(e=xe?Object.create(e):e).composedPath(),n=t.map((function(e){return Ee(e,t)})),r=e.bubbles,o=Object.getOwnPropertyDescriptor(e,"currentTarget");Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:function(){return l}});var i=Event.CAPTURING_PHASE,a=Object.getOwnPropertyDescriptor(e,"eventPhase");Object.defineProperty(e,"eventPhase",{configurable:!0,enumerable:!0,get:function(){return i}});try{for(var s=t.length-1;0<=s;s--){var l=t[s];if(i=l===n[s]?Event.AT_TARGET:Event.CAPTURING_PHASE,Oe(e,l,"capture"),e.fa)return}for(s=0;s<t.length;s++){var u=(l=t[s])===n[s];if((u||r)&&(i=u?Event.AT_TARGET:Event.BUBBLING_PHASE,Oe(e,l,"bubble"),e.fa))break}}finally{xe||(o?Object.defineProperty(e,"currentTarget",o):delete e.currentTarget,a?Object.defineProperty(e,"eventPhase",a):delete e.eventPhase)}}function Me(e,t,n,r){for(var o=0;o<e.length;o++){var i=e[o],a=i.type,s=i.capture;if(t===i.node&&n===a&&r===s)return o}return-1}function Pe(e){return H(),!l.R&&this instanceof Node&&!N(document,this)?(e.__target||Re(e,this),De(e)):this.__shady_native_dispatchEvent(e)}function Ae(e,t,n){var r=this,o=me(n),i=o.capture,a=o.once,s=o.xa;if(o=o.wa,t){var l=typeof t;if(("function"===l||"object"===l)&&("object"!==l||t.handleEvent&&"function"==typeof t.handleEvent)){if(ye[e])return this.__shady_native_addEventListener(e,t,o);var u=s||this;if(s=t[fe]){if(-1<Me(s,u,e,i))return}else t[fe]=[];s=function(o){if(a&&r.__shady_removeEventListener(e,t,n),o.__target||Re(o),u!==r){var s=Object.getOwnPropertyDescriptor(o,"currentTarget");Object.defineProperty(o,"currentTarget",{get:function(){return u},configurable:!0});var d=Object.getOwnPropertyDescriptor(o,"eventPhase");Object.defineProperty(o,"eventPhase",{configurable:!0,enumerable:!0,get:function(){return i?Event.CAPTURING_PHASE:Event.BUBBLING_PHASE}})}if(o.__previousCurrentTarget=o.currentTarget,(!_(u)&&"slot"!==u.localName||-1!=o.composedPath().indexOf(u))&&(o.composed||-1<o.composedPath().indexOf(u)))if(Te(o)&&o.target===o.relatedTarget)o.eventPhase===Event.BUBBLING_PHASE&&o.stopImmediatePropagation();else if(o.eventPhase===Event.CAPTURING_PHASE||o.bubbles||o.target===u||u instanceof Window){var h="function"===l?t.call(u,o):t.handleEvent&&t.handleEvent(o);return u!==r&&(s?(Object.defineProperty(o,"currentTarget",s),s=null):delete o.currentTarget,d?(Object.defineProperty(o,"eventPhase",d),d=null):delete o.eventPhase),h}},t[fe].push({node:u,type:e,capture:i,Ya:s}),this.__handlers=this.__handlers||{},this.__handlers[e]=this.__handlers[e]||{capture:[],bubble:[]},this.__handlers[e][i?"capture":"bubble"].push(s),Se[e]||this.__shady_native_addEventListener(e,s,o)}}}function Le(e,t,n){if(t){var r=me(n);n=r.capture;var o=r.xa;if(r=r.wa,ye[e])return this.__shady_native_removeEventListener(e,t,r);var i=o||this;o=void 0;var a=null;try{a=t[fe]}catch(e){}a&&-1<(i=Me(a,i,e,n))&&(o=a.splice(i,1)[0].Ya,a.length||(t[fe]=void 0)),this.__shady_native_removeEventListener(e,o||t,r),o&&this.__handlers&&this.__handlers[e]&&-1<(t=(e=this.__handlers[e][n?"capture":"bubble"]).indexOf(o))&&e.splice(t,1)}}var je=M(Ne);function Re(e,t){if(t=void 0===t?e.target:t,e.__target=t,e.__relatedTarget=e.relatedTarget,l.j){if(!(t=Object.getPrototypeOf(e)).hasOwnProperty("__shady_patchedProto")){var n=Object.create(t);n.__shady_sourceProto=t,x(n,je),t.__shady_patchedProto=n}e.__proto__=t.__shady_patchedProto}else x(e,je)}var ke=Ce(Event),Fe=Ce(CustomEvent),He=Ce(MouseEvent),Ie=Object.getOwnPropertyNames(Element.prototype).filter((function(e){return"on"===e.substring(0,2)})),Be=Object.getOwnPropertyNames(HTMLElement.prototype).filter((function(e){return"on"===e.substring(0,2)}));function Ue(e){return{set:function(t){var n=a(this),r=e.substring(2);n.F||(n.F={}),n.F[e]&&this.removeEventListener(r,n.F[e]),this.__shady_addEventListener(r,t),n.F[e]=t},get:function(){var t=s(this);return t&&t.F&&t.F[e]},configurable:!0}}function qe(e,t){return{index:e,S:[],Z:t}}function We(e,t,n,r){var o=0,i=0,a=0,s=0,l=Math.min(t-o,r-i);if(0==o&&0==i)e:{for(a=0;a<l;a++)if(e[a]!==n[a])break e;a=l}if(t==e.length&&r==n.length){s=e.length;for(var u=n.length,d=0;d<l-a&&Ve(e[--s],n[--u]);)d++;s=d}if(i+=a,r-=s,0==(t-=s)-(o+=a)&&0==r-i)return[];if(o==t){for(t=qe(o,0);i<r;)t.S.push(n[i++]);return[t]}if(i==r)return[qe(o,t-o)];for(r=r-(a=i)+1,s=t-(l=o)+1,t=Array(r),u=0;u<r;u++)t[u]=Array(s),t[u][0]=u;for(u=0;u<s;u++)t[0][u]=u;for(u=1;u<r;u++)for(d=1;d<s;d++)if(e[l+d-1]===n[a+u-1])t[u][d]=t[u-1][d-1];else{var h=t[u-1][d]+1,c=t[u][d-1]+1;t[u][d]=h<c?h:c}for(l=t.length-1,a=t[0].length-1,r=t[l][a],e=[];0<l||0<a;)0==l?(e.push(2),a--):0==a?(e.push(3),l--):(s=t[l-1][a-1],(h=(u=t[l-1][a])<(d=t[l][a-1])?u<s?u:s:d<s?d:s)==s?(s==r?e.push(0):(e.push(1),r=s),l--,a--):h==u?(e.push(3),l--,r=u):(e.push(2),a--,r=d));for(e.reverse(),t=void 0,l=[],a=0;a<e.length;a++)switch(e[a]){case 0:t&&(l.push(t),t=void 0),o++,i++;break;case 1:t||(t=qe(o,0)),t.Z++,o++,t.S.push(n[i]),i++;break;case 2:t||(t=qe(o,0)),t.Z++,o++;break;case 3:t||(t=qe(o,0)),t.S.push(n[i]),i++}return t&&l.push(t),l}function Ve(e,t){return e===t}var Ge=M({dispatchEvent:Pe,addEventListener:Ae,removeEventListener:Le}),Xe=null;function ze(){return Xe||(Xe=window.ShadyCSS&&window.ShadyCSS.ScopingShim),Xe||null}function Je(e,t,n){var r=ze();return!(!r||"class"!==t||(r.setElementClass(e,n),0))}function Ke(e,t){var n=ze();n&&n.unscopeNode(e,t)}function $e(e,t){var n=ze();if(!n)return!0;if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(n=!0,e=e.__shady_firstChild;e;e=e.__shady_nextSibling)n=n&&$e(e,t);return n}return e.nodeType!==Node.ELEMENT_NODE||n.currentScopeForNode(e)===t}function Ye(e){if(e.nodeType!==Node.ELEMENT_NODE)return"";var t=ze();return t?t.currentScopeForNode(e):""}function Ze(e,t){if(e)for(e.nodeType===Node.ELEMENT_NODE&&t(e),e=e.__shady_firstChild;e;e=e.__shady_nextSibling)e.nodeType===Node.ELEMENT_NODE&&Ze(e,t)}var Qe=window.document,et=l.R,tt=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),nt=tt&&tt.get;function rt(e){for(var t;t=e.__shady_firstChild;)e.__shady_removeChild(t)}function ot(e){var t=s(e);if(t&&void 0!==t.ea)for(t=e.__shady_firstChild;t;t=t.__shady_nextSibling)ot(t);(e=s(e))&&(e.ea=void 0)}function it(e){var t=e;if(e&&"slot"===e.localName){var n=s(e);(n=n&&n.L)&&(t=n.length?n[0]:it(e.__shady_nextSibling))}return t}function at(e,t,n){if(e=(e=s(e))&&e.P){if(t)if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var r=0,o=t.childNodes.length;r<o;r++)e.addedNodes.push(t.childNodes[r]);else e.addedNodes.push(t);n&&e.removedNodes.push(n),function(e){e.g||(e.g=!0,E((function(){e.flush()})))}(e)}}var st=M({get parentNode(){var e=s(this);return void 0!==(e=e&&e.parentNode)?e:this.__shady_native_parentNode},get firstChild(){var e=s(this);return void 0!==(e=e&&e.firstChild)?e:this.__shady_native_firstChild},get lastChild(){var e=s(this);return void 0!==(e=e&&e.lastChild)?e:this.__shady_native_lastChild},get nextSibling(){var e=s(this);return void 0!==(e=e&&e.nextSibling)?e:this.__shady_native_nextSibling},get previousSibling(){var e=s(this);return void 0!==(e=e&&e.previousSibling)?e:this.__shady_native_previousSibling},get childNodes(){if(f(this)){var e=s(this);if(!e.childNodes){e.childNodes=[];for(var t=this.__shady_firstChild;t;t=t.__shady_nextSibling)e.childNodes.push(t)}var n=e.childNodes}else n=this.__shady_native_childNodes;return n.item=function(e){return n[e]},n},get parentElement(){var e=s(this);return(e=e&&e.parentNode)&&e.nodeType!==Node.ELEMENT_NODE&&(e=null),void 0!==e?e:this.__shady_native_parentElement},get isConnected(){if(nt&&nt.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1;var e=this.ownerDocument;if(null===e||N(e,this))return!0;for(e=this;e&&!(e instanceof Document);)e=e.__shady_parentNode||(_(e)?e.host:void 0);return!!(e&&e instanceof Document)},get textContent(){if(f(this)){for(var e=[],t=this.__shady_firstChild;t;t=t.__shady_nextSibling)t.nodeType!==Node.COMMENT_NODE&&e.push(t.__shady_textContent);return e.join("")}return this.__shady_native_textContent},set textContent(e){switch(null==e&&(e=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!f(this)&&l.j){var t=this.__shady_firstChild;(t!=this.__shady_lastChild||t&&t.nodeType!=Node.TEXT_NODE)&&rt(this),this.__shady_native_textContent=e}else rt(this),(0<e.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_insertBefore(document.createTextNode(e));break;default:this.nodeValue=e}},insertBefore:function(e,t){if(this.ownerDocument!==Qe&&e.ownerDocument!==Qe)return this.__shady_native_insertBefore(e,t),e;if(e===this)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(t){var n=s(t);if(void 0!==(n=n&&n.parentNode)&&n!==this||void 0===n&&t.__shady_native_parentNode!==this)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.")}if(t===e)return e;at(this,e);var o=[],i=(n=_n(this))?n.host.localName:Ye(this),l=e.__shady_parentNode;if(l){var u=Ye(e),d=!!n||!_n(e)||et&&void 0!==this.__noInsertionPoint;l.__shady_removeChild(e,d)}l=!0;var h=(!et||void 0===e.__noInsertionPoint&&void 0===this.__noInsertionPoint)&&!$e(e,i),c=n&&!e.__noInsertionPoint&&(!et||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE);return(c||h)&&(h&&(u=u||Ye(e)),Ze(e,(function(e){if(c&&"slot"===e.localName&&o.push(e),h){var t=u;ze()&&(t&&Ke(e,t),(t=ze())&&t.scopeNode(e,i))}}))),o.length&&(an(n),n.i.push.apply(n.i,r(o)),en(n)),f(this)&&(function(e,t,n){Wt(t,2);var r=a(t);if(void 0!==r.firstChild&&(r.childNodes=null),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(e=e.__shady_native_firstChild;e;e=e.__shady_native_nextSibling)Vt(e,t,r,n);else Vt(e,t,r,n)}(e,this,t),(d=s(this)).root?(l=!1,p(this)&&en(d.root)):n&&"slot"===this.localName&&(l=!1,en(n))),l?(n=_(this)?this.host:this,t?(t=it(t),n.__shady_native_insertBefore(e,t)):n.__shady_native_appendChild(e)):e.ownerDocument!==this.ownerDocument&&this.ownerDocument.adoptNode(e),e},appendChild:function(e){if(this!=e||!_(e))return this.__shady_insertBefore(e)},removeChild:function(e,t){if(t=void 0!==t&&t,this.ownerDocument!==Qe)return this.__shady_native_removeChild(e);if(e.__shady_parentNode!==this)throw Error("The node to be removed is not a child of this node: "+e);at(this,null,e);var n=_n(e),r=n&&function(e,t){if(e.g){sn(e);var n,r=e.h;for(n in r)for(var o=r[n],i=0;i<o.length;i++){var a=o[i];if(w(t,a)){o.splice(i,1);var l=e.g.indexOf(a);if(0<=l&&(e.g.splice(l,1),(l=s(a.__shady_parentNode))&&l.U&&l.U--),i--,l=(a=s(a)).L)for(var u=0;u<l.length;u++){var d=l[u],h=d.__shady_native_parentNode;h&&h.__shady_native_removeChild(d)}a.L=[],a.assignedNodes=[],l=!0}}return l}}(n,e),o=s(this);if(f(this)&&(function(e,t){var n=a(e);e===(t=a(t)).firstChild&&(t.firstChild=n.nextSibling),e===t.lastChild&&(t.lastChild=n.previousSibling),e=n.previousSibling;var r=n.nextSibling;e&&(a(e).nextSibling=r),r&&(a(r).previousSibling=e),n.parentNode=n.previousSibling=n.nextSibling=void 0,void 0!==t.childNodes&&(t.childNodes=null)}(e,this),p(this))){en(o.root);var i=!0}if(ze()&&!t&&n&&e.nodeType!==Node.TEXT_NODE){var l=Ye(e);Ze(e,(function(e){Ke(e,l)}))}return ot(e),n&&((t="slot"===this.localName)&&(i=!0),(r||t)&&en(n)),i||(i=_(this)?this.host:this,(!o.root&&"slot"!==e.localName||i===e.__shady_native_parentNode)&&i.__shady_native_removeChild(e)),e},replaceChild:function(e,t){return this.__shady_insertBefore(e,t),this.__shady_removeChild(t),e},cloneNode:function(e){if("template"==this.localName)return this.__shady_native_cloneNode(e);var t=this.__shady_native_cloneNode(!1);if(e&&t.nodeType!==Node.ATTRIBUTE_NODE){e=this.__shady_firstChild;for(var n;e;e=e.__shady_nextSibling)n=e.__shady_cloneNode(!0),t.__shady_appendChild(n)}return t},getRootNode:function(e){if(this&&this.nodeType){var t=a(this),n=t.ea;return void 0===n&&(_(this)?(n=this,t.ea=n):(n=(n=this.__shady_parentNode)?n.__shady_getRootNode(e):this,document.documentElement.__shady_native_contains(this)&&(t.ea=n))),n}},contains:function(e){return w(this,e)}}),lt=M({get assignedSlot(){var e=this.__shady_parentNode;return(e=e&&e.__shady_shadowRoot)&&tn(e),(e=s(this))&&e.assignedSlot||null}}),ut=new Map;function dt(e,t,n,r){for(r=void 0===r||r;t<e.length;t++)if("\\"===e[t]&&t<e.length-1&&"\n"!==e[t+1])t++;else{if(-1!==n.indexOf(e[t]))return t;if(r&&ut.has(e[t])){var o=ut.get(e[t]);t=dt(e,t+1,[o.end],o.da)}}return e.length}function ht(e,t,n){var r=[];return ct(e,t,n,r),r}function ct(e,t,n,r){for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling){var o;if(o=e.nodeType===Node.ELEMENT_NODE){var i=t,a=n,s=r,l=i(o=e);l&&s.push(o),a&&a(l)?o=l:(ct(o,i,a,s),o=void 0)}if(o)break}}[["(",{end:")",da:!0}],["[",{end:"]",da:!0}],['"',{end:'"',da:!1}],["'",{end:"'",da:!1}]].forEach((function(e){var t=n(e);e=t.next().value,t=t.next().value,ut.set(e,t)}));var ft={get firstElementChild(){var e=s(this);if(e&&void 0!==e.firstChild){for(e=this.__shady_firstChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_nextSibling;return e}return this.__shady_native_firstElementChild},get lastElementChild(){var e=s(this);if(e&&void 0!==e.lastChild){for(e=this.__shady_lastChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_previousSibling;return e}return this.__shady_native_lastElementChild},get children(){return f(this)?C(Array.prototype.filter.call(T(this),(function(e){return e.nodeType===Node.ELEMENT_NODE}))):this.__shady_native_children},get childElementCount(){var e=this.__shady_children;return e?e.length:0}},_t=M((ft.append=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];this.__shady_insertBefore(L.apply(null,r(t)),null)},ft.prepend=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];this.__shady_insertBefore(L.apply(null,r(t)),this.__shady_firstChild)},ft.replaceChildren=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];for(;null!==(n=this.__shady_firstChild);)this.__shady_removeChild(n);this.__shady_insertBefore(L.apply(null,r(t)),null)},ft));function pt(e,t){function r(t,n){return(t===e||-1===n.indexOf(":scope"))&&v.call(t,n)}var o=function(e){function t(){if(0<r.length){for(;" "===r[r.length-1];)r.pop();n.push({ta:r.filter((function(e,t){return 0==t%2})),Ha:r.filter((function(e,t){return 1==t%2}))}),r.length=0}}for(var n=[],r=[],o=0;o<e.length;){var i=r[r.length-1],a=dt(e,o,[","," ",">","+","~"]),s=a===o?e[o]:e.substring(o,a);","===s?t():-1!==[void 0," ",">","+","~"].indexOf(i)&&" "===s||(" "===i&&-1!==[">","+","~"].indexOf(s)?r[r.length-1]=s:r.push(s)),o=a+(a===o?1:0)}return t(),n}(t);if(1>o.length)return[];for(t=j(ht(e,(function(){return!0})).map((function(e){return j(o.map((function(t){var n=t.ta,o=n.length-1;return r(e,n[o])?{target:e,N:t,O:e,index:o}:[]})))})));t.some((function(e){return 0<e.index}));)t=j(t.map((function(e){if(0>=e.index)return e;var t=e.target,n=e.O,o=e.N;e=e.index-1;var i=o.Ha[e],a=o.ta[e];if(" "===i){for(i=[],n=n.__shady_parentElement;n;n=n.__shady_parentElement)r(n,a)&&i.push({target:t,N:o,O:n,index:e});return i}if(">"===i)return r(n=n.__shady_parentElement,a)?{target:t,N:o,O:n,index:e}:[];if("+"===i)return(n=n.__shady_previousElementSibling)&&r(n,a)?{target:t,N:o,O:n,index:e}:[];if("~"===i){for(i=[],n=n.__shady_previousElementSibling;n;n=n.__shady_previousElementSibling)r(n,a)&&i.push({target:t,N:o,O:n,index:e});return i}throw Error("Unrecognized combinator: '"+i+"'.")})));return function(e){for(var t=[],r=new Set,o=(e=n(e)).next();!o.done;o=e.next())o=o.value,r.has(o)||(t.push(o),r.add(o));return t}(t.map((function(e){return e.target})))}var mt=l.querySelectorImplementation,vt=M({querySelector:function(e){if("native"===mt){for(var t=Array.prototype.slice.call((this instanceof ShadowRoot?this.host:this).__shady_native_querySelectorAll(e)),r=this.__shady_getRootNode(),o=(t=n(t)).next();!o.done;o=t.next())if((o=o.value).__shady_getRootNode()==r)return o;return null}if("selectorEngine"===mt)return pt(this,e)[0]||null;if(void 0===mt)return ht(this,(function(t){return v.call(t,e)}),(function(e){return!!e}))[0]||null;throw Error("Unrecognized value of ShadyDOM.querySelectorImplementation: '"+mt+"'")},querySelectorAll:function(e,t){if(t||"native"===mt){t=Array.prototype.slice.call((this instanceof ShadowRoot?this.host:this).__shady_native_querySelectorAll(e));var n=this.__shady_getRootNode();return C(t.filter((function(e){return e.__shady_getRootNode()==n})))}if("selectorEngine"===mt)return C(pt(this,e));if(void 0===mt)return C(ht(this,(function(t){return v.call(t,e)})));throw Error("Unrecognized value of ShadyDOM.querySelectorImplementation: '"+mt+"'")}}),yt=l.R&&!l.s?P({},_t):_t;P(_t,vt);var gt=M({after:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=this.__shady_parentNode)){var o=this.__shady_nextSibling;n.__shady_insertBefore(L.apply(null,r(t)),o)}},before:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];null!==(n=this.__shady_parentNode)&&n.__shady_insertBefore(L.apply(null,r(t)),this)},remove:function(){var e=this.__shady_parentNode;null!==e&&e.__shady_removeChild(this)},replaceWith:function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];if(null!==(n=this.__shady_parentNode)){var o=this.__shady_nextSibling;n.__shady_removeChild(this),n.__shady_insertBefore(L.apply(null,r(t)),o)}}}),bt=window.document;function Et(e,t){if("slot"===t)p(e=e.__shady_parentNode)&&en(s(e).root);else if("slot"===e.localName&&"name"===t&&(t=_n(e))){if(t.g){sn(t);var n=e.Ca,r=ln(e);if(r!==n){var o=(n=t.h[n]).indexOf(e);0<=o&&n.splice(o,1),(n=t.h[r]||(t.h[r]=[])).push(e),1<n.length&&(t.h[r]=un(n))}}en(t)}}var Nt=M({get previousElementSibling(){var e=s(this);if(e&&void 0!==e.previousSibling){for(e=this.__shady_previousSibling;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_previousSibling;return e}return this.__shady_native_previousElementSibling},get nextElementSibling(){var e=s(this);if(e&&void 0!==e.nextSibling){for(e=this.__shady_nextSibling;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.__shady_nextSibling;return e}return this.__shady_native_nextElementSibling},get slot(){return this.getAttribute("slot")},set slot(e){this.__shady_setAttribute("slot",e)},get className(){return this.getAttribute("class")||""},set className(e){this.__shady_setAttribute("class",e)},setAttribute:function(e,t){this.ownerDocument!==bt?this.__shady_native_setAttribute(e,t):Je(this,e,t)||(this.__shady_native_setAttribute(e,t),Et(this,e))},removeAttribute:function(e){this.ownerDocument!==bt?this.__shady_native_removeAttribute(e):Je(this,e,"")?""===this.getAttribute(e)&&this.__shady_native_removeAttribute(e):(this.__shady_native_removeAttribute(e),Et(this,e))},toggleAttribute:function(e,t){return this.ownerDocument!==bt?this.__shady_native_toggleAttribute(e,t):Je(this,e,"")?""!==this.getAttribute(e)||t?void 0:this.__shady_native_toggleAttribute(e,t):(t=this.__shady_native_toggleAttribute(e,t),Et(this,e),t)}});l.R||Ie.forEach((function(e){Nt[e]=Ue(e)}));var wt=M({attachShadow:function(e){if(!this)throw Error("Must provide a host.");if(!e)throw Error("Not enough arguments.");if(e.shadyUpgradeFragment&&!l.za){var t=e.shadyUpgradeFragment;if(t.__proto__=ShadowRoot.prototype,Qt(t,this,e),Gt(t,t),e=t.__noInsertionPoint?null:t.querySelectorAll("slot"),t.__noInsertionPoint=void 0,e&&e.length){var n=t;an(n),n.i.push.apply(n.i,r(e)),en(t)}t.host.__shady_native_appendChild(t)}else t=new Zt(Kt,this,e);return this.__CE_shadowRoot=t},get shadowRoot(){var e=s(this);return e&&e.Pa||null}});P(Nt,wt);var Ct=document.implementation.createHTMLDocument("inert"),St=M({get innerHTML(){return f(this)?X("template"===this.localName?this.content:this,T):this.__shady_native_innerHTML},set innerHTML(e){if("template"===this.localName)this.__shady_native_innerHTML=e;else{rt(this);var t=this.localName||"div";for(t=this.namespaceURI&&this.namespaceURI!==Ct.namespaceURI?Ct.createElementNS(this.namespaceURI,t):Ct.createElement(t),l.j?t.__shady_native_innerHTML=e:t.innerHTML=e;e=t.__shady_firstChild;)this.__shady_insertBefore(e)}}}),Tt=M({blur:function(){var e=s(this);(e=(e=e&&e.root)&&e.activeElement)?e.__shady_blur():this.__shady_native_blur()}});l.R||Be.forEach((function(e){Tt[e]=Ue(e)}));var Ot=M({assignedNodes:function(e){if("slot"===this.localName){var t=this.__shady_getRootNode();return t&&_(t)&&tn(t),(t=s(this))&&(e&&e.flatten?t.L:t.assignedNodes)||[]}},addEventListener:function(e,t,n){if("slot"!==this.localName||"slotchange"===e)Ae.call(this,e,t,n);else{"object"!=typeof n&&(n={capture:!!n});var r=this.__shady_parentNode;if(!r)throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");n.G=this,r.__shady_addEventListener(e,t,n)}},removeEventListener:function(e,t,n){if("slot"!==this.localName||"slotchange"===e)Le.call(this,e,t,n);else{"object"!=typeof n&&(n={capture:!!n});var r=this.__shady_parentNode;if(!r)throw Error("ShadyDOM cannot attach event to slot unless it has a `parentNode`");n.G=this,r.__shady_removeEventListener(e,t,n)}}}),xt=M({getElementById:function(e){return""===e?null:ht(this,(function(t){return t.id==e}),(function(e){return!!e}))[0]||null}});function Dt(e,t){for(var n;t&&!e.has(n=t.__shady_getRootNode());)t=n.host;return t}var Mt="__shady_native_"+c(),Pt=M({get activeElement(){var e=l.j?document.__shady_native_activeElement:document.activeElement;if(!e||!e.nodeType)return null;var t=!!_(this);if(!(this===document||t&&this.host!==e&&this.host.__shady_native_contains(e)))return null;for(t=_n(e);t&&t!==this;)t=_n(e=t.host);return this===document?t?null:e:t===this?e:null},elementsFromPoint:function(e,t){if(e=document[Mt](e,t),this===document&&l.useNativeDocumentEFP)return e;e=[].slice.call(e),t=function(e){var t=new Set;for(t.add(e);_(e)&&e.host;)e=e.host.__shady_getRootNode(),t.add(e);return t}(this);for(var n=new Set,r=0;r<e.length;r++)n.add(Dt(t,e[r]));var o=[];return n.forEach((function(e){return o.push(e)})),o},elementFromPoint:function(e,t){return this===document&&l.useNativeDocumentEFP?this.__shady_native_elementFromPoint(e,t):this.__shady_elementsFromPoint(e,t)[0]||null}}),At=window.document,Lt=M({importNode:function(e,t){if(e.ownerDocument!==At||"template"===e.localName)return this.__shady_native_importNode(e,t);var n=this.__shady_native_importNode(e,!1);if(t)for(e=e.__shady_firstChild;e;e=e.__shady_nextSibling)t=this.__shady_importNode(e,!0),n.__shady_appendChild(t);return n}}),jt=M({dispatchEvent:Pe,addEventListener:Ae.bind(window),removeEventListener:Le.bind(window)}),Rt={};Object.getOwnPropertyDescriptor(HTMLElement.prototype,"parentElement")&&(Rt.parentElement=st.parentElement),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"contains")&&(Rt.contains=st.contains),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"children")&&(Rt.children=_t.children),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML")&&(Rt.innerHTML=St.innerHTML),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"className")&&(Rt.className=Nt.className);var kt={EventTarget:[Ge],Node:[st,window.EventTarget?null:Ge],Text:[lt],Comment:[lt],CDATASection:[lt],ProcessingInstruction:[lt],Element:[Nt,_t,gt,lt,!l.j||"innerHTML"in Element.prototype?St:null,window.HTMLSlotElement?null:Ot],HTMLElement:[Tt,Rt],HTMLSlotElement:[Ot],DocumentFragment:[yt,xt],Document:[Lt,yt,xt,Pt],Window:[jt],CharacterData:[gt],XMLHttpRequest:[window.EventTarget?null:Ge]},Ft=l.j?null:["innerHTML","textContent"];function Ht(e,t,n,r){t.forEach((function(t){return e&&t&&x(e,t,n,r)}))}function It(e){var t,n=e?null:Ft;for(t in kt)Ht(window[t]&&window[t].prototype,kt[t],e,n)}function Bt(e){return e.__shady_protoIsPatched=!0,Ht(e,kt.EventTarget),Ht(e,kt.Node),Ht(e,kt.Element),Ht(e,kt.HTMLElement),Ht(e,kt.HTMLSlotElement),e}["Text","Comment","CDATASection","ProcessingInstruction"].forEach((function(e){var t=window[e],n=Object.create(t.prototype);n.__shady_protoIsPatched=!0,Ht(n,kt.EventTarget),Ht(n,kt.Node),kt[e]&&Ht(n,kt[e]),t.prototype.__shady_patchedProto=n}));var Ut=l.ma,qt=l.j;function Wt(e,t){if(Ut&&!e.__shady_protoIsPatched&&!_(e)){var n=Object.getPrototypeOf(e),r=n.hasOwnProperty("__shady_patchedProto")&&n.__shady_patchedProto;r||(Bt(r=Object.create(n)),n.__shady_patchedProto=r),Object.setPrototypeOf(e,r)}qt||(1===t?he(e):2===t&&ce(e))}function Vt(e,t,n,r){Wt(e,1),r=r||null;var o=a(e),i=r?a(r):null;o.previousSibling=r?i.previousSibling:t.__shady_lastChild,(i=s(o.previousSibling))&&(i.nextSibling=e),(i=s(o.nextSibling=r))&&(i.previousSibling=e),o.parentNode=t,r?r===n.firstChild&&(n.firstChild=e):(n.lastChild=e,n.firstChild||(n.firstChild=e)),n.childNodes=null}function Gt(e,t){var n=a(e);if(t||void 0===n.firstChild){n.childNodes=null;var r=n.firstChild=e.__shady_native_firstChild;for(n.lastChild=e.__shady_native_lastChild,Wt(e,2),n=r,r=void 0;n;n=n.__shady_native_nextSibling){var o=a(n);o.parentNode=t||e,o.nextSibling=n.__shady_native_nextSibling,o.previousSibling=r||null,r=n,Wt(n,1)}}}var Xt=M({addEventListener:function(e,t,n){"object"!=typeof n&&(n={capture:!!n}),n.G=n.G||this,this.host.__shady_addEventListener(e,t,n)},removeEventListener:function(e,t,n){"object"!=typeof n&&(n={capture:!!n}),n.G=n.G||this,this.host.__shady_removeEventListener(e,t,n)}});function zt(e,t){x(e,Xt,t),x(e,Pt,t),x(e,St,t),x(e,_t,t),l.s&&!t?(x(e,st,t),x(e,xt,t)):l.j||(x(e,se),x(e,ie),x(e,ae))}var Jt,Kt={},$t=l.deferConnectionCallbacks&&"loading"===document.readyState;function Yt(e){var t=[];do{t.unshift(e)}while(e=e.__shady_parentNode);return t}function Zt(e,t,n){if(e!==Kt)throw new TypeError("Illegal constructor");this.g=null,Qt(this,t,n)}function Qt(e,t,n){if(e.host=t,e.mode=n&&n.mode,Gt(e.host),(t=a(e.host)).root=e,t.Pa="closed"!==e.mode?e:null,(t=a(e)).firstChild=t.lastChild=t.parentNode=t.nextSibling=t.previousSibling=null,l.preferPerformance)for(;t=e.host.__shady_native_firstChild;)e.host.__shady_native_removeChild(t);else en(e)}function en(e){e.K||(e.K=!0,F((function(){return tn(e)})))}function tn(e){var t;if(t=e.K){for(var n;e;)e.K&&(n=e),_(e=(t=e).host.__shady_getRootNode())&&(t=s(t.host))&&0<t.U||(e=void 0);t=n}(n=t)&&n._renderSelf()}function nn(e,t,n){var r=a(t),o=r.ha;r.ha=null,n||(n=(e=e.h[t.__shady_slot||"__catchall"])&&e[0]),n?(a(n).assignedNodes.push(t),r.assignedSlot=n):r.assignedSlot=void 0,o!==r.assignedSlot&&r.assignedSlot&&(a(r.assignedSlot).ja=!0)}function rn(e,t,n){for(var r=0,o=void 0;r<n.length&&(o=n[r]);r++)if("slot"==o.localName){var i=s(o).assignedNodes;i&&i.length&&rn(e,t,i)}else t.push(n[r])}function on(e,t){t.__shady_native_dispatchEvent(new Event("slotchange")),(t=s(t)).assignedSlot&&on(e,t.assignedSlot)}function an(e){e.i=e.i||[],e.g=e.g||[],e.h=e.h||{}}function sn(e){if(e.i&&e.i.length){for(var t,n=e.i,r=0;r<n.length;r++){var o=n[r];Gt(o);var i=o.__shady_parentNode;Gt(i),(i=s(i)).U=(i.U||0)+1,i=ln(o),e.h[i]?((t=t||{})[i]=!0,e.h[i].push(o)):e.h[i]=[o],e.g.push(o)}if(t)for(var a in t)e.h[a]=un(e.h[a]);e.i=[]}}function ln(e){var t=e.name||e.getAttribute("name")||"__catchall";return e.Ca=t}function un(e){return e.sort((function(e,t){e=Yt(e);for(var n=Yt(t),r=0;r<e.length;r++){t=e[r];var o=n[r];if(t!==o)return(e=T(t.__shady_parentNode)).indexOf(t)-e.indexOf(o)}}))}function dn(e){return sn(e),!(!e.g||!e.g.length)}if(Zt.prototype._renderSelf=function(){var e=$t;if($t=!0,this.K=!1,this.g){sn(this);for(var t,n=0;n<this.g.length;n++){var r=s(t=this.g[n]),o=r.assignedNodes;if(r.assignedNodes=[],r.L=[],r.ra=o)for(r=0;r<o.length;r++){var i=s(o[r]);i.ha=i.assignedSlot,i.assignedSlot===t&&(i.assignedSlot=null)}}for(n=this.host.__shady_firstChild;n;n=n.__shady_nextSibling)nn(this,n);for(n=0;n<this.g.length;n++){if(!(o=s(t=this.g[n])).assignedNodes.length)for(r=t.__shady_firstChild;r;r=r.__shady_nextSibling)nn(this,r,t);if((r=(r=s(t.__shady_parentNode))&&r.root)&&(dn(r)||r.K)&&r._renderSelf(),rn(this,o.L,o.assignedNodes),r=o.ra){for(i=0;i<r.length;i++)s(r[i]).ha=null;o.ra=null,r.length>o.assignedNodes.length&&(o.ja=!0)}o.ja&&(o.ja=!1,on(this,t))}for(t=this.g,n=[],o=0;o<t.length;o++)(i=s(r=t[o].__shady_parentNode))&&i.root||!(0>n.indexOf(r))||n.push(r);for(t=0;t<n.length;t++){for(o=(i=n[t])===this?this.host:i,r=[],i=i.__shady_firstChild;i;i=i.__shady_nextSibling)if("slot"==i.localName)for(var a=s(i).L,u=0;u<a.length;u++)r.push(a[u]);else r.push(i);i=S(o),a=We(r,r.length,i,i.length);for(var d=u=0,h=void 0;u<a.length&&(h=a[u]);u++){for(var c=0,f=void 0;c<h.S.length&&(f=h.S[c]);c++)f.__shady_native_parentNode===o&&o.__shady_native_removeChild(f),i.splice(h.index+d,1);d-=h.Z}for(d=0,h=void 0;d<a.length&&(h=a[d]);d++)for(u=i[h.index],c=h.index;c<h.index+h.Z;c++)f=r[c],o.__shady_native_insertBefore(f,u),i.splice(c,0,f)}}if(!l.preferPerformance&&!this.qa)for(n=this.host.__shady_firstChild;n;n=n.__shady_nextSibling)t=s(n),n.__shady_native_parentNode!==this.host||"slot"!==n.localName&&t.assignedSlot||this.host.__shady_native_removeChild(n);this.qa=!0,$t=e,Jt&&Jt()},function(e){e.__proto__=DocumentFragment.prototype,zt(e,"__shady_"),zt(e),Object.defineProperties(e,{nodeType:{value:Node.DOCUMENT_FRAGMENT_NODE,configurable:!0},nodeName:{value:"#document-fragment",configurable:!0},nodeValue:{value:null,configurable:!0}}),["localName","namespaceURI","prefix"].forEach((function(t){Object.defineProperty(e,t,{value:void 0,configurable:!0})})),["ownerDocument","baseURI","isConnected"].forEach((function(t){Object.defineProperty(e,t,{get:function(){return this.host[t]},configurable:!0})}))}(Zt.prototype),window.customElements&&window.customElements.define&&l.ka&&!l.preferPerformance){var hn=new Map;Jt=function(){var e=[];hn.forEach((function(t,n){e.push([n,t])})),hn.clear();for(var t=0;t<e.length;t++){var n=e[t][0];e[t][1]?n.__shadydom_connectedCallback():n.__shadydom_disconnectedCallback()}},$t&&document.addEventListener("readystatechange",(function(){$t=!1,Jt()}),{once:!0});var cn=window.customElements.define,fn=function(e,t){var n=t.prototype.connectedCallback,r=t.prototype.disconnectedCallback;cn.call(window.customElements,e,function(e,t,n){var r=0,o="__isConnected"+r++;return(t||n)&&(e.prototype.connectedCallback=e.prototype.__shadydom_connectedCallback=function(){$t?hn.set(this,!0):this[o]||(this[o]=!0,t&&t.call(this))},e.prototype.disconnectedCallback=e.prototype.__shadydom_disconnectedCallback=function(){$t?this.isConnected||hn.set(this,!1):this[o]&&(this[o]=!1,n&&n.call(this))}),e}(t,n,r)),t.prototype.connectedCallback=n,t.prototype.disconnectedCallback=r};window.customElements.define=fn,Object.defineProperty(window.CustomElementRegistry.prototype,"define",{value:fn,configurable:!0})}function _n(e){if(_(e=e.__shady_getRootNode()))return e}function pn(e){this.node=e}function mn(e){Object.defineProperty(pn.prototype,e,{get:function(){return this.node["__shady_"+e]},set:function(t){this.node["__shady_"+e]=t},configurable:!0})}(e=pn.prototype).addEventListener=function(e,t,n){return this.node.__shady_addEventListener(e,t,n)},e.removeEventListener=function(e,t,n){return this.node.__shady_removeEventListener(e,t,n)},e.appendChild=function(e){return this.node.__shady_appendChild(e)},e.insertBefore=function(e,t){return this.node.__shady_insertBefore(e,t)},e.removeChild=function(e){return this.node.__shady_removeChild(e)},e.replaceChild=function(e,t){return this.node.__shady_replaceChild(e,t)},e.cloneNode=function(e){return this.node.__shady_cloneNode(e)},e.getRootNode=function(e){return this.node.__shady_getRootNode(e)},e.contains=function(e){return this.node.__shady_contains(e)},e.dispatchEvent=function(e){return this.node.__shady_dispatchEvent(e)},e.setAttribute=function(e,t){this.node.__shady_setAttribute(e,t)},e.getAttribute=function(e){return this.node.__shady_native_getAttribute(e)},e.removeAttribute=function(e){this.node.__shady_removeAttribute(e)},e.toggleAttribute=function(e,t){return this.node.__shady_toggleAttribute(e,t)},e.attachShadow=function(e){return this.node.__shady_attachShadow(e)},e.focus=function(){this.node.__shady_native_focus()},e.blur=function(){this.node.__shady_blur()},e.importNode=function(e,t){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_importNode(e,t)},e.getElementById=function(e){if(this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_getElementById(e)},e.elementsFromPoint=function(e,t){return this.node.__shady_elementsFromPoint(e,t)},e.elementFromPoint=function(e,t){return this.node.__shady_elementFromPoint(e,t)},e.querySelector=function(e){return this.node.__shady_querySelector(e)},e.querySelectorAll=function(e,t){return this.node.__shady_querySelectorAll(e,t)},e.assignedNodes=function(e){if("slot"===this.node.localName)return this.node.__shady_assignedNodes(e)},e.append=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_append.apply(this.node,r(t))},e.prepend=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_prepend.apply(this.node,r(t))},e.after=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_after.apply(this.node,r(t))},e.before=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_before.apply(this.node,r(t))},e.remove=function(){return this.node.__shady_remove()},e.replaceWith=function(e){for(var t=[],n=0;n<arguments.length;++n)t[n]=arguments[n];return this.node.__shady_replaceWith.apply(this.node,r(t))},o.Object.defineProperties(pn.prototype,{activeElement:{configurable:!0,enumerable:!0,get:function(){if(_(this.node)||this.node.nodeType===Node.DOCUMENT_NODE)return this.node.__shady_activeElement}},_activeElement:{configurable:!0,enumerable:!0,get:function(){return this.activeElement}},host:{configurable:!0,enumerable:!0,get:function(){if(_(this.node))return this.node.host}},parentNode:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentNode}},firstChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstChild}},lastChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastChild}},nextSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextSibling}},previousSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousSibling}},childNodes:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childNodes}},parentElement:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_parentElement}},firstElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_firstElementChild}},lastElementChild:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_lastElementChild}},nextElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_nextElementSibling}},previousElementSibling:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_previousElementSibling}},children:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_children}},childElementCount:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_childElementCount}},shadowRoot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_shadowRoot}},assignedSlot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_assignedSlot}},isConnected:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_isConnected}},innerHTML:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_innerHTML},set:function(e){this.node.__shady_innerHTML=e}},textContent:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_textContent},set:function(e){this.node.__shady_textContent=e}},slot:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_slot},set:function(e){this.node.__shady_slot=e}},className:{configurable:!0,enumerable:!0,get:function(){return this.node.__shady_className},set:function(e){this.node.__shady_className=e}}}),Ie.forEach((function(e){return mn(e)})),Be.forEach((function(e){return mn(e)}));var vn=new WeakMap;function yn(e){if(_(e)||e instanceof pn)return e;var t=vn.get(e);return t||(t=new pn(e),vn.set(e,t)),t}if(l.ka){var gn=l.j?function(e){return e}:function(e){return ce(e),he(e),e},bn={inUse:l.ka,patch:gn,isShadyRoot:_,enqueue:F,flush:H,flushInitial:function(e){!e.qa&&e.K&&tn(e)},settings:l,filterMutations:function(e,t){var n=t.getRootNode();return e.map((function(e){var t=n===e.target.getRootNode();if(t&&e.addedNodes){if((t=[].slice.call(e.addedNodes).filter((function(e){return n===e.getRootNode()}))).length)return e=Object.create(e),Object.defineProperty(e,"addedNodes",{value:t,configurable:!0}),e}else if(t)return e})).filter((function(e){return e}))},observeChildren:function(e,t){var n=a(e);n.P||(n.P=new I),n.P.aa.add(t);var r=n.P;return{Da:t,J:r,Ea:e,takeRecords:function(){return r.takeRecords()}}},unobserveChildren:function(e){var t=e&&e.J;t&&(t.aa.delete(e.Da),t.aa.size||(a(e.Ea).P=null))},deferConnectionCallbacks:l.deferConnectionCallbacks,preferPerformance:l.preferPerformance,handlesDynamicScoping:!0,wrap:l.s?yn:gn,wrapIfNeeded:!0===l.s?yn:function(e){return e},Wrapper:pn,composedPath:function(e){return e.__composedPath||(e.__composedPath=be(e.target,!0)),e.__composedPath},noPatch:l.s,patchOnDemand:l.ma,nativeMethods:J,nativeTree:K,patchElementProto:Bt,querySelectorImplementation:l.querySelectorImplementation};window.ShadyDOM=bn,function(){var e=["dispatchEvent","addEventListener","removeEventListener"];window.EventTarget?(Z(window.EventTarget.prototype,e),void 0===window.__shady_native_addEventListener&&Z(Window.prototype,e)):(Z(Node.prototype,e),Z(Window.prototype,e),Z(XMLHttpRequest.prototype,e)),z?Z(Node.prototype,"parentNode firstChild lastChild previousSibling nextSibling childNodes parentElement textContent".split(" ")):Y(Node.prototype,{parentNode:{get:function(){return Q.currentNode=this,Q.parentNode()}},firstChild:{get:function(){return Q.currentNode=this,Q.firstChild()}},lastChild:{get:function(){return Q.currentNode=this,Q.lastChild()}},previousSibling:{get:function(){return Q.currentNode=this,Q.previousSibling()}},nextSibling:{get:function(){return Q.currentNode=this,Q.nextSibling()}},childNodes:{get:function(){var e=[];Q.currentNode=this;for(var t=Q.firstChild();t;)e.push(t),t=Q.nextSibling();return e}},parentElement:{get:function(){return ee.currentNode=this,ee.parentNode()}},textContent:{get:function(){switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:for(var e,t=document.createTreeWalker(this,NodeFilter.SHOW_TEXT,null,!1),n="";e=t.nextNode();)n+=e.nodeValue;return n;default:return this.nodeValue}},set:function(e){switch(null==e&&(e=""),this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:ne(this),(0<e.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_native_insertBefore(document.createTextNode(e),void 0);break;default:this.nodeValue=e}}}}),Z(Node.prototype,"appendChild insertBefore removeChild replaceChild cloneNode contains".split(" ")),Z(HTMLElement.prototype,["parentElement","contains"]),e={firstElementChild:{get:function(){return ee.currentNode=this,ee.firstChild()}},lastElementChild:{get:function(){return ee.currentNode=this,ee.lastChild()}},children:{