/*! For license information please see 2.72d7cb01.chunk.js.LICENSE.txt */ (this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(172)},function(e,t,n){"use strict";n.d(t,"a",(function(){return Ke})),n.d(t,"b",(function(){return kt})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return un})),n.d(t,"e",(function(){return nn})),n.d(t,"f",(function(){return hn})),n.d(t,"g",(function(){return c})),n.d(t,"h",(function(){return dn})),n.d(t,"i",(function(){return H})),n.d(t,"j",(function(){return tn})),n.d(t,"k",(function(){return q})),n.d(t,"l",(function(){return K})),n.d(t,"m",(function(){return O})),n.d(t,"n",(function(){return j})),n.d(t,"o",(function(){return jt})),n.d(t,"p",(function(){return ne})),n.d(t,"q",(function(){return F})),n.d(t,"r",(function(){return tt})),n.d(t,"s",(function(){return ue})),n.d(t,"t",(function(){return rt})),n.d(t,"u",(function(){return $})),n.d(t,"v",(function(){return st})),n.d(t,"w",(function(){return ft})),n.d(t,"x",(function(){return lt})),n.d(t,"y",(function(){return xt})),n.d(t,"z",(function(){return f})),n.d(t,"A",(function(){return d})),n.d(t,"B",(function(){return Dt})),n.d(t,"C",(function(){return wt})),n.d(t,"D",(function(){return P})),n.d(t,"E",(function(){return L})),n.d(t,"F",(function(){return Ge})),n.d(t,"G",(function(){return z})),n.d(t,"H",(function(){return Rt})),n.d(t,"I",(function(){return At})),n.d(t,"J",(function(){return Lt})),n.d(t,"K",(function(){return _})),n.d(t,"L",(function(){return v})),n.d(t,"M",(function(){return u})),n.d(t,"N",(function(){return ee})),n.d(t,"O",(function(){return X})),n.d(t,"P",(function(){return J})),n.d(t,"Q",(function(){return Z})),n.d(t,"R",(function(){return re})),n.d(t,"S",(function(){return nt})),n.d(t,"T",(function(){return Et})),n.d(t,"U",(function(){return St})),n.d(t,"V",(function(){return fn})),n.d(t,"W",(function(){return it})),n.d(t,"X",(function(){return I})),n.d(t,"Y",(function(){return C})),n.d(t,"Z",(function(){return ie})),n.d(t,"ab",(function(){return bt})),n.d(t,"bb",(function(){return en})),n.d(t,"cb",(function(){return Cn})),n.d(t,"db",(function(){return Sn})),n.d(t,"eb",(function(){return vn})),n.d(t,"fb",(function(){return mn})),n.d(t,"gb",(function(){return pn})),n.d(t,"hb",(function(){return ct})),n.d(t,"ib",(function(){return ut})),n.d(t,"jb",(function(){return at})),n.d(t,"kb",(function(){return pt})),n.d(t,"lb",(function(){return yt})),n.d(t,"mb",(function(){return Ot})),n.d(t,"nb",(function(){return jn})),n.d(t,"ob",(function(){return se})),n.d(t,"pb",(function(){return yn})),n.d(t,"qb",(function(){return On})),n.d(t,"rb",(function(){return h})),n.d(t,"sb",(function(){return kn})),n.d(t,"tb",(function(){return p})),n.d(t,"ub",(function(){return ae})),n.d(t,"vb",(function(){return g})),n.d(t,"wb",(function(){return Ye})),n.d(t,"xb",(function(){return et})),n.d(t,"yb",(function(){return pe})),n.d(t,"zb",(function(){return R})),n.d(t,"Ab",(function(){return y})),n.d(t,"Bb",(function(){return N})),n.d(t,"Cb",(function(){return b})),n.d(t,"Db",(function(){return m})),n.d(t,"Eb",(function(){return x})),n.d(t,"Fb",(function(){return Pt})),n.d(t,"Gb",(function(){return w})),n.d(t,"Hb",(function(){return bn})),n.d(t,"Ib",(function(){return le})),n.d(t,"Jb",(function(){return G})),n.d(t,"Kb",(function(){return ce})),n.d(t,"Lb",(function(){return l})),n.d(t,"Mb",(function(){return Y})),n.d(t,"Nb",(function(){return te})),n.d(t,"Ob",(function(){return _t})),n.d(t,"Pb",(function(){return k})),n.d(t,"Qb",(function(){return Ct})),n.d(t,"Rb",(function(){return ln})),n.d(t,"Sb",(function(){return ot})),n.d(t,"Tb",(function(){return Mt}));var r=n(25),i=n(13),a=n(4),o=n(6),s=n(7);var l="undefined"===typeof window?function(e){return e()}:window.requestAnimationFrame;function c(e,t,n){var r=n||function(e){return Array.prototype.slice.call(e)},i=!1,a=[];return function(){for(var n=arguments.length,o=new Array(n),s=0;s=0;i--)t.call(n,e[i],i);else for(i=0;in;)e=e[t.substr(n,r-n)],r=A(t,n=r+1);return e}function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}var N=function(e){return"undefined"!==typeof e},z=function(e){return"function"===typeof e},I=function(e,t){if(e.size!==t.size)return!1;var n,r=Object(s.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!t.has(i))return!1}}catch(a){r.e(a)}finally{r.f()}return!0},F=Math.PI,$=2*F,B=$+F,Q=Number.POSITIVE_INFINITY,W=F/180,H=F/2,V=F/4,U=2*F/3,q=Math.log10,Y=Math.sign;function X(e){var t=Math.round(e);e=Z(e,t,e/1e3)?t:e;var n=Math.pow(10,Math.floor(q(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function K(e){var t,n=[],r=Math.sqrt(e);for(t=1;t=e}function ee(e,t,n){var r,i,a;for(r=0,i=e.length;rl&&c=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){return fe(e)?e:de(e,.075,.3)},easeOutElastic:function(e){return fe(e)?e:he(e,.075,.3)},easeInOutElastic:function(e){var t=.1125;return fe(e)?e:e<.5?.5*de(2*e,t,.45):.5+.5*he(2*e-1,t,.45)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-pe.easeOutBounce(1-e)},easeOutBounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*pe.easeInBounce(2*e):.5*pe.easeOutBounce(2*e-1)+.5}},ve={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},me="0123456789ABCDEF",ge=function(e){return me[15&e]},be=function(e){return me[(240&e)>>4]+me[15&e]},ye=function(e){return(240&e)>>4===(15&e)};function Oe(e){var t=function(e){return ye(e.r)&&ye(e.g)&&ye(e.b)&&ye(e.a)}(e)?ge:be;return e?"#"+t(e.r)+t(e.g)+t(e.b)+(e.a<255?t(e.a):""):e}function ke(e){return e+.5|0}var xe=function(e,t,n){return Math.max(Math.min(e,n),t)};function we(e){return xe(ke(2.55*e),0,255)}function je(e){return xe(ke(255*e),0,255)}function Se(e){return xe(ke(e/2.55)/100,0,1)}function Ce(e){return xe(ke(100*e),0,100)}var Me=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Ee=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Te(e,t,n){var r=t*Math.min(n,1-n),i=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+e/30)%12;return n-r*Math.max(Math.min(i-3,9-i,1),-1)};return[i(0),i(8),i(4)]}function Pe(e,t,n){var r=function(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+e/60)%6;return n-n*t*Math.max(Math.min(i,4-i,1),0)};return[r(5),r(3),r(1)]}function _e(e,t,n){var r,i=Te(e,1,.5);for(t+n>1&&(t*=r=1/(t+n),n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function De(e){var t,n,r,i=e.r/255,a=e.g/255,o=e.b/255,s=Math.max(i,a,o),l=Math.min(i,a,o),c=(s+l)/2;return s!==l&&(r=s-l,n=c>.5?r/(2-s-l):r/(s+l),t=60*(t=s===i?(a-o)/r+(a>16&255,n>>8&255,255&n]}return a}()).transparent=[0,0,0,0]);var t=ze[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}function Be(e,t,n){if(e){var r=De(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,0===t?360:1)),r=Re(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Qe(e,t){return e?Object.assign(t||{},e):e}function We(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=je(e[3]))):(t=Qe(e,{r:0,g:0,b:0,a:1})).a=je(t.a),t}function He(e){return"r"===e.charAt(0)?function(e){var t,n,r,i=Me.exec(e),a=255;if(i){if(i[7]!==t){var o=+i[7];a=255&(i[8]?we(o):255*o)}return t=+i[1],n=+i[3],r=+i[5],{r:t=255&(i[2]?we(t):t),g:n=255&(i[4]?we(n):n),b:r=255&(i[6]?we(r):r),a:a}}}(e):Ne(e)}var Ve=function(){function e(t){if(Object(a.a)(this,e),t instanceof e)return t;var n,r=typeof t;"object"===r?n=We(t):"string"===r&&(n=function(e){var t,n=e.length;return"#"===e[0]&&(4===n||5===n?t={r:255&17*ve[e[1]],g:255&17*ve[e[2]],b:255&17*ve[e[3]],a:5===n?17*ve[e[4]]:255}:7!==n&&9!==n||(t={r:ve[e[1]]<<4|ve[e[2]],g:ve[e[3]]<<4|ve[e[4]],b:ve[e[5]]<<4|ve[e[6]],a:9===n?ve[e[7]]<<4|ve[e[8]]:255})),t}(t)||$e(t)||He(t)),this._rgb=n,this._valid=!!n}return Object(o.a)(e,[{key:"rgbString",value:function(){return this._valid?(e=this._rgb)&&(e.a<255?"rgba(".concat(e.r,", ").concat(e.g,", ").concat(e.b,", ").concat(Se(e.a),")"):"rgb(".concat(e.r,", ").concat(e.g,", ").concat(e.b,")")):this._rgb;var e}},{key:"hexString",value:function(){return this._valid?Oe(this._rgb):this._rgb}},{key:"hslString",value:function(){return this._valid?function(e){if(e){var t=De(e),n=t[0],r=Ce(t[1]),i=Ce(t[2]);return e.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(Se(e.a),")"):"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)")}}(this._rgb):this._rgb}},{key:"mix",value:function(e,t){var n=this;if(e){var r,i=n.rgb,a=e.rgb,o=t===r?.5:t,s=2*o-1,l=i.a-a.a,c=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;r=1-c,i.r=255&c*i.r+r*a.r+.5,i.g=255&c*i.g+r*a.g+.5,i.b=255&c*i.b+r*a.b+.5,i.a=o*i.a+(1-o)*a.a,n.rgb=i}return n}},{key:"clone",value:function(){return new e(this.rgb)}},{key:"alpha",value:function(e){return this._rgb.a=je(e),this}},{key:"clearer",value:function(e){return this._rgb.a*=1-e,this}},{key:"greyscale",value:function(){var e=this._rgb,t=ke(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}},{key:"opaquer",value:function(e){return this._rgb.a*=1+e,this}},{key:"negate",value:function(){var e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}},{key:"lighten",value:function(e){return Be(this._rgb,2,e),this}},{key:"darken",value:function(e){return Be(this._rgb,2,-e),this}},{key:"saturate",value:function(e){return Be(this._rgb,1,e),this}},{key:"desaturate",value:function(e){return Be(this._rgb,1,-e),this}},{key:"rotate",value:function(e){return function(e,t){var n=De(e);n[0]=Le(n[0]+t),n=Re(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}},{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var e=Qe(this._rgb);return e&&(e.a=Se(e.a)),e},set:function(e){this._rgb=We(e)}}]),e}();function Ue(e){return new Ve(e)}var qe=function(e){return e instanceof CanvasGradient||e instanceof CanvasPattern};function Ye(e){return qe(e)?e:Ue(e)}function Xe(e){return qe(e)?e:Ue(e).saturate(.5).darken(.1).hexString()}var Ke=Object.create(null),Ge=Object.create(null);function Ze(e,t){if(!t)return e;for(var n=t.split("."),r=0,i=n.length;rr&&(r=a),r}function nt(e,t,n,r){var i=(r=r||{}).data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;var o,s,l,c,u,f=0,d=n.length;for(o=0;on.length){for(o=0;o0&&e.stroke()}}function ot(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y5&&void 0!==arguments[5]?arguments[5]:{},l=g(t)?t:[t],c=s.strokeWidth>0&&""!==s.strokeColor;for(e.save(),e.font=i.string,dt(e,s),a=0;a1;)n(r=a+i>>1)?a=r:i=r;return{lo:a,hi:i}}var Ct=function(e,t,n){return St(e,n,(function(r){return e[r][t]=n}))};function Et(e,t,n){for(var r=0,i=e.length;rr&&e[i-1]>n;)i--;return r>0||i0||(Tt.forEach((function(t){delete e[t]})),delete e._chartjs)}}function Dt(e){var t,n,r=new Set;for(t=0,n=e.length;t1&&void 0!==arguments[1]?arguments[1]:[""],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return e[0]};N(o)||(o=Vt("_fallback",e));var l=(t={},Object(i.a)(t,Symbol.toStringTag,"Object"),Object(i.a)(t,"_cacheable",!0),Object(i.a)(t,"_scopes",e),Object(i.a)(t,"_rootScopes",a),Object(i.a)(t,"_fallback",o),Object(i.a)(t,"_getTarget",s),Object(i.a)(t,"override",(function(t){return At([t].concat(Object(r.a)(e)),n,a,o)})),t);return new Proxy(l,{deleteProperty:function(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get:function(t,r){return It(t,r,(function(){return Ht(r,n,e,t)}))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e[0])},has:function(e,t){return Ut(e).includes(t)},ownKeys:function(e){return Ut(e)},set:function(e,t,n){return(e._storage||(e._storage=s()))[t]=n,delete e[t],delete e._keys,!0}})}function Rt(e,t,n,r){var i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Lt(e,r),setContext:function(t){return Rt(e,t,n,r)},override:function(i){return Rt(e.override(i),t,n,r)}};return new Proxy(i,{deleteProperty:function(t,n){return delete t[n],delete e[n],!0},get:function(e,t,n){return It(e,t,(function(){return function(e,t,n){var r=e._proxy,i=e._context,a=e._subProxy,o=e._descriptors,l=r[t];z(l)&&o.isScriptable(t)&&(l=function(e,t,n,r){var i=n._proxy,a=n._context,o=n._subProxy,s=n._stack;if(s.has(e))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+e);s.add(e),t=t(a,o||r),s.delete(e),b(t)&&(t=Qt(i._scopes,i,e,t));return t}(t,l,e,n));g(l)&&l.length&&(l=function(e,t,n,r){var i=n._proxy,a=n._context,o=n._subProxy,l=n._descriptors;if(N(a.index)&&r(e))t=t[a.index%t.length];else if(b(t[0])){var c=t,u=i._scopes.filter((function(e){return e!==c}));t=[];var f,d=Object(s.a)(c);try{for(d.s();!(f=d.n()).done;){var h=Qt(u,i,e,f.value);t.push(Rt(h,a,o&&o[e],l))}}catch(p){d.e(p)}finally{d.f()}}return t}(t,l,e,o.isIndexable));zt(t,l)&&(l=Rt(l,i,a&&a[t],o));return l}(e,t,n)}))},getOwnPropertyDescriptor:function(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf:function(){return Reflect.getPrototypeOf(e)},has:function(t,n){return Reflect.has(e,n)},ownKeys:function(){return Reflect.ownKeys(e)},set:function(t,n,r){return e[n]=r,delete t[n],!0}})}function Lt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},n=e._scriptable,r=void 0===n?t.scriptable:n,i=e._indexable,a=void 0===i?t.indexable:i,o=e._allKeys,s=void 0===o?t.allKeys:o;return{allKeys:s,scriptable:r,indexable:a,isScriptable:z(r)?r:function(){return r},isIndexable:z(a)?a:function(){return a}}}var Nt=function(e,t){return e?e+L(t):t},zt=function(e,t){return b(t)&&"adapters"!==e};function It(e,t,n){var r=e[t];return N(r)||(r=n(),N(r)&&(e[t]=r)),r}function Ft(e,t,n){return z(e)?e(t,n):e}var $t=function(e,t){return!0===e?t:"string"===typeof e?R(t,e):void 0};function Bt(e,t,n,r){var i,a=Object(s.a)(t);try{for(a.s();!(i=a.n()).done;){var o=i.value,l=$t(n,o);if(l){e.add(l);var c=Ft(l._fallback,n,l);if(N(c)&&c!==n&&c!==r)return c}else if(!1===l&&N(r)&&n!==r)return null}}catch(u){a.e(u)}finally{a.f()}return!1}function Qt(e,t,n,i){var a=t._rootScopes,o=Ft(t._fallback,n,i),s=[].concat(Object(r.a)(e),Object(r.a)(a)),l=new Set;l.add(i);var c=Wt(l,s,n,o||n);return null!==c&&((!N(o)||o===n||null!==(c=Wt(l,s,o,c)))&&At(Array.from(l),[""],a,o,(function(){return function(e,t,n){var r=e._getTarget();t in r||(r[t]={});var i=r[t];if(g(i)&&b(n))return n;return i}(t,n,i)})))}function Wt(e,t,n,r){for(;n;)n=Bt(e,t,n,r);return n}function Ht(e,t,n,r){var i,a,o=Object(s.a)(t);try{for(o.s();!(a=o.n()).done;){var l=a.value;if(i=Vt(Nt(l,e),n),N(i))return zt(e,i)?Qt(n,r,e,i):i}}catch(c){o.e(c)}finally{o.f()}}function Vt(e,t){var n,r=Object(s.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i){var a=i[e];if(N(a))return a}}}catch(o){r.e(o)}finally{r.f()}}function Ut(e){var t=e._keys;return t||(t=e._keys=function(e){var t,n=new Set,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){var i,a=t.value,o=Object(s.a)(Object.keys(a).filter((function(e){return!e.startsWith("_")})));try{for(o.s();!(i=o.n()).done;){var l=i.value;n.add(l)}}catch(c){o.e(c)}finally{o.f()}}}catch(c){r.e(c)}finally{r.f()}return Array.from(n)}(e._scopes)),t}var qt=Number.EPSILON||1e-14,Yt=function(e,t){return t2&&void 0!==arguments[2]?arguments[2]:"x",o=Xt(a),s=e.length,l=Yt(e,0),c=0;c1&&void 0!==arguments[1]?arguments[1]:"x",a=Xt(i),o=e.length,s=Array(o).fill(0),l=Array(o),c=Yt(e,0);for(t=0;t0||t>0)&&(!n||!n.shadowRoot)}(s,l,i.target))n=s,r=l;else{var u=t.getBoundingClientRect();n=o.clientX-u.left,r=o.clientY-u.top,c=!0}return{x:n,y:r,box:c}}(e,n),c=l.x,u=l.y,f=l.box,d=o.left+(f&&s.left),h=o.top+(f&&s.top),p=t.width,v=t.height;return a&&(p-=o.width+s.width,v-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((u-h)/v*n.height/r)}}var cn=function(e){return Math.round(10*e)/10};function un(e,t,n,r){var i=an(e),a=sn(i,"margin"),o=rn(i.maxWidth,e,"clientWidth")||Q,s=rn(i.maxHeight,e,"clientHeight")||Q,l=function(e,t,n){var r,i;if(void 0===t||void 0===n){var a=nn(e);if(a){var o=a.getBoundingClientRect(),s=an(a),l=sn(s,"border","width"),c=sn(s,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=rn(s.maxWidth,a,"clientWidth"),i=rn(s.maxHeight,a,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:r||Q,maxHeight:i||Q}}(e,t,n),c=l.width,u=l.height;if("content-box"===i.boxSizing){var f=sn(i,"border","width"),d=sn(i,"padding");c-=d.width+f.width,u-=d.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,r?Math.floor(c/r):u-a.height),c=cn(Math.min(c,o,l.maxWidth)),u=cn(Math.min(u,s,l.maxHeight)),c&&!u&&(u=cn(c/2)),{width:c,height:u}}function fn(e,t,n){var r=t||1,i=Math.floor(e.height*r),a=Math.floor(e.width*r);e.height=i/r,e.width=a/r;var o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height="".concat(e.height,"px"),o.style.width="".concat(e.width,"px")),(e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a)&&(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0)}var dn=function(){var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(n){}return e}();function hn(e,t){var n=function(e,t){return an(e).getPropertyValue(t)}(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function pn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function vn(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:"middle"===r?n<.5?e.y:t.y:"after"===r?n<1?e.y:t.y:n>0?t.y:e.y}}function mn(e,t,n,r){var i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=pn(e,i,n),s=pn(i,a,n),l=pn(a,t,n),c=pn(o,s,n),u=pn(s,l,n);return pn(c,u,n)}var gn=new Map;function bn(e,t,n){return function(e,t){t=t||{};var n=e+JSON.stringify(t),r=gn.get(n);return r||(r=new Intl.NumberFormat(e,t),gn.set(n,r)),r}(t,n).format(e)}function yn(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}}function On(e,t){var n,r;"ltr"!==t&&"rtl"!==t||(r=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function kn(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function xn(e){return"angle"===e?{between:le,compare:oe,normalize:se}:{between:function(e,t,n){return e>=Math.min(t,n)&&e<=Math.max(n,t)},compare:function(e,t){return e-t},normalize:function(e){return e}}}function wn(e){var t=e.start,n=e.end,r=e.count;return{start:t%r,end:n%r,loop:e.loop&&(n-t+1)%r===0,style:e.style}}function jn(e,t,n){if(!n)return[e];for(var r,i,a,o=n.property,s=n.start,l=n.end,c=t.length,u=xn(o),f=u.compare,d=u.between,h=u.normalize,p=function(e,t,n){var r,i,a=n.property,o=n.start,s=n.end,l=xn(a),c=l.between,u=l.normalize,f=t.length,d=e.start,h=e.end,p=e.loop;if(p){for(d+=f,h+=f,r=0,i=f;ri&&e[a%t].skip;)a--;return{start:i,end:a%=t}}(n,i,a,r),s=o.start,l=o.end;return Mn(e,!0===r?[{start:s,end:l,loop:a}]:function(e,t,n,r){var i,a=e.length,o=[],s=t,l=e[t];for(i=t+1;i<=n;++i){var c=e[i%a];c.skip||c.stop?l.skip||(r=!1,o.push({start:t%a,end:(i-1)%a,loop:r}),t=s=c.stop?i:null):(s=i,l.skip&&(t=i)),l=c}return null!==s&&o.push({start:t%a,end:s%a,loop:r}),o}(n,s,l1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"composeDesc",value:function(e){return this.empty?e:e.empty?this:b(this,e)}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.Simple,r=0,i=0,a=0;ae)return i+(e-r);i+=o}else{if(n!=c.Simple&&l>=e&&(n==c.TrackDel&&re||n==c.TrackBefore&&re))return-1;if(l>e||l==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"mapPosStable",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0,r=0,i=0,a=0;ae)return r+Math.max(0,e-n);i=r+=o}else{if(t<=0&&l>=e)return i;r+=s}n=l}return r}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&o>=e)return!(rt)||"cover";r=o}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];return g(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,a=0;i=0){t[i]=s,t[i+1]=o;for(var c=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"filter",value:function(e){var t=[],r=[],i=[],a=new y(this);e:for(var o=0,s=0;;){for(var l=o==e.length?1e9:e[o++];s0&&v(r,t,a.text),a.forward(c),s+=c}for(var f=e[o++];s>1].toJSON()])}return e}},{key:"desc",get:function(){return new d(this.sections)}}],[{key:"of",value:function(e,t,i){var a=[],o=[],s=0,c=null;function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||a.length){sy||g<0||y>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(y," (in doc of length ").concat(t,")"));var k=O?"string"==typeof O?l.a.of(O.split(i||f)):O:l.a.empty,x=k.length;if(g==y&&0==x)return;gs&&p(a,g-s,-1),p(a,y-g,x),v(o,a,k),s=y}}(e),u(!c),c}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){for(var t=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function v(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,u,a,f,d),i=u,a=f}}}function g(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],a=r?[]:null,o=new y(e),s=new y(t),l=0,c=0;;)if(-1==o.ins)l+=o.len,o.next();else if(-1==s.ins&&c=0&&(o.done||cc&&!o.done&&l+o.len=0)){if(o.done&&s.done)return a?new h(i,a):new d(i);throw new Error("Mismatched change set lengths")}for(var f=0,m=l+o.len;;)if(s.ins>=0&&c>l&&c+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,a=new y(e),o=new y(t),s=!1;;){if(a.done&&o.done)return i?new h(r,i):new d(r);if(0==a.ins)p(r,a.len,0,s),a.next();else if(0!=o.len||o.done){if(a.done||o.done)throw new Error("Mismatched change set lengths");var l=Math.min(a.len2,o.len),c=r.length;if(-1==a.ins){var u=-1==o.ins?-1:o.off?0:o.ins;p(r,l,u,s),i&&u&&v(i,r,o.text)}else-1==o.ins?(p(r,a.off?0:a.len,l,s),i&&v(i,r,a.textBit(l))):(p(r,a.off?0:a.len,o.off?0:o.ins,s),i&&!o.off&&v(i,r,o.text));s=(a.ins>l||o.ins>=0&&o.len>l)&&(s||r.length>c),a.forward2(l),o.forward(l)}else p(r,0,o.ins,s),i&&v(i,r,o.text),o.next()}}var y=function(){function e(t){Object(o.a)(this,e),this.set=t,this.i=0,this.next()}return Object(s.a)(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return n>=t.length&&!e?l.a.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var e=this.set.inserted,t=this.i-2>>1;return t>=e.length?l.a.empty:e[t]}}]),e}(),O=function(){function e(t,n,r){Object(o.a)(this,e),this.from=t,this.to=n,this.flags=r}return Object(s.a)(e,[{key:"map",value:function(t){var n=t.mapPos(this.from),r=t.mapPos(this.to);return n==this.from&&r==this.to?this:new e(n,r,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return k.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return k.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return k.range(e.anchor,e.head)}}]),e}(),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(o.a)(this,e),this.ranges=t,this.primaryIndex=n}return Object(s.a)(e,[{key:"map",value:function(t){return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t)})),this.primaryIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.primaryIndex!=e.primaryIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.primaryIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.primaryIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.primaryIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),primaryIndex:this.primaryIndex}}},{key:"primary",get:function(){return this.ranges[this.primaryIndex]}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.primaryIndex||t.primaryIndex>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return O.fromJSON(e)})),t.primaryIndex)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new O(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!==r&&void 0!==r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!==n&&void 0!==n?n:33554431)<<5;return t1&&void 0!==arguments[1]?arguments[1]:0,n=e[t];e.sort((function(e,t){return e.from-t.from})),t=e.indexOf(n);for(var r=1;ri.head?k.range(s,o):k.range(o,s))}}return new k(e,t)}function w(e,t){var n,i=Object(r.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(a){i.e(a)}finally{i.f()}}var j=0,S=function(){function e(t,n,r,i){Object(o.a)(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=j++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new M([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new M(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new M(e,this,2,t)}},{key:"from",value:function(e,t){var n=this;return function(r){return D(t,n.compute([r],(function(t){return e(t.field(r))})))}}},{key:"nFrom",value:function(e,t){var n=this;return function(r){return D(t,n.computeN([r],(function(t){return e(t.field(r))})))}}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:C),!!t.static)}}]),e}();function C(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var M=function(){function e(t,n,r,i){Object(o.a)(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=j++}return Object(s.a)(e,[{key:"dynamicSlot",value:function(e){var t,n=this.value,i=this.facet.compareInput,a=e[this.id]>>1,o=2==this.type,s=!1,l=!1,c=[],u=Object(r.a)(this.dependencies);try{for(u.s();!(t=u.n()).done;){var f=t.value;"doc"==f?s=!0:"selection"==f?l=!0:0==(1&e[f.id])&&c.push(e[f.id])}}catch(d){u.e(d)}finally{u.f()}return function(e,t){if(!t||t.reconfigure)return e.values[a]=n(e),1;if(!(s&&t.docChanged||l&&(t.docChanged||t.selection)||c.some((function(t){return(1&z(e,t))>0}))))return 0;var r=n(e),u=t.startState.values[a];return(o?function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return function(e,n){var l,c=n?n.reconfigure?n.startState.config.address[t.id]:s<<1:null,u=null==c,f=Object(r.a)(o);try{for(f.s();!(l=f.n()).done;){1&z(e,l.value)&&(u=!0)}}catch(y){f.e(y)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h>1;return function(e,r){if(!r)return e.values[n]=t.createF(e),1;var i,a=0;if(r.reconfigure){var o=function(e,t){var n=e.config.address[t];return null==n?null:n>>1}(r.startState,t.id);i=null==o?t.createF(r.startState):r.startState.values[o],a=1}else i=r.startState.values[n];var s=t.updateF(i,r);return a||t.compareF(i,s)||(a=1),a&&(e.values[n]=s),a}}}],[{key:"define",value:function(t){var n=[],i=new e(j++,t.create,t.update,t.compare||function(e,t){return e===t},n);if(t.provide){var a,o=Object(r.a)(t.provide);try{for(o.s();!(a=o.n()).done;){var s=a.value;s instanceof S?n.push(s.compute([i],(function(e){return e.field(i)}))):n.push(s(i))}}catch(l){o.e(l)}finally{o.f()}}return i}}]),e}(),P={fallback:3,default:2,extend:1,override:0};function _(e,t){if(!P.hasOwnProperty(t))throw new RangeError("Invalid precedence: ".concat(t));return new A(e,P[t])}function D(e,t){return e?_(t,e):t}var A=function e(t,n){Object(o.a)(this,e),this.e=t,this.prec=n},R=function e(t,n){Object(o.a)(this,e),this.tag=t,this.extension=n};var L=function(){function e(t,n,r,i,a){for(Object(o.a)(this,e),this.source=t,this.replacements=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),a=arguments.length>2?arguments[2]:void 0,o=[],s=Object.create(null),l=Object(r.a)(N(t,i));try{for(l.s();!(n=l.n()).done;){var c=n.value;c instanceof T?o.push(c):(s[c.facet.id]||(s[c.facet.id]=[])).push(c)}}catch(b){l.e(b)}finally{l.f()}for(var u=Object.create(null),f=[],d=[],h=function(){var e=v[p];u[e.id]=d.length<<1,d.push((function(t){return e.slot(t)}))},p=0,v=o;p=s)return;var c=n[l].indexOf(e);c>-1&&n[l].splice(c,1)}if(i.set(e,s),Array.isArray(e)){var u,f=Object(r.a)(e);try{for(f.s();!(u=f.n()).done;){o(u.value,s)}}catch(d){f.e(d)}finally{f.f()}}else if(e instanceof R){if(e.tag in a)throw new RangeError("Duplicate use of tag '".concat(String(e.tag),"' in extensions"));a[e.tag]=!0,o(t[e.tag]||e.extension,s)}else e.extension?o(e.extension,s):e instanceof A?o(e.e,e.prec):(n[s].push(e),e instanceof T&&o(e.facets,s))}o(e,P.default);var s,l,c=Object(r.a)((l=t,(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l):[]).concat(Object.keys(l))));try{for(c.s();!(s=c.n()).done;){var u=s.value;!(u in a)&&"full"!=u&&t[u]&&(a[u]=!0,o(t[u],P.default))}}catch(f){c.e(f)}finally{c.f()}return n.reduce((function(e,t){return e.concat(t)}))}function z(e,t){if(1&t)return 2;var n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.config.dynamicSlots[n](e,e.applying);return e.status[n]=2|i}function I(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var F=S.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),$=S.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),B=S.define(),Q=S.define(),W=new u.c,H=S.define(),V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,e),this.state=t,this.options=n}return Object(s.a)(e,[{key:"textAfterPos",value:function(e){var t,n,r=null===(t=this.options)||void 0===t?void 0:t.simulateBreak;return e==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(e,Math.min(e+100,null!=r&&r>e?r:1e9,this.state.doc.lineAt(e).to))}},{key:"countColumn",value:function(e,t){return Object(l.d)(t<0?e:e.slice(0,t),0,this.state.tabSize)}},{key:"lineIndent",value:function(e){var t,n=null===(t=this.options)||void 0===t?void 0:t.overrideIndentation;if(n){var r=n(e.from);if(r>-1)return r}var i=e.slice(0,Math.min(100,e.length));return this.countColumn(i,i.search(/\S/))}},{key:"column",value:function(e){var t,n=this.state.doc.lineAt(e),r=n.slice(0,e-n.from),i=this.countColumn(r,e-n.from),a=(null===(t=this.options)||void 0===t?void 0:t.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return a>-1&&(i+=a-this.countColumn(r,r.search(/\S/))),i}},{key:"unit",get:function(){return this.state.indentUnit}}]),e}(),U=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,null,[{key:"define",value:function(){return new q}}]),e}(),q=function(){function e(){Object(o.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new U(this,e)}}]),e}(),Y=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new X(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;){var o=n.value.map(t);o&&i.push(o)}}catch(s){a.e(s)}finally{a.f()}return i}}]),e}(),X=function(){function e(t){Object(o.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new Y(this,e)}}]),e}(),K=function(){function e(t,n,r,i,a,s,l){Object(o.a)(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.reconfigure=s,this.scrollIntoView=l,this._doc=null,this._state=null,r&&w(r,n.newLength),a.some((function(t){return t.type==e.time}))||(this.annotations=a.concat(e.time.of(Date.now())))}return Object(s.a)(e,[{key:"annotation",value:function(e){var t,n=Object(r.a)(this.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.type==e)return i.value}}catch(a){n.e(a)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}}]),e}();function G(e,t){for(var n=[],r=0,i=0;;){var a=void 0,o=void 0;if(r=e[r]))a=e[r++],o=e[r++];else{if(!(i=0;f--){var d=u[f](e);e=d instanceof K?d:Array.isArray(d)&&1==d.length&&d[0]instanceof K?d[0]:ee(n,Array.isArray(d)?d:[d],!1)}return e}(s):s}K.time=U.define(),K.userEvent=U.define(),K.addToHistory=U.define();var te,ne=[];!function(e){e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other"}(te||(te={}));var re,ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{re=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(le){}function ae(e){return function(t){if(!/\S/.test(t))return te.Space;if(function(e){if(re)return re.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ie.test(n)))return!0}return!1}(t))return te.Word;for(var n=0;n-1)return te.Word;return te.Other}}var oe=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(Object(o.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.applying=null,this.status=t.statusTemplate.slice(),i&&!i.reconfigure)this.values=i.startState.values.slice();else if(this.values=t.dynamicSlots.map((function(e){return null})),i)for(var a in t.address){var s=t.address[a],l=i.startState.config.address[a];null!=l&&0==(1&s)&&(this.values[s>>1]=I(i.startState,l))}this.applying=i,i&&(i._state=this);for(var c=0;c1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return z(this,n),I(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof h?t:h.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return l.a.of(t.split(this.facet(e.lineSeparator)||f))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(z(this,t),I(this,t))}},{key:"toJSON",value:function(){return{doc:this.sliceDoc(),selection:this.selection.toJSON()}}},{key:"indentString",value:function(t){var n="";if(9==this.facet(e.indentUnit).charCodeAt(0))for(;t>=this.tabSize;)n+="\t",t-=this.tabSize;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");return e.create({doc:t.doc,selection:k.fromJSON(t.selection),extensions:n.extensions})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=L.resolve(t.extensions||[]),r=t.doc instanceof l.a?t.doc:l.a.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||f)),i=t.selection?t.selection instanceof k?t.selection:k.single(t.selection.anchor,t.selection.head):k.single(0);return w(i,r.length),n.staticFacet(F)||(i=i.asSingle()),new e(n,r,i)}}]),e}();function se(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={},o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;)for(var s=n.value,l=0,c=Object.keys(s);l=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw o}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(55);function i(e,t){if(null==e)return{};var n,i,a=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"===typeof e||"number"===typeof e)i+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},O="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),k="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),x="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),w="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),j="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),S=O&&(w||+O[1]<57)||x&&w,C=0;C<10;C++)b[48+C]=b[96+C]=String(C);for(C=1;C<=24;C++)b[C+111]="F"+C;for(C=65;C<=90;C++)b[C]=String.fromCharCode(C+32),y[C]=String.fromCharCode(C);for(var M in b)y.hasOwnProperty(M)||(y[M]=b[M]);var E="undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],T=Object(h.a)(E,2),P=T[0],_=T[1],D=/Edge\/(\d+)/.exec(P.userAgent),A=/MSIE \d/.test(P.userAgent),R=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(P.userAgent),L=!!(A||R||D),N=!L&&/gecko\/(\d+)/i.test(P.userAgent),z=!L&&/Chrome\/(\d+)/.exec(P.userAgent),I="webkitFontSmoothing"in _.documentElement.style,F={mac:/Mac/.test(P.platform),ie:L,ie_version:A?_.documentMode||6:R?+R[1]:D?+D[1]:0,gecko:N,gecko_version:N?+(/Firefox\/(\d+)/.exec(P.userAgent)||[0,0])[1]:0,chrome:!!z,chrome_version:z?+z[1]:0,ios:!L&&/AppleWebKit/.test(P.userAgent)&&/Mobile\/\w+/.test(P.userAgent),android:/Android\b/.test(P.userAgent),webkit:I,safari:/Apple Computer/.test(P.vendor),webkit_version:I?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=_.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function $(e){return e.getSelection?e.getSelection():document.getSelection()}function B(e,t){if(!t.anchorNode)return!1;try{return e.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)}catch(n){return!1}}function Q(e){if(3==e.nodeType){var t=J();return t.setEnd(e,e.nodeValue.length),t.setStart(e,0),t.getClientRects()}return 1==e.nodeType?e.getClientRects():[]}function W(e,t,n,r){return!!n&&(V(e,t,n,r,-1)||V(e,t,n,r,1))}function H(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function V(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:U(e))){if("DIV"==e.nodeName)return!1;var a=e.parentNode;if(!a||1!=a.nodeType)return!1;t=H(e)+(i<0?0:1),e=a}else{if(1!=e.nodeType)return!1;e=e.childNodes[t+(i<0?-1:0)],t=i<0?U(e):0}}}function U(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function q(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Y(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var X,K=function(){function e(){Object(f.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}}]),e}(),G=null;function Z(e){if(e.setActive)return e.setActive();if(G)return e.focus(G);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0}}:void 0),!G){G=!1;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];Object(f.a)(this,e),this.node=t,this.offset=n,this.precise=r}return Object(d.a)(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,H(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,H(t)+1,n)}}]),e}(),te=[],ne=function(){function e(){Object(f.a)(this,e),this.parent=null,this.dom=null,this.dirty=2}return Object(d.a)(e,[{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=Object(u.a)(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(a){r.e(a)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"coordsAt",value:function(e,t){return null}},{key:"sync",value:function(t){if(2&this.dirty){var n,r=this.dom,i=null,a=Object(u.a)(this.children);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(o.dirty){var s=i?i.nextSibling:r.firstChild;!s||o.dom||e.get(s)||o.reuseDOM(s),o.sync(t),o.dirty=0}t&&t.node==r&&i!=o.dom&&(t.written=!0),ie(r,i,o.dom),i=o.dom}}catch(h){a.e(h)}finally{a.f()}var l=i?i.nextSibling:r.firstChild;for(l&&t&&t.node==r&&(t.written=!0);l;)l=re(l)}else if(1&this.dirty){var c,f=Object(u.a)(this.children);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.dirty&&(d.sync(t),d.dirty=0)}}catch(h){f.e(h)}finally{f.f()}}}},{key:"reuseDOM",value:function(e){return!1}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==U(t)?0:0==n?-1:1;;){var a=t.parentNode;if(a==this.dom)break;0==i&&a.firstChild!=a.lastChild&&(i=t==a.firstChild?-1:1),t=a}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var o=0,s=0;;o++){var l=this.children[o];if(l.dom==r)return s;s+=l.length+l.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,a=-1,o=-1,s=0,l=n;st)return c.domBoundsAround(e,t,l);if(u>=e&&-1==r&&(r=s,i=l),u>=t&&-1==a){a=s,o=u;break}l=u+c.breakAfter}return{from:i,to:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(e))}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom=e,e.cmView=this}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new ae(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function re(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}function ie(e,t,n){var r=t?t.nextSibling:e.firstChild;if(n.parentNode==e)for(;r!=n;)r=re(r);else e.insertBefore(n,r)}ne.prototype.breakAfter=0;var ae=function(){function e(t,n,r){Object(f.a)(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Object(d.a)(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}(),oe=[],se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}}]),n}(ne);se.prototype.children=oe;var le=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).text=e,r}return Object(d.a)(n,[{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){return 3==e.nodeType&&(this.createDOM(e),!0)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"slice",value:function(e){return new n(this.text.slice(e))}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new ee(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return ue(this.dom,e,t,this.length)}},{key:"length",get:function(){return this.text.length}}]),n}(se),ce=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,n),(r=t.call(this)).mark=e,r.children=a,r.length=o;var s,l=Object(u.a)(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.setParent(Object(i.a)(r))}}catch(d){l.e(d)}finally{l.f()}return r}return Object(d.a)(n,[{key:"createDOM",value:function(){var e=document.createElement(this.mark.tagName);if(this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);this.setDOM(e)}},{key:"sync",value:function(e){this.dom||this.createDOM(),Object(a.a)(Object(o.a)(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,a){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&i<=0||tt&&r.push(i=0?F.chrome||F.gecko||(t?(i--,o=1):(a++,o=-1)):n<0?i--:a++;var s=J();s.setEnd(e,a),s.setStart(e,i);var l=s.getBoundingClientRect();return o?q(l,o<0):l}var fe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var a;return Object(f.a)(this,n),(a=t.call(this)).widget=e,a.length=r,a.side=i,a}return Object(d.a)(n,[{key:"slice",value:function(e){return n.create(this.widget,this.length-e,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return r}},{key:"overrideDOMText",get:function(){if(0==this.length)return g.a.empty;for(var e=this;e.parent;)e=e.parent;var t=e.editorView,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):g.a.empty}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(se),de=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"domAtPos",value:function(e){return new ee(this.widget.text,e)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){return t?3==e.nodeType?Math.min(t,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(e,t){return ue(this.widget.text,e,t,this.length)}},{key:"overrideDOMText",get:function(){return null}}]),n}(fe);function he(e,t,n,r,i,a){var o,s=e.childCursor(),l=s.findPos(n,1),c=l.i,f=l.off,d=s.findPos(t,-1),h=d.i,p=d.off,v=t-n,m=Object(u.a)(r);try{for(m.s();!(o=m.n()).done;){v+=o.value.length}}catch(w){m.e(w)}finally{m.f()}e.length+=v;var g=e.children;if(h==c&&p){var b=g[h];if(1==r.length&&b.merge(p,f,r[0],i,a))return;if(0==r.length)return void b.merge(p,f,null,i,a);var y=b.slice(f);y.merge(0,0,r[r.length-1],0,a)?r[r.length-1]=y:r.push(y),c++,a=f=0}if(f){var O=g[c];r.length&&O.merge(0,f,r[r.length-1],0,a)?(r.pop(),a=0):O.merge(0,f,null,0,0)}else ci&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return ee.after(s)}return new ee(e,0)}function ve(e,t,n){var r,i=e.children;n>0&&t instanceof ce&&i.length&&(r=i[i.length-1])instanceof ce&&r.mark.eq(t.mark)?ve(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function me(e,t,n){for(var r=0,i=0;i=t:o>t)return a.coordsAt(t-r,n);r=o}}return(e.dom.lastChild||e.dom).getBoundingClientRect()}function ge(e,t){for(var n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function be(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,a=n;i-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(e){return new we(e)}},{key:"widget",value:function(e){var t=e.side||0;return e.block&&(t+=200000001*(t>0?1:-1)),new Se(e,t,t,!!e.block,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ce(e),r=n.start,i=n.end;return new Se(e,t?-2e8*(r?2:1):1e8*(r?-1:1),t?2e8*(i?2:1):1e8*(i?1:-1),t,e.widget||null,!0)}},{key:"line",value:function(e){return new je(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m.b.of(e,t)}}]),n}(m.d);xe.none=m.b.empty;var we=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;Object(f.a)(this,n);var i=Ce(e),a=i.start,o=i.end;return(r=t.call(this,1e8*(a?-1:1),1e8*(o?1:-1),null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Object(d.a)(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&be(this.attrs,e.attrs)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=t)throw new RangeError("Mark decorations may not be empty");return Object(a.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(xe);we.prototype.point=!1;var je=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,-1e8,-1e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&be(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return Object(a.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(xe);je.prototype.mapMode=p.h.TrackBefore,je.prototype.point=!0;var Se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,a,o,s){var l;return Object(f.a)(this,n),(l=t.call(this,r,i,o,e)).block=a,l.isReplace=s,l.mapMode=a?r<0?p.h.TrackBefore:p.h.TrackAfter:p.h.TrackDel,l}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return Object(a.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}},{key:"type",get:function(){return this.startSide=5}}]),n}(xe);function Ce(e){var t=e.inclusiveStart,n=e.inclusiveEnd;return null==t&&(t=e.inclusive),null==n&&(n=e.inclusive),{start:t||!1,end:n||!1}}Se.prototype.point=!0;function Me(e,t,n){var r=n.length-1;r>=0&&n[r]+4>e?n[r]=Math.max(n[r],t):n.push(e,t)}var Ee=p.f.define({combine:function(e){return e.join(" ")}}),Te=p.f.define({combine:function(e){return e.indexOf(!0)>-1}}),Pe=v.a.newName();function _e(e){return e.replace(/\$\w[\w\.]*/g,(function(e){for(var t=e.slice(1).split("."),n="",r=1;r<=t.length;r++)n+=".cm-"+t.slice(0,r).join("-");return n}))}function De(e,t){return new v.a(t,{process:function(t){return t=_e(t),/\$/.test(t)?t.replace(/\$/,e):e+" "+t},extend:function(t,n){return t=_e(t),n.slice(0,e.length+1)==e+" "?e+" "+t.replace(/&/,n.slice(e.length+1)):t.replace(/&/,n)}})}function Ae(e){if(e.indexOf(".")<0)return"cm-"+e;for(var t=e.split("."),n="",r=1;r<=t.length;r++)n+=(n?" ":"")+"cm-"+t.slice(0,r).join("-");return n}var Re,Le=De("."+Pe,{$:{position:"relative !important",boxSizing:"border-box","&$focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},display:"flex !important",flexDirection:"column"},$scroller:{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},$content:{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",boxSizing:"border-box",padding:"4px 0",outline:"none"},"$$light $content":{caretColor:"black"},"$$dark $content":{caretColor:"white"},$line:{display:"block",padding:"0 2px 0 4px"},$selectionLayer:{zIndex:-1,contain:"size style"},$selectionBackground:{position:"absolute"},"$$light $selectionBackground":{background:"#d9d9d9"},"$$dark $selectionBackground":{background:"#222"},"$$focused$light $selectionBackground":{background:"#d7d4f0"},"$$focused$dark $selectionBackground":{background:"#233"},$cursorLayer:{zIndex:100,contain:"size style",pointerEvents:"none"},"$$focused $cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},$cursor:{position:"absolute",borderLeft:"1.2px solid #aaa",marginLeft:"-0.6px",pointerEvents:"none"},"$$focused $cursor":{borderLeft:"1.2px solid black"},$placeholder:{color:"#888",display:"inline-block"},$button:{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"$$light $button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"$$dark $button":{backgroundImage:"linear-gradient(#555, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},$textfield:{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"$$light $textfield":{backgroundColor:"white"},"$$dark $textfield":{border:"1px solid #555",backgroundColor:"inherit"}}),Ne=Ae("line"),ze=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(f.a)(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,a,o){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),he(this,e,t,r?r.children:Ie,a,o),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,a=r.off;a&&(t.append(this.children[i].slice(a),0),this.children[i].merge(a,this.children[i].length,null,0,0),i++);for(var o=i;o0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){be(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){ve(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes;t&&(this.attrs=ge(t,this.attrs||{}))}},{key:"domAtPos",value:function(e){return pe(this.dom,this.children,e)}},{key:"sync",value:function(e){this.dom||(this.setDOM(document.createElement("div")),this.dom.className=Ne,this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ye(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add(Ne),this.prevAttrs=void 0),Object(a.a)(Object(o.a)(n.prototype),"sync",this).call(this,e);var t=this.dom.lastChild;if(!t||"BR"!=t.nodeName&&ne.get(t)instanceof fe){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof le))return null;var i=Q(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(a){n.e(a)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return me(this,e,t)}},{key:"match",value:function(e){return!1}},{key:"type",get:function(){return Oe.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var a=e.children[r],o=i+a.length;if(o>=t){if(a instanceof n)return a;if(a.length)return null}i=o+a.breakAfter}}}]),n}(ne),Ie=[],Fe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var a;return Object(f.a)(this,n),(a=t.call(this)).widget=e,a.length=r,a.type=i,a.breakAfter=0,a}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,a,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&a<=0||t=0;n--)e=new ce(t[n],[e],e.length);return e}},{key:"buildText",value:function(e,t,n){for(;e>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,a=r.lineBreak,o=r.done;if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e);this.getLine().append(this.wrapMarks(new le(this.text.slice(this.textOff,this.textOff+s)),t),n),e-=s,this.textOff+=s}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i){var a=t-e;if(n instanceof Se)if(n.block){var o=n.type;o!=Oe.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new Fe(n.widget||new Be("div"),a,o))}else{var s=this.wrapMarks(fe.create(n.widget||new Be("span"),a,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,r,i){var a=new e(t,n,r);return a.openEnd=m.b.spans(i,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(),a}}]),e}(),Be=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).tag=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}}]),n}(ke);!function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Re||(Re={}));var Qe=Re.LTR,We=Re.RTL;function He(e){for(var t=[],n=0;n=t){if(o.level==n)return a;(i<0||(0!=r?r<0?o.fromt:e[i].level>o.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),Xe=[];function Ke(e,t){var n,r=e.length,i=t==Qe?1:2;if(!e||1==i&&!qe.test(e))return Ge(r);for(var a=0,o=i,s=i;aw;){for(var C=S,M=2!=Xe[--S];S>w&&M==(2!=Xe[S-1]);)S--;k.push(new Ye(S,C,M?2:1))}else k.push(new Ye(w,x,0))}else for(var E=0;E-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(e,t,n,r,i,a){var o=tt.indexOf(e)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=o||this.direction!=t;if(this.lineWrapping=o,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:2;Object(f.a)(this,e),this.length=t,this.height=n,this.flags=r}return Object(d.a)(e,[{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>1e-4&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,a=r.length-1;a>=0;a--){var o=r[a],s=o.fromA,l=o.toA,c=o.fromB,u=o.toB,f=i.lineAt(s,et.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,et.ByPosNoHeight,t,0,0);for(u+=d.to-l,l=d.to;a>0&&f.from<=r[a-1].toA;)s=r[a-1].fromA,c=r[a-1].fromB,a--,s0},set:function(e){this.flags=(e?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new st(0,0)}},{key:"of",value:function(t){if(1==t.length)return t[0];for(var n=0,r=t.length,i=0,a=0;;)if(n==r)if(i>2*a){var o=t[n-1];o.break?t.splice(--n,1,o.left,null,o.right):t.splice(--n,1,o.left,o.right),r+=1+o.break,i-=o.size}else{if(!(a>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,a-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(at),st=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this,e,r,Oe.Text)).collapsed=0,i.widgetHeight=0,i}return Object(d.a)(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof lt&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof lt?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):at.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(ot),lt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,e,0)}return Object(d.a)(n,[{key:"lines",value:function(e,t){var n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(e,t,n,r){var i=this.lines(t,r),a=i.firstLine,o=i.lastLine,s=i.lineHeight,l=Math.max(0,Math.min(o-a,Math.floor((e-n)/s))),c=t.line(a+l),u=c.from,f=c.length;return new it(u,f,n+s*l,s,Oe.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==et.ByHeight)return this.blockAt(e,n,r,i);if(t==et.ByPosNoHeight){var a=n.lineAt(e),o=a.from,s=a.to;return new it(o,s-o,0,0,Oe.Text)}var l=this.lines(n,i),c=l.firstLine,u=l.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new it(d,h,r+u*(p-c),u,Oe.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,a){for(var o=this.lines(n,i),s=o.firstLine,l=o.lineHeight,c=e;c0){var a=r[r.length-1];a instanceof n?r[r.length-1]=new n(a.length+i):r.push(null,new n(i-1))}if(e>0){var o=r[0];o instanceof n?r[0]=new n(e+o.length):r.unshift(new n(e-1),null)}return at.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(new n(e-1),null)}},{key:"decomposeRight",value:function(e,t){t.push(null,new n(this.length-e-1))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,a=t+this.length;if(i&&i.from<=t+this.length&&i.more){var o=[],s=Math.max(t,i.from);for(i.from>t&&o.push(new n(i.from-t-1).updateHeight(e,t));s<=a&&i.more;){var l=e.doc.lineAt(s).length;o.length&&o.push(null);var c=new st(l,i.heights[i.index++]);c.outdated=!1,o.push(c),s+=l+1}return s<=a&&o.push(null,new n(a-s).updateHeight(e,s)),e.heightChanged=!0,at.of(o)}return(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(at),ct=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var a;return Object(f.a)(this,n),(a=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,a.right=i,a.size=e.size+i.size,a}return Object(d.a)(n,[{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return eo))return l;var c=t==et.ByPosNoHeight?et.ByPosNoHeight:et.ByPos;return s?l.join(this.right.lineAt(o,c,n,a,o)):this.left.lineAt(o,c,n,r,i).join(l)}},{key:"forEachLine",value:function(e,t,n,r,i,a){var o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,o,s,a);else{var l=this.lineAt(s,et.ByPos,n,r,i);e=e&&l.from<=t&&a(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,o,s,a)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var a,o=i.length,s=Object(u.a)(n);try{for(s.s();!(a=s.n()).done;){var l=a.value;i.push(l)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&ut(i,o-1),t=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?at.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,a=this.right,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}},{key:"break",get:function(){return 1&this.flags}}]),n}(at);function ut(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof lt&&(r=e[t+1])instanceof lt&&e.splice(t-1,3,new lt(n.length+1+r.length))}var ft=function(){function e(t,n){Object(f.a)(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Object(d.a)(e,[{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof st?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new st(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new st(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new lt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof st)return e;var t=new st(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Oe.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Oe.WidgetBefore&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t){var n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof st||this.isCovered?(this.writtenTo0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;a+=2}if(!l)return r;new e(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),o=l.toA,s=l.toB}}}]),e}(),Nt=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pt;Object(f.a)(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.prevState=t.state,this.changes=p.b.empty(this.prevState.doc.length);var i,a=Object(u.a)(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.changes=this.changes.compose(o.changes)}}catch(c){a.e(c)}finally{a.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new Lt(e,t,n,r))})),this.changedRanges=s;var l=t.hasFocus;l!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=l,this.flags),this.docChanged&&(this.flags|=2)}return Object(d.a)(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(e){return e.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}();var zt=function(){function e(t,n,r){Object(f.a)(this,e),this.from=t,this.to=n,this.size=r}return Object(d.a)(e,[{key:"draw",value:function(e){return xe.replace({widget:new It(this.size,e)}).range(this.from,this.to)}}],[{key:"same",value:function(e,t){if(e.length!=t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=e.state;var r=this.state.facet(At),i=e.changedRanges,a=Lt.extendWithRanges(i,dt(e.prevState.facet(At),r,e?e.changes:p.b.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(r,n.doc,this.heightOracle.setDoc(this.state.doc),a),this.heightMap.height!=o&&(e.flags|=2);var s=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t)),s.eq(this.viewport)||(this.viewport=s,e.flags|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(e.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes)))),this.computeVisibleRanges(),t&&(this.scrollTo=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.primary.empty&&e.state.selection.primary.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e,t){var n=e.dom,r="",i=Re.LTR;if(!t){var a=window.getComputedStyle(n);r=a.whiteSpace,i="rtl"==a.direction?Re.RTL:Re.LTR,this.paddingTop=parseInt(a.paddingTop)||0,this.paddingBottom=parseInt(a.paddingBottom)||0}var o=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(e,t){for(var n=e.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),a=Math.max(0,n.top),o=Math.min(innerHeight,n.bottom),s=e.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var l=s.getBoundingClientRect();r=Math.max(r,l.left),i=Math.min(i,l.right),a=Math.max(a,l.top),o=Math.min(o,l.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:a-(n.top+t),bottom:o-(n.top+t)}}(n,this.paddingTop),s=o.top-this.pixelViewport.top,l=o.bottom-this.pixelViewport.bottom;if(this.pixelViewport=o,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var c=e.measureVisibleLineHeights(),u=!1,f=0,d=0,h=this.heightOracle;if(!t){var p=e.dom.clientWidth;if(h.mustRefresh(c,r,i)||h.lineWrapping&&Math.abs(p-this.contentWidth)>h.charWidth){var v=e.measureTextSize(),m=v.lineHeight,g=v.charWidth;(u=h.refresh(r,i,m,g,p/g,c))&&(e.minWidth=0,d|=16)}this.contentWidth!=p&&(this.contentWidth=p,d|=16),s>0&&l>0?f=Math.max(s,l):s<0&&l<0&&(f=Math.min(s,l))}return h.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(h,0,u,new rt(this.viewport.from,c)),h.heightChanged&&(d|=2),(!this.viewportIsAppropriate(this.viewport,f)||this.scrollTo&&(this.scrollTo.headthis.viewport.to))&&(this.viewport=this.getViewport(f,this.scrollTo),d|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(d|=this.updateLineGaps(this.ensureLineGaps(u?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.enforceCursorAssoc()),d}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,a=this.pixelViewport,o=a.top,s=a.bottom,l=new $t(r.lineAt(o-1e3*n,et.ByHeight,i,0,0).from,r.lineAt(s+1e3*(1-n),et.ByHeight,i,0,0).to);if(t)if(t.headl.to){var u=r.lineAt(t.head,et.ByPos,i,0,0).bottom;l=new $t(r.lineAt(u-(s-o)-500,et.ByHeight,i,0,0).from,r.lineAt(u+500,et.ByHeight,i,0,0).to)}return l}},{key:"mapViewport",value:function(e,t){var n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new $t(this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,et.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(e){var t=e.from,n=e.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(t,et.ByPos,this.state.doc,0,0),a=i.top,o=this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0),s=o.bottom;return(0==t||a<=this.pixelViewport.top-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=this.pixelViewport.bottom+Math.max(10,Math.min(r,250)))&&a>this.pixelViewport.top-2e3&&si&&(r.push({from:i,to:e}),a+=e-i),i=t},minPointSize:20}),i=r.from&&(a=l.from),l.from<=r.to&&l.to>=o&&(o=l.to);var c=a-1e4,u=o+1e4;c>r.from+5e3&&n.push(Wt(e,(function(e){return e.from==r.from&&e.to>c-5e3&&e.tou-5e3&&e.from=1)return r[r.length-1].to;for(var i=Math.floor(n*t),a=0;;a++){var o=r[a],s=o.from,l=o.to-s;if(i<=l)return s+i;i-=l}}function Qt(e,t){var n,r=0,i=Object(u.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.from,s=a.to;if(t<=s){r+=t-o;break}r+=s-o}}catch(l){i.e(l)}finally{i.f()}return r/e.total}function Wt(e,t){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t(i))return i}}catch(a){r.e(a)}finally{r.f()}}var Ht=[],Vt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).view=e,r.viewports=Ht,r.compositionDeco=xe.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(e.contentDOM),r.children=[new ze],r.children[0].setParent(Object(i.a)(r)),r.updateInner([new Lt(0,0,0,e.state.doc.length)],r.updateDeco(),0),r}return Object(d.a)(n,[{key:"update",value:function(e){var t,n=this,r=e.changedRanges;this.minWidth>0&&r.length&&(r.every((function(e){var t=e.fromA;return e.toAn.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),(null===(t=this.view.inputState)||void 0===t?void 0:t.composing)?e.transactions.length&&(this.compositionDeco=function(e,t){var n=$(e.root),r=n.focusNode&&Xt(n.focusNode,n.focusOffset,0);if(!r)return xe.none;var i,a,o=e.docView.nearest(r),s=r;if(o instanceof se){for(;o.parent instanceof se;)o=o.parent;a=(i=o.posAtStart)+o.length,s=o.dom}else{if(!(o instanceof ze))return xe.none;for(;s.parentNode!=o.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!ne.get(l);)l=l.previousSibling;i=a=l?ne.get(l).posAtEnd:o.posAtStart}var c=t.mapPos(i,1),u=Math.max(c,t.mapPos(a,-1)),f=r.nodeValue,d=e.state;if(u-c=this.view.viewport.from&&e.state.selection.primary.to<=this.view.viewport.to?(this.updateSelection(i,l),!1):(this.updateInner(r,o,e.prevState.doc.length,i,l),!0)}},{key:"updateInner",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(e,t,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.heightMap.height+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var e=F.chrome?{node:$(r.view.root).focusNode,written:!1}:void 0;r.sync(e),r.dirty=0,(null===e||void 0===e?void 0:e.written)&&(i=!0),r.updateSelection(i,a),r.dom.style.height=""}))}},{key:"updateChildren",value:function(e,t,n){for(var r=this.childCursor(n),i=e.length-1;;i--){var a=i>=0?e[i]:null;if(!a)break;var o=a.fromA,s=a.toA,l=a.fromB,c=a.toB,u=$e.build(this.view.state.doc,l,c,t),f=u.content,d=u.breakAtStart,h=u.openStart,p=u.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,b=r.findPos(o,-1),y=b.i,O=b.off;this.replaceRange(y,O,m,g,f,d,h,p)}}},{key:"replaceRange",value:function(e,t,n,r,i,a,o,s){var l=this.children[e],c=i.length?i[i.length-1]:null,u=c?c.breakAfter:a;if(e!=n||a||u||!(i.length<2)||!l.merge(t,r,i.length?c:null,0==t,o,s)){var f=this.children[n];for(r0&&(!a&&i.length&&l.merge(t,l.length,i[0],!1,o,0)?l.breakAfter=i.shift().breakAfter:(t0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t||this.mayControlSelection()){var n=this.view.state.selection.primary,r=this.domAtPos(n.anchor),i=this.domAtPos(n.head),a=$(this.root);(e||!a.focusNode||F.gecko&&n.empty&&Kt(a.focusNode,a.focusOffset)||!W(r.node,r.offset,a.anchorNode,a.anchorOffset)||!W(i.node,i.offset,a.focusNode,a.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if(F.gecko){var e=Kt(r.node,r.offset);if(e&&3!=e){var t=Xt(r.node,r.offset,1==e?1:-1);t&&(r=new ee(t,1==e?0:t.nodeValue.length))}}a.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=a.cursorBidiLevel&&(a.cursorBidiLevel=n.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(i.node,i.offset);else{var o=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}o.setEnd(i.node,i.offset),o.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(o)}})),this.impreciseAnchor=r.precise?null:new ee(a.anchorNode,a.anchorOffset),this.impreciseHead=i.precise?null:new ee(a.focusNode,a.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var e=this.view.state.selection.primary,t=$(this.root);if(e.empty&&e.assoc&&t.modify){var n=ze.find(this,e.head);if(n){var r=n.posAtStart;if(e.head!=r&&e.head!=r+n.length){var i=this.coordsAt(e.head,-1),a=this.coordsAt(e.head,1);if(i&&a&&!(i.bottom>a.top)){var o=this.domAtPos(e.head+e.assoc);t.collapse(o.node,o.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(xt)?this.root.activeElement==this.dom:B(this.dom,$(this.root))}},{key:"nearest",value:function(e){for(var t=e;t;){var n=ne.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;n=a&&i.type!=Oe.WidgetAfter)return i.coordsAt(e-a,t);n=a}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=0,o=0;or)break;if(a>=n){e.push(s.dom.getBoundingClientRect().height);var c=s.dom.scrollWidth;c>i&&(this.minWidth=i=c,this.minWidthFrom=a,this.minWidthTo=l)}a=l+s.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof ze){var i=r.measureTextSize();if(i)return i}}}catch(l){n.e(l)}finally{n.f()}var a,o,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=Q(s.firstChild)[0];a=s.getBoundingClientRect().height,o=e?e.width/27:7,s.remove()})),{lineHeight:a,charWidth:o}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new ae(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){var e=this.view.viewState.viewport,t=[e],n=this.view.state.selection.primary,r=n.head,i=n.anchor;if(re.to){var a=this.view.viewState.lineAt(r,0),o=a.from,s=a.to;t.push(new $t(o,s))}if(!t.some((function(e){var t=e.from,n=e.to;return i>=t&&i<=n}))){var l=this.view.viewState.lineAt(i,0),c=l.from,u=l.to;t.push(new $t(c,u))}this.viewports=t.sort((function(e,t){return e.from-t.from}));for(var f=[],d=0,h=0;;h++){var p=h==t.length?null:t[h],v=p?p.from-1:this.length;if(v>d){var m=this.view.viewState.lineAt(v,0).bottom-this.view.viewState.lineAt(d,0).top;f.push(xe.replace({widget:new qt(m),block:!0,inclusive:!0}).range(d,v))}if(!p)break;d=p.to+1}return xe.set(f)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(Object(c.a)(this.view.state.facet(At)),Object(c.a)(this.view.pluginField(Et)))}},{key:"scrollPosIntoView",value:function(e,t){var n=this.coordsAt(e,t);if(n){var r,i=0,a=0,o=0,s=0,l=Object(u.a)(this.view.pluginField(jt.scrollMargins));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c){var f=c.left,d=c.right,h=c.top,p=c.bottom;null!=f&&(i=Math.max(i,f)),null!=d&&(a=Math.max(a,d)),null!=h&&(o=Math.max(o,h)),null!=p&&(s=Math.max(s,p))}}}catch(v){l.e(v)}finally{l.f()}!function(e,t){for(var n=e.ownerDocument.defaultView,r=e.parentNode;r;)if(1==r.nodeType){var i=void 0,a=r==document.body;if(a)i=Y(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var o=r.getBoundingClientRect();i={left:o.left,right:o.left+r.clientWidth,top:o.top,bottom:o.top+r.clientHeight}}var s=0,l=0;if(t.topi.bottom&&(l=t.bottom-i.bottom+5),t.lefti.right&&(s=t.right-i.right+5),s||l)if(a)n.scrollBy(s,l);else{if(l){var c=r.scrollTop;r.scrollTop+=l,l=r.scrollTop-c}if(s){var u=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-u}t={left:t.left-s,top:t.top-l,right:t.right-s,bottom:t.bottom-l}}if(a)break;r=r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-o,right:n.right+a,bottom:n.bottom+s})}}},{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}}]),n}(ne),Ut=1e7,qt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).height=e,r}return Object(d.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("div");return this.updateDOM(e),e}},{key:"eq",value:function(e){return e.height==this.height}},{key:"updateDOM",value:function(e){if(this.height0;t-=Ut){e.appendChild(document.createElement("div")).style.height=Math.min(t,Ut)+"px"}}return!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(ke);var Yt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).top=e,i.text=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return this.top==e.top&&this.text==e.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return de}}]),n}(ke);function Xt(e,t,n){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0&&n<=0)t=U(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function Kt(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(te?t.left-e:Math.max(0,e-t.right)}function Jt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function en(e,t){return e.topt.top+1}function tn(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function rn(e,t,n){for(var r,i,a,o,s,l,c,u,f=e.firstChild;f;f=f.nextSibling)for(var d=Q(f),h=0;hm||o==m&&a>v)&&(r=f,i=p,a=v,o=m),0==v?n>p.bottom&&(!c||c.bottomp.top)&&(l=f,u=p):c&&en(c,p)?c=nn(c,p.bottom):u&&en(u,p)&&(u=tn(u,p.top))}if(c&&c.bottom>=n?(r=s,i=c):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?an(r,g,n):a||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:rn(r,g,n)}function an(e,t,n){for(var r=e.nodeValue.length,i=J(),a=0;a=t&&l.top-1<=n&&l.bottom+1>=n)){var c=t>=(l.left+l.right)/2,u=c;if(F.chrome||F.gecko)i.setEnd(e,a),i.getBoundingClientRect().left==l.right&&(u=!c);return{node:e,offset:a+(u?1:0)}}}}return{node:e,offset:0}}function on(e,t){for(var n,r=t.x,i=t.y,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=e.contentDOM.getBoundingClientRect(),s=e.defaultLineHeight/2,l=!1;;){if((n=e.blockAtHeight(i,o.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),l)return-1;l=!0}if(n.type==Oe.Text)break;i=a>0?n.bottom+s:n.top-s}var c=n.from;if(ce.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:-1;r=Math.max(o.left+1,Math.min(o.right-1,r));var u,f=e.root,d=f.elementFromPoint(r,i),h=-1;if(d&&e.contentDOM.contains(d)&&!(e.docView.nearest(d)instanceof fe))if(f.caretPositionFromPoint){var p=f.caretPositionFromPoint(r,i);p&&(u=p.offsetNode,h=p.offset)}else if(f.caretRangeFromPoint){var v=f.caretRangeFromPoint(r,i);v&&(u=v.startContainer,h=v.startOffset)}if(!u||!e.docView.dom.contains(u)){var m=ze.find(e.docView,c),g=rn(m.dom,r,i);u=g.node,h=g.offset}return e.docView.posFromDOM(u,h)}function sn(e,t,n,r){var i=e.state.doc.lineAt(t.head),a=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(a){var o=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==Re.LTR)?o.right-1:o.left+1,y:(a.top+a.bottom)/2});if(s>-1)return p.d.cursor(s,n?-1:1)}var l=ze.find(e.docView,t.head),c=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return p.d.cursor(c,n?-1:1)}function ln(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=t,s=null;;){var l=Je(i,a,e.textDirection,o,n),c=Ze;if(!l){if(i.number==(n?e.state.doc.lines:1))return o;c="\n",i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),l=p.d.cursor(n?i.from:i.to)}if(s){if(!s(c))return o}else{if(!r)return l;s=r(c)}o=l}}var cn=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=!1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(e){var r=dn[e];t.contentDOM.addEventListener(e,(function(i){fn(t,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i))})),n.registeredEvents.push(e)};for(var i in dn)r(i);t.contentDOM.addEventListener("keydown",(function(e){t.inputState.lastKeyCode=e.keyCode,t.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=t.hasFocus,this.ensureHandlers(t)}return Object(d.a)(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=this.customHandlers=e.pluginField(Tt),i=Object(u.a)(r);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){fn(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in a.handlers)o(s)}}catch(l){i.e(l)}finally{i.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=Object(u.a)(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=a.handlers[e];if(o)try{if(o.call(a.plugin,n,t)||n.defaultPrevented)return!0}catch(s){kt(t.state,s)}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=Object(u.a)(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=i.handlers.scroll;if(a)try{a.call(i.plugin,t,e)}catch(o){kt(e.state,o)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(!!this.composing||!!(F.safari&&e.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"mustFlushObserver",value:function(e){return"keydown"==e.type||"compositionend"==e.type}},{key:"startMouseSelection",value:function(e,t,n){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=new un(this,e,t,n)}},{key:"update",value:function(e){this.mouseSelection&&this.mouseSelection.update(e),this.lastKeyCode=this.lastSelectionTime=0}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),un=function(){function e(t,n,r,i){Object(f.a)(this,e),this.inputState=t,this.view=n,this.startEvent=r,this.style=i;var a=n.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=n.state.facet(p.e.allowMultipleSelections)&&function(e,t){var n=e.state.facet(vt);return n.length?n[0](t):F.mac?t.metaKey:t.ctrlKey}(n,r),this.dragMove=function(e,t){var n=e.state.facet(mt);return n.length?n[0](t):F.mac?!t.altKey:!t.ctrlKey}(n,r),this.dragging=!!function(e,t){if(e.state.selection.primary.empty)return!1;var n=$(e.root);if(0==n.rangeCount)return!0;for(var r=n.getRangeAt(0).getClientRects(),i=0;i=t.clientX&&a.top<=t.clientY&&a.bottom>=t.clientY)return!0}return!1}(n,r)&&null,!1===this.dragging&&(r.preventDefault(),this.select(r))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.startEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);t.eq(this.view.state.selection)&&t.primary.assoc==this.view.state.selection.primary.assoc||this.view.dispatch({selection:t,annotations:p.l.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)}}]),e}();function fn(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=ne.get(r))&&n.ignoreEvent(t))return!1;return!0}var dn=Object.create(null),hn=F.ie&&F.ie_version<15||F.ios&&F.webkit_version<604;function pn(e,t){var n,r=e.state,i=1,a=r.toText(t),o=a.lines==r.selection.ranges.length;n=wn&&r.selection.ranges.every((function(e){return e.empty}))&&wn==a.toString()?{changes:r.selection.ranges.map((function(e){return r.doc.lineAt(e.from)})).filter((function(e,t,n){return 0==t||n[t-1]!=e})).map((function(e){return{from:e.from,insert:(o?a.line(i++).slice():t)+r.lineBreak}}))}:o?r.changeByRange((function(e){var t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.slice()},range:p.d.cursor(e.from+t.length)}})):r.replaceSelection(a),e.dispatch(n,{annotations:p.l.userEvent.of("paste"),scrollIntoView:!0})}function vn(e,t,n,r){if(1==r)return p.d.cursor(t,n);if(2==r)return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(0==i.length)return p.d.cursor(t);0==a?n=1:a==i.length&&(n=-1);var o=a,s=a;n<0?o=i.findClusterBreak(a,!1):s=i.findClusterBreak(a,!0);for(var l=r(i.slice(o,s));o>0;){var c=i.findClusterBreak(o,!1);if(r(i.slice(c,o))!=l)break;o=c}for(;sDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(xn+1)%3:1}(t),i=e.state.selection,a=n,o=t;return{update:function(e){e.changes&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes))},get:function(t,s,l){var c;if(t.clientX==o.clientX&&t.clientY==o.clientY?c=a:(c=a=yn(e,t),o=t),!c||!n)return i;var u=vn(e,c.pos,c.bias,r);if(n.pos!=c.pos&&!s){var f=vn(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d=t.top&&e<=t.bottom},gn=function(e,t,n){return mn(t,n)&&e>=n.left&&e<=n.right};function bn(e,t,n,r){var i=ze.find(e.docView,t);if(!i)return 1;var a=t-i.posAtStart;if(0==a)return 1;if(a==i.length)return-1;var o=i.coordsAt(a,-1);if(o&&gn(n,r,o))return-1;var s=i.coordsAt(a,1);return s&&gn(n,r,s)?1:o&&mn(r,o)?-1:1}function yn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY});return n<0?null:{pos:n,bias:bn(e,n,t.clientX,t.clientY)}}var On=F.ie&&F.ie_version<=11,kn=null,xn=0;dn.dragstart=function(e,t){var n=e.state.selection.primary,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},dn.drop=function(e,t){if(t.dataTransfer){var n=e.posAtCoords({x:t.clientX,y:t.clientY}),r=t.dataTransfer.getData("Text");if(!(n<0)&&r){t.preventDefault();var i=e.inputState.mouseSelection,a=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,o={from:n,insert:r},s=e.state.changes(a?[a,o]:o);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(n,-1),head:s.mapPos(n,1)},annotations:p.l.userEvent.of("drop")})}}},dn.paste=function(e,t){e.observer.flush();var n=hn?null:t.clipboardData,r=n&&n.getData("text/plain");r?(pn(e,r),t.preventDefault()):function(e){var t=e.dom.parentNode;if(t){var n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){e.focus(),n.remove(),pn(e,n.value)}),50)}}(e)};var wn=null;function jn(e){e.docView.compositionDeco.size&&e.update([])}dn.copy=dn.cut=function(e,t){var n=function(e){var t,n=[],r=[],i=!1,a=Object(u.a)(e.selection.ranges);try{for(a.s();!(t=a.n()).done;){var o=t.value;o.empty||(n.push(e.sliceDoc(o.from,o.to)),r.push(o))}}catch(h){a.e(h)}finally{a.f()}if(!n.length){var s,l=-1,c=Object(u.a)(e.selection.ranges);try{for(c.s();!(s=c.n()).done;){var f=s.value.from,d=e.doc.lineAt(f);d.number>l&&(n.push(d.slice()),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),l=d.number}}catch(h){c.e(h)}finally{c.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,a=n.linewise;if(r){wn=a?r:null;var o=hn?null:t.clipboardData;o?(t.preventDefault(),o.clearData(),o.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"==t.type&&e.dispatch({changes:i,scrollIntoView:!0,annotations:p.l.userEvent.of("cut")})}},dn.focus=dn.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},dn.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},dn.compositionstart=dn.compositionupdate=function(e){e.inputState.composing||(e.docView.compositionDeco.size&&(e.observer.flush(),jn(e)),e.inputState.composing=!0)},dn.compositionend=function(e){e.inputState.composing=!1,e.inputState.compositionEndedAt=Date.now(),setTimeout((function(){e.inputState.composing||jn(e)}),50)};var Sn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},Cn=F.ie&&F.ie_version<=11,Mn=function(){function e(t,n,r){var i=this;Object(f.a)(this,e),this.view=t,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new K,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var t,n=Object(u.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;i.queue.push(r)}}catch(a){n.e(a)}finally{n.f()}F.ie&&F.ie_version<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?i.flushSoon():i.flush()})),Cn&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=function(){if(i.view.root.activeElement==i.dom){if(F.ie&&F.ie_version<=11&&!i.view.state.selection.primary.empty){var e=$(i.view.root);if(e.focusNode&&W(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return i.flushSoon()}i.flush()}},this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(e){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&(this.flush(),this.onScrollChanged(e))}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var e=0,t=null,n=this.dom;n;)if(1==n.nodeType)!t&&e=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var e=this;if(!(this.delayedFlush>=0)){var t,n=this.queue,r=Object(u.a)(this.observer.takeRecords());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(m){r.e(m)}finally{r.f()}n.length&&(this.queue=[]);var a=$(this.view.root),o=!this.ignoreSelection.eq(a)&&B(this.dom,a);if(0!=n.length||o){var s,l=-1,c=-1,f=!1,d=Object(u.a)(n);try{for(d.s();!(s=d.n()).done;){var h=s.value,p=this.readMutation(h);p&&(p.typeOver&&(f=!0),-1==l?(l=p.from,c=p.to):(l=Math.min(p.from,l),c=Math.max(p.to,c)))}}catch(m){d.e(m)}finally{d.f()}var v=this.view.state;(l>-1||o)&&this.onChange(l,c,f),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return e.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(),"childList"==e.type){var n=En(t,e.previousSibling||e.target.previousSibling,-1),r=En(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var e,t=Object(u.a)(this.scrollTargets);try{for(t.s();!(e=t.n()).done;){e.value.removeEventListener("scroll",this.onScroll)}}catch(n){t.e(n)}finally{t.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),e}();function En(e,t,n){for(;t;){var r=ne.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}var Tn="\ufdda";function Pn(e,t,n,r){var i,a,o,s=e.state.selection.primary;if(t>-1&&(o=e.docView.domBoundsAround(t,n,0))){var l=o,c=l.from,u=l.to,f=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e,t){var n=[];if(t.activeElement!=e)return n;var r=$(t),i=r.anchorNode,a=r.anchorOffset,o=r.focusNode,s=r.focusOffset;i&&(n.push(new An(i,a)),o==i&&s==a||n.push(new An(o,s)));return n}(e.contentDOM,e.root),d=new _n(f);d.readRange(o.startDOM,o.endDOM),a=function(e,t){if(0==e.length)return null;var n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?p.d.single(n+t,r+t):null}(f,c);var h=s.from,v=null;8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100&&(h=s.to,v="end");var m=function(e,t,n,r){var i=Math.min(e.length,t.length),a=0;for(;a0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if("end"==r){n-=o+Math.max(0,a-Math.min(o,s))-a}if(o=o?a-n:0)+(s-o),o=a}else if(s=s?a-n:0)+(o-s),s=a}return{from:a,toA:o,toB:s}}(e.state.doc.sliceString(c,u,Tn),d.text,h-c,v);m&&(i={from:c+m.from,to:c+m.toA,insert:p.k.of(d.text.slice(m.from,m.toB).split(Tn))})}else if(e.hasFocus){var g=$(e.root),b=e.docView,y=b.impreciseHead,O=b.impreciseAnchor,k=y&&y.node==g.focusNode&&y.offset==g.focusOffset?e.state.selection.primary.head:e.docView.posFromDOM(g.focusNode,g.focusOffset),x=O&&O.node==g.anchorNode&&O.offset==g.anchorOffset?e.state.selection.primary.anchor:function(e){var t=e.isCollapsed;return t&&F.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t}(g)?k:e.docView.posFromDOM(g.anchorNode,g.anchorOffset);k==s.head&&x==s.anchor||(a=p.d.single(x,k))}if(i||a)if(!i&&r&&!s.empty&&a&&a.primary.empty&&(i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}),i){var w=e.state;if(F.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&Rn(e,"Enter",10)||i.from==s.from-1&&i.to==s.to&&0==i.insert.length&&Rn(e,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&Rn(e,"Delete",46)))return;var j,S=i.insert.toString();if(e.state.facet(Ot).some((function(t){return t(e,i.from,i.to,S)})))return;if(i.from>=s.from&&i.to<=s.to&&i.to-i.from>=(s.to-s.from)/3){var C=s.fromi.to?w.doc.sliceString(i.to,s.to,Tn):"";j=w.replaceSelection(p.k.of((C+i.insert.sliceString(0,void 0,Tn)+M).split(Tn)))}else{var E=w.changes(i);j={changes:E,selection:a&&!w.selection.primary.eq(a.primary)&&a.primary.to<=E.newLength?w.selection.replaceRange(a.primary):void 0}}e.dispatch(j,{scrollIntoView:!0,annotations:p.l.userEvent.of("input")})}else if(a&&!a.primary.eq(s)){var T,P=!1;e.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==e.inputState.lastSelectionOrigin?P=!0:T=p.l.userEvent.of(e.inputState.lastSelectionOrigin)),e.dispatch({selection:a,scrollIntoView:P,annotations:T})}}var _n=function(){function e(t){Object(f.a)(this,e),this.points=t,this.text=""}return Object(d.a)(e,[{key:"readRange",value:function(e,t){if(e){for(var n=e.parentNode,r=e;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==t)break;var a=ne.get(r),o=ne.get(i);((a?a.breakAfter:Dn(r))||(o?o.breakAfter:Dn(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=Tn),r=i}this.findPointBefore(n,t)}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t,n=ne.get(e),r=n&&n.overrideDOMText;null!=r?t=r.sliceString(0,void 0,Tn):3==e.nodeType?t=e.nodeValue:"BR"==e.nodeName?t=e.nextSibling?Tn:"":1==e.nodeType&&this.readRange(e.firstChild,null),null!=t&&(this.findPointIn(e,t.length),this.text+=t)}}},{key:"findPointBefore",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(a){r.e(a)}finally{r.f()}}},{key:"findPointIn",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t))}}catch(a){r.e(a)}finally{r.f()}}}]),e}();function Dn(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var An=function e(t,n){Object(f.a)(this,e),this.node=t,this.offset=n,this.pos=-1};function Rn(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);e.contentDOM.dispatchEvent(i);var a=new KeyboardEvent("keyup",r);return e.contentDOM.dispatchEvent(a),i.defaultPrevented||a.defaultPrevented}var Ln=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.className=Ae("scroller"),this.scrollDOM.appendChild(this.contentDOM),this.dom=document.createElement("div"),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(e){return t.update([e])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new Ft(n.state||p.e.create()),this.plugins=this.state.facet(Ct).map((function(e){return Pt.create(e,t)})),this.observer=new Mn(this,(function(e,n,r){return Pn(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.measure()})),this.docView=new Vt(this),this.inputState=new cn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,Fn(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Object(d.a)(e,[{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof p.l?arguments.length<=0?void 0:arguments[0]:(e=this.state).update.apply(e,arguments))}},{key:"update",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");this.updateState=2;var t,n=this.state,r=Object(u.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=i.state}}catch(f){r.e(f)}finally{r.f()}var a=new Nt(this,n,e),o=e.some((function(e){return e.scrollIntoView}))?n.selection.primary:null;this.viewState.update(a,o),this.bidiCache=Qn.update(this.bidiCache,a.changes),a.empty||this.updatePlugins(a);var s=this.docView.update(a);this.state.facet(Rt)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.updateState=0,(s||o||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure();var l,c=Object(u.a)(this.state.facet(yt));try{for(c.s();!(l=c.n()).done;){(0,l.value)(a)}}catch(f){c.e(f)}finally{c.f()}}},{key:"setState",value:function(e){var t=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;var n,r=Object(u.a)(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new Ft(e),this.plugins=e.facet(Ct).map((function(e){return Pt.create(e,t)})),this.docView=new Vt(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[],this.updateState=0,this.requestMeasure()}},{key:"updatePlugins",value:function(e){var t=e.prevState.facet(Ct),n=e.state.facet(Ct);if(t!=n){var r,i=[],a=[],o=Object(u.a)(n);try{for(o.s();!(r=o.n()).done;){var s=r.value,l=t.indexOf(s);if(l<0)i.push(Pt.create(s,this));else{var c=this.plugins[l].update(e);a.push(c),i.push(c)}}}catch(v){o.e(v)}finally{o.f()}var f,d=Object(u.a)(this.plugins);try{for(d.s();!(f=d.n()).done;){var h=f.value;a.indexOf(h)<0&&h.destroy(this)}}catch(v){d.e(v)}finally{d.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else for(var p=0;p-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;for(var t=null,n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var a=i.map((function(t){try{return t.read(e)}catch(n){return kt(e.state,n),Bn}})),o=new Nt(this,this.state);o.flags|=r,t?t.flags|=r:t=o,this.updateState=2,this.updatePlugins(o),r&&this.docView.update(o);for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure()}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return t.measure()}))),e){if(null!=e.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(e,t)}},{key:"viewportLines",value:function(e,t){var n=this.viewport,r=n.from,i=n.to;this.viewState.forEachLine(r,i,e,zn(t,this.contentDOM))}},{key:"moveByChar",value:function(e,t,n){return ln(this,e,t,n)}},{key:"moveByGroup",value:function(e,t){var n=this;return ln(this,e,t,(function(t){return function(e,t,n){var r=e.state.charCategorizer(t),i=r(n);return function(e){var t=r(e);return i==p.c.Space&&(i=t),i==t}}(n,e.head,t)}))}},{key:"moveToLineBoundary",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return sn(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return function(e,t,n,r){var i,a=t.head,o=n?1:-1;if(a==(n?e.state.doc.length:0))return p.d.cursor(a);var s=e.coordsAtPos(a);if(s)for(var l=e.dom.getBoundingClientRect(),c=null!==(i=t.goalColumn)&&void 0!==i?i:s.left-l.left,u=l.left+c,f=null!==r&&void 0!==r?r:5,d=o<0?s.top:s.bottom,h=0;h<50;h+=10){var v=on(e,{x:u,y:d+(f+h)*o},o);if(v<0)break;if(v!=a)return p.d.cursor(v,void 0,void 0,c)}var m=e.state.doc,b=m.lineAt(a),y=e.state.tabSize,O=t.goalColumn,k=0;if(null==O){for(var x=m.iterRange(b.from,a);!x.next().done;)k=Object(g.d)(x.value,k,y);O=k*e.defaultCharacterWidth}else k=Math.round(O/e.defaultCharacterWidth);if(o<0&&0==b.from)return p.d.cursor(0);if(o>0&&b.to==m.length)return p.d.cursor(b.to);for(var w=m.line(b.number+o),j=w.from,S=0,C=m.iterRange(w.from,w.to);S>=k&&!C.next().done;){var M=Object(g.e)(C.value,S,k,y),E=M.offset;S=k-M.leftOver,j+=E}return p.d.cursor(j,void 0,void 0,O)}(this,e,t,n)}},{key:"scrollPosIntoView",value:function(e){this.viewState.scrollTo=p.d.cursor(e),this.requestMeasure()}},{key:"posAtCoords",value:function(e){return this.readMeasured(),on(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[Ye.find(i,e-r.from,-1,t)];return q(n,a.dir==Re.LTR==t>0)}},{key:"bidiSpans",value:function(e){if(e.length>Nn)return Ge(e.length);var t,n=this.textDirection,r=Object(u.a)(this.bidiCache);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.from==e.from&&i.dir==n)return i.order}}catch(o){r.e(o)}finally{r.f()}var a=Ke(e.slice(),this.textDirection);return this.bidiCache.push(new Qn(e.from,e.to,n,a)),a}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){Z(e.contentDOM),e.docView.updateSelection()}))}},{key:"destroy",value:function(){var e,t=Object(u.a)(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(n){t.e(n)}finally{t.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing}},{key:"themeClasses",get:function(){return Pe+" "+(this.state.facet(Te)?"cm-dark":"cm-light")+" "+this.state.facet(Ee)}},{key:"contentHeight",get:function(){return this.viewState.heightMap.height+this.viewState.paddingTop+this.viewState.paddingBottom}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(e){return Mt.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[Ee.of(n),Rt.of(De(".".concat(Pe,".").concat(n),e))];return t&&t.dark&&r.push(Te.of(!0)),r}},{key:"baseTheme",value:function(e){return Object(p.o)(Rt.of(De("."+Pe,e)),"fallback")}}]),e}();Ln.styleModule=Rt,Ln.inputHandler=Ot,Ln.exceptionSink=bt,Ln.updateListener=yt,Ln.editable=xt,Ln.dragMovesSelection=mt,Ln.clickAddsSelectionRange=vt,Ln.mouseSelectionStyle=gt,Ln.decorations=At,Ln.lineWrapping=Ln.theme({$content:{whiteSpace:"pre-wrap"}}),Ln.contentAttributes=Dt,Ln.editorAttributes=_t;var Nn=4096;function zn(e,t){return null==e?t.getBoundingClientRect().top:e}var In=-1;function Fn(){window.addEventListener("resize",(function(){-1==In&&(In=setTimeout($n,50))}))}function $n(){In=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t1&&void 0!==arguments[1]?arguments[1]:Wn,r=Object.create(null),i=Object.create(null),a=function(e,t){var n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=function(e,t,i,o){for(var s=r[e]||(r[e]=Object.create(null)),l=t.split(/ (?!$)/).map((function(e){return Hn(e,n)})),c=function(t){var n=l.slice(0,t).join(" ");a(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=Kn={view:t,prefix:n,scope:e};return setTimeout((function(){Kn==r&&(Kn=null)}),4e3),!0}]})},u=1;u0&&void 0!==arguments[0]?arguments[0]:{};return[er.of(e),rr,ar]}var nr=function(){function e(t,n,r,i,a){Object(f.a)(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=a}return Object(d.a)(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px",e}},{key:"eq",value:function(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}]),e}(),rr=Mt.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className=Ae("selectionLayer"),this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className=Ae("cursorLayer"),this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}return Object(d.a)(e,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(er).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.prevState.facet(er)!=e.state.facet(er);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((function(e){return e.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}},{key:"readPos",value:function(){var e,t=this,n=this.view.state,r=n.facet(er),i=n.selection.ranges.map((function(e){return e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];var n=Math.max(t.from,e.viewport.from),r=Math.min(t.to,e.viewport.to),i=e.textDirection==Re.LTR,a=e.contentDOM,o=a.getBoundingClientRect(),s=sr(e),l=window.getComputedStyle(a.firstChild),c=o.left+parseInt(l.paddingLeft),f=o.right-parseInt(l.paddingRight),d=e.visualLineAt(n),h=e.visualLineAt(r);if(d.from==h.from)return y(O(t.from,t.to));var v=O(t.from,null),m=O(null,t.to),g=[];return d.tod&&m.from=b)break;j>g&&s(Math.max(w,g),null==t&&w<=d,Math.min(j,b),null==n&&j>=h,x.dir)}}catch(C){k.e(C)}finally{k.f()}if((g=O.to+1)>=b)break}}}catch(C){v.e(C)}finally{v.f()}if(0==o.length){var S=e.coordsAtPos(d,-1);r=Math.min(S.top,r),a=Math.max(S.bottom,a)}return{top:r,bottom:a,horizontal:o}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),a=[],o=Object(u.a)(n.selection.ranges);try{for(o.s();!(e=o.n()).done;){var s=e.value,l=s==n.selection.primary;if(s.empty?!l||Jn:r.drawRangeCursor){var c=ur(this.view,s,l);c&&a.push(c)}}}catch(f){o.e(f)}finally{o.f()}return{rangePieces:i,cursors:a}}},{key:"drawSel",value:function(e){var t=this,n=e.rangePieces,r=e.cursors;if(n.length!=this.rangePieces.length||n.some((function(e,n){return!e.eq(t.rangePieces[n])}))){this.selectionLayer.textContent="";var i,a=Object(u.a)(n);try{for(a.s();!(i=a.n()).done;){var o=i.value;this.selectionLayer.appendChild(o.draw())}}catch(f){a.e(f)}finally{a.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){this.cursorLayer.textContent="";var s,l=Object(u.a)(r);try{for(l.s();!(s=l.n()).done;){var c=s.value;this.cursorLayer.appendChild(c.draw())}}catch(f){l.e(f)}finally{l.f()}this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),ir={$content:{"& ::selection":{backgroundColor:"transparent !important"}}};Jn&&(ir.$content.caretColor="transparent !important");var ar=Object(p.o)(Ln.theme(ir),"override"),or=Ae("selectionBackground");function sr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:t.left-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}var lr=Ae("cursor.primary"),cr=Ae("cursor.secondary");function ur(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=sr(e);return new nr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?lr:cr)}var fr=/[\0-\x08\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200C\u200E\u200F\u2028\u2029\uFEFF\uFFF9-\uFFFC]/g,dr={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},hr=null;function pr(){if(null==hr&&"undefined"!=typeof document&&document.body){var e=document.body.style;hr=null!=(e.tabSize||e.MozTabSize)}return hr||!1}var vr=null!=/x/.unicode?"gu":"g",mr=p.f.define({combine:function(e){var t=Object(p.m)(e,{render:null,specialChars:fr,addSpecialChars:null});return(t.replaceTabs=!pr())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,vr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,vr)),t}});function gr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[mr.of(e),br];return pr()||t.push(xr),t}var br=Mt.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=xe.none,this.decorationCache=Object.create(null),this.recompute()}return Object(d.a)(e,[{key:"update",value:function(e){var t=e.prevState.facet(mr)!=e.state.facet(mr);t&&(this.decorationCache=Object.create(null)),(t||e.changes.length||e.viewportChanged)&&this.recompute()}},{key:"recompute",value:function(){var e,t=[],n=Object(u.a)(this.view.visibleRanges);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.from,a=r.to;this.getDecorationsFor(i,a,t)}}catch(o){n.e(o)}finally{n.f()}this.decorations=xe.set(t)}},{key:"getDecorationsFor",value:function(e,t,n){for(var r,i=this.view.state.facet(mr),a=this.view.state.doc,o=e,s=a.iterRange(e,t);!s.next().done;){if(!s.lineBreak)for(;r=i.specialChars.exec(s.value);){var l=Object(g.b)(r[0],0),c=void 0;if(null!=l){if(9==l){var u=a.lineAt(o+r.index),f=this.view.state.tabSize,d=Object(g.d)(a.sliceString(u.from,o+r.index),0,f);c=xe.replace({widget:new Or((f-d%f)*this.view.defaultCharacterWidth)})}else c=this.decorationCache[l]||(this.decorationCache[l]=xe.replace({widget:new yr(i,l)}));n.push(c.range(o+r.index,o+r.index+r[0].length))}}o+=s.value.length}}}]),e}(),{decorations:function(e){return e.decorations}});var yr=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).options=e,i.code=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(){var e,t=((e=this.code)>=32?null:10==e?"\u2424":String.fromCharCode(9216+e))||"\u2022",n="Control character "+(dr[this.code]||this.code),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;var i=document.createElement("span");return i.textContent=t,i.title=n,i.setAttribute("aria-label",n),i.style.color="red",i}},{key:"ignoreEvent",value:function(){return!1}}]),n}(ke),Or=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).width=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className=kr,e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(ke),kr=v.a.newName(),xr=Ln.styleModule.of(new v.a(Object(r.a)({},"."+kr,{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"})));function wr(){return p.e.transactionFilter.of((function(e){if(!e.docChanged||"input"!=e.annotation(p.l.userEvent))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.primary.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.primary.head,i=n.lineAt(r);if(r>i.from+200)return e;var a=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(a)})))return e;var o,s=e.state,l=-1,f=[],d=Object(u.a)(s.selection.ranges);try{var h=function(){var e=o.value.head,t=s.doc.lineAt(e);if(t.from==l)return"continue";l=t.from;var n=Math.max.apply(Math,Object(c.a)(s.facet(p.e.indentation).map((function(e){return e(new p.g(s),t.from)}))));if(n<0)return"continue";var r=/^\s*/.exec(t.slice(0,Math.min(t.length,200)))[0],i=s.indentString(n);r!=i&&f.push({from:t.from,to:t.from+r.length,insert:i})};for(d.s();!(o=d.n()).done;)h()}catch(v){d.e(v)}finally{d.f()}return f.length?[e,{changes:f}]:e}))}},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(0),o=n.n(a),s=(n(12),n(94)),l=n.n(s),c=n(192),u=n(223),f=n(151),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=h,m=Object(c.a)(e,Object(r.a)({defaultTheme:a,Component:n,name:h||n.displayName,classNamePrefix:v},p)),g=o.a.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=m(Object(r.a)(Object(r.a)({},n.defaultProps),e)),v=c;return("string"===typeof h||d)&&(s=Object(f.a)()||a,h&&(v=Object(u.a)({theme:s,name:h,props:c})),d&&!v.theme&&(v.theme=s)),o.a.createElement(n,Object(r.a)({ref:l||t,classes:p},v))}));return l()(g,n),g}},h=n(65);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){e.exports=n(177)()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(13);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;te)return u[t-1]<=e;return!1}function h(e){return e>=127462&&e<=127487}function p(e,t){if(t==e.length)return t;t&&m(e.charCodeAt(t))&&g(e.charCodeAt(t-1))&&t--;var n=b(e,t);for(t+=O(n);t=0&&h(b(e,a));)i++,a-=2;if(i%2==0)break;t+=2}}return t}function v(e,t){for(;t>0;){var n=p(e,t-2);if(n=56320&&e<57344}function g(e){return e>=55296&&e<56320}function b(e,t){var n=e.charCodeAt(t);if(!g(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return m(r)?r-56320+(n-55296<<10)+65536:n}function y(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function O(e){return e<65536?1:2}function k(e,t,n){for(var r=0;r=n)return{offset:i,leftOver:0};t+=9==e.charCodeAt(i)?r-t%r:1,i=p(e,i)}return{offset:e.length,leftOver:n-t}}var w=function(){function e(){Object(l.a)(this,e)}return Object(c.a)(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.from<=e&&r.to>=e)return r}}catch(i){n.e(i)}finally{n.f()}return C(this.lineInner(e,!1,1,0).finish(this))}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.number==e)return r}}catch(i){n.e(i)}finally{n.f()}return C(this.lineInner(e,!0,1,0).finish(this))}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r),r.push(n),this.decompose(t,this.length,r),E.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return 0==this.length?e:0==e.length?this:E.from([this,e],this.length+e.length)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n),E.from(n,t-e)}},{key:"eq",value:function(e){return this==e||function(e,t){if(e.length!=t.length||e.lines!=t.lines)return!1;for(var n=new D(e),r=new D(t),i=0,a=0;;){if(n.lineBreak!=r.lineBreak||n.done!=r.done)return!1;if(n.done)return!0;if(n.lineBreak)n.next(),r.next(),i=a=0;else{var o=n.value.slice(i),s=r.value.slice(a);if(o.length==s.length){if(o!=s)return!1;n.next(),r.next(),i=a=0}else if(o.length>s.length){if(o.slice(0,s.length)!=s)return!1;i+=s.length,r.next(),a=0}else{if(s.slice(0,o.length)!=o)return!1;a+=o.length,n.next(),i=0}}}}(this,e)}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new D(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new A(this,e,t)}},{key:"iterLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new R(this,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){for(var e=[],t=this.iterLines();!t.next().done;)e.push(t.value);return e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");if(1==t.length&&!t[0]&&e.empty)return e.empty;var n=T(t);return n<1024?new M(t,n):E.from(M.split(t,[]),n)}}]),e}();"undefined"!=typeof Symbol&&(w.prototype[Symbol.iterator]=function(){return this.iter()});var j=[],S=-1;function C(e){return j[S=(S+1)%10]=e}var M=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T(e);return Object(l.a)(this,n),(r=t.call(this)).text=e,r.length=i,r}return Object(c.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new L(r,o,n,a);r=o+1,n++}}},{key:"decompose",value:function(e,t,r){r.push(new n(_(this.text,e,t),Math.min(t,this.length)-Math.max(0,e)))}},{key:"lastLineLength",value:function(){return this.text[this.text.length-1].length}},{key:"firstLineLength",value:function(){return this.text[0].length}},{key:"replace",value:function(e,t,a){var o=this.length+a.length-(t-e);return o>=1024||!(a instanceof n)?Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,a):new n(P(this.text,P(a.text,_(this.text,0,e)),t),o)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,a=0;i<=t&&ae&&a&&(r+=n),ei&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){e[e.length-1]+=this.text[0];for(var t=1;t=56320&&f<57344&&u++,i.push(l.slice(0,u)),t.push(new n(i,512)),l=l.slice(u),a=-1,i=[]}}catch(d){o.e(d)}finally{o.f()}return-1!=a&&t.push(new n(i,a)),t}}]),n}(w),E=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(e,r){var i;Object(l.a)(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=1;var a,o=Object(s.a)(e);try{for(o.s();!(a=o.n()).done;){var c=a.value;i.lines+=c.lines-1}}catch(u){o.e(u)}finally{o.f()}return i}return Object(c.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e){var l=a.lineInner(e,t,n,r),c=void 0;return l.from==r&&(c=this.lineLengthTo(i))&&(l.from-=c,l.content=null),l.to==o&&(c=this.lineLengthFrom(i+1))&&(l.to+=c,l.content=null),l}r=o,n=s}}},{key:"decompose",value:function(e,t,n){for(var r=0,i=0;ii&&(i>=e&&o<=t?n.push(a):a.decompose(e-i,t-i,n)),i=o}}},{key:"lineLengthTo",value:function(e){for(var t=0,n=e-1;n>=0;n--){var r=this.children[n];if(r.lines>1)return t+r.lastLineLength();t+=r.length}return t}},{key:"lastLineLength",value:function(){return this.lineLengthTo(this.children.length)}},{key:"lineLengthFrom",value:function(e){for(var t=0,n=e;n1)return t+r.firstLineLength();t+=r.length}return t}},{key:"firstLineLength",value:function(){return this.lineLengthFrom(0)}},{key:"replace",value:function(e,t,a){if(a.length<512&&t-e<512)for(var o=a.length-(t-e),s=0,l=0;s=l&&t<=u&&c.length+o>2&&c.length+o>0){var f=this.children.slice();return f[s]=c.replace(e-l,t-l,a),new n(f,this.length+o)}l=u}return Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,a)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,a=0;aa){var l=o.sliceString(e-a,t-a,n);if(e>=a&&t<=s)return l;r+=l}a=s}return r}},{key:"flatten",value:function(e){var t,n=Object(s.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(e,t){if(!e.every((function(e){return e instanceof w})))throw new Error("NOP");if(t<1024){var r,i=[""],a=Object(s.a)(e);try{for(a.s();!(r=a.n()).done;){r.value.flatten(i)}}catch(g){a.e(g)}finally{a.f()}return new M(i,t)}var o=Math.max(512,t>>3),l=o<<1,c=o>>1,u=[],f=0,d=[];function h(e){var t,r=e.length;if(r)if(r>l&&e instanceof n){var i,a=Object(s.a)(e.children);try{for(a.s();!(i=a.n()).done;){h(i.value)}}catch(g){a.e(g)}finally{a.f()}}else r>c&&(f>c||0==f)?(p(),u.push(e)):e instanceof M&&f>0&&(t=d[d.length-1])instanceof M&&e.length+t.length<=512?(f+=r,d[d.length-1]=new M(P(e.text,t.text.slice()),e.length+t.length)):(f+r>o&&p(),f+=r,d.push(e))}function p(){0!=f&&(u.push(1==d.length?d[0]:n.from(d,f)),f=0,d.length=0)}var v,m=Object(s.a)(e);try{for(m.s();!(v=m.n()).done;){h(v.value)}}catch(g){m.e(g)}finally{m.f()}return p(),1==u.length?u[0]:new n(u,t)}}]),n}(w);function T(e){var t,n=-1,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function P(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,a=0,o=!0;a=n&&(l>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;Object(l.a)(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?0:t instanceof M?t.text.length:t.children.length]}return Object(c.a)(e,[{key:"next",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var t=this.nodes.length-1;if(t<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[t],r=this.offsets[t];if(n instanceof M){if(r!=(this.dir>0?0:n.text.length)&&!this.lineBreak){if(this.lineBreak=!0,0==e)return this.value="\n",this;e--;continue}var i=n.text[r-(this.dir<0?1:0)];if(this.offsets[t]=r+=this.dir,r==(this.dir>0?n.text.length:0)&&(this.nodes.pop(),this.offsets.pop()),this.lineBreak=!1,i.length>Math.max(0,e))return this.value=0==e?i:this.dir>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else if(r==(this.dir>0?n.children.length:0))this.nodes.pop(),this.offsets.pop();else{var a=n.children[this.dir>0?r:r-1],o=a.length;this.offsets[t]=r+this.dir,e>o?e-=o:(this.nodes.push(a),this.offsets.push(this.dir>0?0:a instanceof M?a.text.length:a.children.length))}}}}]),e}(),A=function(){function e(t,n,r){Object(l.a)(this,e),this.value="",this.cursor=new D(t,n>r?-1:1),n>r?(this.skip=t.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return Object(c.a)(e,[{key:"next",value:function(){if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;this.skip=0,this.value=t;var i=n?1:t.length;i>this.limit&&(this.value=this.cursor.dir>0?t.slice(0,this.limit):t.slice(i-this.limit)),r||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),e}(),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(l.a)(this,e),this.value="",this.done=!1,this.cursor=t.iter(),this.skip=n}return Object(c.a)(e,[{key:"next",value:function(){if(this.cursor.done)return this.done=!0,this.value="",this;for(this.value="";;){var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;if(this.skip=0,r||n)return this;this.value+=t}}},{key:"lineBreak",get:function(){return!1}}]),e}(),L=function(){function e(t,n,r,i){Object(l.a)(this,e),this.from=t,this.to=n,this.number=r,this.content=i}return Object(c.a)(e,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;if(e==t)return"";if("string"==typeof this.content)return this.content.slice(e,t);this.content||(this.content=new N(this.doc,this.from));var n=this.content.slice(e,t);return 0==e&&t==this.length&&(this.content=n),n}},{key:"finish",value:function(e){return this.doc=e,this}},{key:"findClusterBreak",value:function(e,t){if(e<0||e>this.length)throw new RangeError("Invalid position given to Line.findClusterBreak");var n,r;return"string"==this.content?(n=this.from,r=this.content):(n=Math.max(0,e-256),r=this.slice(n,Math.min(this.length,n+512))),(t?p:v)(r,e-n)+n}},{key:"length",get:function(){return this.to-this.from}}]),e}(),N=function(){function e(t,n){Object(l.a)(this,e),this.doc=t,this.start=n,this.cursor=null,this.strings=null}return Object(c.a)(e,[{key:"slice",value:function(e,t){this.cursor||(this.cursor=this.doc.iter(),this.strings=[this.cursor.next(this.start).value]);for(var n="",r=0,i=0;;i++){if(i==this.strings.length){var a=this.cursor.next().value;if(!a)return n;this.strings.push(a)}var o=this.strings[i],s=r;if(!((r+=o.length)<=e)&&(n+=o.slice(Math.max(0,e-s),Math.min(o.length,t-s)),r>=t))return n}}}]),e}()},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d}));var r=n(152);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function a(e){if(e.type)return e;if("#"===e.charAt(0))return a(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function o(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t="hsl"===(e=a(e)).type?a(function(e){var t=(e=a(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),o({type:c,values:u})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?f(e,t):d(e,t)}function u(e,t){return e=a(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function f(e,t){if(e=a(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function d(e,t){if(e=a(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return o(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=n(38);function a(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return y}));var r=n(16),i=n(15),a=n(7),o=n(4),s=n(6),l=1024,c=function(){function e(t,n){Object(o.a)(this,e),this.enter=t,this.leave=n,this.result=void 0}return Object(s.a)(e,[{key:"doEnter",value:function(e,t,n){var r=this.enter(e,t,n);return void 0===r||(!1!==r&&(this.result=r),!1)}},{key:"done",get:function(){return void 0!==this.result}}]),e}(),u=0,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.deserialize;Object(o.a)(this,e),this.id=u++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return Object(s.a)(e,[{key:"set",value:function(e,t){return e[this.id]=t,e}},{key:"add",value:function(e){return new d(this,"function"==typeof e?e:h.match(e))}}],[{key:"string",value:function(){return new e({deserialize:function(e){return e}})}},{key:"number",value:function(){return new e({deserialize:Number})}},{key:"flag",value:function(){return new e({deserialize:function(){return!0}})}}]),e}();f.error=f.flag(),f.skipped=f.flag(),f.closedBy=new f({deserialize:function(e){return e.split(" ")}}),f.openedBy=new f({deserialize:function(e){return e.split(" ")}}),f.top=f.flag();var d=function e(t,n){Object(o.a)(this,e),this.prop=t,this.f=n},h=function(){function e(t,n,r){Object(o.a)(this,e),this.name=t,this.props=n,this.id=r}return Object(s.a)(e,[{key:"prop",value:function(e){return this.props[e.id]}}],[{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=Object(a.a)(n.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value;t[o]=e[n]}}catch(s){i.e(s)}finally{i.f()}}return function(e){return t[e.name]}}}]),e}();h.none=new h("",Object.create(null),0);var p=function(){function e(t){Object(o.a)(this,e),this.types=t;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.resolveAt(e);if(0!=t)for(;;){var r=t<0?n.childBefore(e):n.childAfter(e);if(!r||(t<0?r.end:r.start)!=e)break;n=r}return n}},{key:"name",get:function(){return this.type.name}},{key:"depth",get:function(){for(var e=0,t=this.parent;t;t=t.parent)e++;return e}},{key:"root",get:function(){for(var e=this;e.parent;)e=e.parent;return e}},{key:"firstChild",get:function(){return this.childAfter(this.start-1)}},{key:"lastChild",get:function(){return this.childBefore(this.end+1)}}]),e}(),m=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,a){var s;return Object(o.a)(this,n),(s=t.call(this)).type=e,s.children=r,s.positions=i,s.length=a,s}return Object(s.a)(n,[{key:"toString",value:function(){var e=this.children.map((function(e){return e.toString()})).join();return this.name?(/\W/.test(this.name)&&!this.type.prop(f.error)?JSON.stringify(this.name):this.name)+(e.length?"("+e+")":""):e}},{key:"partial",value:function(e,t,r,i,a){for(var o=0;ot)break;var l=this.children[o],c=s+l.length;c=c?(i.push(l),a.push(s+r)):l instanceof n&&l.partial(e-s,t-s,r+s,i,a))}}},{key:"applyChanges",value:function(e){if(0==e.length)return this;var t=[],r=[];function i(e,t,n){var r=-1;return e.iterate({from:t,to:n<0?0:e.length,enter:function(){return r<0&&void 0},leave:function(e,i,a){r<0&&(n<0?a<=t:i>=t)&&!e.prop(f.error)&&(r=n<0?Math.min(t,a-1):Math.max(t,i+1))}}),r>-1?r:n<0?0:e.length}for(var a=0,o=0,s=0;;o++){var l=o==e.length?null:e[o],c=l?i(this,l.fromA,-1):this.length;if(c>s&&this.partial(s,c,a,t,r),!l)break;s=i(this,l.toA,1),a+=l.toB-l.fromB-(l.toA-l.fromA)}return new n(h.none,t,r,this.length+a)}},{key:"cut",value:function(e){if(e>=this.length)return this;for(var t=[],r=[],i=0;i=e)break;var o=this.children[i],s=a+o.length;t.push(s<=e?o:o.cut(e-a)),r.push(a)}return new n(this.type,t,r,e)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,a=e.enter,o=e.leave,s=new c(a,o);return this.iterInner(n,i,0,s),s.result}},{key:"iterInner",value:function(e,t,n,r){if(!this.type.name||r.doEnter(this.type,n,n+this.length)){if(e<=t)for(var i=0;it)break;s=0&&!r.done;l--){var c=this.children[l],u=this.positions[l]+n;if(u+c.lengthe||c.iterInner(e,t,u,r)}r.leave&&this.type.name&&r.leave(this.type,n,n+this.length)}}},{key:"resolveAt",value:function(e){if(g==this)for(var t=b;;){var n=t.parent;if(!n)break;if(t.starte)return t.resolve(e);t=n}return g=this,b=this.resolveInner(e,0,this)}},{key:"childBefore",value:function(e){return this.findChild(e,-1,0,this)}},{key:"childAfter",value:function(e){return this.findChild(e,1,0,this)}},{key:"findChild",value:function(e,t,r,i){for(var a=0;a=e)if(t<0&&a>0)s=a-1;else{if(!(t>0))break;s=a}if(s<0&&(o+this.children[a].length>e||t<0&&a==this.children.length-1)&&(s=a),s>=0){var l=this.children[s],c=this.positions[s]+r;if(0==l.length&&c==e)continue;if(l instanceof n)return l.type.name?new O(l,c,i):l.findChild(e,t,c,i);var u=l.findIndex(e,t,c,0,l.buffer.length);if(u>-1)return new k(l,c,u,i)}}return null}},{key:"resolveInner",value:function(e,t,n){var r=this.findChild(e,0,t,n);return r?r.resolveAt(e):n}},{key:"append",value:function(e){if(e.children.length&&e.positions[0]0&&void 0!==arguments[0]?arguments[0]:l;return this.children.length<=w?this:S(this.type,h.none,this.children,this.positions,0,this.children.length,0,e,this.length)}},{key:"start",get:function(){return 0}},{key:"end",get:function(){return this.length}}],[{key:"build",value:function(e){return j(e)}}]),n}(v);m.empty=new m(h.none,[],[],0),m.prototype.parent=null;var g=m.empty,b=m.empty,y=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.none;Object(o.a)(this,e),this.buffer=t,this.length=n,this.group=r,this.type=i}return Object(s.a)(e,[{key:"toString",value:function(){for(var e=[],t=0;t(e+=4)){for(var o=[];et)return this.buffer.length;if(s>=e&&i.doEnter(a,o,s)){for(;r0?(l=s.pop(),c=o.buffer[l+3]):c=-1};u();e:for(var f=i;f>r&&!a.done;){for(;c==f;){var d=l,h=this.buffer[d],p=this.buffer[d+1]+n,v=this.buffer[d+2]+n;if(u(),p<=e&&v>=t&&!a.doEnter(this.group.types[h],p,v)){for(f=d;c>d;)u();continue e}}var m=this.buffer[--f],g=this.buffer[--f]+n,b=this.buffer[--f]+n,y=this.buffer[--f];b>e||g=e){if(t>0&&!u)return o;break}if(c>e)return o;u||(a=o),o=s[o+3]}return t<0?a:-1}}]),e}(),O=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var a;return Object(o.a)(this,n),(a=t.call(this)).node=e,a.start=r,a.parent=i,a}return Object(s.a)(n,[{key:"resolveAt",value:function(e){return e<=this.start||e>=this.end?this.parent.resolveAt(e):this.node.resolveInner(e,this.start,this)}},{key:"childBefore",value:function(e){return this.node.findChild(e,-1,this.start,this)}},{key:"childAfter",value:function(e){return this.node.findChild(e,1,this.start,this)}},{key:"toString",value:function(){return this.node.toString()}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,a=e.enter,o=e.leave,s=new c(a,o);return this.node.iterInner(n,i,this.start,s),s.result}},{key:"type",get:function(){return this.node.type}},{key:"end",get:function(){return this.start+this.node.length}}]),n}(v),k=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,a){var s;return Object(o.a)(this,n),(s=t.call(this)).buffer=e,s.bufferStart=r,s.index=i,s.parent=a,s}return Object(s.a)(n,[{key:"childBefore",value:function(e){var t=this.buffer.findIndex(e,-1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"childAfter",value:function(e){var t=this.buffer.findIndex(e,1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,a=e.enter,o=e.leave,s=new c(a,o);return n<=i?this.buffer.iterChild(n,i,this.bufferStart,this.index,s):this.buffer.iterRev(n,i,this.bufferStart,this.index,this.endIndex,s),s.result}},{key:"resolveAt",value:function(e){if(e<=this.start||e>=this.end)return this.parent.resolveAt(e);var t=this.buffer.findIndex(e,0,this.bufferStart,this.index+4,this.endIndex);return t<0?this:new n(this.buffer,this.bufferStart,t,this).resolveAt(e)}},{key:"toString",value:function(){var e=[];return this.buffer.childToString(this.index,e),e.join("")}},{key:"type",get:function(){return this.buffer.group.types[this.buffer.buffer[this.index]]}},{key:"start",get:function(){return this.buffer.buffer[this.index+1]+this.bufferStart}},{key:"end",get:function(){return this.buffer.buffer[this.index+2]+this.bufferStart}},{key:"endIndex",get:function(){return this.buffer.buffer[this.index+3]}}]),n}(v),x=function(){function e(t,n){Object(o.a)(this,e),this.buffer=t,this.index=n}return Object(s.a)(e,[{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}}]),e}(),w=8;function j(e){var t=e.buffer,n=e.group,r=e.topID,i=void 0===r?0:r,a=e.maxBufferLength,o=void 0===a?l:a,s=e.reused,c=void 0===s?[]:s,u=e.minRepeatType,f=void 0===u?n.types.length:u,d=Array.isArray(t)?new x(t,t.length):t,p=n.types;function v(e,t,r,i,a){for(var s=d.id,l=d.start,u=d.end,b=d.size;s==a;)d.next(),s=d.id,l=d.start,u=d.end,b=d.size;var O=l-e;if(b<0)return r.push(c[s]),i.push(O),void d.next();var k,x,j=p[s];if(u-l<=o&&(x=function(e,t){var n=d.fork(),r=0,i=0,a=0,s=n.end-o,l={size:0,start:0,skip:0};e:for(var c=n.pos-e;n.pos>c;)if(n.id!=t){var u=n.size,h=n.pos-u;if(u<0||h=f?4:0,v=n.start;for(n.next();n.pos>h;){if(n.size<0)break e;n.id>=f&&(p+=4),n.next()}i=v,r+=u,a+=p}else l.size=r,l.start=i,l.skip=a,a+=4,r+=4,n.next();(t<0||r==e)&&(l.size=r,l.start=i,l.skip=a);return l.size>4?l:void 0}(d.pos-t,a))){for(var C=new Uint16Array(x.size-x.skip),M=d.pos-x.size,E=C.length;d.pos>M;)E=g(x.start,C,E,a);k=new y(C,u-x.start,n,a<0?h.none:p[a]),O=x.start-e}else{var T=d.pos-b;d.next();for(var P=[],_=[],D=s>=f?s:-1;d.pos>T;)v(l,T,P,_,D);P.reverse(),_.reverse(),k=D>-1&&P.length>w?S(j,j,P,_,0,P.length,0,o,u-l):new m(j,P,_,u-l)}r.push(k),i.push(O)}function g(e,t,n,r){var i=d.id,a=d.start,o=d.end,s=d.size;if(d.next(),i==r)return n;var l=n;if(s>4)for(var c=d.pos-(s-4);d.pos>c;)n=g(e,t,n,r);return i0;)v(0,0,b,O,-1);var k=b.length?O[0]+b[0].length:0;return new m(n.types[i],b.reverse(),O.reverse(),k)}function S(e,t,n,r,i,a,o,s,l){var c=[],u=[];if(l<=s)for(var f=i;fd)break}if(p==v+1){var b=n[v];if(b instanceof m&&b.type==t&&b.length>d<<1){for(var y=0;y1&&void 0!==arguments[1]?arguments[1]:e;return new l(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=o.h.TrackDel;var l=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function c(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=500,f=1e9,d=function(){function e(t,n,r,a){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=a}return Object(a.a)(e,[{key:"findIndex",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t*f,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(e<=0)return r;for(var i=t<0?this.to:this.from,a=r,o=i.length;;){if(a==o)return a;var s=a+o>>1,l=i[s]-e||(t<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==a)return l>=0?a:o;l>=0?o=s:a=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1),a=this.findIndex(n,1,void 0,i);i(h=n.mapPos(f,c.endSide))||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-o),a.push(h-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),e}(),h=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,a=arguments.length>3?arguments[3]:void 0;Object(i.a)(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=a}return Object(a.a)(e,[{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,a=void 0!==i&&i,o=t.filter,s=t.filterFrom,u=void 0===s?0:s,f=t.filterTo,d=void 0===f?this.length:f;if(0==r.length&&!o)return this;if(a&&r.slice().sort(c),this==e.empty)return r.length?e.of(r):this;for(var h=new v(this,null,-1).goto(0),m=0,g=[],b=new p;h.value||m=0){var y=r[m++];b.addInner(y.from,y.to,y.value)||g.push(y)}else 1==h.rangeIndex&&h.chunkIndexthis.chunkEnd(h.chunkIndex)||dh.to||d=a&&t<=a+o.length&&!1===o.between(a,t-a,n-a,r))return}this.nextLayer.between(t,n,r)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(e)}},{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this==e.empty)return 0;var t,n=this.nextLayer.size,i=Object(r.a)(this.chunk);try{for(i.s();!(t=i.n()).done;){n+=t.value.value.length}}catch(a){i.e(a)}finally{i.f()}return n}}],[{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(e).goto(t)}},{key:"compare",value:function(t,n,i,a){var o,s=null!==(o=a.minPointSize)&&void 0!==o?o:-1,l=t.filter((function(t){return t.maxPoint>=500||t!=e.empty&&n.indexOf(t)<0&&t.maxPoint>=s})),c=n.filter((function(n){return n.maxPoint>=500||n!=e.empty&&t.indexOf(n)<0&&n.maxPoint>=s})),f=function(e,t){var n,i=new Map,a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;)for(var o=n.value,s=0;sl?1:0)):l>o&&(r.span(o,l,a.active,s),s=a.openEnd(l)),a.to>n)break;o=a.to,a.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new p,a=Object(r.a)(e instanceof l?[e]:n?e.slice().sort(c):e);try{for(a.s();!(t=a.n()).done;){var o=t.value;i.add(o.from,o.to,o.value)}}catch(s){a.e(s)}finally{a.f()}return i.finish()}}]),e}();h.empty=new h([],[],null,-1),h.empty.nextLayer=h.empty;var p=function(){function e(){Object(i.a)(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-f,this.lastTo=-f,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Object(a.a)(e,[{key:"finishChunk",value:function(e){this.chunks.push(new d(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(h.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new h(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();var v=function(){function e(t,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=a}return Object(a.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(e){return this.from-e.from||this.startSide-e.startSide||this.to-e.to||this.endSide-e.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),e}(),m=function(){function e(t){Object(i.a)(this,e),this.heap=t}return Object(a.a)(e,[{key:"goto",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f,i=Object(r.a)(this.heap);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.goto(e,n)}}catch(s){i.e(s)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)g(this.heap,o);return this.next(),this}},{key:"forward",value:function(e,t){var n,i=Object(r.a)(this.heap);try{for(i.s();!(n=i.n()).done;){n.value.forward(e,t)}}catch(o){i.e(o)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)g(this.heap,a);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=f,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),g(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],a=0;a=r&&i.push(new v(o,n,r,a));return 1==i.length?i[0]:new e(i)}}]),e}();function g(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var b=function(){function e(t,n,r){Object(i.a)(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-f,this.endSide=0,this.openStart=-1,this.cursor=m.from(t,n,r)}return Object(a.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){k(this.active,e),k(this.activeTo,e),k(this.activeRank,e),this.minActive=w(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,a=n.rank;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),t&&k(t,r)}else{if(!this.cursor.value){this.to=this.endSide=f;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.frome&&this.forward(this.to,this.endSide);break}this.addActive(t),this.cursor.next()}}if(t){for(var a=0;athis.pointRank);n++)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>this.point.endSide)&&t.push(this.active[n]);return t}},{key:"openEnd",value:function(e){for(var t=0;te;)t++;return t}}]),e}();function y(e,t,n,r,i,a){e.goto(t),n.goto(r);for(var o=r+i,s=r,l=r-t;;){var c=e.to+l-n.to||e.endSide-n.endSide,u=c<0?e.to+l:n.to,f=Math.min(u,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))||a.comparePoint(s,f,e.point,n.point):f>s&&!O(e.active,n.active)&&a.compareRange(s,f,e.active,n.active),u>o)break;s=u,c<=0&&e.next(),c>=0&&n.next()}}function O(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function w(e,t){for(var n=-1,r=f,i=0;i-1?n.panels[r]:null}var d=o.f.fromClass(function(){function e(t){Object(r.a)(this,e),this.specs=t.state.facet(u),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(l);this.top=new p(t,!0,n.topContainer),this.bottom=new p(t,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(e){return e.top}))),this.bottom.sync(this.panels.filter((function(e){return!e.top})));var i,o=Object(a.a)(this.panels);try{for(o.s();!(i=o.n()).done;){var s=i.value;s.dom.className+=" "+h(s),s.mount&&s.mount()}}catch(c){o.e(c)}finally{o.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(l);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new p(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new p(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(u);if(n!=this.specs){var r,i=[],o=[],s=[],c=[],f=Object(a.a)(n);try{for(f.s();!(r=f.n()).done;){var d=r.value,v=this.specs.indexOf(d),m=void 0;v<0?(m=d(e.view),c.push(m)):(m=this.panels[v]).update&&m.update(e),i.push(m),(m.top?o:s).push(m)}}catch(w){f.e(w)}finally{f.f()}this.specs=n,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(var g=0,b=c;g0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?a.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,f=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:o(s)," ").concat(c," ").concat("string"===typeof f?f:o(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",a="minute",o="hour",s="day",l="week",c="month",u="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},b={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(i,2,"0")},m:function e(t,n){if(t.date()1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),a=0;a=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(83);var i=n(92),a=n(76);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a}));var r=n(0),i=r.createContext();function a(){return r.useContext(i)}t.a=i},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var r=n(4),i=n(6),a="undefined"==typeof Symbol?"__\u037c":Symbol.for("\u037c"),o="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"==typeof e?window:e,l=function(){function e(t,n){Object(r.a)(this,e),this.rules=[];var i=n||{},a=i.process,o=i.extend;function s(e){if(/^@/.test(e))return[e];var t=e.split(",");return a?t.map(a):t}function l(e,t,n){var r=[],i=/^@(\w+)\b/.exec(e[0]);if(i&&null==t)return n.push(e[0]+";");var a=function(a){var c=t[a];if(/&/.test(a))l(e.map((function(e){return o?o(a,e):a.replace(/&/,e)})),c,n);else if(c&&"object"==typeof c){if(!i)throw new RangeError("The value of a property ("+a+") should be a primitive value.");l("keyframes"==i[1]?[a]:s(a),c,r)}else null!=c&&r.push(a.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+c+";")};for(var c in t)a(c);(r.length||i&&"keyframes"==i[1])&&n.push(e.join(",")+" {"+r.join(" ")+"}")}for(var c in t)l(s(c),t[c],this.rules)}return Object(i.a)(e,null,[{key:"newName",value:function(){var e=s[a]||1;return s[a]=e+1,"\u037c"+e.toString(36)}},{key:"mount",value:function(e,t){(e[o]||new u(e)).mount(Array.isArray(t)?t:[t])}}]),e}(),c=null,u=function(){function e(t){if(Object(r.a)(this,e),t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(c)return t.adoptedStyleSheets=[c.sheet].concat(t.adoptedStyleSheets),t[o]=c;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),c=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[o]=this}return Object(i.a)(e,[{key:"mount",value:function(e){for(var t=this.sheet,n=0,r=0,i=0;i-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,a),t)for(var s=0;s0&&m(t.state,l.head-1,1,o)||o.afterCursor&&(m(t.state,l.head,1,o)||l.head0&&void 0!==arguments[0]?arguments[0]:{};return[u.of(e),h]}function v(e,t,n){var r=e.prop(t<0?o.c.openedBy:o.c.closedBy);if(r)return r;if(1==e.name.length){var i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function m(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i.maxScanDistance||l,o=i.brackets||c,s=e.tree,u=s.resolve(t,n);return(r=v(u.type,n,o))?g(e,t,n,u,r,o):b(e,t,n,s,u.type,a,o)}function g(e,t,n,r,i,a){var o=r.parent,s={from:r.start,to:r.end},l=0;return o&&o.iterate({from:n<0?r.start:r.end,to:n<0?o.start:o.end,enter:function(e,t,o){if(!(n<0?o>r.start:t-1)return{start:s,end:{from:t,to:o},matched:!0};if(v(e,n,a))l++;else if(v(e,-n,a)&&0==--l)return{start:s,end:{from:t,to:o},matched:!1};return!1}}})||{start:s,matched:!1}}function b(e,t,n,r,i,a,o){var s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(s);if(l<0||l%2==0!=n>0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,d=0;!u.next().done&&d<=a;){var h=u.value;n<0&&(d+=h.length);for(var p=t+d*n,v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){var g=o.indexOf(h[v]);if(!(g<0||r.resolve(p+v,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:c,end:{from:p+v,to:p+v+1},matched:g>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(26),a=!0,o=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(a=!0)}function u(){a=!1}function f(){"hidden"===this.visibilityState&&o&&(a=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return a||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){o=!0,window.clearTimeout(s),s=window.setTimeout((function(){o=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(29);function i(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(147),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";var r=n(191);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},,function(e,t,n){"use strict";e.exports=n(179)},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function a(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return J})),n.d(t,"b",(function(){return ee})),n.d(t,"c",(function(){return K}));n(17);var r=n(25),i=n(16),a=n(15),o=n(7),s=n(4),l=n(6),c=n(84),u=n(5),f=n(10),d=n(19),h=function(){function e(t,n,r){Object(s.a)(this,e),this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}return Object(l.a)(e,[{key:"tokenBefore",value:function(e){for(var t=this.state.tree.resolve(this.pos,-1);t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.start,to:this.pos,text:this.state.sliceDoc(t.start,this.pos),type:t.type}:null}},{key:"matchBefore",value:function(e){var t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.slice(n-t.from,this.pos-t.from),i=r.search(m(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}},{key:"addEventListener",value:function(e,t){this.abortListeners&&this.abortListeners.push(t)}},{key:"aborted",get:function(){return null==this.abortListeners}}]),e}(),p=function e(t,n,r){Object(s.a)(this,e),this.completion=t,this.source=n,this.match=r};function v(e){return e.selection.primary.head}function m(e,t){var n,r=e.source,i=t&&"^"!=r[0],a="$"!=r[r.length-1];return i||a?new RegExp("".concat(i?"^":"","(?:").concat(r,")").concat(a?"$":""),null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function g(e,t){var n=t.completion.apply||t.completion.label,r=t.source;"string"==typeof n?e.dispatch({changes:{from:r.from,to:r.to,insert:n},selection:{anchor:r.from+n.length}}):n(e,t.completion,r.from,r.to)}var b=function(){function e(t){Object(s.a)(this,e),this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(var n=0;n=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(j=Object(d.f)(w))!=j.toLowerCase()?1:j!=j.toUpperCase()?2:0;(1==S||0==x&&0!=S&&(this.chars[v]==w||this.folded[v]==w&&(m=!0)))&&(a[v++]=O),x=S,O+=Object(d.c)(w)}return v==l&&0==a[0]?this.result((m?-200:0)-100,a,e):g==l&&0==b?[-200,0,y]:s>-1?[-700,s,s+this.pattern.length]:g==l?[-900,b,y]:v==l?this.result((m?-200:0)-100-700,a,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}},{key:"result",value:function(e,t,n){var r,i=[e],a=1,s=Object(o.a)(t);try{for(s.s();!(r=s.n()).done;){var l=r.value,c=l+(this.astral?Object(d.c)(Object(d.b)(n,l)):1);a>1&&i[a-1]==l?i[a-1]=c:(i[a++]=l,i[a++]=c)}}catch(u){s.e(u)}finally{s.f()}return i}}]),e}(),y=u.f.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100})}}),O=f.d.baseTheme({"$tooltip.autocomplete":{"& > ul":{fontFamily:"monospace",overflowY:"auto",whiteSpace:"nowrap",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2},"& > li[aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"}}},"$completionListIncompleteTop:before, $completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},"$tooltip.completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},"$tooltip.completionInfo.left":{right:"100%"},"$tooltip.completionInfo.right":{left:"100%"},"$$light $snippetField":{backgroundColor:"#ddd"},"$$dark $snippetField":{backgroundColor:"#333"},$snippetFieldPosition:{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},$completionMatchedText:{textDecoration:"underline"},$completionDetail:{marginLeft:"0.5em",fontStyle:"italic"},$completionIcon:{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},"$completionIcon.function, $completionIcon.method":{"&:after":{content:"'\u0192'"}},"$completionIcon.class":{"&:after":{content:"'\u25cb'"}},"$completionIcon.interface":{"&:after":{content:"'\u25cc'"}},"$completionIcon.variable":{"&:after":{content:"'\ud835\udc65'"}},"$completionIcon.constant":{"&:after":{content:"'\ud835\udc36'"}},"$completionIcon.type":{"&:after":{content:"'\ud835\udc61'"}},"$completionIcon.enum":{"&:after":{content:"'\u222a'"}},"$completionIcon.property":{"&:after":{content:"'\u25a1'"}},"$completionIcon.keyword":{"&:after":{content:"'\ud83d\udd11\ufe0e'"}},"$completionIcon.namespace":{"&:after":{content:"'\u25a2'"}},"$completionIcon.text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});function k(e,t,n){var r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true");for(var i=n.from;ip&&u.appendChild(document.createTextNode(d.slice(p,m)));var b=u.appendChild(document.createElement("span"));b.appendChild(document.createTextNode(d.slice(m,g))),b.className=Object(f.n)("completionMatchedText"),p=g}if(p>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var w=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.stateField=n,this.info=null,this.placeInfo={read:function(){return r.measureInfo()},write:function(e){return r.positionInfo(e)},key:this};var i=t.state.field(n),a=i.open,o=a.options,l=a.selected,c=t.state.facet(y);this.range=x(o.length,l,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.addEventListener("mousedown",(function(e){for(var n=r.range.from,i=e.target;i&&i!=r.list&&i.parentNode!=r.list;)i=i.parentNode;for(;i=i.previousSibling;)n++;n>=0&&n=this.range.to)&&(this.range=x(n.options.length,n.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(k(n.options,t.id,this.range)),this.list.addEventListener("scroll",(function(){e.info&&e.view.requestMeasure(e.placeInfo)}))),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);var r=n.options[n.selected];r.completion.info&&(this.info=this.dom.appendChild(function(e){var t=document.createElement("div");t.className=Object(f.n)("tooltip.completionInfo");var n=e.completion.info;return"string"==typeof n?t.textContent=n:t.appendChild(n(e.completion)),t}(r)),this.view.requestMeasure(this.placeInfo))}}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e)return null;var t=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;if(n<0||n>this.list.clientHeight-10)return null;var r=this.view.textDirection==f.c.RTL,i=t.left,a=innerWidth-t.right;return r&&i=this.options.length?this:new e(this.options,C(n,t),this.tooltip,this.timestamp,t)}},{key:"map",value:function(t){return new e(this.options,this.attrs,[Object.assign(Object.assign({},this.tooltip[0]),{pos:t.mapPos(this.tooltip[0].pos)})],this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i){var a=function(e,t){var n,r=[],i=Object(o.a)(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.hasResult()){var s,l=new b(t.sliceDoc(a.from,a.to)),c=void 0,u=Object(o.a)(a.result.options);try{for(u.s();!(s=u.n()).done;){var f=s.value;(c=l.match(f.label))&&(null!=f.boost&&(c[0]+=f.boost),r.push(new p(f,a,c)))}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){i.e(d)}finally{i.f()}return r.sort(T),r.length>300?r.slice(0,300):r}(t,n);if(!a.length)return null;var s,l=0;if(i)for(var c=i.options[i.selected].completion,u=0;ua?new P(this.source,"input"==t&&r.activateOnTyping?1:0,!1):this.span&&(i==a||this.span.test(e.state.sliceDoc(i,a)))?new n(this.source,this.explicit,this.result,i,a,this.span):new P(this.source,1,this.explicit)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new P(this.source,0,!1):new n(this.source,this.explicit,this.result,e.changes.mapPos(this.from),e.changes.mapPos(this.to,1),this.span)}},{key:"map",value:function(e){return new n(this.source,this.explicit,this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}]),n}(P),D=u.i.define(),A=u.i.define({map:function(e,t){return e.map((function(e){return e.hasResult()&&!t.empty?e.map(t):e}))}}),R=u.i.define(),L=u.j.define({create:function(){return S.start()},update:function(e,t){return e.update(t)},provide:[c.b.nFrom((function(e){return e.tooltip})),f.d.contentAttributes.from((function(e){return e.attrs}))]});function N(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(L,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,a=1;"page"==t&&(i=n.dom.querySelector(".cm-tooltip-autocomplete"))&&(a=Math.max(2,Math.floor(i.offsetHeight/i.firstChild.offsetHeight)));var o=r.open.selected+a*(e?1:-1),s=r.open.options.length;return o<0?o="page"==t?0:s-1:o>=s&&(o="page"==t?s-1:0),n.dispatch({effects:R.of(o)}),!0}}var z=function(e){var t=e.state.field(L,!1);return!(!t||!t.open||Date.now()-t.open.timestamp<75)&&(g(e,t.open.options[t.open.selected]),!0)},I=function e(t,n){Object(s.a)(this,e),this.source=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0},F=f.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1;var n,r=Object(o.a)(t.state.field(L).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(a){r.e(a)}finally{r.f()}}return Object(l.a)(e,[{key:"update",value:function(e){var t=this,n=e.state.field(L);if(e.selectionSet||e.docChanged||e.prevState.field(L)!=n){for(var i=e.transactions.some((function(e){var t=e.annotation(u.l.userEvent);return(e.selection||e.docChanged)&&"input"!=t&&"delete"!=t})),a=0;a50&&s.time-Date.now()>1e3){var l,c=Object(o.a)(s.context.abortListeners);try{for(c.s();!(l=c.n()).done;){var d=l.value;try{d()}catch(p){Object(f.l)(this.view.state,p)}}}catch(v){c.e(v)}finally{c.f()}s.context.abortListeners=null,this.running.splice(a--,1)}else{var h;(h=s.updates).push.apply(h,Object(r.a)(e.transactions))}}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=this.view.state.field(L),r=Object(o.a)(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=v(n),i=new h(n,r,e.explicit),a=new I(e.source,i);this.running.push(a),Promise.resolve(e.source(i)).then((function(e){a.context.aborted||(a.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:D.of(!1)}),Object(f.l)(t.view.state,e)}))}},{key:"scheduleAccept",value:function(){var e=this;this.running.every((function(e){return void 0!==e.done}))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((function(){return e.accept()}),50))}},{key:"accept",value:function(){var e,t=this;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;for(var n=[],r=this.view.state.facet(y),i=function(i){var s=t.running[i];if(void 0===s.done)return a=i,"continue";if(t.running.splice(i--,1),s.done){var l,c=new _(s.source,s.context.explicit,s.done,s.done.from,null!==(e=s.done.to)&&void 0!==e?e:v(s.updates.length?s.updates[0].startState:t.view.state),s.done.span?m(s.done.span,!0):null),u=Object(o.a)(s.updates);try{for(u.s();!(l=u.n()).done;){var f=l.value;c=c.update(f,r)}}catch(y){u.e(y)}finally{u.f()}if(c.hasResult())return n.push(c),a=i,"continue"}var d=t.view.state.field(L).active.find((function(e){return e.source==s.source}));if(d&&1==d.state)if(null==s.done){var h,p=new P(s.source,0,!1),g=Object(o.a)(s.updates);try{for(g.s();!(h=g.n()).done;){var b=h.value;p=p.update(b,r)}}catch(y){g.e(y)}finally{g.f()}1!=p.state&&n.push(p)}else t.startQuery(d);a=i},a=0;a=e.to}))}))}}]),e}(),U=u.i.define({map:function(e,t){return e&&e.map(t)}}),q=u.i.define(),Y=u.j.define({create:function(){return null},update:function(e,t){var n,r=Object(o.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(U))return i.value;if(i.is(q)&&e)return new V(e.ranges,i.value)}}catch(a){r.e(a)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:[f.d.decorations.from((function(e){return e?e.deco:f.b.none}))]});function X(e,t){return u.d.create(e.filter((function(e){return e.field==t})).map((function(e){return u.d.range(e.from,e.to)})))}function K(e){var t=Q.parse(e);return function(e,n,r,i){var a=t.instantiate(e.state,r),o=a.text,s=a.ranges,l={changes:{from:r,to:i,insert:u.k.of(o)}};s.length&&(l.selection=X(s,0)),s.length>1&&(l.effects=U.of(new V(s,0)),void 0===e.state.field(Y,!1)&&(l.reconfigure={append:[Y,Z,O]})),e.dispatch(e.state.update(l))}}function G(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(Y,!1);if(!i||e<0&&0==i.active)return!1;var a=i.active+e,o=e>0&&!i.ranges.some((function(t){return t.field==a+e}));return r(n.update({selection:X(i.ranges,a),effects:U.of(o?null:new V(i.ranges,a))})),!0}}var Z=Object(u.o)(Object(f.k)([{key:"Tab",run:G(1),shift:G(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(Y,!1)&&(n(t.update({effects:U.of(null)})),!0)}}]),"override");function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[L,y.of(e),F,O,Object(c.c)(),Object(u.o)(Object(f.k)([{key:"ArrowDown",run:N(!0)},{key:"ArrowUp",run:N(!1)},{key:"PageDown",run:N(!0,"page")},{key:"PageUp",run:N(!1,"page")},{key:"Enter",run:z}]),"override")]}var ee=[{key:"Mod-Space",run:function(e){return!!e.state.field(L,!1)&&(e.dispatch({effects:D.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(L,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:D.of(!1)}),!0)}}]},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(82);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(83);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},function(e,t,n){var r;!function(i,a,o,s){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=a.createElement("div"),f=Math.round,d=Math.abs,h=Date.now;function p(e,t,n){return setTimeout(k(e,n),t)}function v(e,t,n){return!!Array.isArray(e)&&(m(e,n[t],n),!0)}function m(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",a=i.console&&(i.console.warn||i.console.log);return a&&a.call(i.console,r,n),e.apply(this,arguments)}}l="function"!==typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1}function E(e){return e.trim().split(/\s+/g)}function T(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;rn[t]})):r.sort()),r}function D(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=V(t):1===i&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,l=o?o.center:a.center,c=t.center=U(r);t.timeStamp=h(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=K(l,c),t.distance=X(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};1!==t.eventType&&4!==a.eventType||(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=Y(t.deltaX,t.deltaY);var u=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=u.x,t.overallVelocityY=u.y,t.overallVelocity=d(u.x)>d(u.y)?u.x:u.y,t.scale=o?(f=o.pointers,p=r,X(p[0],p[1],Q)/X(f[0],f[1],Q)):1,t.rotation=o?function(e,t){return K(t[1],t[0],Q)+K(e[1],e[0],Q)}(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,a,o=e.lastInterval||t,l=t.timeStamp-o.timeStamp;if(8!=t.eventType&&(l>25||o.velocity===s)){var c=t.deltaX-o.deltaX,u=t.deltaY-o.deltaY,f=q(l,c,u);r=f.x,i=f.y,n=d(f.x)>d(f.y)?f.x:f.y,a=Y(c,u),e.lastInterval=t}else n=o.velocity,r=o.velocityX,i=o.velocityY,a=o.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=a}(n,t);var f,p;var v=e.element;C(t.srcEvent.target,v)&&(v=t.srcEvent.target);t.target=v}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function V(e){for(var t=[],n=0;n=d(t)?e<0?2:4:t<0?8:16}function X(e,t,n){n||(n=B);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function K(e,t,n){n||(n=B);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}W.prototype={handler:function(){},init:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(R(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4},Z="mousedown",J="mousemove mouseup";function ee(){this.evEl=Z,this.evWin=J,this.pressed=!1,W.apply(this,arguments)}O(ee,W,{handler:function(e){var t=G[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var te={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ne={2:I,3:"pen",4:F,5:"kinect"},re="pointerdown",ie="pointermove pointerup pointercancel";function ae(){this.evEl=re,this.evWin=ie,W.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(re="MSPointerDown",ie="MSPointerMove MSPointerUp MSPointerCancel"),O(ae,W,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=te[r],a=ne[e.pointerType]||e.pointerType,o=a==I,s=T(t,e.pointerId,"pointerId");1&i&&(0===e.button||o)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:e}),n&&t.splice(s,1))}});var oe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},se="touchstart",le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=se,this.evWin=le,this.started=!1,W.apply(this,arguments)}function ue(e,t){var n=P(e.touches),r=P(e.changedTouches);return 12&t&&(n=_(n.concat(r),"identifier",!0)),[n,r]}O(ce,W,{handler:function(e){var t=oe[e.type];if(1===t&&(this.started=!0),this.started){var n=ue.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}}});var fe={touchstart:1,touchmove:2,touchend:4,touchcancel:8},de="touchstart touchmove touchend touchcancel";function he(){this.evTarget=de,this.targetIds={},W.apply(this,arguments)}function pe(e,t){var n=P(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,a,o=P(e.changedTouches),s=[],l=this.target;if(a=n.filter((function(e){return C(e.target,l)})),1===t)for(i=0;i-1&&r.splice(e,1)}),2500)}}function be(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+_e(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+_e(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Te},canEmit:function(){for(var e=0;et.threshold&&i&t.direction},attrTest:function(e){return Re.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),O(Ne,Re,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),O(ze,Pe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Te},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),O(Ie,Re,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),O(Fe,Re,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Le.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&$&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&d(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),O($e,Pe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[we]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancee.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.bottom||s.right<=t.left||s.left>=t.right)a.style.top="-10000px";else{var c=l.right-l.left,u=l.bottom-l.top,f=this.view.textDirection==o.c.LTR?Math.min(s.left,e.innerWidth-c):Math.max(0,s.left-c),d=!!r.above;!r.strictSide&&(d?s.top-(l.bottom-l.top)<0:s.bottom+(l.bottom-l.top)>e.innerHeight)&&(d=!d),a.style.top=(d?s.top-u:s.bottom)+"px",a.style.left=f+"px",a.classList.toggle("cm-tooltip-above",d),a.classList.toggle("cm-tooltip-below",!d),i.positioned&&i.positioned()}}}},{key:"maybeMeasure",value:function(){this.tooltips.length&&((this.view.inView||this.inView)&&this.view.requestMeasure(this.measureReq),this.inView=this.view.inView)}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),c=o.d.baseTheme({$tooltip:{position:"fixed",border:"1px solid #ddd",backgroundColor:"#f5f5f5",zIndex:100}});function u(){return[l,c]}var f=s.f.define(),d=function(){function e(t,n,r,a){Object(i.a)(this,e),this.view=t,this.source=n,this.field=r,this.setHover=a,this.lastMouseMove=null,this.hoverTimeout=-1,this.mouseInside=!1,this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseenter",this.mouseenter=this.mouseenter.bind(this)),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Object(a.a)(e,[{key:"checkHover",value:function(){var e=this;if(this.hoverTimeout=-1,this.mouseInside&&!this.active){var t=Date.now(),n=this.lastMouseMove;if(t-n.timeStamp<750)this.hoverTimeout=setTimeout(this.checkHover,750-(t-n.timeStamp));else{var r=this.view.contentDOM.contains(n.target)?this.view.posAtCoords({x:n.clientX,y:n.clientY}):-1,i=r<0?null:this.source(this.view,(function(t,i){return t<=r&&i>=r&&(t==i||h(e.view,t,i,n.clientX,n.clientY))}));i&&this.view.dispatch({effects:this.setHover.of(i)})}}}},{key:"mousemove",value:function(e){var t;this.lastMouseMove=e,this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,750));var n=this.active;if(n&&!function(e){for(var t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(e.target)){var r=n.pos,i=null!==(t=n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords({x:e.clientX,y:e.clientY})==r:h(this.view,r,i,e.clientX,e.clientY,10))||this.view.dispatch({effects:this.setHover.of(null)})}}},{key:"mouseenter",value:function(){this.mouseInside=!0}},{key:"mouseleave",value:function(){this.mouseInside=!1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}},{key:"destroy",value:function(){this.view.dom.removeEventListener("mouseenter",this.mouseenter),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},{key:"active",get:function(){return this.view.state.field(this.field)}}]),e}();function h(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=document.createRange(),s=e.domAtPos(t),l=e.domAtPos(n);o.setEnd(l.node,l.offset),o.setStart(s.node,s.offset);for(var c=o.getClientRects(),u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=s.i.define(),i=s.j.define({create:function(){return null},update:function(e,i){if(e&&t.hideOnChange&&(i.docChanged||i.selection))return null;var a,o=Object(r.a)(i.effects);try{for(o.s();!(a=o.n()).done;){var l=a.value;if(l.is(n))return l.value}}catch(f){o.e(f)}finally{o.f()}if(e&&i.docChanged){var c=i.changes.mapPos(e.pos,-1,s.h.TrackDel);if(c<0)return null;var u=Object.assign(Object.create(null),e);return u.pos=c,null!=e.end&&(u.end=i.changes.mapPos(e.end)),u}return e},provide:[f.nFrom((function(e){return e?[e]:[]}))]});return[i,o.f.define((function(t){return new d(t,e,i,n)})),u()]}},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(0),o=(n(12),n(9)),s=n(11),l=n(18),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},u=a.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,u=e.classes,f=e.className,d=e.color,h=void 0===d?"initial":d,p=e.component,v=e.display,m=void 0===v?"initial":v,g=e.gutterBottom,b=void 0!==g&&g,y=e.noWrap,O=void 0!==y&&y,k=e.paragraph,x=void 0!==k&&k,w=e.variant,j=void 0===w?"body1":w,S=e.variantMapping,C=void 0===S?c:S,M=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),E=p||(x?"p":C[j]||c[j])||"span";return a.createElement(E,Object(r.a)({className:Object(o.a)(u.root,f,"inherit"!==j&&u[j],"initial"!==h&&u["color".concat(Object(l.a)(h))],O&&u.noWrap,b&&u.gutterBottom,x&&u.paragraph,"inherit"!==s&&u["align".concat(Object(l.a)(s))],"initial"!==m&&u["display".concat(Object(l.a)(m))]),ref:t},M))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(u)},function(e,t,n){"use strict";var r=n(2),i=n(8),a=n(0),o=(n(12),n(26)),s=n(9),l=n(23),c=n(31),u=n(11),f=n(63),d=n(56),h=n(264),p="undefined"===typeof window?a.useEffect:a.useLayoutEffect;var v=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,i=e.rippleX,o=e.rippleY,l=e.rippleSize,u=e.in,f=e.onExited,d=void 0===f?function(){}:f,h=e.timeout,v=a.useState(!1),m=v[0],g=v[1],b=Object(s.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),y={width:l,height:l,top:-l/2+o,left:-l/2+i},O=Object(s.a)(t.child,m&&t.childLeaving,r&&t.childPulsate),k=Object(c.a)(d);return p((function(){if(!u){g(!0);var e=setTimeout(k,h);return function(){clearTimeout(e)}}}),[k,u,h]),a.createElement("span",{className:b,style:y},a.createElement("span",{className:O}))},m=a.forwardRef((function(e,t){var n=e.center,o=void 0!==n&&n,l=e.classes,c=e.className,u=Object(i.a)(e,["center","classes","className"]),f=a.useState([]),p=f[0],m=f[1],g=a.useRef(0),b=a.useRef(null);a.useEffect((function(){b.current&&(b.current(),b.current=null)}),[p]);var y=a.useRef(!1),O=a.useRef(null),k=a.useRef(null),x=a.useRef(null);a.useEffect((function(){return function(){clearTimeout(O.current)}}),[]);var w=a.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,i=e.rippleSize,o=e.cb;m((function(e){return[].concat(Object(d.a)(e),[a.createElement(v,{key:g.current,classes:l,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i})])})),g.current+=1,b.current=o}),[l]),j=a.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,a=t.center,s=void 0===a?o||t.pulsate:a,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&y.current)y.current=!1;else{"touchstart"===e.type&&(y.current=!0);var u,f,d,h=c?null:x.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(p.width/2),f=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,g=v.clientY;u=Math.round(m-p.left),f=Math.round(g-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var b=2*Math.max(Math.abs((h?h.clientWidth:0)-u),u)+2,j=2*Math.max(Math.abs((h?h.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(b,2)+Math.pow(j,2))}e.touches?null===k.current&&(k.current=function(){w({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})},O.current=setTimeout((function(){k.current&&(k.current(),k.current=null)}),80)):w({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})}}),[o,w]),S=a.useCallback((function(){j({},{pulsate:!0})}),[j]),C=a.useCallback((function(e,t){if(clearTimeout(O.current),"touchend"===e.type&&k.current)return e.persist(),k.current(),k.current=null,void(O.current=setTimeout((function(){C(e,t)})));k.current=null,m((function(e){return e.length>0?e.slice(1):e})),b.current=t}),[]);return a.useImperativeHandle(t,(function(){return{pulsate:S,start:j,stop:C}}),[S,j,C]),a.createElement("span",Object(r.a)({className:Object(s.a)(l.root,c),ref:x},u),a.createElement(h.a,{component:null,exit:!0},p))})),g=Object(u.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(a.memo(m)),b=a.forwardRef((function(e,t){var n=e.action,u=e.buttonRef,d=e.centerRipple,h=void 0!==d&&d,p=e.children,v=e.classes,m=e.className,b=e.component,y=void 0===b?"button":b,O=e.disabled,k=void 0!==O&&O,x=e.disableRipple,w=void 0!==x&&x,j=e.disableTouchRipple,S=void 0!==j&&j,C=e.focusRipple,M=void 0!==C&&C,E=e.focusVisibleClassName,T=e.onBlur,P=e.onClick,_=e.onFocus,D=e.onFocusVisible,A=e.onKeyDown,R=e.onKeyUp,L=e.onMouseDown,N=e.onMouseLeave,z=e.onMouseUp,I=e.onTouchEnd,F=e.onTouchMove,$=e.onTouchStart,B=e.onDragLeave,Q=e.tabIndex,W=void 0===Q?0:Q,H=e.TouchRippleProps,V=e.type,U=void 0===V?"button":V,q=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),Y=a.useRef(null);var X=a.useRef(null),K=a.useState(!1),G=K[0],Z=K[1];k&&G&&Z(!1);var J=Object(f.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(c.a)((function(r){return t&&t(r),!n&&X.current&&X.current[e](r),!0}))}a.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),Y.current.focus()}}}),[]),a.useEffect((function(){G&&M&&!w&&X.current.pulsate()}),[w,M,G]);var ie=re("start",L),ae=re("stop",B),oe=re("stop",z),se=re("stop",(function(e){G&&e.preventDefault(),N&&N(e)})),le=re("start",$),ce=re("stop",I),ue=re("stop",F),fe=re("stop",(function(e){G&&(te(e),Z(!1)),T&&T(e)}),!1),de=Object(c.a)((function(e){Y.current||(Y.current=e.currentTarget),ee(e)&&(Z(!0),D&&D(e)),_&&_(e)})),he=function(){var e=o.findDOMNode(Y.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},pe=a.useRef(!1),ve=Object(c.a)((function(e){M&&!pe.current&&G&&X.current&&" "===e.key&&(pe.current=!0,e.persist(),X.current.stop(e,(function(){X.current.start(e)}))),e.target===e.currentTarget&&he()&&" "===e.key&&e.preventDefault(),A&&A(e),e.target===e.currentTarget&&he()&&"Enter"===e.key&&!k&&(e.preventDefault(),P&&P(e))})),me=Object(c.a)((function(e){M&&" "===e.key&&X.current&&G&&!e.defaultPrevented&&(pe.current=!1,e.persist(),X.current.stop(e,(function(){X.current.pulsate(e)}))),R&&R(e),P&&e.target===e.currentTarget&&he()&&" "===e.key&&!e.defaultPrevented&&P(e)})),ge=y;"button"===ge&&q.href&&(ge="a");var be={};"button"===ge?(be.type=U,be.disabled=k):("a"===ge&&q.href||(be.role="button"),be["aria-disabled"]=k);var ye=Object(l.a)(u,t),Oe=Object(l.a)(ne,Y),ke=Object(l.a)(ye,Oe),xe=a.useState(!1),we=xe[0],je=xe[1];a.useEffect((function(){je(!0)}),[]);var Se=we&&!w&&!k;return a.createElement(ge,Object(r.a)({className:Object(s.a)(v.root,m,G&&[v.focusVisible,E],k&&v.disabled),onBlur:fe,onClick:P,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:ie,onMouseLeave:se,onMouseUp:oe,onDragLeave:ae,onTouchEnd:ce,onTouchMove:ue,onTouchStart:le,ref:ke,tabIndex:k?-1:W},be,q),p,Se?a.createElement(g,Object(r.a)({ref:X,center:h},H)):null)}));t.a=Object(u.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(b)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e){var t=r.useState(e),n=t[0],i=t[1],a=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),a}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(56),n(2);var r=n(60),i=(n(12),n(66),{xs:0,sm:600,md:960,lg:1280,xl:1920}),a={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function o(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||a;return t.reduce((function(e,r,a){return e[i.up(i.keys[a])]=n(t[a]),e}),{})}if("object"===Object(r.a)(t)){var o=e.theme.breakpoints||a;return Object.keys(t).reduce((function(e,r){return e[o.up(r)]=n(t[r]),e}),{})}return n(t)}},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(69),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?o:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var o=u(n);f&&(o=o.concat(f(n)));for(var s=l(t),v=l(n),m=0;m0&&void 0!==arguments[0]?arguments[0]:Date.now(),t=this,n=0;t._charts.forEach((function(r,i){if(r.running&&r.items.length){for(var a,o=r.items,s=o.length-1,l=!1;s>=0;--s)(a=o[s])._active?(a._total>r.duration&&(r.duration=a._total),a.tick(e),l=!0):(o[s]=o[o.length-1],o.pop());l&&(i.draw(),t._notify(i,r,e,"progress")),o.length||(r.running=!1,t._notify(i,r,e,"complete"),r.initial=!1),n+=o.length}})),t._lastDate=e,0===n&&(t._running=!1)}},{key:"_getAnims",value:function(e){var t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}},{key:"listen",value:function(e,t,n){this._getAnims(e).listeners[t].push(n)}},{key:"add",value:function(e,t){var n;t&&t.length&&(n=this._getAnims(e).items).push.apply(n,Object(f.a)(t))}},{key:"has",value:function(e){return this._getAnims(e).items.length>0}},{key:"start",value:function(e){var t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((function(e,t){return Math.max(e,t._duration)}),0),this._refresh())}},{key:"running",value:function(e){if(!this._running)return!1;var t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}},{key:"stop",value:function(e){var t=this._charts.get(e);if(t&&t.items.length){for(var n=t.items,r=n.length-1;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}}},{key:"remove",value:function(e){return this._charts.delete(e)}}]),e}()),m="transparent",g={boolean:function(e,t,n){return n>.5?t:e},color:function(e,t,n){var r=Object(p.wb)(e||m),i=r.valid&&Object(p.wb)(t||m);return i&&i.valid?i.mix(r,n).hexString():t},number:function(e,t,n){return e+(t-e)*n}},b=function(){function e(t,n,r,i){Object(d.a)(this,e);var a=n[r];i=Object(p.C)([t.to,i,a,t.from]);var o=Object(p.C)([t.from,a,i]);this._active=!0,this._fn=t.fn||g[t.type||typeof o],this._easing=p.yb[t.easing]||p.yb.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}return Object(h.a)(e,[{key:"active",value:function(){return this._active}},{key:"update",value:function(e,t,n){var r=this;if(r._active){r._notify(!1);var i=r._target[r._prop],a=n-r._start,o=r._duration-a;r._start=n,r._duration=Math.floor(Math.max(o,e.duration)),r._total+=a,r._loop=!!e.loop,r._to=Object(p.C)([e.to,t,i,e.from]),r._from=Object(p.C)([e.from,i,t])}}},{key:"cancel",value:function(){var e=this;e._active&&(e.tick(Date.now()),e._active=!1,e._notify(!1))}},{key:"tick",value:function(e){var t,n=this,r=e-n._start,i=n._duration,a=n._prop,o=n._from,s=n._loop,l=n._to;if(n._active=o!==l&&(s||r1?2-t:t,t=n._easing(Math.min(1,Math.max(0,t))),n._target[a]=n._fn(o,l,t))}},{key:"wait",value:function(){var e=this._promises||(this._promises=[]);return new Promise((function(t,n){e.push({res:t,rej:n})}))}},{key:"_notify",value:function(e){for(var t=e?"res":"rej",n=this._promises||[],r=0;r=0;--n){var l=o[n];if("$"!==l.charAt(0))if("options"!==l){var c=t[l],u=a[l],d=r.get(l);if(u){if(d&&u.active()){u.update(d,c,s);continue}u.cancel()}d&&d.duration?(a[l]=u=new b(d,e,l,c),i.push(u)):e[l]=c}else i.push.apply(i,Object(f.a)(this._animateOptions(e,t)))}return i}},{key:"update",value:function(e,t){if(0!==this._properties.size){var n=this._createAnimations(e,t);return n.length?(v.add(this._chart,n),!0):void 0}Object.assign(e,t)}}]),e}();function k(e,t){var n=e&&e.options||{},r=n.reverse,i=void 0===n.min?t:0,a=void 0===n.max?t:0;return{start:r?a:i,end:r?i:a}}function x(e,t){var n,r,i=[],a=e._getSortedDatasetMetas(t);for(n=0,r=a.length;n0||!n&&o<0)return a.index}}catch(s){i.e(s)}finally{i.f()}return null}function M(e,t){for(var n,r=e.chart,i=e._cachedMeta,a=r._stacks||(r._stacks={}),o=i.iScale,s=i.vScale,l=i.index,c=o.axis,u=s.axis,f=function(e,t,n){return"".concat(e.id,".").concat(t.id,".").concat(n.stack||n.type)}(o,s,i),d=t.length,h=0;h0&&o._parsed[e-1];if(!1===a._parsing)o._parsed=s,o._sorted=!0,i=s;else{i=Object(p.vb)(s[e])?a.parseArrayData(o,s,e,t):Object(p.Cb)(s[e])?a.parseObjectData(o,s,e,t):a.parsePrimitiveData(o,s,e,t);for(n=0;na||g=0;--n)if(!b()){o.updateRangeFromParsed(h,e,i,d);break}return h}},{key:"getAllParsedValues",value:function(e){var t,n,r,i=this._cachedMeta._parsed,a=[];for(t=0,n=i.length;t=0&&e1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,r=this,i="active"===t,a=r._cachedDataOpts,o=e+"-"+t,s=a[o],l=r.enableOptionSharing&&Object(p.Bb)(n);if(s)return _(s,l);var c=r.chart.config,u=c.datasetElementScopeKeys(r._type,e),f=i?["".concat(e,"Hover"),"hover",e,""]:[e,""],d=c.getOptionScopes(r.getDataset(),u),h=Object.keys(p.xb.elements[e]),v=function(){return r.getContext(n,i)},m=c.resolveNamedOptions(d,h,v,f);return m.$shared&&(m.$shared=l,a[o]=Object.freeze(_(m,l))),m}},{key:"_resolveAnimations",value:function(e,t,n){var r,i=this,a=i.chart,o=i._cachedDataOpts,s="animation-".concat(t),l=o[s];if(l)return l;if(!1!==a.options.animation){var c=i.chart.config,u=c.datasetAnimationScopeKeys(i._type,t),f=c.getOptionScopes(i.getDataset(),u);r=c.createResolver(f,i.getContext(e,n,t))}var d=new O(a,r&&r.animations);return r&&r._cacheable&&(o[s]=Object.freeze(d)),d}},{key:"getSharedOptions",value:function(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}},{key:"includeOptions",value:function(e,t){return!t||P(e)||this.chart._animationsDisabled}},{key:"updateElement",value:function(e,t,n,r){P(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}},{key:"updateSharedOptions",value:function(e,t,n){e&&!P(t)&&this._resolveAnimations(void 0,t).update(e,n)}},{key:"_setStyle",value:function(e,t,n,r){e.active=r;var i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}},{key:"removeHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!1)}},{key:"setHoverStyle",value:function(e,t,n){this._setStyle(e,n,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}},{key:"_resyncElements",value:function(e){var t,n=this,r=n._data,i=n._cachedMeta.data,a=Object(u.a)(n._syncList);try{for(a.s();!(t=a.n()).done;){var o=Object(l.a)(t.value,3),s=o[0],c=o[1],f=o[2];n[s](c,f)}}catch(v){a.e(v)}finally{a.f()}n._syncList=[];var d=i.length,h=r.length,p=Math.min(h,d);p&&n.parse(0,p),h>d?n._insertElements(d,h-d,e):h2&&void 0!==arguments[2])||arguments[2],i=this,a=i._cachedMeta,o=a.data,s=e+t,l=function(e){for(e.length+=t,n=e.length-1;n>=s;n--)e[n]=e[n-t]};for(l(o),n=e;nMath.abs(s)&&(l=s,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:a,min:o,max:s}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function L(e,t,n,r){var i,a,o,s,l=e.iScale,c=e.vScale,u=l.getLabels(),f=l===c,d=[];for(i=n,a=n+r;ie.x,n="left",r="right"):(t=e.base=n?1:-1)}(n,a,u)*c,v===u&&(y-=n/2),t=y+n),y===a.getPixelForValue(u)){var O=Object(p.Mb)(n)*a.getLineWidthForValue(u)/2;y+=O,n-=O}return{size:n,base:y,head:t,center:t+n/2}}},{key:"_calculateBarIndexPixels",value:function(e,t){var n,r,i=this,a=t.scale,o=i.options,s=o.skipNull,l=Object(p.Pb)(o.maxBarThickness,1/0);if(t.grouped){var c=s?i._getStackCount(e):t.stackCount,u="flex"===o.barThickness?function(e,t,n,r){var i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e=0;--i)r=Math.max(r,t[i].size()/2,n[i]._custom);return r>0&&r}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=t.xScale,r=t.yScale,i=this.getParsed(e),a=n.getLabelForValue(i.x),o=r.getLabelForValue(i.y),s=i._custom;return{label:t.label,value:"("+a+", "+o+(s?", "+s:"")+")"}}},{key:"update",value:function(e){var t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}},{key:"updateElements",value:function(e,t,n,r){for(var i=this,a="reset"===r,o=i._cachedMeta,s=o.iScale,l=o.vScale,c=i.resolveDataElementOptions(t,r),u=i.getSharedOptions(c),f=i.includeOptions(r,u),d=s.axis,h=l.axis,p=t;p0&&!isNaN(e)?p.u*(Math.abs(e)/t):0}},{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Object(p.Hb)(t._parsed[e],n.options.locale);return{label:r[e]||"",value:i}}},{key:"getMaxBorderWidth",value:function(e){var t,n,r,i,a,o=0,s=this.chart;if(!e)for(t=0,n=s.data.datasets.length;t0&&i.getParsed(t-1),O=t;O0&&x[h]-y[h]>g,w.parsed=x,d&&(w.options=f||i.resolveDataElementOptions(O,k.active?"active":r)),b||i.updateElement(k,O,w,r),y=x}i.updateSharedOptions(f,r,u)}},{key:"getMaxOverflow",value:function(){var e=this,t=e._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;var a=i[0].size(e.resolveDataElementOptions(0)),o=i[i.length-1].size(e.resolveDataElementOptions(i.length-1));return Math.max(r,a,o)/2}},{key:"draw",value:function(){var e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),Object(i.a)(Object(a.a)(n.prototype),"draw",this).call(this)}}]),n}(D);W.id="line",W.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},W.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var H=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(d.a)(this,n),(i=t.call(this,e,r)).innerRadius=void 0,i.outerRadius=void 0,i}return Object(h.a)(n,[{key:"getLabelAndValue",value:function(e){var t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Object(p.Hb)(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:i}}},{key:"update",value:function(e){var t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}},{key:"_updateRadius",value:function(){var e=this,t=e.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),a=Math.max(i/2,0),o=(a-Math.max(r.cutoutPercentage?a/100*r.cutoutPercentage:1,0))/t.getVisibleDatasetCount();e.outerRadius=a-o*e.index,e.innerRadius=e.outerRadius-o}},{key:"updateElements",value:function(e,t,n,r){var i,a=this,o="reset"===r,s=a.chart,l=a.getDataset(),c=s.options.animation,u=a._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,h=u.getIndexAngle(0)-.5*p.q,v=h,m=360/a.countVisibleElements();for(i=0;i0){var s=o[0].datasetIndex,l=e.getDatasetMeta(s).data;o=[];for(var c=0;c1){var o=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(o<1e-4||o>1e15)&&(r="scientific"),a=function(e,t){var n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e));return n}(e,n)}var s=Object(p.k)(Math.abs(a)),l=Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Object(p.Hb)(e,i,c)},logarithmic:function(e,t,n){if(0===e)return"0";var r=e/Math.pow(10,Math.floor(Object(p.k)(e)));return 1===r||2===r||5===r?Ne.numeric.call(this,e,t,n):""}};var ze={formatters:Ne};function Ie(e,t){var n=e.options.ticks,r=n.maxTicksLimit||function(e){var t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}(e),i=n.major.enabled?function(e){var t,n,r=[];for(t=0,n=e.length;tr)return function(e,t,n,r){var i,a=0,o=n[0];for(r=Math.ceil(r),i=0;ii)return l}return Math.max(i,1)}(i,t,r);if(a>0){var u,f,d=a>1?Math.round((s-o)/(a-1)):null;for(Fe(t,l,c,Object(p.Db)(d)?0:o-d,o),u=0,f=a-1;us+l)))return c}function We(e){return e.drawTicks?e.tickLength:0}function He(e,t){if(!e.display)return 0;var n=Object(p.y)(e.font,t),r=Object(p.b)(e.padding);return(Object(p.vb)(e.text)?e.text.length:1)*n.lineHeight+r.height}function Ve(e,t,n){var r=Object(p.z)(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=function(e){return"left"===e?"right":"right"===e?"left":e}(r)),r}var Ue=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(d.a)(this,n),(r=t.call(this)).id=e.id,r.type=e.type,r.options=void 0,r.ctx=e.ctx,r.chart=e.chart,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r._margins={left:0,right:0,top:0,bottom:0},r.maxWidth=void 0,r.maxHeight=void 0,r.paddingTop=void 0,r.paddingBottom=void 0,r.paddingLeft=void 0,r.paddingRight=void 0,r.axis=void 0,r.labelRotation=void 0,r.min=void 0,r.max=void 0,r._range=void 0,r.ticks=[],r._gridLineItems=null,r._labelItems=null,r._labelSizes=null,r._length=0,r._maxLength=0,r._longestTextCache={},r._startPixel=void 0,r._endPixel=void 0,r._reversePixels=!1,r._userMax=void 0,r._userMin=void 0,r._suggestedMax=void 0,r._suggestedMin=void 0,r._ticksLength=0,r._borderValue=0,r._cache={},r._dataLimitsCached=!1,r.$context=void 0,r}return Object(h.a)(n,[{key:"init",value:function(e){var t=this;t.options=e.setContext(t.getContext()),t.axis=e.axis,t._userMin=t.parse(e.min),t._userMax=t.parse(e.max),t._suggestedMin=t.parse(e.suggestedMin),t._suggestedMax=t.parse(e.suggestedMax)}},{key:"parse",value:function(e,t){return e}},{key:"getUserBounds",value:function(){var e=this._userMin,t=this._userMax,n=this._suggestedMin,r=this._suggestedMax;return e=Object(p.m)(e,Number.POSITIVE_INFINITY),t=Object(p.m)(t,Number.NEGATIVE_INFINITY),n=Object(p.m)(n,Number.POSITIVE_INFINITY),r=Object(p.m)(r,Number.NEGATIVE_INFINITY),{min:Object(p.m)(e,n),max:Object(p.m)(t,r),minDefined:Object(p.Ab)(e),maxDefined:Object(p.Ab)(t)}}},{key:"getMinMax",value:function(e){var t,n=this,r=n.getUserBounds(),i=r.min,a=r.max,o=r.minDefined,s=r.maxDefined;if(o&&s)return{min:i,max:a};for(var l=n.getMatchingVisibleMetas(),c=0,u=l.length;c=l||o<=1||!r.isHorizontal())r.labelRotation=s;else{var u=r._getLabelSizes(),f=u.widest.width,d=u.highest.height,h=Object(p.Kb)(r.chart.width-f,0,r.maxWidth);f+6>(e=i.offset?r.maxWidth/o:h/(o-1))&&(e=h/(o-(i.offset?.5:1)),t=r.maxHeight-We(i.grid)-a.padding-He(i.title,r.chart.options.font),n=Math.sqrt(f*f+d*d),c=Object(p.p)(Math.min(Math.asin(Object(p.Kb)((u.highest.height+6)/e,-1,1)),Math.asin(Object(p.Kb)(t/n,-1,1))-Math.asin(Object(p.Kb)(d/n,-1,1)))),c=Math.max(s,Math.min(l,c))),r.labelRotation=c}}},{key:"afterCalculateLabelRotation",value:function(){Object(p.n)(this.options.afterCalculateLabelRotation,[this])}},{key:"beforeFit",value:function(){Object(p.n)(this.options.beforeFit,[this])}},{key:"fit",value:function(){var e=this,t={width:0,height:0},n=e.chart,r=e.options,i=r.ticks,a=r.title,o=r.grid,s=e._isVisible(),l=e.isHorizontal();if(s){var c=He(a,n.options.font);if(l?(t.width=e.maxWidth,t.height=We(o)+c):(t.height=e.maxHeight,t.width=We(o)+c),i.display&&e.ticks.length){var u=e._getLabelSizes(),f=u.first,d=u.last,h=u.widest,v=u.highest,m=2*i.padding,g=Object(p.Nb)(e.labelRotation),b=Math.cos(g),y=Math.sin(g);if(l){var O=i.mirror?0:y*h.width+b*v.height;t.height=Math.min(e.maxHeight,t.height+O+m)}else{var k=i.mirror?0:b*h.width+y*v.height;t.width=Math.min(e.maxWidth,t.width+k+m)}e._calculatePadding(f,d,y,b)}}e._handleMargins(),l?(e.width=e._length=n.width-e._margins.left-e._margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e._margins.top-e._margins.bottom)}},{key:"_calculatePadding",value:function(e,t,n,r){var i=this,a=i.options,o=a.ticks,s=o.align,l=o.padding,c=a.position,u=0!==i.labelRotation,f="top"!==c&&"x"===i.axis;if(i.isHorizontal()){var d=i.getPixelForTick(0)-i.left,h=i.right-i.getPixelForTick(i.ticks.length-1),p=0,v=0;u?f?(p=r*e.width,v=n*t.height):(p=n*e.height,v=r*t.width):"start"===s?v=t.width:"end"===s?p=e.width:(p=e.width/2,v=t.width/2),i.paddingLeft=Math.max((p-d+l)*i.width/(i.width-d),0),i.paddingRight=Math.max((v-h+l)*i.width/(i.width-h),0)}else{var m=t.height/2,g=e.height/2;"start"===s?(m=0,g=e.height):"end"===s&&(m=t.height,g=0),i.paddingTop=m+l,i.paddingBottom=g+l}}},{key:"_handleMargins",value:function(){var e=this;e._margins&&(e._margins.left=Math.max(e.paddingLeft,e._margins.left),e._margins.top=Math.max(e.paddingTop,e._margins.top),e._margins.right=Math.max(e.paddingRight,e._margins.right),e._margins.bottom=Math.max(e.paddingBottom,e._margins.bottom))}},{key:"afterFit",value:function(){Object(p.n)(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var e=this.options,t=e.axis,n=e.position;return"top"===n||"bottom"===n||"x"===t}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(e){var t,n,r=this;for(r.beforeTickToLabelConversion(),r.generateTickLabels(e),t=0,n=e.length;tt){for(n=0;nt.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getPixelForDecimal",value:function(e){var t=this;t._reversePixels&&(e=1-e);var n=t._startPixel+e*t._length;return Object(p.s)(t._alignToPixels?Object(p.t)(t.chart,n,0):n)}},{key:"getDecimalForPixel",value:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var e=this.min,t=this.max;return e<0&&t<0?t:e>0&&t>0?e:0}},{key:"getContext",value:function(e){var t,n,r=this,i=r.ticks||[];if(e>=0&&es*i?s/r:l/i:l*i0}},{key:"_computeGridLineItems",value:function(e){var t,n,r,i,a,o,s,l,c,u,f,d,h=this,v=h.axis,m=h.chart,g=h.options,b=g.grid,y=g.position,O=b.offset,k=h.isHorizontal(),x=h.ticks.length+(O?1:0),w=We(b),j=[],S=b.setContext(h.getContext()),C=S.drawBorder?S.borderWidth:0,M=C/2,E=function(e){return Object(p.t)(m,e,C)};if("top"===y)t=E(h.bottom),o=h.bottom-w,l=t-M,u=E(e.top)+M,d=e.bottom;else if("bottom"===y)t=E(h.top),u=e.top,d=E(e.bottom)-M,o=t+M,l=h.top+w;else if("left"===y)t=E(h.right),a=h.right-w,s=t-M,c=E(e.left)+M,f=e.right;else if("right"===y)t=E(h.left),c=e.left,f=E(e.right)-M,a=t+M,s=h.left+w;else if("x"===v){if("center"===y)t=E((e.top+e.bottom)/2+.5);else if(Object(p.Cb)(y)){var T=Object.keys(y)[0],P=y[T];t=E(h.chart.scales[T].getPixelForValue(P))}u=e.top,d=e.bottom,l=(o=t+M)+w}else if("y"===v){if("center"===y)t=E((e.left+e.right)/2);else if(Object(p.Cb)(y)){var _=Object.keys(y)[0],D=y[_];t=E(h.chart.scales[_].getPixelForValue(D))}s=(a=t-M)-w,c=e.left,f=e.right}var A=Object(p.Pb)(g.ticks.maxTicksLimit,x),R=Math.max(1,Math.ceil(x/A));for(n=0;n=0?n.setContext(t.getContext(r)).lineWidth:0}},{key:"drawGrid",value:function(e){var t,n,r=this,i=r.options.grid,a=r.ctx,o=r._gridLineItems||(r._gridLineItems=r._computeGridLineItems(e)),s=function(e,t,n){n.width&&n.color&&(a.save(),a.lineWidth=n.width,a.strokeStyle=n.color,a.setLineDash(n.borderDash||[]),a.lineDashOffset=n.borderDashOffset,a.beginPath(),a.moveTo(e.x,e.y),a.lineTo(t.x,t.y),a.stroke(),a.restore())};if(i.display)for(t=0,n=o.length;t3&&void 0!==arguments[3]?arguments[3]:[""],i={$shared:!0},a=st(this._resolverCache,e,r),o=a.resolver,s=a.subPrefixes,l=o;if(lt(o,t)){i.$shared=!1,n=Object(p.G)(n)?n():n;var c=this.createResolver(e,n,s);l=Object(p.H)(o,n,c)}var f,d=Object(u.a)(t);try{for(d.s();!(f=d.n()).done;){var h=f.value;i[h]=l[h]}}catch(v){d.e(v)}finally{d.f()}return i}},{key:"createResolver",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,i=st(this._resolverCache,e,n),a=i.resolver;return Object(p.Cb)(t)?Object(p.H)(a,t,void 0,r):a}},{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(e){this._config.type=e}},{key:"data",get:function(){return this._config.data},set:function(e){this._config.data=tt(e)}},{key:"options",get:function(){return this._config.options},set:function(e){this._config.options=e}},{key:"plugins",get:function(){return this._config.plugins}}]),e}();function st(e,t,n){var r=e.get(t);r||(r=new Map,e.set(t,r));var i=n.join(),a=r.get(i);a||(a={resolver:Object(p.I)(t,n),subPrefixes:n.filter((function(e){return!e.toLowerCase().includes("hover")}))},r.set(i,a));return a}function lt(e,t){var n,r=Object(p.J)(e),i=r.isScriptable,a=r.isIndexable,o=Object(u.a)(t);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(i(s)&&Object(p.G)(e[s])||a(s)&&Object(p.vb)(e[s]))return!0}}catch(l){o.e(l)}finally{o.f()}return!1}var ct=["top","bottom","left","right","chartArea"];function ut(e,t){return"top"===e||"bottom"===e||-1===ct.indexOf(e)&&"x"===t}function ft(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function dt(e){var t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Object(p.n)(n&&n.onComplete,[e],t)}function ht(e){var t=e.chart,n=t.options.animation;Object(p.n)(n&&n.onProgress,[e],t)}function pt(e){return Object(p.j)()&&"string"===typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var vt={},mt=function(e){var t=pt(e);return Object.values(vt).filter((function(e){return e.canvas===t})).pop()},gt=function(){function e(t,n){var r=this;Object(d.a)(this,e);var i=this,a=this.config=new ot(n),o=pt(t),s=mt(o);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");var l=a.createResolver(a.chartOptionScopes(),i.getContext());this.platform=new(a.platform||function(e){return!Object(p.j)()||"undefined"!==typeof OffscreenCanvas&&e instanceof OffscreenCanvas?ke:Re}(o));var c=i.platform.acquireContext(o,l.aspectRatio),u=c&&c.canvas,f=u&&u.height,h=u&&u.width;this.id=Object(p.L)(),this.ctx=c,this.canvas=u,this.width=h,this.height=f,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Object(p.M)((function(){return r.update("resize")}),l.resizeDelay||0),vt[i.id]=i,c&&u?(v.listen(i,"complete",dt),v.listen(i,"progress",ht),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}return Object(h.a)(e,[{key:"_initialize",value:function(){var e=this;return e.notifyPlugins("beforeInit"),e.options.responsive?e.resize():Object(p.V)(e,e.options.devicePixelRatio),e.bindEvents(),e.notifyPlugins("afterInit"),e}},{key:"clear",value:function(){return Object(p.W)(this.canvas,this.ctx),this}},{key:"stop",value:function(){return v.stop(this),this}},{key:"resize",value:function(e,t){v.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}},{key:"_resize",value:function(e,t){var n=this,r=n.options,i=n.canvas,a=r.maintainAspectRatio&&n.aspectRatio,o=n.platform.getMaximumSize(i,e,t,a),s=r.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=o.width,n.height=o.height,n._aspectRatio=n.aspectRatio,Object(p.V)(n,s,!0)&&(n.notifyPlugins("resize",{size:o}),Object(p.n)(r.onResize,[n,o],n),n.attached&&n._doResize()&&n.render())}},{key:"ensureScalesHaveIDs",value:function(){var e=this.options.scales||{};Object(p.c)(e,(function(e,t){e.id=t}))}},{key:"buildOrUpdateScales",value:function(){var e=this,t=e.options,n=t.scales,r=e.scales,i=Object.keys(r).reduce((function(e,t){return e[t]=!1,e}),{}),a=[];n&&(a=a.concat(Object.keys(n).map((function(e){var t=n[e],r=Je(e,t),i="r"===r,a="x"===r;return{options:t,dposition:i?"chartArea":a?"bottom":"left",dtype:i?"radialLinear":a?"category":"linear"}})))),Object(p.c)(a,(function(n){var a=n.options,o=a.id,s=Je(o,a),l=Object(p.Pb)(a.type,n.dtype);void 0!==a.position&&ut(a.position,s)===ut(n.dposition)||(a.position=n.dposition),i[o]=!0;var c=null;o in r&&r[o].type===l?c=r[o]:(c=new(Ye.getScale(l))({id:o,type:l,ctx:e.ctx,chart:e}),r[c.id]=c);c.init(a,t)})),Object(p.c)(i,(function(e,t){e||delete r[t]})),Object(p.c)(r,(function(t){be(e,t,t.options),me(e,t)}))}},{key:"_updateMetasets",value:function(){var e=this,t=e._metasets,n=e.data.datasets.length,r=t.length;if(t.sort((function(e,t){return e.index-t.index})),r>n){for(var i=n;in.length&&delete e._stacks,t.forEach((function(t,r){0===n.filter((function(e){return e===t._dataset})).length&&e._destroyDatasetMeta(r)}))}},{key:"buildOrUpdateControllers",value:function(){var e,t,n=this,r=[],i=n.data.datasets;for(n._removeUnreferencedMetasets(),e=0,t=i.length;e=0;--n)e._drawDataset(t[n]);e.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(e){var t=this,n=t.ctx,r=e._clip,i=!r.disabled,a=t.chartArea,o={meta:e,index:e.index,cancelable:!0};!1!==t.notifyPlugins("beforeDatasetDraw",o)&&(i&&Object(p.v)(n,{left:!1===r.left?0:a.left-r.left,right:!1===r.right?t.width:a.right+r.right,top:!1===r.top?0:a.top-r.top,bottom:!1===r.bottom?t.height:a.bottom+r.bottom}),e.controller.draw(),i&&Object(p.x)(n),o.cancelable=!1,t.notifyPlugins("afterDatasetDraw",o))}},{key:"getElementsAtEventForMode",value:function(e,t,n,r){var i=re.modes[t];return"function"===typeof i?i(this,e,n,r):[]}},{key:"getDatasetMeta",value:function(e){var t=this.data.datasets[e],n=this._metasets,r=n.filter((function(e){return e&&e._dataset===t})).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}},{key:"getContext",value:function(){return this.$context||(this.$context={chart:this,type:"chart"})}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(e){var t=this.data.datasets[e];if(!t)return!1;var n=this.getDatasetMeta(e);return"boolean"===typeof n.hidden?!n.hidden:!t.hidden}},{key:"setDatasetVisibility",value:function(e,t){this.getDatasetMeta(e).hidden=!t}},{key:"toggleDataVisibility",value:function(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}},{key:"getDataVisibility",value:function(e){return!this._hiddenIndices[e]}},{key:"_updateVisibility",value:function(e,t,n){var r=this,i=n?"show":"hide",a=r.getDatasetMeta(e),o=a.controller._resolveAnimations(void 0,i);Object(p.Bb)(t)?(a.data[t].hidden=!n,r.update()):(r.setDatasetVisibility(e,n),o.update(a,{visible:n}),r.update((function(t){return t.datasetIndex===e?i:void 0})))}},{key:"hide",value:function(e,t){this._updateVisibility(e,t,!1)}},{key:"show",value:function(e,t){this._updateVisibility(e,t,!0)}},{key:"_destroyDatasetMeta",value:function(e){var t=this,n=t._metasets&&t._metasets[e];n&&n.controller&&(n.controller._destroy(),delete t._metasets[e])}},{key:"destroy",value:function(){var e,t,n=this,r=n.canvas,i=n.ctx;for(n.stop(),v.remove(n),e=0,t=n.data.datasets.length;ei?(c=i/l,e.arc(a,o,l,n+c,r-c,!0)):e.arc(a,o,i,n+p.i,r-p.i),e.closePath(),e.clip()}function kt(e,t,n,r){var i,a=(i=e.options.borderRadius,Object(p.ab)(i,["outerStart","outerEnd","innerStart","innerEnd"])),o=(n-t)/2,s=Math.min(o,r*t/2),l=function(e){var t=(n-Math.min(o,e))*r/2;return Object(p.Kb)(e,0,Math.min(o,t))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:Object(p.Kb)(a.innerStart,0,s),innerEnd:Object(p.Kb)(a.innerEnd,0,s)}}function xt(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function wt(e,t,n,r,i){var a=t.x,o=t.y,s=t.startAngle,l=t.pixelMargin,c=t.innerRadius,u=Math.max(t.outerRadius+r+n-l,0),f=c>0?c+r+n+l:0,d=0,h=i-s;if(r){var v=((c>0?c-r:0)+(u>0?u-r:0))/2;d=(h-(0!==v?h*v/(v+r):h))/2}var m=(h-Math.max(.001,h*u-n/p.q)/u)/2,g=s+m+d,b=i-m-d,y=kt(t,f,u,b-g),O=y.outerStart,k=y.outerEnd,x=y.innerStart,w=y.innerEnd,j=u-O,S=u-k,C=g+O/j,M=b-k/S,E=f+x,T=f+w,P=g+x/E,_=b-w/T;if(e.beginPath(),e.arc(a,o,u,C,M),k>0){var D=xt(S,M,a,o);e.arc(D.x,D.y,k,M,b+p.i)}var A=xt(T,b,a,o);if(e.lineTo(A.x,A.y),w>0){var R=xt(T,_,a,o);e.arc(R.x,R.y,w,b+p.i,_+Math.PI)}if(e.arc(a,o,f,b-w/f,g+x/f,!0),x>0){var L=xt(E,P,a,o);e.arc(L.x,L.y,x,P+Math.PI,g-p.i)}var N=xt(j,g,a,o);if(e.lineTo(N.x,N.y),O>0){var z=xt(j,C,a,o);e.arc(z.x,z.y,O,g-p.i,C)}e.closePath()}function jt(e,t,n,r,i){var a=t.options,o="inner"===a.borderAlign;a.borderWidth&&(o?(e.lineWidth=2*a.borderWidth,e.lineJoin="round"):(e.lineWidth=a.borderWidth,e.lineJoin="bevel"),t.fullCircles&&function(e,t,n){var r,i=t.x,a=t.y,o=t.startAngle,s=t.pixelMargin,l=t.fullCircles,c=Math.max(t.outerRadius-s,0),u=t.innerRadius+s;for(n&&Ot(e,t,o+p.u),e.beginPath(),e.arc(i,a,u,o+p.u,o,!0),r=0;r=p.u||Object(p.Ib)(a,l,c))&&(o>=u+h&&o<=f+h)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),n=t.x,r=t.y,i=t.startAngle,a=t.endAngle,o=t.innerRadius,s=t.outerRadius,l=this.options,c=l.offset,u=(i+a)/2,f=(o+s+l.spacing+c)/2;return{x:n+Math.cos(u)*f,y:r+Math.sin(u)*f}}},{key:"tooltipPosition",value:function(e){return this.getCenterPoint(e)}},{key:"draw",value:function(e){var t=this,n=t.options,r=t.circumference,i=(n.offset||0)/2,a=(n.spacing||0)/2;if(t.pixelMargin="inner"===n.borderAlign?.33:0,t.fullCircles=r>p.u?Math.floor(r/p.u):0,!(0===r||t.innerRadius<0||t.outerRadius<0)){e.save();var o=0;if(i){o=i/2;var s=(t.startAngle+t.endAngle)/2;e.translate(Math.cos(s)*o,Math.sin(s)*o),t.circumference>=p.q&&(o=i)}e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor;var l=function(e,t,n,r){var i=t.fullCircles,a=t.startAngle,o=t.circumference,s=t.endAngle;if(i){wt(e,t,n,r,a+p.u);for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:t;e.lineCap=Object(p.Pb)(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Object(p.Pb)(n.borderDash,t.borderDash)),e.lineDashOffset=Object(p.Pb)(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Object(p.Pb)(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Object(p.Pb)(n.borderWidth,t.borderWidth),e.strokeStyle=Object(p.Pb)(n.borderColor,t.borderColor)}function Mt(e,t,n){e.lineTo(n.x,n.y)}function Et(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.length,i=n.start,a=void 0===i?0:i,o=n.end,s=void 0===o?r-1:o,l=t.start,c=t.end,u=Math.max(a,l),f=Math.min(s,c),d=ac&&s>c;return{count:r,start:u,loop:t.loop,ilen:fl&&(l=j),y=(O*y+w)/++O):(x(),e.lineTo(w,j),o=S,O=0,s=l=j),c=j}x()}function _t(e){var t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&"monotone"!==t.cubicInterpolationMode&&!t.stepped&&!n?Pt:Tt}St.id="arc",St.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},St.defaultRoutes={backgroundColor:"backgroundColor"};var Dt="function"===typeof Path2D;function At(e,t,n,r){Dt&&1===t.segments.length?function(e,t,n,r){var i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ct(e,t.options),e.stroke(i)}(e,t,n,r):function(e,t,n,r){var i,a=t.segments,o=t.options,s=_t(t),l=Object(u.a)(a);try{for(l.s();!(i=l.n()).done;){var c=i.value;Ct(e,o,c.style),e.beginPath(),s(e,t,c,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}}catch(f){l.e(f)}finally{l.f()}}(e,t,n,r)}var Rt=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(d.a)(this,n),(i=t.call(this)).animated=!0,i.options=void 0,i._loop=void 0,i._fullLoop=void 0,i._path=void 0,i._points=void 0,i._segments=void 0,i._decimated=!1,i._pointsUpdated=!1,i._datasetIndex=void 0,e&&Object.assign(Object(r.a)(i),e),i}return Object(h.a)(n,[{key:"updateControlPoints",value:function(e,t){var n=this,r=n.options;if((r.tension||"monotone"===r.cubicInterpolationMode)&&!r.stepped&&!n._pointsUpdated){var i=r.spanGaps?n._loop:n._fullLoop;Object(p.bb)(n._points,r,e,i,t),n._pointsUpdated=!0}}},{key:"first",value:function(){var e=this.segments,t=this.points;return e.length&&t[e[0].start]}},{key:"last",value:function(){var e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}},{key:"interpolate",value:function(e,t){var n=this,r=n.options,i=e[t],a=n.points,o=Object(p.db)(n,{property:t,start:i,end:i});if(o.length){var s,l,c=[],u=function(e){return e.stepped?p.eb:e.tension||"monotone"===e.cubicInterpolationMode?p.fb:p.gb}(r);for(s=0,l=o.length;s=o.left&&t<=o.right)&&(a||n>=o.top&&n<=o.bottom)}function Bt(e,t){e.rect(t.x,t.y,t.w,t.h)}function Qt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,a=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}Nt.id="point",Nt.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Nt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Wt=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(d.a)(this,n),(i=t.call(this)).options=void 0,i.horizontal=void 0,i.base=void 0,i.width=void 0,i.height=void 0,e&&Object.assign(Object(r.a)(i),e),i}return Object(h.a)(n,[{key:"draw",value:function(e){var t,n=this.options,r=Ft(this),i=r.inner,a=r.outer,o=(t=a.radius).topLeft||t.topRight||t.bottomLeft||t.bottomRight?p.kb:Bt,s=.33;e.save(),a.w===i.w&&a.h===i.h||(e.beginPath(),o(e,Qt(a,s,i)),e.clip(),o(e,Qt(i,-.33,a)),e.fillStyle=n.borderColor,e.fill("evenodd")),e.beginPath(),o(e,Qt(i,s,a)),e.fillStyle=n.backgroundColor,e.fill(),e.restore()}},{key:"inRange",value:function(e,t,n){return $t(this,e,t,n)}},{key:"inXRange",value:function(e,t){return $t(this,e,null,t)}},{key:"inYRange",value:function(e,t){return $t(this,null,e,t)}},{key:"getCenterPoint",value:function(e){var t=this.getProps(["x","y","base","horizontal"],e),n=t.x,r=t.y,i=t.base,a=t.horizontal;return{x:a?(n+i)/2:n,y:a?r:(r+i)/2}}},{key:"getRange",value:function(e){return"x"===e?this.width/2:this.height/2}}]),n}(Le);Wt.id="bar",Wt.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Wt.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};new WeakMap;var Ht={average:function(e){if(!e.length)return!1;var t,n,r=0,i=0,a=0;for(t=0,n=e.length;t-1?e.split("\n"):e}function qt(e,t){var n=t.element,r=t.datasetIndex,i=t.index,a=e.getDatasetMeta(r).controller,o=a.getLabelAndValue(i),s=o.label,l=o.value;return{chart:e,label:s,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:l,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Yt(e,t){var n=e._chart.ctx,r=e.body,i=e.footer,a=e.title,o=t.boxWidth,s=t.boxHeight,l=Object(p.y)(t.bodyFont),c=Object(p.y)(t.titleFont),u=Object(p.y)(t.footerFont),f=a.length,d=i.length,h=r.length,v=Object(p.b)(t.padding),m=v.height,g=0,b=r.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);(b+=e.beforeBody.length+e.afterBody.length,f&&(m+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),b)&&(m+=h*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(b-h)*l.lineHeight+(b-1)*t.bodySpacing);d&&(m+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);var y=0,O=function(e){g=Math.max(g,n.measureText(e).width+y)};return n.save(),n.font=c.string,Object(p.c)(e.title,O),n.font=l.string,Object(p.c)(e.beforeBody.concat(e.afterBody),O),y=t.displayColors?o+2:0,Object(p.c)(r,(function(e){Object(p.c)(e.before,O),Object(p.c)(e.lines,O),Object(p.c)(e.after,O)})),y=0,n.font=u.string,Object(p.c)(e.footer,O),n.restore(),{width:g+=v.width,height:m}}function Xt(e,t,n,r){var i=n.x,a=n.width,o=e.width,s=e.chartArea,l=s.left,c=s.right,u="center";return"center"===r?u=i<=(l+c)/2?"left":"right":i<=a/2?u="left":i>=o-a/2&&(u="right"),function(e,t,n,r){var i=r.x,a=r.width,o=n.caretSize+n.caretPadding;return"left"===e&&i+a+o>t.width||"right"===e&&i-a-o<0||void 0}(u,e,t,n)&&(u="center"),u}function Kt(e,t,n){var r=t.yAlign||function(e,t){var n=t.y,r=t.height;return ne.height-r/2?"bottom":"center"}(e,n);return{xAlign:t.xAlign||Xt(e,t,n,r),yAlign:r}}function Gt(e,t,n,r){var i=e.caretSize,a=e.caretPadding,o=e.cornerRadius,s=n.xAlign,l=n.yAlign,c=i+a,u=o+a,f=function(e,t){var n=e.x,r=e.width;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,s),d=function(e,t,n){var r=e.y,i=e.height;return"top"===t?r+=n:r-="bottom"===t?i+n:i/2,r}(t,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=u:"right"===s&&(f+=u),{x:Object(p.Kb)(f,0,r.width-t.width),y:Object(p.Kb)(d,0,r.height-t.height)}}function Zt(e,t,n){var r=Object(p.b)(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function Jt(e){return Vt([],Ut(e))}function en(e,t){var n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var tn=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(d.a)(this,n),(r=t.call(this)).opacity=0,r._active=[],r._chart=e._chart,r._eventPosition=void 0,r._size=void 0,r._cachedAnimations=void 0,r._tooltipItems=[],r.$animations=void 0,r.$context=void 0,r.options=e.options,r.dataPoints=void 0,r.title=void 0,r.beforeBody=void 0,r.body=void 0,r.afterBody=void 0,r.footer=void 0,r.xAlign=void 0,r.yAlign=void 0,r.x=void 0,r.y=void 0,r.height=void 0,r.width=void 0,r.caretX=void 0,r.caretY=void 0,r.labelColors=void 0,r.labelPointStyles=void 0,r.labelTextColors=void 0,r}return Object(h.a)(n,[{key:"initialize",value:function(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var e=this,t=e._cachedAnimations;if(t)return t;var n=e._chart,r=e.options.setContext(e.getContext()),i=r.enabled&&n.options.animation&&r.animations,a=new O(e._chart,i);return i._cacheable&&(e._cachedAnimations=Object.freeze(a)),a}},{key:"getContext",value:function(){var e,t,n,r=this;return r.$context||(r.$context=(e=r._chart.getContext(),t=r,n=r._tooltipItems,Object.assign(Object.create(e),{tooltip:t,tooltipItems:n,type:"tooltip"})))}},{key:"getTitle",value:function(e,t){var n=this,r=t.callbacks,i=r.beforeTitle.apply(n,[e]),a=r.title.apply(n,[e]),o=r.afterTitle.apply(n,[e]),s=[];return s=Vt(s,Ut(i)),s=Vt(s,Ut(a)),s=Vt(s,Ut(o))}},{key:"getBeforeBody",value:function(e,t){return Jt(t.callbacks.beforeBody.apply(this,[e]))}},{key:"getBody",value:function(e,t){var n=this,r=t.callbacks,i=[];return Object(p.c)(e,(function(e){var t={before:[],lines:[],after:[]},a=en(r,e);Vt(t.before,Ut(a.beforeLabel.call(n,e))),Vt(t.lines,a.label.call(n,e)),Vt(t.after,Ut(a.afterLabel.call(n,e))),i.push(t)})),i}},{key:"getAfterBody",value:function(e,t){return Jt(t.callbacks.afterBody.apply(this,[e]))}},{key:"getFooter",value:function(e,t){var n=this,r=t.callbacks,i=r.beforeFooter.apply(n,[e]),a=r.footer.apply(n,[e]),o=r.afterFooter.apply(n,[e]),s=[];return s=Vt(s,Ut(i)),s=Vt(s,Ut(a)),s=Vt(s,Ut(o))}},{key:"_createItems",value:function(e){var t,n,r=this,i=r._active,a=r._chart.data,o=[],s=[],l=[],c=[];for(t=0,n=i.length;t0&&t.stroke()}},{key:"_updateAnimationTarget",value:function(e){var t=this,n=t._chart,r=t.$animations,i=r&&r.x,a=r&&r.y;if(i||a){var o=Ht[e.position].call(t,t._active,t._eventPosition);if(!o)return;var s=t._size=Yt(t,e),l=Object.assign({},o,t._size),c=Kt(n,e,l),u=Gt(e,l,c,n);i._to===u.x&&a._to===u.y||(t.xAlign=c.xAlign,t.yAlign=c.yAlign,t.width=s.width,t.height=s.height,t.caretX=o.x,t.caretY=o.y,t._resolveAnimations().update(t,u))}}},{key:"draw",value:function(e){var t=this,n=t.options.setContext(t.getContext()),r=t.opacity;if(r){t._updateAnimationTarget(n);var i={width:t.width,height:t.height},a={x:t.x,y:t.y};r=Math.abs(r)<.001?0:r;var o=Object(p.b)(n.padding),s=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;n.enabled&&s&&(e.save(),e.globalAlpha=r,t.drawBackground(a,e,i,n),Object(p.qb)(e,n.textDirection),a.y+=o.top,t.drawTitle(a,e,n),t.drawBody(a,e,n),t.drawFooter(a,e,n),Object(p.sb)(e,n.textDirection),e.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(e,t){var n=this,r=n._active,i=e.map((function(e){var t=e.datasetIndex,r=e.index,i=n._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[r],index:r}})),a=!Object(p.Y)(r,i),o=n._positionChanged(i,t);(a||o)&&(n._active=i,n._eventPosition=t,n.update(!0))}},{key:"handleEvent",value:function(e,t){var n,r=this,i=r.options,a=r._active||[],o=[];"mouseout"!==e.type&&(o=r._chart.getElementsAtEventForMode(e,i.mode,i,t),i.reverse&&o.reverse());var s=r._positionChanged(o,e);return(n=t||!Object(p.Y)(o,a)||s)&&(r._active=o,(i.enabled||i.external)&&(r._eventPosition={x:e.x,y:e.y},r.update(!0,t))),n}},{key:"_positionChanged",value:function(e,t){var n=this.caretX,r=this.caretY,i=this.options,a=Ht[i.position].call(this,e,t);return!1!==a&&(n!==a.x||r!==a.y)}}]),n}(Le);tn.positioners=Ht;p.tb,p.tb,p.tb,p.tb,p.tb,p.tb,p.tb,p.tb,p.tb;function nn(e,t,n){var r=e.indexOf(t);return-1===r?function(e,t,n){return"string"===typeof t?e.push(t)-1:isNaN(t)?null:n}(e,t,n):r!==e.lastIndexOf(t)?n:r}var rn=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(d.a)(this,n),(r=t.call(this,e))._startValue=void 0,r._valueRange=0,r}return Object(h.a)(n,[{key:"parse",value:function(e,t){if(Object(p.Db)(e))return null;var n=this.getLabels();return function(e,t){return null===e?null:Object(p.Kb)(Math.round(e),0,t)}(t=isFinite(t)&&n[t]===e?t:nn(n,e,Object(p.Pb)(t,e)),n.length-1)}},{key:"determineDataLimits",value:function(){var e=this,t=e.getUserBounds(),n=t.minDefined,r=t.maxDefined,i=e.getMinMax(!0),a=i.min,o=i.max;"ticks"===e.options.bounds&&(n||(a=0),r||(o=e.getLabels().length-1)),e.min=a,e.max=o}},{key:"buildTicks",value:function(){var e=this,t=e.min,n=e.max,r=e.options.offset,i=[],a=e.getLabels();a=0===t&&n===a.length-1?a:a.slice(t,n+1),e._valueRange=Math.max(a.length-(r?0:1),1),e._startValue=e.min-(r?.5:0);for(var o=t;o<=n;o++)i.push({value:o});return i}},{key:"getLabelForValue",value:function(e){var t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}},{key:"getValueForPixel",value:function(e){var t=this;return Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),n}(Ue);function an(e,t,n){var r=n.horizontal,i=n.minRotation,a=Object(p.Nb)(i),o=(r?Math.sin(a):Math.cos(a))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}rn.id="category",rn.defaults={ticks:{callback:rn.prototype.getLabelForValue}};var on=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(d.a)(this,n),(r=t.call(this,e)).start=void 0,r.end=void 0,r._startValue=void 0,r._endValue=void 0,r._valueRange=0,r}return Object(h.a)(n,[{key:"parse",value:function(e,t){return Object(p.Db)(e)||("number"===typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}},{key:"handleTickRangeOptions",value:function(){var e=this,t=e.options.beginAtZero,n=e.getUserBounds(),r=n.minDefined,i=n.maxDefined,a=e.min,o=e.max,s=function(e){return a=r?a:e},l=function(e){return o=i?o:e};if(t){var c=Object(p.Mb)(a),u=Object(p.Mb)(o);c<0&&u<0?l(0):c>0&&u>0&&s(0)}if(a===o){var f=1;(o>=Number.MAX_SAFE_INTEGER||a<=Number.MIN_SAFE_INTEGER)&&(f=Math.abs(.05*o)),l(o+f),t||s(a-f)}e.min=a,e.max=o}},{key:"getTickLimit",value:function(){var e,t=this,n=t.options.ticks,r=n.maxTicksLimit,i=n.stepSize;return i?e=Math.ceil(t.max/i)-Math.floor(t.min/i)+1:(e=t.computeTickLimit(),r=r||11),r&&(e=Math.min(r,e)),e}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=t.ticks,r=e.getTickLimit(),i=function(e,t){var n,r,i,a,o=[],s=e.bounds,l=e.step,c=e.min,u=e.max,f=e.precision,d=e.count,h=e.maxTicks,v=e.maxDigits,m=e.includeBounds,g=l||1,b=h-1,y=t.min,O=t.max,k=!Object(p.Db)(c),x=!Object(p.Db)(u),w=!Object(p.Db)(d),j=(O-y)/(v+1),S=Object(p.O)((O-y)/b/g)*g;if(S<1e-14&&!k&&!x)return[{value:y},{value:O}];(a=Math.ceil(O/S)-Math.floor(y/S))>b&&(S=Object(p.O)(a*S/b/g)*g),Object(p.Db)(f)||(n=Math.pow(10,f),S=Math.ceil(S*n)/n),"ticks"===s?(r=Math.floor(y/S)*S,i=Math.ceil(O/S)*S):(r=y,i=O),k&&x&&l&&Object(p.P)((u-c)/l,S/1e3)?(S=(u-c)/(a=Math.round(Math.min((u-c)/S,h))),r=c,i=u):w?S=((i=x?u:i)-(r=k?c:r))/(a=d-1):(a=(i-r)/S,a=Object(p.Q)(a,Math.round(a),S/1e3)?Math.round(a):Math.ceil(a));var C=Math.max(Object(p.R)(S),Object(p.R)(r));n=Math.pow(10,Object(p.Db)(f)?C:f),r=Math.round(r*n)/n,i=Math.round(i*n)/n;var M=0;for(k&&(m&&r!==c?(o.push({value:c}),r0?n:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var e=this,t=e.getMinMax(!0),n=t.min,r=t.max;e.min=Object(p.Ab)(n)?Math.max(0,n):null,e.max=Object(p.Ab)(r)?Math.max(0,r):null,e.options.beginAtZero&&(e._zero=!0),e.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var e=this,t=e.getUserBounds(),n=t.minDefined,r=t.maxDefined,i=e.min,a=e.max,o=function(e){return i=n?i:e},s=function(e){return a=r?a:e},l=function(e,t){return Math.pow(10,Math.floor(Object(p.k)(e))+t)};i===a&&(i<=0?(o(1),s(10)):(o(l(i,-1)),s(l(a,1)))),i<=0&&o(l(a,-1)),a<=0&&s(l(i,1)),e._zero&&e.min!==e._suggestedMin&&i===l(e.min,0)&&o(l(i,-1)),e.min=i,e.max=a}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=function(e,t){var n=Math.floor(Object(p.k)(t.max)),r=Math.ceil(t.max/Math.pow(10,n)),i=[],a=Object(p.m)(e.min,Math.pow(10,Math.floor(Object(p.k)(t.min)))),o=Math.floor(Object(p.k)(a)),s=Math.floor(a/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{i.push({value:a,major:ln(a)}),10===++s&&(s=1,l=++o>=0?1:l),a=Math.round(s*Math.pow(10,o)*l)/l}while(oi?{start:t-n,end:t}:{start:t,end:t+n}}function dn(e){for(var t,n,r,i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={},o=[],s=[],l=e.getLabels().length,c=0;ci.r&&(i.r=g.end,a.r=v),b.starti.b&&(i.b=b.end,a.b=v)}e._setReductions(e.drawingArea,i,a),e._pointLabelItems=function(e,t,n){for(var r=[],i=e.getLabels().length,a=e.options,o=un(a),s=e.getDistanceFromCenterForValue(a.ticks.reverse?e.min:e.max),l=0;l270||n<90)&&(e-=t),e}function mn(e,t,n,r){var i=e.ctx;if(n)i.arc(e.xCenter,e.yCenter,t,0,p.u);else{var a=e.getPointPosition(0,t);i.moveTo(a.x,a.y);for(var o=1;o=0&&e=0;i--){var a=r.setContext(e.getPointLabelContext(i)),o=Object(p.y)(a.font),s=e._pointLabelItems[i],l=s.x,c=s.y,u=s.textAlign,f=s.left,d=s.top,h=s.right,v=s.bottom,m=a.backdropColor;if(!Object(p.Db)(m)){var g=Object(p.b)(a.backdropPadding);n.fillStyle=m,n.fillRect(f-g.left,d-g.top,h-f+g.width,v-d+g.height)}Object(p.w)(n,e._pointLabels[i],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}(r,l),s.display&&r.ticks.forEach((function(e,n){if(0!==n){t=r.getDistanceFromCenterForValue(e.value);var i=s.setContext(r.getContext(n-1));!function(e,t,n,r){var i=e.ctx,a=t.circular,o=t.color,s=t.lineWidth;!a&&!r||!o||!s||n<0||(i.save(),i.strokeStyle=o,i.lineWidth=s,i.setLineDash(t.borderDash),i.lineDashOffset=t.borderDashOffset,i.beginPath(),mn(e,n,a,r),i.closePath(),i.stroke(),i.restore())}(r,i,t,l)}})),o.display){for(i.save(),e=r.getLabels().length-1;e>=0;e--){var c=o.setContext(r.getPointLabelContext(e)),u=c.color,f=c.lineWidth;f&&u&&(i.lineWidth=f,i.strokeStyle=u,i.setLineDash(c.borderDash),i.lineDashOffset=c.borderDashOffset,t=r.getDistanceFromCenterForValue(a.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),i.beginPath(),i.moveTo(r.xCenter,r.yCenter),i.lineTo(n.x,n.y),i.stroke())}i.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var e=this,t=e.ctx,n=e.options,r=n.ticks;if(r.display){var i,a,o=e.getIndexAngle(0);t.save(),t.translate(e.xCenter,e.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",e.ticks.forEach((function(o,s){if(0!==s||n.reverse){var l=r.setContext(e.getContext(s)),c=Object(p.y)(l.font);if(i=e.getDistanceFromCenterForValue(e.ticks[s].value),l.showLabelBackdrop){t.font=c.string,a=t.measureText(o.label).width,t.fillStyle=l.backdropColor;var u=Object(p.b)(l.backdropPadding);t.fillRect(-a/2-u.left,-i-c.size/2-u.top,a+u.width,c.size+u.height)}Object(p.w)(t,o.label,0,-i,c,{color:l.color})}})),t.restore()}}},{key:"drawTitle",value:function(){}}]),n}(on);bn.id="radialLinear",bn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ze.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(e){return e},padding:5}},bn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},bn.descriptors={angleLines:{_fallback:"grid"}};var yn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},On=Object.keys(yn);function kn(e,t){return e-t}function xn(e,t){if(Object(p.Db)(t))return null;var n=e._adapter,r=e._parseOpts,i=r.parser,a=r.round,o=r.isoWeekday,s=t;return"function"===typeof i&&(s=i(s)),Object(p.Ab)(s)||(s="string"===typeof i?n.parse(s,i):n.parse(s)),null===s?null:(a&&(s="week"!==a||!Object(p.Jb)(o)&&!0!==o?n.startOf(s,a):n.startOf(s,"isoWeek",o)),+s)}function wn(e,t,n,r){for(var i=On.length,a=On.indexOf(e);a=t?n[i]:n[a]]=!0}}else e[t]=!0}function Sn(e,t,n){var r,i,a=[],o={},s=t.length;for(r=0;r=0&&(t[a].major=!0);return t}(e,a,o,n):a}var Cn=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(d.a)(this,n),(r=t.call(this,e))._cache={data:[],labels:[],all:[]},r._unit="day",r._majorUnit=void 0,r._offsets={},r._normalized=!1,r._parseOpts=void 0,r}return Object(h.a)(n,[{key:"init",value:function(e,t){var r=e.time||(e.time={}),o=this._adapter=new K._date(e.adapters.date);Object(p.K)(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},Object(i.a)(Object(a.a)(n.prototype),"init",this).call(this,e),this._normalized=t.normalized}},{key:"parse",value:function(e,t){return void 0===e?null:xn(this,e)}},{key:"beforeLayout",value:function(){Object(i.a)(Object(a.a)(n.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var e=this,t=e.options,n=e._adapter,r=t.time.unit||"day",i=e.getUserBounds(),a=i.min,o=i.max,s=i.minDefined,l=i.maxDefined;function c(e){s||isNaN(e.min)||(a=Math.min(a,e.min)),l||isNaN(e.max)||(o=Math.max(o,e.max))}s&&l||(c(e._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||c(e.getMinMax(!1))),a=Object(p.Ab)(a)&&!isNaN(a)?a:+n.startOf(Date.now(),r),o=Object(p.Ab)(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,e.min=Math.min(a,o-1),e.max=Math.max(a+1,o)}},{key:"_getLabelBounds",value:function(){var e=this.getLabelTimestamps(),t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}},{key:"buildTicks",value:function(){var e=this,t=e.options,n=t.time,r=t.ticks,i="labels"===r.source?e.getLabelTimestamps():e._generate();"ticks"===t.bounds&&i.length&&(e.min=e._userMin||i[0],e.max=e._userMax||i[i.length-1]);var a=e.min,o=e.max,s=Object(p.T)(i,a,o);return e._unit=n.unit||(r.autoSkip?wn(n.minUnit,e.min,e.max,e._getLabelCapacity(a)):function(e,t,n,r,i){for(var a=On.length-1;a>=On.indexOf(n);a--){var o=On[a];if(yn[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return On[n?On.indexOf(n):0]}(e,s.length,n.minUnit,e.min,e.max)),e._majorUnit=r.major.enabled&&"year"!==e._unit?function(e){for(var t=On.indexOf(e)+1,n=On.length;t1e5*c)throw new Error(i+" and "+a+" are too far apart with stepSize of "+c+" "+l);var v="data"===o.ticks.source&&n.getDataTimestamps();for(e=h,t=0;e0?s:1}},{key:"getDataTimestamps",value:function(){var e,t,n=this,r=n._cache.data||[];if(r.length)return r;var i=n.getMatchingVisibleMetas();if(n._normalized&&i.length)return n._cache.data=i[0].controller.getAllParsedValues(n);for(e=0,t=i.length;e=e[s].pos&&t<=e[l].pos){var c=Object(p.Qb)(e,"pos",t);s=c.lo,l=c.hi}var u=e[s];r=u.pos,a=u.time;var f=e[l];i=f.pos,o=f.time}else{if(t>=e[s].time&&t<=e[l].time){var d=Object(p.Qb)(e,"time",t);s=d.lo,l=d.hi}var h=e[s];r=h.time,a=h.pos;var v=e[l];i=v.time,o=v.pos}var m=i-r;return m?a+(o-a)*(t-r)/m:a}Cn.id="time",Cn.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var En=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(d.a)(this,n),(r=t.call(this,e))._table=[],r._minPos=void 0,r._tableRange=void 0,r}return Object(h.a)(n,[{key:"initOffsets",value:function(){var e=this,t=e._getTimestampsForTable(),r=e._table=e.buildLookupTable(t);e._minPos=Mn(r,e.min),e._tableRange=Mn(r,e.max)-e._minPos,Object(i.a)(Object(a.a)(n.prototype),"initOffsets",this).call(this,t)}},{key:"buildLookupTable",value:function(e){var t,n,r,i,a,o=this.min,s=this.max,l=[],c=[];for(t=0,n=e.length;t=o&&i<=s&&l.push(i);if(l.length<2)return[{time:o,pos:0},{time:s,pos:1}];for(t=0,n=l.length;t2||/[^\s,.;:]/.test(e.sliceDoc(t.start,t.end)))||t.firstChild}function b(e,t,n){for(var r=e.tree.resolve(t.head),a=n?l.c.closedBy:l.c.openedBy,o=t.head;;){var c=n?r.childAfter(o):r.childBefore(o);if(!c)break;g(e,c,a)?r=c:o=n?c.end:c.start}var u,f;return f=r.type.prop(a)&&(u=n?Object(s.b)(e,r.start,1):Object(s.b)(e,r.end,-1))&&u.matched?n?u.end.to:u.end.from:n?r.end:r.start,i.d.cursor(f,n?-1:1)}function y(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t):d(n,t)}))}var O=function(e){return y(e,!1)},k=function(e){return y(e,!0)};function x(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):d(n,t)}))}var w=function(e){return x(e,!1)},j=function(e){return x(e,!0)};function S(e,t,n){var r=e.visualLineAt(t.head),a=e.moveToLineBoundary(t,n);if(a.head==t.head&&a.head!=(n?r.to:r.from)&&(a=e.moveToLineBoundary(t,n,!1)),!n&&a.head==r.from&&r.length){var o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head>r.from+o&&(a=i.d.cursor(r.from+o))}return a}var C=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).from,1)}))},M=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).to,-1)}))};function E(e,t,n){var r=!1,a=c(e.selection,(function(t){var a=Object(s.b)(e,t.head,-1)||Object(s.b)(e,t.head,1)||t.head>0&&Object(s.b)(e,t.head-1,1)||t.headl.from&&r-1)return o}}catch(s){a.e(s)}finally{a.f()}return-1}function ne(e,t){var n=-1;return e.changeByRange((function(r){for(var a=[],o=e.doc.lineAt(r.from);o.number>n&&(t(o,a,r),n=o.number),!(r.to<=o.to);)o=e.doc.lineAt(o.to+1);var s=e.changes(a);return{changes:a,range:i.d.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}}))}var re=[{key:"ArrowLeft",run:p,shift:_},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function(e){return m(e,e.textDirection!=o.c.LTR)},shift:function(e){return A(e,e.textDirection!=o.c.LTR)}},{mac:"Cmd-ArrowLeft",run:C,shift:$},{key:"ArrowRight",run:v,shift:D},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function(e){return m(e,e.textDirection==o.c.LTR)},shift:function(e){return A(e,e.textDirection==o.c.LTR)}},{mac:"Cmd-ArrowRight",run:M,shift:B},{key:"ArrowUp",run:O,shift:L},{mac:"Cmd-ArrowUp",run:Q,shift:H},{mac:"Ctrl-ArrowUp",run:w,shift:I},{key:"ArrowDown",run:k,shift:N},{mac:"Cmd-ArrowDown",run:W,shift:V},{mac:"Ctrl-ArrowDown",run:j,shift:F},{key:"PageUp",run:w,shift:I},{key:"PageDown",run:j,shift:F},{key:"Home",run:function(e){return f(e,(function(t){return S(e,t,!1)}))},shift:function(e){return T(e,(function(t){return S(e,t,!1)}))}},{key:"Mod-Home",run:Q,shift:H},{key:"End",run:function(e){return f(e,(function(t){return S(e,t,!0)}))},shift:function(e){return T(e,(function(t){return S(e,t,!0)}))}},{key:"Mod-End",run:W,shift:V},{key:"Enter",run:function(e){var t=e.state,n=e.dispatch,r=t.changeByRange((function(e){var n=e.from,r=e.to,o=n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=e.tree.resolve(t),i=r.childBefore(t),a=r.childAfter(t);return i&&a&&i.end<=t&&a.start>=t&&(n=i.type.prop(l.c.closedBy))&&n.indexOf(a.name)>-1?{from:i.end,to:a.start}:null}(t,n),s=new i.g(t,{simulateBreak:n,simulateDoubleBreak:!!o}),c=te(s,n);c<0&&(c=/^\s*/.exec(t.doc.lineAt(n).slice(0,50))[0].length);for(var u=t.doc.lineAt(n);ru.from&&n",run:W},{key:"Ctrl-v",run:j},{key:"Alt-v",run:w}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))),ie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection!=o.c.LTR)}))},shift:function(e){return T(e,(function(t){return b(e.state,t,e.textDirection!=o.c.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection==o.c.LTR)}))},shift:function(e){return T(e,(function(t){return b(e.state,t,e.textDirection==o.c.LTR)}))}},{key:"Alt-ArrowUp",run:function(e){return J(e.state,e.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(e){return ee(e.state,e.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(e){return J(e.state,e.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(e){return ee(e.state,e.dispatch,!0)}},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch,r=t.selection,a=null;return r.ranges.length>1?a=new i.d([r.primary]):r.primary.empty||(a=new i.d([i.d.cursor(r.primary.head)])),!!a&&(n(u(t,a)),!0)}},{key:"Mod-l",run:function(e){var t=e.state,n=e.dispatch,r=Z(t).map((function(e){var n=e.from,r=e.to;return i.d.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:new i.d(r),annotations:i.l.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=c(t.selection,(function(e){for(var n,r=t.tree.resolve(e.head,1);!(r.start=e.to||r.end>e.to&&r.start<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return i.d.range(r.end,r.start)}));return n(u(t,r)),!0}},{key:"Mod-[",run:function(e){var t=e.state;return(0,e.dispatch)(t.update(ne(t,(function(e,n){var r=e.slice(0,Math.min(e.length,200)),i=/^\s*/.exec(r)[0];if(i){for(var o=Object(a.d)(i,0,t.tabSize),s=t.indentString(Math.max(0,o-t.indentUnit)),l=0;l0?n--:r30||this.typeNames.length>Math.pow(2,30-this.flags.length))throw new RangeError("Too many style tag flags to fit in a 30-bit integer")}return Object(a.a)(e,[{key:"get",value:function(e){var t,n=0,i=Object(r.a)(e.split(" "));try{for(i.s();!(t=i.n()).done;){var a=t.value;if(a){var o=this.flags.indexOf(a);if(o>-1)n+=1<>this.typeShift)throw new RangeError("Multiple tag types specified in '".concat(e,"'"));n+=s<1&&void 0!==arguments[1]?arguments[1]:{},n=this.getWithMode(e),r=n.mode,i=n.tag;return this.prop.set(t,new h(i,r,d))}},{key:"add",value:function(e){var t=Object.create(null);for(var n in e){var i,a=e[n],o=this.getWithMode(a),s=o.mode,l=o.tag,c=Object(r.a)(n.split(" "));try{for(c.s();!(i=c.n()).done;){var u=i.value.split("/"),f=u[u.length-1],p=u.length>1?u.slice(0,u.length-1).map((function(e){return"*"==e?null:e})):d,v=new h(l,s,p);t[f]=v.sort(t[f])}}catch(m){c.e(m)}finally{c.f()}}return this.prop.add(t)}},{key:"highlighter",value:function(e){var t=this,n=new m(this,e);return[Object(c.o)(l.f.define((function(e){return new g(e,t.prop,n)}),{decorations:function(e){return e.decorations}}),"fallback"),l.d.styleModule.of(n.module)]}},{key:"specificity",value:function(e){for(var t=e&this.flagMask,n=0,r=1;r<=this.flags.length;r++)t&1<>this.typeShift;i;i=this.parents[i])n+=/#/.test(this.typeNames[i])?500:1e3;return n}}]),e}())({flags:["invalid","meta","standard","definition","constant","local","control","link","strong","emphasis","monospace","changed","inserted","deleted"],subtypes:7,types:["comment","lineComment=comment","blockComment=comment","docComment=comment","name","variableName=name","typeName=name","propertyName=name","className=name","labelName=name","functionName=name","namespace=name","literal","string=literal","docString=string","character=string","number=literal","integer=number","float=number","bool=literal","regexp=literal","escape=literal","color=literal","content","heading=content","list=content","quote=content","keyword","self=keyword","null=keyword","atom=keyword","unit=keyword","modifier=keyword","operatorKeyword=keyword","operator","derefOperator=operator","arithmeticOperator=operator","logicOperator=operator","bitwiseOperator=operator","compareOperator=operator","updateOperator=operator","typeOperator=operator","punctuation","separator=punctuation","bracket=punctuation","angleBracket=bracket","squareBracket=bracket","paren=bracket","brace=bracket"]}),d=[],h=function(){function e(t,n,r,a){Object(i.a)(this,e),this.tag=t,this.mode=n,this.context=r,this.next=a}return Object(a.a)(e,[{key:"sort",value:function(e){return!e||e.context.length>t.typeShift,h&t.flagMask,t.specificity(h),c))}}catch(p){f.e(p)}finally{f.f()}}this.rules=o.sort((function(e,t){return t.specificity-e.specificity})),this.module=new s.a(a)}return Object(a.a)(e,[{key:"match",value:function(e){var t=this.cache[e];if(null!=t)return t;for(var n="",i=e>>this.tags.typeShift,a=e&this.tags.flagMask;;){var o,s=Object(r.a)(this.rules);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.type==i&&(l.flags&a)==l.flags&&(n&&(n+=" "),n+=l.cls,a&=~l.flags,i))break}}catch(c){s.e(c)}finally{s.f()}if(!i)break;i=this.tags.parents[i]}return this.cache[e]=n}}]),e}(),g=function(){function e(t,n,r){Object(i.a)(this,e),this.prop=n,this.styling=r,this.nodeStack=[""],this.classStack=[""],this.inheritStack=[""],this.tree=t.state.tree,this.decorations=this.buildDeco(t.visibleRanges,this.tree)}return Object(a.a)(e,[{key:"update",value:function(e){var t=e.state.facet(c.e.syntax);t.length?t[0].parsePos(e.state)n&&t&&s.add(n,e,l.b.mark({class:t})),n=e}var f,d=this.nodeStack,h=this.classStack,p=this.inheritStack,v=Object(r.a)(e);try{var m=function(){var e=f.value,r=e.from,s=e.to;i="",a=0,n=r,t.iterate({from:r,to:s,enter:function(e,t){a++;for(var n=p[a-1],r=n,s=e.prop(o.prop),l=!1;s;){if(!s.context.length||b(s.context,d,a)){var u=o.styling.match(s.tag);u&&(r&&(r+=" "),r+=u,1==s.mode?n=r:0==s.mode&&(l=!0));break}s=s.next}if(r!=i&&(c(t,i),i=r),l)return a--,!1;h[a]=r,p[a]=n,d[a]=e.name},leave:function(e,t,n){a--;var r=h[a];r!=i&&(c(Math.min(s,n),i),i=r)}})};for(v.s();!(f=v.n()).done;)m()}catch(g){v.e(g)}finally{v.f()}return s.finish()}}]),e}();function b(e,t,n){if(e.length>n-1)return!1;for(var r=n-1,i=e.length-1;i>=0;i--,r--){var a=e[i];if(a&&a!=t[r])return!1}return!0}var y,O=(y={deleted:{textDecoration:"line-through"},inserted:{textDecoration:"underline"},link:{textDecoration:"underline"},strong:{fontWeight:"bold"},emphasis:{fontStyle:"italic"},keyword:{color:"#708"},"atom, bool":{color:"#219"},number:{color:"#164"},string:{color:"#a11"},"regexp, escape, string#2":{color:"#e40"},"variableName definition":{color:"#00f"},typeName:{color:"#085"},className:{color:"#167"},"name#2":{color:"#256"},"propertyName definition":{color:"#00c"},comment:{color:"#940"},meta:{color:"#555"},invalid:{color:"#f00"}},f.highlighter(y))},function(e,t,n){"use strict";n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return S}));var r=n(16),i=n(15),a=n(6),o=n(7),s=n(4),l=n(10),c=n(5),u=n(84),f=n(35),d=function e(t,n,r){Object(s.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},h=function e(t,n,r){Object(s.a)(this,e),this.diagnostics=t,this.panel=n,this.selected=r};function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null;return e.between(n,e.length,(function(e,n,i){var a=i.spec;if(!t||a.diagnostic==t)return r=new d(e,n,a.diagnostic),!1})),r}function v(e){return e.field(y,!1)?void 0:{append:[y,l.d.decorations.compute([y],(function(e){var t=e.field(y),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?l.b.set([O.range(n.from,n.to)]):l.b.none})),Object(f.b)(),Object(u.a)(k),_]}}var m=c.i.define(),g=c.i.define(),b=c.i.define(),y=c.j.define({create:function(){return new h(l.b.none,null,null)},update:function(e,t){if(t.docChanged){var n=e.diagnostics.map(t.changes),r=null;if(e.selected){var i=t.changes.mapPos(e.selected.from,1);r=p(n,e.selected.diagnostic,i)||p(n,null,i)}e=new h(n,e.panel,r)}var a,s=Object(o.a)(t.effects);try{for(s.s();!(a=s.n()).done;){var c=a.value;if(c.is(m)){var u=l.b.set(c.value.map((function(e){return e.fromi&&(e.items.splice(i,u-i),a=!0)),r&&l.diagnostic==r.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),o=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),i++}));ir.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.items.length||this.list.removeAttribute("aria-activedescendant"),a&&this.sync()}},{key:"sync",value:function(){var e=this.list.firstChild;function t(){var t=e;e=t.nextSibling,t.remove()}var n,r=Object(o.a)(this.items);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e)}}catch(a){r.e(a)}finally{r.f()}for(;e;)t();this.list.firstChild||this.list.appendChild(C(this.view,{severity:"info",message:this.view.state.phrase("No diagnostics")}))}},{key:"moveSelection",value:function(e){if(0!=this.items.length){var t=p(this.view.state.field(y).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:b.of(t)})}}},{key:"selectedIndex",get:function(){var e=this.view.state.field(y).selected;if(!e)return-1;for(var t=0;t\n ');return"url('data:image/svg+xml;base64,".concat(btoa(t),"')")}var _=l.d.baseTheme({$diagnostic:{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block"},"$diagnostic.error":{borderLeft:"5px solid #d11"},"$diagnostic.warning":{borderLeft:"5px solid orange"},"$diagnostic.info":{borderLeft:"5px solid #999"},$diagnosticAction:{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},$lintRange:{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x"},"$lintRange.error":{backgroundImage:P("#d11")},"$lintRange.warning":{backgroundImage:P("orange")},"$lintRange.info":{backgroundImage:P("#999")},"$lintRange.active":{backgroundColor:"#ffdd9980"},$lintPoint:{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},"$lintPoint.warning":{"&:after":{borderBottomColor:"orange"}},"$lintPoint.info":{"&:after":{borderBottomColor:"#999"}},"$panel.lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd"},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"$tooltip.lint":{padding:0,margin:0}})},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return x}));var r=n(24);n.d(t,"a",(function(){return r.c}));var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var a,o=function(){function e(e,t,n,r,i,a,o,s,l){this.cx=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.parent=l}return e.prototype.toString=function(){return"["+this.stack.filter((function(e,t){return t%3==0})).concat(this.state)+"]@"+this.pos+(this.score?"!"+this.score:"")},e.start=function(t,n,r){return void 0===r&&(r=0),new e(t,[],n,r,r,0,[],0,null)},e.prototype.pushState=function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e},e.prototype.reduce=function(e){var t=e>>19,n=65535&e,r=this.cx.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return na;)this.stack.pop()},e.prototype.storeNode=function(e,t,n,r,i){if(void 0===r&&(r=4),void 0===i&&(i=!1),0==e){var a=this,o=this.buffer.length;if(0==o&&a.parent&&(o=a.bufferBase-a.parent.bufferBase,a=a.parent),o>0&&0==a.buffer[o-4]&&a.buffer[o-1]>-1){if(t==n)return;if(a.buffer[o-2]>=t)return void(a.buffer[o-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)},e.prototype.shift=function(e,t,n){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var r=this.pos,i=e,a=this.cx.parser;(n>this.pos||t<=a.maxNode)&&(this.pos=n,a.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),t<=a.maxNode&&this.buffer.push(t,r,n,4)}else t<=this.cx.parser.maxNode&&this.buffer.push(t,this.pos,n,4),this.pos=n},e.prototype.apply=function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)},e.prototype.useNode=function(e,t){var n=this.cx.reused.length-1;(n<0||this.cx.reused[n]!=e)&&(this.cx.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1)},e.prototype.split=function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.cx,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,t)},e.prototype.recoverByDelete=function(e,t){var n=e<=this.cx.parser.maxNode;n&&this.storeNode(e,this.pos,t),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=200},e.prototype.canShift=function(e){for(var t=new s(this);;){var n=this.cx.parser.stateSlot(t.top,4)||this.cx.parser.hasAction(t.top,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}},Object.defineProperty(e.prototype,"ruleStart",{get:function(){for(var e=this.state,t=this.stack.length;;){var n=this.cx.parser.stateSlot(e,5);if(!(65536&n))return 0;if(t-=3*(n>>19),(65535&n)>19,o=65535&i;if(e.indexOf(o)>-1){var s=n-3*(i>>19);return this.stack[s+1]}if(0==n)return-1;0==a?(n-=3,t=this.stack[n]):(n-=3*(a-1),t=r.getGoto(this.stack[n-3],o,!0))}},e.prototype.recoverByInsert=function(e){var t=this;if(this.stack.length>=300)return[];var n=this.cx.parser.nextStates(this.state);if(n.length>4||this.stack.length>=120){var r=n.filter((function(n){return n!=t.state&&t.cx.parser.hasAction(n,e)}));if(this.stack.length<120)for(var i=0;r.length<4&&i>19;0==n?(this.rest==this.stack.stack&&(this.rest=this.rest.slice()),this.rest.push(this.top,0,0),this.offset+=3):this.offset-=3*(n-1);var r=this.stack.cx.parser.getGoto(this.rest[this.offset-3],t,!0);this.top=r},e}(),l=function(){function e(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}return e.create=function(t){return new e(t,t.bufferBase+t.buffer.length,t.buffer.length)},e.prototype.maybeNext=function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)},Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer[this.index-4]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.buffer[this.index-3]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.buffer[this.index-2]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.buffer[this.index-1]},enumerable:!0,configurable:!0}),e.prototype.next=function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()},e.prototype.fork=function(){return new e(this.stack,this.pos,this.index)},e}(),c=function(){function e(){this.start=-1,this.value=-1,this.end=-1}return e.prototype.accept=function(e,t){this.value=e,this.end=t},e}(),u=function(){function e(e,t){void 0===t&&(t=e.length),this.string=e,this.length=t}return e.prototype.get=function(e){return e<0||e>=this.length?-1:this.string.charCodeAt(e)},e.prototype.read=function(e,t){return this.string.slice(e,Math.min(this.length,t))},e.prototype.clip=function(t){return new e(this.string,t)},e}(),f=function(){function e(e,t){this.data=e,this.id=t}return e.prototype.token=function(e,t,n){!function(e,t,n,r,i){var a=0,o=1<0){var f=e[u];if(s.allows(f)&&(-1==n.value||n.value==f||r.cx.parser.overrides(f,n.value))){n.accept(f,l);break}}for(var d=t.get(l++),h=0,p=e[a+2];h>1,m=c+v+(v<<1),g=e[m],b=e[m+1];if(d=b)){a=e[m+2];continue e}h=v+1}}break}}(this.data,e,t,n,this.id)},e}();f.prototype.contextual=f.prototype.fallback=f.prototype.extend=!1;function d(e,t){if(void 0===t&&(t=Uint16Array),"string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&o--,o>=34&&o--;var l=o-32;if(l>=46&&(l-=46,s=!0),a+=l,s)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var h="undefined"!=typeof e&&/\bparse\b/.test(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).LOG),p=null,v=function(){function e(e){this.start=[0],this.index=[0],this.nextStart=0,this.trees=[e]}return e.prototype.nodeAt=function(e){if(e=e)return o==e?a:null;a instanceof r.f?(this.index[t]++,this.nextStart=o+a.length):(this.index[t]++,o+a.length>=e&&(this.trees.push(a),this.start.push(o),this.index.push(0)))}else this.trees.pop(),this.start.pop(),this.index.pop()}},e}(),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.extended=-1,t.mask=0,t}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.clear=function(e){this.start=e,this.value=this.extended=-1},t}(c),g=new c,b=function(){function e(e){this.tokens=[],this.mainToken=g,this.actions=[],this.tokens=e.tokenizers.map((function(e){return new m}))}return e.prototype.getActions=function(e,t){for(var n=0,r=null,i=e.cx.parser,a=i.tokenizers,o=i.stateSlot(e.state,3),s=0;s-1&&(n=this.addActions(e,c.extended,c.end,n)),n=this.addActions(e,c.value,c.end,n),!l.extend&&(r=c,n>u))break}}for(;this.actions.length>n;)this.actions.pop();return r||((r=g).start=e.pos,e.pos==t.length?r.accept(e.cx.parser.eofTerm,e.pos):r.accept(0,e.pos+1)),this.mainToken=r,this.actions},e.prototype.updateCachedToken=function(e,t,n,r){if(e.clear(n.pos),t.token(r,e,n),e.value>-1){for(var i=n.cx.parser,a=0;a=0&&n.cx.dialect.allows(o>>1)){0==(1&o)?e.value=o>>1:e.extended=o>>1;break}}}else n.pos==r.length?e.accept(n.cx.parser.eofTerm,n.pos):e.accept(0,n.pos+1)},e.prototype.putAction=function(e,t,n,r){for(var i=0;it)this.putStack(a);else{var o=this.advanceStack(a,e);if(o){a=o;continue}n||(n=[],r=[]),n.push(a);var s=a.cx.tokens.mainToken;r.push(s.value,s.end)}break}if(!this.stacks.length){var l;if(l=n&&function(e){for(var t=null,n=0,r=e;nc&&(this.stacks.sort((function(e,t){return t.score-e.score})),this.stacks.length=c),this.stacks.some((function(e){return e.reducePos>t}))&&this.recovering--}else if(this.stacks.length>1)e:for(i=0;i200&&f.buffer.length>200){if(!((a.score-f.score||a.buffer.length-f.buffer.length)>0)){this.stacks.splice(i--,1);continue e}this.stacks.splice(u--,1)}}}return this.tokenCount++,null},e.prototype.advanceStack=function(e,t){var n=e.pos,i=e.cx,a=i.input,s=i.parser,l=h?this.stackID(e)+" -> ":"";if(this.cache)for(var c=this.cache.nodeAt(n);c;){var u=s.group.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1)return e.useNode(c,u),h&&console.log(l+this.stackID(e)+" (via reuse of "+s.getName(c.type.id)+")"),e;if(!(c instanceof r.e)||0==c.children.length||c.positions[0]>0)break;var f=c.children[0];if(!(f instanceof r.e))break;c=f}var d=s.startNested(e.state);e:if(d>-1){var p=s.nested[d],v=p.grammar,m=p.end,g=p.placeholder,b=void 0,O=null,k=void 0,x=void 0,w=void 0,j=void 0;if("function"==typeof v){var S=v(a,e);if(S.stay)break e;O=S.parseNode,k=S.parser,x=S.top,w=S.dialect,b=S.filterEnd,j=S.wrapType}else k=v;var C=this.scanForNestEnd(e,m,b),M=e.cx.input.clip(C);if(O||!k){var E=O?O(M,e.pos):r.e.empty;return E.length!=C-e.pos&&(E=new r.e(E.type,E.children,E.positions,C-e.pos)),null!=j&&(E=new r.e(s.group.types[j],[E],[0],E.length)),e.useNode(E,s.getGoto(e.state,g,!0)),e}var T=x?k.topRules[x]:k.defaultTop,P=o.start(new y(k,e.cx.maxBufferLength,M,T[1],k.parseDialect(w),e,j),T[0],e.pos);return h&&console.log(l+this.stackID(P)+" (nested)"),P}var _=s.stateSlot(e.state,4);if(_>0)return e.reduce(_),h&&console.log(l+this.stackID(e)+" (via always-reduce "+s.getName(65535&_)+")"),e;for(var D=e.cx.tokens.getActions(e,a),A=0;An?this.putStack(z):t.push(z)}return e.cx.parent&&e.pos==a.length?this.finishNested(e):null},e.prototype.advanceFully=function(e){for(var t=e.pos;;){var n=this.advanceStack(e,null);if(!n)return e;if(n.pos>t)return this.putStackDedup(n),null;e=n}},e.prototype.runRecovery=function(e,t){for(var n=null,r=!1,i=0;i ":"";if(a.deadEnd){if(r)continue;if(r=!0,a.restart(),h&&console.log(l+this.stackID(a)+" (restarted)"),!(d=this.advanceFully(a)))continue;a=d}for(var c=a.split(),u=l,f=0;c.forceReduce()&&f<10;f++){var d;if(h&&console.log(u+this.stackID(c)+" (via force-reduce)"),!(d=this.advanceFully(c)))break;c=d,h&&(u=this.stackID(d)+" -> ")}for(var p=0,v=a.recoverByInsert(o);pa.pos?(s==a.pos&&(s++,o=0),a.recoverByDelete(o,s),h&&console.log(l+this.stackID(a)+" (via recover-delete "+a.cx.parser.getName(o)+")"),this.putStackDedup(a)):a.cx.parent||n&&!(n.score-1&&(!n||n(r.read(i,g.end))))return i;return r.length},e.prototype.finishNested=function(e){if(-2==e.cx.wrapType)return null;var t=e.cx.parent,n=e.forceAll().toTree(),i=t.cx.parser,a=i.nested[i.startNested(t.state)];return n=new r.e(n.type,n.children,n.positions.map((function(e){return e-t.pos})),e.pos-t.pos),e.cx.wrapType>-1&&(n=new r.e(i.group.types[e.cx.wrapType],[n],[0],n.length)),e.cx.wrapType=-2,t.useNode(n,i.getGoto(t.state,a.placeholder,!0)),h&&console.log(this.stackID(t)+" (via unnest "+(e.cx.wrapType>-1?i.getName(e.cx.wrapType):n.type.name)+")"),t},e.prototype.stackID=function(e){var t=(p||(p=new WeakMap)).get(e);return t||p.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e},e}(),k=function(){function e(e,t,n){this.source=e,this.flags=t,this.disabled=n}return e.prototype.allows=function(e){return!this.disabled||0==this.disabled[e]},e}(),x=function(){function e(e){this.nextStateCache=[],this.cachedDialect=null;var t=d(e.tokenData),n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(var i=0;i=r[0])return-1;for(var i=r[t+1];;){var a=r[i++],o=1&a,s=r[i++];if(o&&n)return s;for(var l=i+(a>>1);i0},e.prototype.startNested=function(e){var t=this.stateSlot(e,0);return 4&t?t>>10:-1},e.prototype.validAction=function(e,t){if(t==this.stateSlot(e,4))return!0;for(var n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=w(this.data,n+2)}if(t==w(this.data,n+1))return!0}},e.prototype.nextStates=function(e){var t=this.nextStateCache[e];if(t)return t;for(var n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=w(this.data,r+2)}0==(1&this.data[r+2])&&n.indexOf(this.data[r+1])<0&&n.push(this.data[r+1])}for(var i=this.goto,a=i[0],o=0;o>1);s0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultTop",{get:function(){return this.topRules[Object.keys(this.topRules)[0]]},enumerable:!0,configurable:!0}),e.prototype.dynamicPrecedence=function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0},Object.defineProperty(e.prototype,"topType",{get:function(){return this.group.types[this.defaultTop[1]]},enumerable:!0,configurable:!0}),e.prototype.parseDialect=function(e){if(this.cachedDialect&&this.cachedDialect.source==e)return this.cachedDialect;var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e)for(var r=0,i=e.split(" ");r=0&&(n[c]=!0)}for(var o=null,s=0;s-1},P.prototype.set=function(e,t){var n=this.__data__,r=D(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},_.prototype.clear=function(){this.__data__={hash:new T,map:new(S||P),string:new T}},_.prototype.delete=function(e){return L(this,e).delete(e)},_.prototype.get=function(e){return L(this,e).get(e)},_.prototype.has=function(e){return L(this,e).has(e)},_.prototype.set=function(e,t){return L(this,e).set(e,t),this};var z=F((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Q(e))return E?E.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(l,(function(e,t,r,i){n.push(r?i.replace(c,"$1"):t||e)})),n}));function I(e){if("string"==typeof e||Q(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function F(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(F.Cache||_),n}F.Cache=_;var $=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Q(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:A(e,t);return void 0===r?n:r}}).call(this,n(110))},function(e,t,n){e.exports=n(187)},,,,,,,,,,function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n+=t.charAt(r):a<128?n+=i[a]:a<2048?n+=i[192|a>>6]+i[128|63&a]:a<55296||a>=57344?n+=i[224|a>>12]+i[128|a>>6&63]+i[128|63&a]:(r+=1,a=65536+((1023&a)<<10|1023&t.charCodeAt(r)),n+=i[240|a>>18]+i[128|a>>12&63]+i[128|a>>6&63]+i[128|63&a])}return n},isBuffer:function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!==typeof n){if(Array.isArray(t))t.push(n);else{if("object"!==typeof t)return[t,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if("object"!==typeof t)return[t].concat(n);var o=t;return Array.isArray(t)&&!Array.isArray(n)&&(o=a(t,i)),Array.isArray(t)&&Array.isArray(n)?(n.forEach((function(n,a){r.call(t,a)?t[a]&&"object"===typeof t[a]?t[a]=e(t[a],n,i):t.push(n):t[a]=n})),t):Object.keys(n).reduce((function(t,a){var o=n[a];return r.call(t,a)?t[a]=e(t[a],o,i):t[a]=o,t}),o)}}},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,l=2592e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:s,months:l,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},f=function(e){return e instanceof b},d=function(e,t,n){return new b(e,n,t.$l)},h=function(e){return t.p(e)+"s"},p=function(e){return e<0},v=function(e){return p(e)?Math.ceil(e):Math.floor(e)},m=function(e){return Math.abs(e)},g=function(e,t){return e?p(e)?{negative:!0,format:""+m(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function p(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){r.$d[h(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var m=p.prototype;return m.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},m.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=v(e/s),e%=s,this.$d.months=v(e/l),e%=l,this.$d.days=v(e/a),e%=a,this.$d.hours=v(e/i),e%=i,this.$d.minutes=v(e/r),e%=r,this.$d.seconds=v(e/n),e%=n,this.$d.milliseconds=e},m.toISOString=function(){var e=g(this.$d.years,"Y"),t=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=g(n,"D"),i=g(this.$d.hours,"H"),a=g(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var s=g(o,"S"),l=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,c=i.format||a.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+r.format+c+i.format+a.format+s.format;return"P"===u||"-P"===u?"P0D":u},m.toJSON=function(){return this.toISOString()},m.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(o,(function(e,t){return t||String(r[e])}))},m.as=function(e){return this.$ms/u[h(e)]},m.get=function(e){var t=this.$ms,n=h(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?v(t/u[n]):this.$d[n],0===t?0:t},m.add=function(e,t,n){var r;return r=t?e*u[h(t)]:f(e)?e.$ms:d(e,this).$ms,d(this.$ms+r*(n?-1:1),this)},m.subtract=function(e,t){return this.add(e,t,!0)},m.locale=function(e){var t=this.clone();return t.$l=e,t},m.clone=function(){return d(this.$ms,this)},m.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},m.milliseconds=function(){return this.get("milliseconds")},m.asMilliseconds=function(){return this.as("milliseconds")},m.seconds=function(){return this.get("seconds")},m.asSeconds=function(){return this.as("seconds")},m.minutes=function(){return this.get("minutes")},m.asMinutes=function(){return this.as("minutes")},m.hours=function(){return this.get("hours")},m.asHours=function(){return this.as("hours")},m.days=function(){return this.get("days")},m.asDays=function(){return this.as("days")},m.weeks=function(){return this.get("weeks")},m.asWeeks=function(){return this.as("weeks")},m.months=function(){return this.get("months")},m.asMonths=function(){return this.as("months")},m.years=function(){return this.get("years")},m.asYears=function(){return this.as("years")},p}();return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){var n=i.locale();return d(e,{$l:n},t)},i.isDuration=f;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return f(e)&&(e=e.asMilliseconds()),a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return f(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)}}}()},function(e,t,n){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var i=(""+r[0]).match(n)||["-",0,0],a=i[0],o=60*+i[1]+ +i[2];return 0===o?0:"+"===a?o:-o}(r)))return this;var o=Math.abs(r)<=16?60*r:r,s=this;if(i)return s.$offset=o,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(o+l,e)).$offset=o,s.$x.$localOffset=l}else s=this.utc();return s};var u=o.format;o.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var f=o.toDate;o.toDate=function(e){return"s"===e&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),i=a(e).local();return d.call(r,i,t,n)}}}()},function(e,t,n){"use strict";var r=n(180),i=n(181),a=n(125);e.exports={formats:a,parse:i,stringify:r}},function(e,t,n){"use strict";(function(e){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function a(e){return e&&"[object Function]"==={}.toString.call(e)}function o(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=o(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:l(s(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?u:10===e?f:u||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===o(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,a=document.createRange();a.setStart(r,0),a.setEnd(i,0);var o=a.commonAncestorContainer;if(e!==o&&t!==o||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(o)?o:h(o);var s=p(e);return s.host?v(s.host,t):v(e,p(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,a=e.ownerDocument.scrollingElement||i;return a[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),i=m(t,"left"),a=n?-1:1;return e.top+=r*a,e.bottom+=r*a,e.left+=i*a,e.right+=i*a,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function y(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var k=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},x=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,a=C(e),s=C(t),c=l(e),u=o(t),f=parseFloat(u.borderTopWidth),h=parseFloat(u.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:a.top-s.top-f,left:a.left-s.left-h,width:a.width,height:a.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var v=parseFloat(u.marginTop),m=parseFloat(u.marginLeft);p.top-=f-v,p.bottom-=f-v,p.left-=h-m,p.right-=h-m,p.marginTop=v,p.marginLeft=m}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(p=g(p,t)),p}function E(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=M(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),a=Math.max(n.clientHeight,window.innerHeight||0),o=t?0:m(n),s=t?0:m(n,"left"),l={top:o-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:a};return S(l)}function T(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===o(e,"position"))return!0;var n=s(e);return!!n&&T(n)}function P(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===o(t,"transform");)t=t.parentElement;return t||document.documentElement}function _(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={top:0,left:0},o=i?P(e):v(e,c(t));if("viewport"===r)a=E(o,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=l(s(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===r?e.ownerDocument.documentElement:r;var f=M(u,o,i);if("HTML"!==u.nodeName||T(o))a=f;else{var d=O(e.ownerDocument),h=d.height,p=d.width;a.top+=f.top-f.marginTop,a.bottom=h+f.top,a.left+=f.left-f.marginLeft,a.right=p+f.left}}var m="number"===typeof(n=n||0);return a.left+=m?n:n.left||0,a.top+=m?n:n.top||0,a.right-=m?n:n.right||0,a.bottom-=m?n:n.bottom||0,a}function D(e){return e.width*e.height}function A(e,t,n,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var o=_(n,r,a,i),s={top:{width:o.width,height:t.top-o.top},right:{width:o.right-t.right,height:o.height},bottom:{width:o.width,height:o.bottom-t.bottom},left:{width:t.left-o.left,height:o.height}},l=Object.keys(s).map((function(e){return j({key:e},s[e],{area:D(s[e])})})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function R(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?P(t):v(t,c(n));return M(n,i,r)}function L(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function N(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function z(e,t,n){n=n.split("-")[0];var r=L(e),i={width:r.width,height:r.height},a=-1!==["right","left"].indexOf(n),o=a?"top":"left",s=a?"left":"top",l=a?"height":"width",c=a?"width":"height";return i[o]=t[o]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[c]:t[N(s)],i}function I(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function F(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=I(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&a(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function $(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=R(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=A(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=z(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=F(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function Q(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ie="counterclockwise";function ae(e,t,n,r){var i=[0,0],a=-1!==["right","left"].indexOf(r),o=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=o.indexOf(I(o,(function(e){return-1!==e.search(/,|\s/)})));o[s]&&-1===o[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[o.slice(0,s).concat([o[s].split(l)[0]]),[o[s].split(l)[1]].concat(o.slice(s+1))]:[o];return(c=c.map((function(e,r){var i=(1===r?!a:a)?"height":"width",o=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,o=!0,e):o?(e[e.length-1]+=t,o=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),a=+i[1],o=i[2];if(!a)return e;if(0===o.indexOf("%")){var s=void 0;switch(o){case"%p":s=n;break;case"%":case"%r":default:s=r}return S(s)[t]/100*a}if("vh"===o||"vw"===o)return("vh"===o?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*a;return a}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){X(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var oe={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,a=i.reference,o=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:w({},l,a[l]),end:w({},l,a[l]+a[c]-o[c])};e.offsets.popper=j({},o,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,a=i.popper,o=i.reference,s=r.split("-")[0],l=void 0;return l=X(+n)?[+n,0]:ae(n,a,o,s),"left"===s?(a.top+=l[0],a.left-=l[1]):"right"===s?(a.top+=l[0],a.left+=l[1]):"top"===s?(a.left+=l[0],a.top-=l[1]):"bottom"===s&&(a.left+=l[0],a.top+=l[1]),e.popper=a,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=Q("transform"),i=e.instance.popper.style,a=i.top,o=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=_(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=a,i.left=o,i[r]=s,t.boundaries=l;var c=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]l[e]&&!t.escapeWithReference&&(r=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),w({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=j({},u,f[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],a=Math.floor,o=-1!==["top","bottom"].indexOf(i),s=o?"right":"bottom",l=o?"left":"top",c=o?"width":"height";return n[s]a(r[s])&&(e.offsets.popper[l]=a(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Z(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],a=e.offsets,s=a.popper,l=a.reference,c=-1!==["left","right"].indexOf(i),u=c?"height":"width",f=c?"Top":"Left",d=f.toLowerCase(),h=c?"left":"top",p=c?"bottom":"right",v=L(r)[u];l[p]-vs[p]&&(e.offsets.popper[d]+=l[d]+v-s[p]),e.offsets.popper=S(e.offsets.popper);var m=l[d]+l[u]/2-v/2,g=o(e.instance.popper),b=parseFloat(g["margin"+f]),y=parseFloat(g["border"+f+"Width"]),O=m-e.offsets.popper[d]-b-y;return O=Math.max(Math.min(s[u]-v,O),0),e.arrowElement=r,e.offsets.arrow=(w(n={},d,Math.round(O)),w(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=_(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=N(r),a=e.placement.split("-")[1]||"",o=[];switch(t.behavior){case ne:o=[r,i];break;case re:o=te(r);break;case ie:o=te(r,!0);break;default:o=t.behavior}return o.forEach((function(s,l){if(r!==s||o.length===l+1)return e;r=e.placement.split("-")[0],i=N(r);var c=e.offsets.popper,u=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(u.left)||"right"===r&&f(c.left)f(u.top)||"bottom"===r&&f(c.top)f(n.right),v=f(c.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&v||"bottom"===r&&m,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===a&&h||b&&"end"===a&&p||!b&&"start"===a&&v||!b&&"end"===a&&m),O=!!t.flipVariationsByContent&&(b&&"start"===a&&p||b&&"end"===a&&h||!b&&"start"===a&&m||!b&&"end"===a&&v),k=y||O;(d||g||k)&&(e.flipped=!0,(d||g)&&(r=o[l+1]),k&&(a=function(e){return"end"===e?"start":"start"===e?"end":e}(a)),e.placement=r+(a?"-"+a:""),e.offsets.popper=j({},e.offsets.popper,z(e.instance.popper,e.offsets.reference,e.placement)),e=F(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,a=r.reference,o=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[o?"left":"top"]=a[n]-(s?i[o?"width":"height"]:0),e.placement=N(t),e.offsets.popper=S(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Z(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=I(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};k(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=j({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(j({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=j({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return j({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&a(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return x(e,[{key:"update",value:function(){return $.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return q.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();se.Utils=("undefined"!==typeof window?window:e).PopperUtils,se.placements=J,se.Defaults=oe,t.a=se}).call(this,n(110))},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"}),"TableChart");t.default=o},function(e,t,n){var r;window,r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./react/uplot-react.tsx")}({"./common/index.ts":function(e,t,n){"use strict";n.r(t),n.d(t,"optionsUpdateState",(function(){return i})),n.d(t,"dataMatch",(function(){return a}));var r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=g&&!a||"t"===a?(m+=d.abbreviations.trillion,t/=g):o=b&&!a||"b"===a?(m+=d.abbreviations.billion,t/=b):o=y&&!a||"m"===a?(m+=d.abbreviations.million,t/=y):(o=O&&!a||"k"===a)&&(m+=d.abbreviations.thousand,t/=O)),e._.includes(n,"[.]")&&(p=!0,n=n.replace("[.]",".")),s=t.toString().split(".")[0],l=n.split(".")[1],u=n.indexOf(","),v=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,l?(e._.includes(l,"[")?(l=(l=l.replace("]","")).split("["),k=e._.toFixed(t,l[0].length+l[1].length,r,l[1].length)):k=e._.toFixed(t,l.length,r),s=k.split(".")[0],k=e._.includes(k,".")?d.delimiters.decimal+k.split(".")[1]:"",p&&0===Number(k.slice(1))&&(k="")):s=e._.toFixed(t,0,r),m&&!a&&Number(s)>=1e3&&m!==d.abbreviations.trillion)switch(s=String(Number(s)/1e3),m){case d.abbreviations.thousand:m=d.abbreviations.million;break;case d.abbreviations.million:m=d.abbreviations.billion;break;case d.abbreviations.billion:m=d.abbreviations.trillion}if(e._.includes(s,"-")&&(s=s.slice(1),x=!0),s.length0;w--)s="0"+s;return u>-1&&(s=s.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),0===n.indexOf(".")&&(s=""),f=s+k+(m||""),h?f=(h&&x?"(":"")+f+(h&&x?")":""):c>=0?f=0===c?(x?"-":"+")+f:f+(x?"-":"+"):x&&(f="-"+f),f},stringToNumber:function(e){var t,n,r,a=i[o.currentLocale],s=e,l={thousand:3,million:6,billion:9,trillion:12};if(o.zeroFormat&&e===o.zeroFormat)n=0;else if(o.nullFormat&&e===o.nullFormat||!e.replace(/[^0-9]+/g,"").length)n=null;else{for(t in n=1,"."!==a.delimiters.decimal&&(e=e.replace(/\./g,"").replace(a.delimiters.decimal,".")),l)if(r=new RegExp("[^a-zA-Z]"+a.abbreviations[t]+"(?:\\)|(\\"+a.currency.symbol+")?(?:\\))?)?$"),s.match(r)){n*=Math.pow(10,l[t]);break}n*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),n*=Number(e)}return n},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return"number"===typeof e&&isNaN(e)})),includes:function(e,t){return-1!==e.indexOf(t)},insert:function(e,t,n){return e.slice(0,n)+t+e.slice(n)},reduce:function(e,t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!==typeof t)throw new TypeError(t+" is not a function");var n,r=Object(e),i=r.length>>>0,a=0;if(3===arguments.length)n=arguments[2];else{for(;a=i)throw new TypeError("Reduce of empty array with no initial value");n=r[a++]}for(;ar?e:r}),1)},toFixed:function(e,t,n,r){var i,a,o,s,l=e.toString().split("."),c=t-(r||0);return i=2===l.length?Math.min(Math.max(l[1].length,c),t):c,o=Math.pow(10,i),s=(n(e+"e+"+i)/o).toFixed(i),r>t-i&&(a=new RegExp("\\.?0{1,"+(r-(t-i))+"}$"),s=s.replace(a,"")),s}},e.options=o,e.formats=r,e.locales=i,e.locale=function(e){return e&&(o.currentLocale=e.toLowerCase()),o.currentLocale},e.localeData=function(e){if(!e)return i[o.currentLocale];if(e=e.toLowerCase(),!i[e])throw new Error("Unknown locale : "+e);return i[e]},e.reset=function(){for(var e in a)o[e]=a[e]},e.zeroFormat=function(e){o.zeroFormat="string"===typeof e?e:null},e.nullFormat=function(e){o.nullFormat="string"===typeof e?e:null},e.defaultFormat=function(e){o.defaultFormat="string"===typeof e?e:"0.0"},e.register=function(e,t,n){if(t=t.toLowerCase(),this[e+"s"][t])throw new TypeError(t+" "+e+" already registered.");return this[e+"s"][t]=n,n},e.validate=function(t,n){var r,i,a,o,s,l,c,u;if("string"!==typeof t&&(t+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",t)),(t=t.trim()).match(/^\d+$/))return!0;if(""===t)return!1;try{c=e.localeData(n)}catch(f){c=e.localeData(e.locale())}return a=c.currency.symbol,s=c.abbreviations,r=c.delimiters.decimal,i="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(u=t.match(/^[^\d]+/))||(t=t.substr(1),u[0]===a))&&(null===(u=t.match(/[^\d]+$/))||(t=t.slice(0,-1),u[0]===s.thousand||u[0]===s.million||u[0]===s.billion||u[0]===s.trillion))&&(l=new RegExp(i+"{2}"),!t.match(/[^\d.,]/g)&&!((o=t.split(r)).length>2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(l):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(l)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(l)&&!!o[1].match(/^\d+$/)))},e.fn=s.prototype={clone:function(){return e(this)},format:function(t,n){var i,a,s,l=this._value,c=t||o.defaultFormat;if(n=n||Math.round,0===l&&null!==o.zeroFormat)a=o.zeroFormat;else if(null===l&&null!==o.nullFormat)a=o.nullFormat;else{for(i in r)if(c.match(r[i].regexps.format)){s=r[i].format;break}a=(s=s||e._.numberToFormat)(l,c,n)}return a},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var n=t.correctionFactor.call(null,this._value,e);function r(e,t,r,i){return e+Math.round(n*t)}return this._value=t.reduce([this._value,e],r,0)/n,this},subtract:function(e){var n=t.correctionFactor.call(null,this._value,e);function r(e,t,r,i){return e-Math.round(n*t)}return this._value=t.reduce([e],r,Math.round(this._value*n))/n,this},multiply:function(e){function n(e,n,r,i){var a=t.correctionFactor(e,n);return Math.round(e*a)*Math.round(n*a)/Math.round(a*a)}return this._value=t.reduce([this._value,e],n,1),this},divide:function(e){function n(e,n,r,i){var a=t.correctionFactor(e,n);return Math.round(e*a)/Math.round(n*a)}return this._value=t.reduce([this._value,e],n),this},difference:function(t){return Math.abs(e(this._value).subtract(t).value())}},e.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var t=e%10;return 1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),e.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(t,n,r){var i,a=e._.includes(n," BPS")?" ":"";return t*=1e4,n=n.replace(/\s?BPS/,""),i=e._.numberToFormat(t,n,r),e._.includes(i,")")?((i=i.split("")).splice(-1,0,a+"BPS"),i=i.join("")):i=i+a+"BPS",i},unformat:function(t){return+(1e-4*e._.stringToNumber(t)).toFixed(15)}}),function(){var t={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},r=t.suffixes.concat(n.suffixes.filter((function(e){return t.suffixes.indexOf(e)<0}))).join("|");r="("+r.replace("B","B(?!PS)")+")",e.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(r)},format:function(r,i,a){var o,s,l,c=e._.includes(i,"ib")?n:t,u=e._.includes(i," b")||e._.includes(i," ib")?" ":"";for(i=i.replace(/\s?i?b/,""),o=0;o<=c.suffixes.length;o++)if(s=Math.pow(c.base,o),l=Math.pow(c.base,o+1),null===r||0===r||r>=s&&r0&&(r/=s);break}return e._.numberToFormat(r,i,a)+u},unformat:function(r){var i,a,o=e._.stringToNumber(r);if(o){for(i=t.suffixes.length-1;i>=0;i--){if(e._.includes(r,t.suffixes[i])){a=Math.pow(t.base,i);break}if(e._.includes(r,n.suffixes[i])){a=Math.pow(n.base,i);break}}o*=a||1}return o}})}(),e.register("format","currency",{regexps:{format:/(\$)/},format:function(t,n,r){var i,a,o=e.locales[e.options.currentLocale],s={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(n=n.replace(/\s?\$\s?/,""),i=e._.numberToFormat(t,n,r),t>=0?(s.before=s.before.replace(/[\-\(]/,""),s.after=s.after.replace(/[\-\)]/,"")):t<0&&!e._.includes(s.before,"-")&&!e._.includes(s.before,"(")&&(s.before="-"+s.before),a=0;a=0;a--)switch(s.after[a]){case"$":i=a===s.after.length-1?i+o.currency.symbol:e._.insert(i,o.currency.symbol,-(s.after.length-(1+a)));break;case" ":i=a===s.after.length-1?i+" ":e._.insert(i," ",-(s.after.length-(1+a)+o.currency.symbol.length-1))}return i}}),e.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(t,n,r){var i=("number"!==typeof t||e._.isNaN(t)?"0e+0":t.toExponential()).split("e");return n=n.replace(/e[\+|\-]{1}0/,""),e._.numberToFormat(Number(i[0]),n,r)+"e"+i[1]},unformat:function(t){var n=e._.includes(t,"e+")?t.split("e+"):t.split("e-"),r=Number(n[0]),i=Number(n[1]);function a(t,n,r,i){var a=e._.correctionFactor(t,n);return t*a*(n*a)/(a*a)}return i=e._.includes(t,"e-")?i*=-1:i,e._.reduce([r,Math.pow(10,i)],a,1)}}),e.register("format","ordinal",{regexps:{format:/(o)/},format:function(t,n,r){var i=e.locales[e.options.currentLocale],a=e._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),a+=i.ordinal(t),e._.numberToFormat(t,n,r)+a}}),e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(t,n,r){var i,a=e._.includes(n," %")?" ":"";return e.options.scalePercentBy100&&(t*=100),n=n.replace(/\s?\%/,""),i=e._.numberToFormat(t,n,r),e._.includes(i,")")?((i=i.split("")).splice(-1,0,a+"%"),i=i.join("")):i=i+a+"%",i},unformat:function(t){var n=e._.stringToNumber(t);return e.options.scalePercentBy100?.01*n:n}}),e.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,t,n){var r=Math.floor(e/60/60),i=Math.floor((e-60*r*60)/60),a=Math.round(e-60*r*60-60*i);return r+":"+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)},unformat:function(e){var t=e.split(":"),n=0;return 3===t.length?(n+=60*Number(t[0])*60,n+=60*Number(t[1]),n+=Number(t[2])):2===t.length&&(n+=60*Number(t[0]),n+=Number(t[1])),Number(n)}}),e})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"PlayCircleOutline");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"}),"Security");t.default=o},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");t.default=o},function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,l,"next",e)}function l(e){r(o,i,a,s,l,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";var r=n(47),i=n(48);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(0)),o=(0,r(n(49)).default)(a.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");t.default=o},function(e,t,n){"use strict";var r=n(44),i=n.n(r),a=n(145),o=n.n(a),s=n(146),l=n.n(s);i.a.extend(o.a),i.a.extend(l.a);var c=function(){function e(e){var t=void 0===e?{}:e,n=t.locale,r=t.instance,a=t.dayjs;this.yearFormat="YYYY",this.yearMonthFormat="MMMM YYYY",this.dateTime12hFormat="MMMM Do hh:mm a",this.dateTime24hFormat="MMMM Do HH:mm",this.time12hFormat="hh:mm A",this.time24hFormat="HH:mm",this.dateFormat="MMMM Do",this.dayjs=function(e,t){return t?function(){for(var n=[],r=0;r68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=a[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=a.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,s("seconds")],ss:[r,s("seconds")],m:[r,s("minutes")],mm:[r,s("minutes")],H:[r,s("hours")],h:[r,s("hours")],HH:[r,s("hours")],hh:[r,s("hours")],D:[r,s("day")],DD:[n,s("day")],Do:[i,function(e){var t=a.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,s("month")],MM:[n,s("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.substr(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=o(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};function d(n){var r,i;r=n,i=a&&a.formats;for(var o=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=o.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var r=d(t)(e),i=r.year,a=r.month,o=r.day,s=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,f=r.zone,h=new Date,p=o||(i||a?1:h.getDate()),v=i||h.getFullYear(),m=0;i&&!a||(m=a>0?a-1:h.getMonth());var g=s||0,b=l||0,y=c||0,O=u||0;return f?new Date(Date.UTC(v,m,p,g,b,y,O+60*f.offset*1e3)):n?new Date(Date.UTC(v,m,p,g,b,y,O)):new Date(v,m,p,g,b,y,O)}catch(e){return new Date("")}}(t,s,r),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),u&&t!=this.format(s)&&(this.$d=new Date("")),a={}}else if(s instanceof Array)for(var h=s.length,p=1;p<=h;p+=1){o[1]=s[p-1];var v=n.apply(this,o);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}p===h&&(this.$d=new Date(""))}else i.call(this,e)}}}()},function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){var r=t.prototype,i=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return i.bind(this)(e);var r=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(a)}}}()},function(e,t,n){"use strict";var r=n(20),i=n(8),a=n(191),o=n(2),s=["xs","sm","md","lg","xl"];function l(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,a=void 0===r?"px":r,l=e.step,c=void 0===l?5:l,u=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(a,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(a,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(a,")")}return Object(o.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(a,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},u)}function c(e,t,n){var i;return Object(o.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(o.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(o.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(152),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(22),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function x(e,t,n,r){var i=r.light||r,a=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.e)(e.main,i):"dark"===t&&(e.dark=Object(y.a)(e.main,a)))}function w(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,l=e.error,c=void 0===l?{light:v[300],main:v[500],dark:v[700]}:l,w=e.warning,j=void 0===w?{light:m[300],main:m[500],dark:m[700]}:w,S=e.info,C=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,M=e.success,E=void 0===M?{light:b[300],main:b[500],dark:b[700]}:M,T=e.type,P=void 0===T?"light":T,_=e.contrastThreshold,D=void 0===_?3:_,A=e.tonalOffset,R=void 0===A?.2:A,L=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function N(e){return Object(y.d)(e,k.text.primary)>=D?k.text.primary:O.text.primary}var z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(o.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return x(e,"light",n,R),x(e,"dark",r,R),e.contrastText||(e.contrastText=N(e.main)),e},I={dark:k,light:O};return Object(a.a)(Object(o.a)({common:f,type:P,primary:z(n),secondary:z(s,"A400","A200","A700"),error:z(c),warning:z(j),info:z(C),success:z(E),grey:d,contrastThreshold:D,getContrastText:N,augmentColor:z,tonalOffset:R},I[P]),L)}function j(e){return Math.round(1e5*e)/1e5}var S={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function M(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?C:r,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,f=void 0===u?300:u,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,b=n.htmlFontSize,y=void 0===b?16:b,O=n.allVariants,k=n.pxToRem,x=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var w=c/14,M=k||function(e){return"".concat(e/y*w,"rem")},E=function(e,t,n,r,i){return Object(o.a)({fontFamily:s,fontWeight:e,fontSize:M(t),lineHeight:n},s===C?{letterSpacing:"".concat(j(r/t),"em")}:{},i,O)},T={h1:E(f,96,1.167,-1.5),h2:E(f,60,1.2,-.5),h3:E(h,48,1.167,0),h4:E(h,34,1.235,.25),h5:E(h,24,1.334,0),h6:E(v,20,1.6,.15),subtitle1:E(h,16,1.75,.15),subtitle2:E(v,14,1.57,.1),body1:E(h,16,1.5,.15),body2:E(h,14,1.43,.15),button:E(v,14,1.75,.4,S),caption:E(h,12,1.66,.4),overline:E(h,12,2.66,1,S)};return Object(a.a)(Object(o.a)({htmlFontSize:y,pxToRem:M,round:j,fontFamily:s,fontSize:c,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},T),x,{clone:!1})}function E(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var T=["none",E(0,2,1,-1,0,1,1,0,0,1,3,0),E(0,3,1,-2,0,2,2,0,0,1,5,0),E(0,3,3,-2,0,3,4,0,0,1,8,0),E(0,2,4,-1,0,4,5,0,0,1,10,0),E(0,3,5,-1,0,5,8,0,0,1,14,0),E(0,3,5,-1,0,6,10,0,0,1,18,0),E(0,4,5,-2,0,7,10,1,0,2,16,1),E(0,5,5,-3,0,8,10,1,0,3,14,2),E(0,5,6,-3,0,9,12,1,0,3,16,2),E(0,6,6,-3,0,10,14,1,0,4,18,3),E(0,6,7,-4,0,11,15,1,0,4,20,3),E(0,7,8,-4,0,12,17,2,0,5,22,4),E(0,7,8,-4,0,13,19,2,0,5,24,4),E(0,7,9,-4,0,14,21,2,0,5,26,4),E(0,8,9,-5,0,15,22,2,0,6,28,5),E(0,8,10,-5,0,16,24,2,0,6,30,5),E(0,8,11,-5,0,17,26,2,0,6,32,5),E(0,9,11,-5,0,18,28,2,0,7,34,6),E(0,9,12,-6,0,19,29,2,0,7,36,6),E(0,10,13,-6,0,20,31,3,0,8,38,7),E(0,10,13,-6,0,21,33,3,0,8,40,7),E(0,10,14,-6,0,22,35,3,0,8,42,7),E(0,11,14,-7,0,23,36,3,0,9,44,8),E(0,11,15,-7,0,24,38,3,0,9,46,8)],P={borderRadius:4},_=n(270);function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(_.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,o=void 0===r?{}:r,s=e.palette,u=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=w(u),m=l(n),g=D(f),b=Object(a.a)({breakpoints:m,direction:"ltr",mixins:c(m,g,o),overrides:{},palette:v,props:{},shadows:T,typography:M(v,h),spacing:g,shape:P,transitions:A.a,zIndex:R.a},p),y=arguments.length,O=new Array(y>1?y-1:0),k=1;k-1;return function(e){return b(e,!0,1,void 0,a&&!function(e){var t,n;return e.pos==(null===(t=e.options)||void 0===t?void 0:t.simulateBreak)&&(null===(n=e.options)||void 0===n?void 0:n.simulateDoubleBreak)}(e)?i.start:void 0)}}return null==e.parent?v:null}function v(){return 0}var m=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e.state,e.options)).pos=i,o.node=a,o}return Object(i.a)(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var e=this.state.doc.lineAt(this.node.start);;){for(var t=this.node.resolve(e.from);t.parent&&t.parent.start==t.start;)t=t.parent;if(g(t,this.node))break;e=this.state.doc.lineAt(t.start)}return this.lineIndent(e)}}]),n}(u.g);function g(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function b(e,t,n,r,i){var a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,l=t?function(e){var t,n=e.node,r=n.childAfter(n.start),i=n.lastChild;if(!r)return null;for(var a=null===(t=e.options)||void 0===t?void 0:t.simulateBreak,o=e.state.doc.lineAt(r.start),s=null==a||a<=o.from?o.to:Math.min(o.to,a),l=r.end;;){var u=n.childAfter(l);if(!u||u==i)return null;if(!u.type.prop(c.c.skipped))return u.startn)){if(r&&i.start=t&&s.to>n&&(r=s)}}return r})))]}return Object(i.a)(e,[{key:"withDialect",value:function(t){return new e(this.parser,t,this.languageData)}},{key:"getTree",value:function(e){return e.field(this.field).tree}},{key:"parsePos",value:function(e){return e.field(this.field).upto}},{key:"ensureTree",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=e.field(this.field);if(r.upto>=t)return r.updatedTree;if(r.parse||r.startParse(this,e.doc),r.parse.pos1&&void 0!==arguments[1]?arguments[1]:{},r=u.f.define({combine:n.languageData?function(e){return e.concat(n.languageData)}:void 0});return new e(t.withProps(u.n.add(Object(o.a)({},t.topType.name,r))),n.dialect||"",r)}}]),e}(),k=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;Object(r.a)(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Object(i.a)(e,[{key:"get",value:function(e){if(e>=this.length)return-1;var t=this.cursorPos-this.string.length;return(e=this.cursorPos)&&(e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},{key:"clip",value:function(t){return new e(this.doc,t)}}]),e}();function x(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e6,r=Date.now()+t;;){var i=e.advance();if(i)return i;if(e.pos>n||Date.now()>r)return null}}function w(e,t){var n=e.forceFinish(),r=n.applyChanges([{fromA:e.pos,toA:n.length,fromB:e.pos,toB:n.length}]).append(t.applyChanges([{fromA:0,toA:e.pos,fromB:0,toB:e.pos}]));return{parsed:n,cache:r}}var j=function(){function e(t,n,i){Object(r.a)(this,e),this.tree=t,this.upto=n,this.cache=i,this.parse=null,this.updatedTree=t}return Object(i.a)(e,[{key:"apply",value:function(t,n,r){var i,o=Object(a.a)(t.effects);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(s.is(r))return s.value}}catch(c){o.e(c)}finally{o.f()}if(!t.docChanged)return this;var l=[];return t.changes.iterChangedRanges((function(e,t,n,r){return l.push({fromA:e,toA:t,fromB:n,toB:r})})),e.advance((this.parse?w(this.parse,this.updatedTree).cache:this.cache).applyChanges(l),n,t.state.doc)}},{key:"startParse",value:function(e,t){this.parse=e.parser.startParse(new k(t),{cache:this.cache,dialect:e.dialect})}},{key:"stopParse",value:function(e,t){if(e)this.cache=e;else{var n=w(this.parse,this.updatedTree);e=n.parsed,this.cache=n.cache}return this.updatedTree=e,this.upto=null!==t&&void 0!==t?t:this.parse.pos,this.parse=null,e}}],[{key:"advance",value:function(t,n,r){var i=n.parser.startParse(new k(r),{cache:t,dialect:n.dialect}),a=x(i,25);if(a)return new e(a,r.length,a);var o=w(i,t);return new e(o.parsed,i.pos,o.cache)}}]),e}(),S="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},C="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,M=function(){function e(t,n,i){Object(r.a)(this,e),this.view=t,this.syntax=n,this.setSyntax=i,this.working=-1,this.work=this.work.bind(this),this.scheduleWork()}return Object(i.a)(e,[{key:"update",value:function(e){e.docChanged&&this.scheduleWork()}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var e=this.view.state;e.field(this.syntax.field).upto>=e.doc.length||(this.working=S(this.work,{timeout:200}))}}},{key:"work",value:function(e){this.working=-1;var t=this.view.state,n=t.field(this.syntax.field);if(!(n.upto>=t.doc.length)){n.parse||n.startParse(this.syntax,t.doc);var r=x(n.parse,e?Math.max(25,e.timeRemaining()):100);if(r||n.parse.badness>.8){var i=n.stopParse(r,t.doc.length);this.view.dispatch({effects:this.setSyntax.of(new j(i,t.doc.length,n.cache))})}else this.scheduleWork()}}},{key:"destroy",value:function(){this.working>=0&&C(this.working)}}]),e}(),E=n(105),T={bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},P={avg:7,bottomk:8,count:9,count_values:10,group:11,max:12,min:13,quantile:14,stddev:15,stdvar:16,sum:17,topk:18,by:19,without:20,and:21,or:22,unless:23},_={__proto__:null,absent_over_time:257,absent:259,abs:261,avg_over_time:263,ceil:265,changes:267,clamp_max:269,clamp_min:271,count_over_time:273,days_in_month:275,day_of_month:277,day_of_week:279,delta:281,deriv:283,exp:285,floor:287,histogram_quantile:289,holt_winters:291,hour:293,idelta:295,increase:297,irate:299,label_replace:301,label_join:303,ln:305,log10:307,log2:309,max_over_time:311,min_over_time:313,minute:315,month:317,predict_linear:319,quantile_over_time:321,rate:323,resets:325,round:327,scalar:329,sort:331,sort_desc:333,sqrt:335,stddev_over_time:337,stdvar_over_time:339,sum_over_time:341,timestamp:343,time:345,vector:347,year:349},D=E.b.deserialize({states:"2SO%jQPOOOOQO'#Cx'#CxO%nQPO'#CwQ'QQQOOOOQO'#De'#DeO%tQPO'#DdO%jQPO'#ElOOQO'#Ep'#EpO%jQPO'#EoOOQO'#Er'#ErO'UQSO'#EsO'^QQO'#EqOOQO'#Eq'#EqOOQO'#Cv'#CvOOQO'#Df'#DfOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOOQO'#Dm'#DmOOQO'#Dn'#DnOOQO'#Do'#DoOOQO'#Dp'#DpOOQO'#Dq'#DqOOQO'#Dr'#DrOOQO'#Ds'#DsOOQO'#Dt'#DtOOQO'#Du'#DuOOQO'#Dv'#DvOOQO'#Dw'#DwOOQO'#Dx'#DxOOQO'#Dy'#DyOOQO'#Dz'#DzOOQO'#D{'#D{OOQO'#D|'#D|OOQO'#D}'#D}OOQO'#EO'#EOOOQO'#EP'#EPOOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETOOQO'#EU'#EUOOQO'#EV'#EVOOQO'#EW'#EWOOQO'#EX'#EXOOQO'#EY'#EYOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#E]'#E]OOQO'#E^'#E^OOQO'#E_'#E_OOQO'#E`'#E`OOQO'#Ea'#EaOOQO'#Eb'#EbOOQO'#Ec'#EcOOQO'#Ed'#EdOOQO'#Ee'#EeOOQO'#Ef'#EfOOQO'#Eg'#EgO(qQPO'#CyO(vQPO'#DOO%tQPO,59cO(}QQO,59cO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/SQQO,5;SO/XQQO,5;VOOQO,5:O,5:OO/^QQO,5;WO/eQQO,5;ZO0uQPO'#EuO1TQPO,5;_OOQO'#Et'#EtOOQO,5;_,5;_OOQO,5;],5;]O1]QSO'#CzOOQO,59e,59eO1eQPO,59jO1mQQO'#DPOOQO,59j,59jOOQO1G.}1G.}OOQO'#DU'#DUO6XQPO'#DTO6cQPO'#DTOOQO'#DS'#DSO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO6mQSO1G0nOOQO1G0q1G0qOOQO1G0r1G0rOOQO'#Ev'#EvO6uQPO,5;aO6zQSO1G0yOOQO1G0y1G0yOOQO'#C|'#C|O7SQPO,59fOOQO'#C{'#C{OOQO,59f,59fO%jQPO,59kOOQO1G/U1G/UO(qQPO,59qO7[QPO,59oO]QQO7+$rO>sQQO7+$rO@XQQO7+$rOOQO7+&Y7+&YO@oQQO7+&`OOQO1G0{1G0{OOQO1G0z1G0zOOQO7+&e7+&eO@wQSO1G/QOOQO1G/Q1G/QOAPQQO1G/VOOQO1G/]1G/]OOQO'#DW'#DWOOQO1G/Z1G/ZOOQO<|Q;xP#]Q!Q![;{QR#g#h+rQ>UR!Q![>R#a#b>_#g#h>eQ>bP#g#h+rQ>jP#]Q!Q![>mQ>pQ!Q![>m#a#b>vQ>yP#g#h+rQ?RP#]Q!Q![?UQ?XQ!Q![?U#a#b?_Q?bP#g#h+rQ?jP#]Q!Q![?mQ?pR!Q![?m#a#b?y#g#hAPQ@OQ#]Q!Q![@U#g#h+rQ@XR!Q![@U#a#b@b#g#h@hQ@eP#g#h+rQ@mP#]Q!Q![@pQ@sQ!Q![@p#a#b@yQ@|P#g#h+rQAUP#]Q!Q![AXQA[Q!Q![AX#a#bAbQAeP#g#h+rQAmQ#]Q!Q![As#g#h+rQAvR!Q![As#a#bBP#g#hBVQBSP#g#h+rQB[P#]Q!Q![B_QBbQ!Q![B_#a#bBhQBkP#g#h+rQBsP#]Q!Q![BvQByQ!Q![Bv#a#bCPQCSP#g#h+rQC[P#]Q!Q![C_QCbT!Q![C_#W#XCq#[#]Gz#a#bI}#g#hKTQCvP#]Q!Q![CyQC|S!Q![Cy#[#]DY#a#bF]#g#hGcQD_P#]Q!Q![DbQDeR!Q![Db#a#bDn#g#hEtQDsQ#]Q!Q![Dy#g#h+rQD|R!Q![Dy#a#bEV#g#hE]QEYP#g#h+rQEbP#]Q!Q![EeQEhQ!Q![Ee#a#bEnQEqP#g#h+rQEyP#]Q!Q![E|QFPQ!Q![E|#a#bFVQFYP#g#h+rQFbQ#]Q!Q![Fh#g#h+rQFkR!Q![Fh#a#bFt#g#hFzQFwP#g#h+rQGPP#]Q!Q![GSQGVQ!Q![GS#a#bG]QG`P#g#h+rQGhP#]Q!Q![GkQGnQ!Q![Gk#a#bGtQGwP#g#h+rQHPP#]Q!Q![HSQHVR!Q![HS#a#bH`#g#hIfQHeQ#]Q!Q![Hk#g#h+rQHnR!Q![Hk#a#bHw#g#hH}QHzP#g#h+rQISP#]Q!Q![IVQIYQ!Q![IV#a#bI`QIcP#g#h+rQIkP#]Q!Q![InQIqQ!Q![In#a#bIwQIzP#g#h+rQJSQ#]Q!Q![JY#g#h+rQJ]R!Q![JY#a#bJf#g#hJlQJiP#g#h+rQJqP#]Q!Q![JtQJwQ!Q![Jt#a#bJ}QKQP#g#h+rQKYP#]Q!Q![K]QK`Q!Q![K]#a#bKfQKiP#g#h+rPKoR!Q![Kx!c!iKx#T#ZKxPK}R#^P!Q![Kx!c!iKx#T#ZKxVL_T$wS!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLnRLsT!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLn~MXP!U~!_!`M[~MaO!T~~MfQ#kP!_!`Ml#r#sMqQMqO!QQ~MvO#l~~M{P!S~!_!`NO~NTO!R~VN[T!ZRqS!Q![NT![!]Ln!c!}NT#R#SNT#T#oNT~NpO$u~~NuO$v~~NzOu~~N}RO#SNz#S#T%Y#T~Nz~! ]O$z~~! bO${~",tokenizers:[0,1,2],topRules:{"@top":[0,25]},specialized:[{term:57,get:function(e,t){return function(e,t){return T[e.toLowerCase()]||-1}(e)<<1}},{term:57,get:function(e,t){return function(e,t){return P[e.toLowerCase()]||-1}(e)<<1|1}},{term:57,get:function(e){return _[e]||-1}}],tokenPrec:0}),A=26,R=36,L=38,N=39,z=104,I=107,F=109,$=113,B=117,Q=119,W=n(100),H=n(17),V=n(25);function U(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=n.length){var o=e.resolve(a,-1);if(o.type.id===t.id&&o.start===r&&o.end===a)return o;for(o=e.resolve(r,1);o&&(o.type.id!==t.id||o.start!==r||o.end!==a);)o=o.parent;return o}}})}function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"and"},{label:"or"},{label:"unless"}],Z=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate \u03c6-quantile (0 \u2264 \u03c6 \u2264 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],J=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:Object(K.c)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:Object(K.c)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:Object(K.c)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')}],ee={matchOp:[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],binOp:G,duration:[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],binOpModifier:[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],functionIdentifier:[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from histogram buckets",type:"function"},{label:"holt_winters",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variation within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],aggregateOp:Z,aggregateOpModifier:[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}]};function te(e,t){var n=function(e,t){for(var n=e;n&&n.type.id!==t;)n=n.parent;return n}(e,$);return n&&(n=U(n,114,57))?t.sliceDoc(n.start,n.end):""}function ne(e,t){var n,r,i,a,o,s,l,c,u,f,d,h,p,v,m,g,b,y=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===I){y.push({kind:X.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===z){y.push({kind:X.Duration});break}var O=e.sliceDoc(t.start,t.end);G.filter((function(e){return e.label.includes(O)})).length>0&&y.push({kind:X.BinOp});break;case 57:if(0===(null===(i=t.parent)||void 0===i?void 0:i.type.id)){if(27===(null===(a=t.parent.parent)||void 0===a?void 0:a.type.id)){y.push({kind:X.AggregateOpModifier},{kind:X.BinOp});break}if((null===(o=t.parent.parent)||void 0===o?void 0:o.type.id)===$){var k=te(t,e);Z.filter((function(e){return e.label===k})).length>0&&y.push({kind:X.AggregateOpModifier}),y.push({kind:X.BinOp},{kind:X.Offset});break}}var x=null===(c=null===(l=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===l?void 0:l.parent)||void 0===c?void 0:c.parent;if(!x){y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break}(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&i++;var a=0,o=e.iterate({enter:function(t){if(t.id!==e.type.id||0!==i)return(t.id===n[a]||t.name===n[a])&&++a>=n.length;i++}});return void 0!==o&&o})(x,A,A)?x.type.id!==R||q(x,0)?(x.type.id!==R||x.type.id===R&&q(x,0))&&y.push({kind:X.BinOp},{kind:X.Offset}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation},{kind:X.BinOpModifier}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 30:y.push({kind:X.LabelName});break;case 115:y.push({kind:X.LabelName,metricName:te(t,e)});break;case 33:32===(null===(u=t.parent)||void 0===u?void 0:u.type.id)?y.push({kind:X.LabelName}):(null===(f=t.parent)||void 0===f?void 0:f.type.id)===B&&y.push({kind:X.LabelName,metricName:te(t,e)});break;case B:33===(null===(d=t.firstChild)||void 0===d?void 0:d.type.id)&&0===(null===(h=t.lastChild)||void 0===h?void 0:h.type.id)&&null===(null===(p=t.lastChild)||void 0===p?void 0:p.firstChild)&&y.push({kind:X.MatchOp});break;case F:if((null===(v=t.parent)||void 0===v?void 0:v.type.id)===B){var w="";33===(null===(m=t.parent.firstChild)||void 0===m?void 0:m.type.id)&&(w=e.sliceDoc(t.parent.firstChild.start,t.parent.firstChild.end));var j=te(t,e);y.push({kind:X.LabelValue,metricName:j,labelName:w})}break;case 105:case I:y.push({kind:X.Duration});break;case 34:y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 53:118===(null===(g=t.parent)||void 0===g?void 0:g.type.id)?y.push({kind:X.MatchOp}):(null===(b=t.parent)||void 0===b?void 0:b.type.id)===R&&y.push({kind:X.BinOp});break;case Q:case 120:case 121:case 118:y.push({kind:X.MatchOp});break;case 37:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 21:case 23:case 22:case R:y.push({kind:X.BinOp})}return y}!function(e){e[e.MetricName=0]="MetricName",e[e.LabelName=1]="LabelName",e[e.LabelValue=2]="LabelValue",e[e.Function=3]="Function",e[e.Aggregation=4]="Aggregation",e[e.BinOpModifier=5]="BinOpModifier",e[e.BinOp=6]="BinOp",e[e.MatchOp=7]="MatchOp",e[e.AggregateOpModifier=8]="AggregateOpModifier",e[e.Duration=9]="Duration",e[e.Offset=10]="Offset"}(X||(X={}));var re=function(){function e(t){Object(r.a)(this,e),this.prometheusClient=t}return Object(i.a)(e,[{key:"promQL",value:function(e){var t,n=this,r=e.state,i=e.pos,o=r.tree.resolve(i,-1),s=ne(r,o),l=Promise.resolve([]),c=!1,u=!0,f=Object(a.a)(s);try{var d=function(){var e=t.value;switch(e.kind){case X.Aggregation:l=l.then((function(e){return e.concat(ee.aggregateOp)}));break;case X.Function:l=l.then((function(e){return e.concat(ee.functionIdentifier)}));break;case X.BinOpModifier:l=l.then((function(e){return e.concat(ee.binOpModifier)}));break;case X.BinOp:l=l.then((function(e){return e.concat(ee.binOp)}));break;case X.MatchOp:l=l.then((function(e){return e.concat(ee.matchOp)}));break;case X.AggregateOpModifier:l=l.then((function(e){return e.concat(ee.aggregateOpModifier)}));break;case X.Duration:u=!1,l=l.then((function(e){return e.concat(ee.duration)}));break;case X.Offset:l=l.then((function(e){return e.concat([{label:"offset"}])}));break;case X.MetricName:l=l.then((function(e){return c=!0,n.autocompleteMetricName(e)}));break;case X.LabelName:l=l.then((function(t){return n.autocompleteLabelName(t,e.metricName)}));break;case X.LabelValue:l=l.then((function(t){return n.autocompleteLabelValue(t,e.labelName,e.metricName)}))}};for(f.s();!(t=f.n()).done;)d()}catch(h){f.e(h)}finally{f.f()}return l.then((function(e){return function(e,t,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=e;return arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&i.push.apply(i,Object(V.a)(J)),{from:t,to:n,options:i,span:r?/^[a-zA-Z0-9_:]+$/:void 0}}(e,function(e,t){var n,r,i,a,o,s,l=e.start;return 30===e.type.id||115===e.type.id||34===e.type.id||e.type.id===F&&(null===(n=e.parent)||void 0===n?void 0:n.type.id)===B?l++:e.type.id===B&&33===(null===(r=e.firstChild)||void 0===r?void 0:r.type.id)&&0===(null===(i=e.lastChild)||void 0===i?void 0:i.type.id)&&null===(null===(a=e.lastChild)||void 0===a?void 0:a.firstChild)?l=e.lastChild.start:e.type.id!==I&&(0!==e.type.id||(null===(o=e.parent)||void 0===o?void 0:o.type.id)!==I&&(null===(s=e.parent)||void 0===s?void 0:s.type.id)!==z)||(l=t),l}(o,i),i,c,u)}))}},{key:"autocompleteMetricName",value:function(e){var t=this;if(!this.prometheusClient)return e;var n=new Map;return this.prometheusClient.labelValues("__name__").then((function(e){var r,i,o=Object(a.a)(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;n.set(s,{label:s,type:"constant"})}}catch(l){o.e(l)}finally{o.f()}if(e.length<=1e4)return null===(r=t.prometheusClient)||void 0===r?void 0:r.metricMetadata()})).then((function(t){if(t){var r,i=Object(a.a)(n);try{for(i.s();!(r=i.n()).done;){var o=Object(H.a)(r.value,2),s=o[0],l=o[1],c=t.get(s.replace(/(_count|_sum|_bucket)$/,""));if(c)if(c.length>1){var u,f=Object(a.a)(c);try{for(f.s();!(u=f.n()).done;){var d=u.value;""===l.detail?l.detail=d.type:l.detail!==d.type&&(l.detail="unknown",l.info="multiple different definitions for this metric"),""===l.info?l.info=d.help:l.info!==d.help&&(l.info="multiple different definitions for this metric")}}catch(m){f.e(m)}finally{f.f()}}else if(1===c.length){var h=c[0],p=h.type,v=h.help;"histogram"!==p&&"summary"!==p||(s.endsWith("_count")&&(p="counter",v="The total number of observations for: ".concat(v)),s.endsWith("_sum")&&(p="counter",v="The total sum of observations for: ".concat(v)),s.endsWith("_bucket")&&(p="counter",v="The total count of observations for a bucket in the histogram: ".concat(v))),l.detail=p,l.info=v}}}catch(m){i.e(m)}finally{i.f()}}return e.concat(Array.from(n.values()))}))}},{key:"autocompleteLabelName",value:function(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"constant"}})))})):e}},{key:"autocompleteLabelValue",value:function(e,t,n){return this.prometheusClient&&t?this.prometheusClient.labelValues(t,n).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"text"}})))})):e}}]),e}(),ie="/api/v1/label/:name/values",ae=function(){function e(){Object(r.a)(this,e),this.completeAssociation=new Map,this.metricMetadata=new Map,this.labelValues=new Map,this.labelNames=[]}return Object(i.a)(e,[{key:"setAssociation",value:function(e,t){var n=this.completeAssociation.get(e);n||(n=new Map,this.completeAssociation.set(e,n));for(var r=0,i=Object.entries(t);r0)return Promise.resolve(this.cache.getLabelNames(e));var n=new Date,r=new Date(n.getTime()-this.lookbackInterval);if(void 0===e||""===e){var i=new URLSearchParams({start:r.toISOString(),end:n.toISOString()});return this.fetchAPI("".concat("/api/v1/labels","?").concat(i)).then((function(e){return t.cache.setLabelNames(e),e})).catch((function(e){return t.errorHandler&&t.errorHandler(e),[]}))}return this.series(e,r,n).then((function(n){return t.cache.getLabelNames(e)}))}},{key:"labelValues",value:function(e,t){var n=this;if(this.cache.getLabelValues(e,t)&&this.cache.getLabelValues(e,t).length>0)return Promise.resolve(this.cache.getLabelValues(e,t));var r=new Date,i=new Date(r.getTime()-this.lookbackInterval);if(!t||0===t.length){var a=new URLSearchParams({start:i.toISOString(),end:r.toISOString()});return this.fetchAPI("".concat(ie.replace(/:name/gi,e),"?").concat(a)).then((function(t){return n.cache.setLabelValues(e,t),t})).catch((function(e){return n.errorHandler&&n.errorHandler(e),[]}))}return this.series(t,i,r).then((function(r){return n.cache.getLabelValues(e,t)}))}},{key:"metricMetadata",value:function(){var e=this;return this.cache.getMetricMetadata()&&this.cache.getMetricMetadata().size>0?Promise.resolve(this.cache.getMetricMetadata()):this.fetchAPI("/api/v1/metadata").then((function(t){for(var n=0,r=Object.entries(t);n0){var s,l=Object(a.a)(o);try{for(l.s();!(s=l.n()).done;){var c=s.value;n.matchingLabels.push(e.sliceDoc(c.start,c.end))}}catch(m){l.e(m)}finally{l.f()}}}var u=U(t,L,N,4),f=U(t,L,N,5);if(u||f){n.card=u?pe.CardManyToOne:pe.CardOneToMany;var d=Y(U(t,L,N,42,30),31,32);if(d.length>0){var h,p=Object(a.a)(d);try{for(p.s();!(h=p.n()).done;){var v=h.value;n.include.push(e.sliceDoc(v.start,v.end))}}catch(m){p.e(m)}finally{p.f()}}}return q(t,21,22,23)&&n.card===pe.CardOneToOne&&(n.card=pe.CardManyToMany),n}(this.state,e);if(null!==c&&c.on){var u,f=Object(a.a)(c.matchingLabels);try{for(f.s();!(u=f.n()).done;){var d,h=u.value,p=Object(a.a)(c.include);try{for(p.s();!(d=p.n()).done;){h===d.value&&this.addDiagnostic(e,'label "'.concat(h,'" must not occur in ON and GROUP clause at once'))}}catch(v){p.e(v)}finally{p.f()}}}catch(v){f.e(v)}finally{f.f()}}r!==de.scalar&&r!==de.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),i!==de.scalar&&i!==de.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),r===de.vector&&i===de.vector||null===c?l&&((null===c||void 0===c?void 0:c.card)!==pe.CardOneToMany&&(null===c||void 0===c?void 0:c.card)!==pe.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===c||void 0===c?void 0:c.card)!==pe.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")):c.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"),r!==de.scalar&&i!==de.scalar||!l||this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}else this.addDiagnostic(e,"left or right expression is missing in binary expression")}},{key:"checkCallFunction",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=Y(U(e,34),35,A),i=me(n.type.id),a=i.argTypes.length;if(0===i.variadic)r.length!==a&&this.addDiagnostic(e,"expected ".concat(a," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var o=a-1;if(o>r.length)this.addDiagnostic(e,"expected at least ".concat(o," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var s=o+i.variadic;i.variadic>0&&s=i.argTypes.length){if(0===i.variadic)break;l=i.argTypes.length-1}this.expectType(r[c],i.argTypes[l],"call to function ".concat(i.name))}}else this.addDiagnostic(e,"function not defined")}},{key:"checkVectorSelector",value:function(e){var t=ye(Y(U(e,115,116),116,B),this.state),n="",r=U(e,114,57);if(r&&(n=this.state.sliceDoc(r.start,r.end)),""!==n){var i=t.find((function(e){return"__name__"===e.name}));i&&this.addDiagnostic(e,"metric name must not be set twice: ".concat(n," or ").concat(i.value)),t.push(new be(Q,"__name__",n))}t.every((function(e){return e.matchesEmpty()}))&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}},{key:"expectType",value:function(e,t,n){var r=this.checkAST(e);r!==t&&this.addDiagnostic(e,"expected type ".concat(t," in ").concat(n,", got ").concat(r))}},{key:"addDiagnostic",value:function(e,t){this.diagnostics.push({severity:"error",message:t,from:e.start,to:e.end})}}]),e}(),ke=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,[{key:"promQL",value:function(){return function(e){var t=new Oe(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();var xe=O.define(D.withProps(Object(W.b)({LineComment:"comment",LabelName:"labelName",StringLiteral:"string",NumberLiteral:"number",Duration:"number","Abs Absent AbsentOverTime AvgOverTime Ceil Changes ClampMax ClampMin CountOverTime DaysInMonth DayOfMonth DayOfWeek Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin Ln Log10 Log2 MaxOverTime MinOverTime Minute Month PredictLinear QuantileOverTime Rate Resets Round Scalar Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Time Timestamp Vector Year":"functionName","Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":"operatorKeyword","By Without Bool On Ignoring GroupLeft GroupRight Offset":"modifier","And Unless Or":"logicOperator","Sub Add Mul Mod Div Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow":"operator",UnaryOp:"arithmeticOperator","( )":"paren","[ ]":"squareBracket","{ }":"brace","\u26a0":"invalid"})),{languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}),we=function(){function e(){Object(r.a)(this,e),this.complete=ue(),this.lint=new ke,this.enableLinter=!0,this.enableCompletion=!0}return Object(i.a)(e,[{key:"setComplete",value:function(e){return this.complete=ue(e),this}},{key:"activateCompletion",value:function(e){return this.enableCompletion=e,this}},{key:"activateLinter",value:function(e){return this.enableLinter=e,this}},{key:"asExtension",value:function(){var e,t,n=this,r=[xe];if(this.enableCompletion){var i=xe.languageData.of({autocomplete:function(e){return n.complete.promQL(e)}});r=r.concat(i)}return this.enableLinter&&(r=r.concat((e=this.lint.promQL,t=this.lint,Object(he.b)(e.call(t))))),r}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return Tt}));var r=n(25),i=n(10),a=n(5),o=n(7),s=n(4),l=n(6),c=a.a.define(),u=a.a.define(),f=a.f.define(),d=a.f.define({combine:function(e){return Object(a.m)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),h=a.j.define({create:function(){return E.empty},update:function(e,t){var n=t.state.facet(d),r=t.annotation(c);if(r){var i=O.fromTransaction(t),o=r.side,s=0==o?e.undone:e.done;return s=i?k(s,s.length,n.minDepth,i):j(s,t.startState.selection),new E(0==o?r.rest:s,0==o?s:r.rest)}var l=t.annotation(u);if("full"!=l&&"before"!=l||(e=e.isolate()),!1===t.annotation(a.l.addToHistory))return t.changes.length?e.addMapping(t.changes.desc):e;var f=O.fromTransaction(t),h=t.annotation(a.l.time),p=t.annotation(a.l.userEvent);return f?e=e.addChanges(f,h,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,h,p,n.newGroupDelay)),"full"!=l&&"after"!=l||(e=e.isolate()),e}});function p(e,t){return function(n){var r=n.state,i=n.dispatch,a=r.field(h,!1);if(!a)return!1;var o=a.pop(e,r,t);return!!o&&(i(o),!0)}}var v=p(0,!1),m=p(1,!1),g=p(0,!0),b=p(1,!0);function y(e){return function(t){var n=t.field(h,!1);if(!n)return 0;var r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}y(0),y(1);var O=function(){function e(t,n,r,i,a){Object(s.a)(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=a}return Object(l.a)(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}}],[{key:"fromTransaction",value:function(t){var n,r=w,i=Object(o.a)(t.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var a=(0,n.value)(t);a.length&&(r=r.concat(a))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,t.startState.selection,w)}},{key:"selection",value:function(t){return new e(void 0,w,void 0,void 0,t)}}]),e}();function k(e,t,n,r){var i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function x(e,t){return e.length?t.length?e.concat(t):e:t}var w=[];function j(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),k(e,e.length-1,1e9,n.setSelAfter(r)))}return[O.selection([t])]}function S(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function C(e,t){if(!e.length)return e;for(var n=e.length,r=w;n;){var i=M(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var a=e.slice(0,n);return a[n-1]=i,a}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[O.selection(r)]:w}function M(e,t,n){var r=x(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):w,n);if(!e.changes)return O.selection(r);var i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new O(i,a.i.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}var E=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;Object(s.a)(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Object(l.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,a){var o=this.done,s=o[o.length-1];return new e(o=s&&s.changes&&n-this.prevTime=s&&i<=l&&(r=!0)}})),r}(s.changes,t.changes)?k(o,o.length-1,a,new O(t.changes.compose(s.changes),x(t.effects,s.effects),s.mapped,s.startSelection,w)):k(o,o.length,a,t),w,n,r)}},{key:"addSelection",value:function(t,n,r,i){var a,o,s=this.done.length?this.done[this.done.length-1].selectionsAfter:w;return s.length>0&&n-this.prevTimethis.i;)e.dom.removeChild(e.elements.pop().dom)}}]),e}(),Q=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className=Object(i.n)("gutter"+(this.config.style?"."+this.config.style:"")),this.elementClass=Object(i.n)("gutterElement"+(this.config.style?"."+this.config.style:""));var a=function(e){r.dom.addEventListener(e,(function(r){var i=t.visualLineAtHeight(r.clientY,t.contentDOM.getBoundingClientRect().top);n.domEventHandlers[e](t,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)a(o);this.markers=n.markers(t.state),n.initialSpacer&&(this.spacer=new W(t,0,0,[n.initialSpacer(t)],this.elementClass),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Object(l.a)(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=this.config.markers(e.state),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n],this.elementClass)}return this.markers!=t}}]),e}(),W=function(){function e(t,n,r,i,a){Object(s.a)(this,e),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,n,r,i,a)}return Object(l.a)(e,[{key:"update",value:function(e,t,n,r,i){if(this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var a;a=this.dom.lastChild;)a.remove();var s,l=i,c=Object(o.a)(r);try{for(c.s();!(s=c.n()).done;){var u=s.value,f=u.toDOM(e);f&&this.dom.appendChild(f);var d=u.elementClass;d&&(l+=" "+d)}}catch(h){c.e(h)}finally{c.f()}this.dom.className=l}}}]),e}();var H=a.f.define(),V=a.f.define({combine:function(e){return Object(a.m)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(e,t){var n=Object.assign({},e),r=function(e){var r=n[e],i=t[e];n[e]=r?function(e,t,n){return r(e,t,n)||i(e,t,n)}:i};for(var i in t)r(i);return n}})}}),U=function(e){Object(P.a)(n,e);var t=Object(_.a)(n);function n(e){var r;return Object(s.a)(this,n),(r=t.call(this)).number=e,r}return Object(l.a)(n,[{key:"eq",value:function(e){return this.number==e.number}},{key:"toDOM",value:function(e){var t=e.state.facet(V);return document.createTextNode(t.formatNumber(this.number))}}]),n}(A),q=N({style:"lineNumber",markers:function(e){return e.facet(H)},lineMarker:function(e,t,n){return n.length?null:new U(e.state.doc.lineAt(t.from).number)},initialSpacer:function(e){return new U(Y(e.state.doc.lines))},updateSpacer:function(e,t){var n=Y(t.view.state.doc.lines);return n==e.number?e:new U(n)}});function Y(e){for(var t=9;t=r?void 0:{from:n,to:r}}var K=a.i.define({map:X}),G=a.i.define({map:X});function Z(e){var t,n=[],r=Object(o.a)(e.state.selection.ranges);try{var i=function(){var r=t.value.head;if(n.some((function(e){return e.from<=r&&e.to>=r})))return"continue";n.push(e.visualLineAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(a){r.e(a)}finally{r.f()}return n}var J=a.j.define({create:function(){return i.b.none},update:function(e,t){e=e.map(t.changes);var n,r=Object(o.a)(t.effects);try{var i=function(){var t=n.value;t.is(K)&&!function(e,t,n){var r=!1;return e.between(t,t,(function(e,i){e==t&&i==n&&(r=!0)})),r}(e,t.value.from,t.value.to)?e=e.update({add:[se.range(t.value.from,t.value.to)]}):t.is(G)&&(e=e.update({filter:function(e,n){return t.value.from!=e||t.value.to!=n},filterFrom:t.value.from,filterTo:t.value.to}))};for(r.s();!(n=r.n()).done;)i()}catch(l){r.e(l)}finally{r.f()}if(t.selection){var a=!1,s=t.selection.primary.head;e.between(s,s,(function(e,t){es&&(a=!0)})),a&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:[i.d.decorations]});function ee(e,t,n){var r,i=null;return null===(r=e.field(J,!1))||void 0===r||r.between(t,n,(function(e,t){(!i||i.from>e)&&(i={from:e,to:t})})),i}function te(e,t,n){return e.facet(a.e.foldable).reduce((function(r,i){return r||i(e,t,n)}),null)}function ne(e){return e.field(J,!1)?void 0:{append:oe()}}var re=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=Object(o.a)(Z(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=te(e.state,r.from,r.to);if(i)return e.dispatch({effects:K.of(i),reconfigure:ne(e.state)}),!0}}catch(a){n.e(a)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(J,!1))return!1;var t,n=[],r=Object(o.a)(Z(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=ee(e.state,i.from,i.to);a&&n.push(G.of(a))}}catch(s){r.e(s)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r"};var ve="()[]{}<>";function me(e){for(var t=0;t2||2==r.length&&1==Object(he.c)(Object(he.b)(r,0))||t!=i.from||n!=i.to)return!1;var a=function(e,t){var n,r=ge(e,e.selection.primary.head),i=r.brackets||pe.brackets,a=Object(o.a)(i);try{for(a.s();!(n=a.n()).done;){var s=n.value,l=me(Object(he.b)(s,0));if(t==s)return l==s?we(e,s,i.indexOf(s+s+s)>-1):ke(e,s,l,r.before||pe.before);if(t==l)return xe(e,s,l)}}catch(c){a.e(c)}finally{a.f()}return null}(e.state,r);return!!a&&(e.dispatch(a),!0)}var ye=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch,r=ge(t,t.selection.primary.head).brackets||pe.brackets,i=null,s=t.changeByRange((function(e){if(e.empty){var n,s=function(e,t){var n=e.sliceString(t-2,t);return Object(he.c)(Object(he.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),l=Object(o.a)(r);try{for(l.s();!(n=l.n()).done;){var c=n.value;if(c==s&&Oe(t.doc,e.head)==me(Object(he.b)(c,0)))return{changes:{from:e.head-c.length,to:e.head+c.length},range:a.d.cursor(e.head-c.length),annotations:a.l.userEvent.of("delete")}}}catch(u){l.e(u)}finally{l.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function Oe(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(he.c)(Object(he.b)(n,0)))}function ke(e,t,n,r){var i=null,o=e.changeByRange((function(o){if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],range:a.d.range(o.anchor+t.length,o.head+t.length)};var s=Oe(e.doc,o.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},range:a.d.cursor(o.head+t.length)}:{range:i=o}}));return i?null:e.update(o,{scrollIntoView:!0,annotations:a.l.userEvent.of("input")})}function xe(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&Oe(e.doc,t.head)==n?a.d.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:a.d.create(i,e.selection.primaryIndex),scrollIntoView:!0})}function we(e,t,n){var r=null,i=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],range:a.d.range(i.anchor+t.length,i.head+t.length)};var o=i.head,s=Oe(e.doc,o);if(s==t){if(je(e,o))return{changes:{insert:t+t,from:o},range:a.d.cursor(o+t.length)};var l=n&&e.sliceDoc(o,o+3*t.length)==t+t+t;return{range:a.d.cursor(o+t.length*(l?3:1))}}if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&je(e,o-2*t.length))return{changes:{insert:t+t+t+t,from:o},range:a.d.cursor(o+t.length)};if(e.charCategorizer(o)(s)!=a.c.Word){var c=e.sliceDoc(o-1,o);if(c!=t&&e.charCategorizer(o)(c)!=a.c.Word)return{changes:{insert:t+t,from:o},range:a.d.cursor(o+t.length)}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,annotations:a.l.userEvent.of("input")})}function je(e,t){var n=e.tree.resolve(t+1);return n.parent&&n.start==t}var Se=n(35),Ce="function"==typeof String.prototype.normalize?function(e){return e.normalize("NFKD")}:function(e){return e},Me=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,a=arguments.length>4?arguments[4]:void 0;Object(s.a)(this,e),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=a?function(e){return a(Ce(e))}:Ce,this.query=this.normalize(n)}return Object(l.a)(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=String.fromCharCode(e),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,t+=String.fromCharCode(r)}for(var i=this.normalize(t),a=0,o=n;;a++){var s=i.charCodeAt(a),l=this.match(s,o);if(l)return this.value=l,this;if(a==i.length-1)break;o==n&&a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Me(e,this.search,t,n,this.caseInsensitive?function(e){return e.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),e}(),Te=a.i.define(),Pe=a.i.define(),_e=a.j.define({create:function(){return new De(new Ee("","",!1),[])},update:function(e,t){var n,r=Object(o.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Te)?e=new De(i.value,e.panel):i.is(Pe)&&(e=new De(e.query,i.value?[He]:[]))}}catch(a){r.e(a)}finally{r.f()}return e},provide:[Se.c.nFrom((function(e){return e.panel}))]}),De=function e(t,n){Object(s.a)(this,e),this.query=t,this.panel=n},Ae=i.b.mark({class:Object(i.n)("searchMatch")}),Re=i.b.mark({class:Object(i.n)("searchMatch.selected")}),Le=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.decorations=this.highlight(t.state.field(_e))}return Object(l.a)(e,[{key:"update",value:function(e){var t=e.state.field(_e);(t!=e.prevState.field(_e)||e.docChanged||e.selectionSet)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel.length||!t.valid)return i.b.none;for(var n=this.view.state,r=this.view.viewport,a=t.cursor(n.doc,Math.max(0,r.from-t.search.length),Math.min(r.to+t.search.length,n.doc.length)),o=new D.c,s=function(){var e=a.value,t=e.from,r=e.to,i=n.selection.ranges.some((function(e){return e.from==t&&e.to==r}));o.add(t,r,i?Re:Ae)};!a.next().done;)s();return o.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function Ne(e){return function(t){var n=t.state.field(_e,!1);return n&&n.query.valid?e(t,n):Ve(t)}}function ze(e,t,n){var r=n.cursor(e,t).next();return r.done&&(r=n.cursor(e,0,t+n.search.length-1).next()).done?null:r.value}var Ie=Ne((function(e,t){var n=e.state.selection.primary,r=n.from,i=n.to,a=ze(e.state.doc,e.state.selection.primary.from+1,t.query);return!(!a||a.from==r&&a.to==i)&&(e.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0}),Ge(e),!0)}));function Fe(e,t,n,r){for(var i=r;;){for(var a=Math.max(n,i-1e4-e.search.length),o=e.cursor(t,a,i),s=null;!o.next().done;)s=o.value;if(s)return s;if(a==n)return null;i-=1e4}}var $e=Ne((function(e,t){var n=t.query,r=e.state,i=Fe(n,r.doc,0,r.selection.primary.to-1)||Fe(n,r.doc,r.selection.primary.from+1,r.doc.length);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),Ge(e),!0)})),Be=Ne((function(e,t){for(var n=t.query.cursor(e.state.doc),r=[];!n.next().done;)r.push(a.d.range(n.value.from,n.value.to));return!!r.length&&(e.dispatch({selection:a.d.create(r)}),!0)})),Qe=Ne((function(e,t){var n=t.query,r=e.state,i=ze(r.doc,r.selection.primary.from,n);if(!i)return!1;var a,o=r.selection.primary,s=o.from,l=o.to,c=[];if(i.from==s&&i.to==l&&(c.push({from:i.from,to:i.to,insert:n.replace}),i=ze(r.doc,i.to,n)),i){var u=0==c.length||c[0].from>=i.to?0:i.to-i.from-n.replace.length;a={anchor:i.from-u,head:i.to-u}}return e.dispatch({changes:c,selection:a,scrollIntoView:!!a}),i&&Ge(e),!0})),We=Ne((function(e,t){for(var n=t.query,r=n.cursor(e.state.doc),i=[];!r.next().done;){var a=r.value,o=a.from,s=a.to;i.push({from:o,to:s,insert:n.replace})}return!!i.length&&(e.dispatch({changes:i}),!0)}));function He(e){var t=e.state.field(_e).query;return{dom:Xe({view:e,query:t,updateQuery:function(n){t.eq(n)||(t=n,e.dispatch({effects:Te.of(t)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,style:"search"}}var Ve=function(e){var t=e.state.field(_e,!1);if(t&&t.panel.length){var n=Object(Se.a)(e,He);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else e.dispatch({effects:Pe.of(!0),reconfigure:t?void 0:{append:et}});return!0},Ue=function(e){var t=e.state.field(_e,!1);if(!t||!t.panel.length)return!1;var n=Object(Se.a)(e,He);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Pe.of(!1)}),!0},qe=[{key:"Mod-f",run:Ve,scope:"editor search-panel"},{key:"F3",run:Ie,shift:$e,scope:"editor search-panel"},{key:"Mod-g",run:Ie,shift:$e,scope:"editor search-panel"},{key:"Escape",run:Ue,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.primary.empty)return!1;for(var i=r.primary,o=i.from,s=i.to,l=[],c=0,u=new Me(t.doc,t.sliceDoc(o,s));!u.next().done;){if(l.length>1e3)return!1;u.value.from==o&&(c=l.length),l.push(a.d.range(u.value.from,u.value.to))}return n(t.update({selection:new a.d(l,c)})),!0}}];function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=document.createElement(e);if(t)for(var i in t){var a=t[i];"string"==typeof a?r.setAttribute(i,a):r[i]=a}var s,l=Object(o.a)(n);try{for(l.s();!(s=l.n()).done;){var c=s.value;r.appendChild("string"==typeof c?document.createTextNode(c):c)}}catch(u){l.e(u)}finally{l.f()}return r}function Xe(e){function t(t){return e.view.state.phrase(t)}var n=Ye("input",{value:e.query.search,placeholder:t("Find"),"aria-label":t("Find"),class:Object(i.n)("textfield"),name:"search",onchange:o,onkeyup:o}),r=Ye("input",{value:e.query.replace,placeholder:t("Replace"),"aria-label":t("Replace"),class:Object(i.n)("textfield"),name:"replace",onchange:o,onkeyup:o}),a=Ye("input",{type:"checkbox",name:"case",checked:!e.query.caseInsensitive,onchange:o});function o(){e.updateQuery(new Ee(n.value,r.value,!a.checked))}function s(e,t,n){return Ye("button",{class:Object(i.n)("button"),name:e,onclick:t},n)}return Ye("div",{onkeydown:function(t){Object(i.m)(e.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==n?(t.preventDefault(),(t.shiftKey?$e:Ie)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),Qe(e.view))}},[n,s("next",(function(){return Ie(e.view)}),[t("next")]),s("prev",(function(){return $e(e.view)}),[t("previous")]),s("select",(function(){return Be(e.view)}),[t("all")]),Ye("label",null,[a,"match case"]),Ye("br"),r,s("replace",(function(){return Qe(e.view)}),[t("replace")]),s("replaceAll",(function(){return We(e.view)}),[t("replace all")]),Ye("button",{name:"close",onclick:function(){return Ue(e.view)},"aria-label":t("close")},["\xd7"]),Ye("div",{style:"position: absolute; top: -10000px","aria-live":"polite"})])}var Ke=/[\s\.,:;?!]/;function Ge(e){var t=e.state.selection.primary,n=t.from,r=t.to,i=e.state.doc.lineAt(n).from,a=e.state.doc.lineAt(r).to,o=Math.max(i,n-30),s=Math.min(a,r+30),l=e.state.sliceDoc(o,s);if(o!=i)for(var c=0;c<30;c++)if(!Ke.test(l[c+1])&&Ke.test(l[c])){l=l.slice(c);break}if(s!=a)for(var u=l.length-1;u>l.length-30;u--)if(!Ke.test(l[u-1])&&Ke.test(l[u])){l=l.slice(0,u);break}var f=Object(Se.a)(e,He);f&&f.dom.contains(e.root.activeElement)&&(f.dom.querySelector("div[aria-live]").textContent=e.state.phrase("current match")+". "+l)}var Ze,Je=i.d.baseTheme({"$panel.search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"$$light $searchMatch":{backgroundColor:"#ffff0054"},"$$dark $searchMatch":{backgroundColor:"#00ffff8a"},"$$light $searchMatch.selected":{backgroundColor:"#ff6a0054"},"$$dark $searchMatch.selected":{backgroundColor:"#ff00ff8a"}}),et=[_e,Object(a.o)(Le,"override"),Object(Se.b)(),Je],tt=n(72),nt=[{key:"Mod-/",run:function(e){return rt(ot(Ze.Toggle),e)}},{key:"Alt-A",run:function(e){return rt(at(Ze.Toggle),e)}}];function rt(e,t){var n=e(t.state);return!!n&&(t.dispatch(n),!0)}function it(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.primary.head;return e.languageDataAt("commentTokens",t)[0]||{}}!function(e){e[e.Toggle=0]="Toggle",e[e.OnlyComment=1]="OnlyComment",e[e.OnlyUncomment=2]="OnlyUncomment"}(Ze||(Ze={}));var at=function(e){return function(t){var n=it(t);return n.block?new st(n.block.open,n.block.close).toggle(e,t):null}},ot=function(e){return function(t){var n=it(t);return n.line?new ct(n.line).toggle(e,t):null}},st=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";Object(s.a)(this,e),this.open=t,this.close=n,this.margin=r}return Object(l.a)(e,[{key:"toggle",value:function(e,t){var n=this,r=this.isSelectionCommented(t);if(null!==r){if(e!==Ze.OnlyComment)return t.update({changes:r.map((function(e){var t=e.open,r=e.close;return[{from:t.pos-n.open.length,to:t.pos+t.margin},{from:r.pos-r.margin,to:r.pos+n.close.length}]}))})}else if(e!==Ze.OnlyUncomment)return t.update(t.changeByRange((function(e){var t=(n.open+n.margin).length;return{changes:[{from:e.from,insert:n.open+n.margin},{from:e.to,insert:n.margin+n.close}],range:a.d.range(e.anchor+t,e.head+t)}})));return null}},{key:"isSelectionCommented",value:function(e){var t,n=[],r=Object(o.a)(e.selection.ranges);try{for(r.s();!(t=r.n()).done;){var i=t.value,a=this.isRangeCommented(e,i);if(null===a)return null;n.push(a)}}catch(s){r.e(s)}finally{r.f()}return n}},{key:"isRangeCommented",value:function(e,t){var n,r,i=e.sliceDoc(t.from-lt,t.from),a=e.sliceDoc(t.to,t.to+lt),o=/\s*$/.exec(i)[0].length,s=/^\s*/.exec(a)[0].length,l=i.length-o;if(i.slice(l-this.open.length,l)==this.open&&a.slice(s,s+this.close.length)==this.close)return{open:{pos:t.from-o,margin:o&&1},close:{pos:t.to+s,margin:s&&1}};t.to-t.from<=2*lt?n=r=e.sliceDoc(t.from,t.to):(n=e.sliceDoc(t.from,t.from+lt),r=e.sliceDoc(t.to-lt,t.to));var c=/^\s*/.exec(n)[0].length,u=/\s*$/.exec(r)[0].length,f=r.length-u-this.close.length;return n.slice(c,c+this.open.length)==this.open&&r.slice(f,f+this.close.length)==this.close?{open:{pos:t.from+c+this.open.length,margin:/\s/.test(n.charAt(c+this.open.length))?1:0},close:{pos:t.to-u-this.close.length,margin:/\s/.test(r.charAt(f-1))?1:0}}:null}}]),e}(),lt=50,ct=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";Object(s.a)(this,e),this.lineCommentToken=t,this.margin=n}return Object(l.a)(e,[{key:"toggle",value:function(e,t){for(var n=[],i={},a=0;a1&&l.isLineSkipped[p.number])){var v=p.from+l.minCol,m=l.minCol+this.lineCommentToken.length,g=" "==p.slice(m,m+1)?1:0;c.push({from:v,to:v+this.lineCommentToken.length+g})}}}catch(j){h.e(j)}finally{h.f()}}return t.update({changes:c})}}else if(e!=Ze.OnlyUncomment){for(var b=[],y=0;yft?-1:i==r.length?function(e,t){var n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Object(he.d)(r.slice(0,n-r.from),0,e.state.tabSize);return{line:r.number,col:a,off:i}}function ht(e,t){var n=dt(e,t),r=e.state.selection;return{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.prevState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get:function(t,i,o){var s=dt(e,t),l=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>ft||n.off>ft||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),l=Math.max(t.off,n.off),c=r;c<=i;c++){var u=e.doc.line(c);u.length<=l&&o.push(a.d.range(u.from+s,u.to+l))}else for(var f=Math.min(t.col,n.col),d=Math.max(t.col,n.col),h=r;h<=i;h++){var p=e.doc.line(h),v=p.length>ft?p.slice(0,2*d):p.slice(),m=Object(he.e)(v,0,f,e.tabSize),g=Object(he.e)(v,0,d,e.tabSize);m.leftOver||o.push(a.d.range(p.from+m.offset,p.from+g.offset))}return o}(e.state,n,s);return l.length?o?a.d.create(l.concat(r.ranges)):a.d.create(l):r}}}var pt=n(13),vt="undefined"==typeof Symbol?"__goto-line":Symbol("goto-line");function mt(e){var t=document.createElement("form");t.innerHTML="\n");var n=t.querySelector("input");function r(){var t=parseInt(n.value,10);e.dispatch({reconfigure:Object(pt.a)({},vt,[gt]),selection:!isNaN(t)&&t>0&&t<=e.state.doc.lines?a.d.cursor(e.state.doc.line(t).from):void 0,scrollIntoView:!0}),e.focus()}return t.addEventListener("keydown",(function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({reconfigure:{append:[gt]}}),e.focus()):13==t.keyCode&&(t.preventDefault(),r())})),t.addEventListener("submit",r),{dom:t,style:"gotoLine",pos:-10}}var gt=i.d.baseTheme({"$panel.gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),bt=[{key:"Alt-g",run:function(e){var t=Object(Se.a)(e,mt);return t||(e.dispatch({reconfigure:{append:[Object(Se.b)(),Se.c.of(mt),gt]}}),t=Object(Se.a)(e,mt)),t&&t.dom.querySelector("input").focus(),!0}}];var yt=i.b.line({attributes:{class:Object(i.n)("activeLine")}}),Ot=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],a=Object(o.a)(e.state.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value;if(s.empty){var l=e.visualLineAt(s.head);l.from>n&&(r.push(yt.range(l.from)),n=l.from)}}}catch(c){a.e(c)}finally{a.f()}return i.b.set(r)}}]),e}(),{decorations:function(e){return e.decorations}}),kt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},xt=a.f.define({combine:function(e){return Object(a.m)(e,kt,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});var wt=i.b.mark({class:Object(i.n)("selectionMatch")}),jt=i.b.mark({class:Object(i.n)("selectionMatch.main")}),St=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t=e.state.facet(xt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,l=r.primary,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return i.b.none;if(c=n.charCategorizer(l.head),!(s=function(e,t,n){for(var r=e.lineAt(t),i=t-r.from,o=t-r.from;i>0;){var s=r.findClusterBreak(i,!1);if(n(r.slice(s,i))!=a.c.Word)break;i=s}for(;o200)return i.b.none;if(!(s=n.sliceDoc(l.from,l.to).trim()))return i.b.none}var f,d=[],h=Object(o.a)(e.visibleRanges);try{for(h.s();!(f=h.n()).done;)for(var p=f.value,v=new Me(n.doc,s,p.from,p.to);!v.next().done;){var m=v.value,g=m.from,b=m.to;if((!c||(0==g||c(n.sliceDoc(g-1,g))!=a.c.Word)&&(b==n.doc.length||c(n.sliceDoc(b,b+1))!=a.c.Word))&&(c&&g<=l.from&&b>=l.to?d.push(jt.range(g,b)):(g>=l.to||b<=l.from)&&d.push(wt.range(g,b)),d.length>t.maxMatches))return i.b.none}}catch(y){h.e(y)}finally{h.f()}return i.b.set(d)}}]),e}(),{decorations:function(e){return e.decorations}}),Ct=i.d.baseTheme({"$$light $activeLine":{backgroundColor:"#eff5ff"},"$$dark $activeLine":{backgroundColor:"#223039"},$selectionMatch:{backgroundColor:"#99ff7780"},"$searchMatch $selectionMatch":{backgroundColor:"transparent"}}),Mt=n(100),Et=n(101),Tt=[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V.of(e),q]}(),Object(i.i)(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[h,d.of(e)]}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},le),e),n=new ce(t,!0),r=new ce(t,!1);return[N({style:"foldGutter",lineMarker:function(e,t){return ee(e.state,t.from,t.to)?r:te(e.state,t.from,t.to)?n:null},initialSpacer:function(){return new ce(t,!1)},domEventHandlers:{click:function(e,t){var n=ee(e.state,t.from,t.to);if(n)return e.dispatch({effects:G.of(n)}),!0;var r=te(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:K.of(r)}),!0)}}}),oe()]}(),Object(i.h)(),a.e.allowMultipleSelections.of(!0),Object(i.j)(),Mt.a,Object(de.a)(),i.d.inputHandler.of(be),Object(tt.a)(),function(e){var t=e||function(e){return e.altKey&&0==e.button};return i.d.mouseSelectionStyle.of((function(e,n){return t(n)?ht(e,n):null}))}(),[Ct,Ot],function(e){var t=[Ct,St];return e&&t.push(xt.of(e)),t}(),Object(i.k)([].concat(Object(r.a)(ye),Object(r.a)(fe.a),Object(r.a)(qe),Object(r.a)(T),Object(r.a)(re),Object(r.a)(nt),Object(r.a)(bt),Object(r.a)(tt.b),Object(r.a)(Et.a)))]},function(e,t,n){"use strict";var r=n(79),i=n.n(r),a=n(1),o=function(e){return e&&e.enabled&&e.modifierKey},s=function(e,t){return e&&t[e+"Key"]},l=function(e,t){return e&&!t[e+"Key"]};function c(e,t,n){return void 0===e||("string"===typeof e?-1!==e.indexOf(t):"function"===typeof e&&-1!==e({chart:n}).indexOf(t))}function u(e,t,n){var r=function(e,t){for(var n=e.x,r=e.y,i=t.scales,a=Object.keys(i),o=0;o=s.top&&r<=s.bottom&&n>=s.left&&n<=s.right)return s}return null}(t,n);if(r&&c(e,r.axis,n))return[r];var i=[];return Object(a.c)(n.scales,(function(t){c(e,t.axis,n)||i.push(t)})),i}var f=new WeakMap;function d(e){var t=f.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{}},f.set(e,t)),t}function h(e,t,n){var r=e.max-e.min,i=r*(t-1),a=e.isHorizontal()?n.x:n.y,o=(e.getValueForPixel(a)-e.min)/r||0;return{min:i*o,max:i*(1-o)}}function p(e,t,n,r,i){var o=n[r];if("original"===o){var s=e.originalScaleLimits[t.id][r];o=Object(a.Pb)(s.options,s.scale)}return Object(a.Pb)(o,i)}function v(e,t,n){var r=t.min,i=t.max,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=d(e.chart),s=e.id,l=e.axis,c=e.options,u=n&&(n[s]||n[l])||{},f=u.minRange,h=void 0===f?0:f,v=p(o,e,u,"min",-1/0),m=p(o,e,u,"max",1/0),g=Math.max(r,v),b=Math.min(i,m),y=a?Math.max(b-g,h):e.max-e.min;if(b-g!==y)if(v>b-y)r=g,i=g+y;else if(m3&&void 0!==arguments[3]&&arguments[3],i=e.min,a=e.max,o=e.options,s=o.time&&o.time.round,l=g[s]||0,c=e.getValueForPixel(e.getPixelForValue(i+l)-t),u=e.getValueForPixel(e.getPixelForValue(a+l)-t),f=r&&n&&n[e.axis]||{},d=f.min,h=void 0===d?-1/0:d,p=f.max,m=void 0===p?1/0:p;return!!(isNaN(c)||isNaN(u)||cm)||v(e,{min:c,max:u},n,r)}function y(e,t,n){return b(e,t,n,!0)}var O={category:function(e,t,n,r){var i=h(e,t,n);return e.min===e.max&&t<1&&function(e){var t=e.getLabels().length-1;e.min>0&&(e.min-=1),e.maxl&&(a=Math.max(0,a-c),o=1===s?a:a+s,r=0===a),v(e,{min:a,max:o},n)||r},default:b,logarithmic:y,timeseries:y};function x(e,t){Object(a.c)(e,(function(n,r){t[r]||delete e[r]}))}function w(e,t){var n=e.scales,r=t.originalScaleLimits,i=t.updatedScaleLimits;return Object(a.c)(n,(function(e){(function(e,t,n){var r=e.id,i=e.options,a=i.min,o=i.max;if(!t[r]||!n[r])return!0;var s=n[r];return s.min!==a||s.max!==o})(e,r,i)&&(r[e.id]={min:{scale:e.min,options:e.options.min},max:{scale:e.max,options:e.options.max}})})),x(r,n),x(i,n),r}function j(e,t,n,r){var i=O[e.type]||O.default;Object(a.n)(i,[e,t,n,r])}function S(e){var t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"none",r="number"===typeof t?{x:t,y:t}:t,i=r.x,o=void 0===i?1:i,s=r.y,l=void 0===s?1:s,f=r.focalPoint,h=void 0===f?S(e):f,p=d(e),v=p.options,m=v.limits,g=v.zoom,b=g||{},y=b.mode,O=void 0===y?"xy":y,k=b.overScaleMode;w(e,p);var x=1!==o&&c(O,"x",e),C=1!==l&&c(O,"y",e),M=k&&u(k,h,e);Object(a.c)(M||e.scales,(function(e){e.isHorizontal()&&x?j(e,o,h,m):!e.isHorizontal()&&C&&j(e,l,h,m)})),e.update(n),Object(a.n)(g.onZoom,[{chart:e}])}function M(e,t,n){var r=e.getValueForPixel(t),i=e.getValueForPixel(n);return{min:Math.min(r,i),max:Math.max(r,i)}}function E(e){var t=d(e),n=1,r=1;return Object(a.c)(e.scales,(function(e){var i=function(e,t){var n=e.originalScaleLimits[t];if(n){var r=n.min,i=n.max;return Object(a.Pb)(i.options,i.scale)-Object(a.Pb)(r.options,r.scale)}}(t,e.id);if(i){var o=Math.round(i/(e.max-e.min)*100)/100;n=Math.min(n,o),r=Math.max(r,o)}})),n<1?n:r}function T(e,t,n,r){var i=r.panDelta,o=i[e.id]||0;Object(a.Mb)(o)===Object(a.Mb)(t)&&(t+=o);var s=k[e.type]||k.default;Object(a.n)(s,[e,t,n])?i[e.id]=0:i[e.id]=t}function P(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",i="number"===typeof t?{x:t,y:t}:t,o=i.x,s=void 0===o?0:o,l=i.y,u=void 0===l?0:l,f=d(e),h=f.options,p=h.pan,v=h.limits,m=p||{},g=m.mode,b=void 0===g?"xy":g,y=m.onPan;w(e,f);var O=0!==s&&c(b,"x",e),k=0!==u&&c(b,"y",e);Object(a.c)(n||e.scales,(function(e){e.isHorizontal()&&O?T(e,s,v,f):!e.isHorizontal()&&k&&T(e,u,v,f)})),e.update(r),Object(a.n)(y,[{chart:e}])}function _(e,t){var n=d(e).handlers,r=n[t];r&&r.target&&(r.target.removeEventListener(t,r),delete n[t])}function D(e,t,n,r){var i=d(e),a=i.handlers,o=i.options;_(e,n),a[n]=function(t){return r(e,t,o)},a[n].target=t,t.addEventListener(n,a[n])}function A(e,t){var n=d(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function R(e,t,n){var r=n.onZoomStart,i=n.onZoomRejected;if(r){var o=t.target.getBoundingClientRect(),s=o.left,l=o.top,c={x:t.clientX-s,y:t.clientY-l};if(!1===Object(a.n)(r,[{chart:e,event:t,point:c}]))return Object(a.n)(i,[{chart:e,event:t}]),!1}}function L(e,t){var n=d(e),r=n.options,i=r.pan,c=r.zoom,u=void 0===c?{}:c;if(s(o(i),t)||l(o(u.drag),t))return Object(a.n)(u.onZoomRejected,[{chart:e,event:t}]);!1!==R(e,t,u)&&(n.dragStart=t,D(e,e.canvas,"mousemove",A))}function N(e,t,n,r){var i=n.target.getBoundingClientRect(),a=i.left,o=i.top,s=c(t,"x",e),l=c(t,"y",e),u=e.chartArea,f=u.top,d=u.left,h=u.right,p=u.bottom,v=u.width,m=u.height;s&&(d=Math.min(n.clientX,r.clientX)-a,h=Math.max(n.clientX,r.clientX)-a),l&&(f=Math.min(n.clientY,r.clientY)-o,p=Math.max(n.clientY,r.clientY)-o);var g=h-d,b=p-f;return{left:d,top:f,right:h,bottom:p,width:g,height:b,zoomX:s&&g?1+(v-g)/v:1,zoomY:l&&b?1+(m-b)/m:1}}function z(e,t){var n=d(e);if(n.dragStart){_(e,"mousemove");var r=n.options.zoom,i=r.mode,o=r.onZoomComplete,s=r.drag.threshold,l=void 0===s?0:s,u=N(e,i,n.dragStart,t),f=c(i,"x",e)?u.width:0,h=c(i,"y",e)?u.height:0,p=Math.sqrt(f*f+h*h);if(n.dragStart=n.dragEnd=null,p<=l)return n.dragging=!1,void e.update("none");!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",i=d(e),o=i.options,s=o.limits,l=o.zoom,u=l.mode,f=void 0===u?"xy":u;w(e,i);var h=c(f,"x",e),p=c(f,"y",e);Object(a.c)(e.scales,(function(e){e.isHorizontal()&&h?v(e,M(e,t.x,n.x),s,!0):!e.isHorizontal()&&p&&v(e,M(e,t.y,n.y),s,!0)})),e.update(r),Object(a.n)(l.onZoom,[{chart:e}])}(e,{x:u.left,y:u.top},{x:u.right,y:u.bottom},"zoom"),setTimeout((function(){return n.dragging=!1}),500),Object(a.n)(o,[{chart:e}])}}function I(e,t){var n=d(e),r=n.handlers.onZoomComplete,i=n.options.zoom;if(function(e,t,n){if(l(o(n.wheel),t))Object(a.n)(n.onZoomRejected,[{chart:e,event:t}]);else if(!1!==R(e,t,n)&&(t.cancelable&&t.preventDefault(),void 0!==t.deltaY))return!0}(e,t,i)){var s=t.target.getBoundingClientRect(),c=1+(t.deltaY>=0?-i.wheel.speed:i.wheel.speed);C(e,{x:c,y:c,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}}),r&&r()}}function F(e,t,n,r){n&&(d(e).handlers[t]=function(e,t){var n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}((function(){return Object(a.n)(n,[{chart:e}])}),r))}function $(e,t){return function(n,r){var i=t.options,c=i.pan,u=i.zoom,f=void 0===u?{}:u;if(!c||!c.enabled)return!1;var d=r&&r.srcEvent;return!d||(!(!t.panning&&"mouse"===r.pointerType&&(l(o(c),d)||s(o(f.drag),d)))||(Object(a.n)(c.onPanRejected,[{chart:e,event:r}]),!1))}}function B(e,t,n){if(t.scale){var r=n.center,i=n.pointers,a=1/t.scale*n.scale,o=n.target.getBoundingClientRect(),s=function(e,t){var n,r,i=Math.abs(e.clientX-t.clientX),a=Math.abs(e.clientY-t.clientY),o=i/a;return o>.3&&o<1.7?n=r=!0:i>a?n=!0:r=!0,{x:n,y:r}}(i[0],i[1]),l=t.options.zoom.mode;C(e,{x:s.x&&c(l,"x",e)?a:1,y:s.y&&c(l,"y",e)?a:1,focalPoint:{x:r.x-o.left,y:r.y-o.top}}),t.scale=n.scale}}function Q(e,t,n){var r=t.delta;r&&(t.panning=!0,P(e,{x:n.deltaX-r.x,y:n.deltaY-r.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}var W=new WeakMap;function H(e,t){var n=d(e),r=e.canvas,o=t.pan,s=t.zoom,l=new i.a.Manager(r);s&&s.pinch.enabled&&(l.add(new i.a.Pinch),l.on("pinchstart",(function(){return function(e,t){t.options.zoom.pinch.enabled&&(t.scale=1)}(0,n)})),l.on("pinch",(function(t){return B(e,n,t)})),l.on("pinchend",(function(t){return function(e,t,n){t.scale&&(B(e,t,n),t.scale=null,Object(a.n)(t.options.zoom.onZoomComplete,[{chart:e}]))}(e,n,t)}))),o&&o.enabled&&(l.add(new i.a.Pan({threshold:o.threshold,enable:$(e,n)})),l.on("panstart",(function(t){return function(e,t,n){var r=t.options.pan,i=r.enabled,o=r.overScaleMode,s=r.onPanStart,l=r.onPanRejected;if(i){var c=n.target.getBoundingClientRect(),f={x:n.center.x-c.left,y:n.center.y-c.top};if(!1===Object(a.n)(s,[{chart:e,event:n,point:f}]))return Object(a.n)(l,[{chart:e,event:n}]);t.panScales=o&&u(o,f,e),t.delta={x:0,y:0},clearTimeout(t.panEndTimeout),Q(e,t,n)}}(e,n,t)})),l.on("panmove",(function(t){return Q(e,n,t)})),l.on("panend",(function(){return function(e,t){t.delta=null,t.panning&&(t.panEndTimeout=setTimeout((function(){return t.panning=!1}),500),Object(a.n)(t.options.pan.onPanComplete,[{chart:e}]))}(e,n)}))),W.set(e,l)}var V={id:"zoom",version:"1.1.1",defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){d(e).options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),i.a&&H(e,n),e.pan=function(t,n,r){return P(e,t,n,r)},e.zoom=function(t,n){return C(e,t,n)},e.zoomScale=function(t,n,r){return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none";w(e,d(e)),v(e.scales[t],n,void 0,!0),e.update(r)}(e,t,n,r)},e.resetZoom=function(t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=d(e),r=w(e,n);Object(a.c)(e.scales,(function(e){var t=e.options;r[e.id]?(t.min=r[e.id].min.options,t.max=r[e.id].max.options):(delete t.min,delete t.max)})),e.update(t),Object(a.n)(n.options.zoom.onZoomComplete,[{chart:e}])}(e,t)},e.getZoomLevel=function(){return E(e)}},beforeEvent:function(e){var t=d(e);if(t.panning||t.dragging)return!1},beforeUpdate:function(e,t,n){d(e).options=n,function(e,t){var n=e.canvas,r=t.zoom,i=r.wheel,a=r.drag,o=r.onZoomComplete;i.enabled?(D(e,n,"wheel",I),F(e,"onZoomComplete",o,250)):_(e,"wheel"),a.enabled?(D(e,n,"mousedown",L),D(e,n.ownerDocument,"mouseup",z)):(_(e,"mousedown"),_(e,"mousemove"),_(e,"mouseup"))}(e,n)},beforeDatasetsDraw:function(e,t,n){var r=d(e),i=r.dragStart,a=r.dragEnd;if(a){var o=N(e,n.zoom.mode,i,a),s=o.left,l=o.top,c=o.width,u=o.height,f=n.zoom.drag,h=e.ctx;h.save(),h.beginPath(),h.fillStyle=f.backgroundColor||"rgba(225,225,225,0.3)",h.fillRect(s,l,c,u),f.borderWidth>0&&(h.lineWidth=f.borderWidth,h.strokeStyle=f.borderColor||"rgba(225,225,225)",h.strokeRect(s,l,c,u)),h.restore()}},stop:function(e){!function(e){_(e,"mousedown"),_(e,"mousemove"),_(e,"mouseup"),_(e,"wheel"),_(e,"click")}(e),i.a&&function(e){var t=W.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),W.delete(e))}(e),function(e){f.delete(e)}(e)},panFunctions:k,zoomFunctions:O};t.a=V},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n.n(r),a=n(90);function o(){return i.a.useContext(a.a)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n