0&&o>0&&(n.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?n.min=e.min:void 0!==e.suggestedMin&&(null===n.min?n.min=e.suggestedMin:n.min=Math.min(n.min,e.suggestedMin)),void 0!==e.max?n.max=e.max:void 0!==e.suggestedMax&&(null===n.max?n.max=e.suggestedMax:n.max=Math.max(n.max,e.suggestedMax)),a!==r&&n.min>=n.max&&(a?n.max=n.min+1:n.min=n.max-1),n.min===n.max&&(n.max++,e.beginAtZero||n.min--)},getTickLimit:function(){var n,e=this,t=e.options.ticks,o=t.stepSize,a=t.maxTicksLimit;return o?n=Math.ceil(e.max/o)-Math.floor(e.min/o)+1:(n=e._computeTickLimit(),a=a||11),a&&(n=Math.min(a,n)),n},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:yo,buildTicks:function(){var n=this,e=n.options.ticks,t=n.getTickLimit(),o={maxTicks:t=Math.max(2,t),min:e.min,max:e.max,precision:e.precision,stepSize:ln.valueOrDefault(e.fixedStepSize,e.stepSize)},a=n.ticks=Bo(o,n);n.handleDirectionalChanges(),n.max=ln.max(a),n.min=ln.min(a),e.reverse?(a.reverse(),n.start=n.max,n.end=n.min):(n.start=n.min,n.end=n.max)},convertTicksToLabels:function(){var n=this;n.ticksAsNumbers=n.ticks.slice(),n.zeroLineIndex=n.ticks.indexOf(0),ho.prototype.convertTicksToLabels.call(n)},_configure:function(){var n,e=this,t=e.getTicks(),o=e.min,a=e.max;ho.prototype._configure.call(e),e.options.offset&&t.length&&(o-=n=(a-o)/Math.max(t.length-1,1)/2,a+=n),e._startValue=o,e._endValue=a,e._valueRange=a-o}}),So={position:"left",ticks:{callback:Kt.formatters.linear}},Mo=0,To=1;function Lo(n,e,t){var o=[t.type,void 0===e&&void 0===t.stack?t.index:"",t.stack].join(".");return void 0===n[o]&&(n[o]={pos:[],neg:[]}),n[o]}function zo(n,e,t,o){var a,r,i=n.options,l=Lo(e,i.stacked,t),f=l.pos,c=l.neg,p=o.length;for(a=0;ae.length-1?null:this.getPixelForValue(e[n])}}),Fo=So;Ro._defaults=Fo;var Do=ln.valueOrDefault,Oo=ln.math.log10;function Ao(n,e){var t,o,a=[],r=Do(n.min,Math.pow(10,Math.floor(Oo(e.min)))),i=Math.floor(Oo(e.max)),l=Math.ceil(e.max/Math.pow(10,i));0===r?(t=Math.floor(Oo(e.minNotZero)),o=Math.floor(e.minNotZero/Math.pow(10,t)),a.push(r),r=o*Math.pow(10,t)):(t=Math.floor(Oo(r)),o=Math.floor(r/Math.pow(10,t)));var f=t<0?Math.pow(10,Math.abs(t)):1;do{a.push(r),10==++o&&(o=1,f=++t>=0?1:f),r=Math.round(o*Math.pow(10,t)*f)/f}while(t=0?n:e}var No=ho.extend({determineDataLimits:function(){var n,e,t,o,a,r,i=this,l=i.options,f=i.chart,c=f.data.datasets,p=i.isHorizontal();function d(n){return p?n.xAxisID===i.id:n.yAxisID===i.id}i.min=Number.POSITIVE_INFINITY,i.max=Number.NEGATIVE_INFINITY,i.minNotZero=Number.POSITIVE_INFINITY;var s=l.stacked;if(void 0===s)for(n=0;n0){var e=ln.min(n),t=ln.max(n);i.min=Math.min(i.min,e),i.max=Math.max(i.max,t)}}))}else for(n=0;n0?n.minNotZero=n.min:n.max<1?n.minNotZero=Math.pow(10,Math.floor(Oo(n.max))):n.minNotZero=t)},buildTicks:function(){var n=this,e=n.options.ticks,t=!n.isHorizontal(),o={min:Ho(e.min),max:Ho(e.max)},a=n.ticks=Ao(o,n);n.max=ln.max(a),n.min=ln.min(a),e.reverse?(t=!t,n.start=n.max,n.end=n.min):(n.start=n.min,n.end=n.max),t&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),ho.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(n,e){return this._getScaleLabel(this.chart.data.datasets[e].data[n])},getPixelForTick:function(n){var e=this.tickValues;return n<0||n>e.length-1?null:this.getPixelForValue(e[n])},_getFirstTickValue:function(n){var e=Math.floor(Oo(n));return Math.floor(n/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var n=this,e=n.min,t=0;ho.prototype._configure.call(n),0===e&&(e=n._getFirstTickValue(n.minNotZero),t=Do(n.options.ticks.fontSize,J.global.defaultFontSize)/n._length),n._startValue=Oo(e),n._valueOffset=t,n._valueRange=(Oo(n.max)-Oo(e))/(1-t)},getPixelForValue:function(n){var e=this,t=0;return(n=+e.getRightValue(n))>e.min&&n>0&&(t=(Oo(n)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(t)},getValueForPixel:function(n){var e=this,t=e.getDecimalForPixel(n);return 0===t&&0===e.min?0:Math.pow(10,e._startValue+(t-e._valueOffset)*e._valueRange)}}),Eo=Io;No._defaults=Eo;var jo=ln.valueOrDefault,Go=ln.valueAtIndexOrDefault,Yo=ln.options.resolve,qo={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Kt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(n){return n}}};function Vo(n){var e=n.ticks;return e.display&&n.display?jo(e.fontSize,J.global.defaultFontSize)+2*e.backdropPaddingY:0}function Uo(n,e,t){return ln.isArray(t)?{w:ln.longestText(n,n.font,t),h:t.length*e}:{w:n.measureText(t).width,h:e}}function Xo(n,e,t,o,a){return n===o||n===a?{start:e-t/2,end:e+t/2}:na?{start:e-t,end:e}:{start:e,end:e+t}}function Zo(n){var e,t,o,a=ln.options._parseFont(n.options.pointLabels),r={l:0,r:n.width,t:0,b:n.height-n.paddingTop},i={};n.ctx.font=a.string,n._pointLabelSizes=[];var l=n.chart.data.labels.length;for(e=0;er.r&&(r.r=p.end,i.r=f),d.startr.b&&(r.b=d.end,i.b=f)}n.setReductions(n.drawingArea,r,i)}function $o(n){return 0===n||180===n?"center":n<180?"left":"right"}function Ko(n,e,t,o){var a,r,i=t.y+o/2;if(ln.isArray(e))for(a=0,r=e.length;a270||n<90)&&(t.y-=e.h)}function Qo(n){var e=n.ctx,t=n.options,o=t.pointLabels,a=Vo(t),r=n.getDistanceFromCenterForValue(t.ticks.reverse?n.min:n.max),i=ln.options._parseFont(o);e.save(),e.font=i.string,e.textBaseline="middle";for(var l=n.chart.data.labels.length-1;l>=0;l--){var f=0===l?a/2:0,c=n.getPointPosition(l,r+f+5),p=Go(o.fontColor,l,J.global.defaultFontColor);e.fillStyle=p;var d=n.getIndexAngle(l),s=ln.toDegrees(d);e.textAlign=$o(s),Jo(s,n._pointLabelSizes[l],c),Ko(e,n.pointLabels[l],c,i.lineHeight)}e.restore()}function na(n,e,t,o){var a,r=n.ctx,i=e.circular,l=n.chart.data.labels.length,f=Go(e.color,o-1),c=Go(e.lineWidth,o-1);if((i||l)&&f&&c){if(r.save(),r.strokeStyle=f,r.lineWidth=c,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),i)r.arc(n.xCenter,n.yCenter,t,0,2*Math.PI);else{a=n.getPointPosition(0,t),r.moveTo(a.x,a.y);for(var p=1;p0&&o>0?t:0)},_drawGrid:function(){var n,e,t,o=this,a=o.ctx,r=o.options,i=r.gridLines,l=r.angleLines,f=jo(l.lineWidth,i.lineWidth),c=jo(l.color,i.color);if(r.pointLabels.display&&Qo(o),i.display&&ln.each(o.ticks,(function(n,t){0!==t&&(e=o.getDistanceFromCenterForValue(o.ticksAsNumbers[t]),na(o,i,e,t))})),l.display&&f&&c){for(a.save(),a.lineWidth=f,a.strokeStyle=c,a.setLineDash&&(a.setLineDash(Yo([l.borderDash,i.borderDash,[]])),a.lineDashOffset=Yo([l.borderDashOffset,i.borderDashOffset,0])),n=o.chart.data.labels.length-1;n>=0;n--)e=o.getDistanceFromCenterForValue(r.ticks.reverse?o.min:o.max),t=o.getPointPosition(n,e),a.beginPath(),a.moveTo(o.xCenter,o.yCenter),a.lineTo(t.x,t.y),a.stroke();a.restore()}},_drawLabels:function(){var n=this,e=n.ctx,t=n.options.ticks;if(t.display){var o,a,r=n.getIndexAngle(0),i=ln.options._parseFont(t),l=jo(t.fontColor,J.global.defaultFontColor);e.save(),e.font=i.string,e.translate(n.xCenter,n.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",ln.each(n.ticks,(function(r,f){(0!==f||t.reverse)&&(o=n.getDistanceFromCenterForValue(n.ticksAsNumbers[f]),t.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=t.backdropColor,e.fillRect(-a/2-t.backdropPaddingX,-o-i.size/2-t.backdropPaddingY,a+2*t.backdropPaddingX,i.size+2*t.backdropPaddingY)),e.fillStyle=l,e.fillText(r,0,-o))})),e.restore()}},_drawTitle:ln.noop}),oa=qo;ta._defaults=oa;var aa=ln._deprecated,ra=ln.options.resolve,ia=ln.valueOrDefault,la=Number.MIN_SAFE_INTEGER||-9007199254740991,fa=Number.MAX_SAFE_INTEGER||9007199254740991,ca={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},pa=Object.keys(ca);function da(n,e){return n-e}function sa(n){var e,t,o,a={},r=[];for(e=0,t=n.length;ee&&l=0&&i<=l;){if(a=n[(o=i+l>>1)-1]||null,r=n[o],!a)return{lo:null,hi:r};if(r[e]t))return{lo:a,hi:r};l=o-1}}return{lo:r,hi:null}}function _a(n,e,t,o){var a=ua(n,e,t),r=a.lo?a.hi?a.lo:n[n.length-2]:n[0],i=a.lo?a.hi?a.hi:n[n.length-1]:n[1],l=i[e]-r[e],f=l?(t-r[e])/l:0,c=(i[o]-r[o])*f;return r[o]+c}function ha(n,e){var t=n._adapter,o=n.options.time,a=o.parser,r=a||o.format,i=e;return"function"==typeof a&&(i=a(i)),ln.isFinite(i)||(i="string"==typeof r?t.parse(i,r):t.parse(i)),null!==i?+i:(a||"function"!=typeof r||(i=r(e),ln.isFinite(i)||(i=t.parse(i))),i)}function va(n,e){if(ln.isNullOrUndef(e))return null;var t=n.options.time,o=ha(n,n.getRightValue(e));return null===o||t.round&&(o=+n._adapter.startOf(o,t.round)),o}function xa(n,e,t,o){var a,r,i,l=pa.length;for(a=pa.indexOf(n);a=pa.indexOf(t);r--)if(i=pa[r],ca[i].common&&n._adapter.diff(a,o,i)>=e-1)return i;return pa[t?pa.indexOf(t):0]}function ka(n){for(var e=pa.indexOf(n)+1,t=pa.length;e1e5*c)throw e+" and "+t+" are too far apart with stepSize of "+c+" "+f;for(a=d;a=0&&(e[r].major=!0);return e}function Pa(n,e,t){var o,a,r=[],i={},l=e.length;for(o=0;o1?sa(g).sort(da):g.sort(da),s=Math.min(s,g[0]),m=Math.max(m,g[g.length-1])),s=va(l,ma(p))||s,m=va(l,ga(p))||m,s=s===fa?+c.startOf(Date.now(),d):s,m=m===la?+c.endOf(Date.now(),d)+1:m,l.min=Math.min(s,m),l.max=Math.max(s+1,m),l._table=[],l._timestamps={data:g,datasets:b,labels:u}},buildTicks:function(){var n,e,t,o=this,a=o.min,r=o.max,i=o.options,l=i.ticks,f=i.time,c=o._timestamps,p=[],d=o.getLabelCapacity(a),s=l.source,m=i.distribution;for(c="data"===s||"auto"===s&&"series"===m?c.data:"labels"===s?c.labels:ya(o,a,r,d),"ticks"===i.bounds&&c.length&&(a=c[0],r=c[c.length-1]),a=va(o,ma(i))||a,r=va(o,ga(i))||r,n=0,e=c.length;n=a&&t<=r&&p.push(t);return o.min=a,o.max=r,o._unit=f.unit||(l.autoSkip?xa(f.minUnit,o.min,o.max,d):wa(o,p.length,f.minUnit,o.min,o.max)),o._majorUnit=l.major.enabled&&"year"!==o._unit?ka(o._unit):void 0,o._table=ba(o._timestamps.data,a,r,m),o._offsets=Ca(o._table,p,a,r,i),l.reverse&&p.reverse(),Pa(o,p,o._majorUnit)},getLabelForIndex:function(n,e){var t=this,o=t._adapter,a=t.chart.data,r=t.options.time,i=a.labels&&n=0&&n0?l:1}}),Ta=Sa;Ma._defaults=Ta;var La={category:wo,linear:Ro,logarithmic:No,radialLinear:ta,time:Ma},za={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};$t._date.override("function"==typeof n?{_id:"moment",formats:function(){return za},parse:function(e,t){return"string"==typeof e&&"string"==typeof t?e=n(e,t):e instanceof n||(e=n(e)),e.isValid()?e.valueOf():null},format:function(e,t){return n(e).format(t)},add:function(e,t,o){return n(e).add(t,o).valueOf()},diff:function(e,t,o){return n(e).diff(n(t),o)},startOf:function(e,t,o){return e=n(e),"isoWeek"===t?e.isoWeekday(o).valueOf():e.startOf(t).valueOf()},endOf:function(e,t){return n(e).endOf(t).valueOf()},_create:function(e){return n(e)}}:{}),J._set("global",{plugins:{filler:{propagate:!0}}});var Wa={dataset:function(n){var e=n.fill,t=n.chart,o=t.getDatasetMeta(e),a=o&&t.isDatasetVisible(e)&&o.dataset._children||[],r=a.length||0;return r?function(n,e){return e=t)&&o;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function Fa(n){var e,t=n.el._model||{},o=n.el._scale||{},a=n.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===t.scaleBottom?o.bottom:t.scaleBottom:"end"===a?r=void 0===t.scaleTop?o.top:t.scaleTop:void 0!==t.scaleZero?r=t.scaleZero:o.getBasePixel&&(r=o.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if(ln.isFinite(r))return{x:(e=o.isHorizontal())?r:null,y:e?null:r}}return null}function Da(n){var e,t,o,a,r,i=n.el._scale,l=i.options,f=i.chart.data.labels.length,c=n.fill,p=[];if(!f)return null;for(e=l.ticks.reverse?i.max:i.min,t=l.ticks.reverse?i.min:i.max,o=i.getPointPositionForValue(0,e),a=0;a0;--r)ln.canvas.lineTo(n,t[r],t[r-1],!0);else for(i=t[0].cx,l=t[0].cy,f=Math.sqrt(Math.pow(t[0].x-i,2)+Math.pow(t[0].y-l,2)),r=a-1;r>0;--r)n.arc(i,l,f,t[r].angle,t[r-1].angle,!0)}}function Ea(n,e,t,o,a,r){var i,l,f,c,p,d,s,m,g=e.length,b=o.spanGaps,u=[],_=[],h=0,v=0;for(n.beginPath(),i=0,l=g;i=0;--t)(e=f[t].$filler)&&e.visible&&(a=(o=e.el)._view,r=o._children||[],i=e.mapper,l=a.backgroundColor||J.global.defaultColor,i&&l&&r.length&&(ln.canvas.clipArea(c,n.chartArea),Ea(c,r,i,a,l,o._loop),ln.canvas.unclipArea(c)))}},Ga=ln.rtl.getRtlAdapter,Ya=ln.noop,qa=ln.valueOrDefault;function Va(n,e){return n.usePointStyle&&n.boxWidth>e?e:n.boxWidth}J._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(n,e){var t=e.datasetIndex,o=this.chart,a=o.getDatasetMeta(t);a.hidden=null===a.hidden?!o.data.datasets[t].hidden:null,o.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(n){var e=n.data.datasets,t=n.options.legend||{},o=t.labels&&t.labels.usePointStyle;return n._getSortedDatasetMetas().map((function(t){var a=t.controller.getStyle(o?0:void 0);return{text:e[t.index].label,fillStyle:a.backgroundColor,hidden:!n.isDatasetVisible(t.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:t.index}}),this)}}},legendCallback:function(n){var e,t,o,a=document.createElement("ul"),r=n.data.datasets;for(a.setAttribute("class",n.id+"-legend"),e=0,t=r.length;ef.width)&&(d+=i+t.padding,p[p.length-(e>0?0:1)]=0),l[e]={left:0,top:0,width:o,height:i},p[p.length-1]+=o+t.padding})),f.height+=d}else{var s=t.padding,m=n.columnWidths=[],g=n.columnHeights=[],b=t.padding,u=0,_=0;ln.each(n.legendItems,(function(n,e){var o=Va(t,i)+i/2+a.measureText(n.text).width;e>0&&_+i+2*s>f.height&&(b+=u+t.padding,m.push(u),g.push(_),u=0,_=0),u=Math.max(u,o),_+=i+s,l[e]={left:0,top:0,width:o,height:i}})),b+=u,m.push(u),g.push(_),f.width+=b}n.width=f.width,n.height=f.height}else n.width=f.width=n.height=f.height=0},afterFit:Ya,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var n=this,e=n.options,t=e.labels,o=J.global,a=o.defaultColor,r=o.elements.line,i=n.height,l=n.columnHeights,f=n.width,c=n.lineWidths;if(e.display){var p,d=Ga(e.rtl,n.left,n.minSize.width),s=n.ctx,m=qa(t.fontColor,o.defaultFontColor),g=ln.options._parseFont(t),b=g.size;s.textAlign=d.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.strokeStyle=m,s.fillStyle=m,s.font=g.string;var u=Va(t,b),_=n.legendHitBoxes,h=function(n,e,o){if(!(isNaN(u)||u<=0)){s.save();var i=qa(o.lineWidth,r.borderWidth);if(s.fillStyle=qa(o.fillStyle,a),s.lineCap=qa(o.lineCap,r.borderCapStyle),s.lineDashOffset=qa(o.lineDashOffset,r.borderDashOffset),s.lineJoin=qa(o.lineJoin,r.borderJoinStyle),s.lineWidth=i,s.strokeStyle=qa(o.strokeStyle,a),s.setLineDash&&s.setLineDash(qa(o.lineDash,r.borderDash)),t&&t.usePointStyle){var l=u*Math.SQRT2/2,f=d.xPlus(n,u/2),c=e+b/2;ln.canvas.drawPoint(s,o.pointStyle,l,f,c,o.rotation)}else s.fillRect(d.leftForLtr(n,u),e,u,b),0!==i&&s.strokeRect(d.leftForLtr(n,u),e,u,b);s.restore()}},v=function(n,e,t,o){var a=b/2,r=d.xPlus(n,u+a),i=e+a;s.fillText(t.text,r,i),t.hidden&&(s.beginPath(),s.lineWidth=2,s.moveTo(r,i),s.lineTo(d.xPlus(r,o),i),s.stroke())},x=function(n,o){switch(e.align){case"start":return t.padding;case"end":return n-o;default:return(n-o+t.padding)/2}},w=n.isHorizontal();p=w?{x:n.left+x(f,c[0]),y:n.top+t.padding,line:0}:{x:n.left+t.padding,y:n.top+x(i,l[0]),line:0},ln.rtl.overrideTextDirection(n.ctx,e.textDirection);var k=b+t.padding;ln.each(n.legendItems,(function(e,o){var a=s.measureText(e.text).width,r=u+b/2+a,m=p.x,g=p.y;d.setWidth(n.minSize.width),w?o>0&&m+r+t.padding>n.left+n.minSize.width&&(g=p.y+=k,p.line++,m=p.x=n.left+x(f,c[p.line])):o>0&&g+k>n.top+n.minSize.height&&(m=p.x=m+n.columnWidths[p.line]+t.padding,p.line++,g=p.y=n.top+x(i,l[p.line]));var y=d.x(m);h(y,g,e),_[o].left=d.leftForLtr(y,_[o].width),_[o].top=g,v(y,g,e,a),w?p.x+=r+t.padding:p.y+=k})),ln.rtl.restoreTextDirection(n.ctx,e.textDirection)}},_getLegendItemAt:function(n,e){var t,o,a,r=this;if(n>=r.left&&n<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,t=0;t=(o=a[t]).left&&n<=o.left+o.width&&e>=o.top&&e<=o.top+o.height)return r.legendItems[t];return null},handleEvent:function(n){var e,t=this,o=t.options,a="mouseup"===n.type?"click":n.type;if("mousemove"===a){if(!o.onHover&&!o.onLeave)return}else{if("click"!==a)return;if(!o.onClick)return}e=t._getLegendItemAt(n.x,n.y),"click"===a?e&&o.onClick&&o.onClick.call(t,n.native,e):(o.onLeave&&e!==t._hoveredItem&&(t._hoveredItem&&o.onLeave.call(t,n.native,t._hoveredItem),t._hoveredItem=e),o.onHover&&e&&o.onHover.call(t,n.native,e))}});function Xa(n,e){var t=new Ua({ctx:n.ctx,options:e,chart:n});qe.configure(n,t,e),qe.addBox(n,t),n.legend=t}var Za={id:"legend",_element:Ua,beforeInit:function(n){var e=n.options.legend;e&&Xa(n,e)},beforeUpdate:function(n){var e=n.options.legend,t=n.legend;e?(ln.mergeIf(e,J.global.legend),t?(qe.configure(n,t,e),t.options=e):Xa(n,e)):t&&(qe.removeBox(n,t),delete n.legend)},afterEvent:function(n,e){var t=n.legend;t&&t.handleEvent(e)}},$a=ln.noop;J._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ka=bn.extend({initialize:function(n){var e=this;ln.extend(e,n),e.legendHitBoxes=[]},beforeUpdate:$a,update:function(n,e,t){var o=this;return o.beforeUpdate(),o.maxWidth=n,o.maxHeight=e,o.margins=t,o.beforeSetDimensions(),o.setDimensions(),o.afterSetDimensions(),o.beforeBuildLabels(),o.buildLabels(),o.afterBuildLabels(),o.beforeFit(),o.fit(),o.afterFit(),o.afterUpdate(),o.minSize},afterUpdate:$a,beforeSetDimensions:$a,setDimensions:function(){var n=this;n.isHorizontal()?(n.width=n.maxWidth,n.left=0,n.right=n.width):(n.height=n.maxHeight,n.top=0,n.bottom=n.height),n.paddingLeft=0,n.paddingTop=0,n.paddingRight=0,n.paddingBottom=0,n.minSize={width:0,height:0}},afterSetDimensions:$a,beforeBuildLabels:$a,buildLabels:$a,afterBuildLabels:$a,beforeFit:$a,fit:function(){var n,e=this,t=e.options,o=e.minSize={},a=e.isHorizontal();t.display?(n=(ln.isArray(t.text)?t.text.length:1)*ln.options._parseFont(t).lineHeight+2*t.padding,e.width=o.width=a?e.maxWidth:n,e.height=o.height=a?n:e.maxHeight):e.width=o.width=e.height=o.height=0},afterFit:$a,isHorizontal:function(){var n=this.options.position;return"top"===n||"bottom"===n},draw:function(){var n=this,e=n.ctx,t=n.options;if(t.display){var o,a,r,i=ln.options._parseFont(t),l=i.lineHeight,f=l/2+t.padding,c=0,p=n.top,d=n.left,s=n.bottom,m=n.right;e.fillStyle=ln.valueOrDefault(t.fontColor,J.global.defaultFontColor),e.font=i.string,n.isHorizontal()?(a=d+(m-d)/2,r=p+f,o=m-d):(a="left"===t.position?d+f:m-f,r=p+(s-p)/2,o=s-p,c=Math.PI*("left"===t.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(c),e.textAlign="center",e.textBaseline="middle";var g=t.text;if(ln.isArray(g))for(var b=0,u=0;u{this.chart&&this.chart.resize()}))}static get styles(){return nn`:host{position:relative;height:100%;width:100%;display:block;min-height:25rem}canvas{width:100px;height:100px}`}firstUpdated(){fetch(this.url).then((n=>n.json())).catch((n=>console.error(n))).then((n=>{let e=this.shadowRoot?.querySelector("canvas").getContext("2d");this.chart=new Un(e,{type:"bar",data:{datasets:[{label:"Failed Logins",backgroundColor:"rgba(201, 25, 11, .5)",spanGaps:!0,data:n.logins_failed_per_1h},{label:"Successful Logins",backgroundColor:"rgba(189, 229, 184, .5)",spanGaps:!0,data:n.logins_per_1h}]},options:{maintainAspectRatio:!1,spanGaps:!0,scales:{xAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"},type:"time",offset:!0,ticks:{callback:function(n,e,t){const o=t[e],a=Date.now()-o.value;return Math.round(a/1e3/3600)+" Hours ago"},autoSkip:!0,maxTicksLimit:8}}],yAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"}}]}}})}))}render(){return A``}};n([$()],Xn.prototype,"url",void 0),Xn=n([X("pb-admin-logins-chart")],Xn);
//# sourceMappingURL=main.js.map
diff --git a/passbook/static/static/dist/main.js.map b/passbook/static/static/dist/main.js.map
index 7b49f267e..1fae4e4b5 100644
--- a/passbook/static/static/dist/main.js.map
+++ b/passbook/static/static/dist/main.js.map
@@ -1 +1 @@
-{"version":3,"file":"main.js","sources":["../node_modules/tslib/tslib.es6.js","../node_modules/construct-style-sheets-polyfill/dist/adoptedStyleSheets.js","../src/legacy.js","../node_modules/lit-html/src/lib/dom.ts","../node_modules/lit-html/src/lib/template.ts","../node_modules/lit-html/src/lib/modify-template.ts","../node_modules/lit-html/src/lib/directive.ts","../node_modules/lit-html/src/lib/part.ts","../node_modules/lit-html/src/lib/template-instance.ts","../node_modules/lit-html/src/lib/template-result.ts","../node_modules/lit-html/src/lib/parts.ts","../node_modules/lit-html/src/lib/template-factory.ts","../node_modules/lit-html/src/lib/render.ts","../node_modules/lit-html/src/lib/default-template-processor.ts","../node_modules/lit-html/src/lit-html.ts","../node_modules/lit-html/src/lib/shady-render.ts","../node_modules/lit-element/src/lib/updating-element.ts","../node_modules/lit-element/src/lib/decorators.ts","../node_modules/lit-element/src/lib/css-tag.ts","../node_modules/lit-element/src/lit-element.ts","../src/elements/Messages.ts","../src/constants.ts","../src/elements/ActionButton.ts","../src/utils.ts","../src/elements/Sidebar.ts","../src/api/user.ts","../src/elements/SidebarBrand.ts","../src/api/config.ts","../src/elements/SidebarUser.ts","../node_modules/codemirror/lib/codemirror.js","../node_modules/codemirror/addon/display/autorefresh.js","../node_modules/codemirror/mode/xml/xml.js","../node_modules/codemirror/mode/yaml/yaml.js","../node_modules/codemirror/mode/python/python.js","../src/elements/CodeMirror.ts","../src/elements/Dropdown.ts","../src/elements/FetchFillSlot.ts","../src/elements/ModalButton.ts","../src/elements/TokenCopyButton.ts","../src/api/token.ts","../src/elements/Tabs.ts","../src/pages/SiteShell.ts","../src/pages/FlowShellCard.ts","../src/pages/RouterOutlet.ts","../node_modules/moment/moment.js","../node_modules/chart.js/dist/Chart.js","../src/elements/AdminLoginsChart.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","(function () {\n 'use strict';\n\n if ('adoptedStyleSheets' in document) { return; }\n\n var hasShadyCss = 'ShadyCSS' in window && !window.ShadyCSS.nativeShadow;\n var deferredStyleSheets = [];\n var deferredDocumentStyleElements = [];\n var adoptedSheetsRegistry = new WeakMap();\n var sheetMetadataRegistry = new WeakMap();\n var locationRegistry = new WeakMap();\n var observerRegistry = new WeakMap();\n var appliedActionsCursorRegistry = new WeakMap();\n var state = {\n loaded: false\n };\n var frame = {\n body: null,\n CSSStyleSheet: null\n };\n var OldCSSStyleSheet = CSSStyleSheet;\n\n var importPattern = /@import\\surl(.*?);/gi;\n function instanceOfStyleSheet(instance) {\n return instance instanceof OldCSSStyleSheet || instance instanceof frame.CSSStyleSheet;\n }\n function checkAndPrepare(sheets, container) {\n var locationType = container === document ? 'Document' : 'ShadowRoot';\n if (!Array.isArray(sheets)) {\n throw new TypeError(\"Failed to set the 'adoptedStyleSheets' property on \" + locationType + \": Iterator getter is not callable.\");\n }\n if (!sheets.every(instanceOfStyleSheet)) {\n throw new TypeError(\"Failed to set the 'adoptedStyleSheets' property on \" + locationType + \": Failed to convert value to 'CSSStyleSheet'\");\n }\n var uniqueSheets = sheets.filter(function (value, index) {\n return sheets.indexOf(value) === index;\n });\n adoptedSheetsRegistry.set(container, uniqueSheets);\n return uniqueSheets;\n }\n function isDocumentLoading() {\n return document.readyState === 'loading';\n }\n function getAdoptedStyleSheet(location) {\n return adoptedSheetsRegistry.get(location.parentNode === document.documentElement ? document : location);\n }\n function rejectImports(contents) {\n var imports = contents.match(importPattern, '') || [];\n var sheetContent = contents;\n if (imports.length) {\n console.warn('@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418');\n imports.forEach(function (_import) {\n sheetContent = sheetContent.replace(_import, '');\n });\n }\n return sheetContent;\n }\n\n var cssStyleSheetMethods = ['addImport', 'addPageRule', 'addRule', 'deleteRule', 'insertRule', 'removeImport', 'removeRule'];\n var cssStyleSheetNewMethods = ['replace', 'replaceSync'];\n function updatePrototype(proto) {\n cssStyleSheetNewMethods.forEach(function (methodKey) {\n proto[methodKey] = function () {\n return ConstructStyleSheet.prototype[methodKey].apply(this, arguments);\n };\n });\n cssStyleSheetMethods.forEach(function (methodKey) {\n var oldMethod = proto[methodKey];\n proto[methodKey] = function () {\n var args = arguments;\n var result = oldMethod.apply(this, args);\n if (sheetMetadataRegistry.has(this)) {\n var _sheetMetadataRegistr = sheetMetadataRegistry.get(this),\n adopters = _sheetMetadataRegistr.adopters,\n actions = _sheetMetadataRegistr.actions;\n adopters.forEach(function (styleElement) {\n if (styleElement.sheet) {\n styleElement.sheet[methodKey].apply(styleElement.sheet, args);\n }\n });\n actions.push([methodKey, args]);\n }\n return result;\n };\n });\n }\n function updateAdopters(sheet) {\n var _sheetMetadataRegistr2 = sheetMetadataRegistry.get(sheet),\n adopters = _sheetMetadataRegistr2.adopters,\n basicStyleElement = _sheetMetadataRegistr2.basicStyleElement;\n adopters.forEach(function (styleElement) {\n styleElement.innerHTML = basicStyleElement.innerHTML;\n });\n }\n var ConstructStyleSheet =\n function () {\n function ConstructStyleSheet() {\n var basicStyleElement = document.createElement('style');\n if (state.loaded) {\n frame.body.appendChild(basicStyleElement);\n } else {\n document.head.appendChild(basicStyleElement);\n basicStyleElement.disabled = true;\n deferredStyleSheets.push(basicStyleElement);\n }\n var nativeStyleSheet = basicStyleElement.sheet;\n sheetMetadataRegistry.set(nativeStyleSheet, {\n adopters: new Map(),\n actions: [],\n basicStyleElement: basicStyleElement\n });\n return nativeStyleSheet;\n }\n var _proto = ConstructStyleSheet.prototype;\n _proto.replace = function replace(contents) {\n var _this = this;\n var sanitized = rejectImports(contents);\n return new Promise(function (resolve, reject) {\n if (sheetMetadataRegistry.has(_this)) {\n var _sheetMetadataRegistr3 = sheetMetadataRegistry.get(_this),\n basicStyleElement = _sheetMetadataRegistr3.basicStyleElement;\n basicStyleElement.innerHTML = sanitized;\n resolve(basicStyleElement.sheet);\n updateAdopters(_this);\n } else {\n reject(new Error(\"Can't call replace on non-constructed CSSStyleSheets.\"));\n }\n });\n };\n _proto.replaceSync = function replaceSync(contents) {\n var sanitized = rejectImports(contents);\n if (sheetMetadataRegistry.has(this)) {\n var _sheetMetadataRegistr4 = sheetMetadataRegistry.get(this),\n basicStyleElement = _sheetMetadataRegistr4.basicStyleElement;\n basicStyleElement.innerHTML = sanitized;\n updateAdopters(this);\n return basicStyleElement.sheet;\n } else {\n throw new Error(\"Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.\");\n }\n };\n return ConstructStyleSheet;\n }();\n Object.defineProperty(ConstructStyleSheet, Symbol.hasInstance, {\n configurable: true,\n value: instanceOfStyleSheet\n });\n\n function adoptStyleSheets(location) {\n var newStyles = document.createDocumentFragment();\n var sheets = getAdoptedStyleSheet(location);\n var observer = observerRegistry.get(location);\n for (var i = 0, len = sheets.length; i < len; i++) {\n var _sheetMetadataRegistr = sheetMetadataRegistry.get(sheets[i]),\n adopters = _sheetMetadataRegistr.adopters,\n basicStyleElement = _sheetMetadataRegistr.basicStyleElement;\n var elementToAdopt = adopters.get(location);\n if (elementToAdopt) {\n observer.disconnect();\n newStyles.appendChild(elementToAdopt);\n if (!elementToAdopt.innerHTML || elementToAdopt.sheet && !elementToAdopt.sheet.cssText) {\n elementToAdopt.innerHTML = basicStyleElement.innerHTML;\n }\n observer.observe();\n } else {\n elementToAdopt = document.createElement('style');\n elementToAdopt.innerHTML = basicStyleElement.innerHTML;\n locationRegistry.set(elementToAdopt, location);\n appliedActionsCursorRegistry.set(elementToAdopt, 0);\n adopters.set(location, elementToAdopt);\n newStyles.appendChild(elementToAdopt);\n }\n if (location === document.head) {\n deferredDocumentStyleElements.push(elementToAdopt);\n }\n }\n location.insertBefore(newStyles, location.firstChild);\n for (var _i = 0, _len = sheets.length; _i < _len; _i++) {\n var _sheetMetadataRegistr2 = sheetMetadataRegistry.get(sheets[_i]),\n _adopters = _sheetMetadataRegistr2.adopters,\n actions = _sheetMetadataRegistr2.actions;\n var adoptedStyleElement = _adopters.get(location);\n var cursor = appliedActionsCursorRegistry.get(adoptedStyleElement);\n if (actions.length > 0) {\n for (var _i2 = cursor, _len2 = actions.length; _i2 < _len2; _i2++) {\n var _actions$_i = actions[_i2],\n key = _actions$_i[0],\n args = _actions$_i[1];\n adoptedStyleElement.sheet[key].apply(adoptedStyleElement.sheet, args);\n }\n appliedActionsCursorRegistry.set(adoptedStyleElement, actions.length - 1);\n }\n }\n }\n function removeExcludedStyleSheets(location, oldSheets) {\n var sheets = getAdoptedStyleSheet(location);\n for (var i = 0, len = oldSheets.length; i < len; i++) {\n if (sheets.indexOf(oldSheets[i]) > -1) {\n continue;\n }\n var _sheetMetadataRegistr3 = sheetMetadataRegistry.get(oldSheets[i]),\n adopters = _sheetMetadataRegistr3.adopters;\n var observer = observerRegistry.get(location);\n var styleElement = adopters.get(location);\n if (!styleElement) {\n styleElement = adopters.get(document.head);\n }\n observer.disconnect();\n styleElement.parentNode.removeChild(styleElement);\n observer.observe();\n }\n }\n\n function adoptAndRestoreStylesOnMutationCallback(mutations) {\n for (var i = 0, len = mutations.length; i < len; i++) {\n var _mutations$i = mutations[i],\n addedNodes = _mutations$i.addedNodes,\n removedNodes = _mutations$i.removedNodes;\n for (var _i = 0, _len = removedNodes.length; _i < _len; _i++) {\n var location = locationRegistry.get(removedNodes[_i]);\n if (location) {\n adoptStyleSheets(location);\n }\n }\n if (!hasShadyCss) {\n for (var _i2 = 0, _len2 = addedNodes.length; _i2 < _len2; _i2++) {\n var iter = document.createNodeIterator(addedNodes[_i2], NodeFilter.SHOW_ELEMENT, function (node) {\n return node.shadowRoot && node.shadowRoot.adoptedStyleSheets.length > 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n },\n null, false);\n var node = void 0;\n while (node = iter.nextNode()) {\n adoptStyleSheets(node.shadowRoot);\n }\n }\n }\n }\n }\n function createObserver(location) {\n var observer = new MutationObserver(adoptAndRestoreStylesOnMutationCallback);\n var observerTool = {\n observe: function observe() {\n observer.observe(location, {\n childList: true,\n subtree: true\n });\n },\n disconnect: function disconnect() {\n observer.disconnect();\n }\n };\n observerRegistry.set(location, observerTool);\n observerTool.observe();\n }\n\n function initPolyfill() {\n var iframe = document.createElement('iframe');\n iframe.hidden = true;\n document.body.appendChild(iframe);\n frame.body = iframe.contentWindow.document.body;\n frame.CSSStyleSheet = iframe.contentWindow.CSSStyleSheet;\n updatePrototype(iframe.contentWindow.CSSStyleSheet.prototype);\n createObserver(document.body);\n state.loaded = true;\n var fragment = document.createDocumentFragment();\n for (var i = 0, len = deferredStyleSheets.length; i < len; i++) {\n deferredStyleSheets[i].disabled = false;\n fragment.appendChild(deferredStyleSheets[i]);\n }\n frame.body.appendChild(fragment);\n for (var _i = 0, _len = deferredDocumentStyleElements.length; _i < _len; _i++) {\n fragment.appendChild(deferredDocumentStyleElements[_i]);\n }\n document.body.insertBefore(fragment, document.body.firstChild);\n deferredStyleSheets.length = 0;\n deferredDocumentStyleElements.length = 0;\n }\n function initAdoptedStyleSheets() {\n var adoptedStyleSheetAccessors = {\n configurable: true,\n get: function get() {\n return adoptedSheetsRegistry.get(this) || [];\n },\n set: function set(sheets) {\n var oldSheets = adoptedSheetsRegistry.get(this) || [];\n checkAndPrepare(sheets, this);\n var location = this === document ?\n isDocumentLoading() ? this.head : this.body : this;\n var isConnected = 'isConnected' in location ? location.isConnected : document.body.contains(location);\n window.requestAnimationFrame(function () {\n if (isConnected) {\n adoptStyleSheets(location);\n removeExcludedStyleSheets(location, oldSheets);\n }\n });\n }\n };\n Object.defineProperty(Document.prototype, 'adoptedStyleSheets', adoptedStyleSheetAccessors);\n if (typeof ShadowRoot !== 'undefined') {\n var attachShadow = Element.prototype.attachShadow;\n Element.prototype.attachShadow = function () {\n var location = hasShadyCss ? this : attachShadow.apply(this, arguments);\n createObserver(location);\n return location;\n };\n Object.defineProperty(ShadowRoot.prototype, 'adoptedStyleSheets', adoptedStyleSheetAccessors);\n }\n }\n\n updatePrototype(OldCSSStyleSheet.prototype);\n window.CSSStyleSheet = ConstructStyleSheet;\n initAdoptedStyleSheets();\n if (isDocumentLoading()) {\n document.addEventListener('DOMContentLoaded', initPolyfill);\n } else {\n initPolyfill();\n }\n\n}());\n","// Fetch from data-attributes\ndocument.querySelectorAll(\"[data-pb-fetch-fill]\").forEach((el) => {\n const url = el.dataset.pbFetchFill;\n const key = el.dataset.pbFetchKey;\n fetch(url)\n .then((r) => r.json())\n .then((r) => {\n el.textContent = r[key];\n el.value = r[key];\n });\n});\n\n// Modal\ndocument.querySelectorAll(\"[data-target='modal']\").forEach((m) => {\n m.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest('[data-target=\"modal\"]');\n const modalId = parentContainer.attributes[\"data-modal\"].value;\n document.querySelector(`#${modalId}`).removeAttribute(\"hidden\");\n });\n});\ndocument.querySelectorAll(\".pf-c-modal-box [data-modal-close]\").forEach((b) => {\n b.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest(\".pf-c-backdrop\");\n parentContainer.setAttribute(\"hidden\", true);\n });\n});\n\n// Make Checkbox label click trigger checkbox toggle\ndocument.querySelectorAll(\".pf-c-check__label\").forEach((checkLabel) => {\n checkLabel.addEventListener(\"click\", (e) => {\n const checkbox = e.target.parentElement.querySelector(\n \"input[type=checkbox]\"\n );\n checkbox.checked = !checkbox.checked;\n });\n});\n\n// Hamburger Menu\ndocument\n .querySelectorAll(\".pf-c-page__header-brand-toggle>button\")\n .forEach((toggle) => {\n toggle.addEventListener(\"click\", (e) => {\n const sidebar = document.querySelector(\".pf-c-page__sidebar\");\n if (sidebar.classList.contains(\"pf-m-expanded\")) {\n // Sidebar already expanded\n sidebar.classList.remove(\"pf-m-expanded\");\n sidebar.style.zIndex = 0;\n } else {\n // Sidebar not expanded yet\n sidebar.classList.add(\"pf-m-expanded\");\n sidebar.style.zIndex = 200;\n }\n });\n });\n\n// Collapsable Menus in Sidebar\ndocument\n .querySelectorAll(\".pf-m-expandable>.pf-c-nav__link\")\n .forEach((menu) => {\n menu.addEventListener(\"click\", (e) => {\n e.preventDefault();\n menu.parentElement.classList.toggle(\"pf-m-expanded\");\n });\n });\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\ninterface MaybePolyfilledCe extends CustomElementRegistry {\n readonly polyfillWrapFlushCallback?: object;\n}\n\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = typeof window !== 'undefined' &&\n window.customElements != null &&\n (window.customElements as MaybePolyfilledCe).polyfillWrapFlushCallback !==\n undefined;\n\n/**\n * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive),\n * into another container (could be the same container), before `before`. If\n * `before` is null, it appends the nodes to the container.\n */\nexport const reparentNodes =\n (container: Node,\n start: Node|null,\n end: Node|null = null,\n before: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.insertBefore(start!, before);\n start = n;\n }\n };\n\n/**\n * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from\n * `container`.\n */\nexport const removeNodes =\n (container: Node, start: Node|null, end: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.removeChild(start!);\n start = n;\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\n\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nexport const nodeMarker = ``;\n\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n\n/**\n * Suffix appended to all bound attribute names.\n */\nexport const boundAttributeSuffix = '$lit$';\n\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n readonly parts: TemplatePart[] = [];\n readonly element: HTMLTemplateElement;\n\n constructor(result: TemplateResult, element: HTMLTemplateElement) {\n this.element = element;\n\n const nodesToRemove: Node[] = [];\n const stack: Node[] = [];\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n element.content,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n // Keeps track of the last index associated with a part. We try to delete\n // unnecessary nodes, but we never want to associate two different parts\n // to the same index. They must have a constant node between.\n let lastPartIndex = 0;\n let index = -1;\n let partIndex = 0;\n const {strings, values: {length}} = result;\n while (partIndex < length) {\n const node = walker.nextNode() as Element | Comment | Text | null;\n if (node === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n continue;\n }\n index++;\n\n if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n if ((node as Element).hasAttributes()) {\n const attributes = (node as Element).attributes;\n const {length} = attributes;\n // Per\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n // attributes are not guaranteed to be returned in document order.\n // In particular, Edge/IE can return them out of order, so we cannot\n // assume a correspondence between part index and attribute index.\n let count = 0;\n for (let i = 0; i < length; i++) {\n if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n count++;\n }\n }\n while (count-- > 0) {\n // Get the template literal section leading up to the first\n // expression in this attribute\n const stringForPart = strings[partIndex];\n // Find the attribute name\n const name = lastAttributeNameRegex.exec(stringForPart)![2];\n // Find the corresponding attribute\n // All bound attributes have had a suffix added in\n // TemplateResult#getHTML to opt out of special attribute\n // handling. To look up the attribute value we also need to add\n // the suffix.\n const attributeLookupName =\n name.toLowerCase() + boundAttributeSuffix;\n const attributeValue =\n (node as Element).getAttribute(attributeLookupName)!;\n (node as Element).removeAttribute(attributeLookupName);\n const statics = attributeValue.split(markerRegex);\n this.parts.push({type: 'attribute', index, name, strings: statics});\n partIndex += statics.length - 1;\n }\n }\n if ((node as Element).tagName === 'TEMPLATE') {\n stack.push(node);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n } else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n const data = (node as Text).data;\n if (data.indexOf(marker) >= 0) {\n const parent = node.parentNode!;\n const strings = data.split(markerRegex);\n const lastIndex = strings.length - 1;\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for node parts\n for (let i = 0; i < lastIndex; i++) {\n let insert: Node;\n let s = strings[i];\n if (s === '') {\n insert = createMarker();\n } else {\n const match = lastAttributeNameRegex.exec(s);\n if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n s = s.slice(0, match.index) + match[1] +\n match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n }\n insert = document.createTextNode(s);\n }\n parent.insertBefore(insert, node);\n this.parts.push({type: 'node', index: ++index});\n }\n // If there's no text, we must insert a comment to mark our place.\n // Else, we can trust it will stick around after cloning.\n if (strings[lastIndex] === '') {\n parent.insertBefore(createMarker(), node);\n nodesToRemove.push(node);\n } else {\n (node as Text).data = strings[lastIndex];\n }\n // We have a part for each match found\n partIndex += lastIndex;\n }\n } else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n if ((node as Comment).data === marker) {\n const parent = node.parentNode!;\n // Add a new marker node to be the startNode of the Part if any of\n // the following are true:\n // * We don't have a previousSibling\n // * The previousSibling is already the start of a previous part\n if (node.previousSibling === null || index === lastPartIndex) {\n index++;\n parent.insertBefore(createMarker(), node);\n }\n lastPartIndex = index;\n this.parts.push({type: 'node', index});\n // If we don't have a nextSibling, keep this node so we have an end.\n // Else, we can remove it to save future costs.\n if (node.nextSibling === null) {\n (node as Comment).data = '';\n } else {\n nodesToRemove.push(node);\n index--;\n }\n partIndex++;\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n // TODO (justinfagnani): consider whether it's even worth it to\n // make bindings in comments work\n this.parts.push({type: 'node', index: -1});\n partIndex++;\n }\n }\n }\n }\n\n // Remove text binding nodes after the walk to not disturb the TreeWalker\n for (const n of nodesToRemove) {\n n.parentNode!.removeChild(n);\n }\n }\n}\n\nconst endsWith = (str: string, suffix: string): boolean => {\n const index = str.length - suffix.length;\n return index >= 0 && str.slice(index) === suffix;\n};\n\n/**\n * A placeholder for a dynamic expression in an HTML template.\n *\n * There are two built-in part types: AttributePart and NodePart. NodeParts\n * always represent a single dynamic expression, while AttributeParts may\n * represent as many expressions are contained in the attribute.\n *\n * A Template's parts are mutable, so parts can be replaced or modified\n * (possibly to implement different template semantics). The contract is that\n * parts can only be replaced, not removed, added or reordered, and parts must\n * always consume the correct number of values in their `update()` method.\n *\n * TODO(justinfagnani): That requirement is a little fragile. A\n * TemplateInstance could instead be more careful about which values it gives\n * to Part.update().\n */\nexport type TemplatePart = {\n readonly type: 'node'; index: number;\n}|{\n readonly type: 'attribute';\n index: number;\n readonly name: string;\n readonly strings: ReadonlyArray;\n};\n\nexport const isTemplatePartActive = (part: TemplatePart) => part.index !== -1;\n\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters, which includes every\n * space character except \" \".\n *\n * So an attribute is:\n * * The name: any character except a control character, space character, ('),\n * (\"), \">\", \"=\", or \"/\"\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nexport const lastAttributeNameRegex =\n // eslint-disable-next-line no-control-regex\n /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\nconst walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;\n\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n * div#1 (remove) <-- start removing (removing node is div#1)\n * div\n * div#2 (remove) <-- continue removing (removing node is still div#1)\n * div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(\n template: Template, nodesToRemove: Set) {\n const {element: {content}, parts} = template;\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let part = parts[partIndex];\n let nodeIndex = -1;\n let removeCount = 0;\n const nodesToRemoveInTemplate = [];\n let currentRemovingNode: Node|null = null;\n while (walker.nextNode()) {\n nodeIndex++;\n const node = walker.currentNode as Element;\n // End removal if stepped past the removing node\n if (node.previousSibling === currentRemovingNode) {\n currentRemovingNode = null;\n }\n // A node to remove was found in the template\n if (nodesToRemove.has(node)) {\n nodesToRemoveInTemplate.push(node);\n // Track node we're removing\n if (currentRemovingNode === null) {\n currentRemovingNode = node;\n }\n }\n // When removing, increment count by which to adjust subsequent part indices\n if (currentRemovingNode !== null) {\n removeCount++;\n }\n while (part !== undefined && part.index === nodeIndex) {\n // If part is in a removed node deactivate it by setting index to -1 or\n // adjust the index as needed.\n part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n // go to the next active part.\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n part = parts[partIndex];\n }\n }\n nodesToRemoveInTemplate.forEach((n) => n.parentNode!.removeChild(n));\n}\n\nconst countNodes = (node: Node) => {\n let count = (node.nodeType === 11 /* Node.DOCUMENT_FRAGMENT_NODE */) ? 0 : 1;\n const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n while (walker.nextNode()) {\n count++;\n }\n return count;\n};\n\nconst nextActiveIndexInTemplateParts =\n (parts: TemplatePart[], startIndex = -1) => {\n for (let i = startIndex + 1; i < parts.length; i++) {\n const part = parts[i];\n if (isTemplatePartActive(part)) {\n return i;\n }\n }\n return -1;\n };\n\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(\n template: Template, node: Node, refNode: Node|null = null) {\n const {element: {content}, parts} = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n content.appendChild(node);\n return;\n }\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let insertCount = 0;\n let walkerIndex = -1;\n while (walker.nextNode()) {\n walkerIndex++;\n const walkerNode = walker.currentNode as Element;\n if (walkerNode === refNode) {\n insertCount = countNodes(node);\n refNode.parentNode!.insertBefore(node, refNode);\n }\n while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n // If we've inserted the node, simply adjust all subsequent parts\n if (insertCount > 0) {\n while (partIndex !== -1) {\n parts[partIndex].index += insertCount;\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n return;\n }\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\n\nconst directives = new WeakMap