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

Side by Side Diff: appengine/swarming/ui/build/elements.html

Issue 2676513004: Add task-list summary (Closed)
Patch Set: rebase Created 3 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
1 <!DOCTYPE html><html><head><meta charset="UTF-8"> </head><body><div hidden="" by -vulcanize=""><script>!function(){function e(){document.body.removeAttribute("un resolved")}window.WebComponents?addEventListener("WebComponentsReady",e):"intera ctive"===document.readyState||"complete"===document.readyState?e():addEventListe ner("DOMContentLoaded",e)}(),window.Polymer={Settings:function(){var e=window.Po lymer||{};if(!e.noUrlSettings)for(var t,r=location.search.slice(1).split("&"),i= 0;i<r.length&&(t=r[i]);i++)t=t.split("="),t[0]&&(e[t[0]]=t[1]||!0);return e.want Shadow="shadow"===e.dom,e.hasShadow=Boolean(Element.prototype.createShadowRoot), e.nativeShadow=e.hasShadow&&!window.ShadowDOMPolyfill,e.useShadow=e.wantShadow&& e.hasShadow,e.hasNativeImports=Boolean("import"in document.createElement("link") ),e.useNativeImports=e.hasNativeImports,e.useNativeCustomElements=!window.Custom Elements||window.CustomElements.useNative,e.useNativeShadow=e.useShadow&&e.nativ eShadow,e.usePolyfillProto=!e.useNativeCustomElements&&!Object.__proto__,e.hasNa tiveCSSProperties=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS .supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"),e.useNativeCSSPropertie s=e.hasNativeCSSProperties&&e.lazyRegister&&e.useNativeCSSProperties,e}()},funct ion(){var e=window.Polymer;window.Polymer=function(e){"function"==typeof e&&(e=e .prototype),e||(e={});var r=t(e);e=r.prototype;var i={prototype:e};return e.exte nds&&(i.extends=e.extends),Polymer.telemetry._registrate(e),document.registerEle ment(e.is,i),r};var t=function(e){var t=Polymer.Base;return e.extends&&(t=Polyme r.Base._getExtendedPrototype(e.extends)),e=Polymer.Base.chainObject(e,t),e.regis terCallback(),e.constructor};if(e)for(var r in e)Polymer[r]=e[r];Polymer.Class=t }(),Polymer.telemetry={registrations:[],_regLog:function(e){console.log("["+e.is +"]: registered")},_registrate:function(e){this.registrations.push(e),Polymer.lo g&&this._regLog(e)},dumpRegistrations:function(){this.registrations.forEach(this ._regLog)}},Object.defineProperty(window,"currentImport",{enumerable:!0,configur able:!0,get:function(){return(document._currentScript||document.currentScript).o wnerDocument}}),Polymer.RenderStatus={_ready:!1,_callbacks:[],whenReady:function (e){this._ready?e():this._callbacks.push(e)},_makeReady:function(){this._ready=! 0;for(var e=0;e<this._callbacks.length;e++)this._callbacks[e]();this._callbacks= []},_catchFirstRender:function(){requestAnimationFrame(function(){Polymer.Render Status._makeReady()})},_afterNextRenderQueue:[],_waitingNextRender:!1,afterNextR ender:function(e,t,r){this._watchNextRender(),this._afterNextRenderQueue.push([e ,t,r])},hasRendered:function(){return this._ready},_watchNextRender:function(){i f(!this._waitingNextRender){this._waitingNextRender=!0;var e=function(){Polymer. RenderStatus._flushNextRender()};this._ready?requestAnimationFrame(e):this.whenR eady(e)}},_flushNextRender:function(){var e=this;setTimeout(function(){e._flushR enderCallbacks(e._afterNextRenderQueue),e._afterNextRenderQueue=[],e._waitingNex tRender=!1})},_flushRenderCallbacks:function(e){for(var t,r=0;r<e.length;r++)t=e [r],t[1].apply(t[0],t[2]||Polymer.nar)}},window.HTMLImports?HTMLImports.whenRead y(function(){Polymer.RenderStatus._catchFirstRender()}):Polymer.RenderStatus._ca tchFirstRender(),Polymer.ImportStatus=Polymer.RenderStatus,Polymer.ImportStatus. whenLoaded=Polymer.ImportStatus.whenReady,function(){"use strict";var e=Polymer. Settings;Polymer.Base={__isPolymerInstance__:!0,_addFeature:function(e){this.ext end(this,e)},registerCallback:function(){"max"===e.lazyRegister?this.beforeRegis ter&&this.beforeRegister():(this._desugarBehaviors(),this._doBehavior("beforeReg ister")),this._registerFeatures(),e.lazyRegister||this.ensureRegisterFinished()} ,createdCallback:function(){this.__hasRegisterFinished||this._ensureRegisterFini shed(this.__proto__),Polymer.telemetry.instanceCount++,this.root=this,this._doBe havior("created"),this._initFeatures()},ensureRegisterFinished:function(){this._ ensureRegisterFinished(this)},_ensureRegisterFinished:function(t){t.__hasRegiste rFinished===t.is&&t.is||("max"===e.lazyRegister&&(t._desugarBehaviors(),t._doBeh aviorOnly("beforeRegister")),t.__hasRegisterFinished=t.is,t._finishRegisterFeatu res&&t._finishRegisterFeatures(),t._doBehavior("registered"),e.usePolyfillProto& &t!==this&&t.extend(this,t))},attachedCallback:function(){var e=this;Polymer.Ren derStatus.whenReady(function(){e.isAttached=!0,e._doBehavior("attached")})},deta chedCallback:function(){var e=this;Polymer.RenderStatus.whenReady(function(){e.i sAttached=!1,e._doBehavior("detached")})},attributeChangedCallback:function(e,t, r){this._attributeChangedImpl(e),this._doBehavior("attributeChanged",[e,t,r])},_ attributeChangedImpl:function(e){this._setAttributeToProperty(this,e)},extend:fu nction(e,t){if(e&&t)for(var r,i=Object.getOwnPropertyNames(t),o=0;o<i.length&&(r =i[o]);o++)this.copyOwnProperty(r,t,e);return e||t},mixin:function(e,t){for(var r in t)e[r]=t[r];return e},copyOwnProperty:function(e,t,r){var i=Object.getOwnPr opertyDescriptor(t,e);i&&Object.defineProperty(r,e,i)},_logger:function(e,t){swi tch(1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"err or":console[e].apply(console,t)}},_log:function(){var e=Array.prototype.slice.ca ll(arguments,0);this._logger("log",e)},_warn:function(){var e=Array.prototype.sl ice.call(arguments,0);this._logger("warn",e)},_error:function(){var e=Array.prot otype.slice.call(arguments,0);this._logger("error",e)},_logf:function(){return t his._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments,0))}} ,Polymer.Base._logPrefix=function(){var e=window.chrome&&!/edge/i.test(navigator .userAgent)||/firefox/i.test(navigator.userAgent);return e?["%c[%s::%s]:","font- weight: bold; background-color:#EEEE00;"]:["[%s::%s]:"]}(),Polymer.Base.chainObj ect=function(e,t){return e&&t&&e!==t&&(Object.__proto__||(e=Polymer.Base.extend( Object.create(t),e)),e.__proto__=t),e},Polymer.Base=Polymer.Base.chainObject(Pol ymer.Base,HTMLElement.prototype),window.CustomElements?Polymer.instanceof=Custom Elements.instanceof:Polymer.instanceof=function(e,t){return e instanceof t},Poly mer.isInstance=function(e){return Boolean(e&&e.__isPolymerInstance__)},Polymer.t elemetry.instanceCount=0}(),function(){function e(){if(s)for(var e,t=document._c urrentScript||document.currentScript,r=t&&t.ownerDocument||document,i=r.querySel ectorAll("dom-module"),o=i.length-1;o>=0&&(e=i[o]);o--){if(e.__upgraded__)return ;CustomElements.upgrade(e)}}var t={},r={},i=function(e){return t[e]||r[e.toLower Case()]},o=function(){return document.createElement("dom-module")};o.prototype=O bject.create(HTMLElement.prototype),Polymer.Base.extend(o.prototype,{constructor :o,createdCallback:function(){this.register()},register:function(e){e=e||this.id ||this.getAttribute("name")||this.getAttribute("is"),e&&(this.id=e,t[e]=this,r[e .toLowerCase()]=this)},import:function(t,r){if(t){var o=i(t);return o||(e(),o=i( t)),o&&r&&(o=o.querySelector(r)),o}}});var s=window.CustomElements&&!CustomEleme nts.useNative;document.registerElement("dom-module",o)}(),Polymer.Base._addFeatu re({_prepIs:function(){if(!this.is){var e=(document._currentScript||document.cur rentScript).parentNode;if("dom-module"===e.localName){var t=e.id||e.getAttribute ("name")||e.getAttribute("is");this.is=t}}this.is&&(this.is=this.is.toLowerCase( ))}}),Polymer.Base._addFeature({behaviors:[],_desugarBehaviors:function(){this.b ehaviors.length&&(this.behaviors=this._desugarSomeBehaviors(this.behaviors))},_d esugarSomeBehaviors:function(e){var t=[];e=this._flattenBehaviorsList(e);for(var r=e.length-1;r>=0;r--){var i=e[r];t.indexOf(i)===-1&&(this._mixinBehavior(i),t. unshift(i))}return t},_flattenBehaviorsList:function(e){for(var t=[],r=0;r<e.len gth;r++){var i=e[r];i instanceof Array?t=t.concat(this._flattenBehaviorsList(i)) :i?t.push(i):this._warn(this._logf("_flattenBehaviorsList","behavior is null, ch eck for missing or 404 import"))}return t},_mixinBehavior:function(e){for(var t, r=Object.getOwnPropertyNames(e),i=0;i<r.length&&(t=r[i]);i++)Polymer.Base._behav iorProperties[t]||this.hasOwnProperty(t)||this.copyOwnProperty(t,e,this)},_prepB ehaviors:function(){this._prepFlattenedBehaviors(this.behaviors)},_prepFlattened Behaviors:function(e){for(var t=0,r=e.length;t<r;t++)this._prepBehavior(e[t]);th is._prepBehavior(this)},_doBehavior:function(e,t){for(var r=0;r<this.behaviors.l ength;r++)this._invokeBehavior(this.behaviors[r],e,t);this._invokeBehavior(this, e,t)},_doBehaviorOnly:function(e,t){for(var r=0;r<this.behaviors.length;r++)this ._invokeBehavior(this.behaviors[r],e,t)},_invokeBehavior:function(e,t,r){var i=e [t];i&&i.apply(this,r||Polymer.nar)},_marshalBehaviors:function(){for(var e=0;e< this.behaviors.length;e++)this._marshalBehavior(this.behaviors[e]);this._marshal Behavior(this)}}),Polymer.Base._behaviorProperties={hostAttributes:!0,beforeRegi ster:!0,registered:!0,properties:!0,observers:!0,listeners:!0,created:!0,attache d:!0,detached:!0,attributeChanged:!0,ready:!0},Polymer.Base._addFeature({_getExt endedPrototype:function(e){return this._getExtendedNativePrototype(e)},_nativePr ototypes:{},_getExtendedNativePrototype:function(e){var t=this._nativePrototypes [e];if(!t){var r=this.getNativePrototype(e);t=this.extend(Object.create(r),Polym er.Base),this._nativePrototypes[e]=t}return t},getNativePrototype:function(e){re turn Object.getPrototypeOf(document.createElement(e))}}),Polymer.Base._addFeatur e({_prepConstructor:function(){this._factoryArgs=this.extends?[this.extends,this .is]:[this.is];var e=function(){return this._factory(arguments)};this.hasOwnProp erty("extends")&&(e.extends=this.extends),Object.defineProperty(this,"constructo r",{value:e,writable:!0,configurable:!0}),e.prototype=this},_factory:function(e) {var t=document.createElement.apply(document,this._factoryArgs);return this.fact oryImpl&&this.factoryImpl.apply(t,e),t}}),Polymer.nob=Object.create(null),Polyme r.Base._addFeature({properties:{},getPropertyInfo:function(e){var t=this._getPro pertyInfo(e,this.properties);if(!t)for(var r=0;r<this.behaviors.length;r++)if(t= this._getPropertyInfo(e,this.behaviors[r].properties))return t;return t||Polymer .nob},_getPropertyInfo:function(e,t){var r=t&&t[e];return"function"==typeof r&&( r=t[e]={type:r}),r&&(r.defined=!0),r},_prepPropertyInfo:function(){this._propert yInfo={};for(var e=0;e<this.behaviors.length;e++)this._addPropertyInfo(this._pro pertyInfo,this.behaviors[e].properties);this._addPropertyInfo(this._propertyInfo ,this.properties),this._addPropertyInfo(this._propertyInfo,this._propertyEffects )},_addPropertyInfo:function(e,t){if(t){var r,i;for(var o in t)r=e[o],i=t[o],("_ "!==o[0]||i.readOnly)&&(e[o]?(r.type||(r.type=i.type),r.readOnly||(r.readOnly=i. readOnly)):e[o]={type:"function"==typeof i?i:i.type,readOnly:i.readOnly,attribut e:Polymer.CaseMap.camelToDashCase(o)})}}}),Polymer.CaseMap={_caseMap:{},_rx:{das hToCamel:/-[a-z]/g,camelToDash:/([A-Z])/g},dashToCamelCase:function(e){return th is._caseMap[e]||(this._caseMap[e]=e.indexOf("-")<0?e:e.replace(this._rx.dashToCa mel,function(e){return e[1].toUpperCase()}))},camelToDashCase:function(e){return this._caseMap[e]||(this._caseMap[e]=e.replace(this._rx.camelToDash,"-$1").toLow erCase())}},Polymer.Base._addFeature({_addHostAttributes:function(e){this._aggre gatedAttributes||(this._aggregatedAttributes={}),e&&this.mixin(this._aggregatedA ttributes,e)},_marshalHostAttributes:function(){this._aggregatedAttributes&&this ._applyAttributes(this,this._aggregatedAttributes)},_applyAttributes:function(e, t){for(var r in t)if(!this.hasAttribute(r)&&"class"!==r){var i=t[r];this.seriali zeValueToAttribute(i,r,this)}},_marshalAttributes:function(){this._takeAttribute sToModel(this)},_takeAttributesToModel:function(e){if(this.hasAttributes())for(v ar t in this._propertyInfo){var r=this._propertyInfo[t];this.hasAttribute(r.attr ibute)&&this._setAttributeToProperty(e,r.attribute,t,r)}},_setAttributeToPropert y:function(e,t,r,i){if(!this._serializing&&(r=r||Polymer.CaseMap.dashToCamelCase (t),i=i||this._propertyInfo&&this._propertyInfo[r],i&&!i.readOnly)){var o=this.g etAttribute(t);e[r]=this.deserialize(o,i.type)}},_serializing:!1,reflectProperty ToAttribute:function(e,t,r){this._serializing=!0,r=void 0===r?this[e]:r,this.ser ializeValueToAttribute(r,t||Polymer.CaseMap.camelToDashCase(e)),this._serializin g=!1},serializeValueToAttribute:function(e,t,r){var i=this.serialize(e);r=r||thi s,void 0===i?r.removeAttribute(t):r.setAttribute(t,i)},deserialize:function(e,t) {switch(t){case Number:e=Number(e);break;case Boolean:e=null!=e;break;case Objec t:try{e=JSON.parse(e)}catch(e){}break;case Array:try{e=JSON.parse(e)}catch(t){e= null,console.warn("Polymer::Attributes: couldn`t decode Array as JSON")}break;ca se Date:e=new Date(e);break;case String:}return e},serialize:function(e){switch( typeof e){case"boolean":return e?"":void 0;case"object":if(e instanceof Date)ret urn e.toString();if(e)try{return JSON.stringify(e)}catch(e){return""}default:ret urn null!=e?e:void 0}}}),Polymer.version="1.7.0",Polymer.Base._addFeature({_regi sterFeatures:function(){this._prepIs(),this._prepBehaviors(),this._prepConstruct or(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHostAttributes (e.hostAttributes)},_marshalBehavior:function(e){},_initFeatures:function(){this ._marshalHostAttributes(),this._marshalBehaviors()}})</script> <script>Polymer.B ase._addFeature({_prepTemplate:function(){void 0===this._template&&(this._templa te=Polymer.DomModule.import(this.is,"template")),this._template&&this._template. hasAttribute("is")&&this._warn(this._logf("_prepTemplate","top-level Polymer tem plate must not be a type-extension, found",this._template,"Move inside simple <t emplate>.")),this._template&&!this._template.content&&window.HTMLTemplateElement &&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(this._template)},_s tampTemplate:function(){this._template&&(this.root=this.instanceTemplate(this._t emplate))},instanceTemplate:function(e){var t=document.importNode(e._content||e. content,!0);return t}}),function(){var e=Polymer.Base.attachedCallback;Polymer.B ase._addFeature({_hostStack:[],ready:function(){},_registerHost:function(e){this .dataHost=e=e||Polymer.Base._hostStack[Polymer.Base._hostStack.length-1],e&&e._c lients&&e._clients.push(this),this._clients=null,this._clientsReadied=!1},_begin Hosting:function(){Polymer.Base._hostStack.push(this),this._clients||(this._clie nts=[])},_endHosting:function(){Polymer.Base._hostStack.pop()},_tryReady:functio n(){this._readied=!1,this._canReady()&&this._ready()},_canReady:function(){retur n!this.dataHost||this.dataHost._clientsReadied},_ready:function(){this._beforeCl ientsReady(),this._template&&(this._setupRoot(),this._readyClients()),this._clie ntsReadied=!0,this._clients=null,this._afterClientsReady(),this._readySelf()},_r eadyClients:function(){this._beginDistribute();var e=this._clients;if(e)for(var t,o=0,i=e.length;o<i&&(t=e[o]);o++)t._ready();this._finishDistribute()},_readySe lf:function(){this._doBehavior("ready"),this._readied=!0,this._attachedPending&& (this._attachedPending=!1,this.attachedCallback())},_beforeClientsReady:function (){},_afterClientsReady:function(){},_beforeAttached:function(){},attachedCallba ck:function(){this._readied?(this._beforeAttached(),e.call(this)):this._attached Pending=!0}})}(),Polymer.ArraySplice=function(){function e(e,t,o){return{index:e ,removed:t,addedCount:o}}function t(){}var o=0,i=1,n=2,s=3;return t.prototype={c alcEditDistances:function(e,t,o,i,n,s){for(var r=s-n+1,d=o-t+1,a=new Array(r),l= 0;l<r;l++)a[l]=new Array(d),a[l][0]=l;for(var h=0;h<d;h++)a[0][h]=h;for(l=1;l<r; l++)for(h=1;h<d;h++)if(this.equals(e[t+h-1],i[n+l-1]))a[l][h]=a[l-1][h-1];else{v ar u=a[l-1][h]+1,c=a[l][h-1]+1;a[l][h]=u<c?u:c}return a},spliceOperationsFromEdi tDistances:function(e){for(var t=e.length-1,r=e[0].length-1,d=e[t][r],a=[];t>0|| r>0;)if(0!=t)if(0!=r){var l,h=e[t-1][r-1],u=e[t-1][r],c=e[t][r-1];l=u<c?u<h?u:h: c<h?c:h,l==h?(h==d?a.push(o):(a.push(i),d=h),t--,r--):l==u?(a.push(s),t--,d=u):( a.push(n),r--,d=c)}else a.push(s),t--;else a.push(n),r--;return a.reverse(),a},c alcSplices:function(t,r,d,a,l,h){var u=0,c=0,_=Math.min(d-r,h-l);if(0==r&&0==l&& (u=this.sharedPrefix(t,a,_)),d==t.length&&h==a.length&&(c=this.sharedSuffix(t,a, _-u)),r+=u,l+=u,d-=c,h-=c,d-r==0&&h-l==0)return[];if(r==d){for(var f=e(r,[],0);l <h;)f.removed.push(a[l++]);return[f]}if(l==h)return[e(r,[],d-r)];var m=this.spli ceOperationsFromEditDistances(this.calcEditDistances(t,r,d,a,l,h));f=void 0;for( var p=[],v=r,g=l,b=0;b<m.length;b++)switch(m[b]){case o:f&&(p.push(f),f=void 0), v++,g++;break;case i:f||(f=e(v,[],0)),f.addedCount++,v++,f.removed.push(a[g]),g+ +;break;case n:f||(f=e(v,[],0)),f.addedCount++,v++;break;case s:f||(f=e(v,[],0)) ,f.removed.push(a[g]),g++}return f&&p.push(f),p},sharedPrefix:function(e,t,o){fo r(var i=0;i<o;i++)if(!this.equals(e[i],t[i]))return i;return o},sharedSuffix:fun ction(e,t,o){for(var i=e.length,n=t.length,s=0;s<o&&this.equals(e[--i],t[--n]);) s++;return s},calculateSplices:function(e,t){return this.calcSplices(e,0,e.lengt h,t,0,t.length)},equals:function(e,t){return e===t}},new t}(),Polymer.domInnerHT ML=function(){function e(e){switch(e){case"&":return"&amp;";case"<":return"&lt;" ;case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function t( t){return t.replace(r,e)}function o(t){return t.replace(d,e)}function i(e){for(v ar t={},o=0;o<e.length;o++)t[e[o]]=!0;return t}function n(e,i,n){switch(e.nodeTy pe){case Node.ELEMENT_NODE:for(var r,d=e.localName,h="<"+d,u=e.attributes,c=0;r= u[c];c++)h+=" "+r.name+'="'+t(r.value)+'"';return h+=">",a[d]?h:h+s(e,n)+"</"+d+ ">";case Node.TEXT_NODE:var _=e.data;return i&&l[i.localName]?_:o(_);case Node.C OMMENT_NODE:return"\x3c!--"+e.data+"--\x3e";default:throw console.error(e),new E rror("not implemented")}}function s(e,t){e instanceof HTMLTemplateElement&&(e=e. content);for(var o,i="",s=Polymer.dom(e).childNodes,r=0,d=s.length;r<d&&(o=s[r]) ;r++)i+=n(o,e,t);return i}var r=/[&\u00A0"]/g,d=/[&\u00A0<>]/g,a=i(["area","base ","br","col","command","embed","hr","img","input","keygen","link","meta","param" ,"source","track","wbr"]),l=i(["style","script","xmp","iframe","noembed","nofram es","plaintext","noscript"]);return{getInnerHTML:s}}(),function(){"use strict";v ar e=Element.prototype.insertBefore,t=Element.prototype.appendChild,o=Element.pr ototype.removeChild;Polymer.TreeApi={arrayCopyChildNodes:function(e){for(var t=[ ],o=0,i=e.firstChild;i;i=i.nextSibling)t[o++]=i;return t},arrayCopyChildren:func tion(e){for(var t=[],o=0,i=e.firstElementChild;i;i=i.nextElementSibling)t[o++]=i ;return t},arrayCopy:function(e){for(var t=e.length,o=new Array(t),i=0;i<t;i++)o [i]=e[i];return o}},Polymer.TreeApi.Logical={hasParentNode:function(e){return Bo olean(e.__dom&&e.__dom.parentNode)},hasChildNodes:function(e){return Boolean(e._ _dom&&void 0!==e.__dom.childNodes)},getChildNodes:function(e){return this.hasChi ldNodes(e)?this._getChildNodes(e):e.childNodes},_getChildNodes:function(e){if(!e .__dom.childNodes){e.__dom.childNodes=[];for(var t=e.__dom.firstChild;t;t=t.__do m.nextSibling)e.__dom.childNodes.push(t)}return e.__dom.childNodes},getParentNod e:function(e){return e.__dom&&void 0!==e.__dom.parentNode?e.__dom.parentNode:e.p arentNode},getFirstChild:function(e){return e.__dom&&void 0!==e.__dom.firstChild ?e.__dom.firstChild:e.firstChild},getLastChild:function(e){return e.__dom&&void 0!==e.__dom.lastChild?e.__dom.lastChild:e.lastChild},getNextSibling:function(e){ return e.__dom&&void 0!==e.__dom.nextSibling?e.__dom.nextSibling:e.nextSibling}, getPreviousSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling? e.__dom.previousSibling:e.previousSibling},getFirstElementChild:function(e){retu rn e.__dom&&void 0!==e.__dom.firstChild?this._getFirstElementChild(e):e.firstEle mentChild},_getFirstElementChild:function(e){for(var t=e.__dom.firstChild;t&&t.n odeType!==Node.ELEMENT_NODE;)t=t.__dom.nextSibling;return t},getLastElementChild :function(e){return e.__dom&&void 0!==e.__dom.lastChild?this._getLastElementChil d(e):e.lastElementChild},_getLastElementChild:function(e){for(var t=e.__dom.last Child;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},get NextElementSibling:function(e){return e.__dom&&void 0!==e.__dom.nextSibling?this ._getNextElementSibling(e):e.nextElementSibling},_getNextElementSibling:function (e){for(var t=e.__dom.nextSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.n extSibling;return t},getPreviousElementSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling?this._getPreviousElementSibling(e):e.previousElement Sibling},_getPreviousElementSibling:function(e){for(var t=e.__dom.previousSiblin g;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},saveChi ldNodes:function(e){if(!this.hasChildNodes(e)){e.__dom=e.__dom||{},e.__dom.first Child=e.firstChild,e.__dom.lastChild=e.lastChild,e.__dom.childNodes=[];for(var t =e.firstChild;t;t=t.nextSibling)t.__dom=t.__dom||{},t.__dom.parentNode=e,e.__dom .childNodes.push(t),t.__dom.nextSibling=t.nextSibling,t.__dom.previousSibling=t. previousSibling}},recordInsertBefore:function(e,t,o){if(t.__dom.childNodes=null, e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var i=e.firstChild;i;i=i.nextSiblin g)this._linkNode(i,t,o);else this._linkNode(e,t,o)},_linkNode:function(e,t,o){e. __dom=e.__dom||{},t.__dom=t.__dom||{},o&&(o.__dom=o.__dom||{}),e.__dom.previousS ibling=o?o.__dom.previousSibling:t.__dom.lastChild,e.__dom.previousSibling&&(e._ _dom.previousSibling.__dom.nextSibling=e),e.__dom.nextSibling=o||null,e.__dom.ne xtSibling&&(e.__dom.nextSibling.__dom.previousSibling=e),e.__dom.parentNode=t,o? o===t.__dom.firstChild&&(t.__dom.firstChild=e):(t.__dom.lastChild=e,t.__dom.firs tChild||(t.__dom.firstChild=e)),t.__dom.childNodes=null},recordRemoveChild:funct ion(e,t){e.__dom=e.__dom||{},t.__dom=t.__dom||{},e===t.__dom.firstChild&&(t.__do m.firstChild=e.__dom.nextSibling),e===t.__dom.lastChild&&(t.__dom.lastChild=e.__ dom.previousSibling);var o=e.__dom.previousSibling,i=e.__dom.nextSibling;o&&(o._ _dom.nextSibling=i),i&&(i.__dom.previousSibling=o),e.__dom.parentNode=e.__dom.pr eviousSibling=e.__dom.nextSibling=void 0,t.__dom.childNodes=null}},Polymer.TreeA pi.Composed={getChildNodes:function(e){return Polymer.TreeApi.arrayCopyChildNode s(e)},getParentNode:function(e){return e.parentNode},clearChildNodes:function(e) {e.textContent=""},insertBefore:function(t,o,i){return e.call(t,o,i||null)},appe ndChild:function(e,o){return t.call(e,o)},removeChild:function(e,t){return o.cal l(e,t)}}}(),Polymer.DomApi=function(){"use strict";var e=Polymer.Settings,t=Poly mer.TreeApi,o=function(e){this.node=i?o.wrap(e):e},i=e.hasShadow&&!e.nativeShado w;o.wrap=window.wrap?window.wrap:function(e){return e},o.prototype={flush:functi on(){Polymer.dom.flush()},deepContains:function(e){if(this.node.contains(e))retu rn!0;for(var t=e,o=e.ownerDocument;t&&t!==o&&t!==this.node;)t=Polymer.dom(t).par entNode||t.host;return t===this.node},queryDistributedElements:function(e){for(v ar t,i=this.getEffectiveChildNodes(),n=[],s=0,r=i.length;s<r&&(t=i[s]);s++)t.nod eType===Node.ELEMENT_NODE&&o.matchesSelector.call(t,e)&&n.push(t);return n},getE ffectiveChildNodes:function(){for(var e,t=[],o=this.childNodes,i=0,r=o.length;i< r&&(e=o[i]);i++)if(e.localName===n)for(var d=s(e).getDistributedNodes(),a=0;a<d. length;a++)t.push(d[a]);else t.push(e);return t},observeNodes:function(e){if(e)r eturn this.observer||(this.observer=this.node.localName===n?new o.DistributedNod esObserver(this):new o.EffectiveNodesObserver(this)),this.observer.addListener(e )},unobserveNodes:function(e){this.observer&&this.observer.removeListener(e)},no tifyObserver:function(){this.observer&&this.observer.notify()},_query:function(e ,o,i){o=o||this.node;var n=[];return this._queryElements(t.Logical.getChildNodes (o),e,i,n),n},_queryElements:function(e,t,o,i){for(var n,s=0,r=e.length;s<r&&(n= e[s]);s++)if(n.nodeType===Node.ELEMENT_NODE&&this._queryElement(n,t,o,i))return! 0},_queryElement:function(e,o,i,n){var s=o(e);return s&&n.push(e),i&&i(s)?s:void this._queryElements(t.Logical.getChildNodes(e),o,i,n)}};var n=o.CONTENT="conten t",s=o.factory=function(e){return e=e||document,e.__domApi||(e.__domApi=new o.ct or(e)),e.__domApi};o.hasApi=function(e){return Boolean(e.__domApi)},o.ctor=o,Pol ymer.dom=function(e,t){return e instanceof Event?Polymer.EventApi.factory(e):o.f actory(e,t)};var r=Element.prototype;return o.matchesSelector=r.matches||r.match esSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.web kitMatchesSelector,o}(),function(){"use strict";var e=Polymer.Settings,t=Polymer .DomApi,o=t.factory,i=Polymer.TreeApi,n=Polymer.domInnerHTML.getInnerHTML,s=t.CO NTENT;if(!e.useShadow){var r=Element.prototype.cloneNode,d=Document.prototype.im portNode;Polymer.Base.extend(t.prototype,{_lazyDistribute:function(e){e.shadyRoo t&&e.shadyRoot._distributionClean&&(e.shadyRoot._distributionClean=!1,Polymer.do m.addDebouncer(e.debounce("_distribute",e._distributeContent)))},appendChild:fun ction(e){return this.insertBefore(e)},insertBefore:function(e,n){if(n&&i.Logical .getParentNode(n)!==this.node)throw Error("The ref_node to be inserted before is not a child of this node");if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var r=i .Logical.getParentNode(e);r?(t.hasApi(r)&&o(r).notifyObserver(),this._removeNode (e)):this._removeOwnerShadyRoot(e)}if(!this._addNode(e,n)){n&&(n=n.localName===s ?this._firstComposedNode(n):n);var d=this.node._isShadyRoot?this.node.host:this. node;n?i.Composed.insertBefore(d,e,n):i.Composed.appendChild(d,e)}return this.no tifyObserver(),e},_addNode:function(e,t){var o=this.getOwnerRoot();if(o){var n=t his._maybeAddInsertionPoint(e,this.node);o._invalidInsertionPoints||(o._invalidI nsertionPoints=n),this._addNodeToHost(o.host,e)}i.Logical.hasChildNodes(this.nod e)&&i.Logical.recordInsertBefore(e,this.node,t);var s=this._maybeDistribute(e)|| this.node.shadyRoot;if(s)if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(;e.firs tChild;)i.Composed.removeChild(e,e.firstChild);else{var r=i.Composed.getParentNo de(e);r&&i.Composed.removeChild(r,e)}return s},removeChild:function(e){if(i.Logi cal.getParentNode(e)!==this.node)throw Error("The node to be removed is not a ch ild of this node: "+e);if(!this._removeNode(e)){var t=this.node._isShadyRoot?thi s.node.host:this.node,o=i.Composed.getParentNode(e);t===o&&i.Composed.removeChil d(t,e)}return this.notifyObserver(),e},_removeNode:function(e){var t,n=i.Logical .hasParentNode(e)&&i.Logical.getParentNode(e),s=this._ownerShadyRootForNode(e);r eturn n&&(t=o(e)._maybeDistributeParent(),i.Logical.recordRemoveChild(e,n),s&&th is._removeDistributedChildren(s,e)&&(s._invalidInsertionPoints=!0,this._lazyDist ribute(s.host))),this._removeOwnerShadyRoot(e),s&&this._removeNodeFromHost(s.hos t,e),t},replaceChild:function(e,t){return this.insertBefore(e,t),this.removeChil d(t),e},_hasCachedOwnerRoot:function(e){return Boolean(void 0!==e._ownerShadyRoo t)},getOwnerRoot:function(){return this._ownerShadyRootForNode(this.node)},_owne rShadyRootForNode:function(e){if(e){var t=e._ownerShadyRoot;if(void 0===t){if(e. _isShadyRoot)t=e;else{var o=i.Logical.getParentNode(e);t=o?o._isShadyRoot?o:this ._ownerShadyRootForNode(o):null}(t||document.documentElement.contains(e))&&(e._o wnerShadyRoot=t)}return t}},_maybeDistribute:function(e){var t=e.nodeType===Node .DOCUMENT_FRAGMENT_NODE&&!e.__noContent&&o(e).querySelector(s),n=t&&i.Logical.ge tParentNode(t).nodeType!==Node.DOCUMENT_FRAGMENT_NODE,r=t||e.localName===s;if(r) {var d=this.getOwnerRoot();d&&this._lazyDistribute(d.host)}var a=this._nodeNeeds Distribution(this.node);return a&&this._lazyDistribute(this.node),a||r&&!n},_may beAddInsertionPoint:function(e,t){var n;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_N ODE||e.__noContent)e.localName===s&&(i.Logical.saveChildNodes(t),i.Logical.saveC hildNodes(e),n=!0);else for(var r,d,a,l=o(e).querySelectorAll(s),h=0;h<l.length& &(r=l[h]);h++)d=i.Logical.getParentNode(r),d===e&&(d=t),a=this._maybeAddInsertio nPoint(r,d),n=n||a;return n},_updateInsertionPoints:function(e){for(var t,n=e.sh adyRoot._insertionPoints=o(e.shadyRoot).querySelectorAll(s),r=0;r<n.length;r++)t =n[r],i.Logical.saveChildNodes(t),i.Logical.saveChildNodes(i.Logical.getParentNo de(t))},_nodeNeedsDistribution:function(e){return e&&e.shadyRoot&&t.hasInsertion Point(e.shadyRoot)},_addNodeToHost:function(e,t){e._elementAdd&&e._elementAdd(t) },_removeNodeFromHost:function(e,t){e._elementRemove&&e._elementRemove(t)},_remo veDistributedChildren:function(e,t){for(var n,s=e._insertionPoints,r=0;r<s.lengt h;r++){var d=s[r];if(this._contains(t,d))for(var a=o(d).getDistributedNodes(),l= 0;l<a.length;l++){n=!0;var h=a[l],u=i.Composed.getParentNode(h);u&&i.Composed.re moveChild(u,h)}}return n},_contains:function(e,t){for(;t;){if(t==e)return!0;t=i. Logical.getParentNode(t)}},_removeOwnerShadyRoot:function(e){if(this._hasCachedO wnerRoot(e))for(var t,o=i.Logical.getChildNodes(e),n=0,s=o.length;n<s&&(t=o[n]); n++)this._removeOwnerShadyRoot(t);e._ownerShadyRoot=void 0},_firstComposedNode:f unction(e){for(var t,i,n=o(e).getDistributedNodes(),s=0,r=n.length;s<r&&(t=n[s]) ;s++)if(i=o(t).getDestinationInsertionPoints(),i[i.length-1]===e)return t},query Selector:function(e){var o=this._query(function(o){return t.matchesSelector.call (o,e)},this.node,function(e){return Boolean(e)})[0];return o||null},querySelecto rAll:function(e){return this._query(function(o){return t.matchesSelector.call(o, e)},this.node)},getDestinationInsertionPoints:function(){return this.node._desti nationInsertionPoints||[]},getDistributedNodes:function(){return this.node._dist ributedNodes||[]},_clear:function(){for(;this.childNodes.length;)this.removeChil d(this.childNodes[0])},setAttribute:function(e,t){this.node.setAttribute(e,t),th is._maybeDistributeParent()},removeAttribute:function(e){this.node.removeAttribu te(e),this._maybeDistributeParent()},_maybeDistributeParent:function(){if(this._ nodeNeedsDistribution(this.parentNode))return this._lazyDistribute(this.parentNo de),!0},cloneNode:function(e){var t=r.call(this.node,!1);if(e)for(var i,n=this.c hildNodes,s=o(t),d=0;d<n.length;d++)i=o(n[d]).cloneNode(!0),s.appendChild(i);ret urn t},importNode:function(e,t){var n=this.node instanceof Document?this.node:th is.node.ownerDocument,s=d.call(n,e,!1);if(t)for(var r,a=i.Logical.getChildNodes( e),l=o(s),h=0;h<a.length;h++)r=o(n).importNode(a[h],!0),l.appendChild(r);return s},_getComposedInnerHTML:function(){return n(this.node,!0)}}),Object.definePrope rties(t.prototype,{activeElement:{get:function(){var e=document.activeElement;if (!e)return null;var t=!!this.node._isShadyRoot;if(this.node!==document){if(!t)re turn null;if(this.node.host===e||!this.node.host.contains(e))return null}for(var i=o(e).getOwnerRoot();i&&i!==this.node;)e=i.host,i=o(e).getOwnerRoot();return t his.node===document?i?null:e:i===this.node?e:null},configurable:!0},childNodes:{ get:function(){var e=i.Logical.getChildNodes(this.node);return Array.isArray(e)? e:i.arrayCopyChildNodes(this.node)},configurable:!0},children:{get:function(){re turn i.Logical.hasChildNodes(this.node)?Array.prototype.filter.call(this.childNo des,function(e){return e.nodeType===Node.ELEMENT_NODE}):i.arrayCopyChildren(this .node)},configurable:!0},parentNode:{get:function(){return i.Logical.getParentNo de(this.node)},configurable:!0},firstChild:{get:function(){return i.Logical.getF irstChild(this.node)},configurable:!0},lastChild:{get:function(){return i.Logica l.getLastChild(this.node)},configurable:!0},nextSibling:{get:function(){return i .Logical.getNextSibling(this.node)},configurable:!0},previousSibling:{get:functi on(){return i.Logical.getPreviousSibling(this.node)},configurable:!0},firstEleme ntChild:{get:function(){return i.Logical.getFirstElementChild(this.node)},config urable:!0},lastElementChild:{get:function(){return i.Logical.getLastElementChild (this.node)},configurable:!0},nextElementSibling:{get:function(){return i.Logica l.getNextElementSibling(this.node)},configurable:!0},previousElementSibling:{get :function(){return i.Logical.getPreviousElementSibling(this.node)},configurable: !0},textContent:{get:function(){var e=this.node.nodeType;if(e===Node.TEXT_NODE|| e===Node.COMMENT_NODE)return this.node.textContent;for(var t,o=[],i=0,n=this.chi ldNodes;t=n[i];i++)t.nodeType!==Node.COMMENT_NODE&&o.push(t.textContent);return o.join("")},set:function(e){var t=this.node.nodeType;t===Node.TEXT_NODE||t===Nod e.COMMENT_NODE?this.node.textContent=e:(this._clear(),e&&this.appendChild(docume nt.createTextNode(e)))},configurable:!0},innerHTML:{get:function(){var e=this.no de.nodeType;return e===Node.TEXT_NODE||e===Node.COMMENT_NODE?null:n(this.node)}, set:function(e){var t=this.node.nodeType;if(t!==Node.TEXT_NODE||t!==Node.COMMENT _NODE){this._clear();var o=document.createElement("div");o.innerHTML=e;for(var n =i.arrayCopyChildNodes(o),s=0;s<n.length;s++)this.appendChild(n[s])}},configurab le:!0}}),t.hasInsertionPoint=function(e){return Boolean(e&&e._insertionPoints.le ngth)}}}(),function(){"use strict";var e=Polymer.Settings,t=Polymer.TreeApi,o=Po lymer.DomApi;if(e.useShadow){Polymer.Base.extend(o.prototype,{querySelectorAll:f unction(e){return t.arrayCopy(this.node.querySelectorAll(e))},getOwnerRoot:funct ion(){for(var e=this.node;e;){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.hos t)return e;e=e.parentNode}},importNode:function(e,t){var o=this.node instanceof Document?this.node:this.node.ownerDocument;return o.importNode(e,t)},getDestinat ionInsertionPoints:function(){var e=this.node.getDestinationInsertionPoints&&thi s.node.getDestinationInsertionPoints();return e?t.arrayCopy(e):[]},getDistribute dNodes:function(){var e=this.node.getDistributedNodes&&this.node.getDistributedN odes();return e?t.arrayCopy(e):[]}}),Object.defineProperties(o.prototype,{active Element:{get:function(){var e=o.wrap(this.node),t=e.activeElement;return e.conta ins(t)?t:null},configurable:!0},childNodes:{get:function(){return t.arrayCopyChi ldNodes(this.node)},configurable:!0},children:{get:function(){return t.arrayCopy Children(this.node)},configurable:!0},textContent:{get:function(){return this.no de.textContent},set:function(e){return this.node.textContent=e},configurable:!0} ,innerHTML:{get:function(){return this.node.innerHTML},set:function(e){return th is.node.innerHTML=e},configurable:!0}});var i=function(e){for(var t=0;t<e.length ;t++)n(e[t])},n=function(e){o.prototype[e]=function(){return this.node[e].apply( this.node,arguments)}};i(["cloneNode","appendChild","insertBefore","removeChild" ,"replaceChild","setAttribute","removeAttribute","querySelector"]);var s=functio n(e){for(var t=0;t<e.length;t++)r(e[t])},r=function(e){Object.defineProperty(o.p rototype,e,{get:function(){return this.node[e]},configurable:!0})};s(["parentNod e","firstChild","lastChild","nextSibling","previousSibling","firstElementChild", "lastElementChild","nextElementSibling","previousElementSibling"])}}(),Polymer.B ase.extend(Polymer.dom,{_flushGuard:0,_FLUSH_MAX:100,_needsTakeRecords:!Polymer. Settings.useNativeCustomElements,_debouncers:[],_staticFlushList:[],_finishDebou ncer:null,flush:function(){for(this._flushGuard=0,this._prepareFlush();this._deb ouncers.length&&this._flushGuard<this._FLUSH_MAX;){for(;this._debouncers.length; )this._debouncers.shift().complete();this._finishDebouncer&&this._finishDebounce r.complete(),this._prepareFlush(),this._flushGuard++}this._flushGuard>=this._FLU SH_MAX&&console.warn("Polymer.dom.flush aborted. Flush may not be complete.")},_ prepareFlush:function(){this._needsTakeRecords&&CustomElements.takeRecords();for (var e=0;e<this._staticFlushList.length;e++)this._staticFlushList[e]()},addStati cFlush:function(e){this._staticFlushList.push(e)},removeStaticFlush:function(e){ var t=this._staticFlushList.indexOf(e);t>=0&&this._staticFlushList.splice(t,1)}, addDebouncer:function(e){this._debouncers.push(e),this._finishDebouncer=Polymer. Debounce(this._finishDebouncer,this._finishFlush)},_finishFlush:function(){Polym er.dom._debouncers=[]}}),Polymer.EventApi=function(){"use strict";var e=Polymer. DomApi.ctor,t=Polymer.Settings;e.Event=function(e){this.event=e},t.useShadow?e.E vent.prototype={get rootTarget(){return this.event.path[0]},get localTarget(){re turn this.event.target},get path(){var e=this.event.path;return Array.isArray(e) ||(e=Array.prototype.slice.call(e)),e}}:e.Event.prototype={get rootTarget(){retu rn this.event.target},get localTarget(){for(var e=this.event.currentTarget,t=e&& Polymer.dom(e).getOwnerRoot(),o=this.path,i=0;i<o.length;i++)if(Polymer.dom(o[i] ).getOwnerRoot()===t)return o[i]},get path(){if(!this.event._path){for(var e=[], t=this.rootTarget;t;){e.push(t);var o=Polymer.dom(t).getDestinationInsertionPoin ts();if(o.length){for(var i=0;i<o.length-1;i++)e.push(o[i]);t=o[o.length-1]}else t=Polymer.dom(t).parentNode||t.host}e.push(window),this.event._path=e}return th is.event._path}};var o=function(t){return t.__eventApi||(t.__eventApi=new e.Even t(t)),t.__eventApi};return{factory:o}}(),function(){"use strict";var e=Polymer.D omApi.ctor,t=Polymer.Settings.useShadow;Object.defineProperty(e.prototype,"class List",{get:function(){return this._classList||(this._classList=new e.ClassList(t his)),this._classList},configurable:!0}),e.ClassList=function(e){this.domApi=e,t his.node=e.node},e.ClassList.prototype={add:function(){this.node.classList.add.a pply(this.node.classList,arguments),this._distributeParent()},remove:function(){ this.node.classList.remove.apply(this.node.classList,arguments),this._distribute Parent()},toggle:function(){this.node.classList.toggle.apply(this.node.classList ,arguments),this._distributeParent()},_distributeParent:function(){t||this.domAp i._maybeDistributeParent()},contains:function(){return this.node.classList.conta ins.apply(this.node.classList,arguments)}}}(),function(){"use strict";var e=Poly mer.DomApi.ctor,t=Polymer.Settings;if(e.EffectiveNodesObserver=function(e){this. domApi=e,this.node=this.domApi.node,this._listeners=[]},e.EffectiveNodesObserver .prototype={addListener:function(e){this._isSetup||(this._setup(),this._isSetup= !0);var t={fn:e,_nodes:[]};return this._listeners.push(t),this._scheduleNotify() ,t},removeListener:function(e){var t=this._listeners.indexOf(e);t>=0&&(this._lis teners.splice(t,1),e._nodes=[]),this._hasListeners()||(this._cleanup(),this._isS etup=!1)},_setup:function(){this._observeContentElements(this.domApi.childNodes) },_cleanup:function(){this._unobserveContentElements(this.domApi.childNodes)},_h asListeners:function(){return Boolean(this._listeners.length)},_scheduleNotify:f unction(){this._debouncer&&this._debouncer.stop(),this._debouncer=Polymer.Deboun ce(this._debouncer,this._notify),this._debouncer.context=this,Polymer.dom.addDeb ouncer(this._debouncer)},notify:function(){this._hasListeners()&&this._scheduleN otify()},_notify:function(){this._beforeCallListeners(),this._callListeners()},_ beforeCallListeners:function(){this._updateContentElements()},_updateContentElem ents:function(){this._observeContentElements(this.domApi.childNodes)},_observeCo ntentElements:function(e){for(var t,o=0;o<e.length&&(t=e[o]);o++)this._isContent (t)&&(t.__observeNodesMap=t.__observeNodesMap||new WeakMap,t.__observeNodesMap.h as(this)||t.__observeNodesMap.set(this,this._observeContent(t)))},_observeConten t:function(e){var t=this,o=Polymer.dom(e).observeNodes(function(){t._scheduleNot ify()});return o._avoidChangeCalculation=!0,o},_unobserveContentElements:functio n(e){for(var t,o,i=0;i<e.length&&(t=e[i]);i++)this._isContent(t)&&(o=t.__observe NodesMap.get(this),o&&(Polymer.dom(t).unobserveNodes(o),t.__observeNodesMap.dele te(this)))},_isContent:function(e){return"content"===e.localName},_callListeners :function(){for(var e,t=this._listeners,o=this._getEffectiveNodes(),i=0;i<t.leng th&&(e=t[i]);i++){var n=this._generateListenerInfo(e,o);(n||e._alwaysNotify)&&th is._callListener(e,n)}},_getEffectiveNodes:function(){return this.domApi.getEffe ctiveChildNodes()},_generateListenerInfo:function(e,t){if(e._avoidChangeCalculat ion)return!0;for(var o,i=e._nodes,n={target:this.node,addedNodes:[],removedNodes :[]},s=Polymer.ArraySplice.calculateSplices(t,i),r=0;r<s.length&&(o=s[r]);r++)fo r(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)n.removedNodes.push(d);for( r=0,o;r<s.length&&(o=s[r]);r++)for(a=o.index;a<o.index+o.addedCount;a++)n.addedN odes.push(t[a]);return e._nodes=t,n.addedNodes.length||n.removedNodes.length?n:v oid 0},_callListener:function(e,t){return e.fn.call(this.node,t)},enableShadowAt tributeTracking:function(){}},t.useShadow){var o=e.EffectiveNodesObserver.protot ype._setup,i=e.EffectiveNodesObserver.prototype._cleanup;Polymer.Base.extend(e.E ffectiveNodesObserver.prototype,{_setup:function(){if(!this._observer){var e=thi s;this._mutationHandler=function(t){t&&t.length&&e._scheduleNotify()},this._obse rver=new MutationObserver(this._mutationHandler),this._boundFlush=function(){e._ flush()},Polymer.dom.addStaticFlush(this._boundFlush),this._observer.observe(thi s.node,{childList:!0})}o.call(this)},_cleanup:function(){this._observer.disconne ct(),this._observer=null,this._mutationHandler=null,Polymer.dom.removeStaticFlus h(this._boundFlush),i.call(this)},_flush:function(){this._observer&&this._mutati onHandler(this._observer.takeRecords())},enableShadowAttributeTracking:function( ){if(this._observer){this._makeContentListenersAlwaysNotify(),this._observer.dis connect(),this._observer.observe(this.node,{childList:!0,attributes:!0,subtree:! 0});var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).observer&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}},_makeContentListenersAlwa ysNotify:function(){for(var e,t=0;t<this._listeners.length;t++)e=this._listeners [t],e._alwaysNotify=e._isContentListener}})}}(),function(){"use strict";var e=Po lymer.DomApi.ctor,t=Polymer.Settings;e.DistributedNodesObserver=function(t){e.Ef fectiveNodesObserver.call(this,t)},e.DistributedNodesObserver.prototype=Object.c reate(e.EffectiveNodesObserver.prototype),Polymer.Base.extend(e.DistributedNodes Observer.prototype,{_setup:function(){},_cleanup:function(){},_beforeCallListene rs:function(){},_getEffectiveNodes:function(){return this.domApi.getDistributedN odes()}}),t.useShadow&&Polymer.Base.extend(e.DistributedNodesObserver.prototype, {_setup:function(){if(!this._observer){var e=this.domApi.getOwnerRoot(),t=e&&e.h ost;if(t){var o=this;this._observer=Polymer.dom(t).observeNodes(function(){o._sc heduleNotify()}),this._observer._isContentListener=!0,this._hasAttrSelect()&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}}},_hasAttrSelect:function( ){var e=this.node.getAttribute("select");return e&&e.match(/[[.]+/)},_cleanup:fu nction(){var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).unobserv eNodes(this._observer),this._observer=null}})}(),function(){function e(e,t){t._d istributedNodes.push(e);var o=e._destinationInsertionPoints;o?o.push(t):e._desti nationInsertionPoints=[t]}function t(e){var t=e._distributedNodes;if(t)for(var o =0;o<t.length;o++){var i=t[o]._destinationInsertionPoints;i&&i.splice(i.indexOf( e)+1,i.length)}}function o(e,t){var o=u.Logical.getParentNode(e);o&&o.shadyRoot& &h.hasInsertionPoint(o.shadyRoot)&&o.shadyRoot._distributionClean&&(o.shadyRoot. _distributionClean=!1,t.shadyRoot._dirtyRoots.push(o))}function i(e,t){var o=t._ destinationInsertionPoints;return o&&o[o.length-1]===e}function n(e){return"cont ent"==e.localName}function s(e){for(;e&&r(e);)e=e.domHost;return e}function r(e) {for(var t,o=u.Logical.getChildNodes(e),i=0;i<o.length;i++)if(t=o[i],t.localName &&"content"===t.localName)return e.domHost}function d(e){for(var t,o=0;o<e._inse rtionPoints.length;o++)t=e._insertionPoints[o],h.hasApi(t)&&Polymer.dom(t).notif yObserver()}function a(e){h.hasApi(e)&&Polymer.dom(e).notifyObserver()}function l(e){if(c&&e)for(var t=0;t<e.length;t++)CustomElements.upgrade(e[t])}var h=Polym er.DomApi,u=Polymer.TreeApi;Polymer.Base._addFeature({_prepShady:function(){this ._useContent=this._useContent||Boolean(this._template)},_setupShady:function(){t his.shadyRoot=null,this.__domApi||(this.__domApi=null),this.__dom||(this.__dom=n ull),this._ownerShadyRoot||(this._ownerShadyRoot=void 0)},_poolContent:function( ){this._useContent&&u.Logical.saveChildNodes(this)},_setupRoot:function(){this._ useContent&&(this._createLocalRoot(),this.dataHost||l(u.Logical.getChildNodes(th is)))},_createLocalRoot:function(){this.shadyRoot=this.root,this.shadyRoot._dist ributionClean=!1,this.shadyRoot._hasDistributed=!1,this.shadyRoot._isShadyRoot=! 0,this.shadyRoot._dirtyRoots=[];var e=this.shadyRoot._insertionPoints=!this._not es||this._notes._hasContent?this.shadyRoot.querySelectorAll("content"):[];u.Logi cal.saveChildNodes(this.shadyRoot);for(var t,o=0;o<e.length;o++)t=e[o],u.Logical .saveChildNodes(t),u.Logical.saveChildNodes(t.parentNode);this.shadyRoot.host=th is},get domHost(){var e=Polymer.dom(this).getOwnerRoot();return e&&e.host},distr ibuteContent:function(e){if(this.shadyRoot){this.shadyRoot._invalidInsertionPoin ts=this.shadyRoot._invalidInsertionPoints||e;var t=s(this);Polymer.dom(this)._la zyDistribute(t)}},_distributeContent:function(){this._useContent&&!this.shadyRoo t._distributionClean&&(this.shadyRoot._invalidInsertionPoints&&(Polymer.dom(this )._updateInsertionPoints(this),this.shadyRoot._invalidInsertionPoints=!1),this._ beginDistribute(),this._distributeDirtyRoots(),this._finishDistribute())},_begin Distribute:function(){this._useContent&&h.hasInsertionPoint(this.shadyRoot)&&(th is._resetDistribution(),this._distributePool(this.shadyRoot,this._collectPool()) ); 1 <!DOCTYPE html><html><head><meta charset="UTF-8"> </head><body><div hidden="" by -vulcanize=""><script>!function(){function e(){document.body.removeAttribute("un resolved")}window.WebComponents?addEventListener("WebComponentsReady",e):"intera ctive"===document.readyState||"complete"===document.readyState?e():addEventListe ner("DOMContentLoaded",e)}(),window.Polymer={Settings:function(){var e=window.Po lymer||{};if(!e.noUrlSettings)for(var t,r=location.search.slice(1).split("&"),i= 0;i<r.length&&(t=r[i]);i++)t=t.split("="),t[0]&&(e[t[0]]=t[1]||!0);return e.want Shadow="shadow"===e.dom,e.hasShadow=Boolean(Element.prototype.createShadowRoot), e.nativeShadow=e.hasShadow&&!window.ShadowDOMPolyfill,e.useShadow=e.wantShadow&& e.hasShadow,e.hasNativeImports=Boolean("import"in document.createElement("link") ),e.useNativeImports=e.hasNativeImports,e.useNativeCustomElements=!window.Custom Elements||window.CustomElements.useNative,e.useNativeShadow=e.useShadow&&e.nativ eShadow,e.usePolyfillProto=!e.useNativeCustomElements&&!Object.__proto__,e.hasNa tiveCSSProperties=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS .supports&&CSS.supports("box-shadow","0 0 0 var(--foo)"),e.useNativeCSSPropertie s=e.hasNativeCSSProperties&&e.lazyRegister&&e.useNativeCSSProperties,e}()},funct ion(){var e=window.Polymer;window.Polymer=function(e){"function"==typeof e&&(e=e .prototype),e||(e={});var r=t(e);e=r.prototype;var i={prototype:e};return e.exte nds&&(i.extends=e.extends),Polymer.telemetry._registrate(e),document.registerEle ment(e.is,i),r};var t=function(e){var t=Polymer.Base;return e.extends&&(t=Polyme r.Base._getExtendedPrototype(e.extends)),e=Polymer.Base.chainObject(e,t),e.regis terCallback(),e.constructor};if(e)for(var r in e)Polymer[r]=e[r];Polymer.Class=t }(),Polymer.telemetry={registrations:[],_regLog:function(e){console.log("["+e.is +"]: registered")},_registrate:function(e){this.registrations.push(e),Polymer.lo g&&this._regLog(e)},dumpRegistrations:function(){this.registrations.forEach(this ._regLog)}},Object.defineProperty(window,"currentImport",{enumerable:!0,configur able:!0,get:function(){return(document._currentScript||document.currentScript).o wnerDocument}}),Polymer.RenderStatus={_ready:!1,_callbacks:[],whenReady:function (e){this._ready?e():this._callbacks.push(e)},_makeReady:function(){this._ready=! 0;for(var e=0;e<this._callbacks.length;e++)this._callbacks[e]();this._callbacks= []},_catchFirstRender:function(){requestAnimationFrame(function(){Polymer.Render Status._makeReady()})},_afterNextRenderQueue:[],_waitingNextRender:!1,afterNextR ender:function(e,t,r){this._watchNextRender(),this._afterNextRenderQueue.push([e ,t,r])},hasRendered:function(){return this._ready},_watchNextRender:function(){i f(!this._waitingNextRender){this._waitingNextRender=!0;var e=function(){Polymer. RenderStatus._flushNextRender()};this._ready?requestAnimationFrame(e):this.whenR eady(e)}},_flushNextRender:function(){var e=this;setTimeout(function(){e._flushR enderCallbacks(e._afterNextRenderQueue),e._afterNextRenderQueue=[],e._waitingNex tRender=!1})},_flushRenderCallbacks:function(e){for(var t,r=0;r<e.length;r++)t=e [r],t[1].apply(t[0],t[2]||Polymer.nar)}},window.HTMLImports?HTMLImports.whenRead y(function(){Polymer.RenderStatus._catchFirstRender()}):Polymer.RenderStatus._ca tchFirstRender(),Polymer.ImportStatus=Polymer.RenderStatus,Polymer.ImportStatus. whenLoaded=Polymer.ImportStatus.whenReady,function(){"use strict";var e=Polymer. Settings;Polymer.Base={__isPolymerInstance__:!0,_addFeature:function(e){this.ext end(this,e)},registerCallback:function(){"max"===e.lazyRegister?this.beforeRegis ter&&this.beforeRegister():(this._desugarBehaviors(),this._doBehavior("beforeReg ister")),this._registerFeatures(),e.lazyRegister||this.ensureRegisterFinished()} ,createdCallback:function(){this.__hasRegisterFinished||this._ensureRegisterFini shed(this.__proto__),Polymer.telemetry.instanceCount++,this.root=this,this._doBe havior("created"),this._initFeatures()},ensureRegisterFinished:function(){this._ ensureRegisterFinished(this)},_ensureRegisterFinished:function(t){t.__hasRegiste rFinished===t.is&&t.is||("max"===e.lazyRegister&&(t._desugarBehaviors(),t._doBeh aviorOnly("beforeRegister")),t.__hasRegisterFinished=t.is,t._finishRegisterFeatu res&&t._finishRegisterFeatures(),t._doBehavior("registered"),e.usePolyfillProto& &t!==this&&t.extend(this,t))},attachedCallback:function(){var e=this;Polymer.Ren derStatus.whenReady(function(){e.isAttached=!0,e._doBehavior("attached")})},deta chedCallback:function(){var e=this;Polymer.RenderStatus.whenReady(function(){e.i sAttached=!1,e._doBehavior("detached")})},attributeChangedCallback:function(e,t, r){this._attributeChangedImpl(e),this._doBehavior("attributeChanged",[e,t,r])},_ attributeChangedImpl:function(e){this._setAttributeToProperty(this,e)},extend:fu nction(e,t){if(e&&t)for(var r,i=Object.getOwnPropertyNames(t),o=0;o<i.length&&(r =i[o]);o++)this.copyOwnProperty(r,t,e);return e||t},mixin:function(e,t){for(var r in t)e[r]=t[r];return e},copyOwnProperty:function(e,t,r){var i=Object.getOwnPr opertyDescriptor(t,e);i&&Object.defineProperty(r,e,i)},_logger:function(e,t){swi tch(1===t.length&&Array.isArray(t[0])&&(t=t[0]),e){case"log":case"warn":case"err or":console[e].apply(console,t)}},_log:function(){var e=Array.prototype.slice.ca ll(arguments,0);this._logger("log",e)},_warn:function(){var e=Array.prototype.sl ice.call(arguments,0);this._logger("warn",e)},_error:function(){var e=Array.prot otype.slice.call(arguments,0);this._logger("error",e)},_logf:function(){return t his._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments,0))}} ,Polymer.Base._logPrefix=function(){var e=window.chrome&&!/edge/i.test(navigator .userAgent)||/firefox/i.test(navigator.userAgent);return e?["%c[%s::%s]:","font- weight: bold; background-color:#EEEE00;"]:["[%s::%s]:"]}(),Polymer.Base.chainObj ect=function(e,t){return e&&t&&e!==t&&(Object.__proto__||(e=Polymer.Base.extend( Object.create(t),e)),e.__proto__=t),e},Polymer.Base=Polymer.Base.chainObject(Pol ymer.Base,HTMLElement.prototype),window.CustomElements?Polymer.instanceof=Custom Elements.instanceof:Polymer.instanceof=function(e,t){return e instanceof t},Poly mer.isInstance=function(e){return Boolean(e&&e.__isPolymerInstance__)},Polymer.t elemetry.instanceCount=0}(),function(){function e(){if(s)for(var e,t=document._c urrentScript||document.currentScript,r=t&&t.ownerDocument||document,i=r.querySel ectorAll("dom-module"),o=i.length-1;o>=0&&(e=i[o]);o--){if(e.__upgraded__)return ;CustomElements.upgrade(e)}}var t={},r={},i=function(e){return t[e]||r[e.toLower Case()]},o=function(){return document.createElement("dom-module")};o.prototype=O bject.create(HTMLElement.prototype),Polymer.Base.extend(o.prototype,{constructor :o,createdCallback:function(){this.register()},register:function(e){e=e||this.id ||this.getAttribute("name")||this.getAttribute("is"),e&&(this.id=e,t[e]=this,r[e .toLowerCase()]=this)},import:function(t,r){if(t){var o=i(t);return o||(e(),o=i( t)),o&&r&&(o=o.querySelector(r)),o}}});var s=window.CustomElements&&!CustomEleme nts.useNative;document.registerElement("dom-module",o)}(),Polymer.Base._addFeatu re({_prepIs:function(){if(!this.is){var e=(document._currentScript||document.cur rentScript).parentNode;if("dom-module"===e.localName){var t=e.id||e.getAttribute ("name")||e.getAttribute("is");this.is=t}}this.is&&(this.is=this.is.toLowerCase( ))}}),Polymer.Base._addFeature({behaviors:[],_desugarBehaviors:function(){this.b ehaviors.length&&(this.behaviors=this._desugarSomeBehaviors(this.behaviors))},_d esugarSomeBehaviors:function(e){var t=[];e=this._flattenBehaviorsList(e);for(var r=e.length-1;r>=0;r--){var i=e[r];t.indexOf(i)===-1&&(this._mixinBehavior(i),t. unshift(i))}return t},_flattenBehaviorsList:function(e){for(var t=[],r=0;r<e.len gth;r++){var i=e[r];i instanceof Array?t=t.concat(this._flattenBehaviorsList(i)) :i?t.push(i):this._warn(this._logf("_flattenBehaviorsList","behavior is null, ch eck for missing or 404 import"))}return t},_mixinBehavior:function(e){for(var t, r=Object.getOwnPropertyNames(e),i=0;i<r.length&&(t=r[i]);i++)Polymer.Base._behav iorProperties[t]||this.hasOwnProperty(t)||this.copyOwnProperty(t,e,this)},_prepB ehaviors:function(){this._prepFlattenedBehaviors(this.behaviors)},_prepFlattened Behaviors:function(e){for(var t=0,r=e.length;t<r;t++)this._prepBehavior(e[t]);th is._prepBehavior(this)},_doBehavior:function(e,t){for(var r=0;r<this.behaviors.l ength;r++)this._invokeBehavior(this.behaviors[r],e,t);this._invokeBehavior(this, e,t)},_doBehaviorOnly:function(e,t){for(var r=0;r<this.behaviors.length;r++)this ._invokeBehavior(this.behaviors[r],e,t)},_invokeBehavior:function(e,t,r){var i=e [t];i&&i.apply(this,r||Polymer.nar)},_marshalBehaviors:function(){for(var e=0;e< this.behaviors.length;e++)this._marshalBehavior(this.behaviors[e]);this._marshal Behavior(this)}}),Polymer.Base._behaviorProperties={hostAttributes:!0,beforeRegi ster:!0,registered:!0,properties:!0,observers:!0,listeners:!0,created:!0,attache d:!0,detached:!0,attributeChanged:!0,ready:!0},Polymer.Base._addFeature({_getExt endedPrototype:function(e){return this._getExtendedNativePrototype(e)},_nativePr ototypes:{},_getExtendedNativePrototype:function(e){var t=this._nativePrototypes [e];if(!t){var r=this.getNativePrototype(e);t=this.extend(Object.create(r),Polym er.Base),this._nativePrototypes[e]=t}return t},getNativePrototype:function(e){re turn Object.getPrototypeOf(document.createElement(e))}}),Polymer.Base._addFeatur e({_prepConstructor:function(){this._factoryArgs=this.extends?[this.extends,this .is]:[this.is];var e=function(){return this._factory(arguments)};this.hasOwnProp erty("extends")&&(e.extends=this.extends),Object.defineProperty(this,"constructo r",{value:e,writable:!0,configurable:!0}),e.prototype=this},_factory:function(e) {var t=document.createElement.apply(document,this._factoryArgs);return this.fact oryImpl&&this.factoryImpl.apply(t,e),t}}),Polymer.nob=Object.create(null),Polyme r.Base._addFeature({properties:{},getPropertyInfo:function(e){var t=this._getPro pertyInfo(e,this.properties);if(!t)for(var r=0;r<this.behaviors.length;r++)if(t= this._getPropertyInfo(e,this.behaviors[r].properties))return t;return t||Polymer .nob},_getPropertyInfo:function(e,t){var r=t&&t[e];return"function"==typeof r&&( r=t[e]={type:r}),r&&(r.defined=!0),r},_prepPropertyInfo:function(){this._propert yInfo={};for(var e=0;e<this.behaviors.length;e++)this._addPropertyInfo(this._pro pertyInfo,this.behaviors[e].properties);this._addPropertyInfo(this._propertyInfo ,this.properties),this._addPropertyInfo(this._propertyInfo,this._propertyEffects )},_addPropertyInfo:function(e,t){if(t){var r,i;for(var o in t)r=e[o],i=t[o],("_ "!==o[0]||i.readOnly)&&(e[o]?(r.type||(r.type=i.type),r.readOnly||(r.readOnly=i. readOnly)):e[o]={type:"function"==typeof i?i:i.type,readOnly:i.readOnly,attribut e:Polymer.CaseMap.camelToDashCase(o)})}}}),Polymer.CaseMap={_caseMap:{},_rx:{das hToCamel:/-[a-z]/g,camelToDash:/([A-Z])/g},dashToCamelCase:function(e){return th is._caseMap[e]||(this._caseMap[e]=e.indexOf("-")<0?e:e.replace(this._rx.dashToCa mel,function(e){return e[1].toUpperCase()}))},camelToDashCase:function(e){return this._caseMap[e]||(this._caseMap[e]=e.replace(this._rx.camelToDash,"-$1").toLow erCase())}},Polymer.Base._addFeature({_addHostAttributes:function(e){this._aggre gatedAttributes||(this._aggregatedAttributes={}),e&&this.mixin(this._aggregatedA ttributes,e)},_marshalHostAttributes:function(){this._aggregatedAttributes&&this ._applyAttributes(this,this._aggregatedAttributes)},_applyAttributes:function(e, t){for(var r in t)if(!this.hasAttribute(r)&&"class"!==r){var i=t[r];this.seriali zeValueToAttribute(i,r,this)}},_marshalAttributes:function(){this._takeAttribute sToModel(this)},_takeAttributesToModel:function(e){if(this.hasAttributes())for(v ar t in this._propertyInfo){var r=this._propertyInfo[t];this.hasAttribute(r.attr ibute)&&this._setAttributeToProperty(e,r.attribute,t,r)}},_setAttributeToPropert y:function(e,t,r,i){if(!this._serializing&&(r=r||Polymer.CaseMap.dashToCamelCase (t),i=i||this._propertyInfo&&this._propertyInfo[r],i&&!i.readOnly)){var o=this.g etAttribute(t);e[r]=this.deserialize(o,i.type)}},_serializing:!1,reflectProperty ToAttribute:function(e,t,r){this._serializing=!0,r=void 0===r?this[e]:r,this.ser ializeValueToAttribute(r,t||Polymer.CaseMap.camelToDashCase(e)),this._serializin g=!1},serializeValueToAttribute:function(e,t,r){var i=this.serialize(e);r=r||thi s,void 0===i?r.removeAttribute(t):r.setAttribute(t,i)},deserialize:function(e,t) {switch(t){case Number:e=Number(e);break;case Boolean:e=null!=e;break;case Objec t:try{e=JSON.parse(e)}catch(e){}break;case Array:try{e=JSON.parse(e)}catch(t){e= null,console.warn("Polymer::Attributes: couldn`t decode Array as JSON")}break;ca se Date:e=new Date(e);break;case String:}return e},serialize:function(e){switch( typeof e){case"boolean":return e?"":void 0;case"object":if(e instanceof Date)ret urn e.toString();if(e)try{return JSON.stringify(e)}catch(e){return""}default:ret urn null!=e?e:void 0}}}),Polymer.version="1.7.0",Polymer.Base._addFeature({_regi sterFeatures:function(){this._prepIs(),this._prepBehaviors(),this._prepConstruct or(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHostAttributes (e.hostAttributes)},_marshalBehavior:function(e){},_initFeatures:function(){this ._marshalHostAttributes(),this._marshalBehaviors()}})</script> <script>Polymer.B ase._addFeature({_prepTemplate:function(){void 0===this._template&&(this._templa te=Polymer.DomModule.import(this.is,"template")),this._template&&this._template. hasAttribute("is")&&this._warn(this._logf("_prepTemplate","top-level Polymer tem plate must not be a type-extension, found",this._template,"Move inside simple <t emplate>.")),this._template&&!this._template.content&&window.HTMLTemplateElement &&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(this._template)},_s tampTemplate:function(){this._template&&(this.root=this.instanceTemplate(this._t emplate))},instanceTemplate:function(e){var t=document.importNode(e._content||e. content,!0);return t}}),function(){var e=Polymer.Base.attachedCallback;Polymer.B ase._addFeature({_hostStack:[],ready:function(){},_registerHost:function(e){this .dataHost=e=e||Polymer.Base._hostStack[Polymer.Base._hostStack.length-1],e&&e._c lients&&e._clients.push(this),this._clients=null,this._clientsReadied=!1},_begin Hosting:function(){Polymer.Base._hostStack.push(this),this._clients||(this._clie nts=[])},_endHosting:function(){Polymer.Base._hostStack.pop()},_tryReady:functio n(){this._readied=!1,this._canReady()&&this._ready()},_canReady:function(){retur n!this.dataHost||this.dataHost._clientsReadied},_ready:function(){this._beforeCl ientsReady(),this._template&&(this._setupRoot(),this._readyClients()),this._clie ntsReadied=!0,this._clients=null,this._afterClientsReady(),this._readySelf()},_r eadyClients:function(){this._beginDistribute();var e=this._clients;if(e)for(var t,o=0,i=e.length;o<i&&(t=e[o]);o++)t._ready();this._finishDistribute()},_readySe lf:function(){this._doBehavior("ready"),this._readied=!0,this._attachedPending&& (this._attachedPending=!1,this.attachedCallback())},_beforeClientsReady:function (){},_afterClientsReady:function(){},_beforeAttached:function(){},attachedCallba ck:function(){this._readied?(this._beforeAttached(),e.call(this)):this._attached Pending=!0}})}(),Polymer.ArraySplice=function(){function e(e,t,o){return{index:e ,removed:t,addedCount:o}}function t(){}var o=0,i=1,n=2,s=3;return t.prototype={c alcEditDistances:function(e,t,o,i,n,s){for(var r=s-n+1,d=o-t+1,a=new Array(r),l= 0;l<r;l++)a[l]=new Array(d),a[l][0]=l;for(var h=0;h<d;h++)a[0][h]=h;for(l=1;l<r; l++)for(h=1;h<d;h++)if(this.equals(e[t+h-1],i[n+l-1]))a[l][h]=a[l-1][h-1];else{v ar u=a[l-1][h]+1,c=a[l][h-1]+1;a[l][h]=u<c?u:c}return a},spliceOperationsFromEdi tDistances:function(e){for(var t=e.length-1,r=e[0].length-1,d=e[t][r],a=[];t>0|| r>0;)if(0!=t)if(0!=r){var l,h=e[t-1][r-1],u=e[t-1][r],c=e[t][r-1];l=u<c?u<h?u:h: c<h?c:h,l==h?(h==d?a.push(o):(a.push(i),d=h),t--,r--):l==u?(a.push(s),t--,d=u):( a.push(n),r--,d=c)}else a.push(s),t--;else a.push(n),r--;return a.reverse(),a},c alcSplices:function(t,r,d,a,l,h){var u=0,c=0,_=Math.min(d-r,h-l);if(0==r&&0==l&& (u=this.sharedPrefix(t,a,_)),d==t.length&&h==a.length&&(c=this.sharedSuffix(t,a, _-u)),r+=u,l+=u,d-=c,h-=c,d-r==0&&h-l==0)return[];if(r==d){for(var f=e(r,[],0);l <h;)f.removed.push(a[l++]);return[f]}if(l==h)return[e(r,[],d-r)];var m=this.spli ceOperationsFromEditDistances(this.calcEditDistances(t,r,d,a,l,h));f=void 0;for( var p=[],v=r,g=l,b=0;b<m.length;b++)switch(m[b]){case o:f&&(p.push(f),f=void 0), v++,g++;break;case i:f||(f=e(v,[],0)),f.addedCount++,v++,f.removed.push(a[g]),g+ +;break;case n:f||(f=e(v,[],0)),f.addedCount++,v++;break;case s:f||(f=e(v,[],0)) ,f.removed.push(a[g]),g++}return f&&p.push(f),p},sharedPrefix:function(e,t,o){fo r(var i=0;i<o;i++)if(!this.equals(e[i],t[i]))return i;return o},sharedSuffix:fun ction(e,t,o){for(var i=e.length,n=t.length,s=0;s<o&&this.equals(e[--i],t[--n]);) s++;return s},calculateSplices:function(e,t){return this.calcSplices(e,0,e.lengt h,t,0,t.length)},equals:function(e,t){return e===t}},new t}(),Polymer.domInnerHT ML=function(){function e(e){switch(e){case"&":return"&amp;";case"<":return"&lt;" ;case">":return"&gt;";case'"':return"&quot;";case" ":return"&nbsp;"}}function t( t){return t.replace(r,e)}function o(t){return t.replace(d,e)}function i(e){for(v ar t={},o=0;o<e.length;o++)t[e[o]]=!0;return t}function n(e,i,n){switch(e.nodeTy pe){case Node.ELEMENT_NODE:for(var r,d=e.localName,h="<"+d,u=e.attributes,c=0;r= u[c];c++)h+=" "+r.name+'="'+t(r.value)+'"';return h+=">",a[d]?h:h+s(e,n)+"</"+d+ ">";case Node.TEXT_NODE:var _=e.data;return i&&l[i.localName]?_:o(_);case Node.C OMMENT_NODE:return"\x3c!--"+e.data+"--\x3e";default:throw console.error(e),new E rror("not implemented")}}function s(e,t){e instanceof HTMLTemplateElement&&(e=e. content);for(var o,i="",s=Polymer.dom(e).childNodes,r=0,d=s.length;r<d&&(o=s[r]) ;r++)i+=n(o,e,t);return i}var r=/[&\u00A0"]/g,d=/[&\u00A0<>]/g,a=i(["area","base ","br","col","command","embed","hr","img","input","keygen","link","meta","param" ,"source","track","wbr"]),l=i(["style","script","xmp","iframe","noembed","nofram es","plaintext","noscript"]);return{getInnerHTML:s}}(),function(){"use strict";v ar e=Element.prototype.insertBefore,t=Element.prototype.appendChild,o=Element.pr ototype.removeChild;Polymer.TreeApi={arrayCopyChildNodes:function(e){for(var t=[ ],o=0,i=e.firstChild;i;i=i.nextSibling)t[o++]=i;return t},arrayCopyChildren:func tion(e){for(var t=[],o=0,i=e.firstElementChild;i;i=i.nextElementSibling)t[o++]=i ;return t},arrayCopy:function(e){for(var t=e.length,o=new Array(t),i=0;i<t;i++)o [i]=e[i];return o}},Polymer.TreeApi.Logical={hasParentNode:function(e){return Bo olean(e.__dom&&e.__dom.parentNode)},hasChildNodes:function(e){return Boolean(e._ _dom&&void 0!==e.__dom.childNodes)},getChildNodes:function(e){return this.hasChi ldNodes(e)?this._getChildNodes(e):e.childNodes},_getChildNodes:function(e){if(!e .__dom.childNodes){e.__dom.childNodes=[];for(var t=e.__dom.firstChild;t;t=t.__do m.nextSibling)e.__dom.childNodes.push(t)}return e.__dom.childNodes},getParentNod e:function(e){return e.__dom&&void 0!==e.__dom.parentNode?e.__dom.parentNode:e.p arentNode},getFirstChild:function(e){return e.__dom&&void 0!==e.__dom.firstChild ?e.__dom.firstChild:e.firstChild},getLastChild:function(e){return e.__dom&&void 0!==e.__dom.lastChild?e.__dom.lastChild:e.lastChild},getNextSibling:function(e){ return e.__dom&&void 0!==e.__dom.nextSibling?e.__dom.nextSibling:e.nextSibling}, getPreviousSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling? e.__dom.previousSibling:e.previousSibling},getFirstElementChild:function(e){retu rn e.__dom&&void 0!==e.__dom.firstChild?this._getFirstElementChild(e):e.firstEle mentChild},_getFirstElementChild:function(e){for(var t=e.__dom.firstChild;t&&t.n odeType!==Node.ELEMENT_NODE;)t=t.__dom.nextSibling;return t},getLastElementChild :function(e){return e.__dom&&void 0!==e.__dom.lastChild?this._getLastElementChil d(e):e.lastElementChild},_getLastElementChild:function(e){for(var t=e.__dom.last Child;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},get NextElementSibling:function(e){return e.__dom&&void 0!==e.__dom.nextSibling?this ._getNextElementSibling(e):e.nextElementSibling},_getNextElementSibling:function (e){for(var t=e.__dom.nextSibling;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.n extSibling;return t},getPreviousElementSibling:function(e){return e.__dom&&void 0!==e.__dom.previousSibling?this._getPreviousElementSibling(e):e.previousElement Sibling},_getPreviousElementSibling:function(e){for(var t=e.__dom.previousSiblin g;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.__dom.previousSibling;return t},saveChi ldNodes:function(e){if(!this.hasChildNodes(e)){e.__dom=e.__dom||{},e.__dom.first Child=e.firstChild,e.__dom.lastChild=e.lastChild,e.__dom.childNodes=[];for(var t =e.firstChild;t;t=t.nextSibling)t.__dom=t.__dom||{},t.__dom.parentNode=e,e.__dom .childNodes.push(t),t.__dom.nextSibling=t.nextSibling,t.__dom.previousSibling=t. previousSibling}},recordInsertBefore:function(e,t,o){if(t.__dom.childNodes=null, e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(var i=e.firstChild;i;i=i.nextSiblin g)this._linkNode(i,t,o);else this._linkNode(e,t,o)},_linkNode:function(e,t,o){e. __dom=e.__dom||{},t.__dom=t.__dom||{},o&&(o.__dom=o.__dom||{}),e.__dom.previousS ibling=o?o.__dom.previousSibling:t.__dom.lastChild,e.__dom.previousSibling&&(e._ _dom.previousSibling.__dom.nextSibling=e),e.__dom.nextSibling=o||null,e.__dom.ne xtSibling&&(e.__dom.nextSibling.__dom.previousSibling=e),e.__dom.parentNode=t,o? o===t.__dom.firstChild&&(t.__dom.firstChild=e):(t.__dom.lastChild=e,t.__dom.firs tChild||(t.__dom.firstChild=e)),t.__dom.childNodes=null},recordRemoveChild:funct ion(e,t){e.__dom=e.__dom||{},t.__dom=t.__dom||{},e===t.__dom.firstChild&&(t.__do m.firstChild=e.__dom.nextSibling),e===t.__dom.lastChild&&(t.__dom.lastChild=e.__ dom.previousSibling);var o=e.__dom.previousSibling,i=e.__dom.nextSibling;o&&(o._ _dom.nextSibling=i),i&&(i.__dom.previousSibling=o),e.__dom.parentNode=e.__dom.pr eviousSibling=e.__dom.nextSibling=void 0,t.__dom.childNodes=null}},Polymer.TreeA pi.Composed={getChildNodes:function(e){return Polymer.TreeApi.arrayCopyChildNode s(e)},getParentNode:function(e){return e.parentNode},clearChildNodes:function(e) {e.textContent=""},insertBefore:function(t,o,i){return e.call(t,o,i||null)},appe ndChild:function(e,o){return t.call(e,o)},removeChild:function(e,t){return o.cal l(e,t)}}}(),Polymer.DomApi=function(){"use strict";var e=Polymer.Settings,t=Poly mer.TreeApi,o=function(e){this.node=i?o.wrap(e):e},i=e.hasShadow&&!e.nativeShado w;o.wrap=window.wrap?window.wrap:function(e){return e},o.prototype={flush:functi on(){Polymer.dom.flush()},deepContains:function(e){if(this.node.contains(e))retu rn!0;for(var t=e,o=e.ownerDocument;t&&t!==o&&t!==this.node;)t=Polymer.dom(t).par entNode||t.host;return t===this.node},queryDistributedElements:function(e){for(v ar t,i=this.getEffectiveChildNodes(),n=[],s=0,r=i.length;s<r&&(t=i[s]);s++)t.nod eType===Node.ELEMENT_NODE&&o.matchesSelector.call(t,e)&&n.push(t);return n},getE ffectiveChildNodes:function(){for(var e,t=[],o=this.childNodes,i=0,r=o.length;i< r&&(e=o[i]);i++)if(e.localName===n)for(var d=s(e).getDistributedNodes(),a=0;a<d. length;a++)t.push(d[a]);else t.push(e);return t},observeNodes:function(e){if(e)r eturn this.observer||(this.observer=this.node.localName===n?new o.DistributedNod esObserver(this):new o.EffectiveNodesObserver(this)),this.observer.addListener(e )},unobserveNodes:function(e){this.observer&&this.observer.removeListener(e)},no tifyObserver:function(){this.observer&&this.observer.notify()},_query:function(e ,o,i){o=o||this.node;var n=[];return this._queryElements(t.Logical.getChildNodes (o),e,i,n),n},_queryElements:function(e,t,o,i){for(var n,s=0,r=e.length;s<r&&(n= e[s]);s++)if(n.nodeType===Node.ELEMENT_NODE&&this._queryElement(n,t,o,i))return! 0},_queryElement:function(e,o,i,n){var s=o(e);return s&&n.push(e),i&&i(s)?s:void this._queryElements(t.Logical.getChildNodes(e),o,i,n)}};var n=o.CONTENT="conten t",s=o.factory=function(e){return e=e||document,e.__domApi||(e.__domApi=new o.ct or(e)),e.__domApi};o.hasApi=function(e){return Boolean(e.__domApi)},o.ctor=o,Pol ymer.dom=function(e,t){return e instanceof Event?Polymer.EventApi.factory(e):o.f actory(e,t)};var r=Element.prototype;return o.matchesSelector=r.matches||r.match esSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.web kitMatchesSelector,o}(),function(){"use strict";var e=Polymer.Settings,t=Polymer .DomApi,o=t.factory,i=Polymer.TreeApi,n=Polymer.domInnerHTML.getInnerHTML,s=t.CO NTENT;if(!e.useShadow){var r=Element.prototype.cloneNode,d=Document.prototype.im portNode;Polymer.Base.extend(t.prototype,{_lazyDistribute:function(e){e.shadyRoo t&&e.shadyRoot._distributionClean&&(e.shadyRoot._distributionClean=!1,Polymer.do m.addDebouncer(e.debounce("_distribute",e._distributeContent)))},appendChild:fun ction(e){return this.insertBefore(e)},insertBefore:function(e,n){if(n&&i.Logical .getParentNode(n)!==this.node)throw Error("The ref_node to be inserted before is not a child of this node");if(e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){var r=i .Logical.getParentNode(e);r?(t.hasApi(r)&&o(r).notifyObserver(),this._removeNode (e)):this._removeOwnerShadyRoot(e)}if(!this._addNode(e,n)){n&&(n=n.localName===s ?this._firstComposedNode(n):n);var d=this.node._isShadyRoot?this.node.host:this. node;n?i.Composed.insertBefore(d,e,n):i.Composed.appendChild(d,e)}return this.no tifyObserver(),e},_addNode:function(e,t){var o=this.getOwnerRoot();if(o){var n=t his._maybeAddInsertionPoint(e,this.node);o._invalidInsertionPoints||(o._invalidI nsertionPoints=n),this._addNodeToHost(o.host,e)}i.Logical.hasChildNodes(this.nod e)&&i.Logical.recordInsertBefore(e,this.node,t);var s=this._maybeDistribute(e)|| this.node.shadyRoot;if(s)if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE)for(;e.firs tChild;)i.Composed.removeChild(e,e.firstChild);else{var r=i.Composed.getParentNo de(e);r&&i.Composed.removeChild(r,e)}return s},removeChild:function(e){if(i.Logi cal.getParentNode(e)!==this.node)throw Error("The node to be removed is not a ch ild of this node: "+e);if(!this._removeNode(e)){var t=this.node._isShadyRoot?thi s.node.host:this.node,o=i.Composed.getParentNode(e);t===o&&i.Composed.removeChil d(t,e)}return this.notifyObserver(),e},_removeNode:function(e){var t,n=i.Logical .hasParentNode(e)&&i.Logical.getParentNode(e),s=this._ownerShadyRootForNode(e);r eturn n&&(t=o(e)._maybeDistributeParent(),i.Logical.recordRemoveChild(e,n),s&&th is._removeDistributedChildren(s,e)&&(s._invalidInsertionPoints=!0,this._lazyDist ribute(s.host))),this._removeOwnerShadyRoot(e),s&&this._removeNodeFromHost(s.hos t,e),t},replaceChild:function(e,t){return this.insertBefore(e,t),this.removeChil d(t),e},_hasCachedOwnerRoot:function(e){return Boolean(void 0!==e._ownerShadyRoo t)},getOwnerRoot:function(){return this._ownerShadyRootForNode(this.node)},_owne rShadyRootForNode:function(e){if(e){var t=e._ownerShadyRoot;if(void 0===t){if(e. _isShadyRoot)t=e;else{var o=i.Logical.getParentNode(e);t=o?o._isShadyRoot?o:this ._ownerShadyRootForNode(o):null}(t||document.documentElement.contains(e))&&(e._o wnerShadyRoot=t)}return t}},_maybeDistribute:function(e){var t=e.nodeType===Node .DOCUMENT_FRAGMENT_NODE&&!e.__noContent&&o(e).querySelector(s),n=t&&i.Logical.ge tParentNode(t).nodeType!==Node.DOCUMENT_FRAGMENT_NODE,r=t||e.localName===s;if(r) {var d=this.getOwnerRoot();d&&this._lazyDistribute(d.host)}var a=this._nodeNeeds Distribution(this.node);return a&&this._lazyDistribute(this.node),a||r&&!n},_may beAddInsertionPoint:function(e,t){var n;if(e.nodeType!==Node.DOCUMENT_FRAGMENT_N ODE||e.__noContent)e.localName===s&&(i.Logical.saveChildNodes(t),i.Logical.saveC hildNodes(e),n=!0);else for(var r,d,a,l=o(e).querySelectorAll(s),h=0;h<l.length& &(r=l[h]);h++)d=i.Logical.getParentNode(r),d===e&&(d=t),a=this._maybeAddInsertio nPoint(r,d),n=n||a;return n},_updateInsertionPoints:function(e){for(var t,n=e.sh adyRoot._insertionPoints=o(e.shadyRoot).querySelectorAll(s),r=0;r<n.length;r++)t =n[r],i.Logical.saveChildNodes(t),i.Logical.saveChildNodes(i.Logical.getParentNo de(t))},_nodeNeedsDistribution:function(e){return e&&e.shadyRoot&&t.hasInsertion Point(e.shadyRoot)},_addNodeToHost:function(e,t){e._elementAdd&&e._elementAdd(t) },_removeNodeFromHost:function(e,t){e._elementRemove&&e._elementRemove(t)},_remo veDistributedChildren:function(e,t){for(var n,s=e._insertionPoints,r=0;r<s.lengt h;r++){var d=s[r];if(this._contains(t,d))for(var a=o(d).getDistributedNodes(),l= 0;l<a.length;l++){n=!0;var h=a[l],u=i.Composed.getParentNode(h);u&&i.Composed.re moveChild(u,h)}}return n},_contains:function(e,t){for(;t;){if(t==e)return!0;t=i. Logical.getParentNode(t)}},_removeOwnerShadyRoot:function(e){if(this._hasCachedO wnerRoot(e))for(var t,o=i.Logical.getChildNodes(e),n=0,s=o.length;n<s&&(t=o[n]); n++)this._removeOwnerShadyRoot(t);e._ownerShadyRoot=void 0},_firstComposedNode:f unction(e){for(var t,i,n=o(e).getDistributedNodes(),s=0,r=n.length;s<r&&(t=n[s]) ;s++)if(i=o(t).getDestinationInsertionPoints(),i[i.length-1]===e)return t},query Selector:function(e){var o=this._query(function(o){return t.matchesSelector.call (o,e)},this.node,function(e){return Boolean(e)})[0];return o||null},querySelecto rAll:function(e){return this._query(function(o){return t.matchesSelector.call(o, e)},this.node)},getDestinationInsertionPoints:function(){return this.node._desti nationInsertionPoints||[]},getDistributedNodes:function(){return this.node._dist ributedNodes||[]},_clear:function(){for(;this.childNodes.length;)this.removeChil d(this.childNodes[0])},setAttribute:function(e,t){this.node.setAttribute(e,t),th is._maybeDistributeParent()},removeAttribute:function(e){this.node.removeAttribu te(e),this._maybeDistributeParent()},_maybeDistributeParent:function(){if(this._ nodeNeedsDistribution(this.parentNode))return this._lazyDistribute(this.parentNo de),!0},cloneNode:function(e){var t=r.call(this.node,!1);if(e)for(var i,n=this.c hildNodes,s=o(t),d=0;d<n.length;d++)i=o(n[d]).cloneNode(!0),s.appendChild(i);ret urn t},importNode:function(e,t){var n=this.node instanceof Document?this.node:th is.node.ownerDocument,s=d.call(n,e,!1);if(t)for(var r,a=i.Logical.getChildNodes( e),l=o(s),h=0;h<a.length;h++)r=o(n).importNode(a[h],!0),l.appendChild(r);return s},_getComposedInnerHTML:function(){return n(this.node,!0)}}),Object.definePrope rties(t.prototype,{activeElement:{get:function(){var e=document.activeElement;if (!e)return null;var t=!!this.node._isShadyRoot;if(this.node!==document){if(!t)re turn null;if(this.node.host===e||!this.node.host.contains(e))return null}for(var i=o(e).getOwnerRoot();i&&i!==this.node;)e=i.host,i=o(e).getOwnerRoot();return t his.node===document?i?null:e:i===this.node?e:null},configurable:!0},childNodes:{ get:function(){var e=i.Logical.getChildNodes(this.node);return Array.isArray(e)? e:i.arrayCopyChildNodes(this.node)},configurable:!0},children:{get:function(){re turn i.Logical.hasChildNodes(this.node)?Array.prototype.filter.call(this.childNo des,function(e){return e.nodeType===Node.ELEMENT_NODE}):i.arrayCopyChildren(this .node)},configurable:!0},parentNode:{get:function(){return i.Logical.getParentNo de(this.node)},configurable:!0},firstChild:{get:function(){return i.Logical.getF irstChild(this.node)},configurable:!0},lastChild:{get:function(){return i.Logica l.getLastChild(this.node)},configurable:!0},nextSibling:{get:function(){return i .Logical.getNextSibling(this.node)},configurable:!0},previousSibling:{get:functi on(){return i.Logical.getPreviousSibling(this.node)},configurable:!0},firstEleme ntChild:{get:function(){return i.Logical.getFirstElementChild(this.node)},config urable:!0},lastElementChild:{get:function(){return i.Logical.getLastElementChild (this.node)},configurable:!0},nextElementSibling:{get:function(){return i.Logica l.getNextElementSibling(this.node)},configurable:!0},previousElementSibling:{get :function(){return i.Logical.getPreviousElementSibling(this.node)},configurable: !0},textContent:{get:function(){var e=this.node.nodeType;if(e===Node.TEXT_NODE|| e===Node.COMMENT_NODE)return this.node.textContent;for(var t,o=[],i=0,n=this.chi ldNodes;t=n[i];i++)t.nodeType!==Node.COMMENT_NODE&&o.push(t.textContent);return o.join("")},set:function(e){var t=this.node.nodeType;t===Node.TEXT_NODE||t===Nod e.COMMENT_NODE?this.node.textContent=e:(this._clear(),e&&this.appendChild(docume nt.createTextNode(e)))},configurable:!0},innerHTML:{get:function(){var e=this.no de.nodeType;return e===Node.TEXT_NODE||e===Node.COMMENT_NODE?null:n(this.node)}, set:function(e){var t=this.node.nodeType;if(t!==Node.TEXT_NODE||t!==Node.COMMENT _NODE){this._clear();var o=document.createElement("div");o.innerHTML=e;for(var n =i.arrayCopyChildNodes(o),s=0;s<n.length;s++)this.appendChild(n[s])}},configurab le:!0}}),t.hasInsertionPoint=function(e){return Boolean(e&&e._insertionPoints.le ngth)}}}(),function(){"use strict";var e=Polymer.Settings,t=Polymer.TreeApi,o=Po lymer.DomApi;if(e.useShadow){Polymer.Base.extend(o.prototype,{querySelectorAll:f unction(e){return t.arrayCopy(this.node.querySelectorAll(e))},getOwnerRoot:funct ion(){for(var e=this.node;e;){if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.hos t)return e;e=e.parentNode}},importNode:function(e,t){var o=this.node instanceof Document?this.node:this.node.ownerDocument;return o.importNode(e,t)},getDestinat ionInsertionPoints:function(){var e=this.node.getDestinationInsertionPoints&&thi s.node.getDestinationInsertionPoints();return e?t.arrayCopy(e):[]},getDistribute dNodes:function(){var e=this.node.getDistributedNodes&&this.node.getDistributedN odes();return e?t.arrayCopy(e):[]}}),Object.defineProperties(o.prototype,{active Element:{get:function(){var e=o.wrap(this.node),t=e.activeElement;return e.conta ins(t)?t:null},configurable:!0},childNodes:{get:function(){return t.arrayCopyChi ldNodes(this.node)},configurable:!0},children:{get:function(){return t.arrayCopy Children(this.node)},configurable:!0},textContent:{get:function(){return this.no de.textContent},set:function(e){return this.node.textContent=e},configurable:!0} ,innerHTML:{get:function(){return this.node.innerHTML},set:function(e){return th is.node.innerHTML=e},configurable:!0}});var i=function(e){for(var t=0;t<e.length ;t++)n(e[t])},n=function(e){o.prototype[e]=function(){return this.node[e].apply( this.node,arguments)}};i(["cloneNode","appendChild","insertBefore","removeChild" ,"replaceChild","setAttribute","removeAttribute","querySelector"]);var s=functio n(e){for(var t=0;t<e.length;t++)r(e[t])},r=function(e){Object.defineProperty(o.p rototype,e,{get:function(){return this.node[e]},configurable:!0})};s(["parentNod e","firstChild","lastChild","nextSibling","previousSibling","firstElementChild", "lastElementChild","nextElementSibling","previousElementSibling"])}}(),Polymer.B ase.extend(Polymer.dom,{_flushGuard:0,_FLUSH_MAX:100,_needsTakeRecords:!Polymer. Settings.useNativeCustomElements,_debouncers:[],_staticFlushList:[],_finishDebou ncer:null,flush:function(){for(this._flushGuard=0,this._prepareFlush();this._deb ouncers.length&&this._flushGuard<this._FLUSH_MAX;){for(;this._debouncers.length; )this._debouncers.shift().complete();this._finishDebouncer&&this._finishDebounce r.complete(),this._prepareFlush(),this._flushGuard++}this._flushGuard>=this._FLU SH_MAX&&console.warn("Polymer.dom.flush aborted. Flush may not be complete.")},_ prepareFlush:function(){this._needsTakeRecords&&CustomElements.takeRecords();for (var e=0;e<this._staticFlushList.length;e++)this._staticFlushList[e]()},addStati cFlush:function(e){this._staticFlushList.push(e)},removeStaticFlush:function(e){ var t=this._staticFlushList.indexOf(e);t>=0&&this._staticFlushList.splice(t,1)}, addDebouncer:function(e){this._debouncers.push(e),this._finishDebouncer=Polymer. Debounce(this._finishDebouncer,this._finishFlush)},_finishFlush:function(){Polym er.dom._debouncers=[]}}),Polymer.EventApi=function(){"use strict";var e=Polymer. DomApi.ctor,t=Polymer.Settings;e.Event=function(e){this.event=e},t.useShadow?e.E vent.prototype={get rootTarget(){return this.event.path[0]},get localTarget(){re turn this.event.target},get path(){var e=this.event.path;return Array.isArray(e) ||(e=Array.prototype.slice.call(e)),e}}:e.Event.prototype={get rootTarget(){retu rn this.event.target},get localTarget(){for(var e=this.event.currentTarget,t=e&& Polymer.dom(e).getOwnerRoot(),o=this.path,i=0;i<o.length;i++)if(Polymer.dom(o[i] ).getOwnerRoot()===t)return o[i]},get path(){if(!this.event._path){for(var e=[], t=this.rootTarget;t;){e.push(t);var o=Polymer.dom(t).getDestinationInsertionPoin ts();if(o.length){for(var i=0;i<o.length-1;i++)e.push(o[i]);t=o[o.length-1]}else t=Polymer.dom(t).parentNode||t.host}e.push(window),this.event._path=e}return th is.event._path}};var o=function(t){return t.__eventApi||(t.__eventApi=new e.Even t(t)),t.__eventApi};return{factory:o}}(),function(){"use strict";var e=Polymer.D omApi.ctor,t=Polymer.Settings.useShadow;Object.defineProperty(e.prototype,"class List",{get:function(){return this._classList||(this._classList=new e.ClassList(t his)),this._classList},configurable:!0}),e.ClassList=function(e){this.domApi=e,t his.node=e.node},e.ClassList.prototype={add:function(){this.node.classList.add.a pply(this.node.classList,arguments),this._distributeParent()},remove:function(){ this.node.classList.remove.apply(this.node.classList,arguments),this._distribute Parent()},toggle:function(){this.node.classList.toggle.apply(this.node.classList ,arguments),this._distributeParent()},_distributeParent:function(){t||this.domAp i._maybeDistributeParent()},contains:function(){return this.node.classList.conta ins.apply(this.node.classList,arguments)}}}(),function(){"use strict";var e=Poly mer.DomApi.ctor,t=Polymer.Settings;if(e.EffectiveNodesObserver=function(e){this. domApi=e,this.node=this.domApi.node,this._listeners=[]},e.EffectiveNodesObserver .prototype={addListener:function(e){this._isSetup||(this._setup(),this._isSetup= !0);var t={fn:e,_nodes:[]};return this._listeners.push(t),this._scheduleNotify() ,t},removeListener:function(e){var t=this._listeners.indexOf(e);t>=0&&(this._lis teners.splice(t,1),e._nodes=[]),this._hasListeners()||(this._cleanup(),this._isS etup=!1)},_setup:function(){this._observeContentElements(this.domApi.childNodes) },_cleanup:function(){this._unobserveContentElements(this.domApi.childNodes)},_h asListeners:function(){return Boolean(this._listeners.length)},_scheduleNotify:f unction(){this._debouncer&&this._debouncer.stop(),this._debouncer=Polymer.Deboun ce(this._debouncer,this._notify),this._debouncer.context=this,Polymer.dom.addDeb ouncer(this._debouncer)},notify:function(){this._hasListeners()&&this._scheduleN otify()},_notify:function(){this._beforeCallListeners(),this._callListeners()},_ beforeCallListeners:function(){this._updateContentElements()},_updateContentElem ents:function(){this._observeContentElements(this.domApi.childNodes)},_observeCo ntentElements:function(e){for(var t,o=0;o<e.length&&(t=e[o]);o++)this._isContent (t)&&(t.__observeNodesMap=t.__observeNodesMap||new WeakMap,t.__observeNodesMap.h as(this)||t.__observeNodesMap.set(this,this._observeContent(t)))},_observeConten t:function(e){var t=this,o=Polymer.dom(e).observeNodes(function(){t._scheduleNot ify()});return o._avoidChangeCalculation=!0,o},_unobserveContentElements:functio n(e){for(var t,o,i=0;i<e.length&&(t=e[i]);i++)this._isContent(t)&&(o=t.__observe NodesMap.get(this),o&&(Polymer.dom(t).unobserveNodes(o),t.__observeNodesMap.dele te(this)))},_isContent:function(e){return"content"===e.localName},_callListeners :function(){for(var e,t=this._listeners,o=this._getEffectiveNodes(),i=0;i<t.leng th&&(e=t[i]);i++){var n=this._generateListenerInfo(e,o);(n||e._alwaysNotify)&&th is._callListener(e,n)}},_getEffectiveNodes:function(){return this.domApi.getEffe ctiveChildNodes()},_generateListenerInfo:function(e,t){if(e._avoidChangeCalculat ion)return!0;for(var o,i=e._nodes,n={target:this.node,addedNodes:[],removedNodes :[]},s=Polymer.ArraySplice.calculateSplices(t,i),r=0;r<s.length&&(o=s[r]);r++)fo r(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)n.removedNodes.push(d);for( r=0,o;r<s.length&&(o=s[r]);r++)for(a=o.index;a<o.index+o.addedCount;a++)n.addedN odes.push(t[a]);return e._nodes=t,n.addedNodes.length||n.removedNodes.length?n:v oid 0},_callListener:function(e,t){return e.fn.call(this.node,t)},enableShadowAt tributeTracking:function(){}},t.useShadow){var o=e.EffectiveNodesObserver.protot ype._setup,i=e.EffectiveNodesObserver.prototype._cleanup;Polymer.Base.extend(e.E ffectiveNodesObserver.prototype,{_setup:function(){if(!this._observer){var e=thi s;this._mutationHandler=function(t){t&&t.length&&e._scheduleNotify()},this._obse rver=new MutationObserver(this._mutationHandler),this._boundFlush=function(){e._ flush()},Polymer.dom.addStaticFlush(this._boundFlush),this._observer.observe(thi s.node,{childList:!0})}o.call(this)},_cleanup:function(){this._observer.disconne ct(),this._observer=null,this._mutationHandler=null,Polymer.dom.removeStaticFlus h(this._boundFlush),i.call(this)},_flush:function(){this._observer&&this._mutati onHandler(this._observer.takeRecords())},enableShadowAttributeTracking:function( ){if(this._observer){this._makeContentListenersAlwaysNotify(),this._observer.dis connect(),this._observer.observe(this.node,{childList:!0,attributes:!0,subtree:! 0});var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).observer&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}},_makeContentListenersAlwa ysNotify:function(){for(var e,t=0;t<this._listeners.length;t++)e=this._listeners [t],e._alwaysNotify=e._isContentListener}})}}(),function(){"use strict";var e=Po lymer.DomApi.ctor,t=Polymer.Settings;e.DistributedNodesObserver=function(t){e.Ef fectiveNodesObserver.call(this,t)},e.DistributedNodesObserver.prototype=Object.c reate(e.EffectiveNodesObserver.prototype),Polymer.Base.extend(e.DistributedNodes Observer.prototype,{_setup:function(){},_cleanup:function(){},_beforeCallListene rs:function(){},_getEffectiveNodes:function(){return this.domApi.getDistributedN odes()}}),t.useShadow&&Polymer.Base.extend(e.DistributedNodesObserver.prototype, {_setup:function(){if(!this._observer){var e=this.domApi.getOwnerRoot(),t=e&&e.h ost;if(t){var o=this;this._observer=Polymer.dom(t).observeNodes(function(){o._sc heduleNotify()}),this._observer._isContentListener=!0,this._hasAttrSelect()&&Pol ymer.dom(t).observer.enableShadowAttributeTracking()}}},_hasAttrSelect:function( ){var e=this.node.getAttribute("select");return e&&e.match(/[[.]+/)},_cleanup:fu nction(){var e=this.domApi.getOwnerRoot(),t=e&&e.host;t&&Polymer.dom(t).unobserv eNodes(this._observer),this._observer=null}})}(),function(){function e(e,t){t._d istributedNodes.push(e);var o=e._destinationInsertionPoints;o?o.push(t):e._desti nationInsertionPoints=[t]}function t(e){var t=e._distributedNodes;if(t)for(var o =0;o<t.length;o++){var i=t[o]._destinationInsertionPoints;i&&i.splice(i.indexOf( e)+1,i.length)}}function o(e,t){var o=u.Logical.getParentNode(e);o&&o.shadyRoot& &h.hasInsertionPoint(o.shadyRoot)&&o.shadyRoot._distributionClean&&(o.shadyRoot. _distributionClean=!1,t.shadyRoot._dirtyRoots.push(o))}function i(e,t){var o=t._ destinationInsertionPoints;return o&&o[o.length-1]===e}function n(e){return"cont ent"==e.localName}function s(e){for(;e&&r(e);)e=e.domHost;return e}function r(e) {for(var t,o=u.Logical.getChildNodes(e),i=0;i<o.length;i++)if(t=o[i],t.localName &&"content"===t.localName)return e.domHost}function d(e){for(var t,o=0;o<e._inse rtionPoints.length;o++)t=e._insertionPoints[o],h.hasApi(t)&&Polymer.dom(t).notif yObserver()}function a(e){h.hasApi(e)&&Polymer.dom(e).notifyObserver()}function l(e){if(c&&e)for(var t=0;t<e.length;t++)CustomElements.upgrade(e[t])}var h=Polym er.DomApi,u=Polymer.TreeApi;Polymer.Base._addFeature({_prepShady:function(){this ._useContent=this._useContent||Boolean(this._template)},_setupShady:function(){t his.shadyRoot=null,this.__domApi||(this.__domApi=null),this.__dom||(this.__dom=n ull),this._ownerShadyRoot||(this._ownerShadyRoot=void 0)},_poolContent:function( ){this._useContent&&u.Logical.saveChildNodes(this)},_setupRoot:function(){this._ useContent&&(this._createLocalRoot(),this.dataHost||l(u.Logical.getChildNodes(th is)))},_createLocalRoot:function(){this.shadyRoot=this.root,this.shadyRoot._dist ributionClean=!1,this.shadyRoot._hasDistributed=!1,this.shadyRoot._isShadyRoot=! 0,this.shadyRoot._dirtyRoots=[];var e=this.shadyRoot._insertionPoints=!this._not es||this._notes._hasContent?this.shadyRoot.querySelectorAll("content"):[];u.Logi cal.saveChildNodes(this.shadyRoot);for(var t,o=0;o<e.length;o++)t=e[o],u.Logical .saveChildNodes(t),u.Logical.saveChildNodes(t.parentNode);this.shadyRoot.host=th is},get domHost(){var e=Polymer.dom(this).getOwnerRoot();return e&&e.host},distr ibuteContent:function(e){if(this.shadyRoot){this.shadyRoot._invalidInsertionPoin ts=this.shadyRoot._invalidInsertionPoints||e;var t=s(this);Polymer.dom(this)._la zyDistribute(t)}},_distributeContent:function(){this._useContent&&!this.shadyRoo t._distributionClean&&(this.shadyRoot._invalidInsertionPoints&&(Polymer.dom(this )._updateInsertionPoints(this),this.shadyRoot._invalidInsertionPoints=!1),this._ beginDistribute(),this._distributeDirtyRoots(),this._finishDistribute())},_begin Distribute:function(){this._useContent&&h.hasInsertionPoint(this.shadyRoot)&&(th is._resetDistribution(),this._distributePool(this.shadyRoot,this._collectPool()) );
2 },_distributeDirtyRoots:function(){for(var e,t=this.shadyRoot._dirtyRoots,o=0,i= t.length;o<i&&(e=t[o]);o++)e._distributeContent();this.shadyRoot._dirtyRoots=[]} ,_finishDistribute:function(){if(this._useContent){if(this.shadyRoot._distributi onClean=!0,h.hasInsertionPoint(this.shadyRoot))this._composeTree(),d(this.shadyR oot);else if(this.shadyRoot._hasDistributed){var e=this._composeNode(this);this. _updateChildNodes(this,e)}else u.Composed.clearChildNodes(this),this.appendChild (this.shadyRoot);this.shadyRoot._hasDistributed||a(this),this.shadyRoot._hasDist ributed=!0}},elementMatches:function(e,t){return t=t||this,h.matchesSelector.cal l(t,e)},_resetDistribution:function(){for(var e=u.Logical.getChildNodes(this),o= 0;o<e.length;o++){var i=e[o];i._destinationInsertionPoints&&(i._destinationInser tionPoints=void 0),n(i)&&t(i)}for(var s=this.shadyRoot,r=s._insertionPoints,d=0; d<r.length;d++)r[d]._distributedNodes=[]},_collectPool:function(){for(var e=[],t =u.Logical.getChildNodes(this),o=0;o<t.length;o++){var i=t[o];n(i)?e.push.apply( e,i._distributedNodes):e.push(i)}return e},_distributePool:function(e,t){for(var i,n=e._insertionPoints,s=0,r=n.length;s<r&&(i=n[s]);s++)this._distributeInserti onPoint(i,t),o(i,this)},_distributeInsertionPoint:function(t,o){for(var i,n=!1,s =0,r=o.length;s<r;s++)i=o[s],i&&this._matchesContentSelect(i,t)&&(e(i,t),o[s]=vo id 0,n=!0);if(!n)for(var d=u.Logical.getChildNodes(t),a=0;a<d.length;a++)e(d[a], t)},_composeTree:function(){this._updateChildNodes(this,this._composeNode(this)) ;for(var e,t,o=this.shadyRoot._insertionPoints,i=0,n=o.length;i<n&&(e=o[i]);i++) t=u.Logical.getParentNode(e),t._useContent||t===this||t===this.shadyRoot||this._ updateChildNodes(t,this._composeNode(t))},_composeNode:function(e){for(var t=[], o=u.Logical.getChildNodes(e.shadyRoot||e),s=0;s<o.length;s++){var r=o[s];if(n(r) )for(var d=r._distributedNodes,a=0;a<d.length;a++){var l=d[a];i(r,l)&&t.push(l)} else t.push(r)}return t},_updateChildNodes:function(e,t){for(var o,i=u.Composed. getChildNodes(e),n=Polymer.ArraySplice.calculateSplices(t,i),s=0,r=0;s<n.length& &(o=n[s]);s++){for(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)u.Composed .getParentNode(d)===e&&u.Composed.removeChild(e,d),i.splice(o.index+r,1);r-=o.ad dedCount}for(var o,l,s=0;s<n.length&&(o=n[s]);s++)for(l=i[o.index],a=o.index,d;a <o.index+o.addedCount;a++)d=t[a],u.Composed.insertBefore(e,d,l),i.splice(a,0,d)} ,_matchesContentSelect:function(e,t){var o=t.getAttribute("select");if(!o)return !0;if(o=o.trim(),!o)return!0;if(!(e instanceof Element))return!1;var i=/^(:not\( )?[*.#[a-zA-Z_|]/;return!!i.test(o)&&this.elementMatches(o,e)},_elementAdd:funct ion(){},_elementRemove:function(){}});var c=window.CustomElements&&!CustomElemen ts.useNative}(),Polymer.Settings.useShadow&&Polymer.Base._addFeature({_poolConte nt:function(){},_beginDistribute:function(){},distributeContent:function(){},_di stributeContent:function(){},_finishDistribute:function(){},_createLocalRoot:fun ction(){this.createShadowRoot(),this.shadowRoot.appendChild(this.root),this.root =this.shadowRoot}}),Polymer.Async={_currVal:0,_lastVal:0,_callbacks:[],_twiddleC ontent:0,_twiddle:document.createTextNode(""),run:function(e,t){return t>0?~setT imeout(e,t):(this._twiddle.textContent=this._twiddleContent++,this._callbacks.pu sh(e),this._currVal++)},cancel:function(e){if(e<0)clearTimeout(~e);else{var t=e- this._lastVal;if(t>=0){if(!this._callbacks[t])throw"invalid async handle: "+e;th is._callbacks[t]=null}}},_atEndOfMicrotask:function(){for(var e=this._callbacks. length,t=0;t<e;t++){var o=this._callbacks[t];if(o)try{o()}catch(e){throw t++,thi s._callbacks.splice(0,t),this._lastVal+=t,this._twiddle.textContent=this._twiddl eContent++,e}}this._callbacks.splice(0,e),this._lastVal+=e}},new window.Mutation Observer(function(){Polymer.Async._atEndOfMicrotask()}).observe(Polymer.Async._t widdle,{characterData:!0}),Polymer.Debounce=function(){function e(e,t,i){return e?e.stop():e=new o(this),e.go(t,i),e}var t=Polymer.Async,o=function(e){this.cont ext=e;var t=this;this.boundComplete=function(){t.complete()}};return o.prototype ={go:function(e,o){var i;this.finish=function(){t.cancel(i)},i=t.run(this.boundC omplete,o),this.callback=e},stop:function(){this.finish&&(this.finish(),this.fin ish=null,this.callback=null)},complete:function(){if(this.finish){var e=this.cal lback;this.stop(),e.call(this.context)}}},e}(),Polymer.Base._addFeature({_setupD ebouncers:function(){this._debouncers={}},debounce:function(e,t,o){return this._ debouncers[e]=Polymer.Debounce.call(this,this._debouncers[e],t,o)},isDebouncerAc tive:function(e){var t=this._debouncers[e];return!(!t||!t.finish)},flushDebounce r:function(e){var t=this._debouncers[e];t&&t.complete()},cancelDebouncer:functio n(e){var t=this._debouncers[e];t&&t.stop()}}),Polymer.DomModule=document.createE lement("dom-module"),Polymer.Base._addFeature({_registerFeatures:function(){this ._prepIs(),this._prepBehaviors(),this._prepConstructor(),this._prepTemplate(),th is._prepShady(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHos tAttributes(e.hostAttributes)},_initFeatures:function(){this._registerHost(),thi s._template&&(this._poolContent(),this._beginHosting(),this._stampTemplate(),thi s._endHosting()),this._marshalHostAttributes(),this._setupDebouncers(),this._mar shalBehaviors(),this._tryReady()},_marshalBehavior:function(e){}})</script> <scr ipt>Polymer.nar=[],Polymer.Annotations={parseAnnotations:function(e){var t=[],n= e._content||e.content;return this._parseNodeAnnotations(n,t,e.hasAttribute("stri p-whitespace")),t},_parseNodeAnnotations:function(e,t,n){return e.nodeType===Nod e.TEXT_NODE?this._parseTextNodeAnnotation(e,t):this._parseElementAnnotations(e,t ,n)},_bindingRegex:function(){var e="(?:[a-zA-Z_$][\\w.:$\\-*]*)",t="(?:[-+]?[0- 9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)",n="(?:'(?:[^'\\\\]|\\\\.)*')",r='(?:"(?:[^"\ \\\]|\\\\.)*")',s="(?:"+n+"|"+r+")",i="(?:"+e+"|"+t+"|"+s+"\\s*)",o="(?:"+i+"(?: ,\\s*"+i+")*)",a="(?:\\(\\s*(?:"+o+"?)\\)\\s*)",l="("+e+"\\s*"+a+"?)",c="(\\[\\[ |{{)\\s*",h="(?:]]|}})",u="(?:(!)\\s*)?",f=c+u+l+h;return new RegExp(f,"g")}(),_ parseBindings:function(e){for(var t,n=this._bindingRegex,r=[],s=0;null!==(t=n.ex ec(e));){t.index>s&&r.push({literal:e.slice(s,t.index)});var i,o,a,l=t[1][0],c=B oolean(t[2]),h=t[3].trim();"{"==l&&(a=h.indexOf("::"))>0&&(o=h.substring(a+2),h= h.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:h,mode:l,negate:c,ev ent:o,customEvent:i}),s=n.lastIndex}if(s&&s<e.length){var u=e.substring(s);u&&r. push({literal:u})}if(r.length)return r},_literalFromParts:function(e){for(var t= "",n=0;n<e.length;n++){var r=e[n].literal;t+=r||""}return t},_parseTextNodeAnnot ation:function(e,t){var n=this._parseBindings(e.textContent);if(n){e.textContent =this._literalFromParts(n)||" ";var r={bindings:[{kind:"text",name:"textContent" ,parts:n,isCompound:1!==n.length}]};return t.push(r),r}},_parseElementAnnotation s:function(e,t,n){var r={bindings:[],events:[]};return"content"===e.localName&&( t._hasContent=!0),this._parseChildNodesAnnotations(e,r,t,n),e.attributes&&(this. _parseNodeAttributeAnnotations(e,r,t),this.prepElement&&this.prepElement(e)),(r. bindings.length||r.events.length||r.id)&&t.push(r),r},_parseChildNodesAnnotation s:function(e,t,n,r){if(e.firstChild)for(var s=e.firstChild,i=0;s;){var o=s.nextS ibling;if("template"!==s.localName||s.hasAttribute("preserve-content")||this._pa rseTemplate(s,i,n,t),"slot"==s.localName&&(s=this._replaceSlotWithContent(s)),s. nodeType===Node.TEXT_NODE){for(var a=o;a&&a.nodeType===Node.TEXT_NODE;)s.textCon tent+=a.textContent,o=a.nextSibling,e.removeChild(a),a=o;r&&!s.textContent.trim( )&&(e.removeChild(s),i--)}if(s.parentNode){var l=this._parseNodeAnnotations(s,n, r);l&&(l.parent=t,l.index=i)}s=o,i++}},_replaceSlotWithContent:function(e){for(v ar t=e.ownerDocument.createElement("content");e.firstChild;)t.appendChild(e.firs tChild);for(var n=e.attributes,r=0;r<n.length;r++){var s=n[r];t.setAttribute(s.n ame,s.value)}var i=e.getAttribute("name"),o=i?"[slot='"+i+"']":":not([slot])";re turn t.setAttribute("select",o),e.parentNode.replaceChild(t,e),t},_parseTemplate :function(e,t,n,r){var s=document.createDocumentFragment();s._notes=this.parseAn notations(e),s.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polyme r.nar,templateContent:s,parent:r,index:t})},_parseNodeAttributeAnnotations:funct ion(e,t){for(var n,r=Array.prototype.slice.call(e.attributes),s=r.length-1;n=r[s ];s--){var i,o=n.name,a=n.value;"on-"===o.slice(0,3)?(e.removeAttribute(o),t.eve nts.push({name:o.slice(3),value:a})):(i=this._parseNodeAttributeAnnotation(e,o,a ))?t.bindings.push(i):"id"===o&&(t.id=a)}},_parseNodeAttributeAnnotation:functio n(e,t,n){var r=this._parseBindings(n);if(r){var s=t,i="property";"$"==t[t.length -1]&&(t=t.slice(0,-1),i="attribute");var o=this._literalFromParts(r);o&&"attribu te"==i&&e.setAttribute(t,o),"input"===e.localName&&"value"===s&&e.setAttribute(s ,""),e.removeAttribute(s);var a=Polymer.CaseMap.dashToCamelCase(t);return"proper ty"===i&&(t=a),{kind:i,name:t,propertyName:a,parts:r,literal:o,isCompound:1!==r. length}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.fi ndAnnotatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.next Sibling)if(t.index===s++)return r}},function(){function e(e,t){return e.replace( a,function(e,r,s,i){return r+"'"+n(s.replace(/["']/g,""),t)+"'"+i})}function t(t ,r){for(var s in l)for(var i,o,a,c=l[s],u=0,f=c.length;u<f&&(i=c[u]);u++)"*"!==s &&t.localName!==s||(o=t.attributes[i],a=o&&o.value,a&&a.search(h)<0&&(o.value="s tyle"===i?e(a,r):n(a,r)))}function n(e,t){if(e&&c.test(e))return e;var n=s(t);re turn n.href=e,n.href||e}function r(e,t){return i||(i=document.implementation.cre ateHTMLDocument("temp"),o=i.createElement("base"),i.head.appendChild(o)),o.href= t,n(e,i)}function s(e){return e.__urlResolver||(e.__urlResolver=e.createElement( "a"))}var i,o,a=/(url\()([^)]*)(\))/g,l={"*":["href","src","style","url"],form:[ "action"]},c=/(^\/)|(^#)|(^[\w-\d]*:)/,h=/\{\{|\[\[/;Polymer.ResolveUrl={resolve Css:e,resolveAttrs:t,resolveUrl:r}}(),Polymer.Path={root:function(e){var t=e.ind exOf(".");return t===-1?e:e.slice(0,t)},isDeep:function(e){return e.indexOf(".") !==-1},isAncestor:function(e,t){return 0===e.indexOf(t+".")},isDescendant:functi on(e,t){return 0===t.indexOf(e+".")},translate:function(e,t,n){return t+n.slice( e.length)},matches:function(e,t,n){return e===n||this.isAncestor(e,n)||Boolean(t )&&this.isDescendant(e,n)}},Polymer.Base._addFeature({_prepAnnotations:function( ){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t){e._p repElement(t)},this._template._content&&this._template._content._notes?this._not es=this._template._content._notes:(this._notes=Polymer.Annotations.parseAnnotati ons(this._template),this._processAnnotations(this._notes)),Polymer.Annotations.p repElement=null}else this._notes=[]},_processAnnotations:function(e){for(var t=0 ;t<e.length;t++){for(var n=e[t],r=0;r<n.bindings.length;r++)for(var s=n.bindings [r],i=0;i<s.parts.length;i++){var o=s.parts[i];if(!o.literal){var a=this._parseM ethod(o.value);a?o.signature=a:o.model=Polymer.Path.root(o.value)}}if(n.template Content){this._processAnnotations(n.templateContent._notes);var l=n.templateCont ent._parentProps=this._discoverTemplateParentProps(n.templateContent._notes),c=[ ];for(var h in l){var u="_parent_"+h;c.push({index:n.index,kind:"property",name: u,propertyName:u,parts:[{mode:"{",model:h,value:h}]})}n.bindings=n.bindings.conc at(c)}}},_discoverTemplateParentProps:function(e){for(var t,n={},r=0;r<e.length& &(t=e[r]);r++){for(var s,i=0,o=t.bindings;i<o.length&&(s=o[i]);i++)for(var a,l=0 ,c=s.parts;l<c.length&&(a=c[l]);l++)if(a.signature){for(var h=a.signature.args,u =0;u<h.length;u++){var f=h[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&(n[a.sig nature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){var p=t.t emplateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepElement:func tion(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)},_findAn notatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationReferences:f unction(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedNodes(), this._marshalAnnotatedListeners())},_configureAnnotationReferences:function(){fo r(var e=this._notes,t=this._nodes,n=0;n<e.length;n++){var r=e[n],s=t[n];this._co nfigureTemplateContent(r,s),this._configureCompoundBindings(r,s)}},_configureTem plateContent:function(e,t){e.templateContent&&(t._content=e.templateContent)},_c onfigureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.length;r++){ var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoundStorag e__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].literal;var c=s.name;i[c]=a,s.literal&&"property"==s.kind&&(t._configValue?t._configValue(c ,s.literal):t[c]=s.literal)}}},_marshalIdNodes:function(){this.$={};for(var e,t= 0,n=this._notes.length;t<n&&(e=this._notes[t]);t++)e.id&&(this.$[e.id]=this._fin dAnnotatedNode(this.root,e))},_marshalAnnotatedNodes:function(){if(this._notes&& this._notes.length){for(var e=new Array(this._notes.length),t=0;t<this._notes.le ngth;t++)e[t]=this._findAnnotatedNode(this.root,this._notes[t]);this._nodes=e}}, _marshalAnnotatedListeners:function(){for(var e,t=0,n=this._notes.length;t<n&&(e =this._notes[t]);t++)if(e.events&&e.events.length)for(var r,s=this._findAnnotate dNode(this.root,e),i=0,o=e.events;i<o.length&&(r=o[i]);i++)this.listen(s,r.name, r.value)}}),Polymer.Base._addFeature({listeners:{},_listenListeners:function(e){ var t,n,r;for(r in e)r.indexOf(".")<0?(t=this,n=r):(n=r.split("."),t=this.$[n[0] ],n=n[1]),this.listen(t,n,e[r])},listen:function(e,t,n){var r=this._recallEventH andler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||(this._l isten(e,t,r),r._listening=!0)},_boundListenerKey:function(e,t){return e+":"+t},_ recordEventHandler:function(e,t,n,r,s){var i=e.__boundListeners;i||(i=e.__boundL isteners=new WeakMap);var o=i.get(n);o||(o={},i.set(n,o));var a=this._boundListe nerKey(t,r);o[a]=s},_recallEventHandler:function(e,t,n,r){var s=e.__boundListene rs;if(s){var i=s.get(n);if(i){var o=this._boundListenerKey(t,r);return i[o]}}},_ createEventHandler:function(e,t,n){var r=this,s=function(e){r[n]?r[n](e,e.detail ):r._warn(r._logf("_createEventHandler","listener method `"+n+"` not defined"))} ;return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:function (e,t,n){var r=this._recallEventHandler(this,t,e,n);r&&(this._unlisten(e,t,r),r._ listening=!1)},_listen:function(e,t,n){e.addEventListener(t,n)},_unlisten:functi on(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){fo r(var t,n=g?["click"]:m,r=0;r<n.length;r++)t=n[r],e?document.addEventListener(t, P,!0):document.removeEventListener(t,P,!0)}function t(){S.mouse.mouseIgnoreJob|| e(!0);var t=function(){e(),S.mouse.target=null,S.mouse.mouseIgnoreJob=null};S.mo use.mouseIgnoreJob=Polymer.Debounce(S.mouse.mouseIgnoreJob,t,d)}function n(e){va r t=e.type;if(m.indexOf(t)===-1)return!1;if("mousemove"===t){var n=void 0===e.bu ttons?1:e.buttons;return e instanceof window.MouseEvent&&!v&&(n=y[e.which]||0),B oolean(1&n)}var r=void 0===e.button?0:e.button;return 0===r}function r(e){if("cl ick"===e.type){if(0===e.detail)return!0;var t=C.findOriginalTarget(e),n=t.getBou ndingClientRect(),r=e.pageX,s=e.pageY;return!(r>=n.left&&r<=n.right&&s>=n.top&&s <=n.bottom)}return!1}function s(e){for(var t,n=Polymer.dom(e).path,r="auto",s=0; s<n.length;s++)if(t=n[s],t[u]){r=t[u];break}return r}function i(e,t,n){e.movefn= t,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("m ouseup",n)}function o(e){document.removeEventListener("mousemove",e.movefn),docu ment.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var a=Polym er.DomApi.wrap,l="string"==typeof document.head.style.touchAction,c="__polymerGe stures",h="__polymerGesturesHandled",u="__polymerGesturesTouchAction",f=25,p=5,_ =2,d=2500,m=["mousedown","mousemove","mouseup","click"],y=[0,1,4,2],v=function() {try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}() ,g=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),P=function(e){var t=e.s ourceCapabilities;if((!t||t.firesTouchEvents)&&(e[h]={skip:!0},"click"===e.type) ){for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===S.mouse.target)retu rn;e.preventDefault(),e.stopPropagation()}},S={mouse:{target:null,mouseIgnoreJob :null},touch:{x:0,y:0,id:-1,scrollDecided:!1}},C={gestures:{},recognizers:[],dee pTargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shad owRoot;)r=r.shadowRoot.elementFromPoint(e,t),r&&(n=r);return n},findOriginalTarg et:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var n, r=e.type,s=a(e.currentTarget),i=s[c];if(i){var o=i[r];if(o){if(!e[h]&&(e[h]={}," touch"===r.slice(0,5))){var u=e.changedTouches[0];if("touchstart"===r&&1===e.tou ches.length&&(S.touch.id=u.identifier),S.touch.id!==u.identifier)return;l||"touc hstart"!==r&&"touchmove"!==r||C.handleTouchAction(e),"touchend"===r&&(S.mouse.ta rget=Polymer.dom(e).rootTarget,t())}if(n=e[h],!n.skip){for(var f,p=C.recognizers ,_=0;_<p.length;_++)f=p[_],o[f.name]&&!n[f.name]&&f.flow&&f.flow.start.indexOf(e .type)>-1&&f.reset&&f.reset();for(_=0,f;_<p.length;_++)f=p[_],o[f.name]&&!n[f.na me]&&(n[f.name]=!0,f[r](e))}}}},handleTouchAction:function(e){var t=e.changedTou ches[0],n=e.type;if("touchstart"===n)S.touch.x=t.clientX,S.touch.y=t.clientY,S.t ouch.scrollDecided=!1;else if("touchmove"===n){if(S.touch.scrollDecided)return;S .touch.scrollDecided=!0;var r=s(e),i=!1,o=Math.abs(S.touch.x-t.clientX),a=Math.a bs(S.touch.y-t.clientY);e.cancelable&&("none"===r?i=!0:"pan-x"===r?i=a>o:"pan-y" ===r&&(i=o>a)),i?e.preventDefault():C.prevent("track")}},add:function(e,t,n){e=a (e);var r=this.gestures[t],s=r.deps,i=r.name,o=e[c];o||(e[c]=o={});for(var l,h,u =0;u<s.length;u++)l=s[u],g&&m.indexOf(l)>-1&&"click"!==l||(h=o[l],h||(o[l]=h={_c ount:0}),0===h._count&&e.addEventListener(l,this.handleNative),h[i]=(h[i]||0)+1, h._count=(h._count||0)+1);e.addEventListener(t,n),r.touchAction&&this.setTouchAc tion(e,r.touchAction)},remove:function(e,t,n){e=a(e);var r=this.gestures[t],s=r. deps,i=r.name,o=e[c];if(o)for(var l,h,u=0;u<s.length;u++)l=s[u],h=o[l],h&&h[i]&& (h[i]=(h[i]||1)-1,h._count=(h._count||1)-1,0===h._count&&e.removeEventListener(l ,this.handleNative));e.removeEventListener(t,n)},register:function(e){this.recog nizers.push(e);for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},fin dRecognizerByEvent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=th is.recognizers[n];for(var r,s=0;s<t.emits.length;s++)if(r=t.emits[s],r===e)retur n t}return null},setTouchAction:function(e,t){l&&(e.style.touchAction=t),e[u]=t} ,fire:function(e,t,n){var r=Polymer.Base.fire(t,n,{node:e,bubbles:!0,cancelable: !0});if(r.defaultPrevented){var s=n.preventer||n.sourceEvent;s&&s.preventDefault &&s.preventDefault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t .info&&(t.info.prevent=!0)},resetMouseCanceller:function(){S.mouse.mouseIgnoreJo b&&S.mouse.mouseIgnoreJob.complete()}};C.register({name:"downup",deps:["mousedow n","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup ","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function() {o(this.info)},mousedown:function(e){if(n(e)){var t=C.findOriginalTarget(e),r=th is,s=function(e){n(e)||(r.fire("up",t,e),o(r.info))},a=function(e){n(e)&&r.fire( "up",t,e),o(r.info)};i(this.info,s,a),this.fire("down",t,e)}},touchstart:functio n(e){this.fire("down",C.findOriginalTarget(e),e.changedTouches[0],e)},touchend:f unction(e){this.fire("up",C.findOriginalTarget(e),e.changedTouches[0],e)},fire:f unction(e,t,n,r){C.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,p revent:function(e){return C.prevent(e)}})}}),C.register({name:"track",touchActio n:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mo usedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0 ,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>_&&this .moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:funct ion(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info. x=0,this.info.y=0,this.info.prevent=!1,o(this.info)},hasMovedEnough:function(e,t ){if(this.info.prevent)return!1;if(this.info.started)return!0;var n=Math.abs(thi s.info.x-e),r=Math.abs(this.info.y-t);return n>=p||r>=p},mousedown:function(e){i f(n(e)){var t=C.findOriginalTarget(e),r=this,s=function(e){var s=e.clientX,i=e.c lientY;r.hasMovedEnough(s,i)&&(r.info.state=r.info.started?"mouseup"===e.type?"e nd":"track":"start","start"===r.info.state&&C.prevent("tap"),r.info.addMove({x:s ,y:i}),n(e)||(r.info.state="end",o(r.info)),r.fire(t,e),r.info.started=!0)},a=fu nction(e){r.info.started&&s(e),o(r.info)};i(this.info,s,a),this.info.x=e.clientX ,this.info.y=e.clientY}},touchstart:function(e){var t=e.changedTouches[0];this.i nfo.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=C.findOrigina lTarget(e),n=e.changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s )&&("start"===this.info.state&&C.prevent("tap"),this.info.addMove({x:r,y:s}),thi s.fire(t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){ var t=C.findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.inf o.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fi re:function(e,t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info .moves[this.info.moves.length-1],o=i.x-this.info.x,a=i.y-this.info.y,l=0;return s&&(r=i.x-s.x,l=i.y-s.y),C.fire(e,"track",{state:this.info.state,x:t.clientX,y:t .clientY,dx:o,dy:a,ddx:r,ddy:l,sourceEvent:t,preventer:n,hover:function(){return C.deepTargetFind(t.clientX,t.clientY)}})}}),C.register({name:"tap",deps:["mouse down","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],en d:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:functi on(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this .info.x=e.clientX,this.info.y=e.clientY},mousedown:function(e){n(e)&&this.save(e )},click:function(e){n(e)&&this.forward(e)},touchstart:function(e){this.save(e.c hangedTouches[0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},f orward:function(e,t){var n=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY- this.info.y),i=C.findOriginalTarget(e);(isNaN(n)||isNaN(s)||n<=f&&s<=f||r(e))&&( this.info.prevent||C.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,prevent er:t}))}});var E={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addF eature({_setupGestures:function(){this.__polymerGestures=null},_listen:function( e,t,n){C.gestures[t]?C.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e, t,n){C.gestures[t]?C.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirectio n:function(e,t){t=t||this,C.setTouchAction(t,E[e]||"auto")}}),Polymer.Gestures=C }(),function(){"use strict";if(Polymer.Base._addFeature({$$:function(e){return P olymer.dom(this.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1= =arguments.length&&(t=!n.classList.contains(e)),t?Polymer.dom(n).classList.add(e ):Polymer.dom(n).classList.remove(e)},toggleAttribute:function(e,t,n){n=n||this, 1==arguments.length&&(t=!n.hasAttribute(e)),t?Polymer.dom(n).setAttribute(e,""): Polymer.dom(n).removeAttribute(e)},classFollows:function(e,t,n){n&&Polymer.dom(n ).classList.remove(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:funct ion(e,t,n){n&&Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e ,"")},getEffectiveChildNodes:function(){return Polymer.dom(this).getEffectiveChi ldNodes()},getEffectiveChildren:function(){var e=Polymer.dom(this).getEffectiveC hildNodes();return e.filter(function(e){return e.nodeType===Node.ELEMENT_NODE})} ,getEffectiveTextContent:function(){for(var e,t=this.getEffectiveChildNodes(),n= [],r=0;e=t[r];r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textCont ent);return n.join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(thi s).queryDistributedElements(e);return t&&t[0]},queryAllEffectiveChildren:functio n(e){return Polymer.dom(this).queryDistributedElements(e)},getContentChildNodes: function(e){var t=Polymer.dom(this.root).querySelector(e||"content");return t?Po lymer.dom(t).getDistributedNodes():[]},getContentChildren:function(e){return thi s.getContentChildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NO DE})},fire:function(e,t,n){n=n||Polymer.nob;var r=n.node||this;t=null===t||void 0===t?{}:t;var s=void 0===n.bubbles||n.bubbles,i=Boolean(n.cancelable),o=n._useC ache,a=this._getEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null), r.dispatchEvent(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:func tion(e,t,n,r){var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable ==n||(s=new Event(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){v ar n=this;return Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:functio n(e){Polymer.Async.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e )){if(n=e.indexOf(t),n>=0)return e.splice(n,1)}else{var r=this._get(e);if(n=r.in dexOf(t),n>=0)return this.splice(e,n,1)}},transform:function(e,t){t=t||this,t.st yle.webkitTransform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||th is,this.transform("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n ,r){var s=document.createElement("link");s.rel="import",s.href=e;var i=Polymer.B ase.importHref.imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s, l=this;if(t){var c=function(e){return e.target.__firedLoad=!0,e.target.removeEve ntListener("load",c),t.call(l,e)};a.addEventListener("load",c)}if(n){var h=funct ion(e){return e.target.__firedError=!0,e.target.removeEventListener("error",h),n .call(l,e)};a.addEventListener("error",h)}return o?(o.__firedLoad&&o.dispatchEve nt(new Event("load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s. href]=s,r=Boolean(r),r&&s.setAttribute("async",""),document.head.appendChild(s)) ,a},create:function(e,t){var n=document.createElement(e);if(t)for(var r in t)n[r ]=t[r];return n},isLightDescendant:function(e){return this!==e&&this.contains(e) &&Polymer.dom(this).getOwnerRoot()===Polymer.dom(e).getOwnerRoot()},isLocalDesce ndant:function(e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.S ettings.useNativeCustomElements){var e=Polymer.Base.importHref;Polymer.Base.impo rtHref=function(t,n,r,s){CustomElements.ready=!1;var i=function(e){if(CustomElem ents.upgradeDocumentTree(document),CustomElements.ready=!0,n)return n.call(this, e)};return e.call(this,t,i,r,s)}}}(),Polymer.Bind={prepareModel:function(e){Poly mer.Base.mixin(e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=voi d 0===n?this[e]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t ,{value:n},{bubbles:!1,cancelable:!1,_useCache:!0})},_propertySetter:function(e, t,n,r){var s=this.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"o bject"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChange d(e,t,s),n&&this._effectEffects(e,t,n,s,r)),s},__setProperty:function(e,t,n,r){r =r||this;var s=r._propertyEffects&&r._propertyEffects[e];s?r._propertySetter(e,t ,s,n):r[e]!==t&&(r[e]=t)},_effectEffects:function(e,t,n,r,s){for(var i,o=0,a=n.l ength;o<a&&(i=n[o]);o++)i.fn.call(this,e,this[e],i.effect,r,s)},_clearPath:funct ion(e){for(var t in this.__data__)Polymer.Path.isDescendant(e,t)&&(this.__data__ [t]=void 0)}},ensurePropertyEffects:function(e,t){e._propertyEffects||(e._proper tyEffects={});var n=e._propertyEffects[t];return n||(n=e._propertyEffects[t]=[]) ,n},addPropertyEffect:function(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i= {kind:n,effect:r,fn:Polymer.Bind["_"+n+"Effect"]};return s.push(i),i},createBind ings:function(e){var t=e._propertyEffects;if(t)for(var n in t){var r=t[n];r.sort (this._sortPropertyEffects),this._createAccessors(e,n,r)}},_sortPropertyEffects: function(){var e={compute:0,annotation:1,annotatedComputation:2,reflect:3,notify :4,observer:5,complexObserver:6,function:7};return function(t,n){return e[t.kind ]-e[n.kind]}}(),_createAccessors:function(e,t,n){var r={get:function(){return th is.__data__[t]}},s=function(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo& &e.getPropertyInfo(t);i&&i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.se t=s,Object.defineProperty(e,t,r)},upper:function(e){return e[0].toUpperCase()+e. substring(1)},_addAnnotatedListener:function(e,t,n,r,s,i){e._bindListeners||(e._ bindListeners=[]);var o=this._notedListenerFactory(n,r,Polymer.Path.isDeep(r),i) ,a=s||Polymer.CaseMap.camelToDashCase(n)+"-changed";e._bindListeners.push({index :t,property:n,path:r,changedFn:o,event:a})},_isEventBogus:function(e,t){return e .path&&e.path[0]!==t},_notedListenerFactory:function(e,t,n,r){return function(s, i,o){if(o){var a=Polymer.Path.translate(e,t,o);this._notifyPath(a,i)}else i=s[e] ,r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i}},prepareInstance:func tion(e){e.__data__=Object.create(null)},setupBindListeners:function(e){for(var t ,n=e._bindListeners,r=0,s=n.length;r<s&&(t=n[r]);r++){var i=e._nodes[t.index];th is._addNotifyListener(i,e,t.event,t.changedFn)}},_addNotifyListener:function(e,t ,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polymer .Base.extend(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attrib ute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotationE ffect:function(e,t,n){e!=n.value&&(t=this._get(n.value),this.__data__[n.value]=t ),this._applyEffectValue(n,t)},_reflectEffect:function(e,t,n){this.reflectProper tyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._notif yChange(e,n.event,t)},_functionEffect:function(e,t,n,r,s){n.call(this,e,t,r,s)}, _observerEffect:function(e,t,n,r){var s=this[n.method];s?s.call(this,t,r):this._ warn(this._logf("_observerEffect","observer method `"+n.method+"` not defined")) },_complexObserverEffect:function(e,t,n){var r=this[n.method];if(r){var s=Polyme r.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn||th is._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` not defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=Pol ymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this.__s etProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect"," compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:functi on(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bind. _marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectValu e(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compute method `"+n.method+"` not defined"))},_marshalArgs:function(e,t,n,r){for(var s= [],i=t.args,o=i.length>1||t.dynamicFn,a=0,l=i.length;a<l;a++){var c,h=i[a],u=h.n ame;if(h.literal?c=h.value:n===u?c=r:(c=e[u],void 0===c&&h.structured&&(c=Polyme r.Base._get(u,e))),o&&void 0===c)return;if(h.wildcard){var f=Polymer.Path.isAnce stor(n,u);s[a]={path:f?n:u,value:f?r:c,base:c}}else s[a]=c}return s}}),Polymer.B ase._addFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addProper tyEffect(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:functi on(){Polymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_p repBindings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:fu nction(e){if(e)for(var t in e){var n=e[t];if(n.observer&&this._addObserverEffect (t,n.observer),n.computed&&(n.readOnly=!0,this._addComputedEffect(t,n.computed)) ,n.notify&&this._addPropertyEffect(t,"notify",{event:Polymer.CaseMap.camelToDash Case(t)+"-changed"}),n.reflectToAttribute){var r=Polymer.CaseMap.camelToDashCase (t);"-"===r[0]?this._warn(this._logf("_addPropertyEffects","Property "+t+" canno t be reflected to attribute "+r+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):this._addPropert yEffect(t,"reflect",{attribute:r})}n.readOnly&&Polymer.Bind.ensurePropertyEffect s(this,t)}},_addComputedEffect:function(e,t){for(var n,r=this._parseMethod(t),s= r.dynamicFn,i=0;i<r.args.length&&(n=r.args[i]);i++)this._addPropertyEffect(n.mod el,"compute",{method:r.method,args:r.args,trigger:n,name:e,dynamicFn:s});s&&this ._addPropertyEffect(r.method,"compute",{method:r.method,args:r.args,trigger:null ,name:e,dynamicFn:s})},_addObserverEffect:function(e,t){this._addPropertyEffect( e,"observer",{method:t,property:e})},_addComplexObserverEffects:function(e){if(e )for(var t,n=0;n<e.length&&(t=e[n]);n++)this._addComplexObserverEffect(t)},_addC omplexObserverEffect:function(e){var t=this._parseMethod(e);if(!t)throw new Erro r("Malformed observer expression '"+e+"'");for(var n,r=t.dynamicFn,s=0;s<t.args. length&&(n=t.args[s]);s++)this._addPropertyEffect(n.model,"complexObserver",{met hod:t.method,args:t.args,trigger:n,dynamicFn:r});r&&this._addPropertyEffect(t.me thod,"complexObserver",{method:t.method,args:t.args,trigger:null,dynamicFn:r})}, _addAnnotationEffects:function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)for(var r,s=t.bindings,i=0;i<s.length&&(r=s[i]);i++)this._addAnnotationEffect(r,n)},_ad dAnnotationEffect:function(e,t){Polymer.Bind._shouldAddListener(e)&&Polymer.Bind ._addAnnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0 ].negate);for(var n=0;n<e.parts.length;n++){var r=e.parts[n];r.signature?this._a ddAnnotatedComputationEffect(e,r,t):r.literal||("attribute"===e.kind&&"-"===e.na me[0]?this._warn(this._logf("_addAnnotationEffect","Cannot set attribute "+e.nam e+' because "-" is not a valid attribute starting character')):this._addProperty Effect(r.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.prop ertyName,value:r.value,isCompound:e.isCompound,compoundIndex:r.compoundIndex,eve nt:r.event,customEvent:r.customEvent,negate:r.negate}))}},_addAnnotatedComputati onEffect:function(e,t,n){var r=t.signature;if(r.static)this.__addAnnotatedComput ationEffect("__static__",n,e,t,null);else{for(var s,i=0;i<r.args.length&&(s=r.ar gs[i]);i++)s.literal||this.__addAnnotatedComputationEffect(s.model,n,e,t,s);r.dy namicFn&&this.__addAnnotatedComputationEffect(r.method,n,e,t,null)}},__addAnnota tedComputationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedCom putation",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n. kind,name:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args ,trigger:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.m atch(/([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getPr opertyInfo(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){va r r=t[2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.args=Polymer.nar,n}},_parseArgs:function(e,t){return t.args=e.map(function(e) {var n=this._parseArg(e);return n.literal||(t.static=!1),n},this),t},_parseArg:f unction(e){var t=e.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),n={name :t},r=t[0];switch("-"===r&&(r=t[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':n .value=t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}r eturn n.literal||(n.model=Polymer.Path.root(t),n.structured=Polymer.Path.isDeep( t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2) ))),n},_marshalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),thi s._bindListeners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:funct ion(e,t){var n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationVa lue(n,r,t,e),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._propertyInfo&&n._propertyInfo[r];if(s&&s.readOnly)return;this.__setProperty (r,t,!1,n)}},_computeFinalAnnotationValue:function(e,t,n,r){if(r.negate&&(n=!n), r.isCompound){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}r eturn"attribute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),(" textContent"===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_exe cuteStaticEffects:function(){this._propertyEffects&&this._propertyEffects.__stat ic__&&this._effectEffects("__static__",null,this._propertyEffects.__static__)}}) ,function(){var e=Polymer.Settings.usePolyfillProto;Polymer.Base._addFeature({_s etupConfigure:function(e){if(this._config={},this._handlers=[],this._aboveConfig =null,e)for(var t in e)void 0!==e[t]&&(this._config[t]=e[t])},_marshalAttributes :function(){this._takeAttributesToModel(this._config)},_attributeChangedImpl:fun ction(e){var t=this._clientsReadied?this:this._config;this._setAttributeToProper ty(t,e)},_configValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||( this._config[e]=t)},_beforeClientsReady:function(){this._configure()},_configure :function(){this._configureAnnotationReferences(),this._configureInstancePropert ies(),this._aboveConfig=this.mixin({},this._config);for(var e={},t=0;t<this.beha viors.length;t++)this._configureProperties(this.behaviors[t].properties,e);this. _configureProperties(this.properties,e),this.mixin(e,this._aboveConfig),this._co nfig=e,this._clients&&this._clients.length&&this._distributeConfig(this._config) },_configureInstanceProperties:function(){for(var t in this._propertyEffects)!e& &this.hasOwnProperty(t)&&(this._configValue(t,this[t]), 2 },_distributeDirtyRoots:function(){for(var e,t=this.shadyRoot._dirtyRoots,o=0,i= t.length;o<i&&(e=t[o]);o++)e._distributeContent();this.shadyRoot._dirtyRoots=[]} ,_finishDistribute:function(){if(this._useContent){if(this.shadyRoot._distributi onClean=!0,h.hasInsertionPoint(this.shadyRoot))this._composeTree(),d(this.shadyR oot);else if(this.shadyRoot._hasDistributed){var e=this._composeNode(this);this. _updateChildNodes(this,e)}else u.Composed.clearChildNodes(this),this.appendChild (this.shadyRoot);this.shadyRoot._hasDistributed||a(this),this.shadyRoot._hasDist ributed=!0}},elementMatches:function(e,t){return t=t||this,h.matchesSelector.cal l(t,e)},_resetDistribution:function(){for(var e=u.Logical.getChildNodes(this),o= 0;o<e.length;o++){var i=e[o];i._destinationInsertionPoints&&(i._destinationInser tionPoints=void 0),n(i)&&t(i)}for(var s=this.shadyRoot,r=s._insertionPoints,d=0; d<r.length;d++)r[d]._distributedNodes=[]},_collectPool:function(){for(var e=[],t =u.Logical.getChildNodes(this),o=0;o<t.length;o++){var i=t[o];n(i)?e.push.apply( e,i._distributedNodes):e.push(i)}return e},_distributePool:function(e,t){for(var i,n=e._insertionPoints,s=0,r=n.length;s<r&&(i=n[s]);s++)this._distributeInserti onPoint(i,t),o(i,this)},_distributeInsertionPoint:function(t,o){for(var i,n=!1,s =0,r=o.length;s<r;s++)i=o[s],i&&this._matchesContentSelect(i,t)&&(e(i,t),o[s]=vo id 0,n=!0);if(!n)for(var d=u.Logical.getChildNodes(t),a=0;a<d.length;a++)e(d[a], t)},_composeTree:function(){this._updateChildNodes(this,this._composeNode(this)) ;for(var e,t,o=this.shadyRoot._insertionPoints,i=0,n=o.length;i<n&&(e=o[i]);i++) t=u.Logical.getParentNode(e),t._useContent||t===this||t===this.shadyRoot||this._ updateChildNodes(t,this._composeNode(t))},_composeNode:function(e){for(var t=[], o=u.Logical.getChildNodes(e.shadyRoot||e),s=0;s<o.length;s++){var r=o[s];if(n(r) )for(var d=r._distributedNodes,a=0;a<d.length;a++){var l=d[a];i(r,l)&&t.push(l)} else t.push(r)}return t},_updateChildNodes:function(e,t){for(var o,i=u.Composed. getChildNodes(e),n=Polymer.ArraySplice.calculateSplices(t,i),s=0,r=0;s<n.length& &(o=n[s]);s++){for(var d,a=0;a<o.removed.length&&(d=o.removed[a]);a++)u.Composed .getParentNode(d)===e&&u.Composed.removeChild(e,d),i.splice(o.index+r,1);r-=o.ad dedCount}for(var o,l,s=0;s<n.length&&(o=n[s]);s++)for(l=i[o.index],a=o.index,d;a <o.index+o.addedCount;a++)d=t[a],u.Composed.insertBefore(e,d,l),i.splice(a,0,d)} ,_matchesContentSelect:function(e,t){var o=t.getAttribute("select");if(!o)return !0;if(o=o.trim(),!o)return!0;if(!(e instanceof Element))return!1;var i=/^(:not\( )?[*.#[a-zA-Z_|]/;return!!i.test(o)&&this.elementMatches(o,e)},_elementAdd:funct ion(){},_elementRemove:function(){}});var c=window.CustomElements&&!CustomElemen ts.useNative}(),Polymer.Settings.useShadow&&Polymer.Base._addFeature({_poolConte nt:function(){},_beginDistribute:function(){},distributeContent:function(){},_di stributeContent:function(){},_finishDistribute:function(){},_createLocalRoot:fun ction(){this.createShadowRoot(),this.shadowRoot.appendChild(this.root),this.root =this.shadowRoot}}),Polymer.Async={_currVal:0,_lastVal:0,_callbacks:[],_twiddleC ontent:0,_twiddle:document.createTextNode(""),run:function(e,t){return t>0?~setT imeout(e,t):(this._twiddle.textContent=this._twiddleContent++,this._callbacks.pu sh(e),this._currVal++)},cancel:function(e){if(e<0)clearTimeout(~e);else{var t=e- this._lastVal;if(t>=0){if(!this._callbacks[t])throw"invalid async handle: "+e;th is._callbacks[t]=null}}},_atEndOfMicrotask:function(){for(var e=this._callbacks. length,t=0;t<e;t++){var o=this._callbacks[t];if(o)try{o()}catch(e){throw t++,thi s._callbacks.splice(0,t),this._lastVal+=t,this._twiddle.textContent=this._twiddl eContent++,e}}this._callbacks.splice(0,e),this._lastVal+=e}},new window.Mutation Observer(function(){Polymer.Async._atEndOfMicrotask()}).observe(Polymer.Async._t widdle,{characterData:!0}),Polymer.Debounce=function(){function e(e,t,i){return e?e.stop():e=new o(this),e.go(t,i),e}var t=Polymer.Async,o=function(e){this.cont ext=e;var t=this;this.boundComplete=function(){t.complete()}};return o.prototype ={go:function(e,o){var i;this.finish=function(){t.cancel(i)},i=t.run(this.boundC omplete,o),this.callback=e},stop:function(){this.finish&&(this.finish(),this.fin ish=null,this.callback=null)},complete:function(){if(this.finish){var e=this.cal lback;this.stop(),e.call(this.context)}}},e}(),Polymer.Base._addFeature({_setupD ebouncers:function(){this._debouncers={}},debounce:function(e,t,o){return this._ debouncers[e]=Polymer.Debounce.call(this,this._debouncers[e],t,o)},isDebouncerAc tive:function(e){var t=this._debouncers[e];return!(!t||!t.finish)},flushDebounce r:function(e){var t=this._debouncers[e];t&&t.complete()},cancelDebouncer:functio n(e){var t=this._debouncers[e];t&&t.stop()}}),Polymer.DomModule=document.createE lement("dom-module"),Polymer.Base._addFeature({_registerFeatures:function(){this ._prepIs(),this._prepBehaviors(),this._prepConstructor(),this._prepTemplate(),th is._prepShady(),this._prepPropertyInfo()},_prepBehavior:function(e){this._addHos tAttributes(e.hostAttributes)},_initFeatures:function(){this._registerHost(),thi s._template&&(this._poolContent(),this._beginHosting(),this._stampTemplate(),thi s._endHosting()),this._marshalHostAttributes(),this._setupDebouncers(),this._mar shalBehaviors(),this._tryReady()},_marshalBehavior:function(e){}})</script> <scr ipt>Polymer.nar=[],Polymer.Annotations={parseAnnotations:function(e){var t=[],n= e._content||e.content;return this._parseNodeAnnotations(n,t,e.hasAttribute("stri p-whitespace")),t},_parseNodeAnnotations:function(e,t,n){return e.nodeType===Nod e.TEXT_NODE?this._parseTextNodeAnnotation(e,t):this._parseElementAnnotations(e,t ,n)},_bindingRegex:function(){var e="(?:[a-zA-Z_$][\\w.:$\\-*]*)",t="(?:[-+]?[0- 9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)",n="(?:'(?:[^'\\\\]|\\\\.)*')",r='(?:"(?:[^"\ \\\]|\\\\.)*")',s="(?:"+n+"|"+r+")",i="(?:"+e+"|"+t+"|"+s+"\\s*)",o="(?:"+i+"(?: ,\\s*"+i+")*)",a="(?:\\(\\s*(?:"+o+"?)\\)\\s*)",l="("+e+"\\s*"+a+"?)",c="(\\[\\[ |{{)\\s*",h="(?:]]|}})",u="(?:(!)\\s*)?",f=c+u+l+h;return new RegExp(f,"g")}(),_ parseBindings:function(e){for(var t,n=this._bindingRegex,r=[],s=0;null!==(t=n.ex ec(e));){t.index>s&&r.push({literal:e.slice(s,t.index)});var i,o,a,l=t[1][0],c=B oolean(t[2]),h=t[3].trim();"{"==l&&(a=h.indexOf("::"))>0&&(o=h.substring(a+2),h= h.substring(0,a),i=!0),r.push({compoundIndex:r.length,value:h,mode:l,negate:c,ev ent:o,customEvent:i}),s=n.lastIndex}if(s&&s<e.length){var u=e.substring(s);u&&r. push({literal:u})}if(r.length)return r},_literalFromParts:function(e){for(var t= "",n=0;n<e.length;n++){var r=e[n].literal;t+=r||""}return t},_parseTextNodeAnnot ation:function(e,t){var n=this._parseBindings(e.textContent);if(n){e.textContent =this._literalFromParts(n)||" ";var r={bindings:[{kind:"text",name:"textContent" ,parts:n,isCompound:1!==n.length}]};return t.push(r),r}},_parseElementAnnotation s:function(e,t,n){var r={bindings:[],events:[]};return"content"===e.localName&&( t._hasContent=!0),this._parseChildNodesAnnotations(e,r,t,n),e.attributes&&(this. _parseNodeAttributeAnnotations(e,r,t),this.prepElement&&this.prepElement(e)),(r. bindings.length||r.events.length||r.id)&&t.push(r),r},_parseChildNodesAnnotation s:function(e,t,n,r){if(e.firstChild)for(var s=e.firstChild,i=0;s;){var o=s.nextS ibling;if("template"!==s.localName||s.hasAttribute("preserve-content")||this._pa rseTemplate(s,i,n,t),"slot"==s.localName&&(s=this._replaceSlotWithContent(s)),s. nodeType===Node.TEXT_NODE){for(var a=o;a&&a.nodeType===Node.TEXT_NODE;)s.textCon tent+=a.textContent,o=a.nextSibling,e.removeChild(a),a=o;r&&!s.textContent.trim( )&&(e.removeChild(s),i--)}if(s.parentNode){var l=this._parseNodeAnnotations(s,n, r);l&&(l.parent=t,l.index=i)}s=o,i++}},_replaceSlotWithContent:function(e){for(v ar t=e.ownerDocument.createElement("content");e.firstChild;)t.appendChild(e.firs tChild);for(var n=e.attributes,r=0;r<n.length;r++){var s=n[r];t.setAttribute(s.n ame,s.value)}var i=e.getAttribute("name"),o=i?"[slot='"+i+"']":":not([slot])";re turn t.setAttribute("select",o),e.parentNode.replaceChild(t,e),t},_parseTemplate :function(e,t,n,r){var s=document.createDocumentFragment();s._notes=this.parseAn notations(e),s.appendChild(e.content),n.push({bindings:Polymer.nar,events:Polyme r.nar,templateContent:s,parent:r,index:t})},_parseNodeAttributeAnnotations:funct ion(e,t){for(var n,r=Array.prototype.slice.call(e.attributes),s=r.length-1;n=r[s ];s--){var i,o=n.name,a=n.value;"on-"===o.slice(0,3)?(e.removeAttribute(o),t.eve nts.push({name:o.slice(3),value:a})):(i=this._parseNodeAttributeAnnotation(e,o,a ))?t.bindings.push(i):"id"===o&&(t.id=a)}},_parseNodeAttributeAnnotation:functio n(e,t,n){var r=this._parseBindings(n);if(r){var s=t,i="property";"$"==t[t.length -1]&&(t=t.slice(0,-1),i="attribute");var o=this._literalFromParts(r);o&&"attribu te"==i&&e.setAttribute(t,o),"input"===e.localName&&"value"===s&&e.setAttribute(s ,""),e.removeAttribute(s);var a=Polymer.CaseMap.dashToCamelCase(t);return"proper ty"===i&&(t=a),{kind:i,name:t,propertyName:a,parts:r,literal:o,isCompound:1!==r. length}}},findAnnotatedNode:function(e,t){var n=t.parent&&Polymer.Annotations.fi ndAnnotatedNode(e,t.parent);if(!n)return e;for(var r=n.firstChild,s=0;r;r=r.next Sibling)if(t.index===s++)return r}},function(){function e(e,t){return e.replace( a,function(e,r,s,i){return r+"'"+n(s.replace(/["']/g,""),t)+"'"+i})}function t(t ,r){for(var s in l)for(var i,o,a,c=l[s],u=0,f=c.length;u<f&&(i=c[u]);u++)"*"!==s &&t.localName!==s||(o=t.attributes[i],a=o&&o.value,a&&a.search(h)<0&&(o.value="s tyle"===i?e(a,r):n(a,r)))}function n(e,t){if(e&&c.test(e))return e;var n=s(t);re turn n.href=e,n.href||e}function r(e,t){return i||(i=document.implementation.cre ateHTMLDocument("temp"),o=i.createElement("base"),i.head.appendChild(o)),o.href= t,n(e,i)}function s(e){return e.__urlResolver||(e.__urlResolver=e.createElement( "a"))}var i,o,a=/(url\()([^)]*)(\))/g,l={"*":["href","src","style","url"],form:[ "action"]},c=/(^\/)|(^#)|(^[\w-\d]*:)/,h=/\{\{|\[\[/;Polymer.ResolveUrl={resolve Css:e,resolveAttrs:t,resolveUrl:r}}(),Polymer.Path={root:function(e){var t=e.ind exOf(".");return t===-1?e:e.slice(0,t)},isDeep:function(e){return e.indexOf(".") !==-1},isAncestor:function(e,t){return 0===e.indexOf(t+".")},isDescendant:functi on(e,t){return 0===t.indexOf(e+".")},translate:function(e,t,n){return t+n.slice( e.length)},matches:function(e,t,n){return e===n||this.isAncestor(e,n)||Boolean(t )&&this.isDescendant(e,n)}},Polymer.Base._addFeature({_prepAnnotations:function( ){if(this._template){var e=this;Polymer.Annotations.prepElement=function(t){e._p repElement(t)},this._template._content&&this._template._content._notes?this._not es=this._template._content._notes:(this._notes=Polymer.Annotations.parseAnnotati ons(this._template),this._processAnnotations(this._notes)),Polymer.Annotations.p repElement=null}else this._notes=[]},_processAnnotations:function(e){for(var t=0 ;t<e.length;t++){for(var n=e[t],r=0;r<n.bindings.length;r++)for(var s=n.bindings [r],i=0;i<s.parts.length;i++){var o=s.parts[i];if(!o.literal){var a=this._parseM ethod(o.value);a?o.signature=a:o.model=Polymer.Path.root(o.value)}}if(n.template Content){this._processAnnotations(n.templateContent._notes);var l=n.templateCont ent._parentProps=this._discoverTemplateParentProps(n.templateContent._notes),c=[ ];for(var h in l){var u="_parent_"+h;c.push({index:n.index,kind:"property",name: u,propertyName:u,parts:[{mode:"{",model:h,value:h}]})}n.bindings=n.bindings.conc at(c)}}},_discoverTemplateParentProps:function(e){for(var t,n={},r=0;r<e.length& &(t=e[r]);r++){for(var s,i=0,o=t.bindings;i<o.length&&(s=o[i]);i++)for(var a,l=0 ,c=s.parts;l<c.length&&(a=c[l]);l++)if(a.signature){for(var h=a.signature.args,u =0;u<h.length;u++){var f=h[u].model;f&&(n[f]=!0)}a.signature.dynamicFn&&(n[a.sig nature.method]=!0)}else a.model&&(n[a.model]=!0);if(t.templateContent){var p=t.t emplateContent._parentProps;Polymer.Base.mixin(n,p)}}return n},_prepElement:func tion(e){Polymer.ResolveUrl.resolveAttrs(e,this._template.ownerDocument)},_findAn notatedNode:Polymer.Annotations.findAnnotatedNode,_marshalAnnotationReferences:f unction(){this._template&&(this._marshalIdNodes(),this._marshalAnnotatedNodes(), this._marshalAnnotatedListeners())},_configureAnnotationReferences:function(){fo r(var e=this._notes,t=this._nodes,n=0;n<e.length;n++){var r=e[n],s=t[n];this._co nfigureTemplateContent(r,s),this._configureCompoundBindings(r,s)}},_configureTem plateContent:function(e,t){e.templateContent&&(t._content=e.templateContent)},_c onfigureCompoundBindings:function(e,t){for(var n=e.bindings,r=0;r<n.length;r++){ var s=n[r];if(s.isCompound){for(var i=t.__compoundStorage__||(t.__compoundStorag e__={}),o=s.parts,a=new Array(o.length),l=0;l<o.length;l++)a[l]=o[l].literal;var c=s.name;i[c]=a,s.literal&&"property"==s.kind&&(t._configValue?t._configValue(c ,s.literal):t[c]=s.literal)}}},_marshalIdNodes:function(){this.$={};for(var e,t= 0,n=this._notes.length;t<n&&(e=this._notes[t]);t++)e.id&&(this.$[e.id]=this._fin dAnnotatedNode(this.root,e))},_marshalAnnotatedNodes:function(){if(this._notes&& this._notes.length){for(var e=new Array(this._notes.length),t=0;t<this._notes.le ngth;t++)e[t]=this._findAnnotatedNode(this.root,this._notes[t]);this._nodes=e}}, _marshalAnnotatedListeners:function(){for(var e,t=0,n=this._notes.length;t<n&&(e =this._notes[t]);t++)if(e.events&&e.events.length)for(var r,s=this._findAnnotate dNode(this.root,e),i=0,o=e.events;i<o.length&&(r=o[i]);i++)this.listen(s,r.name, r.value)}}),Polymer.Base._addFeature({listeners:{},_listenListeners:function(e){ var t,n,r;for(r in e)r.indexOf(".")<0?(t=this,n=r):(n=r.split("."),t=this.$[n[0] ],n=n[1]),this.listen(t,n,e[r])},listen:function(e,t,n){var r=this._recallEventH andler(this,t,e,n);r||(r=this._createEventHandler(e,t,n)),r._listening||(this._l isten(e,t,r),r._listening=!0)},_boundListenerKey:function(e,t){return e+":"+t},_ recordEventHandler:function(e,t,n,r,s){var i=e.__boundListeners;i||(i=e.__boundL isteners=new WeakMap);var o=i.get(n);o||(o={},i.set(n,o));var a=this._boundListe nerKey(t,r);o[a]=s},_recallEventHandler:function(e,t,n,r){var s=e.__boundListene rs;if(s){var i=s.get(n);if(i){var o=this._boundListenerKey(t,r);return i[o]}}},_ createEventHandler:function(e,t,n){var r=this,s=function(e){r[n]?r[n](e,e.detail ):r._warn(r._logf("_createEventHandler","listener method `"+n+"` not defined"))} ;return s._listening=!1,this._recordEventHandler(r,t,e,n,s),s},unlisten:function (e,t,n){var r=this._recallEventHandler(this,t,e,n);r&&(this._unlisten(e,t,r),r._ listening=!1)},_listen:function(e,t,n){e.addEventListener(t,n)},_unlisten:functi on(e,t,n){e.removeEventListener(t,n)}}),function(){"use strict";function e(e){fo r(var t,n=g?["click"]:m,r=0;r<n.length;r++)t=n[r],e?document.addEventListener(t, P,!0):document.removeEventListener(t,P,!0)}function t(){S.mouse.mouseIgnoreJob|| e(!0);var t=function(){e(),S.mouse.target=null,S.mouse.mouseIgnoreJob=null};S.mo use.mouseIgnoreJob=Polymer.Debounce(S.mouse.mouseIgnoreJob,t,d)}function n(e){va r t=e.type;if(m.indexOf(t)===-1)return!1;if("mousemove"===t){var n=void 0===e.bu ttons?1:e.buttons;return e instanceof window.MouseEvent&&!v&&(n=y[e.which]||0),B oolean(1&n)}var r=void 0===e.button?0:e.button;return 0===r}function r(e){if("cl ick"===e.type){if(0===e.detail)return!0;var t=C.findOriginalTarget(e),n=t.getBou ndingClientRect(),r=e.pageX,s=e.pageY;return!(r>=n.left&&r<=n.right&&s>=n.top&&s <=n.bottom)}return!1}function s(e){for(var t,n=Polymer.dom(e).path,r="auto",s=0; s<n.length;s++)if(t=n[s],t[u]){r=t[u];break}return r}function i(e,t,n){e.movefn= t,e.upfn=n,document.addEventListener("mousemove",t),document.addEventListener("m ouseup",n)}function o(e){document.removeEventListener("mousemove",e.movefn),docu ment.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}var a=Polym er.DomApi.wrap,l="string"==typeof document.head.style.touchAction,c="__polymerGe stures",h="__polymerGesturesHandled",u="__polymerGesturesTouchAction",f=25,p=5,_ =2,d=2500,m=["mousedown","mousemove","mouseup","click"],y=[0,1,4,2],v=function() {try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}() ,g=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/),P=function(e){var t=e.s ourceCapabilities;if((!t||t.firesTouchEvents)&&(e[h]={skip:!0},"click"===e.type) ){for(var n=Polymer.dom(e).path,r=0;r<n.length;r++)if(n[r]===S.mouse.target)retu rn;e.preventDefault(),e.stopPropagation()}},S={mouse:{target:null,mouseIgnoreJob :null},touch:{x:0,y:0,id:-1,scrollDecided:!1}},C={gestures:{},recognizers:[],dee pTargetFind:function(e,t){for(var n=document.elementFromPoint(e,t),r=n;r&&r.shad owRoot;)r=r.shadowRoot.elementFromPoint(e,t),r&&(n=r);return n},findOriginalTarg et:function(e){return e.path?e.path[0]:e.target},handleNative:function(e){var n, r=e.type,s=a(e.currentTarget),i=s[c];if(i){var o=i[r];if(o){if(!e[h]&&(e[h]={}," touch"===r.slice(0,5))){var u=e.changedTouches[0];if("touchstart"===r&&1===e.tou ches.length&&(S.touch.id=u.identifier),S.touch.id!==u.identifier)return;l||"touc hstart"!==r&&"touchmove"!==r||C.handleTouchAction(e),"touchend"===r&&(S.mouse.ta rget=Polymer.dom(e).rootTarget,t())}if(n=e[h],!n.skip){for(var f,p=C.recognizers ,_=0;_<p.length;_++)f=p[_],o[f.name]&&!n[f.name]&&f.flow&&f.flow.start.indexOf(e .type)>-1&&f.reset&&f.reset();for(_=0,f;_<p.length;_++)f=p[_],o[f.name]&&!n[f.na me]&&(n[f.name]=!0,f[r](e))}}}},handleTouchAction:function(e){var t=e.changedTou ches[0],n=e.type;if("touchstart"===n)S.touch.x=t.clientX,S.touch.y=t.clientY,S.t ouch.scrollDecided=!1;else if("touchmove"===n){if(S.touch.scrollDecided)return;S .touch.scrollDecided=!0;var r=s(e),i=!1,o=Math.abs(S.touch.x-t.clientX),a=Math.a bs(S.touch.y-t.clientY);e.cancelable&&("none"===r?i=!0:"pan-x"===r?i=a>o:"pan-y" ===r&&(i=o>a)),i?e.preventDefault():C.prevent("track")}},add:function(e,t,n){e=a (e);var r=this.gestures[t],s=r.deps,i=r.name,o=e[c];o||(e[c]=o={});for(var l,h,u =0;u<s.length;u++)l=s[u],g&&m.indexOf(l)>-1&&"click"!==l||(h=o[l],h||(o[l]=h={_c ount:0}),0===h._count&&e.addEventListener(l,this.handleNative),h[i]=(h[i]||0)+1, h._count=(h._count||0)+1);e.addEventListener(t,n),r.touchAction&&this.setTouchAc tion(e,r.touchAction)},remove:function(e,t,n){e=a(e);var r=this.gestures[t],s=r. deps,i=r.name,o=e[c];if(o)for(var l,h,u=0;u<s.length;u++)l=s[u],h=o[l],h&&h[i]&& (h[i]=(h[i]||1)-1,h._count=(h._count||1)-1,0===h._count&&e.removeEventListener(l ,this.handleNative));e.removeEventListener(t,n)},register:function(e){this.recog nizers.push(e);for(var t=0;t<e.emits.length;t++)this.gestures[e.emits[t]]=e},fin dRecognizerByEvent:function(e){for(var t,n=0;n<this.recognizers.length;n++){t=th is.recognizers[n];for(var r,s=0;s<t.emits.length;s++)if(r=t.emits[s],r===e)retur n t}return null},setTouchAction:function(e,t){l&&(e.style.touchAction=t),e[u]=t} ,fire:function(e,t,n){var r=Polymer.Base.fire(t,n,{node:e,bubbles:!0,cancelable: !0});if(r.defaultPrevented){var s=n.preventer||n.sourceEvent;s&&s.preventDefault &&s.preventDefault()}},prevent:function(e){var t=this.findRecognizerByEvent(e);t .info&&(t.info.prevent=!0)},resetMouseCanceller:function(){S.mouse.mouseIgnoreJo b&&S.mouse.mouseIgnoreJob.complete()}};C.register({name:"downup",deps:["mousedow n","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup ","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function() {o(this.info)},mousedown:function(e){if(n(e)){var t=C.findOriginalTarget(e),r=th is,s=function(e){n(e)||(r.fire("up",t,e),o(r.info))},a=function(e){n(e)&&r.fire( "up",t,e),o(r.info)};i(this.info,s,a),this.fire("down",t,e)}},touchstart:functio n(e){this.fire("down",C.findOriginalTarget(e),e.changedTouches[0],e)},touchend:f unction(e){this.fire("up",C.findOriginalTarget(e),e.changedTouches[0],e)},fire:f unction(e,t,n,r){C.fire(t,e,{x:n.clientX,y:n.clientY,sourceEvent:n,preventer:r,p revent:function(e){return C.prevent(e)}})}}),C.register({name:"track",touchActio n:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mo usedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0 ,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>_&&this .moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:funct ion(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info. x=0,this.info.y=0,this.info.prevent=!1,o(this.info)},hasMovedEnough:function(e,t ){if(this.info.prevent)return!1;if(this.info.started)return!0;var n=Math.abs(thi s.info.x-e),r=Math.abs(this.info.y-t);return n>=p||r>=p},mousedown:function(e){i f(n(e)){var t=C.findOriginalTarget(e),r=this,s=function(e){var s=e.clientX,i=e.c lientY;r.hasMovedEnough(s,i)&&(r.info.state=r.info.started?"mouseup"===e.type?"e nd":"track":"start","start"===r.info.state&&C.prevent("tap"),r.info.addMove({x:s ,y:i}),n(e)||(r.info.state="end",o(r.info)),r.fire(t,e),r.info.started=!0)},a=fu nction(e){r.info.started&&s(e),o(r.info)};i(this.info,s,a),this.info.x=e.clientX ,this.info.y=e.clientY}},touchstart:function(e){var t=e.changedTouches[0];this.i nfo.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){var t=C.findOrigina lTarget(e),n=e.changedTouches[0],r=n.clientX,s=n.clientY;this.hasMovedEnough(r,s )&&("start"===this.info.state&&C.prevent("tap"),this.info.addMove({x:r,y:s}),thi s.fire(t,n),this.info.state="track",this.info.started=!0)},touchend:function(e){ var t=C.findOriginalTarget(e),n=e.changedTouches[0];this.info.started&&(this.inf o.state="end",this.info.addMove({x:n.clientX,y:n.clientY}),this.fire(t,n,e))},fi re:function(e,t,n){var r,s=this.info.moves[this.info.moves.length-2],i=this.info .moves[this.info.moves.length-1],o=i.x-this.info.x,a=i.y-this.info.y,l=0;return s&&(r=i.x-s.x,l=i.y-s.y),C.fire(e,"track",{state:this.info.state,x:t.clientX,y:t .clientY,dx:o,dy:a,ddx:r,ddy:l,sourceEvent:t,preventer:n,hover:function(){return C.deepTargetFind(t.clientX,t.clientY)}})}}),C.register({name:"tap",deps:["mouse down","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],en d:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:functi on(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},save:function(e){this .info.x=e.clientX,this.info.y=e.clientY},mousedown:function(e){n(e)&&this.save(e )},click:function(e){n(e)&&this.forward(e)},touchstart:function(e){this.save(e.c hangedTouches[0],e)},touchend:function(e){this.forward(e.changedTouches[0],e)},f orward:function(e,t){var n=Math.abs(e.clientX-this.info.x),s=Math.abs(e.clientY- this.info.y),i=C.findOriginalTarget(e);(isNaN(n)||isNaN(s)||n<=f&&s<=f||r(e))&&( this.info.prevent||C.fire(i,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,prevent er:t}))}});var E={x:"pan-x",y:"pan-y",none:"none",all:"auto"};Polymer.Base._addF eature({_setupGestures:function(){this.__polymerGestures=null},_listen:function( e,t,n){C.gestures[t]?C.add(e,t,n):e.addEventListener(t,n)},_unlisten:function(e, t,n){C.gestures[t]?C.remove(e,t,n):e.removeEventListener(t,n)},setScrollDirectio n:function(e,t){t=t||this,C.setTouchAction(t,E[e]||"auto")}}),Polymer.Gestures=C }(),function(){"use strict";if(Polymer.Base._addFeature({$$:function(e){return P olymer.dom(this.root).querySelector(e)},toggleClass:function(e,t,n){n=n||this,1= =arguments.length&&(t=!n.classList.contains(e)),t?Polymer.dom(n).classList.add(e ):Polymer.dom(n).classList.remove(e)},toggleAttribute:function(e,t,n){n=n||this, 1==arguments.length&&(t=!n.hasAttribute(e)),t?Polymer.dom(n).setAttribute(e,""): Polymer.dom(n).removeAttribute(e)},classFollows:function(e,t,n){n&&Polymer.dom(n ).classList.remove(e),t&&Polymer.dom(t).classList.add(e)},attributeFollows:funct ion(e,t,n){n&&Polymer.dom(n).removeAttribute(e),t&&Polymer.dom(t).setAttribute(e ,"")},getEffectiveChildNodes:function(){return Polymer.dom(this).getEffectiveChi ldNodes()},getEffectiveChildren:function(){var e=Polymer.dom(this).getEffectiveC hildNodes();return e.filter(function(e){return e.nodeType===Node.ELEMENT_NODE})} ,getEffectiveTextContent:function(){for(var e,t=this.getEffectiveChildNodes(),n= [],r=0;e=t[r];r++)e.nodeType!==Node.COMMENT_NODE&&n.push(Polymer.dom(e).textCont ent);return n.join("")},queryEffectiveChildren:function(e){var t=Polymer.dom(thi s).queryDistributedElements(e);return t&&t[0]},queryAllEffectiveChildren:functio n(e){return Polymer.dom(this).queryDistributedElements(e)},getContentChildNodes: function(e){var t=Polymer.dom(this.root).querySelector(e||"content");return t?Po lymer.dom(t).getDistributedNodes():[]},getContentChildren:function(e){return thi s.getContentChildNodes(e).filter(function(e){return e.nodeType===Node.ELEMENT_NO DE})},fire:function(e,t,n){n=n||Polymer.nob;var r=n.node||this;t=null===t||void 0===t?{}:t;var s=void 0===n.bubbles||n.bubbles,i=Boolean(n.cancelable),o=n._useC ache,a=this._getEvent(e,s,i,o);return a.detail=t,o&&(this.__eventCache[e]=null), r.dispatchEvent(a),o&&(this.__eventCache[e]=a),a},__eventCache:{},_getEvent:func tion(e,t,n,r){var s=r&&this.__eventCache[e];return s&&s.bubbles==t&&s.cancelable ==n||(s=new Event(e,{bubbles:Boolean(t),cancelable:n})),s},async:function(e,t){v ar n=this;return Polymer.Async.run(function(){e.call(n)},t)},cancelAsync:functio n(e){Polymer.Async.cancel(e)},arrayDelete:function(e,t){var n;if(Array.isArray(e )){if(n=e.indexOf(t),n>=0)return e.splice(n,1)}else{var r=this._get(e);if(n=r.in dexOf(t),n>=0)return this.splice(e,n,1)}},transform:function(e,t){t=t||this,t.st yle.webkitTransform=e,t.style.transform=e},translate3d:function(e,t,n,r){r=r||th is,this.transform("translate3d("+e+","+t+","+n+")",r)},importHref:function(e,t,n ,r){var s=document.createElement("link");s.rel="import",s.href=e;var i=Polymer.B ase.importHref.imported=Polymer.Base.importHref.imported||{},o=i[s.href],a=o||s, l=this;if(t){var c=function(e){return e.target.__firedLoad=!0,e.target.removeEve ntListener("load",c),t.call(l,e)};a.addEventListener("load",c)}if(n){var h=funct ion(e){return e.target.__firedError=!0,e.target.removeEventListener("error",h),n .call(l,e)};a.addEventListener("error",h)}return o?(o.__firedLoad&&o.dispatchEve nt(new Event("load")),o.__firedError&&o.dispatchEvent(new Event("error"))):(i[s. href]=s,r=Boolean(r),r&&s.setAttribute("async",""),document.head.appendChild(s)) ,a},create:function(e,t){var n=document.createElement(e);if(t)for(var r in t)n[r ]=t[r];return n},isLightDescendant:function(e){return this!==e&&this.contains(e) &&Polymer.dom(this).getOwnerRoot()===Polymer.dom(e).getOwnerRoot()},isLocalDesce ndant:function(e){return this.root===Polymer.dom(e).getOwnerRoot()}}),!Polymer.S ettings.useNativeCustomElements){var e=Polymer.Base.importHref;Polymer.Base.impo rtHref=function(t,n,r,s){CustomElements.ready=!1;var i=function(e){if(CustomElem ents.upgradeDocumentTree(document),CustomElements.ready=!0,n)return n.call(this, e)};return e.call(this,t,i,r,s)}}}(),Polymer.Bind={prepareModel:function(e){Poly mer.Base.mixin(e,this._modelApi)},_modelApi:{_notifyChange:function(e,t,n){n=voi d 0===n?this[e]:n,t=t||Polymer.CaseMap.camelToDashCase(e)+"-changed",this.fire(t ,{value:n},{bubbles:!1,cancelable:!1,_useCache:!0})},_propertySetter:function(e, t,n,r){var s=this.__data__[e];return s===t||s!==s&&t!==t||(this.__data__[e]=t,"o bject"==typeof t&&this._clearPath(e),this._propertyChanged&&this._propertyChange d(e,t,s),n&&this._effectEffects(e,t,n,s,r)),s},__setProperty:function(e,t,n,r){r =r||this;var s=r._propertyEffects&&r._propertyEffects[e];s?r._propertySetter(e,t ,s,n):r[e]!==t&&(r[e]=t)},_effectEffects:function(e,t,n,r,s){for(var i,o=0,a=n.l ength;o<a&&(i=n[o]);o++)i.fn.call(this,e,this[e],i.effect,r,s)},_clearPath:funct ion(e){for(var t in this.__data__)Polymer.Path.isDescendant(e,t)&&(this.__data__ [t]=void 0)}},ensurePropertyEffects:function(e,t){e._propertyEffects||(e._proper tyEffects={});var n=e._propertyEffects[t];return n||(n=e._propertyEffects[t]=[]) ,n},addPropertyEffect:function(e,t,n,r){var s=this.ensurePropertyEffects(e,t),i= {kind:n,effect:r,fn:Polymer.Bind["_"+n+"Effect"]};return s.push(i),i},createBind ings:function(e){var t=e._propertyEffects;if(t)for(var n in t){var r=t[n];r.sort (this._sortPropertyEffects),this._createAccessors(e,n,r)}},_sortPropertyEffects: function(){var e={compute:0,annotation:1,annotatedComputation:2,reflect:3,notify :4,observer:5,complexObserver:6,function:7};return function(t,n){return e[t.kind ]-e[n.kind]}}(),_createAccessors:function(e,t,n){var r={get:function(){return th is.__data__[t]}},s=function(e){this._propertySetter(t,e,n)},i=e.getPropertyInfo& &e.getPropertyInfo(t);i&&i.readOnly?i.computed||(e["_set"+this.upper(t)]=s):r.se t=s,Object.defineProperty(e,t,r)},upper:function(e){return e[0].toUpperCase()+e. substring(1)},_addAnnotatedListener:function(e,t,n,r,s,i){e._bindListeners||(e._ bindListeners=[]);var o=this._notedListenerFactory(n,r,Polymer.Path.isDeep(r),i) ,a=s||Polymer.CaseMap.camelToDashCase(n)+"-changed";e._bindListeners.push({index :t,property:n,path:r,changedFn:o,event:a})},_isEventBogus:function(e,t){return e .path&&e.path[0]!==t},_notedListenerFactory:function(e,t,n,r){return function(s, i,o){if(o){var a=Polymer.Path.translate(e,t,o);this._notifyPath(a,i)}else i=s[e] ,r&&(i=!i),n?this.__data__[t]!=i&&this.set(t,i):this[t]=i}},prepareInstance:func tion(e){e.__data__=Object.create(null)},setupBindListeners:function(e){for(var t ,n=e._bindListeners,r=0,s=n.length;r<s&&(t=n[r]);r++){var i=e._nodes[t.index];th is._addNotifyListener(i,e,t.event,t.changedFn)}},_addNotifyListener:function(e,t ,n,r){e.addEventListener(n,function(e){return t._notifyListener(r,e)})}},Polymer .Base.extend(Polymer.Bind,{_shouldAddListener:function(e){return e.name&&"attrib ute"!=e.kind&&"text"!=e.kind&&!e.isCompound&&"{"===e.parts[0].mode},_annotationE ffect:function(e,t,n){e!=n.value&&(t=this._get(n.value),this.__data__[n.value]=t ),this._applyEffectValue(n,t)},_reflectEffect:function(e,t,n){this.reflectProper tyToAttribute(e,n.attribute,t)},_notifyEffect:function(e,t,n,r,s){s||this._notif yChange(e,n.event,t)},_functionEffect:function(e,t,n,r,s){n.call(this,e,t,r,s)}, _observerEffect:function(e,t,n,r){var s=this[n.method];s?s.call(this,t,r):this._ warn(this._logf("_observerEffect","observer method `"+n.method+"` not defined")) },_complexObserverEffect:function(e,t,n){var r=this[n.method];if(r){var s=Polyme r.Bind._marshalArgs(this.__data__,n,e,t);s&&r.apply(this,s)}else n.dynamicFn||th is._warn(this._logf("_complexObserverEffect","observer method `"+n.method+"` not defined"))},_computeEffect:function(e,t,n){var r=this[n.method];if(r){var s=Pol ymer.Bind._marshalArgs(this.__data__,n,e,t);if(s){var i=r.apply(this,s);this.__s etProperty(n.name,i)}}else n.dynamicFn||this._warn(this._logf("_computeEffect"," compute method `"+n.method+"` not defined"))},_annotatedComputationEffect:functi on(e,t,n){var r=this._rootDataHost||this,s=r[n.method];if(s){var i=Polymer.Bind. _marshalArgs(this.__data__,n,e,t);if(i){var o=s.apply(r,i);this._applyEffectValu e(n,o)}}else n.dynamicFn||r._warn(r._logf("_annotatedComputationEffect","compute method `"+n.method+"` not defined"))},_marshalArgs:function(e,t,n,r){for(var s= [],i=t.args,o=i.length>1||t.dynamicFn,a=0,l=i.length;a<l;a++){var c,h=i[a],u=h.n ame;if(h.literal?c=h.value:n===u?c=r:(c=e[u],void 0===c&&h.structured&&(c=Polyme r.Base._get(u,e))),o&&void 0===c)return;if(h.wildcard){var f=Polymer.Path.isAnce stor(n,u);s[a]={path:f?n:u,value:f?r:c,base:c}}else s[a]=c}return s}}),Polymer.B ase._addFeature({_addPropertyEffect:function(e,t,n){var r=Polymer.Bind.addProper tyEffect(this,e,t,n);r.pathFn=this["_"+r.kind+"PathEffect"]},_prepEffects:functi on(){Polymer.Bind.prepareModel(this),this._addAnnotationEffects(this._notes)},_p repBindings:function(){Polymer.Bind.createBindings(this)},_addPropertyEffects:fu nction(e){if(e)for(var t in e){var n=e[t];if(n.observer&&this._addObserverEffect (t,n.observer),n.computed&&(n.readOnly=!0,this._addComputedEffect(t,n.computed)) ,n.notify&&this._addPropertyEffect(t,"notify",{event:Polymer.CaseMap.camelToDash Case(t)+"-changed"}),n.reflectToAttribute){var r=Polymer.CaseMap.camelToDashCase (t);"-"===r[0]?this._warn(this._logf("_addPropertyEffects","Property "+t+" canno t be reflected to attribute "+r+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.')):this._addPropert yEffect(t,"reflect",{attribute:r})}n.readOnly&&Polymer.Bind.ensurePropertyEffect s(this,t)}},_addComputedEffect:function(e,t){for(var n,r=this._parseMethod(t),s= r.dynamicFn,i=0;i<r.args.length&&(n=r.args[i]);i++)this._addPropertyEffect(n.mod el,"compute",{method:r.method,args:r.args,trigger:n,name:e,dynamicFn:s});s&&this ._addPropertyEffect(r.method,"compute",{method:r.method,args:r.args,trigger:null ,name:e,dynamicFn:s})},_addObserverEffect:function(e,t){this._addPropertyEffect( e,"observer",{method:t,property:e})},_addComplexObserverEffects:function(e){if(e )for(var t,n=0;n<e.length&&(t=e[n]);n++)this._addComplexObserverEffect(t)},_addC omplexObserverEffect:function(e){var t=this._parseMethod(e);if(!t)throw new Erro r("Malformed observer expression '"+e+"'");for(var n,r=t.dynamicFn,s=0;s<t.args. length&&(n=t.args[s]);s++)this._addPropertyEffect(n.model,"complexObserver",{met hod:t.method,args:t.args,trigger:n,dynamicFn:r});r&&this._addPropertyEffect(t.me thod,"complexObserver",{method:t.method,args:t.args,trigger:null,dynamicFn:r})}, _addAnnotationEffects:function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++)for(var r,s=t.bindings,i=0;i<s.length&&(r=s[i]);i++)this._addAnnotationEffect(r,n)},_ad dAnnotationEffect:function(e,t){Polymer.Bind._shouldAddListener(e)&&Polymer.Bind ._addAnnotatedListener(this,t,e.name,e.parts[0].value,e.parts[0].event,e.parts[0 ].negate);for(var n=0;n<e.parts.length;n++){var r=e.parts[n];r.signature?this._a ddAnnotatedComputationEffect(e,r,t):r.literal||("attribute"===e.kind&&"-"===e.na me[0]?this._warn(this._logf("_addAnnotationEffect","Cannot set attribute "+e.nam e+' because "-" is not a valid attribute starting character')):this._addProperty Effect(r.model,"annotation",{kind:e.kind,index:t,name:e.name,propertyName:e.prop ertyName,value:r.value,isCompound:e.isCompound,compoundIndex:r.compoundIndex,eve nt:r.event,customEvent:r.customEvent,negate:r.negate}))}},_addAnnotatedComputati onEffect:function(e,t,n){var r=t.signature;if(r.static)this.__addAnnotatedComput ationEffect("__static__",n,e,t,null);else{for(var s,i=0;i<r.args.length&&(s=r.ar gs[i]);i++)s.literal||this.__addAnnotatedComputationEffect(s.model,n,e,t,s);r.dy namicFn&&this.__addAnnotatedComputationEffect(r.method,n,e,t,null)}},__addAnnota tedComputationEffect:function(e,t,n,r,s){this._addPropertyEffect(e,"annotatedCom putation",{index:t,isCompound:n.isCompound,compoundIndex:r.compoundIndex,kind:n. kind,name:n.name,negate:r.negate,method:r.signature.method,args:r.signature.args ,trigger:s,dynamicFn:r.signature.dynamicFn})},_parseMethod:function(e){var t=e.m atch(/([^\s]+?)\(([\s\S]*)\)/);if(t){var n={method:t[1],static:!0};if(this.getPr opertyInfo(n.method)!==Polymer.nob&&(n.static=!1,n.dynamicFn=!0),t[2].trim()){va r r=t[2].replace(/\\,/g,"&comma;").split(",");return this._parseArgs(r,n)}return n.args=Polymer.nar,n}},_parseArgs:function(e,t){return t.args=e.map(function(e) {var n=this._parseArg(e);return n.literal||(t.static=!1),n},this),t},_parseArg:f unction(e){var t=e.trim().replace(/&comma;/g,",").replace(/\\(.)/g,"$1"),n={name :t},r=t[0];switch("-"===r&&(r=t[1]),r>="0"&&r<="9"&&(r="#"),r){case"'":case'"':n .value=t.slice(1,-1),n.literal=!0;break;case"#":n.value=Number(t),n.literal=!0}r eturn n.literal||(n.model=Polymer.Path.root(t),n.structured=Polymer.Path.isDeep( t),n.structured&&(n.wildcard=".*"==t.slice(-2),n.wildcard&&(n.name=t.slice(0,-2) ))),n},_marshalInstanceEffects:function(){Polymer.Bind.prepareInstance(this),thi s._bindListeners&&Polymer.Bind.setupBindListeners(this)},_applyEffectValue:funct ion(e,t){var n=this._nodes[e.index],r=e.name;if(t=this._computeFinalAnnotationVa lue(n,r,t,e),"attribute"==e.kind)this.serializeValueToAttribute(t,r,n);else{var s=n._propertyInfo&&n._propertyInfo[r];if(s&&s.readOnly)return;this.__setProperty (r,t,!1,n)}},_computeFinalAnnotationValue:function(e,t,n,r){if(r.negate&&(n=!n), r.isCompound){var s=e.__compoundStorage__[t];s[r.compoundIndex]=n,n=s.join("")}r eturn"attribute"!==r.kind&&("className"===t&&(n=this._scopeElementClass(e,n)),(" textContent"===t||"input"==e.localName&&"value"==t)&&(n=void 0==n?"":n)),n},_exe cuteStaticEffects:function(){this._propertyEffects&&this._propertyEffects.__stat ic__&&this._effectEffects("__static__",null,this._propertyEffects.__static__)}}) ,function(){var e=Polymer.Settings.usePolyfillProto;Polymer.Base._addFeature({_s etupConfigure:function(e){if(this._config={},this._handlers=[],this._aboveConfig =null,e)for(var t in e)void 0!==e[t]&&(this._config[t]=e[t])},_marshalAttributes :function(){this._takeAttributesToModel(this._config)},_attributeChangedImpl:fun ction(e){var t=this._clientsReadied?this:this._config;this._setAttributeToProper ty(t,e)},_configValue:function(e,t){var n=this._propertyInfo[e];n&&n.readOnly||( this._config[e]=t)},_beforeClientsReady:function(){this._configure()},_configure :function(){this._configureAnnotationReferences(),this._configureInstancePropert ies(),this._aboveConfig=this.mixin({},this._config);for(var e={},t=0;t<this.beha viors.length;t++)this._configureProperties(this.behaviors[t].properties,e);this. _configureProperties(this.properties,e),this.mixin(e,this._aboveConfig),this._co nfig=e,this._clients&&this._clients.length&&this._distributeConfig(this._config) },_configureInstanceProperties:function(){for(var t in this._propertyEffects)!e& &this.hasOwnProperty(t)&&(this._configValue(t,this[t]),
3 delete this[t])},_configureProperties:function(e,t){for(var n in e){var r=e[n];i f(void 0!==r.value){var s=r.value;"function"==typeof s&&(s=s.call(this,this._con fig)),t[n]=s}}},_distributeConfig:function(e){var t=this._propertyEffects;if(t)f or(var n in e){var r=t[n];if(r)for(var s,i=0,o=r.length;i<o&&(s=r[i]);i++)if("an notation"===s.kind){var a=this._nodes[s.effect.index],l=s.effect.propertyName,c= "attribute"==s.effect.kind,h=a._propertyEffects&&a._propertyEffects[l];if(a._con figValue&&(h||!c)){var u=n===s.effect.value?e[n]:this._get(s.effect.value,e);u=t his._computeFinalAnnotationValue(a,l,u,s.effect),c&&(u=a.deserialize(this.serial ize(u),a._propertyInfo[l].type)),a._configValue(l,u)}}}},_afterClientsReady:func tion(){this._executeStaticEffects(),this._applyConfig(this._config,this._aboveCo nfig),this._flushHandlers()},_applyConfig:function(e,t){for(var n in e)void 0=== this[n]&&this.__setProperty(n,e[n],n in t)},_notifyListener:function(e,t){if(!Po lymer.Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t .detail.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueH andler([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_fl ushHandlers:function(){for(var e,t=this._handlers,n=0,r=t.length;n<r&&(e=t[n]);n ++)e[0].call(this,e[1],e[2],e[3]);this._handlers=[]}})}(),function(){"use strict ";var e=Polymer.Path;Polymer.Base._addFeature({notifyPath:function(e,t,n){var r= {},s=this._get(e,this,r);1===arguments.length&&(t=s),r.path&&this._notifyPath(r. path,t,n)},_notifyPath:function(e,t,n){var r=this._propertySetter(e,t);if(r!==t& &(r===r||t===t))return this._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_g etPathParts:function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for (var r=e[n].toString().split("."),s=0;s<r.length;s++)t.push(r[s]);return t}retur n e.toString().split(".")},set:function(e,t,n){var r,s=n||this,i=this._getPathPa rts(e),o=i[i.length-1];if(i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];i f(r&&"#"==l[0]?s=Polymer.Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)= =l&&(i[a]=Polymer.Collection.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:n ull}if(r){var c,h,u=Polymer.Collection.get(r);"#"==o[0]?(h=o,c=u.getItem(h),o=r. indexOf(c),u.setItem(h,t)):parseInt(o,10)==o&&(c=s[o],h=u.getKey(c),i[a]=h,u.set Item(h,t))}s[o]=t,n||this._notifyPath(i.join("."),t)}else s[e]=t},get:function(e ,t){return this._get(e,t)},_get:function(e,t,n){for(var r,s=t||this,i=this._getP athParts(e),o=0;o<i.length;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.C ollection.get(r).getItem(a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Colle ction.get(r).getKey(s))),r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".") ),s},_pathEffector:function(t,n){var r=e.root(t),s=this._propertyEffects&&this._ propertyEffects[r];if(s)for(var i,o=0;o<s.length&&(i=s[o]);o++){var a=i.pathFn;a &&a.call(this,t,n,i.effect)}this._boundPaths&&this._notifyBoundPaths(t,n)},_anno tationPathEffect:function(t,n,r){if(e.matches(r.value,!1,t))Polymer.Bind._annota tionEffect.call(this,t,n,r);else if(!r.negate&&e.isDescendant(r.value,t)){var s= this._nodes[r.index];if(s&&s._notifyPath){var i=e.translate(r.value,r.name,t);s. _notifyPath(i,n,!0)}}},_complexObserverPathEffect:function(t,n,r){e.matches(r.tr igger.name,r.trigger.wildcard,t)&&Polymer.Bind._complexObserverEffect.call(this, t,n,r)},_computePathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wi ldcard,t)&&Polymer.Bind._computeEffect.call(this,t,n,r)},_annotatedComputationPa thEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer .Bind._annotatedComputationEffect.call(this,t,n,r)},linkPaths:function(e,t){this ._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e)},u nlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyBoun dPaths:function(t,n){for(var r in this._boundPaths){var s=this._boundPaths[r];e. isDescendant(r,t)?this._notifyPath(e.translate(r,s,t),n):e.isDescendant(s,t)&&th is._notifyPath(e.translate(s,r,t),n)}},_notifyPathUp:function(t,n){var r=e.root( t),s=Polymer.CaseMap.camelToDashCase(r),i=s+this._EVENT_CHANGED;this.fire(i,{pat h:t,value:n},{bubbles:!1,_useCache:!0})},_EVENT_CHANGED:"-changed",notifySplices :function(e,t){var n={},r=this._get(e,this,n);this._notifySplices(r,n.path,t)},_ notifySplices:function(e,t,n){var r={keySplices:Polymer.Collection.applySplices( e,n),indexSplices:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".l ength",e.length),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySp lice:function(e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed: s,object:e,type:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=A rray.prototype.slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.l ength&&this._notifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n= this._get(e,this,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1 ),i=n.pop.apply(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},sp lice:function(e,t){var n={},r=this._get(e,this,n);t=t<0?r.length-Math.floor(-t): Math.floor(t),t||(t=0);var s=Array.prototype.slice.call(arguments,1),i=r.splice. apply(r,s),o=Math.max(s.length-2,0);return(o||i.length)&&this._notifySplice(r,n. path,t,o,i),i},shift:function(e){var t={},n=this._get(e,this,t),r=Boolean(n.leng th),s=Array.prototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&thi s._notifySplice(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e, this,t),r=Array.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:f unction(e){this.mixin(e,{fire:Polymer.Base.fire,_getEvent:Polymer.Base._getEvent ,__eventCache:Polymer.Base.__eventCache,notifyPath:Polymer.Base.notifyPath,_get: Polymer.Base._get,_EVENT_CHANGED:Polymer.Base._EVENT_CHANGED,_notifyPath:Polymer .Base._notifyPath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer .Base._pathEffector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_co mplexObserverPathEffect:Polymer.Base._complexObserverPathEffect,_annotatedComput ationPathEffect:Polymer.Base._annotatedComputationPathEffect,_computePathEffect: Polymer.Base._computePathEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths ,_getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({reso lveUrl:function(e){var t=Polymer.DomModule.import(this.is),n="";if(t){var r=t.ge tAttribute("assetpath")||"";n=Polymer.ResolveUrl.resolveUrl(r,t.ownerDocument.ba seURI)}return Polymer.ResolveUrl.resolveUrl(e,n)}}),Polymer.CssParse=function(){ return{parse:function(e){return e=this._clean(e),this._parseCss(this._lex(e),e)} ,_clean:function(e){return e.replace(this._rx.comments,"").replace(this._rx.port ,"")},_lex:function(e){for(var t={start:0,end:e.length},n=t,r=0,s=e.length;r<s;r ++)switch(e[r]){case this.OPEN_BRACE:n.rules||(n.rules=[]);var i=n,o=i.rules[i.r ules.length-1];n={start:r+1,parent:i,previous:o},i.rules.push(n);break;case this .CLOSE_BRACE:n.end=r+1,n=n.parent||t}return t},_parseCss:function(e,t){var n=t.s ubstring(e.start,e.end-1);if(e.parsedCssText=e.cssText=n.trim(),e.parent){var r= e.previous?e.previous.end:e.parent.start;n=t.substring(r,e.start-1),n=this._expa ndUnicodeEscapes(n),n=n.replace(this._rx.multipleSpaces," "),n=n.substring(n.las tIndexOf(";")+1);var s=e.parsedSelector=e.selector=n.trim();e.atRule=0===s.index Of(this.AT_START),e.atRule?0===s.indexOf(this.MEDIA_START)?e.type=this.types.MED IA_RULE:s.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.key framesName=e.selector.split(this._rx.multipleSpaces).pop()):0===s.indexOf(this.V AR_START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var i=e.rule s;if(i)for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)this._parseCss(o,t);return e}, _expandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,funct ion(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify :function(e,t,n){n=n||"";var r="";if(e.cssText||e.rules){var s=e.rules;if(s&&!th is._hasMixinRules(s))for(var i,o=0,a=s.length;o<a&&(i=s[o]);o++)r=this.stringify (i,t,r);else r=t?e.cssText:this.removeCustomProps(e.cssText),r=r.trim(),r&&(r=" "+r+"\n")}return r&&(e.selector&&(n+=e.selector+" "+this.OPEN_BRACE+"\n"),n+=r, e.selector&&(n+=this.CLOSE_BRACE+"\n\n")),n},_hasMixinRules:function(e){return 0 ===e[0].selector.indexOf(this.VAR_START)},removeCustomProps:function(e){return e =this.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomP ropAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this. _rx.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.m ixinApply,"").replace(this._rx.varApply,"")},types:{STYLE_RULE:1,KEYFRAMES_RULE: 7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE:"{",CLOSE_BRACE:"}",_rx:{comments:/\/\ *[^*]*\*+([^\/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s }]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^ {};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/ gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]* keyframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:" @"}}(),Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABL ES:Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[r el=import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){ return"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this .parser.stringify(e,this.NATIVE_VARIABLES)},forRulesInStyles:function(e,t,n){if( e)for(var r,s=0,i=e.length;s<i&&(r=e[s]);s++)this.forEachRuleInStyle(r,t,n)},for ActiveRulesInStyles:function(e,t,n){if(e)for(var r,s=0,i=e.length;s<i&&(r=e[s]); s++)this.forEachRuleInStyle(r,t,n,!0)},rulesForStyle:function(e){return!e.__cssR ules&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRule s},isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTyp es.KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForS tyle(e);t&&(s=function(n){t(n,e)}),n&&(i=function(t){n(t,e)}),this.forEachRule(o ,s,i,r)},forEachRule:function(e,t,n,r){if(e){var s=!1;if(r&&e.type===this.ruleTy pes.MEDIA_RULE){var i=e.selector.match(this.rx.MEDIA_MATCH);i&&(window.matchMedi a(i[1]).matches||(s=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===thi s.ruleTypes.KEYFRAMES_RULE?n(e):e.type===this.ruleTypes.MIXIN_RULE&&(s=!0);var o =e.rules;if(o&&!s)for(var a,l=0,c=o.length;l<c&&(a=o[l]);l++)this.forEachRule(a, t,n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this .applyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nex tSibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},cr eateScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.s etAttribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePla ceHolder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" " ),n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=documen t.head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cs sFromModules:function(e,t){for(var n=e.trim().split(" "),r="",s=0;s<n.length;s++ )r+=this.cssFromModule(n[s],t);return r},cssFromModule:function(e,t){var n=Polym er.DomModule.import(e);return n&&!n._cssText&&(n._cssText=this.cssFromElement(n) ),!n&&t&&console.warn("Could not find style data in module named",e),n&&n._cssTe xt||""},cssFromElement:function(e){for(var t,n="",r=e.content||e,s=Polymer.TreeA pi.arrayCopy(r.querySelectorAll(this.MODULE_STYLES_SELECTOR)),i=0;i<s.length;i++ )if(t=s[i],"template"===t.localName)t.hasAttribute("preserve-content")||(n+=this .cssFromElement(t));else if("style"===t.localName){var o=t.getAttribute(this.INC LUDE_ATTR);o&&(n+=this.cssFromModules(o,!0)),t=t.__appliedElement||t,t.parentNod e.removeChild(t),n+=this.resolveCss(t.textContent,e.ownerDocument)}else t.import &&t.import.body&&(n+=this.resolveCss(t.import.body.textContent,t.import));return n},isTargetedBuild:function(t){return e.useNativeShadow?"shadow"===t:"shady"=== t},cssBuildTypeForModule:function(e){var t=Polymer.DomModule.import(e);if(t)retu rn this.getCssBuildType(t)},getCssBuildType:function(e){return e.getAttribute("c ss-build")},_findMatchingParen:function(e,t){for(var n=0,r=t,s=e.length;r<s;r++) switch(e[r]){case"(":n++;break;case")":if(0===--n)return r}return-1},processVari ableAndFallback:function(e,t){var n=e.indexOf("var(");if(n===-1)return t(e,"","" ,"");var r=this._findMatchingParen(e,n+3),s=e.substring(n+4,r),i=e.substring(0,n ),o=this.processVariableAndFallback(e.substring(r+1),t),a=s.indexOf(",");if(a=== -1)return t(i,s.trim(),"",o);var l=s.substring(0,a).trim(),c=s.substring(a+1).tr im();return t(i,l,c,o)},rx:{VAR_ASSIGN:/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^; {]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,MIXIN_MATCH:/(?:^|\W+)@apply\s*\(?([^);\n]*)\ )?/gi,VAR_CONSUMED:/(--[\w-]+)\s*([:,;)]|$)/gi,ANIMATION_MATCH:/(animation\s*:)| (animation-name\s*:)/,MEDIA_MATCH:/@media[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETE D:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:])",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolv eCss:Polymer.ResolveUrl.resolveCss,parser:Polymer.CssParse,ruleTypes:Polymer.Css Parse.types}}(),Polymer.StyleTransformer=function(){var e=Polymer.StyleUtil,t=Po lymer.Settings,n={dom:function(e,t,n,r){this._transformDom(e,t||"",n,r)},_transf ormDom:function(e,t,n,r){e.setAttribute&&this.element(e,t,n,r);for(var s=Polymer .dom(e).childNodes,i=0;i<s.length;i++)this._transformDom(s[i],t,n,r)},element:fu nction(e,t,n,s){if(n)s?e.removeAttribute(r):e.setAttribute(r,t);else if(t)if(e.c lassList)s?(e.classList.remove(r),e.classList.remove(t)):(e.classList.add(r),e.c lassList.add(t));else if(e.getAttribute){var i=e.getAttribute(g);s?i&&e.setAttri bute(g,i.replace(r,"").replace(t,"")):e.setAttribute(g,(i?i+" ":"")+r+" "+t)}},e lementStyles:function(n,r){var s,i=n._styles,o="",a=n.__cssBuild,l=t.useNativeSh adow||"shady"===a;if(l){var h=this;s=function(e){e.selector=h._slottedToContent( e.selector),e.selector=e.selector.replace(c,":host > *"),r&&r(e)}}for(var u,f=0, p=i.length;f<p&&(u=i[f]);f++){var _=e.rulesForStyle(u);o+=l?e.toCssText(_,s):thi s.css(_,n.is,n.extends,r,n._scopeCssViaAttr)+"\n\n"}return o.trim()},css:functio n(t,n,r,s,i){var o=this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a= this;return e.toCssText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0), s&&s(e,n,o)})},_calcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHos tScope:function(e,t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transfo rmRule(e,this._transformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e .selector=e.transformedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleC ss:function(t,n,r,s){var o=t.selector.split(i);if(!e.isKeyframesSelector(t))for( var a,l=0,c=o.length;l<c&&(a=o[l]);l++)o[l]=n.call(this,a,r,s);return o.join(i)} ,_transformComplexSelector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim( ),e=this._slottedToContent(e),e=e.replace(c,":host > *"),e=e.replace(P,l+" $1"), e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._transformCom poundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l.value}r eturn i+o}),s&&(e=e.replace(f,function(e,t,r,s){return t+r+" "+n+s+i+" "+t+n+r+s })),e},_transformCompoundSelector:function(e,t,n,r){var s=e.search(_),i=!1;e.ind exOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s&&(e=n?t his._transformSimpleSelector(e,n):e),e.indexOf(p)>=0&&(t="");var o;return s>=0&& (e=e.replace(_," "),o=!0),{value:e,combinator:t,stop:o,hostContext:i}},_transfor mSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)},_transf ormHostSelector:function(e,t){var n=e.match(h),r=n&&n[2].trim()||"";if(r){if(r[0 ].match(a))return e.replace(h,function(e,n,r){return t+r});var s=r.split(a)[0];r eturn s===t?r:S}return e.replace(l,t)},documentRule:function(e){e.selector=e.par sedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transformRule (e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e.selecto r=e.selector.replace(c,"html")},_transformDocumentSelector:function(e){return e. match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e.tri m(),s)},_slottedToContent:function(e){return e.replace(C,p+"> $1")},SCOPE_NAME:" style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+")",i=",",o=/(^|[\s>+~]+) ((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",c=":root",h=/(:host)(?:\(((?: \([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::host-context)(?:\(((?:\([ ^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::shadow|\/deep\//,d=".",m ="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")"),S="should_not_match", C=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g;return n}(),Polymer.StyleExt ends=function(){var e=Polymer.StyleUtil;return{hasExtends:function(e){return Boo lean(e.match(this.rx.EXTEND))},transform:function(t){var n=e.rulesForStyle(t),r= this;return e.forEachRule(n,function(e){if(r._mapRuleOntoParent(e),e.parent)for( var t;t=r.rx.EXTEND.exec(e.cssText);){var n=t[1],s=r._findExtendor(n,e);s&&r._ex tendRule(e,s)}e.cssText=e.cssText.replace(r.rx.EXTEND,"")}),e.toCssText(n,functi on(e){e.selector.match(r.rx.STRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:func tion(e){if(e.parent){for(var t,n=e.parent.map||(e.parent.map={}),r=e.selector.sp lit(","),s=0;s<r.length;s++)t=r[s],n[t.trim()]=e;return n}},_findExtendor:functi on(e,t){return t.parent&&t.parent.map&&t.parent.map[e]||this._findExtendor(e,t.p arent)},_extendRule:function(e,t){e.parent!==t.parent&&this._cloneAndAddRuleToPa rent(t,e.parent),e.extends=e.extends||[],e.extends.push(t),t.selector=t.selector .replace(this.rx.STRIP,""),t.selector=(t.selector&&t.selector+",\n")+e.selector, t.extends&&t.extends.forEach(function(t){this._extendRule(e,t)},this)},_cloneAnd AddRuleToParent:function(e,t){e=Object.create(e),e.parent=t,e.extends&&(e.extend s=e.extends.slice()),t.rules.push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,S TRIP:/%[^,]*$/}}}(),Polymer.ApplyShim=function(){"use strict";function e(e,t){e= e.trim(),m[e]={properties:t,dependants:{}}}function t(e){return e=e.trim(),m[e]} function n(e,t){var n=_.exec(t);return n&&(t=n[1]?y._getInitialValueForProperty( e):"apply-shim-inherit"),t}function r(e){for(var t,r,s,i,o=e.split(";"),a={},l=0 ;l<o.length;l++)s=o[l],s&&(i=s.split(":"),i.length>1&&(t=i[0].trim(),r=n(t,i.sli ce(1).join(":")),a[t]=r));return a}function s(e){var t=y.__currentElementProto,n =t&&t.is;for(var r in e.dependants)r!==n&&(e.dependants[r].__applyShimInvalid=!0 )}function i(n,i,o,a){if(o&&c.processVariableAndFallback(o,function(e,n){n&&t(n) &&(a="@apply "+n+";")}),!a)return n;var h=l(a),u=n.slice(0,n.indexOf("--")),f=r( h),p=f,_=t(i),m=_&&_.properties;m?(p=Object.create(m),p=Polymer.Base.mixin(p,f)) :e(i,p);var y,v,g=[],P=!1;for(y in p)v=f[y],void 0===v&&(v="initial"),!m||y in m ||(P=!0),g.push(i+d+y+": "+v);return P&&s(_),_&&(_.properties=p),o&&(u=n+";"+u), u+g.join("; ")+";"}function o(e,t,n){return"var("+t+",var("+n+"))"}function a(n, r){n=n.replace(p,"");var s=[],i=t(n);if(i||(e(n,{}),i=t(n)),i){var o=y.__current ElementProto;o&&(i.dependants[o.is]=o);var a,l,c;for(a in i.properties)c=r&&r[a] ,l=[a,": var(",n,d,a],c&&l.push(",",c),l.push(")"),s.push(l.join(""))}return s.j oin("; ")}function l(e){for(var t;t=h.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+ n.indexOf("@apply"),l=i+n.length,c=e.slice(0,o),u=e.slice(l),f=r(c),p=a(s,f);e=[ c,p,u].join(""),h.lastIndex=i+p.length}return e}var c=Polymer.StyleUtil,h=c.rx.M IXIN_MATCH,u=c.rx.VAR_ASSIGN,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/ ^\s*(initial)|(inherit)\s*$/,d="_-_",m={},y={_measureElement:null,_map:m,_separa tor:d,transform:function(e,t){this.__currentElementProto=t,c.forRulesInStyles(e, this._boundFindDefinitions),c.forRulesInStyles(e,this._boundFindApplications),t& &(t.__applyShimInvalid=!1),this.__currentElementProto=null},_findDefinitions:fun ction(e){var t=e.parsedCssText;t=t.replace(f,o),t=t.replace(u,i),e.cssText=t,":r oot"===e.selector&&(e.selector=":host > *")},_findApplications:function(e){e.css Text=l(e.cssText)},transformRule:function(e){this._findDefinitions(e),this._find Applications(e)},_getInitialValueForProperty:function(e){return this._measureEle ment||(this._measureElement=document.createElement("meta"),this._measureElement. style.all="initial",document.head.appendChild(this._measureElement)),window.getC omputedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransfor mRule=y.transformRule.bind(y),y._boundFindDefinitions=y._findDefinitions.bind(y) ,y._boundFindApplications=y._findApplications.bind(y),y}(),function(){var e=Poly mer.Base._prepElement,t=Polymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=P olymer.StyleTransformer,s=Polymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Set tings;Polymer.Base._addFeature({_prepElement:function(t){this._encapsulateStyle& &"shady"!==this.__cssBuild&&r.element(t,this.is,this._scopeCssViaAttr),e.call(th is,t)},_prepStyles:function(){void 0===this._encapsulateStyle&&(this._encapsulat eStyle=!t),t||(this._scopeStyle=n.applyStylePlaceHolder(this.is)),this.__cssBuil d=n.cssBuildTypeForModule(this.is)},_prepShimStyles:function(){if(this._template ){var e=n.isTargetedBuild(this.__cssBuild);if(o.useNativeCSSProperties&&"shadow" ===this.__cssBuild&&e)return;this._styles=this._styles||this._collectStyles(),o. useNativeCSSProperties&&!this.__cssBuild&&i.transform(this._styles,this);var s=o .useNativeCSSProperties&&e?this._styles.length&&this._styles[0].textContent.trim ():r.elementStyles(this);this._prepStyleProperties(),!this._needsStyleProperties ()&&s&&n.applyCss(s,this.is,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectStyles:function(){var e=[],t="",r=this.styleModules;if (r)for(var i,o=0,a=r.length;o<a&&(i=r[o]);o++)t+=n.cssFromModule(i);t+=n.cssFrom Module(this.is);var l=this._template&&this._template.parentNode;if(!this._templa te||l&&l.id.toLowerCase()===this.is||(t+=n.cssFromElement(this._template)),t){va r c=document.createElement("style");c.textContent=t,s.hasExtends(c.textContent)& &(t=s.transform(c)),e.push(c)}return e},_elementAdd:function(e){this._encapsulat eStyle&&(e.__styleScoped?e.__styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAtt r))},_elementRemove:function(e){this._encapsulateStyle&&r.dom(e,this.is,this._sc opeCssViaAttr,!0)},scopeSubtree:function(e,n){if(!t){var r=this,s=function(e){if (e.nodeType===Node.ELEMENT_NODE){var t=e.getAttribute("class");e.setAttribute("c lass",r._scopeElementClass(e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.len gth&&(n=s[i]);i++)t=n.getAttribute("class"),n.setAttribute("class",r._scopeEleme ntClass(n,t))}};if(s(e),n){var i=new MutationObserver(function(e){for(var t,n=0; n<e.length&&(t=e[n]);n++)if(t.addedNodes)for(var r=0;r<t.addedNodes.length;r++)s (t.addedNodes[r])});return i.observe(e,{childList:!0,subtree:!0}),i}}}})}(),Poly mer.StyleProperties=function(){"use strict";function e(e,t){var n=parseInt(e/32) ,r=1<<e%32;t[n]=(t[n]||0)|r}var t=Polymer.DomApi.matchesSelector,n=Polymer.Style Util,r=Polymer.StyleTransformer,s=navigator.userAgent.match("Trident"),i=Polymer .Settings;return{decorateStyles:function(e,t){var s=this,i={},o=[],a=0,l=r._calc HostScope(t.is,t.extends);n.forRulesInStyles(e,function(e,r){s.decorateRule(e),e .index=a++,s.whenHostOrRootRule(t,e,r,function(r){if(e.parent.type===n.ruleTypes .MEDIA_RULE&&(t.__notStyleScopeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleS copeCacheable=t.__notStyleScopeCacheable||s}}),s.collectPropertiesInCssText(e.pr opertyInfo.cssText,i)},function(e){o.push(e)}),e._keyframes=o;var c=[];for(var h in i)c.push(h);return c},decorateRule:function(e){if(e.propertyInfo)return e.pr opertyInfo;var t={},n={},r=this.collectProperties(e,n);return r&&(t.properties=n ,e.rules=null),t.cssText=this.collectCssText(e),e.propertyInfo=t,t},collectPrope rties:function(e,t){var n=e.propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSI GN,a=e.parsedCssText;r=o.exec(a);)s=(r[2]||r[3]).trim(),"inherit"!==s&&(t[r[1].t rim()]=s),i=!0;return i}if(n.properties)return Polymer.Base.mixin(t,n.properties ),!0},collectCssText:function(e){return this.collectConsumingCssText(e.parsedCss Text)},collectConsumingCssText:function(e){return e.replace(this.rx.BRACKETED,"" ).replace(this.rx.VAR_ASSIGN,"")},collectPropertiesInCssText:function(e,t){for(v ar n;n=this.rx.VAR_CONSUMED.exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:f unction(e){for(var t,n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++)t=n[r],e [t]=this.valueForProperty(e[t],e)},valueForProperty:function(e,t){if(e)if(e.inde xOf(";")>=0)e=this.valueForProperties(e,t);else{var r=this,s=function(e,n,s,i){v ar o=r.valueForProperty(t[n],t);return o&&"initial"!==o?"apply-shim-inherit"===o &&(o="inherit"):o=r.valueForProperty(t[s]||s,t)||s,e+(o||"")+i};e=n.processVaria bleAndFallback(e,s)}return e&&e.trim()||""},valueForProperties:function(e,t){for (var n,r,s=e.split(";"),i=0;i<s.length;i++)if(n=s[i]){if(this.rx.MIXIN_MATCH.las tIndex=0,r=this.rx.MIXIN_MATCH.exec(n))n=this.valueForProperty(t[r[1]],t);else{v ar o=n.indexOf(":");if(o!==-1){var a=n.substring(o);a=a.trim(),a=this.valueForPr operty(a,t)||a,n=n.substring(0,o)+a}}s[i]=n&&n.lastIndexOf(";")===n.length-1?n.s lice(0,-1):n||""}return s.join(";")},applyProperties:function(e,t){var n="";e.pr opertyInfo||this.decorateRule(e),e.propertyInfo.cssText&&(n=this.valueForPropert ies(e.propertyInfo.cssText,t)),e.cssText=n},applyKeyframeTransforms:function(e,t ){var n=e.cssText,r=e.cssText;if(null==e.hasAnimations&&(e.hasAnimations=this.rx .ANIMATION_MATCH.test(n)),e.hasAnimations){var s;if(null==e.keyframeNamesToTrans form){e.keyframeNamesToTransform=[];for(var i in t)s=t[i],r=s(n),n!==r&&(n=r,e.k eyframeNamesToTransform.push(i))}else{for(var o=0;o<e.keyframeNamesToTransform.l ength;++o)s=t[e.keyframeNamesToTransform[o]],n=s(n);r=n}}e.cssText=r},propertyDa taFromStyles:function(r,s){var i={},o=this,a=[];return n.forActiveRulesInStyles( r,function(n){n.propertyInfo||o.decorateRule(n);var r=n.transformedSelector||n.p arsedSelector;s&&n.propertyInfo.properties&&r&&t.call(s,r)&&(o.collectProperties (n,i),e(n.index,a))}),{properties:i,key:a}},_rootSelector:/:root|:host\s*>\s*\*/ ,_checkRoot:function(e,t){return Boolean(t.match(this._rootSelector))||"html"=== e&&t.indexOf("html")>-1},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo| |self.decorateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.i s,e.extends):"html",a=t.parsedSelector,l=this._checkRoot(o,a),c=!l&&0===a.indexO f(":host"),h=e.__cssBuild||n.__cssBuild;if("shady"===h&&(l=a===o+" > *."+o||a.in dexOf("html")>-1,c=!l&&0===a.indexOf(o)),l||c){var u=o;c&&(i.useNativeShadow&&!t .transformedSelector&&(t.transformedSelector=r._transformRuleCss(t,r._transformC omplexSelector,e.is,o)),u=t.transformedSelector||t.parsedSelector),l&&"html"===o &&(u=t.transformedSelector||t.parsedSelector),s({selector:u,isHost:c,isRoot:l})} }},hostAndRootPropertiesForScope:function(e){var r={},s={},i=this;return n.forAc tiveRulesInStyles(e._styles,function(n,o){i.whenHostOrRootRule(e,n,o,function(o) {var a=e._element||e;t.call(a,o.selector)&&(o.isHost?i.collectProperties(n,r):i. collectProperties(n,s))})}),{rootProps:s,hostProps:r}},transformStyles:function( e,t,n){var s=this,o=r._calcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0, -1)+"\\]":o,l=new RegExp(this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),c=this._elem entKeyframeTransforms(e,n);return r.elementStyles(e,function(r){s.applyPropertie s(r,t),i.useNativeShadow||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText|| (s.applyKeyframeTransforms(r,c),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})} ,_elementKeyframeTransforms:function(e,t){var n=e._styles._keyframes,r={};if(!i. useNativeShadow&&n)for(var s=0,o=n[s];s<n.length;o=n[++s])this._scopeKeyframes(o ,t),r[o.keyframesName]=this._keyframesRuleTransformer(o);return r},_keyframesRul eTransformer:function(e){return function(t){return t.replace(e.keyframesNameRx,e .transformedKeyframesName)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName,"g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e. transformedSelector=e.transformedSelector||e.selector,e.selector=e.transformedSe lector.replace(e.keyframesName,e.transformedKeyframesName)},_scopeSelector:funct ion(e,t,n,s,i){e.transformedSelector=e.transformedSelector||e.selector;for(var o ,a=e.transformedSelector,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,c=a.split(","),h= 0,u=c.length;h<u&&(o=c[h]);h++)c[h]=o.match(t)?o.replace(n,l):l+" "+o;e.selector =c.join(",")},applyElementScopeSelector:function(e,t,n,s){var i=s?e.getAttribute (r.SCOPE_NAME):e.getAttribute("class")||"",o=n?i.replace(n,t):(i?i+" ":"")+this. XSCOPE_NAME+" "+t;i!==o&&(s?e.setAttribute(r.SCOPE_NAME,o):e.setAttribute("class ",o))},applyElementStyle:function(e,t,r,o){var a=o?o.textContent||"":this.transf ormStyles(e,t,r),l=e._customStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCo unt--,l._useCount<=0&&l.parentNode&&l.parentNode.removeChild(l)),i.useNativeShad ow?e._customStyle?(e._customStyle.textContent=a,o=e._customStyle):a&&(o=n.applyC ss(a,r,e.root,e._scopeStyle)):o?o.parentNode||(s&&a.indexOf("@media")>-1&&(o.tex tContent=a),n.applyStyle(o,null,e._scopeStyle)):a&&(o=n.applyCss(a,r,null,e._sco peStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount++,e._cus tomStyle=o),o},mixinCustomStyle:function(e,t){var n;for(var r in t)n=t[r],(n||0= ==n)&&(e[r]=n)},updateNativeStyleProperties:function(e,t){var n=e.__customStyleP roperties;if(n)for(var r=0;r<n.length;r++)e.style.removeProperty(n[r]);var s=[]; for(var i in t)null!==t[i]&&(e.style.setProperty(i,t[i]),s.push(i));e.__customSt yleProperties=s},rx:n.rx,XSCOPE_NAME:"x-scope"}}(),function(){Polymer.StyleCache =function(){this.cache={}},Polymer.StyleCache.prototype={MAX:100,store:function( e,t,n,r){t.keyValues=n,t.styles=r;var s=this.cache[e]=this.cache[e]||[];s.push(t ),s.length>this.MAX&&s.shift()},retrieve:function(e,t,n){var r=this.cache[e];if( r)for(var s,i=r.length-1;i>=0;i--)if(s=r[i],n===s.styles&&this._objectsEqual(t,s .keyValues))return s},clear:function(){this.cache={}},_objectsEqual:function(e,t ){var n,r;for(var s in e)if(n=e[s],r=t[s],!("object"==typeof n&&n?this._objectsS trictlyEqual(n,r):n===r))return!1;return!Array.isArray(e)||e.length===t.length}, _objectsStrictlyEqual:function(e,t){return this._objectsEqual(e,t)&&this._object sEqual(t,e)}}}(),Polymer.StyleDefaults=function(){var e=Polymer.StyleProperties, t=Polymer.StyleCache,n=Polymer.Settings.useNativeCSSProperties,r={_styles:[],_pr operties:null,customStyle:{},_styleCache:new t,_element:Polymer.DomApi.wrap(docu ment.documentElement),addStyle:function(e){this._styles.push(e),this._properties =null},get _styleProperties(){return this._properties||(e.decorateStyles(this._s tyles,this),this._styles._scopeStyleProperties=null,this._properties=e.hostAndRo otPropertiesForScope(this).rootProps,e.mixinCustomStyle(this._properties,this.cu stomStyle),e.reify(this._properties)),this._properties},hasStyleProperties:funct ion(){return Boolean(this._properties)},_needsStyleProperties:function(){},_comp uteStyleProperties:function(){return this._styleProperties},updateStyles:functio n(t){this._properties=null,t&&Polymer.Base.mixin(this.customStyle,t),this._style Cache.clear();for(var r,s=0;s<this._styles.length;s++)r=this._styles[s],r=r.__im portElement||r,r._apply();n&&e.updateNativeStyleProperties(document.documentElem ent,this.customStyle)}};return r}(),function(){"use strict";var e=Polymer.Base.s erializeValueToAttribute,t=Polymer.StyleProperties,n=Polymer.StyleTransformer,r= Polymer.StyleDefaults,s=Polymer.Settings.useNativeShadow,i=Polymer.Settings.useN ativeCSSProperties;Polymer.Base._addFeature({_prepStyleProperties:function(){i|| (this._ownStylePropertyNames=this._styles&&this._styles.length?t.decorateStyles( this._styles,this):null); 3 delete this[t])},_configureProperties:function(e,t){for(var n in e){var r=e[n];i f(void 0!==r.value){var s=r.value;"function"==typeof s&&(s=s.call(this,this._con fig)),t[n]=s}}},_distributeConfig:function(e){var t=this._propertyEffects;if(t)f or(var n in e){var r=t[n];if(r)for(var s,i=0,o=r.length;i<o&&(s=r[i]);i++)if("an notation"===s.kind){var a=this._nodes[s.effect.index],l=s.effect.propertyName,c= "attribute"==s.effect.kind,h=a._propertyEffects&&a._propertyEffects[l];if(a._con figValue&&(h||!c)){var u=n===s.effect.value?e[n]:this._get(s.effect.value,e);u=t his._computeFinalAnnotationValue(a,l,u,s.effect),c&&(u=a.deserialize(this.serial ize(u),a._propertyInfo[l].type)),a._configValue(l,u)}}}},_afterClientsReady:func tion(){this._executeStaticEffects(),this._applyConfig(this._config,this._aboveCo nfig),this._flushHandlers()},_applyConfig:function(e,t){for(var n in e)void 0=== this[n]&&this.__setProperty(n,e[n],n in t)},_notifyListener:function(e,t){if(!Po lymer.Bind._isEventBogus(t,t.target)){var n,r;if(t.detail&&(n=t.detail.value,r=t .detail.path),this._clientsReadied)return e.call(this,t.target,n,r);this._queueH andler([e,t.target,n,r])}},_queueHandler:function(e){this._handlers.push(e)},_fl ushHandlers:function(){for(var e,t=this._handlers,n=0,r=t.length;n<r&&(e=t[n]);n ++)e[0].call(this,e[1],e[2],e[3]);this._handlers=[]}})}(),function(){"use strict ";var e=Polymer.Path;Polymer.Base._addFeature({notifyPath:function(e,t,n){var r= {},s=this._get(e,this,r);1===arguments.length&&(t=s),r.path&&this._notifyPath(r. path,t,n)},_notifyPath:function(e,t,n){var r=this._propertySetter(e,t);if(r!==t& &(r===r||t===t))return this._pathEffector(e,t),n||this._notifyPathUp(e,t),!0},_g etPathParts:function(e){if(Array.isArray(e)){for(var t=[],n=0;n<e.length;n++)for (var r=e[n].toString().split("."),s=0;s<r.length;s++)t.push(r[s]);return t}retur n e.toString().split(".")},set:function(e,t,n){var r,s=n||this,i=this._getPathPa rts(e),o=i[i.length-1];if(i.length>1){for(var a=0;a<i.length-1;a++){var l=i[a];i f(r&&"#"==l[0]?s=Polymer.Collection.get(r).getItem(l):(s=s[l],r&&parseInt(l,10)= =l&&(i[a]=Polymer.Collection.get(r).getKey(s))),!s)return;r=Array.isArray(s)?s:n ull}if(r){var c,h,u=Polymer.Collection.get(r);"#"==o[0]?(h=o,c=u.getItem(h),o=r. indexOf(c),u.setItem(h,t)):parseInt(o,10)==o&&(c=s[o],h=u.getKey(c),i[a]=h,u.set Item(h,t))}s[o]=t,n||this._notifyPath(i.join("."),t)}else s[e]=t},get:function(e ,t){return this._get(e,t)},_get:function(e,t,n){for(var r,s=t||this,i=this._getP athParts(e),o=0;o<i.length;o++){if(!s)return;var a=i[o];r&&"#"==a[0]?s=Polymer.C ollection.get(r).getItem(a):(s=s[a],n&&r&&parseInt(a,10)==a&&(i[o]=Polymer.Colle ction.get(r).getKey(s))),r=Array.isArray(s)?s:null}return n&&(n.path=i.join(".") ),s},_pathEffector:function(t,n){var r=e.root(t),s=this._propertyEffects&&this._ propertyEffects[r];if(s)for(var i,o=0;o<s.length&&(i=s[o]);o++){var a=i.pathFn;a &&a.call(this,t,n,i.effect)}this._boundPaths&&this._notifyBoundPaths(t,n)},_anno tationPathEffect:function(t,n,r){if(e.matches(r.value,!1,t))Polymer.Bind._annota tionEffect.call(this,t,n,r);else if(!r.negate&&e.isDescendant(r.value,t)){var s= this._nodes[r.index];if(s&&s._notifyPath){var i=e.translate(r.value,r.name,t);s. _notifyPath(i,n,!0)}}},_complexObserverPathEffect:function(t,n,r){e.matches(r.tr igger.name,r.trigger.wildcard,t)&&Polymer.Bind._complexObserverEffect.call(this, t,n,r)},_computePathEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wi ldcard,t)&&Polymer.Bind._computeEffect.call(this,t,n,r)},_annotatedComputationPa thEffect:function(t,n,r){e.matches(r.trigger.name,r.trigger.wildcard,t)&&Polymer .Bind._annotatedComputationEffect.call(this,t,n,r)},linkPaths:function(e,t){this ._boundPaths=this._boundPaths||{},t?this._boundPaths[e]=t:this.unlinkPaths(e)},u nlinkPaths:function(e){this._boundPaths&&delete this._boundPaths[e]},_notifyBoun dPaths:function(t,n){for(var r in this._boundPaths){var s=this._boundPaths[r];e. isDescendant(r,t)?this._notifyPath(e.translate(r,s,t),n):e.isDescendant(s,t)&&th is._notifyPath(e.translate(s,r,t),n)}},_notifyPathUp:function(t,n){var r=e.root( t),s=Polymer.CaseMap.camelToDashCase(r),i=s+this._EVENT_CHANGED;this.fire(i,{pat h:t,value:n},{bubbles:!1,_useCache:!0})},_EVENT_CHANGED:"-changed",notifySplices :function(e,t){var n={},r=this._get(e,this,n);this._notifySplices(r,n.path,t)},_ notifySplices:function(e,t,n){var r={keySplices:Polymer.Collection.applySplices( e,n),indexSplices:n},s=t+".splices";this._notifyPath(s,r),this._notifyPath(t+".l ength",e.length),this.__data__[s]={keySplices:null,indexSplices:null}},_notifySp lice:function(e,t,n,r,s){this._notifySplices(e,t,[{index:n,addedCount:r,removed: s,object:e,type:"splice"}])},push:function(e){var t={},n=this._get(e,this,t),r=A rray.prototype.slice.call(arguments,1),s=n.length,i=n.push.apply(n,r);return r.l ength&&this._notifySplice(n,t.path,s,r.length,[]),i},pop:function(e){var t={},n= this._get(e,this,t),r=Boolean(n.length),s=Array.prototype.slice.call(arguments,1 ),i=n.pop.apply(n,s);return r&&this._notifySplice(n,t.path,n.length,0,[i]),i},sp lice:function(e,t){var n={},r=this._get(e,this,n);t=t<0?r.length-Math.floor(-t): Math.floor(t),t||(t=0);var s=Array.prototype.slice.call(arguments,1),i=r.splice. apply(r,s),o=Math.max(s.length-2,0);return(o||i.length)&&this._notifySplice(r,n. path,t,o,i),i},shift:function(e){var t={},n=this._get(e,this,t),r=Boolean(n.leng th),s=Array.prototype.slice.call(arguments,1),i=n.shift.apply(n,s);return r&&thi s._notifySplice(n,t.path,0,0,[i]),i},unshift:function(e){var t={},n=this._get(e, this,t),r=Array.prototype.slice.call(arguments,1),s=n.unshift.apply(n,r);return r.length&&this._notifySplice(n,t.path,0,r.length,[]),s},prepareModelNotifyPath:f unction(e){this.mixin(e,{fire:Polymer.Base.fire,_getEvent:Polymer.Base._getEvent ,__eventCache:Polymer.Base.__eventCache,notifyPath:Polymer.Base.notifyPath,_get: Polymer.Base._get,_EVENT_CHANGED:Polymer.Base._EVENT_CHANGED,_notifyPath:Polymer .Base._notifyPath,_notifyPathUp:Polymer.Base._notifyPathUp,_pathEffector:Polymer .Base._pathEffector,_annotationPathEffect:Polymer.Base._annotationPathEffect,_co mplexObserverPathEffect:Polymer.Base._complexObserverPathEffect,_annotatedComput ationPathEffect:Polymer.Base._annotatedComputationPathEffect,_computePathEffect: Polymer.Base._computePathEffect,_notifyBoundPaths:Polymer.Base._notifyBoundPaths ,_getPathParts:Polymer.Base._getPathParts})}})}(),Polymer.Base._addFeature({reso lveUrl:function(e){var t=Polymer.DomModule.import(this.is),n="";if(t){var r=t.ge tAttribute("assetpath")||"";n=Polymer.ResolveUrl.resolveUrl(r,t.ownerDocument.ba seURI)}return Polymer.ResolveUrl.resolveUrl(e,n)}}),Polymer.CssParse=function(){ return{parse:function(e){return e=this._clean(e),this._parseCss(this._lex(e),e)} ,_clean:function(e){return e.replace(this._rx.comments,"").replace(this._rx.port ,"")},_lex:function(e){for(var t={start:0,end:e.length},n=t,r=0,s=e.length;r<s;r ++)switch(e[r]){case this.OPEN_BRACE:n.rules||(n.rules=[]);var i=n,o=i.rules[i.r ules.length-1];n={start:r+1,parent:i,previous:o},i.rules.push(n);break;case this .CLOSE_BRACE:n.end=r+1,n=n.parent||t}return t},_parseCss:function(e,t){var n=t.s ubstring(e.start,e.end-1);if(e.parsedCssText=e.cssText=n.trim(),e.parent){var r= e.previous?e.previous.end:e.parent.start;n=t.substring(r,e.start-1),n=this._expa ndUnicodeEscapes(n),n=n.replace(this._rx.multipleSpaces," "),n=n.substring(n.las tIndexOf(";")+1);var s=e.parsedSelector=e.selector=n.trim();e.atRule=0===s.index Of(this.AT_START),e.atRule?0===s.indexOf(this.MEDIA_START)?e.type=this.types.MED IA_RULE:s.match(this._rx.keyframesRule)&&(e.type=this.types.KEYFRAMES_RULE,e.key framesName=e.selector.split(this._rx.multipleSpaces).pop()):0===s.indexOf(this.V AR_START)?e.type=this.types.MIXIN_RULE:e.type=this.types.STYLE_RULE}var i=e.rule s;if(i)for(var o,a=0,l=i.length;a<l&&(o=i[a]);a++)this._parseCss(o,t);return e}, _expandUnicodeEscapes:function(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,funct ion(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e})},stringify :function(e,t,n){n=n||"";var r="";if(e.cssText||e.rules){var s=e.rules;if(s&&!th is._hasMixinRules(s))for(var i,o=0,a=s.length;o<a&&(i=s[o]);o++)r=this.stringify (i,t,r);else r=t?e.cssText:this.removeCustomProps(e.cssText),r=r.trim(),r&&(r=" "+r+"\n")}return r&&(e.selector&&(n+=e.selector+" "+this.OPEN_BRACE+"\n"),n+=r, e.selector&&(n+=this.CLOSE_BRACE+"\n\n")),n},_hasMixinRules:function(e){return 0 ===e[0].selector.indexOf(this.VAR_START)},removeCustomProps:function(e){return e =this.removeCustomPropAssignment(e),this.removeCustomPropApply(e)},removeCustomP ropAssignment:function(e){return e.replace(this._rx.customProp,"").replace(this. _rx.mixinProp,"")},removeCustomPropApply:function(e){return e.replace(this._rx.m ixinApply,"").replace(this._rx.varApply,"")},types:{STYLE_RULE:1,KEYFRAMES_RULE: 7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE:"{",CLOSE_BRACE:"}",_rx:{comments:/\/\ *[^*]*\*+([^\/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s }]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^ {};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/ gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]* keyframes/,multipleSpaces:/\s+/g},VAR_START:"--",MEDIA_START:"@media",AT_START:" @"}}(),Polymer.StyleUtil=function(){var e=Polymer.Settings;return{NATIVE_VARIABL ES:Polymer.Settings.useNativeCSSProperties,MODULE_STYLES_SELECTOR:"style, link[r el=import][type~=css], template",INCLUDE_ATTR:"include",toCssText:function(e,t){ return"string"==typeof e&&(e=this.parser.parse(e)),t&&this.forEachRule(e,t),this .parser.stringify(e,this.NATIVE_VARIABLES)},forRulesInStyles:function(e,t,n){if( e)for(var r,s=0,i=e.length;s<i&&(r=e[s]);s++)this.forEachRuleInStyle(r,t,n)},for ActiveRulesInStyles:function(e,t,n){if(e)for(var r,s=0,i=e.length;s<i&&(r=e[s]); s++)this.forEachRuleInStyle(r,t,n,!0)},rulesForStyle:function(e){return!e.__cssR ules&&e.textContent&&(e.__cssRules=this.parser.parse(e.textContent)),e.__cssRule s},isKeyframesSelector:function(e){return e.parent&&e.parent.type===this.ruleTyp es.KEYFRAMES_RULE},forEachRuleInStyle:function(e,t,n,r){var s,i,o=this.rulesForS tyle(e);t&&(s=function(n){t(n,e)}),n&&(i=function(t){n(t,e)}),this.forEachRule(o ,s,i,r)},forEachRule:function(e,t,n,r){if(e){var s=!1;if(r&&e.type===this.ruleTy pes.MEDIA_RULE){var i=e.selector.match(this.rx.MEDIA_MATCH);i&&(window.matchMedi a(i[1]).matches||(s=!0))}e.type===this.ruleTypes.STYLE_RULE?t(e):n&&e.type===thi s.ruleTypes.KEYFRAMES_RULE?n(e):e.type===this.ruleTypes.MIXIN_RULE&&(s=!0);var o =e.rules;if(o&&!s)for(var a,l=0,c=o.length;l<c&&(a=o[l]);l++)this.forEachRule(a, t,n,r)}},applyCss:function(e,t,n,r){var s=this.createScopeStyle(e,t);return this .applyStyle(s,n,r)},applyStyle:function(e,t,n){t=t||document.head;var r=n&&n.nex tSibling||t.firstChild;return this.__lastHeadApplyNode=e,t.insertBefore(e,r)},cr eateScopeStyle:function(e,t){var n=document.createElement("style");return t&&n.s etAttribute("scope",t),n.textContent=e,n},__lastHeadApplyNode:null,applyStylePla ceHolder:function(e){var t=document.createComment(" Shady DOM styles for "+e+" " ),n=this.__lastHeadApplyNode?this.__lastHeadApplyNode.nextSibling:null,r=documen t.head;return r.insertBefore(t,n||r.firstChild),this.__lastHeadApplyNode=t,t},cs sFromModules:function(e,t){for(var n=e.trim().split(" "),r="",s=0;s<n.length;s++ )r+=this.cssFromModule(n[s],t);return r},cssFromModule:function(e,t){var n=Polym er.DomModule.import(e);return n&&!n._cssText&&(n._cssText=this.cssFromElement(n) ),!n&&t&&console.warn("Could not find style data in module named",e),n&&n._cssTe xt||""},cssFromElement:function(e){for(var t,n="",r=e.content||e,s=Polymer.TreeA pi.arrayCopy(r.querySelectorAll(this.MODULE_STYLES_SELECTOR)),i=0;i<s.length;i++ )if(t=s[i],"template"===t.localName)t.hasAttribute("preserve-content")||(n+=this .cssFromElement(t));else if("style"===t.localName){var o=t.getAttribute(this.INC LUDE_ATTR);o&&(n+=this.cssFromModules(o,!0)),t=t.__appliedElement||t,t.parentNod e.removeChild(t),n+=this.resolveCss(t.textContent,e.ownerDocument)}else t.import &&t.import.body&&(n+=this.resolveCss(t.import.body.textContent,t.import));return n},isTargetedBuild:function(t){return e.useNativeShadow?"shadow"===t:"shady"=== t},cssBuildTypeForModule:function(e){var t=Polymer.DomModule.import(e);if(t)retu rn this.getCssBuildType(t)},getCssBuildType:function(e){return e.getAttribute("c ss-build")},_findMatchingParen:function(e,t){for(var n=0,r=t,s=e.length;r<s;r++) switch(e[r]){case"(":n++;break;case")":if(0===--n)return r}return-1},processVari ableAndFallback:function(e,t){var n=e.indexOf("var(");if(n===-1)return t(e,"","" ,"");var r=this._findMatchingParen(e,n+3),s=e.substring(n+4,r),i=e.substring(0,n ),o=this.processVariableAndFallback(e.substring(r+1),t),a=s.indexOf(",");if(a=== -1)return t(i,s.trim(),"",o);var l=s.substring(0,a).trim(),c=s.substring(a+1).tr im();return t(i,l,c,o)},rx:{VAR_ASSIGN:/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^; {]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,MIXIN_MATCH:/(?:^|\W+)@apply\s*\(?([^);\n]*)\ )?/gi,VAR_CONSUMED:/(--[\w-]+)\s*([:,;)]|$)/gi,ANIMATION_MATCH:/(animation\s*:)| (animation-name\s*:)/,MEDIA_MATCH:/@media[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETE D:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:])",HOST_SUFFIX:"($|[.:[\\s>+~])"},resolv eCss:Polymer.ResolveUrl.resolveCss,parser:Polymer.CssParse,ruleTypes:Polymer.Css Parse.types}}(),Polymer.StyleTransformer=function(){var e=Polymer.StyleUtil,t=Po lymer.Settings,n={dom:function(e,t,n,r){this._transformDom(e,t||"",n,r)},_transf ormDom:function(e,t,n,r){e.setAttribute&&this.element(e,t,n,r);for(var s=Polymer .dom(e).childNodes,i=0;i<s.length;i++)this._transformDom(s[i],t,n,r)},element:fu nction(e,t,n,s){if(n)s?e.removeAttribute(r):e.setAttribute(r,t);else if(t)if(e.c lassList)s?(e.classList.remove(r),e.classList.remove(t)):(e.classList.add(r),e.c lassList.add(t));else if(e.getAttribute){var i=e.getAttribute(g);s?i&&e.setAttri bute(g,i.replace(r,"").replace(t,"")):e.setAttribute(g,(i?i+" ":"")+r+" "+t)}},e lementStyles:function(n,r){var s,i=n._styles,o="",a=n.__cssBuild,l=t.useNativeSh adow||"shady"===a;if(l){var h=this;s=function(e){e.selector=h._slottedToContent( e.selector),e.selector=e.selector.replace(c,":host > *"),r&&r(e)}}for(var u,f=0, p=i.length;f<p&&(u=i[f]);f++){var _=e.rulesForStyle(u);o+=l?e.toCssText(_,s):thi s.css(_,n.is,n.extends,r,n._scopeCssViaAttr)+"\n\n"}return o.trim()},css:functio n(t,n,r,s,i){var o=this._calcHostScope(n,r);n=this._calcElementScope(n,i);var a= this;return e.toCssText(t,function(e){e.isScoped||(a.rule(e,n,o),e.isScoped=!0), s&&s(e,n,o)})},_calcElementScope:function(e,t){return e?t?m+e+y:d+e:""},_calcHos tScope:function(e,t){return t?"[is="+e+"]":e},rule:function(e,t,n){this._transfo rmRule(e,this._transformComplexSelector,t,n)},_transformRule:function(e,t,n,r){e .selector=e.transformedSelector=this._transformRuleCss(e,t,n,r)},_transformRuleC ss:function(t,n,r,s){var o=t.selector.split(i);if(!e.isKeyframesSelector(t))for( var a,l=0,c=o.length;l<c&&(a=o[l]);l++)o[l]=n.call(this,a,r,s);return o.join(i)} ,_transformComplexSelector:function(e,t,n){var r=!1,s=!1,a=this;return e=e.trim( ),e=this._slottedToContent(e),e=e.replace(c,":host > *"),e=e.replace(P,l+" $1"), e=e.replace(o,function(e,i,o){if(r)o=o.replace(_," ");else{var l=a._transformCom poundSelector(o,i,t,n);r=r||l.stop,s=s||l.hostContext,i=l.combinator,o=l.value}r eturn i+o}),s&&(e=e.replace(f,function(e,t,r,s){return t+r+" "+n+s+i+" "+t+n+r+s })),e},_transformCompoundSelector:function(e,t,n,r){var s=e.search(_),i=!1;e.ind exOf(u)>=0?i=!0:e.indexOf(l)>=0?e=this._transformHostSelector(e,r):0!==s&&(e=n?t his._transformSimpleSelector(e,n):e),e.indexOf(p)>=0&&(t="");var o;return s>=0&& (e=e.replace(_," "),o=!0),{value:e,combinator:t,stop:o,hostContext:i}},_transfor mSimpleSelector:function(e,t){var n=e.split(v);return n[0]+=t,n.join(v)},_transf ormHostSelector:function(e,t){var n=e.match(h),r=n&&n[2].trim()||"";if(r){if(r[0 ].match(a))return e.replace(h,function(e,n,r){return t+r});var s=r.split(a)[0];r eturn s===t?r:S}return e.replace(l,t)},documentRule:function(e){e.selector=e.par sedSelector,this.normalizeRootSelector(e),t.useNativeShadow||this._transformRule (e,this._transformDocumentSelector)},normalizeRootSelector:function(e){e.selecto r=e.selector.replace(c,"html")},_transformDocumentSelector:function(e){return e. match(_)?this._transformComplexSelector(e,s):this._transformSimpleSelector(e.tri m(),s)},_slottedToContent:function(e){return e.replace(C,p+"> $1")},SCOPE_NAME:" style-scope"},r=n.SCOPE_NAME,s=":not(["+r+"]):not(."+r+")",i=",",o=/(^|[\s>+~]+) ((?:\[.+?\]|[^\s>+~=\[])+)/g,a=/[[.:#*]/,l=":host",c=":root",h=/(:host)(?:\(((?: \([^)(]*\)|[^)(]*)+?)\))/,u=":host-context",f=/(.*)(?::host-context)(?:\(((?:\([ ^)(]*\)|[^)(]*)+?)\))(.*)/,p="::content",_=/::content|::shadow|\/deep\//,d=".",m ="["+r+"~=",y="]",v=":",g="class",P=new RegExp("^("+p+")"),S="should_not_match", C=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g;return n}(),Polymer.StyleExt ends=function(){var e=Polymer.StyleUtil;return{hasExtends:function(e){return Boo lean(e.match(this.rx.EXTEND))},transform:function(t){var n=e.rulesForStyle(t),r= this;return e.forEachRule(n,function(e){if(r._mapRuleOntoParent(e),e.parent)for( var t;t=r.rx.EXTEND.exec(e.cssText);){var n=t[1],s=r._findExtendor(n,e);s&&r._ex tendRule(e,s)}e.cssText=e.cssText.replace(r.rx.EXTEND,"")}),e.toCssText(n,functi on(e){e.selector.match(r.rx.STRIP)&&(e.cssText="")},!0)},_mapRuleOntoParent:func tion(e){if(e.parent){for(var t,n=e.parent.map||(e.parent.map={}),r=e.selector.sp lit(","),s=0;s<r.length;s++)t=r[s],n[t.trim()]=e;return n}},_findExtendor:functi on(e,t){return t.parent&&t.parent.map&&t.parent.map[e]||this._findExtendor(e,t.p arent)},_extendRule:function(e,t){e.parent!==t.parent&&this._cloneAndAddRuleToPa rent(t,e.parent),e.extends=e.extends||[],e.extends.push(t),t.selector=t.selector .replace(this.rx.STRIP,""),t.selector=(t.selector&&t.selector+",\n")+e.selector, t.extends&&t.extends.forEach(function(t){this._extendRule(e,t)},this)},_cloneAnd AddRuleToParent:function(e,t){e=Object.create(e),e.parent=t,e.extends&&(e.extend s=e.extends.slice()),t.rules.push(e)},rx:{EXTEND:/@extends\(([^)]*)\)\s*?;/gim,S TRIP:/%[^,]*$/}}}(),Polymer.ApplyShim=function(){"use strict";function e(e,t){e= e.trim(),m[e]={properties:t,dependants:{}}}function t(e){return e=e.trim(),m[e]} function n(e,t){var n=_.exec(t);return n&&(t=n[1]?y._getInitialValueForProperty( e):"apply-shim-inherit"),t}function r(e){for(var t,r,s,i,o=e.split(";"),a={},l=0 ;l<o.length;l++)s=o[l],s&&(i=s.split(":"),i.length>1&&(t=i[0].trim(),r=n(t,i.sli ce(1).join(":")),a[t]=r));return a}function s(e){var t=y.__currentElementProto,n =t&&t.is;for(var r in e.dependants)r!==n&&(e.dependants[r].__applyShimInvalid=!0 )}function i(n,i,o,a){if(o&&c.processVariableAndFallback(o,function(e,n){n&&t(n) &&(a="@apply "+n+";")}),!a)return n;var h=l(a),u=n.slice(0,n.indexOf("--")),f=r( h),p=f,_=t(i),m=_&&_.properties;m?(p=Object.create(m),p=Polymer.Base.mixin(p,f)) :e(i,p);var y,v,g=[],P=!1;for(y in p)v=f[y],void 0===v&&(v="initial"),!m||y in m ||(P=!0),g.push(i+d+y+": "+v);return P&&s(_),_&&(_.properties=p),o&&(u=n+";"+u), u+g.join("; ")+";"}function o(e,t,n){return"var("+t+",var("+n+"))"}function a(n, r){n=n.replace(p,"");var s=[],i=t(n);if(i||(e(n,{}),i=t(n)),i){var o=y.__current ElementProto;o&&(i.dependants[o.is]=o);var a,l,c;for(a in i.properties)c=r&&r[a] ,l=[a,": var(",n,d,a],c&&l.push(",",c),l.push(")"),s.push(l.join(""))}return s.j oin("; ")}function l(e){for(var t;t=h.exec(e);){var n=t[0],s=t[1],i=t.index,o=i+ n.indexOf("@apply"),l=i+n.length,c=e.slice(0,o),u=e.slice(l),f=r(c),p=a(s,f);e=[ c,p,u].join(""),h.lastIndex=i+p.length}return e}var c=Polymer.StyleUtil,h=c.rx.M IXIN_MATCH,u=c.rx.VAR_ASSIGN,f=/var\(\s*(--[^,]*),\s*(--[^)]*)\)/g,p=/;\s*/m,_=/ ^\s*(initial)|(inherit)\s*$/,d="_-_",m={},y={_measureElement:null,_map:m,_separa tor:d,transform:function(e,t){this.__currentElementProto=t,c.forRulesInStyles(e, this._boundFindDefinitions),c.forRulesInStyles(e,this._boundFindApplications),t& &(t.__applyShimInvalid=!1),this.__currentElementProto=null},_findDefinitions:fun ction(e){var t=e.parsedCssText;t=t.replace(f,o),t=t.replace(u,i),e.cssText=t,":r oot"===e.selector&&(e.selector=":host > *")},_findApplications:function(e){e.css Text=l(e.cssText)},transformRule:function(e){this._findDefinitions(e),this._find Applications(e)},_getInitialValueForProperty:function(e){return this._measureEle ment||(this._measureElement=document.createElement("meta"),this._measureElement. style.all="initial",document.head.appendChild(this._measureElement)),window.getC omputedStyle(this._measureElement).getPropertyValue(e)}};return y._boundTransfor mRule=y.transformRule.bind(y),y._boundFindDefinitions=y._findDefinitions.bind(y) ,y._boundFindApplications=y._findApplications.bind(y),y}(),function(){var e=Poly mer.Base._prepElement,t=Polymer.Settings.useNativeShadow,n=Polymer.StyleUtil,r=P olymer.StyleTransformer,s=Polymer.StyleExtends,i=Polymer.ApplyShim,o=Polymer.Set tings;Polymer.Base._addFeature({_prepElement:function(t){this._encapsulateStyle& &"shady"!==this.__cssBuild&&r.element(t,this.is,this._scopeCssViaAttr),e.call(th is,t)},_prepStyles:function(){void 0===this._encapsulateStyle&&(this._encapsulat eStyle=!t),t||(this._scopeStyle=n.applyStylePlaceHolder(this.is)),this.__cssBuil d=n.cssBuildTypeForModule(this.is)},_prepShimStyles:function(){if(this._template ){var e=n.isTargetedBuild(this.__cssBuild);if(o.useNativeCSSProperties&&"shadow" ===this.__cssBuild&&e)return;this._styles=this._styles||this._collectStyles(),o. useNativeCSSProperties&&!this.__cssBuild&&i.transform(this._styles,this);var s=o .useNativeCSSProperties&&e?this._styles.length&&this._styles[0].textContent.trim ():r.elementStyles(this);this._prepStyleProperties(),!this._needsStyleProperties ()&&s&&n.applyCss(s,this.is,t?this._template.content:null,this._scopeStyle)}else this._styles=[]},_collectStyles:function(){var e=[],t="",r=this.styleModules;if (r)for(var i,o=0,a=r.length;o<a&&(i=r[o]);o++)t+=n.cssFromModule(i);t+=n.cssFrom Module(this.is);var l=this._template&&this._template.parentNode;if(!this._templa te||l&&l.id.toLowerCase()===this.is||(t+=n.cssFromElement(this._template)),t){va r c=document.createElement("style");c.textContent=t,s.hasExtends(c.textContent)& &(t=s.transform(c)),e.push(c)}return e},_elementAdd:function(e){this._encapsulat eStyle&&(e.__styleScoped?e.__styleScoped=!1:r.dom(e,this.is,this._scopeCssViaAtt r))},_elementRemove:function(e){this._encapsulateStyle&&r.dom(e,this.is,this._sc opeCssViaAttr,!0)},scopeSubtree:function(e,n){if(!t){var r=this,s=function(e){if (e.nodeType===Node.ELEMENT_NODE){var t=e.getAttribute("class");e.setAttribute("c lass",r._scopeElementClass(e,t));for(var n,s=e.querySelectorAll("*"),i=0;i<s.len gth&&(n=s[i]);i++)t=n.getAttribute("class"),n.setAttribute("class",r._scopeEleme ntClass(n,t))}};if(s(e),n){var i=new MutationObserver(function(e){for(var t,n=0; n<e.length&&(t=e[n]);n++)if(t.addedNodes)for(var r=0;r<t.addedNodes.length;r++)s (t.addedNodes[r])});return i.observe(e,{childList:!0,subtree:!0}),i}}}})}(),Poly mer.StyleProperties=function(){"use strict";function e(e,t){var n=parseInt(e/32) ,r=1<<e%32;t[n]=(t[n]||0)|r}var t=Polymer.DomApi.matchesSelector,n=Polymer.Style Util,r=Polymer.StyleTransformer,s=navigator.userAgent.match("Trident"),i=Polymer .Settings;return{decorateStyles:function(e,t){var s=this,i={},o=[],a=0,l=r._calc HostScope(t.is,t.extends);n.forRulesInStyles(e,function(e,r){s.decorateRule(e),e .index=a++,s.whenHostOrRootRule(t,e,r,function(r){if(e.parent.type===n.ruleTypes .MEDIA_RULE&&(t.__notStyleScopeCacheable=!0),r.isHost){var s=r.selector.split(" ").some(function(e){return 0===e.indexOf(l)&&e.length!==l.length});t.__notStyleS copeCacheable=t.__notStyleScopeCacheable||s}}),s.collectPropertiesInCssText(e.pr opertyInfo.cssText,i)},function(e){o.push(e)}),e._keyframes=o;var c=[];for(var h in i)c.push(h);return c},decorateRule:function(e){if(e.propertyInfo)return e.pr opertyInfo;var t={},n={},r=this.collectProperties(e,n);return r&&(t.properties=n ,e.rules=null),t.cssText=this.collectCssText(e),e.propertyInfo=t,t},collectPrope rties:function(e,t){var n=e.propertyInfo;if(!n){for(var r,s,i,o=this.rx.VAR_ASSI GN,a=e.parsedCssText;r=o.exec(a);)s=(r[2]||r[3]).trim(),"inherit"!==s&&(t[r[1].t rim()]=s),i=!0;return i}if(n.properties)return Polymer.Base.mixin(t,n.properties ),!0},collectCssText:function(e){return this.collectConsumingCssText(e.parsedCss Text)},collectConsumingCssText:function(e){return e.replace(this.rx.BRACKETED,"" ).replace(this.rx.VAR_ASSIGN,"")},collectPropertiesInCssText:function(e,t){for(v ar n;n=this.rx.VAR_CONSUMED.exec(e);){var r=n[1];":"!==n[2]&&(t[r]=!0)}},reify:f unction(e){for(var t,n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++)t=n[r],e [t]=this.valueForProperty(e[t],e)},valueForProperty:function(e,t){if(e)if(e.inde xOf(";")>=0)e=this.valueForProperties(e,t);else{var r=this,s=function(e,n,s,i){v ar o=r.valueForProperty(t[n],t);return o&&"initial"!==o?"apply-shim-inherit"===o &&(o="inherit"):o=r.valueForProperty(t[s]||s,t)||s,e+(o||"")+i};e=n.processVaria bleAndFallback(e,s)}return e&&e.trim()||""},valueForProperties:function(e,t){for (var n,r,s=e.split(";"),i=0;i<s.length;i++)if(n=s[i]){if(this.rx.MIXIN_MATCH.las tIndex=0,r=this.rx.MIXIN_MATCH.exec(n))n=this.valueForProperty(t[r[1]],t);else{v ar o=n.indexOf(":");if(o!==-1){var a=n.substring(o);a=a.trim(),a=this.valueForPr operty(a,t)||a,n=n.substring(0,o)+a}}s[i]=n&&n.lastIndexOf(";")===n.length-1?n.s lice(0,-1):n||""}return s.join(";")},applyProperties:function(e,t){var n="";e.pr opertyInfo||this.decorateRule(e),e.propertyInfo.cssText&&(n=this.valueForPropert ies(e.propertyInfo.cssText,t)),e.cssText=n},applyKeyframeTransforms:function(e,t ){var n=e.cssText,r=e.cssText;if(null==e.hasAnimations&&(e.hasAnimations=this.rx .ANIMATION_MATCH.test(n)),e.hasAnimations){var s;if(null==e.keyframeNamesToTrans form){e.keyframeNamesToTransform=[];for(var i in t)s=t[i],r=s(n),n!==r&&(n=r,e.k eyframeNamesToTransform.push(i))}else{for(var o=0;o<e.keyframeNamesToTransform.l ength;++o)s=t[e.keyframeNamesToTransform[o]],n=s(n);r=n}}e.cssText=r},propertyDa taFromStyles:function(r,s){var i={},o=this,a=[];return n.forActiveRulesInStyles( r,function(n){n.propertyInfo||o.decorateRule(n);var r=n.transformedSelector||n.p arsedSelector;s&&n.propertyInfo.properties&&r&&t.call(s,r)&&(o.collectProperties (n,i),e(n.index,a))}),{properties:i,key:a}},_rootSelector:/:root|:host\s*>\s*\*/ ,_checkRoot:function(e,t){return Boolean(t.match(this._rootSelector))||"html"=== e&&t.indexOf("html")>-1},whenHostOrRootRule:function(e,t,n,s){if(t.propertyInfo| |self.decorateRule(t),t.propertyInfo.properties){var o=e.is?r._calcHostScope(e.i s,e.extends):"html",a=t.parsedSelector,l=this._checkRoot(o,a),c=!l&&0===a.indexO f(":host"),h=e.__cssBuild||n.__cssBuild;if("shady"===h&&(l=a===o+" > *."+o||a.in dexOf("html")>-1,c=!l&&0===a.indexOf(o)),l||c){var u=o;c&&(i.useNativeShadow&&!t .transformedSelector&&(t.transformedSelector=r._transformRuleCss(t,r._transformC omplexSelector,e.is,o)),u=t.transformedSelector||t.parsedSelector),l&&"html"===o &&(u=t.transformedSelector||t.parsedSelector),s({selector:u,isHost:c,isRoot:l})} }},hostAndRootPropertiesForScope:function(e){var r={},s={},i=this;return n.forAc tiveRulesInStyles(e._styles,function(n,o){i.whenHostOrRootRule(e,n,o,function(o) {var a=e._element||e;t.call(a,o.selector)&&(o.isHost?i.collectProperties(n,r):i. collectProperties(n,s))})}),{rootProps:s,hostProps:r}},transformStyles:function( e,t,n){var s=this,o=r._calcHostScope(e.is,e.extends),a=e.extends?"\\"+o.slice(0, -1)+"\\]":o,l=new RegExp(this.rx.HOST_PREFIX+a+this.rx.HOST_SUFFIX),c=this._elem entKeyframeTransforms(e,n);return r.elementStyles(e,function(r){s.applyPropertie s(r,t),i.useNativeShadow||Polymer.StyleUtil.isKeyframesSelector(r)||!r.cssText|| (s.applyKeyframeTransforms(r,c),s._scopeSelector(r,l,o,e._scopeCssViaAttr,n))})} ,_elementKeyframeTransforms:function(e,t){var n=e._styles._keyframes,r={};if(!i. useNativeShadow&&n)for(var s=0,o=n[s];s<n.length;o=n[++s])this._scopeKeyframes(o ,t),r[o.keyframesName]=this._keyframesRuleTransformer(o);return r},_keyframesRul eTransformer:function(e){return function(t){return t.replace(e.keyframesNameRx,e .transformedKeyframesName)}},_scopeKeyframes:function(e,t){e.keyframesNameRx=new RegExp(e.keyframesName,"g"),e.transformedKeyframesName=e.keyframesName+"-"+t,e. transformedSelector=e.transformedSelector||e.selector,e.selector=e.transformedSe lector.replace(e.keyframesName,e.transformedKeyframesName)},_scopeSelector:funct ion(e,t,n,s,i){e.transformedSelector=e.transformedSelector||e.selector;for(var o ,a=e.transformedSelector,l=s?"["+r.SCOPE_NAME+"~="+i+"]":"."+i,c=a.split(","),h= 0,u=c.length;h<u&&(o=c[h]);h++)c[h]=o.match(t)?o.replace(n,l):l+" "+o;e.selector =c.join(",")},applyElementScopeSelector:function(e,t,n,s){var i=s?e.getAttribute (r.SCOPE_NAME):e.getAttribute("class")||"",o=n?i.replace(n,t):(i?i+" ":"")+this. XSCOPE_NAME+" "+t;i!==o&&(s?e.setAttribute(r.SCOPE_NAME,o):e.setAttribute("class ",o))},applyElementStyle:function(e,t,r,o){var a=o?o.textContent||"":this.transf ormStyles(e,t,r),l=e._customStyle;return l&&!i.useNativeShadow&&l!==o&&(l._useCo unt--,l._useCount<=0&&l.parentNode&&l.parentNode.removeChild(l)),i.useNativeShad ow?e._customStyle?(e._customStyle.textContent=a,o=e._customStyle):a&&(o=n.applyC ss(a,r,e.root,e._scopeStyle)):o?o.parentNode||(s&&a.indexOf("@media")>-1&&(o.tex tContent=a),n.applyStyle(o,null,e._scopeStyle)):a&&(o=n.applyCss(a,r,null,e._sco peStyle)),o&&(o._useCount=o._useCount||0,e._customStyle!=o&&o._useCount++,e._cus tomStyle=o),o},mixinCustomStyle:function(e,t){var n;for(var r in t)n=t[r],(n||0= ==n)&&(e[r]=n)},updateNativeStyleProperties:function(e,t){var n=e.__customStyleP roperties;if(n)for(var r=0;r<n.length;r++)e.style.removeProperty(n[r]);var s=[]; for(var i in t)null!==t[i]&&(e.style.setProperty(i,t[i]),s.push(i));e.__customSt yleProperties=s},rx:n.rx,XSCOPE_NAME:"x-scope"}}(),function(){Polymer.StyleCache =function(){this.cache={}},Polymer.StyleCache.prototype={MAX:100,store:function( e,t,n,r){t.keyValues=n,t.styles=r;var s=this.cache[e]=this.cache[e]||[];s.push(t ),s.length>this.MAX&&s.shift()},retrieve:function(e,t,n){var r=this.cache[e];if( r)for(var s,i=r.length-1;i>=0;i--)if(s=r[i],n===s.styles&&this._objectsEqual(t,s .keyValues))return s},clear:function(){this.cache={}},_objectsEqual:function(e,t ){var n,r;for(var s in e)if(n=e[s],r=t[s],!("object"==typeof n&&n?this._objectsS trictlyEqual(n,r):n===r))return!1;return!Array.isArray(e)||e.length===t.length}, _objectsStrictlyEqual:function(e,t){return this._objectsEqual(e,t)&&this._object sEqual(t,e)}}}(),Polymer.StyleDefaults=function(){var e=Polymer.StyleProperties, t=Polymer.StyleCache,n=Polymer.Settings.useNativeCSSProperties,r={_styles:[],_pr operties:null,customStyle:{},_styleCache:new t,_element:Polymer.DomApi.wrap(docu ment.documentElement),addStyle:function(e){this._styles.push(e),this._properties =null},get _styleProperties(){return this._properties||(e.decorateStyles(this._s tyles,this),this._styles._scopeStyleProperties=null,this._properties=e.hostAndRo otPropertiesForScope(this).rootProps,e.mixinCustomStyle(this._properties,this.cu stomStyle),e.reify(this._properties)),this._properties},hasStyleProperties:funct ion(){return Boolean(this._properties)},_needsStyleProperties:function(){},_comp uteStyleProperties:function(){return this._styleProperties},updateStyles:functio n(t){this._properties=null,t&&Polymer.Base.mixin(this.customStyle,t),this._style Cache.clear();for(var r,s=0;s<this._styles.length;s++)r=this._styles[s],r=r.__im portElement||r,r._apply();n&&e.updateNativeStyleProperties(document.documentElem ent,this.customStyle)}};return r}(),function(){"use strict";var e=Polymer.Base.s erializeValueToAttribute,t=Polymer.StyleProperties,n=Polymer.StyleTransformer,r= Polymer.StyleDefaults,s=Polymer.Settings.useNativeShadow,i=Polymer.Settings.useN ativeCSSProperties;Polymer.Base._addFeature({_prepStyleProperties:function(){i|| (this._ownStylePropertyNames=this._styles&&this._styles.length?t.decorateStyles( this._styles,this):null);
4 },customStyle:null,getComputedStyleValue:function(e){return!i&&this._styleProper ties&&this._styleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_set upStyleProperties:function(){this.customStyle={},this._styleCache=null,this._sty leProperties=null,this._scopeSelector=null,this._ownStyleProperties=null,this._c ustomStyle=null},_needsStyleProperties:function(){return Boolean(!i&&this._ownSt ylePropertyNames&&this._ownStylePropertyNames.length)},_validateApplyShim:functi on(){if(this.__applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this._ _proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySe lector("style");t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeSty le.nextSibling;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSel ector&&!this.__stylePropertiesInvalid||!this._needsStyleProperties()||(this.__st ylePropertiesInvalid=!1,this._updateStyleProperties())},_findStyleHost:function( ){for(var e,t=this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.hos t))return e.host;t=e.host}return r},_updateStyleProperties:function(){var e,n=th is._findStyleHost();n._styleProperties||n._computeStyleProperties(),n._styleCach e||(n._styleCache=new Polymer.StyleCache);var r=t.propertyDataFromStyles(n._styl es,this),i=!this.__notStyleScopeCacheable;i&&(r.key.customStyle=this.customStyle ,e=n._styleCache.retrieve(this.is,r.key,this._styles));var a=Boolean(e);a?this._ styleProperties=e._styleProperties:this._computeStyleProperties(r.properties),th is._computeOwnStyleProperties(),a||(e=o.retrieve(this.is,this._ownStylePropertie s,this._styles));var l=Boolean(e)&&!a,c=this._applyStyleProperties(e);a||(c=c&&s ?c.cloneNode(!0):c,e={style:c,_scopeSelector:this._scopeSelector,_stylePropertie s:this._styleProperties},i&&(r.key.customStyle={},this.mixin(r.key.customStyle,t his.customStyle),n._styleCache.store(this.is,e,r.key,this._styles)),l||o.store(t his.is,Object.create(e),this._ownStyleProperties,this._styles))},_computeStylePr operties:function(e){var n=this._findStyleHost();n._styleProperties||n._computeS tyleProperties();var r=Object.create(n._styleProperties),s=t.hostAndRootProperti esForScope(this);this.mixin(r,s.hostProps),e=e||t.propertyDataFromStyles(n._styl es,this).properties,this.mixin(r,e),this.mixin(r,s.rootProps),t.mixinCustomStyle (r,this.customStyle),t.reify(r),this._styleProperties=r},_computeOwnStylePropert ies:function(){for(var e,t={},n=0;n<this._ownStylePropertyNames.length;n++)e=thi s._ownStylePropertyNames[n],t[e]=this._styleProperties[e];this._ownStyleProperti es=t},_scopeCount:0,_applyStyleProperties:function(e){var n=this._scopeSelector; this._scopeSelector=e?e._scopeSelector:this.is+"-"+this.__proto__._scopeCount++; var r=t.applyElementStyle(this,this._styleProperties,this._scopeSelector,e&&e.st yle);return s||t.applyElementScopeSelector(this,this._scopeSelector,n,this._scop eCssViaAttr),r},serializeValueToAttribute:function(t,n,r){if(r=r||this,"class"== =n&&!s){var i=r===this?this.domHost||this.dataHost:this;i&&(t=i._scopeElementCla ss(r,t))}r=this.shadyRoot&&this.shadyRoot._hasDistributed?Polymer.dom(r):r,e.cal l(this,t,n,r)},_scopeElementClass:function(e,t){return s||this._scopeCssViaAttr| |(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSelector?" "+l+" "+e._scopeSelector:"")) ,t},updateStyles:function(e){e&&this.mixin(this.customStyle,e),i?t.updateNativeS tyleProperties(this,this.customStyle):(this.isAttached?this._needsStylePropertie s()?this._updateStyleProperties():this._styleProperties=null:this.__stylePropert iesInvalid=!0,this._styleCache&&this._styleCache.clear(),this._updateRootStyles( ))},_updateRootStyles:function(e){e=e||this.root;for(var t,n=Polymer.dom(e)._que ry(function(e){return e.shadyRoot||e.shadowRoot}),r=0,s=n.length;r<s&&(t=n[r]);r ++)t.updateStyles&&t.updateStyles()}}),Polymer.updateStyles=function(e){r.update Styles(e),Polymer.Base._updateRootStyles(document)};var o=new Polymer.StyleCache ;Polymer.customStyleCache=o;var a=n.SCOPE_NAME,l=t.XSCOPE_NAME}(),Polymer.Base._ addFeature({_registerFeatures:function(){this._prepIs(),this._prepConstructor(), this._prepStyles()},_finishRegisterFeatures:function(){this._prepTemplate(),this ._prepShimStyles(),this._prepAnnotations(),this._prepEffects(),this._prepBehavio rs(),this._prepPropertyInfo(),this._prepBindings(),this._prepShady()},_prepBehav ior:function(e){this._addPropertyEffects(e.properties),this._addComplexObserverE ffects(e.observers),this._addHostAttributes(e.hostAttributes)},_initFeatures:fun ction(){this._setupGestures(),this._setupConfigure(),this._setupStyleProperties( ),this._setupDebouncers(),this._setupShady(),this._registerHost(),this._template &&(this._validateApplyShim(),this._poolContent(),this._beginHosting(),this._stam pTemplate(),this._endHosting(),this._marshalAnnotationReferences()),this._marsha lInstanceEffects(),this._marshalBehaviors(),this._marshalHostAttributes(),this._ marshalAttributes(),this._tryReady()},_marshalBehavior:function(e){e.listeners&& this._listenListeners(e.listeners)}}),function(){var e,t=Polymer.StyleProperties ,n=Polymer.StyleUtil,r=Polymer.CssParse,s=Polymer.StyleDefaults,i=Polymer.StyleT ransformer,o=Polymer.ApplyShim,a=Polymer.Debounce,l=Polymer.Settings;Polymer({is :"custom-style",extends:"style",_template:null,properties:{include:String},ready :function(){this.__appliedElement=this.__appliedElement||this,this.__cssBuild=n. getCssBuildType(this),this.__appliedElement!==this&&(this.__appliedElement.__css Build=this.__cssBuild),this._tryApply()},attached:function(){this._tryApply()},_ tryApply:function(){if(!this._appliesToDocument&&this.parentNode&&"dom-module"!= =this.parentNode.localName){this._appliesToDocument=!0;var e=this.__appliedEleme nt;if(l.useNativeCSSProperties||(this.__needsUpdateStyles=s.hasStyleProperties() ,s.addStyle(e)),e.textContent||this.include)this._apply(!0);else{var t=this,n=ne w MutationObserver(function(){n.disconnect(),t._apply(!0)});n.observe(e,{childLi st:!0})}}},_updateStyles:function(){Polymer.updateStyles()},_apply:function(e){v ar t=this.__appliedElement;if(this.include&&(t.textContent=n.cssFromModules(this .include,!0)+t.textContent),t.textContent){var r=this.__cssBuild,s=n.isTargetedB uild(r);if(!l.useNativeCSSProperties||!s){var a=n.rulesForStyle(t);if(s||(n.forE achRule(a,function(e){i.documentRule(e)}),l.useNativeCSSProperties&&!r&&o.transf orm([t])),l.useNativeCSSProperties)t.textContent=n.toCssText(a);else{var c=this, h=function(){c._flushCustomProperties()};e?Polymer.RenderStatus.whenReady(h):h() }}}},_flushCustomProperties:function(){this.__needsUpdateStyles?(this.__needsUpd ateStyles=!1,e=a(e,this._updateStyles)):this._applyCustomProperties()},_applyCus tomProperties:function(){var e=this.__appliedElement;this._computeStylePropertie s();var s=this._styleProperties,i=n.rulesForStyle(e);i&&(e.textContent=n.toCssTe xt(i,function(e){var n=e.cssText=e.parsedCssText;e.propertyInfo&&e.propertyInfo. cssText&&(n=r.removeCustomPropAssignment(n),e.cssText=t.valueForProperties(n,s)) }))}})}(),Polymer.Templatizer={properties:{__hideTemplateChildren__:{observer:"_ showHideChildren"}},_instanceProps:Polymer.nob,_parentPropPrefix:"_parent_",temp latize:function(e){if(this._templatized=e,e._content||(e._content=e.content),e._ content._ctor)return this.ctor=e._content._ctor,void this._prepParentProperties( this.ctor.prototype,e);var t=Object.create(Polymer.Base);this._customPrepAnnotat ions(t,e),this._prepParentProperties(t,e),t._prepEffects(),this._customPrepEffec ts(t),t._prepBehaviors(),t._prepPropertyInfo(),t._prepBindings(),t._notifyPathUp =this._notifyPathUpImpl,t._scopeElementClass=this._scopeElementClassImpl,t.liste n=this._listenImpl,t._showHideChildren=this._showHideChildrenImpl,t.__setPropert yOrig=this.__setProperty,t.__setProperty=this.__setPropertyImpl;var n=this._cons tructorImpl,r=function(e,t){n.call(this,e,t)};r.prototype=t,t.constructor=r,e._c ontent._ctor=r,this.ctor=r},_getRootDataHost:function(){return this.dataHost&&th is.dataHost._rootDataHost||this.dataHost},_showHideChildrenImpl:function(e){for( var t=this._children,n=0;n<t.length;n++){var r=t[n];Boolean(e)!=Boolean(r.__hide TemplateChildren__)&&(r.nodeType===Node.TEXT_NODE?e?(r.__polymerTextContent__=r. textContent,r.textContent=""):r.textContent=r.__polymerTextContent__:r.style&&(e ?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r .__polymerDisplay__)),r.__hideTemplateChildren__=e}},__setPropertyImpl:function( e,t,n,r){r&&r.__hideTemplateChildren__&&"textContent"==e&&(e="__polymerTextConte nt__"),this.__setPropertyOrig(e,t,n,r)},_debounceTemplate:function(e){Polymer.do m.addDebouncer(this.debounce("_debounceTemplate",e))},_flushTemplates:function() {Polymer.dom.flush()},_customPrepEffects:function(e){var t=e._parentProps;for(va r n in t)e._addPropertyEffect(n,"function",this._createHostPropEffector(n));for( n in this._instanceProps)e._addPropertyEffect(n,"function",this._createInstanceP ropEffector(n))},_customPrepAnnotations:function(e,t){e._template=t;var n=t._con tent;if(!n._notes){var r=e._rootDataHost;r&&(Polymer.Annotations.prepElement=fun ction(){r._prepElement()}),n._notes=Polymer.Annotations.parseAnnotations(t),Poly mer.Annotations.prepElement=null,this._processAnnotations(n._notes)}e._notes=n._ notes,e._parentProps=n._parentProps},_prepParentProperties:function(e,t){var n=t his._parentProps=e._parentProps;if(this._forwardParentProp&&n){var r,s=e._parent PropProto;if(!s){for(r in this._instanceProps)delete n[r];s=e._parentPropProto=O bject.create(null),t!=this&&(Polymer.Bind.prepareModel(s),Polymer.Base.prepareMo delNotifyPath(s));for(r in n){var i=this._parentPropPrefix+r,o=[{kind:"function" ,effect:this._createForwardPropEffector(r),fn:Polymer.Bind._functionEffect},{kin d:"notify",fn:Polymer.Bind._notifyEffect,effect:{event:Polymer.CaseMap.camelToDa shCase(i)+"-changed"}}];Polymer.Bind._createAccessors(s,i,o)}}var a=this;t!=this &&(Polymer.Bind.prepareInstance(t),t._forwardParentProp=function(e,t){a._forward ParentProp(e,t)}),this._extendTemplate(t,s),t._pathEffector=function(e,t,n){retu rn a._pathEffectorImpl(e,t,n)}}},_createForwardPropEffector:function(e){return f unction(t,n){this._forwardParentProp(e,n)}},_createHostPropEffector:function(e){ var t=this._parentPropPrefix;return function(n,r){this.dataHost._templatized[t+e ]=r}},_createInstancePropEffector:function(e){return function(t,n,r,s){s||this.d ataHost._forwardInstanceProp(this,e,n)}},_extendTemplate:function(e,t){var n=Obj ect.getOwnPropertyNames(t);t._propertySetter&&(e._propertySetter=t._propertySett er);for(var r,s=0;s<n.length&&(r=n[s]);s++){var i=e[r],o=Object.getOwnPropertyDe scriptor(t,r);Object.defineProperty(e,r,o),void 0!==i&&e._propertySetter(r,i)}}, _showHideChildren:function(e){},_forwardInstancePath:function(e,t,n){},_forwardI nstanceProp:function(e,t,n){},_notifyPathUpImpl:function(e,t){var n=this.dataHos t,r=Polymer.Path.root(e);n._forwardInstancePath.call(n,this,e,t),r in n._parentP rops&&n._templatized._notifyPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:fun ction(e,t,n){if(this._forwardParentPath&&0===e.indexOf(this._parentPropPrefix)){ var r=e.substring(this._parentPropPrefix.length),s=Polymer.Path.root(r);s in thi s._parentProps&&this._forwardParentPath(r,t)}Polymer.Base._pathEffector.call(thi s._templatized,e,t,n)},_constructorImpl:function(e,t){this._rootDataHost=t._getR ootDataHost(),this._setupConfigure(e),this._registerHost(t),this._beginHosting() ,this.root=this.instanceTemplate(this._template),this.root.__noContent=!this._no tes._hasContent,this.root.__styleScoped=!0,this._endHosting(),this._marshalAnnot atedNodes(),this._marshalInstanceEffects(),this._marshalAnnotatedListeners();for (var n=[],r=this.root.firstChild;r;r=r.nextSibling)n.push(r),r._templateInstance =this;this._children=n,t.__hideTemplateChildren__&&this._showHideChildren(!0),th is._tryReady()},_listenImpl:function(e,t,n){var r=this,s=this._rootDataHost,i=s. _createEventHandler(e,t,n),o=function(e){e.model=r,i(e)};s._listen(e,t,o)},_scop eElementClassImpl:function(e,t){var n=this._rootDataHost;return n?n._scopeElemen tClass(e,t):t},stamp:function(e){if(e=e||{},this._parentProps){var t=this._templ atized;for(var n in this._parentProps)void 0===e[n]&&(e[n]=t[this._parentPropPre fix+n])}return new this.ctor(e,this)},modelForElement:function(e){for(var t;e;)i f(t=e._templateInstance){if(t.dataHost==this)return t;e=t.dataHost}else e=e.pare ntNode}},Polymer({is:"dom-template",extends:"template",_template:null,behaviors: [Polymer.Templatizer],ready:function(){this.templatize(this)}}),Polymer._collect ions=new WeakMap,Polymer.Collection=function(e){Polymer._collections.set(e,this) ,this.userArray=e,this.store=e.slice(),this.initMap()},Polymer.Collection.protot ype={constructor:Polymer.Collection,initMap:function(){for(var e=this.omap=new W eakMap,t=this.pmap={},n=this.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==t ypeof s?e.set(s,r):t[s]=r}},add:function(e){var t=this.store.push(e)-1;return e& &"object"==typeof e?this.omap.set(e,t):this.pmap[e]=t,"#"+t},removeKey:function( e){(e=this._parseKey(e))&&(this._removeFromMap(this.store[e]),delete this.store[ e])},_removeFromMap:function(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:function(e){var t=this.getKey(e);return this.removeKey(t), t},getKey:function(e){var t;if(t=e&&"object"==typeof e?this.omap.get(e):this.pma p[e],void 0!=t)return"#"+t},getKeys:function(){return Object.keys(this.store).ma p(function(e){return"#"+e})},_parseKey:function(e){if(e&&"#"==e[0])return e.slic e(1)},setItem:function(e,t){if(e=this._parseKey(e)){var n=this.store[e];n&&this. _removeFromMap(n),t&&"object"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.s tore[e]=t}},getItem:function(e){if(e=this._parseKey(e))return this.store[e]},get Items:function(){var e=[],t=this.store;for(var n in t)e.push(t[n]);return e},_ap plySplices:function(e){for(var t,n,r={},s=0;s<e.length&&(n=e[s]);s++){n.addedKey s=[];for(var i=0;i<n.removed.length;i++)t=this.getKey(n.removed[i]),r[t]=r[t]?nu ll:-1;for(i=0;i<n.addedCount;i++){var o=this.userArray[n.index+i];t=this.getKey( o),t=void 0===t?this.add(o):t,r[t]=r[t]?null:1,n.addedKeys.push(t)}}var a=[],l=[ ];for(t in r)r[t]<0&&(this.removeKey(t),a.push(t)),r[t]>0&&l.push(t);return[{rem oved:a,added:l}]}},Polymer.Collection.get=function(e){return Polymer._collection s.get(e)||new Polymer.Collection(e)},Polymer.Collection.applySplices=function(e, t){var n=Polymer._collections.get(e);return n?n._applySplices(t):null},Polymer({ is:"dom-repeat",extends:"template",_template:null,properties:{items:{type:Array} ,as:{type:String,value:"item"},indexAs:{type:String,value:"index"},sort:{type:Fu nction,observer:"_sortChanged"},filter:{type:Function,observer:"_filterChanged"} ,observe:{type:String,observer:"_observeChanged"},delay:Number,renderedItemCount :{type:Number,notify:!0,readOnly:!0},initialCount:{type:Number,observer:"_initia lizeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Num ber,computed:"_computeFrameTime(targetFramerate)"}},behaviors:[Polymer.Templatiz er],observers:["_itemsChanged(items.*)"],created:function(){this._instances=[],t his._pool=[],this._limit=1/0;var e=this;this._boundRenderChunk=function(){e._ren derChunk()}},detached:function(){this.__isDetached=!0;for(var e=0;e<this._instan ces.length;e++)this._detachInstance(e)},attached:function(){if(this.__isDetached ){this.__isDetached=!1;for(var e=Polymer.dom(Polymer.dom(this).parentNode),t=0;t <this._instances.length;t++)this._attachInstance(t,e)}},ready:function(){this._i nstanceProps={__key__:!0},this._instanceProps[this.as]=!0,this._instanceProps[th is.indexAs]=!0,this.ctor||this.templatize(this)},_sortChanged:function(e){var t= this._getRootDataHost();this._sortFn=e&&("function"==typeof e?e:function(){retur n t[e].apply(t,arguments)}),this._needFullRefresh=!0,this.items&&this._debounceT emplate(this._render)},_filterChanged:function(e){var t=this._getRootDataHost(); this._filterFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,argumen ts)}),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)} ,_computeFrameTime:function(e){return Math.ceil(1e3/e)},_initializeChunking:func tion(){this.initialCount&&(this._limit=this.initialCount,this._chunkCount=this.i nitialCount,this._lastChunkTime=performance.now())},_tryRenderChunk:function(){t his.items&&this._limit<this.items.length&&this.debounce("renderChunk",this._requ estRenderChunk)},_requestRenderChunk:function(){requestAnimationFrame(this._boun dRenderChunk)},_renderChunk:function(){var e=performance.now(),t=this._targetFra meTime/(e-this._lastChunkTime);this._chunkCount=Math.round(this._chunkCount*t)|| 1,this._limit+=this._chunkCount,this._lastChunkTime=e,this._debounceTemplate(thi s._render)},_observeChanged:function(){this._observePaths=this.observe&&this.obs erve.replace(".*",".").split(" ")},_itemsChanged:function(e){if("items"==e.path) Array.isArray(this.items)?this.collection=Polymer.Collection.get(this.items):thi s.items?this._error(this._logf("dom-repeat","expected array for `items`, found", this.items)):this.collection=null,this._keySplices=[],this._indexSplices=[],this ._needFullRefresh=!0,this._initializeChunking(),this._debounceTemplate(this._ren der);else if("items.splices"==e.path)this._keySplices=this._keySplices.concat(e. value.keySplices),this._indexSplices=this._indexSplices.concat(e.value.indexSpli ces),this._debounceTemplate(this._render);else{var t=e.path.slice(6);this._forwa rdItemPath(t,e.value),this._checkObservedPaths(t)}},_checkObservedPaths:function (e){if(this._observePaths){e=e.substring(e.indexOf(".")+1);for(var t=this._obser vePaths,n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return this._needFullRefresh=! 0,void(this.delay?this.debounce("render",this._render,this.delay):this._debounce Template(this._render))}},render:function(){this._needFullRefresh=!0,this._debou nceTemplate(this._render),this._flushTemplates()},_render:function(){this._needF ullRefresh?(this._applyFullRefresh(),this._needFullRefresh=!1):this._keySplices. length&&(this._sortFn?this._applySplicesUserSort(this._keySplices):this._filterF n?this._applyFullRefresh():this._applySplicesArrayOrder(this._indexSplices)),thi s._keySplices=[],this._indexSplices=[];for(var e=this._keyToInstIdx={},t=this._i nstances.length-1;t>=0;t--){var n=this._instances[t];n.isPlaceholder&&t<this._li mit?n=this._insertInstance(t,n.__key__):!n.isPlaceholder&&t>=this._limit&&(n=thi s._downgradeInstance(t,n.__key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProper ty(this.indexAs,t,!0)}this._pool.length=0,this._setRenderedItemCount(this._insta nces.length),this.fire("dom-change"),this._tryRenderChunk()},_applyFullRefresh:f unction(){var e,t=this.collection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];v ar n=this.items;if(n)for(var r=0;r<n.length;r++)e.push(t.getKey(n[r]))}var s=thi s;for(this._filterFn&&(e=e.filter(function(e){return s._filterFn(t.getItem(e))}) ),this._sortFn&&e.sort(function(e,n){return s._sortFn(t.getItem(e),t.getItem(n)) }),r=0;r<e.length;r++){var i=e[r],o=this._instances[r];o?(o.__key__=i,!o.isPlace holder&&r<this._limit&&o.__setProperty(this.as,t.getItem(i),!0)):r<this._limit?t his._insertInstance(r,i):this._insertPlaceholder(r,i)}for(var a=this._instances. length-1;a>=r;a--)this._detachAndRemoveInstance(a)},_numericSort:function(e,t){r eturn e-t},_applySplicesUserSort:function(e){for(var t,n,r=this.collection,s={}, i=0;i<e.length&&(n=e[i]);i++){for(var o=0;o<n.removed.length;o++)t=n.removed[o], s[t]=s[t]?null:-1;for(o=0;o<n.added.length;o++)t=n.added[o],s[t]=s[t]?null:1}var a=[],l=[];for(t in s)s[t]===-1&&a.push(this._keyToInstIdx[t]),1===s[t]&&l.push( t);if(a.length)for(a.sort(this._numericSort),i=a.length-1;i>=0;i--){var c=a[i];v oid 0!==c&&this._detachAndRemoveInstance(c)}var h=this;if(l.length){this._filter Fn&&(l=l.filter(function(e){return h._filterFn(r.getItem(e))})),l.sort(function( e,t){return h._sortFn(r.getItem(e),r.getItem(t))});var u=0;for(i=0;i<l.length;i+ +)u=this._insertRowUserSort(u,l[i])}},_insertRowUserSort:function(e,t){for(var n =this.collection,r=n.getItem(t),s=this._instances.length-1,i=-1;e<=s;){var o=e+s >>1,a=this._instances[o].__key__,l=this._sortFn(n.getItem(a),r);if(l<0)e=o+1;els e{if(!(l>0)){i=o;break}s=o-1}}return i<0&&(i=s+1),this._insertPlaceholder(i,t),i },_applySplicesArrayOrder:function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++){fo r(var r=0;r<t.removed.length;r++)this._detachAndRemoveInstance(t.index);for(r=0; r<t.addedKeys.length;r++)this._insertPlaceholder(t.index+r,t.addedKeys[r])}},_de tachInstance:function(e){var t=this._instances[e];if(!t.isPlaceholder){for(var n =0;n<t._children.length;n++){var r=t._children[n];Polymer.dom(t.root).appendChil d(r)}return t}},_attachInstance:function(e,t){var n=this._instances[e];n.isPlace holder||t.insertBefore(n.root,this)},_detachAndRemoveInstance:function(e){var t= this._detachInstance(e);t&&this._pool.push(t),this._instances.splice(e,1)},_inse rtPlaceholder:function(e,t){this._instances.splice(e,0,{isPlaceholder:!0,__key__ :t})},_stampInstance:function(e,t){var n={__key__:t};return n[this.as]=this.coll ection.getItem(t),n[this.indexAs]=e,this.stamp(n)},_insertInstance:function(e,t) {var n=this._pool.pop();n?(n.__setProperty(this.as,this.collection.getItem(t),!0 ),n.__setProperty("__key__",t,!0)):n=this._stampInstance(e,t);var r=this._instan ces[e+1],s=r&&!r.isPlaceholder?r._children[0]:this,i=Polymer.dom(this).parentNod e;return Polymer.dom(i).insertBefore(n.root,s),this._instances[e]=n,n},_downgrad eInstance:function(e,t){var n=this._detachInstance(e);return n&&this._pool.push( n),n={isPlaceholder:!0,__key__:t},this._instances[e]=n,n},_showHideChildren:func tion(e){for(var t=0;t<this._instances.length;t++)this._instances[t]._showHideChi ldren(e)},_forwardInstanceProp:function(e,t,n){if(t==this.as){var r;r=this._sort Fn||this._filterFn?this.items.indexOf(this.collection.getItem(e.__key__)):e[this .indexAs],this.set("items."+r,n)}},_forwardInstancePath:function(e,t,n){0===t.in dexOf(this.as+".")&&this._notifyPath("items."+e.__key__+"."+t.slice(this.as.leng th+1),n)},_forwardParentProp:function(e,t){for(var n,r=this._instances,s=0;s<r.l ength&&(n=r[s]);s++)n.isPlaceholder||n.__setProperty(e,t,!0)},_forwardParentPath :function(e,t){for(var n,r=this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPlac eholder||n._notifyPath(e,t,!0)},_forwardItemPath:function(e,t){if(this._keyToIns tIdx){var n=e.indexOf("."),r=e.substring(0,n<0?e.length:n),s=this._keyToInstIdx[ r],i=this._instances[s];i&&!i.isPlaceholder&&(n>=0?(e=this.as+"."+e.substring(n+ 1),i._notifyPath(e,t,!0)):i.__setProperty(this.as,t,!0))}},itemForElement:functi on(e){var t=this.modelForElement(e);return t&&t[this.as]},keyForElement:function (e){var t=this.modelForElement(e);return t&&t.__key__},indexForElement:function( e){var t=this.modelForElement(e);return t&&t[this.indexAs]}}),Polymer({is:"array -selector",_template:null,properties:{items:{type:Array,observer:"clearSelection "},multi:{type:Boolean,value:!1,observer:"clearSelection"},selected:{type:Object ,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}} ,clearSelection:function(){if(Array.isArray(this.selected))for(var e=0;e<this.se lected.length;e++)this.unlinkPaths("selected."+e);else this.unlinkPaths("selecte d"),this.unlinkPaths("selectedItem");this.multi?this.selected&&!this.selected.le ngth||(this.selected=[],this._selectedColl=Polymer.Collection.get(this.selected) ):(this.selected=null,this._selectedColl=null),this.selectedItem=null},isSelecte d:function(e){return this.multi?void 0!==this._selectedColl.getKey(e):this.selec ted==e},deselect:function(e){if(this.multi){if(this.isSelected(e)){var t=this._s electedColl.getKey(e);this.arrayDelete("selected",e),this.unlinkPaths("selected. "+t)}}else this.selected=null,this.selectedItem=null,this.unlinkPaths("selected" ),this.unlinkPaths("selectedItem")},select:function(e){var t=Polymer.Collection. get(this.items),n=t.getKey(e);if(this.multi)if(this.isSelected(e))this.toggle&&t his.deselect(e);else{this.push("selected",e);var r=this._selectedColl.getKey(e); this.linkPaths("selected."+r,"items."+n)}else this.toggle&&e==this.selected?this .deselect():(this.selected=e,this.selectedItem=e,this.linkPaths("selected","item s."+n),this.linkPaths("selectedItem","items."+n))}}),Polymer({is:"dom-if",extend s:"template",_template:null,properties:{if:{type:Boolean,value:!1,observer:"_que ueRender"},restamp:{type:Boolean,value:!1,observer:"_queueRender"}},behaviors:[P olymer.Templatizer],_queueRender:function(){this._debounceTemplate(this._render) },detached:function(){this.parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_ FRAGMENT_NODE||Polymer.Settings.hasShadow&&this.parentNode instanceof ShadowRoot )||this._teardownInstance()},attached:function(){this.if&&this.ctor&&this.async( this._ensureInstance)},render:function(){this._flushTemplates()},_render:functio n(){this.if?(this.ctor||this.templatize(this),this._ensureInstance(),this._showH ideChildren()):this.restamp&&this._teardownInstance(),!this.restamp&&this._insta nce&&this._showHideChildren(),this.if!=this._lastIf&&(this.fire("dom-change"),th is._lastIf=this.if)},_ensureInstance:function(){var e=Polymer.dom(this).parentNo de;if(e){var t=Polymer.dom(e);if(this._instance){var n=this._instance._children; if(n&&n.length){var r=Polymer.dom(this).previousSibling;if(r!==n[n.length-1])for (var s,i=0;i<n.length&&(s=n[i]);i++)t.insertBefore(s,this)}}else{this._instance= this.stamp();var o=this._instance.root;t.insertBefore(o,this)}}},_teardownInstan ce:function(){if(this._instance){var e=this._instance._children;if(e&&e.length)f or(var t,n=Polymer.dom(Polymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r+ +)n.removeChild(t);this._instance=null}},_showHideChildren:function(){var e=this .__hideTemplateChildren__||!this.if;this._instance&&this._instance._showHideChil dren(e)},_forwardParentProp:function(e,t){this._instance&&this._instance.__setPr operty(e,t,!0)},_forwardParentPath:function(e,t){this._instance&&this._instance. _notifyPath(e,t,!0)}}),Polymer({is:"dom-bind",extends:"template",_template:null, created:function(){var e=this;Polymer.RenderStatus.whenReady(function(){"loading "==document.readyState?document.addEventListener("DOMContentLoaded",function(){e ._markImportsReady()}):e._markImportsReady()})},_ensureReady:function(){this._re adied||this._readySelf()},_markImportsReady:function(){this._importsReady=!0,thi s._ensureReady()},_registerFeatures:function(){this._prepConstructor()},_insertC hildren:function(){var e=Polymer.dom(Polymer.dom(this).parentNode);e.insertBefor e(this.root,this)},_removeChildren:function(){if(this._children)for(var e=0;e<th is._children.length;e++)this.root.appendChild(this._children[e])},_initFeatures: function(){},_scopeElementClass:function(e,t){return this.dataHost?this.dataHost ._scopeElementClass(e,t):t},_configureInstanceProperties:function(){},_prepConfi gure:function(){var e={};for(var t in this._propertyEffects)e[t]=this[t];var n=t his._setupConfigure;this._setupConfigure=function(){n.call(this,e)}},attached:fu nction(){this._importsReady&&this.render()},detached:function(){this._removeChil dren()},render:function(){this._ensureReady(),this._children||(this._template=th is,this._prepAnnotations(),this._prepEffects(),this._prepBehaviors(),this._prepC onfigure(),this._prepBindings(),this._prepPropertyInfo(),Polymer.Base._initFeatu res.call(this),this._children=Polymer.TreeApi.arrayCopyChildNodes(this.root)),th is._insertChildren(),this.fire("dom-change")}})</script> <script> window.Swarmin gBehaviors = window.SwarmingBehaviors || {}; 4 },customStyle:null,getComputedStyleValue:function(e){return!i&&this._styleProper ties&&this._styleProperties[e]||getComputedStyle(this).getPropertyValue(e)},_set upStyleProperties:function(){this.customStyle={},this._styleCache=null,this._sty leProperties=null,this._scopeSelector=null,this._ownStyleProperties=null,this._c ustomStyle=null},_needsStyleProperties:function(){return Boolean(!i&&this._ownSt ylePropertyNames&&this._ownStylePropertyNames.length)},_validateApplyShim:functi on(){if(this.__applyShimInvalid){Polymer.ApplyShim.transform(this._styles,this._ _proto__);var e=n.elementStyles(this);if(s){var t=this._template.content.querySe lector("style");t&&(t.textContent=e)}else{var r=this._scopeStyle&&this._scopeSty le.nextSibling;r&&(r.textContent=e)}}},_beforeAttached:function(){this._scopeSel ector&&!this.__stylePropertiesInvalid||!this._needsStyleProperties()||(this.__st ylePropertiesInvalid=!1,this._updateStyleProperties())},_findStyleHost:function( ){for(var e,t=this;e=Polymer.dom(t).getOwnerRoot();){if(Polymer.isInstance(e.hos t))return e.host;t=e.host}return r},_updateStyleProperties:function(){var e,n=th is._findStyleHost();n._styleProperties||n._computeStyleProperties(),n._styleCach e||(n._styleCache=new Polymer.StyleCache);var r=t.propertyDataFromStyles(n._styl es,this),i=!this.__notStyleScopeCacheable;i&&(r.key.customStyle=this.customStyle ,e=n._styleCache.retrieve(this.is,r.key,this._styles));var a=Boolean(e);a?this._ styleProperties=e._styleProperties:this._computeStyleProperties(r.properties),th is._computeOwnStyleProperties(),a||(e=o.retrieve(this.is,this._ownStylePropertie s,this._styles));var l=Boolean(e)&&!a,c=this._applyStyleProperties(e);a||(c=c&&s ?c.cloneNode(!0):c,e={style:c,_scopeSelector:this._scopeSelector,_stylePropertie s:this._styleProperties},i&&(r.key.customStyle={},this.mixin(r.key.customStyle,t his.customStyle),n._styleCache.store(this.is,e,r.key,this._styles)),l||o.store(t his.is,Object.create(e),this._ownStyleProperties,this._styles))},_computeStylePr operties:function(e){var n=this._findStyleHost();n._styleProperties||n._computeS tyleProperties();var r=Object.create(n._styleProperties),s=t.hostAndRootProperti esForScope(this);this.mixin(r,s.hostProps),e=e||t.propertyDataFromStyles(n._styl es,this).properties,this.mixin(r,e),this.mixin(r,s.rootProps),t.mixinCustomStyle (r,this.customStyle),t.reify(r),this._styleProperties=r},_computeOwnStylePropert ies:function(){for(var e,t={},n=0;n<this._ownStylePropertyNames.length;n++)e=thi s._ownStylePropertyNames[n],t[e]=this._styleProperties[e];this._ownStyleProperti es=t},_scopeCount:0,_applyStyleProperties:function(e){var n=this._scopeSelector; this._scopeSelector=e?e._scopeSelector:this.is+"-"+this.__proto__._scopeCount++; var r=t.applyElementStyle(this,this._styleProperties,this._scopeSelector,e&&e.st yle);return s||t.applyElementScopeSelector(this,this._scopeSelector,n,this._scop eCssViaAttr),r},serializeValueToAttribute:function(t,n,r){if(r=r||this,"class"== =n&&!s){var i=r===this?this.domHost||this.dataHost:this;i&&(t=i._scopeElementCla ss(r,t))}r=this.shadyRoot&&this.shadyRoot._hasDistributed?Polymer.dom(r):r,e.cal l(this,t,n,r)},_scopeElementClass:function(e,t){return s||this._scopeCssViaAttr| |(t=(t?t+" ":"")+a+" "+this.is+(e._scopeSelector?" "+l+" "+e._scopeSelector:"")) ,t},updateStyles:function(e){e&&this.mixin(this.customStyle,e),i?t.updateNativeS tyleProperties(this,this.customStyle):(this.isAttached?this._needsStylePropertie s()?this._updateStyleProperties():this._styleProperties=null:this.__stylePropert iesInvalid=!0,this._styleCache&&this._styleCache.clear(),this._updateRootStyles( ))},_updateRootStyles:function(e){e=e||this.root;for(var t,n=Polymer.dom(e)._que ry(function(e){return e.shadyRoot||e.shadowRoot}),r=0,s=n.length;r<s&&(t=n[r]);r ++)t.updateStyles&&t.updateStyles()}}),Polymer.updateStyles=function(e){r.update Styles(e),Polymer.Base._updateRootStyles(document)};var o=new Polymer.StyleCache ;Polymer.customStyleCache=o;var a=n.SCOPE_NAME,l=t.XSCOPE_NAME}(),Polymer.Base._ addFeature({_registerFeatures:function(){this._prepIs(),this._prepConstructor(), this._prepStyles()},_finishRegisterFeatures:function(){this._prepTemplate(),this ._prepShimStyles(),this._prepAnnotations(),this._prepEffects(),this._prepBehavio rs(),this._prepPropertyInfo(),this._prepBindings(),this._prepShady()},_prepBehav ior:function(e){this._addPropertyEffects(e.properties),this._addComplexObserverE ffects(e.observers),this._addHostAttributes(e.hostAttributes)},_initFeatures:fun ction(){this._setupGestures(),this._setupConfigure(),this._setupStyleProperties( ),this._setupDebouncers(),this._setupShady(),this._registerHost(),this._template &&(this._validateApplyShim(),this._poolContent(),this._beginHosting(),this._stam pTemplate(),this._endHosting(),this._marshalAnnotationReferences()),this._marsha lInstanceEffects(),this._marshalBehaviors(),this._marshalHostAttributes(),this._ marshalAttributes(),this._tryReady()},_marshalBehavior:function(e){e.listeners&& this._listenListeners(e.listeners)}}),function(){var e,t=Polymer.StyleProperties ,n=Polymer.StyleUtil,r=Polymer.CssParse,s=Polymer.StyleDefaults,i=Polymer.StyleT ransformer,o=Polymer.ApplyShim,a=Polymer.Debounce,l=Polymer.Settings;Polymer({is :"custom-style",extends:"style",_template:null,properties:{include:String},ready :function(){this.__appliedElement=this.__appliedElement||this,this.__cssBuild=n. getCssBuildType(this),this.__appliedElement!==this&&(this.__appliedElement.__css Build=this.__cssBuild),this._tryApply()},attached:function(){this._tryApply()},_ tryApply:function(){if(!this._appliesToDocument&&this.parentNode&&"dom-module"!= =this.parentNode.localName){this._appliesToDocument=!0;var e=this.__appliedEleme nt;if(l.useNativeCSSProperties||(this.__needsUpdateStyles=s.hasStyleProperties() ,s.addStyle(e)),e.textContent||this.include)this._apply(!0);else{var t=this,n=ne w MutationObserver(function(){n.disconnect(),t._apply(!0)});n.observe(e,{childLi st:!0})}}},_updateStyles:function(){Polymer.updateStyles()},_apply:function(e){v ar t=this.__appliedElement;if(this.include&&(t.textContent=n.cssFromModules(this .include,!0)+t.textContent),t.textContent){var r=this.__cssBuild,s=n.isTargetedB uild(r);if(!l.useNativeCSSProperties||!s){var a=n.rulesForStyle(t);if(s||(n.forE achRule(a,function(e){i.documentRule(e)}),l.useNativeCSSProperties&&!r&&o.transf orm([t])),l.useNativeCSSProperties)t.textContent=n.toCssText(a);else{var c=this, h=function(){c._flushCustomProperties()};e?Polymer.RenderStatus.whenReady(h):h() }}}},_flushCustomProperties:function(){this.__needsUpdateStyles?(this.__needsUpd ateStyles=!1,e=a(e,this._updateStyles)):this._applyCustomProperties()},_applyCus tomProperties:function(){var e=this.__appliedElement;this._computeStylePropertie s();var s=this._styleProperties,i=n.rulesForStyle(e);i&&(e.textContent=n.toCssTe xt(i,function(e){var n=e.cssText=e.parsedCssText;e.propertyInfo&&e.propertyInfo. cssText&&(n=r.removeCustomPropAssignment(n),e.cssText=t.valueForProperties(n,s)) }))}})}(),Polymer.Templatizer={properties:{__hideTemplateChildren__:{observer:"_ showHideChildren"}},_instanceProps:Polymer.nob,_parentPropPrefix:"_parent_",temp latize:function(e){if(this._templatized=e,e._content||(e._content=e.content),e._ content._ctor)return this.ctor=e._content._ctor,void this._prepParentProperties( this.ctor.prototype,e);var t=Object.create(Polymer.Base);this._customPrepAnnotat ions(t,e),this._prepParentProperties(t,e),t._prepEffects(),this._customPrepEffec ts(t),t._prepBehaviors(),t._prepPropertyInfo(),t._prepBindings(),t._notifyPathUp =this._notifyPathUpImpl,t._scopeElementClass=this._scopeElementClassImpl,t.liste n=this._listenImpl,t._showHideChildren=this._showHideChildrenImpl,t.__setPropert yOrig=this.__setProperty,t.__setProperty=this.__setPropertyImpl;var n=this._cons tructorImpl,r=function(e,t){n.call(this,e,t)};r.prototype=t,t.constructor=r,e._c ontent._ctor=r,this.ctor=r},_getRootDataHost:function(){return this.dataHost&&th is.dataHost._rootDataHost||this.dataHost},_showHideChildrenImpl:function(e){for( var t=this._children,n=0;n<t.length;n++){var r=t[n];Boolean(e)!=Boolean(r.__hide TemplateChildren__)&&(r.nodeType===Node.TEXT_NODE?e?(r.__polymerTextContent__=r. textContent,r.textContent=""):r.textContent=r.__polymerTextContent__:r.style&&(e ?(r.__polymerDisplay__=r.style.display,r.style.display="none"):r.style.display=r .__polymerDisplay__)),r.__hideTemplateChildren__=e}},__setPropertyImpl:function( e,t,n,r){r&&r.__hideTemplateChildren__&&"textContent"==e&&(e="__polymerTextConte nt__"),this.__setPropertyOrig(e,t,n,r)},_debounceTemplate:function(e){Polymer.do m.addDebouncer(this.debounce("_debounceTemplate",e))},_flushTemplates:function() {Polymer.dom.flush()},_customPrepEffects:function(e){var t=e._parentProps;for(va r n in t)e._addPropertyEffect(n,"function",this._createHostPropEffector(n));for( n in this._instanceProps)e._addPropertyEffect(n,"function",this._createInstanceP ropEffector(n))},_customPrepAnnotations:function(e,t){e._template=t;var n=t._con tent;if(!n._notes){var r=e._rootDataHost;r&&(Polymer.Annotations.prepElement=fun ction(){r._prepElement()}),n._notes=Polymer.Annotations.parseAnnotations(t),Poly mer.Annotations.prepElement=null,this._processAnnotations(n._notes)}e._notes=n._ notes,e._parentProps=n._parentProps},_prepParentProperties:function(e,t){var n=t his._parentProps=e._parentProps;if(this._forwardParentProp&&n){var r,s=e._parent PropProto;if(!s){for(r in this._instanceProps)delete n[r];s=e._parentPropProto=O bject.create(null),t!=this&&(Polymer.Bind.prepareModel(s),Polymer.Base.prepareMo delNotifyPath(s));for(r in n){var i=this._parentPropPrefix+r,o=[{kind:"function" ,effect:this._createForwardPropEffector(r),fn:Polymer.Bind._functionEffect},{kin d:"notify",fn:Polymer.Bind._notifyEffect,effect:{event:Polymer.CaseMap.camelToDa shCase(i)+"-changed"}}];Polymer.Bind._createAccessors(s,i,o)}}var a=this;t!=this &&(Polymer.Bind.prepareInstance(t),t._forwardParentProp=function(e,t){a._forward ParentProp(e,t)}),this._extendTemplate(t,s),t._pathEffector=function(e,t,n){retu rn a._pathEffectorImpl(e,t,n)}}},_createForwardPropEffector:function(e){return f unction(t,n){this._forwardParentProp(e,n)}},_createHostPropEffector:function(e){ var t=this._parentPropPrefix;return function(n,r){this.dataHost._templatized[t+e ]=r}},_createInstancePropEffector:function(e){return function(t,n,r,s){s||this.d ataHost._forwardInstanceProp(this,e,n)}},_extendTemplate:function(e,t){var n=Obj ect.getOwnPropertyNames(t);t._propertySetter&&(e._propertySetter=t._propertySett er);for(var r,s=0;s<n.length&&(r=n[s]);s++){var i=e[r],o=Object.getOwnPropertyDe scriptor(t,r);Object.defineProperty(e,r,o),void 0!==i&&e._propertySetter(r,i)}}, _showHideChildren:function(e){},_forwardInstancePath:function(e,t,n){},_forwardI nstanceProp:function(e,t,n){},_notifyPathUpImpl:function(e,t){var n=this.dataHos t,r=Polymer.Path.root(e);n._forwardInstancePath.call(n,this,e,t),r in n._parentP rops&&n._templatized._notifyPath(n._parentPropPrefix+e,t)},_pathEffectorImpl:fun ction(e,t,n){if(this._forwardParentPath&&0===e.indexOf(this._parentPropPrefix)){ var r=e.substring(this._parentPropPrefix.length),s=Polymer.Path.root(r);s in thi s._parentProps&&this._forwardParentPath(r,t)}Polymer.Base._pathEffector.call(thi s._templatized,e,t,n)},_constructorImpl:function(e,t){this._rootDataHost=t._getR ootDataHost(),this._setupConfigure(e),this._registerHost(t),this._beginHosting() ,this.root=this.instanceTemplate(this._template),this.root.__noContent=!this._no tes._hasContent,this.root.__styleScoped=!0,this._endHosting(),this._marshalAnnot atedNodes(),this._marshalInstanceEffects(),this._marshalAnnotatedListeners();for (var n=[],r=this.root.firstChild;r;r=r.nextSibling)n.push(r),r._templateInstance =this;this._children=n,t.__hideTemplateChildren__&&this._showHideChildren(!0),th is._tryReady()},_listenImpl:function(e,t,n){var r=this,s=this._rootDataHost,i=s. _createEventHandler(e,t,n),o=function(e){e.model=r,i(e)};s._listen(e,t,o)},_scop eElementClassImpl:function(e,t){var n=this._rootDataHost;return n?n._scopeElemen tClass(e,t):t},stamp:function(e){if(e=e||{},this._parentProps){var t=this._templ atized;for(var n in this._parentProps)void 0===e[n]&&(e[n]=t[this._parentPropPre fix+n])}return new this.ctor(e,this)},modelForElement:function(e){for(var t;e;)i f(t=e._templateInstance){if(t.dataHost==this)return t;e=t.dataHost}else e=e.pare ntNode}},Polymer({is:"dom-template",extends:"template",_template:null,behaviors: [Polymer.Templatizer],ready:function(){this.templatize(this)}}),Polymer._collect ions=new WeakMap,Polymer.Collection=function(e){Polymer._collections.set(e,this) ,this.userArray=e,this.store=e.slice(),this.initMap()},Polymer.Collection.protot ype={constructor:Polymer.Collection,initMap:function(){for(var e=this.omap=new W eakMap,t=this.pmap={},n=this.store,r=0;r<n.length;r++){var s=n[r];s&&"object"==t ypeof s?e.set(s,r):t[s]=r}},add:function(e){var t=this.store.push(e)-1;return e& &"object"==typeof e?this.omap.set(e,t):this.pmap[e]=t,"#"+t},removeKey:function( e){(e=this._parseKey(e))&&(this._removeFromMap(this.store[e]),delete this.store[ e])},_removeFromMap:function(e){e&&"object"==typeof e?this.omap.delete(e):delete this.pmap[e]},remove:function(e){var t=this.getKey(e);return this.removeKey(t), t},getKey:function(e){var t;if(t=e&&"object"==typeof e?this.omap.get(e):this.pma p[e],void 0!=t)return"#"+t},getKeys:function(){return Object.keys(this.store).ma p(function(e){return"#"+e})},_parseKey:function(e){if(e&&"#"==e[0])return e.slic e(1)},setItem:function(e,t){if(e=this._parseKey(e)){var n=this.store[e];n&&this. _removeFromMap(n),t&&"object"==typeof t?this.omap.set(t,e):this.pmap[t]=e,this.s tore[e]=t}},getItem:function(e){if(e=this._parseKey(e))return this.store[e]},get Items:function(){var e=[],t=this.store;for(var n in t)e.push(t[n]);return e},_ap plySplices:function(e){for(var t,n,r={},s=0;s<e.length&&(n=e[s]);s++){n.addedKey s=[];for(var i=0;i<n.removed.length;i++)t=this.getKey(n.removed[i]),r[t]=r[t]?nu ll:-1;for(i=0;i<n.addedCount;i++){var o=this.userArray[n.index+i];t=this.getKey( o),t=void 0===t?this.add(o):t,r[t]=r[t]?null:1,n.addedKeys.push(t)}}var a=[],l=[ ];for(t in r)r[t]<0&&(this.removeKey(t),a.push(t)),r[t]>0&&l.push(t);return[{rem oved:a,added:l}]}},Polymer.Collection.get=function(e){return Polymer._collection s.get(e)||new Polymer.Collection(e)},Polymer.Collection.applySplices=function(e, t){var n=Polymer._collections.get(e);return n?n._applySplices(t):null},Polymer({ is:"dom-repeat",extends:"template",_template:null,properties:{items:{type:Array} ,as:{type:String,value:"item"},indexAs:{type:String,value:"index"},sort:{type:Fu nction,observer:"_sortChanged"},filter:{type:Function,observer:"_filterChanged"} ,observe:{type:String,observer:"_observeChanged"},delay:Number,renderedItemCount :{type:Number,notify:!0,readOnly:!0},initialCount:{type:Number,observer:"_initia lizeChunking"},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Num ber,computed:"_computeFrameTime(targetFramerate)"}},behaviors:[Polymer.Templatiz er],observers:["_itemsChanged(items.*)"],created:function(){this._instances=[],t his._pool=[],this._limit=1/0;var e=this;this._boundRenderChunk=function(){e._ren derChunk()}},detached:function(){this.__isDetached=!0;for(var e=0;e<this._instan ces.length;e++)this._detachInstance(e)},attached:function(){if(this.__isDetached ){this.__isDetached=!1;for(var e=Polymer.dom(Polymer.dom(this).parentNode),t=0;t <this._instances.length;t++)this._attachInstance(t,e)}},ready:function(){this._i nstanceProps={__key__:!0},this._instanceProps[this.as]=!0,this._instanceProps[th is.indexAs]=!0,this.ctor||this.templatize(this)},_sortChanged:function(e){var t= this._getRootDataHost();this._sortFn=e&&("function"==typeof e?e:function(){retur n t[e].apply(t,arguments)}),this._needFullRefresh=!0,this.items&&this._debounceT emplate(this._render)},_filterChanged:function(e){var t=this._getRootDataHost(); this._filterFn=e&&("function"==typeof e?e:function(){return t[e].apply(t,argumen ts)}),this._needFullRefresh=!0,this.items&&this._debounceTemplate(this._render)} ,_computeFrameTime:function(e){return Math.ceil(1e3/e)},_initializeChunking:func tion(){this.initialCount&&(this._limit=this.initialCount,this._chunkCount=this.i nitialCount,this._lastChunkTime=performance.now())},_tryRenderChunk:function(){t his.items&&this._limit<this.items.length&&this.debounce("renderChunk",this._requ estRenderChunk)},_requestRenderChunk:function(){requestAnimationFrame(this._boun dRenderChunk)},_renderChunk:function(){var e=performance.now(),t=this._targetFra meTime/(e-this._lastChunkTime);this._chunkCount=Math.round(this._chunkCount*t)|| 1,this._limit+=this._chunkCount,this._lastChunkTime=e,this._debounceTemplate(thi s._render)},_observeChanged:function(){this._observePaths=this.observe&&this.obs erve.replace(".*",".").split(" ")},_itemsChanged:function(e){if("items"==e.path) Array.isArray(this.items)?this.collection=Polymer.Collection.get(this.items):thi s.items?this._error(this._logf("dom-repeat","expected array for `items`, found", this.items)):this.collection=null,this._keySplices=[],this._indexSplices=[],this ._needFullRefresh=!0,this._initializeChunking(),this._debounceTemplate(this._ren der);else if("items.splices"==e.path)this._keySplices=this._keySplices.concat(e. value.keySplices),this._indexSplices=this._indexSplices.concat(e.value.indexSpli ces),this._debounceTemplate(this._render);else{var t=e.path.slice(6);this._forwa rdItemPath(t,e.value),this._checkObservedPaths(t)}},_checkObservedPaths:function (e){if(this._observePaths){e=e.substring(e.indexOf(".")+1);for(var t=this._obser vePaths,n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return this._needFullRefresh=! 0,void(this.delay?this.debounce("render",this._render,this.delay):this._debounce Template(this._render))}},render:function(){this._needFullRefresh=!0,this._debou nceTemplate(this._render),this._flushTemplates()},_render:function(){this._needF ullRefresh?(this._applyFullRefresh(),this._needFullRefresh=!1):this._keySplices. length&&(this._sortFn?this._applySplicesUserSort(this._keySplices):this._filterF n?this._applyFullRefresh():this._applySplicesArrayOrder(this._indexSplices)),thi s._keySplices=[],this._indexSplices=[];for(var e=this._keyToInstIdx={},t=this._i nstances.length-1;t>=0;t--){var n=this._instances[t];n.isPlaceholder&&t<this._li mit?n=this._insertInstance(t,n.__key__):!n.isPlaceholder&&t>=this._limit&&(n=thi s._downgradeInstance(t,n.__key__)),e[n.__key__]=t,n.isPlaceholder||n.__setProper ty(this.indexAs,t,!0)}this._pool.length=0,this._setRenderedItemCount(this._insta nces.length),this.fire("dom-change"),this._tryRenderChunk()},_applyFullRefresh:f unction(){var e,t=this.collection;if(this._sortFn)e=t?t.getKeys():[];else{e=[];v ar n=this.items;if(n)for(var r=0;r<n.length;r++)e.push(t.getKey(n[r]))}var s=thi s;for(this._filterFn&&(e=e.filter(function(e){return s._filterFn(t.getItem(e))}) ),this._sortFn&&e.sort(function(e,n){return s._sortFn(t.getItem(e),t.getItem(n)) }),r=0;r<e.length;r++){var i=e[r],o=this._instances[r];o?(o.__key__=i,!o.isPlace holder&&r<this._limit&&o.__setProperty(this.as,t.getItem(i),!0)):r<this._limit?t his._insertInstance(r,i):this._insertPlaceholder(r,i)}for(var a=this._instances. length-1;a>=r;a--)this._detachAndRemoveInstance(a)},_numericSort:function(e,t){r eturn e-t},_applySplicesUserSort:function(e){for(var t,n,r=this.collection,s={}, i=0;i<e.length&&(n=e[i]);i++){for(var o=0;o<n.removed.length;o++)t=n.removed[o], s[t]=s[t]?null:-1;for(o=0;o<n.added.length;o++)t=n.added[o],s[t]=s[t]?null:1}var a=[],l=[];for(t in s)s[t]===-1&&a.push(this._keyToInstIdx[t]),1===s[t]&&l.push( t);if(a.length)for(a.sort(this._numericSort),i=a.length-1;i>=0;i--){var c=a[i];v oid 0!==c&&this._detachAndRemoveInstance(c)}var h=this;if(l.length){this._filter Fn&&(l=l.filter(function(e){return h._filterFn(r.getItem(e))})),l.sort(function( e,t){return h._sortFn(r.getItem(e),r.getItem(t))});var u=0;for(i=0;i<l.length;i+ +)u=this._insertRowUserSort(u,l[i])}},_insertRowUserSort:function(e,t){for(var n =this.collection,r=n.getItem(t),s=this._instances.length-1,i=-1;e<=s;){var o=e+s >>1,a=this._instances[o].__key__,l=this._sortFn(n.getItem(a),r);if(l<0)e=o+1;els e{if(!(l>0)){i=o;break}s=o-1}}return i<0&&(i=s+1),this._insertPlaceholder(i,t),i },_applySplicesArrayOrder:function(e){for(var t,n=0;n<e.length&&(t=e[n]);n++){fo r(var r=0;r<t.removed.length;r++)this._detachAndRemoveInstance(t.index);for(r=0; r<t.addedKeys.length;r++)this._insertPlaceholder(t.index+r,t.addedKeys[r])}},_de tachInstance:function(e){var t=this._instances[e];if(!t.isPlaceholder){for(var n =0;n<t._children.length;n++){var r=t._children[n];Polymer.dom(t.root).appendChil d(r)}return t}},_attachInstance:function(e,t){var n=this._instances[e];n.isPlace holder||t.insertBefore(n.root,this)},_detachAndRemoveInstance:function(e){var t= this._detachInstance(e);t&&this._pool.push(t),this._instances.splice(e,1)},_inse rtPlaceholder:function(e,t){this._instances.splice(e,0,{isPlaceholder:!0,__key__ :t})},_stampInstance:function(e,t){var n={__key__:t};return n[this.as]=this.coll ection.getItem(t),n[this.indexAs]=e,this.stamp(n)},_insertInstance:function(e,t) {var n=this._pool.pop();n?(n.__setProperty(this.as,this.collection.getItem(t),!0 ),n.__setProperty("__key__",t,!0)):n=this._stampInstance(e,t);var r=this._instan ces[e+1],s=r&&!r.isPlaceholder?r._children[0]:this,i=Polymer.dom(this).parentNod e;return Polymer.dom(i).insertBefore(n.root,s),this._instances[e]=n,n},_downgrad eInstance:function(e,t){var n=this._detachInstance(e);return n&&this._pool.push( n),n={isPlaceholder:!0,__key__:t},this._instances[e]=n,n},_showHideChildren:func tion(e){for(var t=0;t<this._instances.length;t++)this._instances[t]._showHideChi ldren(e)},_forwardInstanceProp:function(e,t,n){if(t==this.as){var r;r=this._sort Fn||this._filterFn?this.items.indexOf(this.collection.getItem(e.__key__)):e[this .indexAs],this.set("items."+r,n)}},_forwardInstancePath:function(e,t,n){0===t.in dexOf(this.as+".")&&this._notifyPath("items."+e.__key__+"."+t.slice(this.as.leng th+1),n)},_forwardParentProp:function(e,t){for(var n,r=this._instances,s=0;s<r.l ength&&(n=r[s]);s++)n.isPlaceholder||n.__setProperty(e,t,!0)},_forwardParentPath :function(e,t){for(var n,r=this._instances,s=0;s<r.length&&(n=r[s]);s++)n.isPlac eholder||n._notifyPath(e,t,!0)},_forwardItemPath:function(e,t){if(this._keyToIns tIdx){var n=e.indexOf("."),r=e.substring(0,n<0?e.length:n),s=this._keyToInstIdx[ r],i=this._instances[s];i&&!i.isPlaceholder&&(n>=0?(e=this.as+"."+e.substring(n+ 1),i._notifyPath(e,t,!0)):i.__setProperty(this.as,t,!0))}},itemForElement:functi on(e){var t=this.modelForElement(e);return t&&t[this.as]},keyForElement:function (e){var t=this.modelForElement(e);return t&&t.__key__},indexForElement:function( e){var t=this.modelForElement(e);return t&&t[this.indexAs]}}),Polymer({is:"array -selector",_template:null,properties:{items:{type:Array,observer:"clearSelection "},multi:{type:Boolean,value:!1,observer:"clearSelection"},selected:{type:Object ,notify:!0},selectedItem:{type:Object,notify:!0},toggle:{type:Boolean,value:!1}} ,clearSelection:function(){if(Array.isArray(this.selected))for(var e=0;e<this.se lected.length;e++)this.unlinkPaths("selected."+e);else this.unlinkPaths("selecte d"),this.unlinkPaths("selectedItem");this.multi?this.selected&&!this.selected.le ngth||(this.selected=[],this._selectedColl=Polymer.Collection.get(this.selected) ):(this.selected=null,this._selectedColl=null),this.selectedItem=null},isSelecte d:function(e){return this.multi?void 0!==this._selectedColl.getKey(e):this.selec ted==e},deselect:function(e){if(this.multi){if(this.isSelected(e)){var t=this._s electedColl.getKey(e);this.arrayDelete("selected",e),this.unlinkPaths("selected. "+t)}}else this.selected=null,this.selectedItem=null,this.unlinkPaths("selected" ),this.unlinkPaths("selectedItem")},select:function(e){var t=Polymer.Collection. get(this.items),n=t.getKey(e);if(this.multi)if(this.isSelected(e))this.toggle&&t his.deselect(e);else{this.push("selected",e);var r=this._selectedColl.getKey(e); this.linkPaths("selected."+r,"items."+n)}else this.toggle&&e==this.selected?this .deselect():(this.selected=e,this.selectedItem=e,this.linkPaths("selected","item s."+n),this.linkPaths("selectedItem","items."+n))}}),Polymer({is:"dom-if",extend s:"template",_template:null,properties:{if:{type:Boolean,value:!1,observer:"_que ueRender"},restamp:{type:Boolean,value:!1,observer:"_queueRender"}},behaviors:[P olymer.Templatizer],_queueRender:function(){this._debounceTemplate(this._render) },detached:function(){this.parentNode&&(this.parentNode.nodeType!=Node.DOCUMENT_ FRAGMENT_NODE||Polymer.Settings.hasShadow&&this.parentNode instanceof ShadowRoot )||this._teardownInstance()},attached:function(){this.if&&this.ctor&&this.async( this._ensureInstance)},render:function(){this._flushTemplates()},_render:functio n(){this.if?(this.ctor||this.templatize(this),this._ensureInstance(),this._showH ideChildren()):this.restamp&&this._teardownInstance(),!this.restamp&&this._insta nce&&this._showHideChildren(),this.if!=this._lastIf&&(this.fire("dom-change"),th is._lastIf=this.if)},_ensureInstance:function(){var e=Polymer.dom(this).parentNo de;if(e){var t=Polymer.dom(e);if(this._instance){var n=this._instance._children; if(n&&n.length){var r=Polymer.dom(this).previousSibling;if(r!==n[n.length-1])for (var s,i=0;i<n.length&&(s=n[i]);i++)t.insertBefore(s,this)}}else{this._instance= this.stamp();var o=this._instance.root;t.insertBefore(o,this)}}},_teardownInstan ce:function(){if(this._instance){var e=this._instance._children;if(e&&e.length)f or(var t,n=Polymer.dom(Polymer.dom(e[0]).parentNode),r=0;r<e.length&&(t=e[r]);r+ +)n.removeChild(t);this._instance=null}},_showHideChildren:function(){var e=this .__hideTemplateChildren__||!this.if;this._instance&&this._instance._showHideChil dren(e)},_forwardParentProp:function(e,t){this._instance&&this._instance.__setPr operty(e,t,!0)},_forwardParentPath:function(e,t){this._instance&&this._instance. _notifyPath(e,t,!0)}}),Polymer({is:"dom-bind",extends:"template",_template:null, created:function(){var e=this;Polymer.RenderStatus.whenReady(function(){"loading "==document.readyState?document.addEventListener("DOMContentLoaded",function(){e ._markImportsReady()}):e._markImportsReady()})},_ensureReady:function(){this._re adied||this._readySelf()},_markImportsReady:function(){this._importsReady=!0,thi s._ensureReady()},_registerFeatures:function(){this._prepConstructor()},_insertC hildren:function(){var e=Polymer.dom(Polymer.dom(this).parentNode);e.insertBefor e(this.root,this)},_removeChildren:function(){if(this._children)for(var e=0;e<th is._children.length;e++)this.root.appendChild(this._children[e])},_initFeatures: function(){},_scopeElementClass:function(e,t){return this.dataHost?this.dataHost ._scopeElementClass(e,t):t},_configureInstanceProperties:function(){},_prepConfi gure:function(){var e={};for(var t in this._propertyEffects)e[t]=this[t];var n=t his._setupConfigure;this._setupConfigure=function(){n.call(this,e)}},attached:fu nction(){this._importsReady&&this.render()},detached:function(){this._removeChil dren()},render:function(){this._ensureReady(),this._children||(this._template=th is,this._prepAnnotations(),this._prepEffects(),this._prepBehaviors(),this._prepC onfigure(),this._prepBindings(),this._prepPropertyInfo(),Polymer.Base._initFeatu res.call(this),this._children=Polymer.TreeApi.arrayCopyChildNodes(this.root)),th is._insertChildren(),this.fire("dom-change")}})</script> <script> window.Swarmin gBehaviors = window.SwarmingBehaviors || {};
5 (function(){ 5 (function(){
6 // This behavior wraps up all the shared swarming functionality. 6 // This behavior wraps up all the shared swarming functionality.
7 SwarmingBehaviors.CommonBehavior = { 7 SwarmingBehaviors.CommonBehavior = {
8 8
9 _botLink: function(bot_id) { 9 _botLink: function(bot_id) {
10 if (!bot_id) { 10 if (!bot_id) {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 sk.errorMessage("Could not get next set of results. Try reloading the page?", 0); 343 sk.errorMessage("Could not get next set of results. Try reloading the page?", 0);
344 this.set("busy", false); 344 this.set("busy", false);
345 }.bind(this)); 345 }.bind(this));
346 }, 346 },
347 347
348 _noMore: function(cursor) { 348 _noMore: function(cursor) {
349 return cursor === END; 349 return cursor === END;
350 } 350 }
351 }); 351 });
352 })(); </script> </dom-module><script>Polymer({is:"iron-a11y-keys",behaviors:[P olymer.IronA11yKeysBehavior],properties:{target:{type:Object,observer:"_targetCh anged"},keys:{type:String,reflectToAttribute:!0,observer:"_keysChanged"}},attach ed:function(){this.target||(this.target=this.parentNode)},_targetChanged:functio n(e){this.keyEventTarget=e},_keysChanged:function(){this.removeOwnKeyBindings(), this.addOwnKeyBinding(this.keys,"_fireKeysPressed")},_fireKeysPressed:function(e ){this.fire("keys-pressed",e.detail,{})}})</script> <script>Polymer({is:"iron-se lector",behaviors:[Polymer.IronMultiSelectableBehavior]})</script> <script>Polym er.IronValidatableBehaviorMeta=null,Polymer.IronValidatableBehavior={properties: {validator:{type:String},invalid:{notify:!0,reflectToAttribute:!0,type:Boolean,v alue:!1},_validatorMeta:{type:Object},validatorType:{type:String,value:"validato r"},_validator:{type:Object,computed:"__computeValidator(validator)"}},observers :["_invalidChanged(invalid)"],registered:function(){Polymer.IronValidatableBehav iorMeta=new Polymer.IronMeta({type:"validator"})},_invalidChanged:function(){thi s.invalid?this.setAttribute("aria-invalid","true"):this.removeAttribute("aria-in valid")},hasValidator:function(){return null!=this._validator},validate:function (a){return this.invalid=!this._getValidity(a),!this.invalid},_getValidity:functi on(a){return!this.hasValidator()||this._validator.validate(a)},__computeValidato r:function(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatable BehaviorMeta.byKey(this.validator)}}</script> <script>Polymer.IronFormElementBeh avior={properties:{name:{type:String},value:{notify:!0,type:String},required:{ty pe:Boolean,value:!1},_parentForm:{type:Object}},attached:function(){this.fire("i ron-form-element-register")},detached:function(){this._parentForm&&this._parentF orm.fire("iron-form-element-unregister",{target:this})}}</script> <script>Polyme r.IronCheckedElementBehaviorImpl={properties:{checked:{type:Boolean,value:!1,ref lectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,v alue:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueCha nged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIro nCheckedElementBehavior=!0},_getValidity:function(e){return this.disabled||!this .required||this.checked},_requiredChanged:function(){this.required?this.setAttri bute("aria-required","true"):this.removeAttribute("aria-required")},_checkedChan ged:function(){this.active=this.checked,this.fire("iron-change")},_valueChanged: function(){void 0!==this.value&&null!==this.value||(this.value="on")}},Polymer.I ronCheckedElementBehavior=[Polymer.IronFormElementBehavior,Polymer.IronValidatab leBehavior,Polymer.IronCheckedElementBehaviorImpl]</script> <script>Polymer.Pape rCheckedElementBehaviorImpl={_checkedChanged:function(){Polymer.IronCheckedEleme ntBehaviorImpl._checkedChanged.call(this),this.hasRipple()&&(this.checked?this._ ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_but tonStateChanged:function(){Polymer.PaperRippleBehavior._buttonStateChanged.call( this),this.disabled||this.isAttached&&(this.checked=this.active)}},Polymer.Paper CheckedElementBehavior=[Polymer.PaperInkyFocusBehavior,Polymer.IronCheckedElemen tBehavior,Polymer.PaperCheckedElementBehaviorImpl]</script> <dom-module id="pape r-checkbox" assetpath="/res/imp/bower_components/paper-checkbox/"> <template str ip-whitespace=""> <style>:host{display:inline-block;white-space:nowrap;cursor:po inter;--calculated-paper-checkbox-size:var(--paper-checkbox-size, 18px);--calcul ated-paper-checkbox-ink-size:var(--paper-checkbox-ink-size, -1px);@apply(--paper -font-common-base);line-height:0;-webkit-tap-highlight-color:transparent}:host([ hidden]){display:none!important}:host(:focus){outline:0}.hidden{display:none}#ch eckboxContainer{display:inline-block;position:relative;width:var(--calculated-pa per-checkbox-size);height:var(--calculated-paper-checkbox-size);min-width:var(-- calculated-paper-checkbox-size);margin:var(--paper-checkbox-margin,initial);vert ical-align:var(--paper-checkbox-vertical-align,middle);background-color:var(--pa per-checkbox-unchecked-background-color,transparent)}#ink{position:absolute;top: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-c heckbox-size))/ 2);left:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size))/ 2);width:var(--calculated-paper-checkbox -ink-size);height:var(--calculated-paper-checkbox-ink-size);color:var(--paper-ch eckbox-unchecked-ink-color,var(--primary-text-color));opacity:.6;pointer-events: none}:host-context([dir=rtl]) #ink{right:calc(0px - (var(--calculated-paper-chec kbox-ink-size) - var(--calculated-paper-checkbox-size))/ 2);left:auto}#ink[check ed]{color:var(--paper-checkbox-checked-ink-color,var(--primary-color))}#checkbox {position:relative;box-sizing:border-box;height:100%;border:solid 2px;border-col or:var(--paper-checkbox-unchecked-color,var(--primary-text-color));border-radius :2px;pointer-events:none;-webkit-transition:background-color 140ms,border-color 140ms;transition:background-color 140ms,border-color 140ms}#checkbox.checked #ch eckmark{-webkit-animation:checkmark-expand 140ms ease-out forwards;animation:che ckmark-expand 140ms ease-out forwards}@-webkit-keyframes checkmark-expand{0%{-we bkit-transform:scale(0,0) rotate(45deg)}100%{-webkit-transform:scale(1,1) rotate (45deg)}}@keyframes checkmark-expand{0%{transform:scale(0,0) rotate(45deg)}100%{ transform:scale(1,1) rotate(45deg)}}#checkbox.checked{background-color:var(--pap er-checkbox-checked-color,var(--primary-color));border-color:var(--paper-checkbo x-checked-color,var(--primary-color))}#checkmark{position:absolute;width:36%;hei ght:70%;border-style:solid;border-top:none;border-left:none;border-right-width:c alc(2/15 * var(--calculated-paper-checkbox-size));border-bottom-width:calc(2/15 * var(--calculated-paper-checkbox-size));border-color:var(--paper-checkbox-check mark-color,#fff);-webkit-transform-origin:97% 86%;transform-origin:97% 86%;box-s izing:content-box}:host-context([dir=rtl]) #checkmark{-webkit-transform-origin:5 0% 14%;transform-origin:50% 14%}#checkboxLabel{position:relative;display:inline- block;vertical-align:middle;padding-left:var(--paper-checkbox-label-spacing,8px) ;white-space:normal;line-height:normal;color:var(--paper-checkbox-label-color,va r(--primary-text-color));@apply(--paper-checkbox-label)}:host([checked]) #checkb oxLabel{color:var(--paper-checkbox-label-checked-color,var(--paper-checkbox-labe l-color,var(--primary-text-color)));@apply(--paper-checkbox-label-checked)}:host -context([dir=rtl]) #checkboxLabel{padding-right:var(--paper-checkbox-label-spac ing,8px);padding-left:0}#checkboxLabel[hidden]{display:none}:host([disabled]) #c heckbox{opacity:.5;border-color:var(--paper-checkbox-unchecked-color,var(--prima ry-text-color))}:host([disabled][checked]) #checkbox{background-color:var(--pape r-checkbox-unchecked-color,var(--primary-text-color));opacity:.5}:host([disabled ]) #checkboxLabel{opacity:.65}#checkbox.invalid:not(.checked){border-color:var(- -paper-checkbox-error-color,var(--error-color))}</style> <div id="checkboxContai ner"> <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> < div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> </div> </ div> <div id="checkboxLabel"><content></content></div> </template> <script>Polym er({is:"paper-checkbox",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttr ibutes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttr ibute:{type:String,value:"aria-checked"}},attached:function(){var e=this.getComp utedStyleValue("--calculated-paper-checkbox-ink-size");if("-1px"===e){var t=pars eFloat(this.getComputedStyleValue("--calculated-paper-checkbox-size")),a=Math.fl oor(8/3*t);a%2!==t%2&&a++,this.customStyle["--paper-checkbox-ink-size"]=a+"px",t his.updateStyles()}},_computeCheckboxClass:function(e,t){var a="";return e&&(a+= "checked "),t&&(a+="invalid"),a},_computeCheckmarkClass:function(e){return e?"": "hidden"},_createRipple:function(){return this._rippleContainer=this.$.checkboxC ontainer,Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)}})</script> </dom-module> <script>Polymer({is:"iron-input",extends:"input",behaviors:[Polym er.IronValidatableBehavior],properties:{bindValue:{observer:"_bindValueChanged", type:String},preventInvalidInput:{type:Boolean},allowedPattern:{type:String,obse rver:"_allowedPatternChanged"},_previousValidInput:{type:String,value:""},_patte rnAlreadyChecked:{type:Boolean,value:!1}},listeners:{input:"_onInput",keypress:" _onKeypress"},registered:function(){this._canDispatchEventOnDisabled()||(this._o rigDispatchEvent=this.dispatchEvent,this.dispatchEvent=this._dispatchEventFirefo xIE)},created:function(){Polymer.IronA11yAnnouncer.requestAvailability()},_canDi spatchEventOnDisabled:function(){var e=document.createElement("input"),t=!1;e.di sabled=!0,e.addEventListener("feature-check-dispatch-event",function(){t=!0});tr y{e.dispatchEvent(new Event("feature-check-dispatch-event"))}catch(e){}return t} ,_dispatchEventFirefoxIE:function(){var e=this.disabled;this.disabled=!1,this._o rigDispatchEvent.apply(this,arguments),this.disabled=e},get _patternRegExp(){var e;if(this.allowedPattern)e=new RegExp(this.allowedPattern);else switch(this.typ e){case"number":e=/[0-9.,e-]/}return e},ready:function(){this.bindValue=this.val ue},_bindValueChanged:function(){this.value!==this.bindValue&&(this.value=this.b indValue||0===this.bindValue||this.bindValue===!1?this.bindValue:""),this.fire(" bind-value-changed",{value:this.bindValue})},_allowedPatternChanged:function(){t his.preventInvalidInput=!!this.allowedPattern},_onInput:function(){if(this.preve ntInvalidInput&&!this._patternAlreadyChecked){var e=this._checkPatternValidity() ;e||(this._announceInvalidCharacter("Invalid string of characters not entered.") ,this.value=this._previousValidInput)}this.bindValue=this.value,this._previousVa lidInput=this.value,this._patternAlreadyChecked=!1},_isPrintable:function(e){var t=8==e.keyCode||9==e.keyCode||13==e.keyCode||27==e.keyCode,i=19==e.keyCode||20= =e.keyCode||45==e.keyCode||46==e.keyCode||144==e.keyCode||145==e.keyCode||e.keyC ode>32&&e.keyCode<41||e.keyCode>111&&e.keyCode<124;return!(t||0==e.charCode&&i)} ,_onKeypress:function(e){if(this.preventInvalidInput||"number"===this.type){var t=this._patternRegExp;if(t&&!(e.metaKey||e.ctrlKey||e.altKey)){this._patternAlre adyChecked=!0;var i=String.fromCharCode(e.charCode);this._isPrintable(e)&&!t.tes t(i)&&(e.preventDefault(),this._announceInvalidCharacter("Invalid character "+i+ " not entered."))}}},_checkPatternValidity:function(){var e=this._patternRegExp; if(!e)return!0;for(var t=0;t<this.value.length;t++)if(!e.test(this.value[t]))ret urn!1;return!0},validate:function(){var e=this.checkValidity();return e&&(this.r equired&&""===this.value?e=!1:this.hasValidator()&&(e=Polymer.IronValidatableBeh avior.validate.call(this,this.value))),this.invalid=!e,this.fire("iron-input-val idate"),e},_announceInvalidCharacter:function(e){this.fire("iron-announce",{text :e})}})</script> <script>Polymer.PaperInputHelper={},Polymer.PaperInputHelper.Ne xtLabelID=1,Polymer.PaperInputHelper.NextAddonID=1,Polymer.PaperInputBehaviorImp l={properties:{label:{type:String},value:{notify:!0,type:String},disabled:{type: Boolean,value:!1},invalid:{type:Boolean,value:!1,notify:!0},preventInvalidInput: {type:Boolean},allowedPattern:{type:String},type:{type:String},list:{type:String },pattern:{type:String},required:{type:Boolean,value:!1},errorMessage:{type:Stri ng},charCounter:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1},alw aysFloatLabel:{type:Boolean,value:!1},autoValidate:{type:Boolean,value:!1},valid ator:{type:String},autocomplete:{type:String,value:"off"},autofocus:{type:Boolea n,observer:"_autofocusChanged"},inputmode:{type:String},minlength:{type:Number}, maxlength:{type:Number},min:{type:String},max:{type:String},step:{type:String},n ame:{type:String},placeholder:{type:String,value:""},readonly:{type:Boolean,valu e:!1},size:{type:Number},autocapitalize:{type:String,value:"none"},autocorrect:{ type:String,value:"off"},autosave:{type:String},results:{type:Number},accept:{ty pe:String},multiple:{type:Boolean},_ariaDescribedBy:{type:String,value:""},_aria LabelledBy:{type:String,value:""}},listeners:{"addon-attached":"_onAddonAttached "},keyBindings:{"shift+tab:keydown":"_onShiftTabDown"},hostAttributes:{tabindex: 0},get inputElement(){return this.$.input},get _focusableElement(){return this.i nputElement},registered:function(){this._typesThatHaveText=["date","datetime","d atetime-local","month","time","week","file"]},attached:function(){this._updateAr iaLabelledBy(),this.inputElement&&this._typesThatHaveText.indexOf(this.inputElem ent.type)!==-1&&(this.alwaysFloatLabel=!0)},_appendStringWithSpace:function(e,t) {return e=e?e+" "+t:t},_onAddonAttached:function(e){var t=e.path?e.path[0]:e.tar get;if(t.id)this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribe dBy,t.id);else{var a="paper-input-add-on-"+Polymer.PaperInputHelper.NextAddonID+ +;t.id=a,this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy ,a)}},validate:function(){return this.inputElement.validate()},_focusBlurHandler :function(e){Polymer.IronControlState._focusBlurHandler.call(this,e),this.focuse d&&!this._shiftTabPressed&&this._focusableElement.focus()},_onShiftTabDown:funct ion(e){var t=this.getAttribute("tabindex");this._shiftTabPressed=!0,this.setAttr ibute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),thi s._shiftTabPressed=!1},1)},_handleAutoValidate:function(){this.autoValidate&&thi s.validate()},updateValueAndPreserveCaret:function(e){try{var t=this.inputElemen t.selectionStart;this.value=e,this.inputElement.selectionStart=t,this.inputEleme nt.selectionEnd=t}catch(t){this.value=e}},_computeAlwaysFloatLabel:function(e,t) {return t||e},_updateAriaLabelledBy:function(){var e=Polymer.dom(this.root).quer ySelector("label");if(!e)return void(this._ariaLabelledBy="");var t;e.id?t=e.id: (t="paper-input-label-"+Polymer.PaperInputHelper.NextLabelID++,e.id=t),this._ari aLabelledBy=t},_onChange:function(e){this.shadowRoot&&this.fire(e.type,{sourceEv ent:e},{node:this,bubbles:e.bubbles,cancelable:e.cancelable})},_autofocusChanged :function(){if(this.autofocus&&this._focusableElement){var e=document.activeElem ent,t=e instanceof HTMLElement,a=t&&e!==document.body&&e!==document.documentElem ent;a||this._focusableElement.focus()}}},Polymer.PaperInputBehavior=[Polymer.Iro nControlState,Polymer.IronA11yKeysBehavior,Polymer.PaperInputBehaviorImpl]</scri pt> <script>Polymer.PaperInputAddonBehavior={hostAttributes:{"add-on":""},attach ed:function(){this.fire("addon-attached")},update:function(t){}}</script> <dom-m odule id="paper-input-char-counter" assetpath="/res/imp/bower_components/paper-i nput/"> <template> <style>:host{display:inline-block;float:right;@apply(--paper- font-caption);@apply(--paper-input-char-counter)}:host([hidden]){display:none!im portant}:host-context([dir=rtl]){float:left}</style> <span>[[_charCounterStr]]</ span> </template> </dom-module> <script>Polymer({is:"paper-input-char-counter",b ehaviors:[Polymer.PaperInputAddonBehavior],properties:{_charCounterStr:{type:Str ing,value:"0"}},update:function(t){if(t.inputElement){t.value=t.value||"";var e= t.value.toString().length.toString();t.inputElement.hasAttribute("maxlength")&&( e+="/"+t.inputElement.getAttribute("maxlength")),this._charCounterStr=e}}})</scr ipt> <dom-module id="paper-input-container" assetpath="/res/imp/bower_components /paper-input/"> <template> <style>:host{display:block;padding:8px 0;@apply(--pap er-input-container)}:host([inline]){display:inline-block}:host([disabled]){point er-events:none;opacity:.33;@apply(--paper-input-container-disabled)}:host([hidde n]){display:none!important}.floated-label-placeholder{@apply(--paper-font-captio n)}.underline{position:relative}.focused-line{@apply(--layout-fit);background:va r(--paper-input-container-focus-color,--primary-color);height:2px;-webkit-transf orm-origin:center center;transform-origin:center center;-webkit-transform:scale3 d(0,1,1);transform:scale3d(0,1,1);@apply(--paper-input-container-underline-focus )}.underline.is-highlighted .focused-line{-webkit-transform:none;transform:none; -webkit-transition:-webkit-transform .25s;transition:transform .25s;@apply(--pap er-transition-easing)}.underline.is-invalid .focused-line{background:var(--paper -input-container-invalid-color,--error-color);-webkit-transform:none;transform:n one;-webkit-transition:-webkit-transform .25s;transition:transform .25s;@apply(- -paper-transition-easing)}.unfocused-line{@apply(--layout-fit);background:var(-- paper-input-container-color,--secondary-text-color);height:1px;@apply(--paper-in put-container-underline)}:host([disabled]) .unfocused-line{border-bottom:1px das hed;border-color:var(--paper-input-container-color,--secondary-text-color);backg round:0 0;@apply(--paper-input-container-underline-disabled)}.label-and-input-co ntainer{@apply(--layout-flex-auto);@apply(--layout-relative);width:100%;max-widt h:100%}.input-content{@apply(--layout-horizontal);@apply(--layout-center);positi on:relative}.input-content ::content .paper-input-label,.input-content ::content label{position:absolute;top:0;right:0;left:0;width:100%;font:inherit;color:var( --paper-input-container-color,--secondary-text-color);-webkit-transition:-webkit -transform .25s,width .25s;transition:transform .25s,width .25s;-webkit-transfor m-origin:left top;transform-origin:left top;@apply(--paper-font-common-nowrap);@ apply(--paper-font-subhead);@apply(--paper-input-container-label);@apply(--paper -transition-easing)}.input-content.label-is-floating ::content .paper-input-labe l,.input-content.label-is-floating ::content label{-webkit-transform:translateY( -75%) scale(.75);transform:translateY(-75%) scale(.75);width:133%;@apply(--paper -input-container-label-floating)}:host-context([dir=rtl]) .input-content.label-i s-floating ::content .paper-input-label,:host-context([dir=rtl]) .input-content. label-is-floating ::content label{width:100%;-webkit-transform-origin:right top; transform-origin:right top}.input-content.label-is-highlighted ::content .paper- input-label,.input-content.label-is-highlighted ::content label{color:var(--pape r-input-container-focus-color,--primary-color);@apply(--paper-input-container-la bel-focus)}.input-content.is-invalid ::content .paper-input-label,.input-content .is-invalid ::content label{color:var(--paper-input-container-invalid-color,--er ror-color)}.input-content.label-is-hidden ::content .paper-input-label,.input-co ntent.label-is-hidden ::content label{visibility:hidden}.input-content ::content .paper-input-input,.input-content ::content input,.input-content ::content iron -autogrow-textarea,.input-content ::content textarea{position:relative;outline:0 ;box-shadow:none;padding:0;width:100%;max-width:100%;background:0 0;border:none; color:var(--paper-input-container-input-color,--primary-text-color);-webkit-appe arance:none;text-align:inherit;vertical-align:bottom;@apply(--paper-font-subhead );@apply(--paper-input-container-input)}::content [prefix]{@apply(--paper-font-s ubhead);@apply(--paper-input-prefix);@apply(--layout-flex-none)}::content [suffi x]{@apply(--paper-font-subhead);@apply(--paper-input-suffix);@apply(--layout-fle x-none)}.input-content ::content input{min-width:0}.input-content ::content text area{resize:none}.add-on-content{position:relative}.add-on-content.is-invalid :: content *{color:var(--paper-input-container-invalid-color,--error-color)}.add-on -content.is-highlighted ::content *{color:var(--paper-input-container-focus-colo r,--primary-color)}</style> <template is="dom-if" if="[[!noLabelFloat]]"> <div c lass="floated-label-placeholder" aria-hidden="true">&nbsp;</div> </template> <di v class$="[[_computeInputContentClass(noLabelFloat,alwaysFloatLabel,focused,inva lid,_inputHasContent)]]"> <content select="[prefix]" id="prefix"></content> <div class="label-and-input-container" id="labelAndInputContainer"> <content select= ":not([add-on]):not([prefix]):not([suffix])"></content> </div> <content select=" [suffix]"></content> </div> <div class$="[[_computeUnderlineClass(focused,invali d)]]"> <div class="unfocused-line"></div> <div class="focused-line"></div> </div > <div class$="[[_computeAddOnContentClass(focused,invalid)]]"> <content id="add OnContent" select="[add-on]"></content> </div> </template> </dom-module> <script >Polymer({is:"paper-input-container",properties:{noLabelFloat:{type:Boolean,valu e:!1},alwaysFloatLabel:{type:Boolean,value:!1},attrForValue:{type:String,value:" bind-value"},autoValidate:{type:Boolean,value:!1},invalid:{observer:"_invalidCha nged",type:Boolean,value:!1},focused:{readOnly:!0,type:Boolean,value:!1,notify:! 0},_addons:{type:Array},_inputHasContent:{type:Boolean,value:!1},_inputSelector: {type:String,value:"input,textarea,.paper-input-input"},_boundOnFocus:{type:Func tion,value:function(){return this._onFocus.bind(this)}},_boundOnBlur:{type:Funct ion,value:function(){return this._onBlur.bind(this)}},_boundOnInput:{type:Functi on,value:function(){return this._onInput.bind(this)}},_boundValueChanged:{type:F unction,value:function(){return this._onValueChanged.bind(this)}}},listeners:{"a ddon-attached":"_onAddonAttached","iron-input-validate":"_onIronInputValidate"}, get _valueChangedEvent(){return this.attrForValue+"-changed"},get _propertyForVa lue(){return Polymer.CaseMap.dashToCamelCase(this.attrForValue)},get _inputEleme nt(){return Polymer.dom(this).querySelector(this._inputSelector)},get _inputElem entValue(){return this._inputElement[this._propertyForValue]||this._inputElement .value},ready:function(){this._addons||(this._addons=[]),this.addEventListener(" focus",this._boundOnFocus,!0),this.addEventListener("blur",this._boundOnBlur,!0) },attached:function(){this.attrForValue?this._inputElement.addEventListener(this ._valueChangedEvent,this._boundValueChanged):this.addEventListener("input",this. _onInput),""!=this._inputElementValue?this._handleValueAndAutoValidate(this._inp utElement):this._handleValue(this._inputElement)},_onAddonAttached:function(t){t his._addons||(this._addons=[]);var n=t.target;this._addons.indexOf(n)===-1&&(thi s._addons.push(n),this.isAttached&&this._handleValue(this._inputElement))},_onFo cus:function(){this._setFocused(!0)},_onBlur:function(){this._setFocused(!1),thi s._handleValueAndAutoValidate(this._inputElement)},_onInput:function(t){this._ha ndleValueAndAutoValidate(t.target)},_onValueChanged:function(t){this._handleValu eAndAutoValidate(t.target)},_handleValue:function(t){var n=this._inputElementVal ue;n||0===n||"number"===t.type&&!t.checkValidity()?this._inputHasContent=!0:this ._inputHasContent=!1,this.updateAddons({inputElement:t,value:n,invalid:this.inva lid})},_handleValueAndAutoValidate:function(t){if(this.autoValidate){var n;n=t.v alidate?t.validate(this._inputElementValue):t.checkValidity(),this.invalid=!n}th is._handleValue(t)},_onIronInputValidate:function(t){this.invalid=this._inputEle ment.invalid},_invalidChanged:function(){this._addons&&this.updateAddons({invali d:this.invalid})},updateAddons:function(t){for(var n,e=0;n=this._addons[e];e++)n .update(t)},_computeInputContentClass:function(t,n,e,i,a){var u="input-content"; if(t)a&&(u+=" label-is-hidden");else{var o=this.querySelector("label");n||a?(u+= " label-is-floating",this.$.labelAndInputContainer.style.position="static",i?u+= " is-invalid":e&&(u+=" label-is-highlighted")):o&&(this.$.labelAndInputContainer .style.position="relative")}return u},_computeUnderlineClass:function(t,n){var e ="underline";return n?e+=" is-invalid":t&&(e+=" is-highlighted"),e},_computeAddO nContentClass:function(t,n){var e="add-on-content";return n?e+=" is-invalid":t&& (e+=" is-highlighted"),e}})</script> <dom-module id="paper-input-error" assetpat h="/res/imp/bower_components/paper-input/"> <template> <style>:host{display:inli ne-block;visibility:hidden;color:var(--paper-input-container-invalid-color,--err or-color);@apply(--paper-font-caption);@apply(--paper-input-error);position:abso lute;left:0;right:0}:host([invalid]){visibility:visible};</style> <content></con tent> </template> </dom-module> <script>Polymer({is:"paper-input-error",behavior s:[Polymer.PaperInputAddonBehavior],properties:{invalid:{readOnly:!0,reflectToAt tribute:!0,type:Boolean}},update:function(e){this._setInvalid(e.invalid)}})</scr ipt> <dom-module id="paper-input" assetpath="/res/imp/bower_components/paper-inp ut/"> <template> <style>:host{display:block}:host([focused]){outline:0}:host([hi dden]){display:none!important}input::-webkit-input-placeholder{color:var(--paper -input-container-color,--secondary-text-color)}input:-moz-placeholder{color:var( --paper-input-container-color,--secondary-text-color)}input::-moz-placeholder{co lor:var(--paper-input-container-color,--secondary-text-color)}input:-ms-input-pl aceholder{color:var(--paper-input-container-color,--secondary-text-color)}label{ pointer-events:none}</style> <paper-input-container no-label-float="[[noLabelFlo at]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholde r)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[inva lid]]"> <content select="[prefix]"></content> <label hidden$="[[!label]]" aria-h idden="true" for="input">[[label]]</label> <input is="iron-input" id="input" ari a-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" dis abled$="[[disabled]]" title$="[[title]]" bind-value="{{value}}" invalid="{{inval id}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowed Pattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" req uired$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]] " inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength] ]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$= "[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" aut ocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onC hange" tabindex$="[[tabindex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"> <content select="[suffix]"></cont ent> <template is="dom-if" if="[[errorMessage]]"> <paper-input-error aria-live=" assertive">[[errorMessage]]</paper-input-error> </template> <template is="dom-if " if="[[charCounter]]"> <paper-input-char-counter></paper-input-char-counter> </ template> </paper-input-container> </template> </dom-module> <script>Polymer({is :"paper-input",behaviors:[Polymer.IronFormElementBehavior,Polymer.PaperInputBeha vior]})</script> <dom-module id="query-column-filter-style" assetpath="/res/imp/ common/"> <template> <style>:host{display:block;font-family:sans-serif}#filter{m argin:0 5px}.container{min-height:120px;width:100%}.item{border-bottom:1px solid #EEE;max-width:250px;min-height:1em;min-width:100px;padding:.1em .2em;line-heig ht:1.5em}.header{height:2em;padding:.25em;line-height:2em}.selector{border:1px s olid #000;margin:0 5px;max-height:200px;min-height:130px;min-width:275px;overflo w-y:auto}.pointable,.selectable{cursor:pointer}.selectable:hover{background-colo r:#A6CEE3}.iron-selected{background-color:#1F78B4;color:#fff}.icons{cursor:point er;height:20px;margin:2px;width:20px;flex-shrink:0}.side-by-side{display:inline- block;vertical-align:top}.bold{font-weight:700}paper-checkbox{max-height:2em;mar gin:2px;--paper-checkbox-checked-color:black;--paper-checkbox-checked-ink-color: black;--paper-checkbox-unchecked-color:black;--paper-checkbox-unchecked-ink-colo r:black;--paper-checkbox-label-color:black}</style> </template> </dom-module> <s cript>!function(){var r=":",i=function(r,i){if(!i)return{idx:0,part:""};if(!r)re turn{idx:-1};i=i.trim().toLocaleLowerCase(),r=r.toLocaleLowerCase();for(var t=i. split(" "),e=0;e<t.length;e++){var n=r.indexOf(t[e]);if(n!==-1)return{idx:n,part :t[e]}}return{idx:-1}},t=function(i,t,e){if(!t)return!0;if(!i)return!1;if(i=i.to LocaleLowerCase(),t=t.trim().toLocaleLowerCase(),t.indexOf(" ")!==-1||t.indexOf( ":")===-1)return!1;var n=t.split(r,1)[0],a=t.substring(n.length+r.length);return e?i===n:i.startsWith(a)};SwarmingBehaviors.QueryColumnFilter=[SwarmingBehaviors .CommonBehavior,{properties:{dimensions:{type:Array},primary_map:{type:Object},p rimary_arr:{type:Array},special_columns:{type:Array,value:function(){return[]}}, filter:{type:Function,computed:"_makeFilter(_filters.*)",notify:!0},FILTER_SEP:{ type:String,value:r},_filters:{type:Array},_limit:{type:Number},_primaryItems:{t ype:Array,computed:"_primary(_query, primary_map, primary_arr, columns.*)"},_pri marySelected:{type:String,value:""},_query:{type:String},_secondaryItems:{type:A rray,computed:"_secondary(_primarySelected, _query, primary_map)"}},_addFilter:f unction(r){var i=r.model.item;if(!this._cantAddFilter(this._primarySelected,i)){ var t=this._primarySelected+this.FILTER_SEP+i;this.push("_filters",t)}},_removeF ilter:function(r){var i=r.model.fil;if(!this._cantRemoveFilter(i)){var t=this._f ilters.indexOf(i);t!==-1&&this.splice("_filters",t,1)}},_cantAddFilter:function( r,i){if(!r||!i)return!0;var t=r+this.FILTER_SEP+i;return this._filters.indexOf(t )!==-1},_cantRemoveFilter:function(r){return!r||this._filters.indexOf(r)===-1},_ makeFilter:function(){var r={};this._filters.forEach(function(i){var t=i.indexOf (this.FILTER_SEP),e=i.slice(0,t),n=i.slice(t+this.FILTER_SEP.length),a=r[e]||[]; a.push(n),r[e]=a}.bind(this));var i=this._filterMap||{};return function(t){var e =!0;for(primary in r){var n=r[primary],a=i[primary];a||(a=function(r,i){var t=th is._attribute(r,primary);return t.indexOf(i)!==-1}.bind(this)),a&&n.forEach(func tion(r){e=e&&a.bind(this)(t,r)}.bind(this))}return e}},_manuallyAddFilter:functi on(){var r=this._query.trim(),i=r.indexOf(this.FILTER_SEP);if(i===-1)return void sk.errorMessage('Invalid filter. Should be like "foo:bar"',5e3);var t=r.slice( 0,i),e=r.slice(i+this.FILTER_SEP.length);return swarming.alias.DIMENSIONS_WITH_A LIASES.indexOf(t)!==-1&&(e=swarming.alias.apply(e,t)),r=t+this.FILTER_SEP+e,this ._filters.indexOf(r)!==-1?void sk.errorMessage('Filter "'+r+'" is already active ',5e3):(this.push("_filters",r),void this.set("_query",""))},_toggleColumn:funct ion(r){var i=r.model.item;if(!this._cantToggleColumn(i)){if(this._columnState(i) ){var t=this.columns.indexOf(i);return void(t!==-1&&this.splice("columns",t,1))} this.push("columns",i)}},_cantToggleColumn:function(r){return!1},_columnState:fu nction(r){return!!r&&this.columns.indexOf(r)!==-1},_primary:function(r,e,n){var a=this.primary_arr.filter(function(n){if(t(n,r,!0))return!0;if(i(n,r).idx!==-1)r eturn!0;for(var a=e[n]||[],s=0;s<a.length;s++)if(i(a[s],r).idx!==-1)return!0;ret urn!1});return r&&a.length>0&&a.indexOf(this._primarySelected)===-1&&this.set("_ primarySelected",a[0]),a.sort(function(r,i){var t=this._columnState(r),e=this._c olumnState(i);if(t&&!e)return-1;if(e&&!t)return 1;if(t&&e){if(t=this.special_col umns.indexOf(r),e=this.special_columns.indexOf(i),t!==-1&&e===-1)return-1;if(t== =-1&&e!==-1)return 1;if(t!==-1&&e!==-1)return t-e}return swarming.naturalCompare (r,i)}.bind(this)),a},_secondary:function(r,e,n){if(requestAnimationFrame(functi on(){this.$.secondaryList.render()}.bind(this)),!r)return[];var a=n[r]||[];retur n t(r,e,!0)?a.sort(function(r,i){var n=t(r,e,!1),a=t(i,e,!1);return n===a?swarmi ng.naturalCompare(r,i):a-n}):i(r,e).idx!==-1?a.sort(function(r,t){var n=i(r,e).i dx!==-1,a=i(t,e).idx!==-1;return n===a?swarming.naturalCompare(r,t):a-n}):a.filt er(function(r){return i(r,e).idx!==-1})},_beforeBold:function(r,t){var e=i(r,t.r eplace(":"," "));return e.idx===-1?r:r.substring(0,e.idx)},_bold:function(r,t){v ar e=i(r,t.replace(":"," "));return e.idx===-1?"":r.substring(e.idx,e.idx+e.part .length)},_afterBold:function(r,t){var e=i(r,t.replace(":"," "));return e.idx=== -1?"":r.substring(e.idx+e.part.length)},_commonFilters:function(){return{android _devices:function(r,i){var t=this._attribute(r,"android_devices","0");return t.i ndexOf(i)!==-1},device_os:function(r,i){var t=this._attribute(r,"device_os","non e");return t.indexOf(i)!==-1},device_type:function(r,i){var t=this._attribute(r, "device_type","none");return t.indexOf(swarming.alias.unapply(i))!==-1},gpu:func tion(r,i){var t=this._attribute(r,"gpu","none");return t.indexOf(swarming.alias. unapply(i))!==-1}}}}]}()</script> <script>!function(){var e="unknown";SwarmingBe haviors.BotListBehavior=[SwarmingBehaviors.CommonBehavior,{properties:{BOT_PROPE RTIES:{type:Array,value:function(){return["disk_space","uptime","running_time"," task","status","version","external_ip","internal_ip","cloud_console_link","mp_le ase_id","mp_lease_expires","last_seen","first_seen","battery_level","battery_vol tage","battery_temperature","battery_status","battery_health","bot_temperature", "device_temperature"]}}},_attribute:function(t,i,n){return n=n||e,this._dimensio n(t,i)||this._state(t,i)||[n]},_devices:function(e){return e.state.devices},_dev iceType:function(e){return e.device_type.toLowerCase()},_dimension:function(e,t) {if(e&&e.dimensions&&t)for(var i=0;i<e.dimensions.length;i++)if(e.dimensions[i]. key===t)return e.dimensions[i].value},_state:function(e,t){if(e&&e.state&&e.stat e[t]){var i=e.state[t];return Array.isArray(i)?i:[i]}},_taskId:function(e){retur n e&&e.task_id?e.task_id:"idle"}}]}()</script> <dom-module id="bot-filters" asse tpath="/res/imp/botlist/"> <template> <style is="custom-style" include="iron-fle x iron-flex-alignment iron-positioning query-column-filter-style swarming-app-st yle"></style> <url-param name="f" value="{{_filters}}" default_values="[]" multi =""> </url-param> <url-param name="c" value="{{columns}}" default_values="[&quot ;id&quot;,&quot;os&quot;,&quot;task&quot;,&quot;status&quot;]" multi=""> </url-p aram> <url-param name="q" value="{{_query}}" default_value=""> </url-param> <url -param name="v" value="{{verbose}}"> </url-param> <url-param name="l" default_va lue="100" value="{{_limit}}"> </url-param> <div class="container horizontal layo ut"> <div class="narrow-down-selector"> <div> <iron-a11y-keys target="[[_filter_ input]]" keys="enter" on-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <pa per-input id="filter" label="Search columns and filters or supply a filter and p ress enter" placeholder="gpu nvidia pool:Chrome" value="{{_query::input}}"> </pa per-input> </div> <div class="selector side-by-side" title="This shows all bot d imension names and other interesting bot properties. Mark the check box to add a s a column. Select the row to see filter options."> <iron-selector attr-for-sele cted="label" selected="{{_primarySelected}}"> <template is="dom-repeat" items="[ [_primaryItems]]" as="item"> <div class="selectable item horizontal layout" labe l="[[item]]"> <span>[[_beforeBold(item,_query)]]<span class="bold">[[_bold(item, _query)]]</span>[[_afterBold(item,_query)]]</span> <span class="flex"></span> <p aper-checkbox noink="" disabled$="[[_cantToggleColumn(item)]]" checked="[[_colum nState(item,columns.*)]]" on-change="_toggleColumn"> </paper-checkbox> </div> </ template> </iron-selector> </div> <div class="selector side-by-side" title="Thes e are all options (if any) that the bot list can be filtered on."> <template is= "dom-repeat" id="secondaryList" items="[[_secondaryItems]]" as="item"> <div clas s="item horizontal layout" label="[[item]]"> <span>[[_beforeBold(item,_query)]]< span class="bold">[[_bold(item,_query)]]</span>[[_afterBold(item,_query)]]</span > <span class="flex"></span> <iron-icon class="icons" icon="icons:arrow-forward" hidden="[[_cantAddFilter(_primarySelected,item,_filters.*)]]" on-tap="_addFilte r"> </iron-icon> </div> </template> <template is="dom-if" if="[[_showDimensionMe ssage(_primarySelected,_secondaryItems.length)]]"> <div class="item"> Only dimen sions can be used for filtering. <i>"[[_primarySelected]]"</i> is a part of the bot's state and is informational only. </div> </template> </div> <div class="sel ector side-by-side" title="These filters are AND'd together and applied to all b ots in 352 })(); </script> </dom-module><script>Polymer({is:"iron-a11y-keys",behaviors:[P olymer.IronA11yKeysBehavior],properties:{target:{type:Object,observer:"_targetCh anged"},keys:{type:String,reflectToAttribute:!0,observer:"_keysChanged"}},attach ed:function(){this.target||(this.target=this.parentNode)},_targetChanged:functio n(e){this.keyEventTarget=e},_keysChanged:function(){this.removeOwnKeyBindings(), this.addOwnKeyBinding(this.keys,"_fireKeysPressed")},_fireKeysPressed:function(e ){this.fire("keys-pressed",e.detail,{})}})</script> <script>Polymer({is:"iron-se lector",behaviors:[Polymer.IronMultiSelectableBehavior]})</script> <script>Polym er.IronValidatableBehaviorMeta=null,Polymer.IronValidatableBehavior={properties: {validator:{type:String},invalid:{notify:!0,reflectToAttribute:!0,type:Boolean,v alue:!1},_validatorMeta:{type:Object},validatorType:{type:String,value:"validato r"},_validator:{type:Object,computed:"__computeValidator(validator)"}},observers :["_invalidChanged(invalid)"],registered:function(){Polymer.IronValidatableBehav iorMeta=new Polymer.IronMeta({type:"validator"})},_invalidChanged:function(){thi s.invalid?this.setAttribute("aria-invalid","true"):this.removeAttribute("aria-in valid")},hasValidator:function(){return null!=this._validator},validate:function (a){return this.invalid=!this._getValidity(a),!this.invalid},_getValidity:functi on(a){return!this.hasValidator()||this._validator.validate(a)},__computeValidato r:function(){return Polymer.IronValidatableBehaviorMeta&&Polymer.IronValidatable BehaviorMeta.byKey(this.validator)}}</script> <script>Polymer.IronFormElementBeh avior={properties:{name:{type:String},value:{notify:!0,type:String},required:{ty pe:Boolean,value:!1},_parentForm:{type:Object}},attached:function(){this.fire("i ron-form-element-register")},detached:function(){this._parentForm&&this._parentF orm.fire("iron-form-element-unregister",{target:this})}}</script> <script>Polyme r.IronCheckedElementBehaviorImpl={properties:{checked:{type:Boolean,value:!1,ref lectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,v alue:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueCha nged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIro nCheckedElementBehavior=!0},_getValidity:function(e){return this.disabled||!this .required||this.checked},_requiredChanged:function(){this.required?this.setAttri bute("aria-required","true"):this.removeAttribute("aria-required")},_checkedChan ged:function(){this.active=this.checked,this.fire("iron-change")},_valueChanged: function(){void 0!==this.value&&null!==this.value||(this.value="on")}},Polymer.I ronCheckedElementBehavior=[Polymer.IronFormElementBehavior,Polymer.IronValidatab leBehavior,Polymer.IronCheckedElementBehaviorImpl]</script> <script>Polymer.Pape rCheckedElementBehaviorImpl={_checkedChanged:function(){Polymer.IronCheckedEleme ntBehaviorImpl._checkedChanged.call(this),this.hasRipple()&&(this.checked?this._ ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_but tonStateChanged:function(){Polymer.PaperRippleBehavior._buttonStateChanged.call( this),this.disabled||this.isAttached&&(this.checked=this.active)}},Polymer.Paper CheckedElementBehavior=[Polymer.PaperInkyFocusBehavior,Polymer.IronCheckedElemen tBehavior,Polymer.PaperCheckedElementBehaviorImpl]</script> <dom-module id="pape r-checkbox" assetpath="/res/imp/bower_components/paper-checkbox/"> <template str ip-whitespace=""> <style>:host{display:inline-block;white-space:nowrap;cursor:po inter;--calculated-paper-checkbox-size:var(--paper-checkbox-size, 18px);--calcul ated-paper-checkbox-ink-size:var(--paper-checkbox-ink-size, -1px);@apply(--paper -font-common-base);line-height:0;-webkit-tap-highlight-color:transparent}:host([ hidden]){display:none!important}:host(:focus){outline:0}.hidden{display:none}#ch eckboxContainer{display:inline-block;position:relative;width:var(--calculated-pa per-checkbox-size);height:var(--calculated-paper-checkbox-size);min-width:var(-- calculated-paper-checkbox-size);margin:var(--paper-checkbox-margin,initial);vert ical-align:var(--paper-checkbox-vertical-align,middle);background-color:var(--pa per-checkbox-unchecked-background-color,transparent)}#ink{position:absolute;top: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-c heckbox-size))/ 2);left:calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size))/ 2);width:var(--calculated-paper-checkbox -ink-size);height:var(--calculated-paper-checkbox-ink-size);color:var(--paper-ch eckbox-unchecked-ink-color,var(--primary-text-color));opacity:.6;pointer-events: none}:host-context([dir=rtl]) #ink{right:calc(0px - (var(--calculated-paper-chec kbox-ink-size) - var(--calculated-paper-checkbox-size))/ 2);left:auto}#ink[check ed]{color:var(--paper-checkbox-checked-ink-color,var(--primary-color))}#checkbox {position:relative;box-sizing:border-box;height:100%;border:solid 2px;border-col or:var(--paper-checkbox-unchecked-color,var(--primary-text-color));border-radius :2px;pointer-events:none;-webkit-transition:background-color 140ms,border-color 140ms;transition:background-color 140ms,border-color 140ms}#checkbox.checked #ch eckmark{-webkit-animation:checkmark-expand 140ms ease-out forwards;animation:che ckmark-expand 140ms ease-out forwards}@-webkit-keyframes checkmark-expand{0%{-we bkit-transform:scale(0,0) rotate(45deg)}100%{-webkit-transform:scale(1,1) rotate (45deg)}}@keyframes checkmark-expand{0%{transform:scale(0,0) rotate(45deg)}100%{ transform:scale(1,1) rotate(45deg)}}#checkbox.checked{background-color:var(--pap er-checkbox-checked-color,var(--primary-color));border-color:var(--paper-checkbo x-checked-color,var(--primary-color))}#checkmark{position:absolute;width:36%;hei ght:70%;border-style:solid;border-top:none;border-left:none;border-right-width:c alc(2/15 * var(--calculated-paper-checkbox-size));border-bottom-width:calc(2/15 * var(--calculated-paper-checkbox-size));border-color:var(--paper-checkbox-check mark-color,#fff);-webkit-transform-origin:97% 86%;transform-origin:97% 86%;box-s izing:content-box}:host-context([dir=rtl]) #checkmark{-webkit-transform-origin:5 0% 14%;transform-origin:50% 14%}#checkboxLabel{position:relative;display:inline- block;vertical-align:middle;padding-left:var(--paper-checkbox-label-spacing,8px) ;white-space:normal;line-height:normal;color:var(--paper-checkbox-label-color,va r(--primary-text-color));@apply(--paper-checkbox-label)}:host([checked]) #checkb oxLabel{color:var(--paper-checkbox-label-checked-color,var(--paper-checkbox-labe l-color,var(--primary-text-color)));@apply(--paper-checkbox-label-checked)}:host -context([dir=rtl]) #checkboxLabel{padding-right:var(--paper-checkbox-label-spac ing,8px);padding-left:0}#checkboxLabel[hidden]{display:none}:host([disabled]) #c heckbox{opacity:.5;border-color:var(--paper-checkbox-unchecked-color,var(--prima ry-text-color))}:host([disabled][checked]) #checkbox{background-color:var(--pape r-checkbox-unchecked-color,var(--primary-text-color));opacity:.5}:host([disabled ]) #checkboxLabel{opacity:.65}#checkbox.invalid:not(.checked){border-color:var(- -paper-checkbox-error-color,var(--error-color))}</style> <div id="checkboxContai ner"> <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> < div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> </div> </ div> <div id="checkboxLabel"><content></content></div> </template> <script>Polym er({is:"paper-checkbox",behaviors:[Polymer.PaperCheckedElementBehavior],hostAttr ibutes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttr ibute:{type:String,value:"aria-checked"}},attached:function(){var e=this.getComp utedStyleValue("--calculated-paper-checkbox-ink-size");if("-1px"===e){var t=pars eFloat(this.getComputedStyleValue("--calculated-paper-checkbox-size")),a=Math.fl oor(8/3*t);a%2!==t%2&&a++,this.customStyle["--paper-checkbox-ink-size"]=a+"px",t his.updateStyles()}},_computeCheckboxClass:function(e,t){var a="";return e&&(a+= "checked "),t&&(a+="invalid"),a},_computeCheckmarkClass:function(e){return e?"": "hidden"},_createRipple:function(){return this._rippleContainer=this.$.checkboxC ontainer,Polymer.PaperInkyFocusBehaviorImpl._createRipple.call(this)}})</script> </dom-module> <script>Polymer({is:"iron-input",extends:"input",behaviors:[Polym er.IronValidatableBehavior],properties:{bindValue:{observer:"_bindValueChanged", type:String},preventInvalidInput:{type:Boolean},allowedPattern:{type:String,obse rver:"_allowedPatternChanged"},_previousValidInput:{type:String,value:""},_patte rnAlreadyChecked:{type:Boolean,value:!1}},listeners:{input:"_onInput",keypress:" _onKeypress"},registered:function(){this._canDispatchEventOnDisabled()||(this._o rigDispatchEvent=this.dispatchEvent,this.dispatchEvent=this._dispatchEventFirefo xIE)},created:function(){Polymer.IronA11yAnnouncer.requestAvailability()},_canDi spatchEventOnDisabled:function(){var e=document.createElement("input"),t=!1;e.di sabled=!0,e.addEventListener("feature-check-dispatch-event",function(){t=!0});tr y{e.dispatchEvent(new Event("feature-check-dispatch-event"))}catch(e){}return t} ,_dispatchEventFirefoxIE:function(){var e=this.disabled;this.disabled=!1,this._o rigDispatchEvent.apply(this,arguments),this.disabled=e},get _patternRegExp(){var e;if(this.allowedPattern)e=new RegExp(this.allowedPattern);else switch(this.typ e){case"number":e=/[0-9.,e-]/}return e},ready:function(){this.bindValue=this.val ue},_bindValueChanged:function(){this.value!==this.bindValue&&(this.value=this.b indValue||0===this.bindValue||this.bindValue===!1?this.bindValue:""),this.fire(" bind-value-changed",{value:this.bindValue})},_allowedPatternChanged:function(){t his.preventInvalidInput=!!this.allowedPattern},_onInput:function(){if(this.preve ntInvalidInput&&!this._patternAlreadyChecked){var e=this._checkPatternValidity() ;e||(this._announceInvalidCharacter("Invalid string of characters not entered.") ,this.value=this._previousValidInput)}this.bindValue=this.value,this._previousVa lidInput=this.value,this._patternAlreadyChecked=!1},_isPrintable:function(e){var t=8==e.keyCode||9==e.keyCode||13==e.keyCode||27==e.keyCode,i=19==e.keyCode||20= =e.keyCode||45==e.keyCode||46==e.keyCode||144==e.keyCode||145==e.keyCode||e.keyC ode>32&&e.keyCode<41||e.keyCode>111&&e.keyCode<124;return!(t||0==e.charCode&&i)} ,_onKeypress:function(e){if(this.preventInvalidInput||"number"===this.type){var t=this._patternRegExp;if(t&&!(e.metaKey||e.ctrlKey||e.altKey)){this._patternAlre adyChecked=!0;var i=String.fromCharCode(e.charCode);this._isPrintable(e)&&!t.tes t(i)&&(e.preventDefault(),this._announceInvalidCharacter("Invalid character "+i+ " not entered."))}}},_checkPatternValidity:function(){var e=this._patternRegExp; if(!e)return!0;for(var t=0;t<this.value.length;t++)if(!e.test(this.value[t]))ret urn!1;return!0},validate:function(){var e=this.checkValidity();return e&&(this.r equired&&""===this.value?e=!1:this.hasValidator()&&(e=Polymer.IronValidatableBeh avior.validate.call(this,this.value))),this.invalid=!e,this.fire("iron-input-val idate"),e},_announceInvalidCharacter:function(e){this.fire("iron-announce",{text :e})}})</script> <script>Polymer.PaperInputHelper={},Polymer.PaperInputHelper.Ne xtLabelID=1,Polymer.PaperInputHelper.NextAddonID=1,Polymer.PaperInputBehaviorImp l={properties:{label:{type:String},value:{notify:!0,type:String},disabled:{type: Boolean,value:!1},invalid:{type:Boolean,value:!1,notify:!0},preventInvalidInput: {type:Boolean},allowedPattern:{type:String},type:{type:String},list:{type:String },pattern:{type:String},required:{type:Boolean,value:!1},errorMessage:{type:Stri ng},charCounter:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1},alw aysFloatLabel:{type:Boolean,value:!1},autoValidate:{type:Boolean,value:!1},valid ator:{type:String},autocomplete:{type:String,value:"off"},autofocus:{type:Boolea n,observer:"_autofocusChanged"},inputmode:{type:String},minlength:{type:Number}, maxlength:{type:Number},min:{type:String},max:{type:String},step:{type:String},n ame:{type:String},placeholder:{type:String,value:""},readonly:{type:Boolean,valu e:!1},size:{type:Number},autocapitalize:{type:String,value:"none"},autocorrect:{ type:String,value:"off"},autosave:{type:String},results:{type:Number},accept:{ty pe:String},multiple:{type:Boolean},_ariaDescribedBy:{type:String,value:""},_aria LabelledBy:{type:String,value:""}},listeners:{"addon-attached":"_onAddonAttached "},keyBindings:{"shift+tab:keydown":"_onShiftTabDown"},hostAttributes:{tabindex: 0},get inputElement(){return this.$.input},get _focusableElement(){return this.i nputElement},registered:function(){this._typesThatHaveText=["date","datetime","d atetime-local","month","time","week","file"]},attached:function(){this._updateAr iaLabelledBy(),this.inputElement&&this._typesThatHaveText.indexOf(this.inputElem ent.type)!==-1&&(this.alwaysFloatLabel=!0)},_appendStringWithSpace:function(e,t) {return e=e?e+" "+t:t},_onAddonAttached:function(e){var t=e.path?e.path[0]:e.tar get;if(t.id)this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribe dBy,t.id);else{var a="paper-input-add-on-"+Polymer.PaperInputHelper.NextAddonID+ +;t.id=a,this._ariaDescribedBy=this._appendStringWithSpace(this._ariaDescribedBy ,a)}},validate:function(){return this.inputElement.validate()},_focusBlurHandler :function(e){Polymer.IronControlState._focusBlurHandler.call(this,e),this.focuse d&&!this._shiftTabPressed&&this._focusableElement.focus()},_onShiftTabDown:funct ion(e){var t=this.getAttribute("tabindex");this._shiftTabPressed=!0,this.setAttr ibute("tabindex","-1"),this.async(function(){this.setAttribute("tabindex",t),thi s._shiftTabPressed=!1},1)},_handleAutoValidate:function(){this.autoValidate&&thi s.validate()},updateValueAndPreserveCaret:function(e){try{var t=this.inputElemen t.selectionStart;this.value=e,this.inputElement.selectionStart=t,this.inputEleme nt.selectionEnd=t}catch(t){this.value=e}},_computeAlwaysFloatLabel:function(e,t) {return t||e},_updateAriaLabelledBy:function(){var e=Polymer.dom(this.root).quer ySelector("label");if(!e)return void(this._ariaLabelledBy="");var t;e.id?t=e.id: (t="paper-input-label-"+Polymer.PaperInputHelper.NextLabelID++,e.id=t),this._ari aLabelledBy=t},_onChange:function(e){this.shadowRoot&&this.fire(e.type,{sourceEv ent:e},{node:this,bubbles:e.bubbles,cancelable:e.cancelable})},_autofocusChanged :function(){if(this.autofocus&&this._focusableElement){var e=document.activeElem ent,t=e instanceof HTMLElement,a=t&&e!==document.body&&e!==document.documentElem ent;a||this._focusableElement.focus()}}},Polymer.PaperInputBehavior=[Polymer.Iro nControlState,Polymer.IronA11yKeysBehavior,Polymer.PaperInputBehaviorImpl]</scri pt> <script>Polymer.PaperInputAddonBehavior={hostAttributes:{"add-on":""},attach ed:function(){this.fire("addon-attached")},update:function(t){}}</script> <dom-m odule id="paper-input-char-counter" assetpath="/res/imp/bower_components/paper-i nput/"> <template> <style>:host{display:inline-block;float:right;@apply(--paper- font-caption);@apply(--paper-input-char-counter)}:host([hidden]){display:none!im portant}:host-context([dir=rtl]){float:left}</style> <span>[[_charCounterStr]]</ span> </template> </dom-module> <script>Polymer({is:"paper-input-char-counter",b ehaviors:[Polymer.PaperInputAddonBehavior],properties:{_charCounterStr:{type:Str ing,value:"0"}},update:function(t){if(t.inputElement){t.value=t.value||"";var e= t.value.toString().length.toString();t.inputElement.hasAttribute("maxlength")&&( e+="/"+t.inputElement.getAttribute("maxlength")),this._charCounterStr=e}}})</scr ipt> <dom-module id="paper-input-container" assetpath="/res/imp/bower_components /paper-input/"> <template> <style>:host{display:block;padding:8px 0;@apply(--pap er-input-container)}:host([inline]){display:inline-block}:host([disabled]){point er-events:none;opacity:.33;@apply(--paper-input-container-disabled)}:host([hidde n]){display:none!important}.floated-label-placeholder{@apply(--paper-font-captio n)}.underline{position:relative}.focused-line{@apply(--layout-fit);background:va r(--paper-input-container-focus-color,--primary-color);height:2px;-webkit-transf orm-origin:center center;transform-origin:center center;-webkit-transform:scale3 d(0,1,1);transform:scale3d(0,1,1);@apply(--paper-input-container-underline-focus )}.underline.is-highlighted .focused-line{-webkit-transform:none;transform:none; -webkit-transition:-webkit-transform .25s;transition:transform .25s;@apply(--pap er-transition-easing)}.underline.is-invalid .focused-line{background:var(--paper -input-container-invalid-color,--error-color);-webkit-transform:none;transform:n one;-webkit-transition:-webkit-transform .25s;transition:transform .25s;@apply(- -paper-transition-easing)}.unfocused-line{@apply(--layout-fit);background:var(-- paper-input-container-color,--secondary-text-color);height:1px;@apply(--paper-in put-container-underline)}:host([disabled]) .unfocused-line{border-bottom:1px das hed;border-color:var(--paper-input-container-color,--secondary-text-color);backg round:0 0;@apply(--paper-input-container-underline-disabled)}.label-and-input-co ntainer{@apply(--layout-flex-auto);@apply(--layout-relative);width:100%;max-widt h:100%}.input-content{@apply(--layout-horizontal);@apply(--layout-center);positi on:relative}.input-content ::content .paper-input-label,.input-content ::content label{position:absolute;top:0;right:0;left:0;width:100%;font:inherit;color:var( --paper-input-container-color,--secondary-text-color);-webkit-transition:-webkit -transform .25s,width .25s;transition:transform .25s,width .25s;-webkit-transfor m-origin:left top;transform-origin:left top;@apply(--paper-font-common-nowrap);@ apply(--paper-font-subhead);@apply(--paper-input-container-label);@apply(--paper -transition-easing)}.input-content.label-is-floating ::content .paper-input-labe l,.input-content.label-is-floating ::content label{-webkit-transform:translateY( -75%) scale(.75);transform:translateY(-75%) scale(.75);width:133%;@apply(--paper -input-container-label-floating)}:host-context([dir=rtl]) .input-content.label-i s-floating ::content .paper-input-label,:host-context([dir=rtl]) .input-content. label-is-floating ::content label{width:100%;-webkit-transform-origin:right top; transform-origin:right top}.input-content.label-is-highlighted ::content .paper- input-label,.input-content.label-is-highlighted ::content label{color:var(--pape r-input-container-focus-color,--primary-color);@apply(--paper-input-container-la bel-focus)}.input-content.is-invalid ::content .paper-input-label,.input-content .is-invalid ::content label{color:var(--paper-input-container-invalid-color,--er ror-color)}.input-content.label-is-hidden ::content .paper-input-label,.input-co ntent.label-is-hidden ::content label{visibility:hidden}.input-content ::content .paper-input-input,.input-content ::content input,.input-content ::content iron -autogrow-textarea,.input-content ::content textarea{position:relative;outline:0 ;box-shadow:none;padding:0;width:100%;max-width:100%;background:0 0;border:none; color:var(--paper-input-container-input-color,--primary-text-color);-webkit-appe arance:none;text-align:inherit;vertical-align:bottom;@apply(--paper-font-subhead );@apply(--paper-input-container-input)}::content [prefix]{@apply(--paper-font-s ubhead);@apply(--paper-input-prefix);@apply(--layout-flex-none)}::content [suffi x]{@apply(--paper-font-subhead);@apply(--paper-input-suffix);@apply(--layout-fle x-none)}.input-content ::content input{min-width:0}.input-content ::content text area{resize:none}.add-on-content{position:relative}.add-on-content.is-invalid :: content *{color:var(--paper-input-container-invalid-color,--error-color)}.add-on -content.is-highlighted ::content *{color:var(--paper-input-container-focus-colo r,--primary-color)}</style> <template is="dom-if" if="[[!noLabelFloat]]"> <div c lass="floated-label-placeholder" aria-hidden="true">&nbsp;</div> </template> <di v class$="[[_computeInputContentClass(noLabelFloat,alwaysFloatLabel,focused,inva lid,_inputHasContent)]]"> <content select="[prefix]" id="prefix"></content> <div class="label-and-input-container" id="labelAndInputContainer"> <content select= ":not([add-on]):not([prefix]):not([suffix])"></content> </div> <content select=" [suffix]"></content> </div> <div class$="[[_computeUnderlineClass(focused,invali d)]]"> <div class="unfocused-line"></div> <div class="focused-line"></div> </div > <div class$="[[_computeAddOnContentClass(focused,invalid)]]"> <content id="add OnContent" select="[add-on]"></content> </div> </template> </dom-module> <script >Polymer({is:"paper-input-container",properties:{noLabelFloat:{type:Boolean,valu e:!1},alwaysFloatLabel:{type:Boolean,value:!1},attrForValue:{type:String,value:" bind-value"},autoValidate:{type:Boolean,value:!1},invalid:{observer:"_invalidCha nged",type:Boolean,value:!1},focused:{readOnly:!0,type:Boolean,value:!1,notify:! 0},_addons:{type:Array},_inputHasContent:{type:Boolean,value:!1},_inputSelector: {type:String,value:"input,textarea,.paper-input-input"},_boundOnFocus:{type:Func tion,value:function(){return this._onFocus.bind(this)}},_boundOnBlur:{type:Funct ion,value:function(){return this._onBlur.bind(this)}},_boundOnInput:{type:Functi on,value:function(){return this._onInput.bind(this)}},_boundValueChanged:{type:F unction,value:function(){return this._onValueChanged.bind(this)}}},listeners:{"a ddon-attached":"_onAddonAttached","iron-input-validate":"_onIronInputValidate"}, get _valueChangedEvent(){return this.attrForValue+"-changed"},get _propertyForVa lue(){return Polymer.CaseMap.dashToCamelCase(this.attrForValue)},get _inputEleme nt(){return Polymer.dom(this).querySelector(this._inputSelector)},get _inputElem entValue(){return this._inputElement[this._propertyForValue]||this._inputElement .value},ready:function(){this._addons||(this._addons=[]),this.addEventListener(" focus",this._boundOnFocus,!0),this.addEventListener("blur",this._boundOnBlur,!0) },attached:function(){this.attrForValue?this._inputElement.addEventListener(this ._valueChangedEvent,this._boundValueChanged):this.addEventListener("input",this. _onInput),""!=this._inputElementValue?this._handleValueAndAutoValidate(this._inp utElement):this._handleValue(this._inputElement)},_onAddonAttached:function(t){t his._addons||(this._addons=[]);var n=t.target;this._addons.indexOf(n)===-1&&(thi s._addons.push(n),this.isAttached&&this._handleValue(this._inputElement))},_onFo cus:function(){this._setFocused(!0)},_onBlur:function(){this._setFocused(!1),thi s._handleValueAndAutoValidate(this._inputElement)},_onInput:function(t){this._ha ndleValueAndAutoValidate(t.target)},_onValueChanged:function(t){this._handleValu eAndAutoValidate(t.target)},_handleValue:function(t){var n=this._inputElementVal ue;n||0===n||"number"===t.type&&!t.checkValidity()?this._inputHasContent=!0:this ._inputHasContent=!1,this.updateAddons({inputElement:t,value:n,invalid:this.inva lid})},_handleValueAndAutoValidate:function(t){if(this.autoValidate){var n;n=t.v alidate?t.validate(this._inputElementValue):t.checkValidity(),this.invalid=!n}th is._handleValue(t)},_onIronInputValidate:function(t){this.invalid=this._inputEle ment.invalid},_invalidChanged:function(){this._addons&&this.updateAddons({invali d:this.invalid})},updateAddons:function(t){for(var n,e=0;n=this._addons[e];e++)n .update(t)},_computeInputContentClass:function(t,n,e,i,a){var u="input-content"; if(t)a&&(u+=" label-is-hidden");else{var o=this.querySelector("label");n||a?(u+= " label-is-floating",this.$.labelAndInputContainer.style.position="static",i?u+= " is-invalid":e&&(u+=" label-is-highlighted")):o&&(this.$.labelAndInputContainer .style.position="relative")}return u},_computeUnderlineClass:function(t,n){var e ="underline";return n?e+=" is-invalid":t&&(e+=" is-highlighted"),e},_computeAddO nContentClass:function(t,n){var e="add-on-content";return n?e+=" is-invalid":t&& (e+=" is-highlighted"),e}})</script> <dom-module id="paper-input-error" assetpat h="/res/imp/bower_components/paper-input/"> <template> <style>:host{display:inli ne-block;visibility:hidden;color:var(--paper-input-container-invalid-color,--err or-color);@apply(--paper-font-caption);@apply(--paper-input-error);position:abso lute;left:0;right:0}:host([invalid]){visibility:visible};</style> <content></con tent> </template> </dom-module> <script>Polymer({is:"paper-input-error",behavior s:[Polymer.PaperInputAddonBehavior],properties:{invalid:{readOnly:!0,reflectToAt tribute:!0,type:Boolean}},update:function(e){this._setInvalid(e.invalid)}})</scr ipt> <dom-module id="paper-input" assetpath="/res/imp/bower_components/paper-inp ut/"> <template> <style>:host{display:block}:host([focused]){outline:0}:host([hi dden]){display:none!important}input::-webkit-input-placeholder{color:var(--paper -input-container-color,--secondary-text-color)}input:-moz-placeholder{color:var( --paper-input-container-color,--secondary-text-color)}input::-moz-placeholder{co lor:var(--paper-input-container-color,--secondary-text-color)}input:-ms-input-pl aceholder{color:var(--paper-input-container-color,--secondary-text-color)}label{ pointer-events:none}</style> <paper-input-container no-label-float="[[noLabelFlo at]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholde r)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[inva lid]]"> <content select="[prefix]"></content> <label hidden$="[[!label]]" aria-h idden="true" for="input">[[label]]</label> <input is="iron-input" id="input" ari a-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" dis abled$="[[disabled]]" title$="[[title]]" bind-value="{{value}}" invalid="{{inval id}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowed Pattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" req uired$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]] " inputmode$="[[inputmode]]" minlength$="[[minlength]]" maxlength$="[[maxlength] ]" min$="[[min]]" max$="[[max]]" step$="[[step]]" name$="[[name]]" placeholder$= "[[placeholder]]" readonly$="[[readonly]]" list$="[[list]]" size$="[[size]]" aut ocapitalize$="[[autocapitalize]]" autocorrect$="[[autocorrect]]" on-change="_onC hange" tabindex$="[[tabindex]]" autosave$="[[autosave]]" results$="[[results]]" accept$="[[accept]]" multiple$="[[multiple]]"> <content select="[suffix]"></cont ent> <template is="dom-if" if="[[errorMessage]]"> <paper-input-error aria-live=" assertive">[[errorMessage]]</paper-input-error> </template> <template is="dom-if " if="[[charCounter]]"> <paper-input-char-counter></paper-input-char-counter> </ template> </paper-input-container> </template> </dom-module> <script>Polymer({is :"paper-input",behaviors:[Polymer.IronFormElementBehavior,Polymer.PaperInputBeha vior]})</script> <dom-module id="query-column-filter-style" assetpath="/res/imp/ common/"> <template> <style>:host{display:block;font-family:sans-serif}#filter{m argin:0 5px}.container{min-height:120px;width:100%}.item{border-bottom:1px solid #EEE;max-width:250px;min-height:1em;min-width:100px;padding:.1em .2em;line-heig ht:1.5em}.header{height:2em;padding:.25em;line-height:2em}.selector{border:1px s olid #000;margin:0 5px;max-height:200px;min-height:130px;min-width:275px;overflo w-y:auto}.pointable,.selectable{cursor:pointer}.selectable:hover{background-colo r:#A6CEE3}.iron-selected{background-color:#1F78B4;color:#fff}.icons{cursor:point er;height:20px;margin:2px;width:20px;flex-shrink:0}.side-by-side{display:inline- block;vertical-align:top}.bold{font-weight:700}paper-checkbox{max-height:2em;mar gin:2px;--paper-checkbox-checked-color:black;--paper-checkbox-checked-ink-color: black;--paper-checkbox-unchecked-color:black;--paper-checkbox-unchecked-ink-colo r:black;--paper-checkbox-label-color:black}</style> </template> </dom-module> <s cript>!function(){var r=":",i=function(r,i){if(!i)return{idx:0,part:""};if(!r)re turn{idx:-1};i=i.trim().toLocaleLowerCase(),r=r.toLocaleLowerCase();for(var t=i. split(" "),e=0;e<t.length;e++){var n=r.indexOf(t[e]);if(n!==-1)return{idx:n,part :t[e]}}return{idx:-1}},t=function(i,t,e){if(!t)return!0;if(!i)return!1;if(i=i.to LocaleLowerCase(),t=t.trim().toLocaleLowerCase(),t.indexOf(" ")!==-1||t.indexOf( ":")===-1)return!1;var n=t.split(r,1)[0],a=t.substring(n.length+r.length);return e?i===n:i.startsWith(a)};SwarmingBehaviors.QueryColumnFilter=[SwarmingBehaviors .CommonBehavior,{properties:{dimensions:{type:Array},primary_map:{type:Object},p rimary_arr:{type:Array},special_columns:{type:Array,value:function(){return[]}}, filter:{type:Function,computed:"_makeFilter(_filters.*)",notify:!0},FILTER_SEP:{ type:String,value:r},_filters:{type:Array},_limit:{type:Number},_primaryItems:{t ype:Array,computed:"_primary(_query, primary_map, primary_arr, columns.*)"},_pri marySelected:{type:String,value:""},_query:{type:String},_secondaryItems:{type:A rray,computed:"_secondary(_primarySelected, _query, primary_map)"}},_addFilter:f unction(r){var i=r.model.item;if(!this._cantAddFilter(this._primarySelected,i)){ var t=this._primarySelected+this.FILTER_SEP+i;this.push("_filters",t)}},_removeF ilter:function(r){var i=r.model.fil;if(!this._cantRemoveFilter(i)){var t=this._f ilters.indexOf(i);t!==-1&&this.splice("_filters",t,1)}},_cantAddFilter:function( r,i){if(!r||!i)return!0;var t=r+this.FILTER_SEP+i;return this._filters.indexOf(t )!==-1},_cantRemoveFilter:function(r){return!r||this._filters.indexOf(r)===-1},_ makeFilter:function(){var r={};this._filters.forEach(function(i){var t=i.indexOf (this.FILTER_SEP),e=i.slice(0,t),n=i.slice(t+this.FILTER_SEP.length),a=r[e]||[]; a.push(n),r[e]=a}.bind(this));var i=this._filterMap||{};return function(t){var e =!0;for(primary in r){var n=r[primary],a=i[primary];a||(a=function(r,i){var t=th is._attribute(r,primary);return t.indexOf(i)!==-1}.bind(this)),a&&n.forEach(func tion(r){e=e&&a.bind(this)(t,r)}.bind(this))}return e}},_manuallyAddFilter:functi on(){var r=this._query.trim(),i=r.indexOf(this.FILTER_SEP);if(i===-1)return void sk.errorMessage('Invalid filter. Should be like "foo:bar"',5e3);var t=r.slice( 0,i),e=r.slice(i+this.FILTER_SEP.length);return swarming.alias.DIMENSIONS_WITH_A LIASES.indexOf(t)!==-1&&(e=swarming.alias.apply(e,t)),r=t+this.FILTER_SEP+e,this ._filters.indexOf(r)!==-1?void sk.errorMessage('Filter "'+r+'" is already active ',5e3):(this.push("_filters",r),void this.set("_query",""))},_toggleColumn:funct ion(r){var i=r.model.item;if(!this._cantToggleColumn(i)){if(this._columnState(i) ){var t=this.columns.indexOf(i);return void(t!==-1&&this.splice("columns",t,1))} this.push("columns",i)}},_cantToggleColumn:function(r){return!1},_columnState:fu nction(r){return!!r&&this.columns.indexOf(r)!==-1},_primary:function(r,e,n){var a=this.primary_arr.filter(function(n){if(t(n,r,!0))return!0;if(i(n,r).idx!==-1)r eturn!0;for(var a=e[n]||[],s=0;s<a.length;s++)if(i(a[s],r).idx!==-1)return!0;ret urn!1});return r&&a.length>0&&a.indexOf(this._primarySelected)===-1&&this.set("_ primarySelected",a[0]),a.sort(function(r,i){var t=this._columnState(r),e=this._c olumnState(i);if(t&&!e)return-1;if(e&&!t)return 1;if(t&&e){if(t=this.special_col umns.indexOf(r),e=this.special_columns.indexOf(i),t!==-1&&e===-1)return-1;if(t== =-1&&e!==-1)return 1;if(t!==-1&&e!==-1)return t-e}return swarming.naturalCompare (r,i)}.bind(this)),a},_secondary:function(r,e,n){if(requestAnimationFrame(functi on(){this.$.secondaryList.render()}.bind(this)),!r)return[];var a=n[r]||[];retur n t(r,e,!0)?a.sort(function(r,i){var n=t(r,e,!1),a=t(i,e,!1);return n===a?swarmi ng.naturalCompare(r,i):a-n}):i(r,e).idx!==-1?a.sort(function(r,t){var n=i(r,e).i dx!==-1,a=i(t,e).idx!==-1;return n===a?swarming.naturalCompare(r,t):a-n}):a.filt er(function(r){return i(r,e).idx!==-1})},_beforeBold:function(r,t){var e=i(r,t.r eplace(":"," "));return e.idx===-1?r:r.substring(0,e.idx)},_bold:function(r,t){v ar e=i(r,t.replace(":"," "));return e.idx===-1?"":r.substring(e.idx,e.idx+e.part .length)},_afterBold:function(r,t){var e=i(r,t.replace(":"," "));return e.idx=== -1?"":r.substring(e.idx+e.part.length)},_commonFilters:function(){return{android _devices:function(r,i){var t=this._attribute(r,"android_devices","0");return t.i ndexOf(i)!==-1},device_os:function(r,i){var t=this._attribute(r,"device_os","non e");return t.indexOf(i)!==-1},device_type:function(r,i){var t=this._attribute(r, "device_type","none");return t.indexOf(swarming.alias.unapply(i))!==-1},gpu:func tion(r,i){var t=this._attribute(r,"gpu","none");return t.indexOf(swarming.alias. unapply(i))!==-1}}}}]}()</script> <script>!function(){var e="unknown";SwarmingBe haviors.BotListBehavior=[SwarmingBehaviors.CommonBehavior,{properties:{BOT_PROPE RTIES:{type:Array,value:function(){return["disk_space","uptime","running_time"," task","status","version","external_ip","internal_ip","cloud_console_link","mp_le ase_id","mp_lease_expires","last_seen","first_seen","battery_level","battery_vol tage","battery_temperature","battery_status","battery_health","bot_temperature", "device_temperature"]}}},_attribute:function(t,i,n){return n=n||e,this._dimensio n(t,i)||this._state(t,i)||[n]},_devices:function(e){return e.state.devices},_dev iceType:function(e){return e.device_type.toLowerCase()},_dimension:function(e,t) {if(e&&e.dimensions&&t)for(var i=0;i<e.dimensions.length;i++)if(e.dimensions[i]. key===t)return e.dimensions[i].value},_state:function(e,t){if(e&&e.state&&e.stat e[t]){var i=e.state[t];return Array.isArray(i)?i:[i]}},_taskId:function(e){retur n e&&e.task_id?e.task_id:"idle"}}]}()</script> <dom-module id="bot-filters" asse tpath="/res/imp/botlist/"> <template> <style is="custom-style" include="iron-fle x iron-flex-alignment iron-positioning query-column-filter-style swarming-app-st yle"></style> <url-param name="f" value="{{_filters}}" default_values="[]" multi =""> </url-param> <url-param name="c" value="{{columns}}" default_values="[&quot ;id&quot;,&quot;os&quot;,&quot;task&quot;,&quot;status&quot;]" multi=""> </url-p aram> <url-param name="q" value="{{_query}}" default_value=""> </url-param> <url -param name="v" value="{{verbose}}"> </url-param> <url-param name="l" default_va lue="100" value="{{_limit}}"> </url-param> <div class="container horizontal layo ut"> <div class="narrow-down-selector"> <div> <iron-a11y-keys target="[[_filter_ input]]" keys="enter" on-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <pa per-input id="filter" label="Search columns and filters or supply a filter and p ress enter" placeholder="gpu nvidia pool:Chrome" value="{{_query::input}}"> </pa per-input> </div> <div class="selector side-by-side" title="This shows all bot d imension names and other interesting bot properties. Mark the check box to add a s a column. Select the row to see filter options."> <iron-selector attr-for-sele cted="label" selected="{{_primarySelected}}"> <template is="dom-repeat" items="[ [_primaryItems]]" as="item"> <div class="selectable item horizontal layout" labe l="[[item]]"> <span>[[_beforeBold(item,_query)]]<span class="bold">[[_bold(item, _query)]]</span>[[_afterBold(item,_query)]]</span> <span class="flex"></span> <p aper-checkbox noink="" disabled$="[[_cantToggleColumn(item)]]" checked="[[_colum nState(item,columns.*)]]" on-change="_toggleColumn"> </paper-checkbox> </div> </ template> </iron-selector> </div> <div class="selector side-by-side" title="Thes e are all options (if any) that the bot list can be filtered on."> <template is= "dom-repeat" id="secondaryList" items="[[_secondaryItems]]" as="item"> <div clas s="item horizontal layout" label="[[item]]"> <span>[[_beforeBold(item,_query)]]< span class="bold">[[_bold(item,_query)]]</span>[[_afterBold(item,_query)]]</span > <span class="flex"></span> <iron-icon class="icons" icon="icons:arrow-forward" hidden="[[_cantAddFilter(_primarySelected,item,_filters.*)]]" on-tap="_addFilte r"> </iron-icon> </div> </template> <template is="dom-if" if="[[_showDimensionMe ssage(_primarySelected,_secondaryItems.length)]]"> <div class="item"> Only dimen sions can be used for filtering. <i>"[[_primarySelected]]"</i> is a part of the bot's state and is informational only. </div> </template> </div> <div class="sel ector side-by-side" title="These filters are AND'd together and applied to all b ots in
353 the fleet."> <template is="dom-repeat" items="[[_filters]]" as="fil"> <div class ="item horizontal layout" label="[[fil]]"> <span>[[fil]]</span> <span class="fle x"></span> <iron-icon class="icons" icon="icons:remove-circle-outline" hidden="[ [_cantRemoveFilter(fil,_filters.*)]]" on-tap="_removeFilter"> </iron-icon> </div > </template> </div> <div class="side-by-side"> <paper-checkbox checked="{{verbo se}}">Verbose Entries</paper-checkbox> <paper-input id="_limit" label="Limit Res ults" auto-validate="" min="0" max="1000" pattern="[0-9]+" value="{{_limit}}"> < /paper-input> <a href$="[[_matchingTasksLink(query_params)]]">View Matching Task s</a> </div> </div> </div> </template> <script>!function(){var i={disk_space:fun ction(i,t){return!0},id:function(i,t){return!0},status:function(i,t){return"quar antined"===t?i.quarantined:"dead"===t?i.is_dead:!i.quarantined&&!i.is_dead},task :function(i,t){return"idle"===t?"idle"===this._taskId(i):"idle"!==this._taskId(i )}};Polymer({is:"bot-filters",behaviors:[SwarmingBehaviors.BotListBehavior,Swarm ingBehaviors.QueryColumnFilter],properties:{columns:{type:Array,notify:!0},query _params:{type:Object,computed:"_extractQueryParams(dimensions.*,_filters.*, _lim it)",notify:!0},verbose:{type:Boolean,notify:!0},_filter_input:{type:Object,valu e:function(){return this.$.filter}},_filterMap:{type:Object,value:function(){var t=this._commonFilters();for(var n in i)t[n]=i[n];return t}}},_cantToggleColumn: function(i){return!i||"id"===i},_extractQueryParams:function(){var i={},t=[];thi s._filters.forEach(function(n){var e=n.split(this.FILTER_SEP,1),s=e[0];if(this.d imensions.indexOf(s)!==-1){var r=n.substring(s.length+this.FILTER_SEP.length);t. push(s+this.FILTER_SEP+swarming.alias.unapply(r))}else if("status"===s){var r=n. substring(s.length+this.FILTER_SEP.length);"alive"===r?(i.is_dead=["FALSE"],i.qu arantined=["FALSE"]):"quarantined"===r?i.quarantined=["TRUE"]:"dead"===r&&(i.is_ dead=["TRUE"])}}.bind(this)),i.dimensions=t;var n=parseInt(this._limit);return N umber.isInteger(n)&&(n=Math.max(n,1),n=Math.min(1e3,n),i.limit=[n],this._limit!= n&&this.set("_limit",n)),i},_matchingTasksLink:function(i){var t=["name","state" ,"created_ts"];return i.dimensions?(i.dimensions.forEach(function(i){var n=i.spl it(this.FILTER_SEP,1)[0];t.indexOf(n)===-1&&t.push(n)}.bind(this)),this._taskLis tLink(i.dimensions,t)):this._taskListLink([],t)},_showDimensionMessage:function( i,t){return i&&"id"!==i&&!t}})}()</script> </dom-module><dom-module id="bot-list -data" assetpath="/res/imp/botlist/"> <script>!function(){function e(e){if(!e)re turn{};var t=[],s=0;for(k in e)t.push(k+": "+e[k]),s+=e[k];return s/=t.length,s= s?s.toFixed(1):"unknown",{average:s,zones:t.join(" | ")||"unknown"}}var t="avail able",s=["quarantined","error"];Polymer({is:"bot-list-data",behaviors:[SwarmingB ehaviors.BotListBehavior],properties:{auth_headers:{type:Object,observer:"signIn "},bots:{type:Array,computed:"parseBots(_list)",notify:!0},busy:{type:Boolean,co mputed:"_or(_busy2,_busy1)",notify:!0},dimensions:{type:Array,computed:"_makeArr ay(_dimensions)",notify:!0},fleet:{type:Object,computed:"_fleet(_count)",notify: !0},primary_map:{type:Object,computed:"_primaryMap(_dimensions)",notify:!0},prim ary_arr:{type:Array,computed:"_primaryArr(dimensions, BOT_PROPERTIES)",notify:!0 },_busy1:{type:Boolean,value:!1},_busy2:{type:Boolean,value:!1},_count:{type:Obj ect},_dimensions:{type:Object},_list:{type:Object}},signIn:function(){this._getJ sonAsync("_count","/api/swarming/v1/bots/count","_busy2",this.auth_headers),this ._getJsonAsync("_dimensions","/api/swarming/v1/bots/dimensions","_busy1",this.au th_headers)},parseBots:function(s){return s&&s.items?(s.items.forEach(function(s ){s.state=s.state||"{}",s.state=JSON.parse(s.state)||{};var n=s.state.disks||{}, i=Object.keys(n);if(i.length){s.disks=[];for(var a=0;a<i.length;a++)s.disks.push ({id:i[a],mb:n[i[a]].free_mb});s.disks.sort(function(e,t){return t.mb-e.mb})}els e s.disks=[{id:"unknown",mb:0}];s.state.temp=e(s.state.temp);var o=[],r=s&&s.sta te&&s.state.devices||{};for(key in r){var u=r[key];u.serial=key,u.okay=u.state== =t;var _=this._dimension(s,"device_type")||["unknown"];u.device_type=_[0],u.temp =e(u.temp),o.push(u)}s.state.devices=o,s.last_seen_ts&&(s.last_seen_ts=new Date( s.last_seen_ts)),s.first_seen_ts&&(s.first_seen_ts=new Date(s.first_seen_ts)),s. lease_expiration_ts&&(s.lease_expiration_ts=new Date(s.lease_expiration_ts))}.bi nd(this)),s.items):[]},_fleet:function(){return this._count?{all:this._count.cou nt||-1,alive:this._count.count-this._count.dead||-1,busy:this._count.busy||-1,id le:this._count.count-this._count.busy||-1,dead:this._count.dead||-1,quarantined: this._count.quarantined||-1}:{}},_makeArray:function(e){if(!e||!e.bots_dimension s)return[];var t=[];return e.bots_dimensions.forEach(function(e){s.indexOf(e.key )===-1&&t.push(e.key)}),t.push("id"),t.sort(),t},_primaryArr:function(e,t){retur n e.concat(t)},_primaryMap:function(e){e=e.bots_dimensions||[];var t={};return e .forEach(function(e){if(swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(e.key)=== -1)t[e.key]=e.value;else{var s=[];e.value.forEach(function(t){s.push(swarming.al ias.apply(t,e.key))}),t[e.key]=s}}),t.android_devices&&t.android_devices.push("0 "),t.device_os&&t.device_os.push("none"),t.device_type&&t.device_type.push("none "),t.id=[],t.disk_space=[],t.task=["busy","idle"],t.status=["alive","dead","quar antined"],t}})}()</script> </dom-module><dom-module id="bot-list-summary" assetp ath="/res/imp/botlist/"> <template> <style include="swarming-app-style">:host{di splay:block;border-left:1px solid #000;padding:5px 5px;font-family:sans-serif}.h eader{font-size:1.2em;font-weight:700}.header.buffer{margin-top:5px}.right{text- align:right}.left{text-align:left}</style> <div class="header">Fleet</div> <tabl e> <tbody><tr> <td class="right"> <a href$="[[_makeURL('','',columns.*,filtered_ bots.*,sort,verbose)]]">All</a>: </td> <td class="left">[[fleet.all]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('alive','',columns.*,filtered_bots .*,sort,verbose)]]">Alive</a>: </td> <td class="left">[[fleet.alive]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('busy','',columns.*,filtered_bots. *,sort,verbose)]]">Busy</a>: </td> <td class="left">[[fleet.busy]]</td> </tr> <t r> <td class="right"> <a href$="[[_makeURL('idle','',columns.*,filtered_bots.*,s ort,verbose)]]">Idle</a>: </td> <td class="left">[[fleet.idle]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('dead','',columns.*,filtered_bots.*,sort ,verbose)]]">Dead</a>: </td> <td class="left">[[fleet.dead]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('quarantined','',columns.*,filtered_bots.*, sort,verbose)]]">Quarantined</a>: </td> <td class="left">[[fleet.quarantined]]</ td> </tr> </tbody></table> <div class="header buffer">Selected</div> <table> <tb ody><tr> <td class="right"> Displayed: </td> <td class="left">[[_currentlyDispla yed(filtered_bots.*)]]</td> </tr> <tr> <td class="right"> All: </td> <td class=" left">[[_count_query.count]]</td> </tr> <tr> <td class="right"> <a href$="[[_mak eURL('alive','true',columns.*,filtered_bots.*,sort,verbose)]]">Alive</a>: </td> <td class="left">[[_computeAlive(_count_query.*)]]</td> </tr> <tr> <td class="ri ght"> <a href$="[[_makeURL('busy','true',columns.*,filtered_bots.*,sort,verbose) ]]">Busy</a>: </td> <td class="left">[[_count_query.busy]]</td> </tr> <tr> <td c lass="right"> <a href$="[[_makeURL('idle','true',columns.*,filtered_bots.*,sort, verbose)]]">Idle</a>: </td> <td class="left">[[_computeIdle(_count_query.*)]]</t d> </tr> <tr> <td class="right"> <a href$="[[_makeURL('dead','true',columns.*,fi ltered_bots.*,sort,verbose)]]">Dead</a>: </td> <td class="left">[[_count_query.d ead]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('quarantined','tru e',columns.*,filtered_bots.*,sort,verbose)]]">Quarantined</a>: </td> <td class=" left">[[_count_query.quarantined]]</td> </tr> </tbody></table> </template> <scri pt>Polymer({is:"bot-list-summary",behaviors:[SwarmingBehaviors.BotListBehavior], properties:{auth_headers:{type:Object},busy:{type:Boolean,value:!1,notify:!0},co lumns:{type:Array},count_params:{type:Object},filtered_bots:{type:Array},fleet:{ type:Object},sort:{type:String},verbose:{type:Boolean},_count_query:{type:Object }},observers:["_recountTotal(auth_headers.*,count_params.*)"],_computeAlive:func tion(){return this._count_query.count-this._count_query.dead},_computeIdle:funct ion(){return this._count_query.count-this._count_query.busy},_currentlyDisplayed :function(){return this.filtered_bots&&this.filtered_bots.length},_getFilterStr: function(t){return t?"alive"===t||"dead"===t||"quarantined"===t?"status:"+t:"tas k:"+t:""},_makeURL:function(t,e){if(!e){var r={s:[this.sort],c:this.columns,v:[t his.verbose]};return t&&(r.f=[this._getFilterStr(t)]),window.location.href.split ("?")[0]+"?"+sk.query.fromParamSet(r)}var o=encodeURIComponent(this._getFilterSt r(t));if(window.location.href.indexOf(o)===-1)return window.location.href+"&f="+ o},_recountTotal:function(){this.auth_headers&&this.count_params&&this._getJsonA sync("_count_query","/api/swarming/v1/bots/count","busy",this.auth_headers,this. count_params)}})</script> </dom-module><dom-module id="bot-list" assetpath="/res /imp/botlist/"> <template> <style include="iron-flex iron-flex-alignment iron-po sitioning swarming-app-style dynamic-table-style">bot-filters,bot-list-summary{m argin-bottom:8px;margin-right:10px}.old_version{background-color:#ffd}.bad-devic e,.quarantined{background-color:#fdd}.dead{background-color:#ccc}.alt{background -color:#f8f8f8}.bot-list th>span{padding-right:30px}</style> <url-param name="s" value="{{_sortstr}}" default_value="id:asc"> </url-param> <swarming-app client_ id="[[client_id]]" auth_headers="{{_auth_headers}}" signed_in="{{_signed_in}}" s erver_details="{{_server_details}}" busy="[[_or(_busy1,_busy2,_busy3)]]" name="S warming Bot List"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <div class="horizontal layout "> <bot-filters dimensions="[[_dimensions]]" primary_map="[[_primary_map]]" prim ary_arr="[[_primary_arr]]" special_columns="[[_specialColumns]]" columns="{{_col umns}}" query_params="{{_query_params}}" filter="{{_filter}}" verbose="{{_verbos e}}"> </bot-filters> <bot-list-summary auth_headers="[[_auth_headers]]" busy="{{ _busy3}}" columns="[[_columns]]" count_params="[[_query_params]]" fleet="[[_flee t]]" filtered_bots="[[_filteredSortedItems]]" sort="[[_sortstr]]" verbose="[[_ve rbose]]"> </bot-list-summary> </div> <bot-list-data id="data" auth_headers="[[_a uth_headers]]" query_params="[[_query_params]]" busy="{{_busy1}}" dimensions="{{ _dimensions}}" fleet="{{_fleet}}" primary_map="{{_primary_map}}" primary_arr="{{ _primary_arr}}"> </bot-list-data> <table class="bot-list"> <thead on-sort_change ="_sortChange"> <tr> <th> <span>Bot Id</span> <sort-toggle name="id" current="[[ _sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('cloud_console_link', _colum ns.*)]]"> <span>Bot in Cloud Console</span> <sort-toggle name="cloud_console_lin k" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('mp_lease_id', _columns.*)]]"> <span>Machine Provider Lease Id</span> <sort-toggle name="mp_le ase_id" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('task', _ columns.*)]]"> <span>Current Task</span> <sort-toggle name="task" current="[[_so rt]]"> </sort-toggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" as="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle nam e="[[c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> < tbody> <template id="bot_table" is="dom-repeat" items="[[_filteredSortedItems]]" as="bot" initial-count="50"> <tr class$="[[_botClass(bot,_server_details.bot_ve rsion)]]"> <td> <a class="center" href$="[[_botLink(bot.bot_id)]]" target="_blan k" rel="noopener"> [[bot.bot_id]] </a> </td> <td hidden$="[[_hide('cloud_console _link', _columns.*)]]"> <a href$="[[_ccLink(bot)]]">[[_ccText(bot)]]</a> </td> < td hidden$="[[_hide('mp_lease_id', _columns.*)]]"> <a href$="[[_mpLink(bot, _ser ver_details.machine_provider_template)]]"> [[_column('mp_lease_id', bot,_verbose )]] </a> </td> <td hidden$="[[_hide('task', _columns.*)]]"> <a href$="[[_taskLin k(bot.task_id)]]">[[_taskId(bot)]]</a> </td> <template is="dom-repeat" items="[[ _plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_column(c, bot, _verbose) ]] </td> </template> </tr> <template is="dom-repeat" items="[[_devices(bot)]]" a s="device"> <tr hidden$="[[_hide('android_devices', _columns.*)]]" class$="[[_de viceClass(device,index)]]"> <td></td> <td hidden$="[[_hide('cloud_console_link', _columns.*)]]"></td> <td hidden$="[[_hide('mp_lease_id', _columns.*)]]"></td> < td hidden$="[[_hide('task', _columns.*)]]"></td> <template is="dom-repeat" items ="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_deviceColumn(c, devi ce, _verbose)]] </td> </template> </tr> </template> </template> </tbody> </table > <pageable-data id="page_bots" busy="{{_busy2}}" label="Show more bots" output= "{{_items}}" parse="[[_parseBots]]"> </pageable-data> </div> </swarming-app> </t emplate> <script> (function(){ 353 the fleet."> <template is="dom-repeat" items="[[_filters]]" as="fil"> <div class ="item horizontal layout" label="[[fil]]"> <span>[[fil]]</span> <span class="fle x"></span> <iron-icon class="icons" icon="icons:remove-circle-outline" hidden="[ [_cantRemoveFilter(fil,_filters.*)]]" on-tap="_removeFilter"> </iron-icon> </div > </template> </div> <div class="side-by-side"> <paper-checkbox checked="{{verbo se}}">Verbose Entries</paper-checkbox> <paper-input id="_limit" label="Limit Res ults" auto-validate="" min="0" max="1000" pattern="[0-9]+" value="{{_limit}}"> < /paper-input> <a href$="[[_matchingTasksLink(query_params)]]">View Matching Task s</a> </div> </div> </div> </template> <script>!function(){var i={disk_space:fun ction(i,t){return!0},id:function(i,t){return!0},status:function(i,t){return"quar antined"===t?i.quarantined:"dead"===t?i.is_dead:!i.quarantined&&!i.is_dead},task :function(i,t){return"idle"===t?"idle"===this._taskId(i):"idle"!==this._taskId(i )}};Polymer({is:"bot-filters",behaviors:[SwarmingBehaviors.BotListBehavior,Swarm ingBehaviors.QueryColumnFilter],properties:{columns:{type:Array,notify:!0},query _params:{type:Object,computed:"_extractQueryParams(dimensions.*,_filters.*, _lim it)",notify:!0},verbose:{type:Boolean,notify:!0},_filter_input:{type:Object,valu e:function(){return this.$.filter}},_filterMap:{type:Object,value:function(){var t=this._commonFilters();for(var n in i)t[n]=i[n];return t}}},_cantToggleColumn: function(i){return!i||"id"===i},_extractQueryParams:function(){var i={},t=[];thi s._filters.forEach(function(n){var e=n.split(this.FILTER_SEP,1),s=e[0];if(this.d imensions.indexOf(s)!==-1){var r=n.substring(s.length+this.FILTER_SEP.length);t. push(s+this.FILTER_SEP+swarming.alias.unapply(r))}else if("status"===s){var r=n. substring(s.length+this.FILTER_SEP.length);"alive"===r?(i.is_dead=["FALSE"],i.qu arantined=["FALSE"]):"quarantined"===r?i.quarantined=["TRUE"]:"dead"===r&&(i.is_ dead=["TRUE"])}}.bind(this)),i.dimensions=t;var n=parseInt(this._limit);return N umber.isInteger(n)&&(n=Math.max(n,1),n=Math.min(1e3,n),i.limit=[n],this._limit!= n&&this.set("_limit",n)),i},_matchingTasksLink:function(i){var t=["name","state" ,"created_ts"];return i.dimensions?(i.dimensions.forEach(function(i){var n=i.spl it(this.FILTER_SEP,1)[0];t.indexOf(n)===-1&&t.push(n)}.bind(this)),this._taskLis tLink(i.dimensions,t)):this._taskListLink([],t)},_showDimensionMessage:function( i,t){return i&&"id"!==i&&!t}})}()</script> </dom-module><dom-module id="bot-list -data" assetpath="/res/imp/botlist/"> <script>!function(){function e(e){if(!e)re turn{};var t=[],s=0;for(k in e)t.push(k+": "+e[k]),s+=e[k];return s/=t.length,s= s?s.toFixed(1):"unknown",{average:s,zones:t.join(" | ")||"unknown"}}var t="avail able",s=["quarantined","error"];Polymer({is:"bot-list-data",behaviors:[SwarmingB ehaviors.BotListBehavior],properties:{auth_headers:{type:Object,observer:"signIn "},bots:{type:Array,computed:"parseBots(_list)",notify:!0},busy:{type:Boolean,co mputed:"_or(_busy2,_busy1)",notify:!0},dimensions:{type:Array,computed:"_makeArr ay(_dimensions)",notify:!0},fleet:{type:Object,computed:"_fleet(_count)",notify: !0},primary_map:{type:Object,computed:"_primaryMap(_dimensions)",notify:!0},prim ary_arr:{type:Array,computed:"_primaryArr(dimensions, BOT_PROPERTIES)",notify:!0 },_busy1:{type:Boolean,value:!1},_busy2:{type:Boolean,value:!1},_count:{type:Obj ect},_dimensions:{type:Object},_list:{type:Object}},signIn:function(){this._getJ sonAsync("_count","/api/swarming/v1/bots/count","_busy2",this.auth_headers),this ._getJsonAsync("_dimensions","/api/swarming/v1/bots/dimensions","_busy1",this.au th_headers)},parseBots:function(s){return s&&s.items?(s.items.forEach(function(s ){s.state=s.state||"{}",s.state=JSON.parse(s.state)||{};var n=s.state.disks||{}, i=Object.keys(n);if(i.length){s.disks=[];for(var a=0;a<i.length;a++)s.disks.push ({id:i[a],mb:n[i[a]].free_mb});s.disks.sort(function(e,t){return t.mb-e.mb})}els e s.disks=[{id:"unknown",mb:0}];s.state.temp=e(s.state.temp);var o=[],r=s&&s.sta te&&s.state.devices||{};for(key in r){var u=r[key];u.serial=key,u.okay=u.state== =t;var _=this._dimension(s,"device_type")||["unknown"];u.device_type=_[0],u.temp =e(u.temp),o.push(u)}s.state.devices=o,s.last_seen_ts&&(s.last_seen_ts=new Date( s.last_seen_ts)),s.first_seen_ts&&(s.first_seen_ts=new Date(s.first_seen_ts)),s. lease_expiration_ts&&(s.lease_expiration_ts=new Date(s.lease_expiration_ts))}.bi nd(this)),s.items):[]},_fleet:function(){return this._count?{all:this._count.cou nt||-1,alive:this._count.count-this._count.dead||-1,busy:this._count.busy||-1,id le:this._count.count-this._count.busy||-1,dead:this._count.dead||-1,quarantined: this._count.quarantined||-1}:{}},_makeArray:function(e){if(!e||!e.bots_dimension s)return[];var t=[];return e.bots_dimensions.forEach(function(e){s.indexOf(e.key )===-1&&t.push(e.key)}),t.push("id"),t.sort(),t},_primaryArr:function(e,t){retur n e.concat(t)},_primaryMap:function(e){e=e.bots_dimensions||[];var t={};return e .forEach(function(e){if(swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(e.key)=== -1)t[e.key]=e.value;else{var s=[];e.value.forEach(function(t){s.push(swarming.al ias.apply(t,e.key))}),t[e.key]=s}}),t.android_devices&&t.android_devices.push("0 "),t.device_os&&t.device_os.push("none"),t.device_type&&t.device_type.push("none "),t.id=[],t.disk_space=[],t.task=["busy","idle"],t.status=["alive","dead","quar antined"],t}})}()</script> </dom-module><dom-module id="bot-list-summary" assetp ath="/res/imp/botlist/"> <template> <style include="swarming-app-style">:host{di splay:block;border-left:1px solid #000;padding:5px 5px;font-family:sans-serif}.h eader{font-size:1.2em;font-weight:700}.header.buffer{margin-top:5px}.right{text- align:right}.left{text-align:left}</style> <div class="header">Fleet</div> <tabl e> <tbody><tr> <td class="right"> <a href$="[[_makeURL('','',columns.*,sort,verb ose)]]">All</a>: </td> <td class="left">[[fleet.all]]</td> </tr> <tr> <td class= "right"> <a href$="[[_makeURL('alive','',columns.*,sort,verbose)]]">Alive</a>: < /td> <td class="left">[[fleet.alive]]</td> </tr> <tr> <td class="right"> <a href $="[[_makeURL('busy','',columns.*,sort,verbose)]]">Busy</a>: </td> <td class="le ft">[[fleet.busy]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('idle ','',columns.*,sort,verbose)]]">Idle</a>: </td> <td class="left">[[fleet.idle]]< /td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('dead','',columns.*,sort ,verbose)]]">Dead</a>: </td> <td class="left">[[fleet.dead]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('quarantined','',columns.*,sort,verbose)]]" >Quarantined</a>: </td> <td class="left">[[fleet.quarantined]]</td> </tr> </tbod y></table> <div class="header buffer">Selected</div> <table> <tbody><tr> <td cla ss="right"> Displayed: </td> <td class="left">[[num_bots]]</td> </tr> <tr> <td c lass="right"> All: </td> <td class="left">[[_count_query.count]]</td> </tr> <tr> <td class="right"> <a href$="[[_makeURL('alive','true',columns.*,sort,verbose)] ]">Alive</a>: </td> <td class="left">[[_computeAlive(_count_query.*)]]</td> </tr > <tr> <td class="right"> <a href$="[[_makeURL('busy','true',columns.*,sort,verb ose)]]">Busy</a>: </td> <td class="left">[[_count_query.busy]]</td> </tr> <tr> < td class="right"> <a href$="[[_makeURL('idle','true',columns.*,sort,verbose)]]"> Idle</a>: </td> <td class="left">[[_computeIdle(_count_query.*)]]</td> </tr> <tr > <td class="right"> <a href$="[[_makeURL('dead','true',columns.*,sort,verbose)] ]">Dead</a>: </td> <td class="left">[[_count_query.dead]]</td> </tr> <tr> <td cl ass="right"> <a href$="[[_makeURL('quarantined','true',columns.*,sort,verbose)]] ">Quarantined</a>: </td> <td class="left">[[_count_query.quarantined]]</td> </tr > </tbody></table> </template> <script>Polymer({is:"bot-list-summary",behaviors: [SwarmingBehaviors.BotListBehavior],properties:{auth_headers:{type:Object},colum ns:{type:Array},count_params:{type:Object},fleet:{type:Object},num_bots:{type:Nu mber},sort:{type:String},verbose:{type:Boolean},busy:{type:Boolean,value:!1,noti fy:!0},_count_query:{type:Object}},observers:["_recountTotal(auth_headers.*,coun t_params.*)"],_computeAlive:function(){return this._count_query.count-this._coun t_query.dead},_computeIdle:function(){return this._count_query.count-this._count _query.busy},_getFilterStr:function(t){return t?"alive"===t||"dead"===t||"quaran tined"===t?"status:"+t:"task:"+t:""},_makeURL:function(t,e){if(!e){var r={s:[thi s.sort],c:this.columns,v:[this.verbose]};return t&&(r.f=[this._getFilterStr(t)]) ,window.location.href.split("?")[0]+"?"+sk.query.fromParamSet(r)}var o=encodeURI Component(this._getFilterStr(t));if(window.location.href.indexOf(o)===-1)return window.location.href+"&f="+o},_recountTotal:function(){this.auth_headers&&this.c ount_params&&this._getJsonAsync("_count_query","/api/swarming/v1/bots/count","bu sy",this.auth_headers,this.count_params)}})</script> </dom-module><dom-module id ="bot-list" assetpath="/res/imp/botlist/"> <template> <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-style dynamic-table-style">bot -filters,bot-list-summary{margin-bottom:8px;margin-right:10px}.old_version{backg round-color:#ffd}.bad-device,.quarantined{background-color:#fdd}.dead{background -color:#ccc}.alt{background-color:#f8f8f8}.bot-list th>span{padding-right:30px}< /style> <url-param name="s" value="{{_sortstr}}" default_value="id:asc"> </url-p aram> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" s igned_in="{{_signed_in}}" server_details="{{_server_details}}" busy="[[_or(_busy 1,_busy2,_busy3)]]" name="Swarming Bot List"> <h2 hidden$="[[_signed_in]]">You m ust sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <d iv class="horizontal layout"> <bot-filters dimensions="[[_dimensions]]" primary_ map="[[_primary_map]]" primary_arr="[[_primary_arr]]" special_columns="[[_specia lColumns]]" columns="{{_columns}}" query_params="{{_query_params}}" filter="{{_f ilter}}" verbose="{{_verbose}}"> </bot-filters> <bot-list-summary auth_headers=" [[_auth_headers]]" columns="[[_columns]]" count_params="[[_query_params]]" fleet ="[[_fleet]]" num_bots="[[_filteredSortedItems.length]]" sort="[[_sortstr]]" ver bose="[[_verbose]]" busy="{{_busy3}}"> </bot-list-summary> </div> <bot-list-data id="data" auth_headers="[[_auth_headers]]" query_params="[[_query_params]]" bus y="{{_busy1}}" dimensions="{{_dimensions}}" fleet="{{_fleet}}" primary_map="{{_p rimary_map}}" primary_arr="{{_primary_arr}}"> </bot-list-data> <table class="bot -list"> <thead on-sort_change="_sortChange"> <tr> <th> <span>Bot Id</span> <sort -toggle name="id" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide ('cloud_console_link', _columns.*)]]"> <span>Bot in Cloud Console</span> <sort-t oggle name="cloud_console_link" current="[[_sort]]"> </sort-toggle> </th> <th hi dden$="[[_hide('mp_lease_id', _columns.*)]]"> <span>Machine Provider Lease Id</s pan> <sort-toggle name="mp_lease_id" current="[[_sort]]"> </sort-toggle> </th> < th hidden$="[[_hide('task', _columns.*)]]"> <span>Current Task</span> <sort-togg le name="task" current="[[_sort]]"> </sort-toggle> </th> <template is="dom-repea t" items="[[_plainColumns]]" as="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header (c)]]</span> <sort-toggle name="[[c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <tbody> <template id="bot_table" is="dom-repeat" ite ms="[[_filteredSortedItems]]" as="bot" initial-count="50"> <tr class$="[[_botCla ss(bot,_server_details.bot_version)]]"> <td> <a class="center" href$="[[_botLink (bot.bot_id)]]" target="_blank" rel="noopener"> [[bot.bot_id]] </a> </td> <td hi dden$="[[_hide('cloud_console_link', _columns.*)]]"> <a href$="[[_ccLink(bot)]]" >[[_ccText(bot)]]</a> </td> <td hidden$="[[_hide('mp_lease_id', _columns.*)]]"> <a href$="[[_mpLink(bot, _server_details.machine_provider_template)]]"> [[_colum n('mp_lease_id', bot,_verbose)]] </a> </td> <td hidden$="[[_hide('task', _column s.*)]]"> <a href$="[[_taskLink(bot.task_id)]]">[[_taskId(bot)]]</a> </td> <templ ate is="dom-repeat" items="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]" > [[_column(c, bot, _verbose)]] </td> </template> </tr> <template is="dom-repeat " items="[[_devices(bot)]]" as="device"> <tr hidden$="[[_hide('android_devices', _columns.*)]]" class$="[[_deviceClass(device,index)]]"> <td></td> <td hidden$=" [[_hide('cloud_console_link', _columns.*)]]"></td> <td hidden$="[[_hide('mp_leas e_id', _columns.*)]]"></td> <td hidden$="[[_hide('task', _columns.*)]]"></td> <t emplate is="dom-repeat" items="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c )]]"> [[_deviceColumn(c, device, _verbose)]] </td> </template> </tr> </template> </template> </tbody> </table> <pageable-data id="page_bots" busy="{{_busy2}}" l abel="Show more bots" output="{{_items}}" parse="[[_parseBots]]"> </pageable-dat a> </div> </swarming-app> </template> <script> (function(){
354 var UNKNOWN = "unknown"; 354 var UNKNOWN = "unknown";
355 // see dynamic-table for more information on specialColumns, headerMap, 355 // see dynamic-table for more information on specialColumns, headerMap,
356 // columnMap, and specialSort 356 // columnMap, and specialSort
357 var specialColumns = ["id", "cloud_console_link", "mp_lease_id", "task"]; 357 var specialColumns = ["id", "cloud_console_link", "mp_lease_id", "task"];
358 358
359 var deviceColumns = ["battery_health", "battery_level", "battery_status", "b attery_temperature", "battery_voltage", "device_temperature"]; 359 var deviceColumns = ["battery_health", "battery_level", "battery_status", "b attery_temperature", "battery_voltage", "device_temperature"];
360 360
361 var headerMap = { 361 var headerMap = {
362 // "id", "task" and other special columns don't go here. They have their 362 // "id", "task" and other special columns don't go here. They have their
363 // headers hard-coded above. 363 // headers hard-coded above.
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 778
779 _reload: function() { 779 _reload: function() {
780 if (!this._auth_headers || !this._query_params) { 780 if (!this._auth_headers || !this._query_params) {
781 return; 781 return;
782 } 782 }
783 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu ery_params); 783 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu ery_params);
784 this.$.page_bots.load(url,this._auth_headers); 784 this.$.page_bots.load(url,this._auth_headers);
785 } 785 }
786 786
787 }); 787 });
788 })(); </script> </dom-module> <dom-module id="paper-button" assetpath="/res/im p/bower_components/paper-button/"> <template strip-whitespace=""> <style include ="paper-material-shared-styles">:host{@apply(--layout-inline);@apply(--layout-ce nter-center);position:relative;box-sizing:border-box;min-width:5.14em;margin:0 . 29em;background:0 0;-webkit-tap-highlight-color:transparent;-webkit-tap-highligh t-color:transparent;font:inherit;text-transform:uppercase;outline-width:0;border -radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none; user-select:none;cursor:pointer;z-index:0;padding:.7em .57em;@apply(--paper-font -common-base);@apply(--paper-button)}:host([hidden]){display:none!important}:hos t([raised].keyboard-focus){font-weight:700;@apply(--paper-button-raised-keyboard -focus)}:host(:not([raised]).keyboard-focus){font-weight:700;@apply(--paper-butt on-flat-keyboard-focus)}:host([disabled]){background:#eaeaea;color:#a8a8a8;curso r:auto;pointer-events:none;@apply(--paper-button-disabled)}:host([animated]){@ap ply(--shadow-transition)}paper-ripple{color:var(--paper-button-ink-color)}</styl e> <content></content> </template> <script>Polymer({is:"paper-button",behaviors: [Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribut e:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){th is.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._ setElevation(0)}})</script> </dom-module> <script>Polymer.NeonAnimatableBehavior ={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnim ationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type: String}},_entryAnimationChanged:function(){this.animationConfig=this.animationCo nfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exi tAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this. animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:func tion(i,n){for(var t in n)i[t]=n[t]},_cloneConfig:function(i){var n={isClone:!0}; return this._copyProperties(n,i),n},_getAnimationConfigRecursive:function(i,n,t) {if(this.animationConfig){if(this.animationConfig.value&&"function"==typeof this .animationConfig.value)return void this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));var o;if(o=i?this.animationConfig[i]:this.animationConfig,Arra y.isArray(o)||(o=[o]),o)for(var e,a=0;e=o[a];a++)if(e.animatable)e.animatable._g etAnimationConfigRecursive(e.type||i,n,t);else if(e.id){var r=n[e.id];r?(r.isClo ne||(n[e.id]=this._cloneConfig(r),r=n[e.id]),this._copyProperties(r,e)):n[e.id]= e}else t.push(e)}},getAnimationConfig:function(i){var n={},t=[];this._getAnimati onConfigRecursive(i,n,t);for(var o in n)t.push(n[o]);return t}}</script> <script >Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(n){var i =[];if(n.length>0)for(var e,t=0;e=n[t];t++){var o=document.createElement(e.name) ;if(o.isNeonAnimation){var a=null;try{a=o.configure(e),"function"!=typeof a.canc el&&(a=document.timeline.play(a))}catch(n){a=null,console.warn("Couldnt play","( ",e.name,").",n)}a&&i.push({neonAnimation:o,config:e,animation:a})}else console. warn(this.is+":",e.name,"not found!")}return i},_shouldComplete:function(n){for( var i=!0,e=0;e<n.length;e++)if("finished"!=n[e].animation.playState){i=!1;break} return i},_complete:function(n){for(var i=0;i<n.length;i++)n[i].neonAnimation.co mplete(n[i].config);for(var i=0;i<n.length;i++)n[i].animation.cancel()},playAnim ation:function(n,i){var e=this.getAnimationConfig(n);if(e){this._active=this._ac tive||{},this._active[n]&&(this._complete(this._active[n]),delete this._active[n ]);var t=this._configureAnimations(e);if(0==t.length)return void this.fire("neon -animation-finish",i,{bubbles:!1});this._active[n]=t;for(var o=0;o<t.length;o++) t[o].animation.onfinish=function(){this._shouldComplete(t)&&(this._complete(t),d elete this._active[n],this.fire("neon-animation-finish",i,{bubbles:!1}))}.bind(t his)}},cancelAnimation:function(){for(var n in this._animations)this._animations [n].cancel();this._animations={}}},Polymer.NeonAnimationRunnerBehavior=[Polymer. NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl]</script> <script >Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},p roperties:{modal:{type:Boolean,value:!1}},observers:["_modalChanged(modal, _read ied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOu tsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancel OnEscKey,this.__prevWithBackdrop=this.withBackdrop},_modalChanged:function(i,e){ e&&(i?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prev NoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop ,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):( this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOu tsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEsc Key,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosi ngReasonConfirmed:function(i){this.closingReason=this.closingReason||{},this.clo singReason.confirmed=i},_onDialogClick:function(i){for(var e=Polymer.dom(i).path ,o=0;o<e.indexOf(this);o++){var t=e[o];if(t.hasAttribute&&(t.hasAttribute("dialo g-dismiss")||t.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirm ed(t.hasAttribute("dialog-confirm")),this.close(),i.stopPropagation();break}}}}, Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBeha viorImpl]</script> <dom-module id="paper-dialog-shared-styles" assetpath="/res/i mp/bower_components/paper-dialog-behavior/"> <template> <style>:host{display:blo ck;margin:24px 40px;background:var(--paper-dialog-background-color,--primary-bac kground-color);color:var(--paper-dialog-color,--primary-text-color);@apply(--pap er-font-body1);@apply(--shadow-elevation-16dp);@apply(--paper-dialog)}:host>::co ntent>*{margin-top:20px;padding:0 24px}:host>::content>.no-padding{padding:0}:ho st>::content>:first-child{margin-top:24px}:host>::content>:last-child{margin-bot tom:24px}:host>::content h2{position:relative;margin:0;@apply(--paper-font-title );@apply(--paper-dialog-title)}:host>::content .buttons{position:relative;paddin g:8px 8px 8px 24px;margin:0;color:var(--paper-dialog-button-color,--primary-colo r);@apply(--layout-horizontal);@apply(--layout-end-justified)}</style> </templat e> </dom-module> <dom-module id="paper-dialog" assetpath="/res/imp/bower_compone nts/paper-dialog/"> <template> <style include="paper-dialog-shared-styles"></sty le> <content></content> </template> </dom-module> <script>!function(){Polymer({i s:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRun nerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_rende rOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderCl osed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimat ionFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderCl osed()}})}()</script> <script>window.SwarmingBehaviors=window.SwarmingBehaviors| |{},function(){SwarmingBehaviors.TaskBehavior={properties:{BOT_DIED:{type:String ,value:"BOT_DIED"},CANCELED:{type:String,value:"CANCELED"},COMPLETED:{type:Strin g,value:"COMPLETED"},COMPLETED_DEDUPED:{type:String,value:"COMPLETED (DEDUPED)"} ,COMPLETED_FAILURE:{type:String,value:"COMPLETED (FAILURE)"},COMPLETED_SUCCESS:{ type:String,value:"COMPLETED (SUCCESS)"},EXPIRED:{type:String,value:"EXPIRED"},P ENDING:{type:String,value:"PENDING"},RUNNING:{type:String,value:"RUNNING"},TIMED _OUT:{type:String,value:"TIMED_OUT"}},stateClass:function(t){return t===this.CAN CELED||t===this.TIMED_OUT||t===this.EXPIRED?"exception":t===this.BOT_DIED?"bot_d ied":t===this.COMPLETED_FAILURE?"failed_task":t===this.RUNNING||t===this.PENDING ?"pending_task":""},state:function(t){return t?t.state===this.COMPLETED?t.failur e?this.COMPLETED_FAILURE:"0"===t.try_number?this.COMPLETED_DEDUPED:this.COMPLETE D_SUCCESS:t.state:""},_stateClass:function(t){return this.stateClass(this.state( t))}}}()</script> <dom-module id="task-style" assetpath="/res/imp/common/"> <tem plate> <style>.failed_task{background-color:#fdd}.bot_died{background-color:#ccc }.exception{background-color:#edd2ff}.pending_task{background-color:#fffc6c}</st yle> </template> </dom-module><dom-module id="task-filters" assetpath="/res/imp/ tasklist/"> <template> <style is="custom-style" include="iron-flex iron-flex-ali gnment iron-positioning query-column-filter-style swarming-app-style">.item.wide {max-width:400px}.selector.wide{min-width:275px}.cancel-button{display:block;mar gin-top:5px}</style> <url-param name="f" value="{{_filters}}" default_values="[] " multi=""> </url-param> <url-param name="c" value="{{columns}}" default_values= "[&quot;name&quot;,&quot;state&quot;,&quot;created_ts&quot;,&quot;user&quot;,&qu ot;bot&quot;]" multi=""> </url-param> <url-param name="q" value="{{_query}}" def ault_value=""> </url-param> <url-param name="l" default_value="50" value="{{_lim it}}"> </url-param> <div class="container horizontal layout"> <div class="narrow -down-selector"> <div> <iron-a11y-keys target="[[_filter_input]]" keys="enter" o n-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <paper-input id="filter" l abel="Search columns and filters or supply a filter and press enter" placeholder ="gpu nvidia pool:Chrome" value="{{_query::input}}"> </paper-input> </div> <div class="wide selector side-by-side" title="This shows all task tags and other int eresting task properties. Mark the check box to add as a column. Select the row to see filter options."> <iron-selector attr-for-selected="label" selected="{{_p rimarySelected}}"> <template is="dom-repeat" items="[[_primaryItems]]" as="item" > <div class="selectable item horizontal layout" label="[[item]]"> <span>[[_befo reBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</span>[[_afterBol d(item,_query)]]</span> <span class="flex"></span> <paper-checkbox noink="" disa bled$="[[_cantToggleColumn(item)]]" checked="[[_columnState(item,columns.*)]]" o n-change="_toggleColumn"> </paper-checkbox> </div> </template> </iron-selector> </div> <div class="selector side-by-side" title="These are most of the options ( if any) that the task list can be filtered on. This list is all that have been s een recently, augmented with the ones returned by the current query. There may b e others."> <template is="dom-repeat" id="secondaryList" items="[[_secondaryItem s]]" as="item"> <div class="item horizontal layout" label="[[item]]"> <span>[[_b eforeBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</span>[[_after Bold(item,_query)]]</span> <span class="flex"></span> <iron-icon class="icons" i con="icons:arrow-forward" hidden="[[_cantAddFilter(_primarySelected,item,_filter s.*)]]" on-tap="_addFilter"> </iron-icon> </div> </template> <template is="dom-i f" if="[[_secondaryItems.length]]"> <div class="pointable item" title="There may be more valid options than just the ones shown.">...</div> </template> <templat e is="dom-if" if="[[_showTagMessage(_primarySelected,_secondaryItems.length)]]"> <div class="item">Only tags can be used for filtering. <i>"[[_primarySelected]] "</i> is informational only.</div> </template> </div> <div class="selector side- by-side" title="These tag filters are AND'd together and applied to all tasks."> <template is="dom-repeat" items="[[_filters]]" as="fil"> <div class="item horiz ontal layout" label="[[fil]]"> <span>[[fil]]</span> <span class="flex"></span> < iron-icon class="icons" icon="icons:remove-circle-outline" hidden="[[_cantRemove Filter(fil,_filters.*)]]" on-tap="_removeFilter"> </iron-icon> </div> </template > </div> <div class="side-by-side"> <paper-input id="_limit" label="Limit Result s" auto-validate="" min="0" max="1000" pattern="[0-9]+" value="{{_limit}}"> </pa per-input> <a href$="[[_matchingBotsLink(query_params,dimensions.*)]]">View Matc hing Bots</a> <template is="dom-if" if="[[permissions.cancel_tasks]]"> <paper-bu tton class="cancel-button" raised="" on-tap="_promptCancel"> Cancel All Tasks </ paper-button> </template> </div> </div> </div> </template> <script>!function(){v ar t={state:function(t,i){var r=this._attribute(t,"state")[0];if(i===r||"ALL"=== i)return!0;if("PENDING_RUNNING"===i)return r===this.PENDING||r===this.RUNNING;va r s=this._attribute(t,"failure",!1)[0];if("COMPLETED_SUCCESS"===i)return r===thi s.COMPLETED&&!s;if("COMPLETED_FAILURE"===i)return r===this.COMPLETED&&s;var e=th is._attribute(t,"try_number","-1")[0];return"DEDUPED"===i?r===this.COMPLETED&&"0 "===e:void 0}};Polymer({is:"task-filters",behaviors:[SwarmingBehaviors.QueryColu mnFilter,SwarmingBehaviors.TaskBehavior],properties:{columns:{type:Array,notify: !0},query_params:{type:Object,computed:"_extractQueryParams(_filters.*, _limit)" ,notify:!0},permissions:{type:Object},_filterMap:{type:Object,value:function(){v ar i=this._commonFilters();for(var r in t)i[r]=t[r];return i}}},_cantToggleColum n:function(t){return!t||"name"===t},_extractQueryParams:function(){var t={},i=[] ;this._filters.forEach(function(r){var s=r.split(this.FILTER_SEP,1),e=s[0],a=r.s ubstring(e.length+this.FILTER_SEP.length);"state"===e?t.state=[a]:("user"===e&&" none"===a&&(a=""),i.push(e+this.FILTER_SEP+swarming.alias.unapply(a)))}.bind(thi s)),t.tags=i;var r=parseInt(this._limit);return Number.isInteger(r)&&(r=Math.max (r,1),r=Math.min(1e3,r),t.limit=[r],this._limit!=r&&this.set("_limit",r)),t},_ma tchingBotsLink:function(t){var i=["id","os","task","status"];if(!t.tags||!this.d imensions)return this._botListLink([],i);var r=t.tags.filter(function(t){var i=t .split(this.FILTER_SEP,1)[0];return this.dimensions.indexOf(i)!==-1}.bind(this)) ;return r.forEach(function(t){var r=t.split(this.FILTER_SEP,1)[0];i.indexOf(r)== =-1&&i.push(r)}.bind(this)),this._botListLink(r,i)},_promptCancel:function(){ret urn this.query_params.tags&&this.query_params.tags.length?void this.fire("cancel -all",{tags:this.query_params.tags}):void sk.errorMessage("You can't batch cance l everything. Specify some tags to filter by first.",8e3)},_showTagMessage:func tion(t,i){return t&&"name"!==t&&!i}})}()</script> </dom-module><dom-module id="t ask-list-data" assetpath="/res/imp/tasklist/"> <script>!function(){var t=["aband oned_ts","completed_ts","created_ts","modified_ts","started_ts"],s=["quarantined ","error"];Polymer({is:"task-list-data",behaviors:[SwarmingBehaviors.CommonBehav ior,SwarmingBehaviors.TaskBehavior],properties:{auth_headers:{type:Object,observ er:"signIn"},query_params:{type:Object},tasks:{type:Array},busy:{type:Boolean,co mputed:"_or(_busy2,_busy1)",notify:!0},dimensions:{type:Array,computed:"_makeArr ay(_dimensions)",notify:!0},primary_map:{type:Object,computed:"_primaryMap(_tags ,_dimensions,tasks.*)",notify:!0},primary_arr:{type:Array,computed:"_primaryArr( primary_map)",notify:!0},_busy2:{type:Boolean,value:!1},_busy1:{type:Boolean,val ue:!1},_dimensions:{type:Object},_list:{type:Object},_tags:{type:Object}},signIn :function(){this._getJsonAsync("_tags","/api/swarming/v1/tasks/tags","_busy2",th is.auth_headers),this._getJsonAsync("_dimensions","/api/swarming/v1/bots/dimensi ons","_busy1",this.auth_headers)},_makeArray:function(t){if(!t||!t.bots_dimensio ns)return[];var a=[];return t.bots_dimensions.forEach(function(t){s.indexOf(t.ke y)===-1&&a.push(t.key)}),a.push("id"),a.sort(),a},_primaryArr:function(t){var s= Object.keys(t);return s.sort(),s},_primaryMap:function(s,a){s=s&&s.tasks_tags||[ ],a=a&&a.bots_dimensions||[],tasks=this.tasks||[];var e={};s.forEach(function(t) {e[t.key]||(e[t.key]={});var s=t.value||[];s.forEach(function(s){e[t.key][s]=!0} )}),a.forEach(function(t){var s=t.value;e[t.key]||(e[t.key]={}),s.forEach(functi on(s){e[t.key][s]=!0})}),tasks.forEach(function(t){Object.keys(t.tagMap).forEach (function(s){var a=t.tagMap[s];e[s]||(e[s]={}),e[s][a]=!0})}),e.user&&(delete e. user[""],e.user.none=!0);var r={};for(key in e){var n=Object.keys(e[key]);if(swa rming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key)===-1)r[key]=n;else{var i=[];n.f orEach(function(t){i.push(swarming.alias.apply(t,key))}),r[key]=i}}return r.name =[],r.state=[this.PENDING,this.RUNNING,"PENDING_RUNNING",this.COMPLETED,"COMPLET ED_SUCCESS","COMPLETED_FAILURE",this.EXPIRED,this.TIMED_OUT,this.BOT_DIED,this.C ANCELED,"DEDUPED","ALL"],r.costs_usd=[],r.deduped_from=[],r.duration=[],r.server _versions=[],r.bot=[],t.forEach(function(t){r[t]=[]}),r},parseTasks:function(s){ if(!s||!s.items)return[];var a=new Date;return s.items.forEach(function(s){var e ={};s.tags=s.tags||[],s.tags.forEach(function(t){var s=t.split(":",1),a=s[0],r=t .substring(a.length+1);e[a]=r}),s.tagMap=e,t.forEach(function(t){s[t]&&(s[t]=new Date(s[t]),s["human_"+t]=sk.human.localeTime(s[t]))}),!s.duration&&s.state===th is.RUNNING&&s.started_ts&&(s.duration=(a-s.started_ts)/1e3),s.duration&&(s.human _duration=this._humanDuration(s.duration))}.bind(this)),s.items}})}()</script> < /dom-module> <dom-module id="task-mass-cancel" assetpath="/res/imp/tasklist/"> < template> <style>.container{padding:5px;max-width:800px}.cancel-button{backgroun d-color:red;color:#fff;font-weight:700}.cancel-button[disabled]{background-color :grey}</style> <div class="container"> <div> You are about to cancel all PENDING task with the following tags: <ul> <template is="dom-repeat" items="[[tags]]" a s="tag"> <li>[[tag]]</li> </template> </ul> This is about [[_estimated_count]] t asks. Once you start the process, the only way to partially stop it is to close this browser window. If that sounds good, click the button below. </div> <paper- button class="cancel-button" raised="" disabled$="[[!_ready_to_cancel]]" hidden$ ="[[started_canceling]]" on-tap="_cancel"> Cancel the Tasks </paper-button> <div > <div hidden$="[[!started_canceling]]">Progress: [[_canceled_count]] queued for cancelation</div> <div>Note: tasks queued for cancellation will be canceled as soon as possible, but there may be some delay between when this dialog box is cl osed and all tasks actually being canceled.</div> </div> </div> </template> <scr ipt> (function(){ 788 })(); </script> </dom-module> <dom-module id="paper-button" assetpath="/res/im p/bower_components/paper-button/"> <template strip-whitespace=""> <style include ="paper-material-shared-styles">:host{@apply(--layout-inline);@apply(--layout-ce nter-center);position:relative;box-sizing:border-box;min-width:5.14em;margin:0 . 29em;background:0 0;-webkit-tap-highlight-color:transparent;-webkit-tap-highligh t-color:transparent;font:inherit;text-transform:uppercase;outline-width:0;border -radius:3px;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none; user-select:none;cursor:pointer;z-index:0;padding:.7em .57em;@apply(--paper-font -common-base);@apply(--paper-button)}:host([hidden]){display:none!important}:hos t([raised].keyboard-focus){font-weight:700;@apply(--paper-button-raised-keyboard -focus)}:host(:not([raised]).keyboard-focus){font-weight:700;@apply(--paper-butt on-flat-keyboard-focus)}:host([disabled]){background:#eaeaea;color:#a8a8a8;curso r:auto;pointer-events:none;@apply(--paper-button-disabled)}:host([animated]){@ap ply(--shadow-transition)}paper-ripple{color:var(--paper-button-ink-color)}</styl e> <content></content> </template> <script>Polymer({is:"paper-button",behaviors: [Polymer.PaperButtonBehavior],properties:{raised:{type:Boolean,reflectToAttribut e:!0,value:!1,observer:"_calculateElevation"}},_calculateElevation:function(){th is.raised?Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this):this._ setElevation(0)}})</script> </dom-module> <script>Polymer.NeonAnimatableBehavior ={properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnim ationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type: String}},_entryAnimationChanged:function(){this.animationConfig=this.animationCo nfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exi tAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this. animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:func tion(i,n){for(var t in n)i[t]=n[t]},_cloneConfig:function(i){var n={isClone:!0}; return this._copyProperties(n,i),n},_getAnimationConfigRecursive:function(i,n,t) {if(this.animationConfig){if(this.animationConfig.value&&"function"==typeof this .animationConfig.value)return void this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));var o;if(o=i?this.animationConfig[i]:this.animationConfig,Arra y.isArray(o)||(o=[o]),o)for(var e,a=0;e=o[a];a++)if(e.animatable)e.animatable._g etAnimationConfigRecursive(e.type||i,n,t);else if(e.id){var r=n[e.id];r?(r.isClo ne||(n[e.id]=this._cloneConfig(r),r=n[e.id]),this._copyProperties(r,e)):n[e.id]= e}else t.push(e)}},getAnimationConfig:function(i){var n={},t=[];this._getAnimati onConfigRecursive(i,n,t);for(var o in n)t.push(n[o]);return t}}</script> <script >Polymer.NeonAnimationRunnerBehaviorImpl={_configureAnimations:function(n){var i =[];if(n.length>0)for(var e,t=0;e=n[t];t++){var o=document.createElement(e.name) ;if(o.isNeonAnimation){var a=null;try{a=o.configure(e),"function"!=typeof a.canc el&&(a=document.timeline.play(a))}catch(n){a=null,console.warn("Couldnt play","( ",e.name,").",n)}a&&i.push({neonAnimation:o,config:e,animation:a})}else console. warn(this.is+":",e.name,"not found!")}return i},_shouldComplete:function(n){for( var i=!0,e=0;e<n.length;e++)if("finished"!=n[e].animation.playState){i=!1;break} return i},_complete:function(n){for(var i=0;i<n.length;i++)n[i].neonAnimation.co mplete(n[i].config);for(var i=0;i<n.length;i++)n[i].animation.cancel()},playAnim ation:function(n,i){var e=this.getAnimationConfig(n);if(e){this._active=this._ac tive||{},this._active[n]&&(this._complete(this._active[n]),delete this._active[n ]);var t=this._configureAnimations(e);if(0==t.length)return void this.fire("neon -animation-finish",i,{bubbles:!1});this._active[n]=t;for(var o=0;o<t.length;o++) t[o].animation.onfinish=function(){this._shouldComplete(t)&&(this._complete(t),d elete this._active[n],this.fire("neon-animation-finish",i,{bubbles:!1}))}.bind(t his)}},cancelAnimation:function(){for(var n in this._animations)this._animations [n].cancel();this._animations={}}},Polymer.NeonAnimationRunnerBehavior=[Polymer. NeonAnimatableBehavior,Polymer.NeonAnimationRunnerBehaviorImpl]</script> <script >Polymer.PaperDialogBehaviorImpl={hostAttributes:{role:"dialog",tabindex:"-1"},p roperties:{modal:{type:Boolean,value:!1}},observers:["_modalChanged(modal, _read ied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOu tsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancel OnEscKey,this.__prevWithBackdrop=this.withBackdrop},_modalChanged:function(i,e){ e&&(i?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prev NoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop ,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):( this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOu tsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEsc Key,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosi ngReasonConfirmed:function(i){this.closingReason=this.closingReason||{},this.clo singReason.confirmed=i},_onDialogClick:function(i){for(var e=Polymer.dom(i).path ,o=0;o<e.indexOf(this);o++){var t=e[o];if(t.hasAttribute&&(t.hasAttribute("dialo g-dismiss")||t.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirm ed(t.hasAttribute("dialog-confirm")),this.close(),i.stopPropagation();break}}}}, Polymer.PaperDialogBehavior=[Polymer.IronOverlayBehavior,Polymer.PaperDialogBeha viorImpl]</script> <dom-module id="paper-dialog-shared-styles" assetpath="/res/i mp/bower_components/paper-dialog-behavior/"> <template> <style>:host{display:blo ck;margin:24px 40px;background:var(--paper-dialog-background-color,--primary-bac kground-color);color:var(--paper-dialog-color,--primary-text-color);@apply(--pap er-font-body1);@apply(--shadow-elevation-16dp);@apply(--paper-dialog)}:host>::co ntent>*{margin-top:20px;padding:0 24px}:host>::content>.no-padding{padding:0}:ho st>::content>:first-child{margin-top:24px}:host>::content>:last-child{margin-bot tom:24px}:host>::content h2{position:relative;margin:0;@apply(--paper-font-title );@apply(--paper-dialog-title)}:host>::content .buttons{position:relative;paddin g:8px 8px 8px 24px;margin:0;color:var(--paper-dialog-button-color,--primary-colo r);@apply(--layout-horizontal);@apply(--layout-end-justified)}</style> </templat e> </dom-module> <dom-module id="paper-dialog" assetpath="/res/imp/bower_compone nts/paper-dialog/"> <template> <style include="paper-dialog-shared-styles"></sty le> <content></content> </template> </dom-module> <script>!function(){Polymer({i s:"paper-dialog",behaviors:[Polymer.PaperDialogBehavior,Polymer.NeonAnimationRun nerBehavior],listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},_rende rOpened:function(){this.cancelAnimation(),this.playAnimation("entry")},_renderCl osed:function(){this.cancelAnimation(),this.playAnimation("exit")},_onNeonAnimat ionFinish:function(){this.opened?this._finishRenderOpened():this._finishRenderCl osed()}})}()</script> <script>window.SwarmingBehaviors=window.SwarmingBehaviors| |{},function(){SwarmingBehaviors.TaskBehavior={properties:{BOT_DIED:{type:String ,value:"BOT_DIED"},CANCELED:{type:String,value:"CANCELED"},COMPLETED:{type:Strin g,value:"COMPLETED"},COMPLETED_DEDUPED:{type:String,value:"COMPLETED (DEDUPED)"} ,COMPLETED_FAILURE:{type:String,value:"COMPLETED (FAILURE)"},COMPLETED_SUCCESS:{ type:String,value:"COMPLETED (SUCCESS)"},EXPIRED:{type:String,value:"EXPIRED"},P ENDING:{type:String,value:"PENDING"},RUNNING:{type:String,value:"RUNNING"},TIMED _OUT:{type:String,value:"TIMED_OUT"}},stateClass:function(t){return t===this.CAN CELED||t===this.TIMED_OUT||t===this.EXPIRED?"exception":t===this.BOT_DIED?"bot_d ied":t===this.COMPLETED_FAILURE?"failed_task":t===this.RUNNING||t===this.PENDING ?"pending_task":""},state:function(t){return t?t.state===this.COMPLETED?t.failur e?this.COMPLETED_FAILURE:"0"===t.try_number?this.COMPLETED_DEDUPED:this.COMPLETE D_SUCCESS:t.state:""},_stateClass:function(t){return this.stateClass(this.state( t))}}}()</script> <dom-module id="task-style" assetpath="/res/imp/common/"> <tem plate> <style>.failed_task{background-color:#fdd}.bot_died{background-color:#ccc }.exception{background-color:#edd2ff}.pending_task{background-color:#fffc6c}</st yle> </template> </dom-module><dom-module id="task-filters" assetpath="/res/imp/ tasklist/"> <template> <style is="custom-style" include="iron-flex iron-flex-ali gnment iron-positioning query-column-filter-style swarming-app-style">.item.wide {max-width:400px}.selector.wide{min-width:275px}.cancel-button{display:block;mar gin-top:5px}</style> <url-param name="f" value="{{_filters}}" default_values="[] " multi=""> </url-param> <url-param name="c" value="{{columns}}" default_values= "[&quot;name&quot;,&quot;state&quot;,&quot;created_ts&quot;,&quot;user&quot;,&qu ot;bot&quot;]" multi=""> </url-param> <url-param name="q" value="{{_query}}" def ault_value=""> </url-param> <url-param name="l" default_value="50" value="{{_lim it}}"> </url-param> <div class="container horizontal layout"> <div class="narrow -down-selector"> <div> <iron-a11y-keys target="[[_filter_input]]" keys="enter" o n-keys-pressed="_manuallyAddFilter"></iron-a11y-keys> <paper-input id="filter" l abel="Search columns and filters or supply a filter and press enter" placeholder ="gpu nvidia pool:Chrome" value="{{_query::input}}"> </paper-input> </div> <div class="wide selector side-by-side" title="This shows all task tags and other int eresting task properties. Mark the check box to add as a column. Select the row to see filter options."> <iron-selector attr-for-selected="label" selected="{{_p rimarySelected}}"> <template is="dom-repeat" items="[[_primaryItems]]" as="item" > <div class="selectable item horizontal layout" label="[[item]]"> <span>[[_befo reBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</span>[[_afterBol d(item,_query)]]</span> <span class="flex"></span> <paper-checkbox noink="" disa bled$="[[_cantToggleColumn(item)]]" checked="[[_columnState(item,columns.*)]]" o n-change="_toggleColumn"> </paper-checkbox> </div> </template> </iron-selector> </div> <div class="selector side-by-side" title="These are most of the options ( if any) that the task list can be filtered on. This list is all that have been s een recently, augmented with the ones returned by the current query. There may b e others."> <template is="dom-repeat" id="secondaryList" items="[[_secondaryItem s]]" as="item"> <div class="item horizontal layout" label="[[item]]"> <span>[[_b eforeBold(item,_query)]]<span class="bold">[[_bold(item,_query)]]</span>[[_after Bold(item,_query)]]</span> <span class="flex"></span> <iron-icon class="icons" i con="icons:arrow-forward" hidden="[[_cantAddFilter(_primarySelected,item,_filter s.*)]]" on-tap="_addFilter"> </iron-icon> </div> </template> <template is="dom-i f" if="[[_secondaryItems.length]]"> <div class="pointable item" title="There may be more valid options than just the ones shown.">...</div> </template> <templat e is="dom-if" if="[[_showTagMessage(_primarySelected,_secondaryItems.length)]]"> <div class="item">Only tags can be used for filtering. <i>"[[_primarySelected]] "</i> is informational only.</div> </template> </div> <div class="selector side- by-side" title="These tag filters are AND'd together and applied to all tasks."> <template is="dom-repeat" items="[[_filters]]" as="fil"> <div class="item horiz ontal layout" label="[[fil]]"> <span>[[fil]]</span> <span class="flex"></span> < iron-icon class="icons" icon="icons:remove-circle-outline" hidden="[[_cantRemove Filter(fil,_filters.*)]]" on-tap="_removeFilter"> </iron-icon> </div> </template > </div> <div class="side-by-side"> <paper-input id="_limit" label="Limit Result s" auto-validate="" min="0" max="1000" pattern="[0-9]+" value="{{_limit}}"> </pa per-input> <a href$="[[_matchingBotsLink(query_params,dimensions.*)]]">View Matc hing Bots</a> <template is="dom-if" if="[[permissions.cancel_tasks]]"> <paper-bu tton class="cancel-button" raised="" on-tap="_promptCancel"> Cancel All Tasks </ paper-button> </template> </div> </div> </div> </template> <script>!function(){v ar t={state:function(t,i){var r=this._attribute(t,"state")[0];if(i===r||"ALL"=== i)return!0;if("PENDING_RUNNING"===i)return r===this.PENDING||r===this.RUNNING;va r s=this._attribute(t,"failure",!1)[0];if("COMPLETED_SUCCESS"===i)return r===thi s.COMPLETED&&!s;if("COMPLETED_FAILURE"===i)return r===this.COMPLETED&&s;var e=th is._attribute(t,"try_number","-1")[0];return"DEDUPED"===i?r===this.COMPLETED&&"0 "===e:void 0}};Polymer({is:"task-filters",behaviors:[SwarmingBehaviors.QueryColu mnFilter,SwarmingBehaviors.TaskBehavior],properties:{columns:{type:Array,notify: !0},query_params:{type:Object,computed:"_extractQueryParams(_filters.*, _limit)" ,notify:!0},permissions:{type:Object},_filterMap:{type:Object,value:function(){v ar i=this._commonFilters();for(var r in t)i[r]=t[r];return i}}},_cantToggleColum n:function(t){return!t||"name"===t},_extractQueryParams:function(){var t={},i=[] ;this._filters.forEach(function(r){var s=r.split(this.FILTER_SEP,1),e=s[0],a=r.s ubstring(e.length+this.FILTER_SEP.length);"state"===e?t.state=[a]:("user"===e&&" none"===a&&(a=""),i.push(e+this.FILTER_SEP+swarming.alias.unapply(a)))}.bind(thi s)),t.tags=i;var r=parseInt(this._limit);return Number.isInteger(r)&&(r=Math.max (r,1),r=Math.min(1e3,r),t.limit=[r],this._limit!=r&&this.set("_limit",r)),t},_ma tchingBotsLink:function(t){var i=["id","os","task","status"];if(!t.tags||!this.d imensions)return this._botListLink([],i);var r=t.tags.filter(function(t){var i=t .split(this.FILTER_SEP,1)[0];return this.dimensions.indexOf(i)!==-1}.bind(this)) ;return r.forEach(function(t){var r=t.split(this.FILTER_SEP,1)[0];i.indexOf(r)== =-1&&i.push(r)}.bind(this)),this._botListLink(r,i)},_promptCancel:function(){ret urn this.query_params.tags&&this.query_params.tags.length?void this.fire("cancel -all",{tags:this.query_params.tags}):void sk.errorMessage("You can't batch cance l everything. Specify some tags to filter by first.",8e3)},_showTagMessage:func tion(t,i){return t&&"name"!==t&&!i}})}()</script> </dom-module><dom-module id="t ask-list-data" assetpath="/res/imp/tasklist/"> <script>!function(){var t=["aband oned_ts","completed_ts","created_ts","modified_ts","started_ts"],s=["quarantined ","error"];Polymer({is:"task-list-data",behaviors:[SwarmingBehaviors.CommonBehav ior,SwarmingBehaviors.TaskBehavior],properties:{auth_headers:{type:Object,observ er:"signIn"},query_params:{type:Object},tasks:{type:Array},busy:{type:Boolean,co mputed:"_or(_busy2,_busy1)",notify:!0},dimensions:{type:Array,computed:"_makeArr ay(_dimensions)",notify:!0},primary_map:{type:Object,computed:"_primaryMap(_tags ,_dimensions,tasks.*)",notify:!0},primary_arr:{type:Array,computed:"_primaryArr( primary_map)",notify:!0},_busy2:{type:Boolean,value:!1},_busy1:{type:Boolean,val ue:!1},_dimensions:{type:Object},_list:{type:Object},_tags:{type:Object}},signIn :function(){this._getJsonAsync("_tags","/api/swarming/v1/tasks/tags","_busy2",th is.auth_headers),this._getJsonAsync("_dimensions","/api/swarming/v1/bots/dimensi ons","_busy1",this.auth_headers)},_makeArray:function(t){if(!t||!t.bots_dimensio ns)return[];var a=[];return t.bots_dimensions.forEach(function(t){s.indexOf(t.ke y)===-1&&a.push(t.key)}),a.push("id"),a.sort(),a},_primaryArr:function(t){var s= Object.keys(t);return s.sort(),s},_primaryMap:function(s,a){s=s&&s.tasks_tags||[ ],a=a&&a.bots_dimensions||[],tasks=this.tasks||[];var e={};s.forEach(function(t) {e[t.key]||(e[t.key]={});var s=t.value||[];s.forEach(function(s){e[t.key][s]=!0} )}),a.forEach(function(t){var s=t.value;e[t.key]||(e[t.key]={}),s.forEach(functi on(s){e[t.key][s]=!0})}),tasks.forEach(function(t){Object.keys(t.tagMap).forEach (function(s){var a=t.tagMap[s];e[s]||(e[s]={}),e[s][a]=!0})}),e.user&&(delete e. user[""],e.user.none=!0);var r={};for(key in e){var n=Object.keys(e[key]);if(swa rming.alias.DIMENSIONS_WITH_ALIASES.indexOf(key)===-1)r[key]=n;else{var i=[];n.f orEach(function(t){i.push(swarming.alias.apply(t,key))}),r[key]=i}}return r.name =[],r.state=[this.PENDING,this.RUNNING,"PENDING_RUNNING",this.COMPLETED,"COMPLET ED_SUCCESS","COMPLETED_FAILURE",this.EXPIRED,this.TIMED_OUT,this.BOT_DIED,this.C ANCELED,"DEDUPED","ALL"],r.costs_usd=[],r.deduped_from=[],r.duration=[],r.server _versions=[],r.bot=[],t.forEach(function(t){r[t]=[]}),r},parseTasks:function(s){ if(!s||!s.items)return[];var a=new Date;return s.items.forEach(function(s){var e ={};s.tags=s.tags||[],s.tags.forEach(function(t){var s=t.split(":",1),a=s[0],r=t .substring(a.length+1);e[a]=r}),s.tagMap=e,t.forEach(function(t){s[t]&&(s[t]=new Date(s[t]),s["human_"+t]=sk.human.localeTime(s[t]))}),!s.duration&&s.state===th is.RUNNING&&s.started_ts&&(s.duration=(a-s.started_ts)/1e3),s.duration&&(s.human _duration=this._humanDuration(s.duration))}.bind(this)),s.items}})}()</script> < /dom-module> <dom-module id="task-list-summary" assetpath="/res/imp/tasklist/"> <template> <style include="swarming-app-style iron-flex">:host{display:block;bor der-left:1px solid #000;padding:5px 5px;font-family:sans-serif}.header{font-size :1.2em;font-weight:700}.column.left{margin-left:10px}.right{text-align:right}.le ft{text-align:left}</style> <div class="horizontal layout"> <div class="column"> <table> <thead> <tr><th class="header right" colspan="2">Selected</th> </tr></t head> <tbody><tr> <td class="right"> Displayed: </td> <td class="left">[[num_tas ks]]</td> </tr> <tr title="By default, these counts are from the last 24 hours"> <td class="right"> Total: </td> <td class="left">[[_selected_exact.count]]</td> </tr> <template is="dom-repeat" items="[[_selected_summary]]" as="item" index-a s="idx"> <tr title="By default, these counts are from the last 24 hours"> <td cl ass="right"> <a href$="[[_makeURL(item.name,'true',columns.*,sort)]]">[[item.hum an]]</a>: </td> <td class="left">[[_idx(_selected_counts, idx, _selected_counts. *)]]</td> </tr> </template> </tbody></table> </div> <div class="left column"> <t able> <thead> <tr><th class="header right" colspan="2">All Tasks in last 24h</th > </tr></thead> <template is="dom-repeat" items="[[_all_summary]]" as="item" ind ex-as="idx"> <tr title="By default, this is the last 24 hours"> <td class="right "> <a href$="[[_makeURL(item.name,'',columns.*,sort)]]">[[item.human]]</a>: </td > <td class="left">[[_idx(_all_counts, idx, _all_counts.*)]]</td> </tr> </templa te> </table> </div> </div> </template> <script> (function(){
789 var ALL_TASKS_SUMMARY = [
790 {name:"ALL", human:"All"},
791 {name:"BOT_DIED", human:"Bot Died"},
792 {name:"CANCELED", human:"Canceled"},
793 {name:"COMPLETED_SUCCESS", human:"Completed (Success)"},
794 {name:"COMPLETED_FAILURE", human:"Completed (Failure)"},
795 {name:"DEDUPED", human:"Deduplicated"},
796 {name:"EXPIRED", human:"Expired"},
797 {name:"PENDING", human:"Pending"},
798 {name:"RUNNING", human:"Running"},
799 {name:"TIMED_OUT", human:"Timed Out"},
800 ];
801 var SELECTED_TASKS_SUMMARY = [
802 {name:"BOT_DIED", human:"Bot Died"},
803 {name:"CANCELED", human:"Canceled"},
804 {name:"COMPLETED_SUCCESS", human:"Completed (Success)"},
805 {name:"COMPLETED_FAILURE", human:"Completed (Failure)"},
806 {name:"DEDUPED", human:"Deduplicated"},
807 {name:"EXPIRED", human:"Expired"},
808 {name:"PENDING", human:"Pending"},
809 {name:"RUNNING", human:"Running"},
810 {name:"TIMED_OUT", human:"Timed Out"},
811 ];
812 Polymer({
813 is: 'task-list-summary',
814
815 behaviors: [SwarmingBehaviors.CommonBehavior],
816
817 properties: {
818 auth_headers: {
819 type: Object,
820 },
821 busy: {
822 type: Boolean,
823 computed: "_anyBusy(_busyArr1.*,_busyArr2.*,_busy3)",
824 notify: true,
825 },
826 count_params: {
827 type: Object,
828 },
829 columns: {
830 type: Array,
831 },
832 num_tasks: {
833 type: Number,
834 },
835 sort: {
836 type: String,
837 },
838
839 _busyArr1: {
840 type:Array,
841 value: function() {
842 return [];
843 }
844 },
845 _busyArr2: {
846 type:Array,
847 value: function() {
848 return [];
849 }
850 },
851 _busy3: {
852 type: Boolean,
853 value: false,
854 },
855 _all_counts: {
856 type: Array,
857 value: function() {
858 return [];
859 }
860 },
861 _all_summary: {
862 type: Array,
863 value: function() {
864 return ALL_TASKS_SUMMARY;
865 }
866 },
867 _selected_counts: {
868 type: Array,
869 value: function() {
870 return [];
871 }
872 },
873 _selected_exact: {
874 type: Object,
875 },
876 _selected_summary: {
877 type: Array,
878 value: function() {
879 return SELECTED_TASKS_SUMMARY;
880 }
881 },
882
883 },
884
885 observers: [
886 "_recountEverything(auth_headers.*,count_params.*)"
887 ],
888
889 // Returns true if any of the busy signals are true.
890 _anyBusy: function() {
891 for (var i = 0; i<this._busyArr1.length; i++) {
892 if (this._busyArr1[i].status) {
893 return true;
894 }
895 }
896 for (var i = 0; i<this._busyArr2.length; i++) {
897 if (this._busyArr2[i].status) {
898 return true;
899 }
900 }
901 return this._busy3;
902 },
903
904 // Returns the idx'th count of obj.
905 _idx: function(obj, idx) {
906 return obj && obj[idx] && obj[idx].count;
907 },
908
909 // Recount all the task counts. This will make use of _getJsonAsyncArr bec ause
910 // the results will be generated in a dom-repeat.
911 _recountEverything: function() {
912 if (!this.auth_headers || !this.count_params) {
913 return;
914 }
915 // convert to seconds because API uses seconds.
916 var now = (new Date()).getTime()/1000;
917 var last2Days = now - 24 * 60 * 60;
918
919 // TODO(kjlubick): Once users can specify their own times, respect those limits here.
920
921 var queryObj = {
922 start: [last2Days],
923 };
924
925 for (var i = 0; i < ALL_TASKS_SUMMARY.length; i++) {
926 if (this._all_counts.length < ALL_TASKS_SUMMARY.length) {
927 this.push("_all_counts", {});
928 }
929 queryObj.state = [ALL_TASKS_SUMMARY[i].name];
930 this._getJsonAsyncArr(i, "_all_counts","/api/swarming/v1/tasks/count", "_busyArr1",
931 this.auth_headers, queryObj);
932 }
933
934 queryObj = JSON.parse(JSON.stringify(this.count_params));
935 queryObj.start = [last2Days];
936 this._getJsonAsync("_selected_exact","/api/swarming/v1/tasks/count","_bu sy3",
937 this.auth_headers, queryObj);
938
939 for (var j = 0; j < SELECTED_TASKS_SUMMARY.length; j++) {
940 if (this._selected_counts.length < SELECTED_TASKS_SUMMARY.length) {
941 this.push("_selected_counts", {});
942 }
943 queryObj.state = [SELECTED_TASKS_SUMMARY[j].name];
944 this._getJsonAsyncArr(j, "_selected_counts","/api/swarming/v1/tasks/co unt","_busyArr2",
945 this.auth_headers, queryObj);
946 }
947 },
948
949 // _makeURL creates a task-list url that keeps the columns and sort requir ements the same
950 // while changing which state is represented. The preserveOthers signifies if other
951 // filtering parameters (e.g. tags) should be kept as well.
952 _makeURL: function(state, preserveOthers) {
953 var fstr = "state:"+state;
954 if (preserveOthers) {
955 var fstr = encodeURIComponent(fstr);
956 var url = window.location.href;
957 if (url.indexOf(fstr+"&") !== -1) {
958 // The state filter is already on the list.
959 return undefined;
960 }
961 if (url.indexOf("f=state") === -1) {
962 return url + "&f=" + fstr;
963 }
964 // Things can't be in multiple states at once - so replace it.
965 // %3A is url encoded colon (:)
966 return url.replace(/f=state%3A[A-Z_]+/, `f=state%3A${fstr}`);
967 }
968 var params = {
969 s: [this.sort],
970 c: this.columns,
971 }
972 if (state) {
973 params["f"] = [fstr];
974 }
975
976 return window.location.href.split('?')[0] + '?' + sk.query.fromParamSet( params);
977 },
978
979 });
980 })(); </script> </dom-module><dom-module id="task-mass-cancel" assetpath="/r es/imp/tasklist/"> <template> <style>.container{padding:5px;max-width:800px}.can cel-button{background-color:red;color:#fff;font-weight:700}.cancel-button[disabl ed]{background-color:grey}</style> <div class="container"> <div> You are about t o cancel all PENDING task with the following tags: <ul> <template is="dom-repeat " items="[[tags]]" as="tag"> <li>[[tag]]</li> </template> </ul> This is about [[ _estimated_count]] tasks. Once you start the process, the only way to partially stop it is to close this browser window. If that sounds good, click the button b elow. </div> <paper-button class="cancel-button" raised="" disabled$="[[!_ready_ to_cancel]]" hidden$="[[started_canceling]]" on-tap="_cancel"> Cancel the Tasks </paper-button> <div> <div hidden$="[[!started_canceling]]">Progress: [[_cancele d_count]] queued for cancelation</div> <div>Note: tasks queued for cancellation will be canceled as soon as possible, but there may be some delay between when t his dialog box is closed and all tasks actually being canceled.</div> </div> </d iv> </template> <script> (function(){
789 var CANCEL_BATCH_SIZE = 100; 981 var CANCEL_BATCH_SIZE = 100;
790 Polymer({ 982 Polymer({
791 is: 'task-mass-cancel', 983 is: 'task-mass-cancel',
792 984
793 properties: { 985 properties: {
794 // input 986 // input
795 auth_headers: { 987 auth_headers: {
796 type: Object, 988 type: Object,
797 }, 989 },
798 tags: { 990 tags: {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 .then(JSON.parse).then(function(json){ 1070 .then(JSON.parse).then(function(json){
879 this._ready_to_cancel = true; 1071 this._ready_to_cancel = true;
880 this._estimated_count = json.count; 1072 this._estimated_count = json.count;
881 }.bind(this)) 1073 }.bind(this))
882 .catch(function(e){ 1074 .catch(function(e){
883 console.log(e); 1075 console.log(e);
884 sk.errorMessage(e); 1076 sk.errorMessage(e);
885 }); 1077 });
886 }, 1078 },
887 }); 1079 });
888 })() </script> </dom-module><dom-module id="task-list" assetpath="/res/imp/tas klist/"> <template> <style include="iron-flex iron-flex-alignment iron-positioni ng swarming-app-style dynamic-table-style task-style">task-filters{margin-bottom :8px;margin-right:10px}.task-list th>span{padding-right:30px}</style> <url-param name="s" value="{{_sortstr}}" default_value="created_ts:desc"> </url-param> <sw arming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" permission s="{{_permissions}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2)]]" na me="Swarming Task List"> <h2 hidden$="[[_signed_in]]">You must sign in to see an ything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-list-data id="dat a" auth_headers="[[_auth_headers]]" query_params="[[_query_params]]" tasks="[[_i tems]]" busy="{{_busy1)}}" dimensions="{{_dimensions}}" primary_map="{{_primary_ map}}" primary_arr="{{_primary_arr}}"> </task-list-data> <div class="horizontal layout"> <task-filters dimensions="[[_dimensions]]" permissions="[[_permissions] ]" primary_map="[[_primary_map]]" primary_arr="[[_primary_arr]]" special_columns ="[[_specialColumns]]" columns="{{_columns}}" query_params="{{_query_params}}" f ilter="{{_filter}}" on-cancel-all="_promptCancelAll"> </task-filters> </div> <ta ble class="task-list"> <thead on-sort_change="_sortChange"> <tr> <th> <span>Task Name</span> <sort-toggle name="name" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('state', _columns.*)]]"> <span>State</span> <sort-toggle na me="state" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('bot', _columns.*)]]"> <span>Bot Assigned</span> <sort-toggle name="bot" current="[[_s ort]]"> </sort-toggle> </th> <th hidden$="[[_hide('deduped_from', _columns.*)]]" > <span>Deduped from</span> <sort-toggle name="deduped_from" current="[[_sort]]" > </sort-toggle> </th> <th hidden$="[[_hide('source_revision', _columns.*)]]"> < span>Source Revision</span> <sort-toggle name="source_revision" current="[[_sort ]]"> </sort-toggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" as ="c"> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle name= "[[c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <tb ody> <template id="tasks_table" is="dom-repeat" items="[[_filteredSortedItems]]" as="task" initial-count="50"> <tr class$="[[_taskClass(task)]]"> <td> <a class= "center" href$="[[_taskLink(task.task_id)]]" target="_blank"> [[task.name]] </a> </td> <td hidden$="[[_hide('state', _columns.*)]]"> [[_column('state', task)]] <paper-button raised="" hidden$="[[_cannotCancel(task,_permissions)]]" on-tap="_ promptCancel"> Cancel </paper-button> </td> <td hidden$="[[_hide('bot', _columns .*)]]"> <a class="center" href$="[[_botLink(task.bot_id)]]" target="_blank"> [[_ column('bot',task)]] </a> </td> <td hidden$="[[_hide('deduped_from', _columns.*) ]]"> <a class="center" href$="[[_taskLink(task.deduped_from)]]" target="_blank"> [[_column('deduped_from',task)]] </a> </td> <td hidden$="[[_hide('source_revisi on', _columns.*)]]"> <a class="center" href$="[[_sourceLink(task)]]" target="_bl ank"> [[_column('source_revision',task)]] </a> </td> <template is="dom-repeat" i tems="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_column(c, task)] ] </td> </template> </tr> </template> </tbody> </table> <pageable-data id="page_ tasks" busy="{{_busy2}}" label="Show more tasks" output="{{_items}}" parse="[[_p arseTasks]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-butt on dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm ="">Yes</paper-button> </div> </paper-dialog> <paper-dialog id="cancel_all_dialo g" modal=""> <task-mass-cancel id="mass_cancel" auth_headers="[[_auth_headers]]" started_canceling="{{_started_canceling}}" finished_canceling="{{_finished_canc eling}}"> </task-mass-cancel> <div class="buttons"> <paper-button dialog-dismiss ="" autofocus="" hidden$="[[_started_canceling]]"> Go Back - Don't Cancel Anythi ng </paper-button> <paper-button dialog-dismiss="" autofocus="" hidden$="[[!_fin ished_canceling]]"> Done </paper-button> </div> </paper-dialog> </template> <scr ipt>!function(){function t(t){return function(e){return this._attribute(e,"human _"+t)[0]}}function e(t){return function(e,a,s){var n=this._attribute(a,t,"0")[0] ,i=this._attribute(s,t,"0")[0];return e*(n-i)}}var a=["deduped_from","name","sta te","bot","source_revision"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){r eturn this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd:f unction(t){return this._attribute(t,"costs_usd",0)[0]},created_ts:t("created_ts" ),duration:t("duration"),modified_ts:t("modified_ts"),source_revision:function(t ){var e=this._attribute(t,"source_revision")[0];return e.substring(0,8)},started _ts:t("started_ts"),state:function(t){var e=this._attribute(t,"state")[0];if("CO MPLETED"===e){if(this._attribute(t,"failure",!1)[0])return"COMPLETED (FAILURE)"; var a=this._attribute(t,"try_number","-1")[0];return"0"===a?"COMPLETED (DEDUPED) ":"COMPLETED (SUCCESS)"}return e}},n={abandoned_ts:"Abandoned On",completed_ts:" Completed On",created_ts:"Created On",duration:"Duration",modified_ts:"Last Modi fied",started_ts:"Started Working On",user:"Requesting User"},i={abandoned_ts:e( "abandoned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),durati on:e("duration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polyme r({is:"task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBeha viors.TaskBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,val ue:!1},_busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function( ){return this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap: {type:Object,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[ e];return t}},_headerMap:{type:Object,value:n},_specialColumns:{type:Array,value :a},_specialSort:{type:Object,value:i}},observers:["reload(_query_params,_auth_h eaders)"],_attribute:function(t,e,a){void 0===a&&(a="none");var s=this._tag(t,e) ||t[e]||[a];return Array.isArray(s)?s:[s]},_cannotCancel:function(t,e){return!(e &&e.cancel_task&&"PENDING"===this._column("state",t))},_cancelTask:function(){va r t="/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t," Canceling task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_p romptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:fu nction(t){var e=t.model.task;return e&&e.task_id?(this.set("_toCancel",e.task_id ),this.set("_dialogPrompt",'cancel task "'+e.name+'"'),void this.$.prompt.open() ):void console.log("Missing task info",e)},_promptCancelAll:function(t){this.$.m ass_cancel.tags=t.detail.tags,this.$.mass_cancel.prompt(),this.$.cancel_all_dial og.open()},_closeCancelAll:function(){this.$.cancel_all_dialog.close()},reload:f unction(){if(this._auth_headers&&this._query_params){var t="/api/swarming/v1/tas ks/list?"+sk.query.fromParamSet(this._query_params);this.$.page_tasks.load(t,thi s._auth_headers)}},_sourceLink:function(t){var e=this._attribute(t,"source_revis ion")[0],a=this._attribute(t,"source_repo")[0];return"none"!==e&&"none"!==a&&a.r eplace("%s",e)},_tag:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_taskClass :function(t){return this.stateClass(this._column("state",t))}})}()</script> </do m-module> <dom-module id="iron-collapse" assetpath="/res/imp/bower_components/ir on-collapse/"> <template> <style>:host{display:block;transition-duration:var(--i ron-collapse-transition-duration,300ms);overflow:visible}:host(.iron-collapse-cl osed){display:none}:host(:not(.iron-collapse-opened)){overflow:hidden}</style> < content></content> </template> </dom-module> <script>Polymer({is:"iron-collapse" ,behaviors:[Polymer.IronResizableBehavior],properties:{horizontal:{type:Boolean, value:!1,observer:"_horizontalChanged"},opened:{type:Boolean,value:!1,notify:!0, observer:"_openedChanged"},noAnimation:{type:Boolean},_desiredSize:{type:String, value:""}},get dimension(){return this.horizontal?"width":"height"},get _dimensi onMax(){return this.horizontal?"maxWidth":"maxHeight"},get _dimensionMaxCss(){re turn this.horizontal?"max-width":"max-height"},hostAttributes:{role:"group","ari a-hidden":"true","aria-expanded":"false"},listeners:{transitionend:"_transitionE nd"},attached:function(){this._transitionEnd()},toggle:function(){this.opened=!t his.opened},show:function(){this.opened=!0},hide:function(){this.opened=!1},upda teSize:function(i,t){if(i="auto"===i?"":i,this._desiredSize!==i){this._desiredSi ze=i,this._updateTransition(!1);var e=t&&!this.noAnimation&&this._isDisplayed;if (e){var n=this._calcSize();""===i&&(this.style[this._dimensionMax]="",i=this._ca lcSize()),this.style[this._dimensionMax]=n,this.scrollTop=this.scrollTop,this._u pdateTransition(!0),e=i!==n}this.style[this._dimensionMax]=i,e||this._transition End()}},enableTransition:function(i){Polymer.Base._warn("`enableTransition()` is deprecated, use `noAnimation` instead."),this.noAnimation=!i},_updateTransition :function(i){this.style.transitionDuration=i&&!this.noAnimation?"":"0s"},_horizo ntalChanged:function(){this.style.transitionProperty=this._dimensionMaxCss;var i ="maxWidth"===this._dimensionMax?"maxHeight":"maxWidth";this.style[i]="",this.up dateSize(this.opened?"auto":"0px",!1)},_openedChanged:function(){this.setAttribu te("aria-expanded",this.opened),this.setAttribute("aria-hidden",!this.opened),th is.toggleClass("iron-collapse-closed",!1),this.toggleClass("iron-collapse-opened ",!1),this.updateSize(this.opened?"auto":"0px",!0),this.opened&&this.focus()},_t ransitionEnd:function(){this.style[this._dimensionMax]=this._desiredSize,this.to ggleClass("iron-collapse-closed",!this.opened),this.toggleClass("iron-collapse-o pened",this.opened),this._updateTransition(!1),this.notifyResize()},get _isDispl ayed(){var i=this.getBoundingClientRect();for(var t in i)if(0!==i[t])return!0;re turn!1},_calcSize:function(){return this.getBoundingClientRect()[this.dimension] +"px"}})</script> <script>Polymer.IronMenubarBehaviorImpl={hostAttributes:{role: "menubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function (e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey :function(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},g et _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:fu nction(e){this._isRTL?this._focusNext():this._focusPrevious(),e.detail.keyboardE vent.preventDefault()},_onRightKey:function(e){this._isRTL?this._focusPrevious() :this._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeydown:function( e){this.keyboardEventMatchesKeys(e,"up down left right esc")||this._focusWithKey boardEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.Ir onMenubarBehaviorImpl]</script> <iron-iconset-svg name="paper-tabs" size="24"> < svg><defs> <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10. 83 12z"></path></g> <g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.5 8 4.59L10 18l6-6z"></path></g> </defs></svg> </iron-iconset-svg> <dom-module id= "paper-tab" assetpath="/res/imp/bower_components/paper-tabs/"> <template> <style >:host{@apply(--layout-inline);@apply(--layout-center);@apply(--layout-center-ju stified);@apply(--layout-flex-auto);position:relative;padding:0 12px;overflow:hi dden;cursor:pointer;vertical-align:middle;@apply(--paper-font-common-base);@appl y(--paper-tab)}:host(:focus){outline:0}:host([link]){padding:0}.tab-content{heig ht:100%;transform:translateZ(0);-webkit-transform:translateZ(0);transition:opaci ty .1s cubic-bezier(.4,0,1,1);@apply(--layout-horizontal);@apply(--layout-center -center);@apply(--layout-flex-auto);@apply(--paper-tab-content)}:host(:not(.iron -selected))>.tab-content{opacity:.8;@apply(--paper-tab-content-unselected)}:host (:focus) .tab-content{opacity:1;font-weight:700}paper-ripple{color:var(--paper-t ab-ink,--paper-yellow-a100)}.tab-content>::content>a{@apply(--layout-flex-auto); height:100%}</style> <div class="tab-content"> <content></content> </div> </temp late> <script>Polymer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polyme r.IronButtonState,Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,va lue:!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_upd ateNoink",tap:"_onTap"},attached:function(){this._updateNoink()},get _parentNoin k(){var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:functi on(){this.noink=!!this.noink||!!this._parentNoink},_onTap:function(t){if(this.li nk){var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e .click()}}})</script> </dom-module> <dom-module id="paper-tabs" assetpath="/res/ imp/bower_components/paper-tabs/"> <template> <style>:host{@apply(--layout);@app ly(--layout-center);height:48px;font-size:14px;font-weight:500;overflow:hidden;- moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:n one;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transpar ent;@apply(--paper-tabs)}:host-context([dir=rtl]){@apply(--layout-horizontal-rev erse)}#tabsContainer{position:relative;height:100%;white-space:nowrap;overflow:h idden;@apply(--layout-flex-auto)}#tabsContent{height:100%;-moz-flex-basis:auto;- ms-flex-basis:auto;flex-basis:auto}#tabsContent.scrollable{position:absolute;whi te-space:nowrap}#tabsContent.scrollable.fit-container,#tabsContent:not(.scrollab le){@apply(--layout-horizontal)}#tabsContent.scrollable.fit-container{min-width: 100%}#tabsContent.scrollable.fit-container>::content>*{-ms-flex:1 0 auto;-webkit -flex:1 0 auto;flex:1 0 auto}.hidden{display:none}.not-visible{opacity:0;cursor: default}paper-icon-button{width:48px;height:48px;padding:12px;margin:0 4px}#sele ctionBar{position:absolute;height:2px;bottom:0;left:0;right:0;background-color:v ar(--paper-tabs-selection-bar-color,--paper-yellow-a100);-webkit-transform:scale (0);transform:scale(0);-webkit-transform-origin:left center;transform-origin:lef t center;transition:-webkit-transform;transition:transform;@apply(--paper-tabs-s election-bar)}#selectionBar.align-bottom{top:0;bottom:auto}#selectionBar.expand{ transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,1,1)}#sele ctionBar.contract{transition-duration:.18s;transition-timing-function:cubic-bezi er(0,0,.2,1)}#tabsContent>::content>:not(#selectionBar){height:100%}</style> <pa per-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonCla ss(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-d own="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> <div id="tabsCo ntainer" on-track="_scroll" on-down="_down"> <div id="tabsContent" class$="[[_co mputeTabsContentClass(scrollable, fitContainer)]]"> <div id="selectionBar" class $="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTr ansitionEnd"></div> <content select="*"></content> </div> </div> <paper-icon-but ton icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHi dden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRi ghtScrollButtonDown" tabindex="-1"></paper-icon-button> </template> <script>Poly mer({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polymer.IronMenuba rBehavior],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},no Bar:{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boo lean,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,va lue:!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,valu e:!1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value: !1},autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDela y:{type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:B oolean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},lis teners:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingCh anged","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindi ngs:{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob= null,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,th is._bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this. addEventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){thi s.setScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancel PendingActivation()},_noinkChanged:function(t){var e=Polymer.dom(this).querySele ctorAll("paper-tab");e.forEach(t?this._setNoinkAttribute:this._removeNoinkAttrib ute)},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAtt ribute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:functio n(t,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsContentClass:funct ion(t,e){return t?"scrollable"+(e?" fit-container":""):" fit-container"},_comput eSelectionBarClass:function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSi zingChanged:function(){this.debounce("_onTabSizingChanged",function(){this._scro ll(),this._tabChanged(this.selectedItem)},10)},_onIronSelect:function(t){this._t abChanged(t.detail.item,this._previousTab),this._previousTab=t.detail.item,this. cancelDebouncer("tab-changed")},_onIronDeselect:function(t){this.debounce("tab-c hanged",function(){this._tabChanged(null,this._previousTab),this._previousTab=nu ll},1)},_activateHandler:function(){this._cancelPendingActivation(),Polymer.Iron MenuBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleActivation:fun ction(t,e){this._pendingActivationItem=t,this._pendingActivationTimeout=this.asy nc(this._bindDelayedActivationHandler,e)},_delayedActivationHandler:function(){v ar t=this._pendingActivationItem;this._pendingActivationItem=void 0,this._pendin gActivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable: !0})},_cancelPendingActivation:function(){void 0!==this._pendingActivationTimeou t&&(this.cancelAsync(this._pendingActivationTimeout),this._pendingActivationItem =void 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.a utoselect&&this._scheduleActivation(this.focusedItem,this.autoselectDelay)},_onB lurCapture:function(t){t.target===this._pendingActivationItem&&this._cancelPendi ngActivation()},get _tabContainerScrollSize(){return Math.max(0,this.$.tabsConta iner.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(thi s.scrollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:function(t){this. async(function(){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAs ync),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){this.$.tabsCon tainer.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0=== e,this._rightHidden=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:fu nction(){this._scrollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind( this),this._holdDelay)},_onRightScrollButtonDown:function(){this._scrollToRight( ),this._holdJob=setInterval(this._scrollToRight.bind(this),this._holdDelay)},_on ScrollButtonUp:function(){clearInterval(this._holdJob),this._holdJob=null},_scro llToLeft:function(){this._affectScroll(-this._step)},_scrollToRight:function(){t his._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)return this.$.sel ectionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contr act"),void this._positionBar(0,0);var i=this.$.tabsContent.getBoundingClientRect (),n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._pos={width:thi s._calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide||null==e)ret urn this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList .remove("contract"),void this._positionBar(this._pos.width,this._pos.left);var a =e.getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.indexOf(t),r=5;t his.$.selectionBar.classList.add("expand");var h=l<c,d=this._isRTL;d&&(h=!h),h?t his._positionBar(this._calcPercent(o.left+o.width-a.left,n)-r,this._left):this._ positionBar(this._calcPercent(a.left+a.width-o.left,n)-r,this._calcPercent(s,n)+ r),this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scrollToSelected IfNeeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0?this.$.tabsCo ntainer.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth,i>0&&(this.$.tabsCo ntainer.scrollLeft+=i))},_calcPercent:function(t,e){return 100*t/e},_positionBar :function(t,e){t=t||0,e=e||0,this._width=t,this._left=e,this.transform("translat eX("+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function (t){var e=this.$.selectionBar.classList;e.contains("expand")?(e.remove("expand") ,e.add("contract"),this._positionBar(this._pos.width,this._pos.left)):e.contains ("contract")&&e.remove("contract")}})</script> </dom-module> <dom-module id="sin gle-page-style" assetpath="/res/imp/common/"> <template> <style>.header{max-widt h:800px}.title{font-size:1.5em;font-weight:700;margin:5px}.id_input{margin-left: 5px;--paper-input-container-input:{font-size:2em};}.refresh{max-width:40px;max-h eight:40px;width:initial;height:initial}button{min-width:4em;max-height:55px}tab le{border-collapse:collapse;margin-left:5px;margin-bottom:8px}td,th{border:1px s olid #BBB;padding:5px}.tabs{background-color:#1F78B4;color:#fff;max-width:600px; margin-left:5px;--paper-checkbox-label-color:#fff}paper-tab{background-color:#A6 CEE3;color:#000}paper-tab.iron-selected{background-color:#1F78B4;color:#fff;font -weight:700;text-decoration:underline}paper-tab[disabled]{background-color:#AAA; text-decoration:line-through}.quarantined{background-color:#fdd}.dead{background -color:#ccc}paper-checkbox{--paper-checkbox-checked-color:#1F78B4}</style> </tem plate> </dom-module><script>!function(){SwarmingBehaviors.BotPageBehavior=[Swarm ingBehaviors.CommonBehavior,{}]}()</script> <dom-module id="bot-page-data" asset path="/res/imp/botpage/"> <script>!function(){function t(t){if(!s){var e=t.toStr ing();s=e.substring(e.indexOf("("))}return t.toLocaleString()+" "+s}var e,s,i=40 0,n=["first_seen_ts","last_seen_ts","lease_expiration_ts"],a=["started_ts","comp leted_ts","abandoned_ts","modified_ts"];Polymer({is:"bot-page-data",behaviors:[S warmingBehaviors.BotPageBehavior],properties:{auth_headers:{type:Object},bot_id: {type:String},busy:{type:Boolean,computed:"_or(_busy1)",notify:!0},bot:{type:Obj ect,computed:"_parseBot(_bot)",notify:!0},bot_exists:{type:Boolean,value:!0,noti fy:!0},_busy1:{type:Boolean,value:!1},_bot:{type:Object},_events:{type:Object},_ tasks:{type:Object}},observers:["request(auth_headers,bot_id)"],request:function (){this.bot_id&&this.auth_headers&&(e&&this.cancelAsync(e),e=this.async(function (){e=void 0;var t="/api/swarming/v1/bot/"+this.bot_id,s=this._getJsonAsync("_bot ",t+"/get","_busy1",this.auth_headers);s.then(function(){this.set("bot_exists",! 0)}.bind(this)).catch(function(t){404===t.status?this.set("bot_exists",!1):sk.er rorMessage("Http response: "+(t.status||" ")+" "+t.response)}.bind(this)),this.f ire("reload",{id:this.bot_id})},i))},_parseBot:function(e){if(!e)return{};e.stat e=e.state||"{}",e.state=JSON.parse(e.state)||{};var s=e.state.disks||{},i=Object .keys(s);if(i.length){e.disks=[];for(var a=0;a<i.length;a++)e.disks.push({id:i[a ],mb:s[i[a]].free_mb});e.disks.sort(function(t,e){return e.mb-t.mb})}else e.disk s=[{id:"unknown",mb:0}];return e.dimensions=e.dimensions||[],e.dimensions.forEac h(function(t){swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(t.key)!==-1&&t.valu e.forEach(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)})}),n.forEach(f unction(s){e[s]&&(e[s]=new Date(e[s]),e["human_"+s]=t(e[s]))}),e},parseEvents:fu nction(e){if(!e||!e.items)return[];var e=e.items;return e.forEach(function(e){e. ts&&(e.ts=new Date(e.ts),e.human_ts=t(e.ts))}),e.sort(function(t,e){return e.ts- t.ts}),e},parseTasks:function(e){if(!e||!e.items)return[];var e=e.items;return e .forEach(function(e){if(a.forEach(function(s){e[s]&&(e[s]=new Date(e[s]),e["huma n_"+s]=t(e[s]))}),e.duration)e.human_duration=this._humanDuration(e.duration);el se{var s=e.completed_ts||e.abandoned_ts||e.modified_ts||new Date;e.human_duratio n=this._timeDiffExact(e.started_ts,s),e.duration=(s.getTime()-e.started_ts)/1e3} e.state=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.state="FAILURE":e .state="SUCCESS")}.bind(this)),e.sort(function(t,e){return e.started_ts-t.starte d_ts}),e}})}()</script> </dom-module> <dom-module id="bot-page-summary" assetpat h="/res/imp/botpage/"> <template> <style include="single-page-style">.wrapper{di splay:table;margin-left:auto;margin-bottom:10px;margin-right:5px}paper-checkbox{ margin-left:5px}.thick{border-top-style:solid}</style> <url-param name="show_ful l_names" value="{{_show_full_names}}"> </url-param> <url-param name="show_all_ta sks" value="{{_show_all_tasks}}"> </url-param> <url-param name="sort_stats" valu e="{{_sortstr}}" default_value="total:desc"> </url-param> <div class="wrapper"> <table> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name</span> <sort-t oggle name="full_name" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Tota l</span> <sort-toggle name="total" current="[[_sort]]"> </sort-toggle> </th> <th > <span>Success</span> <sort-toggle name="success" current="[[_sort]]"> </sort-t oggle> </th> <th> <span>Failed</span> <sort-toggle name="failed" current="[[_sor t]]"> </sort-toggle> </th> <th> <span>Died</span> <sort-toggle name="bot_died" c urrent="[[_sort]]"> </sort-toggle> </th> <th> <span>Average Duration</span> <sor t-toggle name="avg_duration" current="[[_sort]]"> </sort-toggle> </th> <th> <spa n>Total Duration</span> <sort-toggle name="total_time" current="[[_sort]]"> </so rt-toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> <template is=" dom-repeat" items="[[_tasksToShow]]" as="task"> <tr> <td hidden$="[[_truthy(_sho w_full_names)]]" title="[[task.full_name]]">[[task.name]]</td> <td hidden$="[[_n ot(_show_full_names)]]" title="[[task.full_name]]">[[task.full_name]]</td> <td>[ [task.total]]</td> <td>[[task.success]]</td> <td>[[task.failed]]</td> <td>[[task .bot_died]]</td> <td>[[_humanDuration(task.avg_duration)]]</td> <td>[[_humanDura tion(task.total_time)]]</td> <td>[[task.total_time_percent]]%</td> </tr> </templ ate> </tbody> <tbody><tr class="thick"> <td>Total</td> <td>[[_totalStats.total]] </td> <td>[[_totalStats.success]]</td> <td>[[_totalStats.failed]]</td> <td>[[_to talStats.bot_died]]</td> <td>[[_humanDuration(_totalStats.avg_duration)]]</td> < td>[[_humanDuration(_totalStats.total_time)]]</td> <td>100.0%</td> </tr> </tbody ></table> <div> <table> <thead> <tr> <th title="How much time passed between the oldest task fetched and now."> Total Wall Time </th> <th title="How much of the wall time this bot was busy with a task."> Wall Time Utilization </th> </tr> </ thead> <tbody> <tr> <td>[[_humanDuration(_totalStats.wall_time)]]</td> <td>[[_to talStats.wall_time_utilization]]%</td> </tr> </tbody> </table> <paper-checkbox c hecked="{{_show_full_names}}"> Show Full Names </paper-checkbox> <paper-checkbox hidden$="[[_cannotExpand]]" checked="{{_show_all_tasks}}"> Show All Tasks </pap er-checkbox> </div> </div> </template> <script>!function(){var t=15;Polymer({is: "bot-page-summary",behaviors:[SwarmingBehaviors.BotPageBehavior],properties:{tas ks:{type:Array},_cannotExpand:{type:Boolean,computed:"_countTasks(_taskStats.*)" },_show_all_tasks:{type:Boolean},_show_full_names:{type:Boolean},_sortstr:{type: String},_sort:{type:Object,computed:"_makeSortObject(_sortstr)"},_taskStats:{typ e:Array},_tasksToShow:{type:Array,computed:"_sortAndLimitTasks(_taskStats.*,_sor t.*,_show_all_tasks)"},_totalStats:{type:Object}},observers:["_aggregate(tasks.* )"],_aggregate:function(){if(this.tasks&&this.tasks.length){var t=new Date(1e3*s k.now()),a={},e={total:this.tasks.length,success:0,failed:0,bot_died:0,avg_durat ion:0,total_time:0,wall_time:(t-this.tasks[this.tasks.length-1].started_ts)/1e3} ;this.tasks.forEach(function(t){var s=t.name.trim(),i=s.split("/");5===i.length& &(s=i[0]+"/"+i[3]),a[s]||(a[s]={full_name:s,name:s,total:0,success:0,failed:0,bo t_died:0,avg_duration:0,total_time:0}),a[s].total++,t.failure?(e.failed++,a[s].f ailed++):t.internal_failure?(e.bot_died++,a[s].bot_died++):(e.success++,a[s].suc cess++),e.total_time+=t.duration,a[s].total_time+=t.duration}),e.avg_duration=e. total_time/e.total,e.wall_time_utilization=(100*e.total_time/e.wall_time).toFixe d(1),this.set("_totalStats",e);var s=Object.keys(a),i=[];s.forEach(function(t){a [t].avg_duration=a[t].total_time/a[t].total,a[t].total_time_percent=(100*a[t].to tal_time/e.total_time).toFixed(1),i.push(a[t])});var o=new Substrings({minOccurr ence:Math.max(2,s.length-1),minLength:6});o.build(s);var n=o.weighByAverage()||[ ];n.length&&n[0].source.forEach(function(t){var a=i[t].full_name;i[t].name=a.rep lace(n[0].name,"...")}),this.set("_taskStats",i)}},_compare:function(t,a){if(!th is._sort)return 0;var e=1;return"desc"===this._sort.direction&&(e=-1),e*swarming .naturalCompare(t[this._sort.name],a[this._sort.name])},_countTasks:function(){r eturn this._taskStats.length<=t},_makeSortObject:function(t){if(t){var a=t.split (":");return 2!=a.length?{name:"full_name",direction:"asc"}:{name:a[0],direction :a[1]}}},_sortAndLimitTasks:function(){swarming.stableSort(this._taskStats,this. _compare.bind(this));var a=this._taskStats.length;return!this._show_all_tasks&&t his._taskStats.length>t&&(a=t),this._taskStats.slice(0,a)},_sortChange:function( t){t&&t.detail&&t.detail.name&&(t.preventDefault(),t.stopPropagation(),this.set( "_sortstr",t.detail.name+":"+t.detail.direction))}})}()</script> </dom-module><d om-module id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include ="iron-flex iron-flex-alignment iron-positioning swarming-app-style single-page- style task-style">.message{white-space:pre-line;font-family:monospace}.bot_state {white-space:pre;font-family:monospace;margin-bottom:10px}.events_table,.tasks_t able{border:3px solid #1F78B4}.old_version{background-color:#ffd}.stats{min-widt h:700px;flex-grow:2}#collapse{max-width:700px}.cloud{white-space:nowrap;margin-b ottom:5px;margin-top:auto}.deleted{text-align:center;font-size:larger}paper-dial og{border-radius:6px}</style> <url-param name="id" value="{{bot_id}}"> </url-par am> <url-param name="show_all_events" value="{{_show_all}}"> </url-param> <url-p aram name="selected" value="{{_selected}}"> </url-param> <url-param name="show_s tate" value="{{_show_state}}"> </url-param> <swarming-app client_id="[[client_id ]]" auth_headers="{{_auth_headers}}" permissions="{{_permissions}}" server_detai ls="{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2,_b usy3)]]" name="Swarming Bot Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <bot-page-dat a id="data" auth_headers="[[_auth_headers]]" bot_id="[[bot_id]]" bot="{{_bot}}" bot_exists="{{_bot_exists}}" busy="{{_busy1}}" events="{{_events}}" tasks="{{_ta sks}}" on-reload="_clearAndReload"> </bot-page-data> <div class="header horizont al layout"> <paper-input class="id_input" label="Bot id" value="{{bot_id}}"></pa per-input> <template is="dom-if" if="[[_ccLink(_bot)]]"> <div class="vertical la yout"> <a href$="[[_ccLink(_bot)]]" class="cloud">Cloud Console</a> </div> </tem plate> <button on-click="_refresh"> <iron-icon class="refresh" icon="icons:refre sh"></iron-icon> </button> </div> </div> <h2 hidden$="[[_bot_exists]]">Bot not f ound.</h2> <div hidden$="[[_not(_bot_exists)]]"> <div class="horizontal wrap lay out"> <div class="flex"> <table> <template is="dom-if" if="[[_bot.deleted]]"> <t r class="dead deleted" title="This bot was deleted."> <td colspan="3">THIS BOT W AS DELETED</td> </tr> </template> <tbody><tr class$="[[_isDead(_bot)]]" title="L ast time the bot contacted the server."> <td>Last Seen</td> <td title="[[_bot.hu man_last_seen_ts]]"> [[_timeDiffExact(_bot.last_seen_ts)]] ago</td> <td> <templa te is="dom-if" if="[[_canShutdown(_bot,_permissions)]]"> <button class="raised" on-click="_promptShutdown"> Shut Down Gracefully </button> </template> <template is="dom-if" if="[[_canDelete(_bot,_permissions)]]"> <button class="raised" on-c lick="_promptDelete"> Delete </button> </template> </td> </tr> <template is="dom -if" if="[[_bot.quarantined]]"> <tr class="quarantined"> <td>Quarantined</td> <t d colspan="2" class="message">[[_quarantineMessage(_bot)]]</td> </tr> </template > <tr> <td>Current Task</td> <td> <a target="_blank" rel="noopener" href$="[[_ta skLink(_bot.task_id)]]"> [[_task(_bot)]] </a> </td> <td> </td> </tr> <tr> <td ro wspan$="[[_numRows(_bot.dimensions)]]"> <a href$="[[_siblingBotsLink(_bot.dimens ions)]]" title="The list of bots that also matches these dimensions (except id). "> Dimensions</a> </td> </tr> <template is="dom-repeat" items="[[_bot.dimensions ]]" as="dim"> <tr> <td>[[dim.key]]</td> <td>[[_concat(dim.value)]]</td> </tr> </ template> <tr title="IP address that the server saw the connection from."> <td>E xternal IP</td> <td><a href$="[[_bot.external_ip]]">[[_bot.external_ip]]</a></td > <td></td> </tr> <tr class$="[[_classVersion(_server_details.bot_version,_bot.v ersion)]]" title="Version is based on the content of swarming_bot.zip which is t he swarming bot code. The bot won't update if quarantined, dead, or busy."> <td> Bot Version</td> <td>[[_shorten(_bot.version,'8')]]</td> <td></td> </tr> <tr tit le="The version the server expects the bot to be using."> <td>Expected Bot Versi on</td> <td>[[_shorten(_server_details.bot_version,'8')]]</td> <td></td> </tr> < tr title="First time ever a bot with this id contacted the server."> <td>First s een</td> <td title="[[_bot.human_first_seen_ts]]"> [[_timeDiffApprox(_bot.first_ seen_ts)]] ago </td> <td></td> </tr> <tr title="How the bot is authenticated by the server."> <td>Authenticated as</td> <td colspan="2">[[_bot.authenticated_as] ]</td> </tr> <template is="dom-if" if="[[_bot.lease_id]]"> <tr> <td>Machine Prov ider Lease ID</td> <td colspan="2"> <a href$="[[_mpLink(_bot,_server_details.mac hine_provider_template)]]"> [[_bot.lease_id]] </a> </td> </tr> <tr> <td>Machine Provider Lease Expires</td> <td colspan="2">[[_bot.human_lease_expiration_ts]]</ td> </tr> </template> </tbody></table> <span class="title">State</span> <templat e is="dom-if" if="[[_not(_show_state)]]"> <button on-click="_toggleState"> <iron -icon icon="icons:add-circle-outline"></iron-icon> </button> </template> <templa te is="dom-if" if="[[_show_state]]"> <button on-click="_toggleState"> <iron-icon icon="icons:remove-circle-outline"></iron-icon> </button> </template> <iron-col lapse id="collapse" opened="[[_show_state]]"> <div class="bot_state">[[_prettyPr int(_bot.state)]]</div> </iron-collapse> </div> <div class="stats flex"> <bot-pa ge-summary tasks="[[_tasks]]"> </bot-page-summary> </div> </div> <div class="tab s"> <paper-tabs selected="{{_selected}}" no-bar=""> <paper-tab>Tasks</paper-tab> <paper-tab>Events</paper-tab> </paper-tabs> <template is="dom-if" if="[[_showEv ents]]"> <paper-checkbox checked="{{_show_all}}"> Show all events </paper-checkb ox> </template> </div> <template is="dom-if" if="[[_not(_showEvents)]]"> <table class="tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</t h> <th>Result</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_ta sks}}" as="task"> <tr class$="[[_taskClass(task)]]"> <td> <a target="_blank" rel ="noopener" href$="[[_taskLink(task.task_id)]]"> [[task.name]] </a> </td> <td>[[ task.human_started_ts]]</td> <td title="[[task.human_completed_ts]]">[[task.huma n_duration]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </table> </ template> <template is="dom-if" if="[[_showEvents]]"> <table class="events_table "> <thead> <tr> <th>Message</th> <th>Type</th> <th>Timestamp</th> <th>Task ID</t h> <th>Version</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_e ventList(_show_all,_events.*)}}" as="event"> <tr> <td class="message">[[event.me ssage]]</td> <td>[[event.event_type]]</td> <td>[[event.human_ts]]</td> <td> <a t arget="_blank" rel="noopener" href$="[[_taskLink(event.task_id)]]"> [[event.task _id]] </a> </td> <td class$="[[_classVersion(_server_details.bot_version,event.v ersion)]]"> [[_shorten(event.version,'8')]] </td> </tr> </template> </tbody> </t able> </template> <pageable-data id="page_tasks" hidden$="[[_showEvents]]" busy= "{{_busy2}}" label="Show more tasks" output="{{_tasks}}" parse="[[_parseTasks]]" > </pageable-data> <pageable-data id="page_events" hidden$="[[_not(_showEvents)] ]" busy="{{_busy3}}" label="Show more events" output="{{_events}}" parse="[[_par seEvents]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" m odal="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-butto n dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm= "">Yes</paper-button> </div> </paper-dialog> </template> <script> (function(){ 1080 })() </script> </dom-module><dom-module id="task-list" assetpath="/res/imp/tas klist/"> <template> <style include="iron-flex iron-flex-alignment iron-positioni ng swarming-app-style dynamic-table-style task-style">task-filters,task-list-sum mary{margin-bottom:8px;margin-right:10px}.task-list th>span{padding-right:30px}< /style> <url-param name="s" value="{{_sortstr}}" default_value="created_ts:desc" > </url-param> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_hea ders}}" permissions="{{_permissions}}" signed_in="{{_signed_in}}" busy="[[_or(_b usy1,_busy2,_busy3)]]" name="Swarming Task List"> <h2 hidden$="[[_signed_in]]">Y ou must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]" > <task-list-data id="data" auth_headers="[[_auth_headers]]" query_params="[[_qu ery_params]]" tasks="[[_items]]" busy="{{_busy1)}}" dimensions="{{_dimensions}}" primary_map="{{_primary_map}}" primary_arr="{{_primary_arr}}"> </task-list-data > <div class="horizontal layout"> <task-filters dimensions="[[_dimensions]]" per missions="[[_permissions]]" primary_map="[[_primary_map]]" primary_arr="[[_prima ry_arr]]" special_columns="[[_specialColumns]]" columns="{{_columns}}" query_par ams="{{_query_params}}" filter="{{_filter}}" on-cancel-all="_promptCancelAll"> < /task-filters> <task-list-summary auth_headers="[[_auth_headers]]" busy="{{_busy 3}}" columns="[[_columns]]" count_params="[[_query_params]]" num_tasks="[[_filte redSortedItems.length]]" sort="[[_sortstr]]"> </task-list-summary> </div> <table class="task-list"> <thead on-sort_change="_sortChange"> <tr> <th> <span>Task Na me</span> <sort-toggle name="name" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('state', _columns.*)]]"> <span>State</span> <sort-toggle name= "state" current="[[_sort]]"> </sort-toggle> </th> <th hidden$="[[_hide('bot', _c olumns.*)]]"> <span>Bot Assigned</span> <sort-toggle name="bot" current="[[_sort ]]"> </sort-toggle> </th> <th hidden$="[[_hide('deduped_from', _columns.*)]]"> < span>Deduped from</span> <sort-toggle name="deduped_from" current="[[_sort]]"> < /sort-toggle> </th> <th hidden$="[[_hide('source_revision', _columns.*)]]"> <spa n>Source Revision</span> <sort-toggle name="source_revision" current="[[_sort]]" > </sort-toggle> </th> <template is="dom-repeat" items="[[_plainColumns]]" as="c "> <th hidden$="[[_hide(c)]]"> <span>[[_header(c)]]</span> <sort-toggle name="[[ c]]" current="[[_sort]]"> </sort-toggle> </th> </template> </tr> </thead> <tbody > <template id="tasks_table" is="dom-repeat" items="[[_filteredSortedItems]]" as ="task" initial-count="50"> <tr class$="[[_taskClass(task)]]"> <td> <a class="ce nter" href$="[[_taskLink(task.task_id)]]" target="_blank"> [[task.name]] </a> </ td> <td hidden$="[[_hide('state', _columns.*)]]"> [[_column('state', task)]] <pa per-button raised="" hidden$="[[_cannotCancel(task,_permissions)]]" on-tap="_pro mptCancel"> Cancel </paper-button> </td> <td hidden$="[[_hide('bot', _columns.*) ]]"> <a class="center" href$="[[_botLink(task.bot_id)]]" target="_blank"> [[_col umn('bot',task)]] </a> </td> <td hidden$="[[_hide('deduped_from', _columns.*)]]" > <a class="center" href$="[[_taskLink(task.deduped_from)]]" target="_blank"> [[ _column('deduped_from',task)]] </a> </td> <td hidden$="[[_hide('source_revision' , _columns.*)]]"> <a class="center" href$="[[_sourceLink(task)]]" target="_blank "> [[_column('source_revision',task)]] </a> </td> <template is="dom-repeat" item s="[[_plainColumns]]" as="c"> <td hidden$="[[_hide(c)]]"> [[_column(c, task)]] < /td> </template> </tr> </template> </tbody> </table> <pageable-data id="page_tas ks" busy="{{_busy2}}" label="Show more tasks" output="{{_items}}" parse="[[_pars eTasks]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" mod al="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are yo u sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm="" >Yes</paper-button> </div> </paper-dialog> <paper-dialog id="cancel_all_dialog" modal=""> <task-mass-cancel id="mass_cancel" auth_headers="[[_auth_headers]]" st arted_canceling="{{_started_canceling}}" finished_canceling="{{_finished_canceli ng}}"> </task-mass-cancel> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="" hidden$="[[_started_canceling]]"> Go Back - Don't Cancel Anything </paper-button> <paper-button dialog-dismiss="" autofocus="" hidden$="[[!_finish ed_canceling]]"> Done </paper-button> </div> </paper-dialog> </template> <script >!function(){function t(t){return function(e){return this._attribute(e,"human_"+ t)[0]}}function e(t){return function(e,a,s){var n=this._attribute(a,t,"0")[0],i= this._attribute(s,t,"0")[0];return e*(n-i)}}var a=["deduped_from","name","state" ,"bot","source_revision"],s={abandoned_ts:t("abandoned_ts"),bot:function(t){retu rn this._attribute(t,"bot_id")[0]},completed_ts:t("completed_ts"),costs_usd:func tion(t){return this._attribute(t,"costs_usd",0)[0]},created_ts:t("created_ts"),d uration:t("duration"),modified_ts:t("modified_ts"),source_revision:function(t){v ar e=this._attribute(t,"source_revision")[0];return e.substring(0,8)},started_ts :t("started_ts"),state:function(t){var e=this._attribute(t,"state")[0];if("COMPL ETED"===e){if(this._attribute(t,"failure",!1)[0])return"COMPLETED (FAILURE)";var a=this._attribute(t,"try_number","-1")[0];return"0"===a?"COMPLETED (DEDUPED)":" COMPLETED (SUCCESS)"}return e}},n={abandoned_ts:"Abandoned On",completed_ts:"Com pleted On",created_ts:"Created On",duration:"Duration",modified_ts:"Last Modifie d",started_ts:"Started Working On",user:"Requesting User"},i={abandoned_ts:e("ab andoned_ts"),completed_ts:e("completed_ts"),created_ts:e("created_ts"),duration: e("duration"),modified_ts:e("modified_ts"),started_ts:e("started_ts")};Polymer({ is:"task-list",behaviors:[SwarmingBehaviors.DynamicTableBehavior,SwarmingBehavio rs.TaskBehavior],properties:{client_id:{type:String},_busy1:{type:Boolean,value: !1},_busy2:{type:Boolean,value:!1},_parseTasks:{type:Function,value:function(){r eturn this.$.data.parseTasks.bind(this)}},_toCancel:{type:String},_columnMap:{ty pe:Object,value:function(){var t=this._commonColumns();for(var e in s)t[e]=s[e]; return t}},_headerMap:{type:Object,value:n},_specialColumns:{type:Array,value:a} ,_specialSort:{type:Object,value:i}},observers:["reload(_query_params,_auth_head ers)"],_attribute:function(t,e,a){void 0===a&&(a="none");var s=this._tag(t,e)||t [e]||[a];return Array.isArray(s)?s:[s]},_cannotCancel:function(t,e){return!(e&&e .cancel_task&&"PENDING"===this._column("state",t))},_cancelTask:function(){var t ="/api/swarming/v1/task/"+this._toCancel+"/cancel";swarming.postWithToast(t,"Can celing task "+this._toCancel,this._auth_headers),this.set("_toCancel","")},_prom ptClosed:function(t){t.detail.confirmed&&this._cancelTask()},_promptCancel:funct ion(t){var e=t.model.task;return e&&e.task_id?(this.set("_toCancel",e.task_id),t his.set("_dialogPrompt",'cancel task "'+e.name+'"'),void this.$.prompt.open()):v oid console.log("Missing task info",e)},_promptCancelAll:function(t){this.$.mass _cancel.tags=t.detail.tags,this.$.mass_cancel.prompt(),this.$.cancel_all_dialog. open()},_closeCancelAll:function(){this.$.cancel_all_dialog.close()},reload:func tion(){if(this._auth_headers&&this._query_params){var t="/api/swarming/v1/tasks/ list?"+sk.query.fromParamSet(this._query_params);this.$.page_tasks.load(t,this._ auth_headers)}},_sourceLink:function(t){var e=this._attribute(t,"source_revision ")[0],a=this._attribute(t,"source_repo")[0];return"none"!==e&&"none"!==a&&a.repl ace("%s",e)},_tag:function(t,e){if(t&&t.tagMap)return t.tagMap[e]},_taskClass:fu nction(t){return this.stateClass(this._column("state",t))}})}()</script> </dom-m odule> <dom-module id="iron-collapse" assetpath="/res/imp/bower_components/iron- collapse/"> <template> <style>:host{display:block;transition-duration:var(--iron -collapse-transition-duration,300ms);overflow:visible}:host(.iron-collapse-close d){display:none}:host(:not(.iron-collapse-opened)){overflow:hidden}</style> <con tent></content> </template> </dom-module> <script>Polymer({is:"iron-collapse",be haviors:[Polymer.IronResizableBehavior],properties:{horizontal:{type:Boolean,val ue:!1,observer:"_horizontalChanged"},opened:{type:Boolean,value:!1,notify:!0,obs erver:"_openedChanged"},noAnimation:{type:Boolean},_desiredSize:{type:String,val ue:""}},get dimension(){return this.horizontal?"width":"height"},get _dimensionM ax(){return this.horizontal?"maxWidth":"maxHeight"},get _dimensionMaxCss(){retur n this.horizontal?"max-width":"max-height"},hostAttributes:{role:"group","aria-h idden":"true","aria-expanded":"false"},listeners:{transitionend:"_transitionEnd" },attached:function(){this._transitionEnd()},toggle:function(){this.opened=!this .opened},show:function(){this.opened=!0},hide:function(){this.opened=!1},updateS ize:function(i,t){if(i="auto"===i?"":i,this._desiredSize!==i){this._desiredSize= i,this._updateTransition(!1);var e=t&&!this.noAnimation&&this._isDisplayed;if(e) {var n=this._calcSize();""===i&&(this.style[this._dimensionMax]="",i=this._calcS ize()),this.style[this._dimensionMax]=n,this.scrollTop=this.scrollTop,this._upda teTransition(!0),e=i!==n}this.style[this._dimensionMax]=i,e||this._transitionEnd ()}},enableTransition:function(i){Polymer.Base._warn("`enableTransition()` is de precated, use `noAnimation` instead."),this.noAnimation=!i},_updateTransition:fu nction(i){this.style.transitionDuration=i&&!this.noAnimation?"":"0s"},_horizonta lChanged:function(){this.style.transitionProperty=this._dimensionMaxCss;var i="m axWidth"===this._dimensionMax?"maxHeight":"maxWidth";this.style[i]="",this.updat eSize(this.opened?"auto":"0px",!1)},_openedChanged:function(){this.setAttribute( "aria-expanded",this.opened),this.setAttribute("aria-hidden",!this.opened),this. toggleClass("iron-collapse-closed",!1),this.toggleClass("iron-collapse-opened",! 1),this.updateSize(this.opened?"auto":"0px",!0),this.opened&&this.focus()},_tran sitionEnd:function(){this.style[this._dimensionMax]=this._desiredSize,this.toggl eClass("iron-collapse-closed",!this.opened),this.toggleClass("iron-collapse-open ed",this.opened),this._updateTransition(!1),this.notifyResize()},get _isDisplaye d(){var i=this.getBoundingClientRect();for(var t in i)if(0!==i[t])return!0;retur n!1},_calcSize:function(){return this.getBoundingClientRect()[this.dimension]+"p x"}})</script> <script>Polymer.IronMenubarBehaviorImpl={hostAttributes:{role:"me nubar"},keyBindings:{left:"_onLeftKey",right:"_onRightKey"},_onUpKey:function(e) {this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},_onDownKey:fu nction(e){this.focusedItem.click(),e.detail.keyboardEvent.preventDefault()},get _isRTL(){return"rtl"===window.getComputedStyle(this).direction},_onLeftKey:funct ion(e){this._isRTL?this._focusNext():this._focusPrevious(),e.detail.keyboardEven t.preventDefault()},_onRightKey:function(e){this._isRTL?this._focusPrevious():th is._focusNext(),e.detail.keyboardEvent.preventDefault()},_onKeydown:function(e){ this.keyboardEventMatchesKeys(e,"up down left right esc")||this._focusWithKeyboa rdEvent(e)}},Polymer.IronMenubarBehavior=[Polymer.IronMenuBehavior,Polymer.IronM enubarBehaviorImpl]</script> <iron-iconset-svg name="paper-tabs" size="24"> <svg ><defs> <g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g> <g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4 .59L10 18l6-6z"></path></g> </defs></svg> </iron-iconset-svg> <dom-module id="pa per-tab" assetpath="/res/imp/bower_components/paper-tabs/"> <template> <style>:h ost{@apply(--layout-inline);@apply(--layout-center);@apply(--layout-center-justi fied);@apply(--layout-flex-auto);position:relative;padding:0 12px;overflow:hidde n;cursor:pointer;vertical-align:middle;@apply(--paper-font-common-base);@apply(- -paper-tab)}:host(:focus){outline:0}:host([link]){padding:0}.tab-content{height: 100%;transform:translateZ(0);-webkit-transform:translateZ(0);transition:opacity .1s cubic-bezier(.4,0,1,1);@apply(--layout-horizontal);@apply(--layout-center-ce nter);@apply(--layout-flex-auto);@apply(--paper-tab-content)}:host(:not(.iron-se lected))>.tab-content{opacity:.8;@apply(--paper-tab-content-unselected)}:host(:f ocus) .tab-content{opacity:1;font-weight:700}paper-ripple{color:var(--paper-tab- ink,--paper-yellow-a100)}.tab-content>::content>a{@apply(--layout-flex-auto);hei ght:100%}</style> <div class="tab-content"> <content></content> </div> </templat e> <script>Polymer({is:"paper-tab",behaviors:[Polymer.IronControlState,Polymer.I ronButtonState,Polymer.PaperRippleBehavior],properties:{link:{type:Boolean,value :!1,reflectToAttribute:!0}},hostAttributes:{role:"tab"},listeners:{down:"_update Noink",tap:"_onTap"},attached:function(){this._updateNoink()},get _parentNoink() {var t=Polymer.dom(this).parentNode;return!!t&&!!t.noink},_updateNoink:function( ){this.noink=!!this.noink||!!this._parentNoink},_onTap:function(t){if(this.link) {var e=this.queryEffectiveChildren("a");if(!e)return;if(t.target===e)return;e.cl ick()}}})</script> </dom-module> <dom-module id="paper-tabs" assetpath="/res/imp /bower_components/paper-tabs/"> <template> <style>:host{@apply(--layout);@apply( --layout-center);height:48px;font-size:14px;font-weight:500;overflow:hidden;-moz -user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none ;-webkit-tap-highlight-color:transparent;-webkit-tap-highlight-color:transparent ;@apply(--paper-tabs)}:host-context([dir=rtl]){@apply(--layout-horizontal-revers e)}#tabsContainer{position:relative;height:100%;white-space:nowrap;overflow:hidd en;@apply(--layout-flex-auto)}#tabsContent{height:100%;-moz-flex-basis:auto;-ms- flex-basis:auto;flex-basis:auto}#tabsContent.scrollable{position:absolute;white- space:nowrap}#tabsContent.scrollable.fit-container,#tabsContent:not(.scrollable) {@apply(--layout-horizontal)}#tabsContent.scrollable.fit-container{min-width:100 %}#tabsContent.scrollable.fit-container>::content>*{-ms-flex:1 0 auto;-webkit-fl ex:1 0 auto;flex:1 0 auto}.hidden{display:none}.not-visible{opacity:0;cursor:def ault}paper-icon-button{width:48px;height:48px;padding:12px;margin:0 4px}#selecti onBar{position:absolute;height:2px;bottom:0;left:0;right:0;background-color:var( --paper-tabs-selection-bar-color,--paper-yellow-a100);-webkit-transform:scale(0) ;transform:scale(0);-webkit-transform-origin:left center;transform-origin:left c enter;transition:-webkit-transform;transition:transform;@apply(--paper-tabs-sele ction-bar)}#selectionBar.align-bottom{top:0;bottom:auto}#selectionBar.expand{tra nsition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,1,1)}#selecti onBar.contract{transition-duration:.18s;transition-timing-function:cubic-bezier( 0,0,.2,1)}#tabsContent>::content>:not(#selectionBar){height:100%}</style> <paper -icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass( _leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down ="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button> <div id="tabsConta iner" on-track="_scroll" on-down="_down"> <div id="tabsContent" class$="[[_compu teTabsContentClass(scrollable, fitContainer)]]"> <div id="selectionBar" class$=" [[_computeSelectionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTrans itionEnd"></div> <content select="*"></content> </div> </div> <paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidde n, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRight ScrollButtonDown" tabindex="-1"></paper-icon-button> </template> <script>Polymer ({is:"paper-tabs",behaviors:[Polymer.IronResizableBehavior,Polymer.IronMenubarBe havior],properties:{noink:{type:Boolean,value:!1,observer:"_noinkChanged"},noBar :{type:Boolean,value:!1},noSlide:{type:Boolean,value:!1},scrollable:{type:Boolea n,value:!1},fitContainer:{type:Boolean,value:!1},disableDrag:{type:Boolean,value :!1},hideScrollButtons:{type:Boolean,value:!1},alignBottom:{type:Boolean,value:! 1},selectable:{type:String,value:"paper-tab"},autoselect:{type:Boolean,value:!1} ,autoselectDelay:{type:Number,value:0},_step:{type:Number,value:10},_holdDelay:{ type:Number,value:1},_leftHidden:{type:Boolean,value:!1},_rightHidden:{type:Bool ean,value:!1},_previousTab:{type:Object}},hostAttributes:{role:"tablist"},listen ers:{"iron-resize":"_onTabSizingChanged","iron-items-changed":"_onTabSizingChang ed","iron-select":"_onIronSelect","iron-deselect":"_onIronDeselect"},keyBindings :{"left:keyup right:keyup":"_onArrowKeyup"},created:function(){this._holdJob=nul l,this._pendingActivationItem=void 0,this._pendingActivationTimeout=void 0,this. _bindDelayedActivationHandler=this._delayedActivationHandler.bind(this),this.add EventListener("blur",this._onBlurCapture.bind(this),!0)},ready:function(){this.s etScrollDirection("y",this.$.tabsContainer)},detached:function(){this._cancelPen dingActivation()},_noinkChanged:function(t){var e=Polymer.dom(this).querySelecto rAll("paper-tab");e.forEach(t?this._setNoinkAttribute:this._removeNoinkAttribute )},_setNoinkAttribute:function(t){t.setAttribute("noink","")},_removeNoinkAttrib ute:function(t){t.removeAttribute("noink")},_computeScrollButtonClass:function(t ,e,i){return!e||i?"hidden":t?"not-visible":""},_computeTabsContentClass:function (t,e){return t?"scrollable"+(e?" fit-container":""):" fit-container"},_computeSe lectionBarClass:function(t,e){return t?"hidden":e?"align-bottom":""},_onTabSizin gChanged:function(){this.debounce("_onTabSizingChanged",function(){this._scroll( ),this._tabChanged(this.selectedItem)},10)},_onIronSelect:function(t){this._tabC hanged(t.detail.item,this._previousTab),this._previousTab=t.detail.item,this.can celDebouncer("tab-changed")},_onIronDeselect:function(t){this.debounce("tab-chan ged",function(){this._tabChanged(null,this._previousTab),this._previousTab=null} ,1)},_activateHandler:function(){this._cancelPendingActivation(),Polymer.IronMen uBehaviorImpl._activateHandler.apply(this,arguments)},_scheduleActivation:functi on(t,e){this._pendingActivationItem=t,this._pendingActivationTimeout=this.async( this._bindDelayedActivationHandler,e)},_delayedActivationHandler:function(){var t=this._pendingActivationItem;this._pendingActivationItem=void 0,this._pendingAc tivationTimeout=void 0,t.fire(this.activateEvent,null,{bubbles:!0,cancelable:!0} )},_cancelPendingActivation:function(){void 0!==this._pendingActivationTimeout&& (this.cancelAsync(this._pendingActivationTimeout),this._pendingActivationItem=vo id 0,this._pendingActivationTimeout=void 0)},_onArrowKeyup:function(t){this.auto select&&this._scheduleActivation(this.focusedItem,this.autoselectDelay)},_onBlur Capture:function(t){t.target===this._pendingActivationItem&&this._cancelPendingA ctivation()},get _tabContainerScrollSize(){return Math.max(0,this.$.tabsContaine r.scrollWidth-this.$.tabsContainer.offsetWidth)},_scroll:function(t,e){if(this.s crollable){var i=e&&-e.ddx||0;this._affectScroll(i)}},_down:function(t){this.asy nc(function(){this._defaultFocusAsync&&(this.cancelAsync(this._defaultFocusAsync ),this._defaultFocusAsync=null)},1)},_affectScroll:function(t){this.$.tabsContai ner.scrollLeft+=t;var e=this.$.tabsContainer.scrollLeft;this._leftHidden=0===e,t his._rightHidden=e===this._tabContainerScrollSize},_onLeftScrollButtonDown:funct ion(){this._scrollToLeft(),this._holdJob=setInterval(this._scrollToLeft.bind(thi s),this._holdDelay)},_onRightScrollButtonDown:function(){this._scrollToRight(),t his._holdJob=setInterval(this._scrollToRight.bind(this),this._holdDelay)},_onScr ollButtonUp:function(){clearInterval(this._holdJob),this._holdJob=null},_scrollT oLeft:function(){this._affectScroll(-this._step)},_scrollToRight:function(){this ._affectScroll(this._step)},_tabChanged:function(t,e){if(!t)return this.$.select ionBar.classList.remove("expand"),this.$.selectionBar.classList.remove("contract "),void this._positionBar(0,0);var i=this.$.tabsContent.getBoundingClientRect(), n=i.width,o=t.getBoundingClientRect(),s=o.left-i.left;if(this._pos={width:this._ calcPercent(o.width,n),left:this._calcPercent(s,n)},this.noSlide||null==e)return this.$.selectionBar.classList.remove("expand"),this.$.selectionBar.classList.re move("contract"),void this._positionBar(this._pos.width,this._pos.left);var a=e. getBoundingClientRect(),l=this.items.indexOf(e),c=this.items.indexOf(t),r=5;this .$.selectionBar.classList.add("expand");var h=l<c,d=this._isRTL;d&&(h=!h),h?this ._positionBar(this._calcPercent(o.left+o.width-a.left,n)-r,this._left):this._pos itionBar(this._calcPercent(a.left+a.width-o.left,n)-r,this._calcPercent(s,n)+r), this.scrollable&&this._scrollToSelectedIfNeeded(o.width,s)},_scrollToSelectedIfN eeded:function(t,e){var i=e-this.$.tabsContainer.scrollLeft;i<0?this.$.tabsConta iner.scrollLeft+=i:(i+=t-this.$.tabsContainer.offsetWidth,i>0&&(this.$.tabsConta iner.scrollLeft+=i))},_calcPercent:function(t,e){return 100*t/e},_positionBar:fu nction(t,e){t=t||0,e=e||0,this._width=t,this._left=e,this.transform("translateX( "+e+"%) scaleX("+t/100+")",this.$.selectionBar)},_onBarTransitionEnd:function(t) {var e=this.$.selectionBar.classList;e.contains("expand")?(e.remove("expand"),e. add("contract"),this._positionBar(this._pos.width,this._pos.left)):e.contains("c ontract")&&e.remove("contract")}})</script> </dom-module> <dom-module id="single -page-style" assetpath="/res/imp/common/"> <template> <style>.header{max-width:8 00px}.title{font-size:1.5em;font-weight:700;margin:5px}.id_input{margin-left:5px ;--paper-input-container-input:{font-size:2em};}.refresh{max-width:40px;max-heig ht:40px;width:initial;height:initial}button{min-width:4em;max-height:55px}table{ border-collapse:collapse;margin-left:5px;margin-bottom:8px}td,th{border:1px soli d #BBB;padding:5px}.tabs{background-color:#1F78B4;color:#fff;max-width:600px;mar gin-left:5px;--paper-checkbox-label-color:#fff}paper-tab{background-color:#A6CEE 3;color:#000}paper-tab.iron-selected{background-color:#1F78B4;color:#fff;font-we ight:700;text-decoration:underline}paper-tab[disabled]{background-color:#AAA;tex t-decoration:line-through}.quarantined{background-color:#fdd}.dead{background-co lor:#ccc}paper-checkbox{--paper-checkbox-checked-color:#1F78B4}</style> </templa te> </dom-module><script>!function(){SwarmingBehaviors.BotPageBehavior=[Swarming Behaviors.CommonBehavior,{}]}()</script> <dom-module id="bot-page-data" assetpat h="/res/imp/botpage/"> <script>!function(){function t(t){if(!s){var e=t.toString ();s=e.substring(e.indexOf("("))}return t.toLocaleString()+" "+s}var e,s,i=400,n =["first_seen_ts","last_seen_ts","lease_expiration_ts"],a=["started_ts","complet ed_ts","abandoned_ts","modified_ts"];Polymer({is:"bot-page-data",behaviors:[Swar mingBehaviors.BotPageBehavior],properties:{auth_headers:{type:Object},bot_id:{ty pe:String},busy:{type:Boolean,computed:"_or(_busy1)",notify:!0},bot:{type:Object ,computed:"_parseBot(_bot)",notify:!0},bot_exists:{type:Boolean,value:!0,notify: !0},_busy1:{type:Boolean,value:!1},_bot:{type:Object},_events:{type:Object},_tas ks:{type:Object}},observers:["request(auth_headers,bot_id)"],request:function(){ this.bot_id&&this.auth_headers&&(e&&this.cancelAsync(e),e=this.async(function(){ e=void 0;var t="/api/swarming/v1/bot/"+this.bot_id,s=this._getJsonAsync("_bot",t +"/get","_busy1",this.auth_headers);s.then(function(){this.set("bot_exists",!0)} .bind(this)).catch(function(t){404===t.status?this.set("bot_exists",!1):sk.error Message("Http response: "+(t.status||" ")+" "+t.response)}.bind(this)),this.fire ("reload",{id:this.bot_id})},i))},_parseBot:function(e){if(!e)return{};e.state=e .state||"{}",e.state=JSON.parse(e.state)||{};var s=e.state.disks||{},i=Object.ke ys(s);if(i.length){e.disks=[];for(var a=0;a<i.length;a++)e.disks.push({id:i[a],m b:s[i[a]].free_mb});e.disks.sort(function(t,e){return e.mb-t.mb})}else e.disks=[ {id:"unknown",mb:0}];return e.dimensions=e.dimensions||[],e.dimensions.forEach(f unction(t){swarming.alias.DIMENSIONS_WITH_ALIASES.indexOf(t.key)!==-1&&t.value.f orEach(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)})}),n.forEach(func tion(s){e[s]&&(e[s]=new Date(e[s]),e["human_"+s]=t(e[s]))}),e},parseEvents:funct ion(e){if(!e||!e.items)return[];var e=e.items;return e.forEach(function(e){e.ts& &(e.ts=new Date(e.ts),e.human_ts=t(e.ts))}),e.sort(function(t,e){return e.ts-t.t s}),e},parseTasks:function(e){if(!e||!e.items)return[];var e=e.items;return e.fo rEach(function(e){if(a.forEach(function(s){e[s]&&(e[s]=new Date(e[s]),e["human_" +s]=t(e[s]))}),e.duration)e.human_duration=this._humanDuration(e.duration);else{ var s=e.completed_ts||e.abandoned_ts||e.modified_ts||new Date;e.human_duration=t his._timeDiffExact(e.started_ts,s),e.duration=(s.getTime()-e.started_ts)/1e3}e.s tate=e.state||"UNKNOWN","COMPLETED"===e.state&&(e.failure?e.state="FAILURE":e.st ate="SUCCESS")}.bind(this)),e.sort(function(t,e){return e.started_ts-t.started_t s}),e}})}()</script> </dom-module> <dom-module id="bot-page-summary" assetpath=" /res/imp/botpage/"> <template> <style include="single-page-style">.wrapper{displ ay:table;margin-left:auto;margin-bottom:10px;margin-right:5px}paper-checkbox{mar gin-left:5px}.thick{border-top-style:solid}</style> <url-param name="show_full_n ames" value="{{_show_full_names}}"> </url-param> <url-param name="show_all_tasks " value="{{_show_all_tasks}}"> </url-param> <url-param name="sort_stats" value=" {{_sortstr}}" default_value="total:desc"> </url-param> <div class="wrapper"> <ta ble> <thead on-sort_change="_sortChange"> <tr> <th> <span>Name</span> <sort-togg le name="full_name" current="[[_sort]]"> </sort-toggle> </th> <th> <span>Total</ span> <sort-toggle name="total" current="[[_sort]]"> </sort-toggle> </th> <th> < span>Success</span> <sort-toggle name="success" current="[[_sort]]"> </sort-togg le> </th> <th> <span>Failed</span> <sort-toggle name="failed" current="[[_sort]] "> </sort-toggle> </th> <th> <span>Died</span> <sort-toggle name="bot_died" curr ent="[[_sort]]"> </sort-toggle> </th> <th> <span>Average Duration</span> <sort-t oggle name="avg_duration" current="[[_sort]]"> </sort-toggle> </th> <th> <span>T otal Duration</span> <sort-toggle name="total_time" current="[[_sort]]"> </sort- toggle> </th> <th>Percent of Total</th> </tr> </thead> <tbody> <template is="dom -repeat" items="[[_tasksToShow]]" as="task"> <tr> <td hidden$="[[_truthy(_show_f ull_names)]]" title="[[task.full_name]]">[[task.name]]</td> <td hidden$="[[_not( _show_full_names)]]" title="[[task.full_name]]">[[task.full_name]]</td> <td>[[ta sk.total]]</td> <td>[[task.success]]</td> <td>[[task.failed]]</td> <td>[[task.bo t_died]]</td> <td>[[_humanDuration(task.avg_duration)]]</td> <td>[[_humanDuratio n(task.total_time)]]</td> <td>[[task.total_time_percent]]%</td> </tr> </template > </tbody> <tbody><tr class="thick"> <td>Total</td> <td>[[_totalStats.total]]</t d> <td>[[_totalStats.success]]</td> <td>[[_totalStats.failed]]</td> <td>[[_total Stats.bot_died]]</td> <td>[[_humanDuration(_totalStats.avg_duration)]]</td> <td> [[_humanDuration(_totalStats.total_time)]]</td> <td>100.0%</td> </tr> </tbody></ table> <div> <table> <thead> <tr> <th title="How much time passed between the ol dest task fetched and now."> Total Wall Time </th> <th title="How much of the wa ll time this bot was busy with a task."> Wall Time Utilization </th> </tr> </the ad> <tbody> <tr> <td>[[_humanDuration(_totalStats.wall_time)]]</td> <td>[[_total Stats.wall_time_utilization]]%</td> </tr> </tbody> </table> <paper-checkbox chec ked="{{_show_full_names}}"> Show Full Names </paper-checkbox> <paper-checkbox hi dden$="[[_cannotExpand]]" checked="{{_show_all_tasks}}"> Show All Tasks </paper- checkbox> </div> </div> </template> <script>!function(){var t=15;Polymer({is:"bo t-page-summary",behaviors:[SwarmingBehaviors.BotPageBehavior],properties:{tasks: {type:Array},_cannotExpand:{type:Boolean,computed:"_countTasks(_taskStats.*)"},_ show_all_tasks:{type:Boolean},_show_full_names:{type:Boolean},_sortstr:{type:Str ing},_sort:{type:Object,computed:"_makeSortObject(_sortstr)"},_taskStats:{type:A rray},_tasksToShow:{type:Array,computed:"_sortAndLimitTasks(_taskStats.*,_sort.* ,_show_all_tasks)"},_totalStats:{type:Object}},observers:["_aggregate(tasks.*)"] ,_aggregate:function(){if(this.tasks&&this.tasks.length){var t=new Date(1e3*sk.n ow()),a={},e={total:this.tasks.length,success:0,failed:0,bot_died:0,avg_duration :0,total_time:0,wall_time:(t-this.tasks[this.tasks.length-1].started_ts)/1e3};th is.tasks.forEach(function(t){var s=t.name.trim(),i=s.split("/");5===i.length&&(s =i[0]+"/"+i[3]),a[s]||(a[s]={full_name:s,name:s,total:0,success:0,failed:0,bot_d ied:0,avg_duration:0,total_time:0}),a[s].total++,t.failure?(e.failed++,a[s].fail ed++):t.internal_failure?(e.bot_died++,a[s].bot_died++):(e.success++,a[s].succes s++),e.total_time+=t.duration,a[s].total_time+=t.duration}),e.avg_duration=e.tot al_time/e.total,e.wall_time_utilization=(100*e.total_time/e.wall_time).toFixed(1 ),this.set("_totalStats",e);var s=Object.keys(a),i=[];s.forEach(function(t){a[t] .avg_duration=a[t].total_time/a[t].total,a[t].total_time_percent=(100*a[t].total _time/e.total_time).toFixed(1),i.push(a[t])});var o=new Substrings({minOccurrenc e:Math.max(2,s.length-1),minLength:6});o.build(s);var n=o.weighByAverage()||[];n .length&&n[0].source.forEach(function(t){var a=i[t].full_name;i[t].name=a.replac e(n[0].name,"...")}),this.set("_taskStats",i)}},_compare:function(t,a){if(!this. _sort)return 0;var e=1;return"desc"===this._sort.direction&&(e=-1),e*swarming.na turalCompare(t[this._sort.name],a[this._sort.name])},_countTasks:function(){retu rn this._taskStats.length<=t},_makeSortObject:function(t){if(t){var a=t.split(": ");return 2!=a.length?{name:"full_name",direction:"asc"}:{name:a[0],direction:a[ 1]}}},_sortAndLimitTasks:function(){swarming.stableSort(this._taskStats,this._co mpare.bind(this));var a=this._taskStats.length;return!this._show_all_tasks&&this ._taskStats.length>t&&(a=t),this._taskStats.slice(0,a)},_sortChange:function(t){ t&&t.detail&&t.detail.name&&(t.preventDefault(),t.stopPropagation(),this.set("_s ortstr",t.detail.name+":"+t.detail.direction))}})}()</script> </dom-module><dom- module id="bot-page" assetpath="/res/imp/botpage/"> <template> <style include="i ron-flex iron-flex-alignment iron-positioning swarming-app-style single-page-sty le task-style">.message{white-space:pre-line;font-family:monospace}.bot_state{wh ite-space:pre;font-family:monospace;margin-bottom:10px}.events_table,.tasks_tabl e{border:3px solid #1F78B4}.old_version{background-color:#ffd}.stats{min-width:7 00px;flex-grow:2}#collapse{max-width:700px}.cloud{white-space:nowrap;margin-bott om:5px;margin-top:auto}.deleted{text-align:center;font-size:larger}paper-dialog{ border-radius:6px}</style> <url-param name="id" value="{{bot_id}}"> </url-param> <url-param name="show_all_events" value="{{_show_all}}"> </url-param> <url-para m name="selected" value="{{_selected}}"> </url-param> <url-param name="show_stat e" value="{{_show_state}}"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" permissions="{{_permissions}}" server_details= "{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_or(_busy1,_busy2,_busy 3)]]" name="Swarming Bot Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <bot-page-data i d="data" auth_headers="[[_auth_headers]]" bot_id="[[bot_id]]" bot="{{_bot}}" bot _exists="{{_bot_exists}}" busy="{{_busy1}}" events="{{_events}}" tasks="{{_tasks }}" on-reload="_clearAndReload"> </bot-page-data> <div class="header horizontal layout"> <paper-input class="id_input" label="Bot id" value="{{bot_id}}"></paper -input> <template is="dom-if" if="[[_ccLink(_bot)]]"> <div class="vertical layou t"> <a href$="[[_ccLink(_bot)]]" class="cloud">Cloud Console</a> </div> </templa te> <button on-click="_refresh"> <iron-icon class="refresh" icon="icons:refresh" ></iron-icon> </button> </div> </div> <h2 hidden$="[[_bot_exists]]">Bot not foun d.</h2> <div hidden$="[[_not(_bot_exists)]]"> <div class="horizontal wrap layout "> <div class="flex"> <table> <template is="dom-if" if="[[_bot.deleted]]"> <tr c lass="dead deleted" title="This bot was deleted."> <td colspan="3">THIS BOT WAS DELETED</td> </tr> </template> <tbody><tr class$="[[_isDead(_bot)]]" title="Last time the bot contacted the server."> <td>Last Seen</td> <td title="[[_bot.human _last_seen_ts]]"> [[_timeDiffExact(_bot.last_seen_ts)]] ago</td> <td> <template is="dom-if" if="[[_canShutdown(_bot,_permissions)]]"> <button class="raised" on- click="_promptShutdown"> Shut Down Gracefully </button> </template> <template is ="dom-if" if="[[_canDelete(_bot,_permissions)]]"> <button class="raised" on-clic k="_promptDelete"> Delete </button> </template> </td> </tr> <template is="dom-if " if="[[_bot.quarantined]]"> <tr class="quarantined"> <td>Quarantined</td> <td c olspan="2" class="message">[[_quarantineMessage(_bot)]]</td> </tr> </template> < tr> <td>Current Task</td> <td> <a target="_blank" rel="noopener" href$="[[_taskL ink(_bot.task_id)]]"> [[_task(_bot)]] </a> </td> <td> </td> </tr> <tr> <td rowsp an$="[[_numRows(_bot.dimensions)]]"> <a href$="[[_siblingBotsLink(_bot.dimension s)]]" title="The list of bots that also matches these dimensions (except id)."> Dimensions</a> </td> </tr> <template is="dom-repeat" items="[[_bot.dimensions]]" as="dim"> <tr> <td>[[dim.key]]</td> <td>[[_concat(dim.value)]]</td> </tr> </tem plate> <tr title="IP address that the server saw the connection from."> <td>Exte rnal IP</td> <td><a href$="[[_bot.external_ip]]">[[_bot.external_ip]]</a></td> < td></td> </tr> <tr class$="[[_classVersion(_server_details.bot_version,_bot.vers ion)]]" title="Version is based on the content of swarming_bot.zip which is the swarming bot code. The bot won't update if quarantined, dead, or busy."> <td>Bot Version</td> <td>[[_shorten(_bot.version,'8')]]</td> <td></td> </tr> <tr title= "The version the server expects the bot to be using."> <td>Expected Bot Version< /td> <td>[[_shorten(_server_details.bot_version,'8')]]</td> <td></td> </tr> <tr title="First time ever a bot with this id contacted the server."> <td>First seen </td> <td title="[[_bot.human_first_seen_ts]]"> [[_timeDiffApprox(_bot.first_see n_ts)]] ago </td> <td></td> </tr> <tr title="How the bot is authenticated by the server."> <td>Authenticated as</td> <td colspan="2">[[_bot.authenticated_as]]</ td> </tr> <template is="dom-if" if="[[_bot.lease_id]]"> <tr> <td>Machine Provide r Lease ID</td> <td colspan="2"> <a href$="[[_mpLink(_bot,_server_details.machin e_provider_template)]]"> [[_bot.lease_id]] </a> </td> </tr> <tr> <td>Machine Pro vider Lease Expires</td> <td colspan="2">[[_bot.human_lease_expiration_ts]]</td> </tr> </template> </tbody></table> <span class="title">State</span> <template i s="dom-if" if="[[_not(_show_state)]]"> <button on-click="_toggleState"> <iron-ic on icon="icons:add-circle-outline"></iron-icon> </button> </template> <template is="dom-if" if="[[_show_state]]"> <button on-click="_toggleState"> <iron-icon ic on="icons:remove-circle-outline"></iron-icon> </button> </template> <iron-collap se id="collapse" opened="[[_show_state]]"> <div class="bot_state">[[_prettyPrint (_bot.state)]]</div> </iron-collapse> </div> <div class="stats flex"> <bot-page- summary tasks="[[_tasks]]"> </bot-page-summary> </div> </div> <div class="tabs"> <paper-tabs selected="{{_selected}}" no-bar=""> <paper-tab>Tasks</paper-tab> <p aper-tab>Events</paper-tab> </paper-tabs> <template is="dom-if" if="[[_showEvent s]]"> <paper-checkbox checked="{{_show_all}}"> Show all events </paper-checkbox> </template> </div> <template is="dom-if" if="[[_not(_showEvents)]]"> <table cla ss="tasks_table"> <thead> <tr> <th>Task</th> <th>Started</th> <th>Duration</th> <th>Result</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_tasks }}" as="task"> <tr class$="[[_taskClass(task)]]"> <td> <a target="_blank" rel="n oopener" href$="[[_taskLink(task.task_id)]]"> [[task.name]] </a> </td> <td>[[tas k.human_started_ts]]</td> <td title="[[task.human_completed_ts]]">[[task.human_d uration]]</td> <td>[[task.state]]</td> </tr> </template> </tbody> </table> </tem plate> <template is="dom-if" if="[[_showEvents]]"> <table class="events_table"> <thead> <tr> <th>Message</th> <th>Type</th> <th>Timestamp</th> <th>Task ID</th> <th>Version</th> </tr> </thead> <tbody> <template is="dom-repeat" items="{{_even tList(_show_all,_events.*)}}" as="event"> <tr> <td class="message">[[event.messa ge]]</td> <td>[[event.event_type]]</td> <td>[[event.human_ts]]</td> <td> <a targ et="_blank" rel="noopener" href$="[[_taskLink(event.task_id)]]"> [[event.task_id ]] </a> </td> <td class$="[[_classVersion(_server_details.bot_version,event.vers ion)]]"> [[_shorten(event.version,'8')]] </td> </tr> </template> </tbody> </tabl e> </template> <pageable-data id="page_tasks" hidden$="[[_showEvents]]" busy="{{ _busy2}}" label="Show more tasks" output="{{_tasks}}" parse="[[_parseTasks]]"> < /pageable-data> <pageable-data id="page_events" hidden$="[[_not(_showEvents)]]" busy="{{_busy3}}" label="Show more events" output="{{_events}}" parse="[[_parseE vents]]"> </pageable-data> </div> </swarming-app> <paper-dialog id="prompt" moda l="" on-iron-overlay-closed="_promptClosed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialogPrompt]]?</div> <div class="buttons"> <paper-button d ialog-dismiss="" autofocus="">No</paper-button> <paper-button dialog-confirm=""> Yes</paper-button> </div> </paper-dialog> </template> <script> (function(){
889 1081
890 Polymer({ 1082 Polymer({
891 is: 'bot-page', 1083 is: 'bot-page',
892 1084
893 behaviors: [ 1085 behaviors: [
894 SwarmingBehaviors.BotPageBehavior, 1086 SwarmingBehaviors.BotPageBehavior,
895 ], 1087 ],
896 1088
897 properties: { 1089 properties: {
898 bot_id: { 1090 bot_id: {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 } 1318 }
1127 return ""; 1319 return "";
1128 }, 1320 },
1129 1321
1130 _toggleState: function() { 1322 _toggleState: function() {
1131 this.set("_show_state", !this._show_state); 1323 this.set("_show_state", !this._show_state);
1132 } 1324 }
1133 1325
1134 }); 1326 });
1135 })(); </script> </dom-module><dom-module id="interval-timer" assetpath="/res/i mp/common/"> <script>!function(){Polymer({is:"interval-timer",properties:{period :{type:Number,value:-1,observer:"_periodChanged"}},_periodChanged:function(e){th is._timeout&&window.clearTimeout(this._timeout),e>0&&(this._timeout=window.setTi meout(function(){this.fire("trigger"),this._periodChanged(e)}.bind(this),1e3*e)) }})}()</script> </dom-module> <dom-module id="task-page-data" assetpath="/res/im p/taskpage/"> <script>!function(){var t,e=400,s=["abandoned_ts","completed_ts"," created_ts","modified_ts","started_ts"];Polymer({is:"task-page-data",behaviors:[ SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{aut h_headers:{type:Object},task_id:{type:String},busy:{type:Boolean,computed:"_or(_ busy1,_busy2,_busy3)",notify:!0},request:{type:Object,computed:"_parseRequest(_r equest)",notify:!0},result:{type:Object,computed:"_parseResult(_result)",notify: !0},stdout:{type:String,computed:"_parseStdout(_stdout)",notify:!0},task_exists: {type:Boolean,value:!0,notify:!0},_busy1:{type:Boolean,value:!1},_busy2:{type:Bo olean,value:!1},_busy3:{type:Boolean,value:!1},_request:{type:Object},_result:{t ype:Object},_stdout:{type:Object}},observers:["reload(auth_headers,task_id)"],re load:function(){if(!this.task_id||!this.auth_headers)return void console.log("ta sk_id and auth_headers can't be empty");t&&this.cancelAsync(t);var s="/api/swarm ing/v1/task/"+this.task_id;t=this.async(function(){t=void 0;var e=this._getJsonA sync("_request",s+"/request","_busy1",this.auth_headers);e.then(function(){this. set("task_exists",!0)}.bind(this)).catch(function(t){404===t.status?this.set("ta sk_exists",!1):sk.errorMessage("Http response: "+(t.status||" ")+" "+t.response) }.bind(this)),this._getJsonAsync("_result",s+"/result?include_performance_stats= true","_busy2",this.auth_headers),this.reloadStdout()},e)},_parseRequest:functio n(t){return t?(t.tagMap={},t.tags=t.tags||[],t.tags.forEach(function(e){var s=e. split(":",1),a=s[0],u=e.substring(a.length+1);t.tagMap[a]=u}),s.forEach(function (e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),t):{}} ,_parseResult:function(t){if(!t)return{};var e=new Date;return s.forEach(functio n(e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.du ration&&t.state===this.RUNNING&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3), t.duration&&(t.human_duration=this._humanDuration(t.duration)),t},_parseStdout:f unction(t){return t&&t.output?t.output:""},reloadStdout:function(){this._getJson Async("_stdout","/api/swarming/v1/task/"+this.task_id+"/stdout","_busy3",this.au th_headers)}})}()</script> </dom-module><dom-module id="task-disambiguation" ass etpath="/res/imp/taskpage/"> <template> <style include="swarming-app-style singl e-page-style task-style"></style> <table> <thead> <tr> <th>Try ID</th> <th>Bot I D</th> <th>Status</th> </tr> </thead> <tbody> <template id="result_list" is="dom -repeat" items="[[_results]]" as="result" observe="task_id bot_id state"> <tr> < td> <a href$="[[_taskLink(result.task_id,'true')]]"> [[result.task_id]] </a> </t d> <td> <a href$="[[_botLink(result.bot_id)]]"> [[result.bot_id]] </a> </td> <td class$="[[_stateClass(result)]]">[[state(result)]]</td> </tr> </template> </tbo dy> </table> </template> <script>Polymer({is:"task-disambiguation",behaviors:[Sw armingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{auth_ headers:{type:Object},summary_result:{type:Object},task_id:{type:String},busy:{t ype:Boolean,value:!1,notify:!0},_busyArr:{type:Array,value:function(){return[]}} ,_results:{type:Array,value:function(){return[]}}},observers:["_fetchRest(auth_h eaders,task_id,summary_result)","_computeBusy(_busyArr.*)"],_computeBusy:functio n(){for(var s=0;s<this._busyArr.length;s++)if(this._busyArr[s].status)return!0;r eturn!1},_fetchRest:function(s,r,t){if(s&&r&&t){var e=t.try_number;this.set("_bu syArr",[]),this.set("_results",[]);for(var u=r.substring(0,r.length-1),i="/api/s warming/v1/task/",a=0;a<e-1;a++){var n=u+(a+1);this.splice("_busyArr",a,0,{}),th is.splice("_results",a,0,{task_id:n}),this._getJsonAsyncArr(a,"_results",i+n+"/r esult","_busyArr",s)}t.task_id=u+e,this.splice("_results",e-1,1,t)}}})</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskpage/"> <templat e> <style include="iron-flex iron-flex-alignment swarming-app-style single-page- style task-style">.milo{width:calc(100% - 11px);height:2000px}.right{margin-top: 8px}.break-all{word-break:break-all}.expand{min-width:3em;vertical-align:middle; padding:.5em}.code{font-family:monospace}.stdout{white-space:pre-wrap;padding:2p x}.stdout.wide{white-space:pre;overflow-x:auto}.refresh_input{padding:0 5px}.rep roduce{margin-left:5px}.tabbed{border:3px solid #1F78B4;margin-left:5px;min-heig ht:80vh;min-width:550px}.task-info{min-width:500px}.cipd-header{-moz-user-select :none;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-weight :700;margin-left:8px}.full-width{min-width:100%}.full-width-container{position:r elative}.full-width-container>paper-checkbox{position:absolute;bottom:10px;width :140px;left:5px}</style> <url-param name="id" value="{{task_id}}"> </url-param> <url-param name="try_detail" value="{{_try_detail}}"> </url-param> <url-param na me="request_detail" value="{{_request_detail}}"> </url-param> <url-param name="s how_raw" value="{{_show_raw}}"> </url-param> <url-param name="wide_logs" value=" {{_wide_logs}}"> </url-param> <url-param name="refresh" value="{{_refresh_interv al}}" default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" a uth_headers="{{_auth_headers}}" permissions="{{_permissions}}" profile="{{_profi le}}" server_details="{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_o r(_busy1,busy2)]]" name="Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You m ust sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <t ask-page-data id="data" auth_headers="[[_auth_headers]]" task_id="[[task_id]]" b usy="{{_busy1}}" request="{{_request}}" result="{{_result}}" stdout="{{_stdout}} " task_exists="{{_task_exists}}"> </task-page-data> <div class="horizontal layou t wrap"> <div class="left flex"> <div class="horizontal layout"> <paper-input cl ass="id_input" label="Task id" value="{{task_id}}"></paper-input> <button on-cli ck="_refresh"> <iron-icon class="refresh" icon="icons:refresh"></iron-icon> </bu tton> <button on-click="_promptRetry">Retry</button> <template is="dom-if" if="[ [_canCancelTask(_result,_permissions)]]"> <button on-click="_promptCancel">Cance l</button> </template> </div> <h2 hidden$="[[_task_exists]]">Task not found.</h2 > <template is="dom-if" if="[[_disambiguate(task_id,_result)]]"> <h2>Displaying a summary for a task with multiple tries</h2> <task-disambiguation busy="{{busy2 }}" auth_headers="[[_auth_headers]]" task_id="[[task_id]]" summary_result="[[_re sult]]"> </task-disambiguation> </template> <table class="task-info" hidden$="[[ _not(_task_exists)]]"> <tbody> <tr> <td>Name</td> <td>[[_request.name]]</td> </t r> <tr> <td>State</td> <td class$="[[_stateClass(_result)]]">[[state(_result)]]< /td> </tr> <tr> <td>Created</td> <td title$="[[_request.created_ts]]">[[_request .human_created_ts]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_result) ]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]">[[_result.human_s tarted_ts]]</td> </tr> </template> <template is="dom-if" if="[[_wasNotPickedUp(_ result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</td> </tr> </templa te> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td>Complete d</td> <td title$="[[_result.completed_ts]]">[[_result.human_completed_ts]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_abandoned_ts]]"> <t r> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_result.human_aban doned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <td title$="[[_resu lt.modified_ts]]">[[_result.human_modified_ts]]</td> </tr> <template is="dom-if" if="[[_result.deduped_from]]"> <tr> <td><b>Deduped from</b></td> <td> <a href$= "[[_taskLink(_result.deduped_from)]]"> [[_result.deduped_from]] </a> </td> </tr> </template> <tr> <td>Pending Time</td> <td>[[_pending(_result)]]</td> </tr> <tr > <td>Duration</td> <td>[[_result.human_duration]]</td> </tr> <tr> <td>Priority< /td> <td>[[_request.priority]]</td> </tr> <tr> <td>User</td> <td>[[_request.user ]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authenticated]]</td> </ tr> <template is="dom-if" if="[[_request.service_account]]"> <tr> <td>Service Ac count</td> <td>[[_request.service_account]]</td> </tr> </template> <template is= "dom-if" if="[[_request.properties.secret_bytes]]"> <tr> <td>Secret Bytes</td> < td>[[_request.properties.secret_bytes]]</td> </tr> </template> <template is="dom -if" if="[[_request.parent_task_id]]"> <tr> <td>Parent Task</td> <td> <a href$=" [[_taskLink(_request.parent_task_id)]]">[[_request.parent_task_id]]</a> </td> </ tr> </template> <tr> <td rowspan$="[[_rowspan(_request.properties.dimensions)]]" > <a title="The list of bots that matches the list of dimensions" href$="[[_botL istLink(_request.properties.dimensions)]]"> Requested Dimensions </a> </td> </tr > <template is="dom-repeat" items="{{_request.properties.dimensions}}" as="dimen sion"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </tr> </tem plate> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_request.prop erties.inputs_ref)]]"> [[_request.properties.inputs_ref.isolated]] </a> </td> </ tr> <template is="dom-if" if="[[_request.properties.outputs.length]]"> <tr> <td rowspan$="[[_rowspan(_request.properties.outputs)]]">Expected outputs</td> </tr> <template is="dom-repeat" items="{{_request.properties.outputs}}" as="output"> <tr> <td>[[output]]</td> </tr> </template> </template> <template is="dom-if" if= "[[_not(_request_detail)]]"> <tr> <td>More Details</td> <td> <button on-click="_ toggleDetails"> <iron-icon icon="icons:add-circle-outline"></iron-icon> </button > </td> </tr> </template> <template is="dom-if" if="[[_request_detail]]"> <tr> < td>Hide Details</td> <td> <button on-click="_toggleDetails"> <iron-icon icon="ic ons:remove-circle-outline"></iron-icon> </button> </td> </tr> </template> </tbod y> <tbody id="more_details" hidden$="[[!_request_detail]]"> <tr> <td>Extra Args< /td> <td class="code break-all">[[_extraArgs(_request)]]</td> </tr> <tr> <td>Com mand</td> <td class="code break-all">[[_command(_request)]]</td> </tr> <tr> <td> Idempotent</td> <td>[[_request.properties.idempotent]]</td> </tr> <tr> <td rowsp an$="[[_rowspan(_request.tags)]]">Tags</td> </tr> <template is="dom-repeat" item s="{{_request.tags}}" as="tag"> <tr> <td class="break-all">[[tag]]</td> </tr> </ template> <tr> <td>Execution timeout</td> <td>[[_humanDuration(_request.properti es.execution_timeout_secs)]]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDu ration(_request.properties.io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</ td> <td>[[_humanDuration(_request.properties.grace_period_secs)]]</td> </tr> <tr > <td>CIPD server</td> <td> <a href$="[[_request.properties.cipd_input.server]]" > [[_request.properties.cipd_input.server]] </a> </td> </tr> <tr> <td>CIPD versi on</td> <td class="break-all">[[_request.properties.cipd_input.client_package.ve rsion]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <t d>CIPD package name</td> <td>[[_result.cipd_pins.client_package.package_name]]</ td> </tr> </template> <tr hidden$="[[_not(_request.properties.cipd_input)]]"> <t d rowspan$="[[_cipdRowspan(_request,_result)]]">CIPD packages</td> </tr> <templa te is="dom-repeat" items="[[_cipdPackages(_request,_result)]]" as="cipd"> <tr> < td>[[cipd.path]]/</td> </tr> <tr> <td class="break-all"> <span class="cipd-heade r">Requested: </span>[[cipd.requested]] </td> </tr> <tr hidden$="[[!_hasActualCI PDPackages(_result)]]"> <td class="break-all"> <span class="cipd-header">Actual: </span>[[cipd.actual]] </td> </tr> </template> <tr hidden$="[[_empty(_request.p roperties.caches)]]"> <td rowspan$="[[_rowspan(_request.properties.caches)]]">Na med caches</td> </tr> <template is="dom-repeat" items="[[_request.properties.cac hes]]" as="cache"> <tr> <td><span>[[cache.name]]</span>:<span>[[cache.path]]</sp an></td> </tr> </template> </tbody> </table> <div class="title" hidden$="[[_not( _task_exists)]]">Task Execution</div> <template is="dom-if" if="[[_wasPickedUp(_ result)]]"> <table hidden$="[[_not(_task_exists)]]"> <tbody><tr> <td>Bot assigne d to task</td> <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]</a ></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> <a>Bot Di mensions</a> </td> </tr> <template is="dom-repeat" items="[[_result.bot_dimensio ns]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</ td> </tr> </template> <tr> <td>Exit code</td> <td>[[_result.exit_code]]</td> </t r> <tr> <td>Try number</td> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failu re</td> <td class$="[[_failureClass(_result.failure)]]">[[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_result.inter nal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isolated Output s</td> <td> <a href$="[[_isolateLink(_result.outputs_ref)]]"> [[_result.outputs_ ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td> <td>[[_result.bot_vers ion]]</td> </tr> <tr> <td>Server version</td> <td>[[_result.server_versions]]</t d> </tr> </tbody></table> </template> <template is="dom-if" if="[[_wasNotPickedU p(_result)]]"> This space left blank until a bot is assigned to the task. </temp late> <template is="dom-if" if="[[_result.performance_stats]]"> <div class="titl e">Performance Stats</div> <table> <tbody><tr> <td title="This includes time tak en to download inputs, isolate outputs, and setup CIPD">Total Overhead</td> <td> [[_humanDuration(_result.performance_stats.bot_overhead)]]</td> </tr> <tr> <td>D ownloading Inputs From Isolate</td> <td>[[_humanDuration(_result.performance_sta ts.isolated_download.duration)]]</td> </tr> <tr> <td>Uploading Outputs To Isolat e</td> <td>[[_humanDuration(_result.performance_stats.isolated_upload.duration)] ]</td> </tr> <tr hidden$="[[!_result.performance_stats.isolated_download.initial _size]]"> <td>Initial bot cache</td> <td>[[_result.performance_stats.isolated_do wnload.initial_number_items]] items; [[_bytes(_result.performance_stats.isolated _download.initial_size)]]</td> </tr> </tbody></table> </template> <div hidden$=" [[_not(_task_exists)]]"> <div class="title">Reproducing the task locally</div> < div class="reproduce"> <div>Download inputs files into directory <i>foo</i>:</di v> <div class="code"> python isolateserver.py download -I [[_request.properties. inputs_ref.isolatedserver]] --namespace [[_request.properties.inputs_ref.namespa ce]] -s [[_request.properties.inputs_ref.isolated]] --target foo</div> <br> <div >Run this task locally:</div> <div class="code"> python swarming.py reproduce -S [[_host_url]] [[task_id]]</div> <br> <div>Download output results into director y <i>foo</i>:</div> <div class="code"> python swarming.py collect -S [[_host_url ]] --task-output-dir=foo [[task_id]]</div> <br> <div>Looking for <i>swarming.py< /i>?</div> <div class="code"> git clone https://github.com/luci/client-py</div> </div> </div> </div> <div class$="flex right [[_classRight(_wide_logs)]]" hidden $="[[_not(_task_exists)]]"> <div class="horizontal layout"> <div class="tabs"> < paper-tabs selected="{{_show_raw}}" no-bar=""> <paper-tab disabled$="[[_noMilo(_ request)]]">Milo Output</paper-tab> <paper-tab>Raw Output</paper-tab> </paper-ta bs> </div> <paper-input class="refresh_input" label="Refresh Interval (seconds)" value="{{_refresh_interval}}" title="How often to refresh all information about the task" auto-validate="" min="1" max="1000" pattern="[0-9]+"> </paper-input> <div class="full-width-container"> <paper-checkbox checked="{{_wide_logs}}"> Ful l Width Logs </paper-checkbox> </div> </div> <template is="dom-if" if="[[_suppor tsMilo(_request,_show_raw)]]"> <div class="milo tabbed" hidden$="[[_isSummaryLin k(task_id)]]"> Milo results are only generated for task summaires, that is, task s whose ids end in 0. Tasks ending in 1 or 2 represent possible retries of tasks . See <a href="//goo.gl/LE4rwV">the docs</a> for more. </div> <iframe id="miloFr ame" class="milo tabbed" src$="[[_getDisplayServerLink(_server_details.display_s erver_url_template,task_id)]]"></iframe> </template> <template is="dom-if" if="[ [_show_raw]]"> <div class$="code stdout tabbed break-all [[_classStdout(_wide_lo gs)]]">[[_rawOutput(_stdout,_result)]]</div> </template> </div> </div> </div> </ swarming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_prompt Closed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialog_prompt]] ?</div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</p aper-button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-d ialog> <interval-timer period="[[_refresh_interval]]" on-trigger="_softRefresh"> </interval-timer> </template> <script>!function(){Polymer({is:"task-page",behav iors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],propertie s:{task_id:{type:String},client_id:{type:String},_dialog_prompt:{type:String,val ue:""},_host_url:{type:String,value:function(){return window.location.hostname}} ,_refresh_interval:{type:Number},_request:{type:Object,observer:"_requestUpdated "},_request_detail:{type:Boolean},_result:{type:Object},_server_details:{type:Ob ject},_stdout:{type:String}},_alias:function(t){var e=t.value;return Array.isArr ay(e)||(e=[e]),swarming.alias.has(t.key)&&e.forEach(function(i,s){e[s]=swarming. alias.apply(i,t.key)}),e.join(" | ")},_bytes:function(t){return sk.human.bytes(t )},_canCancelTask:function(t,e){return t&&"PENDING"===t.state&&e.cancel_task},_c ancelTask:function(){var t="/api/swarming/v1/task/"+this.task_id+"/cancel";swarm ing.postWithToast(t,"Canceling task "+this.task_id,this._auth_headers)},_cipdRow span:function(t,e){if(!t||!t.properties||!t.properties.cipd_input)return 0;var i =(t.properties.cipd_input.packages||[]).length;return i*=this._hasActualCIPDPack ages(e)?3:2,i+1},_cipdPackages:function(t,e){if(!t||!t.properties||!t.properties .cipd_input)return[];var i=t.properties.cipd_input.packages||[],s=e&&e.cipd_pins &&e.cipd_pins.packages||[];return i.forEach(function(t){t.requested=t.package_na me+":"+t.version,s.forEach(function(e){e.path===t.path&&(t.actual=e.package_name +":"+e.version)})}),i},_classRight:function(t){return t?"full-width":""},_classS tdout:function(t){return t?"wide":""},_command:function(t){if(!t||!t.properties) return"";var e=t.properties.command||[];return e.join(" ")},_disambiguate:functi on(t,e){return!(!t.endsWith("0")||!e)&&e.try_number>1},_empty:function(t){return !t||0==t.length},_expires:function(t){var e=parseInt(t.expiration_secs);return e ?sk.human.localeTime(new Date(t.created_ts.getTime()+1e3*e)):t.expiration_secs+" seconds from created time"},_extraArgs:function(t){if(!t||!t.properties)return" ";var e=t.properties.extra_args||[];return e.join(" ")},_failureClass:function(t ){return t?"failed_task":""},_getDisplayServerLink:function(t,e){if(t)return t.r eplace("%s",e)},_hasActualCIPDPackages:function(t){return t&&t.cipd_pins&&t.cipd _pins.packages},_internalClass:function(t){return t?"exception":""},_isolateLink :function(t){if(t&&t.isolatedserver)return t.isolatedserver+"/browse?namespace=" +t.namespace+"&hash="+t.isolated},_isSummaryLink:function(t){return t&&t.endsWit h(0)},_noMilo:function(t){return!this._tag(t,"allow_milo")},_pending:function(t) {if(!t.created_ts)return"";var e=t.started_ts||t.abandoned_ts||new Date;return e <=t.created_ts?"0s":this._timeDiffExact(t.created_ts,e)},_promptClosed:function( t){t.detail.confirmed&&(this._dialog_prompt.startsWith("cancel")?this._cancelTas k():this._retryTask())},_promptCancel:function(){this.set("_dialog_prompt","canc el task "+this.task_id),this.$.prompt.open()},_promptRetry:function(){this.set(" _dialog_prompt","retry task "+this.task_id),this.$.prompt.open()},_rawOutput:fun ction(t,e){return t?t:"PENDING"===e.state||"RUNNING"===e.state?"[No output yet]" :"[No output received]"},_refresh:function(){this.$.data.reload()},_requestUpdat ed:function(t){this._noMilo(t)&&this.set("_show_raw",1)},_softRefresh:function() {if(!this._result||"RUNNING"===this._result.state||"PENDING"===this._result.stat e){this.$.data.reload();var t=this.$$("iframe");t&&(t.src=this._getDisplayServer Link(this._server_details.display_server_url_template,this.task_id))}},_retryTas k:function(){if(!this._request)return void sk.errorMessage("Task not yet loaded" ,3e3);var t={expiration_secs:this._request.expiration_secs,name:this._request.na me+" (retry)",parent_task_id:this._request.parent_task_id,priority:this._request .priority,properties:this._request.properties,tags:this._request.tags,user:this. _profile.email,service_account:this._request.service_account};t.properties.idemp otent=!1,swarming.postWithToast("/api/swarming/v1/tasks/new","Retrying task "+th is.task_id,this._auth_headers,t).then(function(t){if(t=JSON.parse(t),t&&t.task_i d){var e={id:this.task_id};history.pushState(e,"Task Page"),this.set("task_id",t .task_id)}}.bind(this),function(t){console.log("Task could not be retried",t)})} ,_rowspan:function(t){return t=t||[],t.length+1},_supportsMilo:function(t,e){ret urn!e&&t&&this._tag(t,"allow_milo")},_toggleDetails:function(){this.set("_reques t_detail",!this._request_detail)},_tag:function(t,e){if(t&&t.tagMap)return t.tag Map[e]},_wasPickedUp:function(t){return t&&t.state!==this.PENDING&&t.state!==thi s.CANCELED&&t.state!=this.EXPIRED},_wasNotPickedUp:function(t){return t&&!this._ wasPickedUp(t)}})}()</script> </dom-module> </div></body></html> 1327 })(); </script> </dom-module><dom-module id="interval-timer" assetpath="/res/i mp/common/"> <script>!function(){Polymer({is:"interval-timer",properties:{period :{type:Number,value:-1,observer:"_periodChanged"}},_periodChanged:function(e){th is._timeout&&window.clearTimeout(this._timeout),e>0&&(this._timeout=window.setTi meout(function(){this.fire("trigger"),this._periodChanged(e)}.bind(this),1e3*e)) }})}()</script> </dom-module> <dom-module id="task-page-data" assetpath="/res/im p/taskpage/"> <script>!function(){var t,e=400,s=["abandoned_ts","completed_ts"," created_ts","modified_ts","started_ts"];Polymer({is:"task-page-data",behaviors:[ SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{aut h_headers:{type:Object},task_id:{type:String},busy:{type:Boolean,computed:"_or(_ busy1,_busy2,_busy3)",notify:!0},request:{type:Object,computed:"_parseRequest(_r equest)",notify:!0},result:{type:Object,computed:"_parseResult(_result)",notify: !0},stdout:{type:String,computed:"_parseStdout(_stdout)",notify:!0},task_exists: {type:Boolean,value:!0,notify:!0},_busy1:{type:Boolean,value:!1},_busy2:{type:Bo olean,value:!1},_busy3:{type:Boolean,value:!1},_request:{type:Object},_result:{t ype:Object},_stdout:{type:Object}},observers:["reload(auth_headers,task_id)"],re load:function(){if(!this.task_id||!this.auth_headers)return void console.log("ta sk_id and auth_headers can't be empty");t&&this.cancelAsync(t);var s="/api/swarm ing/v1/task/"+this.task_id;t=this.async(function(){t=void 0;var e=this._getJsonA sync("_request",s+"/request","_busy1",this.auth_headers);e.then(function(){this. set("task_exists",!0)}.bind(this)).catch(function(t){404===t.status?this.set("ta sk_exists",!1):sk.errorMessage("Http response: "+(t.status||" ")+" "+t.response) }.bind(this)),this._getJsonAsync("_result",s+"/result?include_performance_stats= true","_busy2",this.auth_headers),this.reloadStdout()},e)},_parseRequest:functio n(t){return t?(t.tagMap={},t.tags=t.tags||[],t.tags.forEach(function(e){var s=e. split(":",1),a=s[0],u=e.substring(a.length+1);t.tagMap[a]=u}),s.forEach(function (e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),t):{}} ,_parseResult:function(t){if(!t)return{};var e=new Date;return s.forEach(functio n(e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.du ration&&t.state===this.RUNNING&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3), t.duration&&(t.human_duration=this._humanDuration(t.duration)),t},_parseStdout:f unction(t){return t&&t.output?t.output:""},reloadStdout:function(){this._getJson Async("_stdout","/api/swarming/v1/task/"+this.task_id+"/stdout","_busy3",this.au th_headers)}})}()</script> </dom-module><dom-module id="task-disambiguation" ass etpath="/res/imp/taskpage/"> <template> <style include="swarming-app-style singl e-page-style task-style"></style> <table> <thead> <tr> <th>Try ID</th> <th>Bot I D</th> <th>Status</th> </tr> </thead> <tbody> <template id="result_list" is="dom -repeat" items="[[_results]]" as="result" observe="task_id bot_id state"> <tr> < td> <a href$="[[_taskLink(result.task_id,'true')]]"> [[result.task_id]] </a> </t d> <td> <a href$="[[_botLink(result.bot_id)]]"> [[result.bot_id]] </a> </td> <td class$="[[_stateClass(result)]]">[[state(result)]]</td> </tr> </template> </tbo dy> </table> </template> <script>Polymer({is:"task-disambiguation",behaviors:[Sw armingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],properties:{auth_ headers:{type:Object},summary_result:{type:Object},task_id:{type:String},busy:{t ype:Boolean,value:!1,notify:!0},_busyArr:{type:Array,value:function(){return[]}} ,_results:{type:Array,value:function(){return[]}}},observers:["_fetchRest(auth_h eaders,task_id,summary_result)","_computeBusy(_busyArr.*)"],_computeBusy:functio n(){for(var s=0;s<this._busyArr.length;s++)if(this._busyArr[s].status)return!0;r eturn!1},_fetchRest:function(s,r,t){if(s&&r&&t){var e=t.try_number;this.set("_bu syArr",[]),this.set("_results",[]);for(var u=r.substring(0,r.length-1),i="/api/s warming/v1/task/",a=0;a<e-1;a++){var n=u+(a+1);this.splice("_busyArr",a,0,{}),th is.splice("_results",a,0,{task_id:n}),this._getJsonAsyncArr(a,"_results",i+n+"/r esult","_busyArr",s)}t.task_id=u+e,this.splice("_results",e-1,1,t)}}})</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskpage/"> <templat e> <style include="iron-flex iron-flex-alignment swarming-app-style single-page- style task-style">.milo{width:calc(100% - 11px);height:2000px}.right{margin-top: 8px}.break-all{word-break:break-all}.expand{min-width:3em;vertical-align:middle; padding:.5em}.code{font-family:monospace}.stdout{white-space:pre-wrap;padding:2p x}.stdout.wide{white-space:pre;overflow-x:auto}.refresh_input{padding:0 5px}.rep roduce{margin-left:5px}.tabbed{border:3px solid #1F78B4;margin-left:5px;min-heig ht:80vh;min-width:550px}.task-info{min-width:500px}.cipd-header{-moz-user-select :none;-webkit-user-select:none;-ms-user-select:none;user-select:none;font-weight :700;margin-left:8px}.full-width{min-width:100%}.full-width-container{position:r elative}.full-width-container>paper-checkbox{position:absolute;bottom:10px;width :140px;left:5px}</style> <url-param name="id" value="{{task_id}}"> </url-param> <url-param name="try_detail" value="{{_try_detail}}"> </url-param> <url-param na me="request_detail" value="{{_request_detail}}"> </url-param> <url-param name="s how_raw" value="{{_show_raw}}"> </url-param> <url-param name="wide_logs" value=" {{_wide_logs}}"> </url-param> <url-param name="refresh" value="{{_refresh_interv al}}" default_value="10"> </url-param> <swarming-app client_id="[[client_id]]" a uth_headers="{{_auth_headers}}" permissions="{{_permissions}}" profile="{{_profi le}}" server_details="{{_server_details}}" signed_in="{{_signed_in}}" busy="[[_o r(_busy1,busy2)]]" name="Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You m ust sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <t ask-page-data id="data" auth_headers="[[_auth_headers]]" task_id="[[task_id]]" b usy="{{_busy1}}" request="{{_request}}" result="{{_result}}" stdout="{{_stdout}} " task_exists="{{_task_exists}}"> </task-page-data> <div class="horizontal layou t wrap"> <div class="left flex"> <div class="horizontal layout"> <paper-input cl ass="id_input" label="Task id" value="{{task_id}}"></paper-input> <button on-cli ck="_refresh"> <iron-icon class="refresh" icon="icons:refresh"></iron-icon> </bu tton> <button on-click="_promptRetry">Retry</button> <template is="dom-if" if="[ [_canCancelTask(_result,_permissions)]]"> <button on-click="_promptCancel">Cance l</button> </template> </div> <h2 hidden$="[[_task_exists]]">Task not found.</h2 > <template is="dom-if" if="[[_disambiguate(task_id,_result)]]"> <h2>Displaying a summary for a task with multiple tries</h2> <task-disambiguation busy="{{busy2 }}" auth_headers="[[_auth_headers]]" task_id="[[task_id]]" summary_result="[[_re sult]]"> </task-disambiguation> </template> <table class="task-info" hidden$="[[ _not(_task_exists)]]"> <tbody> <tr> <td>Name</td> <td>[[_request.name]]</td> </t r> <tr> <td>State</td> <td class$="[[_stateClass(_result)]]">[[state(_result)]]< /td> </tr> <tr> <td>Created</td> <td title$="[[_request.created_ts]]">[[_request .human_created_ts]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_result) ]]"> <tr> <td>Started</td> <td title$="[[_result.started_ts]]">[[_result.human_s tarted_ts]]</td> </tr> </template> <template is="dom-if" if="[[_wasNotPickedUp(_ result)]]"> <tr> <td>Expires</td> <td>[[_expires(_request)]]</td> </tr> </templa te> <template is="dom-if" if="[[_result.human_completed_ts]]"> <tr> <td>Complete d</td> <td title$="[[_result.completed_ts]]">[[_result.human_completed_ts]]</td> </tr> </template> <template is="dom-if" if="[[_result.human_abandoned_ts]]"> <t r> <td>Abandoned</td> <td title$="[[_result.abandoned_ts]]">[[_result.human_aban doned_ts]]</td> </tr> </template> <tr> <td>Last Updated</td> <td title$="[[_resu lt.modified_ts]]">[[_result.human_modified_ts]]</td> </tr> <template is="dom-if" if="[[_result.deduped_from]]"> <tr> <td><b>Deduped from</b></td> <td> <a href$= "[[_taskLink(_result.deduped_from)]]"> [[_result.deduped_from]] </a> </td> </tr> </template> <tr> <td>Pending Time</td> <td>[[_pending(_result)]]</td> </tr> <tr > <td>Duration</td> <td>[[_result.human_duration]]</td> </tr> <tr> <td>Priority< /td> <td>[[_request.priority]]</td> </tr> <tr> <td>User</td> <td>[[_request.user ]]</td> </tr> <tr> <td>Authenticated</td> <td>[[_request.authenticated]]</td> </ tr> <template is="dom-if" if="[[_request.service_account]]"> <tr> <td>Service Ac count</td> <td>[[_request.service_account]]</td> </tr> </template> <template is= "dom-if" if="[[_request.properties.secret_bytes]]"> <tr> <td>Secret Bytes</td> < td>[[_request.properties.secret_bytes]]</td> </tr> </template> <template is="dom -if" if="[[_request.parent_task_id]]"> <tr> <td>Parent Task</td> <td> <a href$=" [[_taskLink(_request.parent_task_id)]]">[[_request.parent_task_id]]</a> </td> </ tr> </template> <tr> <td rowspan$="[[_rowspan(_request.properties.dimensions)]]" > <a title="The list of bots that matches the list of dimensions" href$="[[_botL istLink(_request.properties.dimensions)]]"> Requested Dimensions </a> </td> </tr > <template is="dom-repeat" items="{{_request.properties.dimensions}}" as="dimen sion"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</td> </tr> </tem plate> <tr> <td>Isolated Inputs</td> <td> <a href$="[[_isolateLink(_request.prop erties.inputs_ref)]]"> [[_request.properties.inputs_ref.isolated]] </a> </td> </ tr> <template is="dom-if" if="[[_request.properties.outputs.length]]"> <tr> <td rowspan$="[[_rowspan(_request.properties.outputs)]]">Expected outputs</td> </tr> <template is="dom-repeat" items="{{_request.properties.outputs}}" as="output"> <tr> <td>[[output]]</td> </tr> </template> </template> <template is="dom-if" if= "[[_not(_request_detail)]]"> <tr> <td>More Details</td> <td> <button on-click="_ toggleDetails"> <iron-icon icon="icons:add-circle-outline"></iron-icon> </button > </td> </tr> </template> <template is="dom-if" if="[[_request_detail]]"> <tr> < td>Hide Details</td> <td> <button on-click="_toggleDetails"> <iron-icon icon="ic ons:remove-circle-outline"></iron-icon> </button> </td> </tr> </template> </tbod y> <tbody id="more_details" hidden$="[[!_request_detail]]"> <tr> <td>Extra Args< /td> <td class="code break-all">[[_extraArgs(_request)]]</td> </tr> <tr> <td>Com mand</td> <td class="code break-all">[[_command(_request)]]</td> </tr> <tr> <td> Idempotent</td> <td>[[_request.properties.idempotent]]</td> </tr> <tr> <td rowsp an$="[[_rowspan(_request.tags)]]">Tags</td> </tr> <template is="dom-repeat" item s="{{_request.tags}}" as="tag"> <tr> <td class="break-all">[[tag]]</td> </tr> </ template> <tr> <td>Execution timeout</td> <td>[[_humanDuration(_request.properti es.execution_timeout_secs)]]</td> </tr> <tr> <td>I/O timeout</td> <td>[[_humanDu ration(_request.properties.io_timeout_secs)]]</td> </tr> <tr> <td>Grace period</ td> <td>[[_humanDuration(_request.properties.grace_period_secs)]]</td> </tr> <tr > <td>CIPD server</td> <td> <a href$="[[_request.properties.cipd_input.server]]" > [[_request.properties.cipd_input.server]] </a> </td> </tr> <tr> <td>CIPD versi on</td> <td class="break-all">[[_request.properties.cipd_input.client_package.ve rsion]]</td> </tr> <template is="dom-if" if="[[_wasPickedUp(_result)]]"> <tr> <t d>CIPD package name</td> <td>[[_result.cipd_pins.client_package.package_name]]</ td> </tr> </template> <tr hidden$="[[_not(_request.properties.cipd_input)]]"> <t d rowspan$="[[_cipdRowspan(_request,_result)]]">CIPD packages</td> </tr> <templa te is="dom-repeat" items="[[_cipdPackages(_request,_result)]]" as="cipd"> <tr> < td>[[cipd.path]]/</td> </tr> <tr> <td class="break-all"> <span class="cipd-heade r">Requested: </span>[[cipd.requested]] </td> </tr> <tr hidden$="[[!_hasActualCI PDPackages(_result)]]"> <td class="break-all"> <span class="cipd-header">Actual: </span>[[cipd.actual]] </td> </tr> </template> <tr hidden$="[[_empty(_request.p roperties.caches)]]"> <td rowspan$="[[_rowspan(_request.properties.caches)]]">Na med caches</td> </tr> <template is="dom-repeat" items="[[_request.properties.cac hes]]" as="cache"> <tr> <td><span>[[cache.name]]</span>:<span>[[cache.path]]</sp an></td> </tr> </template> </tbody> </table> <div class="title" hidden$="[[_not( _task_exists)]]">Task Execution</div> <template is="dom-if" if="[[_wasPickedUp(_ result)]]"> <table hidden$="[[_not(_task_exists)]]"> <tbody><tr> <td>Bot assigne d to task</td> <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]]</a ></td> </tr> <tr> <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> <a>Bot Di mensions</a> </td> </tr> <template is="dom-repeat" items="[[_result.bot_dimensio ns]]" as="dimension"> <tr> <td><b>[[dimension.key]]:</b> [[_alias(dimension)]]</ td> </tr> </template> <tr> <td>Exit code</td> <td>[[_result.exit_code]]</td> </t r> <tr> <td>Try number</td> <td>[[_result.try_number]]</td> </tr> <tr> <td>Failu re</td> <td class$="[[_failureClass(_result.failure)]]">[[_result.failure]]</td> </tr> <tr> <td>Internal Failure</td> <td class$="[[_internalClass(_result.inter nal_failure)]]">[[_result.internal_failure]]</td> </tr> <tr> <td>Isolated Output s</td> <td> <a href$="[[_isolateLink(_result.outputs_ref)]]"> [[_result.outputs_ ref.isolated]] </a> </td> </tr> <tr> <td>Bot version</td> <td>[[_result.bot_vers ion]]</td> </tr> <tr> <td>Server version</td> <td>[[_result.server_versions]]</t d> </tr> </tbody></table> </template> <template is="dom-if" if="[[_wasNotPickedU p(_result)]]"> This space left blank until a bot is assigned to the task. </temp late> <template is="dom-if" if="[[_result.performance_stats]]"> <div class="titl e">Performance Stats</div> <table> <tbody><tr> <td title="This includes time tak en to download inputs, isolate outputs, and setup CIPD">Total Overhead</td> <td> [[_humanDuration(_result.performance_stats.bot_overhead)]]</td> </tr> <tr> <td>D ownloading Inputs From Isolate</td> <td>[[_humanDuration(_result.performance_sta ts.isolated_download.duration)]]</td> </tr> <tr> <td>Uploading Outputs To Isolat e</td> <td>[[_humanDuration(_result.performance_stats.isolated_upload.duration)] ]</td> </tr> <tr hidden$="[[!_result.performance_stats.isolated_download.initial _size]]"> <td>Initial bot cache</td> <td>[[_result.performance_stats.isolated_do wnload.initial_number_items]] items; [[_bytes(_result.performance_stats.isolated _download.initial_size)]]</td> </tr> </tbody></table> </template> <div hidden$=" [[_not(_task_exists)]]"> <div class="title">Reproducing the task locally</div> < div class="reproduce"> <div>Download inputs files into directory <i>foo</i>:</di v> <div class="code"> python isolateserver.py download -I [[_request.properties. inputs_ref.isolatedserver]] --namespace [[_request.properties.inputs_ref.namespa ce]] -s [[_request.properties.inputs_ref.isolated]] --target foo</div> <br> <div >Run this task locally:</div> <div class="code"> python swarming.py reproduce -S [[_host_url]] [[task_id]]</div> <br> <div>Download output results into director y <i>foo</i>:</div> <div class="code"> python swarming.py collect -S [[_host_url ]] --task-output-dir=foo [[task_id]]</div> <br> <div>Looking for <i>swarming.py< /i>?</div> <div class="code"> git clone https://github.com/luci/client-py</div> </div> </div> </div> <div class$="flex right [[_classRight(_wide_logs)]]" hidden $="[[_not(_task_exists)]]"> <div class="horizontal layout"> <div class="tabs"> < paper-tabs selected="{{_show_raw}}" no-bar=""> <paper-tab disabled$="[[_noMilo(_ request)]]">Milo Output</paper-tab> <paper-tab>Raw Output</paper-tab> </paper-ta bs> </div> <paper-input class="refresh_input" label="Refresh Interval (seconds)" value="{{_refresh_interval}}" title="How often to refresh all information about the task" auto-validate="" min="1" max="1000" pattern="[0-9]+"> </paper-input> <div class="full-width-container"> <paper-checkbox checked="{{_wide_logs}}"> Ful l Width Logs </paper-checkbox> </div> </div> <template is="dom-if" if="[[_suppor tsMilo(_request,_show_raw)]]"> <div class="milo tabbed" hidden$="[[_isSummaryLin k(task_id)]]"> Milo results are only generated for task summaires, that is, task s whose ids end in 0. Tasks ending in 1 or 2 represent possible retries of tasks . See <a href="//goo.gl/LE4rwV">the docs</a> for more. </div> <iframe id="miloFr ame" class="milo tabbed" src$="[[_getDisplayServerLink(_server_details.display_s erver_url_template,task_id)]]"></iframe> </template> <template is="dom-if" if="[ [_show_raw]]"> <div class$="code stdout tabbed break-all [[_classStdout(_wide_lo gs)]]">[[_rawOutput(_stdout,_result)]]</div> </template> </div> </div> </div> </ swarming-app> <paper-dialog id="prompt" modal="" on-iron-overlay-closed="_prompt Closed"> <h2>Are you sure?</h2> <div>Are you sure you want to [[_dialog_prompt]] ?</div> <div class="buttons"> <paper-button dialog-dismiss="" autofocus="">No</p aper-button> <paper-button dialog-confirm="">Yes</paper-button> </div> </paper-d ialog> <interval-timer period="[[_refresh_interval]]" on-trigger="_softRefresh"> </interval-timer> </template> <script>!function(){Polymer({is:"task-page",behav iors:[SwarmingBehaviors.CommonBehavior,SwarmingBehaviors.TaskBehavior],propertie s:{task_id:{type:String},client_id:{type:String},_dialog_prompt:{type:String,val ue:""},_host_url:{type:String,value:function(){return window.location.hostname}} ,_refresh_interval:{type:Number},_request:{type:Object,observer:"_requestUpdated "},_request_detail:{type:Boolean},_result:{type:Object},_server_details:{type:Ob ject},_stdout:{type:String}},_alias:function(t){var e=t.value;return Array.isArr ay(e)||(e=[e]),swarming.alias.has(t.key)&&e.forEach(function(i,s){e[s]=swarming. alias.apply(i,t.key)}),e.join(" | ")},_bytes:function(t){return sk.human.bytes(t )},_canCancelTask:function(t,e){return t&&"PENDING"===t.state&&e.cancel_task},_c ancelTask:function(){var t="/api/swarming/v1/task/"+this.task_id+"/cancel";swarm ing.postWithToast(t,"Canceling task "+this.task_id,this._auth_headers)},_cipdRow span:function(t,e){if(!t||!t.properties||!t.properties.cipd_input)return 0;var i =(t.properties.cipd_input.packages||[]).length;return i*=this._hasActualCIPDPack ages(e)?3:2,i+1},_cipdPackages:function(t,e){if(!t||!t.properties||!t.properties .cipd_input)return[];var i=t.properties.cipd_input.packages||[],s=e&&e.cipd_pins &&e.cipd_pins.packages||[];return i.forEach(function(t){t.requested=t.package_na me+":"+t.version,s.forEach(function(e){e.path===t.path&&(t.actual=e.package_name +":"+e.version)})}),i},_classRight:function(t){return t?"full-width":""},_classS tdout:function(t){return t?"wide":""},_command:function(t){if(!t||!t.properties) return"";var e=t.properties.command||[];return e.join(" ")},_disambiguate:functi on(t,e){return!(!t.endsWith("0")||!e)&&e.try_number>1},_empty:function(t){return !t||0==t.length},_expires:function(t){var e=parseInt(t.expiration_secs);return e ?sk.human.localeTime(new Date(t.created_ts.getTime()+1e3*e)):t.expiration_secs+" seconds from created time"},_extraArgs:function(t){if(!t||!t.properties)return" ";var e=t.properties.extra_args||[];return e.join(" ")},_failureClass:function(t ){return t?"failed_task":""},_getDisplayServerLink:function(t,e){if(t)return t.r eplace("%s",e)},_hasActualCIPDPackages:function(t){return t&&t.cipd_pins&&t.cipd _pins.packages},_internalClass:function(t){return t?"exception":""},_isolateLink :function(t){if(t&&t.isolatedserver)return t.isolatedserver+"/browse?namespace=" +t.namespace+"&hash="+t.isolated},_isSummaryLink:function(t){return t&&t.endsWit h(0)},_noMilo:function(t){return!this._tag(t,"allow_milo")},_pending:function(t) {if(!t.created_ts)return"";var e=t.started_ts||t.abandoned_ts||new Date;return e <=t.created_ts?"0s":this._timeDiffExact(t.created_ts,e)},_promptClosed:function( t){t.detail.confirmed&&(this._dialog_prompt.startsWith("cancel")?this._cancelTas k():this._retryTask())},_promptCancel:function(){this.set("_dialog_prompt","canc el task "+this.task_id),this.$.prompt.open()},_promptRetry:function(){this.set(" _dialog_prompt","retry task "+this.task_id),this.$.prompt.open()},_rawOutput:fun ction(t,e){return t?t:"PENDING"===e.state||"RUNNING"===e.state?"[No output yet]" :"[No output received]"},_refresh:function(){this.$.data.reload()},_requestUpdat ed:function(t){this._noMilo(t)&&this.set("_show_raw",1)},_softRefresh:function() {if(!this._result||"RUNNING"===this._result.state||"PENDING"===this._result.stat e){this.$.data.reload();var t=this.$$("iframe");t&&(t.src=this._getDisplayServer Link(this._server_details.display_server_url_template,this.task_id))}},_retryTas k:function(){if(!this._request)return void sk.errorMessage("Task not yet loaded" ,3e3);var t={expiration_secs:this._request.expiration_secs,name:this._request.na me+" (retry)",parent_task_id:this._request.parent_task_id,priority:this._request .priority,properties:this._request.properties,tags:this._request.tags,user:this. _profile.email,service_account:this._request.service_account};t.properties.idemp otent=!1,swarming.postWithToast("/api/swarming/v1/tasks/new","Retrying task "+th is.task_id,this._auth_headers,t).then(function(t){if(t=JSON.parse(t),t&&t.task_i d){var e={id:this.task_id};history.pushState(e,"Task Page"),this.set("task_id",t .task_id)}}.bind(this),function(t){console.log("Task could not be retried",t)})} ,_rowspan:function(t){return t=t||[],t.length+1},_supportsMilo:function(t,e){ret urn!e&&t&&this._tag(t,"allow_milo")},_toggleDetails:function(){this.set("_reques t_detail",!this._request_detail)},_tag:function(t,e){if(t&&t.tagMap)return t.tag Map[e]},_wasPickedUp:function(t){return t&&t.state!==this.PENDING&&t.state!==thi s.CANCELED&&t.state!=this.EXPIRED},_wasNotPickedUp:function(t){return t&&!this._ wasPickedUp(t)}})}()</script> </dom-module> </div></body></html>
OLDNEW
« no previous file with comments | « appengine/swarming/handlers_endpoints.py ('k') | appengine/swarming/ui/res/imp/botlist/bot-list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698