UNPKG

17.6 kBJavaScriptView Raw
1if(function(){var t=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function e(e){var n=t.has(e);return e=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(e),!n&&e}function n(t){var e=t.isConnected;if(void 0!==e)return e;for(;t&&!(t.__CE_isImportDocument||t instanceof Document);)t=t.parentNode||(window.ShadowRoot&&t instanceof ShadowRoot?t.host:void 0);return!(!t||!(t.__CE_isImportDocument||t instanceof Document))}function o(t,e){for(;e&&e!==t&&!e.nextSibling;)e=e.parentNode;return e&&e!==t?e.nextSibling:null}function i(t,e,n){n=void 0===n?new Set:n;for(var r=t;r;){if(r.nodeType===Node.ELEMENT_NODE){var a=r;e(a);var c=a.localName;if("link"===c&&"import"===a.getAttribute("rel")){if((r=a.import)instanceof Node&&!n.has(r))for(n.add(r),r=r.firstChild;r;r=r.nextSibling)i(r,e,n);r=o(t,a);continue}if("template"===c){r=o(t,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)i(a,e,n)}r=r.firstChild?r.firstChild:o(t,r)}}function r(t,e,n){t[e]=n}function a(){this.a=new Map,this.g=new Map,this.c=[],this.f=[],this.b=!1}function c(t,e){t.b&&i(e,function(e){return l(t,e)})}function l(t,e){if(t.b&&!e.__CE_patched){e.__CE_patched=!0;for(var n=0;n<t.c.length;n++)t.c[n](e);for(n=0;n<t.f.length;n++)t.f[n](e)}}function s(t,e){var n=[];for(i(e,function(t){return n.push(t)}),e=0;e<n.length;e++){var o=n[e];1===o.__CE_state?t.connectedCallback(o):h(t,o)}}function u(t,e){var n=[];for(i(e,function(t){return n.push(t)}),e=0;e<n.length;e++){var o=n[e];1===o.__CE_state&&t.disconnectedCallback(o)}}function p(t,e,n){var o=(n=void 0===n?{}:n).u||new Set,r=n.i||function(e){return h(t,e)},a=[];if(i(e,function(e){if("link"===e.localName&&"import"===e.getAttribute("rel")){var n=e.import;n instanceof Node&&(n.__CE_isImportDocument=!0,n.__CE_hasRegistry=!0),n&&"complete"===n.readyState?n.__CE_documentLoadHandled=!0:e.addEventListener("load",function(){var n=e.import;if(!n.__CE_documentLoadHandled){n.__CE_documentLoadHandled=!0;var i=new Set(o);i.delete(n),p(t,n,{u:i,i:r})}})}else a.push(e)},o),t.b)for(e=0;e<a.length;e++)l(t,a[e]);for(e=0;e<a.length;e++)r(a[e])}function h(t,e){if(void 0===e.__CE_state){var o=e.ownerDocument;if((o.defaultView||o.__CE_isImportDocument&&o.__CE_hasRegistry)&&(o=t.a.get(e.localName))){o.constructionStack.push(e);var i=o.constructorFunction;try{try{if(new i!==e)throw Error("The custom element constructor did not produce the element being upgraded.")}finally{o.constructionStack.pop()}}catch(t){throw e.__CE_state=2,t}if(e.__CE_state=1,e.__CE_definition=o,o.attributeChangedCallback)for(o=o.observedAttributes,i=0;i<o.length;i++){var r=o[i],a=e.getAttribute(r);null!==a&&t.attributeChangedCallback(e,r,null,a,null)}n(e)&&t.connectedCallback(e)}}}function f(t){var e=document;this.c=t,this.a=e,this.b=void 0,p(this.c,this.a),"loading"===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function d(t){t.b&&t.b.disconnect()}function m(){var t=this;this.b=this.a=void 0,this.c=new Promise(function(e){t.b=e,t.a&&e(t.a)})}function y(t){if(t.a)throw Error("Already resolved.");t.a=void 0,t.b&&t.b(void 0)}function b(t){this.c=!1,this.a=t,this.j=new Map,this.f=function(t){return t()},this.b=!1,this.g=[],this.o=new f(t)}a.prototype.connectedCallback=function(t){var e=t.__CE_definition;e.connectedCallback&&e.connectedCallback.call(t)},a.prototype.disconnectedCallback=function(t){var e=t.__CE_definition;e.disconnectedCallback&&e.disconnectedCallback.call(t)},a.prototype.attributeChangedCallback=function(t,e,n,o,i){var r=t.__CE_definition;r.attributeChangedCallback&&-1<r.observedAttributes.indexOf(e)&&r.attributeChangedCallback.call(t,e,n,o,i)},f.prototype.f=function(t){var e=this.a.readyState;for("interactive"!==e&&"complete"!==e||d(this),e=0;e<t.length;e++)for(var n=t[e].addedNodes,o=0;o<n.length;o++)p(this.c,n[o])},b.prototype.l=function(t,n){var o=this;if(!(n instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!e(t))throw new SyntaxError("The element name '"+t+"' is not valid.");if(this.a.a.get(t))throw Error("A custom element with name '"+t+"' has already been defined.");if(this.c)throw Error("A custom element is already being defined.");this.c=!0;try{var i=function(t){var e=r[t];if(void 0!==e&&!(e instanceof Function))throw Error("The '"+t+"' callback must be a function.");return e},r=n.prototype;if(!(r instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");var a=i("connectedCallback"),c=i("disconnectedCallback"),l=i("adoptedCallback"),s=i("attributeChangedCallback"),u=n.observedAttributes||[]}catch(t){return}finally{this.c=!1}(function(t,e,n){t.a.set(e,n),t.g.set(n.constructorFunction,n)})(this.a,t,n={localName:t,constructorFunction:n,connectedCallback:a,disconnectedCallback:c,adoptedCallback:l,attributeChangedCallback:s,observedAttributes:u,constructionStack:[]}),this.g.push(n),this.b||(this.b=!0,this.f(function(){return function(t){if(!1!==t.b){t.b=!1;for(var e=t.g,n=[],o=new Map,i=0;i<e.length;i++)o.set(e[i].localName,[]);for(p(t.a,document,{i:function(e){if(void 0===e.__CE_state){var i=e.localName,r=o.get(i);r?r.push(e):t.a.a.get(i)&&n.push(e)}}}),i=0;i<n.length;i++)h(t.a,n[i]);for(;0<e.length;){var r=e.shift();i=r.localName,r=o.get(r.localName);for(var a=0;a<r.length;a++)h(t.a,r[a]);(i=t.j.get(i))&&y(i)}}}(o)}))},b.prototype.i=function(t){p(this.a,t)},b.prototype.get=function(t){if(t=this.a.a.get(t))return t.constructorFunction},b.prototype.m=function(t){if(!e(t))return Promise.reject(new SyntaxError("'"+t+"' is not a valid custom element name."));var n=this.j.get(t);return n?n.c:(n=new m,this.j.set(t,n),this.a.a.get(t)&&!this.g.some(function(e){return e.localName===t})&&y(n),n.c)},b.prototype.s=function(t){d(this.o);var e=this.f;this.f=function(n){return t(function(){return e(n)})}},window.CustomElementRegistry=b,b.prototype.define=b.prototype.l,b.prototype.upgrade=b.prototype.i,b.prototype.get=b.prototype.get,b.prototype.whenDefined=b.prototype.m,b.prototype.polyfillWrapFlushCallback=b.prototype.s;var g=window.Document.prototype.createElement,w=window.Document.prototype.createElementNS,v=window.Document.prototype.importNode,E=window.Document.prototype.prepend,_=window.Document.prototype.append,C=window.DocumentFragment.prototype.prepend,N=window.DocumentFragment.prototype.append,S=window.Node.prototype.cloneNode,T=window.Node.prototype.appendChild,A=window.Node.prototype.insertBefore,D=window.Node.prototype.removeChild,k=window.Node.prototype.replaceChild,O=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),M=window.Element.prototype.attachShadow,j=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),x=window.Element.prototype.getAttribute,L=window.Element.prototype.setAttribute,H=window.Element.prototype.removeAttribute,F=window.Element.prototype.getAttributeNS,P=window.Element.prototype.setAttributeNS,R=window.Element.prototype.removeAttributeNS,I=window.Element.prototype.insertAdjacentElement,z=window.Element.prototype.insertAdjacentHTML,W=window.Element.prototype.prepend,B=window.Element.prototype.append,$=window.Element.prototype.before,q=window.Element.prototype.after,U=window.Element.prototype.replaceWith,V=window.Element.prototype.remove,X=window.HTMLElement,G=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),J=window.HTMLElement.prototype.insertAdjacentElement,K=window.HTMLElement.prototype.insertAdjacentHTML,Q=new function(){};function Y(t,e,o){function i(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r]=arguments[r];r=[];for(var a=[],c=0;c<i.length;c++){var l=i[c];if(l instanceof Element&&n(l)&&a.push(l),l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)r.push(l);else r.push(l)}for(e.apply(this,i),i=0;i<a.length;i++)u(t,a[i]);if(n(this))for(i=0;i<r.length;i++)(a=r[i])instanceof Element&&s(t,a)}}void 0!==o.h&&(e.prepend=i(o.h)),void 0!==o.append&&(e.append=i(o.append))}var Z,tt=window.customElements;if(!tt||tt.forcePolyfill||"function"!=typeof tt.define||"function"!=typeof tt.get){var et=new a;Z=et,window.HTMLElement=function(){function t(){var t=this.constructor,e=Z.g.get(t);if(!e)throw Error("The custom element being constructed was not registered with `customElements`.");var n=e.constructionStack;if(0===n.length)return n=g.call(document,e.localName),Object.setPrototypeOf(n,t.prototype),n.__CE_state=1,n.__CE_definition=e,l(Z,n),n;var o=n[e=n.length-1];if(o===Q)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");return n[e]=Q,Object.setPrototypeOf(o,t.prototype),l(Z,o),o}return t.prototype=X.prototype,Object.defineProperty(t.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:t}),t}(),function(){var t=et;r(Document.prototype,"createElement",function(e){if(this.__CE_hasRegistry){var n=t.a.get(e);if(n)return new n.constructorFunction}return e=g.call(this,e),l(t,e),e}),r(Document.prototype,"importNode",function(e,n){return e=v.call(this,e,!!n),this.__CE_hasRegistry?p(t,e):c(t,e),e}),r(Document.prototype,"createElementNS",function(e,n){if(this.__CE_hasRegistry&&(null===e||"http://www.w3.org/1999/xhtml"===e)){var o=t.a.get(n);if(o)return new o.constructorFunction}return e=w.call(this,e,n),l(t,e),e}),Y(t,Document.prototype,{h:E,append:_})}(),Y(et,DocumentFragment.prototype,{h:C,append:N}),function(){function t(t,o){Object.defineProperty(t,"textContent",{enumerable:o.enumerable,configurable:!0,get:o.get,set:function(t){if(this.nodeType===Node.TEXT_NODE)o.set.call(this,t);else{var i=void 0;if(this.firstChild){var r=this.childNodes,a=r.length;if(0<a&&n(this)){i=Array(a);for(var c=0;c<a;c++)i[c]=r[c]}}if(o.set.call(this,t),i)for(t=0;t<i.length;t++)u(e,i[t])}}})}var e=et;r(Node.prototype,"insertBefore",function(t,o){if(t instanceof DocumentFragment){var i=Array.prototype.slice.apply(t.childNodes);if(t=A.call(this,t,o),n(this))for(o=0;o<i.length;o++)s(e,i[o]);return t}return i=n(t),o=A.call(this,t,o),i&&u(e,t),n(this)&&s(e,t),o}),r(Node.prototype,"appendChild",function(t){if(t instanceof DocumentFragment){var o=Array.prototype.slice.apply(t.childNodes);if(t=T.call(this,t),n(this))for(var i=0;i<o.length;i++)s(e,o[i]);return t}return o=n(t),i=T.call(this,t),o&&u(e,t),n(this)&&s(e,t),i}),r(Node.prototype,"cloneNode",function(t){return t=S.call(this,!!t),this.ownerDocument.__CE_hasRegistry?p(e,t):c(e,t),t}),r(Node.prototype,"removeChild",function(t){var o=n(t),i=D.call(this,t);return o&&u(e,t),i}),r(Node.prototype,"replaceChild",function(t,o){if(t instanceof DocumentFragment){var i=Array.prototype.slice.apply(t.childNodes);if(t=k.call(this,t,o),n(this))for(u(e,o),o=0;o<i.length;o++)s(e,i[o]);return t}i=n(t);var r=k.call(this,t,o),a=n(this);return a&&u(e,o),i&&u(e,t),a&&s(e,t),r}),O&&O.get?t(Node.prototype,O):function(t,e){t.b=!0,t.c.push(e)}(e,function(e){t(e,{enumerable:!0,configurable:!0,get:function(){for(var t=[],e=0;e<this.childNodes.length;e++){var n=this.childNodes[e];n.nodeType!==Node.COMMENT_NODE&&t.push(n.textContent)}return t.join("")},set:function(t){for(;this.firstChild;)D.call(this,this.firstChild);null!=t&&""!==t&&T.call(this,document.createTextNode(t))}})})}(),function(){function t(t,e){Object.defineProperty(t,"innerHTML",{enumerable:e.enumerable,configurable:!0,get:e.get,set:function(t){var o=this,r=void 0;if(n(this)&&(r=[],i(this,function(t){t!==o&&r.push(t)})),e.set.call(this,t),r)for(var l=0;l<r.length;l++){var s=r[l];1===s.__CE_state&&a.disconnectedCallback(s)}return this.ownerDocument.__CE_hasRegistry?p(a,this):c(a,this),t}})}function e(t,e){r(t,"insertAdjacentElement",function(t,o){var i=n(o);return t=e.call(this,t,o),i&&u(a,o),n(t)&&s(a,o),t})}function o(t,e){function n(t,e){for(var n=[];t!==e;t=t.nextSibling)n.push(t);for(e=0;e<n.length;e++)p(a,n[e])}r(t,"insertAdjacentHTML",function(t,o){if("beforebegin"===(t=t.toLowerCase())){var i=this.previousSibling;e.call(this,t,o),n(i||this.parentNode.firstChild,this)}else if("afterbegin"===t)i=this.firstChild,e.call(this,t,o),n(this.firstChild,i);else if("beforeend"===t)i=this.lastChild,e.call(this,t,o),n(i||this.firstChild,null);else{if("afterend"!==t)throw new SyntaxError("The value provided ("+String(t)+") is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.");i=this.nextSibling,e.call(this,t,o),n(this.nextSibling,i)}})}var a=et;M&&r(Element.prototype,"attachShadow",function(t){t=M.call(this,t);var e=a;if(e.b&&!t.__CE_patched){t.__CE_patched=!0;for(var n=0;n<e.c.length;n++)e.c[n](t)}return this.__CE_shadowRoot=t}),j&&j.get?t(Element.prototype,j):G&&G.get?t(HTMLElement.prototype,G):function(t,e){t.b=!0,t.f.push(e)}(a,function(e){t(e,{enumerable:!0,configurable:!0,get:function(){return S.call(this,!0).innerHTML},set:function(t){var e="template"===this.localName,n=e?this.content:this,o=w.call(document,this.namespaceURI,this.localName);for(o.innerHTML=t;0<n.childNodes.length;)D.call(n,n.childNodes[0]);for(t=e?o.content:o;0<t.childNodes.length;)T.call(n,t.childNodes[0])}})}),r(Element.prototype,"setAttribute",function(t,e){if(1!==this.__CE_state)return L.call(this,t,e);var n=x.call(this,t);L.call(this,t,e),e=x.call(this,t),a.attributeChangedCallback(this,t,n,e,null)}),r(Element.prototype,"setAttributeNS",function(t,e,n){if(1!==this.__CE_state)return P.call(this,t,e,n);var o=F.call(this,t,e);P.call(this,t,e,n),n=F.call(this,t,e),a.attributeChangedCallback(this,e,o,n,t)}),r(Element.prototype,"removeAttribute",function(t){if(1!==this.__CE_state)return H.call(this,t);var e=x.call(this,t);H.call(this,t),null!==e&&a.attributeChangedCallback(this,t,e,null,null)}),r(Element.prototype,"removeAttributeNS",function(t,e){if(1!==this.__CE_state)return R.call(this,t,e);var n=F.call(this,t,e);R.call(this,t,e);var o=F.call(this,t,e);n!==o&&a.attributeChangedCallback(this,e,n,o,t)}),J?e(HTMLElement.prototype,J):I?e(Element.prototype,I):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched."),K?o(HTMLElement.prototype,K):z?o(Element.prototype,z):console.warn("Custom Elements: `Element#insertAdjacentHTML` was not patched."),Y(a,Element.prototype,{h:W,append:B}),function(t){function e(e){return function(o){for(var i=[],r=0;r<arguments.length;++r)i[r]=arguments[r];r=[];for(var a=[],c=0;c<i.length;c++){var l=i[c];if(l instanceof Element&&n(l)&&a.push(l),l instanceof DocumentFragment)for(l=l.firstChild;l;l=l.nextSibling)r.push(l);else r.push(l)}for(e.apply(this,i),i=0;i<a.length;i++)u(t,a[i]);if(n(this))for(i=0;i<r.length;i++)(a=r[i])instanceof Element&&s(t,a)}}var o=Element.prototype;void 0!==$&&(o.before=e($)),void 0!==$&&(o.after=e(q)),void 0!==U&&r(o,"replaceWith",function(e){for(var o=[],i=0;i<arguments.length;++i)o[i]=arguments[i];i=[];for(var r=[],a=0;a<o.length;a++){var c=o[a];if(c instanceof Element&&n(c)&&r.push(c),c instanceof DocumentFragment)for(c=c.firstChild;c;c=c.nextSibling)i.push(c);else i.push(c)}for(a=n(this),U.apply(this,o),o=0;o<r.length;o++)u(t,r[o]);if(a)for(u(t,this),o=0;o<i.length;o++)(r=i[o])instanceof Element&&s(t,r)}),void 0!==V&&r(o,"remove",function(){var e=n(this);V.call(this),e&&u(t,this)})}(a)}(),document.__CE_hasRegistry=!0;var nt=new b(et);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:nt})}}.call(self),"function"!=typeof window.CustomEvent){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}t.prototype=window.Event.prototype,window.CustomEvent=t}var e,n,o,i,r;e=Event.prototype,n=document,o=window,e.composedPath||(e.composedPath=function(){if(this.path)return this.path;var t=this.target;for(this.path=[];null!==t.parentNode;)this.path.push(t),t=t.parentNode;return this.path.push(n,o),this.path}),"function"!=typeof(i=window.Element.prototype).matches&&(i.matches=i.msMatchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||function(t){t=(this.document||this.ownerDocument).querySelectorAll(t);for(var e=0;t[e]&&t[e]!==this;)++e;return!!t[e]}),"function"!=typeof i.closest&&(i.closest=function(t){for(var e=this;e&&1===e.nodeType;){if(e.matches(t))return e;e=e.parentNode}return null}),function(t){function e(t){return t.parentNode?e(t.parentNode):t}"function"!=typeof t.getRootNode&&(t.getRootNode=function(t){return t&&t.composed?function t(n){return 11===(n=e(n)).nodeType?t(n.host):n}(this):e(this)})}(Element.prototype),[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}),"classList"in(r=Element.prototype)||Object.defineProperty(r,"classList",{get:function(){var t=this,e=(t.getAttribute("class")||"").replace(/^\s+|\s$/g,"").split(/\s+/g);function n(){e.length>0?t.setAttribute("class",e.join(" ")):t.removeAttribute("class")}return""===e[0]&&e.splice(0,1),e.toggle=function(t,o){void 0!==o?o?e.add(t):e.remove(t):-1!==e.indexOf(t)?e.splice(e.indexOf(t),1):e.push(t),n()},e.add=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o<i;o++)-1===e.indexOf(t[o])&&e.push(t[o]);n()},e.remove=function(){for(var t=[].slice.call(arguments),o=0,i=t.length;o<i;o++)-1!==e.indexOf(t[o])&&e.splice(e.indexOf(t[o]),1);n()},e.item=function(t){return e[t]},e.contains=function(t){return-1!==e.indexOf(t)},e.replace=function(t,o){-1!==e.indexOf(t)&&e.splice(e.indexOf(t),1,o),n()},e.value=t.getAttribute("class")||"",e}});
\No newline at end of file