Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: pkg/shadow_dom/lib/shadow_dom.min.js

Issue 23548014: update shadowdom polyfill to latest (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated README, add build.sh Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 if(!HTMLElement.prototype.createShadowRoot&&!HTMLElement.prototype.webkitCreateS hadowRoot||window.__forceShadowDomPolyfill){!function(){Element.prototype.webkit CreateShadowRoot&&(Element.prototype.webkitCreateShadowRoot=function(){return wi ndow.ShadowDOMPolyfill.wrapIfNeeded(this).createShadowRoot()})}();var SideTable; "undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable =WeakMap:function(){var a=Object.defineProperty,b=Object.hasOwnProperty,c=(new D ate).getTime()%1e9;SideTable=function(){this.name="__st"+(1e9*Math.random()>>>0) +(c++ +"__")},SideTable.prototype={set:function(b,c){a(b,this.name,{value:c,writ able:!0})},get:function(a){return b.call(a,this.name)?a[this.name]:void 0},"dele te":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!function(a){"u se strict";function b(a){if(!a)throw new Error("Assertion failed")}function c(a, b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.definePropert y(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){return Object.ge tOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments":case"caller": case"length":case"name":case"prototype":case"toString":return}Object.definePrope rty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a){var b=a.__proto_ _||Object.getPrototypeOf(a),c=y.get(b);if(c)return c;var d=e(b),f=m(d);return j( b,f,a),f}function f(a,b){h(a,b,!0)}function g(a,b){h(b,a,!1)}function h(a,b,c){O bject.getOwnPropertyNames(a).forEach(function(d){if(!(d in b)){A&&a.__lookupGett er__(d);var e;try{e=Object.getOwnPropertyDescriptor(a,d)}catch(f){e=B}var g,h;if (c&&"function"==typeof e.value)return b[d]=function(){return this.impl[d].apply( this.impl,arguments)},void 0;g=function(){return this.impl[d]},(e.writable||e.se t)&&(h=function(a){this.impl[d]=a}),Object.defineProperty(b,d,{get:g,set:h,confi gurable:e.configurable,enumerable:e.enumerable})}})}function i(a,b,c){var e=a.pr ototype;j(e,b,c),d(b,a)}function j(a,c,d){var e=c.prototype;b(void 0===y.get(a)) ,y.set(a,c),f(a,e),d&&g(e,d)}function k(a,b){return y.get(b.prototype)===a}funct ion l(a){var b=Object.getPrototypeOf(a),c=e(b),d=m(c);return j(b,d,a),d}function m(a){function b(b){a.call(this,b)}return b.prototype=Object.create(a.prototype) ,b.prototype.constructor=b,b._ShadowDOMPolyfill$isGeneratedWrapper=!0,b}function n(a){return a instanceof z.EventTarget||a instanceof z.Event||a instanceof z.DO MImplementation}function o(a){return a instanceof E||a instanceof D||a instanceo f F||a instanceof C}function p(a){if(null===a)return null;b(o(a));var c=x.get(a) ;if(!c){var d=e(a);c=new d(a),x.set(a,c)}return c}function q(a){return null===a? null:(b(n(a)),a.impl)}function r(a){return a&&n(a)?q(a):a}function s(a){return a &&!n(a)?p(a):a}function t(a,c){null!==c&&(b(o(a)),b(void 0===c||n(c)),x.set(a,c) )}function u(a,b,c){Object.defineProperty(a.prototype,b,{get:c,configurable:!0,e numerable:!0})}function v(a,b){u(a,b,function(){return p(this.impl[b])})}functio n w(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){v ar a=p(this);return a[b].apply(a,arguments)}})})}var x=new SideTable,y=new SideT able,z=Object.create(null);Object.getOwnPropertyNames(window);var A=/Firefox/.te st(navigator.userAgent),B={get:function(){},set:function(){},configurable:!0,enu merable:!0},C=DOMImplementation,D=Event,E=Node,F=Window;a.assert=b,a.defineGette r=u,a.defineWrapGetter=v,a.forwardMethodsToWrapper=w,a.isWrapper=n,a.isWrapperFo r=k,a.mixin=c,a.registerObject=l,a.registerWrapper=i,a.rewrap=t,a.unwrap=q,a.unw rapIfNeeded=r,a.wrap=p,a.wrapIfNeeded=s,a.wrappers=z}(this.ShadowDOMPolyfill),fu nction(a){"use strict";function b(a){return a instanceof J.ShadowRoot}function c (a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){return!!a. shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&&I(b)||nul l}function f(f,g,h){if(h.length)return h.shift();if(b(f))return f.insertionParen t||a.getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var j=1; j<i.length;j++)h[j-1]=i[j];return i[0]}if(g&&c(f)){var k=f.parentNode;if(k&&d(k) )for(var l=a.getShadowTrees(k),m=g.insertionParent,j=0;j<l.length;j++)if(l[j].co ntains(m))return m}return e(f)}function g(a){for(var d=[],e=a,g=[],i=[];e;){var j=null;if(c(e)){j=h(d);var k=d[d.length-1]||e;d.push(k)}else d.length||d.push(e) ;var l=d[d.length-1];g.push({target:l,currentTarget:e}),b(e)&&d.pop(),e=f(e,j,i) }return g}function h(a){for(var b=a.length-1;b>=0;b--)if(!c(a[b]))return a[b];re turn null}function i(d,e){for(var g=[];d;){for(var i=[],k=e,m=void 0;k;){var n=n ull;if(i.length){if(c(k)&&(n=h(i),j(m))){var o=i[i.length-1];i.push(o)}}else i.p ush(k);if(l(k,d))return i[i.length-1];b(k)&&i.pop(),m=k,k=f(k,n,g)}d=b(d)?a.getH ostForShadowRoot(d):d.parentNode}}function j(a){return a.insertionParent}functio n k(a){for(var b;b=a.parentNode;)a=b;return a}function l(a,b){return k(a)===k(b) }function m(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":cas e"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":ca se"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocu ment":case"DOMSubtreeModified":return!0}return!1}function n(b){if(!L.get(b)){L.s et(b,!0),m(b.type)||a.renderAllPending();var c=I(b.target),d=I(b);return o(d,c)} }function o(a,b){var c=g(b);return"load"===a.type&&2===c.length&&c[0].target ins tanceof J.Document&&c.shift(),p(a,c)&&q(a,c)&&r(a,c),P.set(a,u.NONE),N.set(a,nul l),a.defaultPrevented}function p(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d] .target,f=b[d].currentTarget;if(e!==f&&(c=u.CAPTURING_PHASE,!s(b[d],a,c)))return !1}return!0}function q(a,b){var c=u.AT_TARGET;return s(b[0],a,c)}function r(a,b) {for(var c,d=a.bubbles,e=1;e<b.length;e++){var f=b[e].target,g=b[e].currentTarge t;if(f===g)c=u.AT_TARGET;else{if(!d||R.get(a))continue;c=u.BUBBLING_PHASE}if(!s( b[e],a,c))return}}function s(a,b,c){var d=a.target,e=a.currentTarget,f=K.get(e); if(!f)return!0;if("relatedTarget"in b){var g=H(b),h=I(g.relatedTarget),j=i(e,h); if(j===d)return!0;O.set(b,j)}P.set(b,c);var k=b.type,l=!1;M.set(b,d),N.set(b,e); for(var m=0;m<f.length;m++){var n=f[m];if(n.removed)l=!0;else if(!(n.type!==k||! n.capture&&c===u.CAPTURING_PHASE||n.capture&&c===u.BUBBLING_PHASE))try{if("funct ion"==typeof n.handler?n.handler.call(e,b):n.handler.handleEvent(b),R.get(b))ret urn!1}catch(o){window.onerror?window.onerror(o.message):console.error(o)}}if(l){ var p=f.slice();f.length=0;for(var m=0;m<p.length;m++)p[m].removed||f.push(p[m]) }return!Q.get(b)}function t(a,b,c){this.type=a,this.handler=b,this.capture=Boole an(c)}function u(a,b){return a instanceof S?(this.impl=a,void 0):I(y(S,"Event",a ,b))}function v(a){return a&&a.relatedTarget?Object.create(a,{relatedTarget:{val ue:H(a.relatedTarget)}}):a}function w(a,b,c){var d=window[a],e=function(b,c){ret urn b instanceof d?(this.impl=b,void 0):I(y(d,a,b,c))};return e.prototype=Object .create(b.prototype),c&&F(e.prototype,c),d&&G(d,e,document.createEvent(a)),e}fun ction x(a,b){return function(){arguments[b]=H(arguments[b]);var c=H(this);c[a].a pply(c,arguments)}}function y(a,b,c,d){if(ab)return new a(c,v(d));var e=H(docume nt.createEvent(b)),f=_[b],g=[c];return Object.keys(f).forEach(function(a){var b= null!=d&&a in d?d[a]:f[a];"relatedTarget"===a&&(b=H(b)),g.push(b)}),e["init"+b]. apply(e,g),e}function z(a){return"function"==typeof a?!0:a&&a.handleEvent}functi on A(a){this.impl=a}function B(b){return b instanceof J.ShadowRoot&&(b=a.getHost ForShadowRoot(b)),H(b)}function C(a){E(a,db)}function D(b,c,d,e){a.renderAllPend ing();for(var f=I(eb.call(c.impl,d,e)),h=g(f,this),i=0;i<h.length;i++){var j=h[i ];if(j.currentTarget===b)return j.target}return null}var E=a.forwardMethodsToWra pper,F=a.mixin,G=a.registerWrapper,H=a.unwrap,I=a.wrap,J=a.wrappers;new SideTabl e;var K=new SideTable,L=new SideTable,M=new SideTable,N=new SideTable,O=new Side Table,P=new SideTable,Q=new SideTable,R=new SideTable;t.prototype={equals:functi on(a){return this.handler===a.handler&&this.type===a.type&&this.capture===a.capt ure},get removed(){return null===this.handler},remove:function(){this.handler=nu ll}};var S=window.Event;u.prototype={get target(){return M.get(this)},get curren tTarget(){return N.get(this)},get eventPhase(){return P.get(this)},stopPropagati on:function(){Q.set(this,!0)},stopImmediatePropagation:function(){Q.set(this,!0) ,R.set(this,!0)}},G(S,u,document.createEvent("Event"));var T=w("UIEvent",u),U=w( "CustomEvent",u),V={get relatedTarget(){return O.get(this)||I(H(this).relatedTar get)}},W=F({initMouseEvent:x("initMouseEvent",14)},V),X=F({initFocusEvent:x("ini tFocusEvent",5)},V),Y=w("MouseEvent",T,W),Z=w("FocusEvent",T,X),$=w("MutationEve nt",u,{initMutationEvent:x("initMutationEvent",3),get relatedNode(){return I(thi s.impl.relatedNode)}}),_=Object.create(null),ab=function(){try{new window.MouseE vent("click")}catch(a){return!1}return!0}();if(!ab){var bb=function(a,b,c){if(c) {var d=_[c];b=F(F({},d),b)}_[a]=b};bb("Event",{bubbles:!1,cancelable:!1}),bb("Cu stomEvent",{detail:null},"Event"),bb("UIEvent",{view:null,detail:0},"Event"),bb( "MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shift Key:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),bb("FocusEvent",{relat edTarget:null},"UIEvent")}var cb=window.EventTarget,db=["addEventListener","remo veEventListener","dispatchEvent"];[Element,Window,Document].forEach(function(a){ var b=a.prototype;db.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[ a]})})}),A.prototype={addEventListener:function(a,b,c){if(z(b)){var d=new t(a,b, c),e=K.get(this);if(e){for(var f=0;f<e.length;f++)if(d.equals(e[f]))return}else e=[],K.set(this,e);e.push(d);var g=B(this);g.addEventListener_(a,n,!0)}},removeE ventListener:function(a,b,c){c=Boolean(c);var d=K.get(this);if(d){for(var e=0,f= !1,g=0;g<d.length;g++)d[g].type===a&&d[g].capture===c&&(e++,d[g].handler===b&&(f =!0,d[g].remove()));if(f&&1===e){var h=B(this);h.removeEventListener_(a,n,!0)}}} ,dispatchEvent:function(b){a.renderAllPending();var c=B(this);return c.dispatchE vent_(H(b))}},cb&&G(cb,A);var eb=document.elementFromPoint;a.adjustRelatedTarget =i,a.elementFromPoint=D,a.wrapEventTargetMethods=C,a.wrappers.CustomEvent=U,a.wr appers.Event=u,a.wrappers.EventTarget=A,a.wrappers.FocusEvent=Z,a.wrappers.Mouse Event=Y,a.wrappers.MutationEvent=$,a.wrappers.UIEvent=T}(this.ShadowDOMPolyfill) ,function(a){"use strict";function b(a,b){Object.defineProperty(a,b,{enumerable: !1})}function c(){this.length=0,b(this,"length")}function d(a){if(null==a)return a;for(var b=new c,d=0,e=a.length;e>d;d++)b[d]=f(a[d]);return b.length=e,b}funct ion e(a,b){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,argum ents))}}var f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototyp e,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this .ShadowDOMPolyfill),function(a){"use strict";function b(a){i(a instanceof f)}fun ction c(a,b,c,d){if(a.nodeType!==f.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a .parentNode.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d ,c&&(c.nextSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,g=[];e=a.firstChi ld;)a.removeChild(e),g.push(e),e.parentNode_=b;for(var h=0;h<g.length;h++)g[h].p reviousSibling_=g[h-1]||c,g[h].nextSibling_=g[h+1]||d;return c&&(c.nextSibling_= g[0]),d&&(d.previousSibling_=g[g.length-1]),g}function d(a){if(1===a.length)retu rn l(a[0]);for(var b=l(document.createDocumentFragment()),c=0;c<a.length;c++)b.a ppendChild(l(a[c]));return b}function e(a){for(var b=a.firstChild;b;){i(b.parent Node===a);var c=b.nextSibling,d=l(b),e=d.parentNode;e&&r.call(e,d),b.previousSib ling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}func tion f(a){i(a instanceof n),g.call(this,a),this.parentNode_=void 0,this.firstChi ld_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_ =void 0}var g=a.wrappers.EventTarget,h=a.wrappers.NodeList;a.defineWrapGetter;va r i=a.assert,j=a.mixin,k=a.registerWrapper,l=a.unwrap,m=a.wrap,n=window.Node,o=n .prototype.appendChild,p=n.prototype.insertBefore,q=n.prototype.replaceChild,r=n .prototype.removeChild,s=n.prototype.compareDocumentPosition;f.prototype=Object. create(g.prototype),j(f.prototype,{appendChild:function(a){b(a),this.invalidateS hadowRenderer();var e=this.lastChild,f=null,g=c(a,this,e,f);return this.lastChil d_=g[g.length-1],e||(this.firstChild_=g[0]),o.call(this.impl,d(g)),a},insertBefo re:function(a,e){if(!e)return this.appendChild(a);b(a),b(e),i(e.parentNode===thi s),this.invalidateShadowRenderer();var f=e.previousSibling,g=e,h=c(a,this,f,g);t his.firstChild===e&&(this.firstChild_=h[0]);var j=l(e),k=j.parentNode;return k&& p.call(k,d(h),j),a},removeChild:function(a){if(b(a),a.parentNode!==this)throw ne w Error("NotFoundError");this.invalidateShadowRenderer();var c=this.firstChild,d =this.lastChild,e=a.nextSibling,f=a.previousSibling,g=l(a),h=g.parentNode;return h&&r.call(h,g),c===a&&(this.firstChild_=e),d===a&&(this.lastChild_=f),f&&(f.nex tSibling_=e),e&&(e.previousSibling_=f),a.previousSibling_=a.nextSibling_=a.paren tNode_=null,a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Error("NotFoundError");this.invalidateShadowRenderer();var f=e.previousSibl ing,g=e.nextSibling;g===a&&(g=a.nextSibling);var h=c(a,this,f,g);this.firstChild ===e&&(this.firstChild_=h[0]),this.lastChild===e&&(this.lastChild_=h[h.length-1] ),e.previousSibling_=null,e.nextSibling_=null,e.parentNode_=null;var i=l(e);retu rn i.parentNode&&q.call(i.parentNode,d(h),i),e},hasChildNodes:function(){return null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.p arentNode_:m(this.impl.parentNode)},get firstChild(){return void 0!==this.firstC hild_?this.firstChild_:m(this.impl.firstChild)},get lastChild(){return void 0!== this.lastChild_?this.lastChild_:m(this.impl.lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:m(this.impl.nextSibling)},get prev iousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:m(this .impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeT ype!==f.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b= this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent(a){ if(e(this),this.invalidateShadowRenderer(),""!==a){var b=this.impl.ownerDocument .createTextNode(a);this.appendChild(b)}},get childNodes(){for(var a=new h,b=0,c= this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:functi on(a){if(!this.invalidateShadowRenderer())return m(this.impl.cloneNode(a));var b =m(this.impl.cloneNode(!1));if(a)for(var c=this.firstChild;c;c=c.nextSibling)b.a ppendChild(c.cloneNode(!0));return b},contains:function(a){if(!a)return!1;if(a== =this)return!0;var b=a.parentNode;return b?this.contains(b):!1},compareDocumentP osition:function(a){return s.call(this.impl,l(a))},get ownerDocument(){return a. renderAllPending(),m(this.impl.ownerDocument)}}),k(n,f,document.createDocumentFr agment()),delete f.prototype.querySelector,delete f.prototype.querySelectorAll,f .prototype=j(Object.create(g.prototype),f.prototype),a.wrappers.Node=f}(this.Sha dowDOMPolyfill),function(a){"use strict";function b(a,c){for(var d,e=a.firstElem entChild;e;){if(e.matches(c))return e;if(d=b(e,c))return d;e=e.nextElementSiblin g}return null}function c(a,b,d){for(var e=a.firstElementChild;e;)e.matches(b)&&( d[d.length++]=e),c(e,b,d),e=e.nextElementSibling;return d}var d={querySelector:f unction(a){return b(this,a)},querySelectorAll:function(a){return c(this,a,new No deList)}},e={getElementsByTagName:function(a){return this.querySelectorAll(a)},g etElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElemen tsByTagNameNS:function(a,b){if("*"===a)return this.getElementsByTagName(b);for(v ar c=new NodeList,d=this.getElementsByTagName(b),e=0,f=0;e<d.length;e++)d[e].nam espaceURI===a&&(c[f++]=d[e]);return c.length=f,c}};a.GetElementsByInterface=e,a. SelectorsInterface=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){for(;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}function c (a){for(;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}var d=a .wrappers.NodeList,e={get firstElementChild(){return b(this.firstChild)},get las tElementChild(){return c(this.lastChild)},get childElementCount(){for(var a=0,b= this.firstElementChild;b;b=b.nextElementSibling)a++;return a},get children(){for (var a=new d,b=0,c=this.firstElementChild;c;c=c.nextElementSibling)a[b++]=c;retu rn a.length=b,a}},f={get nextElementSibling(){return b(this.nextSibling)},get pr eviousElementSibling(){return c(this.nextSibling)}};a.ChildNodeInterface=f,a.Par entNodeInterface=e}(this.ShadowDOMPolyfill),function(a){"use strict";function b( a){d.call(this,a)}var c=a.ChildNodeInterface,d=a.wrappers.Node,e=a.mixin,f=a.reg isterWrapper,g=window.CharacterData;b.prototype=Object.create(d.prototype),e(b.p rototype,{get textContent(){return this.data},set textContent(a){this.data=a}}), e(b.prototype,c),f(g,b,document.createTextNode("")),a.wrappers.CharacterData=b}( this.ShadowDOMPolyfill),function(a){"use strict";function b(a){e.call(this,a)}va r c=a.ChildNodeInterface,d=a.GetElementsByInterface,e=a.wrappers.Node,f=a.Parent NodeInterface,g=a.SelectorsInterface;a.addWrapNodeListMethod;var h=a.mixin,i=a.r egisterWrapper,j=a.wrappers,k=new SideTable,l=window.Element,m=l.prototype.match es||l.prototype.mozMatchesSelector||l.prototype.msMatchesSelector||l.prototype.w ebkitMatchesSelector;b.prototype=Object.create(e.prototype),h(b.prototype,{creat eShadowRoot:function(){var b=new j.ShadowRoot(this);return k.set(this,b),a.getRe ndererForHost(this),this.invalidateShadowRenderer(!0),b},get shadowRoot(){return k.get(this)||null},setAttribute:function(a,b){this.impl.setAttribute(a,b),this. invalidateShadowRenderer()},matches:function(a){return m.call(this.impl,a)}}),h( b.prototype,c),h(b.prototype,d),h(b.prototype,f),h(b.prototype,g),i(l,b),a.wrapp ers.Element=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){sw itch(a){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}funct ion c(a){return a.replace(p,b)}function d(a){switch(a.nodeType){case Node.ELEMEN T_NODE:for(var b,d=a.tagName.toLowerCase(),f="<"+d,g=a.attributes,h=0;b=g[h];h++ )f+=" "+b.name+'="'+c(b.value)+'"';return f+=">",q[d]?f:f+e(a)+"</"+d+">";case N ode.TEXT_NODE:return c(a.nodeValue);case Node.COMMENT_NODE:return"<!--"+c(a.node Value)+"-->";default:throw console.error(a),new Error("not implemented")}}functi on e(a){for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";var e=n(a.ownerDocument.createElement(d ));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(o(f))}function g(a){j.c all(this,a)}function h(b){k(g,b,function(){return a.renderAllPending(),this.impl [b]})}function i(b){Object.defineProperty(g.prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(this.impl,arguments)},configurable:!0,e numerable:!0})}var j=a.wrappers.Element,k=a.defineGetter,l=a.mixin,m=a.registerW rapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={area:!0,base:!0,br:!0,col:!0,command:!0 ,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,tra ck:!0,wbr:!0},r=window.HTMLElement;g.prototype=Object.create(j.prototype),l(g.pr ototype,{get innerHTML(){return e(this)},set innerHTML(a){f(this,a,this.tagName) },get outerHTML(){return d(this)},set outerHTML(a){if(this.invalidateShadowRende rer())throw new Error("not implemented");this.impl.outerHTML=a}}),["clientHeight ","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop" ,"offsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h) ,["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,do cument.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerH TML=f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(thi s,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLCon tentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){r eturn this.getAttribute("select")},set select(a){this.setAttribute("select",a)}, setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===St ring(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers .HTMLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a),this.olderShadowRoot_=null}var c=a.wrappers.HTMLElement,d=a .mixin,e=a.registerWrapper,f=window.HTMLShadowElement;b.prototype=Object.create( c.prototype),d(b.prototype,{get olderShadowRoot(){return this.olderShadowRoot_}, invalidateShadowRenderer:function(){c.prototype.invalidateShadowRenderer.call(th is,!0)}}),f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),func tion(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if( !b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.l astChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=d.c reateDocumentFragment();c=a.firstChild;)e.appendChild(c);return e}function d(a){ e.call(this,a)}var e=a.wrappers.HTMLElement,f=a.getInnerHTML,g=a.mixin,h=a.regis terWrapper,i=a.setInnerHTML,j=a.wrap,k=new SideTable,l=new SideTable,m=window.HT MLTemplateElement;d.prototype=Object.create(e.prototype),g(d.prototype,{get cont ent(){if(m)return j(this.impl.content);var a=k.get(this);return a||(a=c(this),k. set(this,a)),a},get innerHTML(){return f(this.content)},set innerHTML(a){i(this. content,a),this.invalidateShadowRenderer()}}),m&&h(m,d),a.wrappers.HTMLTemplateE lement=d}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch( a.localName){case"content":return new c(a);case"shadow":return new e(a);case"tem plate":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wr appers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateEleme nt;a.mixin;var g=a.registerWrapper,h=window.HTMLUnknownElement;b.prototype=Objec t.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(this.ShadowDOMPoly fill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInte rface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDoc umentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(docu ment.createTextNode("")),i=f(document.createComment(""));a.wrappers.Comment=i,a. wrappers.DocumentFragment=g,a.wrappers.Text=h}(this.ShadowDOMPolyfill),function( a){"use strict";function b(b){var d=i(b.impl.ownerDocument.createDocumentFragmen t());c.call(this,d),g(d,this);var e=b.shadowRoot;a.nextOlderShadowTreeTable.set( this,e),j.set(this,b)}var c=a.wrappers.DocumentFragment,d=a.elementFromPoint,e=a .getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap,j=new SideTable;b .prototype=Object.create(c.prototype),f(b.prototype,{get innerHTML(){return e(th is)},set innerHTML(a){h(this,a),this.invalidateShadowRenderer()},invalidateShado wRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFromP oint:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:functio n(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForSha dowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use s trict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextS ibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.las tChild_=a.lastChild}function d(a){F(a instanceof E);for(var d=a.firstChild;d;d=d .nextSibling)b(d);c(a)}function e(a){var b=H(a);d(a),b.textContent=""}function f (a,c){var e=H(a),f=H(c);f.nodeType===E.DOCUMENT_FRAGMENT_NODE?d(c):(h(c),b(c)),a .lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChild_=a.firstChild) ;var g=I(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appendChild(f)}functio n g(a,c){var d=H(a),e=H(c);b(c),c.previousSibling&&(c.previousSibling.nextSiblin g_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastChild===c&&(a.last Child_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)}function h(a){var b=H(a),c=b.parentNode;c&&g(I(c),a)}function i(a,b){k(b).push(a),L.set(a,b);var c=K.get(a);c||K.set(a,c=[]),c.push(b)}function j(a){J.set(a,[])}function k(a){re turn J.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[ c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e<d.length;e++){var f=d[e]; if(b(f)){if(c(f)===!1)return}else m(f,b,c)}}function n(a,b){var c=!1;return m(a, u,function(a){j(a);for(var d=0;d<b.length;d++){var e=b[d];void 0!==e&&p(e,a)&&(i (e,a),b[d]=void 0,c=!0)}}),c?b.filter(function(a){return void 0!==a}):b}function o(a,b){for(var c=0;c<b.length;c++)if(b[c]in a)return b[c]}function p(a,b){var c =b.getAttribute("select");if(!c)return!0;if(c=c.trim(),!c)return!0;if(a.nodeType !==E.ELEMENT_NODE)return!1;if(!P.test(c))return!1;if(":"===c[0]&&!Q.test(c))retu rn!1;try{return a.matches(c)}catch(d){return!1}}function q(){C=null,S.forEach(fu nction(a){a.render()}),S=[]}function r(a){this.host=a,this.dirty=!1,this.associa teNode(a)}function s(a){var b=N.get(a);return b||(b=new r(a),N.set(a,b)),b}funct ion t(a){return"content"===a.localName}function u(a){return"content"===a.localNa me}function v(a){return"shadow"===a.localName}function w(a){return"shadow"===a.l ocalName}function x(a){return!!a.shadowRoot}function y(a){return M.get(a)}functi on z(a){for(var b=[],c=a.shadowRoot;c;c=M.get(c))b.push(c);return b}function A(a ,b){L.set(a,b)}function B(a){new r(a).render()}var C,D=a.wrappers.HTMLContentEle ment,E=a.wrappers.Node,F=a.assert,G=a.mixin,H=a.unwrap,I=a.wrap,J=new SideTable, K=new SideTable,L=new SideTable,M=new SideTable,N=new SideTable,O=new SideTable, P=/^[*.:#[a-zA-Z_|]/,Q=new RegExp("^:("+["link","visited","target","enabled","di sabled","checked","indeterminate","nth-child","nth-last-child","nth-of-type","nt h-last-of-type","first-child","last-child","first-of-type","last-of-type","only- of-type"].join("|")+")"),R=o(window,["requestAnimationFrame","mozRequestAnimatio nFrame","webkitRequestAnimationFrame","setTimeout"]),S=[];r.prototype={render:fu nction(){if(this.dirty){var a=this.host;this.treeComposition();var b=a.shadowRoo t;if(b){this.removeAllChildNodes(this.host);var c=l(b);c.forEach(function(c){thi s.renderNode(a,b,c,!1)},this),this.dirty=!1}}},invalidate:function(){if(!this.di rty){if(this.dirty=!0,S.push(this),C)return;C=window[R](q,0)}},renderNode:functi on(a,b,c,d){if(x(c)){this.appendChild(a,c);var e=s(c);e.dirty=!0,e.render()}else t(c)?this.renderInsertionPoint(a,b,c,d):v(c)?this.renderShadowInsertionPoint(a, b,c):this.renderAsAnyDomTree(a,b,c,d)},renderAsAnyDomTree:function(a,b,c,d){if(t his.appendChild(a,c),x(c))B(c);else{var e=c,f=l(e);f.forEach(function(a){this.re nderNode(e,b,a,d)},this)}},renderInsertionPoint:function(a,b,c,d){var e=k(c);e.l ength?(this.removeAllChildNodes(c),e.forEach(function(c){t(c)&&d?this.renderInse rtionPoint(a,b,c,d):this.renderAsAnyDomTree(a,b,c,d)},this)):this.renderFallback Content(a,c),this.remove(c)},renderShadowInsertionPoint:function(a,b,c){var d=y( b);if(d){L.set(d,c),c.olderShadowRoot_=d,this.remove(c);var e=l(d);e.forEach(fun ction(b){this.renderNode(a,d,b,!0)},this)}else this.renderFallbackContent(a,c)}, renderFallbackContent:function(a,b){var c=l(b);c.forEach(function(b){this.append Child(a,b)},this)},treeComposition:function(){var a=this.host,b=a.shadowRoot,c=[ ],d=l(a);d.forEach(function(a){if(t(a)){var b=k(a);b&&b.length||(b=l(a)),c.push. apply(c,b)}else c.push(a)});for(var e,f;b;){if(e=void 0,m(b,w,function(a){return e=a,!1}),f=e,c=n(b,c),f){var g=y(b);if(g){b=g,A(b,f);continue}break}break}},app endChild:function(a,b){f(a,b),this.associateNode(b)},remove:function(a){h(a),thi s.associateNode(a)},removeAllChildNodes:function(a){e(a)},associateNode:function (a){O.set(a,this)}},E.prototype.invalidateShadowRenderer=function(a){var b=O.get (this);if(!b)return!1;var c;return(a||this.shadowRoot||(c=this.parentNode)&&(c.s hadowRoot||c instanceof ShadowRoot))&&b.invalidate(),!0},D.prototype.getDistribu tedNodes=function(){return q(),k(this)},G(E.prototype,{get insertionParent(){ret urn L.get(this)||null}}),a.eventParentsTable=K,a.getRendererForHost=s,a.getShado wTrees=z,a.nextOlderShadowTreeTable=M,a.renderAllPending=q,a.visual={removeAllCh ildNodes:e,appendChild:f,removeChild:g}}(this.ShadowDOMPolyfill),function(a){"us e strict";function b(a){h.call(this,a)}function c(a){var c=document[a];b.prototy pe[a]=function(){return q(c.apply(this.impl,arguments))}}function d(a){this.impl =a}function e(a,b){var c=document.implementation[b];a.prototype[b]=function(){re turn q(c.apply(this.impl,arguments))}}function f(a,b){var c=document.implementat ion[b];a.prototype[b]=function(){return c.apply(this.impl,arguments)}}var g=a.Ge tElementsByInterface,h=a.wrappers.Node,i=a.ParentNodeInterface,j=a.SelectorsInte rface,k=a.defineWrapGetter,l=a.elementFromPoint,m=a.forwardMethodsToWrapper,n=a. mixin,o=a.registerWrapper,p=a.unwrap,q=a.wrap,r=a.wrapEventTargetMethods;a.wrapN odeList;var s=new SideTable;b.prototype=Object.create(h.prototype),k(b,"document Element"),k(b,"body"),k(b,"head"),["getElementById","createElement","createEleme ntNS","createTextNode","createDocumentFragment","createEvent","createEventNS"].f orEach(c);var t=document.adoptNode,u=document.write;n(b.prototype,{adoptNode:fun ction(a){return t.call(this.impl,p(a)),a},elementFromPoint:function(a,b){return l(this,this,a,b)},write:function(a){for(var b=this.querySelectorAll("*"),c=b[b.l ength-1];c.nextSibling;)c=c.nextSibling;var d=c.parentNode;d.lastChild_=void 0,c .nextSibling_=void 0,u.call(this.impl,a)}}),m([window.HTMLBodyElement,window.HTM LDocument||window.Document,window.HTMLHeadElement],["appendChild","compareDocume ntPosition","getElementsByClassName","getElementsByTagName","getElementsByTagNam eNS","insertBefore","querySelector","querySelectorAll","removeChild","replaceChi ld"]),m([window.HTMLDocument||window.Document],["adoptNode","createDocumentFragm ent","createElement","createElementNS","createEvent","createEventNS","createText Node","elementFromPoint","getElementById","write"]),n(b.prototype,g),n(b.prototy pe,i),n(b.prototype,j),n(b.prototype,{get implementation(){var a=s.get(this);ret urn a?a:(a=new d(p(this).implementation),s.set(this,a),a)}}),o(window.Document,b ,document.implementation.createHTMLDocument("")),window.HTMLDocument&&o(window.H TMLDocument,b),r([window.HTMLBodyElement,window.HTMLDocument||window.Document,wi ndow.HTMLHeadElement]),e(d,"createDocumentType"),e(d,"createDocument"),e(d,"crea teHTMLDocument"),f(d,"hasFeature"),o(window.DOMImplementation,d),m([window.DOMIm plementation],["createDocumentType","createDocument","createHTMLDocument","hasFe ature"]),a.wrappers.Document=b,a.wrappers.DOMImplementation=d}(this.ShadowDOMPol yfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.Ev entTarget,d=a.mixin,e=a.registerWrapper,f=a.unwrap,g=a.unwrapIfNeeded,h=a.wrap,i =window.Window;b.prototype=Object.create(c.prototype);var j=window.getComputedSt yle;i.prototype.getComputedStyle=function(a,b){return j.call(this||window,g(a),b )},["addEventListener","removeEventListener","dispatchEvent"].forEach(function(a ){i.prototype[a]=function(){var b=h(this||window);return b[a].apply(b,arguments) }}),d(b.prototype,{getComputedStyle:function(a,b){return j.call(f(this),g(a),b)} }),e(i,b),a.wrappers.Window=b}(this.ShadowDOMPolyfill),function(a){"use strict"; function b(a){this.impl=a}function c(a){return new b(a)}function d(a){return a.m ap(c)}function e(a){var b=this;this.impl=new k(function(c){a.call(b,d(c),b)})}va r f=a.defineGetter,g=a.defineWrapGetter,h=a.registerWrapper,i=a.unwrapIfNeeded,j =a.wrapNodeList;a.wrappers;var k=window.MutationObserver||window.WebKitMutationO bserver;if(k){var l=window.MutationRecord;b.prototype={get addedNodes(){return j (this.impl.addedNodes)},get removedNodes(){return j(this.impl.removedNodes)}},[" target","previousSibling","nextSibling"].forEach(function(a){g(b,a)}),["type","a ttributeName","attributeNamespace","oldValue"].forEach(function(a){f(b,a,functio n(){return this.impl[a] 1 if(!HTMLElement.prototype.createShadowRoot&&!HTMLElement.prototype.webkitCreateS hadowRoot||window.__forceShadowDomPolyfill){!function(){Element.prototype.webkit CreateShadowRoot&&(Element.prototype.webkitCreateShadowRoot=function(){return wi ndow.ShadowDOMPolyfill.wrapIfNeeded(this).createShadowRoot()})}();var SideTable; "undefined"!=typeof WeakMap&&navigator.userAgent.indexOf("Firefox/")<0?SideTable =WeakMap:!function(){var a=Object.defineProperty,b=Date.now()%1e9;SideTable=func tion(){this.name="__st"+(1e9*Math.random()>>>0)+(b++ +"__")},SideTable.prototype ={set:function(b,c){var d=b[this.name];d&&d[0]===b?d[1]=c:a(b,this.name,{value:[ b,c],writable:!0})},get:function(a){var b;return(b=a[this.name])&&b[0]===a?b[1]: void 0},"delete":function(a){this.set(a,void 0)}}}();var ShadowDOMPolyfill={};!f unction(a){"use strict";function b(a){if(!a)throw new Error("Assertion failed")} function c(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object. defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function d(a,b){ret urn Object.getOwnPropertyNames(b).forEach(function(c){switch(c){case"arguments": case"caller":case"length":case"name":case"prototype":case"toString":return}Objec t.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a}function e(a,b){f or(var c=0;c<b.length;c++)if(b[c]in a)return b[c]}function f(a){var b=a.__proto_ _||Object.getPrototypeOf(a),c=A.get(b);if(c)return c;var d=f(b),e=o(d);return l( b,e,a),e}function g(a,b){j(a,b,!0)}function h(a,b){j(b,a,!1)}function i(a){retur n/^on[a-z]+$/.test(a)}function j(b,c,d){Object.getOwnPropertyNames(b).forEach(fu nction(e){if(!(e in c)){D&&b.__lookupGetter__(e);var f;try{f=Object.getOwnProper tyDescriptor(b,e)}catch(g){f=E}var h,j;if(d&&"function"==typeof f.value)return c [e]=function(){return this.impl[e].apply(this.impl,arguments)},void 0;var k=i(e) ;h=k?a.getEventHandlerGetter(e):function(){return this.impl[e]},(f.writable||f.s et)&&(j=k?a.getEventHandlerSetter(e):function(a){this.impl[e]=a}),Object.defineP roperty(c,e,{get:h,set:j,configurable:f.configurable,enumerable:f.enumerable})}} )}function k(a,b,c){var e=a.prototype;l(e,b,c),d(b,a)}function l(a,c,d){var e=c. prototype;b(void 0===A.get(a)),A.set(a,c),B.set(e,a),g(a,e),d&&h(e,d)}function m (a,b){return A.get(b.prototype)===a}function n(a){var b=Object.getPrototypeOf(a) ,c=f(b),d=o(c);return l(b,d,a),d}function o(a){function b(b){a.call(this,b)}retu rn b.prototype=Object.create(a.prototype),b.prototype.constructor=b,b}function p (a){return a instanceof C.EventTarget||a instanceof C.Event||a instanceof C.Rang e||a instanceof C.DOMImplementation}function q(a){return a instanceof H||a insta nceof G||a instanceof I||a instanceof J||a instanceof F}function r(a){if(null=== a)return null;b(q(a));var c=z.get(a);return c||z.set(a,c=new(f(a))(a)),c}functio n s(a){return null===a?null:(b(p(a)),a.impl)}function t(a){return a&&p(a)?s(a):a }function u(a){return a&&!p(a)?r(a):a}function v(a,c){null!==c&&(b(q(a)),b(void 0===c||p(c)),z.set(a,c))}function w(a,b,c){Object.defineProperty(a.prototype,b,{ get:c,configurable:!0,enumerable:!0})}function x(a,b){w(a,b,function(){return r( this.impl[b])})}function y(a,b){a.forEach(function(a){b.forEach(function(b){a.pr ototype[b]=function(){var a=u(this);return a[b].apply(a,arguments)}})})}var z=ne w SideTable,A=new SideTable,B=new SideTable,C=Object.create(null);Object.getOwnP ropertyNames(window);var D=/Firefox/.test(navigator.userAgent),E={get:function() {},set:function(){},configurable:!0,enumerable:!0},F=DOMImplementation,G=Event,H =Node,I=Window,J=Range;a.assert=b,a.constructorTable=A,a.defineGetter=w,a.define WrapGetter=x,a.forwardMethodsToWrapper=y,a.isWrapperFor=m,a.mixin=c,a.nativeProt otypeTable=B,a.oneOf=e,a.registerObject=n,a.registerWrapper=k,a.rewrap=v,a.unwra p=s,a.unwrapIfNeeded=t,a.wrap=r,a.wrapIfNeeded=u,a.wrappers=C}(this.ShadowDOMPol yfill),function(a){"use strict";function b(a){return a instanceof N.ShadowRoot}f unction c(a){var b=a.localName;return"content"===b||"shadow"===b}function d(a){r eturn!!a.shadowRoot}function e(a){var b;return a.parentNode||(b=a.defaultView)&& M(b)||null}function f(f,g,h){if(h.length)return h.shift();if(b(f))return j(f)||a .getHostForShadowRoot(f);var i=a.eventParentsTable.get(f);if(i){for(var k=1;k<i. length;k++)h[k-1]=i[k];return i[0]}if(g&&c(f)){var l=f.parentNode;if(l&&d(l))for (var m=a.getShadowTrees(l),n=j(g),k=0;k<m.length;k++)if(m[k].contains(n))return n}return e(f)}function g(a){for(var d=[],e=a,g=[],i=[];e;){var j=null;if(c(e)){j =h(d);var k=d[d.length-1]||e;d.push(k)}else d.length||d.push(e);var l=d[d.length -1];g.push({target:l,currentTarget:e}),b(e)&&d.pop(),e=f(e,j,i)}return g}functio n h(a){for(var b=a.length-1;b>=0;b--)if(!c(a[b]))return a[b];return null}functio n i(d,e){for(var g=[];d;){for(var i=[],j=e,l=void 0;j;){var n=null;if(i.length){ if(c(j)&&(n=h(i),k(l))){var o=i[i.length-1];i.push(o)}}else i.push(j);if(m(j,d)) return i[i.length-1];b(j)&&i.pop(),l=j,j=f(j,n,g)}d=b(d)?a.getHostForShadowRoot( d):d.parentNode}}function j(b){return a.insertionParentTable.get(b)}function k(a ){return j(a)}function l(a){for(var b;b=a.parentNode;)a=b;return a}function m(a, b){return l(a)===l(b)}function n(b,c){if(b===c)return!0;if(b instanceof N.Shadow Root){var d=a.getHostForShadowRoot(b);return n(l(d),c)}return!1}function o(a){sw itch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDat aModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInserte dIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSub treeModified":return!0}return!1}function p(b){if(!P.get(b)){P.set(b,!0),o(b.type )||a.renderAllPending();var c=M(b.target),d=M(b);return q(d,c)}}function q(a,b){ var c=g(b);return"load"===a.type&&2===c.length&&c[0].target instanceof N.Documen t&&c.shift(),X.set(a,c),r(a,c)&&s(a,c)&&t(a,c),T.set(a,w.NONE),R.set(a,null),a.d efaultPrevented}function r(a,b){for(var c,d=b.length-1;d>0;d--){var e=b[d].targe t,f=b[d].currentTarget;if(e!==f&&(c=w.CAPTURING_PHASE,!u(b[d],a,c)))return!1}ret urn!0}function s(a,b){var c=w.AT_TARGET;return u(b[0],a,c)}function t(a,b){for(v ar c,d=a.bubbles,e=1;e<b.length;e++){var f=b[e].target,g=b[e].currentTarget;if(f ===g)c=w.AT_TARGET;else{if(!d||V.get(a))continue;c=w.BUBBLING_PHASE}if(!u(b[e],a ,c))return}}function u(a,b,c){var d=a.target,e=a.currentTarget,f=O.get(e);if(!f) return!0;if("relatedTarget"in b){var g=L(b),h=M(g.relatedTarget),j=i(e,h);if(j== =d)return!0;S.set(b,j)}T.set(b,c);var k=b.type,l=!1;Q.set(b,d),R.set(b,e);for(va r m=0;m<f.length;m++){var n=f[m];if(n.removed)l=!0;else if(!(n.type!==k||!n.capt ure&&c===w.CAPTURING_PHASE||n.capture&&c===w.BUBBLING_PHASE))try{if("function"== typeof n.handler?n.handler.call(e,b):n.handler.handleEvent(b),V.get(b))return!1} catch(o){window.onerror?window.onerror(o.message):console.error(o)}}if(l){var p= f.slice();f.length=0;for(var m=0;m<p.length;m++)p[m].removed||f.push(p[m])}retur n!U.get(b)}function v(a,b,c){this.type=a,this.handler=b,this.capture=Boolean(c)} function w(a,b){return a instanceof Y?(this.impl=a,void 0):M(A(Y,"Event",a,b))}f unction x(a){return a&&a.relatedTarget?Object.create(a,{relatedTarget:{value:L(a .relatedTarget)}}):a}function y(a,b,c){var d=window[a],e=function(b,c){return b instanceof d?(this.impl=b,void 0):M(A(d,a,b,c))};return e.prototype=Object.creat e(b.prototype),c&&J(e.prototype,c),d&&(d.prototype["init"+a]?K(d,e,document.crea teEvent(a)):K(d,e,new d("temp"))),e}function z(a,b){return function(){arguments[ b]=L(arguments[b]);var c=L(this);c[a].apply(c,arguments)}}function A(a,b,c,d){if (gb)return new a(c,x(d));var e=L(document.createEvent(b)),f=fb[b],g=[c];return O bject.keys(f).forEach(function(a){var b=null!=d&&a in d?d[a]:f[a];"relatedTarget "===a&&(b=L(b)),g.push(b)}),e["init"+b].apply(e,g),e}function B(a){return"functi on"==typeof a?!0:a&&a.handleEvent}function C(a){this.impl=a}function D(b){return b instanceof N.ShadowRoot&&(b=a.getHostForShadowRoot(b)),L(b)}function E(a){I(a ,jb)}function F(b,c,d,e){a.renderAllPending();for(var f=M(kb.call(c.impl,d,e)),h =g(f,this),i=0;i<h.length;i++){var j=h[i];if(j.currentTarget===b)return j.target }return null}function G(a){return function(){var b=W.get(this);return b&&b[a]&&b [a].value||null}}function H(a){var b=a.slice(2);return function(c){var d=W.get(t his);d||(d=Object.create(null),W.set(this,d));var e=d[a];if(e&&this.removeEventL istener(b,e.wrapped,!1),"function"==typeof c){var f=function(b){var d=c.call(thi s,b);d===!1?b.preventDefault():"onbeforeunload"===a&&"string"==typeof d&&(b.retu rnValue=d)};this.addEventListener(b,f,!1),d[a]={value:c,wrapped:f}}}}var I=a.for wardMethodsToWrapper,J=a.mixin,K=a.registerWrapper,L=a.unwrap,M=a.wrap,N=a.wrapp ers;new SideTable;var O=new SideTable,P=new SideTable,Q=new SideTable,R=new Side Table,S=new SideTable,T=new SideTable,U=new SideTable,V=new SideTable,W=new Side Table,X=new SideTable;v.prototype={equals:function(a){return this.handler===a.ha ndler&&this.type===a.type&&this.capture===a.capture},get removed(){return null== =this.handler},remove:function(){this.handler=null}};var Y=window.Event;w.protot ype={get target(){return Q.get(this)},get currentTarget(){return R.get(this)},ge t eventPhase(){return T.get(this)},get path(){var a=new N.NodeList,b=X.get(this) ;if(b){for(var c=0,d=b.length-1,e=l(R.get(this)),f=0;d>=f;f++){var g=b[f].curren tTarget,h=l(g);n(e,h)&&(f!==d||g instanceof N.Node)&&(a[c++]=g)}a.length=c}retur n a},stopPropagation:function(){U.set(this,!0)},stopImmediatePropagation:functio n(){U.set(this,!0),V.set(this,!0)}},K(Y,w,document.createEvent("Event"));var Z=y ("UIEvent",w),$=y("CustomEvent",w),_={get relatedTarget(){return S.get(this)||M( L(this).relatedTarget)}},ab=J({initMouseEvent:z("initMouseEvent",14)},_),bb=J({i nitFocusEvent:z("initFocusEvent",5)},_),cb=y("MouseEvent",Z,ab),db=y("FocusEvent ",Z,bb),eb=y("MutationEvent",w,{initMutationEvent:z("initMutationEvent",3),get r elatedNode(){return M(this.impl.relatedNode)}}),fb=Object.create(null),gb=functi on(){try{new window.MouseEvent("click")}catch(a){return!1}return!0}();if(!gb){va r hb=function(a,b,c){if(c){var d=fb[c];b=J(J({},d),b)}fb[a]=b};hb("Event",{bubbl es:!1,cancelable:!1}),hb("CustomEvent",{detail:null},"Event"),hb("UIEvent",{view :null,detail:0},"Event"),hb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY: 0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEv ent"),hb("FocusEvent",{relatedTarget:null},"UIEvent")}var ib=window.EventTarget, jb=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forE ach(function(a){var b=a.prototype;jb.forEach(function(a){Object.defineProperty(b ,a+"_",{value:b[a]})})}),C.prototype={addEventListener:function(a,b,c){if(B(b)){ var d=new v(a,b,c),e=O.get(this);if(e){for(var f=0;f<e.length;f++)if(d.equals(e[ f]))return}else e=[],O.set(this,e);e.push(d);var g=D(this);g.addEventListener_(a ,p,!0)}},removeEventListener:function(a,b,c){c=Boolean(c);var d=O.get(this);if(d ){for(var e=0,f=!1,g=0;g<d.length;g++)d[g].type===a&&d[g].capture===c&&(e++,d[g] .handler===b&&(f=!0,d[g].remove()));if(f&&1===e){var h=D(this);h.removeEventList ener_(a,p,!0)}}},dispatchEvent:function(b){a.renderAllPending();var c=D(this);re turn c.dispatchEvent_(L(b))}},ib&&K(ib,C);var kb=document.elementFromPoint;a.adj ustRelatedTarget=i,a.elementFromPoint=F,a.getEventHandlerGetter=G,a.getEventHand lerSetter=H,a.wrapEventTargetMethods=E,a.wrappers.CustomEvent=$,a.wrappers.Event =w,a.wrappers.EventTarget=C,a.wrappers.FocusEvent=db,a.wrappers.MouseEvent=cb,a. wrappers.MutationEvent=eb,a.wrappers.UIEvent=Z}(this.ShadowDOMPolyfill),function (a){"use strict";function b(a,b){Object.defineProperty(a,b,{enumerable:!1})}func tion c(){this.length=0,b(this,"length")}function d(a){if(null==a)return a;for(va r b=new c,d=0,e=a.length;e>d;d++)b[d]=f(a[d]);return b.length=e,b}function e(a,b ){a.prototype[b]=function(){return d(this.impl[b].apply(this.impl,arguments))}}v ar f=a.wrap;c.prototype={item:function(a){return this[a]}},b(c.prototype,"item") ,a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(this.ShadowDO MPolyfill),function(a){"use strict";function b(a){l(a instanceof i)}function c(a ,b,c,d){if(a.nodeType!==i.DOCUMENT_FRAGMENT_NODE)return a.parentNode&&a.parentNo de.removeChild(a),a.parentNode_=b,a.previousSibling_=c,a.nextSibling_=d,c&&(c.ne xtSibling_=a),d&&(d.previousSibling_=a),[a];for(var e,f=[];e=a.firstChild;)a.rem oveChild(e),f.push(e),e.parentNode_=b;for(var g=0;g<f.length;g++)f[g].previousSi bling_=f[g-1]||c,f[g].nextSibling_=f[g+1]||d;return c&&(c.nextSibling_=f[0]),d&& (d.previousSibling_=f[f.length-1]),f}function d(a,b){var c=a.nodeType===i.DOCUME NT_NODE?a:a.ownerDocument;c!==b.ownerDocument&&c.adoptNode(b)}function e(b,c){if (c.length){var d=b.ownerDocument;if(d!==c[0].ownerDocument)for(var e=0;e<c.lengt h;e++)a.adoptNodeNoRemove(c[e],d)}}function f(a,b){e(a,b);var c=b.length;if(1=== c)return o(b[0]);for(var d=o(a.ownerDocument.createDocumentFragment()),f=0;c>f;f ++)d.appendChild(o(b[f]));return d}function g(a){if(a.invalidateShadowRenderer() ){for(var b=a.firstChild;b;){l(b.parentNode===a);var c=b.nextSibling,d=o(b),e=d. parentNode;e&&v.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b =c}a.firstChild_=a.lastChild_=null}else for(var c,f=o(a),g=f.firstChild;g;)c=g.n extSibling,v.call(f,g),g=c}function h(a){var b=a.parentNode;return b&&b.invalida teShadowRenderer()}function i(a){l(a instanceof r),j.call(this,a),this.parentNod e_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0}var j=a.wrappers.EventTarget,k=a.wrappers.NodeLis t;a.defineWrapGetter;var l=a.assert,m=a.mixin,n=a.registerWrapper,o=a.unwrap,p=a .wrap,q=a.wrapIfNeeded,r=window.Node,s=r.prototype.appendChild,t=r.prototype.ins ertBefore,u=r.prototype.replaceChild,v=r.prototype.removeChild,w=r.prototype.com pareDocumentPosition;i.prototype=Object.create(j.prototype),m(i.prototype,{appen dChild:function(a){if(b(a),this.invalidateShadowRenderer()||h(a)){var e=this.las tChild,g=null,i=c(a,this,e,g);this.lastChild_=i[i.length-1],e||(this.firstChild_ =i[0]),s.call(this.impl,f(this,i))}else d(this,a),s.call(this.impl,o(a));return a.nodeWasAdded_(),a},insertBefore:function(a,g){if(!g)return this.appendChild(a) ;if(b(a),b(g),l(g.parentNode===this),this.invalidateShadowRenderer()||h(a)){var i=g.previousSibling,j=g,k=c(a,this,i,j);this.firstChild===g&&(this.firstChild_=k [0]);var m=o(g),n=m.parentNode;n?t.call(n,f(this,k),m):e(this,k)}else d(this,a), t.call(this.impl,o(a),o(g));return a.nodeWasAdded_(),a},removeChild:function(a){ if(b(a),a.parentNode!==this)throw new Error("NotFoundError");var c=o(a);if(this. invalidateShadowRenderer()){var d=this.firstChild,e=this.lastChild,f=a.nextSibli ng,g=a.previousSibling,h=c.parentNode;h&&v.call(h,c),d===a&&(this.firstChild_=f) ,e===a&&(this.lastChild_=g),g&&(g.nextSibling_=f),f&&(f.previousSibling_=g),a.pr eviousSibling_=a.nextSibling_=a.parentNode_=void 0}else v.call(this.impl,c);retu rn a},replaceChild:function(a,e){if(b(a),b(e),e.parentNode!==this)throw new Erro r("NotFoundError");var g=o(e);if(this.invalidateShadowRenderer()||h(a)){var i=e. previousSibling,j=e.nextSibling;j===a&&(j=a.nextSibling);var k=c(a,this,i,j);thi s.firstChild===e&&(this.firstChild_=k[0]),this.lastChild===e&&(this.lastChild_=k [k.length-1]),e.previousSibling_=e.nextSibling_=e.parentNode_=void 0,g.parentNod e&&u.call(g.parentNode,f(this,k),g)}else d(this,a),u.call(this.impl,o(a),g);retu rn a.nodeWasAdded_(),e},nodeWasAdded_:function(){},hasChildNodes:function(){retu rn null===this.firstChild},get parentNode(){return void 0!==this.parentNode_?thi s.parentNode_:p(this.impl.parentNode)},get firstChild(){return void 0!==this.fir stChild_?this.firstChild_:p(this.impl.firstChild)},get lastChild(){return void 0 !==this.lastChild_?this.lastChild_:p(this.impl.lastChild)},get nextSibling(){ret urn void 0!==this.nextSibling_?this.nextSibling_:p(this.impl.nextSibling)},get p reviousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:p(t his.impl.previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.no deType!==i.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="" ,b=this.firstChild;b;b=b.nextSibling)a+=b.textContent;return a},set textContent( a){if(this.invalidateShadowRenderer()){if(g(this),""!==a){var b=this.impl.ownerD ocument.createTextNode(a);this.appendChild(b)}}else this.impl.textContent=a},get childNodes(){for(var a=new k,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;r eturn a.length=b,a},cloneNode:function(a){if(!this.invalidateShadowRenderer())re turn p(this.impl.cloneNode(a));var b=p(this.impl.cloneNode(!1));if(a)for(var c=t his.firstChild;c;c=c.nextSibling)b.appendChild(c.cloneNode(!0));return b},contai ns:function(a){if(!a)return!1;if(a=q(a),a===this)return!0;var b=a.parentNode;ret urn b?this.contains(b):!1},compareDocumentPosition:function(a){return w.call(thi s.impl,o(a))},get ownerDocument(){return a.renderAllPending(),p(this.impl.ownerD ocument)}}),n(r,i,document.createDocumentFragment()),delete i.prototype.querySel ector,delete i.prototype.querySelectorAll,i.prototype=m(Object.create(j.prototyp e),i.prototype),a.wrappers.Node=i}(this.ShadowDOMPolyfill),function(a){"use stri ct";function b(a,c){for(var d,e=a.firstElementChild;e;){if(e.matches(c))return e ;if(d=b(e,c))return d;e=e.nextElementSibling}return null}function c(a,b,d){for(v ar e=a.firstElementChild;e;)e.matches(b)&&(d[d.length++]=e),c(e,b,d),e=e.nextEle mentSibling;return d}var d={querySelector:function(a){return b(this,a)},querySel ectorAll:function(a){return c(this,a,new NodeList)}},e={getElementsByTagName:fun ction(a){return this.querySelectorAll(a)},getElementsByClassName:function(a){ret urn this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){if("*"=== a)return this.getElementsByTagName(b);for(var c=new NodeList,d=this.getElementsB yTagName(b),e=0,f=0;e<d.length;e++)d[e].namespaceURI===a&&(c[f++]=d[e]);return c .length=f,c}};a.GetElementsByInterface=e,a.SelectorsInterface=d}(this.ShadowDOMP olyfill),function(a){"use strict";function b(a){for(;a&&a.nodeType!==Node.ELEMEN T_NODE;)a=a.nextSibling;return a}function c(a){for(;a&&a.nodeType!==Node.ELEMENT _NODE;)a=a.previousSibling;return a}var d=a.wrappers.NodeList,e={get firstElemen tChild(){return b(this.firstChild)},get lastElementChild(){return c(this.lastChi ld)},get childElementCount(){for(var a=0,b=this.firstElementChild;b;b=b.nextElem entSibling)a++;return a},get children(){for(var a=new d,b=0,c=this.firstElementC hild;c;c=c.nextElementSibling)a[b++]=c;return a.length=b,a}},f={get nextElementS ibling(){return b(this.nextSibling)},get previousElementSibling(){return c(this. previousSibling)}};a.ChildNodeInterface=f,a.ParentNodeInterface=e}(this.ShadowDO MPolyfill),function(a){"use strict";function b(a){d.call(this,a)}var c=a.ChildNo deInterface,d=a.wrappers.Node,e=a.mixin,f=a.registerWrapper,g=window.CharacterDa ta;b.prototype=Object.create(d.prototype),e(b.prototype,{get textContent(){retur n this.data},set textContent(a){this.data=a}}),e(b.prototype,c),f(g,b,document.c reateTextNode("")),a.wrappers.CharacterData=b}(this.ShadowDOMPolyfill),function( a){"use strict";function b(b,c){var d=b.parentNode;if(d&&d.shadowRoot){var e=a.g etRendererForHost(d);e.dependsOnAttribute(c)&&e.invalidate()}}function c(a){g.ca ll(this,a)}function d(a,c,d){var e=d||c;Object.defineProperty(a,c,{get:function( ){return this.impl[c]},set:function(a){this.impl[c]=a,b(this,e)},configurable:!0 ,enumerable:!0})}var e=a.ChildNodeInterface,f=a.GetElementsByInterface,g=a.wrapp ers.Node,h=a.ParentNodeInterface,i=a.SelectorsInterface;a.addWrapNodeListMethod; var j=a.mixin,k=a.oneOf,l=a.registerWrapper,m=a.wrappers,n=new SideTable,o=windo w.Element,p=k(o.prototype,["matches","mozMatchesSelector","msMatchesSelector","w ebkitMatchesSelector"]),q=o.prototype[p];c.prototype=Object.create(g.prototype), j(c.prototype,{createShadowRoot:function(){var b=new m.ShadowRoot(this);n.set(th is,b);var c=a.getRendererForHost(this);return c.invalidate(),b},get shadowRoot() {return n.get(this)||null},setAttribute:function(a,c){this.impl.setAttribute(a,c ),b(this,a)},removeAttribute:function(a){this.impl.removeAttribute(a),b(this,a)} ,matches:function(a){return q.call(this.impl,a)}}),c.prototype[p]=function(a){re turn this.matches(a)},o.prototype.webkitCreateShadowRoot&&(c.prototype.webkitCre ateShadowRoot=c.prototype.createShadowRoot),d(c.prototype,"id"),d(c.prototype,"c lassName","class"),j(c.prototype,e),j(c.prototype,f),j(c.prototype,h),j(c.protot ype,i),l(o,c),a.matchesName=p,a.wrappers.Element=c}(this.ShadowDOMPolyfill),func tion(a){"use strict";function b(a){switch(a){case"&":return"&amp;";case"<":retur n"&lt;";case'"':return"&quot;"}}function c(a){return a.replace(p,b)}function d(a ){switch(a.nodeType){case Node.ELEMENT_NODE:for(var b,d=a.tagName.toLowerCase(), f="<"+d,g=a.attributes,h=0;b=g[h];h++)f+=" "+b.name+'="'+c(b.value)+'"';return f +=">",q[d]?f:f+e(a)+"</"+d+">";case Node.TEXT_NODE:return c(a.nodeValue);case No de.COMMENT_NODE:return"<!--"+c(a.nodeValue)+"-->";default:throw console.error(a) ,new Error("not implemented")}}function e(a){for(var b="",c=a.firstChild;c;c=c.n extSibling)b+=d(c);return b}function f(a,b,c){var d=c||"div";a.textContent="";va r e=n(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;) a.appendChild(o(f))}function g(a){j.call(this,a)}function h(b){k(g,b,function(){ return a.renderAllPending(),this.impl[b]})}function i(b){Object.defineProperty(g .prototype,b,{value:function(){return a.renderAllPending(),this.impl[b].apply(th is.impl,arguments)},configurable:!0,enumerable:!0})}var j=a.wrappers.Element,k=a .defineGetter,l=a.mixin,m=a.registerWrapper,n=a.unwrap,o=a.wrap,p=/&|<|"/g,q={ar ea:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,l ink:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},r=window.HTMLElement;g.protot ype=Object.create(j.prototype),l(g.prototype,{get innerHTML(){return e(this)},se t innerHTML(a){this.invalidateShadowRenderer()?f(this,a,this.tagName):this.impl. innerHTML=a},get outerHTML(){return d(this)},set outerHTML(a){var b=this.parentN ode;b&&(b.invalidateShadowRenderer(),this.impl.outerHTML=a)}}),["clientHeight"," clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","o ffsetWidth","scrollHeight","scrollLeft","scrollTop","scrollWidth"].forEach(h),[" getBoundingClientRect","getClientRects","scrollIntoView"].forEach(i),m(r,g,docum ent.createElement("b")),a.wrappers.HTMLElement=g,a.getInnerHTML=e,a.setInnerHTML =f}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a )}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLConten tElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get select(){retu rn this.getAttribute("select")},set select(a){this.setAttribute("select",a)},set Attribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===Strin g(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HT MLContentElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b( a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=w indow.HTMLShadowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{}) ,f&&e(f,b),a.wrappers.HTMLShadowElement=b}(this.ShadowDOMPolyfill),function(a){" use strict";function b(a){if(!a.defaultView)return a;var b=m.get(a);if(!b){for(b =a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild) ;m.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=j(d.createDo cumentFragment());c=a.firstChild;)e.appendChild(c);return e}function d(a){if(e.c all(this,a),!n){var b=c(a);l.set(this,k(b))}}var e=a.wrappers.HTMLElement,f=a.ge tInnerHTML,g=a.mixin,h=a.registerWrapper,i=a.setInnerHTML,j=a.unwrap,k=a.wrap,l= new SideTable,m=new SideTable,n=window.HTMLTemplateElement;d.prototype=Object.cr eate(e.prototype),g(d.prototype,{get content(){return n?k(this.impl.content):l.g et(this)},get innerHTML(){return f(this.content)},set innerHTML(a){i(this.conten t,a)}}),n&&h(n,d),a.wrappers.HTMLTemplateElement=d}(this.ShadowDOMPolyfill),func tion(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)} var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLSh adowElement,f=a.wrappers.HTMLTemplateElement;a.mixin;var g=a.registerWrapper,h=w indow.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrapper s.HTMLUnknownElement=b}(this.ShadowDOMPolyfill),function(a){"use strict";var b=a .GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin ,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g. prototype,d),e(g.prototype,b);var h=f(document.createTextNode("")),i=f(document. createComment(""));a.wrappers.Comment=i,a.wrappers.DocumentFragment=g,a.wrappers .Text=h}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=i( a.impl.ownerDocument.createDocumentFragment());c.call(this,b),g(b,this);var d=a. shadowRoot;k.set(this,d),j.set(this,a)}var c=a.wrappers.DocumentFragment,d=a.ele mentFromPoint,e=a.getInnerHTML,f=a.mixin,g=a.rewrap,h=a.setInnerHTML,i=a.unwrap, j=new SideTable,k=new SideTable;b.prototype=Object.create(c.prototype),f(b.proto type,{get innerHTML(){return e(this)},set innerHTML(a){h(this,a),this.invalidate ShadowRenderer()},get olderShadowRoot(){return k.get(this)||null},invalidateShad owRenderer:function(){return j.get(this).invalidateShadowRenderer()},elementFrom Point:function(a,b){return d(this,this.ownerDocument,a,b)},getElementById:functi on(a){return this.querySelector("#"+a)}}),a.wrappers.ShadowRoot=b,a.getHostForSh adowRoot=function(a){return j.get(a)}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.next Sibling,a.parentNode_=a.parentNode}function c(a){a.firstChild_=a.firstChild,a.la stChild_=a.lastChild}function d(a){F(a instanceof D);for(var d=a.firstChild;d;d= d.nextSibling)b(d);c(a)}function e(a){var b=J(a);d(a),b.firstChild&&(b.textConte nt="")}function f(a,c){var e=J(a),f=J(c);f.nodeType===D.DOCUMENT_FRAGMENT_NODE?d (c):(h(c),b(c)),a.lastChild_=a.lastChild,a.lastChild===a.firstChild&&(a.firstChi ld_=a.firstChild);var g=K(e.lastChild);g&&(g.nextSibling_=g.nextSibling),e.appen dChild(f)}function g(a,c){var d=J(a),e=J(c);b(c),c.previousSibling&&(c.previousS ibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),a.lastC hild===c&&(a.lastChild_=c),a.firstChild===c&&(a.firstChild_=c),d.removeChild(e)} function h(a){var b=J(a),c=b.parentNode;c&&g(K(c),a)}function i(a,b){k(b).push(a ),z(a,b);var c=M.get(a);c||M.set(a,c=[]),c.push(b)}function j(a){L.set(a,[])}fun ction k(a){return L.get(a)}function l(a){for(var b=[],c=0,d=a.firstChild;d;d=d.n extSibling)b[c++]=d;return b}function m(a,b,c){for(var d=l(a),e=0;e<d.length;e++ ){var f=d[e];if(b(f)){if(c(f)===!1)return}else m(f,b,c)}}function n(a,b){var c=b .getAttribute("select");if(!c)return!0;if(c=c.trim(),!c)return!0;if(a.nodeType!= =D.ELEMENT_NODE)return!1;if(!Q.test(c))return!1;if(":"===c[0]&&!R.test(c))return !1;try{return a.matches(c)}catch(d){return!1}}function o(){H=null,T.forEach(func tion(a){a.render()}),T=[]}function p(a){this.host=a,this.dirty=!1,this.invalidat eAttributes(),this.associateNode(a)}function q(a){var b=O.get(a);return b||(b=ne w p(a),O.set(a,b)),b}function r(a){for(;a;a=a.parentNode)if(a instanceof E)retur n a;return null}function s(a){return q(G(a))}function t(a){return"content"===a.l ocalName}function u(a){return"content"===a.localName}function v(a){return"shadow "===a.localName}function w(a){return"shadow"===a.localName}function x(a){return a.shadowRoot}function y(a){for(var b=[],c=a.shadowRoot;c;c=c.olderShadowRoot)b.p ush(c);return b}function z(a,b){N.set(a,b)}function A(a){new p(a).render()}var B =a.wrappers.HTMLContentElement,C=a.wrappers.HTMLShadowElement,D=a.wrappers.Node, E=a.wrappers.ShadowRoot,F=a.assert,G=a.getHostForShadowRoot;a.mixin;var H,I=a.on eOf,J=a.unwrap,K=a.wrap,L=new SideTable,M=new SideTable,N=new SideTable,O=new Si deTable,P=new SideTable,Q=/^[*.:#[a-zA-Z_|]/,R=new RegExp("^:("+["link","visited ","target","enabled","disabled","checked","indeterminate","nth-child","nth-last- child","nth-of-type","nth-last-of-type","first-child","last-child","first-of-typ e","last-of-type","only-of-type"].join("|")+")"),S=I(window,["requestAnimationFr ame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout"]),T=[ ];p.prototype={render:function(){if(this.dirty){this.invalidateAttributes(),this .treeComposition();var a=this.host,b=a.shadowRoot;this.removeAllChildNodes(this. host);var c=l(b);c.forEach(function(c){this.renderNode(a,b,c,!1)},this),this.dir ty=!1}},invalidate:function(){if(!this.dirty){if(this.dirty=!0,T.push(this),H)re turn;H=window[S](o,0)}},renderNode:function(a,b,c,d){if(x(c)){this.appendChild(a ,c);var e=q(c);e.dirty=!0,e.render()}else t(c)?this.renderInsertionPoint(a,b,c,d ):v(c)?this.renderShadowInsertionPoint(a,b,c):this.renderAsAnyDomTree(a,b,c,d)}, renderAsAnyDomTree:function(a,b,c,d){if(this.appendChild(a,c),x(c))A(c);else{var e=c,f=l(e);P.get(e)&&this.removeAllChildNodes(e),f.forEach(function(a){this.ren derNode(e,b,a,d)},this)}},renderInsertionPoint:function(a,b,c,d){var e=k(c);e.le ngth?(this.removeAllChildNodes(c),e.forEach(function(c){t(c)&&d?this.renderInser tionPoint(a,b,c,d):this.renderAsAnyDomTree(a,b,c,d)},this)):this.renderFallbackC ontent(a,c),this.remove(c)},renderShadowInsertionPoint:function(a,b,c){var d=b.o lderShadowRoot;if(d){z(d,c),this.remove(c);var e=l(d);e.forEach(function(b){this .renderNode(a,d,b,!0)},this)}else this.renderFallbackContent(a,c)},renderFallbac kContent:function(a,b){var c=l(b);this.associateNode(b),this.remove(b),c.forEach (function(b){this.appendChild(a,b)},this)},invalidateAttributes:function(){this. attributes=Object.create(null)},updateDependentAttributes:function(a){if(a){var b=this.attributes;/\.\w+/.test(a)&&(b["class"]=!0),/#\w+/.test(a)&&(b.id=!0),a.r eplace(/\[\s*([^\s=\|~\]]+)/g,function(a,c){b[c]=!0})}},dependsOnAttribute:funct ion(a){return this.attributes[a]},distribute:function(a,b){var c=!1,d=this;retur n m(a,u,function(a){j(a),d.updateDependentAttributes(a.getAttribute("select"));f or(var e=0;e<b.length;e++){var f=b[e];void 0!==f&&n(f,a)&&(i(f,a),b[e]=void 0,c= !0)}}),c?b.filter(function(a){return void 0!==a}):b},treeComposition:function(){ var a=this.host,b=a.shadowRoot,c=[],d=l(a);d.forEach(function(a){if(t(a)){var b= k(a);b&&b.length||(b=l(a)),c.push.apply(c,b)}else c.push(a)});for(var e,f;b;){if (e=void 0,m(b,w,function(a){return e=a,!1}),f=e,c=this.distribute(b,c),f){var g= b.olderShadowRoot;if(g){b=g,z(b,f);continue}break}break}},appendChild:function(a ,b){this.associateNode(a),f(a,b)},remove:function(a){this.associateNode(a.parent Node),h(a)},removeAllChildNodes:function(a){this.associateNode(a),e(a)},associat eNode:function(a){P.set(a,this)}},D.prototype.invalidateShadowRenderer=function( ){var a=P.get(this);return a?(a.invalidate(),!0):!1},B.prototype.getDistributedN odes=function(){var a=P.get(this);return a&&a.render(),k(this)},C.prototype.node WasAdded_=B.prototype.nodeWasAdded_=function(){this.invalidateShadowRenderer();v ar a,b=r(this);b&&(a=s(b)),P.set(this,a),a&&a.invalidate()},a.eventParentsTable= M,a.getRendererForHost=q,a.getShadowTrees=y,a.insertionParentTable=N,a.renderAll Pending=o,a.visual={removeAllChildNodes:e,appendChild:f,removeChild:g}}(this.Sha dowDOMPolyfill),function(a){"use strict";function b(b){if(window[b]){d(!a.wrappe rs[b]);var i=function(a){c.call(this,a)};i.prototype=Object.create(c.prototype), e(i.prototype,{get form(){return h(g(this).form)}}),f(window[b],i,document.creat eElement(b.slice(4,-7))),a.wrappers[b]=i}}var c=a.wrappers.HTMLElement,d=a.asser t,e=a.mixin,f=a.registerWrapper,g=a.unwrap,h=a.wrap,i=["HTMLButtonElement","HTML FieldSetElement","HTMLInputElement","HTMLKeygenElement","HTMLLabelElement","HTML LegendElement","HTMLObjectElement","HTMLOptionElement","HTMLOutputElement","HTML SelectElement","HTMLTextAreaElement"];i.forEach(b)}(this.ShadowDOMPolyfill),func tion(a){"use strict";
2 })}),l&&h(l,b),window.Node,e.prototype={observe:function(a,b){this.impl.observe( i(a),b)},disconnect:function(){this.impl.disconnect()},takeRecords:function(){re turn d(this.impl.takeRecords())}},a.wrappers.MutationObserver=e,a.wrappers.Mutat ionRecord=b}}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=c[a],d=window[b];if(d){var e=document.createElement(a),f=e.constructor;window [b]=f}}a.isWrapperFor;var c={a:"HTMLAnchorElement",applet:"HTMLAppletElement",ar ea:"HTMLAreaElement",audio:"HTMLAudioElement",br:"HTMLBRElement",base:"HTMLBaseE lement",body:"HTMLBodyElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElem ent",dl:"HTMLDListElement",datalist:"HTMLDataListElement",dir:"HTMLDirectoryElem ent",div:"HTMLDivElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement ",font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",framese t:"HTMLFrameSetElement",hr:"HTMLHRElement",head:"HTMLHeadElement",h1:"HTMLHeadin gElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",input:"HTMLInputElem ent",li:"HTMLLIElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",link :"HTMLLinkElement",map:"HTMLMapElement",menu:"HTMLMenuElement",menuitem:"HTMLMen uItemElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",del:"HTMLModElemen t",ol:"HTMLOListElement",object:"HTMLObjectElement",optgroup:"HTMLOptGroupElemen t",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement ",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q :"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",source :"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",caption:"HT MLTableCaptionElement",col:"HTMLTableColElement",table:"HTMLTableElement",tr:"HT MLTableRowElement",thead:"HTMLTableSectionElement",tbody:"HTMLTableSectionElemen t",textarea:"HTMLTextAreaElement",title:"HTMLTitleElement",ul:"HTMLUListElement" ,video:"HTMLVideoElement"};Object.keys(c).forEach(b),Object.getOwnPropertyNames( a.wrappers).forEach(function(b){window[b]=a.wrappers[b]}),a.knownElements=c}(thi s.ShadowDOMPolyfill),function(){var a=window.ShadowDOMPolyfill;a.wrap,Object.def ineProperties(HTMLElement.prototype,{webkitShadowRoot:{get:function(){return thi s.shadowRoot}}}),HTMLElement.prototype.webkitCreateShadowRoot=HTMLElement.protot ype.createShadowRoot,window.dartExperimentalFixupGetTag=function(b){function c(a ){if(a instanceof d)return"NodeList";if(a instanceof e)return"ShadowRoot";if(a i nstanceof MutationRecord)return"MutationRecord";if(a instanceof MutationObserver )return"MutationObserver";if(f(a)){a=g(a);var c=a.constructor;if(c&&c._ShadowDOM Polyfill$isGeneratedWrapper){var h=c._ShadowDOMPolyfill$cacheTag_;return h||(h=O bject.prototype.toString.call(a),h=h.substring(8,h.length-1),c._ShadowDOMPolyfil l$cacheTag_=h),h}}return b(a)}var d=a.wrappers.NodeList,e=a.wrappers.ShadowRoot, f=a.isWrapper,g=a.unwrap;return c}}();var Platform={};!function(a){function b(a, b){var c="";return Array.prototype.forEach.call(a,function(a){c+=a.textContent+" \n\n"}),b||(c=c.replace(m,"")),c}function c(a){var b=document.createElement("sty le");b.textContent=a,document.head.appendChild(b);var c=b.sheet.cssRules;return b.parentNode.removeChild(b),c}function d(a){for(var b=0,c=[];b<a.length;b++)c.pu sh(a[b].cssText);return c.join("\n\n")}function e(a){a&&f().appendChild(document .createTextNode(a))}function f(){return g||(g=document.createElement("style"),g. setAttribute("ShadowCSSShim","")),g}var g,h={strictStyling:!1,registry:{},shimSt yling:function(a,b,c){if(a){var d=this.registerDefinition(a,b,c);this.strictStyl ing&&this.applyScopeToContent(a,b),this.shimPolyfillDirectives(d.rootStyles,b),t his.applyShimming(d.scopeStyles,b)}},shimShadowDOMStyling:function(a,b){this.shi mPolyfillDirectives(a,b),this.applyShimming(a,b)},registerDefinition:function(a, b,c){var d=this.registry[b]={root:a,name:b,extendsName:c},e=a.querySelectorAll(" style");e=e?Array.prototype.slice.call(e,0):[],d.rootStyles=e,d.scopeStyles=d.ro otStyles;var f=this.registry[d.extendsName];return f&&(d.scopeStyles=d.scopeStyl es.concat(f.scopeStyles)),d},applyScopeToContent:function(a,b){a&&(Array.prototy pe.forEach.call(a.querySelectorAll("*"),function(a){a.setAttribute(b,"")}),Array .prototype.forEach.call(a.querySelectorAll("template"),function(a){this.applySco peToContent(a.content,b)},this))},shimPolyfillDirectives:function(a,b){a&&Array. prototype.forEach.call(a,function(a){a.textContent=this.convertPolyfillDirective s(a.textContent,b)},this)},convertPolyfillDirectives:function(a,b){for(var c,d,e ="",f=0;c=n.exec(a);)e+=a.substring(f,c.index),d=c[1].slice(0,-2).replace(q,b),e +=this.scopeSelector(d,b)+"{",f=n.lastIndex;return e+=a.substring(f,a.length)},a pplyShimming:function(a,b){var c=this.shimAtHost(a,b);c+=this.shimScoping(a,b),e (c)},shimAtHost:function(a,b){return a?this.convertAtHostStyles(a,b):void 0},con vertAtHostStyles:function(a,e){for(var f,g=b(a),h="",j=0;f=i.exec(g);)h+=g.subst ring(j,f.index),h+=this.scopeHostCss(f[1],e),j=i.lastIndex;h+=g.substring(j,g.le ngth);var k=new RegExp("^"+e+p,"m"),g=d(this.findAtHostRules(c(h),k));return g}, scopeHostCss:function(a,b){for(var c,d="";c=j.exec(a);)d+=this.scopeHostSelector (c[1],b)+" "+c[2]+"\n ";return d},scopeHostSelector:function(a,b){var c=[],d=a .split(","),e="[is="+b+"]";return d.forEach(function(a){a=a.trim(),a.match(k)?a= a.replace(k,b+"$1$3, "+e+"$1$3"):a.match(l)&&(a=b+a+", "+e+a),c.push(a)},this),c .join(", ")},findAtHostRules:function(a,b){return Array.prototype.filter.call(a, this.isHostRule.bind(this,b))},isHostRule:function(a,b){return b.selectorText&&b .selectorText.match(a)||b.cssRules&&this.findAtHostRules(b.cssRules,a).length||b .type==CSSRule.WEBKIT_KEYFRAMES_RULE},shimScoping:function(a,b){return a?this.co nvertScopedStyles(a,b):void 0},convertScopedStyles:function(a,d){Array.prototype .forEach.call(a,function(a){a.parentNode&&a.parentNode.removeChild(a)});var e=b( a).replace(i,"");e=this.convertPseudos(e);var f=c(e);return e=this.scopeRules(f, d)},convertPseudos:function(a){return a.replace(o," [pseudo=$1]")},scopeRules:fu nction(a,b){var c="";return Array.prototype.forEach.call(a,function(a){a.selecto rText&&a.style&&a.style.cssText?(c+=this.scopeSelector(a.selectorText,b,this.str ictStyling)+" {\n ",c+=this.propertiesFromRule(a)+"\n}\n\n"):a.media?(c+=" @media "+a.media.mediaText+" {\n",c+=this.scopeRules(a.cssRules,b),c+="\n}\n\n") :a.cssText&&(c+=a.cssText+"\n\n")},this),c},scopeSelector:function(a,b,c){var d= [],e=a.split(",");return e.forEach(function(a){a=a.trim(),this.selectorNeedsScop ing(a,b)&&(a=c?this.applyStrictSelectorScope(a,b):this.applySimpleSelectorScope( a,b)),d.push(a)},this),d.join(", ")},selectorNeedsScoping:function(a,b){var c="( "+b+"|\\[is="+b+"\\])",d=new RegExp("^"+c+p,"m");return!a.match(d)},applySimpleS electorScope:function(a,b){return b+" "+a+", "+"[is="+b+"] "+a},applyStrictSelec torScope:function(a,b){var c=[" ",">","+","~"],d=a,e="["+b+"]";return c.forEach( function(a){var b=d.split(a);d=b.map(function(a){var b=a.trim();return b&&c.inde xOf(b)<0&&b.indexOf(e)<0&&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).joi n(a)}),d},propertiesFromRule:function(a){var b=a.style.cssText;return a.style.co ntent&&!a.style.content.match(/['"]+/)&&(b="content: '"+a.style.content+"';\n"+a .style.cssText.replace(/content:[^;]*;/g,"")),b}},i=/@host[^{]*{(([^}]*?{[^{]*?} [\s\S]*?)+)}/gim,j=/([^{]*)({[\s\S]*?})/gim,k=/(.*)((?:\*)|(?:\:scope))(.*)/,l=/ ^[.\[:]/,m=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,n=/\/\*\s*@polyfill ([^*]*\*+([^/ *][^*]*\*+)*\/)([^{]*?){/gim,o=/::(x-[^\s{,(]*)/gim,p="([>\\s~+[.,{:][\\s\\S]*)? $",q=/@host/gim;if(window.ShadowDOMPolyfill){e("style { display: none !important ; }\n");var r=document.querySelector("head");r.insertBefore(f(),r.childNodes[0]) }a.ShadowCSS=h}(window.Platform),function(a){function b(a,b){if(window.ShadowDOM Polyfill){for(var h,i=this.convertPolyfillDirectives(a,b),j="",k=0;h=e.exec(i);) j+=i.substring(k,h.index),j+=this.scopeHostCss(h[1],b),k=e.lastIndex;j+=i.substr ing(k,i.length);var l=new RegExp("^"+b+g,"m"),m=d(this.findAtHostRules(c(j),l)); i=i.replace(f,""),i=this.convertPseudos(i);var n=c(i),o=this.scopeRules(n,b);ret urn m+o}}function c(a){var b=document.createElement("style");b.textContent=a,doc ument.head.appendChild(b);var c=b.sheet.cssRules;return b.parentNode.removeChild (b),c}function d(a){for(var b=0,c=[];b<a.length;b++)c.push(a[b].cssText);return c.join("\n\n")}var e=/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,f=/\/\*[^*]*\* +([^/*][^*]*\*+)*\//gim,g="([>\\s~+[.,{:][\\s\\S]*)?$";a.ShadowCSS.shimShadowDOM Styling2=b}(window.Platform)} 2 function b(a){k.call(this,a)}function c(a){var c=document[a];b.prototype[a]=func tion(){return v(c.apply(this.impl,arguments))}}function d(a,b){y.call(b.impl,u(a )),e(a,b)}function e(a,b){a.shadowRoot&&b.adoptNode(a.shadowRoot),a instanceof n &&f(a,b);for(var c=a.firstChild;c;c=c.nextSibling)e(c,b)}function f(a,b){var c=a .olderShadowRoot;c&&b.adoptNode(c)}function g(a){this.impl=a}function h(a,b){var c=document.implementation[b];a.prototype[b]=function(){return v(c.apply(this.im pl,arguments))}}function i(a,b){var c=document.implementation[b];a.prototype[b]= function(){return c.apply(this.impl,arguments)}}var j=a.GetElementsByInterface,k =a.wrappers.Node,l=a.ParentNodeInterface,m=a.SelectorsInterface,n=a.wrappers.Sha dowRoot,o=a.defineWrapGetter,p=a.elementFromPoint,q=a.forwardMethodsToWrapper,r= a.matchesName,s=a.mixin,t=a.registerWrapper,u=a.unwrap,v=a.wrap,w=a.wrapEventTar getMethods;a.wrapNodeList;var x=new SideTable;b.prototype=Object.create(k.protot ype),o(b,"documentElement"),o(b,"body"),o(b,"head"),["createComment","createDocu mentFragment","createElement","createElementNS","createEvent","createEventNS","c reateRange","createTextNode","getElementById"].forEach(c);var y=document.adoptNo de;if(s(b.prototype,{adoptNode:function(a){return a.parentNode&&a.parentNode.rem oveChild(a),d(a,this),a},elementFromPoint:function(a,b){return p(this,this,a,b)} }),document.register){var z=document.register;b.prototype.register=function(b,c) {function d(a){return a?(this.impl=a,void 0):document.createElement(b)}var e=c.p rototype;if(a.nativePrototypeTable.get(e))throw new Error("NotSupportedError");f or(var f,g=Object.getPrototypeOf(e),h=[];g&&!(f=a.nativePrototypeTable.get(g));) h.push(g),g=Object.getPrototypeOf(g);if(!f)throw new Error("NotSupportedError"); for(var i=Object.create(f),j=h.length-1;j>=0;j--)i=Object.create(i);return["crea tedCallback","enteredDocumentCallback","leftDocumentCallback","attributeChangedC allback"].forEach(function(a){var b=e[a];b&&(i[a]=function(){b.apply(v(this),arg uments)})}),z.call(u(this),b,{prototype:i}),d.prototype=e,d.prototype.constructo r=d,a.constructorTable.set(i,d),a.nativePrototypeTable.set(e,i),d},q([window.HTM LDocument||window.Document],["register"])}q([window.HTMLBodyElement,window.HTMLD ocument||window.Document,window.HTMLHeadElement,window.HTMLHtmlElement],["append Child","compareDocumentPosition","contains","getElementsByClassName","getElement sByTagName","getElementsByTagNameNS","insertBefore","querySelector","querySelect orAll","removeChild","replaceChild",r]),q([window.HTMLDocument||window.Document] ,["adoptNode","contains","createComment","createDocumentFragment","createElement ","createElementNS","createEvent","createEventNS","createRange","createTextNode" ,"elementFromPoint","getElementById"]),s(b.prototype,j),s(b.prototype,l),s(b.pro totype,m),s(b.prototype,{get implementation(){var a=x.get(this);return a?a:(a=ne w g(u(this).implementation),x.set(this,a),a)}}),t(window.Document,b,document.imp lementation.createHTMLDocument("")),window.HTMLDocument&&t(window.HTMLDocument,b ),w([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHead Element]),h(g,"createDocumentType"),h(g,"createDocument"),h(g,"createHTMLDocumen t"),i(g,"hasFeature"),t(window.DOMImplementation,g),q([window.DOMImplementation] ,["createDocumentType","createDocument","createHTMLDocument","hasFeature"]),a.ad optNodeNoRemove=d,a.wrappers.DOMImplementation=g,a.wrappers.Document=b}(this.Sha dowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wr appers.EventTarget,d=a.mixin,e=a.registerWrapper,f=a.unwrap,g=a.unwrapIfNeeded,h =a.wrap,i=window.Window;b.prototype=Object.create(c.prototype);var j=window.getC omputedStyle;i.prototype.getComputedStyle=function(a,b){return j.call(this||wind ow,g(a),b)},["addEventListener","removeEventListener","dispatchEvent"].forEach(f unction(a){i.prototype[a]=function(){var b=h(this||window);return b[a].apply(b,a rguments)}}),d(b.prototype,{getComputedStyle:function(a,b){return j.call(f(this) ,g(a),b)}}),e(i,b),a.wrappers.Window=b}(this.ShadowDOMPolyfill),function(a){"use strict";function b(a){this.impl=a}function c(a){return new b(a)}function d(a){r eturn a.map(c)}function e(a){var b=this;this.impl=new k(function(c){a.call(b,d(c ),b)})}var f=a.defineGetter,g=a.defineWrapGetter,h=a.registerWrapper,i=a.unwrapI fNeeded,j=a.wrapNodeList;a.wrappers;var k=window.MutationObserver||window.WebKit MutationObserver;if(k){var l=window.MutationRecord;b.prototype={get addedNodes() {return j(this.impl.addedNodes)},get removedNodes(){return j(this.impl.removedNo des)}},["target","previousSibling","nextSibling"].forEach(function(a){g(b,a)}),[ "type","attributeName","attributeNamespace","oldValue"].forEach(function(a){f(b, a,function(){return this.impl[a]})}),l&&h(l,b),window.Node,e.prototype={observe: function(a,b){this.impl.observe(i(a),b)},disconnect:function(){this.impl.disconn ect()},takeRecords:function(){return d(this.impl.takeRecords())}},a.wrappers.Mut ationObserver=e,a.wrappers.MutationRecord=b}}(this.ShadowDOMPolyfill),function(a ){"use strict";function b(a){this.impl=a}var c=a.registerWrapper,d=a.unwrap,e=a. unwrapIfNeeded,f=a.wrap,g=window.Range;b.prototype={get startContainer(){return f(this.impl.startContainer)},get endContainer(){return f(this.impl.endContainer) },get commonAncestorContainer(){return f(this.impl.commonAncestorContainer)},set Start:function(a,b){this.impl.setStart(e(a),b)},setEnd:function(a,b){this.impl.s etEnd(e(a),b)},setStartBefore:function(a){this.impl.setStartBefore(e(a))},setSta rtAfter:function(a){this.impl.setStartAfter(e(a))},setEndBefore:function(a){this .impl.setEndBefore(e(a))},setEndAfter:function(a){this.impl.setEndAfter(e(a))},s electNode:function(a){this.impl.selectNode(e(a))},selectNodeContents:function(a) {this.impl.selectNodeContents(e(a))},compareBoundaryPoints:function(a,b){return this.impl.compareBoundaryPoints(a,d(b))},extractContents:function(){return f(thi s.impl.extractContents())},cloneContents:function(){return f(this.impl.cloneCont ents())},insertNode:function(a){this.impl.insertNode(e(a))},surroundContents:fun ction(a){this.impl.surroundContents(e(a))},cloneRange:function(){return f(this.i mpl.cloneRange())},isPointInRange:function(a,b){return this.impl.isPointInRange( e(a),b)},comparePoint:function(a,b){return this.impl.comparePoint(e(a),b)},inter sectsNode:function(a){return this.impl.intersectsNode(e(a))}},g.prototype.create ContextualFragment&&(b.prototype.createContextualFragment=function(a){return f(t his.impl.createContextualFragment(a))}),c(window.Range,b),a.wrappers.Range=b}(th is.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=c[a],d=window [b];if(d){var e=document.createElement(a),f=e.constructor;window[b]=f}}a.isWrapp erFor;var c={a:"HTMLAnchorElement",applet:"HTMLAppletElement",area:"HTMLAreaElem ent",audio:"HTMLAudioElement",br:"HTMLBRElement",base:"HTMLBaseElement",body:"HT MLBodyElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",dl:"HTMLDLi stElement",datalist:"HTMLDataListElement",dir:"HTMLDirectoryElement",div:"HTMLDi vElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",font:"HTMLFont Element",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetE lement",hr:"HTMLHRElement",head:"HTMLHeadElement",h1:"HTMLHeadingElement",html:" HTMLHtmlElement",iframe:"HTMLIFrameElement",input:"HTMLInputElement",li:"HTMLLIE lement",label:"HTMLLabelElement",legend:"HTMLLegendElement",link:"HTMLLinkElemen t",map:"HTMLMapElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuItemElement",me ta:"HTMLMetaElement",meter:"HTMLMeterElement",del:"HTMLModElement",ol:"HTMLOList Element",object:"HTMLObjectElement",optgroup:"HTMLOptGroupElement",option:"HTMLO ptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLPar amElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteEleme nt",script:"HTMLScriptElement",select:"HTMLSelectElement",source:"HTMLSourceElem ent",span:"HTMLSpanElement",style:"HTMLStyleElement",caption:"HTMLTableCaptionEl ement",col:"HTMLTableColElement",table:"HTMLTableElement",tr:"HTMLTableRowElemen t",thead:"HTMLTableSectionElement",tbody:"HTMLTableSectionElement",textarea:"HTM LTextAreaElement",title:"HTMLTitleElement",ul:"HTMLUListElement",video:"HTMLVide oElement"};Object.keys(c).forEach(b),Object.getOwnPropertyNames(a.wrappers).forE ach(function(b){window[b]=a.wrappers[b]}),a.knownElements=c}(this.ShadowDOMPolyf ill),function(){var a=window.ShadowDOMPolyfill;a.wrap,Object.defineProperties(HT MLElement.prototype,{webkitShadowRoot:{get:function(){return this.shadowRoot}}}) ,HTMLElement.prototype.webkitCreateShadowRoot=HTMLElement.prototype.createShadow Root,window.dartExperimentalFixupGetTag=function(b){function c(a){if(a instanceo f d)return"NodeList";if(a instanceof e)return"ShadowRoot";if(a instanceof Mutati onRecord)return"MutationRecord";if(a instanceof MutationObserver)return"Mutation Observer";var c=f(a);if(a!==c){var g=a.constructor;if(g&&"GeneratedWrapper"==g.n ame){var h=g._ShadowDOMPolyfill$cacheTag_;return h||(h=Object.prototype.toString .call(c),h=h.substring(8,h.length-1),g._ShadowDOMPolyfill$cacheTag_=h),h}a=c}ret urn b(a)}var d=a.wrappers.NodeList,e=a.wrappers.ShadowRoot,f=a.unwrapIfNeeded;re turn c}}();var Platform={};!function(a){function b(a,b){var c="";return Array.pr ototype.forEach.call(a,function(a){c+=a.textContent+"\n\n"}),b||(c=c.replace(m," ")),c}function c(a){var b=document.createElement("style");b.textContent=a,docume nt.head.appendChild(b);var c=b.sheet.cssRules;return b.parentNode.removeChild(b) ,c}function d(a){for(var b=0,c=[];b<a.length;b++)c.push(a[b].cssText);return c.j oin("\n\n")}function e(a){a&&f().appendChild(document.createTextNode(a))}functio n f(){return g||(g=document.createElement("style"),g.setAttribute("ShadowCSSShim ","")),g}var g,h={strictStyling:!1,registry:{},shimStyling:function(a,b,c){if(a) {var d=this.registerDefinition(a,b,c);this.strictStyling&&this.applyScopeToConte nt(a,b),this.shimPolyfillDirectives(d.rootStyles,b),this.applyShimming(d.scopeSt yles,b)}},shimShadowDOMStyling:function(a,b){this.shimPolyfillDirectives(a,b),th is.applyShimming(a,b)},registerDefinition:function(a,b,c){var d=this.registry[b] ={root:a,name:b,extendsName:c},e=a.querySelectorAll("style");e=e?Array.prototype .slice.call(e,0):[],d.rootStyles=e,d.scopeStyles=d.rootStyles;var f=this.registr y[d.extendsName];return f&&(d.scopeStyles=d.scopeStyles.concat(f.scopeStyles)),d },applyScopeToContent:function(a,b){a&&(Array.prototype.forEach.call(a.querySele ctorAll("*"),function(a){a.setAttribute(b,"")}),Array.prototype.forEach.call(a.q uerySelectorAll("template"),function(a){this.applyScopeToContent(a.content,b)},t his))},shimPolyfillDirectives:function(a,b){a&&Array.prototype.forEach.call(a,fu nction(a){a.textContent=this.convertPolyfillDirectives(a.textContent,b)},this)}, convertPolyfillDirectives:function(a,b){for(var c,d,e="",f=0;c=n.exec(a);)e+=a.s ubstring(f,c.index),d=c[1].slice(0,-2).replace(q,b),e+=this.scopeSelector(d,b)+" {",f=n.lastIndex;return e+=a.substring(f,a.length)},applyShimming:function(a,b){ var c=this.shimAtHost(a,b);c+=this.shimScoping(a,b),e(c)},shimAtHost:function(a, b){return a?this.convertAtHostStyles(a,b):void 0},convertAtHostStyles:function(a ,e){for(var f,g=b(a),h="",j=0;f=i.exec(g);)h+=g.substring(j,f.index),h+=this.sco peHostCss(f[1],e),j=i.lastIndex;h+=g.substring(j,g.length);var k=new RegExp("^"+ e+p,"m"),g=d(this.findAtHostRules(c(h),k));return g},scopeHostCss:function(a,b){ for(var c,d="";c=j.exec(a);)d+=this.scopeHostSelector(c[1],b)+" "+c[2]+"\n ";return d},scopeHostSelector:function(a,b){var c=[],d=a.split(","),e="[is="+b+" ]";return d.forEach(function(a){a=a.trim(),a.match(k)?a=a.replace(k,b+"$1$3, "+e +"$1$3"):a.match(l)&&(a=b+a+", "+e+a),c.push(a)},this),c.join(", ")},findAtHostR ules:function(a,b){return Array.prototype.filter.call(a,this.isHostRule.bind(thi s,b))},isHostRule:function(a,b){return b.selectorText&&b.selectorText.match(a)|| b.cssRules&&this.findAtHostRules(b.cssRules,a).length||b.type==CSSRule.WEBKIT_KE YFRAMES_RULE},shimScoping:function(a,b){return a?this.convertScopedStyles(a,b):v oid 0},convertScopedStyles:function(a,d){Array.prototype.forEach.call(a,function (a){a.parentNode&&a.parentNode.removeChild(a)});var e=b(a).replace(i,"");e=this. convertPseudos(e);var f=c(e);return e=this.scopeRules(f,d)},convertPseudos:funct ion(a){return a.replace(o," [pseudo=$1]")},scopeRules:function(a,b){var c="";ret urn Array.prototype.forEach.call(a,function(a){a.selectorText&&a.style&&a.style. cssText?(c+=this.scopeSelector(a.selectorText,b,this.strictStyling)+" {\n ",c+=this.propertiesFromRule(a)+"\n}\n\n"):a.media?(c+="@media "+a.media.mediaTe xt+" {\n",c+=this.scopeRules(a.cssRules,b),c+="\n}\n\n"):a.cssText&&(c+=a.cssTex t+"\n\n")},this),c},scopeSelector:function(a,b,c){var d=[],e=a.split(",");return e.forEach(function(a){a=a.trim(),this.selectorNeedsScoping(a,b)&&(a=c?this.appl yStrictSelectorScope(a,b):this.applySimpleSelectorScope(a,b)),d.push(a)},this),d .join(", ")},selectorNeedsScoping:function(a,b){var c="("+b+"|\\[is="+b+"\\])",d =new RegExp("^"+c+p,"m");return!a.match(d)},applySimpleSelectorScope:function(a, b){return b+" "+a+", "+"[is="+b+"] "+a},applyStrictSelectorScope:function(a,b){v ar c=[" ",">","+","~"],d=a,e="["+b+"]";return c.forEach(function(a){var b=d.spli t(a);d=b.map(function(a){var b=a.trim();return b&&c.indexOf(b)<0&&b.indexOf(e)<0 &&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).join(a)}),d},propertiesFrom Rule:function(a){var b=a.style.cssText;return a.style.content&&!a.style.content. match(/['"]+/)&&(b="content: '"+a.style.content+"';\n"+a.style.cssText.replace(/ content:[^;]*;/g,"")),b}},i=/@host[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,j=/([^{ ]*)({[\s\S]*?})/gim,k=/(.*)((?:\*)|(?:\:scope))(.*)/,l=/^[.\[:]/,m=/\/\*[^*]*\*+ ([^/*][^*]*\*+)*\//gim,n=/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){ /gim,o=/::(x-[^\s{,(]*)/gim,p="([>\\s~+[.,{:][\\s\\S]*)?$",q=/@host/gim;if(windo w.ShadowDOMPolyfill){e("style { display: none !important; }\n");var r=document.q uerySelector("head");r.insertBefore(f(),r.childNodes[0])}a.ShadowCSS=h}(window.P latform),function(a){function b(a,b){if(window.ShadowDOMPolyfill){for(var h,i=th is.convertPolyfillDirectives(a,b),j="",k=0;h=e.exec(i);)j+=i.substring(k,h.index ),j+=this.scopeHostCss(h[1],b),k=e.lastIndex;j+=i.substring(k,i.length);var l=ne w RegExp("^"+b+g,"m"),m=d(this.findAtHostRules(c(j),l));i=i.replace(f,""),i=this .convertPseudos(i);var n=c(i),o=this.scopeRules(n,b);return m+o}}function c(a){v ar b=document.createElement("style");b.textContent=a,document.head.appendChild(b );var c=b.sheet.cssRules;return b.parentNode.removeChild(b),c}function d(a){for( var b=0,c=[];b<a.length;b++)c.push(a[b].cssText);return c.join("\n\n")}var e=/@h ost[^{]*{(([^}]*?{[^{]*?}[\s\S]*?)+)}/gim,f=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, g="([>\\s~+[.,{:][\\s\\S]*)?$";a.ShadowCSS.shimShadowDOMStyling2=b}(window.Platf orm)}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698