{"version":3,"sources":["webpack:///./node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js"],"names":["module","exports","Chart","helpers","hasOwnProperty","devicePixelRatio","window","screen","deviceXDPI","logicalXDPI","utils","toTextLines","inputs","input","lines","concat","length","pop","unshift","apply","split","Array","isArray","push","isNullOrUndef","toFontString","font","size","family","style","weight","textSize","ctx","i","items","ilen","prev","width","string","Math","max","measureText","height","lineHeight","parseFont","value","global","defaults","valueOrDefault","defaultFontSize","defaultFontFamily","options","toLineHeight","defaultFontStyle","bound","min","arrayDiff","a0","a1","j","v","slice","updates","indexOf","splice","rasterize","round","orient","point","origin","x0","x","y0","y","dx","dy","ln","sqrt","R_INSIDE","R_LEFT","R_RIGHT","R_BOTTOM","R_TOP","region","rect","res","left","right","top","bottom","compute","range","config","anchor","segment","clamp","area","r","x1","y1","r0","r1","clipped","vx","vy","align","PI","cos","sin","aligned","positioners","arc","vm","angle","startAngle","endAngle","innerRadius","outerRadius","rx","radius","ry","sx","sy","horizontal","base","abs","fallback","helpers$1","getScaleOrigin","el","_model","scale","_scale","_xScale","_yScale","undefined","xCenter","yCenter","pixel","getBasePixel","drawTextLine","text","cfg","shadow","shadowBlur","stroked","w","strokeText","filled","fillText","Label","index","me","this","_config","_index","_rects","_ctx","_el","extend","prototype","_modelize","display","context","resolve","color","defaultFontColor","chart","chartArea","backgroundColor","borderColor","borderRadius","borderWidth","clip","offset","opacity","padding","toPadding","positioner","elements","Arc","Point","Rectangle","rotation","textAlign","textShadowBlur","textShadowColor","textStrokeColor","textStrokeWidth","update","label","model","rects","dataset","data","callback","formatter","th","tw","tx","ty","frame","h","boundingRects","geometry","visible","draw","center","save","beginPath","globalAlpha","translate","rotate","bgColor","canvas","roundedRect","closePath","fillStyle","fill","strokeStyle","lineWidth","lineJoin","stroke","drawFrame","strokeColor","strokeWidth","textGeometry","textBaseline","shadowColor","drawText","restore","helpers$2","MIN_INTEGER","Number","MIN_SAFE_INTEGER","MAX_INTEGER","MAX_SAFE_INTEGER","rotated","cx","cy","projected","points","axis","pt","dp","toAxis","p0","p1","HitBox","_rotation","_rect","coordinates","view","vs","contains","margin","intersects","other","pr0","pr1","_points","axes","layout","prepare","datasets","jlen","labels","$layout","_box","_hidable","_visible","_set","_idx","sort","a","b","sa","sb","state","dirty","collider","s0","s1","collide","h0","h1","compute$1","lookup","_view","helpers$3","keys","klen","k","isObject","Object","listeners","helpers$4","EXPANDO_KEY","dispatchEvent","target","$context","_dirty","handleMoveEvents","event","previous","expando","_listeners","enter","leave","type","_labels","_hovered","dispatchMoveEvents","plugins","datalabels","plugin","id","beforeInit","_actives","beforeUpdate","_listened","_datasets","afterDatasetUpdate","args","datasetIndex","isDatasetVisible","override","merge","configure","meta","hidden","skip","active","dataIndex","merger","key","source","afterUpdate","afterDatasetsDraw","beforeEvent","handlers","click","handleClickEvents","afterEvent","actives","lastActive","animating","animations","animationService","render","duration","lazy","invalidate","register","factory"],"mappings":";;;;;;;AAO+DA,EAAOC,QAG9D,SAAUC,GAAS,aAI3B,IAAIC,GAFJD,EAAQA,GAASA,EAAME,eAAe,WAAaF,EAAe,QAAIA,GAElDC,QAEhBE,EAAoB,WACvB,GAAsB,oBAAXC,OAAwB,CAClC,GAAIA,OAAOD,iBACV,OAAOC,OAAOD,iBAMf,IAAIE,EAASD,OAAOC,OACpB,GAAIA,EACH,OAAQA,EAAOC,YAAc,IAAMD,EAAOE,aAAe,GAI3D,OAAO,EAfe,GAkBnBC,EAAQ,CAEXC,YAAa,SAASC,GACrB,IACIC,EADAC,EAAQ,GAIZ,IADAF,EAAS,GAAGG,OAAOH,GACZA,EAAOI,QAEQ,iBADrBH,EAAQD,EAAOK,OAEdH,EAAMI,QAAQC,MAAML,EAAOD,EAAMO,MAAM,OAC7BC,MAAMC,QAAQT,GACxBD,EAAOW,KAAKJ,MAAMP,EAAQC,GACfV,EAAQqB,cAAcZ,IACjCE,EAAMI,QAAQ,GAAKL,GAIrB,OAAOC,GAKRW,aAAc,SAASC,GACtB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AQD,EAAO,GAAG4G,MAEjB3G,EAAM8G,SAASgC,OAAwB,IAAd/I,EAAO,GAChCC,EAAMD,OAAOC,EAAM8G,YAKlBK,EAAQJ,QAAU/O,EAAQ9C,UAC7BsP,EAAOzE,OAAOoH,EAAQK,SAvIzB,SAAoB/I,GACnB,IAAIA,EAAMmL,UAAV,CAOA,IADA,IAAIC,EAAazV,EAAM0V,iBAAiBD,WAC/B1T,EAAI,EAAGE,EAAOwT,EAAW3U,OAAQiB,EAAIE,IAAQF,EACrD,GAAI0T,EAAW1T,GAAGsI,QAAUA,EAC3B,OAOFA,EAAMsL,OAAO,CAACC,SAAU,EAAGC,MAAM,KAuH/BC,CAAWzL,WAGL0I,EAAQJ,SAQjB,OAFA3S,EAAMuT,QAAQwC,SAAStC,GAEhBA,EAzyCyEuC,CAAQ,EAAQ","file":"npm.chartjs-plugin-datalabels.45ed149182ae5bc5716e.js","sourcesContent":["/*!\n * chartjs-plugin-datalabels v0.6.0\n * https://chartjs-plugin-datalabels.netlify.com\n * (c) 2019 Chart.js Contributors\n * Released under the MIT license\n */\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('chart.js')) :\ntypeof define === 'function' && define.amd ? define(['chart.js'], factory) :\n(global = global || self, global.ChartDataLabels = factory(global.Chart));\n}(this, function (Chart) { 'use strict';\n\nChart = Chart && Chart.hasOwnProperty('default') ? Chart['default'] : Chart;\n\nvar helpers = Chart.helpers;\n\nvar devicePixelRatio = (function() {\n\tif (typeof window !== 'undefined') {\n\t\tif (window.devicePixelRatio) {\n\t\t\treturn window.devicePixelRatio;\n\t\t}\n\n\t\t// devicePixelRatio is undefined on IE10\n\t\t// https://stackoverflow.com/a/20204180/8837887\n\t\t// https://github.com/chartjs/chartjs-plugin-datalabels/issues/85\n\t\tvar screen = window.screen;\n\t\tif (screen) {\n\t\t\treturn (screen.deviceXDPI || 1) / (screen.logicalXDPI || 1);\n\t\t}\n\t}\n\n\treturn 1;\n}());\n\nvar utils = {\n\t// @todo move this in Chart.helpers.toTextLines\n\ttoTextLines: function(inputs) {\n\t\tvar lines = [];\n\t\tvar input;\n\n\t\tinputs = [].concat(inputs);\n\t\twhile (inputs.length) {\n\t\t\tinput = inputs.pop();\n\t\t\tif (typeof input === 'string') {\n\t\t\t\tlines.unshift.apply(lines, input.split('\\n'));\n\t\t\t} else if (Array.isArray(input)) {\n\t\t\t\tinputs.push.apply(inputs, input);\n\t\t\t} else if (!helpers.isNullOrUndef(inputs)) {\n\t\t\t\tlines.unshift('' + input);\n\t\t\t}\n\t\t}\n\n\t\treturn lines;\n\t},\n\n\t// @todo move this method in Chart.helpers.canvas.toFont (deprecates helpers.fontString)\n\t// @see https://developer.mozilla.org/en-US/docs/Web/CSS/font\n\ttoFontString: function(font) {\n\t\tif (!font || helpers.isNullOrUndef(font.size) || helpers.isNullOrUndef(font.family)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (font.style ? font.style + ' ' : '')\n\t\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t\t+ font.size + 'px '\n\t\t\t+ font.family;\n\t},\n\n\t// @todo move this in Chart.helpers.canvas.textSize\n\t// @todo cache calls of measureText if font doesn't change?!\n\ttextSize: function(ctx, lines, font) {\n\t\tvar items = [].concat(lines);\n\t\tvar ilen = items.length;\n\t\tvar prev = ctx.font;\n\t\tvar width = 0;\n\t\tvar i;\n\n\t\tctx.font = font.string;\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\twidth = Math.max(ctx.measureText(items[i]).width, width);\n\t\t}\n\n\t\tctx.font = prev;\n\n\t\treturn {\n\t\t\theight: ilen * font.lineHeight,\n\t\t\twidth: width\n\t\t};\n\t},\n\n\t// @todo move this method in Chart.helpers.options.toFont\n\tparseFont: function(value) {\n\t\tvar global = Chart.defaults.global;\n\t\tvar size = helpers.valueOrDefault(value.size, global.defaultFontSize);\n\t\tvar font = {\n\t\t\tfamily: helpers.valueOrDefault(value.family, global.defaultFontFamily),\n\t\t\tlineHeight: helpers.options.toLineHeight(value.lineHeight, size),\n\t\t\tsize: size,\n\t\t\tstyle: helpers.valueOrDefault(value.style, global.defaultFontStyle),\n\t\t\tweight: helpers.valueOrDefault(value.weight, null),\n\t\t\tstring: ''\n\t\t};\n\n\t\tfont.string = utils.toFontString(font);\n\t\treturn font;\n\t},\n\n\t/**\n\t * Returns value bounded by min and max. This is equivalent to max(min, min(value, max)).\n\t * @todo move this method in Chart.helpers.bound\n\t * https://doc.qt.io/qt-5/qtglobal.html#qBound\n\t */\n\tbound: function(min, value, max) {\n\t\treturn Math.max(min, Math.min(value, max));\n\t},\n\n\t/**\n\t * Returns an array of pair [value, state] where state is:\n\t * * -1: value is only in a0 (removed)\n\t * * 1: value is only in a1 (added)\n\t */\n\tarrayDiff: function(a0, a1) {\n\t\tvar prev = a0.slice();\n\t\tvar updates = [];\n\t\tvar i, j, ilen, v;\n\n\t\tfor (i = 0, ilen = a1.length; i < ilen; ++i) {\n\t\t\tv = a1[i];\n\t\t\tj = prev.indexOf(v);\n\n\t\t\tif (j === -1) {\n\t\t\t\tupdates.push([v, 1]);\n\t\t\t} else {\n\t\t\t\tprev.splice(j, 1);\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, ilen = prev.length; i < ilen; ++i) {\n\t\t\tupdates.push([prev[i], -1]);\n\t\t}\n\n\t\treturn updates;\n\t},\n\n\t/**\n\t * https://github.com/chartjs/chartjs-plugin-datalabels/issues/70\n\t */\n\trasterize: function(v) {\n\t\treturn Math.round(v * devicePixelRatio) / devicePixelRatio;\n\t}\n};\n\nfunction orient(point, origin) {\n\tvar x0 = origin.x;\n\tvar y0 = origin.y;\n\n\tif (x0 === null) {\n\t\treturn {x: 0, y: -1};\n\t}\n\tif (y0 === null) {\n\t\treturn {x: 1, y: 0};\n\t}\n\n\tvar dx = point.x - x0;\n\tvar dy = point.y - y0;\n\tvar ln = Math.sqrt(dx * dx + dy * dy);\n\n\treturn {\n\t\tx: ln ? dx / ln : 0,\n\t\ty: ln ? dy / ln : -1\n\t};\n}\n\nfunction aligned(x, y, vx, vy, align) {\n\tswitch (align) {\n\tcase 'center':\n\t\tvx = vy = 0;\n\t\tbreak;\n\tcase 'bottom':\n\t\tvx = 0;\n\t\tvy = 1;\n\t\tbreak;\n\tcase 'right':\n\t\tvx = 1;\n\t\tvy = 0;\n\t\tbreak;\n\tcase 'left':\n\t\tvx = -1;\n\t\tvy = 0;\n\t\tbreak;\n\tcase 'top':\n\t\tvx = 0;\n\t\tvy = -1;\n\t\tbreak;\n\tcase 'start':\n\t\tvx = -vx;\n\t\tvy = -vy;\n\t\tbreak;\n\tcase 'end':\n\t\t// keep natural orientation\n\t\tbreak;\n\tdefault:\n\t\t// clockwise rotation (in degree)\n\t\talign *= (Math.PI / 180);\n\t\tvx = Math.cos(align);\n\t\tvy = Math.sin(align);\n\t\tbreak;\n\t}\n\n\treturn {\n\t\tx: x,\n\t\ty: y,\n\t\tvx: vx,\n\t\tvy: vy\n\t};\n}\n\n// Line clipping (Cohen–Sutherland algorithm)\n// https://en.wikipedia.org/wiki/Cohen–Sutherland_algorithm\n\nvar R_INSIDE = 0;\nvar R_LEFT = 1;\nvar R_RIGHT = 2;\nvar R_BOTTOM = 4;\nvar R_TOP = 8;\n\nfunction region(x, y, rect) {\n\tvar res = R_INSIDE;\n\n\tif (x < rect.left) {\n\t\tres |= R_LEFT;\n\t} else if (x > rect.right) {\n\t\tres |= R_RIGHT;\n\t}\n\tif (y < rect.top) {\n\t\tres |= R_TOP;\n\t} else if (y > rect.bottom) {\n\t\tres |= R_BOTTOM;\n\t}\n\n\treturn res;\n}\n\nfunction clipped(segment, area) {\n\tvar x0 = segment.x0;\n\tvar y0 = segment.y0;\n\tvar x1 = segment.x1;\n\tvar y1 = segment.y1;\n\tvar r0 = region(x0, y0, area);\n\tvar r1 = region(x1, y1, area);\n\tvar r, x, y;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tif (!(r0 | r1) || (r0 & r1)) {\n\t\t\t// both points inside or on the same side: no clipping\n\t\t\tbreak;\n\t\t}\n\n\t\t// at least one point is outside\n\t\tr = r0 || r1;\n\n\t\tif (r & R_TOP) {\n\t\t\tx = x0 + (x1 - x0) * (area.top - y0) / (y1 - y0);\n\t\t\ty = area.top;\n\t\t} else if (r & R_BOTTOM) {\n\t\t\tx = x0 + (x1 - x0) * (area.bottom - y0) / (y1 - y0);\n\t\t\ty = area.bottom;\n\t\t} else if (r & R_RIGHT) {\n\t\t\ty = y0 + (y1 - y0) * (area.right - x0) / (x1 - x0);\n\t\t\tx = area.right;\n\t\t} else if (r & R_LEFT) {\n\t\t\ty = y0 + (y1 - y0) * (area.left - x0) / (x1 - x0);\n\t\t\tx = area.left;\n\t\t}\n\n\t\tif (r === r0) {\n\t\t\tx0 = x;\n\t\t\ty0 = y;\n\t\t\tr0 = region(x0, y0, area);\n\t\t} else {\n\t\t\tx1 = x;\n\t\t\ty1 = y;\n\t\t\tr1 = region(x1, y1, area);\n\t\t}\n\t}\n\n\treturn {\n\t\tx0: x0,\n\t\tx1: x1,\n\t\ty0: y0,\n\t\ty1: y1\n\t};\n}\n\nfunction compute(range, config) {\n\tvar anchor = config.anchor;\n\tvar segment = range;\n\tvar x, y;\n\n\tif (config.clamp) {\n\t\tsegment = clipped(segment, config.area);\n\t}\n\n\tif (anchor === 'start') {\n\t\tx = segment.x0;\n\t\ty = segment.y0;\n\t} else if (anchor === 'end') {\n\t\tx = segment.x1;\n\t\ty = segment.y1;\n\t} else {\n\t\tx = (segment.x0 + segment.x1) / 2;\n\t\ty = (segment.y0 + segment.y1) / 2;\n\t}\n\n\treturn aligned(x, y, range.vx, range.vy, config.align);\n}\n\nvar positioners = {\n\tarc: function(vm, config) {\n\t\tvar angle = (vm.startAngle + vm.endAngle) / 2;\n\t\tvar vx = Math.cos(angle);\n\t\tvar vy = Math.sin(angle);\n\t\tvar r0 = vm.innerRadius;\n\t\tvar r1 = vm.outerRadius;\n\n\t\treturn compute({\n\t\t\tx0: vm.x + vx * r0,\n\t\t\ty0: vm.y + vy * r0,\n\t\t\tx1: vm.x + vx * r1,\n\t\t\ty1: vm.y + vy * r1,\n\t\t\tvx: vx,\n\t\t\tvy: vy\n\t\t}, config);\n\t},\n\n\tpoint: function(vm, config) {\n\t\tvar v = orient(vm, config.origin);\n\t\tvar rx = v.x * vm.radius;\n\t\tvar ry = v.y * vm.radius;\n\n\t\treturn compute({\n\t\t\tx0: vm.x - rx,\n\t\t\ty0: vm.y - ry,\n\t\t\tx1: vm.x + rx,\n\t\t\ty1: vm.y + ry,\n\t\t\tvx: v.x,\n\t\t\tvy: v.y\n\t\t}, config);\n\t},\n\n\trect: function(vm, config) {\n\t\tvar v = orient(vm, config.origin);\n\t\tvar x = vm.x;\n\t\tvar y = vm.y;\n\t\tvar sx = 0;\n\t\tvar sy = 0;\n\n\t\tif (vm.horizontal) {\n\t\t\tx = Math.min(vm.x, vm.base);\n\t\t\tsx = Math.abs(vm.base - vm.x);\n\t\t} else {\n\t\t\ty = Math.min(vm.y, vm.base);\n\t\t\tsy = Math.abs(vm.base - vm.y);\n\t\t}\n\n\t\treturn compute({\n\t\t\tx0: x,\n\t\t\ty0: y + sy,\n\t\t\tx1: x + sx,\n\t\t\ty1: y,\n\t\t\tvx: v.x,\n\t\t\tvy: v.y\n\t\t}, config);\n\t},\n\n\tfallback: function(vm, config) {\n\t\tvar v = orient(vm, config.origin);\n\n\t\treturn compute({\n\t\t\tx0: vm.x,\n\t\t\ty0: vm.y,\n\t\t\tx1: vm.x,\n\t\t\ty1: vm.y,\n\t\t\tvx: v.x,\n\t\t\tvy: v.y\n\t\t}, config);\n\t}\n};\n\nvar helpers$1 = Chart.helpers;\nvar rasterize = utils.rasterize;\n\nfunction boundingRects(model) {\n\tvar borderWidth = model.borderWidth || 0;\n\tvar padding = model.padding;\n\tvar th = model.size.height;\n\tvar tw = model.size.width;\n\tvar tx = -tw / 2;\n\tvar ty = -th / 2;\n\n\treturn {\n\t\tframe: {\n\t\t\tx: tx - padding.left - borderWidth,\n\t\t\ty: ty - padding.top - borderWidth,\n\t\t\tw: tw + padding.width + borderWidth * 2,\n\t\t\th: th + padding.height + borderWidth * 2\n\t\t},\n\t\ttext: {\n\t\t\tx: tx,\n\t\t\ty: ty,\n\t\t\tw: tw,\n\t\t\th: th\n\t\t}\n\t};\n}\n\nfunction getScaleOrigin(el) {\n\tvar horizontal = el._model.horizontal;\n\tvar scale = el._scale || (horizontal && el._xScale) || el._yScale;\n\n\tif (!scale) {\n\t\treturn null;\n\t}\n\n\tif (scale.xCenter !== undefined && scale.yCenter !== undefined) {\n\t\treturn {x: scale.xCenter, y: scale.yCenter};\n\t}\n\n\tvar pixel = scale.getBasePixel();\n\treturn horizontal ?\n\t\t{x: pixel, y: null} :\n\t\t{x: null, y: pixel};\n}\n\nfunction getPositioner(el) {\n\tif (el instanceof Chart.elements.Arc) {\n\t\treturn positioners.arc;\n\t}\n\tif (el instanceof Chart.elements.Point) {\n\t\treturn positioners.point;\n\t}\n\tif (el instanceof Chart.elements.Rectangle) {\n\t\treturn positioners.rect;\n\t}\n\treturn positioners.fallback;\n}\n\nfunction drawFrame(ctx, rect, model) {\n\tvar bgColor = model.backgroundColor;\n\tvar borderColor = model.borderColor;\n\tvar borderWidth = model.borderWidth;\n\n\tif (!bgColor && (!borderColor || !borderWidth)) {\n\t\treturn;\n\t}\n\n\tctx.beginPath();\n\n\thelpers$1.canvas.roundedRect(\n\t\tctx,\n\t\trasterize(rect.x) + borderWidth / 2,\n\t\trasterize(rect.y) + borderWidth / 2,\n\t\trasterize(rect.w) - borderWidth,\n\t\trasterize(rect.h) - borderWidth,\n\t\tmodel.borderRadius);\n\n\tctx.closePath();\n\n\tif (bgColor) {\n\t\tctx.fillStyle = bgColor;\n\t\tctx.fill();\n\t}\n\n\tif (borderColor && borderWidth) {\n\t\tctx.strokeStyle = borderColor;\n\t\tctx.lineWidth = borderWidth;\n\t\tctx.lineJoin = 'miter';\n\t\tctx.stroke();\n\t}\n}\n\nfunction textGeometry(rect, align, font) {\n\tvar h = font.lineHeight;\n\tvar w = rect.w;\n\tvar x = rect.x;\n\tvar y = rect.y + h / 2;\n\n\tif (align === 'center') {\n\t\tx += w / 2;\n\t} else if (align === 'end' || align === 'right') {\n\t\tx += w;\n\t}\n\n\treturn {\n\t\th: h,\n\t\tw: w,\n\t\tx: x,\n\t\ty: y\n\t};\n}\n\nfunction drawTextLine(ctx, text, cfg) {\n\tvar shadow = ctx.shadowBlur;\n\tvar stroked = cfg.stroked;\n\tvar x = rasterize(cfg.x);\n\tvar y = rasterize(cfg.y);\n\tvar w = rasterize(cfg.w);\n\n\tif (stroked) {\n\t\tctx.strokeText(text, x, y, w);\n\t}\n\n\tif (cfg.filled) {\n\t\tif (shadow && stroked) {\n\t\t\t// Prevent drawing shadow on both the text stroke and fill, so\n\t\t\t// if the text is stroked, remove the shadow for the text fill.\n\t\t\tctx.shadowBlur = 0;\n\t\t}\n\n\t\tctx.fillText(text, x, y, w);\n\n\t\tif (shadow && stroked) {\n\t\t\tctx.shadowBlur = shadow;\n\t\t}\n\t}\n}\n\nfunction drawText(ctx, lines, rect, model) {\n\tvar align = model.textAlign;\n\tvar color = model.color;\n\tvar filled = !!color;\n\tvar font = model.font;\n\tvar ilen = lines.length;\n\tvar strokeColor = model.textStrokeColor;\n\tvar strokeWidth = model.textStrokeWidth;\n\tvar stroked = strokeColor && strokeWidth;\n\tvar i;\n\n\tif (!ilen || (!filled && !stroked)) {\n\t\treturn;\n\t}\n\n\t// Adjust coordinates based on text alignment and line height\n\trect = textGeometry(rect, align, font);\n\n\tctx.font = font.string;\n\tctx.textAlign = align;\n\tctx.textBaseline = 'middle';\n\tctx.shadowBlur = model.textShadowBlur;\n\tctx.shadowColor = model.textShadowColor;\n\n\tif (filled) {\n\t\tctx.fillStyle = color;\n\t}\n\tif (stroked) {\n\t\tctx.lineJoin = 'round';\n\t\tctx.lineWidth = strokeWidth;\n\t\tctx.strokeStyle = strokeColor;\n\t}\n\n\tfor (i = 0, ilen = lines.length; i < ilen; ++i) {\n\t\tdrawTextLine(ctx, lines[i], {\n\t\t\tstroked: stroked,\n\t\t\tfilled: filled,\n\t\t\tw: rect.w,\n\t\t\tx: rect.x,\n\t\t\ty: rect.y + rect.h * i\n\t\t});\n\t}\n}\n\nvar Label = function(config, ctx, el, index) {\n\tvar me = this;\n\n\tme._config = config;\n\tme._index = index;\n\tme._model = null;\n\tme._rects = null;\n\tme._ctx = ctx;\n\tme._el = el;\n};\n\nhelpers$1.extend(Label.prototype, {\n\t/**\n\t * @private\n\t */\n\t_modelize: function(display, lines, config, context) {\n\t\tvar me = this;\n\t\tvar index = me._index;\n\t\tvar resolve = helpers$1.options.resolve;\n\t\tvar font = utils.parseFont(resolve([config.font, {}], context, index));\n\t\tvar color = resolve([config.color, Chart.defaults.global.defaultFontColor], context, index);\n\n\t\treturn {\n\t\t\talign: resolve([config.align, 'center'], context, index),\n\t\t\tanchor: resolve([config.anchor, 'center'], context, index),\n\t\t\tarea: context.chart.chartArea,\n\t\t\tbackgroundColor: resolve([config.backgroundColor, null], context, index),\n\t\t\tborderColor: resolve([config.borderColor, null], context, index),\n\t\t\tborderRadius: resolve([config.borderRadius, 0], context, index),\n\t\t\tborderWidth: resolve([config.borderWidth, 0], context, index),\n\t\t\tclamp: resolve([config.clamp, false], context, index),\n\t\t\tclip: resolve([config.clip, false], context, index),\n\t\t\tcolor: color,\n\t\t\tdisplay: display,\n\t\t\tfont: font,\n\t\t\tlines: lines,\n\t\t\toffset: resolve([config.offset, 0], context, index),\n\t\t\topacity: resolve([config.opacity, 1], context, index),\n\t\t\torigin: getScaleOrigin(me._el),\n\t\t\tpadding: helpers$1.options.toPadding(resolve([config.padding, 0], context, index)),\n\t\t\tpositioner: getPositioner(me._el),\n\t\t\trotation: resolve([config.rotation, 0], context, index) * (Math.PI / 180),\n\t\t\tsize: utils.textSize(me._ctx, lines, font),\n\t\t\ttextAlign: resolve([config.textAlign, 'start'], context, index),\n\t\t\ttextShadowBlur: resolve([config.textShadowBlur, 0], context, index),\n\t\t\ttextShadowColor: resolve([config.textShadowColor, color], context, index),\n\t\t\ttextStrokeColor: resolve([config.textStrokeColor, color], context, index),\n\t\t\ttextStrokeWidth: resolve([config.textStrokeWidth, 0], context, index)\n\t\t};\n\t},\n\n\tupdate: function(context) {\n\t\tvar me = this;\n\t\tvar model = null;\n\t\tvar rects = null;\n\t\tvar index = me._index;\n\t\tvar config = me._config;\n\t\tvar value, label, lines;\n\n\t\t// We first resolve the display option (separately) to avoid computing\n\t\t// other options in case the label is hidden (i.e. display: false).\n\t\tvar display = helpers$1.options.resolve([config.display, true], context, index);\n\n\t\tif (display) {\n\t\t\tvalue = context.dataset.data[index];\n\t\t\tlabel = helpers$1.valueOrDefault(helpers$1.callback(config.formatter, [value, context]), value);\n\t\t\tlines = helpers$1.isNullOrUndef(label) ? [] : utils.toTextLines(label);\n\n\t\t\tif (lines.length) {\n\t\t\t\tmodel = me._modelize(display, lines, config, context);\n\t\t\t\trects = boundingRects(model);\n\t\t\t}\n\t\t}\n\n\t\tme._model = model;\n\t\tme._rects = rects;\n\t},\n\n\tgeometry: function() {\n\t\treturn this._rects ? this._rects.frame : {};\n\t},\n\n\trotation: function() {\n\t\treturn this._model ? this._model.rotation : 0;\n\t},\n\n\tvisible: function() {\n\t\treturn this._model && this._model.opacity;\n\t},\n\n\tmodel: function() {\n\t\treturn this._model;\n\t},\n\n\tdraw: function(chart, center) {\n\t\tvar me = this;\n\t\tvar ctx = chart.ctx;\n\t\tvar model = me._model;\n\t\tvar rects = me._rects;\n\t\tvar area;\n\n\t\tif (!this.visible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tctx.save();\n\n\t\tif (model.clip) {\n\t\t\tarea = model.area;\n\t\t\tctx.beginPath();\n\t\t\tctx.rect(\n\t\t\t\tarea.left,\n\t\t\t\tarea.top,\n\t\t\t\tarea.right - area.left,\n\t\t\t\tarea.bottom - area.top);\n\t\t\tctx.clip();\n\t\t}\n\n\t\tctx.globalAlpha = utils.bound(0, model.opacity, 1);\n\t\tctx.translate(rasterize(center.x), rasterize(center.y));\n\t\tctx.rotate(model.rotation);\n\n\t\tdrawFrame(ctx, rects.frame, model);\n\t\tdrawText(ctx, model.lines, rects.text, model);\n\n\t\tctx.restore();\n\t}\n});\n\nvar helpers$2 = Chart.helpers;\n\nvar MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\nvar MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\nfunction rotated(point, center, angle) {\n\tvar cos = Math.cos(angle);\n\tvar sin = Math.sin(angle);\n\tvar cx = center.x;\n\tvar cy = center.y;\n\n\treturn {\n\t\tx: cx + cos * (point.x - cx) - sin * (point.y - cy),\n\t\ty: cy + sin * (point.x - cx) + cos * (point.y - cy)\n\t};\n}\n\nfunction projected(points, axis) {\n\tvar min = MAX_INTEGER;\n\tvar max = MIN_INTEGER;\n\tvar origin = axis.origin;\n\tvar i, pt, vx, vy, dp;\n\n\tfor (i = 0; i < points.length; ++i) {\n\t\tpt = points[i];\n\t\tvx = pt.x - origin.x;\n\t\tvy = pt.y - origin.y;\n\t\tdp = axis.vx * vx + axis.vy * vy;\n\t\tmin = Math.min(min, dp);\n\t\tmax = Math.max(max, dp);\n\t}\n\n\treturn {\n\t\tmin: min,\n\t\tmax: max\n\t};\n}\n\nfunction toAxis(p0, p1) {\n\tvar vx = p1.x - p0.x;\n\tvar vy = p1.y - p0.y;\n\tvar ln = Math.sqrt(vx * vx + vy * vy);\n\n\treturn {\n\t\tvx: (p1.x - p0.x) / ln,\n\t\tvy: (p1.y - p0.y) / ln,\n\t\torigin: p0,\n\t\tln: ln\n\t};\n}\n\nvar HitBox = function() {\n\tthis._rotation = 0;\n\tthis._rect = {\n\t\tx: 0,\n\t\ty: 0,\n\t\tw: 0,\n\t\th: 0\n\t};\n};\n\nhelpers$2.extend(HitBox.prototype, {\n\tcenter: function() {\n\t\tvar r = this._rect;\n\t\treturn {\n\t\t\tx: r.x + r.w / 2,\n\t\t\ty: r.y + r.h / 2\n\t\t};\n\t},\n\n\tupdate: function(center, rect, rotation) {\n\t\tthis._rotation = rotation;\n\t\tthis._rect = {\n\t\t\tx: rect.x + center.x,\n\t\t\ty: rect.y + center.y,\n\t\t\tw: rect.w,\n\t\t\th: rect.h\n\t\t};\n\t},\n\n\tcontains: function(point) {\n\t\tvar me = this;\n\t\tvar margin = 1;\n\t\tvar rect = me._rect;\n\n\t\tpoint = rotated(point, me.center(), -me._rotation);\n\n\t\treturn !(point.x < rect.x - margin\n\t\t\t|| point.y < rect.y - margin\n\t\t\t|| point.x > rect.x + rect.w + margin * 2\n\t\t\t|| point.y > rect.y + rect.h + margin * 2);\n\t},\n\n\t// Separating Axis Theorem\n\t// https://gamedevelopment.tutsplus.com/tutorials/collision-detection-using-the-separating-axis-theorem--gamedev-169\n\tintersects: function(other) {\n\t\tvar r0 = this._points();\n\t\tvar r1 = other._points();\n\t\tvar axes = [\n\t\t\ttoAxis(r0[0], r0[1]),\n\t\t\ttoAxis(r0[0], r0[3])\n\t\t];\n\t\tvar i, pr0, pr1;\n\n\t\tif (this._rotation !== other._rotation) {\n\t\t\t// Only separate with r1 axis if the rotation is different,\n\t\t\t// else it's enough to separate r0 and r1 with r0 axis only!\n\t\t\taxes.push(\n\t\t\t\ttoAxis(r1[0], r1[1]),\n\t\t\t\ttoAxis(r1[0], r1[3])\n\t\t\t);\n\t\t}\n\n\t\tfor (i = 0; i < axes.length; ++i) {\n\t\t\tpr0 = projected(r0, axes[i]);\n\t\t\tpr1 = projected(r1, axes[i]);\n\n\t\t\tif (pr0.max < pr1.min || pr1.max < pr0.min) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * @private\n\t */\n\t_points: function() {\n\t\tvar me = this;\n\t\tvar rect = me._rect;\n\t\tvar angle = me._rotation;\n\t\tvar center = me.center();\n\n\t\treturn [\n\t\t\trotated({x: rect.x, y: rect.y}, center, angle),\n\t\t\trotated({x: rect.x + rect.w, y: rect.y}, center, angle),\n\t\t\trotated({x: rect.x + rect.w, y: rect.y + rect.h}, center, angle),\n\t\t\trotated({x: rect.x, y: rect.y + rect.h}, center, angle)\n\t\t];\n\t}\n});\n\nfunction coordinates(view, model, geometry) {\n\tvar point = model.positioner(view, model);\n\tvar vx = point.vx;\n\tvar vy = point.vy;\n\n\tif (!vx && !vy) {\n\t\t// if aligned center, we don't want to offset the center point\n\t\treturn {x: point.x, y: point.y};\n\t}\n\n\tvar w = geometry.w;\n\tvar h = geometry.h;\n\n\t// take in account the label rotation\n\tvar rotation = model.rotation;\n\tvar dx = Math.abs(w / 2 * Math.cos(rotation)) + Math.abs(h / 2 * Math.sin(rotation));\n\tvar dy = Math.abs(w / 2 * Math.sin(rotation)) + Math.abs(h / 2 * Math.cos(rotation));\n\n\t// scale the unit vector (vx, vy) to get at least dx or dy equal to\n\t// w or h respectively (else we would calculate the distance to the\n\t// ellipse inscribed in the bounding rect)\n\tvar vs = 1 / Math.max(Math.abs(vx), Math.abs(vy));\n\tdx *= vx * vs;\n\tdy *= vy * vs;\n\n\t// finally, include the explicit offset\n\tdx += model.offset * vx;\n\tdy += model.offset * vy;\n\n\treturn {\n\t\tx: point.x + dx,\n\t\ty: point.y + dy\n\t};\n}\n\nfunction collide(labels, collider) {\n\tvar i, j, s0, s1;\n\n\t// IMPORTANT Iterate in the reverse order since items at the end of the\n\t// list have an higher weight/priority and thus should be less impacted\n\t// by the overlapping strategy.\n\n\tfor (i = labels.length - 1; i >= 0; --i) {\n\t\ts0 = labels[i].$layout;\n\n\t\tfor (j = i - 1; j >= 0 && s0._visible; --j) {\n\t\t\ts1 = labels[j].$layout;\n\n\t\t\tif (s1._visible && s0._box.intersects(s1._box)) {\n\t\t\t\tcollider(s0, s1);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn labels;\n}\n\nfunction compute$1(labels) {\n\tvar i, ilen, label, state, geometry, center;\n\n\t// Initialize labels for overlap detection\n\tfor (i = 0, ilen = labels.length; i < ilen; ++i) {\n\t\tlabel = labels[i];\n\t\tstate = label.$layout;\n\n\t\tif (state._visible) {\n\t\t\tgeometry = label.geometry();\n\t\t\tcenter = coordinates(label._el._model, label.model(), geometry);\n\t\t\tstate._box.update(center, geometry, label.rotation());\n\t\t}\n\t}\n\n\t// Auto hide overlapping labels\n\treturn collide(labels, function(s0, s1) {\n\t\tvar h0 = s0._hidable;\n\t\tvar h1 = s1._hidable;\n\n\t\tif ((h0 && h1) || h1) {\n\t\t\ts1._visible = false;\n\t\t} else if (h0) {\n\t\t\ts0._visible = false;\n\t\t}\n\t});\n}\n\nvar layout = {\n\tprepare: function(datasets) {\n\t\tvar labels = [];\n\t\tvar i, j, ilen, jlen, label;\n\n\t\tfor (i = 0, ilen = datasets.length; i < ilen; ++i) {\n\t\t\tfor (j = 0, jlen = datasets[i].length; j < jlen; ++j) {\n\t\t\t\tlabel = datasets[i][j];\n\t\t\t\tlabels.push(label);\n\t\t\t\tlabel.$layout = {\n\t\t\t\t\t_box: new HitBox(),\n\t\t\t\t\t_hidable: false,\n\t\t\t\t\t_visible: true,\n\t\t\t\t\t_set: i,\n\t\t\t\t\t_idx: j\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// TODO New `z` option: labels with a higher z-index are drawn\n\t\t// of top of the ones with a lower index. Lowest z-index labels\n\t\t// are also discarded first when hiding overlapping labels.\n\t\tlabels.sort(function(a, b) {\n\t\t\tvar sa = a.$layout;\n\t\t\tvar sb = b.$layout;\n\n\t\t\treturn sa._idx === sb._idx\n\t\t\t\t? sa._set - sb._set\n\t\t\t\t: sb._idx - sa._idx;\n\t\t});\n\n\t\tthis.update(labels);\n\n\t\treturn labels;\n\t},\n\n\tupdate: function(labels) {\n\t\tvar dirty = false;\n\t\tvar i, ilen, label, model, state;\n\n\t\tfor (i = 0, ilen = labels.length; i < ilen; ++i) {\n\t\t\tlabel = labels[i];\n\t\t\tmodel = label.model();\n\t\t\tstate = label.$layout;\n\t\t\tstate._hidable = model && model.display === 'auto';\n\t\t\tstate._visible = label.visible();\n\t\t\tdirty |= state._hidable;\n\t\t}\n\n\t\tif (dirty) {\n\t\t\tcompute$1(labels);\n\t\t}\n\t},\n\n\tlookup: function(labels, point) {\n\t\tvar i, state;\n\n\t\t// IMPORTANT Iterate in the reverse order since items at the end of\n\t\t// the list have an higher z-index, thus should be picked first.\n\n\t\tfor (i = labels.length - 1; i >= 0; --i) {\n\t\t\tstate = labels[i].$layout;\n\n\t\t\tif (state && state._visible && state._box.contains(point)) {\n\t\t\t\treturn {\n\t\t\t\t\tdataset: state._set,\n\t\t\t\t\tlabel: labels[i]\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\n\tdraw: function(chart, labels) {\n\t\tvar i, ilen, label, state, geometry, center;\n\n\t\tfor (i = 0, ilen = labels.length; i < ilen; ++i) {\n\t\t\tlabel = labels[i];\n\t\t\tstate = label.$layout;\n\n\t\t\tif (state._visible) {\n\t\t\t\tgeometry = label.geometry();\n\t\t\t\tcenter = coordinates(label._el._view, label.model(), geometry);\n\t\t\t\tstate._box.update(center, geometry, label.rotation());\n\t\t\t\tlabel.draw(chart, center);\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar helpers$3 = Chart.helpers;\n\nvar formatter = function(value) {\n\tif (helpers$3.isNullOrUndef(value)) {\n\t\treturn null;\n\t}\n\n\tvar label = value;\n\tvar keys, klen, k;\n\tif (helpers$3.isObject(value)) {\n\t\tif (!helpers$3.isNullOrUndef(value.label)) {\n\t\t\tlabel = value.label;\n\t\t} else if (!helpers$3.isNullOrUndef(value.r)) {\n\t\t\tlabel = value.r;\n\t\t} else {\n\t\t\tlabel = '';\n\t\t\tkeys = Object.keys(value);\n\t\t\tfor (k = 0, klen = keys.length; k < klen; ++k) {\n\t\t\t\tlabel += (k !== 0 ? ', ' : '') + keys[k] + ': ' + value[keys[k]];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn '' + label;\n};\n\n/**\n * IMPORTANT: make sure to also update tests and TypeScript definition\n * files (`/test/specs/defaults.spec.js` and `/types/options.d.ts`)\n */\n\nvar defaults = {\n\talign: 'center',\n\tanchor: 'center',\n\tbackgroundColor: null,\n\tborderColor: null,\n\tborderRadius: 0,\n\tborderWidth: 0,\n\tclamp: false,\n\tclip: false,\n\tcolor: undefined,\n\tdisplay: true,\n\tfont: {\n\t\tfamily: undefined,\n\t\tlineHeight: 1.2,\n\t\tsize: undefined,\n\t\tstyle: undefined,\n\t\tweight: null\n\t},\n\tformatter: formatter,\n\tlisteners: {},\n\toffset: 4,\n\topacity: 1,\n\tpadding: {\n\t\ttop: 4,\n\t\tright: 4,\n\t\tbottom: 4,\n\t\tleft: 4\n\t},\n\trotation: 0,\n\ttextAlign: 'start',\n\ttextStrokeColor: undefined,\n\ttextStrokeWidth: 0,\n\ttextShadowBlur: 0,\n\ttextShadowColor: undefined\n};\n\n/**\n * @see https://github.com/chartjs/Chart.js/issues/4176\n */\n\nvar helpers$4 = Chart.helpers;\nvar EXPANDO_KEY = '$datalabels';\n\nfunction configure(dataset, options) {\n\tvar override = dataset.datalabels;\n\tvar config = {};\n\n\tif (override === false) {\n\t\treturn null;\n\t}\n\tif (override === true) {\n\t\toverride = {};\n\t}\n\n\treturn helpers$4.merge(config, [options, override]);\n}\n\nfunction dispatchEvent(chart, listeners, target) {\n\tvar callback = listeners && listeners[target.dataset];\n\tif (!callback) {\n\t\treturn;\n\t}\n\n\tvar label = target.label;\n\tvar context = label.$context;\n\n\tif (helpers$4.callback(callback, [context]) === true) {\n\t\t// Users are allowed to tweak the given context by injecting values that can be\n\t\t// used in scriptable options to display labels differently based on the current\n\t\t// event (e.g. highlight an hovered label). That's why we update the label with\n\t\t// the output context and schedule a new chart render by setting it dirty.\n\t\tchart[EXPANDO_KEY]._dirty = true;\n\t\tlabel.update(context);\n\t}\n}\n\nfunction dispatchMoveEvents(chart, listeners, previous, target) {\n\tvar enter, leave;\n\n\tif (!previous && !target) {\n\t\treturn;\n\t}\n\n\tif (!previous) {\n\t\tenter = true;\n\t} else if (!target) {\n\t\tleave = true;\n\t} else if (previous.label !== target.label) {\n\t\tleave = enter = true;\n\t}\n\n\tif (leave) {\n\t\tdispatchEvent(chart, listeners.leave, previous);\n\t}\n\tif (enter) {\n\t\tdispatchEvent(chart, listeners.enter, target);\n\t}\n}\n\nfunction handleMoveEvents(chart, event) {\n\tvar expando = chart[EXPANDO_KEY];\n\tvar listeners = expando._listeners;\n\tvar previous, target;\n\n\tif (!listeners.enter && !listeners.leave) {\n\t\treturn;\n\t}\n\n\tif (event.type === 'mousemove') {\n\t\ttarget = layout.lookup(expando._labels, event);\n\t} else if (event.type !== 'mouseout') {\n\t\treturn;\n\t}\n\n\tprevious = expando._hovered;\n\texpando._hovered = target;\n\tdispatchMoveEvents(chart, listeners, previous, target);\n}\n\nfunction handleClickEvents(chart, event) {\n\tvar expando = chart[EXPANDO_KEY];\n\tvar handlers = expando._listeners.click;\n\tvar target = handlers && layout.lookup(expando._labels, event);\n\tif (target) {\n\t\tdispatchEvent(chart, handlers, target);\n\t}\n}\n\n// https://github.com/chartjs/chartjs-plugin-datalabels/issues/108\nfunction invalidate(chart) {\n\tif (chart.animating) {\n\t\treturn;\n\t}\n\n\t// `chart.animating` can be `false` even if there is animation in progress,\n\t// so let's iterate all animations to find if there is one for the `chart`.\n\tvar animations = Chart.animationService.animations;\n\tfor (var i = 0, ilen = animations.length; i < ilen; ++i) {\n\t\tif (animations[i].chart === chart) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// No render scheduled: trigger a \"lazy\" render that can be canceled in case\n\t// of hover interactions. The 1ms duration is a workaround to make sure an\n\t// animation is created so the controller can stop it before any transition.\n\tchart.render({duration: 1, lazy: true});\n}\n\nChart.defaults.global.plugins.datalabels = defaults;\n\nvar plugin = {\n\tid: 'datalabels',\n\n\tbeforeInit: function(chart) {\n\t\tchart[EXPANDO_KEY] = {\n\t\t\t_actives: []\n\t\t};\n\t},\n\n\tbeforeUpdate: function(chart) {\n\t\tvar expando = chart[EXPANDO_KEY];\n\t\texpando._listened = false;\n\t\texpando._listeners = {}; // {event-type: {dataset-index: function}}\n\t\texpando._datasets = []; // per dataset labels: [[Label]]\n\t\texpando._labels = []; // layouted labels: [Label]\n\t},\n\n\tafterDatasetUpdate: function(chart, args, options) {\n\t\tvar datasetIndex = args.index;\n\t\tvar expando = chart[EXPANDO_KEY];\n\t\tvar labels = expando._datasets[datasetIndex] = [];\n\t\tvar visible = chart.isDatasetVisible(datasetIndex);\n\t\tvar dataset = chart.data.datasets[datasetIndex];\n\t\tvar config = configure(dataset, options);\n\t\tvar elements = args.meta.data || [];\n\t\tvar ilen = elements.length;\n\t\tvar ctx = chart.ctx;\n\t\tvar i, el, label;\n\n\t\tctx.save();\n\n\t\tfor (i = 0; i < ilen; ++i) {\n\t\t\tel = elements[i];\n\n\t\t\tif (visible && el && !el.hidden && !el._model.skip) {\n\t\t\t\tlabels.push(label = new Label(config, ctx, el, i));\n\t\t\t\tlabel.update(label.$context = {\n\t\t\t\t\tactive: false,\n\t\t\t\t\tchart: chart,\n\t\t\t\t\tdataIndex: i,\n\t\t\t\t\tdataset: dataset,\n\t\t\t\t\tdatasetIndex: datasetIndex\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlabel = null;\n\t\t\t}\n\n\t\t\tel[EXPANDO_KEY] = label;\n\t\t}\n\n\t\tctx.restore();\n\n\t\t// Store listeners at the chart level and per event type to optimize\n\t\t// cases where no listeners are registered for a specific event\n\t\thelpers$4.merge(expando._listeners, config.listeners || {}, {\n\t\t\tmerger: function(key, target, source) {\n\t\t\t\ttarget[key] = target[key] || {};\n\t\t\t\ttarget[key][args.index] = source[key];\n\t\t\t\texpando._listened = true;\n\t\t\t}\n\t\t});\n\t},\n\n\tafterUpdate: function(chart, options) {\n\t\tchart[EXPANDO_KEY]._labels = layout.prepare(\n\t\t\tchart[EXPANDO_KEY]._datasets,\n\t\t\toptions);\n\t},\n\n\t// Draw labels on top of all dataset elements\n\t// https://github.com/chartjs/chartjs-plugin-datalabels/issues/29\n\t// https://github.com/chartjs/chartjs-plugin-datalabels/issues/32\n\tafterDatasetsDraw: function(chart) {\n\t\tlayout.draw(chart, chart[EXPANDO_KEY]._labels);\n\t},\n\n\tbeforeEvent: function(chart, event) {\n\t\t// If there is no listener registered for this chart, `listened` will be false,\n\t\t// meaning we can immediately ignore the incoming event and avoid useless extra\n\t\t// computation for users who don't implement label interactions.\n\t\tif (chart[EXPANDO_KEY]._listened) {\n\t\t\tswitch (event.type) {\n\t\t\tcase 'mousemove':\n\t\t\tcase 'mouseout':\n\t\t\t\thandleMoveEvents(chart, event);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\thandleClickEvents(chart, event);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t},\n\n\tafterEvent: function(chart) {\n\t\tvar expando = chart[EXPANDO_KEY];\n\t\tvar previous = expando._actives;\n\t\tvar actives = expando._actives = chart.lastActive || []; // public API?!\n\t\tvar updates = utils.arrayDiff(previous, actives);\n\t\tvar i, ilen, update, label;\n\n\t\tfor (i = 0, ilen = updates.length; i < ilen; ++i) {\n\t\t\tupdate = updates[i];\n\t\t\tif (update[1]) {\n\t\t\t\tlabel = update[0][EXPANDO_KEY];\n\t\t\t\tif (label) {\n\t\t\t\t\tlabel.$context.active = (update[1] === 1);\n\t\t\t\t\tlabel.update(label.$context);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (expando._dirty || updates.length) {\n\t\t\tlayout.update(expando._labels);\n\t\t\tinvalidate(chart);\n\t\t}\n\n\t\tdelete expando._dirty;\n\t}\n};\n\n// TODO Remove at version 1, we shouldn't automatically register plugins.\n// https://github.com/chartjs/chartjs-plugin-datalabels/issues/42\nChart.plugins.register(plugin);\n\nreturn plugin;\n\n}));\n"],"sourceRoot":""}