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

Side by Side Diff: polymer_0.5.4/bower_components/webcomponentsjs/ShadowDOM.min.js

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
(Empty)
1 /**
2 * @license
3 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt
5 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt
6 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt
7 * Code distributed by Google as part of the polymer project is also
8 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt
9 */
10 // @version 0.5.4
11 "undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now( )%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.proto type={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.na me,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name]) &&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]== =e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]=== e:!1}},window.WeakMap=n}(),window.ShadowDOMPolyfill={},function(e){"use strict"; function t(){if("undefined"!=typeof chrome&&chrome.app&&chrome.app.runtime)retur n!1;if(navigator.getDeviceStorage)return!1;try{var e=new Function("return true;" );return e()}catch(t){return!1}}function n(e){if(!e)throw new Error("Assertion f ailed")}function r(e,t){for(var n=k(t),r=0;r<n.length;r++){var o=n[r];I(e,o,F(t, o))}return e}function o(e,t){for(var n=k(t),r=0;r<n.length;r++){var o=n[r];switc h(o){case"arguments":case"caller":case"length":case"name":case"prototype":case"t oString":continue}I(e,o,F(t,o))}return e}function i(e,t){for(var n=0;n<t.length; n++)if(t[n]in e)return t[n]}function a(e,t,n){B.value=n,I(e,t,B)}function s(e){v ar t=e.__proto__||Object.getPrototypeOf(e),n=R.get(t);if(n)return n;var r=s(t),o =E(r);return v(t,o,e),o}function c(e,t){m(e,t,!0)}function u(e,t){m(t,e,!1)}func tion l(e){return/^on[a-z]+$/.test(e)}function p(e){return/^\w[a-zA-Z_0-9]*$/.tes t(e)}function d(e){return A&&p(e)?new Function("return this.__impl4cf1e782hg__." +e):function(){return this.__impl4cf1e782hg__[e]}}function f(e){return A&&p(e)?n ew Function("v","this.__impl4cf1e782hg__."+e+" = v"):function(t){this.__impl4cf1 e782hg__[e]=t}}function h(e){return A&&p(e)?new Function("return this.__impl4cf1 e782hg__."+e+".apply(this.__impl4cf1e782hg__, arguments)"):function(){return thi s.__impl4cf1e782hg__[e].apply(this.__impl4cf1e782hg__,arguments)}}function w(e,t ){try{return Object.getOwnPropertyDescriptor(e,t)}catch(n){return q}}function m( t,n,r){for(var o=k(t),i=0;i<o.length;i++){var a=o[i];if("polymerBlackList_"!==a& &!(a in n||t.polymerBlackList_&&t.polymerBlackList_[a])){U&&t.__lookupGetter__(a );var s,c,u=w(t,a);if(r&&"function"==typeof u.value)n[a]=h(a);else{var p=l(a);s= p?e.getEventHandlerGetter(a):d(a),(u.writable||u.set||V)&&(c=p?e.getEventHandler Setter(a):f(a)),I(n,a,{get:s,set:c,configurable:u.configurable,enumerable:u.enum erable})}}}}function g(e,t,n){var r=e.prototype;v(r,t,n),o(t,e)}function v(e,t,r ){var o=t.prototype;n(void 0===R.get(e)),R.set(e,t),P.set(o,e),c(e,o),r&&u(o,r), a(o,"constructor",t),t.prototype=o}function b(e,t){return R.get(t.prototype)===e }function y(e){var t=Object.getPrototypeOf(e),n=s(t),r=E(n);return v(t,r,e),r}fu nction E(e){function t(t){e.call(this,t)}var n=Object.create(e.prototype);return n.constructor=t,t.prototype=n,t}function S(e){return e&&e.__impl4cf1e782hg__}fu nction M(e){return!S(e)}function T(e){return null===e?null:(n(M(e)),e.__wrapper8 e3dd93a60__||(e.__wrapper8e3dd93a60__=new(s(e))(e)))}function O(e){return null== =e?null:(n(S(e)),e.__impl4cf1e782hg__)}function L(e){return e.__impl4cf1e782hg__ }function j(e,t){t.__impl4cf1e782hg__=e,e.__wrapper8e3dd93a60__=t}function N(e){ return e&&S(e)?O(e):e}function _(e){return e&&!S(e)?T(e):e}function C(e,t){null! ==t&&(n(M(e)),n(void 0===t||S(t)),e.__wrapper8e3dd93a60__=t)}function D(e,t,n){G .get=n,I(e.prototype,t,G)}function H(e,t){D(e,t,function(){return T(this.__impl4 cf1e782hg__[t])})}function x(e,t){e.forEach(function(e){t.forEach(function(t){e. prototype[t]=function(){var e=_(this);return e[t].apply(e,arguments)}})})}var R= new WeakMap,P=new WeakMap,W=Object.create(null),A=t(),I=Object.defineProperty,k= Object.getOwnPropertyNames,F=Object.getOwnPropertyDescriptor,B={value:void 0,con figurable:!0,enumerable:!1,writable:!0};k(window);var U=/Firefox/.test(navigator .userAgent),q={get:function(){},set:function(){},configurable:!0,enumerable:!0}, V=function(){var e=Object.getOwnPropertyDescriptor(Node.prototype,"nodeType");re turn e&&!e.get&&!e.set}(),G={get:void 0,configurable:!0,enumerable:!0};e.assert= n,e.constructorTable=R,e.defineGetter=D,e.defineWrapGetter=H,e.forwardMethodsToW rapper=x,e.isWrapper=S,e.isWrapperFor=b,e.mixin=r,e.nativePrototypeTable=P,e.one Of=i,e.registerObject=y,e.registerWrapper=g,e.rewrap=C,e.setWrapper=j,e.unsafeUn wrap=L,e.unwrap=O,e.unwrapIfNeeded=N,e.wrap=T,e.wrapIfNeeded=_,e.wrappers=W}(win dow.ShadowDOMPolyfill),function(e){"use strict";function t(e,t,n){return{index:e ,removed:t,addedCount:n}}function n(){}var r=0,o=1,i=2,a=3;n.prototype={calcEdit Distances:function(e,t,n,r,o,i){for(var a=i-o+1,s=n-t+1,c=new Array(a),u=0;a>u;u ++)c[u]=new Array(s),c[u][0]=u;for(var l=0;s>l;l++)c[0][l]=l;for(var u=1;a>u;u++ )for(var l=1;s>l;l++)if(this.equals(e[t+l-1],r[o+u-1]))c[u][l]=c[u-1][l-1];else{ var p=c[u-1][l]+1,d=c[u][l-1]+1;c[u][l]=d>p?p:d}return c},spliceOperationsFromEd itDistances:function(e){for(var t=e.length-1,n=e[0].length-1,s=e[t][n],c=[];t>0| |n>0;)if(0!=t)if(0!=n){var u,l=e[t-1][n-1],p=e[t-1][n],d=e[t][n-1];u=d>p?l>p?p:l :l>d?d:l,u==l?(l==s?c.push(r):(c.push(o),s=l),t--,n--):u==p?(c.push(a),t--,s=p): (c.push(i),n--,s=d)}else c.push(a),t--;else c.push(i),n--;return c.reverse(),c}, calcSplices:function(e,n,s,c,u,l){var p=0,d=0,f=Math.min(s-n,l-u);if(0==n&&0==u& &(p=this.sharedPrefix(e,c,f)),s==e.length&&l==c.length&&(d=this.sharedSuffix(e,c ,f-p)),n+=p,u+=p,s-=d,l-=d,s-n==0&&l-u==0)return[];if(n==s){for(var h=t(n,[],0); l>u;)h.removed.push(c[u++]);return[h]}if(u==l)return[t(n,[],s-n)];for(var w=this .spliceOperationsFromEditDistances(this.calcEditDistances(e,n,s,c,u,l)),h=void 0 ,m=[],g=n,v=u,b=0;b<w.length;b++)switch(w[b]){case r:h&&(m.push(h),h=void 0),g++ ,v++;break;case o:h||(h=t(g,[],0)),h.addedCount++,g++,h.removed.push(c[v]),v++;b reak;case i:h||(h=t(g,[],0)),h.addedCount++,g++;break;case a:h||(h=t(g,[],0)),h. removed.push(c[v]),v++}return h&&m.push(h),m},sharedPrefix:function(e,t,n){for(v ar r=0;n>r;r++)if(!this.equals(e[r],t[r]))return r;return n},sharedSuffix:functi on(e,t,n){for(var r=e.length,o=t.length,i=0;n>i&&this.equals(e[--r],t[--o]);)i++ ;return i},calculateSplices:function(e,t){return this.calcSplices(e,0,e.length,t ,0,t.length)},equals:function(e,t){return e===t}},e.ArraySplice=n}(window.Shadow DOMPolyfill),function(e){"use strict";function t(){a=!1;var e=i.slice(0);i=[];fo r(var t=0;t<e.length;t++)e[t]()}function n(e){i.push(e),a||(a=!0,r(t,0))}var r,o =window.MutationObserver,i=[],a=!1;if(o){var s=1,c=new o(t),u=document.createTex tNode(s);c.observe(u,{characterData:!0}),r=function(){s=(s+1)%2,u.data=s}}else r =window.setTimeout;e.setEndOfMicrotask=n}(window.ShadowDOMPolyfill),function(e){ "use strict";function t(e){e.scheduled_||(e.scheduled_=!0,h.push(e),w||(l(n),w=! 0))}function n(){for(w=!1;h.length;){var e=h;h=[],e.sort(function(e,t){return e. uid_-t.uid_});for(var t=0;t<e.length;t++){var n=e[t];n.scheduled_=!1;var r=n.tak eRecords();i(n),r.length&&n.callback_(r,n)}}}function r(e,t){this.type=e,this.ta rget=t,this.addedNodes=new d.NodeList,this.removedNodes=new d.NodeList,this.prev iousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNam espace=null,this.oldValue=null}function o(e,t){for(;e;e=e.parentNode){var n=f.ge t(e);if(n)for(var r=0;r<n.length;r++){var o=n[r];o.options.subtree&&o.addTransie ntObserver(t)}}}function i(e){for(var t=0;t<e.nodes_.length;t++){var n=e.nodes_[ t],r=f.get(n);if(!r)return;for(var o=0;o<r.length;o++){var i=r[o];i.observer===e &&i.removeTransientObservers()}}}function a(e,n,o){for(var i=Object.create(null) ,a=Object.create(null),s=e;s;s=s.parentNode){var c=f.get(s);if(c)for(var u=0;u<c .length;u++){var l=c[u],p=l.options;if((s===e||p.subtree)&&!("attributes"===n&&! p.attributes||"attributes"===n&&p.attributeFilter&&(null!==o.namespace||-1===p.a ttributeFilter.indexOf(o.name))||"characterData"===n&&!p.characterData||"childLi st"===n&&!p.childList)){var d=l.observer;i[d.uid_]=d,("attributes"===n&&p.attrib uteOldValue||"characterData"===n&&p.characterDataOldValue)&&(a[d.uid_]=o.oldValu e)}}}for(var h in i){var d=i[h],w=new r(n,e);"name"in o&&"namespace"in o&&(w.att ributeName=o.name,w.attributeNamespace=o.namespace),o.addedNodes&&(w.addedNodes= o.addedNodes),o.removedNodes&&(w.removedNodes=o.removedNodes),o.previousSibling& &(w.previousSibling=o.previousSibling),o.nextSibling&&(w.nextSibling=o.nextSibli ng),void 0!==a[h]&&(w.oldValue=a[h]),t(d),d.records_.push(w)}}function s(e){if(t his.childList=!!e.childList,this.subtree=!!e.subtree,this.attributes="attributes "in e||!("attributeOldValue"in e||"attributeFilter"in e)?!!e.attributes:!0,this. characterData="characterDataOldValue"in e&&!("characterData"in e)?!0:!!e.charact erData,!this.attributes&&(e.attributeOldValue||"attributeFilter"in e)||!this.cha racterData&&e.characterDataOldValue)throw new TypeError;if(this.characterData=!! e.characterData,this.attributeOldValue=!!e.attributeOldValue,this.characterDataO ldValue=!!e.characterDataOldValue,"attributeFilter"in e){if(null==e.attributeFil ter||"object"!=typeof e.attributeFilter)throw new TypeError;this.attributeFilter =m.call(e.attributeFilter)}else this.attributeFilter=null}function c(e){this.cal lback_=e,this.nodes_=[],this.records_=[],this.uid_=++g,this.scheduled_=!1}functi on u(e,t,n){this.observer=e,this.target=t,this.options=n,this.transientObservedN odes=[]}var l=e.setEndOfMicrotask,p=e.wrapIfNeeded,d=e.wrappers,f=new WeakMap,h= [],w=!1,m=Array.prototype.slice,g=0;c.prototype={constructor:c,observe:function( e,t){e=p(e);var n,r=new s(t),o=f.get(e);o||f.set(e,o=[]);for(var i=0;i<o.length; i++)o[i].observer===this&&(n=o[i],n.removeTransientObservers(),n.options=r);n||( n=new u(this,e,r),o.push(n),this.nodes_.push(e))},disconnect:function(){this.nod es_.forEach(function(e){for(var t=f.get(e),n=0;n<t.length;n++){var r=t[n];if(r.o bserver===this){t.splice(n,1);break}}},this),this.records_=[]},takeRecords:funct ion(){var e=this.records_;return this.records_=[],e}},u.prototype={addTransientO bserver:function(e){if(e!==this.target){t(this.observer),this.transientObservedN odes.push(e);var n=f.get(e);n||f.set(e,n=[]),n.push(this)}},removeTransientObser vers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[] ;for(var t=0;t<e.length;t++)for(var n=e[t],r=f.get(n),o=0;o<r.length;o++)if(r[o] ===this){r.splice(o,1);break}}},e.enqueueMutation=a,e.registerTransientObservers =o,e.wrappers.MutationObserver=c,e.wrappers.MutationRecord=r}(window.ShadowDOMPo lyfill),function(e){"use strict";function t(e,t){this.root=e,this.parent=t}funct ion n(e,t){if(e.treeScope_!==t){e.treeScope_=t;for(var r=e.shadowRoot;r;r=r.olde rShadowRoot)r.treeScope_.parent=t;for(var o=e.firstChild;o;o=o.nextSibling)n(o,t )}}function r(n){if(n instanceof e.wrappers.Window,n.treeScope_)return n.treeSco pe_;var o,i=n.parentNode;return o=i?r(i):new t(n,null),n.treeScope_=o}t.prototyp e={get renderer(){return this.root instanceof e.wrappers.ShadowRoot?e.getRendere rForHost(this.root.host):null},contains:function(e){for(;e;e=e.parent)if(e===thi s)return!0;return!1}},e.TreeScope=t,e.getTreeScope=r,e.setTreeScope=n}(window.Sh adowDOMPolyfill),function(e){"use strict";function t(e){return e instanceof G.Sh adowRoot}function n(e){return I(e).root}function r(e,r){var s=[],c=e;for(s.push( c);c;){var u=a(c);if(u&&u.length>0){for(var l=0;l<u.length;l++){var d=u[l];if(i( d)){var f=n(d),h=f.olderShadowRoot;h&&s.push(h)}s.push(d)}c=u[u.length-1]}else i f(t(c)){if(p(e,c)&&o(r))break;c=c.host,s.push(c)}else c=c.parentNode,c&&s.push(c )}return s}function o(e){if(!e)return!1;switch(e.type){case"abort":case"error":c ase"select":case"change":case"load":case"reset":case"resize":case"scroll":case"s electstart":return!0}return!1}function i(e){return e instanceof HTMLShadowElemen t}function a(t){return e.getDestinationInsertionPoints(t)}function s(e,t){if(0== =e.length)return t;t instanceof G.Window&&(t=t.document);for(var n=I(t),r=e[0],o =I(r),i=u(n,o),a=0;a<e.length;a++){var s=e[a];if(I(s)===i)return s}return e[e.le ngth-1]}function c(e){for(var t=[];e;e=e.parent)t.push(e);return t}function u(e, t){for(var n=c(e),r=c(t),o=null;n.length>0&&r.length>0;){var i=n.pop(),a=r.pop() ;if(i!==a)break;o=i}return o}function l(e,t,n){t instanceof G.Window&&(t=t.docum ent);var o,i=I(t),a=I(n),s=r(n,e),o=u(i,a);o||(o=a.root);for(var c=o;c;c=c.paren t)for(var l=0;l<s.length;l++){var p=s[l];if(I(p)===c)return p}return null}functi on p(e,t){return I(e)===I(t)}function d(e){if(!z.get(e)&&(z.set(e,!0),h(V(e),V(e .target)),W)){var t=W;throw W=null,t}}function f(e){switch(e.type){case"load":ca se"beforeunload":case"unload":return!0}return!1}function h(t,n){if(K.get(t))thro w new Error("InvalidStateError");K.set(t,!0),e.renderAllPending();var o,i,a;if(f (t)&&!t.bubbles){var s=n;s instanceof G.Document&&(a=s.defaultView)&&(i=s,o=[])} if(!o)if(n instanceof G.Window)a=n,o=[];else if(o=r(n,t),!f(t)){var s=o[o.length -1];s instanceof G.Document&&(a=s.defaultView)}return nt.set(t,o),w(t,o,a,i)&&m( t,o,a,i)&&g(t,o,a,i),J.set(t,rt),Z["delete"](t,null),K["delete"](t),t.defaultPre vented}function w(e,t,n,r){var o=ot;if(n&&!v(n,e,o,t,r))return!1;for(var i=t.len gth-1;i>0;i--)if(!v(t[i],e,o,t,r))return!1;return!0}function m(e,t,n,r){var o=it ,i=t[0]||n;return v(i,e,o,t,r)}function g(e,t,n,r){for(var o=at,i=1;i<t.length;i ++)if(!v(t[i],e,o,t,r))return;n&&t.length>0&&v(n,e,o,t,r)}function v(e,t,n,r,o){ var i=X.get(e);if(!i)return!0;var a=o||s(r,e);if(a===e){if(n===ot)return!0;n===a t&&(n=it)}else if(n===at&&!t.bubbles)return!0;if("relatedTarget"in t){var c=q(t) ,u=c.relatedTarget;if(u){if(u instanceof Object&&u.addEventListener){var p=V(u), d=l(t,e,p);if(d===a)return!0}else d=null;$.set(t,d)}}J.set(t,n);var f=t.type,h=! 1;Y.set(t,a),Z.set(t,e),i.depth++;for(var w=0,m=i.length;m>w;w++){var g=i[w];if( g.removed)h=!0;else if(!(g.type!==f||!g.capture&&n===ot||g.capture&&n===at))try{ if("function"==typeof g.handler?g.handler.call(e,t):g.handler.handleEvent(t),et. get(t))return!1}catch(v){W||(W=v)}}if(i.depth--,h&&0===i.depth){var b=i.slice(); i.length=0;for(var w=0;w<b.length;w++)b[w].removed||i.push(b[w])}return!Q.get(t) }function b(e,t,n){this.type=e,this.handler=t,this.capture=Boolean(n)}function y (e,t){if(!(e instanceof st))return V(T(st,"Event",e,t));var n=e;return vt||"befo reunload"!==n.type||this instanceof O?void B(n,this):new O(n)}function E(e){retu rn e&&e.relatedTarget?Object.create(e,{relatedTarget:{value:q(e.relatedTarget)}} ):e}function S(e,t,n){var r=window[e],o=function(t,n){return t instanceof r?void B(t,this):V(T(r,e,t,n))};if(o.prototype=Object.create(t.prototype),n&&k(o.proto type,n),r)try{F(r,o,new r("temp"))}catch(i){F(r,o,document.createEvent(e))}retur n o}function M(e,t){return function(){arguments[t]=q(arguments[t]);var n=q(this) ;n[e].apply(n,arguments)}}function T(e,t,n,r){if(mt)return new e(n,E(r));var o=q (document.createEvent(t)),i=wt[t],a=[n];return Object.keys(i).forEach(function(e ){var t=null!=r&&e in r?r[e]:i[e];"relatedTarget"===e&&(t=q(t)),a.push(t)}),o["i nit"+t].apply(o,a),o}function O(e){y.call(this,e)}function L(e){return"function" ==typeof e?!0:e&&e.handleEvent}function j(e){switch(e){case"DOMAttrModified":cas e"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameCha nged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemove d":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}f unction N(e){B(e,this)}function _(e){return e instanceof G.ShadowRoot&&(e=e.host ),q(e)}function C(e,t){var n=X.get(e);if(n)for(var r=0;r<n.length;r++)if(!n[r].r emoved&&n[r].type===t)return!0;return!1}function D(e,t){for(var n=q(e);n;n=n.par entNode)if(C(V(n),t))return!0;return!1}function H(e){A(e,yt)}function x(t,n,o,i) {e.renderAllPending();var a=V(Et.call(U(n),o,i));if(!a)return null;var c=r(a,nul l),u=c.lastIndexOf(t);return-1==u?null:(c=c.slice(0,u),s(c,t))}function R(e){ret urn function(){var t=tt.get(this);return t&&t[e]&&t[e].value||null}}function P(e ){var t=e.slice(2);return function(n){var r=tt.get(this);r||(r=Object.create(nul l),tt.set(this,r));var o=r[e];if(o&&this.removeEventListener(t,o.wrapped,!1),"fu nction"==typeof n){var i=function(t){var r=n.call(this,t);r===!1?t.preventDefaul t():"onbeforeunload"===e&&"string"==typeof r&&(t.returnValue=r)};this.addEventLi stener(t,i,!1),r[e]={value:n,wrapped:i}}}}var W,A=e.forwardMethodsToWrapper,I=e. getTreeScope,k=e.mixin,F=e.registerWrapper,B=e.setWrapper,U=e.unsafeUnwrap,q=e.u nwrap,V=e.wrap,G=e.wrappers,X=(new WeakMap,new WeakMap),z=new WeakMap,K=new Weak Map,Y=new WeakMap,Z=new WeakMap,$=new WeakMap,J=new WeakMap,Q=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,rt=0,ot=1,it=2,at=3;b.prototype={equals:f unction(e){return this.handler===e.handler&&this.type===e.type&&this.capture===e .capture},get removed(){return null===this.handler},remove:function(){this.handl er=null}};var st=window.Event;st.prototype.polymerBlackList_={returnValue:!0,key Location:!0},y.prototype={get target(){return Y.get(this)},get currentTarget(){r eturn Z.get(this)},get eventPhase(){return J.get(this)},get path(){var e=nt.get( this);return e?e.slice():[]},stopPropagation:function(){Q.set(this,!0)},stopImme diatePropagation:function(){Q.set(this,!0),et.set(this,!0)}},F(st,y,document.cre ateEvent("Event"));var ct=S("UIEvent",y),ut=S("CustomEvent",y),lt={get relatedTa rget(){var e=$.get(this);return void 0!==e?e:V(q(this).relatedTarget)}},pt=k({in itMouseEvent:M("initMouseEvent",14)},lt),dt=k({initFocusEvent:M("initFocusEvent" ,5)},lt),ft=S("MouseEvent",ct,pt),ht=S("FocusEvent",ct,dt),wt=Object.create(null ),mt=function(){try{new window.FocusEvent("focus")}catch(e){return!1}return!0}() ;if(!mt){var gt=function(e,t,n){if(n){var r=wt[n];t=k(k({},r),t)}wt[e]=t};gt("Ev ent",{bubbles:!1,cancelable:!1}),gt("CustomEvent",{detail:null},"Event"),gt("UIE vent",{view:null,detail:0},"Event"),gt("MouseEvent",{screenX:0,screenY:0,clientX :0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget: null},"UIEvent"),gt("FocusEvent",{relatedTarget:null},"UIEvent")}var vt=window.B eforeUnloadEvent;O.prototype=Object.create(y.prototype),k(O.prototype,{get retur nValue(){return U(this).returnValue},set returnValue(e){U(this).returnValue=e}}) ,vt&&F(vt,O);var bt=window.EventTarget,yt=["addEventListener","removeEventListen er","dispatchEvent"];[Node,Window].forEach(function(e){var t=e.prototype;yt.forE ach(function(e){Object.defineProperty(t,e+"_",{value:t[e]})})}),N.prototype={add EventListener:function(e,t,n){if(L(t)&&!j(e)){var r=new b(e,t,n),o=X.get(this);i f(o){for(var i=0;i<o.length;i++)if(r.equals(o[i]))return}else o=[],o.depth=0,X.s et(this,o);o.push(r);var a=_(this);a.addEventListener_(e,d,!0)}},removeEventList ener:function(e,t,n){n=Boolean(n);var r=X.get(this);if(r){for(var o=0,i=!1,a=0;a <r.length;a++)r[a].type===e&&r[a].capture===n&&(o++,r[a].handler===t&&(i=!0,r[a] .remove()));if(i&&1===o){var s=_(this);s.removeEventListener_(e,d,!0)}}},dispatc hEvent:function(t){var n=q(t),r=n.type;z.set(n,!1),e.renderAllPending();var o;D( this,r)||(o=function(){},this.addEventListener(r,o,!0));try{return q(this).dispa tchEvent_(n)}finally{o&&this.removeEventListener(r,o,!0)}}},bt&&F(bt,N);var Et=d ocument.elementFromPoint;e.elementFromPoint=x,e.getEventHandlerGetter=R,e.getEve ntHandlerSetter=P,e.wrapEventTargetMethods=H,e.wrappers.BeforeUnloadEvent=O,e.wr appers.CustomEvent=ut,e.wrappers.Event=y,e.wrappers.EventTarget=N,e.wrappers.Foc usEvent=ht,e.wrappers.MouseEvent=ft,e.wrappers.UIEvent=ct}(window.ShadowDOMPolyf ill),function(e){"use strict";function t(e,t){Object.defineProperty(e,t,w)}funct ion n(e){u(e,this)}function r(){this.length=0,t(this,"length")}function o(e){for (var t=new r,o=0;o<e.length;o++)t[o]=new n(e[o]);return t.length=o,t}function i( e){a.call(this,e)}var a=e.wrappers.UIEvent,s=e.mixin,c=e.registerWrapper,u=e.set Wrapper,l=e.unsafeUnwrap,p=e.wrap,d=window.TouchEvent;if(d){var f;try{f=document .createEvent("TouchEvent")}catch(h){return}var w={enumerable:!1};n.prototype={ge t target(){return p(l(this).target)}};var m={configurable:!0,enumerable:!0,get:n ull};["clientX","clientY","screenX","screenY","pageX","pageY","identifier","webk itRadiusX","webkitRadiusY","webkitRotationAngle","webkitForce"].forEach(function (e){m.get=function(){return l(this)[e]},Object.defineProperty(n.prototype,e,m)}) ,r.prototype={item:function(e){return this[e]}},i.prototype=Object.create(a.prot otype),s(i.prototype,{get touches(){return o(l(this).touches)},get targetTouches (){return o(l(this).targetTouches)},get changedTouches(){return o(l(this).change dTouches)},initTouchEvent:function(){throw new Error("Not implemented")}}),c(d,i ,f),e.wrappers.Touch=n,e.wrappers.TouchEvent=i,e.wrappers.TouchList=r}}(window.S hadowDOMPolyfill),function(e){"use strict";function t(e,t){Object.defineProperty (e,t,s)}function n(){this.length=0,t(this,"length")}function r(e){if(null==e)ret urn e;for(var t=new n,r=0,o=e.length;o>r;r++)t[r]=a(e[r]);return t.length=o,t}fu nction o(e,t){e.prototype[t]=function(){return r(i(this)[t].apply(i(this),argume nts))}}var i=e.unsafeUnwrap,a=e.wrap,s={enumerable:!1};n.prototype={item:functio n(e){return this[e]}},t(n.prototype,"item"),e.wrappers.NodeList=n,e.addWrapNodeL istMethod=o,e.wrapNodeList=r}(window.ShadowDOMPolyfill),function(e){"use strict" ;e.wrapHTMLCollection=e.wrapNodeList,e.wrappers.HTMLCollection=e.wrappers.NodeLi st}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){L(e instanc eof S)}function n(e){var t=new T;return t[0]=e,t.length=1,t}function r(e,t,n){N( t,"childList",{removedNodes:n,previousSibling:e.previousSibling,nextSibling:e.ne xtSibling})}function o(e,t){N(e,"childList",{removedNodes:t})}function i(e,t,r,o ){if(e instanceof DocumentFragment){var i=s(e);B=!0;for(var a=i.length-1;a>=0;a- -)e.removeChild(i[a]),i[a].parentNode_=t;B=!1;for(var a=0;a<i.length;a++)i[a].pr eviousSibling_=i[a-1]||r,i[a].nextSibling_=i[a+1]||o;return r&&(r.nextSibling_=i [0]),o&&(o.previousSibling_=i[i.length-1]),i}var i=n(e),c=e.parentNode;return c& &c.removeChild(e),e.parentNode_=t,e.previousSibling_=r,e.nextSibling_=o,r&&(r.ne xtSibling_=e),o&&(o.previousSibling_=e),i}function a(e){if(e instanceof Document Fragment)return s(e);var t=n(e),o=e.parentNode;return o&&r(e,o,t),t}function s(e ){for(var t=new T,n=0,r=e.firstChild;r;r=r.nextSibling)t[n++]=r;return t.length= n,o(e,t),t}function c(e){return e}function u(e,t){R(e,t),e.nodeIsInserted_()}fun ction l(e,t){for(var n=_(t),r=0;r<e.length;r++)u(e[r],n)}function p(e){R(e,new O (e,null))}function d(e){for(var t=0;t<e.length;t++)p(e[t])}function f(e,t){var n =e.nodeType===S.DOCUMENT_NODE?e:e.ownerDocument;n!==t.ownerDocument&&n.adoptNode (t)}function h(t,n){if(n.length){var r=t.ownerDocument;if(r!==n[0].ownerDocument )for(var o=0;o<n.length;o++)e.adoptNodeNoRemove(n[o],r)}}function w(e,t){h(e,t); var n=t.length;if(1===n)return W(t[0]);for(var r=W(e.ownerDocument.createDocumen tFragment()),o=0;n>o;o++)r.appendChild(W(t[o]));return r}function m(e){if(void 0 !==e.firstChild_)for(var t=e.firstChild_;t;){var n=t;t=t.nextSibling_,n.parentNo de_=n.previousSibling_=n.nextSibling_=void 0}e.firstChild_=e.lastChild_=void 0}f unction g(e){if(e.invalidateShadowRenderer()){for(var t=e.firstChild;t;){L(t.par entNode===e);var n=t.nextSibling,r=W(t),o=r.parentNode;o&&K.call(o,r),t.previous Sibling_=t.nextSibling_=t.parentNode_=null,t=n}e.firstChild_=e.lastChild_=null}e lse for(var n,i=W(e),a=i.firstChild;a;)n=a.nextSibling,K.call(i,a),a=n}function v(e){var t=e.parentNode;return t&&t.invalidateShadowRenderer()}function b(e){for (var t,n=0;n<e.length;n++)t=e[n],t.parentNode.removeChild(t)}function y(e,t,n){v ar r;if(r=I(n?U.call(n,P(e),!1):q.call(P(e),!1)),t){for(var o=e.firstChild;o;o=o .nextSibling)r.appendChild(y(o,!0,n));if(e instanceof F.HTMLTemplateElement)for( var i=r.content,o=e.content.firstChild;o;o=o.nextSibling)i.appendChild(y(o,!0,n) )}return r}function E(e,t){if(!t||_(e)!==_(t))return!1;for(var n=t;n;n=n.parentN ode)if(n===e)return!0;return!1}function S(e){L(e instanceof V),M.call(this,e),th is.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSi bling_=void 0,this.previousSibling_=void 0,this.treeScope_=void 0}var M=e.wrappe rs.EventTarget,T=e.wrappers.NodeList,O=e.TreeScope,L=e.assert,j=e.defineWrapGett er,N=e.enqueueMutation,_=e.getTreeScope,C=e.isWrapper,D=e.mixin,H=e.registerTran sientObservers,x=e.registerWrapper,R=e.setTreeScope,P=e.unsafeUnwrap,W=e.unwrap, A=e.unwrapIfNeeded,I=e.wrap,k=e.wrapIfNeeded,F=e.wrappers,B=!1,U=document.import Node,q=window.Node.prototype.cloneNode,V=window.Node,G=window.DocumentFragment,X =(V.prototype.appendChild,V.prototype.compareDocumentPosition),z=V.prototype.ins ertBefore,K=V.prototype.removeChild,Y=V.prototype.replaceChild,Z=/Trident|Edge/. test(navigator.userAgent),$=Z?function(e,t){try{K.call(e,t)}catch(n){if(!(e inst anceof G))throw n}}:function(e,t){K.call(e,t)};S.prototype=Object.create(M.proto type),D(S.prototype,{appendChild:function(e){return this.insertBefore(e,null)},i nsertBefore:function(e,n){t(e);var r;n?C(n)?r=W(n):(r=n,n=I(r)):(n=null,r=null), n&&L(n.parentNode===this);var o,s=n?n.previousSibling:this.lastChild,c=!this.inv alidateShadowRenderer()&&!v(e);if(o=c?a(e):i(e,this,s,n),c)f(this,e),m(this),z.c all(P(this),W(e),r);else{s||(this.firstChild_=o[0]),n||(this.lastChild_=o[o.leng th-1],void 0===this.firstChild_&&(this.firstChild_=this.firstChild));var u=r?r.p arentNode:P(this);u?z.call(u,w(this,o),r):h(this,o)}return N(this,"childList",{a ddedNodes:o,nextSibling:n,previousSibling:s}),l(o,this),e},removeChild:function( e){if(t(e),e.parentNode!==this){for(var r=!1,o=(this.childNodes,this.firstChild) ;o;o=o.nextSibling)if(o===e){r=!0;break}if(!r)throw new Error("NotFoundError")}v ar i=W(e),a=e.nextSibling,s=e.previousSibling;if(this.invalidateShadowRenderer() ){var c=this.firstChild,u=this.lastChild,l=i.parentNode;l&&$(l,i),c===e&&(this.f irstChild_=a),u===e&&(this.lastChild_=s),s&&(s.nextSibling_=a),a&&(a.previousSib ling_=s),e.previousSibling_=e.nextSibling_=e.parentNode_=void 0}else m(this),$(P (this),i);return B||N(this,"childList",{removedNodes:n(e),nextSibling:a,previous Sibling:s}),H(this,e),e},replaceChild:function(e,r){t(e);var o;if(C(r)?o=W(r):(o =r,r=I(o)),r.parentNode!==this)throw new Error("NotFoundError");var s,c=r.nextSi bling,u=r.previousSibling,d=!this.invalidateShadowRenderer()&&!v(e);return d?s=a (e):(c===e&&(c=e.nextSibling),s=i(e,this,u,c)),d?(f(this,e),m(this),Y.call(P(thi s),W(e),o)):(this.firstChild===r&&(this.firstChild_=s[0]),this.lastChild===r&&(t his.lastChild_=s[s.length-1]),r.previousSibling_=r.nextSibling_=r.parentNode_=vo id 0,o.parentNode&&Y.call(o.parentNode,w(this,s),o)),N(this,"childList",{addedNo des:s,removedNodes:n(r),nextSibling:c,previousSibling:u}),p(r),l(s,this),r},node IsInserted_:function(){for(var e=this.firstChild;e;e=e.nextSibling)e.nodeIsInser ted_()},hasChildNodes:function(){return null!==this.firstChild},get parentNode() {return void 0!==this.parentNode_?this.parentNode_:I(P(this).parentNode)},get fi rstChild(){return void 0!==this.firstChild_?this.firstChild_:I(P(this).firstChil d)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:I(P(this).la stChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_: I(P(this).nextSibling)},get previousSibling(){return void 0!==this.previousSibli ng_?this.previousSibling_:I(P(this).previousSibling)},get parentElement(){for(va r e=this.parentNode;e&&e.nodeType!==S.ELEMENT_NODE;)e=e.parentNode;return e},get textContent(){for(var e="",t=this.firstChild;t;t=t.nextSibling)t.nodeType!=S.CO MMENT_NODE&&(e+=t.textContent);return e},set textContent(e){null==e&&(e="");var t=c(this.childNodes);if(this.invalidateShadowRenderer()){if(g(this),""!==e){var n=P(this).ownerDocument.createTextNode(e);this.appendChild(n)}}else m(this),P(th is).textContent=e;var r=c(this.childNodes);N(this,"childList",{addedNodes:r,remo vedNodes:t}),d(t),l(r,this)},get childNodes(){for(var e=new T,t=0,n=this.firstCh ild;n;n=n.nextSibling)e[t++]=n;return e.length=t,e},cloneNode:function(e){return y(this,e)},contains:function(e){return E(this,k(e))},compareDocumentPosition:fu nction(e){return X.call(P(this),A(e))},normalize:function(){for(var e,t,n=c(this .childNodes),r=[],o="",i=0;i<n.length;i++)t=n[i],t.nodeType===S.TEXT_NODE?e||t.d ata.length?e?(o+=t.data,r.push(t)):e=t:this.removeChild(t):(e&&r.length&&(e.data +=o,b(r)),r=[],o="",e=null,t.childNodes.length&&t.normalize());e&&r.length&&(e.d ata+=o,b(r))}}),j(S,"ownerDocument"),x(V,S,document.createDocumentFragment()),de lete S.prototype.querySelector,delete S.prototype.querySelectorAll,S.prototype=D (Object.create(M.prototype),S.prototype),e.cloneNode=y,e.nodeWasAdded=u,e.nodeWa sRemoved=p,e.nodesWereAdded=l,e.nodesWereRemoved=d,e.originalInsertBefore=z,e.or iginalRemoveChild=K,e.snapshotNodeList=c,e.wrappers.Node=S}(window.ShadowDOMPoly fill),function(e){"use strict";function t(t,n,r,o){for(var i=null,a=null,s=0,c=t .length;c>s;s++)i=v(t[s]),!o&&(a=m(i).root)&&a instanceof e.wrappers.ShadowRoot| |(r[n++]=i);return n}function n(e){return String(e).replace(/\/deep\//g," ")}fun ction r(e,t){for(var n,o=e.firstElementChild;o;){if(o.matches(t))return o;if(n=r (o,t))return n;o=o.nextElementSibling}return null}function o(e,t){return e.match es(t)}function i(e,t,n){var r=e.localName;return r===t||r===n&&e.namespaceURI=== _}function a(){return!0}function s(e,t,n){return e.localName===n}function c(e,t) {return e.namespaceURI===t}function u(e,t,n){return e.namespaceURI===t&&e.localN ame===n}function l(e,t,n,r,o,i){for(var a=e.firstElementChild;a;)r(a,o,i)&&(n[t+ +]=a),t=l(a,t,n,r,o,i),a=a.nextElementSibling;return t}function p(n,r,o,i,a){var s,c=g(this),u=m(this).root;if(u instanceof e.wrappers.ShadowRoot)return l(this, r,o,n,i,null);if(c instanceof j)s=S.call(c,i);else{if(!(c instanceof N))return l (this,r,o,n,i,null);s=E.call(c,i)}return t(s,r,o,a)}function d(n,r,o,i,a){var s, c=g(this),u=m(this).root;if(u instanceof e.wrappers.ShadowRoot)return l(this,r,o ,n,i,a);if(c instanceof j)s=T.call(c,i,a);else{if(!(c instanceof N))return l(thi s,r,o,n,i,a);s=M.call(c,i,a)}return t(s,r,o,!1)}function f(n,r,o,i,a){var s,c=g( this),u=m(this).root;if(u instanceof e.wrappers.ShadowRoot)return l(this,r,o,n,i ,a);if(c instanceof j)s=L.call(c,i,a);else{if(!(c instanceof N))return l(this,r, o,n,i,a);s=O.call(c,i,a)}return t(s,r,o,!1)}var h=e.wrappers.HTMLCollection,w=e. wrappers.NodeList,m=e.getTreeScope,g=e.unsafeUnwrap,v=e.wrap,b=document.querySel ector,y=document.documentElement.querySelector,E=document.querySelectorAll,S=doc ument.documentElement.querySelectorAll,M=document.getElementsByTagName,T=documen t.documentElement.getElementsByTagName,O=document.getElementsByTagNameNS,L=docum ent.documentElement.getElementsByTagNameNS,j=window.Element,N=window.HTMLDocumen t||window.Document,_="http://www.w3.org/1999/xhtml",C={querySelector:function(t) {var o=n(t),i=o!==t;t=o;var a,s=g(this),c=m(this).root;if(c instanceof e.wrapper s.ShadowRoot)return r(this,t);if(s instanceof j)a=v(y.call(s,t));else{if(!(s ins tanceof N))return r(this,t);a=v(b.call(s,t))}return a&&!i&&(c=m(a).root)&&c inst anceof e.wrappers.ShadowRoot?r(this,t):a},querySelectorAll:function(e){var t=n(e ),r=t!==e;e=t;var i=new w;return i.length=p.call(this,o,0,i,e,r),i}},D={getEleme ntsByTagName:function(e){var t=new h,n="*"===e?a:i;return t.length=d.call(this,n ,0,t,e,e.toLowerCase()),t},getElementsByClassName:function(e){return this.queryS electorAll("."+e)},getElementsByTagNameNS:function(e,t){var n=new h,r=null;retur n r="*"===e?"*"===t?a:s:"*"===t?c:u,n.length=f.call(this,r,0,n,e||null,t),n}};e. GetElementsByInterface=D,e.SelectorsInterface=C}(window.ShadowDOMPolyfill),funct ion(e){"use strict";function t(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.ne xtSibling;return e}function n(e){for(;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.pre viousSibling;return e}var r=e.wrappers.NodeList,o={get firstElementChild(){retur n t(this.firstChild)},get lastElementChild(){return n(this.lastChild)},get child ElementCount(){for(var e=0,t=this.firstElementChild;t;t=t.nextElementSibling)e++ ;return e},get children(){for(var e=new r,t=0,n=this.firstElementChild;n;n=n.nex tElementSibling)e[t++]=n;return e.length=t,e},remove:function(){var e=this.paren tNode;
12 e&&e.removeChild(this)}},i={get nextElementSibling(){return t(this.nextSibling)} ,get previousElementSibling(){return n(this.previousSibling)}};e.ChildNodeInterf ace=i,e.ParentNodeInterface=o}(window.ShadowDOMPolyfill),function(e){"use strict ";function t(e){r.call(this,e)}var n=e.ChildNodeInterface,r=e.wrappers.Node,o=e. enqueueMutation,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=window.Characte rData;t.prototype=Object.create(r.prototype),i(t.prototype,{get textContent(){re turn this.data},set textContent(e){this.data=e},get data(){return s(this).data}, set data(e){var t=s(this).data;o(this,"characterData",{oldValue:t}),s(this).data =e}}),i(t.prototype,n),a(c,t,document.createTextNode("")),e.wrappers.CharacterDa ta=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){return e> >>0}function n(e){r.call(this,e)}var r=e.wrappers.CharacterData,o=(e.enqueueMuta tion,e.mixin),i=e.registerWrapper,a=window.Text;n.prototype=Object.create(r.prot otype),o(n.prototype,{splitText:function(e){e=t(e);var n=this.data;if(e>n.length )throw new Error("IndexSizeError");var r=n.slice(0,e),o=n.slice(e);this.data=r;v ar i=this.ownerDocument.createTextNode(o);return this.parentNode&&this.parentNod e.insertBefore(i,this.nextSibling),i}}),i(a,n,document.createTextNode("")),e.wra ppers.Text=n}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r eturn i(e).getAttribute("class")}function n(e,t){a(e,"attributes",{name:"class", namespace:null,oldValue:t})}function r(t){e.invalidateRendererBasedOnAttribute(t ,"class")}function o(e,o,i){var a=e.ownerElement_;if(null==a)return o.apply(e,i) ;var s=t(a),c=o.apply(e,i);return t(a)!==s&&(n(a,s),r(a)),c}var i=e.unsafeUnwrap ,a=e.enqueueMutation,s=DOMTokenList.prototype.add;DOMTokenList.prototype.add=fun ction(){o(this,s,arguments)};var c=DOMTokenList.prototype.remove;DOMTokenList.pr ototype.remove=function(){o(this,c,arguments)};var u=DOMTokenList.prototype.togg le;DOMTokenList.prototype.toggle=function(){return o(this,u,arguments)}}(window. ShadowDOMPolyfill),function(e){"use strict";function t(t,n){var r=t.parentNode;i f(r&&r.shadowRoot){var o=e.getRendererForHost(r);o.dependsOnAttribute(n)&&o.inva lidate()}}function n(e,t,n){u(e,"attributes",{name:t,namespace:null,oldValue:n}) }function r(e){a.call(this,e)}var o=e.ChildNodeInterface,i=e.GetElementsByInterf ace,a=e.wrappers.Node,s=e.ParentNodeInterface,c=e.SelectorsInterface,u=(e.addWra pNodeListMethod,e.enqueueMutation),l=e.mixin,p=(e.oneOf,e.registerWrapper),d=e.u nsafeUnwrap,f=e.wrappers,h=window.Element,w=["matches","mozMatchesSelector","msM atchesSelector","webkitMatchesSelector"].filter(function(e){return h.prototype[e ]}),m=w[0],g=h.prototype[m],v=new WeakMap;r.prototype=Object.create(a.prototype) ,l(r.prototype,{createShadowRoot:function(){var t=new f.ShadowRoot(this);d(this) .polymerShadowRoot_=t;var n=e.getRendererForHost(this);return n.invalidate(),t}, get shadowRoot(){return d(this).polymerShadowRoot_||null},setAttribute:function( e,r){var o=d(this).getAttribute(e);d(this).setAttribute(e,r),n(this,e,o),t(this, e)},removeAttribute:function(e){var r=d(this).getAttribute(e);d(this).removeAttr ibute(e),n(this,e,r),t(this,e)},matches:function(e){return g.call(d(this),e)},ge t classList(){var e=v.get(this);return e||(e=d(this).classList,e.ownerElement_=t his,v.set(this,e)),e},get className(){return d(this).className},set className(e) {this.setAttribute("class",e)},get id(){return d(this).id},set id(e){this.setAtt ribute("id",e)}}),w.forEach(function(e){"matches"!==e&&(r.prototype[e]=function( e){return this.matches(e)})}),h.prototype.webkitCreateShadowRoot&&(r.prototype.w ebkitCreateShadowRoot=r.prototype.createShadowRoot),l(r.prototype,o),l(r.prototy pe,i),l(r.prototype,s),l(r.prototype,c),p(h,r,document.createElementNS(null,"x") ),e.invalidateRendererBasedOnAttribute=t,e.matchesNames=w,e.wrappers.Element=r}( window.ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e){case" &":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot; ";case" ":return"&nbsp;"}}function n(e){return e.replace(L,t)}function r(e){retu rn e.replace(j,t)}function o(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;retur n t}function i(e,t){switch(e.nodeType){case Node.ELEMENT_NODE:for(var o,i=e.tagN ame.toLowerCase(),s="<"+i,c=e.attributes,u=0;o=c[u];u++)s+=" "+o.name+'="'+n(o.v alue)+'"';return s+=">",N[i]?s:s+a(e)+"</"+i+">";case Node.TEXT_NODE:var l=e.dat a;return t&&_[t.localName]?l:r(l);case Node.COMMENT_NODE:return"<!--"+e.data+"-- >";default:throw console.error(e),new Error("not implemented")}}function a(e){e instanceof O.HTMLTemplateElement&&(e=e.content);for(var t="",n=e.firstChild;n;n= n.nextSibling)t+=i(n,e);return t}function s(e,t,n){var r=n||"div";e.textContent= "";var o=M(e.ownerDocument.createElement(r));o.innerHTML=t;for(var i;i=o.firstCh ild;)e.appendChild(T(i))}function c(e){h.call(this,e)}function u(e,t){var n=M(e. cloneNode(!1));n.innerHTML=t;for(var r,o=M(document.createDocumentFragment());r= n.firstChild;)o.appendChild(r);return T(o)}function l(t){return function(){retur n e.renderAllPending(),S(this)[t]}}function p(e){w(c,e,l(e))}function d(t){Objec t.defineProperty(c.prototype,t,{get:l(t),set:function(n){e.renderAllPending(),S( this)[t]=n},configurable:!0,enumerable:!0})}function f(t){Object.defineProperty( c.prototype,t,{value:function(){return e.renderAllPending(),S(this)[t].apply(S(t his),arguments)},configurable:!0,enumerable:!0})}var h=e.wrappers.Element,w=e.de fineGetter,m=e.enqueueMutation,g=e.mixin,v=e.nodesWereAdded,b=e.nodesWereRemoved ,y=e.registerWrapper,E=e.snapshotNodeList,S=e.unsafeUnwrap,M=e.unwrap,T=e.wrap,O =e.wrappers,L=/[&\u00A0"]/g,j=/[&\u00A0<>]/g,N=o(["area","base","br","col","comm and","embed","hr","img","input","keygen","link","meta","param","source","track", "wbr"]),_=o(["style","script","xmp","iframe","noembed","noframes","plaintext","n oscript"]),C=/MSIE/.test(navigator.userAgent),D=window.HTMLElement,H=window.HTML TemplateElement;c.prototype=Object.create(h.prototype),g(c.prototype,{get innerH TML(){return a(this)},set innerHTML(e){if(C&&_[this.localName])return void(this. textContent=e);var t=E(this.childNodes);this.invalidateShadowRenderer()?this ins tanceof O.HTMLTemplateElement?s(this.content,e):s(this,e,this.tagName):!H&&this instanceof O.HTMLTemplateElement?s(this.content,e):S(this).innerHTML=e;var n=E(t his.childNodes);m(this,"childList",{addedNodes:n,removedNodes:t}),b(t),v(n,this) },get outerHTML(){return i(this,this.parentNode)},set outerHTML(e){var t=this.pa rentNode;if(t){t.invalidateShadowRenderer();var n=u(t,e);t.replaceChild(n,this)} },insertAdjacentHTML:function(e,t){var n,r;switch(String(e).toLowerCase()){case" beforebegin":n=this.parentNode,r=this;break;case"afterend":n=this.parentNode,r=t his.nextSibling;break;case"afterbegin":n=this,r=this.firstChild;break;case"befor eend":n=this,r=null;break;default:return}var o=u(n,t);n.insertBefore(o,r)},get h idden(){return this.hasAttribute("hidden")},set hidden(e){e?this.setAttribute("h idden",""):this.removeAttribute("hidden")}}),["clientHeight","clientLeft","clien tTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrol lHeight","scrollWidth"].forEach(p),["scrollLeft","scrollTop"].forEach(d),["getBo undingClientRect","getClientRects","scrollIntoView"].forEach(f),y(D,c,document.c reateElement("b")),e.wrappers.HTMLElement=c,e.getInnerHTML=a,e.setInnerHTML=s}(w indow.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}v ar n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.w rap,s=window.HTMLCanvasElement;t.prototype=Object.create(n.prototype),r(t.protot ype,{getContext:function(){var e=i(this).getContext.apply(i(this),arguments);ret urn e&&a(e)}}),o(s,t,document.createElement("canvas")),e.wrappers.HTMLCanvasElem ent=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(t his,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=window.HTMLC ontentElement;t.prototype=Object.create(n.prototype),r(t.prototype,{constructor: t,get select(){return this.getAttribute("select")},set select(e){this.setAttribu te("select",e)},setAttribute:function(e,t){n.prototype.setAttribute.call(this,e, t),"select"===String(e).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),i&&o (i,t),e.wrappers.HTMLContentElement=t}(window.ShadowDOMPolyfill),function(e){"us e strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mixin,o= e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=window.HTMLFormElement;t.p rototype=Object.create(n.prototype),r(t.prototype,{get elements(){return i(a(thi s).elements)}}),o(s,t,document.createElement("form")),e.wrappers.HTMLFormElement =t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.call(this ,e)}function n(e,t){if(!(this instanceof n))throw new TypeError("DOM object cons tructor cannot be called as a function.");var o=i(document.createElement("img")) ;r.call(this,o),a(o,this),void 0!==e&&(o.width=e),void 0!==t&&(o.height=t)}var r =e.wrappers.HTMLElement,o=e.registerWrapper,i=e.unwrap,a=e.rewrap,s=window.HTMLI mageElement;t.prototype=Object.create(r.prototype),o(s,t,document.createElement( "img")),n.prototype=t.prototype,e.wrappers.HTMLImageElement=t,e.wrappers.Image=n }(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e )}var n=e.wrappers.HTMLElement,r=(e.mixin,e.wrappers.NodeList,e.registerWrapper) ,o=window.HTMLShadowElement;t.prototype=Object.create(n.prototype),t.prototype.c onstructor=t,o&&r(o,t),e.wrappers.HTMLShadowElement=t}(window.ShadowDOMPolyfill) ,function(e){"use strict";function t(e){if(!e.defaultView)return e;var t=p.get(e );if(!t){for(t=e.implementation.createHTMLDocument("");t.lastChild;)t.removeChil d(t.lastChild);p.set(e,t)}return t}function n(e){for(var n,r=t(e.ownerDocument), o=c(r.createDocumentFragment());n=e.firstChild;)o.appendChild(n);return o}functi on r(e){if(o.call(this,e),!d){var t=n(e);l.set(this,u(t))}}var o=e.wrappers.HTML Element,i=e.mixin,a=e.registerWrapper,s=e.unsafeUnwrap,c=e.unwrap,u=e.wrap,l=new WeakMap,p=new WeakMap,d=window.HTMLTemplateElement;r.prototype=Object.create(o. prototype),i(r.prototype,{constructor:r,get content(){return d?u(s(this).content ):l.get(this)}}),d&&a(d,r),e.wrappers.HTMLTemplateElement=r}(window.ShadowDOMPol yfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HT MLElement,r=e.registerWrapper,o=window.HTMLMediaElement;o&&(t.prototype=Object.c reate(n.prototype),r(o,t,document.createElement("audio")),e.wrappers.HTMLMediaEl ement=t)}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){r.cal l(this,e)}function n(e){if(!(this instanceof n))throw new TypeError("DOM object constructor cannot be called as a function.");var t=i(document.createElement("au dio"));r.call(this,t),a(t,this),t.setAttribute("preload","auto"),void 0!==e&&t.s etAttribute("src",e)}var r=e.wrappers.HTMLMediaElement,o=e.registerWrapper,i=e.u nwrap,a=e.rewrap,s=window.HTMLAudioElement;s&&(t.prototype=Object.create(r.proto type),o(s,t,document.createElement("audio")),n.prototype=t.prototype,e.wrappers. HTMLAudioElement=t,e.wrappers.Audio=n)}(window.ShadowDOMPolyfill),function(e){"u se strict";function t(e){return e.replace(/\s+/g," ").trim()}function n(e){o.cal l(this,e)}function r(e,t,n,i){if(!(this instanceof r))throw new TypeError("DOM o bject constructor cannot be called as a function.");var a=c(document.createEleme nt("option"));o.call(this,a),s(a,this),void 0!==e&&(a.text=e),void 0!==t&&a.setA ttribute("value",t),n===!0&&a.setAttribute("selected",""),a.selected=i===!0}var o=e.wrappers.HTMLElement,i=e.mixin,a=e.registerWrapper,s=e.rewrap,c=e.unwrap,u=e .wrap,l=window.HTMLOptionElement;n.prototype=Object.create(o.prototype),i(n.prot otype,{get text(){return t(this.textContent)},set text(e){this.textContent=t(Str ing(e))},get form(){return u(c(this).form)}}),a(l,n,document.createElement("opti on")),r.prototype=n.prototype,e.wrappers.HTMLOptionElement=n,e.wrappers.Option=r }(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e )}var n=e.wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap ,s=window.HTMLSelectElement;t.prototype=Object.create(n.prototype),r(t.prototype ,{add:function(e,t){"object"==typeof t&&(t=i(t)),i(this).add(i(e),t)},remove:fun ction(e){return void 0===e?void n.prototype.remove.call(this):("object"==typeof e&&(e=i(e)),void i(this).remove(e))},get form(){return a(i(this).form)}}),o(s,t, document.createElement("select")),e.wrappers.HTMLSelectElement=t}(window.ShadowD OMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappe rs.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.unwrap,a=e.wrap,s=e.wrapHTMLCol lection,c=window.HTMLTableElement;t.prototype=Object.create(n.prototype),r(t.pro totype,{get caption(){return a(i(this).caption)},createCaption:function(){return a(i(this).createCaption())},get tHead(){return a(i(this).tHead)},createTHead:fu nction(){return a(i(this).createTHead())},createTFoot:function(){return a(i(this ).createTFoot())},get tFoot(){return a(i(this).tFoot)},get tBodies(){return s(i( this).tBodies)},createTBody:function(){return a(i(this).createTBody())},get rows (){return s(i(this).rows)},insertRow:function(e){return a(i(this).insertRow(e))} }),o(c,t,document.createElement("table")),e.wrappers.HTMLTableElement=t}(window. ShadowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e .wrappers.HTMLElement,r=e.mixin,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.u nwrap,s=e.wrap,c=window.HTMLTableSectionElement;t.prototype=Object.create(n.prot otype),r(t.prototype,{constructor:t,get rows(){return i(a(this).rows)},insertRow :function(e){return s(a(this).insertRow(e))}}),o(c,t,document.createElement("the ad")),e.wrappers.HTMLTableSectionElement=t}(window.ShadowDOMPolyfill),function(e ){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.HTMLElement,r=e.mix in,o=e.registerWrapper,i=e.wrapHTMLCollection,a=e.unwrap,s=e.wrap,c=window.HTMLT ableRowElement;t.prototype=Object.create(n.prototype),r(t.prototype,{get cells() {return i(a(this).cells)},insertCell:function(e){return s(a(this).insertCell(e)) }}),o(c,t,document.createElement("tr")),e.wrappers.HTMLTableRowElement=t}(window .ShadowDOMPolyfill),function(e){"use strict";function t(e){switch(e.localName){c ase"content":return new n(e);case"shadow":return new o(e);case"template":return new i(e)}r.call(this,e)}var n=e.wrappers.HTMLContentElement,r=e.wrappers.HTMLEle ment,o=e.wrappers.HTMLShadowElement,i=e.wrappers.HTMLTemplateElement,a=(e.mixin, e.registerWrapper),s=window.HTMLUnknownElement;t.prototype=Object.create(r.proto type),a(s,t),e.wrappers.HTMLUnknownElement=t}(window.ShadowDOMPolyfill),function (e){"use strict";var t=e.wrappers.Element,n=e.wrappers.HTMLElement,r=e.registerO bject,o="http://www.w3.org/2000/svg",i=document.createElementNS(o,"title"),a=r(i ),s=Object.getPrototypeOf(a.prototype).constructor;if(!("classList"in i)){var c= Object.getOwnPropertyDescriptor(t.prototype,"classList");Object.defineProperty(n .prototype,"classList",c),delete t.prototype.classList}e.wrappers.SVGElement=s}( window.ShadowDOMPolyfill),function(e){"use strict";function t(e){d.call(this,e)} var n=e.mixin,r=e.registerWrapper,o=e.unwrap,i=e.wrap,a=window.SVGUseElement,s=" http://www.w3.org/2000/svg",c=i(document.createElementNS(s,"g")),u=document.crea teElementNS(s,"use"),l=c.constructor,p=Object.getPrototypeOf(l.prototype),d=p.co nstructor;t.prototype=Object.create(p),"instanceRoot"in u&&n(t.prototype,{get in stanceRoot(){return i(o(this).instanceRoot)},get animatedInstanceRoot(){return i (o(this).animatedInstanceRoot)}}),r(a,t,u),e.wrappers.SVGUseElement=t}(window.Sh adowDOMPolyfill),function(e){"use strict";function t(e){n.call(this,e)}var n=e.w rappers.EventTarget,r=e.mixin,o=e.registerWrapper,i=e.unsafeUnwrap,a=e.wrap,s=wi ndow.SVGElementInstance;s&&(t.prototype=Object.create(n.prototype),r(t.prototype ,{get correspondingElement(){return a(i(this).correspondingElement)},get corresp ondingUseElement(){return a(i(this).correspondingUseElement)},get parentNode(){r eturn a(i(this).parentNode)},get childNodes(){throw new Error("Not implemented") },get firstChild(){return a(i(this).firstChild)},get lastChild(){return a(i(this ).lastChild)},get previousSibling(){return a(i(this).previousSibling)},get nextS ibling(){return a(i(this).nextSibling)}}),o(s,t),e.wrappers.SVGElementInstance=t )}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e,this)}va r n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unwrap,s=e.u nwrapIfNeeded,c=e.wrap,u=window.CanvasRenderingContext2D;n(t.prototype,{get canv as(){return c(i(this).canvas)},drawImage:function(){arguments[0]=s(arguments[0]) ,i(this).drawImage.apply(i(this),arguments)},createPattern:function(){return arg uments[0]=a(arguments[0]),i(this).createPattern.apply(i(this),arguments)}}),r(u, t,document.createElement("canvas").getContext("2d")),e.wrappers.CanvasRenderingC ontext2D=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){o(e ,this)}var n=e.mixin,r=e.registerWrapper,o=e.setWrapper,i=e.unsafeUnwrap,a=e.unw rapIfNeeded,s=e.wrap,c=window.WebGLRenderingContext;if(c){n(t.prototype,{get can vas(){return s(i(this).canvas)},texImage2D:function(){arguments[5]=a(arguments[5 ]),i(this).texImage2D.apply(i(this),arguments)},texSubImage2D:function(){argumen ts[6]=a(arguments[6]),i(this).texSubImage2D.apply(i(this),arguments)}});var u=/W ebKit/.test(navigator.userAgent)?{drawingBufferHeight:null,drawingBufferWidth:nu ll}:{};r(c,t,u),e.wrappers.WebGLRenderingContext=t}}(window.ShadowDOMPolyfill),f unction(e){"use strict";function t(e){r(e,this)}var n=e.registerWrapper,r=e.setW rapper,o=e.unsafeUnwrap,i=e.unwrap,a=e.unwrapIfNeeded,s=e.wrap,c=window.Range;t. prototype={get startContainer(){return s(o(this).startContainer)},get endContain er(){return s(o(this).endContainer)},get commonAncestorContainer(){return s(o(th is).commonAncestorContainer)},setStart:function(e,t){o(this).setStart(a(e),t)},s etEnd:function(e,t){o(this).setEnd(a(e),t)},setStartBefore:function(e){o(this).s etStartBefore(a(e))},setStartAfter:function(e){o(this).setStartAfter(a(e))},setE ndBefore:function(e){o(this).setEndBefore(a(e))},setEndAfter:function(e){o(this) .setEndAfter(a(e))},selectNode:function(e){o(this).selectNode(a(e))},selectNodeC ontents:function(e){o(this).selectNodeContents(a(e))},compareBoundaryPoints:func tion(e,t){return o(this).compareBoundaryPoints(e,i(t))},extractContents:function (){return s(o(this).extractContents())},cloneContents:function(){return s(o(this ).cloneContents())},insertNode:function(e){o(this).insertNode(a(e))},surroundCon tents:function(e){o(this).surroundContents(a(e))},cloneRange:function(){return s (o(this).cloneRange())},isPointInRange:function(e,t){return o(this).isPointInRan ge(a(e),t)},comparePoint:function(e,t){return o(this).comparePoint(a(e),t)},inte rsectsNode:function(e){return o(this).intersectsNode(a(e))},toString:function(){ return o(this).toString()}},c.prototype.createContextualFragment&&(t.prototype.c reateContextualFragment=function(e){return s(o(this).createContextualFragment(e) )}),n(window.Range,t,document.createRange()),e.wrappers.Range=t}(window.ShadowDO MPolyfill),function(e){"use strict";var t=e.GetElementsByInterface,n=e.ParentNod eInterface,r=e.SelectorsInterface,o=e.mixin,i=e.registerObject,a=i(document.crea teDocumentFragment());o(a.prototype,n),o(a.prototype,r),o(a.prototype,t);var s=i (document.createComment(""));e.wrappers.Comment=s,e.wrappers.DocumentFragment=a} (window.ShadowDOMPolyfill),function(e){"use strict";function t(e){var t=p(l(e).o wnerDocument.createDocumentFragment());n.call(this,t),c(t,this);var o=e.shadowRo ot;f.set(this,o),this.treeScope_=new r(this,a(o||e)),d.set(this,e)}var n=e.wrapp ers.DocumentFragment,r=e.TreeScope,o=e.elementFromPoint,i=e.getInnerHTML,a=e.get TreeScope,s=e.mixin,c=e.rewrap,u=e.setInnerHTML,l=e.unsafeUnwrap,p=e.unwrap,d=ne w WeakMap,f=new WeakMap,h=/[ \t\n\r\f]/;t.prototype=Object.create(n.prototype),s (t.prototype,{constructor:t,get innerHTML(){return i(this)},set innerHTML(e){u(t his,e),this.invalidateShadowRenderer()},get olderShadowRoot(){return f.get(this) ||null},get host(){return d.get(this)||null},invalidateShadowRenderer:function() {return d.get(this).invalidateShadowRenderer()},elementFromPoint:function(e,t){r eturn o(this,this.ownerDocument,e,t)},getElementById:function(e){return h.test(e )?null:this.querySelector('[id="'+e+'"]')}}),e.wrappers.ShadowRoot=t}(window.Sha dowDOMPolyfill),function(e){"use strict";function t(e){e.previousSibling_=e.prev iousSibling,e.nextSibling_=e.nextSibling,e.parentNode_=e.parentNode}function n(n ,o,i){var a=x(n),s=x(o),c=i?x(i):null;if(r(o),t(o),i)n.firstChild===i&&(n.firstC hild_=i),i.previousSibling_=i.previousSibling;else{n.lastChild_=n.lastChild,n.la stChild===n.firstChild&&(n.firstChild_=n.firstChild);var u=R(a.lastChild);u&&(u. nextSibling_=u.nextSibling)}e.originalInsertBefore.call(a,s,c)}function r(n){var r=x(n),o=r.parentNode;if(o){var i=R(o);t(n),n.previousSibling&&(n.previousSibli ng.nextSibling_=n),n.nextSibling&&(n.nextSibling.previousSibling_=n),i.lastChild ===n&&(i.lastChild_=n),i.firstChild===n&&(i.firstChild_=n),e.originalRemoveChild .call(o,r)}}function o(e){W.set(e,[])}function i(e){var t=W.get(e);return t||W.s et(e,t=[]),t}function a(e){for(var t=[],n=0,r=e.firstChild;r;r=r.nextSibling)t[n ++]=r;return t}function s(){for(var e=0;e<F.length;e++){var t=F[e],n=t.parentRen derer;n&&n.dirty||t.render()}F=[]}function c(){T=null,s()}function u(e){var t=I. get(e);return t||(t=new f(e),I.set(e,t)),t}function l(e){var t=C(e).root;return t instanceof _?t:null}function p(e){return u(e.host)}function d(e){this.skip=!1, this.node=e,this.childNodes=[]}function f(e){this.host=e,this.dirty=!1,this.inva lidateAttributes(),this.associateNode(e)}function h(e){for(var t=[],n=e.firstChi ld;n;n=n.nextSibling)E(n)?t.push.apply(t,i(n)):t.push(n);return t}function w(e){ if(e instanceof j)return e;if(e instanceof L)return null;for(var t=e.firstChild; t;t=t.nextSibling){var n=w(t);if(n)return n}return null}function m(e,t){i(t).pus h(e);var n=A.get(e);n?n.push(t):A.set(e,[t])}function g(e){return A.get(e)}funct ion v(e){A.set(e,void 0)}function b(e,t){var n=t.getAttribute("select");if(!n)re turn!0;if(n=n.trim(),!n)return!0;if(!(e instanceof O))return!1;if(!U.test(n))ret urn!1;try{return e.matches(n)}catch(r){return!1}}function y(e,t){var n=g(t);retu rn n&&n[n.length-1]===e}function E(e){return e instanceof L||e instanceof j}func tion S(e){return e.shadowRoot}function M(e){for(var t=[],n=e.shadowRoot;n;n=n.ol derShadowRoot)t.push(n);return t}var T,O=e.wrappers.Element,L=e.wrappers.HTMLCon tentElement,j=e.wrappers.HTMLShadowElement,N=e.wrappers.Node,_=e.wrappers.Shadow Root,C=(e.assert,e.getTreeScope),D=(e.mixin,e.oneOf),H=e.unsafeUnwrap,x=e.unwrap ,R=e.wrap,P=e.ArraySplice,W=new WeakMap,A=new WeakMap,I=new WeakMap,k=D(window,[ "requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame" ,"setTimeout"]),F=[],B=new P;B.equals=function(e,t){return x(e.node)===t},d.prot otype={append:function(e){var t=new d(e);return this.childNodes.push(t),t},sync: function(e){if(!this.skip){for(var t=this.node,o=this.childNodes,i=a(x(t)),s=e|| new WeakMap,c=B.calculateSplices(o,i),u=0,l=0,p=0,d=0;d<c.length;d++){for(var f= c[d];p<f.index;p++)l++,o[u++].sync(s);for(var h=f.removed.length,w=0;h>w;w++){va r m=R(i[l++]);s.get(m)||r(m)}for(var g=f.addedCount,v=i[l]&&R(i[l]),w=0;g>w;w++) {var b=o[u++],y=b.node;n(t,y,v),s.set(y,!0),b.sync(s)}p+=g}for(var d=p;d<o.lengt h;d++)o[d].sync(s)}}},f.prototype={render:function(e){if(this.dirty){this.invali dateAttributes();var t=this.host;this.distribution(t);var n=e||new d(t);this.bui ldRenderTree(n,t);var r=!e;r&&n.sync(),this.dirty=!1}},get parentRenderer(){retu rn C(this.host).renderer},invalidate:function(){if(!this.dirty){this.dirty=!0;va r e=this.parentRenderer;if(e&&e.invalidate(),F.push(this),T)return;T=window[k](c ,0)}},distribution:function(e){this.resetAllSubtrees(e),this.distributionResolut ion(e)},resetAll:function(e){E(e)?o(e):v(e),this.resetAllSubtrees(e)},resetAllSu btrees:function(e){for(var t=e.firstChild;t;t=t.nextSibling)this.resetAll(t);e.s hadowRoot&&this.resetAll(e.shadowRoot),e.olderShadowRoot&&this.resetAll(e.olderS hadowRoot)},distributionResolution:function(e){if(S(e)){for(var t=e,n=h(t),r=M(t ),o=0;o<r.length;o++)this.poolDistribution(r[o],n);for(var o=r.length-1;o>=0;o-- ){var i=r[o],a=w(i);if(a){var s=i.olderShadowRoot;s&&(n=h(s));for(var c=0;c<n.le ngth;c++)m(n[c],a)}this.distributionResolution(i)}}for(var u=e.firstChild;u;u=u. nextSibling)this.distributionResolution(u)},poolDistribution:function(e,t){if(!( e instanceof j))if(e instanceof L){var n=e;this.updateDependentAttributes(n.getA ttribute("select"));for(var r=!1,o=0;o<t.length;o++){var e=t[o];e&&b(e,n)&&(m(e, n),t[o]=void 0,r=!0)}if(!r)for(var i=n.firstChild;i;i=i.nextSibling)m(i,n)}else for(var i=e.firstChild;i;i=i.nextSibling)this.poolDistribution(i,t)},buildRender Tree:function(e,t){for(var n=this.compose(t),r=0;r<n.length;r++){var o=n[r],i=e. append(o);this.buildRenderTree(i,o)}if(S(t)){var a=u(t);a.dirty=!1}},compose:fun ction(e){for(var t=[],n=e.shadowRoot||e,r=n.firstChild;r;r=r.nextSibling)if(E(r) ){this.associateNode(n);for(var o=i(r),a=0;a<o.length;a++){var s=o[a];y(r,s)&&t. push(s)}}else t.push(r);return t},invalidateAttributes:function(){this.attribute s=Object.create(null)},updateDependentAttributes:function(e){if(e){var t=this.at tributes;/\.\w+/.test(e)&&(t["class"]=!0),/#\w+/.test(e)&&(t.id=!0),e.replace(/\ [\s*([^\s=\|~\]]+)/g,function(e,n){t[n]=!0})}},dependsOnAttribute:function(e){re turn this.attributes[e]},associateNode:function(e){H(e).polymerShadowRenderer_=t his}};var U=/^(:not\()?[*.#[a-zA-Z_|]/;N.prototype.invalidateShadowRenderer=func tion(){var e=H(this).polymerShadowRenderer_;return e?(e.invalidate(),!0):!1},L.p rototype.getDistributedNodes=j.prototype.getDistributedNodes=function(){return s (),i(this)},O.prototype.getDestinationInsertionPoints=function(){return s(),g(th is)||[]},L.prototype.nodeIsInserted_=j.prototype.nodeIsInserted_=function(){this .invalidateShadowRenderer();var e,t=l(this);t&&(e=p(t)),H(this).polymerShadowRen derer_=e,e&&e.invalidate()},e.getRendererForHost=u,e.getShadowTrees=M,e.renderAl lPending=s,e.getDestinationInsertionPoints=g,e.visual={insertBefore:n,remove:r}} (window.ShadowDOMPolyfill),function(e){"use strict";function t(t){if(window[t]){ r(!e.wrappers[t]);var c=function(e){n.call(this,e)};c.prototype=Object.create(n. prototype),o(c.prototype,{get form(){return s(a(this).form)}}),i(window[t],c,doc ument.createElement(t.slice(4,-7))),e.wrappers[t]=c}}var n=e.wrappers.HTMLElemen t,r=e.assert,o=e.mixin,i=e.registerWrapper,a=e.unwrap,s=e.wrap,c=["HTMLButtonEle ment","HTMLFieldSetElement","HTMLInputElement","HTMLKeygenElement","HTMLLabelEle ment","HTMLLegendElement","HTMLObjectElement","HTMLOutputElement","HTMLTextAreaE lement"];c.forEach(t)}(window.ShadowDOMPolyfill),function(e){"use strict";functi on t(e){r(e,this)}{var n=e.registerWrapper,r=e.setWrapper,o=e.unsafeUnwrap,i=e.u nwrap,a=e.unwrapIfNeeded,s=e.wrap;window.Selection}t.prototype={get anchorNode() {return s(o(this).anchorNode)},get focusNode(){return s(o(this).focusNode)},addR ange:function(e){o(this).addRange(i(e))},collapse:function(e,t){o(this).collapse (a(e),t)},containsNode:function(e,t){return o(this).containsNode(a(e),t)},extend :function(e,t){o(this).extend(a(e),t)},getRangeAt:function(e){return s(o(this).g etRangeAt(e))},removeRange:function(e){o(this).removeRange(i(e))},selectAllChild ren:function(e){o(this).selectAllChildren(a(e))},toString:function(){return o(th is).toString()}},n(window.Selection,t,window.getSelection()),e.wrappers.Selectio n=t}(window.ShadowDOMPolyfill),function(e){"use strict";function t(e){l.call(thi s,e),this.treeScope_=new w(this,null)}function n(e){var n=document[e];t.prototyp e[e]=function(){return N(n.apply(L(this),arguments))}}function r(e,t){D.call(L(t ),j(e)),o(e,t)}function o(e,t){e.shadowRoot&&t.adoptNode(e.shadowRoot),e instanc eof h&&i(e,t);for(var n=e.firstChild;n;n=n.nextSibling)o(n,t)}function i(e,t){va r n=e.olderShadowRoot;n&&t.adoptNode(n)}function a(e){O(e,this)}function s(e,t){ var n=document.implementation[t];e.prototype[t]=function(){return N(n.apply(L(th is),arguments))}}function c(e,t){var n=document.implementation[t];e.prototype[t] =function(){return n.apply(L(this),arguments)}}var u=e.GetElementsByInterface,l= e.wrappers.Node,p=e.ParentNodeInterface,d=e.wrappers.Selection,f=e.SelectorsInte rface,h=e.wrappers.ShadowRoot,w=e.TreeScope,m=e.cloneNode,g=e.defineWrapGetter,v =e.elementFromPoint,b=e.forwardMethodsToWrapper,y=e.matchesNames,E=e.mixin,S=e.r egisterWrapper,M=e.renderAllPending,T=e.rewrap,O=e.setWrapper,L=e.unsafeUnwrap,j =e.unwrap,N=e.wrap,_=e.wrapEventTargetMethods,C=(e.wrapNodeList,new WeakMap);t.p rototype=Object.create(l.prototype),g(t,"documentElement"),g(t,"body"),g(t,"head "),["createComment","createDocumentFragment","createElement","createElementNS"," createEvent","createEventNS","createRange","createTextNode","getElementById"].fo rEach(n);var D=document.adoptNode,H=document.getSelection;if(E(t.prototype,{adop tNode:function(e){return e.parentNode&&e.parentNode.removeChild(e),r(e,this),e}, elementFromPoint:function(e,t){return v(this,this,e,t)},importNode:function(e,t) {return m(e,t,L(this))},getSelection:function(){return M(),new d(H.call(j(this)) )},getElementsByName:function(e){return f.querySelectorAll.call(this,"[name="+JS ON.stringify(String(e))+"]")}}),document.registerElement){var x=document.registe rElement;t.prototype.registerElement=function(t,n){function r(e){return e?void O (e,this):i?document.createElement(i,t):document.createElement(t)}var o,i;if(void 0!==n&&(o=n.prototype,i=n["extends"]),o||(o=Object.create(HTMLElement.prototype )),e.nativePrototypeTable.get(o))throw new Error("NotSupportedError");for(var a, s=Object.getPrototypeOf(o),c=[];s&&!(a=e.nativePrototypeTable.get(s));)c.push(s) ,s=Object.getPrototypeOf(s);if(!a)throw new Error("NotSupportedError");for(var u =Object.create(a),l=c.length-1;l>=0;l--)u=Object.create(u);["createdCallback","a ttachedCallback","detachedCallback","attributeChangedCallback"].forEach(function (e){var t=o[e];t&&(u[e]=function(){N(this)instanceof r||T(this),t.apply(N(this), arguments)})});var p={prototype:u};i&&(p["extends"]=i),r.prototype=o,r.prototype .constructor=r,e.constructorTable.set(u,r),e.nativePrototypeTable.set(o,u);x.cal l(j(this),t,p);return r},b([window.HTMLDocument||window.Document],["registerElem ent"])}b([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTM LHeadElement,window.HTMLHtmlElement],["appendChild","compareDocumentPosition","c ontains","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS ","insertBefore","querySelector","querySelectorAll","removeChild","replaceChild" ]),b([window.HTMLBodyElement,window.HTMLHeadElement,window.HTMLHtmlElement],y),b ([window.HTMLDocument||window.Document],["adoptNode","importNode","contains","cr eateComment","createDocumentFragment","createElement","createElementNS","createE vent","createEventNS","createRange","createTextNode","elementFromPoint","getElem entById","getElementsByName","getSelection"]),E(t.prototype,u),E(t.prototype,p), E(t.prototype,f),E(t.prototype,{get implementation(){var e=C.get(this);return e? e:(e=new a(j(this).implementation),C.set(this,e),e)},get defaultView(){return N( j(this).defaultView)}}),S(window.Document,t,document.implementation.createHTMLDo cument("")),window.HTMLDocument&&S(window.HTMLDocument,t),_([window.HTMLBodyElem ent,window.HTMLDocument||window.Document,window.HTMLHeadElement]),s(a,"createDoc umentType"),s(a,"createDocument"),s(a,"createHTMLDocument"),c(a,"hasFeature"),S( window.DOMImplementation,a),b([window.DOMImplementation],["createDocumentType"," createDocument","createHTMLDocument","hasFeature"]),e.adoptNodeNoRemove=r,e.wrap pers.DOMImplementation=a,e.wrappers.Document=t}(window.ShadowDOMPolyfill),functi on(e){"use strict";function t(e){n.call(this,e)}var n=e.wrappers.EventTarget,r=e .wrappers.Selection,o=e.mixin,i=e.registerWrapper,a=e.renderAllPending,s=e.unwra p,c=e.unwrapIfNeeded,u=e.wrap,l=window.Window,p=window.getComputedStyle,d=window .getDefaultComputedStyle,f=window.getSelection;
13 t.prototype=Object.create(n.prototype),l.prototype.getComputedStyle=function(e,t ){return u(this||window).getComputedStyle(c(e),t)},d&&(l.prototype.getDefaultCom putedStyle=function(e,t){return u(this||window).getDefaultComputedStyle(c(e),t)} ),l.prototype.getSelection=function(){return u(this||window).getSelection()},del ete window.getComputedStyle,delete window.getDefaultComputedStyle,delete window. getSelection,["addEventListener","removeEventListener","dispatchEvent"].forEach( function(e){l.prototype[e]=function(){var t=u(this||window);return t[e].apply(t, arguments)},delete window[e]}),o(t.prototype,{getComputedStyle:function(e,t){ret urn a(),p.call(s(this),c(e),t)},getSelection:function(){return a(),new r(f.call( s(this)))},get document(){return u(s(this).document)}}),d&&(t.prototype.getDefau ltComputedStyle=function(e,t){return a(),d.call(s(this),c(e),t)}),i(l,t,window), e.wrappers.Window=t}(window.ShadowDOMPolyfill),function(e){"use strict";var t=e. unwrap,n=window.DataTransfer||window.Clipboard,r=n.prototype.setDragImage;r&&(n. prototype.setDragImage=function(e,n,o){r.call(this,t(e),n,o)})}(window.ShadowDOM Polyfill),function(e){"use strict";function t(e){var t;t=e instanceof i?e:new i( e&&o(e)),r(t,this)}var n=e.registerWrapper,r=e.setWrapper,o=e.unwrap,i=window.Fo rmData;i&&(n(i,t,new i),e.wrappers.FormData=t)}(window.ShadowDOMPolyfill),functi on(e){"use strict";var t=e.unwrapIfNeeded,n=XMLHttpRequest.prototype.send;XMLHtt pRequest.prototype.send=function(e){return n.call(this,t(e))}}(window.ShadowDOMP olyfill),function(e){"use strict";function t(e){var t=n[e],r=window[t];if(r){var o=document.createElement(e),i=o.constructor;window[t]=i}}var n=(e.isWrapperFor, {a:"HTMLAnchorElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",base:"HTM LBaseElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElemen t",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",col:"HTMLTableCo lElement",content:"HTMLContentElement",data:"HTMLDataElement",datalist:"HTMLData ListElement",del:"HTMLModElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement ",dl:"HTMLDListElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement", font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset: "HTMLFrameSetElement",h1:"HTMLHeadingElement",head:"HTMLHeadElement",hr:"HTMLHRE lement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement" ,input:"HTMLInputElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",le gend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapE lement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuIt emElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",object:"HTMLObjectEle ment",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionEle ment",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElemen t",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",scri pt:"HTMLScriptElement",select:"HTMLSelectElement",shadow:"HTMLShadowElement",sou rce:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",table:"H TMLTableElement",tbody:"HTMLTableSectionElement",template:"HTMLTemplateElement", textarea:"HTMLTextAreaElement",thead:"HTMLTableSectionElement",time:"HTMLTimeEle ment",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement" ,ul:"HTMLUListElement",video:"HTMLVideoElement"});Object.keys(n).forEach(t),Obje ct.getOwnPropertyNames(e.wrappers).forEach(function(t){window[t]=e.wrappers[t]}) }(window.ShadowDOMPolyfill);
OLDNEW
« no previous file with comments | « polymer_0.5.4/bower_components/webcomponentsjs/ShadowDOM.js ('k') | polymer_0.5.4/bower_components/webcomponentsjs/bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698