forked from Polymer/old-docs-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon_elements.vulcanized.js
More file actions
4 lines (4 loc) · 108 KB
/
common_elements.vulcanized.js
File metadata and controls
4 lines (4 loc) · 108 KB
1
2
3
4
Polymer("core-selection",{multi:false,ready:function(){this.clear()},clear:function(){this.selection=[]},getSelection:function(){return this.multi?this.selection:this.selection[0]},isSelected:function(item){return this.selection.indexOf(item)>=0},setItemSelected:function(item,isSelected){if(item!==undefined&&item!==null){if(isSelected){this.selection.push(item)}else{var i=this.selection.indexOf(item);if(i>=0){this.selection.splice(i,1)}}this.fire("core-select",{isSelected:isSelected,item:item})}},select:function(item){if(this.multi){this.toggle(item)}else if(this.getSelection()!==item){this.setItemSelected(this.getSelection(),false);this.setItemSelected(item,true)}},toggle:function(item){this.setItemSelected(item,!this.isSelected(item))}});Polymer("core-selector",{selected:null,multi:false,valueattr:"name",selectedClass:"core-selected",selectedProperty:"",selectedAttribute:"active",selectedItem:null,selectedModel:null,selectedIndex:-1,excludedLocalNames:"",target:null,itemsSelector:"",activateEvent:"tap",notap:false,defaultExcludedLocalNames:"template",ready:function(){this.activateListener=this.activateHandler.bind(this);this.itemFilter=this.filterItem.bind(this);this.excludedLocalNamesChanged();this.observer=new MutationObserver(this.updateSelected.bind(this));if(!this.target){this.target=this}},get items(){if(!this.target){return[]}var nodes=this.target!==this?this.itemsSelector?this.target.querySelectorAll(this.itemsSelector):this.target.children:this.$.items.getDistributedNodes();return Array.prototype.filter.call(nodes,this.itemFilter)},filterItem:function(node){return!this._excludedNames[node.localName]},excludedLocalNamesChanged:function(){this._excludedNames={};var s=this.defaultExcludedLocalNames;if(this.excludedLocalNames){s+=" "+this.excludedLocalNames}s.split(/\s+/g).forEach(function(n){this._excludedNames[n]=1},this)},targetChanged:function(old){if(old){this.removeListener(old);this.observer.disconnect();this.clearSelection()}if(this.target){this.addListener(this.target);this.observer.observe(this.target,{childList:true});this.updateSelected()}},addListener:function(node){Polymer.addEventListener(node,this.activateEvent,this.activateListener)},removeListener:function(node){Polymer.removeEventListener(node,this.activateEvent,this.activateListener)},get selection(){return this.$.selection.getSelection()},selectedChanged:function(){this.updateSelected()},updateSelected:function(){this.validateSelected();if(this.multi){this.clearSelection();this.selected&&this.selected.forEach(function(s){this.valueToSelection(s)},this)}else{this.valueToSelection(this.selected)}},validateSelected:function(){if(this.multi&&!Array.isArray(this.selected)&&this.selected!==null&&this.selected!==undefined){this.selected=[this.selected]}},clearSelection:function(){if(this.multi){this.selection.slice().forEach(function(s){this.$.selection.setItemSelected(s,false)},this)}else{this.$.selection.setItemSelected(this.selection,false)}this.selectedItem=null;this.$.selection.clear()},valueToSelection:function(value){var item=value===null||value===undefined?null:this.items[this.valueToIndex(value)];this.$.selection.select(item)},updateSelectedItem:function(){this.selectedItem=this.selection},selectedItemChanged:function(){if(this.selectedItem){var t=this.selectedItem.templateInstance;this.selectedModel=t?t.model:undefined}else{this.selectedModel=null}this.selectedIndex=this.selectedItem?parseInt(this.valueToIndex(this.selected)):-1},valueToIndex:function(value){for(var i=0,items=this.items,c;c=items[i];i++){if(this.valueForNode(c)==value){return i}}return value},valueForNode:function(node){return node[this.valueattr]||node.getAttribute(this.valueattr)},selectionSelect:function(e,detail){this.updateSelectedItem();if(detail.item){this.applySelection(detail.item,detail.isSelected)}},applySelection:function(item,isSelected){if(this.selectedClass){item.classList.toggle(this.selectedClass,isSelected)}if(this.selectedProperty){item[this.selectedProperty]=isSelected}if(this.selectedAttribute&&item.setAttribute){if(isSelected){item.setAttribute(this.selectedAttribute,"")}else{item.removeAttribute(this.selectedAttribute)}}},activateHandler:function(e){if(!this.notap){var i=this.findDistributedTarget(e.target,this.items);if(i>=0){var item=this.items[i];var s=this.valueForNode(item)||i;if(this.multi){if(this.selected){this.addRemoveSelected(s)}else{this.selected=[s]}}else{this.selected=s}this.asyncFire("core-activate",{item:item})}}},addRemoveSelected:function(value){var i=this.selected.indexOf(value);if(i>=0){this.selected.splice(i,1)}else{this.selected.push(value)}this.valueToSelection(value)},findDistributedTarget:function(target,nodes){while(target&&target!=this){var i=Array.prototype.indexOf.call(nodes,target);if(i>=0){return i}target=target.parentNode}},selectIndex:function(index){var item=this.items[index];if(item){this.selected=this.valueForNode(item)||index;return item}},selectPrevious:function(wrap){var i=wrap&&!this.selectedIndex?this.items.length-1:this.selectedIndex-1;return this.selectIndex(i)},selectNext:function(wrap){var i=wrap&&this.selectedIndex>=this.items.length-1?0:this.selectedIndex+1;return this.selectIndex(i)}});Polymer("core-menu");(function(){var SKIP_ID="meta";var metaData={},metaArray={};Polymer("core-meta",{type:"default",alwaysPrepare:true,ready:function(){this.register(this.id)},get metaArray(){var t=this.type;if(!metaArray[t]){metaArray[t]=[]}return metaArray[t]},get metaData(){var t=this.type;if(!metaData[t]){metaData[t]={}}return metaData[t]},register:function(id,old){if(id&&id!==SKIP_ID){this.unregister(this,old);this.metaData[id]=this;this.metaArray.push(this)}},unregister:function(meta,id){delete this.metaData[id||meta.id];var i=this.metaArray.indexOf(meta);if(i>=0){this.metaArray.splice(i,1)}},get list(){return this.metaArray},byId:function(id){return this.metaData[id]}})})();Polymer("core-iconset",{src:"",width:0,icons:"",iconSize:24,offsetX:0,offsetY:0,type:"iconset",created:function(){this.iconMap={};this.iconNames=[];this.themes={}},ready:function(){if(this.src&&this.ownerDocument!==document){this.src=this.resolvePath(this.src,this.ownerDocument.baseURI)}this.super();this.updateThemes()},iconsChanged:function(){var ox=this.offsetX;var oy=this.offsetY;this.icons&&this.icons.split(/\s+/g).forEach(function(name,i){this.iconNames.push(name);this.iconMap[name]={offsetX:ox,offsetY:oy};if(ox+this.iconSize<this.width){ox+=this.iconSize}else{ox=this.offsetX;oy+=this.iconSize}},this)},updateThemes:function(){var ts=this.querySelectorAll("property[theme]");ts&&ts.array().forEach(function(t){this.themes[t.getAttribute("theme")]={offsetX:parseInt(t.getAttribute("offsetX"))||0,offsetY:parseInt(t.getAttribute("offsetY"))||0}},this)},getOffset:function(icon,theme){var i=this.iconMap[icon];if(!i){var n=this.iconNames[Number(icon)];i=this.iconMap[n]}var t=this.themes[theme];if(i&&t){return{offsetX:i.offsetX+t.offsetX,offsetY:i.offsetY+t.offsetY}}return i},applyIcon:function(element,icon,scale){var offset=this.getOffset(icon);scale=scale||1;if(element&&offset){var icon=element._icon||document.createElement("div");var style=icon.style;style.backgroundImage="url("+this.src+")";style.backgroundPosition=-offset.offsetX*scale+"px"+" "+(-offset.offsetY*scale+"px");style.backgroundSize=scale===1?"auto":this.width*scale+"px";if(icon.parentNode!==element){element.appendChild(icon)}return icon}}});(function(){var meta;Polymer("core-icon",{src:"",icon:"",alt:null,observe:{icon:"updateIcon",alt:"updateAlt"},defaultIconset:"icons",ready:function(){if(!meta){meta=document.createElement("core-iconset")}if(this.hasAttribute("aria-label")){if(!this.hasAttribute("role")){this.setAttribute("role","img")}return}this.updateAlt()},srcChanged:function(){var icon=this._icon||document.createElement("div");icon.textContent="";icon.setAttribute("fit","");icon.style.backgroundImage="url("+this.src+")";icon.style.backgroundPosition="center";icon.style.backgroundSize="100%";if(!icon.parentNode){this.appendChild(icon)}this._icon=icon},getIconset:function(name){return meta.byId(name||this.defaultIconset)},updateIcon:function(oldVal,newVal){if(!this.icon){this.updateAlt();return}var parts=String(this.icon).split(":");var icon=parts.pop();if(icon){var set=this.getIconset(parts.pop());if(set){this._icon=set.applyIcon(this,icon);if(this._icon){this._icon.setAttribute("fit","")}}}if(oldVal){if(oldVal.split(":").pop()==this.getAttribute("aria-label")){this.updateAlt()}}},updateAlt:function(){if(this.getAttribute("aria-hidden")){return}if(this.alt===""){this.setAttribute("aria-hidden","true");if(this.hasAttribute("role")){this.removeAttribute("role")}if(this.hasAttribute("aria-label")){this.removeAttribute("aria-label")}}else{this.setAttribute("aria-label",this.alt||this.icon.split(":").pop());if(!this.hasAttribute("role")){this.setAttribute("role","img")}if(this.hasAttribute("aria-hidden")){this.removeAttribute("aria-hidden")}}}})})();Polymer("core-item",{});Polymer("core-collapse",{target:null,horizontal:false,opened:false,duration:.33,fixedSize:false,created:function(){this.transitionEndListener=this.transitionEnd.bind(this)},ready:function(){this.target=this.target||this},domReady:function(){this.async(function(){this.afterInitialUpdate=true})},detached:function(){if(this.target){this.removeListeners(this.target)}},targetChanged:function(old){if(old){this.removeListeners(old)}if(!this.target){return}this.isTargetReady=!!this.target;this.classList.toggle("core-collapse-closed",this.target!==this);this.target.style.overflow="hidden";this.horizontalChanged();this.addListeners(this.target);this.toggleClosedClass(true);this.update()},addListeners:function(node){node.addEventListener("transitionend",this.transitionEndListener)},removeListeners:function(node){node.removeEventListener("transitionend",this.transitionEndListener)},horizontalChanged:function(){this.dimension=this.horizontal?"width":"height"},openedChanged:function(){this.update();this.fire("core-collapse-open",this.opened)},toggle:function(){this.opened=!this.opened},setTransitionDuration:function(duration){var s=this.target.style;s.transition=duration?this.dimension+" "+duration+"s":null;if(duration===0){this.async("transitionEnd")}},transitionEnd:function(){if(this.opened&&!this.fixedSize){this.updateSize("auto",null)}this.setTransitionDuration(null);this.toggleClosedClass(!this.opened);this.asyncFire("core-resize",null,this.target)},toggleClosedClass:function(closed){this.hasClosedClass=closed;this.target.classList.toggle("core-collapse-closed",closed)},updateSize:function(size,duration,forceEnd){this.setTransitionDuration(duration);this.calcSize();var s=this.target.style;var nochange=s[this.dimension]===size;s[this.dimension]=size;if(forceEnd&&nochange){this.transitionEnd()}},update:function(){if(!this.target){return}if(!this.isTargetReady){this.targetChanged()}this.horizontalChanged();this[this.opened?"show":"hide"]()},calcSize:function(){return this.target.getBoundingClientRect()[this.dimension]+"px"},getComputedSize:function(){return getComputedStyle(this.target)[this.dimension]},show:function(){this.toggleClosedClass(false);if(!this.afterInitialUpdate){this.transitionEnd();return}if(!this.fixedSize){this.updateSize("auto",null);var s=this.calcSize();if(s=="0px"){this.transitionEnd();return}this.updateSize(0,null)}this.async(function(){this.updateSize(this.size||s,this.duration,true)})},hide:function(){if(this.hasClosedClass&&!this.fixedSize){return}if(this.fixedSize){this.size=this.getComputedSize()}else{this.updateSize(this.calcSize(),null)}this.async(function(){this.updateSize(0,this.duration)})}});Polymer("core-submenu",{publish:{active:{value:false,reflect:true}},opened:false,get items(){return this.$.submenu.items},hasItems:function(){return!!this.items.length},unselectAllItems:function(){this.$.submenu.selected=null;this.$.submenu.clearSelection()},activeChanged:function(){if(this.hasItems()){this.opened=this.active}if(!this.active){this.unselectAllItems()}},toggle:function(){this.opened=!this.opened},activate:function(){if(this.hasItems()&&this.active){this.toggle();this.unselectAllItems()}}});Polymer("core-iconset-svg",{iconSize:24,type:"iconset",created:function(){this._icons={}},ready:function(){this.super();this.updateIcons()},iconById:function(id){return this._icons[id]||(this._icons[id]=this.querySelector("#"+id))},cloneIcon:function(id){var icon=this.iconById(id);if(icon){var content=icon.cloneNode(true);content.removeAttribute("id");var svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("viewBox","0 0 "+this.iconSize+" "+this.iconSize);svg.style.pointerEvents="none";svg.appendChild(content);return svg}},get iconNames(){if(!this._iconNames){this._iconNames=this.findIconNames()}return this._iconNames},findIconNames:function(){var icons=this.querySelectorAll("[id]").array();if(icons.length){return icons.map(function(n){return n.id})}},applyIcon:function(element,icon){var root=element;var old=root.querySelector("svg");if(old){old.remove()}var svg=this.cloneIcon(icon);if(!svg){return}svg.setAttribute("height","100%");svg.setAttribute("width","100%");svg.setAttribute("preserveAspectRatio","xMidYMid meet");svg.style.display="block";root.insertBefore(svg,root.firstElementChild);return svg},updateIcons:function(selector,method){selector=selector||"[icon]";method=method||"updateIcon";var deep=window.ShadowDOMPolyfill?"":"html /deep/ ";var i$=document.querySelectorAll(deep+selector);for(var i=0,e;e=i$[i];i++){if(e[method]){e[method].call(e)}}}});Polymer("docs-menu",{ajaxify:false,isReady:false,coreElements:{},paperElements:{},created:function(){this.coreElementsList=[];this.paperElementsList=[]},domReady:function(){this.isReady=true;this.async(this.menuChanged)},coreElementsChanged:function(){for(var name in this.coreElements){this.coreElementsList.push({name:name,url:this.coreElements[name]})}},paperElementsChanged:function(){for(var name in this.paperElements){this.paperElementsList.push({name:name,url:this.paperElements[name]})}},menuChanged:function(){if(this.isReady&&this.coreElementsList.length&&this.paperElementsList.length){this.highlightItemWithCurrentURL()}},highlightItemWithCurrentURL:function(opt_href){var href=opt_href||location.pathname+location.hash;if(href.match(/\/articles\//)){this.$.mainmenu.selected=this.$.mainmenu.items.indexOf(this.$.articles);return}else if(href.match(/core-elements.html$/)){this.$.mainmenu.selected=this.$.mainmenu.items.indexOf(this.$.coreelements);return}else if(href.match(/paper-elements.html$/)){this.$.mainmenu.selected=this.$.mainmenu.items.indexOf(this.$.paperelements);return}var item=this.shadowRoot.querySelector('[href$="'+href+'"]');if(!item){item=this.shadowRoot.querySelector('[data-href$="'+href+'"]')}if(item){var submenu=item.parentElement;if(submenu==this.$.mainmenu){return}if(submenu.parentElement&&submenu.parentElement.localName=="core-submenu"){do{submenu.parentElement.selected=submenu.parentElement.items.indexOf(submenu);submenu=submenu.parentElement}while(submenu&&submenu.localName=="core-submenu")}else{this.$.mainmenu.selected=this.$.mainmenu.items.indexOf(submenu)}}}});Polymer("core-media-query",{queryMatches:false,query:"",ready:function(){this._mqHandler=this.queryHandler.bind(this);this._mq=null},queryChanged:function(){if(this._mq){this._mq.removeListener(this._mqHandler)}var query=this.query;if(query[0]!=="("){query="("+this.query+")"}this._mq=window.matchMedia(query);this._mq.addListener(this._mqHandler);this.queryHandler(this._mq)},queryHandler:function(mq){this.queryMatches=mq.matches;this.asyncFire("core-media-change",mq)}});(function(){function onScroll_(){this.previousScrollY=this.latestKnownScrollY;this.latestKnownScrollY=window.scrollY||window.pageYOffset;requestTick_.bind(this)()}function requestTick_(){if(!this.ticking){window.requestAnimationFrame(update_.bind(this))}this.ticking=true}function update_(){this.ticking=false;var currentScrollY=this.latestKnownScrollY;this.smallBannerSizeReached=this.siteBannerHeight-currentScrollY<this.appBarHeight;if(this.smallBannerSizeReached){this.classList.add("scrolling");this.header&&this.header.classList.add("shrink")}else{this.classList.remove("scrolling");this.header&&this.header.classList.remove("shrink");if(this.header&&this.header.offsetTop-currentScrollY<=0){this.header.classList.add("shrink")}}}Polymer("scroll-area",{latestKnownScrollY:0,previousScrollY:0,smallBannerSizeReached:false,ticking:false,fancyheader:true,publish:{sidebar:{value:false,reflect:true}},attached:function(){this.init()},init:function(){var siteBanner=this.querySelector("site-banner");this.appBar=siteBanner.querySelector("app-bar");this.header=siteBanner.querySelector("header");this.async(function(){this.siteBannerHeight=siteBanner.offsetHeight;this.appBarHeight=this.appBar.offsetHeight});this.onscroll=onScroll_.bind(this);this.fancyheaderChanged();if((window.scrollY||window.pageYOffset)&&this.fancyheader){this.onscroll()}},fancyheaderChanged:function(){if(this.fancyheader){window.addEventListener("scroll",this.onscroll,false)}else{window.removeEventListener("scroll",this.onscroll,false);this.classList.remove("scrolling");this.header&&this.header.classList.remove("shrink")}}})})();(function(){Polymer("site-banner",{shortname:"",isPhone:false,isPhoneChanged:function(){this.parentElement.classList.toggle("mobile",this.isPhone)}})})();Polymer("paper-focusable",{publish:{active:{value:false,reflect:true},focused:{value:false,reflect:true},pressed:{value:false,reflect:true},disabled:{value:false,reflect:true},isToggle:{value:false,reflect:false}},disabledChanged:function(){if(this.disabled){this.removeAttribute("tabindex")}else{this.setAttribute("tabindex",0)}},downAction:function(){this.pressed=true;if(this.isToggle){this.active=!this.active}else{this.active=true}},contextMenuAction:function(e){this.upAction(e);this.focusAction()},upAction:function(){this.pressed=false;if(!this.isToggle){this.active=false}},focusAction:function(){if(!this.pressed){this.focused=true}},blurAction:function(){this.focused=false}});Polymer("paper-button-base",{z:1,activeChanged:function(){this.super();if(this.active){if(!this.lastEvent){var rect=this.getBoundingClientRect();this.lastEvent={x:rect.left+rect.width/2,y:rect.top+rect.height/2}}this.$.ripple.downAction(this.lastEvent)}else{this.$.ripple.upAction()}this.adjustZ()},disabledChanged:function(){this.super();if(this.disabled){this.setAttribute("aria-disabled","")}else{this.removeAttribute("aria-disabled")}this.adjustZ()},recenteringTouchChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("recenteringTouch",this.recenteringTouch)}},fillChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("fill",this.fill)}},adjustZ:function(){if(this.active){this.z=2}else if(this.disabled){this.z=0}else{this.z=1}},downAction:function(e){this.super(e);this.lastEvent=e;if(!this.$.ripple){var ripple=document.createElement("paper-ripple");ripple.setAttribute("id","ripple");ripple.setAttribute("fit","");if(this.recenteringTouch){ripple.classList.add("recenteringTouch")}if(!this.fill){ripple.classList.add("circle")}this.$.ripple=ripple;this.shadowRoot.insertBefore(ripple,this.shadowRoot.firstChild)}}});(function(){var waveMaxRadius=150;function waveRadiusFn(touchDownMs,touchUpMs,anim){var touchDown=touchDownMs/1e3;var touchUp=touchUpMs/1e3;var totalElapsed=touchDown+touchUp;var ww=anim.width,hh=anim.height;var waveRadius=Math.min(Math.sqrt(ww*ww+hh*hh),waveMaxRadius)*1.1+5;var duration=1.1-.2*(waveRadius/waveMaxRadius);var tt=totalElapsed/duration;var size=waveRadius*(1-Math.pow(80,-tt));return Math.abs(size)}function waveOpacityFn(td,tu,anim){var touchDown=td/1e3;var touchUp=tu/1e3;var totalElapsed=touchDown+touchUp;if(tu<=0){return anim.initialOpacity}return Math.max(0,anim.initialOpacity-touchUp*anim.opacityDecayVelocity)}function waveOuterOpacityFn(td,tu,anim){var touchDown=td/1e3;var touchUp=tu/1e3;var outerOpacity=touchDown*.3;var waveOpacity=waveOpacityFn(td,tu,anim);return Math.max(0,Math.min(outerOpacity,waveOpacity))}function waveDidFinish(wave,radius,anim){var waveOpacity=waveOpacityFn(wave.tDown,wave.tUp,anim);return waveOpacity<.01&&radius>=Math.min(wave.maxRadius,waveMaxRadius)}function waveAtMaximum(wave,radius,anim){var waveOpacity=waveOpacityFn(wave.tDown,wave.tUp,anim);return waveOpacity>=anim.initialOpacity&&radius>=Math.min(wave.maxRadius,waveMaxRadius)}function drawRipple(ctx,x,y,radius,innerAlpha,outerAlpha){if(outerAlpha!==undefined){ctx.bg.style.opacity=outerAlpha}ctx.wave.style.opacity=innerAlpha;var s=radius/(ctx.containerSize/2);var dx=x-ctx.containerWidth/2;var dy=y-ctx.containerHeight/2;ctx.wc.style.webkitTransform="translate3d("+dx+"px,"+dy+"px,0)";ctx.wc.style.transform="translate3d("+dx+"px,"+dy+"px,0)";ctx.wave.style.webkitTransform="scale("+s+","+s+")";ctx.wave.style.transform="scale3d("+s+","+s+",1)"}function createWave(elem){var elementStyle=window.getComputedStyle(elem);var fgColor=elementStyle.color;var inner=document.createElement("div");inner.style.backgroundColor=fgColor;inner.classList.add("wave");var outer=document.createElement("div");outer.classList.add("wave-container");outer.appendChild(inner);var container=elem.$.waves;container.appendChild(outer);elem.$.bg.style.backgroundColor=fgColor;var wave={bg:elem.$.bg,wc:outer,wave:inner,waveColor:fgColor,maxRadius:0,isMouseDown:false,mouseDownStart:0,mouseUpStart:0,tDown:0,tUp:0};return wave}function removeWaveFromScope(scope,wave){if(scope.waves){var pos=scope.waves.indexOf(wave);scope.waves.splice(pos,1);wave.wc.remove()}}var pow=Math.pow;var now=Date.now;if(window.performance&&performance.now){now=performance.now.bind(performance)}function cssColorWithAlpha(cssColor,alpha){var parts=cssColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(typeof alpha=="undefined"){alpha=1}if(!parts){return"rgba(255, 255, 255, "+alpha+")"}return"rgba("+parts[1]+", "+parts[2]+", "+parts[3]+", "+alpha+")"}function dist(p1,p2){return Math.sqrt(pow(p1.x-p2.x,2)+pow(p1.y-p2.y,2))}function distanceFromPointToFurthestCorner(point,size){var tl_d=dist(point,{x:0,y:0});var tr_d=dist(point,{x:size.w,y:0});var bl_d=dist(point,{x:0,y:size.h});var br_d=dist(point,{x:size.w,y:size.h});return Math.max(tl_d,tr_d,bl_d,br_d)}Polymer("paper-ripple",{initialOpacity:.25,opacityDecayVelocity:.8,backgroundFill:true,pixelDensity:2,eventDelegates:{down:"downAction",up:"upAction"},ready:function(){this.waves=[]},downAction:function(e){var wave=createWave(this);this.cancelled=false;wave.isMouseDown=true;wave.tDown=0;wave.tUp=0;wave.mouseUpStart=0;wave.mouseDownStart=now();var rect=this.getBoundingClientRect();var width=rect.width;var height=rect.height;var touchX=e.x-rect.left;var touchY=e.y-rect.top;wave.startPosition={x:touchX,y:touchY};if(this.classList.contains("recenteringTouch")){wave.endPosition={x:width/2,y:height/2};wave.slideDistance=dist(wave.startPosition,wave.endPosition)}wave.containerSize=Math.max(width,height);wave.containerWidth=width;wave.containerHeight=height;wave.maxRadius=distanceFromPointToFurthestCorner(wave.startPosition,{w:width,h:height});wave.wc.style.top=(wave.containerHeight-wave.containerSize)/2+"px";wave.wc.style.left=(wave.containerWidth-wave.containerSize)/2+"px";wave.wc.style.width=wave.containerSize+"px";wave.wc.style.height=wave.containerSize+"px";this.waves.push(wave);if(!this._loop){this._loop=this.animate.bind(this,{width:width,height:height});requestAnimationFrame(this._loop)}},upAction:function(){for(var i=0;i<this.waves.length;i++){var wave=this.waves[i];if(wave.isMouseDown){wave.isMouseDown=false;wave.mouseUpStart=now();wave.mouseDownStart=0;wave.tUp=0;break}}this._loop&&requestAnimationFrame(this._loop)},cancel:function(){this.cancelled=true},animate:function(ctx){var shouldRenderNextFrame=false;var deleteTheseWaves=[];var longestTouchDownDuration=0;var longestTouchUpDuration=0;var lastWaveColor=null;var anim={initialOpacity:this.initialOpacity,opacityDecayVelocity:this.opacityDecayVelocity,height:ctx.height,width:ctx.width};for(var i=0;i<this.waves.length;i++){var wave=this.waves[i];if(wave.mouseDownStart>0){wave.tDown=now()-wave.mouseDownStart}if(wave.mouseUpStart>0){wave.tUp=now()-wave.mouseUpStart}var tUp=wave.tUp;var tDown=wave.tDown;longestTouchDownDuration=Math.max(longestTouchDownDuration,tDown);longestTouchUpDuration=Math.max(longestTouchUpDuration,tUp);var radius=waveRadiusFn(tDown,tUp,anim);var waveAlpha=waveOpacityFn(tDown,tUp,anim);var waveColor=cssColorWithAlpha(wave.waveColor,waveAlpha);lastWaveColor=wave.waveColor;var x=wave.startPosition.x;var y=wave.startPosition.y;if(wave.endPosition){var translateFraction=Math.min(1,radius/wave.containerSize*2/Math.sqrt(2));x+=translateFraction*(wave.endPosition.x-wave.startPosition.x);y+=translateFraction*(wave.endPosition.y-wave.startPosition.y)}var bgFillColor=null;if(this.backgroundFill){var bgFillAlpha=waveOuterOpacityFn(tDown,tUp,anim);bgFillColor=cssColorWithAlpha(wave.waveColor,bgFillAlpha)}drawRipple(wave,x,y,radius,waveAlpha,bgFillAlpha);var maximumWave=waveAtMaximum(wave,radius,anim);var waveDissipated=waveDidFinish(wave,radius,anim);var shouldKeepWave=!waveDissipated||maximumWave;var shouldRenderWaveAgain=wave.mouseUpStart?!waveDissipated:!maximumWave;shouldRenderNextFrame=shouldRenderNextFrame||shouldRenderWaveAgain;if(!shouldKeepWave||this.cancelled){deleteTheseWaves.push(wave)}}if(shouldRenderNextFrame){requestAnimationFrame(this._loop)}for(var i=0;i<deleteTheseWaves.length;++i){var wave=deleteTheseWaves[i];removeWaveFromScope(this,wave)}if(!this.waves.length&&this._loop){this.$.bg.style.backgroundColor=null;this._loop=null;this.fire("core-transitionend")}}})})();Polymer("paper-icon-button",{publish:{src:"",icon:"",recenteringTouch:true,fill:false},iconChanged:function(oldIcon){this.setAttribute("aria-label",this.icon)}});Polymer("app-bar",{theme:"dark",showingSearch:false,toggleSearch:function(e,detail,sender){if(e){e.stopPropagation()}if(e.target===this.$.input){return}this.showingSearch=!this.showingSearch;this.classList.toggle("search-on");this.async(function(){this.$.input.focus()})},onKeyPress:function(e,detail,sender){if(e.keyCode==13){if(sender.value){recordSearch(sender.value);var q="site:polymer-project.org+"+sender.value;window.open("https://www.google.com/search?q="+q)}}},onMenuClick:function(){this.fire("hamburger-time")}});"use strict";(function(exports){function sign(number){if(number<0)return-1;if(number>0)return 1;return 0}function Animator(delegate){this.delegate=delegate;this.startTimeStamp=0;this.request_=null}Animator.prototype.scheduleAnimation=function(){if(this.request_)return;this.request_=requestAnimationFrame(this.onAnimation_.bind(this))};Animator.prototype.startAnimation=function(){this.startTimeStamp=0;this.scheduleAnimation()};Animator.prototype.stopAnimation=function(){cancelAnimationFrame(this.request_);this.startTimeStamp=0;this.request_=null};Animator.prototype.onAnimation_=function(timeStamp){this.request_=null;if(!this.startTimeStamp)this.startTimeStamp=timeStamp;if(this.delegate.onAnimation(timeStamp))this.scheduleAnimation()};function VelocityTracker(){this.recentTouchMoves_=[];this.velocityX=0;this.velocityY=0}VelocityTracker.kTimeWindow=50;VelocityTracker.prototype.pruneHistory_=function(timeStamp){for(var i=0;i<this.recentTouchMoves_.length;++i){if(this.recentTouchMoves_[i].timeStamp>timeStamp-VelocityTracker.kTimeWindow){this.recentTouchMoves_=this.recentTouchMoves_.slice(i);return}}this.recentTouchMoves_=[]};VelocityTracker.prototype.update_=function(e){this.pruneHistory_(e.timeStamp);this.recentTouchMoves_.push(e);var oldestTouchMove=this.recentTouchMoves_[0];var deltaX=e.changedTouches[0].clientX-oldestTouchMove.changedTouches[0].clientX;var deltaY=e.changedTouches[0].clientY-oldestTouchMove.changedTouches[0].clientY;var deltaT=e.timeStamp-oldestTouchMove.timeStamp;if(deltaT>0){this.velocityX=deltaX/deltaT;this.velocityY=deltaY/deltaT}else{this.velocityX=0;this.velocityY=0}};VelocityTracker.prototype.onTouchStart=function(e){this.recentTouchMoves_.push(e);this.velocityX=0;this.velocityY=0};VelocityTracker.prototype.onTouchMove=function(e){this.update_(e)};VelocityTracker.prototype.onTouchEnd=function(e){this.update_(e);this.recentTouchMoves_=[]};function LinearTimingFunction(){}LinearTimingFunction.prototype.scaleTime=function(fraction){return fraction};function CubicBezierTimingFunction(spec){this.map=[];for(var ii=0;ii<=100;ii+=1){var i=ii/100;this.map.push([3*i*(1-i)*(1-i)*spec[0]+3*i*i*(1-i)*spec[2]+i*i*i,3*i*(1-i)*(1-i)*spec[1]+3*i*i*(1-i)*spec[3]+i*i*i])}}CubicBezierTimingFunction.prototype.scaleTime=function(fraction){var fst=0;while(fst!==100&&fraction>this.map[fst][0]){fst+=1}if(fraction===this.map[fst][0]||fst===0){return this.map[fst][1]}var yDiff=this.map[fst][1]-this.map[fst-1][1];var xDiff=this.map[fst][0]-this.map[fst-1][0];var p=(fraction-this.map[fst-1][0])/xDiff;return this.map[fst-1][1]+p*yDiff};var presetTimingFunctions={linear:new LinearTimingFunction,ease:new CubicBezierTimingFunction([.25,.1,.25,1]),"ease-in":new CubicBezierTimingFunction([.42,0,1,1]),"ease-out":new CubicBezierTimingFunction([0,0,.58,1]),"ease-in-out":new CubicBezierTimingFunction([.42,0,.58,1])};function DrawerController(options){this.velocityTracker=new VelocityTracker;this.animator=new Animator(this);this.target=options.target;this.left=options.left;this.right=options.right;this.position=options.position;this.width=this.right-this.left;this.curve=presetTimingFunctions[options.curve||"linear"];this.willOpenCallback=options.willOpen;this.didCloseCallback=options.didClose;this.animateCallback=options.onAnimate;this.state=DrawerController.kClosed;this.defaultAnimationSpeed=(this.right-this.left)/DrawerController.kBaseSettleDurationMS;this.onTouchMove=this.onTouchMove.bind(this);this.onTouchEnd=this.onTouchEnd.bind(this);this.target.addEventListener("touchstart",this.onTouchStart.bind(this))}DrawerController.kOpened="opened";DrawerController.kClosed="closed";DrawerController.kOpening="opening";DrawerController.kClosing="closing";DrawerController.kDragging="dragging";DrawerController.kFlinging="flinging";DrawerController.kBaseSettleDurationMS=246;DrawerController.kMaxSettleDurationMS=600;DrawerController.kMinFlingVelocity=.4;DrawerController.kTouchSlop=5;DrawerController.kTouchSlopSquare=DrawerController.kTouchSlop*DrawerController.kTouchSlop;DrawerController.prototype.restrictToCurrent=function(offset){return Math.max(this.left,Math.min(this.position,offset))};DrawerController.prototype.restrictToBounds=function(offset){return Math.max(this.left,Math.min(this.right,offset))};DrawerController.prototype.onTouchStart=function(e){this.velocityTracker.onTouchStart(e);var touchX=e.changedTouches[0].clientX;var touchY=e.changedTouches[0].clientY;if(this.state!=DrawerController.kOpened){if(touchX!=this.restrictToCurrent(touchX))return;this.state=DrawerController.kDragging}this.animator.stopAnimation();this.target.addEventListener("touchmove",this.onTouchMove);this.target.addEventListener("touchend",this.onTouchEnd);this.startX=touchX;this.startY=touchY;this.startPosition=this.position;this.touchBaseX=Math.min(touchX,this.startPosition)};DrawerController.prototype.onTouchMove=function(e){this.velocityTracker.onTouchMove(e);if(this.state==DrawerController.kOpened){var deltaX=e.changedTouches[0].clientX-this.startX;var deltaY=e.changedTouches[0].clientY-this.startY;if(deltaX*deltaX+deltaY*deltaY<DrawerController.kTouchSlopSquare){e.preventDefault();return}if(Math.abs(deltaY)>Math.abs(deltaX)){this.target.removeEventListener("touchmove",this.onTouchMove);this.target.removeEventListener("touchend",this.onTouchEnd);return}this.state=DrawerController.kDragging}e.preventDefault();var touchDeltaX=e.changedTouches[0].clientX-this.touchBaseX;this.position=this.restrictToBounds(this.startPosition+touchDeltaX);this.animator.scheduleAnimation()};DrawerController.prototype.onTouchEnd=function(e){this.velocityTracker.onTouchEnd(e);this.target.removeEventListener("touchmove",this.onTouchMove);
this.target.removeEventListener("touchend",this.onTouchEnd);var velocityX=this.velocityTracker.velocityX;if(Math.abs(velocityX)>DrawerController.kMinFlingVelocity){this.fling(velocityX)}else if(this.isOpen()){this.open()}else{this.close()}};DrawerController.prototype.openFraction=function(){var width=this.right-this.left;var offset=this.position-this.left;return offset/width};DrawerController.prototype.isOpen=function(){return this.openFraction()>=.5};DrawerController.prototype.isOpening=function(){return this.state==DrawerController.kOpening||this.state==DrawerController.kFlinging&&this.animationVelocityX>0};DrawerController.prototype.isClosing=function(){return this.state==DrawerController.kClosing||this.state==DrawerController.kFlinging&&this.animationVelocityX<0};DrawerController.prototype.toggle=function(){if(this.isOpen())this.close();else this.open()};DrawerController.prototype.open=function(){if(!this.position)this.willOpenCallback.call(this.target);this.animator.stopAnimation();this.animationDuration=400;this.state=DrawerController.kOpening;this.animate()};DrawerController.prototype.close=function(){this.animator.stopAnimation();this.animationDuration=400;this.state=DrawerController.kClosing;this.animate()};DrawerController.prototype.fling=function(velocityX){this.animator.stopAnimation();this.animationVelocityX=velocityX;this.state=DrawerController.kFlinging;this.animate()};DrawerController.prototype.animate=function(){this.positionAnimationBase=this.position;this.animator.startAnimation()};DrawerController.prototype.targetPosition=function(deltaT){if(this.state==DrawerController.kFlinging)return this.positionAnimationBase+this.animationVelocityX*deltaT;var targetFraction=this.curve.scaleTime(deltaT/this.animationDuration);var animationWidth=this.state==DrawerController.kOpening?this.width-this.positionAnimationBase:-this.positionAnimationBase;return this.positionAnimationBase+targetFraction*animationWidth};DrawerController.prototype.onAnimation=function(timeStamp){if(this.state==DrawerController.kDragging){this.animateCallback.call(this.target,this.position);return false}var deltaT=timeStamp-this.animator.startTimeStamp;var targetPosition=this.targetPosition(deltaT);this.position=this.restrictToBounds(targetPosition);this.animateCallback.call(this.target,this.position);if(targetPosition<=this.left&&this.isClosing()){this.state=DrawerController.kClosed;this.didCloseCallback.call(this.target);return false}if(targetPosition>=this.right&&this.isOpening()){this.state=DrawerController.kOpened;return false}return true};exports.DrawerController=DrawerController})(window);Polymer("app-drawer",{publish:{mobile:{value:false,reflect:true}},active:false,controller:null,toggle:function(){this.controller.toggle()},close:function(){this.controller.close()},attached:function(){var content=this.$.content;var mask=this.$.mask;this.controller=new DrawerController({target:this,left:0,right:315,position:0,curve:"ease-in-out",willOpen:function(){mask.style.display="block";content.style.display="block";this.active=true;document.body.classList.add("noscroll")},didClose:function(){mask.style.display="none";content.style.display="none";this.active=false;document.body.classList.remove("noscroll")},onAnimate:function(position){mask.style.opacity=(position+1)/315*.2;content.style.WebkitTransform="translate3d("+(position-315)+"px,0,0)"}})},mobileChanged:function(){if(this.controller&&!this.mobile){this.$.mask.removeAttribute("style");this.$.content.removeAttribute("style");this.controller.state=this.controller.kClosed;this.controller.position=0;this.controller.left=0;this.controller.right=315;this.active=false}}});Polymer("paper-shadow",{publish:{target:{value:null,reflect:true},z:{value:1,reflect:true},animated:{value:false,reflect:true},hasPosition:false},registerCallback:function(polymerElement){var template=polymerElement.querySelector("template");this._style=template.content.querySelector("style");this._style.removeAttribute("no-shim")},fetchTemplate:function(){return null},attached:function(){if(!this.target){if(!this.parentElement&&this.parentNode.host){this.target=this.parentNode.host}else if(this.parentElement&&(window.ShadowDOMPolyfill?this.parentElement!==wrap(document.body):this.parentElement!==document.body)){this.target=this.parentElement}}},targetChanged:function(old){if(old){this.removeShadow(old)}if(this.target){this.addShadow(this.target)}},zChanged:function(old){if(this.target&&this.target._paperShadow){var shadow=this.target._paperShadow;["top","bottom"].forEach(function(s){shadow[s].classList.remove("paper-shadow-"+s+"-z-"+old);shadow[s].classList.add("paper-shadow-"+s+"-z-"+this.z)}.bind(this))}},animatedChanged:function(){if(this.target&&this.target._paperShadow){var shadow=this.target._paperShadow;["top","bottom"].forEach(function(s){if(this.animated){shadow[s].classList.add("paper-shadow-animated")}else{shadow[s].classList.remove("paper-shadow-animated")}}.bind(this))}},addShadow:function(node){if(node._paperShadow){return}if(!node._hasShadowStyle){if(!node.shadowRoot){node.createShadowRoot().innerHTML="<content></content>"}this.installScopeStyle(this._style,"shadow",node.shadowRoot);node._hasShadowStyle=true}var computed=getComputedStyle(node);if(!this.hasPosition&&computed.position==="static"){node.style.position="relative"}node.style.overflow="visible";["top","bottom"].forEach(function(s){var inner=node._paperShadow&&node._paperShadow[s]||document.createElement("div");inner.classList.add("paper-shadow");inner.classList.add("paper-shadow-"+s+"-z-"+this.z);if(this.animated){inner.classList.add("paper-shadow-animated")}if(node.shadowRoot){node.shadowRoot.insertBefore(inner,node.shadowRoot.firstChild)}else{node.insertBefore(inner,node.firstChild)}node._paperShadow=node._paperShadow||{};node._paperShadow[s]=inner}.bind(this))},removeShadow:function(node){if(!node._paperShadow){return}["top","bottom"].forEach(function(s){node._paperShadow[s].remove()});node._paperShadow=null;node.style.position=null}});Polymer("paper-button",{publish:{label:"",raised:false,raisedButton:false,recenteringTouch:false,fill:true},labelChanged:function(){if(this.label){console.warn('The "label" property is deprecated.')}},raisedButtonChanged:function(){if(this.raisedButton){console.warn('The "raisedButton" property is deprecated.')}}});(function UMD(name,context,definition){context[name]=context[name]||definition();if(typeof module!="undefined"&&module.exports){module.exports=context[name]}else if(typeof define=="function"&&define.amd){define(function $AMD$(){return context[name]})}})("Promise",typeof global!="undefined"?global:this,function DEF(){"use strict";var builtInProp,cycle,scheduling_queue,ToString=Object.prototype.toString,timer=typeof setImmediate!="undefined"?function timer(fn){return setImmediate(fn)}:setTimeout;try{Object.defineProperty({},"x",{});builtInProp=function builtInProp(obj,name,val,config){return Object.defineProperty(obj,name,{value:val,writable:true,configurable:config!==false})}}catch(err){builtInProp=function builtInProp(obj,name,val){obj[name]=val;return obj}}scheduling_queue=function Queue(){var first,last,item;function Item(fn,self){this.fn=fn;this.self=self;this.next=void 0}return{add:function add(fn,self){item=new Item(fn,self);if(last){last.next=item}else{first=item}last=item;item=void 0},drain:function drain(){var f=first;first=last=cycle=void 0;while(f){f.fn.call(f.self);f=f.next}}}}();function schedule(fn,self){scheduling_queue.add(fn,self);if(!cycle){cycle=timer(scheduling_queue.drain)}}function isThenable(o){var _then,o_type=typeof o;if(o!=null&&(o_type=="object"||o_type=="function")){_then=o.then}return typeof _then=="function"?_then:false}function notify(){for(var i=0;i<this.chain.length;i++){notifyIsolated(this,this.state===1?this.chain[i].success:this.chain[i].failure,this.chain[i])}this.chain.length=0}function notifyIsolated(self,cb,chain){var ret,_then;try{if(cb===false){chain.reject(self.msg)}else{if(cb===true){ret=self.msg}else{ret=cb.call(void 0,self.msg)}if(ret===chain.promise){chain.reject(TypeError("Promise-chain cycle"))}else if(_then=isThenable(ret)){_then.call(ret,chain.resolve,chain.reject)}else{chain.resolve(ret)}}}catch(err){chain.reject(err)}}function resolve(msg){var _then,def_wrapper,self=this;if(self.triggered){return}self.triggered=true;if(self.def){self=self.def}try{if(_then=isThenable(msg)){def_wrapper=new MakeDefWrapper(self);_then.call(msg,function $resolve$(){resolve.apply(def_wrapper,arguments)},function $reject$(){reject.apply(def_wrapper,arguments)})}else{self.msg=msg;self.state=1;if(self.chain.length>0){schedule(notify,self)}}}catch(err){reject.call(def_wrapper||new MakeDefWrapper(self),err)}}function reject(msg){var self=this;if(self.triggered){return}self.triggered=true;if(self.def){self=self.def}self.msg=msg;self.state=2;if(self.chain.length>0){schedule(notify,self)}}function iteratePromises(Constructor,arr,resolver,rejecter){for(var idx=0;idx<arr.length;idx++){(function IIFE(idx){Constructor.resolve(arr[idx]).then(function $resolver$(msg){resolver(idx,msg)},rejecter)})(idx)}}function MakeDefWrapper(self){this.def=self;this.triggered=false}function MakeDef(self){this.promise=self;this.state=0;this.triggered=false;this.chain=[];this.msg=void 0}function Promise(executor){if(typeof executor!="function"){throw TypeError("Not a function")}if(this.__NPO__!==0){throw TypeError("Not a promise")}this.__NPO__=1;var def=new MakeDef(this);this["then"]=function then(success,failure){var o={success:typeof success=="function"?success:true,failure:typeof failure=="function"?failure:false};o.promise=new this.constructor(function extractChain(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}o.resolve=resolve;o.reject=reject});def.chain.push(o);if(def.state!==0){schedule(notify,def)}return o.promise};this["catch"]=function $catch$(failure){return this.then(void 0,failure)};try{executor.call(void 0,function publicResolve(msg){resolve.call(def,msg)},function publicReject(msg){reject.call(def,msg)})}catch(err){reject.call(def,err)}}var PromisePrototype=builtInProp({},"constructor",Promise,false);builtInProp(Promise,"prototype",PromisePrototype,false);builtInProp(PromisePrototype,"__NPO__",0,false);builtInProp(Promise,"resolve",function Promise$resolve(msg){var Constructor=this;if(msg&&typeof msg=="object"&&msg.__NPO__===1){return msg}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}resolve(msg)})});builtInProp(Promise,"reject",function Promise$reject(msg){return new this(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}reject(msg)})});builtInProp(Promise,"all",function Promise$all(arr){var Constructor=this;if(ToString.call(arr)!="[object Array]"){return Constructor.reject(TypeError("Not an array"))}if(arr.length===0){return Constructor.resolve([])}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}var len=arr.length,msgs=Array(len),count=0;iteratePromises(Constructor,arr,function resolver(idx,msg){msgs[idx]=msg;if(++count===len){resolve(msgs)}},reject)})});builtInProp(Promise,"race",function Promise$race(arr){var Constructor=this;if(ToString.call(arr)!="[object Array]"){return Constructor.reject(TypeError("Not an array"))}return new Constructor(function executor(resolve,reject){if(typeof resolve!="function"||typeof reject!="function"){throw TypeError("Not a function")}iteratePromises(Constructor,arr,function resolver(idx,msg){resolve(msg)},reject)})});return Promise});(function(window,document,undefined){function get(url){return new Promise(function(resolve,reject){var req=new XMLHttpRequest;req.open("GET",url);req.onload=function(){if(req.status==200){resolve(req.response)}else{reject(Error(req.statusText))}};req.onerror=function(){reject(Error("Network Error"))};req.send()})}function getJSON(url){return get(url).then(JSON.parse)}function formPostData(url,fields){var form=document.createElement("form");form.style.display="none";form.method="post";form.action=url;for(var prop in fields){var name=prop;var value=fields[prop];var input=document.createElement("input");input.type="hidden";input.name=name;input.setAttribute("value",value);form.appendChild(input)}document.body.appendChild(form);form.submit();form.remove()}Polymer("plunker-button",{src:null,strip:"-plunker",openPlunker:function(){var self=this;var exampleFolder=this.src.slice(0,this.src.lastIndexOf("/"));var description="";getJSON(this.src).then(function(manifest){description=manifest.description;return manifest}).then(function(manifest){var filePromises=[];manifest.files.forEach(function(filename){filePromises.push(get(exampleFolder+"/"+filename).then(function(response){if(filename.indexOf(self.strip)!==-1){filename=filename.replace(self.strip,"")}return{name:filename,content:response}}))});return Promise.all(filePromises)}).then(function(files){var postData={};files.forEach(function(file){postData["files["+file.name+"]"]=file.content});postData["tags[0]"]="polymer";postData["tags[1]"]="example";postData.private=true;postData.description=description;formPostData("http://plnkr.co/edit/?p=preview",postData)}).catch(function(err){throw err})}})})(window,document);Polymer("demo-tab");Polymer("demo-tabs",{demoSrc:null,theme:"light",selected:0,bottom:false,domReady:function(){this.updatePanels()},updatePanels:function(){this.panels=Array.prototype.slice.call(this.$.contentpanels.getDistributedNodes());var noHeadings=true;for(var i=0,panel;panel=this.panels[i];++i){if(panel.heading){noHeadings=false;break}}this.$.tabstrip.hidden=noHeadings;this.$.results.classList.toggle("show",this.$.contentresults.getDistributedNodes().length);this.onMutation(this,this.updatePanels)}});Polymer("dropdown-panel",{publish:{open:{value:false,reflect:true}},ajaxify:false,attached:function(){var active=this.querySelector("core-item[active]");var index=Array.prototype.indexOf.call(this.children,active);this.$.mainmenu.selected=index},openPanel:function(){this.open=true;var close=function(){this.open=false;document.body.removeEventListener("click",close,true)}.bind(this);document.body.addEventListener("click",close,true)}});(function(scope){var ContextFreeParser={parse:function(text){var top={};var entities=[];var current=top;var subCurrent={};var scriptDocCommentClause="\\/\\*\\*([\\s\\S]*?)\\*\\/";var htmlDocCommentClause="<!--([\\s\\S]*?)-->";var docCommentRegex=new RegExp(scriptDocCommentClause+"|"+htmlDocCommentClause,"g");var docComments=text.match(docCommentRegex)||[];docComments.forEach(function(m){var lines=m.replace(/\r\n/g,"\n").replace(/^\s*\/\*\*|^\s*\*\/|^\s*\* ?|^\s*\<\!-\-|^s*\-\-\>/gm,"").split("\n");var pragmas=[];lines=lines.filter(function(l){var m=l.match(/\s*@([\w-]*) (.*)/);if(!m){return true}pragmas.push(m)});var code=lines.join("\n");pragmas.forEach(function(m){var pragma=m[1],content=m[2];switch(pragma){case"class":case"element":current={name:content,description:code};entities.push(current);break;case"attribute":case"property":case"method":case"event":subCurrent={name:content,description:code};var label=pragma=="property"?"properties":pragma+"s";makePragma(current,label,subCurrent);break;case"default":case"type":subCurrent[pragma]=content;break;case"param":var eventParmsRe=/\{(.+)\}\s+(\w+[.\w+]+)\s+(.*)$/;var params=content.match(eventParmsRe);if(params){var subEventObj={type:params[1],name:params[2],description:params[3]};makePragma(subCurrent,pragma+"s",subEventObj)}break;default:current[pragma]=content;break}});function makePragma(object,pragma,content){var p$=object;var p=p$[pragma];if(!p){p$[pragma]=p=[]}p.push(content)}});if(entities.length===0){entities.push({name:"Entity",description:"**Undocumented**"})}return entities}};if(typeof module!=="undefined"&&module.exports){module.exports=ContextFreeParser}else{scope.ContextFreeParser=ContextFreeParser}})(this);Polymer("core-xhr",{request:function(options){var xhr=new XMLHttpRequest;var url=options.url;var method=options.method||"GET";var async=!options.sync;var params=this.toQueryString(options.params);if(params&&method=="GET"){url+=(url.indexOf("?")>0?"&":"?")+params}var xhrParams=this.isBodyMethod(method)?options.body||params:null;xhr.open(method,url,async);if(options.responseType){xhr.responseType=options.responseType}if(options.withCredentials){xhr.withCredentials=true}this.makeReadyStateHandler(xhr,options.callback);this.setRequestHeaders(xhr,options.headers);xhr.send(xhrParams);if(!async){xhr.onreadystatechange(xhr)}return xhr},toQueryString:function(params){var r=[];for(var n in params){var v=params[n];n=encodeURIComponent(n);r.push(v==null?n:n+"="+encodeURIComponent(v))}return r.join("&")},isBodyMethod:function(method){return this.bodyMethods[(method||"").toUpperCase()]},bodyMethods:{POST:1,PUT:1,DELETE:1},makeReadyStateHandler:function(xhr,callback){xhr.onreadystatechange=function(){if(xhr.readyState==4){callback&&callback.call(null,xhr.response,xhr)}}},setRequestHeaders:function(xhr,headers){if(headers){for(var name in headers){xhr.setRequestHeader(name,headers[name])}}}});Polymer("core-ajax",{url:"",handleAs:"",auto:false,params:"",response:null,error:null,method:"",headers:null,body:null,contentType:"application/x-www-form-urlencoded",withCredentials:false,xhrArgs:null,ready:function(){this.xhr=document.createElement("core-xhr")},receive:function(response,xhr){if(this.isSuccess(xhr)){this.processResponse(xhr)}else{this.processError(xhr)}this.complete(xhr)},isSuccess:function(xhr){var status=xhr.status||0;return!status||status>=200&&status<300},processResponse:function(xhr){var response=this.evalResponse(xhr);if(xhr===this.activeRequest){this.response=response}this.fire("core-response",{response:response,xhr:xhr})},processError:function(xhr){var response=xhr.status+": "+xhr.responseText;if(xhr===this.activeRequest){this.error=response}this.fire("core-error",{response:response,xhr:xhr})},complete:function(xhr){this.fire("core-complete",{response:xhr.status,xhr:xhr})},evalResponse:function(xhr){return this[(this.handleAs||"text")+"Handler"](xhr)},xmlHandler:function(xhr){return xhr.responseXML},textHandler:function(xhr){return xhr.responseText},jsonHandler:function(xhr){var r=xhr.responseText;try{return JSON.parse(r)}catch(x){console.warn("core-ajax caught an exception trying to parse response as JSON:");console.warn("url:",this.url);console.warn(x);return r}},documentHandler:function(xhr){return xhr.response},blobHandler:function(xhr){return xhr.response},arraybufferHandler:function(xhr){return xhr.response},urlChanged:function(){if(!this.handleAs){var ext=String(this.url).split(".").pop();switch(ext){case"json":this.handleAs="json";break}}this.autoGo()},paramsChanged:function(){this.autoGo()},autoChanged:function(){this.autoGo()},autoGo:function(){if(this.auto){this.goJob=this.job(this.goJob,this.go,0)}},go:function(){var args=this.xhrArgs||{};args.body=this.body||args.body;args.params=this.params||args.params;if(args.params&&typeof args.params=="string"){args.params=JSON.parse(args.params)}args.headers=this.headers||args.headers||{};if(args.headers&&typeof args.headers=="string"){args.headers=JSON.parse(args.headers)}var hasContentType=Object.keys(args.headers).some(function(header){return header.toLowerCase()==="content-type"});if(!hasContentType&&this.contentType){args.headers["Content-Type"]=this.contentType}if(this.handleAs==="arraybuffer"||this.handleAs==="blob"||this.handleAs==="document"){args.responseType=this.handleAs}args.withCredentials=this.withCredentials;args.callback=this.receive.bind(this);args.url=this.url;args.method=this.method;this.response=this.error=null;this.activeRequest=args.url&&this.xhr.request(args);return this.activeRequest}});Polymer("context-free-parser",{text:null,textChanged:function(){if(this.text){var entities=ContextFreeParser.parse(this.text);if(!entities||entities.length===0){entities=[{name:this.url.split("/").pop(),description:"**Undocumented**"}]}this.data={classes:entities}}},dataChanged:function(){this.fire("data-ready")}});(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[2]==="="?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"hr"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"blockquote_start"});cap=cap[0].replace(/^ *> ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\d+\.) +/,"");if(~item.indexOf("\n ")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp("^ {1,"+space+"}","gm"),""):item.replace(/^ {1,4}/gm,"")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:"paragraph",text:cap[1].charAt(cap[1].length-1)==="\n"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"text",text:cap[0]});continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};inline._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;inline._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"<pre><code>"+(escaped?code:escape(code,true))+"\n</code></pre>"}return'<pre><code class="'+this.options.langPrefix+escape(lang,true)+'">'+(escaped?code:escape(code,true))+"\n</code></pre>\n"};Renderer.prototype.blockquote=function(quote){return"<blockquote>\n"+quote+"</blockquote>\n"};Renderer.prototype.html=function(html){return html
};Renderer.prototype.heading=function(text,level,raw){return"<h"+level+' id="'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\w]+/g,"-")+'">'+text+"</h"+level+">\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"</"+type+">\n"};Renderer.prototype.listitem=function(text){return"<li>"+text+"</li>\n"};Renderer.prototype.paragraph=function(text){return"<p>"+text+"</p>\n"};Renderer.prototype.table=function(header,body){return"<table>\n"+"<thead>\n"+header+"</thead>\n"+"<tbody>\n"+body+"</tbody>\n"+"</table>\n"};Renderer.prototype.tablerow=function(content){return"<tr>\n"+content+"</tr>\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"</"+type+">\n"};Renderer.prototype.strong=function(text){return"<strong>"+text+"</strong>"};Renderer.prototype.em=function(text){return"<em>"+text+"</em>"};Renderer.prototype.codespan=function(text){return"<code>"+text+"</code>"};Renderer.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"};Renderer.prototype.del=function(text){return"<del>"+text+"</del>"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='<a href="'+href+'"';if(title){out+=' title="'+title+'"'}out+=">"+text+"</a>";return out};Renderer.prototype.image=function(href,title,text){var out='<img src="'+href+'" alt="'+text+'"';if(title){out+=' title="'+title+'"'}out+=this.options.xhtml?"/>":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell="";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case"blockquote_start":{var body="";while(this.next().type!=="blockquote_end"){body+=this.tok()}return this.renderer.blockquote(body)}case"list_start":{var body="",ordered=this.token.ordered;while(this.next().type!=="list_end"){body+=this.tok()}return this.renderer.list(body,ordered)}case"list_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.token.type==="text"?this.parseText():this.tok()}return this.renderer.listitem(body)}case"loose_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.tok()}return this.renderer.listitem(body)}case"html":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case"paragraph":{return this.renderer.paragraph(this.inline.output(this.token.text))}case"text":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function marked(src,opt,callback){if(callback||typeof opt==="function"){if(!callback){callback=opt;opt=null}opt=merge({},marked.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(){var out,err;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!=="code"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},marked.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+="\nPlease report this to https://github.com/chjj/marked.";if((opt||marked.defaults).silent){return"<p>An error occured:</p><pre>"+escape(e.message+"",true)+"</pre>"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}());Polymer("marked-element",{text:"",attached:function(){marked.setOptions({highlight:this.highlight.bind(this)});if(!this.text){this.text=this.innerHTML}},textChanged:function(){this.innerHTML=marked(this.text)},highlight:function(code,lang){var event=this.fire("marked-js-highlight",{code:code,lang:lang});return event.detail.code||code}});Polymer("component-docs",{elementName:null,url:null,elements:{},updateElementFromHash:function(e){var elementName=window.location.hash.slice(1);if(this.elementName!==elementName&&this.elements[elementName]){this.elementName=elementName;document.body.classList.add("hide-on-hash")}},domReady:function(){this.updateElementFromHash();window.addEventListener("hashchange",this.updateElementFromHash.bind(this))},detached:function(){document.body.classList.remove("hide-on-hash");window.removeEventListener("hashchange",this.updateElementFromHash.bind(this))},elementNameChanged:function(){this.url="/"+this.elements[this.elementName];window.location.hash=this.elementName},dataChanged:function(){if(this.data.classes[0].name==="Entity"){this.data.classes[0].name=this.elementName}},isTopLevelElement:function(name,url){return url.indexOf("/components/"+name+"/")==0}});(function(){function encodeHTMLEntities_(htmlStr){return htmlStr.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}Polymer("doc-page",{downloadable:false,recordDemoPageview:function(e,detail,sender){window.recordPageview&&window.recordPageview(sender.href)},prettyPrint:function(e,detail,sender){if(window.prettyPrintOne){detail.code=window.prettyPrintOne(encodeHTMLEntities_(detail.code))}},collectionPrefix:function(elementName){var match=elementName.match(/(\w+)-/);return match?match[1]:"core"}})})();Polymer("core-transition",{type:"transition",go:function(node,state){this.complete(node)},setup:function(node){},teardown:function(node){},complete:function(node){this.fire("core-transitionend",null,node)},listenOnce:function(node,event,fn,args){var self=this;var listener=function(){fn.apply(self,args);node.removeEventListener(event,listener,false)};node.addEventListener(event,listener,false)}});Polymer("core-key-helper",{ENTER_KEY:13,ESCAPE_KEY:27});(function(){Polymer("core-overlay-layer",{publish:{opened:false},openedChanged:function(){this.classList.toggle("core-opened",this.opened)},addElement:function(element){if(!this.parentNode){document.querySelector("body").appendChild(this)}if(element.parentNode!==this){element.__contents=[];var ip$=element.querySelectorAll("content");for(var i=0,l=ip$.length,n;i<l&&(n=ip$[i]);i++){this.moveInsertedElements(n);this.cacheDomLocation(n);n.parentNode.removeChild(n);element.__contents.push(n)}this.cacheDomLocation(element);this.updateEventController(element);var h=this.makeHost();h.shadowRoot.appendChild(element);element.__host=h}},makeHost:function(){var h=document.createElement("overlay-host");h.createShadowRoot();this.appendChild(h);return h},moveInsertedElements:function(insertionPoint){var n$=insertionPoint.getDistributedNodes();var parent=insertionPoint.parentNode;insertionPoint.__contents=[];for(var i=0,l=n$.length,n;i<l&&(n=n$[i]);i++){this.cacheDomLocation(n);this.updateEventController(n);insertionPoint.__contents.push(n);parent.appendChild(n)}},updateEventController:function(element){element.eventController=this.element.findController(element)},removeElement:function(element){element.eventController=null;this.replaceElement(element);var h=element.__host;if(h){h.parentNode.removeChild(h)}},replaceElement:function(element){if(element.__contents){for(var i=0,c$=element.__contents,c;c=c$[i];i++){this.replaceElement(c)}element.__contents=null}if(element.__parentNode){var n=element.__nextElementSibling&&element.__nextElementSibling===element.__parentNode?element.__nextElementSibling:null;element.__parentNode.insertBefore(element,n)}},cacheDomLocation:function(element){element.__nextElementSibling=element.nextElementSibling;element.__parentNode=element.parentNode}})})();(function(){Polymer("core-overlay",{publish:{target:null,sizingTarget:null,opened:false,backdrop:false,layered:false,autoCloseDisabled:false,autoFocusDisabled:false,closeAttribute:"core-overlay-toggle",closeSelector:"",transition:"core-transition-fade"},captureEventName:"tap",targetListeners:{tap:"tapHandler",keydown:"keydownHandler","core-transitionend":"transitionend"},registerCallback:function(element){this.layer=document.createElement("core-overlay-layer");this.keyHelper=document.createElement("core-key-helper");this.meta=document.createElement("core-transition");this.scrim=document.createElement("div");this.scrim.className="core-overlay-backdrop"},ready:function(){this.target=this.target||this;Platform.flush()},toggle:function(){this.opened=!this.opened},open:function(){this.opened=true},close:function(){this.opened=false},domReady:function(){this.ensureTargetSetup()},targetChanged:function(old){if(this.target){if(this.target.tabIndex<0){this.target.tabIndex=-1}this.addElementListenerList(this.target,this.targetListeners);this.target.style.display="none";this.target.__overlaySetup=false}if(old){this.removeElementListenerList(old,this.targetListeners);var transition=this.getTransition();if(transition){transition.teardown(old)}else{old.style.position="";old.style.outline=""}old.style.display=""}},transitionChanged:function(old){if(!this.target){return}if(old){this.getTransition(old).teardown(this.target)}this.target.__overlaySetup=false},ensureTargetSetup:function(){if(!this.target||this.target.__overlaySetup){return}if(!this.sizingTarget){this.sizingTarget=this.target}this.target.__overlaySetup=true;this.target.style.display="";var transition=this.getTransition();if(transition){transition.setup(this.target)}var style=this.target.style;var computed=getComputedStyle(this.target);if(computed.position==="static"){style.position="fixed"}style.outline="none";style.display="none"},openedChanged:function(){this.transitioning=true;this.ensureTargetSetup();this.prepareRenderOpened();this.async(function(){this.target.style.display="";this.target.offsetWidth;this.renderOpened()});this.fire("core-overlay-open",this.opened)},prepareRenderOpened:function(){if(this.opened){addOverlay(this)}this.prepareBackdrop();this.async(function(){if(!this.autoCloseDisabled){this.enableElementListener(this.opened,document,this.captureEventName,"captureHandler",true)}});this.enableElementListener(this.opened,window,"resize","resizeHandler");if(this.opened){this.target.offsetHeight;this.discoverDimensions();this.preparePositioning();this.positionTarget();this.updateTargetDimensions();this.finishPositioning();if(this.layered){this.layer.addElement(this.target);this.layer.opened=this.opened}}},renderOpened:function(){var transition=this.getTransition();if(transition){transition.go(this.target,{opened:this.opened})}else{this.transitionend()}this.renderBackdropOpened()},transitionend:function(e){if(e&&e.target!==this.target){return}this.transitioning=false;if(!this.opened){this.resetTargetDimensions();this.target.style.display="none";this.completeBackdrop();removeOverlay(this);if(this.layered){if(!currentOverlay()){this.layer.opened=this.opened}this.layer.removeElement(this.target)}}this.fire("core-overlay-"+(this.opened?"open":"close")+"-completed");this.applyFocus()},prepareBackdrop:function(){if(this.backdrop&&this.opened){if(!this.scrim.parentNode){document.body.appendChild(this.scrim);this.scrim.style.zIndex=currentOverlayZ()-1}trackBackdrop(this)}},renderBackdropOpened:function(){if(this.backdrop&&getBackdrops().length<2){this.scrim.classList.toggle("core-opened",this.opened)}},completeBackdrop:function(){if(this.backdrop){trackBackdrop(this);if(getBackdrops().length===0){this.scrim.parentNode.removeChild(this.scrim)}}},preparePositioning:function(){this.target.style.transition=this.target.style.webkitTransition="none";this.target.style.transform=this.target.style.webkitTransform="none";this.target.style.display=""},discoverDimensions:function(){if(this.dimensions){return}var target=getComputedStyle(this.target);var sizer=getComputedStyle(this.sizingTarget);this.dimensions={position:{v:target.top!=="auto"?"top":target.bottom!=="auto"?"bottom":null,h:target.left!=="auto"?"left":target.right!=="auto"?"right":null,css:target.position},size:{v:sizer.maxHeight!=="none",h:sizer.maxWidth!=="none"},margin:{top:parseInt(target.marginTop)||0,right:parseInt(target.marginRight)||0,bottom:parseInt(target.marginBottom)||0,left:parseInt(target.marginLeft)||0}}},finishPositioning:function(target){this.target.style.display="none";this.target.style.transform=this.target.style.webkitTransform="";this.target.offsetWidth;this.target.style.transition=this.target.style.webkitTransition=""},getTransition:function(name){return this.meta.byId(name||this.transition)},getFocusNode:function(){return this.target.querySelector("[autofocus]")||this.target},applyFocus:function(){var focusNode=this.getFocusNode();if(this.opened){if(!this.autoFocusDisabled){focusNode.focus()}}else{focusNode.blur();if(currentOverlay()==this){console.warn("Current core-overlay is attempting to focus itself as next! (bug)")}else{focusOverlay()}}},positionTarget:function(){this.fire("core-overlay-position",{target:this.target,sizingTarget:this.sizingTarget,opened:this.opened});if(!this.dimensions.position.v){this.target.style.top="0px"}if(!this.dimensions.position.h){this.target.style.left="0px"}},updateTargetDimensions:function(){this.sizeTarget();this.repositionTarget()},sizeTarget:function(){this.sizingTarget.style.boxSizing="border-box";var dims=this.dimensions;var rect=this.target.getBoundingClientRect();if(!dims.size.v){this.sizeDimension(rect,dims.position.v,"top","bottom","Height")}if(!dims.size.h){this.sizeDimension(rect,dims.position.h,"left","right","Width")}},sizeDimension:function(rect,positionedBy,start,end,extent){var dims=this.dimensions;var flip=positionedBy===end;var m=flip?start:end;var ws=window["inner"+extent];var o=dims.margin[m]+(flip?ws-rect[end]:rect[start]);var offset="offset"+extent;var o2=this.target[offset]-this.sizingTarget[offset];this.sizingTarget.style["max"+extent]=ws-o-o2+"px"},repositionTarget:function(){if(this.dimensions.position.css!=="fixed"){return}if(!this.dimensions.position.v){var t=(window.innerHeight-this.target.offsetHeight)/2;t-=this.dimensions.margin.top;this.target.style.top=t+"px"}if(!this.dimensions.position.h){var l=(window.innerWidth-this.target.offsetWidth)/2;l-=this.dimensions.margin.left;this.target.style.left=l+"px"}},resetTargetDimensions:function(){if(!this.dimensions.size.v){this.sizingTarget.style.maxHeight=""}if(!this.dimensions.size.h){this.sizingTarget.style.maxWidth=""}this.dimensions=null},tapHandler:function(e){if(e.target&&(this.closeSelector&&e.target.matches(this.closeSelector))||this.closeAttribute&&e.target.hasAttribute(this.closeAttribute)){this.toggle()}else{if(this.autoCloseJob){this.autoCloseJob.stop();this.autoCloseJob=null}}},captureHandler:function(e){if(!this.autoCloseDisabled&¤tOverlay()==this){this.autoCloseJob=this.job(this.autoCloseJob,function(){this.close()})}},keydownHandler:function(e){if(!this.autoCloseDisabled&&e.keyCode==this.keyHelper.ESCAPE_KEY){this.close();e.stopPropagation()}},resizeHandler:function(){this.updateTargetDimensions()},addElementListenerList:function(node,events){for(var i in events){this.addElementListener(node,i,events[i])}},removeElementListenerList:function(node,events){for(var i in events){this.removeElementListener(node,i,events[i])}},enableElementListener:function(enable,node,event,methodName,capture){if(enable){this.addElementListener(node,event,methodName,capture)}else{this.removeElementListener(node,event,methodName,capture)}},addElementListener:function(node,event,methodName,capture){var fn=this._makeBoundListener(methodName);if(node&&fn){Polymer.addEventListener(node,event,fn,capture)}},removeElementListener:function(node,event,methodName,capture){var fn=this._makeBoundListener(methodName);if(node&&fn){Polymer.removeEventListener(node,event,fn,capture)}},_makeBoundListener:function(methodName){var self=this,method=this[methodName];if(!method){return}var bound="_bound"+methodName;if(!this[bound]){this[bound]=function(e){method.call(self,e)}}return this[bound]}});var overlays=[];function addOverlay(overlay){var z0=currentOverlayZ();overlays.push(overlay);var z1=currentOverlayZ();if(z1<=z0){applyOverlayZ(overlay,z0)}}function removeOverlay(overlay){var i=overlays.indexOf(overlay);if(i>=0){overlays.splice(i,1);setZ(overlay,"")}}function applyOverlayZ(overlay,aboveZ){setZ(overlay.target,aboveZ+2)}function setZ(element,z){element.style.zIndex=z}function currentOverlay(){return overlays[overlays.length-1]}var DEFAULT_Z=10;function currentOverlayZ(){var z;var current=currentOverlay();if(current){var z1=window.getComputedStyle(current.target).zIndex;if(!isNaN(z1)){z=Number(z1)}}return z||DEFAULT_Z}function focusOverlay(){var current=currentOverlay();if(current&&!current.transitioning){current.applyFocus()}}var backdrops=[];function trackBackdrop(element){if(element.opened){backdrops.push(element)}else{var i=backdrops.indexOf(element);if(i>=0){backdrops.splice(i,1)}}}function getBackdrops(){return backdrops}})();Polymer("core-dropdown-overlay",{publish:{relatedTarget:null,halign:"left",valign:"top"},measure:function(){var target=this.target;var pos=target.style.position;target.style.position="fixed";target.style.left="0px";target.style.top="0px";var rect=target.getBoundingClientRect();target.style.position=pos;target.style.left=null;target.style.top=null;return rect},resetTargetDimensions:function(){var dims=this.dimensions;var style=this.target.style;if(dims.position.h_by===this.localName){style[dims.position.h]=null}if(dims.position.v_by===this.localName){style[dims.position.v]=null}this.super()},positionTarget:function(){if(!this.relatedTarget){this.super();return}var target=this.target;var related=this.relatedTarget;var rect=this.measure();target.style.width=rect.width+"px";target.style.height=rect.height+"px";var t_op=target.offsetParent;var r_op=related.offsetParent;if(window.ShadowDOMPolyfill){t_op=wrap(t_op);r_op=wrap(r_op)}if(t_op!==r_op&&t_op!==related){console.warn("core-dropdown-overlay: dropdown's offsetParent must be the relatedTarget or the relatedTarget's offsetParent!")}var dims=this.dimensions;var margin=dims.margin;var inside=t_op===related;if(!dims.position.h){if(this.halign==="right"){target.style.right=(inside?0:t_op.offsetWidth-related.offsetLeft-related.offsetWidth)-margin.right+"px";dims.position.h="right"}else{target.style.left=(inside?0:related.offsetLeft)-margin.left+"px";dims.position.h="left"}dims.position.h_by=this.localName}if(!dims.position.v){if(this.valign==="bottom"){target.style.bottom=(inside?0:t_op.offsetHeight-related.offsetTop-related.offsetHeight)-margin.bottom+"px";dims.position.v="bottom"}else{target.style.top=(inside?0:related.offsetTop)-margin.top+"px";dims.position.v="top"}dims.position.v_by=this.localName}}});Polymer("core-dropdown",{publish:{relatedTarget:null,opened:false,halign:"left",valign:"top",autoFocusDisabled:false,transition:null}});Polymer("core-icon-button",{src:"",active:false,icon:"",activeChanged:function(){this.classList.toggle("selected",this.active)}});Polymer("core-menu-button",{publish:{icon:"dots",src:"",opened:false,inlineMenu:false,halign:"left",valign:"top",stickySelection:false,selected:"",valueattr:"name",selectedClass:"core-selected",selectedProperty:"",selectedAttribute:"active",selectedItem:null,selectedModel:null,selectedIndex:-1,excludedLocalNames:""},closeAction:function(){this.opened=false},toggle:function(){this.opened=!this.opened},get selection(){return this.$.menu.selection},openedChanged:function(){if(this.opened&&!this.stickySelection){this.selected=null}}});(function(){var KEY_IDENTIFIER={"U+0009":"tab","U+001B":"esc","U+0020":"space","U+002A":"*","U+0030":"0","U+0031":"1","U+0032":"2","U+0033":"3","U+0034":"4","U+0035":"5","U+0036":"6","U+0037":"7","U+0038":"8","U+0039":"9","U+0041":"a","U+0042":"b","U+0043":"c","U+0044":"d","U+0045":"e","U+0046":"f","U+0047":"g","U+0048":"h","U+0049":"i","U+004A":"j","U+004B":"k","U+004C":"l","U+004D":"m","U+004E":"n","U+004F":"o","U+0050":"p","U+0051":"q","U+0052":"r","U+0053":"s","U+0054":"t","U+0055":"u","U+0056":"v","U+0057":"w","U+0058":"x","U+0059":"y","U+005A":"z","U+007F":"del"};var KEY_CODE={13:"enter",27:"esc",33:"pageup",34:"pagedown",35:"end",36:"home",32:"space",37:"left",38:"up",39:"right",40:"down",46:"del",106:"*"};var KEY_CHAR=/[a-z0-9*]/;function transformKey(key){var validKey="";if(key){var lKey=key.toLowerCase();if(lKey.length==1){if(KEY_CHAR.test(lKey)){validKey=lKey}}else if(lKey=="multiply"){validKey="*"}else{validKey=lKey}}return validKey}var IDENT_CHAR=/U\+/;function transformKeyIdentifier(keyIdent){var validKey="";if(keyIdent){if(IDENT_CHAR.test(keyIdent)){validKey=KEY_IDENTIFIER[keyIdent]}else{validKey=keyIdent.toLowerCase()}}return validKey}function transformKeyCode(keyCode){var validKey="";if(Number(keyCode)){if(keyCode>=65&&keyCode<=90){validKey=String.fromCharCode(32+keyCode)}else if(keyCode>=112&&keyCode<=123){validKey="f"+(keyCode-112)}else if(keyCode>=48&&keyCode<=57){validKey=String(48-keyCode)}else if(keyCode>=96&&keyCode<=105){validKey=String(96-keyCode)}else{validKey=KEY_CODE[keyCode]}}return validKey}function keyboardEventToKey(ev){var normalizedKey=transformKey(ev.key)||transformKeyIdentifier(ev.keyIdentifier)||transformKeyCode(ev.keyCode)||"";return{shift:ev.shiftKey,ctrl:ev.ctrlKey,meta:ev.metaKey,alt:ev.altKey,key:normalizedKey}}function stringToKey(keyCombo){var keys=keyCombo.split("+");var keyObj=Object.create(null);keys.forEach(function(key){if(key=="shift"){keyObj.shift=true}else if(key=="ctrl"){keyObj.ctrl=true}else if(key=="alt"){keyObj.alt=true}else{keyObj.key=key}});return keyObj}function keyMatches(a,b){return Boolean(a.alt)==Boolean(b.alt)&&Boolean(a.ctrl)==Boolean(b.ctrl)&&Boolean(a.shift)==Boolean(b.shift)&&a.key===b.key}function processKeys(ev){var current=keyboardEventToKey(ev);for(var i=0,dk;i<this._desiredKeys.length;i++){dk=this._desiredKeys[i];if(keyMatches(dk,current)){ev.preventDefault();ev.stopPropagation();this.fire("keys-pressed",current,this,false);break}}}function listen(node,handler){if(node&&node.addEventListener){node.addEventListener("keydown",handler)}}function unlisten(node,handler){if(node&&node.removeEventListener){node.removeEventListener("keydown",handler)}}Polymer("core-a11y-keys",{created:function(){this._keyHandler=processKeys.bind(this)},attached:function(){listen(this.target,this._keyHandler)},detached:function(){unlisten(this.target,this._keyHandler)},publish:{keys:"",target:null},keysChanged:function(){var normalized=this.keys.replace("*","* shift+*");this._desiredKeys=normalized.toLowerCase().split(" ").map(stringToKey)},targetChanged:function(oldTarget){unlisten(oldTarget,this._keyHandler);listen(this.target,this._keyHandler)}})})();Polymer("paper-radio-button",{publish:{checked:{value:false,reflect:true},label:"",toggles:false,disabled:{value:false,reflect:true}},eventDelegates:{tap:"tap"},tap:function(){var old=this.checked;this.toggle();if(this.checked!==old){this.fire("change")}},toggle:function(){this.checked=!this.toggles||!this.checked},checkedChanged:function(){this.$.onRadio.classList.toggle("fill",this.checked);this.setAttribute("aria-checked",this.checked?"true":"false");this.fire("core-change")},labelChanged:function(){this.setAttribute("aria-label",this.label)}});Polymer("paper-toggle-button",{checked:false,trackStart:function(e){this._w=this.$.toggleBar.offsetLeft+this.$.toggleBar.offsetWidth;e.preventTap()},trackx:function(e){this._x=Math.min(this._w,Math.max(0,this.checked?this._w+e.dx:e.dx));this.$.toggleRadio.classList.add("dragging");var s=this.$.toggleRadio.style;s.webkitTransform=s.transform="translate3d("+this._x+"px,0,0)"},trackEnd:function(){var s=this.$.toggleRadio.style;s.transform=s.webkitTransform="";this.$.toggleRadio.classList.remove("dragging");var old=this.checked;this.checked=Math.abs(this._x)>this._w/2;if(this.checked!==old){this.fire("change")}},checkedChanged:function(){this.setAttribute("aria-pressed",Boolean(this.checked));this.fire("core-change")},changeAction:function(e){e.stopPropagation();this.fire("change")},stopPropagation:function(e){e.stopPropagation()}});Polymer("paper-radio-group",{selectedAttribute:"checked",activateEvent:"change"});Polymer("paper-checkbox",{toggles:true,checkedChanged:function(){var cl=this.$.checkbox.classList;cl.toggle("checked",this.checked);cl.toggle("unchecked",!this.checked);cl.toggle("checkmark",!this.checked);cl.toggle("box",this.checked);this.setAttribute("aria-checked",this.checked?"true":"false");this.fire("core-change")},checkboxAnimationEnd:function(){var cl=this.$.checkbox.classList;cl.toggle("checkmark",this.checked&&!cl.contains("checkmark"));cl.toggle("box",!this.checked&&!cl.contains("box"))}});Polymer("paper-fab",{publish:{src:"",icon:"",mini:false,raised:true,recenteringTouch:false,fill:true},iconChanged:function(oldIcon){this.setAttribute("aria-label",this.icon)}});Polymer("core-range",{value:0,min:0,max:100,step:1,ratio:0,observe:{"value min max step":"update"},calcRatio:function(value){return(this.clampValue(value)-this.min)/(this.max-this.min)},clampValue:function(value){return Math.min(this.max,Math.max(this.min,this.calcStep(value)))},calcStep:function(value){return this.step?Math.round(value/this.step)/(1/this.step):value},validateValue:function(){var v=this.clampValue(this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!==v},update:function(){this.validateValue();this.ratio=this.calcRatio(this.value)*100}});Polymer("paper-progress",{secondaryProgress:0,step:0,observe:{"value secondaryProgress min max":"update"},update:function(){this.super();this.secondaryProgress=this.clampValue(this.secondaryProgress);this.secondaryRatio=this.calcRatio(this.secondaryProgress)*100}});Polymer("core-input",{publish:{placeholder:"",disabled:false,readonly:false,autofocus:false,multiline:false,rows:"fit",inputValue:"",value:"",type:"text",required:false,pattern:".*",min:null,max:null,step:null,maxlength:null,invalid:false,validateImmediately:true},ready:function(){this.handleTabindex(this.getAttribute("tabindex"))},disabledChanged:function(){if(this.disabled){this.setAttribute("aria-disabled",true)}else{this.removeAttribute("aria-disabled")}},invalidChanged:function(){this.classList.toggle("invalid",this.invalid);this.fire("input-"+(this.invalid?"invalid":"valid"),{value:this.inputValue})},inputValueChanged:function(){if(this.validateImmediately){this.updateValidity_()}},valueChanged:function(){this.inputValue=this.value},requiredChanged:function(){if(this.validateImmediately){this.updateValidity_()}},attributeChanged:function(attr,oldVal,curVal){if(attr==="tabindex"){this.handleTabindex(curVal)}},handleTabindex:function(tabindex){if(tabindex>0){this.$.input.setAttribute("tabindex",-1)}else{this.$.input.removeAttribute("tabindex")}},commit:function(){this.value=this.inputValue},updateValidity_:function(){if(this.$.input.willValidate){this.invalid=!this.$.input.validity.valid}},keypressAction:function(e){if(this.type!=="number"){return}var c=String.fromCharCode(e.charCode);if(e.charCode!==0&&!c.match(/[\d-\.e]/)){e.preventDefault()}},inputChangeAction:function(){this.commit();if(!window.ShadowDOMPolyfill){this.fire("change",null,this)}},focusAction:function(e){if(this.getAttribute("tabindex")>0){this.$.input.focus()}},inputFocusAction:function(e){if(window.ShadowDOMPolyfill){this.fire("focus",null,this,false)}},inputBlurAction:function(){if(window.ShadowDOMPolyfill){this.fire("blur",null,this,false)}},blur:function(){this.$.input.blur()},click:function(){this.$.input.click()},focus:function(){this.$.input.focus()},select:function(){this.$.input.select()},setSelectionRange:function(selectionStart,selectionEnd,selectionDirection){this.$.input.setSelectionRange(selectionStart,selectionEnd,selectionDirection)},setRangeText:function(replacement,start,end,selectMode){if(!this.multiline){this.$.input.setRangeText(replacement,start,end,selectMode)}},stepDown:function(n){if(!this.multiline){this.$.input.stepDown(n)}},stepUp:function(n){if(!this.multiline){this.$.input.stepUp(n)}},get willValidate(){return this.$.input.willValidate},get validity(){return this.$.input.validity},get validationMessage(){return this.$.input.validationMessage},checkValidity:function(){var r=this.$.input.checkValidity();this.updateValidity_();return r},setCustomValidity:function(message){this.$.input.setCustomValidity(message);this.updateValidity_()}});(function(){window.CoreStyle=window.CoreStyle||{g:{},list:{},refMap:{}};Polymer("core-style",{publish:{ref:""},g:CoreStyle.g,refMap:CoreStyle.refMap,list:CoreStyle.list,ready:function(){if(this.id){this.provide()}else{this.registerRef(this.ref);if(!window.ShadowDOMPolyfill){this.require()
}}},attached:function(){if(!this.id&&window.ShadowDOMPolyfill){this.require()}},provide:function(){this.register();if(this.textContent){this._completeProvide()}else{this.async(this._completeProvide)}},register:function(){var i=this.list[this.id];if(i){if(!Array.isArray(i)){this.list[this.id]=[i]}this.list[this.id].push(this)}else{this.list[this.id]=this}},_completeProvide:function(){this.createShadowRoot();this.domObserver=new MutationObserver(this.domModified.bind(this)).observe(this.shadowRoot,{subtree:true,characterData:true,childList:true});this.provideContent()},provideContent:function(){this.ensureTemplate();this.shadowRoot.textContent="";this.shadowRoot.appendChild(this.instanceTemplate(this.template));this.cssText=this.shadowRoot.textContent},ensureTemplate:function(){if(!this.template){this.template=this.querySelector("template:not([repeat]):not([bind])");if(!this.template){this.template=document.createElement("template");var n=this.firstChild;while(n){this.template.content.appendChild(n.cloneNode(true));n=n.nextSibling}}}},domModified:function(){this.cssText=this.shadowRoot.textContent;this.notify()},notify:function(){var s$=this.refMap[this.id];if(s$){for(var i=0,s;s=s$[i];i++){s.require()}}},registerRef:function(ref){this.refMap[this.ref]=this.refMap[this.ref]||[];this.refMap[this.ref].push(this)},applyRef:function(ref){this.ref=ref;this.registerRef(this.ref);this.require()},require:function(){var cssText=this.cssTextForRef(this.ref);if(cssText){this.ensureStyleElement();if(this.styleElement._cssText===cssText){return}this.styleElement._cssText=cssText;if(window.ShadowDOMPolyfill){this.styleElement.textContent=cssText;cssText=Platform.ShadowCSS.shimStyle(this.styleElement,this.getScopeSelector())}this.styleElement.textContent=cssText}},cssTextForRef:function(ref){var s$=this.byId(ref);var cssText="";if(s$){if(Array.isArray(s$)){var p=[];for(var i=0,l=s$.length,s;i<l&&(s=s$[i]);i++){p.push(s.cssText)}cssText=p.join("\n\n")}else{cssText=s$.cssText}}if(s$&&!cssText){console.warn("No styles provided for ref:",ref)}return cssText},byId:function(id){return this.list[id]},ensureStyleElement:function(){if(!this.styleElement){this.styleElement=window.ShadowDOMPolyfill?this.makeShimStyle():this.makeRootStyle()}if(!this.styleElement){console.warn(this.localName,"could not setup style.")}},makeRootStyle:function(){var style=document.createElement("style");this.appendChild(style);return style},makeShimStyle:function(){var host=this.findHost(this);if(host){var name=host.localName;var style=document.querySelector("style["+name+"="+this.ref+"]");if(!style){style=document.createElement("style");style.setAttribute(name,this.ref);document.head.appendChild(style)}return style}},getScopeSelector:function(){if(!this._scopeSelector){var selector="",host=this.findHost(this);if(host){var typeExtension=host.hasAttribute("is");var name=typeExtension?host.getAttribute("is"):host.localName;selector=Platform.ShadowCSS.makeScopeSelector(name,typeExtension)}this._scopeSelector=selector}return this._scopeSelector},findHost:function(node){while(node.parentNode){node=node.parentNode}return node.host||wrap(document.documentElement)},cycle:function(rgb,amount){if(rgb.match("#")){var o=this.hexToRgb(rgb);if(!o){return rgb}rgb="rgb("+o.r+","+o.b+","+o.g+")"}function cycleChannel(v){return Math.abs((Number(v)-amount)%255)}return rgb.replace(/rgb\(([^,]*),([^,]*),([^,]*)\)/,function(m,a,b,c){return"rgb("+cycleChannel(a)+","+cycleChannel(b)+", "+cycleChannel(c)+")"})},hexToRgb:function(hex){var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}:null}})})();(function(){var paperInput=CoreStyle.g.paperInput=CoreStyle.g.paperInput||{};paperInput.focusedColor="#4059a9";paperInput.invalidColor="#d34336";Polymer("paper-input",{publish:{label:"",floatingLabel:false,maxRows:0,error:"",focused:{value:false,reflect:true}},get inputValueForMirror(){var tokens=this.inputValue?String(this.inputValue).replace(/&/gm,"&").replace(/"/gm,""").replace(/'/gm,"'").replace(/</gm,"<").replace(/>/gm,">").split("\n"):[""];if(this.multiline){if(this.maxRows&&tokens.length>this.maxRows){tokens=tokens.slice(0,this.maxRows)}while(this.rows&&tokens.length<this.rows){tokens.push("")}}return tokens.join("<br>")+" "},get inputHasValue(){return this.inputValue||this.type==="number"&&!this.validity.valid},syncInputValueToMirror:function(){this.$.mirror.innerHTML=this.inputValueForMirror},ready:function(){this.syncInputValueToMirror()},prepareLabelTransform:function(){var toRect=this.$.floatedLabelText.getBoundingClientRect();var fromRect=this.$.labelText.getBoundingClientRect();if(toRect.width!==0){var sy=toRect.height/fromRect.height;this.$.labelText.cachedTransform="scale3d("+toRect.width/fromRect.width+","+sy+",1) "+"translate3d(0,"+(toRect.top-fromRect.top)/sy+"px,0)"}},animateFloatingLabel:function(){if(!this.floatingLabel||this.labelAnimated){return}if(!this.$.labelText.cachedTransform){this.prepareLabelTransform()}if(!this.$.labelText.cachedTransform){return}this.labelAnimated=true;this.async(function(){this.transitionEndAction()},null,250);if(this.inputHasValue){this.$.labelText.style.webkitTransform=this.$.labelText.cachedTransform;this.$.labelText.style.transform=this.$.labelText.cachedTransform}else{if(!this.$.labelText.style.webkitTransform&&!this.$.labelText.style.transform){this.$.labelText.style.webkitTransform=this.$.labelText.cachedTransform;this.$.labelText.style.transform=this.$.labelText.cachedTransform;this.$.labelText.offsetTop}this.$.labelText.style.webkitTransform="";this.$.labelText.style.transform=""}},inputValueChanged:function(old){this.super();this.syncInputValueToMirror();if(old&&!this.inputValue||!old&&this.inputValue){this.animateFloatingLabel()}},placeholderChanged:function(){this.label=this.placeholder},inputFocusAction:function(){this.super(arguments);this.focused=true},inputBlurAction:function(e){this.super(arguments);this.focused=false},downAction:function(e){if(this.disabled){return}if(this.focused){return}var rect=this.$.underline.getBoundingClientRect();var right=e.x-rect.left;this.$.focusedUnderline.style.mozTransformOrigin=right+"px";this.$.focusedUnderline.style.webkitTransformOrigin=right+"px ";this.$.focusedUnderline.style.transformOriginX=right+"px";this.underlineAnimated=true;if(!this.inputHasValue){this.cursorAnimated=true}this.async(function(){this.transitionEndAction()},null,250)},keydownAction:function(){this.super();if(this.type==="number"){var valid=!this.inputValue&&this.validity.valid;this.async(function(){if(valid!==(!this.inputValue&&this.validity.valid)){this.animateFloatingLabel()}})}},transitionEndAction:function(){this.underlineAnimated=false;this.cursorAnimated=false;this.labelAnimated=false}})})();Polymer("paper-slider",{snaps:false,pin:false,disabled:false,secondaryProgress:0,editable:false,observe:{"step snaps":"update"},ready:function(){this.update()},update:function(){this.positionKnob(this.calcRatio(this.value));this.updateMarkers()},minChanged:function(){this.update();this.setAttribute("aria-valuemin",this.min)},maxChanged:function(){this.update();this.setAttribute("aria-valuemax",this.max)},valueChanged:function(){this.update();this.setAttribute("aria-valuenow",this.value);this.fire("core-change")},disabledChanged:function(){if(this.disabled){this.removeAttribute("tabindex")}else{this.tabIndex=0}},immediateValueChanged:function(){if(!this.dragging){this.value=this.immediateValue}},expandKnob:function(){this.expand=true},resetKnob:function(){this.expandJob&&this.expandJob.stop();this.expand=false},positionKnob:function(ratio){this.immediateValue=this.calcStep(this.calcKnobPosition(ratio))||0;this._ratio=this.snaps?this.calcRatio(this.immediateValue):ratio;this.$.sliderKnob.style.left=this._ratio*100+"%"},inputChange:function(){this.value=this.$.input.value;this.fire("change")},calcKnobPosition:function(ratio){return(this.max-this.min)*ratio+this.min},trackStart:function(e){this._w=this.$.sliderBar.offsetWidth;this._x=this._ratio*this._w;this._startx=this._x||0;this._minx=-this._startx;this._maxx=this._w-this._startx;this.$.sliderKnob.classList.add("dragging");this.dragging=true;e.preventTap()},trackx:function(e){var x=Math.min(this._maxx,Math.max(this._minx,e.dx));this._x=this._startx+x;this.immediateValue=this.calcStep(this.calcKnobPosition(this._x/this._w))||0;var s=this.$.sliderKnob.style;s.transform=s.webkitTransform="translate3d("+(this.snaps?this.calcRatio(this.immediateValue)*this._w-this._startx:x)+"px, 0, 0)"},trackEnd:function(){var s=this.$.sliderKnob.style;s.transform=s.webkitTransform="";this.$.sliderKnob.classList.remove("dragging");this.dragging=false;this.resetKnob();this.value=this.immediateValue;this.fire("change")},bardown:function(e){this.transiting=true;this._w=this.$.sliderBar.offsetWidth;var rect=this.$.sliderBar.getBoundingClientRect();var ratio=(e.x-rect.left)/this._w;this.positionKnob(ratio);this.expandJob=this.job(this.expandJob,this.expandKnob,60);this.fire("change")},knobTransitionEnd:function(e){if(e.target===this.$.sliderKnob){this.transiting=false}},updateMarkers:function(){this.markers=[],l=(this.max-this.min)/this.step;for(var i=0;i<l;i++){this.markers.push("")}},increment:function(){this.value=this.clampValue(this.value+this.step)},decrement:function(){this.value=this.clampValue(this.value-this.step)},incrementKey:function(ev,keys){if(keys.key==="end"){this.value=this.max}else{this.increment()}this.fire("change")},decrementKey:function(ev,keys){if(keys.key==="home"){this.value=this.min}else{this.decrement()}this.fire("change")}});Polymer("core-transition-css",{baseClass:"core-transition",openedClass:"core-opened",closedClass:"core-closed",completeEventName:"transitionend",publish:{transitionType:null},registerCallback:function(element){this.transitionStyle=element.templateContent().firstElementChild},fetchTemplate:function(){return null},go:function(node,state){if(state.opened!==undefined){this.transitionOpened(node,state.opened)}},setup:function(node){if(!node._hasTransitionStyle){if(!node.shadowRoot){node.createShadowRoot().innerHTML="<content></content>"}this.installScopeStyle(this.transitionStyle,"transition",node.shadowRoot);node._hasTransitionStyle=true}node.classList.add(this.baseClass);if(this.transitionType){node.classList.add(this.baseClass+"-"+this.transitionType)}},teardown:function(node){node.classList.remove(this.baseClass);if(this.transitionType){node.classList.remove(this.baseClass+"-"+this.transitionType)}},transitionOpened:function(node,opened){this.listenOnce(node,this.completeEventName,function(){node.classList.toggle(this.revealedClass,opened);if(!opened){node.classList.remove(this.closedClass)}this.complete(node)});node.classList.toggle(this.openedClass,opened);node.classList.toggle(this.closedClass,!opened)}});(function(){var currentToast;Polymer("paper-toast",{text:"",duration:3e3,opened:false,responsiveWidth:"480px",swipeDisabled:false,eventDelegates:{trackstart:"trackStart",track:"track",trackend:"trackEnd",transitionend:"transitionEnd"},narrowModeChanged:function(){this.classList.toggle("fit-bottom",this.narrowMode)},openedChanged:function(){if(this.opened){this.dismissJob=this.job(this.dismissJob,this.dismiss,this.duration)}else{this.dismissJob&&this.dismissJob.stop();this.dismiss()}},toggle:function(){this.opened=!this.opened},show:function(){if(currentToast){currentToast.dismiss()}currentToast=this;this.opened=true},dismiss:function(){if(this.dragging){this.shouldDismiss=true}else{this.opened=false;if(currentToast===this){currentToast=null}}},trackStart:function(e){if(!this.swipeDisabled){e.preventTap();this.vertical=e.yDirection;this.w=this.offsetWidth;this.h=this.offsetHeight;this.dragging=true;this.classList.add("dragging")}},track:function(e){if(this.dragging){var s=this.style;if(this.vertical){var y=e.dy;s.opacity=(this.h-Math.abs(y))/this.h;s.webkitTransform=s.transform="translate3d(0, "+y+"px, 0)"}else{var x=e.dx;s.opacity=(this.w-Math.abs(x))/this.w;s.webkitTransform=s.transform="translate3d("+x+"px, 0, 0)"}}},trackEnd:function(e){if(this.dragging){this.classList.remove("dragging");this.style.opacity=null;this.style.webkitTransform=this.style.transform=null;var cl=this.classList;if(this.vertical){cl.toggle("fade-out-down",e.yDirection===1&&e.dy>0);cl.toggle("fade-out-up",e.yDirection===-1&&e.dy<0)}else{cl.toggle("fade-out-right",e.xDirection===1&&e.dx>0);cl.toggle("fade-out-left",e.xDirection===-1&&e.dx<0)}this.dragging=false}},transitionEnd:function(){var cl=this.classList;if(cl.contains("fade-out-right")||cl.contains("fade-out-left")||cl.contains("fade-out-down")||cl.contains("fade-out-up")){this.dismiss();cl.remove("fade-out-right","fade-out-left","fade-out-down","fade-out-up")}else if(this.shouldDismiss){this.dismiss()}this.shouldDismiss=false}})})();Polymer("paper-dialog",{opened:false,backdrop:false,layered:false,autoCloseDisabled:false,closeSelector:"[dismissive],[affirmative]",heading:"",transition:"",toggle:function(){this.$.overlay.toggle()},headingChanged:function(){this.setAttribute("aria-label",this.heading)}});Polymer("core-toolbar");Polymer("paper-tab",{noink:false});Polymer("paper-tabs",{noink:false,nobar:false,activateEvent:"down",nostretch:false,selectedIndexChanged:function(old){var s=this.$.selectionBar.style;if(!this.selectedItem){s.width=0;s.left=0;return}var w=100/this.items.length;if(this.nostretch||old===null||old===-1){s.width=w+"%";s.left=this.selectedIndex*w+"%";return}var m=5;this.$.selectionBar.classList.add("expand");if(old<this.selectedIndex){s.width=w+w*(this.selectedIndex-old)-m+"%";this._transitionCounter=1}else{s.width=w+w*(old-this.selectedIndex)-m+"%";s.left=this.selectedIndex*w+m+"%";this._transitionCounter=2}},barTransitionEnd:function(e){this._transitionCounter--;var cl=this.$.selectionBar.classList;if(cl.contains("expand")&&!this._transitionCounter){cl.remove("expand");cl.add("contract");var s=this.$.selectionBar.style;var w=100/this.items.length;s.width=w+"%";s.left=this.selectedIndex*w+"%"}else if(cl.contains("contract")){cl.remove("contract")}}});Polymer("component-download-view",{selected:0,component:null,org:"Polymer",ready:function(){var s=parseInt(localStorage.getItem("polymer-download-pref"));if(s==null||isNaN(s)||s<0||s>2){s=0}this.selected=s},selectedChanged:function(){localStorage.setItem("polymer-download-pref",this.selected)},downloadZIP:function(){window.location="https://bowerarchiver.appspot.com/archive?"+this.component+"="+this.org+"/"+this.component}});Polymer("component-download-button",{open:false,component:null,label:"Get the Source",org:"Polymer",toggle:function(){this.open=!this.open}});