if(function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):t.Chart=e(t.moment)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={rgb2hsl:n,rgb2hsv:i,rgb2hwb:o,rgb2cmyk:a,rgb2keyword:s,rgb2xyz:l,rgb2lab:u,rgb2lch:function(t){return m(u(t))},hsl2rgb:c,hsl2hsv:function(t){var e=t[1]/100,n=t[2]/100;return 0===n?[0,0,0]:[t[0],2*(e*=(n*=2)<=1?n:2-n)/(n+e)*100,(n+e)/2*100]},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return a(c(t))},hsl2keyword:function(t){return s(c(t))},hsv2rgb:f,hsv2hsl:function(t){var e,n,i=t[1]/100,r=t[2]/100;return e=i*r,[t[0],100*(e=(e/=(n=(2-i)*r)<=1?n:2-n)||0),100*(n/=2)]},hsv2hwb:function(t){return o(f(t))},hsv2cmyk:function(t){return a(f(t))},hsv2keyword:function(t){return s(f(t))},hwb2rgb:d,hwb2hsl:function(t){return n(d(t))},hwb2hsv:function(t){return i(d(t))},hwb2cmyk:function(t){return a(d(t))},hwb2keyword:function(t){return s(d(t))},cmyk2rgb:h,cmyk2hsl:function(t){return n(h(t))},cmyk2hsv:function(t){return i(h(t))},cmyk2hwb:function(t){return o(h(t))},cmyk2keyword:function(t){return s(h(t))},keyword2rgb:w,keyword2hsl:function(t){return n(w(t))},keyword2hsv:function(t){return i(w(t))},keyword2hwb:function(t){return o(w(t))},keyword2cmyk:function(t){return a(w(t))},keyword2lab:function(t){return u(w(t))},keyword2xyz:function(t){return l(w(t))},xyz2rgb:p,xyz2lab:v,xyz2lch:function(t){return m(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:m,lch2lab:x,lch2xyz:function(t){return y(x(t))},lch2rgb:function(t){return _(x(t))}};function n(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a;return s==a?e=0:i==s?e=(r-o)/l:r==s?e=2+(o-i)/l:o==s&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s==a?0:n<=.5?l/(s+a):l/(2-s-a)),100*n]}function i(t){var e,n,i=t[0],r=t[1],o=t[2],a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a;return n=0==s?0:l/s*1e3/10,s==a?e=0:i==s?e=(r-o)/l:r==s?e=2+(o-i)/l:o==s&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,n,s/255*1e3/10]}function o(t){var e=t[0],i=t[1],r=t[2];return[n(t)[0],1/255*Math.min(e,Math.min(i,r))*100,100*(r=1-1/255*Math.max(e,Math.max(i,r)))]}function a(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-r)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]}function s(t){return O[JSON.stringify(t)]}function l(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function u(t){var e=l(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]}function c(t){var e,n,i,r,o,a=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),r=[0,0,0];for(var u=0;u<3;u++)(i=a+1/3*-(u-1))<0&&i++,i>1&&i--,r[u]=255*(o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e);return r}function f(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),a=255*i*(1-n),s=255*i*(1-n*o),l=255*i*(1-n*(1-o));switch(i*=255,r){case 0:return[i,l,a];case 1:return[s,i,a];case 2:return[a,i,l];case 3:return[a,s,i];case 4:return[l,a,i];case 5:return[i,a,s]}}function d(t){var e,n,i,o,a=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),n=1-l,i=6*a-(e=Math.floor(6*a)),0!=(1&e)&&(i=1-i),o=s+i*(n-s),e){default:case 6:case 0:r=n,g=o,b=s;break;case 1:r=o,g=n,b=s;break;case 2:r=s,g=n,b=o;break;case 3:r=s,g=o,b=n;break;case 4:r=o,g=s,b=n;break;case 5:r=n,g=s,b=o}return[255*r,255*g,255*b]}function h(t){var e=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-i)+i)),255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]}function p(t){var e,n,i,r=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*r+1.8758*o+.0415*a,i=.0557*r+-.204*o+1.057*a,e=(e=3.2406*r+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]}function v(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]}function y(t){var e,n,i,r,o=t[0],a=t[1],s=t[2];return o<=8?r=(n=100*o/903.3)/100*7.787+16/116:(n=100*Math.pow((o+16)/116,3),r=Math.pow(n/100,1/3)),[e=e/95.047<=.008856?e=95.047*(a/500+r-16/116)/7.787:95.047*Math.pow(a/500+r,3),n,i=i/108.883<=.008859?i=108.883*(r-s/200-16/116)/7.787:108.883*Math.pow(r-s/200,3)]}function m(t){var e,n=t[0],i=t[1],r=t[2];return(e=360*Math.atan2(r,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+r*r),e]}function _(t){return p(y(t))}function x(t){var e,n=t[1];return e=t[2]/360*2*Math.PI,[t[0],n*Math.cos(e),n*Math.sin(e)]}function w(t){return k[t]}var k={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},O={};for(var E in k)O[JSON.stringify(k[E])]=E;var T=function(){return new P};for(var C in e){T[C+"Raw"]=function(t){return function(n){return"number"==typeof n&&(n=Array.prototype.slice.call(arguments)),e[t](n)}}(C);var A=/(\w+)2(\w+)/.exec(C),S=A[1],N=A[2];(T[S]=T[S]||{})[N]=T[C]=function(t){return function(n){"number"==typeof n&&(n=Array.prototype.slice.call(arguments));var i=e[t](n);if("string"==typeof i||void 0===i)return i;for(var r=0;r=0&&e<1?W(Math.round(255*e)):"")},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?R(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:R,percentString:function(t,e){return e<1||t[3]&&t[3]<1?F(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:F,hslString:function(t,e){return e<1||t[3]&&t[3]<1?B(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:B,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return z[t.slice(0,3)]}};function D(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),r="";if(i){r=(i=i[1])[3];for(var o=0;on?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,r=2*i-1,o=this.alpha()-n.alpha(),a=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,s=1-a;return this.rgb(a*this.red()+s*n.red(),a*this.green()+s*n.green(),a*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new U,i=this.values,r=n.values;for(var o in i)i.hasOwnProperty(o)&&("[object Array]"===(e={}.toString.call(t=i[o]))?r[o]=t.slice(0):"[object Number]"===e?r[o]=t:console.error("unexpected color value:",t));return n}},U.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},U.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},U.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;r--)e.call(n,t[r],r);else for(r=0;r=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-G.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*G.easeInBounce(2*t):.5*G.easeOutBounce(2*t-1)+.5}},X={effects:G};Q.easingEffects=G;var Z=Math.PI,J=Z/180,tt=2*Z,et=Z/2,nt=Z/4,it=2*Z/3,rt={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,r,o){if(o){var a=Math.min(o,r/2,i/2),s=e+a,l=n+a,u=e+i-a,c=n+r-a;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,r=this.animations,o=0;o=n?(ut.callback(t.onAnimationComplete,[t],e),e.animating=!1,r.splice(o,1)):++o}},yt=ut.options.resolve,mt=["push","pop","shift","splice","unshift"];function bt(t,e){var n=t._chartjs;if(n){var i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(mt.forEach(function(e){delete t[e]}),delete t._chartjs)}}var _t=function(t,e){this.initialize(t,e)};ut.extend(_t.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this.update(!0)},destroy:function(){this._data&&bt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],r=n.data;for(t=0,e=i.length;tn&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;ns;)r-=2*Math.PI;for(;r=a&&r<=s&&o>=n.innerRadius&&o<=n.outerRadius}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i=n.startAngle,r=n.endAngle,o="inner"===n.borderAlign?.33:0;e.save(),e.beginPath(),e.arc(n.x,n.y,Math.max(n.outerRadius-o,0),i,r),e.arc(n.x,n.y,n.innerRadius,r,i,!0),e.closePath(),e.fillStyle=n.backgroundColor,e.fill(),n.borderWidth&&("inner"===n.borderAlign?(e.beginPath(),e.arc(n.x,n.y,n.outerRadius,i-(t=o/n.outerRadius),r+t),n.innerRadius>o?e.arc(n.x,n.y,n.innerRadius-o,r+(t=o/n.innerRadius),i-t,!0):e.arc(n.x,n.y,o,r+Math.PI/2,i-Math.PI/2),e.closePath(),e.clip(),e.beginPath(),e.arc(n.x,n.y,n.outerRadius,i,r),e.arc(n.x,n.y,n.innerRadius,r,i,!0),e.closePath(),e.lineWidth=2*n.borderWidth,e.lineJoin="round"):(e.lineWidth=n.borderWidth,e.lineJoin="bevel"),e.strokeStyle=n.borderColor,e.stroke()),e.restore()}}),kt=ut.valueOrDefault,Ot=st.global.defaultColor;st._set("global",{elements:{line:{tension:.4,backgroundColor:Ot,borderWidth:3,borderColor:Ot,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var Et=ht.extend({draw:function(){var t,e,n,i,r=this._view,o=this._chart.ctx,a=r.spanGaps,s=this._children.slice(),l=st.global,u=l.elements.line,c=-1;for(this._loop&&s.length&&s.push(s[0]),o.save(),o.lineCap=r.borderCapStyle||u.borderCapStyle,o.setLineDash&&o.setLineDash(r.borderDash||u.borderDash),o.lineDashOffset=kt(r.borderDashOffset,u.borderDashOffset),o.lineJoin=r.borderJoinStyle||u.borderJoinStyle,o.lineWidth=kt(r.borderWidth,u.borderWidth),o.strokeStyle=r.borderColor||l.defaultColor,o.beginPath(),c=-1,t=0;t=o.left&&e<=o.right)&&(r||n>=o.top&&n<=o.bottom)}st._set("global",{elements:{rectangle:{backgroundColor:Nt,borderColor:Nt,borderSkipped:"bottom",borderWidth:0}}});var Dt={},Lt=Et,qt=St,Rt=ht.extend({draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=Mt(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){var i,r,o,a,s=t.borderWidth,l=function(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=jt(e,"left","right")):t.basen?n:i,r:l.right||r<0?0:r>e?e:r,b:l.bottom||o<0?0:o>n?n:o,l:l.left||a<0?0:a>e?e:a}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b}}}(e),i=n.outer,r=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===r.w&&i.h===r.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(r.x,r.y,r.w,r.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return It(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return Pt(n)?It(n,t,null):It(n,null,e)},inXRange:function(t){return It(this._view,t,null)},inYRange:function(t){return It(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return Pt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return Pt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}});Dt.Arc=wt,Dt.Line=Lt,Dt.Point=qt,Dt.Rectangle=Rt;var Ft=ut.options.resolve;st._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}});var Bt=xt.extend({dataElementType:Dt.Rectangle,initialize:function(){var t;xt.prototype.initialize.apply(this,arguments),(t=this.getMeta()).stack=this.getDataset().stack,t.bar=!0},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e0?Math.min(a,i-n):a,n=i;return a}(n,l):-1,pixels:l,start:a,end:s,stackCount:i,scale:n}},calculateBarValuePixels:function(t,e){var n,i,r,o,a,s,l=this.chart,u=this.getMeta(),c=this._getValueScale(),f=c.isHorizontal(),d=l.data.datasets,h=+c.getRightValue(d[t].data[e]),p=c.options.minBarLength,g=c.options.stacked,v=u.stack,y=0;if(g||void 0===g&&void 0!==v)for(n=0;n=0&&r>0)&&(y+=r));return o=c.getPixelForValue(y),s=(a=c.getPixelForValue(y+h))-o,void 0!==p&&Math.abs(s)=0&&!f||h<0&&f?o-p:o+p),{size:s,base:o,head:a,center:a+s/2}},calculateBarIndexPixels:function(t,e,n){var i=n.scale.options,r="flex"===i.barThickness?function(t,e,n){var i,r=e.pixels,o=r[t],a=t>0?r[t-1]:null,s=t');var n=t.data,i=n.datasets,r=n.labels;if(i.length)for(var o=0;o'),r[o]&&e.push(r[o]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var r=t.getDatasetMeta(0),o=e.datasets[0],a=r.data[i],s=a&&a.custom||{},l=t.options.elements.arc;return{text:n,fillStyle:Vt([s.backgroundColor,o.backgroundColor,l.backgroundColor],void 0,i),strokeStyle:Vt([s.borderColor,o.borderColor,l.borderColor],void 0,i),lineWidth:Vt([s.borderWidth,o.borderWidth,l.borderWidth],void 0,i),hidden:isNaN(o.data[i])||r.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,r,o=e.index,a=this.chart;for(n=0,i=(a.data.datasets||[]).length;n=Math.PI?-1:v<-Math.PI?1:0))+p,m={x:Math.cos(v),y:Math.sin(v)},b={x:Math.cos(y),y:Math.sin(y)},_=v<=0&&y>=0||v<=2*Math.PI&&2*Math.PI<=y,x=v<=.5*Math.PI&&.5*Math.PI<=y||v<=2.5*Math.PI&&2.5*Math.PI<=y,w=v<=-Math.PI&&-Math.PI<=y||v<=Math.PI&&Math.PI<=y,k=v<=.5*-Math.PI&&.5*-Math.PI<=y||v<=1.5*Math.PI&&1.5*Math.PI<=y,O=h/100,E={x:w?-1:Math.min(m.x*(m.x<0?1:O),b.x*(b.x<0?1:O)),y:k?-1:Math.min(m.y*(m.y<0?1:O),b.y*(b.y<0?1:O))},T={x:_?1:Math.max(m.x*(m.x>0?1:O),b.x*(b.x>0?1:O)),y:x?1:Math.max(m.y*(m.y>0?1:O),b.y*(b.y>0?1:O))},C={width:.5*(T.x-E.x),height:.5*(T.y-E.y)};u=Math.min(s/C.width,l/C.height),c={x:-.5*(T.x+E.x),y:-.5*(T.y+E.y)}}for(e=0,n=d.length;e0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,r,o,a,s,l,u=0,c=this.chart;if(!t)for(e=0,n=c.data.datasets.length;e(u=(s=a.borderWidth)>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Ut(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Ut(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Ut(n.hoverBorderWidth,n.borderWidth)},_resolveElementOptions:function(t,e){var n,i,r,o=this.chart,a=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,u={},c={chart:o,dataIndex:e,dataset:a,datasetIndex:this.index},f=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(n=0,i=f.length;n0&&Gt(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t');var n=t.data,i=n.datasets,r=n.labels;if(i.length)for(var o=0;o'),r[o]&&e.push(r[o]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var r=t.getDatasetMeta(0),o=e.datasets[0],a=r.data[i].custom||{},s=t.options.elements.arc;return{text:n,fillStyle:Jt([a.backgroundColor,o.backgroundColor,s.backgroundColor],void 0,i),strokeStyle:Jt([a.borderColor,o.borderColor,s.borderColor],void 0,i),lineWidth:Jt([a.borderWidth,o.borderWidth,s.borderWidth],void 0,i),hidden:isNaN(o.data[i])||r.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,r,o=e.index,a=this.chart;for(n=0,i=(a.data.datasets||[]).length;n0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return fe(t,e,{intersect:!1})},point:function(t,e){return le(t,ae(e,t))},nearest:function(t,e,n){var i=ae(e,t);n.axis=n.axis||"xy";var r=ce(n.axis);return ue(t,i,n.intersect,r)},x:function(t,e,n){var i=ae(e,t),r=[],o=!1;return se(t,function(t){t.inXRange(i.x)&&r.push(t),t.inRange(i.x,i.y)&&(o=!0)}),n.intersect&&!o&&(r=[]),r},y:function(t,e,n){var i=ae(e,t),r=[],o=!1;return se(t,function(t){t.inYRange(i.y)&&r.push(t),t.inRange(i.x,i.y)&&(o=!0)}),n.intersect&&!o&&(r=[]),r}}};function he(t,e){return ut.where(t,function(t){return t.position===e})}function pe(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,r=e?t:n;return i.weight===r.weight?i._tmpIndex_-r._tmpIndex_:i.weight-r.weight}),t.forEach(function(t){delete t._tmpIndex_})}function ge(t,e){ut.each(t,function(t){e[t.position]+=t.isHorizontal()?t.height:t.width})}st._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ve,ye={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,r=["fullWidth","position","weight"],o=r.length,a=0;a div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"}))&&ve.default||ve,be=["animationstart","webkitAnimationStart"],_e={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function xe(t,e){var n=ut.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var we=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function ke(t,e,n){t.addEventListener(e,n,we)}function Oe(t,e,n){t.removeEventListener(e,n,we)}function Ee(t,e,n,i,r){return{type:t,chart:e,native:r||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Te(t){var e=document.createElement("div");return e.className=t||"",e}var Ce={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(){var t,e,n;this._loaded||(this._loaded=!0,this.disableCSSInjection||(e=me,n=(t=this)._style||document.createElement("style"),t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))))},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return this._ensureLoaded(),n&&n.canvas===t?(function(t,e){var n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var o=xe(t,"width");void 0!==o&&(t.width=o)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var a=xe(t,"height");void 0!==o&&(t.height=a)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e.$chartjs){var n=e.$chartjs.initial;["height","width"].forEach(function(t){var i=n[t];ut.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),ut.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e.$chartjs}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var r=n.$chartjs||(n.$chartjs={});ke(i,e,(r.proxies||(r.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=_e[t.type]||t.type,i=ut.getRelativePosition(t,e);return Ee(n,e,i.x,i.y,t)}(e,t))})}else!function(t,e,n){var i,r,o,a,s=t.$chartjs||(t.$chartjs={}),l=s.resizer=function(t){var e=Te("chartjs-size-monitor"),n=Te("chartjs-size-monitor-expand"),i=Te("chartjs-size-monitor-shrink");n.appendChild(Te()),i.appendChild(Te()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var r=function(){e._reset(),t()};return ke(n,"scroll",r.bind(n,"expand")),ke(i,"scroll",r.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,r=i?i.clientWidth:0;e(Ee("resize",n)),i&&i.clientWidth0){var o=t[0];o.label?n=o.label:o.xLabel?n=o.xLabel:r>0&&o.index-1?t.split("\n"):t}function De(t){var e=st.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Pe(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Pe(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Pe(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Pe(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Pe(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Pe(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Pe(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Pe(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Pe(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Le(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function qe(t){return je([],Ie(t))}var Re=ht.extend({initialize:function(){this._model=De(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),n=t.title.apply(this,arguments),i=t.afterTitle.apply(this,arguments),r=[];return je(r=je(r=je(r,Ie(e)),Ie(n)),Ie(i))},getBeforeBody:function(){return qe(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,r=[];return ut.each(t,function(t){var o={before:[],lines:[],after:[]};je(o.before,Ie(i.beforeLabel.call(n,t,e))),je(o.lines,i.label.call(n,t,e)),je(o.after,Ie(i.afterLabel.call(n,t,e))),r.push(o)}),r},getAfterBody:function(){return qe(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),n=t.footer.apply(this,arguments),i=t.afterFooter.apply(this,arguments),r=[];return je(r=je(r=je(r,Ie(e)),Ie(n)),Ie(i))},update:function(t){var e,n,i,r,o,a,s,l,u,c,f=this,d=f._options,h=f._model,p=f._model=De(d),g=f._active,v=f._data,y={xAlign:h.xAlign,yAlign:h.yAlign},m={x:h.x,y:h.y},b={width:h.width,height:h.height},_={x:h.caretX,y:h.caretY};if(g.length){p.opacity=1;var x=[],w=[];_=Me[d.position].call(f,g,f._eventPosition);var k=[];for(e=0,n=g.length;ei.width&&(r=i.width-e.width),r<0&&(r=0)),"top"===l?o+=u:o-="bottom"===l?e.height+u:e.height/2,"center"===l?"left"===s?r+=u:"right"===s&&(r-=u):"left"===s?r-=c:"right"===s&&(r+=c),{x:r,y:o}}(p,b=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,r=0,o=e.body,a=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);a+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,c=e.bodyFontSize,f=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=a*c,i+=a?(a-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*f,i+=l?(l-1)*e.footerSpacing:0;var d=0,h=function(t){r=Math.max(r,n.measureText(t).width+d)};return n.font=ut.fontString(u,e._titleFontStyle,e._titleFontFamily),ut.each(e.title,h),n.font=ut.fontString(c,e._bodyFontStyle,e._bodyFontFamily),ut.each(e.beforeBody.concat(e.afterBody),h),d=e.displayColors?c+2:0,ut.each(o,function(t){ut.each(t.before,h),ut.each(t.lines,h),ut.each(t.after,h)}),d=0,n.font=ut.fontString(f,e._footerFontStyle,e._footerFontFamily),ut.each(e.footer,h),{width:r+=2*e.xPadding,height:i}}(this,p),y=function(t,e){var n,i,r,o,a,s=t._model,l=t._chart,u=t._chart.chartArea,c="center",f="center";s.yl.height-e.height&&(f="bottom");var d=(u.left+u.right)/2,h=(u.top+u.bottom)/2;"center"===f?(n=function(t){return t<=d},i=function(t){return t>d}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),r=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},o=function(t){return t-e.width-s.caretSize-s.caretPadding<0},a=function(t){return t<=h?"top":"bottom"},n(s.x)?(c="left",r(s.x)&&(c="center",f=a(s.y))):i(s.x)&&(c="right",o(s.x)&&(c="center",f=a(s.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:c,yAlign:p.yAlign?p.yAlign:f}}(this,b),f._chart)}else p.opacity=0;return p.xAlign=y.xAlign,p.yAlign=y.yAlign,p.x=m.x,p.y=m.y,p.width=b.width,p.height=b.height,p.caretX=_.x,p.caretY=_.y,f._model=p,t&&d.custom&&d.custom.call(f,p),f},drawCaret:function(t,e){var n=this._chart.ctx,i=this.getCaretPosition(t,e,this._view);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(t,e,n){var i,r,o,a,s,l,u=n.caretSize,c=n.cornerRadius,f=n.xAlign,d=n.yAlign,h=t.x,p=t.y,g=e.width,v=e.height;if("center"===d)s=p+v/2,"left"===f?(r=(i=h)-u,o=i,a=s+u,l=s-u):(r=(i=h+g)+u,o=i,a=s-u,l=s+u);else if("left"===f?(i=(r=h+c+u)-u,o=r+u):"right"===f?(i=(r=h+g-c-u)-u,o=r+u):(i=(r=n.caretX)-u,o=r+u),"top"===d)s=(a=p)-u,l=a;else{s=(a=p+v)+u,l=a;var y=o;o=i,i=y}return{x1:i,x2:r,x3:o,y1:a,y2:s,y3:l}},drawTitle:function(t,e,n){var i=e.title;if(i.length){t.x=Le(e,e._titleAlign),n.textAlign=e._titleAlign,n.textBaseline="top";var r,o,a=e.titleFontSize,s=e.titleSpacing;for(n.fillStyle=e.titleFontColor,n.font=ut.fontString(a,e._titleFontStyle,e._titleFontFamily),r=0,o=i.length;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},r=Math.abs(e.opacity<.001)?0:e.opacity;this._options.enabled&&(e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length)&&(t.save(),t.globalAlpha=r,this.drawBackground(i,e,t,n),i.y+=e.yPadding,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],n._active="mouseout"===t.type?[]:n._chart.getElementsAtEventForMode(t,i.mode,i),(e=!ut.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}});Re.positioners=Me;var Fe=ut.valueOrDefault;function Be(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var r,o,a,s=n[t].length;for(e[t]||(e[t]=[]),r=0;r=e[t].length&&e[t].push({}),ut.merge(e[t][r],!e[t][r].type||a.type&&a.type!==e[t][r].type?[Ne.getScaleDefaults(o),a]:a)}else ut._merger(t,e,n,i)}})}function He(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var r=e[t]||{},o=n[t];"scales"===t?e[t]=Be(r,o):"scale"===t?e[t]=ut.merge(r,[Ne.getScaleDefaults(o.type),o]):ut._merger(t,e,n,i)}})}function We(t){return"top"===t||"bottom"===t}st._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var ze=function(t,e){return this.construct(t,e),this};ut.extend(ze.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=He(st.global,st[t.type],t.options||{}),t}(e);var i=Ae.acquireContext(t,e),r=i&&i.canvas,o=r&&r.height,a=r&&r.width;n.id=ut.uid(),n.ctx=i,n.canvas=r,n.config=e,n.width=a,n.height=o,n.aspectRatio=o?a/o:null,n.options=e.options,n._bufferedRender=!1,n.chart=n,n.controller=n,ze.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&r?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Se.notify(t,"beforeInit"),ut.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),Se.notify(t,"afterInit"),t},clear:function(){return ut.canvas.clear(this),this},stop:function(){return vt.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,r=n.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(ut.getMaximumWidth(i))),a=Math.max(0,Math.floor(r?o/r:ut.getMaximumHeight(i)));if((e.width!==o||e.height!==a)&&(i.width=e.width=o,i.height=e.height=a,i.style.width=o+"px",i.style.height=a+"px",ut.retinaScale(e,n.devicePixelRatio),!t)){var s={width:o,height:a};Se.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;ut.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),ut.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],r=Object.keys(n).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ut.each(i,function(e){var i=e.options,o=i.id,a=Fe(i.type,e.dtype);We(i.position)!==We(e.dposition)&&(i.position=e.dposition),r[o]=!0;var s=null;if(o in n&&n[o].type===a)(s=n[o]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Ne.getScaleConstructor(a);if(!l)return;s=new l({id:o,type:a,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),ut.each(r,function(t,e){t||delete n[e]}),t.scales=n,Ne.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t=this,e=[];return ut.each(t.data.datasets,function(n,i){var r=t.getDatasetMeta(i),o=n.type||t.config.type;if(r.type&&r.type!==o&&(t.destroyDatasetMeta(i),r=t.getDatasetMeta(i)),r.type=o,r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{var a=oe[r.type];if(void 0===a)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new a(t,i),e.push(r.controller)}},t),e},resetElements:function(){var t=this;ut.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),n=(e=i).options,ut.each(e.scales,function(t){ye.removeBox(e,t)}),n=He(st.global,st[e.config.type],n),e.options=e.config.options=n,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=n.tooltips,e.tooltip.initialize(),Se._invalidate(i),!1!==Se.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var r=i.buildOrUpdateControllers();ut.each(i.data.datasets,function(t,e){i.getDatasetMeta(e).controller.buildOrUpdateElements()},i),i.updateLayout(),i.options.animation&&i.options.animation.duration&&ut.each(r,function(t){t.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],Se.notify(i,"afterUpdate"),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){!1!==Se.notify(this,"beforeLayout")&&(ye.update(this,this.width,this.height),Se.notify(this,"afterScaleUpdate"),Se.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==Se.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);Se.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this.getDatasetMeta(t),i={meta:n,index:t,easingValue:e};!1!==Se.notify(this,"beforeDatasetDraw",[i])&&(n.controller.draw(e),Se.notify(this,"afterDatasetDraw",[i]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Se.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Se.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return de.modes.single(this,t)},getElementsAtEvent:function(t){return de.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return de.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=de.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return de.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var r=ut.log10(Math.abs(i)),o="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var a=ut.log10(Math.abs(t));o=t.toExponential(Math.floor(a)-Math.floor(r))}else{var s=-1*Math.floor(r);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(ut.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},Qe=ut.valueOrDefault,Ge=ut.valueAtIndexOrDefault;function Xe(t){var e,n,i=[];for(e=0,n=t.length;eu&&ot.maxHeight){o--;break}o++,l=a*s}t.labelRotation=o},afterCalculateTickRotation:function(){ut.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ut.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=Xe(t._ticks),i=t.options,r=i.ticks,o=i.scaleLabel,a=i.gridLines,s=t._isVisible(),l=i.position,u=t.isHorizontal(),c=ut.options._parseFont,f=c(r),d=i.gridLines.tickMarkLength;if(e.width=u?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&a.drawTicks?d:0,e.height=u?s&&a.drawTicks?d:0:t.maxHeight,o.display&&s){var h=c(o),p=ut.options.toPadding(o.padding),g=h.lineHeight+p.height;u?e.height+=g:e.width+=g}if(r.display&&s){var v=ut.longestText(t.ctx,f.string,n,t.longestTextCache),y=ut.numberOfLabelLines(n),m=.5*f.size,b=t.options.ticks.padding;if(t._maxLabelLines=y,t.longestLabelWidth=v,u){var _=ut.toRadians(t.labelRotation),x=Math.cos(_),w=Math.sin(_);e.height=Math.min(t.maxHeight,e.height+(w*v+f.lineHeight*y+m)+b),t.ctx.font=f.string;var k,O,E=Ze(t.ctx,n[0],f.string),T=Ze(t.ctx,n[n.length-1],f.string),C=t.getPixelForTick(0)-t.left,A=t.right-t.getPixelForTick(n.length-1);0!==t.labelRotation?(k="bottom"===l?x*E:x*m,O="bottom"===l?x*m:x*T):(k=E/2,O=T/2),t.paddingLeft=Math.max(k-C,0)+3,t.paddingRight=Math.max(O-A,0)+3}else r.mirror?v=0:v+=b+m,e.width=Math.min(t.maxWidth,e.width+v),t.paddingTop=f.size/2,t.paddingBottom=f.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){ut.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ut.isNullOrUndef(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:ut.noop,getPixelForValue:ut.noop,getValueForPixel:ut.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),r=i*t+e.paddingLeft;return n&&(r+=i/2),e.left+r+(e.isFullWidth()?e.margins.left:0)}return e.top+t*((e.height-(e.paddingTop+e.paddingBottom))/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;return e.isHorizontal()?e.left+((e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft)+(e.isFullWidth()?e.margins.left:0):e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i=this,r=i.isHorizontal(),o=t.length,a=!1,s=i.options.ticks.minor.maxTicksLimit,l=i._tickSize()*(o-1),u=r?i.width-(i.paddingLeft+i.paddingRight):i.height-(i.paddingTop+i.PaddingBottom),c=[];for(l>u&&(a=1+Math.floor(l/u)),o>s&&(a=Math.max(a,1+Math.floor(o/s))),e=0;e1&&e%a>0&&delete n.label,c.push(n);return c},_tickSize:function(){var t=this,e=t.isHorizontal(),n=t.options.ticks.minor,i=ut.toRadians(t.labelRotation),r=Math.abs(Math.cos(i)),o=Math.abs(Math.sin(i)),a=n.autoSkipPadding||0,s=t.longestLabelWidth+a||0,l=ut.options._parseFont(n),u=t._maxLabelLines*l.lineHeight+a||0;return e?u*r>s*o?s/r:u/o:u*o0&&i>0&&(t.min=0)}var r=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(t.min=null===t.min?e.suggestedMin:Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(t.max=null===t.max?e.suggestedMax:Math.max(t.max,e.suggestedMax)),r!==o&&t.min>=t.max&&(r?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:ut.noop,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:ut.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=function(e,n){var r,o,a,s,l=[],u=i.stepSize,c=u||1,f=i.maxTicks-1,d=i.min,h=i.max,p=i.precision,g=t.min,v=t.max,y=ut.niceNum((v-g)/f/c)*c;if(y<1e-14&&en(d)&&en(h))return[g,v];(s=Math.ceil(v/y)-Math.floor(g/y))>f&&(y=ut.niceNum(s*y/f/c)*c),u||en(p)?r=Math.pow(10,ut._decimalPlaces(y)):(r=Math.pow(10,p),y=Math.ceil(y*r)/r),o=Math.floor(g/y)*y,a=Math.ceil(v/y)*y,u&&(!en(d)&&ut.almostWhole(d/y,y/1e3)&&(o=d),!en(h)&&ut.almostWhole(h/y,y/1e3)&&(a=h)),s=ut.almostEquals(s=(a-o)/y,Math.round(s),y/1e3)?Math.round(s):Math.ceil(s),o=Math.round(o*r)/r,a=Math.round(a*r)/r,l.push(en(d)?o:d);for(var m=1;mt.max&&(t.max=i))})});t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=ut.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this,n=e.start,i=+e.getRightValue(t),r=e.end-n;return e.isHorizontal()?e.left+e.width/r*(i-n):e.bottom-e.height/r*(i-n)},getValueForPixel:function(t){var e=this,n=e.isHorizontal();return e.start+(n?t-e.left:e.bottom-t)/(n?e.width:e.height)*(e.end-e.start)},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});on._defaults=rn;var an=ut.valueOrDefault,sn={position:"left",ticks:{callback:$e.formatters.logarithmic}};function ln(t,e){return ut.isFinite(t)&&t>=0?t:e}var un=Je.extend({determineDataLimits:function(){var t=this,e=t.options,n=t.chart,i=n.data.datasets,r=t.isHorizontal();function o(e){return r?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var a=e.stacked;if(void 0===a&&ut.each(i,function(t,e){if(!a){var i=n.getDatasetMeta(e);n.isDatasetVisible(e)&&o(i)&&void 0!==i.stack&&(a=!0)}}),e.stacked||a){var s={};ut.each(i,function(i,r){var a=n.getDatasetMeta(r),l=[a.type,void 0===e.stacked&&void 0===a.stack?r:"",a.stack].join(".");n.isDatasetVisible(r)&&o(a)&&(void 0===s[l]&&(s[l]=[]),ut.each(i.data,function(e,n){var i=s[l],r=+t.getRightValue(e);isNaN(r)||a.data[n].hidden||r<0||(i[n]=i[n]||0,i[n]+=r)}))}),ut.each(s,function(e){if(e.length>0){var n=ut.min(e),i=ut.max(e);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?i:Math.max(t.max,i)}})}else ut.each(i,function(e,i){var r=n.getDatasetMeta(i);n.isDatasetVisible(i)&&o(r)&&ut.each(e.data,function(e,n){var i=+t.getRightValue(e);isNaN(i)||r.data[n].hidden||i<0||(null===t.min?t.min=i:it.max&&(t.max=i),0!==i&&(null===t.minNotZero||i0?t.min:t.max<1?Math.pow(10,Math.floor(ut.log10(t.max))):1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:ln(e.min),max:ln(e.max)},r=t.ticks=function(t,e){var n,i,r=[],o=an(t.min,Math.pow(10,Math.floor(ut.log10(e.min)))),a=Math.floor(ut.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,a));0===o?(n=Math.floor(ut.log10(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),r.push(o),o=i*Math.pow(10,n)):(n=Math.floor(ut.log10(o)),i=Math.floor(o/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{r.push(o),10==++i&&(i=1,l=++n>=0?1:l),o=Math.round(i*Math.pow(10,n)*l)/l}while(nr?{start:e-n,end:e}:{start:e,end:e+n}}function yn(t){return 0===t||180===t?"center":t<180?"left":"right"}function mn(t,e,n,i){var r,o,a=n.y+i/2;if(ut.isArray(e))for(r=0,o=e.length;r270||t<90)&&(n.y-=e.h)}function _n(t){return ut.isNumber(t)?t:0}var xn=nn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=gn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;ut.each(e.data.datasets,function(r,o){if(e.isDatasetVisible(o)){var a=e.getDatasetMeta(o);ut.each(r.data,function(e,r){var o=+t.getRightValue(e);isNaN(o)||a.data[r].hidden||(n=Math.min(o,n),i=Math.max(o,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/gn(this.options))},convertTicksToLabels:function(){var t=this;nn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(t.options.pointLabels.callback,t)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,r=ut.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},a={};t.ctx.font=r.string,t._pointLabelSizes=[];var s,l,u,c=pn(t);for(e=0;eo.r&&(o.r=h.end,a.r=f),p.starto.b&&(o.b=p.end,a.b=f)}t.setReductions(t.drawingArea,o,a)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,r=e.l/Math.sin(n.l),o=Math.max(e.r-i.width,0)/Math.sin(n.r),a=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);r=_n(r),o=_n(o),a=_n(a),s=_n(s),i.drawingArea=Math.min(Math.floor(t-(r+o)/2),Math.floor(t-(a+s)/2)),i.setCenterPoint(r,o,a,s)},setCenterPoint:function(t,e,n,i){var r=this,o=n+r.drawingArea,a=r.height-r.paddingTop-i-r.drawingArea;r.xCenter=Math.floor((t+r.drawingArea+(r.width-e-r.drawingArea))/2+r.left),r.yCenter=Math.floor((o+a)/2+r.top+r.paddingTop)},getIndexAngle:function(t){return t*(2*Math.PI/pn(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,i=e.ticks;if(e.display){var r=t.ctx,o=this.getIndexAngle(0),a=ut.options._parseFont(i);(e.angleLines.display||e.pointLabels.display)&&function(t){var e=t.ctx,n=t.options,i=n.angleLines,r=n.gridLines,o=n.pointLabels,a=cn(i.lineWidth,r.lineWidth),s=cn(i.color,r.color),l=gn(n);e.save(),e.lineWidth=a,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(dn([i.borderDash,r.borderDash,[]])),e.lineDashOffset=dn([i.borderDashOffset,r.borderDashOffset,0]));var u=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),c=ut.options._parseFont(o);e.font=c.string,e.textBaseline="middle";for(var f=pn(t)-1;f>=0;f--){if(i.display&&a&&s){var d=t.getPointPosition(f,u);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(d.x,d.y),e.stroke()}if(o.display){var h=t.getPointPosition(f,u+(0===f?l/2:0)+5),p=fn(o.fontColor,f,st.global.defaultFontColor);e.fillStyle=p;var g=t.getIndexAngle(f),v=ut.toDegrees(g);e.textAlign=yn(v),bn(v,t._pointLabelSizes[f],h),mn(e,t.pointLabels[f]||"",h,c.lineHeight)}}e.restore()}(t),ut.each(t.ticks,function(e,s){if(s>0||i.reverse){var l=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(n.display&&0!==s&&function(t,e,n,i){var r,o=t.ctx,a=e.circular,s=pn(t),l=fn(e.color,i-1),u=fn(e.lineWidth,i-1);if((a||s)&&l&&u){if(o.save(),o.strokeStyle=l,o.lineWidth=u,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),a)o.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{r=t.getPointPosition(0,n),o.moveTo(r.x,r.y);for(var c=1;c=0&&a<=s;){if(o=t[i=a+s>>1],!(r=t[i-1]||null))return{lo:null,hi:o};if(o[e]n))return{lo:r,hi:o};s=i-1}}return{lo:o,hi:null}}(t,e,n),o=r.lo?r.hi?r.lo:t[t.length-2]:t[0],a=r.lo?r.hi?r.hi:t[t.length-1]:t[1],s=a[e]-o[e];return o[i]+(a[i]-o[i])*(s?(n-o[e])/s:0)}function Nn(t,e){var n=t._adapter,i=t.options.time,r=i.parser,o=r||i.format,a=e;return"function"==typeof r&&(a=r(a)),ut.isFinite(a)||(a="string"==typeof o?n.parse(a,o):n.parse(a)),null!==a?+a:(r||"function"!=typeof o||(a=o(e),ut.isFinite(a)||(a=n.parse(a))),a)}function Pn(t,e){if(ut.isNullOrUndef(e))return null;var n=t.options.time,i=Nn(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function Mn(t){for(var e=Tn.indexOf(t)+1,n=Tn.length;e=r&&n<=o&&u.push(n);return i.min=r,i.max=o,i._unit=s.unit||function(t,e,n,i,r){var o,a;for(o=Tn.length-1;o>=Tn.indexOf(n);o--)if(En[a=Tn[o]].common&&t._adapter.diff(r,i,a)>=e.length)return a;return Tn[n?Tn.indexOf(n):0]}(i,u,s.minUnit,i.min,i.max),i._majorUnit=Mn(i._unit),i._table=function(t,e,n,i){if("linear"===a.distribution||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var r,o,s,l,u,c=[],f=[e];for(r=0,o=t.length;re&&l=0&&t0?o:1}});jn._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var In={category:tn,linear:on,logarithmic:un,radialLinear:xn,time:jn},Dn={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"};Ye._date.override("function"==typeof t?{_id:"moment",formats:function(){return Dn},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t.duration(t(e).diff(t(n))).as(i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),st._set("global",{plugins:{filler:{propagate:!0}}});var Ln={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),r=i&&n.isDatasetVisible(e)&&i.dataset._children||[],o=r.length||0;return o?function(t,e){return e=n)&&i;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function Rn(t){var e,n=t.el._model||{},i=t.el._scale||{},r=t.fill,o=null;if(isFinite(r))return null;if("start"===r?o=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===r?o=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:i.getBasePosition?o=i.getBasePosition():i.getBasePixel&&(o=i.getBasePixel()),void 0!==o&&null!==o){if(void 0!==o.x&&void 0!==o.y)return o;if(ut.isFinite(o))return{x:(e=i.isHorizontal())?o:null,y:e?null:o}}return null}function Fn(t,e,n){var i,r=t[e].fill,o=[e];if(!n)return r;for(;!1!==r&&-1===o.indexOf(r);){if(!isFinite(r))return r;if(!(i=t[r]))return!1;if(i.visible)return r;o.push(r),r=i.fill}return!1}function Bn(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),Ln[n](t))}function Hn(t){return t&&!t.skip}function Wn(t,e,n,i,r){var o;if(i&&r){for(t.moveTo(e[0].x,e[0].y),o=1;o0;--o)ut.canvas.lineTo(t,n[o],n[o-1],!0)}}var zn={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,r,o,a=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;ie?e:t.boxWidth}st._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,r=i.getDatasetMeta(n);r.hidden=null===r.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return ut.isArray(e.datasets)?e.datasets.map(function(e,n){return{text:e.label,fillStyle:ut.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(n),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:n}},this):[]}}},legendCallback:function(t){var e=[];e.push('
    ');for(var n=0;n'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("");return e.push("
"),e.join("")}});var Yn=ht.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:Vn,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Vn,beforeSetDimensions:Vn,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Vn,beforeBuildLabels:Vn,buildLabels:function(){var t=this,e=t.options.labels||{},n=ut.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:Vn,beforeFit:Vn,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,r=t.ctx,o=ut.options._parseFont(n),a=o.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i)if(r.font=o.string,u){var c=t.lineWidths=[0],f=0;r.textAlign="left",r.textBaseline="top",ut.each(t.legendItems,function(t,e){var i=Kn(n,a)+a/2+r.measureText(t.text).width;(0===e||c[c.length-1]+i+n.padding>l.width)&&(f+=a+n.padding,c[c.length-(e>0?0:1)]=n.padding),s[e]={left:0,top:0,width:i,height:a},c[c.length-1]+=i+n.padding}),l.height+=f}else{var d=n.padding,h=t.columnWidths=[],p=n.padding,g=0,v=0,y=a+d;ut.each(t.legendItems,function(t,e){var i=Kn(n,a)+a/2+r.measureText(t.text).width;e>0&&v+y>l.height-d&&(p+=g+n.padding,h.push(g),g=0,v=0),g=Math.max(g,i),v+=y,s[e]={left:0,top:0,width:i,height:a}}),p+=g,h.push(g),l.width+=p}t.width=l.width,t.height=l.height},afterFit:Vn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=st.global,r=i.defaultColor,o=i.elements.line,a=t.width,s=t.lineWidths;if(e.display){var l,u=t.ctx,c=Un(n.fontColor,i.defaultFontColor),f=ut.options._parseFont(n),d=f.size;u.textAlign="left",u.textBaseline="middle",u.lineWidth=.5,u.strokeStyle=c,u.fillStyle=c,u.font=f.string;var h=Kn(n,d),p=t.legendHitBoxes,g=t.isHorizontal();l=g?{x:t.left+(a-s[0])/2+n.padding,y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+n.padding,line:0};var v=d+n.padding;ut.each(t.legendItems,function(i,c){var f=u.measureText(i.text).width,y=h+d/2+f,m=l.x,b=l.y;g?c>0&&m+y+n.padding>t.left+t.minSize.width&&(b=l.y+=v,l.line++,m=l.x=t.left+(a-s[l.line])/2+n.padding):c>0&&b+v>t.top+t.minSize.height&&(m=l.x=m+t.columnWidths[l.line]+n.padding,b=l.y=t.top+n.padding,l.line++),function(t,n,i){if(!(isNaN(h)||h<=0)){u.save();var a=Un(i.lineWidth,o.borderWidth);if(u.fillStyle=Un(i.fillStyle,r),u.lineCap=Un(i.lineCap,o.borderCapStyle),u.lineDashOffset=Un(i.lineDashOffset,o.borderDashOffset),u.lineJoin=Un(i.lineJoin,o.borderJoinStyle),u.lineWidth=a,u.strokeStyle=Un(i.strokeStyle,r),u.setLineDash&&u.setLineDash(Un(i.lineDash,o.borderDash)),e.labels&&e.labels.usePointStyle){var s=h*Math.SQRT2/2;ut.canvas.drawPoint(u,i.pointStyle,s,t+h/2,n+d/2)}else 0!==a&&u.strokeRect(t,n,h,d),u.fillRect(t,n,h,d);u.restore()}}(m,b,i),p[c].left=m,p[c].top=b,function(t,e,n,i){var r=d/2,o=h+r+t,a=e+r;u.fillText(n.text,o,a),n.hidden&&(u.beginPath(),u.lineWidth=2,u.moveTo(o,a),u.lineTo(o+i,a),u.stroke())}(m,b,i,f),g?l.x+=y+n.padding:l.y+=v})}},_getLegendItemAt:function(t,e){var n,i,r,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(r=o.legendHitBoxes,n=0;n=(i=r[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return o.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,r="mouseup"===t.type?"click":t.type;if("mousemove"===r){if(!i.onHover&&!i.onLeave)return}else{if("click"!==r)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===r?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function $n(t,e){var n=new Yn({ctx:t.ctx,options:e,chart:t});ye.configure(t,n,e),ye.addBox(t,n),t.legend=n}var Qn={id:"legend",_element:Yn,beforeInit:function(t){var e=t.options.legend;e&&$n(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(ut.mergeIf(e,st.global.legend),n?(ye.configure(t,n,e),n.options=e):$n(t,e)):n&&(ye.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Gn=ut.noop;st._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Xn=ht.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Gn,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Gn,beforeSetDimensions:Gn,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Gn,beforeBuildLabels:Gn,buildLabels:Gn,afterBuildLabels:Gn,beforeFit:Gn,fit:function(){var t=this,e=t.options,n=e.display,i=t.minSize,r=ut.isArray(e.text)?e.text.length:1,o=ut.options._parseFont(e),a=n?r*o.lineHeight+2*e.padding:0;t.isHorizontal()?(i.width=t.maxWidth,i.height=a):(i.width=a,i.height=t.maxHeight),t.width=i.width,t.height=i.height},afterFit:Gn,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,r,o,a=ut.options._parseFont(n),s=a.lineHeight,l=s/2+n.padding,u=0,c=t.top,f=t.left,d=t.bottom,h=t.right;e.fillStyle=ut.valueOrDefault(n.fontColor,st.global.defaultFontColor),e.font=a.string,t.isHorizontal()?(r=f+(h-f)/2,o=c+l,i=h-f):(r="left"===n.position?f+l:h-l,o=c+(d-c)/2,i=d-c,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(r,o),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var p=n.text;if(ut.isArray(p))for(var g=0,v=0;v=0;i--){var r=t[i];if(e(r))return r}},ut.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ut.almostEquals=function(t,e,n){return Math.abs(t-e)t},ut.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},ut.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},ut.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},ut.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e},ut.toRadians=function(t){return t*(Math.PI/180)},ut.toDegrees=function(t){return t*(180/Math.PI)},ut._decimalPlaces=function(t){if(ut.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},ut.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:r}},ut.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ut.aliasPixel=function(t){return t%2==0?0:.5},ut._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,r=n/2;return Math.round((e-r)*i)/i+r},ut.splineCurve=function(t,e,n,i){var r=t.skip?e:t,o=e,a=n.skip?e:n,s=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),l=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),u=s/(s+l),c=l/(s+l),f=i*(u=isNaN(u)?0:u),d=i*(c=isNaN(c)?0:c);return{previous:{x:o.x-f*(a.x-r.x),y:o.y-f*(a.y-r.y)},next:{x:o.x+d*(a.x-r.x),y:o.y+d*(a.y-r.y)}}},ut.EPSILON=Number.EPSILON||1e-14,ut.splineCurveMonotone=function(t){var e,n,i,r,o,a,s,l,u,c=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),f=c.length;for(e=0;e0?c[e-1]:null,(r=e0?c[e-1]:null,r=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ut.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ut.niceNum=function(t,e){var n=Math.floor(ut.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},ut.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},ut.getRelativePosition=function(t,e){var n,i,r=t.originalEvent||t,o=t.target||t.srcElement,a=o.getBoundingClientRect(),s=r.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=r.clientX,i=r.clientY);var l=parseFloat(ut.getStyle(o,"padding-left")),u=parseFloat(ut.getStyle(o,"padding-top")),c=parseFloat(ut.getStyle(o,"padding-right")),f=parseFloat(ut.getStyle(o,"padding-bottom")),d=a.bottom-a.top-u-f;return{x:n=Math.round((n-a.left-l)/(a.right-a.left-l-c)*o.width/e.currentDevicePixelRatio),y:i=Math.round((i-a.top-u)/d*o.height/e.currentDevicePixelRatio)}},ut.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},ut.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},ut._calculatePadding=function(t,e,n){return(e=ut.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},ut._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},ut.getMaximumWidth=function(t){var e=ut._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-ut._calculatePadding(e,"padding-left",n)-ut._calculatePadding(e,"padding-right",n),r=ut.getConstraintWidth(t);return isNaN(r)?i:Math.min(i,r)},ut.getMaximumHeight=function(t){var e=ut._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-ut._calculatePadding(e,"padding-top",n)-ut._calculatePadding(e,"padding-bottom",n),r=ut.getConstraintHeight(t);return isNaN(r)?i:Math.min(i,r)},ut.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},ut.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,r=t.height,o=t.width;i.height=r*n,i.width=o*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=r+"px",i.style.width=o+"px")}},ut.fontString=function(t,e,n){return e+" "+t+"px "+n},ut.longestText=function(t,e,n,i){var r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.font=e;var a=0;ut.each(n,function(e){void 0!==e&&null!==e&&!0!==ut.isArray(e)?a=ut.measureText(t,r,o,a,e):ut.isArray(e)&&ut.each(e,function(e){void 0===e||null===e||ut.isArray(e)||(a=ut.measureText(t,r,o,a,e))})});var s=o.length/2;if(s>n.length){for(var l=0;li&&(i=o),i},ut.numberOfLabelLines=function(t){var e=1;return ut.each(t,function(t){ut.isArray(t)&&t.length>e&&(e=t.length)}),e},ut.color=Y?function(t){return t instanceof CanvasGradient&&(t=st.global.defaultColor),Y(t)}:function(t){return console.error("Color.js not found!"),t},ut.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:ut.color(t).saturate(.5).darken(.1).rgbString()}}(),Ve._adapters=Ye,Ve.Animation=gt,Ve.animationService=vt,Ve.controllers=oe,Ve.DatasetController=xt,Ve.defaults=st,Ve.Element=ht,Ve.elements=Dt,Ve.Interaction=de,Ve.layouts=ye,Ve.platform=Ae,Ve.plugins=Se,Ve.Scale=Je,Ve.scaleService=Ne,Ve.Ticks=$e,Ve.Tooltip=Re,Ve.helpers.each(In,function(t,e){Ve.scaleService.registerScaleType(e,t,t._defaults)}),Jn)Jn.hasOwnProperty(ii)&&Ve.plugins.register(Jn[ii]);Ve.platform.initialize();var ri=Ve;return"undefined"!=typeof window&&(window.Chart=Ve),Ve.Chart=Ve,Ve.Legend=Jn.legend._element,Ve.Title=Jn.title._element,Ve.pluginService=Ve.plugins,Ve.PluginBase=Ve.Element.extend({}),Ve.canvasHelpers=Ve.helpers.canvas,Ve.layoutService=Ve.layouts,Ve.LinearScaleBase=nn,Ve.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(t){Ve[t]=function(e,n){return new Ve(e,Ve.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}}),ri}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=109)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(17),r=n(18),o=n(19),a=n(45),s=n(46),l=n(47),u=n(48),c=n(49),f=n(12),d=n(32),h=n(33),p=n(31),g=n(1);e.default={Scope:g.Scope,create:g.create,find:g.find,query:g.query,register:g.register,Container:i.default,Format:r.default,Leaf:o.default,Embed:u.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:c.default,Attributor:{Attribute:f.default,Class:d.default,Style:h.default,Store:p.default}}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e){var n=this;return(n=t.call(this,e="[Parchment] "+e)||this).message=e,n.name=n.constructor.name,n}return r(e,t),e}(Error);e.ParchmentError=o;var a,s={},l={},u={},c={};function f(t,e){var n;if(void 0===e&&(e=a.ANY),"string"==typeof t)n=c[t]||s[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=c.text;else if("number"==typeof t)t&a.LEVEL&a.BLOCK?n=c.block:t&a.LEVEL&a.INLINE&&(n=c.inline);else if(t instanceof HTMLElement){var i=(t.getAttribute("class")||"").split(/\s+/);for(var r in i)if(n=l[i[r]])break;n=n||u[t.tagName]}return null==n?null:e&a.LEVEL&n.scope&&e&a.TYPE&n.scope?n:null}e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(a=e.Scope||(e.Scope={})),e.create=function(t,e){var n=f(t);if(null==n)throw new o("Unable to create "+t+" blot");return new n(t instanceof Node||t.nodeType===Node.TEXT_NODE?t:n.create(e),e)},e.find=function t(n,i){return void 0===i&&(i=!1),null==n?null:null!=n[e.DATA_KEY]?n[e.DATA_KEY].blot:i?t(n.parentNode,i):null},e.query=f,e.register=function t(){for(var e=[],n=0;n1)return e.map(function(e){return t(e)});var i=e[0];if("string"!=typeof i.blotName&&"string"!=typeof i.attrName)throw new o("Invalid definition");if("abstract"===i.blotName)throw new o("Cannot register abstract class");return c[i.blotName||i.attrName]=i,"string"==typeof i.keyName?s[i.keyName]=i:(null!=i.className&&(l[i.className]=i),null!=i.tagName&&(i.tagName=Array.isArray(i.tagName)?i.tagName.map(function(t){return t.toUpperCase()}):i.tagName.toUpperCase(),(Array.isArray(i.tagName)?i.tagName:[i.tagName]).forEach(function(t){null!=u[t]&&null!=i.className||(u[t]=i)}))),i}},function(t,e,n){var i=n(51),r=n(11),o=n(3),a=n(20),s=String.fromCharCode(0),l=function(t){this.ops=Array.isArray(t)?t:null!=t&&Array.isArray(t.ops)?t.ops:[]};l.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},l.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},l.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},l.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=o(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&"object"!=typeof(n=this.ops[(e-=1)-1]))return this.ops.unshift(t),this;if(r(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},l.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},l.prototype.filter=function(t){return this.ops.filter(t)},l.prototype.forEach=function(t){this.ops.forEach(t)},l.prototype.map=function(t){return this.ops.map(t)},l.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(i){(t(i)?e:n).push(i)}),[e,n]},l.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},l.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+a.length(e):e.delete?t-e.delete:t},0)},l.prototype.length=function(){return this.reduce(function(t,e){return t+a.length(e)},0)},l.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],i=a.iterator(this.ops),r=0;r0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},l.prototype.diff=function(t,e){if(this.ops===t.ops)return new l;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")}).join("")}),o=new l,u=i(n[0],n[1],e),c=a.iterator(this.ops),f=a.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case i.INSERT:n=Math.min(f.peekLength(),e),o.push(f.next(n));break;case i.DELETE:n=Math.min(e,c.peekLength()),c.next(n),o.delete(n);break;case i.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var s=c.next(n),l=f.next(n);r(s.insert,l.insert)?o.retain(n,a.attributes.diff(s.attributes,l.attributes)):o.push(l).delete(n)}e-=n}}),o.chop()},l.prototype.eachLine=function(t,e){e=e||"\n";for(var n=a.iterator(this.ops),i=new l,r=0;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),s=a.length(o)-n.peekLength(),u="string"==typeof o.insert?o.insert.indexOf(e,s)-s:-1;if(u<0)i.push(n.next());else if(u>0)i.push(n.next(u));else{if(!1===t(i,n.next(1).attributes||{},r))return;r+=1,i=new l}}i.length()>0&&t(i,{},r)},l.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=a.iterator(this.ops),i=a.iterator(t.ops),r=new l;n.hasNext()||i.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===i.peekType())if("insert"===i.peekType())r.push(i.next());else{var o=Math.min(n.peekLength(),i.peekLength()),s=n.next(o),u=i.next(o);if(s.delete)continue;u.delete?r.push(u):r.retain(o,a.attributes.transform(s.attributes,u.attributes,e))}else r.retain(a.length(n.next()));return r.chop()},l.prototype.transformPosition=function(t,e){e=!!e;for(var n=a.iterator(this.ops),i=0;n.hasNext()&&i<=t;){var r=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(i0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var i=this.clone();return 0===t?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}var o=r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}();function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,o.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:y(t.parent,e))}v.blotName="block",v.tagName="P",v.defaultChild="break",v.allowedChildren=[u.default,s.default.Embed,c.default],e.bubbleFormats=y,e.BlockEmbed=g,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),this.options=_(e,i),this.container=this.options.container,null==this.container)return m.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new l.default,this.scroll=c.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(l.default.events.EDITOR_CHANGE,function(t){t===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(l.default.events.SCROLL_UPDATE,function(t,e){var i=n.selection.lastRange,r=i&&0===i.length?i.index:void 0;x.call(n,function(){return n.editor.update(null,e,r)},t)});var o=this.clipboard.convert("
"+r+"


");this.setContents(o),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),p.default.level(t)}},{key:"find",value:function(t){return t.__quill||c.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&m.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var r=t.attrName||t.blotName;"string"==typeof r?this.register("formats/"+r,t,e):Object.keys(t).forEach(function(i){n.register(i,t[i],e)})}else null==this.imports[t]||i||m.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?c.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),o(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;(t=document.createElement("div")).classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var i=this,o=w(t,e,n),a=r(o,4);return x.call(this,function(){return i.editor.deleteText(t,e)},n=a[3],t=a[0],-1*(e=a[1]))}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this;return x.call(this,function(){var i=n.getSelection(!0),r=new a.default;if(null==i)return r;if(c.default.query(t,c.default.Scope.BLOCK))r=n.editor.formatLine(i.index,i.length,y({},t,e));else{if(0===i.length)return n.selection.format(t,e),r;r=n.editor.formatText(i.index,i.length,y({},t,e))}return n.setSelection(i,l.default.sources.SILENT),r},arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API)}},{key:"formatLine",value:function(t,e,n,i,o){var a,s=this,l=w(t,e,n,i,o),u=r(l,4);return e=u[1],a=u[2],x.call(this,function(){return s.editor.formatLine(t,e,a)},o=u[3],t=u[0],0)}},{key:"formatText",value:function(t,e,n,i,o){var a,s=this,l=w(t,e,n,i,o),u=r(l,4);return e=u[1],a=u[2],x.call(this,function(){return s.editor.formatText(t,e,a)},o=u[3],t=u[0],0)}},{key:"getBounds",value:function(t){var e;e="number"==typeof t?this.selection.getBounds(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0):this.selection.getBounds(t.index,t.length);var n=this.container.getBoundingClientRect();return{bottom:e.bottom-n.top,height:e.height,left:e.left-n.left,right:e.right-n.left,top:e.top-n.top,width:e.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=w(t,e),i=r(n,2);return this.editor.getContents(t=i[0],e=i[1])}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0);return"number"==typeof t?this.editor.getFormat(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=w(t,e),i=r(n,2);return this.editor.getText(t=i[0],e=i[1])}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,i){var r=this;return x.call(this,function(){return r.editor.insertEmbed(e,n,i)},arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API,e)}},{key:"insertText",value:function(t,e,n,i,o){var a,s=this,l=w(t,0,n,i,o),u=r(l,4);return a=u[2],x.call(this,function(){return s.editor.insertText(t,e,a)},o=u[3],t=u[0],e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var i=this,o=w(t,e,n),a=r(o,4);return e=a[1],x.call(this,function(){return i.editor.removeFormat(t,e)},n=a[3],t=a[0])}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this;return x.call(this,function(){t=new a.default(t);var n=e.getLength(),i=e.editor.deleteText(0,n),r=e.editor.applyDelta(t),o=r.ops[r.ops.length-1];return null!=o&&"string"==typeof o.insert&&"\n"===o.insert[o.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),r.delete(1)),i.compose(r)},arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API)}},{key:"setSelection",value:function(e,n,i){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=w(e,n,i),a=r(o,4);i=a[3],this.selection.setRange(new f.Range(e=a[0],n=a[1]),i),i!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return x.call(this,function(){return t=new a.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();function _(t,e){if((e=(0,h.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e)).theme&&e.theme!==b.DEFAULTS.theme){if(e.theme=b.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=g.default;var n=(0,h.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach(function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach(function(e){!0===t.modules[e]&&(t.modules[e]={})})});var i=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce(function(t,e){var n=b.import("modules/"+e);return null==n?m.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t},{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,h.default)(!0,{},b.DEFAULTS,{modules:i},n,e),["bounds","container","scrollingContainer"].forEach(function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),e.modules=Object.keys(e.modules).reduce(function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t},{}),e}function x(t,e,n,i){if(this.options.strict&&!this.isEnabled()&&e===l.default.sources.USER)return new a.default;var r=null==n?null:this.getSelection(),o=this.editor.delta,s=t();if(null!=r&&(!0===n&&(n=r.index),null==i?r=k(r,s,e):0!==i&&(r=k(r,n,i,e)),this.setSelection(r,l.default.sources.SILENT)),s.length()>0){var u,c,f=[l.default.events.TEXT_CHANGE,s,o,e];(u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(f)),e!==l.default.sources.SILENT&&(c=this.emitter).emit.apply(c,f)}return s}function w(t,e,n,r,o){var a={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===("undefined"==typeof n?"undefined":i(n))?(a=n,o=r):"string"==typeof n&&(null!=r?a[n]=r:o=n),[t,e,a,o=o||l.default.sources.API]}function k(t,e,n,i){if(null==t)return null;var o=void 0,s=void 0;if(e instanceof a.default){var u=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,i!==l.default.sources.USER)}),c=r(u,2);o=c[0],s=c[1]}else{var d=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),h=r(d,2);o=h[0],s=h[1]}return new f.Range(o,s-o)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=l.default.events,b.sources=l.default.sources,b.version="1.3.6",b.imports={delta:a.default,parchment:c.default,"core/module":u.default,"core/theme":g.default},e.expandConfig=_,e.overload=w,e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var i=e.order.indexOf(t),r=e.order.indexOf(n);return i>=0||r>=0?i-r:t===n?0:t1?e-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:{};!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),this.quill=e,this.options=n};i.DEFAULTS={},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=["error","warn","log","info"],r="warn";function o(t){if(i.indexOf(t)<=i.indexOf(r)){for(var e,n=arguments.length,o=Array(n>1?n-1:0),a=1;a=0;u--)if(f[u]!=d[u])return!1;for(u=f.length-1;u>=0;u--)if(!a(t[c=f[u]],e[c],n))return!1;return typeof t==typeof e}(t,e,n))};function s(t){return null===t||void 0===t}function l(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e,this.scope=null!=n.scope?n.scope&i.Scope.LEVEL|i.Scope.TYPE&i.Scope.ATTRIBUTE:i.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,function(t){return t.name})},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=i.query(t,i.Scope.BLOT&(this.scope|i.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function t(t,e){for(var n=0;n=t+n)){var a=this.newlineIndex(t,!0)+1,l=o-a+1,u=this.isolate(a,l),c=u.next;u.format(i,r),c instanceof e&&c.formatAt(0,t-a+n-l,i,r)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(c.default,t),o=i(r,2);o[0].insertAt(o[1],e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=s.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof s.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}();v.blotName="code-block",v.tagName="PRE",v.TAB=" ",e.Code=g,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n=o&&!h.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,h);var p=e.scroll.line(t),g=r(p,2),y=g[0],m=g[1],b=(0,v.default)({},(0,f.bubbleFormats)(y));if(y instanceof d.default){var _=y.descendant(l.default.Leaf,m),x=r(_,1);b=(0,v.default)(b,(0,f.bubbleFormats)(x[0]))}c=s.default.attributes.diff(b,c)||{}}else if("object"===i(a.insert)){var w=Object.keys(a.insert)[0];if(null==w)return t;e.scroll.insertAt(t,w,a.insert[w])}o+=u}return Object.keys(c).forEach(function(n){e.scroll.formatAt(t,u,n,c[n])}),t+u},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new a.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(i).forEach(function(r){if(null==n.scroll.whitelist||n.scroll.whitelist[r]){var o=n.scroll.lines(t,Math.max(e,1)),a=e;o.forEach(function(e){var o=e.length();if(e instanceof u.default){var s=t-e.offset(n.scroll),l=e.newlineIndex(s+a)-s+1;e.formatAt(s,l,r,i[r])}else e.format(r,i[r]);a-=o})}}),this.scroll.optimize(),this.update((new a.default).retain(t).retain(e,(0,p.default)(i)))}},{key:"formatText",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(i).forEach(function(r){n.scroll.formatAt(t,e,r,i[r])}),this.update((new a.default).retain(t).retain(e,(0,p.default)(i)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new a.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],i=[];0===e?this.scroll.path(t).forEach(function(t){var e=r(t,1)[0];e instanceof d.default?n.push(e):e instanceof l.default.Leaf&&i.push(e)}):(n=this.scroll.lines(t,e),i=this.scroll.descendants(l.default.Leaf,t,e));var o=[n,i].map(function(t){if(0===t.length)return{};for(var e=(0,f.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=_((0,f.bubbleFormats)(n),e)}return e});return v.default.apply(v.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new a.default).retain(t).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(i).forEach(function(r){n.scroll.formatAt(t,e.length,r,i[r])}),this.update((new a.default).retain(t).insert(e,(0,p.default)(i)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===d.default.blotName&&!(t.children.length>1)&&t.children.head instanceof h.default}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),i=this.scroll.line(t+e),o=r(i,2),s=o[0],l=o[1],c=0,f=new a.default;null!=s&&(c=s instanceof u.default?s.newlineIndex(l)-l+1:s.length()-l,f=s.delta().slice(l,l+c-1).insert("\n"));var d=this.getContents(t,e+c).diff((new a.default).insert(n).concat(f)),h=(new a.default).retain(t).concat(d);return this.applyDelta(h)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(m)&&l.default.find(e[0].target)){var r=l.default.find(e[0].target),o=(0,f.bubbleFormats)(r),s=r.offset(this.scroll),u=e[0].oldValue.replace(c.default.CONTENTS,""),d=(new a.default).insert(u),h=(new a.default).insert(r.value());t=(new a.default).retain(s).concat(d.diff(h,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,o):t.push(e)},new a.default),this.delta=i.compose(t)}else this.delta=this.getDelta(),t&&(0,g.default)(i.compose(t),this.delta)||(t=i.diff(this.delta,n));return t}}]),t}();function _(t,e){return Object.keys(e).reduce(function(n,i){return null==t[i]?n:(e[i]===t[i]?n[i]=e[i]:Array.isArray(e[i])?e[i].indexOf(t[i])<0&&(n[i]=e[i].concat([t[i]])):n[i]=[e[i],t[i]],n)},{})}e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;f(this,t),this.index=e,this.length=n},p=function(){function t(e,n){var i=this;f(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=o.default.create("cursor",this),this.lastRange=this.savedRange=new h(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){i.mouseDown||setTimeout(i.update.bind(i,l.default.sources.USER),1)}),this.emitter.on(l.default.events.EDITOR_CHANGE,function(t,e){t===l.default.events.TEXT_CHANGE&&e.length()>0&&i.update(l.default.sources.SILENT)}),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,function(){if(i.hasFocus()){var t=i.getNativeRange();null!=t&&t.start.node!==i.cursor.textNode&&i.emitter.once(l.default.events.SCROLL_UPDATE,function(){try{i.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range;i.setNativeRange(n.startNode,n.startOffset,n.endNode,n.endOffset)}}),this.update(l.default.sources.SILENT)}return r(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(l.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!o.default.query(t,o.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var i=o.default.find(n.start.node,!1);if(null==i)return;if(i instanceof o.default.Leaf){var r=i.split(n.start.offset);i.parent.insertBefore(this.cursor,r)}else i.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=this.scroll.leaf(t),a=i(o,2),s=a[0],l=a[1];if(null==s)return null;var u=s.position(l,!0),c=i(u,2);r=c[0],l=c[1];var f=document.createRange();if(e>0){f.setStart(r,l);var d=this.scroll.leaf(t+e),h=i(d,2);if(l=h[1],null==(s=h[0]))return null;var p=s.position(l,!0),g=i(p,2);return f.setEnd(r=g[0],l=g[1]),f.getBoundingClientRect()}var v="left",y=void 0;return r instanceof Text?(l0&&(v="right")),{bottom:y.top+y.height,height:y.height,left:y[v],right:y[v],top:y.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return d.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var r=n.map(function(t){var n=i(t,2),r=n[0],a=n[1],s=o.default.find(r,!0),l=s.offset(e.scroll);return 0===a?l:s instanceof o.default.Container?l+s.length():l+s.index(r,a)}),a=Math.min(Math.max.apply(Math,c(r)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(c(r)));return new h(s,a-s)}},{key:"normalizeNative",value:function(t){if(!g(this.root,t.startContainer)||!t.collapsed&&!g(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;n=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],r=[],o=this.scroll.length();return n.forEach(function(t,n){t=Math.min(o-1,t);var a=e.scroll.leaf(t),s=i(a,2),l=s[1],u=s[0].position(l,0!==n),c=i(u,2);r.push(c[0],l=c[1])}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var r=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,r)),a=i(o,1)[0],s=a;if(e.length>0){var l=this.scroll.line(Math.min(e.index+e.length,r));s=i(l,1)[0]}if(null!=a&&null!=s){var u=t.getBoundingClientRect();n.topu.bottom&&(t.scrollTop+=n.bottom-u.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(d.info("setNativeRange",t,e,n,i),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var o=document.getSelection();if(null!=o)if(null!=t){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||r||t!==a.startContainer||e!==a.startOffset||n!==a.endContainer||i!==a.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(i=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(t,e),s.setEnd(n,i),o.removeAllRanges(),o.addRange(s)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof e&&(n=e,e=!1),d.info("setRange",t),null!=t){var i=this.rangeToNative(t);this.setNativeRange.apply(this,c(i).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.lastRange,n=this.getRange(),r=i(n,2),o=r[1];if(this.lastRange=r[0],null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(e,this.lastRange)){var u;!this.composing&&null!=o&&o.native.collapsed&&o.start.node!==this.cursor.textNode&&this.cursor.restore();var c,f=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(e),t];(u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(f)),t!==l.default.sources.SILENT&&(c=this.emitter).emit.apply(c,f)}}}]),t}();function g(t,e){return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=h,e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=a.Scope.INLINE_BLOT,e}(o.default);e.default=s},function(t,e,n){var i=n(11),r=n(3),o={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var i=r(!0,{},e);for(var o in n||(i=Object.keys(i).reduce(function(t,e){return null!=i[e]&&(t[e]=i[e]),t},{})),t)void 0!==t[o]&&void 0===e[o]&&(i[o]=t[o]);return Object.keys(i).length>0?i:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return i(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var i=Object.keys(e).reduce(function(n,i){return void 0===t[i]&&(n[i]=e[i]),n},{});return Object.keys(i).length>0?i:void 0}}},iterator:function(t){return new a(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};function a(t){this.ops=t,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,i=o.length(e);if(t>=i-n?(t=i-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var r={};return e.attributes&&(r.attributes=e.attributes),"number"==typeof e.retain?r.retain=t:r.insert="string"==typeof e.insert?e.insert.substr(n,t):e.insert,r}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=o},function(t,e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,i;try{e=Map}catch(t){e=function(){}}try{n=Set}catch(t){n=function(){}}try{i=Promise}catch(t){i=function(){}}function r(o,s,l,u,c){"object"==typeof s&&(l=s.depth,u=s.prototype,c=s.includeNonEnumerable,s=s.circular);var f=[],d=[],h="undefined"!=typeof Buffer;return"undefined"==typeof s&&(s=!0),"undefined"==typeof l&&(l=1/0),function o(l,p){if(null===l)return null;if(0===p)return l;var g,v;if("object"!=typeof l)return l;if(t(l,e))g=new e;else if(t(l,n))g=new n;else if(t(l,i))g=new i(function(t,e){l.then(function(e){t(o(e,p-1))},function(t){e(o(t,p-1))})});else if(r.__isArray(l))g=[];else if(r.__isRegExp(l))g=new RegExp(l.source,a(l)),l.lastIndex&&(g.lastIndex=l.lastIndex);else if(r.__isDate(l))g=new Date(l.getTime());else{if(h&&Buffer.isBuffer(l))return g=new Buffer(l.length),l.copy(g),g;t(l,Error)?g=Object.create(l):"undefined"==typeof u?(v=Object.getPrototypeOf(l),g=Object.create(v)):(g=Object.create(u),v=u)}if(s){var y=f.indexOf(l);if(-1!=y)return d[y];f.push(l),d.push(g)}for(var m in t(l,e)&&l.forEach(function(t,e){var n=o(e,p-1),i=o(t,p-1);g.set(n,i)}),t(l,n)&&l.forEach(function(t){var e=o(t,p-1);g.add(e)}),l){var b;v&&(b=Object.getOwnPropertyDescriptor(v,m)),b&&null==b.set||(g[m]=o(l[m],p-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(l);for(m=0;m<_.length;m++){var x=_[m];(!(k=Object.getOwnPropertyDescriptor(l,x))||k.enumerable||c)&&(g[x]=o(l[x],p-1),k.enumerable||Object.defineProperty(g,x,{enumerable:!1}))}}if(c){var w=Object.getOwnPropertyNames(l);for(m=0;m0){if(s instanceof l.BlockEmbed||h instanceof l.BlockEmbed)return void this.optimize();if(s instanceof f.default){var p=s.newlineIndex(s.length(),!0);if(p>-1&&(s=s.split(p+1))===h)return void this.optimize()}else if(h instanceof f.default){var g=h.newlineIndex(0);g>-1&&h.split(g+1)}s.moveChildren(h,h.children.head instanceof c.default?null:h.children.head),s.remove()}this.optimize()}},{key:"enable",value:function(){this.domNode.setAttribute("contenteditable",!(arguments.length>0&&void 0!==arguments[0])||arguments[0])}},{key:"formatAt",value:function(t,n,i,r){(null==this.whitelist||this.whitelist[i])&&(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,i,r),this.optimize())}},{key:"insertAt",value:function(t,n,i){if(null==i||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==i||null==a.default.query(n,a.default.Scope.BLOCK)){var r=a.default.create(this.statics.defaultChild);this.appendChild(r),null==i&&n.endsWith("\n")&&(n=n.slice(0,-1)),r.insertAt(0,n,i)}else{var s=a.default.create(n,i);this.appendChild(s)}else o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,i);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===a.default.Scope.INLINE_BLOT){var i=a.default.create(this.statics.defaultChild);i.appendChild(t),t=i}o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(p,t)}},{key:"lines",value:function(){return function t(e,n,i){var r=[],o=i;return e.children.forEachAt(n,i,function(e,n,i){p(e)?r.push(e):e instanceof a.default.Container&&(r=r.concat(t(e,n,o))),o-=i}),r}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=s.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,t),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,t)}}}]),e}();g.blotName="scroll",g.className="ql-editor",g.tagName="DIV",g.defaultChild="block",g.allowedChildren=[u.default,l.BlockEmbed,d.default],e.default=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&s.return&&s.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=C(t);if(null==i||null==i.key)return y.warn("Attempted to add invalid keyboard binding",i);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),i=(0,l.default)(i,e,n),this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var o=(t.bindings[n.which||n.keyCode]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var a=t.quill.getSelection();if(null!=a&&t.quill.hasFocus()){var l=t.quill.getLine(a.index),u=r(l,2),c=u[0],d=u[1],h=t.quill.getLeaf(a.index),p=r(h,2),g=p[0],v=p[1],y=0===a.length?[g,v]:t.quill.getLeaf(a.index+a.length),m=r(y,2),b=m[0],_=m[1],x=g instanceof f.default.Text?g.value().slice(0,v):"",w=b instanceof f.default.Text?b.value().slice(_):"",k={collapsed:0===a.length,empty:0===a.length&&c.length()<=1,format:t.quill.getFormat(a),offset:d,prefix:x,suffix:w};o.some(function(e){if(null!=e.collapsed&&e.collapsed!==k.collapsed)return!1;if(null!=e.empty&&e.empty!==k.empty)return!1;if(null!=e.offset&&e.offset!==k.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==k.format[t]}))return!1}else if("object"===i(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=k.format[t]:!1===e.format[t]?null==k.format[t]:(0,s.default)(e.format[t],k.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(k.prefix)||null!=e.suffix&&!e.suffix.test(k.suffix)||!0===e.handler.call(t,a,k))})&&n.preventDefault()}}}})}}]),e}();function _(t,e){var n;return v(n={key:t,shiftKey:e,altKey:null},t===b.keys.LEFT?"prefix":"suffix",/^$/),v(n,"handler",function(n){var i=n.index;t===b.keys.RIGHT&&(i+=n.length+1);var o=this.quill.getLeaf(i);return!(r(o,1)[0]instanceof f.default.Embed&&(t===b.keys.LEFT?e?this.quill.setSelection(n.index-1,n.length+1,d.default.sources.USER):this.quill.setSelection(n.index-1,d.default.sources.USER):e?this.quill.setSelection(n.index,n.length+1,d.default.sources.USER):this.quill.setSelection(n.index+n.length+1,d.default.sources.USER),1))}),n}function x(t,e){if(!(0===t.index||this.quill.getLength()<=1)){var n=this.quill.getLine(t.index),i=r(n,1)[0],o={};if(0===e.offset){var a=this.quill.getLine(t.index-1),s=r(a,1)[0];if(null!=s&&s.length()>1){var l=i.formats(),u=this.quill.getFormat(t.index-1,1);o=c.default.attributes.diff(l,u)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,d.default.sources.USER),Object.keys(o).length>0&&this.quill.formatLine(t.index-f,f,o,d.default.sources.USER),this.quill.focus()}}function w(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var i={},o=0,a=this.quill.getLine(t.index),s=r(a,1)[0];if(e.offset>=s.length()-1){var l=this.quill.getLine(t.index+1),u=r(l,1)[0];if(u){var f=s.formats(),h=this.quill.getFormat(t.index,1);i=c.default.attributes.diff(f,h)||{},o=u.length()}}this.quill.deleteText(t.index,n,d.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index+o-1,n,i,d.default.sources.USER)}}function k(t){var e=this.quill.getLines(t),n={};if(e.length>1){var i=e[0].formats(),r=e[e.length-1].formats();n=c.default.attributes.diff(r,i)||{}}this.quill.deleteText(t,d.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,d.default.sources.USER),this.quill.setSelection(t.index,d.default.sources.SILENT),this.quill.focus()}function O(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var i=Object.keys(e.format).reduce(function(t,n){return f.default.query(n,f.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",i,d.default.sources.USER),this.quill.setSelection(t.index+1,d.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==i[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],d.default.sources.USER))})}function E(t){return{key:b.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=f.default.query("code-block"),i=e.index,o=e.length,a=this.quill.scroll.descendant(n,i),s=r(a,2),l=s[0],u=s[1];if(null!=l){var c=this.quill.getIndex(l),h=l.newlineIndex(u,!0)+1,p=l.newlineIndex(c+u+o),g=l.domNode.textContent.slice(h,p).split("\n");u=0,g.forEach(function(e,r){t?(l.insertAt(h+u,n.TAB),u+=n.TAB.length,0===r?i+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(l.deleteAt(h+u,n.TAB.length),u-=n.TAB.length,0===r?i-=n.TAB.length:o-=n.TAB.length),u+=e.length+1}),this.quill.update(d.default.sources.USER),this.quill.setSelection(i,o,d.default.sources.SILENT)}}}}function T(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],d.default.sources.USER)}}}function C(t){if("string"==typeof t||"number"==typeof t)return C({key:t});if("object"===("undefined"==typeof t?"undefined":i(t))&&(t=(0,a.default)(t,!1)),"string"==typeof t.key)if(null!=b.keys[t.key.toUpperCase()])t.key=b.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[m]=t.shortKey,delete t.shortKey),t}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:T("bold"),italic:T("italic"),underline:T("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",d.default.sources.USER)}},outdent:{key:b.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",d.default.sources.USER)}},"outdent backspace":{key:b.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",d.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,d.default.sources.USER)}},"indent code-block":E(!0),"outdent code-block":E(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,d.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new u.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,d.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,d.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,d.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=r(e,2),i=n[0],o=n[1],a=(0,l.default)({},i.formats(),{list:"checked"}),s=(new u.default).retain(t.index).insert("\n",a).retain(i.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,d.default.sources.USER),this.quill.setSelection(t.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),i=r(n,2),o=i[0],a=i[1],s=(new u.default).retain(t.index).insert("\n",e.format).retain(o.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,d.default.sources.USER),this.quill.setSelection(t.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,i=this.quill.getLine(t.index),o=r(i,2),a=o[0],s=o[1];if(s>n)return!0;var l=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(t.index," ",d.default.sources.USER),this.quill.history.cutoff();var c=(new u.default).retain(t.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(c,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,d.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=r(e,2),i=n[0],o=n[1],a=(new u.default).retain(t.index+i.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,d.default.sources.USER)}},"embed left":_(b.keys.LEFT,!1),"embed left shift":_(b.keys.LEFT,!0),"embed right":_(b.keys.RIGHT,!1),"embed right shift":_(b.keys.RIGHT,!0)}},e.default=b,e.SHORTKEY=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(t,e){for(var n=0;n-1}s.blotName="link",s.tagName="A",s.SANITIZED_URL="about:blank",s.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=s,e.sanitize=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":i(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=y(n(0)),r=y(n(5)),o=n(4),a=y(o),s=y(n(16)),l=y(n(25)),u=y(n(24)),c=y(n(35)),f=y(n(6)),d=y(n(22)),h=y(n(7)),p=y(n(55)),g=y(n(42)),v=y(n(23));function y(t){return t&&t.__esModule?t:{default:t}}r.default.register({"blots/block":a.default,"blots/block/embed":o.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":u.default,"blots/embed":c.default,"blots/inline":f.default,"blots/scroll":d.default,"blots/text":h.default,"modules/clipboard":p.default,"modules/history":g.default,"modules/keyboard":v.default}),i.default.register(a.default,s.default,u.default,f.default,d.default,h.default),e.default=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=function(){function t(t){this.domNode=t,this.domNode[i.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new i.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return i.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[i.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,r){var o=this.isolate(t,e);if(null!=i.query(n,i.Scope.BLOT)&&r)o.wrap(n,r);else if(null!=i.query(n,i.Scope.ATTRIBUTE)){var a=i.create(this.statics.scope);o.wrap(a),a.format(n,r)}},t.prototype.insertAt=function(t,e,n){var r=null==n?i.create("text",e):i.create(e,n),o=this.split(t);this.parent.insertBefore(r,o)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[i.DATA_KEY]&&delete this.domNode[i.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?i.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?i.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(12),r=n(32),o=n(33),a=n(1),s=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=i.default.keys(this.domNode),n=r.default.keys(this.domNode),s=o.default.keys(this.domNode);e.concat(n).concat(s).forEach(function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof i.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var i=e.attributes[n].value(e.domNode);t.format(n,i)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=s},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){o(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(o(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[o(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[o(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[o(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;ni&&this.stack.undo.length>0){var r=this.stack.undo.pop();n=n.compose(r.undo),t=r.redo.compose(t)}else this.lastRecorded=i;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}();function u(t){var e=t.reduce(function(t,e){return t+(e.delete||0)},0),n=t.length()-e;return function(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=r.default.query(t,r.default.Scope.BLOCK)}))}(t)&&(n-=1),n}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=l,e.getLastChangeIndex=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t,e,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var i=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,a.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,a.default.sources.USER)),this.quill.root.scrollTop=i;break;case"video":n=(e=(t=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/))?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t;case"formula":if(!n)break;var r=this.quill.getSelection(!0);if(null!=r){var o=r.index+r.length;this.quill.insertEmbed(o,this.root.getAttribute("data-mode"),n,a.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(o+1," ",a.default.sources.USER),this.quill.setSelection(o+2,a.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}();function O(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var i=document.createElement("option");e===n?i.setAttribute("selected","selected"):i.setAttribute("value",e),t.appendChild(i)})}e.BaseTooltip=k,e.default=w},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,i=this.iterator();n=i();){var r=n.length();if(to?n(i,t-o,Math.min(e,o+s-t)):n(i,0,Math.min(s,t+e-o)),o+=s}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,i=this.iterator();n=i();)e=t(e,n);return e},t}();e.default=i},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),a=n(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,s),n.attach(),n}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,i,r){this.update(),t.prototype.formatAt.call(this,e,n,i,r)},e.prototype.insertAt=function(e,n,i){this.update(),t.prototype.insertAt.call(this,e,n,i)},e.prototype.optimize=function(e,n){var i=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var r=[].slice.call(this.observer.takeRecords());r.length>0;)e.push(r.pop());for(var s=function(t,e){void 0===e&&(e=!0),null!=t&&t!==i&&null!=t.domNode.parentNode&&(null==t.domNode[a.DATA_KEY].mutations&&(t.domNode[a.DATA_KEY].mutations=[]),e&&s(t.parent))},l=function(t){null!=t.domNode[a.DATA_KEY]&&null!=t.domNode[a.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(l),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=a.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(s(a.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=a.find(t,!1);s(e,!1),e instanceof o.default&&e.children.forEach(function(t){s(t,!1)})})):"attributes"===t.type&&s(e.prev)),s(e))}),this.children.forEach(l),r=(u=[].slice.call(this.observer.takeRecords())).slice();r.length>0;)e.push(r.pop())}},e.prototype.update=function(e,n){var i=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map(function(t){var e=a.find(t.target,!0);return null==e?null:null==e.domNode[a.DATA_KEY].mutations?(e.domNode[a.DATA_KEY].mutations=[t],e):(e.domNode[a.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==i&&null!=t.domNode[a.DATA_KEY]&&t.update(t.domNode[a.DATA_KEY].mutations||[],n)}),null!=this.domNode[a.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=l},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,i){var r=this;n!==this.statics.blotName||i?t.prototype.format.call(this,n,i):(this.children.forEach(function(t){t instanceof o.default||(t=t.wrap(e.blotName,!0)),r.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,i,r){null!=this.formats()[i]||a.query(i,a.Scope.ATTRIBUTE)?this.isolate(e,n).format(i,r):t.prototype.formatAt.call(this,e,n,i,r)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var i=this.formats();if(0===Object.keys(i).length)return this.unwrap();var r=this.next;r instanceof e&&r.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(i,r.formats())&&(r.moveChildren(this),r.remove())},e.blotName="inline",e.scope=a.Scope.INLINE_BLOT,e.tagName="SPAN",e}(o.default);e.default=s},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){var i=a.query(e.blotName).tagName;if(n.tagName!==i)return t.formats.call(this,n)},e.prototype.format=function(n,i){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||i?t.prototype.format.call(this,n,i):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,i,r){null!=a.query(i,a.Scope.BLOCK)?this.format(i,r):t.prototype.formatAt.call(this,e,n,i,r)},e.prototype.insertAt=function(e,n,i){if(null==i||null!=a.query(n,a.Scope.INLINE))t.prototype.insertAt.call(this,e,n,i);else{var r=this.split(e),o=a.create(n,i);r.parent.insertBefore(o,r)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=s},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,i,r){0===e&&n===this.length()?this.format(i,r):t.prototype.formatAt.call(this,e,n,i,r)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(19).default);e.default=o},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,i){null==i?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,i)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=a.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=a.Scope.INLINE_BLOT,e}(o.default);e.default=s},function(t,e,n){"use strict";var i=document.createElement("div");if(i.classList.toggle("test-class",!1),i.classList.contains("test-class")){var r=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:r.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(e=e||0,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length);var i=n.indexOf(t,e-=t.length);return-1!==i&&i===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),i=n.length>>>0,r=arguments[1],o=0;oe.length?t:e,f=t.length>e.length?e:t,d=c.indexOf(f);if(-1!=d)return u=[[i,c.substring(0,d)],[r,f],[i,c.substring(d+f.length)]],t.length>e.length&&(u[0][0]=u[2][0]=n),u;if(1==f.length)return[[n,t],[i,e]];var h=function(t,e){var n=t.length>e.length?t:e,i=t.length>e.length?e:t;if(n.length<4||2*i.length=t.length?[i,r,o,a,f]:null}var o,a,u,c,f,d=r(n,i,Math.ceil(n.length/4)),h=r(n,i,Math.ceil(n.length/2));return d||h?(o=h?d&&d[4].length>h[4].length?d:h:d,t.length>e.length?(a=o[0],u=o[1],c=o[2],f=o[3]):(c=o[0],f=o[1],a=o[2],u=o[3]),[a,u,c,f,o[4]]):null}(t,e);if(h){var p=h[1],g=h[3],v=h[4],y=o(h[0],h[2]),m=o(p,g);return y.concat([[r,v]],m)}return function(t,e){for(var r=t.length,o=e.length,s=Math.ceil((r+o)/2),l=s,u=2*s,c=new Array(u),f=new Array(u),d=0;dr)v+=2;else if(w>o)g+=2;else if(p&&(E=l+h-_)>=0&&E=k)return a(t,e,C,w)}}for(var O=-b+y;O<=b-m;O+=2){for(var E=l+O,T=(k=O==-b||O!=b&&f[E-1]r)m+=2;else if(T>o)y+=2;else if(!p&&(x=l+h-O)>=0&&x=(k=r-k))return a(t,e,C,w)}}}return[[n,t],[i,e]]}(t,e)}(t=t.substring(0,t.length-f),e=e.substring(0,e.length-f));return d&&p.unshift([r,d]),h&&p.push([r,h]),function t(e){e.push([r,""]);for(var o,a=0,u=0,c=0,f="",d="";a1?(0!==u&&0!==c&&(0!==(o=s(d,f))&&(a-u-c>0&&e[a-u-c-1][0]==r?e[a-u-c-1][1]+=d.substring(0,o):(e.splice(0,0,[r,d.substring(0,o)]),a++),d=d.substring(o),f=f.substring(o)),0!==(o=l(d,f))&&(e[a][1]=d.substring(d.length-o)+e[a][1],d=d.substring(0,d.length-o),f=f.substring(0,f.length-o))),0===u?e.splice(a-c,u+c,[i,d]):0===c?e.splice(a-u,u+c,[n,f]):e.splice(a-u-c,u+c,[n,f],[i,d]),a=a-u-c+(u?1:0)+(c?1:0)+1):0!==a&&e[a-1][0]==r?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,c=0,u=0,f="",d=""}""===e[e.length-1][1]&&e.pop();var h=!1;for(a=1;a0&&o.splice(a+2,0,[l[0],u]),c(o,a,3)}return t}(p,u)),function(t){for(var e=!1,o=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},a=2;a=55296&&s.charCodeAt(s.length-1)<=56319&&t[a-1][0]===n&&o(t[a-1][1])&&t[a][0]===i&&o(t[a][1])&&(e=!0,t[a-1][1]=t[a-2][1].slice(-1)+t[a-1][1],t[a][1]=t[a-2][1].slice(-1)+t[a][1],t[a-2][1]=t[a-2][1].slice(0,-1));var s;if(!e)return t;var l=[];for(a=0;a0&&l.push(t[a]);return l}(p)}function a(t,e,n,i){var r=t.substring(0,n),a=e.substring(0,i),s=t.substring(n),l=e.substring(i),u=o(r,a),c=o(s,l);return u.concat(c)}function s(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,i=Math.min(t.length,e.length),r=i,o=0;n=0&&i>=e-1;i--)if(i+1=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=C(e,n)),parseFloat(i.textIndent||0)>0&&(e=(new s.default).insert("\t").concat(e)),e}],["li",function(t,e){var n=l.default.query(t);if(null==n||"list-item"!==n.blotName||!S(e,"\n"))return e;for(var i=-1,r=t.parentNode;!r.classList.contains("ql-clipboard");)"list"===(l.default.query(r)||{}).blotName&&(i+=1),r=r.parentNode;return i<=0?e:e.compose((new s.default).retain(e.length()-1).retain(1,{indent:i}))}],["b",P.bind(P,"bold")],["i",P.bind(P,"italic")],["style",function(){return new s.default}]],O=[d.AlignAttribute,v.DirectionAttribute].reduce(function(t,e){return t[e.keyName]=e,t},{}),E=[d.AlignStyle,h.BackgroundStyle,g.ColorStyle,v.DirectionStyle,y.FontStyle,m.SizeStyle].reduce(function(t,e){return t[e.keyName]=e,t},{}),T=function(t){function e(t,n){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return i.quill.root.addEventListener("paste",i.onPaste.bind(i)),i.container=i.quill.addContainer("ql-clipboard"),i.container.setAttribute("contenteditable",!0),i.container.setAttribute("tabindex",-1),i.matchers=[],k.concat(i.options.matchers).forEach(function(t){var e=r(t,2),o=e[1];(n.matchVisual||o!==D)&&i.addMatcher(e[0],o)}),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,f.default),o(e,[{key:"addMatcher",value:function(t,e){this.matchers.push([t,e])}},{key:"convert",value:function(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,_({},p.default.blotName,e[p.default.blotName]))}var i=this.prepareMatching(),o=r(i,2),a=function t(e,n,i){return e.nodeType===e.TEXT_NODE?i.reduce(function(t,n){return n(e,t)},new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(r,o){var a=t(o,n,i);return o.nodeType===e.ELEMENT_NODE&&(a=n.reduce(function(t,e){return e(o,t)},a),a=(o[w]||[]).reduce(function(t,e){return e(o,t)},a)),r.concat(a)},new s.default):new s.default}(this.container,o[0],o[1]);return S(a,"\n")&&null==a.ops[a.ops.length-1].attributes&&(a=a.compose((new s.default).retain(a.length()-1).delete(1))),x.log("convert",this.container.innerHTML,a),this.container.innerHTML="",a}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,u.default.sources.SILENT);else{var i=this.convert(e);this.quill.updateContents((new s.default).retain(t).concat(i),n),this.quill.setSelection(t+i.length(),u.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),i=(new s.default).retain(n.index),r=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(u.default.sources.SILENT),setTimeout(function(){i=i.concat(e.convert()).delete(n.length),e.quill.updateContents(i,u.default.sources.USER),e.quill.setSelection(i.length()-n.length,u.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=r,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(i){var o=r(i,2),a=o[0],s=o[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:e.push(s);break;default:[].forEach.call(t.container.querySelectorAll(a),function(t){t[w]=t[w]||[],t[w].push(s)})}}),[e,n]}}]),e}();function C(t,e,n){return"object"===("undefined"==typeof e?"undefined":i(e))?Object.keys(e).reduce(function(t,n){return C(t,n,e[n])},t):t.reduce(function(t,i){return i.attributes&&i.attributes[e]?t.push(i):t.insert(i.insert,(0,a.default)({},_({},e,n),i.attributes))},new s.default)}function A(t){return t.nodeType!==Node.ELEMENT_NODE?{}:t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function S(t,e){for(var n="",i=t.ops.length-1;i>=0&&n.length-1}function P(t,e,n){return C(n,t,!0)}function M(t,e){var n=l.default.Attributor.Attribute.keys(t),i=l.default.Attributor.Class.keys(t),r=l.default.Attributor.Style.keys(t),o={};return n.concat(i).concat(r).forEach(function(e){var n=l.default.query(e,l.default.Scope.ATTRIBUTE);null!=n&&(o[n.attrName]=n.value(t),o[n.attrName])||(null==(n=O[e])||n.attrName!==e&&n.keyName!==e||(o[n.attrName]=n.value(t)||void 0),null==(n=E[e])||n.attrName!==e&&n.keyName!==e||(o[(n=E[e]).attrName]=n.value(t)||void 0))}),Object.keys(o).length>0&&(e=C(e,o)),e}function j(t,e){var n=l.default.query(t);if(null==n)return e;if(n.prototype instanceof l.default.Embed){var i={},r=n.value(t);null!=r&&(i[n.blotName]=r,e=(new s.default).insert(i,n.formats(t)))}else"function"==typeof n.formats&&(e=C(e,n.blotName,n.formats(t)));return e}function I(t,e){return S(e,"\n")||(N(t)||e.length()>0&&t.nextSibling&&N(t.nextSibling))&&e.insert("\n"),e}function D(t,e){if(N(t)&&null!=t.nextElementSibling&&!S(e,"\n\n")){var n=t.offsetHeight+parseFloat(A(t).marginTop)+parseFloat(A(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function L(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!A(t.parentNode).whiteSpace.startsWith("pre")){var i=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,i.bind(i,!0)),(null==t.previousSibling&&N(t.parentNode)||null!=t.previousSibling&&N(t.previousSibling))&&(n=n.replace(/^\s+/,i.bind(i,!1))),(null==t.nextSibling&&N(t.parentNode)||null!=t.nextSibling&&N(t.nextSibling))&&(n=n.replace(/\s+$/,i.bind(i,!1)))}return e.insert(n)}T.DEFAULTS={matchers:[],matchVisual:!0},e.default=T,e.matchAttributor=M,e.matchBlot=j,e.matchNewline=I,e.matchSpacing=D,e.matchText=L},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;ni.right&&(this.root.style.left=e+(o=i.right-r.right)+"px"),r.lefti.bottom&&(this.root.style.top=n-(t.bottom-t.top+(r.bottom-r.top))+"px",this.root.classList.add("ql-flip")),o}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=D(n(29)),r=n(36),o=n(38),a=n(64),s=D(n(65)),l=D(n(66)),u=n(67),c=D(u),f=n(37),d=n(26),h=n(39),p=n(40),g=D(n(56)),v=D(n(68)),y=D(n(27)),m=D(n(69)),b=D(n(70)),_=D(n(71)),x=D(n(72)),w=D(n(73)),k=n(13),O=D(k),E=D(n(74)),T=D(n(75)),C=D(n(57)),A=D(n(41)),S=D(n(28)),N=D(n(59)),P=D(n(60)),M=D(n(61)),j=D(n(108)),I=D(n(62));function D(t){return t&&t.__esModule?t:{default:t}}i.default.register({"attributors/attribute/direction":o.DirectionAttribute,"attributors/class/align":r.AlignClass,"attributors/class/background":f.BackgroundClass,"attributors/class/color":d.ColorClass,"attributors/class/direction":o.DirectionClass,"attributors/class/font":h.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":r.AlignStyle,"attributors/style/background":f.BackgroundStyle,"attributors/style/color":d.ColorStyle,"attributors/style/direction":o.DirectionStyle,"attributors/style/font":h.FontStyle,"attributors/style/size":p.SizeStyle},!0),i.default.register({"formats/align":r.AlignClass,"formats/direction":o.DirectionClass,"formats/indent":a.IndentClass,"formats/background":f.BackgroundStyle,"formats/color":d.ColorStyle,"formats/font":h.FontClass,"formats/size":p.SizeClass,"formats/blockquote":s.default,"formats/code-block":O.default,"formats/header":l.default,"formats/list":c.default,"formats/bold":g.default,"formats/code":k.Code,"formats/italic":v.default,"formats/link":y.default,"formats/script":m.default,"formats/strike":b.default,"formats/underline":_.default,"formats/image":x.default,"formats/video":w.default,"formats/list/item":u.ListItem,"modules/formula":E.default,"modules/syntax":T.default,"modules/toolbar":C.default,"themes/bubble":j.default,"themes/snow":I.default,"ui/icons":A.default,"ui/picker":S.default,"ui/icon-picker":P.default,"ui/color-picker":N.default,"ui/tooltip":M.default},!0),e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var i,r=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,n=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var t,e,n}},{key:"insertBefore",value:function(t,n){if(t instanceof d)r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var i=null==n?this.length():n.offset(this),o=this.split(i);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=o.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}();h.blotName="list",h.scope=o.default.Scope.BLOCK_BLOT,h.tagName=["OL","UL"],h.defaultChild="list-item",h.allowedChildren=[d],e.ListItem=d,e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=(i=n(56))&&i.__esModule?i:{default:i},o=function(t){function e(){return function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.default),e}();o.blotName="italic",o.tagName=["EM","I"],e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return l.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,s.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}();u.blotName="image",u.tagName="IMG",e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return l.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return s.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}();u.blotName="video",u.className="ql-video",u.tagName="IFRAME",e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var i=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}();d.className="ql-syntax";var h=new r.default.Attributor.Class("token","hljs",{scope:r.default.Scope.INLINE}),p=function(t){function e(t,n){u(this,e);var i=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof i.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var r=null;return i.quill.on(o.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(r),r=setTimeout(function(){i.highlight(),r=null},i.options.interval)}),i.highlight(),i}return f(e,a.default),i(e,null,[{key:"register",value:function(){o.default.register(h,!0),o.default.register(d,!0)}}]),i(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(o.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(d).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(o.default.sources.SILENT),null!=e&&this.quill.setSelection(e,o.default.sources.SILENT)}}}]),e}();p.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=d,e.CodeToken=h,e.default=p},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var i=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(i):void 0},r=function(){function t(t,e){for(var n=0;n0&&r===a.default.sources.USER){i.show(),i.root.style.left="0px",i.root.style.width="",i.root.style.width=i.root.offsetWidth+"px";var o=i.quill.getLines(e.index,e.length);if(1===o.length)i.position(i.quill.getBounds(e));else{var s=o[o.length-1],l=i.quill.getIndex(s),c=Math.min(s.length()-1,e.index+e.length-l),f=i.quill.getBounds(new u.Range(l,c));i.position(f)}}else document.activeElement!==i.textbox&&i.quill.hasFocus()&&i.hide()}),i}return p(e,s.BaseTooltip),r(e,[{key:"listen",value:function(){var t=this;i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),e}();y.TEMPLATE=['','
','','',"
"].join(""),e.BubbleTooltip=y,e.default=v},function(t,e,n){t.exports=n(63)}]).default}),function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){"use strict";var n=[],i=t.document,r=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,l=n.indexOf,u={},c=u.toString,f=u.hasOwnProperty,d=f.toString,h=d.call(Object),p={};function g(t,e){var n=(e=e||i).createElement("script");n.text=t,e.head.appendChild(n).parentNode.removeChild(n)}var v="3.2.1",y=function(t,e){return new y.fn.init(t,e)},m=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,b=/^-ms-/,_=/-([a-z])/g,x=function(t,e){return e.toUpperCase()};function w(t){var e=!!t&&"length"in t&&t.length,n=y.type(t);return"function"!==n&&!y.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}y.fn=y.prototype={jquery:v,constructor:y,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=y.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return y.each(this,t)},map:function(t){return this.pushStack(y.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+L+")"+L+"*"),V=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(F),K=new RegExp("^"+q+"$"),Y={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+D+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},$=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,J=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),tt=function(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},et=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,nt=function(t,e){return e?"\0"===t?"\ufffd":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){d()},rt=mt(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{M.apply(S=j.call(x.childNodes),x.childNodes)}catch(t){M={apply:S.length?function(t,e){P.apply(t,j.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function ot(t,e,i,r){var o,s,u,c,f,p,y,m=e&&e.ownerDocument,w=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return i;if(!r&&((e?e.ownerDocument||e:x)!==h&&d(e),e=e||h,g)){if(11!==w&&(f=X.exec(t)))if(o=f[1]){if(9===w){if(!(u=e.getElementById(o)))return i;if(u.id===o)return i.push(u),i}else if(m&&(u=m.getElementById(o))&&b(e,u)&&u.id===o)return i.push(u),i}else{if(f[2])return M.apply(i,e.getElementsByTagName(t)),i;if((o=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return M.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!T[t+" "]&&(!v||!v.test(t))){if(1!==w)m=e,y=t;else if("object"!==e.nodeName.toLowerCase()){for((c=e.getAttribute("id"))?c=c.replace(et,nt):e.setAttribute("id",c=_),s=(p=a(t)).length;s--;)p[s]="#"+c+" "+yt(p[s]);y=p.join(","),m=Z.test(t)&>(e.parentNode)||e}if(y)try{return M.apply(i,m.querySelectorAll(y)),i}catch(t){}finally{c===_&&e.removeAttribute("id")}}}return l(t.replace(H,"$1"),e,i,r)}function at(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function st(t){return t[_]=!0,t}function lt(t){var e=h.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function ct(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function dt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function ht(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function pt(t){return st(function(e){return e=+e,st(function(n,i){for(var r,o=t([],n.length,e),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))})})}function gt(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}for(e in n=ot.support={},o=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},d=ot.setDocument=function(t){var e,r,a=t?t.ownerDocument||t:x;return a!==h&&9===a.nodeType&&a.documentElement?(p=(h=a).documentElement,g=!o(h),x!==h&&(r=h.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",it,!1):r.attachEvent&&r.attachEvent("onunload",it)),n.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=lt(function(t){return t.appendChild(h.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=G.test(h.getElementsByClassName),n.getById=lt(function(t){return p.appendChild(t).id=_,!h.getElementsByName||!h.getElementsByName(_).length}),n.getById?(i.filter.ID=function(t){var e=t.replace(J,tt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&g){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(J,tt);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&g){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if("undefined"!=typeof e.getElementsByClassName&&g)return e.getElementsByClassName(t)},y=[],v=[],(n.qsa=G.test(h.querySelectorAll))&&(lt(function(t){p.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\["+L+"*(?:value|"+D+")"),t.querySelectorAll("[id~="+_+"-]").length||v.push("~="),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+_+"+*").length||v.push(".#.+[+~]")}),lt(function(t){t.innerHTML="";var e=h.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=G.test(m=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&<(function(t){n.disconnectedMatch=m.call(t,"*"),m.call(t,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),e=G.test(p.compareDocumentPosition),b=e||G.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},C=e?function(t,e){if(t===e)return f=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t===h||t.ownerDocument===x&&b(x,t)?-1:e===h||e.ownerDocument===x&&b(x,e)?1:c?I(c,t)-I(c,e):0:4&i?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!r||!o)return t===h?-1:e===h?1:r?-1:o?1:c?I(c,t)-I(c,e):0;if(r===o)return ct(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[i]===s[i];)i++;return i?ct(a[i],s[i]):a[i]===x?-1:s[i]===x?1:0},h):h},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==h&&d(t),e=e.replace(V,"='$1']"),n.matchesSelector&&g&&!T[e+" "]&&(!y||!y.test(e))&&(!v||!v.test(e)))try{var i=m.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return ot(e,h,null,[t]).length>0},ot.contains=function(t,e){return(t.ownerDocument||t)!==h&&d(t),b(t,e)},ot.attr=function(t,e){(t.ownerDocument||t)!==h&&d(t);var r=i.attrHandle[e.toLowerCase()],o=r&&A.call(i.attrHandle,e.toLowerCase())?r(t,e,!g):void 0;return void 0!==o?o:n.attributes||!g?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ot.escape=function(t){return(t+"").replace(et,nt)},ot.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ot.uniqueSort=function(t){var e,i=[],r=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(C),f){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return c=null,t},r=ot.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=ot.selectors={cacheLength:50,createPseudo:st,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(J,tt),t[3]=(t[3]||t[4]||t[5]||"").replace(J,tt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ot.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ot.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(J,tt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=O[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&O(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(i){var r=ot.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(B," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var u,c,f,d,h,p,g=o!==a?"nextSibling":"previousSibling",v=e.parentNode,y=s&&e.nodeName.toLowerCase(),m=!l&&!s,b=!1;if(v){if(o){for(;g;){for(d=e;d=d[g];)if(s?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?v.firstChild:v.lastChild],a&&m){for(b=(h=(u=(c=(f=(d=v)[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===w&&u[1])&&u[2],d=h&&v.childNodes[h];d=++h&&d&&d[g]||(b=h=0)||p.pop();)if(1===d.nodeType&&++b&&d===e){c[t]=[w,h,b];break}}else if(m&&(b=h=(u=(c=(f=(d=e)[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===w&&u[1]),!1===b)for(;(d=++h&&d&&d[g]||(b=h=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(m&&((c=(f=d[_]||(d[_]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]=[w,b]),d!==e)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||ot.error("unsupported pseudo: "+t);return r[_]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?st(function(t,n){for(var i,o=r(t,e),a=o.length;a--;)t[i=I(t,o[a])]=!(n[i]=o[a])}):function(t){return r(t,0,n)}):r}},pseudos:{not:st(function(t){var e=[],n=[],i=s(t.replace(H,"$1"));return i[_]?st(function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:st(function(t){return function(e){return ot(t,e).length>0}}),contains:st(function(t){return t=t.replace(J,tt),function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}}),lang:st(function(t){return K.test(t||"")||ot.error("unsupported lang: "+t),t=t.replace(J,tt).toLowerCase(),function(e){var n;do{if(n=g?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:ht(!1),disabled:ht(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return Q.test(t.nodeName)},input:function(t){return $.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:pt(function(){return[0]}),last:pt(function(t,e){return[e-1]}),eq:pt(function(t,e,n){return[n<0?n+e:n]}),even:pt(function(t,e){for(var n=0;n=0;)t.push(i);return t}),gt:pt(function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function _t(t,e,n,i,r){for(var o,a=[],s=0,l=t.length,u=null!=e;s-1&&(o[u]=!(a[u]=f))}}else y=_t(y===a?y.splice(p,y.length):y),r?r(null,a,y,l):M.apply(a,y)})}function wt(t){for(var e,n,r,o=t.length,a=i.relative[t[0].type],s=a||i.relative[" "],l=a?1:0,c=mt(function(t){return t===e},s,!0),f=mt(function(t){return I(e,t)>-1},s,!0),d=[function(t,n,i){var r=!a&&(i||n!==u)||((e=n).nodeType?c(t,n,i):f(t,n,i));return e=null,r}];l1&&bt(d),l>1&&yt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(H,"$1"),n,l0,r=t.length>0,o=function(o,a,s,l,c){var f,p,v,y=0,m="0",b=o&&[],_=[],x=u,k=o||r&&i.find.TAG("*",c),O=w+=null==x?1:Math.random()||.1,E=k.length;for(c&&(u=a===h||a||c);m!==E&&null!=(f=k[m]);m++){if(r&&f){for(p=0,a||f.ownerDocument===h||(d(f),s=!g);v=t[p++];)if(v(f,a||h,s)){l.push(f);break}c&&(w=O)}n&&((f=!v&&f)&&y--,o&&b.push(f))}if(y+=m,n&&m!==y){for(p=0;v=e[p++];)v(b,_,a,s);if(o){if(y>0)for(;m--;)b[m]||_[m]||(_[m]=N.call(l));_=_t(_)}M.apply(l,_),c&&!o&&_.length>0&&y+e.length>1&&ot.uniqueSort(l)}return c&&(w=O,u=x),b};return n?st(o):o}return vt.prototype=i.filters=i.pseudos,i.setFilters=new vt,a=ot.tokenize=function(t,e){var n,r,o,a,s,l,u,c=E[t+" "];if(c)return e?0:c.slice(0);for(s=t,l=[],u=i.preFilter;s;){for(a in n&&!(r=W.exec(s))||(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),n=!1,(r=z.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(H," ")}),s=s.slice(n.length)),i.filter)!(r=Y[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return e?s.length:s?ot.error(t):E(t,l).slice(0)},s=ot.compile=function(t,e){var n,i=[],r=[],o=T[t+" "];if(!o){for(e||(e=a(t)),n=e.length;n--;)(o=wt(e[n]))[_]?i.push(o):r.push(o);(o=T(t,kt(r,i))).selector=t}return o},l=ot.select=function(t,e,n,r){var o,l,u,c,f,d="function"==typeof t&&t,h=!r&&a(t=d.selector||t);if(n=n||[],1===h.length){if((l=h[0]=h[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===e.nodeType&&g&&i.relative[l[1].type]){if(!(e=(i.find.ID(u.matches[0].replace(J,tt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=Y.needsContext.test(t)?0:l.length;o--&&!i.relative[c=(u=l[o]).type];)if((f=i.find[c])&&(r=f(u.matches[0].replace(J,tt),Z.test(l[0].type)&>(e.parentNode)||e))){if(l.splice(o,1),!(t=r.length&&yt(l)))return M.apply(n,r),n;break}}return(d||s(t,h))(r,e,!g,n,!e||Z.test(t)&>(e.parentNode)||e),n},n.sortStable=_.split("").sort(C).join("")===_,n.detectDuplicates=!!f,d(),n.sortDetached=lt(function(t){return 1&t.compareDocumentPosition(h.createElement("fieldset"))}),lt(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||ut("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&<(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ut("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),lt(function(t){return null==t.getAttribute("disabled")})||ut(D,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),ot}(t);y.find=k,y.expr=k.selectors,y.expr[":"]=y.expr.pseudos,y.uniqueSort=y.unique=k.uniqueSort,y.text=k.getText,y.isXMLDoc=k.isXML,y.contains=k.contains,y.escapeSelector=k.escape;var O=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&y(t).is(n))break;i.push(t)}return i},E=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},T=y.expr.match.needsContext;function C(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,S=/^.[^:#\[\.,]*$/;function N(t,e,n){return y.isFunction(e)?y.grep(t,function(t,i){return!!e.call(t,i,t)!==n}):e.nodeType?y.grep(t,function(t){return t===e!==n}):"string"!=typeof e?y.grep(t,function(t){return l.call(e,t)>-1!==n}):S.test(e)?y.filter(e,t,n):(e=y.filter(e,t),y.grep(t,function(t){return l.call(e,t)>-1!==n&&1===t.nodeType}))}y.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?y.find.matchesSelector(i,t)?[i]:[]:y.find.matches(t,y.grep(e,function(t){return 1===t.nodeType}))},y.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(y(t).filter(function(){for(e=0;e1?y.uniqueSort(n):n},filter:function(t){return this.pushStack(N(this,t||[],!1))},not:function(t){return this.pushStack(N(this,t||[],!0))},is:function(t){return!!N(this,"string"==typeof t&&T.test(t)?y(t):t||[],!1).length}});var P,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(y.fn.init=function(t,e,n){var r,o;if(!t)return this;if(n=n||P,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:M.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(y.merge(this,y.parseHTML(r[1],(e=e instanceof y?e[0]:e)&&e.nodeType?e.ownerDocument||e:i,!0)),A.test(r[1])&&y.isPlainObject(e))for(r in e)y.isFunction(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(o=i.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):y.isFunction(t)?void 0!==n.ready?n.ready(t):t(y):y.makeArray(t,this)}).prototype=y.fn,P=y(i);var j=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function D(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}y.fn.extend({has:function(t){var e=y(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&y.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?y.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?l.call(y(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(y.uniqueSort(y.merge(this.get(),y(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),y.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return O(t,"parentNode")},parentsUntil:function(t,e,n){return O(t,"parentNode",n)},next:function(t){return D(t,"nextSibling")},prev:function(t){return D(t,"previousSibling")},nextAll:function(t){return O(t,"nextSibling")},prevAll:function(t){return O(t,"previousSibling")},nextUntil:function(t,e,n){return O(t,"nextSibling",n)},prevUntil:function(t,e,n){return O(t,"previousSibling",n)},siblings:function(t){return E((t.parentNode||{}).firstChild,t)},children:function(t){return E(t.firstChild)},contents:function(t){return C(t,"iframe")?t.contentDocument:(C(t,"template")&&(t=t.content||t),y.merge([],t.childNodes))}},function(t,e){y.fn[t]=function(n,i){var r=y.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=y.filter(i,r)),this.length>1&&(I[t]||y.uniqueSort(r),j.test(t)&&r.reverse()),this.pushStack(r)}});var L=/[^\x20\t\r\n\f]+/g;function q(t){return t}function R(t){throw t}function F(t,e,n,i){var r;try{t&&y.isFunction(r=t.promise)?r.call(t).done(e).fail(n):t&&y.isFunction(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}y.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return y.each(t.match(L)||[],function(t,n){e[n]=!0}),e}(t):y.extend({},t);var e,n,i,r,o=[],a=[],s=-1,l=function(){for(r=r||t.once,i=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--}),this},has:function(t){return t?y.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=a=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},y.extend({Deferred:function(e){var n=[["notify","progress",y.Callbacks("memory"),y.Callbacks("memory"),2],["resolve","done",y.Callbacks("once memory"),y.Callbacks("once memory"),0,"resolved"],["reject","fail",y.Callbacks("once memory"),y.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return y.Deferred(function(e){y.each(n,function(n,i){var r=y.isFunction(t[i[4]])&&t[i[4]];o[i[1]](function(){var t=r&&r.apply(this,arguments);t&&y.isFunction(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(e,i,r){var o=0;function a(e,n,i,r){return function(){var s=this,l=arguments,u=function(){var t,u;if(!(e=o&&(i!==R&&(s=void 0,l=[t]),n.rejectWith(s,l))}};e?c():(y.Deferred.getStackHook&&(c.stackTrace=y.Deferred.getStackHook()),t.setTimeout(c))}}return y.Deferred(function(t){n[0][3].add(a(0,t,y.isFunction(r)?r:q,t.notifyWith)),n[1][3].add(a(0,t,y.isFunction(e)?e:q)),n[2][3].add(a(0,t,y.isFunction(i)?i:R))}).promise()},promise:function(t){return null!=t?y.extend(t,r):r}},o={};return y.each(n,function(t,e){var a=e[2],s=e[5];r[e[1]]=a.add,s&&a.add(function(){i=s},n[3-t][2].disable,n[0][2].lock),a.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=o.call(arguments),a=y.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?o.call(arguments):n,--e||a.resolveWith(i,r)}};if(e<=1&&(F(t,a.done(s(n)).resolve,a.reject,!e),"pending"===a.state()||y.isFunction(r[n]&&r[n].then)))return a.then();for(;n--;)F(r[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;y.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&B.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},y.readyException=function(e){t.setTimeout(function(){throw e})};var H=y.Deferred();function W(){i.removeEventListener("DOMContentLoaded",W),t.removeEventListener("load",W),y.ready()}y.fn.ready=function(t){return H.then(t).catch(function(t){y.readyException(t)}),this},y.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--y.readyWait:y.isReady)||(y.isReady=!0,!0!==t&&--y.readyWait>0||H.resolveWith(i,[y]))}}),y.ready.then=H.then,"complete"===i.readyState||"loading"!==i.readyState&&!i.documentElement.doScroll?t.setTimeout(y.ready):(i.addEventListener("DOMContentLoaded",W),t.addEventListener("load",W));var z=function(t,e,n,i,r,o,a){var s=0,l=t.length,u=null==n;if("object"===y.type(n))for(s in r=!0,n)z(t,e,s,n[s],!0,o,a);else if(void 0!==i&&(r=!0,y.isFunction(i)||(a=!0),u&&(a?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(y(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each(function(){Y.remove(this,t)})}}),y.extend({queue:function(t,e,n){var i;if(t)return i=K.get(t,e=(e||"fx")+"queue"),n&&(!i||Array.isArray(n)?i=K.access(t,e,y.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){var n=y.queue(t,e=e||"fx"),i=n.length,r=n.shift(),o=y._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,function(){y.dequeue(t,e)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return K.get(t,n)||K.access(t,n,{empty:y.Callbacks("once memory").add(function(){K.remove(t,[e+"queue",n])})})}}),y.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]+)/i,lt=/^$|\/(?:java|ecma)script/i,ut={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ct(t,e){var n;return n="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&C(t,e)?y.merge([t],n):n}function ft(t,e){for(var n=0,i=t.length;n-1)r&&r.push(o);else if(u=y.contains(o.ownerDocument,o),a=ct(f.appendChild(o),"script"),u&&ft(a),n)for(c=0;o=a[c++];)lt.test(o.type||"")&&n.push(o);return f}!function(){var t=i.createDocumentFragment().appendChild(i.createElement("div")),e=i.createElement("input");e.setAttribute("type","radio"),e.setAttribute("checked","checked"),e.setAttribute("name","t"),t.appendChild(e),p.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",p.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var pt=i.documentElement,gt=/^key/,vt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,yt=/^([^.]*)(?:\.(.+)|)/;function mt(){return!0}function bt(){return!1}function _t(){try{return i.activeElement}catch(t){}}function xt(t,e,n,i,r,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(i=i||n,n=void 0),e)xt(t,s,n,i,e[s],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=bt;else if(!r)return t;return 1===o&&(a=r,(r=function(t){return y().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=y.guid++)),t.each(function(){y.event.add(this,e,r,i,n)})}y.event={global:{},add:function(t,e,n,i,r){var o,a,s,l,u,c,f,d,h,p,g,v=K.get(t);if(v)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&y.find.matchesSelector(pt,r),n.guid||(n.guid=y.guid++),(l=v.events)||(l=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof y&&y.event.triggered!==e.type?y.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(L)||[""]).length;u--;)h=g=(s=yt.exec(e[u])||[])[1],p=(s[2]||"").split(".").sort(),h&&(f=y.event.special[h]||{},f=y.event.special[h=(r?f.delegateType:f.bindType)||h]||{},c=y.extend({type:h,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&y.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[h])||((d=l[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,i,p,a)||t.addEventListener&&t.addEventListener(h,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),y.event.global[h]=!0)},remove:function(t,e,n,i,r){var o,a,s,l,u,c,f,d,h,p,g,v=K.hasData(t)&&K.get(t);if(v&&(l=v.events)){for(u=(e=(e||"").match(L)||[""]).length;u--;)if(h=g=(s=yt.exec(e[u])||[])[1],p=(s[2]||"").split(".").sort(),h){for(f=y.event.special[h]||{},d=l[h=(i?f.delegateType:f.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!r&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(t,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,p,v.handle)||y.removeEvent(t,h,v.handle),delete l[h])}else for(h in l)y.event.remove(t,h+e[u],n,i,!0);y.isEmptyObject(l)&&K.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,a,s=y.event.fix(t),l=new Array(arguments.length),u=(K.get(this,"events")||{})[s.type]||[],c=y.event.special[s.type]||{};for(l[0]=s,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:y.find(r,this,null,[u]).length),a[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,kt=/\s*$/g;function Ct(t,e){return C(t,"table")&&C(11!==e.nodeType?e:e.firstChild,"tr")&&y(">tbody",t)[0]||t}function At(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function St(t){var e=Et.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function Nt(t,e){var n,i,r,o,a,s,l,u;if(1===e.nodeType){if(K.hasData(t)&&(o=K.access(t),a=K.set(e,o),u=o.events))for(r in delete a.handle,a.events={},u)for(n=0,i=u[r].length;n1&&"string"==typeof v&&!p.checkClone&&Ot.test(v))return t.each(function(r){var o=t.eq(r);m&&(e[0]=v.call(this,r,o.html())),Mt(o,e,n,i)});if(d&&(o=(r=ht(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(l=(s=y.map(ct(r,"script"),At)).length;f")},clone:function(t,e,n){var i,r,o,a,s=t.cloneNode(!0),l=y.contains(t.ownerDocument,t);if(!(p.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||y.isXMLDoc(t)))for(a=ct(s),i=0,r=(o=ct(t)).length;i0&&ft(a,!l&&ct(t,"script")),s},cleanData:function(t){for(var e,n,i,r=y.event.special,o=0;void 0!==(n=t[o]);o++)if(V(n)){if(e=n[K.expando]){if(e.events)for(i in e.events)r[i]?y.event.remove(n,i):y.removeEvent(n,i,e.handle);n[K.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),y.fn.extend({detach:function(t){return jt(this,t,!0)},remove:function(t){return jt(this,t)},text:function(t){return z(this,function(t){return void 0===t?y.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Mt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ct(this,t).appendChild(t)})},prepend:function(){return Mt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ct(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Mt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Mt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(y.cleanData(ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return y.clone(this,t,e)})},html:function(t){return z(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!kt.test(t)&&!ut[(st.exec(t)||["",""])[1].toLowerCase()]){t=y.htmlPrefilter(t);try{for(;n1)}}),y.Tween=Qt,(Qt.prototype={constructor:Qt,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||y.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(y.cssNumber[n]?"":"px")},cur:function(){var t=Qt.propHooks[this.prop];return t&&t.get?t.get(this):Qt.propHooks._default.get(this)},run:function(t){var e,n=Qt.propHooks[this.prop];return this.pos=e=this.options.duration?y.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qt.propHooks._default.set(this),this}}).init.prototype=Qt.prototype,(Qt.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=y.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){y.fx.step[t.prop]?y.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[y.cssProps[t.prop]]&&!y.cssHooks[t.prop]?t.elem[t.prop]=t.now:y.style(t.elem,t.prop,t.now+t.unit)}}}).scrollTop=Qt.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},y.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},y.fx=Qt.prototype.init,y.fx.step={};var Gt,Xt,Zt=/^(?:toggle|show|hide)$/,Jt=/queueHooks$/;function te(){Xt&&(!1===i.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(te):t.setTimeout(te,y.fx.interval),y.fx.tick())}function ee(){return t.setTimeout(function(){Gt=void 0}),Gt=y.now()}function ne(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=J[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function ie(t,e,n){for(var i,r=(re.tweeners[e]||[]).concat(re.tweeners["*"]),o=0,a=r.length;o1)},removeAttr:function(t){return this.each(function(){y.removeAttr(this,t)})}}),y.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?y.prop(t,e,n):(1===o&&y.isXMLDoc(t)||(r=y.attrHooks[e.toLowerCase()]||(y.expr.match.bool.test(e)?oe:void 0)),void 0!==n?null===n?void y.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=y.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&C(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(L);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),oe={set:function(t,e,n){return!1===e?y.removeAttr(t,n):t.setAttribute(n,n),n}},y.each(y.expr.match.bool.source.match(/\w+/g),function(t,e){var n=ae[e]||y.find.attr;ae[e]=function(t,e,i){var r,o,a=e.toLowerCase();return i||(o=ae[a],ae[a]=r,r=null!=n(t,e,i)?a:null,ae[a]=o),r}});var se=/^(?:input|select|textarea|button)$/i,le=/^(?:a|area)$/i;function ue(t){return(t.match(L)||[]).join(" ")}function ce(t){return t.getAttribute&&t.getAttribute("class")||""}y.fn.extend({prop:function(t,e){return z(this,y.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[y.propFix[t]||t]})}}),y.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&y.isXMLDoc(t)||(r=y.propHooks[e=y.propFix[e]||e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=y.find.attr(t,"tabindex");return e?parseInt(e,10):se.test(t.nodeName)||le.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(y.propHooks.selected={get:function(t){return null},set:function(t){}}),y.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){y.propFix[this.toLowerCase()]=this}),y.fn.extend({addClass:function(t){var e,n,i,r,o,a,s,l=0;if(y.isFunction(t))return this.each(function(e){y(this).addClass(t.call(this,e,ce(this)))});if("string"==typeof t&&t)for(e=t.match(L)||[];n=this[l++];)if(r=ce(n),i=1===n.nodeType&&" "+ue(r)+" "){for(a=0;o=e[a++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(s=ue(i))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,i,r,o,a,s,l=0;if(y.isFunction(t))return this.each(function(e){y(this).removeClass(t.call(this,e,ce(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(L)||[];n=this[l++];)if(r=ce(n),i=1===n.nodeType&&" "+ue(r)+" "){for(a=0;o=e[a++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(s=ue(i))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):y.isFunction(t)?this.each(function(n){y(this).toggleClass(t.call(this,n,ce(this),e),e)}):this.each(function(){var e,i,r,o;if("string"===n)for(i=0,r=y(this),o=t.match(L)||[];e=o[i++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||((e=ce(this))&&K.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":K.get(this,"__className__")||""))})},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+ue(ce(n))+" ").indexOf(e)>-1)return!0;return!1}});var fe=/\r/g;y.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=y.isFunction(t),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,y(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=y.map(r,function(t){return null==t?"":t+""})),(e=y.valHooks[this.type]||y.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=y.valHooks[r.type]||y.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(fe,""):null==n?"":n:void 0}}),y.extend({valHooks:{option:{get:function(t){var e=y.find.attr(t,"value");return null!=e?e:ue(y.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:r.length;for(i=o<0?l:a?o:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),y.each(["radio","checkbox"],function(){y.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=y.inArray(y(t).val(),e)>-1}},p.checkOn||(y.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var de=/^(?:focusinfocus|focusoutblur)$/;y.extend(y.event,{trigger:function(e,n,r,o){var a,s,l,u,c,d,h,p=[r||i],g=f.call(e,"type")?e.type:e,v=f.call(e,"namespace")?e.namespace.split("."):[];if(s=l=r=r||i,3!==r.nodeType&&8!==r.nodeType&&!de.test(g+y.event.triggered)&&(g.indexOf(".")>-1&&(g=(v=g.split(".")).shift(),v.sort()),c=g.indexOf(":")<0&&"on"+g,(e=e[y.expando]?e:new y.Event(g,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:y.makeArray(n,[e]),h=y.event.special[g]||{},o||!h.trigger||!1!==h.trigger.apply(r,n))){if(!o&&!h.noBubble&&!y.isWindow(r)){for(de.test((u=h.delegateType||g)+g)||(s=s.parentNode);s;s=s.parentNode)p.push(s),l=s;l===(r.ownerDocument||i)&&p.push(l.defaultView||l.parentWindow||t)}for(a=0;(s=p[a++])&&!e.isPropagationStopped();)e.type=a>1?u:h.bindType||g,(d=(K.get(s,"events")||{})[e.type]&&K.get(s,"handle"))&&d.apply(s,n),(d=c&&s[c])&&d.apply&&V(s)&&(e.result=d.apply(s,n),!1===e.result&&e.preventDefault());return e.type=g,o||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),n)||!V(r)||c&&y.isFunction(r[g])&&!y.isWindow(r)&&((l=r[c])&&(r[c]=null),y.event.triggered=g,r[g](),y.event.triggered=void 0,l&&(r[c]=l)),e.result}},simulate:function(t,e,n){var i=y.extend(new y.Event,n,{type:t,isSimulated:!0});y.event.trigger(i,null,e)}}),y.fn.extend({trigger:function(t,e){return this.each(function(){y.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return y.event.trigger(t,e,n,!0)}}),y.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){y.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),y.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),p.focusin="onfocusin"in t,p.focusin||y.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){y.event.simulate(e,t.target,y.event.fix(t))};y.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=K.access(i,e);r||i.addEventListener(t,n,!0),K.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=K.access(i,e)-1;r?K.access(i,e,r):(i.removeEventListener(t,n,!0),K.remove(i,e))}}});var he=t.location,pe=y.now(),ge=/\?/;y.parseXML=function(e){var n;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||y.error("Invalid XML: "+e),n};var ve=/\[\]$/,ye=/\r?\n/g,me=/^(?:submit|button|image|reset|file)$/i,be=/^(?:input|select|textarea|keygen)/i;function _e(t,e,n,i){var r;if(Array.isArray(e))y.each(e,function(e,r){n||ve.test(t)?i(t,r):_e(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)});else if(n||"object"!==y.type(e))i(t,e);else for(r in e)_e(t+"["+r+"]",e[r],n,i)}y.param=function(t,e){var n,i=[],r=function(t,e){var n=y.isFunction(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(t)||t.jquery&&!y.isPlainObject(t))y.each(t,function(){r(this.name,this.value)});else for(n in t)_e(n,t[n],e,r);return i.join("&")},y.fn.extend({serialize:function(){return y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=y.prop(this,"elements");return t?y.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!y(this).is(":disabled")&&be.test(this.nodeName)&&!me.test(t)&&(this.checked||!at.test(t))}).map(function(t,e){var n=y(this).val();return null==n?null:Array.isArray(n)?y.map(n,function(t){return{name:e.name,value:t.replace(ye,"\r\n")}}):{name:e.name,value:n.replace(ye,"\r\n")}}).get()}});var xe=/%20/g,we=/#.*$/,ke=/([?&])_=[^&]*/,Oe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ee=/^(?:GET|HEAD)$/,Te=/^\/\//,Ce={},Ae={},Se="*/".concat("*"),Ne=i.createElement("a");function Pe(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(L)||[];if(y.isFunction(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Me(t,e,n,i){var r={},o=t===Ae;function a(s){var l;return r[s]=!0,y.each(t[s]||[],function(t,s){var u=s(e,n,i);return"string"!=typeof u||o||r[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),a(u),!1)}),l}return a(e.dataTypes[0])||!r["*"]&&a("*")}function je(t,e){var n,i,r=y.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&y.extend(!0,t,i),t}Ne.href=he.href,y.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:he.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(he.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Se,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":y.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?je(je(t,y.ajaxSettings),e):je(y.ajaxSettings,t)},ajaxPrefilter:Pe(Ce),ajaxTransport:Pe(Ae),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0);var r,o,a,s,l,u,c,f,d,h,p=y.ajaxSetup({},n=n||{}),g=p.context||p,v=p.context&&(g.nodeType||g.jquery)?y(g):y.event,m=y.Deferred(),b=y.Callbacks("once memory"),_=p.statusCode||{},x={},w={},k="canceled",O={readyState:0,getResponseHeader:function(t){var e;if(c){if(!s)for(s={};e=Oe.exec(a);)s[e[1].toLowerCase()]=e[2];e=s[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)O.always(t[O.status]);else for(e in t)_[e]=[_[e],t[e]];return this},abort:function(t){var e=t||k;return r&&r.abort(e),E(0,e),this}};if(m.promise(O),p.url=((e||p.url||he.href)+"").replace(Te,he.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(L)||[""],null==p.crossDomain){u=i.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Ne.protocol+"//"+Ne.host!=u.protocol+"//"+u.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=y.param(p.data,p.traditional)),Me(Ce,p,n,O),c)return O;for(d in(f=y.event&&p.global)&&0==y.active++&&y.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ee.test(p.type),o=p.url.replace(we,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(xe,"+")):(h=p.url.slice(o.length),p.data&&(o+=(ge.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(o=o.replace(ke,"$1"),h=(ge.test(o)?"&":"?")+"_="+pe+++h),p.url=o+h),p.ifModified&&(y.lastModified[o]&&O.setRequestHeader("If-Modified-Since",y.lastModified[o]),y.etag[o]&&O.setRequestHeader("If-None-Match",y.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&O.setRequestHeader("Content-Type",p.contentType),O.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Se+"; q=0.01":""):p.accepts["*"]),p.headers)O.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(g,O,p)||c))return O.abort();if(k="abort",b.add(p.complete),O.done(p.success),O.fail(p.error),r=Me(Ae,p,n,O)){if(O.readyState=1,f&&v.trigger("ajaxSend",[O,p]),c)return O;p.async&&p.timeout>0&&(l=t.setTimeout(function(){O.abort("timeout")},p.timeout));try{c=!1,r.send(x,E)}catch(t){if(c)throw t;E(-1,t)}}else E(-1,"No Transport");function E(e,n,i,s){var u,d,h,x,w,k=n;c||(c=!0,l&&t.clearTimeout(l),r=void 0,a=s||"",O.readyState=e>0?4:0,u=e>=200&&e<300||304===e,i&&(x=function(t,e,n){for(var i,r,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,O,i)),x=function(t,e,n,i){var r,o,a,s,l,u={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,x,O,u),u?(p.ifModified&&((w=O.getResponseHeader("Last-Modified"))&&(y.lastModified[o]=w),(w=O.getResponseHeader("etag"))&&(y.etag[o]=w)),204===e||"HEAD"===p.type?k="nocontent":304===e?k="notmodified":(k=x.state,d=x.data,u=!(h=x.error))):(h=k,!e&&k||(k="error",e<0&&(e=0))),O.status=e,O.statusText=(n||k)+"",u?m.resolveWith(g,[d,k,O]):m.rejectWith(g,[O,k,h]),O.statusCode(_),_=void 0,f&&v.trigger(u?"ajaxSuccess":"ajaxError",[O,p,u?d:h]),b.fireWith(g,[O,k]),f&&(v.trigger("ajaxComplete",[O,p]),--y.active||y.event.trigger("ajaxStop")))}return O},getJSON:function(t,e,n){return y.get(t,e,n,"json")},getScript:function(t,e){return y.get(t,void 0,e,"script")}}),y.each(["get","post"],function(t,e){y[e]=function(t,n,i,r){return y.isFunction(n)&&(r=r||i,i=n,n=void 0),y.ajax(y.extend({url:t,type:e,dataType:r,data:n,success:i},y.isPlainObject(t)&&t))}}),y._evalUrl=function(t){return y.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},y.fn.extend({wrapAll:function(t){var e;return this[0]&&(y.isFunction(t)&&(t=t.call(this[0])),e=y(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return y.isFunction(t)?this.each(function(e){y(this).wrapInner(t.call(this,e))}):this.each(function(){var e=y(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=y.isFunction(t);return this.each(function(n){y(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){y(this).replaceWith(this.childNodes)}),this}}),y.expr.pseudos.hidden=function(t){return!y.expr.pseudos.visible(t)},y.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},y.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ie={0:200,1223:204},De=y.ajaxSettings.xhr();p.cors=!!De&&"withCredentials"in De,p.ajax=De=!!De,y.ajaxTransport(function(e){var n,i;if(p.cors||De&&!e.crossDomain)return{send:function(r,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);n=function(t){return function(){n&&(n=i=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ie[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),i=s.onerror=n("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&t.setTimeout(function(){n&&i()})},n=n("abort");try{s.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}}),y.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return y.globalEval(t),t}}}),y.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),y.ajaxTransport("script",function(t){var e,n;if(t.crossDomain)return{send:function(r,o){e=y("