From b3389ce26bb0ac5f21f7dada1dadb9dde3239f2e Mon Sep 17 00:00:00 2001 From: Yury Molodov Date: Tue, 14 Dec 2021 15:51:45 +0300 Subject: [PATCH] vmui: custom step (#1942) * feat: add a label for the Query field * fix: change zoom position * fix: add description and error code to alerts * fix: correct logic query history * fix: correct update query history * feat: add custom step * update package-lock.json * docs: document that VMUI now supports overriding of `step` query arg, which is passed to `/api/v1/query_range` Co-authored-by: Aliaksandr Valialkin --- app/vmselect/vmui/asset-manifest.json | 10 ++-- app/vmselect/vmui/index.html | 2 +- .../vmui/static/js/2.ef1db8c8.chunk.js | 2 + ...SE.txt => 2.ef1db8c8.chunk.js.LICENSE.txt} | 0 .../vmui/static/js/2.f1e36397.chunk.js | 2 - .../vmui/static/js/main.33e45f18.chunk.js | 1 - .../vmui/static/js/main.6651c49c.chunk.js | 1 + .../Graph/AxesLimitsConfigurator.tsx | 2 +- .../Home/Configurator/Graph/GraphSettings.tsx | 4 +- .../Configurator/Query/AdditionalSettings.tsx | 4 ++ .../Configurator/Query/StepConfigurator.tsx | 54 +++++++++++++++++++ .../Home/Configurator/Query/useFetchQuery.ts | 7 ++- .../packages/vmui/src/state/graph/reducer.ts | 39 +++++++++++--- app/vmui/packages/vmui/src/theme/theme.ts | 10 ++++ docs/CHANGELOG.md | 1 + docs/README.md | 2 + docs/Single-server-VictoriaMetrics.md | 2 + 17 files changed, 123 insertions(+), 20 deletions(-) create mode 100644 app/vmselect/vmui/static/js/2.ef1db8c8.chunk.js rename app/vmselect/vmui/static/js/{2.f1e36397.chunk.js.LICENSE.txt => 2.ef1db8c8.chunk.js.LICENSE.txt} (100%) delete mode 100644 app/vmselect/vmui/static/js/2.f1e36397.chunk.js delete mode 100644 app/vmselect/vmui/static/js/main.33e45f18.chunk.js create mode 100644 app/vmselect/vmui/static/js/main.6651c49c.chunk.js create mode 100644 app/vmui/packages/vmui/src/components/Home/Configurator/Query/StepConfigurator.tsx diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index 56e3317476..42c3a7471a 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,19 +1,19 @@ { "files": { "main.css": "./static/css/main.83d9ae2d.chunk.css", - "main.js": "./static/js/main.33e45f18.chunk.js", + "main.js": "./static/js/main.6651c49c.chunk.js", "runtime-main.js": "./static/js/runtime-main.c4b656b8.js", "static/css/2.77671664.chunk.css": "./static/css/2.77671664.chunk.css", - "static/js/2.f1e36397.chunk.js": "./static/js/2.f1e36397.chunk.js", + "static/js/2.ef1db8c8.chunk.js": "./static/js/2.ef1db8c8.chunk.js", "static/js/3.65648506.chunk.js": "./static/js/3.65648506.chunk.js", "index.html": "./index.html", - "static/js/2.f1e36397.chunk.js.LICENSE.txt": "./static/js/2.f1e36397.chunk.js.LICENSE.txt" + "static/js/2.ef1db8c8.chunk.js.LICENSE.txt": "./static/js/2.ef1db8c8.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.c4b656b8.js", "static/css/2.77671664.chunk.css", - "static/js/2.f1e36397.chunk.js", + "static/js/2.ef1db8c8.chunk.js", "static/css/main.83d9ae2d.chunk.css", - "static/js/main.33e45f18.chunk.js" + "static/js/main.6651c49c.chunk.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index 23c590318e..8f87d479fc 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -VM UI
\ No newline at end of file +VM UI
\ No newline at end of file diff --git a/app/vmselect/vmui/static/js/2.ef1db8c8.chunk.js b/app/vmselect/vmui/static/js/2.ef1db8c8.chunk.js new file mode 100644 index 0000000000..4ed8671455 --- /dev/null +++ b/app/vmselect/vmui/static/js/2.ef1db8c8.chunk.js @@ -0,0 +1,2 @@ +/*! For license information please see 2.ef1db8c8.chunk.js.LICENSE.txt */ +(this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(205)},function(e,t,n){"use strict";e.exports=n(200)},function(e,t,n){"use strict";function r(){return r=Object.assign||function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 a,s=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return G})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return ce})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return fe})),n.d(t,"g",(function(){return x})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return _})),n.d(t,"j",(function(){return Z})),n.d(t,"k",(function(){return P})),n.d(t,"l",(function(){return ee})),n.d(t,"m",(function(){return de}));var r=n(4),i=n(23),o=n(22),a=n(5),s=n(8),c=n(19),l=/\r\n?|\n/,u=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(u||(u={})),f=function(){function e(t){Object(a.a)(this,e),this.sections=t}return Object(s.a)(e,[{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];v(this,e,t)}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:m(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]:u.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=u.Simple&&c>=e&&(n==u.TrackDel&&re||n==u.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{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&&a>=e)return!(rt)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(t){if(!Array.isArray(t)||t.length%2||t.some((function(e){return"number"!=typeof e})))throw new RangeError("Invalid JSON representation of ChangeDesc");return new e(t)}}]),e}(),d=function(e){Object(i.a)(n,e);var t=Object(o.a)(n);function n(e,r){var i;return Object(a.a)(this,n),(i=t.call(this,e)).inserted=r,i}return Object(s.a)(n,[{key:"apply",value:function(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return v(this,(function(t,n,r,i,o){return e=e.replace(r,r+(n-t),o)}),!1),e}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,o=0;i=0){t[i]=s,t[i+1]=a;for(var l=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:m(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];v(this,e,t)}},{key:"desc",get:function(){return new f(this.sections)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new b(this);e:for(var a=0,s=0;;){for(var c=a==e.length?1e9:e[a++];s0&&p(r,t,o.text),o.forward(l),s+=l}for(var d=e[a++];s>1].toJSON()))}return e}}],[{key:"of",value:function(e,t,i){var o=[],a=[],s=0,u=null;function f(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.length){sy||g<0||y>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(y," (in doc of length ").concat(t,")"));var w=O?"string"==typeof O?c.a.of(O.split(i||l)):O:c.a.empty,k=w.length;if(g==y&&0==k)return;gs&&h(o,g-s,-1),h(o,y-g,k),p(a,o,w),s=y}}(e),f(!u),u}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");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 p(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],l=e.sections[a++];t(i,u,o,f,d),i=u,o=f}}}function m(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new b(e),s=new b(t),c=0,l=0;;)if(-1==a.ins)c+=a.len,a.next();else if(-1==s.ins&&l=0&&(a.done||ll&&!a.done&&c+a.len=0)){if(a.done&&s.done)return o?new d(i,o):new f(i);throw new Error("Mismatched change set lengths")}for(var v=0,m=c+a.len;;)if(s.ins>=0&&l>c&&l+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new b(e),a=new b(t),s=!1;;){if(o.done&&a.done)return i?new d(r,i):new f(r);if(0==o.ins)h(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var c=Math.min(o.len2,a.len),l=r.length;if(-1==o.ins){var u=-1==a.ins?-1:a.off?0:a.ins;h(r,c,u,s),i&&u&&p(i,r,a.text)}else-1==a.ins?(h(r,o.off?0:o.len,c,s),i&&p(i,r,o.textBit(c))):(h(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&p(i,r,a.text));s=(o.ins>c||a.ins>=0&&a.len>c)&&(s||r.length>l),o.forward2(c),a.forward(c)}else h(r,0,a.ins,s),i&&p(i,r,a.text),a.next()}}var b=function(){function e(t){Object(a.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 t>=e.length?c.a.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?c.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)}}]),e}(),y=function(){function e(t,n,r){Object(a.a)(this,e),this.from=t,this.to=n,this.flags=r}return Object(s.a)(e,[{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:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=t.mapPos(this.from,n),i=t.mapPos(this.to,n);return r==this.from&&i==this.to?this:new e(r,i,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 O.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return O.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:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return O.range(e.anchor,e.head)}}]),e}(),O=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(a.a)(this,e),this.ranges=t,this.mainIndex=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t,n)})),this.mainIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),main:this.mainIndex}}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return y.fromJSON(e)})),t.main)}},{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 y(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?O.range(s,a):O.range(a,s))}}return new O(e,t)}function k(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(o){i.e(o)}finally{i.f()}}var j=0,x=function(){function e(t,n,r,i,o){Object(a.a)(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=j++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new C([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new C(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new C(e,this,2,t)}},{key:"from",value:function(e,t){return t||(t=function(e){return e}),this.compute([e],(function(n){return t(n.field(e))}))}}],[{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}:S),!!t.static,t.enables)}}]),e}();function S(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var C=function(){function e(t,n,r,i){Object(a.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,i=this.value,o=this.facet.compareInput,a=e[this.id]>>1,s=2==this.type,c=!1,l=!1,u=[],f=Object(r.a)(this.dependencies);try{for(f.s();!(n=f.n()).done;){var d=n.value;"doc"==d?c=!0:"selection"==d?l=!0:0==(1&(null!==(t=e[d.id])&&void 0!==t?t:1))&&u.push(e[d.id])}}catch(h){f.e(h)}finally{f.f()}return function(e,t){var n=e.values[a];if(n===F)return e.values[a]=i(e),1;if(t&&(c&&t.docChanged||l&&(t.docChanged||t.selection)||u.some((function(t){return(1&$(e,t))>0})))){var r=i(e);if(s?!function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return function(e,r){var i=e.values[n];if(i===F)return e.values[n]=t.create(e),1;if(r){var o=t.updateF(i,r);if(!t.compareF(i,o))return e.values[n]=o,1}return 0}}},{key:"init",value:function(e){return[this,M.of({field:this,create:e})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e(j++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),T=4,E=3,A=2,D=1,R=0;function N(e){return function(t){return new L(t,e)}}var _={lowest:N(T),low:N(E),default:N(A),high:N(D),highest:N(R),fallback:N(T),extend:N(D),override:N(R)},L=function e(t,n){Object(a.a)(this,e),this.inner=t,this.prec=n},I=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new z(this,e)}},{key:"reconfigure",value:function(t){return e.reconfigure.of({compartment:this,extension:t})}},{key:"get",value:function(e){return e.config.compartments.get(this)}}]),e}(),z=function e(t,n){Object(a.a)(this,e),this.compartment=t,this.inner=n},B=function(){function e(t,n,r,i,o){for(Object(a.a)(this,e),this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t,n,i){var o,a=[],s=Object.create(null),c=new Map,l=Object(r.a)(function(e,t,n){var i=[[],[],[],[],[]],o=new Map;function a(e,s){var c=o.get(e);if(null!=c){if(c>=s)return;var l=i[c].indexOf(e);l>-1&&i[c].splice(l,1),e instanceof z&&n.delete(e.compartment)}if(o.set(e,s),Array.isArray(e)){var u,f=Object(r.a)(e);try{for(f.s();!(u=f.n()).done;){a(u.value,s)}}catch(p){f.e(p)}finally{f.f()}}else if(e instanceof z){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");var d=t.get(e.compartment)||e.inner;n.set(e.compartment,d),a(d,s)}else if(e instanceof L)a(e.inner,e.prec);else if(e instanceof P)i[s].push(e),e.provides&&a(e.provides,s);else if(e instanceof C)i[s].push(e),e.facet.extensions&&a(e.facet.extensions,s);else{var h=e.extension;if(!h)throw new Error("Unrecognized extension value in extension set (".concat(e,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(h,s)}}return a(e,A),i.reduce((function(e,t){return e.concat(t)}))}(t,n,c));try{for(l.s();!(o=l.n()).done;){var u=o.value;u instanceof P?a.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u)}}catch(S){l.e(S)}finally{l.f()}for(var f=Object.create(null),d=[],h=[],p=[],v=function(){var e=g[m];f[e.id]=h.length<<1,h.push((function(t){return e.slot(t)})),p.push([])},m=0,g=a;m>1;return function(e,n){var c,l=e.values[s],u=l===F||!n,f=Object(r.a)(a);try{for(f.s();!(c=f.n()).done;)1&$(e,c.value)&&(u=!0)}catch(S){f.e(S)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h7)return!1;var r=f[t];if(!(1&r))return p[r>>1].every((function(t){return e(t,n+1)}));var o=i.config.address[t];return null!=o&&W(i,o)==d[r>>1]};for(var k in f){var j=f[k],x=i.config.address[k];null!=x&&0==(1&j)&&w(+k,0)&&(O[j>>1]=W(i,x))}}return{configuration:new e(t,c,h.map((function(e){return e(f)})),f,d),values:O}}}]),e}();var F={};function $(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 W(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var V=x.define(),H=x.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),q=x.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),Q=x.define(),U=x.define(),X=x.define(),Y=x.define({combine:function(e){return!!e.length&&e[0]}}),G=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,null,[{key:"define",value:function(){return new K}}]),e}(),K=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new G(this,e)}}]),e}(),J=function(){function e(t){Object(a.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new Z(this,e)}}]),e}(),Z=function(){function e(t,n){Object(a.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 J(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value.map(t);a&&i.push(a)}}catch(s){o.e(s)}finally{o.f()}return i}}]),e}();Z.reconfigure=Z.define(),Z.appendConfig=Z.define();var ee=function(){function e(t,n,r,i,o,s){Object(a.a)(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&k(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Object(s.a)(e,[{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:"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(o){n.e(o)}finally{n.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(t){var n=this.annotation(e.userEvent);return!(!n||!(n==t||n.length>t.length&&n.slice(0,t.length)==t&&"."==n[t.length]))}}]),e}();function te(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;i--){var o=n[i](e);o&&Object.keys(o).length&&(r=ne(e,re(t,o,e.changes.newLength),!0))}return r==e?e:new ee(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){var t,n=e.startState,i=!0,o=Object(r.a)(n.facet(Q));try{for(o.s();!(t=o.n()).done;){var a=(0,t.value)(e);if(!1===a){i=!1;break}Array.isArray(a)&&(i=!0===i?a:te(i,a))}}catch(p){o.e(p)}finally{o.f()}if(!0!==i){var s,c;if(!1===i)c=e.changes.invertedDesc,s=d.empty(n.doc.length);else{var l=e.changes.filter(i);s=l.changes,c=l.filtered.invertedDesc}e=new ee(n,s,e.selection&&e.selection.map(c),Z.mapEffects(e.effects,c),e.annotations,e.scrollIntoView)}for(var u=n.facet(U),f=u.length-1;f>=0;f--){var h=u[f](e);e=h instanceof ee?h:Array.isArray(h)&&1==h.length&&h[0]instanceof ee?h[0]:ie(n,ae(h),!1)}return e}(s):s)}ee.time=G.define(),ee.userEvent=G.define(),ee.addToHistory=G.define(),ee.remote=G.define();var oe=[];function ae(e){return null==e?oe:Array.isArray(e)?e:[e]}var se,ce=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ce||(ce={})),le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{se=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(he){}function ue(e){return function(t){if(!/\S/.test(t))return ce.Space;if(function(e){if(se)return se.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||le.test(n)))return!0}return!1}(t))return ce.Word;for(var n=0;n-1)return ce.Word;return ce.Other}}var fe=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;Object(a.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.values=i,this.applying=null,this.status=t.statusTemplate.slice(),this.applying=o,o&&(o._state=this);for(var s=0;s1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return $(this,n),W(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 d?t:d.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return c.a.of(t.split(this.facet(e.lineSeparator)||l))}},{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:($(this,t),W(this,t))}},{key:"toJSON",value:function(e){var t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(var n in e){var r=e[n];r instanceof P&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}},{key:"tabSize",get:function(){return this.facet(e.tabSize)}},{key:"lineBreak",get:function(){return this.facet(e.lineSeparator)||"\n"}},{key:"readOnly",get:function(){return this.facet(Y)}},{key:"phrase",value:function(t){var n,i=Object(r.a)(this.facet(e.phrases));try{for(i.s();!(n=i.n()).done;){var o=n.value;if(Object.prototype.hasOwnProperty.call(o,t))return o[t]}}catch(a){i.e(a)}finally{i.f()}return t}},{key:"languageDataAt",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=[],a=Object(r.a)(this.facet(V));try{for(a.s();!(n=a.n()).done;){var s,c=n.value,l=Object(r.a)(c(this,t,i));try{for(l.s();!(s=l.n()).done;){var u=s.value;Object.prototype.hasOwnProperty.call(u,e)&&o.push(u[e])}}catch(f){l.e(f)}finally{l.f()}}}catch(f){a.e(f)}finally{a.f()}return o}},{key:"charCategorizer",value:function(e){return ue(this.languageDataAt("wordChars",e).join(""))}},{key:"wordAt",value:function(e){for(var t=this.doc.lineAt(e),n=t.text,r=t.from,i=t.length,o=this.charCategorizer(e),a=e-r,s=e-r;a>0;){var l=Object(c.e)(n,a,!1);if(o(n.slice(l,a))!=ce.Word)break;a=l}for(;s1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(e){var n=r[e],o=t[e];i.push(n.init((function(e){return n.spec.fromJSON(o,e)})))};for(var a in r)o(a)}return e.create({doc:t.doc,selection:O.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=B.resolve(t.extensions||[],new Map),r=n.configuration,i=n.values,o=t.doc instanceof c.a?t.doc:c.a.of((t.doc||"").split(r.staticFacet(e.lineSeparator)||l)),a=t.selection?t.selection instanceof O?t.selection:O.single(t.selection.anchor,t.selection.head):O.single(0);return k(a,o.length),r.staticFacet(H)||(a=a.asSingle()),new e(r,o,a,i)}}]),e}();function de(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={},a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,c=0,l=Object.keys(s);c=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=void 0===t?w:t,s=e.rootShouldForwardProp,l=void 0===s?O:s,u=e.slotShouldForwardProp,f=void 0===u?O:u;return function(e){var t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=s.name,d=s.slot,w=s.skipVariantsResolver,k=s.skipSx,j=s.overridesResolver,x=Object(o.a)(s,h),S=void 0!==w?w:d&&"Root"!==d||!1,C=k||!1;var M=O;"Root"===d?M=l:d&&(M=f);var P=Object(a.a)(e,Object(i.a)({shouldForwardProp:M,label:t},x)),T=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),s=1;s0){var h=new Array(d).fill("");(f=[].concat(Object(r.a)(e),Object(r.a)(h))).raw=[].concat(Object(r.a)(e.raw),Object(r.a)(h))}else"function"===typeof e&&(f=function(t){var r=t.theme,a=Object(o.a)(t,v);return e(Object(i.a)({theme:m(r)?n:r},a))});var O=P.apply(void 0,[f].concat(Object(r.a)(l)));return O};return T}}({defaultTheme:k.a,rootShouldForwardProp:j});t.a=S},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"},y="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),O="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),w="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),k="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),j="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),x=y&&(k||+y[1]<57)||w&&k,S=0;S<10;S++)g[48+S]=g[96+S]=String(S);for(S=1;S<=24;S++)g[S+111]="F"+S;for(S=65;S<=90;S++)g[S]=String.fromCharCode(S+32),b[S]=String.fromCharCode(S);for(var C in g)b.hasOwnProperty(C)||(b[C]=g[C]);function M(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function P(e,t){return!!t&&e.contains(1!=t.nodeType?t.parentNode:t)}function T(e,t){if(!t.anchorNode)return!1;try{return P(e,t.anchorNode)}catch(n){return!1}}function E(e){return 3==e.nodeType?W(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function A(e,t,n,r){return!!n&&(R(e,t,n,r,-1)||R(e,t,n,r,1))}function D(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function R(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:N(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=D(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?N(e):0}}}function N(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var _={left:0,right:0,top:0,bottom:0};function L(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function I(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var z,B=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:"setRange",value:function(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}},{key:"set",value:function(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}]),e}(),F=null;function $(e){if(e.setActive)return e.setActive();if(F)return e.focus(F);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==F?{get preventScroll(){return F={preventScroll:!0},!0}}:void 0),!F){F=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=z||(z=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function V(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,e.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,e.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function H(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}var q=function(){function e(t,n){var r=!(arguments.length>2&&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,D(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,D(t)+1,n)}}]),e}(),Q=[],U=function(){function e(){Object(f.a)(this,e),this.parent=null,this.dom=null,this.dirty=2}return Object(d.a)(e,[{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:"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(o){r.e(o)}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){var n;if(2&this.dirty){var r,i=this.dom,o=i.firstChild,a=Object(u.a)(this.children);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.dirty&&(s.dom||!o||(null===(n=e.get(o))||void 0===n?void 0:n.parent)||s.reuseDOM(o),s.sync(t),s.dirty=0),t&&!t.written&&t.node==i&&o!=s.dom&&(t.written=!0),s.dom.parentNode==i){for(;o&&o!=s.dom;)o=X(o);o=s.dom.nextSibling}else i.insertBefore(s.dom,o)}}catch(d){a.e(d)}finally{a.f()}for(o&&t&&t.node==i&&(t.written=!0);o;)o=X(o)}else if(1&this.dirty){var c,l=Object(u.a)(this.children);try{for(l.s();!(c=l.n()).done;){var f=c.value;f.dirty&&(f.sync(t),f.dirty=0)}}catch(d){l.e(d)}finally{l.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==N(t)?0:0==n?-1:1;;){var o=t.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}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 a=0,s=0;;a++){var c=this.children[a];if(c.dom==r)return s;s+=c.length+c.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,c=n,l=n;st)return u.domBoundsAround(e,t,c);if(f>=e&&-1==r&&(r=s,i=c),c>t&&u.dom.parentNode==this.dom){o=s,a=l;break}l=f,c=f+u.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}},{key:"markDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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&&(this.dom.cmView=null),this.dom=e,e.cmView=this}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Q;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new Y(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:"isEditable",get:function(){return!0}},{key:"merge",value:function(e,t,n,r,i,o){return!1}},{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}},{key:"destroy",value:function(){this.parent=null}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function X(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}U.prototype.breakAfter=0;var Y=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}();function G(e,t,n,r,i,o,a,s,c){var l=e.children,u=l.length?l[t]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:a;if(!(t==r&&u&&!a&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,0==n,s,c))){if(r0&&(!a&&o.length&&u.merge(n,u.length,o[0],!1,s,0)?u.breakAfter=o.shift().breakAfter:(n2),fe={mac:ue||/Mac/.test(ee.platform),windows:/Win/.test(ee.platform),linux:/Linux|X11/.test(ee.platform),ie:oe,ie_version:re?te.documentMode||6:ie?+ie[1]:ne?+ne[1]:0,gecko:ae,gecko_version:ae?+(/Firefox\/(\d+)/.exec(ee.userAgent)||[0,0])[1]:0,chrome:!!se,chrome_version:se?+se[1]:0,ios:ue,android:/Android\b/.test(ee.userAgent),webkit:ce,safari:le,webkit_version:ce?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=te.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},de=function(e){Object(a.a)(n,e);var t=Object(s.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:"length",get:function(){return this.text.length}},{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:"split",value:function(e){var t=new n(this.text.slice(e));return this.text=this.text.slice(0,e),t}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new q(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 pe(this.dom,e,t)}}]),n}(U),he=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,n),(i=t.call(this)).mark=e,i.children=o,i.length=a;var s,c=Object(u.a)(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;l.setParent(Object(r.a)(i))}}catch(d){c.e(d)}finally{c.f()}return i}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||4&this.dirty)&&this.createDOM(),Object(i.a)(Object(o.a)(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,o,a){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&o<=0||te&&r.push(i=e&&(o=a),i=l,a++}}catch(d){s.e(d)}finally{s.f()}var f=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new n(this.mark,r,f)}},{key:"domAtPos",value:function(e){return ye(this.dom,this.children,e)}},{key:"coordsAt",value:function(e,t){return we(this,e,t)}}]),n}(U);function pe(e,t,n){var r=e.nodeValue.length;t>r&&(t=r);var i=t,o=t,a=0;0==t&&n<0||t==r&&n>=0?fe.chrome||fe.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=W(e,i,o).getClientRects();if(!s.length)return _;var c=s[(a?a<0:n>=0)?0:s.length-1];return fe.safari&&!a&&0==c.width&&(c=Array.prototype.find.call(s,(function(e){return e.width}))||c),a?L(c,a<0):c||null}var ve=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o}return Object(d.a)(n,[{key:"split",value:function(e){var t=n.create(this.widget,this.length-e,this.side);return this.length-=e,t}},{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,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?r:L(r,0==e)}},{key:"isEditable",get:function(){return!1}},{key:"destroy",value:function(){Object(i.a)(Object(o.a)(n.prototype),"destroy",this).call(this),this.dom&&this.widget.destroy(this.dom)}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(U),me=function(e){Object(a.a)(n,e);var t=Object(s.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 q(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:"overrideDOMText",get:function(){return null}},{key:"coordsAt",value:function(e,t){return pe(this.widget.text,e,t)}},{key:"isEditable",get:function(){return!0}}]),n}(ve),ge=fe.android?"\u200b\u200b":"\u200b",be=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).side=e,r}return Object(d.a)(n,[{key:"length",get:function(){return 0}},{key:"merge",value:function(){return!1}},{key:"become",value:function(e){return e instanceof n&&e.side==this.side}},{key:"split",value:function(){return new n(this.side)}},{key:"sync",value:function(){this.dom?this.dirty&&this.dom.nodeValue!=ge&&(this.dom.nodeValue=ge):this.setDOM(document.createTextNode(ge))}},{key:"getSide",value:function(){return this.side}},{key:"domAtPos",value:function(e){return q.before(this.dom)}},{key:"localPosFromDOM",value:function(){return 0}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(e){var t=E(this.dom);return t[t.length-1]||null}},{key:"overrideDOMText",get:function(){return p.a.of([this.dom.nodeValue.replace(/\u200b/g,"")])}}]),n}(U);function ye(e,t,n){for(var r=0,i=0;ri&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return q.after(s)}return new q(e,0)}function Oe(e,t,n){var r,i=e.children;n>0&&t instanceof he&&i.length&&(r=i[i.length-1])instanceof he&&r.mark.eq(t.mark)?Oe(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function we(e,t,n){for(var r=0,i=0;i0?a>=t:a>t)&&(t0)){var c=0;if(a==r){if(o.getSide()<=0)continue;c=n=-o.getSide()}var l=o.coordsAt(t-r,n);return c&&l?L(l,n<0):l}r=a}var u=e.dom.lastChild;if(!u)return e.dom.getBoundingClientRect();var f=E(u);return f[f.length-1]||null}function ke(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 je(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,o=n;i-1}}],[{key:"mark",value:function(e){return new Pe(e)}},{key:"widget",value:function(e){var t=e.side||0,n=!!e.block;return new Ee(e,t+=n?t>0?3e8:-4e8:t>0?1e8:-1e8,t,n,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ae(e,t),r=n.start,i=n.end;return new Ee(e,t?r?-3e8:-1:4e8,t?i?2e8:1:-5e8,t,e.widget||null,!0)}},{key:"line",value:function(e){return new Te(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m.a.of(e,t)}}]),n}(m.c);Me.none=m.a.empty;var Pe=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;Object(f.a)(this,n);var i=Ae(e),o=i.start,a=i.end;return(r=t.call(this,o?-1:4e8,a?1:-5e8,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&&je(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(i.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(Me);Pe.prototype.point=!1;var Te=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,-2e8,-2e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&je(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(i.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(Me);Te.prototype.mapMode=h.h.TrackBefore,Te.prototype.point=!0;var Ee=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i,o,a,s){var c;return Object(f.a)(this,n),(c=t.call(this,r,i,a,e)).block=o,c.isReplace=s,c.mapMode=o?r<=0?h.h.TrackBefore:h.h.TrackAfter:h.h.TrackDel,c}return Object(d.a)(n,[{key:"type",get:function(){return this.startSide=5}},{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(i.a)(Object(o.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(Me);function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.inclusiveStart,r=e.inclusiveEnd;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!==n&&void 0!==n?n:t,end:null!==r&&void 0!==r?r:t}}function De(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>e?n[i]=Math.max(n[i],t):n.push(e,t)}Ee.prototype.point=!0;var Re=function(e){Object(a.a)(n,e);var t=Object(s.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,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),K(this,e,t,r?r.children:[],o,a),!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,o=r.off;o&&(t.append(this.children[i].split(o),0),this.children[i].merge(o,this.children[i].length,null,!1,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[--i].destroy();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){je(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){Oe(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=ke(t,this.attrs||{})),n&&(this.attrs=ke(t,{class:n}))}},{key:"domAtPos",value:function(e){return ye(this.dom,this.children,e)}},{key:"sync",value:function(e){var t;(!this.dom||4&this.dirty)&&(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(xe(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),Object(i.a)(Object(o.a)(n.prototype),"sync",this).call(this,e);for(var r=this.dom.lastChild;r&&U.get(r)instanceof he;)r=r.lastChild;if(!r||"BR"!=r.nodeName&&0==(null===(t=U.get(r))||void 0===t?void 0:t.isEditable)&&(!fe.ios||!this.children.some((function(e){return e instanceof de})))){var a=document.createElement("BR");a.cmIgnore=!0,this.dom.appendChild(a)}}},{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 de))return null;var i=E(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return we(this,e,t)}},{key:"become",value:function(e){return!1}},{key:"type",get:function(){return Ce.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var o=e.children[r],a=i+o.length;if(a>=t){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(U),Ne=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t),this.getLine().append(Le(new de(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}},{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 o=t-e;if(n instanceof Ee)if(n.block){var a=n.type;a!=Ce.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new Ne(n.widget||new Ie("div"),o,a))}else{var s=ve.create(n.widget||new Ie("span"),o,n.startSide),c=this.atCursorPos&&!s.isEditable&&i<=r.length&&(e0),l=!s.isEditable&&(e0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;o+=2}if(!c)return r;new e(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),a=c.toA,s=c.toB}}}]),e}(),st=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ze;Object(f.a)(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=h.c.empty(this.startState.doc.length);var i,o=Object(u.a)(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(l){o.e(l)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new at(e,t,n,r))})),this.changedRanges=s;var c=t.hasFocus;c!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=c,this.flags|=1),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||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return!this.changes.empty}},{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}(),ct=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(ct||(ct={})),lt=ct.LTR,ut=ct.RTL;function ft(e){for(var t=[],n=0;n=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.fromt:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),xt=[];function St(e,t){var n=e.length,r=t==lt?1:2,i=t==lt?2:1;if(!e||1==r&&!kt.test(e))return Ct(n);for(var o=0,a=r,s=r;o=0;k-=3)if(vt[k+1]==-g){var j=vt[k+2],x=2&j?r:4&j?1&j?i:r:0;x&&(xt[y]=xt[vt[k]]=x),O=k;break}}else{if(189==vt.length)break;vt[O++]=y,vt[O++]=m,vt[O++]=w}else if(2==(b=xt[y])||1==b){var S=b==r;w=S?0:1;for(var C=O-3;C>=0;C-=3){var M=vt[C+2];if(2&M)break;if(S)vt[C+2]|=2;else{if(4&M)break;vt[C+2]|=4}}}for(var P=0;P_;){for(var z=I,B=2!=xt[--I];I>_&&B==(2!=xt[I-1]);)I--;R.push(new jt(I,z,B?2:1))}else R.push(new jt(_,N,0))}else for(var F=0;F0&&n.length&&(n.every((function(e){var n=e.fromA;return e.toAt.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=Me.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){var n=e.observer.selectionRange,r=n.focusNode&&Lt(n.focusNode,n.focusOffset,0);if(!r)return Me.none;var i=e.docView.nearest(r);if(!i)return Me.none;var o,a,s=r;if(i instanceof Re){for(;s.parentNode!=i.dom;)s=s.parentNode;for(var c=s.previousSibling;c&&!U.get(c);)c=c.previousSibling;o=a=c?U.get(c).posAtEnd:i.posAtStart}else{for(;;){var l=i.parent;if(!l)return Me.none;if(l instanceof Re)break;i=l}a=(o=i.posAtStart)+i.length,s=i.dom}var u=t.mapPos(o,1),f=Math.max(u,t.mapPos(a,-1)),d=e.state,h=3==s.nodeType?s.nodeValue:new Tt([],e).readRange(s.firstChild,null).text;if(f-u=0?e[i]:null;if(!o)break;var a=o.fromA,s=o.toA,c=o.fromB,l=o.toB,u=_e.build(this.view.state.doc,c,l,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(a,-1);G(this,b.i,b.off,m,g,f,d,h,p)}}},{key:"updateSelection",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t&&this.view.observer.readSelectionRange(),!(!n&&!this.mayControlSelection()||fe.ios&&this.view.inputState.rapidCompositionStart)){var r=this.forceSelection;this.forceSelection=!1;var i=this.view.state.selection.main,o=this.domAtPos(i.anchor),a=i.empty?o:this.domAtPos(i.head);if(fe.gecko&&i.empty&&Rt(o)){var s=document.createTextNode("");this.view.observer.ignore((function(){return o.node.insertBefore(s,o.node.childNodes[o.offset]||null)})),o=a=new q(s,0),r=!0}var c=this.view.observer.selectionRange;!r&&c.focusNode&&A(o.node,o.offset,c.anchorNode,c.anchorOffset)&&A(a.node,a.offset,c.focusNode,c.focusOffset)||(this.view.observer.ignore((function(){fe.android&&fe.chrome&&e.dom.contains(c.focusNode)&&Bt(c.focusNode,e.dom)&&(e.dom.blur(),e.dom.focus({preventScroll:!0}));var t=M(e.root);if(i.empty){if(fe.gecko){var n=It(o.node,o.offset);if(n&&3!=n){var r=Lt(o.node,o.offset,1==n?1:-1);r&&(o=new q(r,1==n?0:r.nodeValue.length))}}t.collapse(o.node,o.offset),null!=i.bidiLevel&&null!=c.cursorBidiLevel&&(c.cursorBidiLevel=i.bidiLevel)}else if(t.extend)t.collapse(o.node,o.offset),t.extend(a.node,a.offset);else{var s=document.createRange();if(i.anchor>i.head){var l=[a,o];o=l[0],a=l[1]}s.setEnd(a.node,a.offset),s.setStart(o.node,o.offset),t.removeAllRanges(),t.addRange(s)}})),this.view.observer.setSelectionRange(o,a)),this.impreciseAnchor=o.precise?null:new q(c.anchorNode,c.anchorOffset),this.impreciseHead=a.precise?null:new q(c.focusNode,c.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.compositionDeco.size){var e=this.view.state.selection.main,t=M(this.root);if(e.empty&&e.assoc&&t.modify){var n=Re.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),o=this.coordsAt(e.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Xe)?this.root.activeElement==this.dom:T(this.dom,this.view.observer.selectionRange)}},{key:"nearest",value:function(e){for(var t=e;t;){var n=U.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;no||e==o&&i.type!=Ce.WidgetBefore&&i.type!=Ce.WidgetAfter&&(!r||2==t||this.children[r-1].breakAfter||this.children[r-1].type==Ce.WidgetBefore&&t>-2))return i.coordsAt(e-o,t);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=0,c=0;cr)break;if(s>=n){var f=l.dom.getBoundingClientRect();if(e.push(f.height),o){var d=l.dom.lastChild,h=d?E(d):[];if(h.length){var p=h[h.length-1],v=this.view.textDirection==ct.LTR?p.right-f.left:f.right-p.left;v>a&&(a=v,this.minWidth=i,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+l.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 Re){var i=r.measureTextSize();if(i)return i}}}catch(c){n.e(c)}finally{n.f()}var o,a,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=E(s.firstChild)[0];o=s.getBoundingClientRect().height,a=e?e.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{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 Y(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){for(var e=[],t=this.view.viewState,n=0,r=0;;r++){var i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=t.lineBlockAt(o).bottom-t.lineBlockAt(n).top;e.push(Me.replace({widget:new Nt(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Me.set(e)}},{key:"updateDeco",value:function(){return this.decorations=[].concat(Object(l.a)(this.view.pluginField(Ge.decorations)),Object(l.a)(this.view.state.facet(it)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco])}},{key:"scrollIntoView",value:function(e){var t,n=e.range,r=e.center,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(i){!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,t.left),top:Math.min(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)});var o,a=0,s=0,c=0,l=0,f=Object(u.a)(this.view.pluginField(Ge.scrollMargins));try{for(f.s();!(o=f.n()).done;){var d=o.value;if(d){var h=d.left,p=d.right,v=d.top,m=d.bottom;null!=h&&(a=Math.max(a,h)),null!=p&&(s=Math.max(s,p)),null!=v&&(c=Math.max(c,v)),null!=m&&(l=Math.max(l,m))}}}catch(g){f.e(g)}finally{f.f()}!function(e,t,n,r){for(var i=e.ownerDocument,o=i.defaultView,a=e;a;)if(1==a.nodeType){var s=void 0,c=a==i.body;if(c)s=I(o);else{if(a.scrollHeight<=a.clientHeight&&a.scrollWidth<=a.clientWidth){a=a.parentNode;continue}var l=a.getBoundingClientRect();s={left:l.left,right:l.left+a.clientWidth,top:l.top,bottom:l.top+a.clientHeight}}var u=0,f=0;if(r){var d=t.bottom-t.top,h=s.bottom-s.top;f=(d<=h?t.top+d/2-h/2:n<0?t.top-5:t.bottom+5-h)-s.top,Math.abs(f)<=1&&(f=0)}else t.top0&&t.bottom>s.bottom+f&&(f=t.bottom-s.bottom+f+5)):t.bottom>s.bottom&&(f=t.bottom-s.bottom+5,n<0&&t.top-f0&&t.right>s.right+u&&(u=t.right-s.right+u+5)):t.right>s.right&&(u=t.right-s.right+5,n<0&&t.left0&&n<=0)t=N(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function It(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 $t(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function Wt(e,t){return e.topt.top+1}function Vt(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function qt(e,t,n){for(var r,i,o,a,s,c,l,u,f=e.firstChild;f;f=f.nextSibling)for(var d=E(f),h=0;hm||a==m&&o>v)&&(r=f,i=p,o=v,a=m),0==v?n>p.bottom&&(!l||l.bottomp.top)&&(c=f,u=p):l&&Wt(l,p)?l=Ht(l,p.bottom):u&&Wt(u,p)&&(u=Vt(u,p.top))}if(l&&l.bottom>=n?(r=s,i=l):u&&u.top<=n&&(r=c,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?Qt(r,g,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:qt(r,g,n)}function Qt(e,t,n){for(var r=e.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?u.top-n:n-u.bottom)-1;if(u.left-1<=t&&u.right+1>=t&&f=(u.left+u.right)/2,h=d;if(fe.chrome||fe.gecko)W(e,s).getBoundingClientRect().left==u.right&&(h=!d);if(f<=0)return{node:e,offset:s+(h?1:0)};i=s+(h?1:0),o=f}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function Ut(e,t,n){var r,i,o=t.x,a=t.y,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,c=e.contentDOM.getBoundingClientRect(),l=c.top+e.viewState.paddingTop,u=a-l,f=e.viewState.docHeight;if(u<0||u>f){if(n)return null;u=u<0?0:f}for(var d=e.defaultLineHeight/2,h=!1;(i=e.elementAtHeight(u)).type!=Ce.Text;)for(;!((u=s>0?i.bottom+d:i.top-d)>=0&&u<=f);){if(h)return n?null:0;h=!0,s=-s}a=l+u;var p=i.from;if(o=Math.max(c.left+1,Math.min(Math.max(c.right,c.left+e.docView.minWidth)-1,o)),pe.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:Xt(e,c,i,o,a);var v,m=e.dom.ownerDocument,g=(e.root.elementFromPoint?e.root:m).elementFromPoint(o,a),b=-1;if(g&&e.contentDOM.contains(g)&&0!=(null===(r=e.docView.nearest(g))||void 0===r?void 0:r.isEditable))if(m.caretPositionFromPoint){var y=m.caretPositionFromPoint(o,a);y&&(v=y.offsetNode,b=y.offset)}else if(m.caretRangeFromPoint){var O=m.caretRangeFromPoint(o,a);O&&(v=O.startContainer,b=O.startOffset,fe.safari&&Yt(v,b,o)&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){var w=Re.find(e.docView,p),k=qt(w.dom,o,a);v=k.node,b=k.offset}return e.docView.posFromDOM(v,b)}function Xt(e,t,n,r,i){var o=Math.round((r-t.left)*e.defaultCharacterWidth);e.lineWrapping&&n.height>1.5*e.defaultLineHeight&&(o+=Math.floor((i-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);var a=e.state.sliceDoc(n.from,n.to);return n.from+Object(p.f)(a,o,e.state.tabSize)}function Yt(e,t,n){var r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(var i=e.nextSibling;i;i=i.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return W(e,r-1,r).getBoundingClientRect().left>n}function Gt(e,t,n,r){var i=e.state.doc.lineAt(t.head),o=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){var a=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==ct.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(null!=s)return h.e.cursor(s,n?-1:1)}var c=Re.find(e.docView,t.head),l=c?n?c.posAtEnd:c.posAtStart:n?i.to:i.from;return h.e.cursor(l,n?-1:1)}function Kt(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var c=Pt(i,o,e.textDirection,a,n),l=Mt;if(!c){if(i.number==(n?e.state.doc.lines:1))return a;l="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=h.e.cursor(n?i.from:i.to)}if(s){if(!s(l))return a}else{if(!r)return c;s=r(l)}a=c}}function Jt(e,t,n){for(var r=e.pluginField(Ge.atomicRanges);;){var i,o=!1,a=Object(u.a)(r);try{for(a.s();!(i=a.n()).done;){i.value.between(n.from-1,n.from+1,(function(e,r,i){n.from>e&&n.fromn.from?h.e.cursor(e,1):h.e.cursor(r,-1),o=!0)}))}}catch(s){a.e(s)}finally{a.f()}if(!o)return n}}var Zt=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.pendingAndroidKey=void 0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;var r=function(e){var r=on[e];t.contentDOM.addEventListener(e,(function(i){"keydown"==e&&n.keydown(t,i)||rn(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 on)r(i);this.notifiedFocused=t.hasFocus,this.ensureHandlers(t),fe.safari&&t.contentDOM.addEventListener("input",(function(){return null}))}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(et),i=Object(u.a)(r);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){rn(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in o.handlers)a(s)}}catch(c){i.e(c)}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 o=r.value,a=o.handlers[e],s=!1;if(a){try{s=a.call(o.plugin,n,t)}catch(c){Ue(t.state,c)}if(s||n.defaultPrevented)return fe.android&&"keydown"==e&&13==n.keyCode&&t.observer.flushSoon(),!0}}}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,o=i.handlers.scroll;if(o)try{o.call(i.plugin,t,e)}catch(a){Ue(e.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"keydown",value:function(e,t){var n,r=this;return this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),!!this.screenKeyEvent(e,t)||!(!fe.ios||!(n=en.find((function(e){return e.keyCode==t.keyCode})))||t.ctrlKey||t.altKey||t.metaKey||t.synthetic)&&(this.pendingIOSKey=n,setTimeout((function(){return r.flushIOSKey(e)}),250),!0)}},{key:"flushIOSKey",value:function(e){var t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,V(e.contentDOM,t.key,t.keyCode))}},{key:"setPendingAndroidKey",value:function(e,t){var n=this;this.pendingAndroidKey=t,requestAnimationFrame((function(){var t=n.pendingAndroidKey;if(t){n.pendingAndroidKey=void 0,e.observer.processRecords();var r=e.state;V(e.contentDOM,t.key,t.keyCode),e.state==r&&e.docView.reset(!0)}}))}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(fe.safari&&Date.now()-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(e,t){var n=9==t.keyCode&&Date.now()=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}(t,n)||1!=bn(n))&&null,!1===this.dragging&&(n.preventDefault(),this.select(n))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.lastEvent),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.view.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}},{key:"update",value:function(e){var t=this;e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((function(){return t.select(t.lastEvent)}),20)}}]),e}();function rn(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=U.get(r))&&n.ignoreEvent(t))return!1;return!0}var on=Object.create(null),an=fe.ie&&fe.ie_version<15||fe.ios&&fe.webkit_version<604;function sn(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length,s=null!=On&&r.selection.ranges.every((function(e){return e.empty}))&&On==o.toString();if(s){var c=-1;n=r.changeByRange((function(e){var n=r.doc.lineAt(e.from);if(n.from==c)return{range:e};c=n.from;var s=r.toText((a?o.line(i++).text:t)+r.lineBreak);return{changes:{from:n.from,insert:s},range:h.e.cursor(e.from+s.length)}}))}else n=a?r.changeByRange((function(e){var t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:h.e.cursor(e.from+t.length)}})):r.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}on.keydown=function(e,t){e.inputState.setSelectionOrigin("select")};var cn=0;function ln(e,t,n,r){if(1==r)return h.e.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),o=t-i.from;if(0==i.length)return h.e.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=Object(p.e)(i.text,o,!1):s=Object(p.e)(i.text,o);for(var c=r(i.text.slice(a,s));a>0;){var l=Object(p.e)(i.text,a,!1);if(r(i.text.slice(l,a))!=c)break;a=l}for(;sDate.now()-2e3)){var n,r=null,i=Object(u.a)(e.state.facet($e));try{for(i.s();!(n=i.n()).done;){if(r=(0,n.value)(e,t))break}}catch(a){i.e(a)}finally{i.f()}if(r||0!=t.button||(r=function(e,t){var n=hn(e,t),r=bn(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.docChanged&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes),a=null)},get:function(t,s,c){var l;if(a&&t.clientX==a.clientX&&t.clientY==a.clientY?l=o:(l=o=hn(e,t),a=t),!l||!n)return i;var u=ln(e,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){var f=ln(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),p=Math.max(f.to,u.to);u=d=t.top&&e<=t.bottom},fn=function(e,t,n){return un(t,n)&&e>=n.left&&e<=n.right};function dn(e,t,n,r){var i=Re.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&fn(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&fn(n,r,s)?1:a&&un(r,a)?-1:1}function hn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:dn(e,n,t.clientX,t.clientY)}}var pn=fe.ie&&fe.ie_version<=11,vn=null,mn=0,gn=0;function bn(e){if(!pn)return e.detail;var t=vn,n=gn;return vn=e,gn=Date.now(),mn=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(mn+1)%3:1}function yn(e,t,n,r){var i=e.posAtCoords({x:t.clientX,y:t.clientY});if(null!=i&&n){t.preventDefault();var o=e.inputState.mouseSelection,a=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:i,insert:n},c=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}on.dragstart=function(e,t){var n=e.state.selection.main,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")},on.drop=function(e,t){if(t.dataTransfer){if(e.state.readOnly)return t.preventDefault();var n=t.dataTransfer.files;n&&n.length?function(){t.preventDefault();for(var r=Array(n.length),i=0,o=function(){++i==n.length&&yn(e,t,r.filter((function(e){return null!=e})).join(e.state.lineBreak),!1)},a=function(e){var t=new FileReader;t.onerror=o,t.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])},s=0;sc&&(n.push(d.text),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),c=d.number}}catch(h){l.e(h)}finally{l.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){On=o?r:null;var a=an?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.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.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})}},on.focus=on.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},on.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},on.compositionstart=on.compositionupdate=function(e){null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.docView.compositionDeco.size&&(e.observer.flush(),wn(e,!0)),e.inputState.composing=0)},on.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((function(){e.inputState.composing<0&&wn(e,!1)}),50)},on.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()},on.beforeinput=function(e,t){var n,r;if(fe.chrome&&fe.android&&(r=en.find((function(e){return e.inputType==t.inputType})))&&(e.inputState.setPendingAndroidKey(e,r),"Backspace"==r.key||"Delete"==r.key)){var i=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((function(){var t;((null===(t=window.visualViewport)||void 0===t?void 0:t.height)||0)>i+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};var kn=["pre-wrap","normal","pre-line","break-spaces"],jn=function(){function e(){Object(f.a)(this,e),this.doc=p.a.empty,this.lineWrapping=!1,this.direction=ct.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return Object(d.a)(e,[{key:"heightForGap",value:function(e,t){var n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(e){return this.doc=e,this}},{key:"mustRefreshForStyle",value:function(e,t){return kn.indexOf(e)>-1!=this.lineWrapping||this.direction!=t}},{key:"mustRefreshForHeights",value:function(e){for(var t=!1,n=0;n-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=t;if(this.lineWrapping=a,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var c=0;c2&&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:"outdated",get:function(){return(2&this.flags)>0},set:function(e){this.flags=(e?2:0)|-3&this.flags}},{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>Mn&&(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,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,c=a.toA,l=a.fromB,u=a.toB,f=i.lineAt(s,Cn.ByPosNoHeight,t,0,0),d=f.to>=c?f:i.lineAt(c,Cn.ByPosNoHeight,t,0,0);for(u+=d.to-c,c=d.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>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,o-=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}(Pn),En=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this,e,r,Ce.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 An&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof An?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Pn.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}(Tn),An=function(e){Object(a.a)(n,e);var t=Object(s.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),o=i.firstLine,a=i.lastLine,s=i.lineHeight,c=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),l=t.line(o+c),u=l.from,f=l.length;return new Sn(u,f,n+s*c,s,Ce.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==Cn.ByHeight)return this.blockAt(e,n,r,i);if(t==Cn.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new Sn(a,s-a,0,0,Ce.Text)}var c=this.lines(n,i),l=c.firstLine,u=c.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new Sn(d,h,r+u*(p-l),u,Ce.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,c=a.lineHeight,l=Math.max(e,i),u=Math.min(i+this.length,t);l<=u;){var f=n.lineAt(l);l==e&&(r+=c*(f.number-s)),o(new Sn(f.from,f.length,r,c,Ce.Text)),r+=c,l=f.to+1}}},{key:"replace",value:function(e,t,r){var i=this.length-t;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(e>0){var a=r[0];a instanceof n?r[0]=new n(e+a.length):r.unshift(new n(e-1),null)}return Pn.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,o=t+this.length;if(i&&i.from<=t+this.length&&i.more){var a=[],s=Math.max(t,i.from),c=-1,l=e.heightChanged;for(i.from>t&&a.push(new n(i.from-t-1).updateHeight(e,t));s<=o&&i.more;){var u=e.doc.lineAt(s).length;a.length&&a.push(null);var f=i.heights[i.index++];-1==c?c=f:Math.abs(f-c)>=Mn&&(c=-2);var d=new En(u,f);d.outdated=!1,a.push(d),s+=u+1}s<=o&&a.push(null,new n(o-s).updateHeight(e,s));var h=Pn.of(a);return e.heightChanged=l||c<0||Math.abs(h.height-this.height)>=Mn||Math.abs(c-this.lines(e.doc,t).lineHeight)>=Mn,h}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}(Pn),Dn=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,o.right=i,o.size=e.size+i.size,o}return Object(d.a)(n,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return ea))return c;var l=t==Cn.ByPosNoHeight?Cn.ByPosNoHeight:Cn.ByPos;return s?c.join(this.right.lineAt(a,l,n,o,a)):this.left.lineAt(a,l,n,r,i).join(c)}},{key:"forEachLine",value:function(e,t,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,a,s,o);else{var c=this.lineAt(s,Cn.ByPos,n,r,i);e=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,a,s,o)}}},{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 o,a=i.length,s=Object(u.a)(n);try{for(s.s();!(o=s.n()).done;){var c=o.value;i.push(c)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&Rn(i,a-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?Pn.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,o=this.right,a=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<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),n}(Pn);function Rn(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof An&&(r=e[t+1])instanceof An&&e.splice(t-1,3,new An(n.length+1+r.length))}var Nn=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:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{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 En?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new En(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 En(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new An(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 En)return e;var t=new En(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Ce.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Ce.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 En||this.isCovered?(this.writtenTo1&&void 0!==arguments[1]&&arguments[1];Object(f.a)(this,e),this.range=t,this.center=n}return Object(d.a)(e,[{key:"map",value:function(t){return t.empty?this:new e(this.range.map(t),this.center)}}]),e}(),Fn=function(){function e(t){Object(f.a)(this,e),this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.heightOracle=new jn,this.scaler=qn,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.heightMap=Pn.empty().applyChanges(t.facet(it),p.a.empty,this.heightOracle.setDoc(t.doc),[new at(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Me.set(this.lineGaps.map((function(e){return e.draw(!1)}))),this.computeVisibleRanges()}return Object(d.a)(e,[{key:"updateForViewport",value:function(){for(var e=this,t=[this.viewport],n=this.state.selection.main,r=function(r){var i=r?n.head:n.anchor;if(!t.some((function(e){var t=e.from,n=e.to;return i>=t&&i<=n}))){var o=e.lineBlockAt(i),a=o.from,s=o.to;t.push(new $n(a,s))}},i=0;i<=1;i++)r(i);this.viewports=t.sort((function(e,t){return e.from-t.from})),this.scaler=this.heightMap.height<=7e6?qn:new Qn(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"updateViewportLines",value:function(){var e=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(function(t){e.viewportLines.push(1==e.scaler.scale?t:Un(t,e.scaler))}))}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=e.state;var r=this.state.facet(it),i=e.changedRanges,o=at.extendWithRanges(i,_n(e.startState.facet(it),r,e?e.changes:h.c.empty(this.state.doc.length))),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(r,n.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(e.flags|=2);var s=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));var c=!e.changes.empty||2&e.flags||s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,c&&this.updateViewportLines(),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e){var t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace,o="rtl"==n.direction?ct.RTL:ct.LTR,a=this.heightOracle.mustRefreshForStyle(i,o),s=a||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight,c=0,l=0;if(s){this.mustMeasureContent=!1,this.contentDOMHeight=t.clientHeight;var u=parseInt(n.paddingTop)||0,f=parseInt(n.paddingBottom)||0;this.paddingTop==u&&this.paddingBottom==f||(c|=8,this.paddingTop=u,this.paddingBottom=f)}var d=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),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=e.ownerDocument.body,c=e.parentNode;c&&c!=s;)if(1==c.nodeType){var l=c,u=window.getComputedStyle(l);if((l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth)&&"visible"!=u.overflow){var f=l.getBoundingClientRect();r=Math.max(r,f.left),i=Math.min(i,f.right),o=Math.max(o,f.top),a=Math.min(a,f.bottom)}c="absolute"==u.position||"fixed"==u.position?l.offsetParent:l.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:r-n.left,right:Math.max(r,i)-n.left,top:o-(n.top+t),bottom:Math.max(o,a)-(n.top+t)}}(t,this.paddingTop),h=d.top-this.pixelViewport.top,p=d.bottom-this.pixelViewport.bottom;if(this.pixelViewport=d,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;if(s){var v=e.docView.measureVisibleLineHeights();r.mustRefreshForHeights(v)&&(a=!0);var m=t.clientWidth;if(a||r.lineWrapping&&Math.abs(m-this.contentDOMWidth)>r.charWidth){var g=e.docView.measureTextSize(),b=g.lineHeight,y=g.charWidth;(a=r.refresh(i,o,b,y,m/y,v))&&(e.docView.minWidth=0,c|=8)}this.contentDOMWidth!=m&&(this.contentDOMWidth=m,c|=8),this.editorHeight!=e.scrollDOM.clientHeight&&(this.editorHeight=e.scrollDOM.clientHeight,c|=8),h>0&&p>0?l=Math.max(h,p):h<0&&p<0&&(l=Math.min(h,p)),r.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(r,0,a,new xn(this.viewport.from,v)),r.heightChanged&&(c|=2)}var O=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(this.viewport=this.getViewport(l,this.scrollTarget)),(2&c||O)&&this.updateViewportLines(),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom)}},{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,o=this.visibleTop,a=this.visibleBottom,s=new $n(r.lineAt(o-1e3*n,Cn.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),Cn.ByHeight,i,0,0).to);if(t){var c=t.range.head,l=this.editorHeight;if(cs.to){var u,f=r.lineAt(c,Cn.ByPos,i,0,0);u=t.center?(f.top+f.bottom)/2-l/2:c1&&void 0!==arguments[1]?arguments[1]:0;if(!this.inView)return!0;var i=this.heightMap.lineAt(t,Cn.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,Cn.ByPos,this.state.doc,0,0),s=a.bottom,c=this.visibleTop,l=this.visibleBottom;return(0==t||o<=c-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(r,250)))&&o>c-2e3&&si&&(r.push({from:i,to:e}),o+=e-i),i=t}},20),ii.from&&d.push({from:i.from,to:a}),s=i.from&&h.from<=i.to&&Hn(d,h.from-10,h.from+10),!h.empty&&h.to>=i.from&&h.to<=i.to&&Hn(d,h.to-10,h.to+10);for(var p=function(){var r=g[v],a=r.from,s=r.to;s-a>1e3&&n.push(function(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(o){r.e(o)}finally{r.f()}return}(e,(function(e){return e.from>=i.from&&e.to<=i.to&&Math.abs(e.from-a)<1e3&&Math.abs(e.to-s)<1e3}))||new In(a,s,t.gapSize(i,a,s,o)))},v=0,g=d;v=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((function(t){return t.from<=e&&t.to>=e}))||Un(this.heightMap.lineAt(e,Cn.ByPos,this.state.doc,0,0),this.scaler)}},{key:"lineBlockAtHeight",value:function(e){return Un(this.heightMap.lineAt(this.scaler.fromDOM(e),Cn.ByHeight,this.state.doc,0,0),this.scaler)}},{key:"elementAtHeight",value:function(e){return Un(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}},{key:"docHeight",get:function(){return this.scaler.toDOM(this.heightMap.height)}},{key:"contentHeight",get:function(){return this.docHeight+this.paddingTop+this.paddingBottom}}]),e}(),$n=function e(t,n){Object(f.a)(this,e),this.from=t,this.to=n};function Wn(e,t){var n=e.total,r=e.ranges;if(t<=0)return r[0].from;if(t>=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,c=a.to-s;if(i<=c)return s+i;i-=c}}function Vn(e,t){var n,r=0,i=Object(u.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(t<=s){r+=t-a;break}r+=s-a}}catch(c){i.e(c)}finally{i.f()}return r/e.total}function Hn(e,t,n){for(var r=0;rt){var o=[];i.fromn&&o.push({from:n,to:i.to}),e.splice.apply(e,[r,1].concat(o)),r+=o.length-1}}}var qn={toDOM:function(e){return e},fromDOM:function(e){return e},scale:1},Qn=function(){function e(t,n,r){Object(f.a)(this,e);var i=0,o=0,a=0;this.viewports=r.map((function(e){var r=e.from,o=e.to,a=n.lineAt(r,Cn.ByPos,t,0,0).top,s=n.lineAt(o,Cn.ByPos,t,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,c=Object(u.a)(this.viewports);try{for(c.s();!(s=c.n()).done;){var l=s.value;l.domTop=a+(l.top-o)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}}catch(d){c.e(d)}finally{c.f()}}return Object(d.a)(e,[{key:"toDOM",value:function(e){for(var t=0,n=0,r=0;;t++){var i=t-1}}),Gn=v.a.newName(),Kn=v.a.newName(),Jn=v.a.newName(),Zn={"&light":"."+Kn,"&dark":"."+Jn};function er(e,t,n){return new v.a(t,{finish:function(t){return/&/.test(t)?t.replace(/&\w*/,(function(t){if("&"==t)return e;if(!n||!n[t])throw new RangeError("Unsupported selector: ".concat(t));return n[t]})):e+" "+t}})}var tr=er("."+Gn,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-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%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Zn),nr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},rr=fe.ie&&fe.ie_version<=11,ir=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.selectionRange=new B,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.queue.push(o)}}catch(a){r.e(a)}finally{r.f()}(fe.ie&&fe.ie_version<=11||fe.ios&&t.composing)&&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()})),rr&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver((function(){i.view.docView.lastUpdate0&&e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.intersecting!=i.view.inView&&i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((function(e){e.length>0&&e[e.length-1].intersectionRatio>0&&i.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange(),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}},{key:"updateGaps",value:function(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((function(t,n){return t!=e[n]})))){this.gapIntersection.disconnect();var t,n=Object(u.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.gapIntersection.observe(r)}}catch(i){n.e(i)}finally{n.f()}this.gaps=e}}},{key:"onSelectionChange",value:function(e){if(this.readSelectionRange()){var t=this.view,n=this.selectionRange;if(t.state.facet(Xe)?t.root.activeElement==this.dom:T(t.dom,n)){var r=n.anchorNode&&t.docView.nearest(n.anchorNode);r&&r.ignoreEvent(e)||(fe.ie&&fe.ie_version<=11&&!t.state.selection.main.empty&&n.focusNode&&A(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1))}}}},{key:"readSelectionRange",value:function(){var e=this.view.root,t=M(e),n=fe.safari&&11==e.nodeType&&function(){for(var e=document.activeElement;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}()==this.view.contentDOM&&function(e){var t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;var r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);if(A(s.node,s.offset,o,a)){var c=[o,a,r,i];r=c[0],i=c[1],o=c[2],a=c[3]}return{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}(this.view)||t;return!this.selectionRange.eq(n)&&(this.selectionRange.setRange(n),this.selectionChanged=!0)}},{key:"setSelectionRange",value:function(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}},{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:"processRecords",value:function(){var e,t=this.queue,n=Object(u.a)(this.observer.takeRecords());try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(d){n.e(d)}finally{n.f()}t.length&&(this.queue=[]);var i,o=-1,a=-1,s=!1,c=Object(u.a)(t);try{for(c.s();!(i=c.n()).done;){var l=i.value,f=this.readMutation(l);f&&(f.typeOver&&(s=!0),-1==o?(o=f.from,a=f.to):(o=Math.min(f.from,o),a=Math.max(f.to,a)))}}catch(d){c.e(d)}finally{c.f()}return{from:o,to:a,typeOver:s}}},{key:"flush",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(e&&this.readSelectionRange(),!(this.delayedFlush>=0||this.view.inputState.pendingAndroidKey)){var t=this.processRecords(),n=t.from,r=t.to,i=t.typeOver,o=this.selectionChanged&&T(this.dom,this.selectionRange);if(!(n<0)||o){this.selectionChanged=!1;var a=this.view.state;this.onChange(n,r,i),this.view.state==a&&this.view.update([])}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){var n=or(t,e.previousSibling||e.target.previousSibling,-1),r=or(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"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}},{key:"destroy",value:function(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resize)||void 0===n||n.disconnect();var r,i=Object(u.a)(this.scrollTargets);try{for(i.s();!(r=i.n()).done;){r.value.removeEventListener("scroll",this.onScroll)}}catch(o){i.e(o)}finally{i.f()}window.removeEventListener("scroll",this.onScroll),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}]),e}();function or(e,t,n){for(;t;){var r=U.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}function ar(e,t,n,r){var i,o,a=e.state.selection.main;if(t>-1){var s=e.docView.domBoundsAround(t,n,0);if(!s||e.state.readOnly)return;var c=s.from,l=s.to,u=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e){var t=[];if(e.root.activeElement!=e.contentDOM)return t;var n=e.observer.selectionRange,r=n.anchorNode,i=n.anchorOffset,o=n.focusNode,a=n.focusOffset;r&&(t.push(new At(r,i)),o==r&&a==i||t.push(new At(o,a)));return t}(e),f=new Tt(u,e);f.readRange(s.startDOM,s.endDOM),o=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?h.e.single(n+t,r+t):null}(u,c);var d=a.from,p=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||fe.android&&f.text.length0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.sliceDoc(c,l),f.text,d-c,p);v&&(i={from:c+v.from,to:c+v.toA,insert:e.state.toText(f.text.slice(v.from,v.toB))})}else if(e.hasFocus||!e.state.facet(Xe)){var m=e.observer.selectionRange,g=e.docView,b=g.impreciseHead,y=g.impreciseAnchor,O=b&&b.node==m.focusNode&&b.offset==m.focusOffset||!P(e.contentDOM,m.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(m.focusNode,m.focusOffset),w=y&&y.node==m.anchorNode&&y.offset==m.anchorOffset||!P(e.contentDOM,m.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(m.anchorNode,m.anchorOffset);O==a.head&&w==a.anchor||(o=h.e.single(w,O))}if(i||o)if(!i&&r&&!a.empty&&o&&o.main.empty?i={from:a.from,to:a.to,insert:e.state.doc.slice(a.from,a.to)}:i&&i.from>=a.from&&i.to<=a.to&&(i.from!=a.from||i.to!=a.to)&&a.to-a.from-(i.to-i.from)<=4&&(i={from:a.from,to:a.to,insert:e.state.doc.slice(a.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,a.to))}),i){var k=e.state;if(fe.ios&&e.inputState.flushIOSKey(e))return;if(fe.android&&(i.from==a.from&&i.to==a.to&&1==i.insert.length&&2==i.insert.lines&&V(e.contentDOM,"Enter",13)||i.from==a.from-1&&i.to==a.to&&0==i.insert.length&&V(e.contentDOM,"Backspace",8)||i.from==a.from&&i.to==a.to+1&&0==i.insert.length&&V(e.contentDOM,"Delete",46)))return;var j,x=i.insert.toString();if(e.state.facet(He).some((function(t){return t(e,i.from,i.to,x)})))return;if(e.inputState.composing>=0&&e.inputState.composing++,i.from>=a.from&&i.to<=a.to&&i.to-i.from>=(a.to-a.from)/3&&(!o||o.main.empty&&o.main.from==i.from+i.insert.length)){var S=a.fromi.to?k.sliceDoc(i.to,a.to):"";j=k.replaceSelection(e.state.toText(S+i.insert.sliceString(0,void 0,e.state.lineBreak)+C))}else{var M=k.changes(i);j={changes:M,selection:o&&!k.selection.main.eq(o.main)&&o.main.to<=M.newLength?k.selection.replaceRange(o.main):void 0}}var T="input.type";e.composing&&(T+=".compose",e.inputState.compositionFirstChange&&(T+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(j,{scrollIntoView:!0,userEvent:T})}else if(o&&!o.main.eq(a)){var E=!1,A="select";e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(E=!0),A=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:E,userEvent:A})}}var sr=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),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||H(n.parent)||document,this.viewState=new Fn(n.state||h.f.create()),this.plugins=this.state.facet(Je).map((function(e){return new tt(e)}));var r,i=Object(u.a)(this.plugins);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.update(this)}}catch(a){i.e(a)}finally{i.f()}this.observer=new ir(this,(function(e,n,r){ar(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.observer.intersecting&&t.measure()})),this.inputState=new Zt(this),this.docView=new Dt(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,fr(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Object(d.a)(e,[{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>0}},{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof h.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");var t,n,r=!1,i=this.state,o=Object(u.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=a.state}}catch(y){o.e(y)}finally{o.f()}if(this.destroyed)this.viewState.state=i;else{if(i.facet(h.f.phrases)!=this.state.facet(h.f.phrases))return this.setState(i);t=new st(this,i,e);var s=null;try{this.updateState=2;var c,l=Object(u.a)(e);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(s&&(s=s.map(f.changes)),f.scrollIntoView){var d=f.state.selection.main;s=new Bn(d.empty?d:h.e.cursor(d.head,d.head>d.anchor?-1:1))}var p,v=Object(u.a)(f.effects);try{for(v.s();!(p=v.n()).done;){var m=p.value;m.is(qe)?s=new Bn(m.value):m.is(Qe)&&(s=new Bn(m.value,!0))}}catch(y){v.e(y)}finally{v.f()}}}catch(y){l.e(y)}finally{l.f()}this.viewState.update(t,s),this.bidiCache=pr.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),r=this.docView.update(t),this.state.facet(ot)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(r,e.some((function(e){return e.isUserEvent("select.pointer")})))}finally{this.updateState=0}if((r||s||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!t.empty){var g,b=Object(u.a)(this.state.facet(Ve));try{for(b.s();!(g=b.n()).done;){(0,g.value)(t)}}catch(y){b.e(y)}finally{b.f()}}}}},{key:"setState",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=e;else{this.updateState=2;try{var t,n=Object(u.a)(this.plugins);try{for(n.s();!(t=n.n()).done;){t.value.destroy(this)}}catch(o){n.e(o)}finally{n.f()}this.viewState=new Fn(e),this.plugins=e.facet(Je).map((function(e){return new tt(e)})),this.pluginMap.clear();var r,i=Object(u.a)(this.plugins);try{for(i.s();!(r=i.n()).done;){r.value.update(this)}}catch(o){i.e(o)}finally{i.f()}this.docView=new Dt(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}}},{key:"updatePlugins",value:function(e){var t=e.startState.facet(Je),n=e.state.facet(Je);if(t!=n){var r,i=[],o=Object(u.a)(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=t.indexOf(a);if(s<0)i.push(new tt(a));else{var c=this.plugins[s];c.mustUpdate=e,i.push(c)}}}catch(m){o.e(m)}finally{o.f()}var l,f=Object(u.a)(this.plugins);try{for(f.s();!(l=f.n()).done;){var d=l.value;d.mustUpdate!=e&&d.destroy(this)}}catch(m){f.e(m)}finally{f.f()}this.plugins=i,this.pluginMap.clear(),this.inputState.ensureHandlers(this)}else{var h,p=Object(u.a)(this.plugins);try{for(p.s();!(h=p.n()).done;){h.value.mustUpdate=e}}catch(m){p.e(m)}finally{p.f()}}for(var v=0;v0&&void 0!==arguments[0])||arguments[0];if(!this.destroyed){this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,t&&this.observer.flush();var n=null;try{for(var r=0;;r++){this.updateState=1;var i=this.viewport,o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(r>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}var a=[];if(!(4&o)){var s=[a,this.measureRequests];this.measureRequests=s[0],a=s[1]}var c=a.map((function(t){try{return t.read(e)}catch(n){return Ue(e.state,n),hr}})),l=new st(this,this.state),f=!1;l.flags|=o,n?n.flags|=o:n=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),f=this.docView.update(l));for(var d=0;d-1&&this.measure(!1)}},{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.lineBlockAt(e).moveY(t+this.viewState.paddingTop)}},{key:"lineBlockAt",value:function(e){return this.viewState.lineBlockAt(e)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"moveByChar",value:function(e,t,n){return Jt(this,e,Kt(this,e,t,n))}},{key:"moveByGroup",value:function(e,t){var n=this;return Jt(this,e,Kt(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==h.d.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 Gt(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return Jt(this,e,function(e,t,n,r){var i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return h.e.cursor(i);var a,s=t.goalColumn,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i),u=e.documentTop;if(l)null==s&&(s=l.left-c.left),a=o<0?l.top:l.bottom;else{var f=e.viewState.lineBlockAt(i-u);null==s&&(s=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-f.from))),a=(o<0?f.top:f.bottom)+u}for(var d=c.left+s,p=null!==r&&void 0!==r?r:e.defaultLineHeight>>1,v=0;;v+=10){var m=a+(p+v)*o,g=Ut(e,{x:d,y:m},!1,o);if(mc.bottom||(o<0?gi))return h.e.cursor(g,void 0,void 0,s)}}(this,e,t,n))}},{key:"scrollPosIntoView",value:function(e){this.dispatch({effects:qe.of(h.e.cursor(e))})}},{key:"domAtPos",value:function(e){return this.docView.domAtPos(e)}},{key:"posAtDOM",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"posAtCoords",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.readMeasured(),Ut(this,e,t)}},{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),o=i[jt.find(i,e-r.from,-1,t)];return L(n,o.dir==ct.LTR==t>0)}},{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:"bidiSpans",value:function(e){if(e.length>cr)return Ct(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(a){r.e(a)}finally{r.f()}var o=St(e.text,this.textDirection);return this.bidiCache.push(new pr(e.from,e.to,n,o)),o}},{key:"hasFocus",get:function(){var e;return(document.hasFocus()||fe.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){$(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.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}}],[{key:"domEventHandlers",value:function(e){return Ze.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[Xn.of(n),ot.of(er(".".concat(n),e))];return t&&t.dark&&r.push(Yn.of(!0)),r}},{key:"baseTheme",value:function(e){return h.i.lowest(ot.of(er("."+Gn,e,Zn)))}}]),e}();sr.scrollTo=qe,sr.centerOn=Qe,sr.styleModule=ot,sr.inputHandler=He,sr.exceptionSink=We,sr.updateListener=Ve,sr.editable=Xe,sr.mouseSelectionStyle=$e,sr.dragMovesSelection=Fe,sr.clickAddsSelectionRange=Be,sr.decorations=it,sr.contentAttributes=rt,sr.editorAttributes=nt,sr.lineWrapping=sr.contentAttributes.of({class:"cm-lineWrapping"}),sr.announce=h.j.define();var cr=4096;function lr(e,t){return(null==e?t.contentDOM.getBoundingClientRect().top:e)+t.viewState.paddingTop}var ur=-1;function fr(){window.addEventListener("resize",(function(){-1==ur&&(ur=setTimeout(dr,50))}))}function dr(){ur=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t=0;i--){var o=r[i],a="function"==typeof o?o(e):o;a&&ke(a,n)}return n}var mr=fe.mac?"mac":fe.windows?"win":fe.linux?"linux":"key";function gr(e,t){var n,r,i,o,a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:mr,r=Object.create(null),i=Object.create(null),o=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")},a=function(e,t,i,a){for(var s=r[e]||(r[e]=Object.create(null)),c=t.split(/ (?!$)/).map((function(e){return gr(e,n)})),l=function(t){var n=c.slice(0,t).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=xr={view:t,prefix:n,scope:e};return setTimeout((function(){xr==r&&(xr=null)}),Sr),!0}]})},u=1;u0&&void 0!==arguments[0]?arguments[0]:{};return[Pr.of(e),Ar,Rr]}var Er=function(){function e(t,n,r,i,o){Object(f.a)(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=o}return Object(d.a)(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,this.adjust(e),e}},{key:"adjust",value:function(e){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"}},{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}(),Ar=Ze.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="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-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(Pr).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.startState.facet(Pr)!=e.state.facet(Pr);(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(Pr),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==ct.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),s=Nr(e),c=window.getComputedStyle(o.firstChild),l=a.left+parseInt(c.paddingLeft),f=a.right-parseInt(c.paddingRight),d=Lr(e,n),h=Lr(e,r),p=d.type==Ce.Text?d:null,v=h.type==Ce.Text?h:null;e.lineWrapping&&(p&&(p=_r(e,n,p)),v&&(v=_r(e,r,v)));if(p&&v&&p.from==v.from)return O(w(t.from,t.to,p));var m=p?w(t.from,null,p):k(d,!1),g=v?w(null,t.to,v):k(h,!0),b=[];return(p||d).to<(v||h).from-1?b.push(y(l,m.bottom,f,g.top)):m.bottomh&&m.from=b)break;x>g&&c(Math.max(j,g),null==t&&j<=h,Math.min(x,b),null==n&&x>=p,k.dir)}}catch(S){w.e(S)}finally{w.f()}if((g=O.to+1)>=b)break}}}catch(S){v.e(S)}finally{v.f()}return 0==s.length&&c(h,null==t,p,null==n,e.textDirection),{top:o,bottom:a,horizontal:s}}function k(e,t){var n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),o=[],a=Object(u.a)(n.selection.ranges);try{for(a.s();!(e=a.n()).done;){var s=e.value,c=s==n.selection.main;if(s.empty?!c||Mr:r.drawRangeCursor){var l=Ir(this.view,s,c);l&&o.push(l)}}}catch(f){a.e(f)}finally{a.f()}return{rangePieces:i,cursors:o}}},{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,o=Object(u.a)(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(d){o.e(d)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var c,l=Object(u.a)(r);try{for(l.s();!(c=l.n()).done;){var f=c.value;this.cursorLayer.appendChild(f.draw())}}catch(d){l.e(d)}finally{l.f()}}else r.forEach((function(e,t){return e.adjust(s[t])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),Dr={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Mr&&(Dr[".cm-line"].caretColor="transparent !important");var Rr=h.i.highest(sr.theme(Dr));function Nr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ct.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function _r(e,t,n){var r=h.e.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(r,!0,!0).from),type:Ce.Text}}function Lr(e,t){var n=e.lineBlockAt(t);if(Array.isArray(n.type)){var r,i=Object(u.a)(n.type);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.to>t||o.to==t&&(o.to==n.to||o.type==Ce.Text))return o}}catch(a){i.e(a)}finally{i.f()}}return n}function Ir(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=Nr(e);return new Er(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}function zr(e,t,n,r,i){t.lastIndex=0;for(var o,a=e.iterRange(n,r),s=n;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=t.exec(a.value);)i(s+o.index,s+o.index+o[0].length,o)}var Br=function(){function e(t){Object(f.a)(this,e);var n=t.regexp,r=t.decoration,i=t.boundary;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=n,this.getDeco="function"==typeof r?r:function(){return r},this.boundary=i}return Object(d.a)(e,[{key:"createDeco",value:function(e){var t,n=this,r=new m.b,i=Object(u.a)(e.visibleRanges);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=o.from,s=o.to;zr(e.state.doc,this.regexp,a,s,(function(t,i,o){return r.add(t,i,n.getDeco(o,e,t))}))}}catch(c){i.e(c)}finally{i.f()}return r.finish()}},{key:"updateDeco",value:function(e,t){var n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((function(t,i,o,a){a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}},{key:"updateRange",value:function(e,t,n,r){var i,o=this,a=Object(u.a)(e.visibleRanges);try{for(a.s();!(i=a.n()).done;){var s=i.value,c=Math.max(s.from,n),l=Math.min(s.to,r);l>c&&function(){var n=e.state.doc.lineAt(c),r=n.ton.from;c--)if(o.boundary.test(n.text[c-1-n.from])){i=c;break}for(;la},add:u})}()}}catch(f){a.e(f)}finally{a.f()}return t}}]),e}(),Fr=null!=/x/.unicode?"gu":"g",$r=new RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\ufeff\ufff9-\ufffc]",Fr),Wr={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",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Vr=null;var Hr=h.g.define({combine:function(e){var t=Object(h.m)(e,{render:null,specialChars:$r,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==Vr&&"undefined"!=typeof document&&document.body){var t=document.body.style;Vr=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return Vr||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,Fr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Fr)),t}});function qr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[Hr.of(e),Ur()]}var Qr=null;function Ur(){return Qr||(Qr=Ze.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=Me.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Hr)),this.decorations=this.decorator.createDeco(t)}return Object(d.a)(e,[{key:"makeDecorator",value:function(e){var t=this;return new Br({regexp:e.specialChars,decoration:function(n,r,i){var o=r.state.doc,a=Object(p.b)(n[0],0);if(9==a){var s=o.lineAt(i),c=r.state.tabSize,l=Object(p.d)(s.text,c,i-s.from);return Me.replace({widget:new Yr((c-l%c)*t.view.defaultCharacterWidth)})}return t.decorationCache[a]||(t.decorationCache[a]=Me.replace({widget:new Xr(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}},{key:"update",value:function(e){var t=e.state.facet(Hr);e.startState.facet(Hr)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}}]),e}(),{decorations:function(e){return e.decorations}}))}var Xr=function(e){Object(a.a)(n,e);var t=Object(s.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(e){var t,n=(t=this.code)>=32?"\u2022":10==t?"\u2424":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(Wr[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;var o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}},{key:"ignoreEvent",value:function(){return!1}}]),n}(Se),Yr=function(e){Object(a.a)(n,e);var t=Object(s.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="cm-tab",e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(Se);function Gr(){return Jr}var Kr=Me.line({class:"cm-activeLine"}),Jr=Ze.fromClass(function(){function e(t){Object(f.a)(this,e),this.decorations=this.getDeco(t)}return Object(d.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=[],i=Object(u.a)(e.state.selection.ranges);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(!o.empty)return Me.none;var a=e.lineBlockAt(o.head);a.from>n&&(r.push(Kr.range(a.from)),n=a.from)}}catch(s){i.e(s)}finally{i.f()}return Me.set(r)}}]),e}(),{decorations:function(e){return e.decorations}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(144),i=n(74);var o=n(68);function a(e){return function(e){var t=e.props,n=e.name,o=e.defaultTheme,a=Object(i.a)(o);return Object(r.a)({theme:a,name:n,props:t})}({props:e.props,name:e.name,defaultTheme:o.a})}},function(e,t,n){"use strict";var r=n(175);t.a=r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);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 o(e){for(var t=1;te)return f[t-1]<=e;return!1}function p(e){return e>=127462&&e<=127487}function v(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?m:g)(e,t)}function m(e,t){if(t==e.length)return t;t&&b(e.charCodeAt(t))&&y(e.charCodeAt(t-1))&&t--;var n=O(e,t);for(t+=k(n);t=0&&p(O(e,o));)i++,o-=2;if(i%2==0)break;t+=2}}return t}function g(e,t){for(;t>0;){var n=m(e,t-2);if(n=56320&&e<57344}function y(e){return e>=55296&&e<56320}function O(e,t){var n=e.charCodeAt(t);if(!y(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return b(r)?r-56320+(n-55296<<10)+65536:n}function w(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function k(e){return e<65536?1:2}function j(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0;i=t)return i;if(i==e.length)break;o+=9==e.charCodeAt(i)?n-o%n:1,i=v(e,i)}return!0===r?-1:e.length}var S=function(){function e(){Object(l.a)(this,e)}return Object(u.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));return this.lineInner(e,!1,1,0)}},{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"));return this.lineInner(e,!0,1,0)}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),M.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return this.replace(this.length,this.length,e)}},{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,0),M.from(n,t-e)}},{key:"eq",value:function(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;for(var t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new A(this),i=new A(e),o=t,a=t;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new A(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new D(this,e,t)}},{key:"iterLines",value:function(e,t){var n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);var r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new R(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var e=[];return this.flatten(e),e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new C(t):M.from(C.split(t,[])):e.empty}}]),e}(),C=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P(e);return Object(l.a)(this,n),(r=t.call(this)).text=e,r.length=i,r}return Object(u.a)(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new N(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,t,r,i){var o=e<=0&&t>=this.length?this:new n(E(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=T(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var c=s.length>>1;r.push(new n(s.slice(0,c)),new n(s.slice(c)))}}else r.push(o)}},{key:"replace",value:function(e,t,r){if(!(r instanceof n))return Object(o.a)(Object(a.a)(n.prototype),"replace",this).call(this,e,t,r);var i=T(this.text,T(r.text,E(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new n(i,s):M.from(n.split(i,[]),s)}},{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,o=0;i<=t&&oe&&o&&(r+=n),ei&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){var t,n=Object(i.a)(this.text);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(e,t){var r,o=[],a=-1,s=Object(i.a)(e);try{for(s.s();!(r=s.n()).done;){var c=r.value;o.push(c),a+=c.length+1,32==o.length&&(t.push(new n(o,a)),o=[],a=-1)}}catch(l){s.e(l)}finally{s.f()}return a>-1&&t.push(new n(o,a)),t}}]),n}(S),M=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(e,r){var o;Object(l.a)(this,n),(o=t.call(this)).children=e,o.length=r,o.lines=0;var a,s=Object(i.a)(e);try{for(s.s();!(a=s.n()).done;){var c=a.value;o.lines+=c.lines}}catch(u){s.e(u)}finally{s.f()}return o}return Object(u.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(e,t,n,r){for(var i=0,o=0;o<=t&&i=o){var c=r&((o<=e?1:0)|(s>=t?2:0));o>=e&&s<=t&&!c?n.push(a):a.decompose(e-o,t-o,n,c)}o=s+1}}},{key:"replace",value:function(e,t,r){if(r.lines=s&&t<=l){var u=c.replace(e-s,t-s,r),f=this.lines-c.lines+u.lines;if(u.lines>4&&u.lines>f>>6){var d=this.children.slice();return d[i]=u,new n(d,this.length-(t-e)+r.length)}return Object(o.a)(Object(a.a)(n.prototype),"replace",this).call(this,s,l,u)}s=l+1}return Object(o.a)(Object(a.a)(n.prototype),"replace",this).call(this,e,t,r)}},{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,o=0;ie&&i&&(r+=n),eo&&(r+=a.sliceString(e-o,t-o,n)),o=s+1}return r}},{key:"flatten",value:function(e){var t,n=Object(i.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"scanIdentical",value:function(e,t){if(!(e instanceof n))return 0;for(var i=0,o=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1],a=Object(r.a)(o,4),s=a[0],c=a[1],l=a[2],u=a[3];;s+=t,c+=t){if(s==l||c==u)return i;var f=this.children[s],d=e.children[c];if(f!=d)return i+f.scanIdentical(d,t);i+=f.length+1}}}],[{key:"from",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.reduce((function(e,t){return e+t.length+1}),-1),o=0,a=Object(i.a)(e);try{for(a.s();!(t=a.n()).done;){var s=t.value;o+=s.lines}}catch(x){a.e(x)}finally{a.f()}if(o<32){var c,l=[],u=Object(i.a)(e);try{for(u.s();!(c=u.n()).done;){var f=c.value;f.flatten(l)}}catch(x){u.e(x)}finally{u.f()}return new C(l,r)}var d=Math.max(32,o>>5),h=d<<1,p=d>>1,v=[],m=0,g=-1,b=[];function y(e){var t;if(e.lines>h&&e instanceof n){var r,o=Object(i.a)(e.children);try{for(o.s();!(r=o.n()).done;){y(r.value)}}catch(x){o.e(x)}finally{o.f()}}else e.lines>p&&(m>p||!m)?(O(),v.push(e)):e instanceof C&&m&&(t=b[b.length-1])instanceof C&&e.lines+t.lines<=32?(m+=e.lines,g+=e.length+1,b[b.length-1]=new C(t.text.concat(e.text),t.length+1+e.length)):(m+e.lines>d&&O(),m+=e.lines,g+=e.length+1,b.push(e))}function O(){0!=m&&(v.push(1==b.length?b[0]:n.from(b,g)),g=-1,m=b.length=0)}var w,k=Object(i.a)(e);try{for(k.s();!(w=k.n()).done;){var j=w.value;y(j)}}catch(x){k.e(x)}finally{k.f()}return O(),1==v.length?v[0]:new n(v,r)}}]),n}(S);function P(e){var t,n=-1,r=Object(i.a)(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(o){r.e(o)}finally{r.f()}return n}function T(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,o=0,a=!0;o=n&&(c>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?1:(t instanceof C?t.text.length:t.children.length)<<1]}return Object(u.a)(e,[{key:"nextInner",value:function(e,t){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof C?r.text.length:r.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof C){var s=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,s.length>Math.max(0,e))return this.value=0==e?s:t>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{var c=r.children[o+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof C?c.text.length:c.children.length)<<1))}}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}]),e}(),D=function(){function e(t,n,r){Object(l.a)(this,e),this.value="",this.done=!1,this.cursor=new A(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return Object(u.a)(e,[{key:"nextInner",value:function(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);var n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;var r=this.cursor.next(e).value;return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),e}(),R=function(){function e(t){Object(l.a)(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return Object(u.a)(e,[{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.inner.next(e),n=t.done,r=t.lineBreak,i=t.value;return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();"undefined"!=typeof Symbol&&(S.prototype[Symbol.iterator]=function(){return this.iter()},A.prototype[Symbol.iterator]=D.prototype[Symbol.iterator]=R.prototype[Symbol.iterator]=function(){return this});var N=function(){function e(t,n,r,i){Object(l.a)(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return Object(u.a)(e,[{key:"length",get:function(){return this.to-this.from}}]),e}()},function(e,t,n){"use strict";n.d(t,"b",(function(){return a}));var r=n(3),i=n(175),o=n(36);function a(e,t){return t&&"string"===typeof t?t.split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e):null}function s(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||i:a(e,n)||i,t&&(r=t(r)),r}t.a=function(e){var t=e.prop,n=e.cssProperty,c=void 0===n?e.prop:n,l=e.themeKey,u=e.transform,f=function(e){if(null==e[t])return null;var n=e[t],f=a(e.theme,l)||{};return Object(o.b)(e,n,(function(e){var n=s(f,u,e);return e===n&&"string"===typeof e&&(n=s(f,u,"".concat(t).concat("default"===e?"":Object(i.a)(e)),e)),!1===c?n:Object(r.a)({},c,n)}))};return f.propTypes={},f.filterProps=[t],f}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(90);var i=n(102),o=n(67);function a(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.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,"a",(function(){return s}));var r=n(37);function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=n(92);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}function s(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Object(r.a)(e);if(t){var o=Object(r.a)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return a(this,n)}}},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return W})),n.d(t,"d",(function(){return P})),n.d(t,"e",(function(){return E})),n.d(t,"f",(function(){return B})),n.d(t,"g",(function(){return T})),n.d(t,"h",(function(){return M})),n.d(t,"i",(function(){return S})),n.d(t,"j",(function(){return m}));var r=n(23),i=n(22),o=n(4),a=n(5),s=n(8),c=n(25),l=n(6),u=n(13),f=n(19),d=new c.b;var h=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];Object(a.a)(this,e),this.data=t,this.topNode=r,l.f.prototype.hasOwnProperty("tree")||Object.defineProperty(l.f.prototype,"tree",{get:function(){return m(this)}}),this.parser=n,this.extension=[S.of(this),l.f.languageData.of((function(e,t,n){return e.facet(p(e,t,n))}))].concat(i)}return Object(s.a)(e,[{key:"isActiveAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return p(e,t,n)==this.data}},{key:"findRegions",value:function(e){var t=this,n=e.facet(S);if((null===n||void 0===n?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return function e(n,i){if(n.prop(d)!=t.data){var a=n.prop(c.b.mounted);if(a){if(a.tree.prop(d)==t.data){if(a.overlay){var s,l=Object(o.a)(a.overlay);try{for(l.s();!(s=l.n()).done;){var u=s.value;r.push({from:u.from+i,to:u.to+i})}}catch(v){l.e(v)}finally{l.f()}}else r.push({from:i,to:i+n.length});return}if(a.overlay){var f=r.length;if(e(a.tree,a.overlay[0].from+i),r.length>f)return}}for(var h=0;h0}}],[{key:"define",value:function(e){var t,r=(t=e.languageData,l.g.define({combine:t?function(e){return e.concat(t)}:void 0}));return new n(r,e.parser.configure({props:[d.add((function(e){return e.isTop?r:void 0}))]}))}}]),n}(h);function m(e){var t=e.field(h.state,!1);return t?t.tree:c.f.empty}var g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;Object(a.a)(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Object(s.a)(e,[{key:"syncTo",value:function(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}},{key:"chunk",value:function(e){return this.syncTo(e),this.string}},{key:"lineChunks",get:function(){return!0}},{key:"read",value:function(e,t){var n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}]),e}(),b=null,y=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0;Object(a.a)(this,e),this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=c,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}return Object(s.a)(e,[{key:"startParse",value:function(){return this.parser.startParse(new g(this.state.doc),this.fragments)}},{key:"work",value:function(e,t){var n=this;return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=c.f.empty&&this.isDone(null!==t&&void 0!==t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((function(){var r;n.parse||(n.parse=n.startParse()),null!=t&&(null==n.parse.stoppedAt||n.parse.stoppedAt>t)&&ti)return!1}}))}},{key:"takeTree",value:function(){var e,t,n=this;this.parse&&(e=this.parse.parsedPos)>this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((function(){for(;!(t=n.parse.advance()););})),this.tree=t,this.fragments=this.withoutTempSkipped(c.g.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(e){var t=b;b=this;try{return e()}finally{b=t}}},{key:"withoutTempSkipped",value:function(e){for(var t;t=this.tempSkipped.pop();)e=O(e,t.from,t.to);return e}},{key:"changes",value:function(t,n){var r=this.fragments,i=this.tree,a=this.treeLen,s=this.viewport,l=this.skipped;if(this.takeTree(),!t.empty){var u=[];if(t.iterChangedRanges((function(e,t,n,r){return u.push({fromA:e,toA:t,fromB:n,toB:r})})),r=c.g.applyChanges(r,u),i=c.f.empty,a=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){l=[];var f,d=Object(o.a)(this.skipped);try{for(d.s();!(f=d.n()).done;){var h=f.value,p=t.mapPos(h.from,1),v=t.mapPos(h.to,-1);pe.from&&(this.fragments=O(this.fragments,i,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}},{key:"reset",value:function(){this.parse&&(this.takeTree(),this.parse=null)}},{key:"skipUntilInView",value:function(e,t){this.skipped.push({from:e,to:t})}},{key:"movedPast",value:function(e){return this.treeLen=e}},{key:"isDone",value:function(e){var t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}}],[{key:"getSkippingParser",value:function(e){return new(function(t){Object(r.a)(l,t);var n=Object(i.a)(l);function l(){return Object(a.a)(this,l),n.apply(this,arguments)}return Object(s.a)(l,[{key:"createParse",value:function(t,n,r){var i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance:function(){var t=b;if(t){var n,s=Object(o.a)(r);try{for(s.s();!(n=s.n()).done;){var l=n.value;t.tempSkipped.push(l)}}catch(u){s.e(u)}finally{s.f()}e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new c.f(c.d.none,[],[],a-i)},stoppedAt:null,stopAt:function(){}}}}]),l}(c.e))}},{key:"get",value:function(){return b}}]),e}();function O(e,t,n){return c.g.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var w=function(){function e(t){Object(a.a)(this,e),this.context=t,this.tree=t.tree}return Object(s.a)(e,[{key:"apply",value:function(t){if(!t.docChanged)return this;var n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(25,r)||n.takeTree(),new e(n)}}],[{key:"init",value:function(t){var n=new y(t.facet(S).parser,t,[],c.f.empty,0,{from:0,to:t.doc.length},[],null);return n.work(25)||n.takeTree(),new e(n)}}]),e}();h.state=l.k.define({create:w.init,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(h.setState))return i.value}}catch(a){r.e(a)}finally{r.f()}return t.startState.facet(S)!=t.state.facet(S)?w.init(t.state):e.apply(t)}});var k="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},j="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,x=u.f.fromClass(function(){function e(t){Object(a.a)(this,e),this.view=t,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return Object(s.a)(e,[{key:"update",value:function(e){var t=this.view.state.field(h.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var e=this.view.state,t=e.field(h.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=k(this.work,{timeout:500}))}}},{key:"work",value:function(e){this.working=-1;var t=Date.now();if(this.chunkEnd=i+1e6)){var a=Math.min(this.chunkBudget,e?Math.max(25,e.timeRemaining()):100),s=o.context.work(a,i+1e6);this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0||o.context.movedPast(i))&&(o.context.takeTree(),this.view.dispatch({effects:h.setState.of(new w(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(e){var t=this;e.scheduleOn&&(e.scheduleOn.then((function(){return t.scheduleWork()})),e.scheduleOn=null)}},{key:"destroy",value:function(){this.working>=0&&j(this.working)}}]),e}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),S=l.g.define({combine:function(e){return e.length?e[0]:null},enables:[h.state,x]}),C=l.g.define(),M=l.g.define({combine:function(e){if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function P(e){var t=e.facet(M);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function T(e,t){var n="",r=e.tabSize;if(9==e.facet(M).charCodeAt(0))for(;t>=r;)n+="\t",t-=r;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),this.state=t,this.options=n,this.unit=P(t)}return Object(s.a)(e,[{key:"lineAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.state.doc.lineAt(e),r=this.options.simulateBreak;return null!=r&&r>=n.from&&r<=n.to?(t<0?r1&&void 0!==arguments[1]?arguments[1]:1;if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";var n=this.lineAt(e,t),r=n.text,i=n.from;return r.slice(e-i,Math.min(r.length,e+100-i))}},{key:"column",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}},{key:"countColumn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return Object(f.d)(e,this.state.tabSize,t)}},{key:"lineIndent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.options.overrideIndentation;if(o){var a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}},{key:"simulatedBreak",get:function(){return this.options.simulateBreak||null}}]),e}(),D=new c.b;function R(e){var t=e.type.prop(D);if(t)return t;var n,r=e.firstChild;if(r&&(n=r.type.prop(c.b.closedBy))){var i=e.lastChild,o=i&&n.indexOf(i.name)>-1;return function(e){return z(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?i.from:void 0)}}return null==e.parent?_:null}function N(e,t,n){for(;e;e=e.parent){var r=R(e);if(r)return r(new L(n,t,e))}return null}function _(){return 0}var L=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var o;return Object(a.a)(this,n),(o=t.call(this,e.state,e.options)).base=e,o.pos=r,o.node=i,o}return Object(s.a)(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var e=this.state.doc.lineAt(this.node.from);;){for(var t=this.node.resolve(e.from);t.parent&&t.parent.from==t.from;)t=t.parent;if(I(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}},{key:"continue",value:function(){var e=this.node.parent;return e?N(e,this.pos,this.base):0}}]),n}(A);function I(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function z(e,t,n,r,i){var o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,c=t?function(e){var t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;for(var i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i),s=n.to;;){var c=t.childAfter(s);if(!c||c==r)return null;if(!c.type.isSkipped)return c.fromi.from+200)return e;var a=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(a)})))return e;var s,c=e.state,l=-1,u=[],f=Object(o.a)(c.selection.ranges);try{for(f.s();!(s=f.n()).done;){var d=s.value.head,h=c.doc.lineAt(d);if(h.from!=l){l=h.from;var p=E(c,h.from);if(null!=p){var v=/^\s*/.exec(h.text)[0],m=T(c,p);v!=m&&u.push({from:h.from,to:h.from+v.length,insert:m})}}}}catch(g){f.e(g)}finally{f.f()}return u.length?[e,{changes:u,sequential:!0}]:e}))}var F=l.g.define(),$=new c.b;function W(e,t,n){var r,i=Object(o.a)(e.facet(F));try{for(i.s();!(r=i.n()).done;){var a=(0,r.value)(e,t,n);if(a)return a}}catch(s){i.e(s)}finally{i.f()}return function(e,t,n){var r=m(e);if(0==r.length)return null;for(var i=null,o=r.resolveInner(n);o;o=o.parent)if(!(o.to<=n||o.from>n)){if(i&&o.from=t&&s.to>n&&(i=s)}}return i}(e,t,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return A})),n.d(t,"f",(function(){return v})),n.d(t,"g",(function(){return E}));var r=n(9),i=n(4),o=n(8),a=n(5),s=1024,c=0,l=function e(t,n){Object(a.a)(this,e),this.from=t,this.to=n},u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(a.a)(this,e),this.id=c++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function")}}return Object(o.a)(e,[{key:"add",value:function(e){var t=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=d.match(e)),function(n){var r=e(n);return void 0===r?null:[t,r]}}}]),e}();u.closedBy=new u({deserialize:function(e){return e.split(" ")}}),u.openedBy=new u({deserialize:function(e){return e.split(" ")}}),u.group=new u({deserialize:function(e){return e.split(" ")}}),u.contextHash=new u({perNode:!0}),u.lookAhead=new u({perNode:!0}),u.mounted=new u({perNode:!0});var f=Object.create(null),d=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(a.a)(this,e),this.name=t,this.props=n,this.id=r,this.flags=i}return Object(o.a)(e,[{key:"prop",value:function(e){return this.props[e.id]}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}},{key:"is",value:function(e){if("string"==typeof e){if(this.name==e)return!0;var t=this.prop(u.group);return!!t&&t.indexOf(e)>-1}return this.id==e}}],[{key:"define",value:function(t){var n=t.props&&t.props.length?Object.create(null):f,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),o=new e(t.name||"",n,t.id,r);if(t.props){var a,s=Object(i.a)(t.props);try{for(s.s();!(a=s.n()).done;){var c=a.value;if(Array.isArray(c)||(c=c(o)),c){if(c[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[c[0].id]=c[1]}}}catch(l){s.e(l)}finally{s.f()}}return o}},{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,o=Object(i.a)(n.split(" "));try{for(o.s();!(r=o.n()).done;){var a=r.value;t[a]=e[n]}}catch(s){o.e(s)}finally{o.f()}}return function(e){for(var n=e.prop(u.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}}]),e}();d.none=new d("",Object.create(null),0,8);var h=function(){function e(t){Object(a.a)(this,e),this.types=t;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=null!=e&&p.get(this)||this.topNode,r=new x(n);return null!=e&&(r.moveTo(e,t),p.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new x(this.topNode,1)}},{key:"topNode",get:function(){return new O(this,0,0,null)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor(e,t).node}},{key:"resolveInner",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.topNode;;){var r=n.enter(e,t);if(!r)return n;n=r}}},{key:"iterate",value:function(e){for(var t=e.enter,n=e.leave,r=e.from,i=void 0===r?0:r,o=e.to,a=void 0===o?this.length:o,s=this.cursor(),c=function(){return s.node};;){var l=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==t(s.type,s.from,s.to,c))){if(s.firstChild())continue;s.type.isAnonymous||(l=!0)}for(;l&&n&&n(s.type,s.from,s.to,c),l=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;l=!0}}}},{key:"prop",value:function(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}},{key:"propValues",get:function(){var e=[];if(this.props)for(var t in this.props)e.push([+t,this.props[t]]);return e}},{key:"balance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.children.length<=8?this:T(this.type,this.children,this.positions,0,this.children.length,0,this.length,(function(n,r,i){return new e(t.type,n,r,i,t.propValues)}),n.makeTree||function(t,n,r){return new e(d.none,t,n,r)})}}],[{key:"build",value:function(e){return C(e)}}]),e}();v.empty=new v(d.none,[],[],0);var m=function(){function e(t,n){Object(a.a)(this,e),this.buffer=t,this.index=n}return Object(o.a)(e,[{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}},{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}}]),e}(),g=function(){function e(t,n,r){Object(a.a)(this,e),this.buffer=t,this.length=n,this.set=r}return Object(o.a)(e,[{key:"type",get:function(){return d.none}},{key:"toString",value:function(){for(var e=[],t=0;t0));s=o[s+3]);return a}},{key:"slice",value:function(t,n,r,i){for(var o=this.buffer,a=new Uint16Array(n-t),s=t,c=0;s=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function y(e,t){for(var n=e.childBefore(t);n;){var r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(e=n,n=r.prevSibling):n=r}return e}var O=function(){function e(t,n,r,i){Object(a.a)(this,e),this.node=t,this._from=n,this.index=r,this._parent=i}return Object(o.a)(e,[{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"from",get:function(){return this._from}},{key:"to",get:function(){return this._from+this.node.length}},{key:"nextChild",value:function(t,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=this;;){for(var s=a.node,c=s.children,l=s.positions,f=n>0?c.length:-1;t!=f;t+=n){var d=c[t],h=l[t]+a._from;if(b(i,r,h,h+d.length))if(d instanceof g){if(2&o)continue;var p=d.findChild(0,d.buffer.length,n,r-h,i);if(p>-1)return new j(new k(a,d,t,h),null,p)}else if(1&o||!d.type.isAnonymous||S(d)){var v=void 0;if(d.props&&(v=d.prop(u.mounted))&&!v.overlay)return new e(v.tree,h,t,a);var m=new e(d,h,t,a);return 1&o||!m.type.isAnonymous?m:m.nextChild(n<0?d.children.length-1:0,n,r,i)}}if(1&o||!a.type.isAnonymous)return null;if(t=a.index>=0?a.index+n:n<0?-1:a._parent.node.children.length,!(a=a._parent))return null}}},{key:"firstChild",get:function(){return this.nextChild(0,1,0,4)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,0,4)}},{key:"childAfter",value:function(e){return this.nextChild(0,1,e,2)}},{key:"childBefore",value:function(e){return this.nextChild(this.node.children.length-1,-1,e,-2)}},{key:"enter",value:function(t,n){var r,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(o&&(r=this.node.prop(u.mounted))&&r.overlay){var s,c=t-this.from,l=Object(i.a)(r.overlay);try{for(l.s();!(s=l.n()).done;){var f=s.value,d=f.from,h=f.to;if((n>0?d<=c:d=c:h>c))return new e(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(p){l.e(p)}finally{l.f()}}return this.nextChild(0,1,t,n,a?0:2)}},{key:"nextSignificantParent",value:function(){for(var e=this;e.type.isAnonymous&&e._parent;)e=e._parent;return e}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}},{key:"prevSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}},{key:"cursor",get:function(){return new x(this)}},{key:"tree",get:function(){return this.node}},{key:"toTree",value:function(){return this.node}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(e,t).node}},{key:"enterUnfinishedNodesBefore",value:function(e){return y(this,e)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=w(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return w(this,e,t,n)}},{key:"toString",value:function(){return this.node.toString()}}]),e}();function w(e,t,n,r){var i=e.cursor,o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var k=function e(t,n,r,i){Object(a.a)(this,e),this.parent=t,this.buffer=n,this.index=r,this.start=i},j=function(){function e(t,n,r){Object(a.a)(this,e),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}return Object(o.a)(e,[{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"child",value:function(t,n,r){var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new e(this.context,this,o)}},{key:"firstChild",get:function(){return this.child(1,0,4)}},{key:"lastChild",get:function(){return this.child(-1,0,4)}},{key:"childAfter",value:function(e){return this.child(1,e,2)}},{key:"childBefore",value:function(e){return this.child(-1,e,-2)}},{key:"enter",value:function(t,n,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!i)return null;var o=this.context.buffer,a=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"externalSibling",value:function(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}},{key:"nextSibling",get:function(){var t=this.context.buffer,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var t=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}},{key:"cursor",get:function(){return new x(this)}},{key:"tree",get:function(){return null}},{key:"toTree",value:function(){var e=[],t=[],n=this.context.buffer,r=this.index+4,i=n.buffer[this.index+3];if(i>r){var o=n.buffer[this.index+1],a=n.buffer[this.index+2];e.push(n.slice(r,i,o,a)),t.push(0)}return new v(this.type,e,t,this.to-this.from)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(e,t).node}},{key:"enterUnfinishedNodesBefore",value:function(e){return y(this,e)}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=w(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return w(this,e,t,n)}}]),e}(),x=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Object(a.a)(this,e),this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof O)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}return Object(o.a)(e,[{key:"name",get:function(){return this.type.name}},{key:"yieldNode",value:function(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}},{key:"yieldBuf",value:function(e,t){this.index=e;var n=this.buffer,r=n.start,i=n.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}},{key:"yield",value:function(e){return!!e&&(e instanceof O?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enterChild",value:function(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree.node.children.length-1:0,e,t,n,this.mode));var r=this.buffer.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}},{key:"firstChild",value:function(){return this.enterChild(1,0,4)}},{key:"lastChild",value:function(){return this.enterChild(-1,0,4)}},{key:"childAfter",value:function(e){return this.enterChild(1,e,2)}},{key:"childBefore",value:function(e){return this.enterChild(-1,e,-2)}},{key:"enter",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.buffer?!!r&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n,r))}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(1&this.mode?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var e=1&this.mode?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}},{key:"sibling",value:function(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));var t=this.buffer.buffer,n=this.stack.length-1;if(e<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{var i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(e){var t,n,r=this.buffer;if(r){if(e>0){if(this.index-1)for(var s=t+e,c=e<0?-1:n.node.children.length;s!=c;s+=e){var l=n.node.children[s];if(1&this.mode||l instanceof g||!l.type.isAnonymous||S(l))return!1}}return!0}},{key:"move",value:function(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}},{key:"next",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(1,e)}},{key:"prev",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(-1,e)}},{key:"moveTo",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(var o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(var a=n;al;){var u=n.size;if(n.id==t&&u>=0)c.size=r,c.start=i,c.skip=a,a+=4,r+=4,n.next();else{var h=n.pos-u;if(u<0||h=f?4:0,v=n.start;for(n.next();n.pos>h;){if(n.size<0){if(-3!=n.size)break e;p+=4}else n.id>=f&&(p+=4);n.next()}i=v,r+=u,a+=p}}(t<0||r==e)&&(c.size=r,c.start=i,c.skip=a);return c.size>4?c:void 0}(d.pos-t,a))){for(var A=new Uint16Array(M.size-M.skip),D=d.pos-M.size,R=A.length;d.pos>D;)R=k(M.start,A,R);C=new g(A,m-M.start,r),E=M.start-e}else{var N=d.pos-j;d.next();for(var _=[],L=[],I=s>=f?s:-1,z=0,B=m;d.pos>N;)I>=0&&d.id==I&&d.size>=0?(d.end<=B-o&&(O(_,L,l,z,d.end,B,I,x),z=_.length,B=d.end),d.next()):y(l,N,_,L,I);if(I>=0&&z>0&&z<_.length&&O(_,L,l,z,l,B,I,x),_.reverse(),L.reverse(),I>-1&&z>0){var F=function(e){return function(t,n,r){var i,o,a=0,s=t.length-1;if(s>=0&&(i=t[s])instanceof v){if(!s&&i.type==e&&i.length==r)return i;(o=i.prop(u.lookAhead))&&(a=n[s]+i.length+o)}return w(e,t,n,r,a)}}(P);C=T(P,_,L,0,_.length,0,m-l,F,F)}else C=w(P,_,L,m-l,x-m)}n.push(C),i.push(E)}function O(e,t,n,i,o,a,s,c){for(var l=[],u=[];e.length>i;)l.push(e.pop()),u.push(t.pop()+n-o);e.push(w(r.types[s],l,u,a-o,c-a)),t.push(o-n)}function w(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;if(p){var a=[u.contextHash,p];o=o?[a].concat(o):[a]}if(i>25){var s=[u.lookAhead,i];o=o?[s].concat(o):[s]}return new v(e,t,n,r,o)}function k(e,t,n){var r=d.id,i=d.start,o=d.end,a=d.size;if(d.next(),a>=0&&r4)for(var c=d.pos-(a-4);d.pos>c;)n=k(e,t,n);t[--n]=s,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==a?p=r:-4==a&&(b=r);return n}for(var j=[],x=[];d.pos>0;)y(e.start||0,e.bufferStart||0,j,x,-1);var S=null!==(t=e.length)&&void 0!==t?t:j.length?x[0]+j[0].length:0;return new v(h[e.topID],j.reverse(),x.reverse(),S)}var M=new WeakMap;function P(e,t){if(!e.isAnonymous||t instanceof g||t.type!=e)return 1;var n=M.get(t);return null==n&&(n=t.children.reduce((function(t,n){return t+P(e,n)}),1),M.set(t,n)),n}function T(e,t,n,r,i,o,a,s,c){for(var l=0,u=r;u=f)break;v+=m}if(l==u+1){if(v>f){var g=n[u];t(g.children,g.positions,0,g.children.length,r[u]+s);continue}d.push(n[u])}else{var b=r[l-1]+n[l-1].length-p;d.push(T(e,n,r,u,l,p,b,null,c))}h.push(p+s-o)}}(t,n,r,i,0),(s||c)(d,h,a)}var E=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];Object(a.a)(this,e),this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}return Object(o.a)(e,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"addTree",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[new e(0,t.length,t,0,!1,o)],s=Object(i.a)(r);try{for(s.s();!(n=s.n()).done;){var c=n.value;c.to>t.length&&a.push(c)}}catch(l){s.e(l)}finally{s.f()}return a}},{key:"applyChanges",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return t;for(var i=[],o=1,a=t.length?t[0]:null,s=0,c=0,l=0;;s++){var u=s=r)for(;a&&a.from=d.from||f<=d.to||l){var h=Math.max(d.from,c)-l,p=Math.min(d.to,f)-l;d=h>=p?null:new e(h,p,d.tree,d.offset+l,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=o1&&void 0!==arguments[1]?arguments[1]:e;return new c(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=a.h.TrackDel;var c=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function l(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=function(){function e(t,n,r,o){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=o}return Object(o.a)(e,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,c=i[s]-e||(n?this.value[s].endSide:this.value[s].startSide)-t;if(s==o)return c>=0?o:a;c>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i(h=n.mapPos(f,l.endSide))||d==h&&l.startSide>0&&l.endSide<=0)continue;(h-d||l.endSide-l.startSide)<0||(a<0&&(a=d),l.point&&(s=Math.max(s,h-d)),r.push(l),i.push(d-a),o.push(h-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}}]),e}(),f=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,o=arguments.length>3?arguments[3]:void 0;Object(i.a)(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=o}return Object(o.a)(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.isEmpty)return 0;var e,t=this.nextLayer.size,n=Object(r.a)(this.chunk);try{for(n.s();!(e=n.n()).done;){t+=e.value.value.length}}catch(i){n.e(i)}finally{n.f()}return t}},{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,o=void 0!==i&&i,a=t.filterFrom,s=void 0===a?0:a,u=t.filterTo,f=void 0===u?this.length:u,d=t.filter;if(0==r.length&&!d)return this;if(o&&r.slice().sort(l),this.isEmpty)return r.length?e.of(r):this;for(var p=new v(this,null,-1).goto(0),m=0,g=[],b=new h;p.value||m=0){var y=r[m++];b.addInner(y.from,y.to,y.value)||g.push(y)}else 1==p.rangeIndex&&p.chunkIndexthis.chunkEnd(p.chunkIndex)||fp.to||f=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(e)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{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(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=e.filter((function(e){return e.maxPoint>=500||!e.isEmpty&&t.indexOf(e)<0&&e.maxPoint>=i})),a=t.filter((function(t){return t.maxPoint>=500||!t.isEmpty&&e.indexOf(t)<0&&t.maxPoint>=i})),s=p(o,a),c=new b(o,s,i),l=new b(a,s,i);n.iterGaps((function(e,t,n){return y(c,e,l,t,n,r)})),n.empty&&0==n.length&&y(c,0,l,0,0,r)}},{key:"eq",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;null==r&&(r=1e9);var i=e.filter((function(e){return!e.isEmpty&&t.indexOf(e)<0})),o=t.filter((function(t){return!t.isEmpty&&e.indexOf(t)<0}));if(i.length!=o.length)return!1;if(!i.length)return!0;for(var a=p(i,o),s=new b(i,a,0).goto(n),c=new b(o,a,0).goto(n);;){if(s.to!=c.to||!O(s.active,c.active)||s.point&&(!c.point||!s.point.eq(c.point)))return!1;if(s.to>=r)return!0;s.next(),c.next()}}},{key:"spans",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new b(e,null,i).goto(t),a=t,s=o.openStart;;){var c=Math.min(o.to,n);if(o.point?(r.point(a,c,o.point,o.activeForPoint(o.to),s),s=o.openEnd(c)+(o.to>c?1:0)):c>a&&(r.span(a,c,o.active,s),s=o.openEnd(c)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new h,o=Object(r.a)(e instanceof c?[e]:n?d(e):e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return i.finish()}}]),e}();function d(e){if(e.length>1)for(var t=e[0],n=1;n0)return e.slice().sort(l);t=r}return e}f.empty=new f([],[],null,-1),f.empty.nextLayer=f.empty;var h=function(){function e(){Object(i.a)(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Object(o.a)(e,[{key:"finishChunk",value:function(e){this.chunks.push(new u(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(f.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new f(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();function p(e,t){var n,i=new Map,o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=o}return Object(o.a)(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;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:"setRangeIndex",value:function(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex1&&void 0!==arguments[1]?arguments[1]:-1e9,i=Object(r.a)(this.heap);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.goto(e,n)}}catch(s){i.e(s)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)g(this.heap,a);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(a){i.e(a)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)g(this.heap,o);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,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:"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=[],o=0;o=r&&i.push(new v(a,n,r,o));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=-1e9,this.endSide=0,this.openStart=-1,this.cursor=m.from(t,n,r)}return Object(o.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;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){w(this.active,e),w(this.activeTo,e),w(this.activeRank,e),this.minActive=j(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&w(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var o=this.cursor.value;if(o.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}if(n){for(var a=0;a=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}},{key:"openEnd",value:function(e){for(var t=0,n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}]),e}();function y(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,c=r-t;;){var l=e.to+c-n.to||e.endSide-n.endSide,u=l<0?e.to+c:n.to,f=Math.min(u,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&O(e.activeForPoint(e.to+c),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!O(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),u>a)break;s=u,l<=0&&e.next(),l>=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 j(e,t){for(var n=-1,r=1e9,i=0;i-1?t:v.get(t.base||t,t.modified.concat(e).sort((function(e,t){return e.id-t.id})))}}}]),e}(),p=0,v=function(){function e(){Object(i.a)(this,e),this.instances=[],this.id=p++}return Object(o.a)(e,null,[{key:"get",value:function(t,n){if(!n.length)return t;var i=n[0].instances.find((function(e){return e.base==t&&(r=n,i=e.modified,r.length==i.length&&r.every((function(e,t){return e==i[t]})));var r,i}));if(i)return i;var o,a=[],s=new h(a,t,n),c=Object(r.a)(n);try{for(c.s();!(o=c.n()).done;){o.value.instances.push(s)}}catch(b){c.e(b)}finally{c.f()}var l,u=m(n),f=Object(r.a)(t.set);try{for(f.s();!(l=f.n()).done;){var d,p=l.value,v=Object(r.a)(u);try{for(v.s();!(d=v.n()).done;){var g=d.value;a.push(e.get(p,g))}}catch(b){v.e(b)}finally{v.f()}}}catch(b){f.e(b)}finally{f.f()}return s}}]),e}();function m(e){for(var t=[e],n=0;n0&&f+3==s.length){l=1;break}var d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!d)throw new RangeError("Invalid path: "+s);if(c.push("*"==d[0]?null:'"'==d[0][0]?JSON.parse(d[0]):d[0]),(f+=d[0].length)==s.length)break;var h=s[f++];if(f==s.length&&"!"==h){l=0;break}if("/"!=h)throw new RangeError("Invalid path: "+s);u=s.slice(f)}var p=c.length-1,v=c[p];if(!v)throw new RangeError("Invalid path: "+s);var m=new k(i,l,p>0?c.slice(0,p):null);t[v]=m.sort(t[v])}}}catch(g){a.e(g)}finally{a.f()}}return b.add(t)}var b=new a.b,y=l.g.define({combine:function(e){return e.length?j.combinedMatch(e):null}}),O=l.g.define({combine:function(e){return e.length?e[0].match:null}});function w(e){return e.facet(y)||e.facet(O)}var k=function(){function e(t,n,r,o){Object(i.a)(this,e),this.tags=t,this.mode=n,this.context=r,this.next=o}return Object(o.a)(e,[{key:"sort",value:function(e){return!e||e.depththis.at&&(this.at=e),this.class=t)}},{key:"flush",value:function(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}},{key:"highlightRange",value:function(e,t,n,i,o,s){var c=e.type,l=e.from,u=e.to;if(!(l>=n||u<=t)){C[o]=c.name,c.isTop&&(s=c);for(var f=i,d=c.prop(b),h=!1;d;){if(!d.context||T(d.context,C,o)){var p,v=Object(r.a)(d.tags);try{for(v.s();!(p=v.n()).done;){var m=p.value,g=this.style(m,s);g&&(f&&(f+=" "),f+=g,1==d.mode?i+=(i?" ":"")+g:0==d.mode&&(h=!0))}}catch(E){v.e(E)}finally{v.f()}break}d=d.next}if(this.startSpan(e.from,f),!h){var y=e.tree&&e.tree.prop(a.b.mounted);if(y&&y.overlay){for(var O=e.node.enter(y.overlay[0].from+l,1),w=e.firstChild(),k=0,j=l;;k++){var x=k=S)&&e.nextSibling()););if(!x||S>n)break;(j=x.to+l)>t&&(this.highlightRange(O.cursor,Math.max(t,x.from+l),Math.min(n,j),i,o,y.tree.type),this.startSpan(j,f))}w&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,o+1,s),this.startSpan(Math.min(n,e.to),f)}}while(e.nextSibling());e.parent()}}}}}]),e}();function P(e,t,n,r,i){var o=new M(t,r,i);o.highlightRange(e.cursor(),t,n,"",0,e.type),o.flush(n)}function T(e,t,n){if(e.length>n-1)return!1;for(var r=n-1,i=e.length-1;i>=0;i--,r--){var o=e[i];if(o&&o!=t[r])return!1}return!0}var E=h.define,A=E(),D=E(),R=E(D),N=E(D),_=E(),L=E(_),I=E(_),z=E(),B=E(z),F=E(),$=E(),W=E(),V=E(W),H=E(),q={comment:A,lineComment:E(A),blockComment:E(A),docComment:E(A),name:D,variableName:E(D),typeName:R,tagName:E(R),propertyName:N,attributeName:E(N),className:E(D),labelName:E(D),namespace:E(D),macroName:E(D),literal:_,string:L,docString:E(L),character:E(L),attributeValue:E(L),number:I,integer:E(I),float:E(I),bool:E(_),regexp:E(_),escape:E(_),color:E(_),url:E(_),keyword:F,self:E(F),null:E(F),atom:E(F),unit:E(F),modifier:E(F),operatorKeyword:E(F),controlKeyword:E(F),definitionKeyword:E(F),operator:$,derefOperator:E($),arithmeticOperator:E($),logicOperator:E($),bitwiseOperator:E($),compareOperator:E($),updateOperator:E($),definitionOperator:E($),typeOperator:E($),controlOperator:E($),punctuation:W,separator:E(W),bracket:V,angleBracket:E(V),squareBracket:E(V),paren:E(V),brace:E(V),content:z,heading:B,heading1:E(B),heading2:E(B),heading3:E(B),heading4:E(B),heading5:E(B),heading6:E(B),contentSeparator:E(z),list:E(z),quote:E(z),emphasis:E(z),strong:E(z),link:E(z),monospace:E(z),strikethrough:E(z),inserted:E(),deleted:E(),changed:E(),invalid:E(),meta:H,documentMeta:E(H),annotation:E(H),processingInstruction:E(H),definition:h.defineModifier(),constant:h.defineModifier(),function:h.defineModifier(),standard:h.defineModifier(),local:h.defineModifier(),special:h.defineModifier()},Q=j.define([{tag:q.link,textDecoration:"underline"},{tag:q.heading,textDecoration:"underline",fontWeight:"bold"},{tag:q.emphasis,fontStyle:"italic"},{tag:q.strong,fontWeight:"bold"},{tag:q.strikethrough,textDecoration:"line-through"},{tag:q.keyword,color:"#708"},{tag:[q.atom,q.bool,q.url,q.contentSeparator,q.labelName],color:"#219"},{tag:[q.literal,q.inserted],color:"#164"},{tag:[q.string,q.deleted],color:"#a11"},{tag:[q.regexp,q.escape,q.special(q.string)],color:"#e40"},{tag:q.definition(q.variableName),color:"#00f"},{tag:q.local(q.variableName),color:"#30a"},{tag:[q.typeName,q.namespace],color:"#085"},{tag:q.className,color:"#167"},{tag:[q.special(q.variableName),q.macroName],color:"#256"},{tag:q.definition(q.propertyName),color:"#00c"},{tag:q.comment,color:"#940"},{tag:q.meta,color:"#7a757a"},{tag:q.invalid,color:"#f00"}]);q.link,q.heading,q.emphasis,q.strong,q.keyword,q.atom,q.bool,q.url,q.labelName,q.inserted,q.deleted,q.literal,q.string,q.number,q.regexp,q.escape,q.string,q.variableName,q.variableName,q.variableName,q.variableName,q.typeName,q.namespace,q.macroName,q.propertyName,q.operator,q.comment,q.meta,q.invalid,q.punctuation},function(e,t,n){"use strict";n.r(t),n.d(t,"capitalize",(function(){return r.a})),n.d(t,"createChainedFunction",(function(){return i})),n.d(t,"createSvgIcon",(function(){return o.a})),n.d(t,"debounce",(function(){return a.a})),n.d(t,"deprecatedPropType",(function(){return s})),n.d(t,"isMuiElement",(function(){return c.a})),n.d(t,"ownerDocument",(function(){return l.a})),n.d(t,"ownerWindow",(function(){return u.a})),n.d(t,"requirePropFactory",(function(){return f.a})),n.d(t,"setRef",(function(){return d})),n.d(t,"unstable_useEnhancedEffect",(function(){return h.a})),n.d(t,"unstable_useId",(function(){return p.a})),n.d(t,"unsupportedProp",(function(){return v.a})),n.d(t,"useControlled",(function(){return m.a})),n.d(t,"useEventCallback",(function(){return g.a})),n.d(t,"useForkRef",(function(){return b.a})),n.d(t,"useIsFocusVisible",(function(){return y.a})),n.d(t,"unstable_ClassNameGenerator",(function(){return O.a}));var r=n(15),i=n(303).a,o=n(30),a=n(60);var s=function(e,t){return function(){return null}},c=n(79),l=n(47),u=n(73),f=n(129),d=n(93).a,h=n(65),p=n(99),v=n(130),m=n(52),g=n(39),b=n(28),y=n(66),O=n(142)},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return u}));var r=n(1),i=n(89),o=(n(2),n(86),n(131),n(50)),a=n(61),s={}.hasOwnProperty,c=Object(r.createContext)("undefined"!==typeof HTMLElement?Object(i.a)({key:"css"}):null);var l=c.Provider,u=function(e){return Object(r.forwardRef)((function(t,n){var i=Object(r.useContext)(c);return e(t,i,n)}))},f=Object(r.createContext)({});var d="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",h=function(e,t){var n={};for(var r in t)s.call(t,r)&&(n[r]=t[r]);return n[d]=e,n},p=function(){return null},v=u((function(e,t,n){var i=e.css;"string"===typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var c=e[d],l=[i],u="";"string"===typeof e.className?u=Object(o.a)(t.registered,l,e.className):null!=e.className&&(u=e.className+" ");var h=Object(a.a)(l,void 0,Object(r.useContext)(f));Object(o.b)(t,h,"string"===typeof c);u+=t.key+"-"+h.name;var v={};for(var m in e)s.call(e,m)&&"css"!==m&&m!==d&&(v[m]=e[m]);v.ref=n,v.className=u;var g=Object(r.createElement)(c,v),b=Object(r.createElement)(p,null);return Object(r.createElement)(r.Fragment,null,b,g)}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(1);var r=n(74),i=n(68);function o(){return Object(r.a)(i.a)}},function(e,t,n){"use strict";n.d(t,"e",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c}));n(21),n(2),n(17),n(134),n(55);var r={xs:0,sm:600,md:900,lg:1200,xl:1536},i={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(r[e],"px)")}};function o(e,t,n){var o=e.theme||{};if(Array.isArray(t)){var a=o.breakpoints||i;return t.reduce((function(e,r,i){return e[a.up(a.keys[i])]=n(t[i]),e}),{})}if("object"===typeof t){var s=o.breakpoints||i;return Object.keys(t).reduce((function(e,i){if(-1!==Object.keys(s.values||r).indexOf(i)){e[s.up(i)]=n(t[i],i)}else{var o=i;e[o]=t[o]}return e}),{})}return n(t)}function a(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null==t||null==(e=t.keys)?void 0:e.reduce((function(e,n){return e[t.up(n)]={},e}),{});return n||{}}function s(e,t){return e.reduce((function(e,t){var n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function c(e){var t,n=e.values,r=e.breakpoints,i=e.base||function(e,t){if("object"!==typeof e)return{};var n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((function(t,r){r=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()0&&Math.abs((e.outerHeightStyle||0)-h)>1||e.overflow!==p)?(S.current+=1,{overflow:p,outerHeightStyle:h}):e}))}}),[i,l,e.placeholder]);c.useEffect((function(){var e,t=Object(h.a)((function(){S.current=0,E()})),n=Object(d.a)(k.current);return n.addEventListener("resize",t),"undefined"!==typeof ResizeObserver&&(e=new ResizeObserver(t)).observe(k.current),function(){t.clear(),n.removeEventListener("resize",t),e&&e.disconnect()}}),[E]),Object(p.a)((function(){E()})),c.useEffect((function(){S.current=0}),[y]);return Object(v.jsxs)(c.Fragment,{children:[Object(v.jsx)("textarea",Object(a.a)({value:y,onChange:function(e){S.current=0,w||E(),n&&n(e)},ref:j,rows:l,style:Object(a.a)({height:P.outerHeightStyle,overflow:P.overflow?"hidden":null},u)},O)),Object(v.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:x,tabIndex:-1,style:Object(a.a)({},b,u,{padding:0})})]})})),O=n(78),w=n(54),k=n(69),j=n(43),x=n(10),S=n(14),C=n(15),M=n(28),P=n(65),T=n(240),E=n(75),A=n(119),D=n(133);function R(e){return Object(A.a)("MuiInputBase",e)}var N=Object(D.a)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),_=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","startAdornment","type","value"],L=function(e,t){var n=e.ownerState;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,"small"===n.size&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t["color".concat(Object(C.a)(n.color))],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},I=function(e,t){var n=e.ownerState;return[t.input,"small"===n.size&&t.inputSizeSmall,n.multiline&&t.inputMultiline,"search"===n.type&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},z=Object(x.a)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:L})((function(e){var t=e.theme,n=e.ownerState;return Object(a.a)({},t.typography.body1,Object(i.a)({color:t.palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center"},"&.".concat(N.disabled),{color:t.palette.text.disabled,cursor:"default"}),n.multiline&&Object(a.a)({padding:"4px 0 5px"},"small"===n.size&&{paddingTop:1}),n.fullWidth&&{width:"100%"})})),B=Object(x.a)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:I})((function(e){var t,n=e.theme,r=e.ownerState,o="light"===n.palette.mode,s={color:"currentColor",opacity:o?.42:.5,transition:n.transitions.create("opacity",{duration:n.transitions.duration.shorter})},c={opacity:"0 !important"},l={opacity:o?.42:.5};return Object(a.a)((t={font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"}},Object(i.a)(t,"label[data-shrink=false] + .".concat(N.formControl," &"),{"&::-webkit-input-placeholder":c,"&::-moz-placeholder":c,"&:-ms-input-placeholder":c,"&::-ms-input-placeholder":c,"&:focus::-webkit-input-placeholder":l,"&:focus::-moz-placeholder":l,"&:focus:-ms-input-placeholder":l,"&:focus::-ms-input-placeholder":l}),Object(i.a)(t,"&.".concat(N.disabled),{opacity:1,WebkitTextFillColor:n.palette.text.disabled}),Object(i.a)(t,"&:-webkit-autofill",{animationDuration:"5000s",animationName:"mui-auto-fill"}),t),"small"===r.size&&{paddingTop:1},r.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===r.type&&{MozAppearance:"textfield"})})),F=Object(v.jsx)(T.a,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),$=c.forwardRef((function(e,t){var n=Object(S.a)({props:e,name:"MuiInputBase"}),i=n["aria-describedby"],f=n.autoComplete,d=n.autoFocus,h=n.className,p=n.components,m=void 0===p?{}:p,g=n.componentsProps,b=void 0===g?{}:g,x=n.defaultValue,T=n.disabled,A=n.endAdornment,D=n.fullWidth,N=void 0!==D&&D,L=n.id,I=n.inputComponent,$=void 0===I?"input":I,W=n.inputProps,V=void 0===W?{}:W,H=n.inputRef,q=n.maxRows,Q=n.minRows,U=n.multiline,X=void 0!==U&&U,Y=n.name,G=n.onBlur,K=n.onChange,J=n.onClick,Z=n.onFocus,ee=n.onKeyDown,te=n.onKeyUp,ne=n.placeholder,re=n.readOnly,ie=n.renderSuffix,oe=n.rows,ae=n.startAdornment,se=n.type,ce=void 0===se?"text":se,le=n.value,ue=Object(o.a)(n,_),fe=null!=V.value?V.value:le,de=c.useRef(null!=fe).current,he=c.useRef(),pe=c.useCallback((function(e){0}),[]),ve=Object(M.a)(V.ref,pe),me=Object(M.a)(H,ve),ge=Object(M.a)(he,me),be=c.useState(!1),ye=Object(r.a)(be,2),Oe=ye[0],we=ye[1],ke=Object(j.a)();var je=Object(w.a)({props:n,muiFormControl:ke,states:["color","disabled","error","hiddenLabel","size","required","filled"]});je.focused=ke?ke.focused:Oe,c.useEffect((function(){!ke&&T&&Oe&&(we(!1),G&&G())}),[ke,T,Oe,G]);var xe=ke&&ke.onFilled,Se=ke&&ke.onEmpty,Ce=c.useCallback((function(e){Object(E.b)(e)?xe&&xe():Se&&Se()}),[xe,Se]);Object(P.a)((function(){de&&Ce({value:fe})}),[fe,Ce,de]);c.useEffect((function(){Ce(he.current)}),[]);var Me=$,Pe=V;X&&"input"===Me&&(Pe=oe?Object(a.a)({type:void 0,minRows:oe,maxRows:oe},Pe):Object(a.a)({type:void 0,maxRows:q,minRows:Q},Pe),Me=y);c.useEffect((function(){ke&&ke.setAdornedStart(Boolean(ae))}),[ke,ae]);var Te=Object(a.a)({},n,{color:je.color||"primary",disabled:je.disabled,endAdornment:A,error:je.error,focused:je.focused,formControl:ke,fullWidth:N,hiddenLabel:je.hiddenLabel,multiline:X,size:je.size,startAdornment:ae,type:ce}),Ee=function(e){var t=e.classes,n=e.color,r=e.disabled,i=e.error,o=e.endAdornment,a=e.focused,s=e.formControl,c=e.fullWidth,l=e.hiddenLabel,f=e.multiline,d=e.size,h=e.startAdornment,p=e.type,v={root:["root","color".concat(Object(C.a)(n)),r&&"disabled",i&&"error",c&&"fullWidth",a&&"focused",s&&"formControl","small"===d&&"sizeSmall",f&&"multiline",h&&"adornedStart",o&&"adornedEnd",l&&"hiddenLabel"],input:["input",r&&"disabled","search"===p&&"inputTypeSearch",f&&"inputMultiline","small"===d&&"inputSizeSmall",l&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd"]};return Object(u.a)(v,R,t)}(Te),Ae=m.Root||z,De=b.root||{},Re=m.Input||B;return Pe=Object(a.a)({},Pe,b.input),Object(v.jsxs)(c.Fragment,{children:[F,Object(v.jsxs)(Ae,Object(a.a)({},De,!Object(O.a)(Ae)&&{ownerState:Object(a.a)({},Te,De.ownerState)},{ref:t,onClick:function(e){he.current&&e.currentTarget===e.target&&he.current.focus(),J&&J(e)}},ue,{className:Object(l.default)(Ee.root,De.className,h),children:[ae,Object(v.jsx)(k.a.Provider,{value:null,children:Object(v.jsx)(Re,Object(a.a)({ownerState:Te,"aria-invalid":je.error,"aria-describedby":i,autoComplete:f,autoFocus:d,defaultValue:x,disabled:je.disabled,id:L,onAnimationStart:function(e){Ce("mui-auto-fill-cancel"===e.animationName?he.current:{value:"x"})},name:Y,placeholder:ne,readOnly:re,required:je.required,rows:oe,value:fe,onKeyDown:ee,onKeyUp:te,type:ce},Pe,!Object(O.a)(Re)&&{as:Me,ownerState:Object(a.a)({},Te,Pe.ownerState)},{ref:ge,className:Object(l.default)(Ee.input,Pe.className),onBlur:function(e){G&&G(e),V.onBlur&&V.onBlur(e),ke&&ke.onBlur?ke.onBlur(e):we(!1)},onChange:function(e){if(!de){var t=e.target||he.current;if(null==t)throw new Error(Object(s.a)(1));Ce({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2){if(!l[e])return[e];e=l[e]}var t=e.split(""),n=Object(r.a)(t,2),i=n[0],o=n[1],a=s[i],u=c[o]||"";return Array.isArray(u)?u.map((function(e){return a+e})):[a+u]})),f=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[].concat(f,d);function p(e,t,n,r){var i=Object(o.b)(e,t)||n;return"number"===typeof i?function(e){return"string"===typeof e?e:i*e}:Array.isArray(i)?function(e){return"string"===typeof e?e:i[e]}:"function"===typeof i?i:function(){}}function v(e){return p(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}function g(e,t,n,r){if(-1===t.indexOf(n))return null;var o=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=m(t,n),e}),{})}}(u(n),r),a=e[n];return Object(i.b)(e,a,o)}function b(e,t){var n=v(e.theme);return Object.keys(e).map((function(r){return g(e,t,r,n)})).reduce(a.a,{})}function y(e){return b(e,f)}function O(e){return b(e,d)}function w(e){return b(e,h)}y.propTypes={},y.filterProps=f,O.propTypes={},O.filterProps=d,w.propTypes={},w.filterProps=h;t.c=w},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1),i=n(69);function o(){return r.useContext(i.a)}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(33)},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return u}));var r=n(7),i=n(2),o=["duration","easing","delay"],a={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},s={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function c(e){return"".concat(Math.round(e),"ms")}function l(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function u(e){var t=Object(i.a)({},a,e.easing),n=Object(i.a)({},s,e.duration);return Object(i.a)({getAutoHeightDuration:l,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.duration,s=void 0===a?n.standard:a,l=i.easing,u=void 0===l?t.easeInOut:l,f=i.delay,d=void 0===f?0:f;Object(r.a)(i,o);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:c(s)," ").concat(u," ").concat("string"===typeof d?d:c(d))})).join(",")}},e,{easing:t,duration:n})}},function(e,t,n){"use strict";var r=n(95);t.a=r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37);function i(e,t,n){return i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(e,t,n||e)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));function r(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}var i=function(e,t,n){var r=e.key+"-"+t.name;if(!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0);i=i.next}while(void 0!==i)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e){return e.scrollTop};function i(e,t){var n,r,i=e.timeout,o=e.easing,a=e.style,s=void 0===a?{}:a;return{duration:null!=(n=s.transitionDuration)?n:"number"===typeof i?i:i[t.mode]||0,easing:null!=(r=s.transitionTimingFunction)?r:"object"===typeof o?o[t.mode]:o,delay:s.transitionDelay}}},function(e,t,n){"use strict";var r=n(9),i=n(1);t.a=function(e){var t=e.controlled,n=e.default,o=(e.name,e.state,i.useRef(void 0!==t).current),a=i.useState(n),s=Object(r.a)(a,2),c=s[0],l=s[1];return[o?t:c,i.useCallback((function(e){o||l(e)}),[])]}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(201)},function(e,t,n){"use strict";function r(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(134);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";function r(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(5),i=n(8),o="undefined"==typeof Symbol?"__\u037c":Symbol.for("\u037c"),a="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},c=function(){function e(t,n){Object(r.a)(this,e),this.rules=[];var i=(n||{}).finish;function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function a(e,t,n,r){var s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&"keyframes"==c[1];if(c&&null==t)return n.push(e[0]+";");for(var u in t){var f=t[u];if(/&/.test(u))a(u.split(/,\s*/).map((function(t){return e.map((function(e){return t.replace(/&/,e)}))})).reduce((function(e,t){return e.concat(t)})),f,n);else if(f&&"object"==typeof f){if(!c)throw new RangeError("The value of a property ("+u+") should be a primitive value.");a(o(u),f,s,l)}else null!=f&&s.push(u.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+f+";")}(s.length||l)&&n.push((!i||c||r?e:e.map(i)).join(", ")+" {"+s.join(" ")+"}")}for(var s in t)a(o(s),t[s],this.rules)}return Object(i.a)(e,[{key:"getRules",value:function(){return this.rules.join("\n")}}],[{key:"newName",value:function(){var e=s[o]||1;return s[o]=e+1,"\u037c"+e.toString(36)}},{key:"mount",value:function(e,t){(e[a]||new u(e)).mount(Array.isArray(t)?t:[t])}}]),e}(),l=null,u=function(){function e(t){if(Object(r.a)(this,e),!t.head&&t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(l)return t.adoptedStyleSheets=[l.sheet].concat(t.adoptedStyleSheets),t[a]=l;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),l=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[a]=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(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),t)for(var s=0;s=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(S=Object(f.g)(x))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(1==C&&O||0==j&&0!=C)&&(t[v]==x||n[v]==x&&(m=!0))&&(o[v++]=w),j=C,w+=Object(f.c)(x)}return v==c&&0==o[0]?this.result((m?-200:0)-100,o,e):g==c&&0==b?[-200,0,y]:s>-1?[-700,s,s+this.pattern.length]:g==c?[-900,b,y]:v==c?this.result((m?-200:0)-100-700,o,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],o=1,a=Object(s.a)(t);try{for(a.s();!(r=a.n()).done;){var c=r.value,l=c+(this.astral?Object(f.c)(Object(f.b)(n,c)):1);o>1&&i[o-1]==c?i[o-1]=l:(i[o++]=c,i[o++]=l)}}catch(u){a.e(u)}finally{a.f()}return i}}]),e}(),C=u.g.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100,defaultKeymap:!0,optionClass:function(){return""},aboveCursor:!1,icons:!0,addToOptions:[]},{defaultKeymap:function(e,t){return e&&t},icons:function(e,t){return e&&t},optionClass:function(e,t){return function(n){return function(e,t){return e?t?e+" "+t:e:t}(e(n),t(n))}},addToOptions:function(e,t){return e.concat(t)}})}});function M(e,t,n){if(e<=n)return{from:0,to:e};if(t<=e>>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 P=function(){function e(t,n){var r=this;Object(c.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,s=a.options,l=a.selected,u=t.state.facet(C);this.optionContent=function(e){var t=e.addToOptions.slice();return e.icons&&t.push({render:function(e){var t,n=document.createElement("div");return n.classList.add("cm-completionIcon"),e.type&&(t=n.classList).add.apply(t,Object(o.a)(e.type.split(/\s+/g).map((function(e){return"cm-completionIcon-"+e})))),n.setAttribute("aria-hidden","true"),n},position:20}),t.push({render:function(e,t,n){var r=document.createElement("span");r.className="cm-completionLabel";for(var i=e.label,o=0,a=1;ao&&r.appendChild(document.createTextNode(i.slice(o,s)));var l=r.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(i.slice(s,c))),l.className="cm-completionMatchedText",o=c}return o=this.range.to)&&(this.range=M(n.options.length,n.selected,this.view.state.facet(C).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(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,t){var n=document.createElement("div");n.className="cm-tooltip cm-completionInfo";var r=e.completion.info;if("string"==typeof r)n.textContent=r;else{var i=r(e.completion);i.then?i.then((function(e){return n.appendChild(e)}),(function(e){return Object(d.l)(t.state,e,"completion info")})):n.appendChild(i)}return n}(r,this.view)),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||!this.info)return null;var t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect();if(t.top>innerHeight-10||t.bottom<10)return null;var r=Math.max(0,Math.min(e.getBoundingClientRect().top,innerHeight-n.height))-t.top,i=this.view.textDirection==d.c.RTL,o=t.left,a=innerWidth-t.right;return i&&o=this.options.length?this:new e(this.options,R(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),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i,o){var a=function(e,t){var n,r=[],i=0,o=Object(s.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.hasResult())if(!1===a.result.filter){var c,l=Object(s.a)(a.result.options);try{for(l.s();!(c=l.n()).done;){var u=c.value;r.push(new b(u,a,[1e9-i++]))}}catch(k){l.e(k)}finally{l.f()}}else{var f,d=new S(t.sliceDoc(a.from,a.to)),h=void 0,p=Object(s.a)(a.result.options);try{for(p.s();!(f=p.n()).done;){var v=f.value;(h=d.match(v.label))&&(null!=v.boost&&(h[0]+=v.boost),r.push(new b(v,a,h)))}}catch(k){p.e(k)}finally{p.f()}}}}catch(k){o.e(k)}finally{o.f()}r.sort(_);var m,g=[],y=null,O=Object(s.a)(r.sort(_));try{for(O.s();!(m=O.n()).done;){var w=m.value;if(300==g.length)break;y&&y.label==w.completion.label&&y.detail==w.completion.detail&&y.type==w.completion.type&&y.apply==w.completion.apply?T(w.completion)>T(y)&&(g[g.length-1]=w):g.push(w),y=w.completion}}catch(k){O.e(k)}finally{O.f()}return g}(t,n);if(!a.length)return null;var c,l=0;if(i&&i.selected)for(var u=i.options[i.selected].completion,f=0;f2&&void 0!==arguments[2]?arguments[2]:-1;Object(c.a)(this,e),this.source=t,this.state=n,this.explicitPos=r}return Object(l.a)(e,[{key:"hasResult",value:function(){return!1}},{key:"update",value:function(t,n){var r=L(t),i=this;r?i=i.handleUserEvent(t,r,n):t.docChanged?i=i.handleChange(t):t.selection&&0!=i.state&&(i=new e(i.source,0));var o,a=Object(s.a)(t.effects);try{for(a.s();!(o=a.n()).done;){var c=o.value;if(c.is(B))i=new e(i.source,1,c.value?y(t.state):-1);else if(c.is(F))i=new e(i.source,0);else if(c.is($)){var l,u=Object(s.a)(c.value);try{for(u.s();!(l=u.n()).done;){var f=l.value;f.source==i.source&&(i=f)}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){a.e(d)}finally{a.f()}return i}},{key:"handleUserEvent",value:function(t,n,r){return"delete"!=n&&r.activateOnTyping?new e(this.source,1):this.map(t.changes)}},{key:"handleChange",value:function(t){return t.changes.touchesRange(y(t.startState))?new e(this.source,0):this.map(t.changes)}},{key:"map",value:function(t){return t.empty||this.explicitPos<0?this:new e(this.source,this.state,t.mapPos(this.explicitPos))}}]),e}(),z=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o,a,s){var l;return Object(c.a)(this,n),(l=t.call(this,e,2,r)).result=i,l.from=o,l.to=a,l.span=s,l}return Object(l.a)(n,[{key:"hasResult",value:function(){return!0}},{key:"handleUserEvent",value:function(e,t,r){var i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=y(e.state);if((this.explicitPos>-1?ao)return new I(this.source,"input"==t&&r.activateOnTyping?1:0);var s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return this.span&&(i==o||this.span.test(e.state.sliceDoc(i,o)))?new n(this.source,s,this.result,i,o,this.span):new I(this.source,1,s)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new I(this.source,0):this.map(e.changes)}},{key:"map",value:function(e){return e.empty?this:new n(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}]),n}(I),B=u.j.define(),F=u.j.define(),$=u.j.define({map:function(e,t){return e.map((function(e){return e.map(t)}))}}),W=u.j.define(),V=u.k.define({create:function(){return A.start()},update:function(e,t){return e.update(t)},provide:function(e){return[h.b.from(e,(function(e){return e.tooltip})),d.d.contentAttributes.from(e,(function(e){return e.attrs}))]}});function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(V,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,o=1;"page"==t&&(i=n.dom.querySelector(".cm-tooltip-autocomplete"))&&(o=Math.max(2,Math.floor(i.offsetHeight/i.firstChild.offsetHeight)));var a=r.open.selected+o*(e?1:-1),s=r.open.options.length;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:W.of(a)}),!0}}var q=function e(t,n){Object(c.a)(this,e),this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0},Q=d.f.fromClass(function(){function e(t){Object(c.a)(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;var n,r=Object(s.a)(t.state.field(V).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(o){r.e(o)}finally{r.f()}}return Object(l.a)(e,[{key:"update",value:function(e){var t=this,n=e.state.field(V);if(e.selectionSet||e.docChanged||e.startState.field(V)!=n){for(var r=e.transactions.some((function(e){return(e.selection||e.docChanged)&&!L(e)})),i=0;i50&&a.time-Date.now()>1e3){var c,l=Object(s.a)(a.context.abortListeners);try{for(l.s();!(c=l.n()).done;){var u=c.value;try{u()}catch(m){Object(d.l)(this.view.state,m)}}}catch(g){l.e(g)}finally{l.f()}a.context.abortListeners=null,this.running.splice(i--,1)}else{var f;(f=a.updates).push.apply(f,Object(o.a)(e.transactions))}}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.active.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1,0!=this.composing){var h,p=Object(s.a)(e.transactions);try{for(p.s();!(h=p.n()).done;){var v=h.value;"input"==L(v)?this.composing=2:2==this.composing&&v.selection&&(this.composing=3)}}catch(g){p.e(g)}finally{p.f()}}}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=this.view.state.field(V),r=Object(s.a)(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.active.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=y(n),i=new v(n,r,e.explicitPos==r),o=new q(e,i);this.running.push(o),Promise.resolve(e.source(i)).then((function(e){o.context.aborted||(o.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:F.of(null)}),Object(d.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(C),i=function(i){var a=t.running[i];if(void 0===a.done)return o=i,"continue";if(t.running.splice(i--,1),a.done){var c,l=new z(a.active.source,a.active.explicitPos,a.done,a.done.from,null!==(e=a.done.to)&&void 0!==e?e:y(a.updates.length?a.updates[0].startState:t.view.state),a.done.span&&!1!==a.done.filter?O(a.done.span,!0):null),u=Object(s.a)(a.updates);try{for(u.s();!(c=u.n()).done;){var f=c.value;l=l.update(f,r)}}catch(g){u.e(g)}finally{u.f()}if(l.hasResult())return n.push(l),o=i,"continue"}var d=t.view.state.field(V).active.find((function(e){return e.source==a.active.source}));if(d&&1==d.state)if(null==a.done){var h,p=new I(a.active.source,0),v=Object(s.a)(a.updates);try{for(v.s();!(h=v.n()).done;){var m=h.value;p=p.update(m,r)}}catch(g){v.e(g)}finally{v.f()}1!=p.state&&n.push(p)}else t.startQuery(d);o=i},o=0;o ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#39e",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25cb'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25cc'"}},".cm-completionIcon-variable":{"&:after":{content:"'\ud835\udc65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\ud835\udc36'"}},".cm-completionIcon-type":{"&:after":{content:"'\ud835\udc61'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222a'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25a1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\ud83d\udd11\ufe0e'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25a2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),X=function e(t,n,r,i){Object(c.a)(this,e),this.field=t,this.line=n,this.from=r,this.to=i},Y=function(){function e(t,n,r){Object(c.a)(this,e),this.field=t,this.from=n,this.to=r}return Object(l.a)(e,[{key:"map",value:function(t){return new e(this.field,t.mapPos(this.from,-1),t.mapPos(this.to,1))}}]),e}(),G=function(){function e(t,n){Object(c.a)(this,e),this.lines=t,this.fieldPositions=n}return Object(l.a)(e,[{key:"instantiate",value:function(e,t){var n,r=[],i=[t],o=e.doc.lineAt(t),a=/^\s*/.exec(o.text)[0],c=Object(s.a)(this.lines);try{for(c.s();!(n=c.n()).done;){var l=n.value;if(r.length){for(var u=a,f=/^\t*/.exec(l)[0].length,d=0;d=d&&g.field++}}catch(b){m.e(b)}finally{m.f()}}a.push(new X(d,o.length,n.index,n.index+f.length)),l=l.slice(0,n.index)+f+l.slice(n.index+n[0].length)}o.push(l)}}catch(b){c.e(b)}finally{c.f()}return new e(o,a)}}]),e}(),K=d.b.widget({widget:new(function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(l.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(d.g))}),J=d.b.mark({class:"cm-snippetField"}),Z=function(){function e(t,n){Object(c.a)(this,e),this.ranges=t,this.active=n,this.deco=d.b.set(t.map((function(e){return(e.from==e.to?K:J).range(e.from,e.to)})))}return Object(l.a)(e,[{key:"map",value:function(t){return new e(this.ranges.map((function(e){return e.map(t)})),this.active)}},{key:"selectionInsideField",value:function(e){var t=this;return e.ranges.every((function(e){return t.ranges.some((function(n){return n.field==t.active&&n.from<=e.from&&n.to>=e.to}))}))}}]),e}(),ee=u.j.define({map:function(e,t){return e&&e.map(t)}}),te=u.j.define(),ne=u.k.define({create:function(){return null},update:function(e,t){var n,r=Object(s.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(ee))return i.value;if(i.is(te)&&e)return new Z(e.ranges,i.value)}}catch(o){r.e(o)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:function(e){return d.d.decorations.from(e,(function(e){return e?e.deco:d.b.none}))}});function re(e,t){return u.e.create(e.filter((function(e){return e.field==t})).map((function(e){return u.e.range(e.from,e.to)})))}function ie(e){var t=G.parse(e);return function(e,n,r,i){var o=t.instantiate(e.state,r),a=o.text,s=o.ranges,c={changes:{from:r,to:i,insert:f.a.of(a)}};if(s.length&&(c.selection=re(s,0)),s.length>1){var l=new Z(s,0),d=c.effects=[ee.of(l)];void 0===e.state.field(ne,!1)&&d.push(u.j.appendConfig.of([ne,ce,le,U]))}e.dispatch(e.state.update(c))}}function oe(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(ne,!1);if(!i||e<0&&0==i.active)return!1;var o=i.active+e,a=e>0&&!i.ranges.some((function(t){return t.field==o+e}));return r(n.update({selection:re(i.ranges,o),effects:ee.of(a?null:new Z(i.ranges,o))})),!0}}var ae=[{key:"Tab",run:oe(1),shift:oe(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(ne,!1)&&(n(t.update({effects:ee.of(null)})),!0)}}],se=u.g.define({combine:function(e){return e.length?e[0]:ae}}),ce=u.i.highest(d.k.compute([se],(function(e){return e.facet(se)})));var le=d.d.domEventHandlers({mousedown:function(e,t){var n,r=t.state.field(ne,!1);if(!r||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;var i=r.ranges.find((function(e){return e.from<=n&&e.to>=n}));return!(!i||i.field==r.active)&&(t.dispatch({selection:re(r.ranges,i.field),effects:ee.of(r.ranges.some((function(e){return e.field>i.field}))?new Z(r.ranges,i.field):null)}),!0)}});function ue(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V,C.of(e),Q,de,U]}var fe=[{key:"Ctrl-Space",run:function(e){return!!e.state.field(V,!1)&&(e.dispatch({effects:B.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(V,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:F.of(null)}),!0)}},{key:"ArrowDown",run:H(!0)},{key:"ArrowUp",run:H(!1)},{key:"PageDown",run:H(!0,"page")},{key:"PageUp",run:H(!1,"page")},{key:"Enter",run:function(e){var t=e.state.field(V,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75)&&(k(e,t.open.options[t.open.selected]),!0)}}],de=u.i.highest(d.k.computeN([C],(function(e){return e.facet(C).defaultKeymap?[fe]:[]})))},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return p}));var r=n(5),i=n(8),o=n(4),a=n(13),s=n(6),c=s.g.define({combine:function(e){var t,n,r,i=Object(o.a)(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;t=t||a.topContainer,n=n||a.bottomContainer}}catch(s){i.e(s)}finally{i.f()}return{topContainer:t,bottomContainer:n}}});function l(e,t){var n=e.plugin(u),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var u=a.f.fromClass(function(){function e(t){Object(r.a)(this,e),this.input=t.state.facet(p),this.specs=this.input.filter((function(e){return e})),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(c);this.top=new f(t,!0,n.topContainer),this.bottom=new f(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,a=Object(o.a)(this.panels);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.dom.classList.add("cm-panel"),s.mount&&s.mount()}}catch(l){a.e(l)}finally{a.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(c);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new f(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new f(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(p);if(n!=this.input){var r,i=n.filter((function(e){return e})),a=[],s=[],l=[],u=[],d=Object(o.a)(i);try{for(d.s();!(r=d.n()).done;){var h=r.value,v=this.specs.indexOf(h),m=void 0;v<0?(m=h(e.view),u.push(m)):(m=this.panels[v]).update&&m.update(e),a.push(m),(m.top?s:l).push(m)}}catch(j){d.e(j)}finally{d.f()}this.specs=i,this.panels=a,this.top.sync(s),this.bottom.sync(l);for(var g=0,b=u;g=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},i={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=n(85),a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,c=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!==typeof e},u=Object(o.a)((function(e){return c(e)?e:e.replace(a,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(s,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===i[e]||c(e)||"number"!==typeof t||0===t?t:t+"px"};function d(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)h={name:r.name,styles:r.styles,next:h},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i0&&g(t.state,c.head-1,1,o)||o.afterCursor&&(g(t.state,c.head,1,o)||c.head0&&void 0!==arguments[0]?arguments[0]:{};return[f.of(e),p]}function m(e,t,n){var r=e.prop(t<0?s.b.openedBy:s.b.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 g(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.maxScanDistance||l,a=r.brackets||u,s=Object(o.j)(e),c=s.resolveInner(t,n),f=c;f;f=f.parent){var d=m(f.type,n,a);if(d&&f.from=r.to){if(0==c&&i.indexOf(l.type.name)>-1&&l.from0)return null;for(var l={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<=o;){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=a.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:l,end:{from:p+v,to:p+v+1},matched:g>>1==c>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:l,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u}));var r=n(1),i=(n(89),n(34)),o=(n(138),n(86),n(87),n(50)),a=n(61),s=n(103),c=Object(i.f)((function(e,t){var n=e.styles,c=Object(a.a)([n],void 0,Object(r.useContext)(i.c)),l=Object(r.useRef)();return Object(r.useLayoutEffect)((function(){var e=t.key+"-global",n=new s.a({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),r=!1,i=document.querySelector('style[data-emotion="'+e+" "+c.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),null!==i&&(r=!0,i.setAttribute("data-emotion",e),n.hydrate([i])),l.current=[n,r],function(){n.flush()}}),[t]),Object(r.useLayoutEffect)((function(){var e=l.current,n=e[0];if(e[1])e[1]=!1;else{if(void 0!==c.next&&Object(o.b)(t,c.next,!0),n.tags.length){var r=n.tags[n.tags.length-1].nextElementSibling;n.before=r,n.flush()}t.insert("",c,n,!1)}}),[t,c.name]),null}));function l(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:o;return Object(i.a)(e)}},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 o(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))},,function(e,t,n){"use strict";e.exports=n(221)},function(e,t,n){"use strict";t.a=function(e){return"string"===typeof e}},function(e,t,n){"use strict";var r=n(1);t.a=function(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(1),i=n.n(r);t.a=i.a.createContext(null)},function(e,t,n){e.exports=n(233)},function(e,t,n){"use strict";n.d(t,"b",(function(){return Y}));var r=n(3),i=n(20),o=n(55);var a=function(){for(var e=arguments.length,t=new Array(e),n=0;n96?f:d},p=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},v=function(){return null},m=function e(t,n){var i,o,a=t.__emotion_real===t,f=a&&t.__emotion_base||t;void 0!==n&&(i=n.label,o=n.target);var d=p(t,n,a),m=d||h(f),g=!m("as");return function(){var b=arguments,y=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&y.push("label:"+i+";"),null==b[0]||void 0===b[0].raw)y.push.apply(y,b);else{0,y.push(b[0][0]);for(var O=b.length,w=1;w0?g(P,--C):0,x--,10===M&&(x=1,j--),M}function D(){return M=C2||L(M)>3?"":" "}function $(e,t){for(;--t&&D()&&!(M<48||M>102||M>57&&M<65||M>70&&M<97););return _(e,N()+(t<6&&32==R()&&32==D()))}function W(e){for(;D();)switch(M){case e:return C;case 34:case 39:34!==e&&39!==e&&W(M);break;case 40:41===e&&W(e);break;case 92:D()}return C}function V(e,t){for(;D()&&e+M!==57&&(e+M!==84||47!==R()););return"/*"+_(t,C-1)+"*"+d(47===e?e:D())}function H(e){for(;!L(R());)D();return _(e,C)}function q(e){return z(Q("",null,null,null,[""],e=I(e),0,[0],e))}function Q(e,t,n,r,i,o,a,s,c){for(var l=0,u=0,f=a,h=0,p=0,g=0,b=1,O=1,k=1,j=0,x="",S=i,C=o,M=r,P=x;O;)switch(g=j,j=D()){case 40:if(108!=g&&58==P.charCodeAt(f-1)){-1!=m(P+=v(B(j),"&","&\f"),"&\f")&&(k=-1);break}case 34:case 39:case 91:P+=B(j);break;case 9:case 10:case 13:case 32:P+=F(g);break;case 92:P+=$(N()-1,7);continue;case 47:switch(R()){case 42:case 47:w(X(V(D(),N()),t,n),c);break;default:P+="/"}break;case 123*b:s[l++]=y(P)*k;case 125*b:case 59:case 0:switch(j){case 0:case 125:O=0;case 59+u:p>0&&y(P)-f&&w(p>32?Y(P+";",r,n,f-1):Y(v(P," ","")+";",r,n,f-2),c);break;case 59:P+=";";default:if(w(M=U(P,t,n,l,u,i,s,x,S=[],C=[],f),o),123===j)if(0===u)Q(P,t,M,M,S,o,f,s,C);else switch(h){case 100:case 109:case 115:Q(e,M,M,r&&w(U(e,M,M,0,0,i,s,x,i,S=[],f),C),i,C,f,s,r?S:C);break;default:Q(P,M,M,M,[""],C,0,s,C)}}l=u=p=0,b=k=1,x=P="",f=a;break;case 58:f=1+y(P),p=g;default:if(b<1)if(123==j)--b;else if(125==j&&0==b++&&125==A())continue;switch(P+=d(j),j*b){case 38:k=u>0?1:(P+="\f",-1);break;case 44:s[l++]=(y(P)-1)*k,k=1;break;case 64:45===R()&&(P+=B(D())),h=R(),u=f=y(x=P+=H(N())),j++;break;case 45:45===g&&2==y(P)&&(b=0)}}return o}function U(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=0===i?o:[""],g=O(m),y=0,w=0,k=0;y0?m[j]+" "+x:v(x,/&\f/g,m[j])))&&(l[k++]=S);return T(e,t,n,0===i?c:s,l,u,d)}function X(e,t,n){return T(e,t,n,s,d(M),b(e,2,-2),0)}function Y(e,t,n,r){return T(e,t,n,l,b(e,0,r),b(e,r+1,-1),r)}function G(e,t){switch(function(e,t){return(((t<<2^g(e,0))<<2^g(e,1))<<2^g(e,2))<<2^g(e,3)}(e,t)){case 5103:return a+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return a+e+o+e+i+e+e;case 6828:case 4268:return a+e+i+e+e;case 6165:return a+e+i+"flex-"+e+e;case 5187:return a+e+v(e,/(\w+).+(:[^]+)/,a+"box-$1$2"+i+"flex-$1$2")+e;case 5443:return a+e+i+"flex-item-"+v(e,/flex-|-self/,"")+e;case 4675:return a+e+i+"flex-line-pack"+v(e,/align-content|flex-|-self/,"")+e;case 5548:return a+e+i+v(e,"shrink","negative")+e;case 5292:return a+e+i+v(e,"basis","preferred-size")+e;case 6060:return a+"box-"+v(e,"-grow","")+a+e+i+v(e,"grow","positive")+e;case 4554:return a+v(e,/([^-])(transform)/g,"$1"+a+"$2")+e;case 6187:return v(v(v(e,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),e,"")+e;case 5495:case 3959:return v(e,/(image-set\([^]*)/,a+"$1$`$1");case 4968:return v(v(e,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+i+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+e+e;case 4095:case 3583:case 4068:case 2532:return v(e,/(.+)-inline(.+)/,a+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(y(e)-1-t>6)switch(g(e,t+1)){case 109:if(45!==g(e,t+4))break;case 102:return v(e,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3$1"+o+(108==g(e,t+3)?"$3":"$2-$3"))+e;case 115:return~m(e,"stretch")?G(v(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==g(e,t+1))break;case 6444:switch(g(e,y(e)-3-(~m(e,"!important")&&10))){case 107:return v(e,":",":"+a)+e;case 101:return v(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a+(45===g(e,14)?"inline-":"")+"box$3$1"+a+"$2$3$1"+i+"$2box$3")+e}break;case 5936:switch(g(e,t+11)){case 114:return a+e+i+v(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return a+e+i+v(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return a+e+i+v(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return a+e+i+e+e}return e}function K(e,t){for(var n="",r=O(e),i=0;i-1&&!e.return)switch(e.type){case l:e.return=G(e.value,e.length);break;case u:return K([E(e,{value:v(e.value,"@","@"+a)})],r);case c:if(e.length)return k(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return K([E(e,{props:[v(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return K([E(e,{props:[v(t,/:(plac\w+)/,":"+a+"input-$1")]}),E(e,{props:[v(t,/:(plac\w+)/,":-moz-$1")]}),E(e,{props:[v(t,/:(plac\w+)/,i+"input-$1")]})],r)}return""}))}}];t.a=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i=e.stylisPlugins||oe;var o,a,s={},c=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=g&&!o||"t"===o?(m+=d.abbreviations.trillion,t/=g):a=b&&!o||"b"===o?(m+=d.abbreviations.billion,t/=b):a=y&&!o||"m"===o?(m+=d.abbreviations.million,t/=y):(a=O&&!o||"k"===o)&&(m+=d.abbreviations.thousand,t/=O)),e._.includes(n,"[.]")&&(p=!0,n=n.replace("[.]",".")),s=t.toString().split(".")[0],c=n.split(".")[1],u=n.indexOf(","),v=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,c?(e._.includes(c,"[")?(c=(c=c.replace("]","")).split("["),w=e._.toFixed(t,c[0].length+c[1].length,r,c[1].length)):w=e._.toFixed(t,c.length,r),s=w.split(".")[0],w=e._.includes(w,".")?d.delimiters.decimal+w.split(".")[1]:"",p&&0===Number(w.slice(1))&&(w="")):s=e._.toFixed(t,0,r),m&&!o&&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),k=!0),s.length0;j--)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+w+(m||""),h?f=(h&&k?"(":"")+f+(h&&k?")":""):l>=0?f=0===l?(k?"-":"+")+f:f+(k?"-":"+"):k&&(f="-"+f),f},stringToNumber:function(e){var t,n,r,o=i[a.currentLocale],s=e,c={thousand:3,million:6,billion:9,trillion:12};if(a.zeroFormat&&e===a.zeroFormat)n=0;else if(a.nullFormat&&e===a.nullFormat||!e.replace(/[^0-9]+/g,"").length)n=null;else{for(t in n=1,"."!==o.delimiters.decimal&&(e=e.replace(/\./g,"").replace(o.delimiters.decimal,".")),c)if(r=new RegExp("[^a-zA-Z]"+o.abbreviations[t]+"(?:\\)|(\\"+o.currency.symbol+")?(?:\\))?)?$"),s.match(r)){n*=Math.pow(10,c[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,o=0;if(3===arguments.length)n=arguments[2];else{for(;o=i)throw new TypeError("Reduce of empty array with no initial value");n=r[o++]}for(;or?e:r}),1)},toFixed:function(e,t,n,r){var i,o,a,s,c=e.toString().split("."),l=t-(r||0);return i=2===c.length?Math.min(Math.max(c[1].length,l),t):l,a=Math.pow(10,i),s=(n(e+"e+"+i)/a).toFixed(i),r>t-i&&(o=new RegExp("\\.?0{1,"+(r-(t-i))+"}$"),s=s.replace(o,"")),s}},e.options=a,e.formats=r,e.locales=i,e.locale=function(e){return e&&(a.currentLocale=e.toLowerCase()),a.currentLocale},e.localeData=function(e){if(!e)return i[a.currentLocale];if(e=e.toLowerCase(),!i[e])throw new Error("Unknown locale : "+e);return i[e]},e.reset=function(){for(var e in o)a[e]=o[e]},e.zeroFormat=function(e){a.zeroFormat="string"===typeof e?e:null},e.nullFormat=function(e){a.nullFormat="string"===typeof e?e:null},e.defaultFormat=function(e){a.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,o,a,s,c,l,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{l=e.localeData(n)}catch(f){l=e.localeData(e.locale())}return o=l.currency.symbol,s=l.abbreviations,r=l.delimiters.decimal,i="."===l.delimiters.thousands?"\\.":l.delimiters.thousands,(null===(u=t.match(/^[^\d]+/))||(t=t.substr(1),u[0]===o))&&(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))&&(c=new RegExp(i+"{2}"),!t.match(/[^\d.,]/g)&&!((a=t.split(r)).length>2)&&(a.length<2?!!a[0].match(/^\d+.*\d$/)&&!a[0].match(c):1===a[0].length?!!a[0].match(/^\d+$/)&&!a[0].match(c)&&!!a[1].match(/^\d+$/):!!a[0].match(/^\d+.*\d$/)&&!a[0].match(c)&&!!a[1].match(/^\d+$/)))},e.fn=s.prototype={clone:function(){return e(this)},format:function(t,n){var i,o,s,c=this._value,l=t||a.defaultFormat;if(n=n||Math.round,0===c&&null!==a.zeroFormat)o=a.zeroFormat;else if(null===c&&null!==a.nullFormat)o=a.nullFormat;else{for(i in r)if(l.match(r[i].regexps.format)){s=r[i].format;break}o=(s=s||e._.numberToFormat)(c,l,n)}return o},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 o=t.correctionFactor(e,n);return Math.round(e*o)*Math.round(n*o)/Math.round(o*o)}return this._value=t.reduce([this._value,e],n,1),this},divide:function(e){function n(e,n,r,i){var o=t.correctionFactor(e,n);return Math.round(e*o)/Math.round(n*o)}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,o=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,o+"BPS"),i=i.join("")):i=i+o+"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,o){var a,s,c,l=e._.includes(i,"ib")?n:t,u=e._.includes(i," b")||e._.includes(i," ib")?" ":"";for(i=i.replace(/\s?i?b/,""),a=0;a<=l.suffixes.length;a++)if(s=Math.pow(l.base,a),c=Math.pow(l.base,a+1),null===r||0===r||r>=s&&r0&&(r/=s);break}return e._.numberToFormat(r,i,o)+u},unformat:function(r){var i,o,a=e._.stringToNumber(r);if(a){for(i=t.suffixes.length-1;i>=0;i--){if(e._.includes(r,t.suffixes[i])){o=Math.pow(t.base,i);break}if(e._.includes(r,n.suffixes[i])){o=Math.pow(n.base,i);break}}a*=o||1}return a}})}(),e.register("format","currency",{regexps:{format:/(\$)/},format:function(t,n,r){var i,o,a=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),o=0;o=0;o--)switch(s.after[o]){case"$":i=o===s.after.length-1?i+a.currency.symbol:e._.insert(i,a.currency.symbol,-(s.after.length-(1+o)));break;case" ":i=o===s.after.length-1?i+" ":e._.insert(i," ",-(s.after.length-(1+o)+a.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 o(t,n,r,i){var o=e._.correctionFactor(t,n);return t*o*(n*o)/(o*o)}return i=e._.includes(t,"e-")?i*=-1:i,e._.reduce([r,Math.pow(10,i)],o,1)}}),e.register("format","ordinal",{regexps:{format:/(o)/},format:function(t,n,r){var i=e.locales[e.options.currentLocale],o=e._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),o+=i.ordinal(t),e._.numberToFormat(t,n,r)+o}}),e.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(t,n,r){var i,o=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,o+"%"),i=i.join("")):i=i+o+"%",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),o=Math.round(e-60*r*60-60*i);return r+":"+(i<10?"0"+i:i)+":"+(o<10?"0"+o:o)},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},void 0===(i="function"===typeof r?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=s||c||Function("return this")(),u=Object.prototype.toString,f=Math.max,d=Math.min,h=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,c,l=0,u=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function y(e){return l=e,s=setTimeout(w,t),u?b(e):a}function O(e){var n=e-c;return void 0===c||n>=t||n<0||m&&e-l>=o}function w(){var e=h();if(O(e))return k(e);s=setTimeout(w,function(e){var n=t-(e-c);return m?d(n,o-(e-l)):n}(e))}function k(e){return s=void 0,g&&r?b(e):(r=i=void 0,a)}function j(){var e=h(),n=O(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return y(c);if(m)return s=setTimeout(w,t),b(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=v(t)||0,p(n)&&(u=!!n.leading,o=(m="maxWait"in n)?f(v(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g),j.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},j.flush=function(){return void 0===s?a:k(h())},j}}).call(this,n(127))},function(e,t,n){"use strict";var r=n(1),i=r.createContext();t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return y}));var r,i,o=n(21),a=n(3),s=n(4),c=n(5),l=n(8),u=n(13),f=n(6),d="undefined"!=typeof navigator&&!/Edge\/(\d+)/.exec(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),h="-10000px",p=function(){function e(t,n,r){Object(c.a)(this,e),this.facet=n,this.createTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter((function(e){return e})),this.tooltipViews=this.tooltips.map(r)}return Object(l.a)(e,[{key:"update",value:function(e){var t=e.state.facet(this.facet),n=t.filter((function(e){return e}));if(t===this.input){var r,i=Object(s.a)(this.tooltipViews);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.update&&o.update(e)}}catch(g){i.e(g)}finally{i.f()}return{shouldMeasure:!1}}for(var a=[],c=0;c=t.bottom||c.right<=t.left||c.left>=t.right)a.style.top=h;else{var f=!!i.arrow,d=!!i.above,p=l.right-l.left,v=l.bottom-l.top+(f?7:0),m=this.view.textDirection==u.c.LTR?Math.min(c.left-(f?14:0),e.innerWidth-p):Math.max(0,c.left-p+(f?14:0));!i.strictSide&&(d?c.top-(l.bottom-l.top)<0:c.bottom+(l.bottom-l.top)>e.innerHeight)&&(d=!d);var g,b=d?c.top-v:c.bottom+(f?7:0),y=m+p,O=Object(s.a)(n);try{for(O.s();!(g=O.n()).done;){var w=g.value;w.leftm&&w.topb&&(b=d?w.top-v:w.bottom)}}catch(k){O.e(k)}finally{O.f()}"absolute"==this.position?(a.style.top=b-e.parent.top+"px",a.style.left=m-e.parent.left+"px"):(a.style.top=b+"px",a.style.left=m+"px"),n.push({left:m,top:b,right:y,bottom:b+v}),a.classList.toggle("cm-tooltip-above",d),a.classList.toggle("cm-tooltip-below",!d),o.positioned&&o.positioned()}}}},{key:"maybeMeasure",value:function(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var e,t=Object(s.a)(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){e.value.dom.style.top=h}}catch(n){t.e(n)}finally{t.f()}}}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),g="undefined"==typeof document||null!=(null===(i=document.body)||void 0===i?void 0:i.style.insetInlineStart)?"insetInlineStart":"left",b=u.d.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip.cm-tooltip-arrow:before, .cm-tooltip.cm-tooltip-arrow:after":(r={position:"absolute",content:"''"},Object(a.a)(r,g,"".concat(7,"px")),Object(a.a)(r,"width",0),Object(a.a)(r,"height",0),Object(a.a)(r,"borderLeft","".concat(7,"px solid transparent")),Object(a.a)(r,"borderRight","".concat(7,"px solid transparent")),Object(a.a)(r,"zIndex",-1),r),".cm-tooltip-above.cm-tooltip-arrow:before":{borderTop:"".concat(7,"px solid #f5f5f5"),bottom:"-".concat(6,"px")},".cm-tooltip-below.cm-tooltip-arrow:before":{borderBottom:"".concat(7,"px solid #f5f5f5"),top:"-".concat(6,"px")},".cm-tooltip-above.cm-tooltip-arrow:after":{borderTop:"".concat(7,"px solid #bbb"),bottom:"-".concat(7,"px"),zIndex:-2},".cm-tooltip-below.cm-tooltip-arrow:after":{borderBottom:"".concat(7,"px solid #bbb"),top:"-".concat(7,"px"),zIndex:-2},"&dark .cm-tooltip.cm-tooltip-arrow:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&dark .cm-tooltip.cm-tooltip-arrow:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}),y=f.g.define({enables:[m,b]}),O=f.g.define(),w=function(){function e(t){var n=this;Object(c.a)(this,e),this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new p(t,O,(function(e){return n.createHostedView(e)}))}return Object(l.a)(e,[{key:"createHostedView",value:function(e){var t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}},{key:"mount",value:function(e){var t,n=Object(s.a)(this.manager.tooltipViews);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.mount&&r.mount(e)}}catch(i){n.e(i)}finally{n.f()}this.mounted=!0}},{key:"positioned",value:function(){var e,t=Object(s.a)(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.positioned&&n.positioned()}}catch(r){t.e(r)}finally{t.f()}}},{key:"update",value:function(e){this.manager.update(e)}}],[{key:"create",value:function(t){return new e(t)}}]),e}(),k=y.compute([O],(function(e){var t=e.facet(O).filter((function(e){return e}));return 0===t.length?null:{pos:Math.min.apply(Math,Object(o.a)(t.map((function(e){return e.pos})))),end:Math.max.apply(Math,Object(o.a)(t.filter((function(e){return null!=e.end})).map((function(e){return e.end})))),create:w.create,above:t[0].above,arrow:t.some((function(e){return e.arrow}))}})),j=function(){function e(t,n,r,i,o){Object(c.a)(this,e),this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.lastMouseMove=null,this.lastMoveTime=0,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Object(l.a)(e,[{key:"update",value:function(){var e=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((function(){return e.startHover()}),20))}},{key:"active",get:function(){return this.view.state.field(this.field)}},{key:"checkHover",value:function(){if(this.hoverTimeout=-1,!this.active){var e=Date.now()-this.lastMoveTime;eo.bottom||r.xo.right+this.view.defaultCharacterWidth)){var a=this.view.bidiSpans(this.view.state.doc.lineAt(i)).find((function(e){return e.from<=i&&e.to>=i})),s=a&&a.dir==u.c.RTL?-1:1,c=this.source(this.view,i,r.x1&&void 0!==arguments[1]?arguments[1]:{},n=f.j.define(),r=f.k.define({create:function(){return null},update:function(e,r){if(e&&t.hideOnChange&&(r.docChanged||r.selection))return null;var i,o=Object(s.a)(r.effects);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(a.is(n))return a.value}}catch(u){o.e(u)}finally{o.f()}if(e&&r.docChanged){var c=r.changes.mapPos(e.pos,-1,f.h.TrackDel);if(null==c)return null;var l=Object.assign(Object.create(null),e);return l.pos=c,null!=e.end&&(l.end=r.changes.mapPos(e.end)),l}return e},provide:function(e){return O.from(e)}}),i=t.hoverTime||750;return[r,u.f.define((function(t){return new j(t,e,r,n,i)})),k]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return P}));var r=n(23),i=n(22),o=n(21),a=n(4),s=n(8),c=n(5),l=n(13),u=n(6),f=n(108),d=n(59),h=n(29),p=function e(t,n,r){Object(c.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},v=function(){function e(t,n,r){Object(c.a)(this,e),this.diagnostics=t,this.panel=n,this.selected=r}return Object(s.a)(e,null,[{key:"init",value:function(t,n,r){var i=l.b.set(t.map((function(e){return e.from==e.to||e.from==e.to-1&&r.doc.lineAt(e.from).to==e.from?l.b.widget({widget:new A(e),diagnostic:e}).range(e.from):l.b.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity},diagnostic:e}).range(e.from,e.to)})),!0);return new e(i,n,m(i))}}]),e}();function m(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,1e9,(function(e,n,i){var o=i.spec;if(!t||o.diagnostic==t)return r=new p(e,n,o.diagnostic),!1})),r}function g(e,t,n){return e.field(w,!1)?t:t.concat(u.j.appendConfig.of([w.init(n),l.d.decorations.compute([w],(function(e){var t=e.field(w),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?l.b.set([k.range(n.from,n.to)]):l.b.none})),Object(f.a)(j),_]))}var b=u.j.define(),y=u.j.define(),O=u.j.define(),w=u.k.define({create:function(){return new v(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=m(n,e.selected.diagnostic,i)||m(n,null,i)}e=new v(n,e.panel,r)}var o,s=Object(a.a)(t.effects);try{for(s.s();!(o=s.n()).done;){var c=o.value;c.is(b)?e=v.init(c.value,e.panel,t.state):c.is(y)?e=new v(e.diagnostics,c.value?R.open:null,e.selected):c.is(O)&&(e=new v(e.diagnostics,e.panel,c.value))}}catch(l){s.e(l)}finally{s.f()}return e},provide:function(e){return[d.b.from(e,(function(e){return e.panel})),l.d.decorations.from(e,(function(e){return e.diagnostics}))]}});var k=l.b.mark({class:"cm-lintRange cm-lintRange-active"});function j(e,t,n){var r=e.state.field(w).diagnostics,i=[],o=2e8,a=0;return r.between(t-(n<0?1:0),t+(n>0?1:0),(function(e,r,s){var c=s.spec;t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t1&&void 0!==arguments[1]?arguments[1]:{};return M.of({source:e,delay:null!==(t=n.delay)&&void 0!==t?t:750})}function T(e){var t=[];if(e){var n,r=Object(a.a)(e);try{e:for(r.s();!(n=r.n()).done;){for(var i=n.value.name,o=function(e){var n=i[e];if(/[a-zA-Z]/.test(n)&&!t.some((function(e){return e.toLowerCase()==n.toLowerCase()})))return t.push(n),"continue|actions"},s=0;s=65&&e.keyCode<=90&&n.selectedIndex>=0))return;for(var r=n.items[n.selectedIndex].diagnostic,i=T(r.actions),o=0;oi&&(e.items.splice(i,u-i),o=!0)),r&&c.diagnostic==r.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),a=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),i++}));ir.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&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(a.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(o){r.e(o)}finally{r.f()}for(;e;)t()}},{key:"moveSelection",value:function(e){if(!(this.selectedIndex<0)){var t=m(this.view.state.field(w).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:O.of(t)})}}}],[{key:"open",value:function(t){return new e(t)}}]),e}();function N(e){if("function"!=typeof btoa)return"none";var t='\n \n ');return"url('data:image/svg+xml;base64,".concat(btoa(t),"')")}var _=l.d.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x"},".cm-lintRange-error":{backgroundImage:N("#d11")},".cm-lintRange-warning":{backgroundImage:N("orange")},".cm-lintRange-info":{backgroundImage:N("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return le}));var r=n(4),i=n(6),o=n(19),a=n(13),s=n(63),c=n(24),l=n(25);function u(e,t){return i.e.create(e.ranges.map(t),e.mainIndex)}function f(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function d(e,t){var n=e.state,r=e.dispatch,i=u(n.selection,t);return!i.eq(n.selection)&&(r(f(n,i)),!0)}function h(e,t){return i.e.cursor(t?e.to:e.from)}function p(e,t){return d(e,(function(n){return n.empty?e.moveByChar(n,t):h(n,t)}))}var v=function(e){return p(e,e.textDirection!=a.c.LTR)},m=function(e){return p(e,e.textDirection==a.c.LTR)};function g(e,t){return d(e,(function(n){return n.empty?e.moveByGroup(n,t):h(n,t)}))}function b(e,t,n){if(t.type.prop(n))return!0;var r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function y(e,t,n){for(var r=Object(c.j)(e).resolveInner(t.head),o=n?l.b.closedBy:l.b.openedBy,a=t.head;;){var u=n?r.childAfter(a):r.childBefore(a);if(!u)break;b(e,u,o)?r=u:a=n?u.to:u.from}var f,d;return d=r.type.prop(o)&&(f=n?Object(s.b)(e,r.from,1):Object(s.b)(e,r.to,-1))&&f.matched?n?f.end.to:f.end.from:n?r.to:r.from,i.e.cursor(d,n?-1:1)}function O(e,t){return d(e,(function(n){if(!n.empty)return h(n,t);var r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}var w=function(e){return O(e,!1)},k=function(e){return O(e,!0)};function j(e,t){return d(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):h(n,t)}))}var x=function(e){return j(e,!1)},S=function(e){return j(e,!0)};function C(e,t,n){var r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){var a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(o=i.e.cursor(r.from+a))}return o}var M=function(e){return d(e,(function(t){return C(e,t,!0)}))},P=function(e){return d(e,(function(t){return C(e,t,!1)}))};function T(e,t,n){var r=!1,o=u(e.selection,(function(t){var o=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.headn&&(o="delete.forward"),n=Math.min(n,a),r=Math.max(r,a)}return n==r?{range:e}:{changes:{from:n,to:r},range:i.e.cursor(n)}}));return!a.changes.empty&&(r(n.update(a,{scrollIntoView:!0,userEvent:o})),!0)}function X(e,t,n){if(e instanceof a.d){var i,o=Object(r.a)(e.pluginField(a.e.atomicRanges));try{for(o.s();!(i=o.n()).done;){i.value.between(t,t,(function(e,r){et&&(t=n?r:e)}))}}catch(s){o.e(s)}finally{o.f()}}return t}var Y=function(e,t){return U(e,(function(n){var r,i,a=e.state,s=a.doc.lineAt(n);if(!t&&n>s.from&&n=s.number){var l=n[n.length-1];l.to=c.to,l.ranges.push(a)}else n.push({from:s.from,to:c.to,ranges:[a]});i=c.number+1}}catch(u){o.e(u)}finally{o.f()}return n}function ne(e,t,n){if(e.readOnly)return!1;var o,a=[],s=[],c=Object(r.a)(te(e));try{for(c.s();!(o=c.n()).done;){var l=o.value;if(n?l.to!=e.doc.length:0!=l.from){var u=e.doc.lineAt(n?l.to+1:l.from-1),f=u.length+1;if(n){a.push({from:l.to,to:u.to},{from:l.from,insert:u.text+e.lineBreak});var d,h=Object(r.a)(l.ranges);try{for(h.s();!(d=h.n()).done;){var p=d.value;s.push(i.e.range(Math.min(e.doc.length,p.anchor+f),Math.min(e.doc.length,p.head+f)))}}catch(b){h.e(b)}finally{h.f()}}else{a.push({from:u.from,to:l.from},{from:l.to,insert:e.lineBreak+u.text});var v,m=Object(r.a)(l.ranges);try{for(m.s();!(v=m.n()).done;){var g=v.value;s.push(i.e.range(g.anchor-f,g.head-f))}}catch(b){m.e(b)}finally{m.f()}}}}}catch(b){c.e(b)}finally{c.f()}return!!a.length&&(t(e.update({changes:a,scrollIntoView:!0,selection:i.e.create(s,e.selection.mainIndex),userEvent:"move.line"})),!0)}function re(e,t,n){if(e.readOnly)return!1;var i,o=[],a=Object(r.a)(te(e));try{for(a.s();!(i=a.n()).done;){var s=i.value;n?o.push({from:s.from,insert:e.doc.slice(s.from,s.to)+e.lineBreak}):o.push({from:s.to,insert:e.lineBreak+e.doc.slice(s.from,s.to)})}}catch(c){a.e(c)}finally{a.f()}return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var ie=oe(!1);function oe(e){return function(t){var n=t.state,r=t.dispatch;if(n.readOnly)return!1;var a=n.changeByRange((function(t){var r=t.from,a=t.to,s=n.doc.lineAt(r),u=!e&&r==a&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=Object(c.j)(e).resolveInner(t),i=r.childBefore(t),o=r.childAfter(t);return i&&o&&i.to<=t&&o.from>=t&&(n=i.type.prop(l.b.closedBy))&&n.indexOf(o.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(n,r);e&&(r=a=(a<=s.to?s:n.doc.lineAt(a)).to);var f=new c.a(n,{simulateBreak:r,simulateDoubleBreak:!!u}),d=Object(c.e)(f,r);for(null==d&&(d=/^\s*/.exec(n.doc.lineAt(r).text)[0].length);as.from&&rn&&(r.empty||r.to>s.from)&&(t(s,o,r),n=s.number),a=s.to+1}var c=e.changes(o);return{changes:o,range:i.e.range(c.mapPos(r.anchor,1),c.mapPos(r.head,1))}}))}var se=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(ae(t,(function(e,n){n.push({from:e.from,insert:t.facet(c.h)})})),{userEvent:"input.indent"})),!0)},ce=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(ae(t,(function(e,n){var r=/^\s*/.exec(e.text)[0];if(r){for(var i=Object(o.d)(r,t.tabSize),a=0,s=Object(c.g)(t,Math.max(0,i-Object(c.d)(t)));a1?o=i.e.create([r.main]):r.main.empty||(o=i.e.create([i.e.cursor(r.main.head)])),!!o&&(n(f(t,o)),!0)}},{key:"Mod-Enter",run:oe(!0)},{key:"Alt-l",mac:"Ctrl-l",run:function(e){var t=e.state,n=e.dispatch,r=te(t).map((function(e){var n=e.from,r=e.to;return i.e.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:i.e.create(r),userEvent:"select"})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=u(t.selection,(function(e){for(var n,r=Object(c.j)(t).resolveInner(e.head,1);!(r.from=e.to||r.to>e.to&&r.from<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return i.e.range(r.to,r.from)}));return n(f(t,r)),!0},preventDefault:!0},{key:"Mod-[",run:ce},{key:"Mod-]",run:se},{key:"Mod-Alt-\\",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=Object.create(null),i=new c.a(t,{overrideIndentation:function(e){var t=r[e];return null==t?-1:t}}),o=ae(t,(function(e,n,o){var a=Object(c.e)(i,e.from);if(null!=a){/\S/.test(e.text)||(a=0);var s=/^\s*/.exec(e.text)[0],l=Object(c.g)(t,a);(s!=l||o.from0?n--:rn?n:Math.max(0,t-1),!1)}))}},{mac:"Mod-Delete",run:ee}].concat([{key:"Ctrl-b",run:v,shift:D,preventDefault:!0},{key:"Ctrl-f",run:m,shift:R},{key:"Ctrl-p",run:w,shift:L},{key:"Ctrl-n",run:k,shift:I},{key:"Ctrl-a",run:function(e){return d(e,(function(t){return i.e.cursor(e.lineBlockAt(t.head).from,1)}))},shift:function(e){return E(e,(function(t){return i.e.cursor(e.lineBlockAt(t.head).from)}))}},{key:"Ctrl-e",run:function(e){return d(e,(function(t){return i.e.cursor(e.lineBlockAt(t.head).to,-1)}))},shift:function(e){return E(e,(function(t){return i.e.cursor(e.lineBlockAt(t.head).to)}))}},{key:"Ctrl-d",run:K},{key:"Ctrl-h",run:G},{key:"Ctrl-k",run:ee},{key:"Ctrl-Alt-h",run:Z},{key:"Ctrl-o",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=t.changeByRange((function(e){return{changes:{from:e.from,to:e.to,insert:o.a.of(["",""])},range:i.e.cursor(e.from)}}));return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=t.changeByRange((function(e){if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};var n=e.from,r=t.doc.lineAt(n),a=n==r.from?n-1:Object(o.e)(r.text,n-r.from,!1)+r.from,s=n==r.to?n+1:Object(o.e)(r.text,n-r.from,!0)+r.from;return{changes:{from:a,to:s,insert:t.doc.slice(n,s).append(t.doc.slice(a,n))},range:i.e.cursor(s)}}));return!r.changes.empty&&(n(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Alt-<",run:V},{key:"Alt->",run:H},{key:"Ctrl-v",run:S},{key:"Alt-v",run:x}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))))},function(e,t,n){"use strict";var r=n(1),i=Object(r.createContext)({});t.a=i},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(119),i=n(133);function o(e){return Object(r.a)("MuiDialogTitle",e)}var a=Object(i.a)("MuiDialogTitle",["root"]);t.a=a},function(e,t,n){"use strict";var r=n(1),i=r.createContext({});t.a=i},function(e,t,n){"use strict";var r=n(9),i=n(7),o=n(2),a=n(1),s=(n(17),n(11)),c=n(176),l=n(15),u=n(10),f=n(52),d=n(43),h=n(319),p=n(119),v=n(133);function m(e){return Object(p.a)("PrivateSwitchBase",e)}Object(v.a)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var g=n(0),b=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],y=Object(u.a)(h.a,{skipSx:!0})((function(e){var t=e.ownerState;return Object(o.a)({padding:9,borderRadius:"50%"},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})})),O=Object(u.a)("input",{skipSx:!0})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),w=a.forwardRef((function(e,t){var n=e.autoFocus,a=e.checked,u=e.checkedIcon,h=e.className,p=e.defaultChecked,v=e.disabled,w=e.disableFocusRipple,k=void 0!==w&&w,j=e.edge,x=void 0!==j&&j,S=e.icon,C=e.id,M=e.inputProps,P=e.inputRef,T=e.name,E=e.onBlur,A=e.onChange,D=e.onFocus,R=e.readOnly,N=e.required,_=e.tabIndex,L=e.type,I=e.value,z=Object(i.a)(e,b),B=Object(f.a)({controlled:a,default:Boolean(p),name:"SwitchBase",state:"checked"}),F=Object(r.a)(B,2),$=F[0],W=F[1],V=Object(d.a)(),H=v;V&&"undefined"===typeof H&&(H=V.disabled);var q="checkbox"===L||"radio"===L,Q=Object(o.a)({},e,{checked:$,disabled:H,disableFocusRipple:k,edge:x}),U=function(e){var t=e.classes,n=e.checked,r=e.disabled,i=e.edge,o={root:["root",n&&"checked",r&&"disabled",i&&"edge".concat(Object(l.a)(i))],input:["input"]};return Object(c.a)(o,m,t)}(Q);return Object(g.jsxs)(y,Object(o.a)({component:"span",className:Object(s.default)(U.root,h),centerRipple:!0,focusRipple:!k,disabled:H,tabIndex:null,role:void 0,onFocus:function(e){D&&D(e),V&&V.onFocus&&V.onFocus(e)},onBlur:function(e){E&&E(e),V&&V.onBlur&&V.onBlur(e)},ownerState:Q,ref:t},z,{children:[Object(g.jsx)(O,Object(o.a)({autoFocus:n,checked:a,defaultChecked:p,className:U.input,disabled:H,id:q&&C,name:T,onChange:function(e){if(!e.nativeEvent.defaultPrevented){var t=e.target.checked;W(t),A&&A(e,t)}},readOnly:R,ref:P,required:N,ownerState:Q,tabIndex:_,type:L},"checkbox"===L&&void 0===I?{}:{value:I},M)),$?u:S]}))}));t.a=w},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={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=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 r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n-1},E.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},A.prototype.clear=function(){this.__data__={hash:new T,map:new(S||E),string:new T}},A.prototype.delete=function(e){return _(this,e).delete(e)},A.prototype.get=function(e){return _(this,e).get(e)},A.prototype.has=function(e){return _(this,e).has(e)},A.prototype.set=function(e,t){return _(this,e).set(e,t),this};var I=B((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(W(e))return P?P.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(c,(function(e,t,r,i){n.push(r?i.replace(l,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||W(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function B(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],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(B.Cache||A),n}B.Cache=A;var F=Array.isArray;function $(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function W(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==w.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:R(e,t);return void 0===r?n:r}}).call(this,n(127))},function(e,t,n){"use strict";var r=n(7),i=n(62),o=(n(17),n(1)),a=n.n(o),s=n(53),c=n.n(s),l=!1,u=n(80),f="unmounted",d="exited",h="entering",p="entered",v="exiting",m=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=d,r.appearStatus=h):i=p:i=t.unmountOnExit||t.mountOnEnter?f:d,r.state={status:i},r.nextCallback=null,r}Object(i.a)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===f?{status:d}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==h&&n!==p&&(t=h):n!==h&&n!==p||(t=v)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===h?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===d&&this.setState({status:f})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[c.a.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),u=r?s.appear:s.enter;!e&&!n||l?this.safeSetState({status:p},(function(){t.props.onEntered(o)})):(this.props.onEnter(o,a),this.safeSetState({status:h},(function(){t.props.onEntering(o,a),t.onTransitionEnd(u,(function(){t.safeSetState({status:p},(function(){t.props.onEntered(o,a)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:c.a.findDOMNode(this);t&&!l?(this.props.onExit(r),this.safeSetState({status:v},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:d},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:d},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:c.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===f)return null;var t=this.props,n=t.children,i=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,Object(r.a)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return a.a.createElement(u.a.Provider,{value:null},"function"===typeof n?n(e,i):a.a.cloneElement(a.a.Children.only(n),i))},t}(a.a.Component);function g(){}m.contextType=u.a,m.propTypes={},m.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:g,onEntering:g,onEntered:g,onExit:g,onExiting:g,onExited:g},m.UNMOUNTED=f,m.EXITED=d,m.ENTERING=h,m.ENTERED=p,m.EXITING=v;t.a=m},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(142),i={active:"Mui-active",checked:"Mui-checked",completed:"Mui-completed",disabled:"Mui-disabled",error:"Mui-error",expanded:"Mui-expanded",focused:"Mui-focused",focusVisible:"Mui-focusVisible",required:"Mui-required",selected:"Mui-selected"};function o(e,t){return i[t]||"".concat(r.a.generate(e),"-").concat(t)}},,,,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),l=1;l1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');var n=C(e),r=n.length>0?n[0]:"",o=M("%"+r+"%",t),s=o.name,l=o.value,u=!1,f=o.alias;f&&(r=f[0],w(n,O([0,1],f)));for(var d=1,h=!0;d=n.length){var b=c(l,p);l=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[p]}else h=y(l,p),l=l[p];h&&!u&&(v[s]=l)}}return l}},function(e,t,n){"use strict";var r=n(214);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g,o="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:o,RFC3986:a}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.matchesSelector=f,t.matchesSelectorAndParentsTo=function(e,t,n){var r=e;do{if(f(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.addEvent=function(e,t,n,r){if(!e)return;var i=c({capture:!0},r);e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.removeEvent=function(e,t,n,r){if(!e)return;var i=c({capture:!0},r);e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.outerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,i.int)(n.borderTopWidth),t+=(0,i.int)(n.borderBottomWidth)},t.outerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,i.int)(n.borderLeftWidth),t+=(0,i.int)(n.borderRightWidth)},t.innerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,i.int)(n.paddingTop),t-=(0,i.int)(n.paddingBottom)},t.innerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,i.int)(n.paddingLeft),t-=(0,i.int)(n.paddingRight)},t.offsetXYFromParent=function(e,t,n){var r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-r.left)/n,o=(e.clientY+t.scrollTop-r.top)/n;return{x:i,y:o}},t.createCSSTransform=function(e,t){var n=d(e,t,"px");return l({},(0,o.browserPrefixToKey)("transform",o.default),n)},t.createSVGTransform=function(e,t){return d(e,t,"")},t.getTranslation=d,t.getTouch=function(e,t){return e.targetTouches&&(0,i.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,i.findInArray)(e.changedTouches,(function(e){return t===e.identifier}))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.addUserSelectStyles=function(e){if(!e)return;var t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&h(e.body,"react-draggable-transparent-selection")},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&p(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{var t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(n){}},t.addClassName=h,t.removeClassName=p;var i=n(98),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=o?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(i,s,c):i[s]=e[s]}i.default=e,n&&n.set(e,i);return i}(n(226));function a(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function s(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 c(e){for(var t=1;tthis[a])return w(this,this[p].get(e)),!1;var o=this[p].get(e).value;return this[f]&&(this[d]||this[f](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[s]+=i-o.length,o.length=i,this.get(e),O(this),!0}var l=new k(e,t,i,r,n);return l.length>this[a]?(this[f]&&this[f](e,t),!1):(this[s]+=l.length,this[h].unshift(l),this[p].set(e,this[h].head),O(this),!0)}},{key:"has",value:function(e){if(!this[p].has(e))return!1;var t=this[p].get(e).value;return!y(this,t)}},{key:"get",value:function(e){return b(this,e,!0)}},{key:"peek",value:function(e){return b(this,e,!1)}},{key:"pop",value:function(){var e=this[h].tail;return e?(w(this,e),e.value):null}},{key:"del",value:function(e){w(this,this[p].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var e=this;this[p].forEach((function(t,n){return b(e,n,!1)}))}}]),e}(),b=function(e,t,n){var r=e[p].get(t);if(r){var i=r.value;if(y(e,i)){if(w(e,r),!e[l])return}else n&&(e[v]&&(r.value.now=Date.now()),e[h].unshiftNode(r));return i.value}},y=function(e,t){if(!t||!t.maxAge&&!e[u])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[u]&&n>e[u]},O=function(e){if(e[s]>e[a])for(var t=e[h].tail;e[s]>e[a]&&null!==t;){var n=t.prev;w(e,t),t=n}},w=function(e,t){if(t){var n=t.value;e[f]&&e[f](n.key,n.value),e[s]-=n.length,e[p].delete(n.key),e[h].removeNode(t)}},k=function e(t,n,i,o,a){r(this,e),this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=a||0},j=function(e,t,n,r){var i=n.value;y(e,i)&&(w(e,n),e[l]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=g},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(119);function i(e,t){var n={};return t.forEach((function(t){n[t]=Object(r.a)(e,t)})),n}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(2);function i(e){return null!==e&&"object"===typeof e&&e.constructor===Object}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},a=n.clone?Object(r.a)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e&&i(e[r])?a[r]=o(e[r],t[r],n):a[r]=t[r])})),a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1),i=n(93);function o(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){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===r.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r: Unmounted during event!");return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){void 0}},function(e,t,n){"use strict";var r=function(e){return e},i=function(){var e=r;return{configure:function(t){e=t},generate:function(t){return e(t)},reset:function(){e=r}}}();t.a=i},function(e,t,n){"use strict";var r=n(235);function i(e){return 0===Object.keys(e).length}t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=Object(r.a)();return!t||i(t)?e:t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(236);function i(e){var t=e.theme,n=e.name,i=e.props;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?Object(r.a)(t.components[n].defaultProps,i):i}},function(e,t,n){e.exports=function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,o=864e5,a=/\[([^\]]+)]|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,c=2592e6,l=/^(-|\+)?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:c,days:o,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(l);if(i){var o=i.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[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/c),e%=c,this.$d.days=v(e/o),e%=o,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"),o=g(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=g(a,"S"),c=e.negative||t.negative||r.negative||i.negative||o.negative||s.negative,l=i.format||o.format||s.format?"T":"",u=(c?"-":"")+"P"+e.format+t.format+r.format+l+i.format+o.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(a,(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 o=r.prototype.add,a=r.prototype.subtract;r.prototype.add=function(e,t){return f(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)},r.prototype.subtract=function(e,t){return f(e)&&(e=e.asMilliseconds()),a.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,o){var a=i.prototype;o.utc=function(e){return new i({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=a.init;a.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 c.call(this)};var l=a.utcOffset;a.utcOffset=function(r,i){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?l.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],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(r)))return this;var a=Math.abs(r)<=16?60*r:r,s=this;if(i)return s.$offset=a,s.$u=0===r,s;if(0!==r){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+c,e)).$offset=a,s.$x.$localOffset=c}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),i=o(e).local();return d.call(r,i,t,n)}}}()},function(e,t,n){"use strict";var r=n(210),i=n(220),o=n(126);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";var r=n(44);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(45)),o=n(0),a=(0,i.default)((0,o.jsx)("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=a},function(e,t,n){"use strict";var r=n(44);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(45)),o=n(0),a=(0,i.default)((0,o.jsx)("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=a},function(e,t,n){"use strict";var r=n(44);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(45)),o=n(0),a=(0,i.default)((0,o.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=a},function(e,t,n){"use strict";var r=n(44);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(45)),o=n(0),a=(0,i.default)((0,o.jsx)("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=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return qn}));var r=n(9);function i(e,t,n,r){var i;n=n||0;for(var o=(r=r||t.length-1)<=2147483647;r-n>1;)t[i=o?n+r>>1:O((n+r)/2)]=t&&i<=n;i+=r)if(null!=e[i])return i;return-1}var a=[0,0];function s(e,t,n,r){return a[0]=n<0?W(e,-n):e,a[1]=r<0?W(t,-r):t,a}function c(e,t,n,r){var i,o,a,c=C(e),l=10==n?M:P;return e==t&&(-1==c?(e*=n,t/=n):(e/=n,t*=n)),r?(i=O(l(e)),o=k(l(t)),e=(a=s(S(n,i),S(n,o),i,o))[0],t=a[1]):(i=O(l(y(e))),o=O(l(y(t))),e=$(e,(a=s(S(n,i),S(n,o),i,o))[0]),t=F(t,a[1])),[e,t]}function l(e,t,n,r){var i=c(e,t,n,r);return 0==e&&(i[0]=0),0==t&&(i[1]=0),i}var u={mode:3,pad:.1},f={pad:0,soft:null,mode:0},d={min:f,max:f};function h(e,t,n,r){return K(n)?v(e,t,n):(f.pad=n,f.soft=r?0:null,f.mode=r?3:0,v(e,t,d))}function p(e,t){return null==e?t:e}function v(e,t,n){var r=n.min,i=n.max,o=p(r.pad,0),a=p(i.pad,0),s=p(r.hard,-E),c=p(i.hard,E),l=p(r.soft,E),u=p(i.soft,-E),f=p(r.mode,0),d=p(i.mode,0),h=t-e;h<1e-9&&(h=0,0!=e&&0!=t||(h=1e-9,2==f&&l!=E&&(o=0),2==d&&u!=-E&&(a=0)));var v=h||y(t)||1e3,m=M(v),g=S(10,O(m)),b=W($(e-v*(0==h?0==e?.1:1:o),g/10),9),w=e>=l&&(1==f||3==f&&b<=l||2==f&&b>=l)?l:E,k=x(s,b=w?w:j(w,b)),C=W(F(t+v*(0==h?0==t?.1:1:a),g/10),9),P=t<=u&&(1==d||3==d&&C>=u||2==d&&C<=u)?u:-E,T=j(c,C>P&&t<=P?P:x(P,C));return k==T&&0==k&&(T=100),[k,T]}var m=new Intl.NumberFormat(navigator.language).format,g=Math,b=g.PI,y=g.abs,O=g.floor,w=g.round,k=g.ceil,j=g.min,x=g.max,S=g.pow,C=g.sign,M=g.log10,P=g.log2,T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return g.asinh(e/t)},E=1/0;function A(e){return 1+(0|M((e^e>>31)-(e>>31)))}function D(e,t){return w(e/t)*t}function R(e,t,n){return j(x(e,t),n)}function N(e){return"function"==typeof e?e:function(){return e}}var _=function(e){return e},L=function(e,t){return t},I=function(e){return null},z=function(e){return!0},B=function(e,t){return e==t};function F(e,t){return k(e/t)*t}function $(e,t){return O(e/t)*t}function W(e,t){return w(e*(t=Math.pow(10,t)))/t}var V=new Map;function H(e){return((""+e).split(".")[1]||"").length}function q(e,t,n,r){for(var i=[],o=r.map(H),a=t;a=0&&a>=0?0:s)+(a>=o[l]?0:o[l]),d=W(u,f);i.push(d),V.set(d,f)}return i}var Q={},U=[],X=[null,null],Y=Array.isArray;function G(e){return"string"==typeof e}function K(e){var t=!1;if(null!=e){var n=e.constructor;t=null==n||n==Object}return t}function J(e){return null!=e&&"object"==typeof e}function Z(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;if(Y(e)){var r=e.find((function(e){return null!=e}));if(Y(r)||n(r)){t=Array(e.length);for(var i=0;io){for(r=a-1;r>=0&&null==e[r];)e[r--]=null;for(r=a+1;rr||n>i?Se(e,we):Ce(e,we))}var De=new WeakMap;function Re(e,t,n){var r=t+n;r!=De.get(e)&&(De.set(e,r),e.style.background=t,e.style.borderColor=n)}var Ne=new WeakMap;function _e(e,t,n,r){var i=t+""+n;i!=Ne.get(e)&&(Ne.set(e,i),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=r?-t/2+"px":0,e.style.marginTop=r?-n/2+"px":0)}var Le={passive:!0},Ie=ee({capture:!0},Le);function ze(e,t,n,r){t.addEventListener(e,n,r?Ie:Le)}function Be(e,t,n,r){t.removeEventListener(e,n,r?Ie:Le)}!function e(){var t=devicePixelRatio;ne!=t&&(ne=t,re&&Be(ye,re,e),re=matchMedia("(min-resolution: ".concat(ne-.001,"dppx) and (max-resolution: ").concat(ne+.001,"dppx)")),ze(ye,re,e),xe.dispatchEvent(new CustomEvent(Oe)))}();var Fe=["January","February","March","April","May","June","July","August","September","October","November","December"],$e=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function We(e){return e.slice(0,3)}var Ve=$e.map(We),He=Fe.map(We),qe={MMMM:Fe,MMM:He,WWWW:$e,WWW:Ve};function Qe(e){return(e<10?"0":"")+e}var Ue={YYYY:function(e){return e.getFullYear()},YY:function(e){return(e.getFullYear()+"").slice(2)},MMMM:function(e,t){return t.MMMM[e.getMonth()]},MMM:function(e,t){return t.MMM[e.getMonth()]},MM:function(e){return Qe(e.getMonth()+1)},M:function(e){return e.getMonth()+1},DD:function(e){return Qe(e.getDate())},D:function(e){return e.getDate()},WWWW:function(e,t){return t.WWWW[e.getDay()]},WWW:function(e,t){return t.WWW[e.getDay()]},HH:function(e){return Qe(e.getHours())},H:function(e){return e.getHours()},h:function(e){var t=e.getHours();return 0==t?12:t>12?t-12:t},AA:function(e){return e.getHours()>=12?"PM":"AM"},aa:function(e){return e.getHours()>=12?"pm":"am"},a:function(e){return e.getHours()>=12?"p":"a"},mm:function(e){return Qe(e.getMinutes())},m:function(e){return e.getMinutes()},ss:function(e){return Qe(e.getSeconds())},s:function(e){return e.getSeconds()},fff:function(e){return((t=e.getMilliseconds())<10?"00":t<100?"0":"")+t;var t}};function Xe(e,t){t=t||qe;for(var n,r=[],i=/\{([a-z]+)\}|[^{]+/gi;n=i.exec(e);)r.push("{"==n[0][0]?Ue[n[1]]:n[0]);return function(e){for(var n="",i=0;i=a,v=f>=o&&f=i?i:f,D=y+(O(l)-O(g))+F(g-y,A);h.push(D);for(var R=t(D),N=R.getHours()+R.getMinutes()/n+R.getSeconds()/r,_=f/r,L=d/s.axes[c]._space;!((D=W(D+f,1==e?0:3))>u);)if(_>1){var I=O(W(N+_,6))%24,z=t(D).getHours()-I;z>1&&(z=-1),N=(N+_)%24,W(((D-=z*r)-h[h.length-1])/f,3)*L>=.7&&h.push(D)}else h.push(D)}return h}}]}var ht=dt(1),pt=Object(r.a)(ht,3),vt=pt[0],mt=pt[1],gt=pt[2],bt=dt(.001),yt=Object(r.a)(bt,3),Ot=yt[0],wt=yt[1],kt=yt[2];function jt(e,t){return e.map((function(e){return e.map((function(n,r){return 0==r||8==r||null==n?n:t(1==r||0==e[8]?n:e[1]+n)}))}))}function xt(e,t){return function(n,r,i,o,a){var s,c,l,u,f,d,h=t.find((function(e){return a>=e[0]}))||t[t.length-1];return r.map((function(t){var n=e(t),r=n.getFullYear(),i=n.getMonth(),o=n.getDate(),a=n.getHours(),p=n.getMinutes(),v=n.getSeconds(),m=r!=s&&h[2]||i!=c&&h[3]||o!=l&&h[4]||a!=u&&h[5]||p!=f&&h[6]||v!=d&&h[7]||h[1];return s=r,c=i,l=o,u=a,f=p,d=v,m(n)}))}}function St(e,t,n){return new Date(e,t,n)}function Ct(e,t){return t(e)}q(2,-53,53,[1]);function Mt(e,t){return function(n,r){return t(e(r))}}var Pt={show:!0,live:!0,isolate:!1,markers:{show:!0,width:2,stroke:function(e,t){var n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]};var Tt=[0,0];function Et(e,t,n){return function(e){0==e.button&&n(e)}}function At(e,t,n){return n}var Dt={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,n){return Tt[0]=t,Tt[1]=n,Tt},points:{show:function(e,t){var n=e.cursor.points,r=Te(),i=n.size(e,t);Me(r,oe,i),Me(r,ae,i);var o=i/-2;Me(r,"marginLeft",o),Me(r,"marginTop",o);var a=n.width(e,t,i);return a&&Me(r,"borderWidth",a),r},size:function(e,t){return Gt(e.series[t].points.width,1)},width:0,stroke:function(e,t){var n=e.series[t].points;return n._stroke||n._fill},fill:function(e,t){var n=e.series[t].points;return n._fill||n._stroke}},bind:{mousedown:Et,mouseup:Et,click:Et,dblclick:Et,mousemove:At,mouseleave:At,mouseenter:At},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,_x:!1,_y:!1},focus:{prox:-1},left:-10,top:-10,idx:null,dataIdx:function(e,t,n){return n},idxs:null},Rt={show:!0,stroke:"rgba(0,0,0,0.07)",width:2,filter:L},Nt=ee({},Rt,{size:10}),_t='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Lt="bold "+_t,It={show:!0,scale:"x",stroke:fe,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Lt,side:2,grid:Rt,ticks:Nt,font:_t,rotate:0},zt={show:!0,scale:"x",auto:!1,sorted:1,min:E,max:-E,idxs:[]};function Bt(e,t,n,r,i){return t.map((function(e){return null==e?"":m(e)}))}function Ft(e,t,n,r,i,o,a){for(var s=[],c=V.get(i)||0,l=n=a?n:W(F(n,i),c);l<=r;l=W(l+i,c))s.push(Object.is(l,-0)?0:l);return s}function $t(e,t,n,r,i,o,a){var s=[],c=e.scales[e.axes[t].scale].log,l=O((10==c?M:P)(n));i=S(c,l),l<0&&(i=W(i,-l));var u=n;do{s.push(u),(u=W(u+i,V.get(i)))>=i*c&&(i=u)}while(u<=r);return s}function Wt(e,t,n,r,i,o,a){var s=e.scales[e.axes[t].scale].asinh,c=r>s?$t(e,t,x(s,n),r,i):[s],l=r>=0&&n<=0?[0]:[];return(n<-s?$t(e,t,x(s,-r),-n,i):[s]).reverse().map((function(e){return-e})).concat(l,c)}var Vt=/./,Ht=/[12357]/,qt=/[125]/,Qt=/1/;function Ut(e,t,n,r,i){var o=e.axes[n],a=o.scale,s=e.scales[a];if(3==s.distr&&2==s.log)return t;var c=e.valToPos,l=o._space,u=c(10,a),f=c(9,a)-u>=l?Vt:c(7,a)-u>=l?Ht:c(5,a)-u>=l?qt:Qt;return t.map((function(e){return 4==s.distr&&0==e||f.test(e)?e:null}))}function Xt(e,t){return null==t?"":m(t)}var Yt={show:!0,scale:"y",stroke:fe,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Lt,side:3,grid:Rt,ticks:Nt,font:_t,rotate:0};function Gt(e,t){return W((3+2*(e||1))*t,3)}function Kt(e,t,n,r){var i=e.scales[e.series[t].scale],o=e.bands&&e.bands.some((function(e){return e.series[0]==t}));return 3==i.distr||o?i.min:0}var Jt={scale:null,auto:!0,min:E,max:-E},Zt={show:!0,auto:!0,sorted:0,alpha:1,facets:[ee({},Jt,{scale:"x"}),ee({},Jt,{scale:"y"})]},en={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:function(e,t,n,r,i){return i},alpha:1,points:{show:function(e,t){var n=e.series[0],r=n.scale,i=n.idxs,o=e._data[0],a=e.valToPos(o[i[0]],r,!0),s=e.valToPos(o[i[1]],r,!0),c=y(s-a)/(e.series[t].points.space*ne);return i[1]-i[0]<=c},filter:null},values:null,min:E,max:-E,idxs:[],path:null,clip:null};function tn(e,t,n,r,i){return n/10}var nn={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},rn=ee({},nn,{time:!1,ori:1}),on={};function an(e,t){var n=on[e];return n||(n={key:e,plots:[],sub:function(e){n.plots.push(e)},unsub:function(e){n.plots=n.plots.filter((function(t){return t!=e}))},pub:function(e,t,r,i,o,a,s){for(var c=0;c0){a=new Path2D;for(var s=0==t?gn:bn,c=n,l=0;lu[0]&&(s(a,c,r,u[0]-c,r+o),c=u[1])}s(a,c,r,n+i-c,r+o)}return a}function un(e,t,n){var r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])}function fn(e){return 0==e?_:1==e?w:function(t){return D(t,e)}}function dn(e){var t=0==e?hn:pn,n=0==e?function(e,t,n,r,i,o){e.arcTo(t,n,r,i,o)}:function(e,t,n,r,i,o){e.arcTo(n,t,i,r,o)},r=0==e?function(e,t,n,r,i){e.rect(t,n,r,i)}:function(e,t,n,r,i){e.rect(n,t,i,r)};return function(e,i,o,a,s){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;0==c?r(e,i,o,a,s):(c=Math.min(c,a/2,s/2),t(e,i+c,o),n(e,i+a,o,i+a,o+s,c),n(e,i+a,o+s,i,o+s,c),n(e,i,o+s,i,o,c),n(e,i,o,i+a,o,c),e.closePath())}}var hn=function(e,t,n){e.moveTo(t,n)},pn=function(e,t,n){e.moveTo(n,t)},vn=function(e,t,n){e.lineTo(t,n)},mn=function(e,t,n){e.lineTo(n,t)},gn=dn(0),bn=dn(1),yn=function(e,t,n,r,i,o){e.arc(t,n,r,i,o)},On=function(e,t,n,r,i,o){e.arc(n,t,r,i,o)},wn=function(e,t,n,r,i,o,a){e.bezierCurveTo(t,n,r,i,o,a)},kn=function(e,t,n,r,i,o,a){e.bezierCurveTo(n,t,i,r,a,o)};function jn(e){return function(e,t,n,r,i){return sn(e,t,(function(t,o,a,s,c,l,u,f,d,h,p){var v,m,g=t.pxRound,y=t.points;0==s.ori?(v=hn,m=yn):(v=pn,m=On);var O=W(y.width*ne,3),w=(y.size-y.width)/2*ne,k=W(2*w,3),j=new Path2D,x=new Path2D,S=e.bbox,C=S.left,M=S.top,P=S.width,T=S.height;gn(x,C-k,M-k,P+2*k,T+2*k);var E=function(e){if(null!=a[e]){var t=g(l(o[e],s,h,f)),n=g(u(a[e],c,p,d));v(j,t+w,n),m(j,t,n,w,0,2*b)}};if(i)i.forEach(E);else for(var A=n;A<=r;A++)E(A);return{stroke:O>0?j:null,fill:j,clip:x,flags:3}}))}}function xn(e){return function(t,n,r,i,o,a){r!=i&&(o!=r&&a!=r&&e(t,n,r),o!=i&&a!=i&&e(t,n,i),e(t,n,a))}}var Sn=xn(vn),Cn=xn(mn);function Mn(){return function(e,t,n,r){return sn(e,t,(function(i,a,s,c,l,u,f,d,h,p,v){var m,g,b=i.pxRound;0==c.ori?(m=vn,g=Sn):(m=mn,g=Cn);var y,O,w,k,S=c.dir*(0==c.ori?1:-1),C={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},M=C.stroke,P=E,T=-E,A=[],D=b(u(a[1==S?n:r],c,p,d)),R=!1,N=!1,_=o(s,n,r,1*S),L=o(s,n,r,-1*S),I=b(u(a[_],c,p,d)),z=b(u(a[L],c,p,d));I>d&&un(A,d,I);for(var B=1==S?n:r;B>=n&&B<=r;B+=S){var F=b(u(a[B],c,p,d));if(F==D)null!=s[B]?(O=b(f(s[B],l,v,h)),P==E&&(m(M,F,O),y=O),P=j(O,P),T=x(O,T)):null===s[B]&&(R=N=!0);else{var $=!1;P!=E?(g(M,D,P,T,y,O),w=k=D):R&&($=!0,R=!1),null!=s[B]?(m(M,F,O=b(f(s[B],l,v,h))),P=T=y=O,N&&F-D>1&&($=!0),N=!1):(P=E,T=-E,null===s[B]&&(R=!0,F-D>1&&($=!0))),$&&un(A,w,F),D=F}}if(P!=E&&P!=T&&k!=D&&g(M,D,P,T,y,O),z0&&(C.band=cn(e,t,n,r,M)),C}))}}function Pn(e,t,n,r,i,o){var a=e.length;if(a<2)return null;var s=new Path2D;if(n(s,e[0],t[0]),2==a)r(s,e[1],t[1]);else{for(var c=Array(a),l=Array(a-1),u=Array(a-1),f=Array(a-1),d=0;d0!==l[h]>0?c[h]=0:(c[h]=3*(f[h-1]+f[h])/((2*f[h]+f[h-1])/l[h-1]+(f[h]+2*f[h-1])/l[h]),isFinite(c[h])||(c[h]=0));c[a-1]=l[a-2];for(var p=0;p=o&&a+(l<5?V.get(l):0)<=17)return[l,u]}while(++c0?e:t.clamp(o,e,t.min,t.max,t.key)):4==t.distr?T(e,t.asinh):e)-t._min)/(t._max-t._min)}function f(e,t,n,r){var i=s(e,t);return r+n*(-1==t.dir?1-i:i)}function d(e,t,n,r){var i=s(e,t);return r+n*(-1==t.dir?i:1-i)}function v(e,t,n,r){return 0==t.ori?f(e,t,n,r):d(e,t,n,r)}o.valToPosH=f,o.valToPosV=d;var m=!1;o.status=0;var O=o.root=Te("uplot");(null!=e.id&&(O.id=e.id),Se(O,e.class),e.title)&&(Te("u-title",O).textContent=e.title);var C=Pe("canvas"),P=o.ctx=C.getContext("2d"),A=Te("u-wrap",O),_=o.under=Te("u-under",A);A.appendChild(C);var $=o.over=Te("u-over",A),V=+p((e=Z(e)).pxAlign,1),H=fn(V);(e.plugins||[]).forEach((function(t){t.opts&&(e=t.opts(o,e)||e)}));var q,te,re=e.ms||.001,fe=o.series=1==a?Rn(e.series||[],zt,en,!1):(q=e.series||[null],te=Zt,q.map((function(e,t){return 0==t?null:ee({},te,e)}))),ye=o.axes=Rn(e.axes||[],It,Yt,!0),Ee=o.scales={},De=o.bands=e.bands||[];De.forEach((function(e){e.fill=N(e.fill||null)}));var Ne=2==a?fe[1].facets[0].scale:fe[0].scale,Le={axes:function(){for(var e=function(e){var t=ye[e];if(!t.show||!t._show)return"continue";var n=t.side,i=n%2,a=void 0,s=void 0,c=t.stroke(o,e),l=0==n||3==n?-1:1;if(t.label){var u=t.labelGap*l,f=w((t._lpos+u)*ne);ar(t.labelFont[0],c,"center",2==n?se:ce),P.save(),1==i?(a=s=0,P.translate(f,w(Jt+sn/2)),P.rotate((3==n?-b:b)/2)):(a=w(Qt+on/2),s=f),P.fillText(t.label,a,s),P.restore()}var d=Object(r.a)(t._found,2),h=d[0],p=d[1];if(0==p)return"continue";var m=Ee[t.scale],g=0==i?on:sn,y=0==i?Qt:Jt,O=w(t.gap*ne),k=t._splits,j=2==m.distr?k.map((function(e){return tr[e]})):k,x=2==m.distr?tr[k[1]]-tr[k[0]]:h,S=t.ticks,C=S.show?w(S.size*ne):0,M=t._rotate*-b/180,T=H(t._pos*ne),E=T+(C+O)*l;s=0==i?E:0,a=1==i?E:0,ar(t.font[0],c,1==t.align?le:2==t.align?ue:M>0?le:M<0?ue:0==i?"center":3==n?ue:le,M||1==i?"middle":2==n?se:ce);for(var A=1.5*t.font[1],D=k.map((function(e){return H(v(e,m,g,y))})),R=t._values,N=0;N0&&(fe.forEach((function(e,n){if(n>0&&e.show&&null==e._paths){var r=function(e){var t=R(Jn-1,0,xn-1),n=R(Zn+1,0,xn-1);for(;null==e[t]&&t>0;)t--;for(;null==e[n]&&n0&&e.show){Yn!=e.alpha&&(P.globalAlpha=Yn=e.alpha),cr(t,!1),e._paths&&lr(t,!1),cr(t,!0);var n=e.points.show(o,t,Jn,Zn),r=e.points.filter(o,t,n,e._paths?e._paths.gaps:null);(n||r)&&(e.points._paths=e.points.paths(o,t,Jn,Zn,r),lr(t,!0)),1!=Yn&&(P.globalAlpha=Yn=1),di("drawSeries",t)}})))}},Ie=(e.drawOrder||["axes","series"]).map((function(e){return Le[e]}));function Fe(t){var n=Ee[t];if(null==n){var r=(e.scales||Q)[t]||Q;if(null!=r.from)Fe(r.from),Ee[t]=ee({},Ee[r.from],r,{key:t});else{n=Ee[t]=ee({},t==Ne?nn:rn,r),2==a&&(n.time=!1),n.key=t;var i=n.time,o=n.range,s=Y(o);if((t!=Ne||2==a)&&(!s||null!=o[0]&&null!=o[1]||(o={min:null==o[0]?u:{mode:1,hard:o[0],soft:o[0]},max:null==o[1]?u:{mode:1,hard:o[1],soft:o[1]}},s=!1),!s&&K(o))){var c=o;o=function(e,t,n){return null==t?X:h(t,n,c)}}n.range=N(o||(i?Ln:t==Ne?3==n.distr?Bn:4==n.distr?$n:_n:3==n.distr?zn:4==n.distr?Fn:In)),n.auto=N(!s&&n.auto),n.clamp=N(n.clamp||tn),n._min=n._max=null}}}for(var $e in Fe("x"),Fe("y"),1==a&&fe.forEach((function(e){Fe(e.scale)})),ye.forEach((function(e){Fe(e.scale)})),e.scales)Fe($e);var We,Ve,He=Ee[Ne],qe=He.distr;0==He.ori?(Se(O,"u-hz"),We=f,Ve=d):(Se(O,"u-vt"),We=d,Ve=f);var Qe={};for(var Ue in Ee){var Ye=Ee[Ue];null==Ye.min&&null==Ye.max||(Qe[Ue]={min:Ye.min,max:Ye.max},Ye.min=Ye.max=null)}var Ge,Ke=e.tzDate||function(e){return new Date(w(e/re))},Je=e.fmtDate||Xe,Ze=1==re?gt(Ke):kt(Ke),nt=xt(Ke,jt(1==re?mt:wt,Je)),rt=Mt(Ke,Ct("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",Je)),it=[],ot=o.legend=ee({},Pt,e.legend),at=ot.show,st=ot.markers;ot.idxs=it,st.width=N(st.width),st.dash=N(st.dash),st.stroke=N(st.stroke),st.fill=N(st.fill);var ct,lt=[],ut=[],ft=!1,dt={};if(ot.live){var ht=fe[1]?fe[1].values:null;for(var pt in ct=(ft=null!=ht)?ht(o,1,0):{_:0})dt[pt]="--"}if(at)if(Ge=Pe("table","u-legend",O),ft){var bt=Pe("tr","u-thead",Ge);for(var yt in Pe("th",null,bt),ct)Pe("th",ke,bt).textContent=yt}else Se(Ge,"u-inline"),ot.live&&Se(Ge,"u-live");var St={show:!0},Tt={show:!1};var Et=new Map;function At(e,t,n){var r=Et.get(t)||{},i=mn.bind[e](o,t,n);i&&(ze(e,t,r[e]=i),Et.set(t,r))}function Rt(e,t,n){var r=Et.get(t)||{};for(var i in r)null!=e&&i!=e||(Be(i,t,r[i]),delete r[i]);null==e&&Et.delete(t)}var Nt=0,_t=0,Lt=0,Vt=0,Ht=0,qt=0,Qt=0,Jt=0,on=0,sn=0;o.bbox={};var cn=!1,ln=!1,un=!1,dn=!1,hn=!1;function pn(e,t,n){(n||e!=o.width||t!=o.height)&&vn(e,t),mr(!1),un=!0,ln=!0,dn=hn=mn.left>=0,Er()}function vn(e,t){o.width=Nt=Lt=e,o.height=_t=Vt=t,Ht=qt=0,function(){var e=!1,t=!1,n=!1,r=!1;ye.forEach((function(i,o){if(i.show&&i._show){var a=i.side,s=a%2,c=i._size+(null!=i.label?i.labelSize:0);c>0&&(s?(Lt-=c,3==a?(Ht+=c,r=!0):n=!0):(Vt-=c,0==a?(qt+=c,e=!0):t=!0))}})),kn[0]=e,kn[1]=n,kn[2]=t,kn[3]=r,Lt-=Kn[1]+Kn[3],Ht+=Kn[3],Vt-=Kn[2]+Kn[0],qt+=Kn[0]}(),function(){var e=Ht+Lt,t=qt+Vt,n=Ht,r=qt;function i(i,o){switch(i){case 1:return(e+=o)-o;case 2:return(t+=o)-o;case 3:return(n-=o)+o;case 0:return(r-=o)+o}}ye.forEach((function(e,t){if(e.show&&e._show){var n=e.side;e._pos=i(n,e._size),null!=e.label&&(e._lpos=i(n,e.labelSize))}}))}();var n=o.bbox;Qt=n.left=D(Ht*ne,.5),Jt=n.top=D(qt*ne,.5),on=n.width=D(Lt*ne,.5),sn=n.height=D(Vt*ne,.5)}o.setSize=function(e){pn(e.width,e.height)};var mn=o.cursor=ee({},Dt,{drag:{y:2==a}},e.cursor);mn.idxs=it,mn._lock=!1;var gn=mn.points;gn.show=N(gn.show),gn.size=N(gn.size),gn.stroke=N(gn.stroke),gn.width=N(gn.width),gn.fill=N(gn.fill);var bn=o.focus=ee({},e.focus||{alpha:.3},mn.focus),yn=bn.prox>=0,On=[null];function wn(e,t){if(1==a||t>0){var n=1==a&&Ee[e.scale].time,r=e.value;e.value=n?G(r)?Mt(Ke,Ct(r,Je)):r||rt:r||Xt,e.label=e.label||(n?"Time":"Value")}if(t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||An||I,e.fillTo=N(e.fillTo||Kt),e.pxAlign=+p(e.pxAlign,V),e.pxRound=fn(e.pxAlign),e.stroke=N(e.stroke||null),e.fill=N(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;var i=Gt(e.width,1),s=e.points=ee({},{size:i,width:x(1,.2*i),stroke:e.stroke,space:2*i,paths:Dn,_stroke:null,_fill:null},e.points);s.show=N(s.show),s.filter=N(s.filter),s.fill=N(s.fill),s.stroke=N(s.stroke),s.paths=N(s.paths),s.pxAlign=e.pxAlign}if(at){var c=function(e,t){if(0==t&&(ft||!ot.live||2==a))return X;var n=[],r=Pe("tr","u-series",Ge,Ge.childNodes[t]);Se(r,e.class),e.show||Se(r,we);var i=Pe("th",null,r);if(st.show){var s=Te("u-marker",i);if(t>0){var c=st.width(o,t);c&&(s.style.border=c+"px "+st.dash(o,t)+" "+st.stroke(o,t)),s.style.background=st.fill(o,t)}}var l=Te(ke,i);for(var u in l.textContent=e.label,t>0&&(st.show||(l.style.color=e.width>0?st.stroke(o,t):st.fill(o,t)),At("click",i,(function(t){if(!mn._lock){var n=fe.indexOf(e);if((t.ctrlKey||t.metaKey)!=ot.isolate){var r=fe.some((function(e,t){return t>0&&t!=n&&e.show}));fe.forEach((function(e,t){t>0&&Hr(t,r?t==n?St:Tt:St,!0,hi.setSeries)}))}else Hr(n,{show:!e.show},!0,hi.setSeries)}})),yn&&At(me,i,(function(t){mn._lock||Hr(fe.indexOf(e),qr,!0,hi.setSeries)}))),ct){var f=Pe("td","u-value",r);f.textContent="--",n.push(f)}return[r,n]}(e,t);lt.splice(t,0,c[0]),ut.splice(t,0,c[1]),ot.values.push(null)}if(mn.show){it.splice(t,0,null);var l=function(e,t){if(t>0){var n=mn.points.show(o,t);if(n)return Se(n,"u-cursor-pt"),Se(n,e.class),Ae(n,-10,-10,Lt,Vt),$.insertBefore(n,On[t]),n}}(e,t);l&&On.splice(t,0,l)}}o.addSeries=function(e,t){e=Nn(e,t=null==t?fe.length:t,zt,en),fe.splice(t,0,e),wn(fe[t],t)},o.delSeries=function(e){if(fe.splice(e,1),at){ot.values.splice(e,1),ut.splice(e,1);var t=lt.splice(e,1)[0];Rt(null,t.firstChild),t.remove()}mn.show&&(it.splice(e,1),On.length>1&&On.splice(e,1)[0].remove())};var kn=[!1,!1,!1,!1];function jn(e,t,n,i){var o=Object(r.a)(n,4),a=o[0],s=o[1],c=o[2],l=o[3],u=t%2,f=0;return 0==u&&(l||s)&&(f=0==t&&!a||2==t&&!c?w(It.size/3):0),1==u&&(a||c)&&(f=1==t&&!s||3==t&&!l?w(Yt.size/2):0),f}var xn,Sn,Cn,Mn,Pn,En,qn,Qn,Un,Xn,Yn,Gn=o.padding=(e.padding||[jn,jn,jn,jn]).map((function(e){return N(p(e,jn))})),Kn=o._padding=Gn.map((function(e,t){return e(o,t,kn,0)})),Jn=null,Zn=null,er=1==a?fe[0].idxs:null,tr=null,nr=!1;function rr(e,n){if(2==a){xn=0;for(var r=1;r=0,hn=!0,Er()}}function ir(){var e,n;if(nr=!0,1==a)if(xn>0){if(Jn=er[0]=0,Zn=er[1]=xn-1,e=t[0][Jn],n=t[0][Zn],2==qe)e=Jn,n=Zn;else if(1==xn)if(3==qe){var i=c(e,e,He.log,!1),o=Object(r.a)(i,2);e=o[0],n=o[1]}else if(4==qe){var s=l(e,e,He.log,!1),u=Object(r.a)(s,2);e=u[0],n=u[1]}else if(He.time)n=e+w(86400/re);else{var f=h(e,n,.1,!0),d=Object(r.a)(f,2);e=d[0],n=d[1]}}else Jn=er[0]=e=null,Zn=er[1]=n=null;Vr(Ne,e,n)}function or(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"butt",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:de,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"round";e!=Sn&&(P.strokeStyle=Sn=e),i!=Cn&&(P.fillStyle=Cn=i),t!=Mn&&(P.lineWidth=Mn=t),o!=En&&(P.lineJoin=En=o),r!=qn&&(P.lineCap=qn=r),n!=Pn&&P.setLineDash(Pn=n)}function ar(e,t,n,r){t!=Cn&&(P.fillStyle=Cn=t),e!=Qn&&(P.font=Qn=e),n!=Un&&(P.textAlign=Un=n),r!=Xn&&(P.textBaseline=Xn=r)}function sr(e,t,n,r){if(e.auto(o,nr)&&(null==t||null==t.min)){var i=p(Jn,0),a=p(Zn,r.length-1),s=null==n.min?3==e.distr?function(e,t,n){for(var r=E,i=-E,o=t;o<=n;o++)e[o]>0&&(r=j(r,e[o]),i=x(i,e[o]));return[r==E?1:r,i==-E?10:i]}(r,i,a):function(e,t,n,r){var i=E,o=-E;if(1==r)i=e[t],o=e[n];else if(-1==r)i=e[n],o=e[t];else for(var a=t;a<=n;a++)null!=e[a]&&(i=j(i,e[a]),o=x(o,e[a]));return[i,o]}(r,i,a):[n.min,n.max];e.min=j(e.min,n.min=s[0]),e.max=x(e.max,n.max=s[1])}}function cr(e,t){var n=t?fe[e].points:fe[e];n._stroke=n.stroke(o,e),n._fill=n.fill(o,e)}function lr(e,n){var r=n?fe[e].points:fe[e],i=r._stroke,a=r._fill,s=r._paths,c=s.stroke,l=s.fill,u=s.clip,f=s.flags,d=null,h=W(r.width*ne,3),v=h%2/2;n&&null==a&&(a=h>0?"#fff":i);var m=1==r.pxAlign;if(m&&P.translate(v,v),!n){var g=Qt,b=Jt,y=on,O=sn,w=h*ne/2;0==r.min&&(O+=w),0==r.max&&(b-=w,O+=w),(d=new Path2D).rect(g,b,y,O)}n?ur(i,h,r.dash,r.cap,a,c,l,f,u):function(e,n,r,i,a,s,c,l,u,f,d){var h=!1;De.forEach((function(v,m){if(v.series[0]==e){var g,b=fe[v.series[1]],y=t[v.series[1]],O=(b._paths||Q).band,w=null;b.show&&O&&function(e,t,n){for(t=p(t,0),n=p(n,e.length-1);t<=n;){if(null!=e[t])return!0;t++}return!1}(y,Jn,Zn)?(w=v.fill(o,m)||s,g=b._paths.clip):O=null,ur(n,r,i,a,w,c,l,u,f,d,g,O),h=!0}})),h||ur(n,r,i,a,s,c,l,u,f,d)}(e,i,h,r.dash,r.cap,a,c,l,f,d,u),m&&P.translate(-v,-v)}o.setData=rr;function ur(e,t,n,r,i,o,a,s,c,l,u,f){or(e,t,n,r,i),(c||l||f)&&(P.save(),c&&P.clip(c),l&&P.clip(l)),f?3==(3&s)?(P.clip(f),u&&P.clip(u),dr(i,a),fr(e,o,t)):2&s?(dr(i,a),P.clip(f),fr(e,o,t)):1&s&&(P.save(),P.clip(f),u&&P.clip(u),dr(i,a),P.restore(),fr(e,o,t)):(dr(i,a),fr(e,o,t)),(c||l||f)&&P.restore()}function fr(e,t,n){n>0&&(t instanceof Map?t.forEach((function(e,t){P.strokeStyle=Sn=t,P.stroke(e)})):null!=t&&e&&P.stroke(t))}function dr(e,t){t instanceof Map?t.forEach((function(e,t){P.fillStyle=Cn=t,P.fill(e)})):null!=t&&e&&P.fill(t)}function hr(e,t,n,r,i,o,a,s,c,l){var u=a%2/2;1==V&&P.translate(u,u),or(s,a,c,l,s),P.beginPath();var f,d,h,p,v=i+(0==r||3==r?-o:o);0==n?(d=i,p=v):(f=i,h=v);for(var m=0;m0&&(t._paths=null,e&&(1==a?(t.min=null,t.max=null):t.facets.forEach((function(e){e.min=null,e.max=null}))))}))}var gr,br,yr,Or,wr,kr,jr,xr,Sr,Cr,Mr,Pr,Tr=!1;function Er(){Tr||(ie(Ar),Tr=!0)}function Ar(){cn&&(!function(){var e=Z(Ee,J);for(var n in e){var s=e[n],c=Qe[n];if(null!=c&&null!=c.min)ee(s,c),n==Ne&&mr(!0);else if(n!=Ne||2==a)if(0==xn&&null==s.from){var l=s.range(o,null,null,n);s.min=l[0],s.max=l[1]}else s.min=E,s.max=-E}if(xn>0)for(var u in fe.forEach((function(n,s){if(1==a){var c=n.scale,l=e[c],u=Qe[c];if(0==s){var f=l.range(o,l.min,l.max,c);l.min=f[0],l.max=f[1],Jn=i(l.min,t[0]),Zn=i(l.max,t[0]),t[0][Jn]l.max&&Zn--,n.min=tr[Jn],n.max=tr[Zn]}else n.show&&n.auto&&sr(l,u,n,t[s]);n.idxs[0]=Jn,n.idxs[1]=Zn}else if(s>0&&n.show&&n.auto){var d=Object(r.a)(n.facets,2),h=d[0],p=d[1],v=h.scale,m=p.scale,g=Object(r.a)(t[s],2),b=g[0],y=g[1];sr(e[v],Qe[v],h,b),sr(e[m],Qe[m],p,y),n.min=p.min,n.max=p.max}})),e){var f=e[u],d=Qe[u];if(null==f.from&&(null==d||null==d.min)){var h=f.range(o,f.min==E?null:f.min,f.max==-E?null:f.max,u);f.min=h[0],f.max=h[1]}}for(var p in e){var v=e[p];if(null!=v.from){var m=e[v.from];if(null==m.min)v.min=v.max=null;else{var g=v.range(o,m.min,m.max,p);v.min=g[0],v.max=g[1]}}}var b={},y=!1;for(var O in e){var w=e[O],k=Ee[O];if(k.min!=w.min||k.max!=w.max){k.min=w.min,k.max=w.max;var j=k.distr;k._min=3==j?M(k.min):4==j?T(k.min,k.asinh):k.min,k._max=3==j?M(k.max):4==j?T(k.max,k.asinh):k.max,b[O]=y=!0}}if(y){for(var x in fe.forEach((function(e,t){2==a?t>0&&b.y&&(e._paths=null):b[e.scale]&&(e._paths=null)})),b)un=!0,di("setScale",x);mn.show&&(dn=hn=mn.left>=0)}for(var S in Qe)Qe[S]=null}(),cn=!1),un&&(!function(){for(var e=!1,t=0;!e;){var n=pr(++t),r=vr(t);(e=3==t||n&&r)||(vn(o.width,o.height),ln=!0)}}(),un=!1),ln&&(Me(_,le,Ht),Me(_,se,qt),Me(_,oe,Lt),Me(_,ae,Vt),Me($,le,Ht),Me($,se,qt),Me($,oe,Lt),Me($,ae,Vt),Me(A,oe,Nt),Me(A,ae,_t),C.width=w(Nt*ne),C.height=w(_t*ne),ye.forEach((function(e){var t=e._show,n=e._el,r=e._size,i=e._pos,o=e.side;if(t){var a=o%2==1;Me(n,a?"left":"top",i-(3===o||0===o?r:0)),Me(n,a?"width":"height",r),Me(n,a?"top":"left",a?qt:Ht),Me(n,a?"height":"width",a?Vt:Lt),n&&Ce(n,we)}else n&&Se(n,we)})),Sn=Cn=Mn=En=qn=Qn=Un=Xn=Pn=null,Yn=1,ni(!1),di("setSize"),ln=!1),Nt>0&&_t>0&&(P.clearRect(0,0,C.width,C.height),di("drawClear"),Ie.forEach((function(e){return e()})),di("draw")),mn.show&&dn&&(ei(null,!0,!1),dn=!1),m||(m=!0,o.status=1,di("ready")),nr=!1,Tr=!1}function Dr(e,n){var r=Ee[e];if(null==r.from){if(0==xn){var a=r.range(o,n.min,n.max,e);n.min=a[0],n.max=a[1]}if(n.min>n.max){var s=n.min;n.min=n.max,n.max=s}if(xn>1&&null!=n.min&&null!=n.max&&n.max-n.min<1e-16)return;e==Ne&&2==r.distr&&xn>0&&(n.min=i(n.min,t[0]),n.max=i(n.max,t[0])),Qe[e]=n,cn=!0,Er()}}o.redraw=function(e,t){un=t||!1,!1!==e?Vr(Ne,He.min,He.max):Er()},o.setScale=Dr;var Rr=!1,Nr=mn.drag,_r=Nr.x,Lr=Nr.y;mn.show&&(mn.x&&(gr=Te("u-cursor-x",$)),mn.y&&(br=Te("u-cursor-y",$)),0==He.ori?(yr=gr,Or=br):(yr=br,Or=gr),Mr=mn.left,Pr=mn.top);var Ir,zr,Br,Fr=o.select=ee({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),$r=Fr.show?Te("u-select",Fr.over?$:_):null;function Wr(e,t){if(Fr.show){for(var n in e)Me($r,n,Fr[n]=e[n]);!1!==t&&di("setSelect")}}function Vr(e,t,n){Dr(e,{min:t,max:n})}function Hr(e,t,n,r){var i=fe[e];null!=t.focus&&function(e){if(e!=Br){var t=null==e,n=1!=bn.alpha;fe.forEach((function(r,i){var o=t||0==i||i==e;r._focus=t?null:o,n&&function(e,t){fe[e].alpha=t,mn.show&&On[e]&&(On[e].style.opacity=t);at&<[e]&&(lt[e].style.opacity=t)}(i,o?1:bn.alpha)})),Br=e,n&&Er()}}(e),null!=t.show&&(i.show=t.show,function(e,t){var n=fe[e],r=at?lt[e]:null;n.show?r&&Ce(r,we):(r&&Se(r,we),On.length>1&&Ae(On[e],-10,-10,Lt,Vt))}(e,t.show),Vr(2==a?i.facets[1].scale:i.scale,null,null),Er()),!1!==n&&di("setSeries",e,t),r&&mi("setSeries",o,e,t)}o.setSelect=Wr,o.setSeries=Hr,o.addBand=function(e,t){e.fill=N(e.fill||null),t=null==t?De.length:t,De.splice(t,0,e)},o.setBand=function(e,t){ee(De[e],t)},o.delBand=function(e){null==e?De.length=0:De.splice(e,1)};var qr={focus:!0},Qr={focus:!1};function Ur(e,t,n){var r=Ee[t];n&&(e=e/ne-(1==r.ori?qt:Ht));var i=Lt;1==r.ori&&(e=(i=Vt)-e),-1==r.dir&&(e=i-e);var o=r._min,a=o+(r._max-o)*(e/i),s=r.distr;return 3==s?S(10,a):4==s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return g.sinh(e)*t}(a,r.asinh):a}function Xr(e,t){Me($r,le,Fr.left=e),Me($r,oe,Fr.width=t)}function Yr(e,t){Me($r,se,Fr.top=e),Me($r,ae,Fr.height=t)}at&&yn&&ze(ge,Ge,(function(e){mn._lock||(Hr(null,Qr,!0,hi.setSeries),ei(null,!0,!1))})),o.valToIdx=function(e){return i(e,t[0])},o.posToIdx=function(e,n){return i(Ur(e,Ne,n),t[0],Jn,Zn)},o.posToVal=Ur,o.valToPos=function(e,t,n){return 0==Ee[t].ori?f(e,Ee[t],n?on:Lt,n?Qt:0):d(e,Ee[t],n?sn:Vt,n?Jt:0)},o.batch=function(e){e(o),Er()},o.setCursor=function(e,t,n){Mr=e.left,Pr=e.top,ei(null,t,n)};var Gr=0==He.ori?Xr:Yr,Kr=1==He.ori?Xr:Yr;function Jr(e,t){if(null!=e){var n=e.idx;ot.idx=n,fe.forEach((function(e,t){(t>0||!ft)&&Zr(t,n)}))}at&&ot.live&&function(){if(at&&ot.live)for(var e=2==a?1:0;eZn;Ir=E;var d=0==He.ori?Lt:Vt,h=1==He.ori?Lt:Vt;if(Mr<0||0==xn||f){c=null;for(var p=0;p0&&On.length>1&&Ae(On[p],-10,-10,Lt,Vt);if(yn&&Hr(null,qr,!0,null==e&&hi.setSeries),ot.live){it.fill(null),hn=!0;for(var v=0;v0&&k.show){var T=null==M?-10:F(Ve(M,1==a?Ee[k.scale]:Ee[k.facets[1].scale],h,0),.5);if(T>0&&1==a){var A=y(T-Pr);A<=Ir&&(Ir=A,zr=O)}var D=void 0,R=void 0;if(0==He.ori?(D=P,R=T):(D=T,R=P),hn&&On.length>1){Re(On[O],mn.points.fill(o,O),mn.points.stroke(o,O));var N=void 0,_=void 0,L=void 0,I=void 0,z=!0,B=mn.points.bbox;if(null!=B){z=!1;var $=B(o,O);L=$.left,I=$.top,N=$.width,_=$.height}else L=D,I=R,N=_=mn.points.size(o,O);_e(On[O],N,_,z),Ae(On[O],L,I,Lt,Vt)}}if(ot.live){if(!hn||0==O&&ft)continue;Zr(O,C)}}}if(mn.idx=c,mn.left=Mr,mn.top=Pr,hn&&(ot.idx=c,Jr()),Fr.show&&Rr)if(null!=e){var W=Object(r.a)(hi.scales,2),V=W[0],H=W[1],q=Object(r.a)(hi.match,2),Q=q[0],U=q[1],X=Object(r.a)(e.cursor.sync.scales,2),Y=X[0],G=X[1],K=e.cursor.drag;_r=K._x,Lr=K._y;var J,Z,ee,te,ne,re=e.select,ie=re.left,oe=re.top,ae=re.width,se=re.height,ce=e.scales[V].ori,le=e.posToVal,ue=null!=V&&Q(V,Y),de=null!=H&&U(H,G);ue&&(0==ce?(J=ie,Z=ae):(J=oe,Z=se),_r?(ee=Ee[V],te=We(le(J,Y),ee,d,0),ne=We(le(J+Z,Y),ee,d,0),Gr(j(te,ne),y(ne-te))):Gr(0,d),de||Kr(0,h)),de&&(1==ce?(J=ie,Z=ae):(J=oe,Z=se),Lr?(ee=Ee[H],te=Ve(le(J,G),ee,h,0),ne=Ve(le(J+Z,G),ee,h,0),Kr(j(te,ne),y(ne-te))):Kr(0,h),ue||Gr(0,d))}else{var pe=y(Sr-wr),ve=y(Cr-kr);if(1==He.ori){var me=pe;pe=ve,ve=me}_r=Nr.x&&pe>=Nr.dist,Lr=Nr.y&&ve>=Nr.dist;var ge,be,ye=Nr.uni;null!=ye?_r&&Lr&&(Lr=ve>=ye,(_r=pe>=ye)||Lr||(ve>pe?Lr=!0:_r=!0)):Nr.x&&Nr.y&&(_r||Lr)&&(_r=Lr=!0),_r&&(0==He.ori?(ge=jr,be=Mr):(ge=xr,be=Pr),Gr(j(ge,be),y(be-ge)),Lr||Kr(0,h)),Lr&&(1==He.ori?(ge=jr,be=Mr):(ge=xr,be=Pr),Kr(j(ge,be),y(be-ge)),_r||Gr(0,d)),_r||Lr||(Gr(0,0),Kr(0,0))}if(Nr._x=_r,Nr._y=Lr,null==e){if(s){if(null!=pi){var Oe=Object(r.a)(hi.scales,2),we=Oe[0],ke=Oe[1];hi.values[0]=null!=we?Ur(0==He.ori?Mr:Pr,we):null,hi.values[1]=null!=ke?Ur(1==He.ori?Mr:Pr,ke):null}mi(he,o,Mr,Pr,Lt,Vt,c)}if(yn){var je=s&&hi.setSeries,xe=bn.prox;null==Br?Ir<=xe&&Hr(zr,qr,!0,je):Ir>xe?Hr(null,qr,!0,je):zr!=Br&&Hr(zr,qr,!0,je)}}m&&!1!==n&&di("setCursor")}o.setLegend=Jr;var ti=null;function ni(e){!0===e?ti=null:di("syncRect",ti=$.getBoundingClientRect())}function ri(e,t,n,r,i,o,a){mn._lock||(ii(e,t,n,r,i,o,a,!1,null!=e),null!=e?ei(null,!0,!0):ei(t,!0,!1))}function ii(e,t,n,i,a,s,c,l,u){if(null==ti&&ni(!1),null!=e)n=e.clientX-ti.left,i=e.clientY-ti.top;else{if(n<0||i<0)return Mr=-10,void(Pr=-10);var f=Object(r.a)(hi.scales,2),d=f[0],h=f[1],p=t.cursor.sync,m=Object(r.a)(p.values,2),g=m[0],b=m[1],y=Object(r.a)(p.scales,2),O=y[0],w=y[1],k=Object(r.a)(hi.match,2),j=k[0],x=k[1],S=1==t.scales[O].ori,C=0==He.ori?Lt:Vt,M=1==He.ori?Lt:Vt,P=S?s:a,T=S?a:s,E=S?i:n,A=S?n:i;if(n=null!=O?j(d,O)?v(g,Ee[d],C,0):-10:C*(E/P),i=null!=w?x(h,w)?v(b,Ee[h],M,0):-10:M*(A/T),1==He.ori){var R=n;n=i,i=R}}if(u&&((n<=1||n>=Lt-1)&&(n=D(n,Lt)),(i<=1||i>=Vt-1)&&(i=D(i,Vt))),l){wr=n,kr=i;var N=mn.move(o,n,i),_=Object(r.a)(N,2);jr=_[0],xr=_[1]}else Mr=n,Pr=i}function oi(){Wr({width:0,height:0},!1)}function ai(e,t,n,r,i,a,s){Rr=!0,_r=Lr=Nr._x=Nr._y=!1,ii(e,t,n,r,i,a,0,!0,!1),null!=e&&(At(ve,je,si),mi(pe,o,jr,xr,Lt,Vt,null))}function si(e,t,n,r,i,a,s){Rr=Nr._x=Nr._y=!1,ii(e,t,n,r,i,a,0,!1,!0);var c=Fr.left,l=Fr.top,u=Fr.width,f=Fr.height,d=u>0||f>0;if(d&&Wr(Fr),Nr.setScale&&d){var h=c,p=u,v=l,m=f;if(1==He.ori&&(h=l,p=f,v=c,m=u),_r&&Vr(Ne,Ur(h,Ne),Ur(h+p,Ne)),Lr)for(var g in Ee){var b=Ee[g];g!=Ne&&null==b.from&&b.min!=E&&Vr(g,Ur(v+m,g),Ur(v,g))}oi()}else mn.lock&&(mn._lock=!mn._lock,mn._lock||ei(null,!0,!1));null!=e&&(Rt(ve,je),mi(ve,o,Mr,Pr,Lt,Vt,null))}function ci(e,t,n,r,i,a,s){ir(),oi(),null!=e&&mi(be,o,Mr,Pr,Lt,Vt,null)}function li(){ye.forEach(Hn),pn(o.width,o.height,!0)}ze(Oe,xe,li);var ui={};ui.mousedown=ai,ui.mousemove=ri,ui.mouseup=si,ui.dblclick=ci,ui.setSeries=function(e,t,n,r){Hr(n,r,!0,!1)},mn.show&&(At(pe,$,ai),At(he,$,ri),At(me,$,ni),At(ge,$,(function(e,t,n,r,i,o,a){if(!mn._lock){var s=Rr;if(Rr){var c,l,u=!0,f=!0;0==He.ori?(c=_r,l=Lr):(c=Lr,l=_r),c&&l&&(u=Mr<=10||Mr>=Lt-10,f=Pr<=10||Pr>=Vt-10),c&&u&&(Mr=Mr=3?Ut:L)),e.font=Vn(e.font),e.labelFont=Vn(e.labelFont),e._size=e.size(o,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(kn[t]=!0),e._el=Te("u-axis",A)}})),n?n instanceof HTMLElement?(n.appendChild(O),gi()):n(o,gi):gi(),o}qn.assign=ee,qn.fmtNum=m,qn.rangeNum=h,qn.rangeLog=c,qn.rangeAsinh=l,qn.orient=sn,qn.join=function(e,t){for(var n=new Set,r=0;r=i&&P<=a;P+=k){var T=l[P],E=b(d(c[P],u,m,p));if(null!=T){var A=b(h(T,f,g,v));if(x){if(un(j,M,E),S!=A){var D=s.width*ne/2,R=j[j.length-1];R[0]+=n||1==t?D:-D,R[1]-=n||-1==t?D:-D}x=!1}1==t?y(w,E,S):y(w,M,A),y(w,E,A),S=A,M=E}else null===T&&(un(j,M,E),x=!0)}if(null!=s.fill){var N=O.fill=new Path2D(w),_=b(h(s.fillTo(e,r,s.min,s.max),f,g,v));y(N,M,_),y(N,C,_)}return O.gaps=j=s.gaps(e,r,i,a,j),s.spanGaps||(O.clip=ln(j,u.ori,p,v,m,g)),e.bands.length>0&&(O.band=cn(e,r,i,a,w)),O}))}},Qn.bars=function(e){var t=p((e=e||Q).size,[.6,E,1]),n=e.align||0,r=(e.gap||0)*ne,i=p(e.radius,0)*ne,o=1-t[0],a=p(t[1],E)*ne,s=p(t[2],1)*ne,c=e.disp,l=p(e.each,(function(e){}));return function(e,t,u,f){return sn(e,t,(function(d,h,p,v,m,g,b,O,w,k,S){var C,M,P=d.pxRound,T=v.dir*(0==v.ori?1:-1),E=m.dir*(1==m.ori?1:-1),A=0==v.ori?gn:bn,D=0==v.ori?l:function(e,t,n,r,i,o,a){l(e,t,n,i,r,a,o)},R=b(d.fillTo(e,t,d.min,d.max),m,S,w),N=P(d.width*ne),_=!1,L=null,I=null,z=null,B=null;if(null!=c){null!=c.fill&&null!=c.stroke&&(_=!0,L=c.fill.values(e,t,u,f),I=new Map,new Set(L).forEach((function(e){null!=e&&I.set(e,new Path2D)})),z=c.stroke.values(e,t,u,f),B=new Map,new Set(z).forEach((function(e){null!=e&&B.set(e,new Path2D)}))),h=c.x0.values(e,t,u,f),2==c.x0.unit&&(h=h.map((function(t){return e.posToVal(O+t*k,v.key,!0)})));var F=c.size.values(e,t,u,f);M=P((M=2==c.size.unit?F[0]*k:g(F[0],v,k,O)-g(0,v,k,O))-N),C=1==T?-N/2:M+N/2}else{var $=k;if(h.length>1)for(var W=null,V=0,H=1/0;V0;X&&(U.band=new Path2D,Q=P(b(m.max,m,S,w)));for(var Y=_?null:new Path2D,G=U.band,K=1==T?u:f;K>=u&&K<=f;K+=T){var J=p[K],Z=g(2!=v.distr||null!=c?h[K]:K,v,k,O),ee=b(J,m,S,w),te=P(Z-C),re=P(x(ee,R)),ie=P(j(ee,R)),oe=re-ie;null!=p[K]&&(_?(N>0&&null!=z[K]&&A(B.get(z[K]),te,ie,M,oe,i*M),null!=L[K]&&A(I.get(L[K]),te,ie,M,oe,i*M)):A(Y,te,ie,M,oe,i*M),D(e,t,K,te-N/2,ie-N/2,M+N,oe+N)),X&&(1==E?(re=ie,ie=Q):(ie=re,re=Q),A(G,te-N/2,ie+N/2,M+N,(oe=re-ie)-N,0))}return N>0&&(U.stroke=_?B:Y),U.fill=_?I:Y,U}))}},Qn.spline=function(e){return t=Pn,function(e,n,r,i){return sn(e,n,(function(a,s,c,l,u,f,d,h,p,v,m){var g,b,y,O=a.pxRound;0==l.ori?(g=hn,y=vn,b=wn):(g=pn,y=mn,b=kn);var w=1*l.dir*(0==l.ori?1:-1);r=o(c,r,i,1),i=o(c,r,i,-1);for(var k=[],j=!1,x=O(f(s[1==w?r:i],l,v,h)),S=x,C=[],M=[],P=1==w?r:i;P>=r&&P<=i;P+=w){var T=c[P],E=f(s[P],l,v,h);null!=T?(j&&(un(k,S,E),j=!1),C.push(S=E),M.push(d(c[P],u,m,p))):null===T&&(un(k,S,E),j=!0)}var A={stroke:t(C,M,g,y,b,O),fill:null,clip:null,band:null,gaps:null,flags:1},D=A.stroke;if(null!=a.fill&&null!=D){var R=A.fill=new Path2D(D),N=O(d(a.fillTo(e,n,a.min,a.max),u,m,p));y(R,S,N),y(R,x,N)}return A.gaps=k=a.gaps(e,n,r,i,k),a.spanGaps||(A.clip=ln(k,l.ori,h,p,v,m)),e.bands.length>0&&(A.band=cn(e,n,r,i,D)),A}))};var t}},function(e,t,n){(function(t){var n="Expected a function",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),f=Object.prototype.toString,d=Math.max,h=Math.min,p=function(){return u.Date.now()};function v(e,t,r){var i,o,a,s,c,l,u=0,f=!1,v=!1,b=!0;if("function"!=typeof e)throw new TypeError(n);function y(t){var n=i,r=o;return i=o=void 0,u=t,s=e.apply(r,n)}function O(e){return u=e,c=setTimeout(k,t),f?y(e):s}function w(e){var n=e-l;return void 0===l||n>=t||n<0||v&&e-u>=a}function k(){var e=p();if(w(e))return j(e);c=setTimeout(k,function(e){var n=t-(e-l);return v?h(n,a-(e-u)):n}(e))}function j(e){return c=void 0,b&&i?y(e):(i=o=void 0,s)}function x(){var e=p(),n=w(e);if(i=arguments,o=this,l=e,n){if(void 0===c)return O(l);if(v)return c=setTimeout(k,t),y(l)}return void 0===c&&(c=setTimeout(k,t)),s}return t=g(t)||0,m(r)&&(f=!!r.leading,a=(v="maxWait"in r)?d(g(r.maxWait)||0,t):a,b="trailing"in r?!!r.trailing:b),x.cancel=function(){void 0!==c&&clearTimeout(c),u=0,i=l=o=c=void 0},x.flush=function(){return void 0===c?s:j(p())},x}function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=o.test(e);return n||a.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(n);return m(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),v(e,t,{leading:i,maxWait:t,trailing:o})}}).call(this,n(127))},function(e,t,n){"use strict";var r=n(225),i=r.default,o=r.DraggableCore;e.exports=i,e.exports.default=i,e.exports.DraggableCore=o},function(e,t,n){"use strict";var r=n(44);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(45)),o=n(0),a=(0,i.default)((0,o.jsx)("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=a},function(e,t,n){"use strict";var r=n(44);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(45)),o=n(0),a=(0,i.default)((0,o.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.default=a},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E}));var r,i=n(21),o=n(23),a=n(22),s=n(4),c=n(5),l=n(8),u=n(25),f=function(){function e(t,n,r,i,o,a,s,l,u){var f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10?arguments[10]:void 0;Object(c.a)(this,e),this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=l,this.curContext=u,this.lookAhead=f,this.parent=d}return Object(l.a)(e,[{key:"toString",value:function(){return"[".concat(this.stack.filter((function(e,t){return t%3==0})).concat(this.state),"]@").concat(this.pos).concat(this.score?"!"+this.score:"")}},{key:"context",get:function(){return this.curContext?this.curContext.context:null}},{key:"pushState",value:function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}},{key:"reduce",value:function(e){var t=e>>19,n=65535&e,r=this.p.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return no;)this.stack.pop();this.reduceContext(n,a)}},{key:"storeNode",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(0==e){var o=this,a=this.buffer.length;if(0==a&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&0==o.buffer[a-4]&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t)return void(o.buffer[a-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)}},{key:"shift",value:function(e,t,n){var r=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var i=e,o=this.p.parser;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}},{key:"apply",value:function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}},{key:"useNode",value:function(e,t){var n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.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),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}},{key:"split",value: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.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}},{key:"recoverByDelete",value:function(e,t){var n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}},{key:"canShift",value:function(e){for(var t=new h(this);;){var n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}}},{key:"recoverByInsert",value:function(e){if(this.stack.length>=300)return[];var t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){for(var n,r=[],i=0;i>19,r=65535&e,i=this.stack.length-3*n;if(i<0||t.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reduce(e),!0}},{key:"forceAll",value:function(){for(;!this.p.parser.stateFlag(this.state,2)&&this.forceReduce(););return this}},{key:"deadEnd",get:function(){if(3!=this.stack.length)return!1;var e=this.p.parser;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}},{key:"restart",value:function(){this.state=this.stack[0],this.stack.length=0}},{key:"sameState",value:function(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(var t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}},{key:"close",value:function(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}],[{key:"start",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new d(i,i.start):null,0,null)}}]),e}(),d=function e(t,n){Object(c.a)(this,e),this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0};!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(r||(r={}));var h=function(){function e(t){Object(c.a)(this,e),this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}return Object(l.a)(e,[{key:"reduce",value:function(e){var t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);var r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}]),e}(),p=function(){function e(t,n,r){Object(c.a)(this,e),this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,0==this.index&&this.maybeNext()}return Object(l.a)(e,[{key:"maybeNext",value:function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}},{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:"next",value:function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}},{key:"fork",value:function(){return new e(this.stack,this.pos,this.index)}}],[{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.bufferBase+t.buffer.length;return new e(t,n,n-t.bufferBase)}}]),e}(),v=function e(){Object(c.a)(this,e),this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0},m=new v,g=function(){function e(t,n){Object(c.a)(this,e),this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=m,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}return Object(l.a)(e,[{key:"resolveOffset",value:function(e,t){for(var n=this.range,r=this.rangeIndex,i=this.pos+e;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;var a=this.ranges[++r];i+=a.from-n.to,n=a}return i}},{key:"peek",value:function(e){var t,n,r=this.chunkOff+e;if(r>=0&&r=this.chunk2Pos&&ta.to&&(this.chunk2=this.chunk2.slice(0,a.to-t)),n=this.chunk2.charCodeAt(0)}}return t>this.token.lookAhead&&(this.token.lookAhead=t),n}},{key:"acceptToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}},{key:"readNext",value:function(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}},{key:"advance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>this.token.lookAhead&&(this.token.lookAhead=this.pos),this.readNext()}},{key:"setDone",value:function(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}},{key:"reset",value:function(e,t){if(t?(this.token=t,t.start=t.lookAhead=e,t.value=t.extended=-1):this.token=m,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);var n,r="",i=Object(s.a)(this.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.from>=t)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}}catch(a){i.e(a)}finally{i.f()}return r}}]),e}(),b=function(){function e(t,n){Object(c.a)(this,e),this.data=t,this.id=n}return Object(l.a)(e,[{key:"token",value:function(e,t){!function(e,t,n,r){var i=0,o=1<0){var u=e[l];if(s.allows(u)&&(-1==t.token.value||t.token.value==u||a.overrides(u,t.token.value))){t.acceptToken(u);break}}for(var f=t.next,d=0,h=e[i+2];d>1,v=c+p+(p<<1),m=e[v],g=e[v+1];if(f=g)){i=e[v+2],t.advance();continue e}d=p+1}}break}}(this.data,e,t,this.id)}}]),e}();b.prototype.contextual=b.prototype.fallback=b.prototype.extend=!1;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uint16Array;if("string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&a--,a>=34&&a--;var c=a-32;if(c>=46&&(c-=46,s=!0),o+=c,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}var O,w="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),k=null;function j(e,t,n){var r=e.fullCursor();for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.tot)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(O||(O={}));var x,S=function(){function e(t,n){Object(c.a)(this,e),this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}return Object(l.a)(e,[{key:"nextFragment",value:function(){var e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?j(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?j(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}},{key:"nodeAt",value:function(e){if(ee)return this.nextStart=o,null;if(i instanceof u.f){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}else this.trees.pop(),this.start.pop(),this.index.pop()}}}]),e}(),C=function(){function e(t,n){Object(c.a)(this,e),this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((function(e){return new v}))}return Object(l.a)(e,[{key:"getActions",value:function(e){for(var t=0,n=null,r=e.p.parser,i=r.tokenizers,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0,c=0;cu.end+25&&(s=Math.max(u.lookAhead,s)),0!=u.value)){var f=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new v).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}},{key:"getMainToken",value:function(e){if(this.mainToken)return this.mainToken;var t=new v,n=e.pos,r=e.p;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}},{key:"updateCachedToken",value:function(e,t,n){if(t.token(this.stream.reset(n.pos,e),n),e.value>-1){for(var r=n.p.parser,i=0;i=0&&n.p.parser.dialect.allows(o>>1)){0==(1&o)?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=Math.min(n.p.stream.end,n.pos+1)}},{key:"putAction",value:function(e,t,n,r){for(var i=0;i4*t.bufferLength?new S(r,t.nodeSet):null}return Object(l.a)(e,[{key:"parsedPos",get:function(){return this.minStackPos}},{key:"advance",value:function(){for(var e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[],o=0;or)i.push(a);else{if(this.advanceStack(a,i,n))continue;e||(e=[],t=[]),e.push(a);var c=this.tokens.getMainToken(a);t.push(c.value,c.end)}break}if(!i.length){var l=e&&function(e){var t,n=null,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=o&&i.pos>o)&&i.p.parser.stateFlag(i.state,2)&&(!n||n.scoref)for(i.sort((function(e,t){return t.score-e.score}));i.length>f;)i.pop();i.some((function(e){return e.reducePos>r}))&&this.recovering--}else if(i.length>1)e:for(var d=0;d200&&v.buffer.length>200){if(!((h.score-v.score||h.buffer.length-v.buffer.length)>0)){i.splice(d--,1);continue e}i.splice(p--,1)}}this.minStackPos=i[0].pos;for(var m=1;m ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments)for(var a=e.curContext&&e.curContext.tracker.strict,s=a?e.curContext.hash:0,c=this.fragments.nodeAt(r);c;){var l=this.parser.nodeSet.types[c.type.id]==c.type?i.getGoto(e.state,c.type.id):-1;if(l>-1&&c.length&&(!a||(c.prop(u.b.contextHash)||0)==s))return e.useNode(c,l),w&&console.log(o+this.stackID(e)+" (via reuse of ".concat(i.getName(c.type.id),")")),!0;if(!(c instanceof u.f)||0==c.children.length||c.positions[0]>0)break;var f=c.children[0];if(!(f instanceof u.f&&0==c.positions[0]))break;c=f}var d=i.stateSlot(e.state,4);if(d>0)return e.reduce(d),w&&console.log(o+this.stackID(e)+" (via always-reduce ".concat(i.getName(65535&d),")")),!0;for(var h=this.tokens.getActions(e),p=0;pr?t.push(y):n.push(y)}return!1}},{key:"advanceFully",value:function(e,t){for(var n=e.pos;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return P(e,t),!0}}},{key:"runRecovery",value:function(e,t,n){for(var r=null,i=!1,o=0;o ":"";if(a.deadEnd){if(i)continue;if(i=!0,a.restart(),w&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))continue}for(var f=a.split(),d=u,h=0;f.forceReduce()&&h<10;h++){if(w&&console.log(d+this.stackID(f)+" (via force-reduce)"),this.advanceFully(f,n))break;w&&(d=this.stackID(f)+" -> ")}var p,v=Object(s.a)(a.recoverByInsert(c));try{for(v.s();!(p=v.n()).done;){var m=p.value;w&&console.log(u+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,n)}}catch(g){v.e(g)}finally{v.f()}this.stream.end>a.pos?(l==a.pos&&(l++,c=0),a.recoverByDelete(c,l),w&&console.log(u+this.stackID(a)+" (via recover-delete ".concat(this.parser.getName(c),")")),P(a,n)):(!r||r.score=0)d(O,m,v[g++]);else{for(var w=v[g+-O],k=-O;k>0;k--)d(v[g++],m,w);g++}}}catch(S){p.e(S)}finally{p.f()}}r.nodeSet=new u.c(i.map((function(t,n){return u.d.define({name:n>=r.minRepeatTerm?void 0:t,id:n,props:l[n],top:a.indexOf(n)>-1,error:0==n,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1})}))),r.strict=!1,r.bufferLength=u.a;var j=y(e.tokenData);if(r.context=e.context,r.specialized=new Uint16Array(e.specialized?e.specialized.length:0),r.specializers=[],e.specialized)for(var x=0;x2&&void 0!==arguments[2]&&arguments[2],r=this.goto;if(t>=r[0])return-1;for(var i=r[t+1];;){var o=r[i++],a=1&o,s=r[i++];if(a&&n)return s;for(var c=i+(o>>1);i0}},{key:"validAction",value: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=A(this.data,n+2)}if(t==A(this.data,n+1))return!0}}},{key:"nextStates",value:function(e){for(var t=this,n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=A(this.data,r+2)}0==(1&this.data[r+2])&&function(){var e=t.data[r+1];n.some((function(t,n){return 1&n&&t==e}))||n.push(t.data[r],e)}()}return n}},{key:"overrides",value:function(e,t){var n=D(this.data,this.tokenPrecTable,t);return n<0||D(this.data,this.tokenPrecTable,e)=0&&(n[a]=!0)}}catch(d){i.e(d)}finally{i.f()}}for(var c=null,l=0;l68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},c=[/[+-]\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)}],l=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.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=o.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=l("months"),n=(l("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=l("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=a(e)}],YYYY:[/\d{4}/,s("year")],Z:c,ZZ:c};function d(n){var r,i;r=n,i=o&&o.formats;for(var a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date(("X"===t?1e3:1)*e);var r=d(t)(e),i=r.year,o=r.month,a=r.day,s=r.hours,c=r.minutes,l=r.seconds,u=r.milliseconds,f=r.zone,h=new Date,p=a||(i||o?1:h.getDate()),v=i||h.getFullYear(),m=0;i&&!o||(m=o>0?o-1:h.getMonth());var g=s||0,b=c||0,y=l||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("")),o={}}else if(s instanceof Array)for(var h=s.length,p=1;p<=h;p+=1){a[1]=s[p-1];var v=n.apply(this,a);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";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,n,r){var i=n.prototype,o=i.format;r.en.formats=e,i.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var o=i&&i.toUpperCase();return r||n[i]||e[i]||n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,void 0===n?{}:n);return o.call(this,r)}}}()},function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isBetween=function(e,t,r,i){var o=n(e),a=n(t),s="("===(i=i||"()")[0],c=")"===i[1];return(s?this.isAfter(o,r):!this.isBefore(o,r))&&(c?this.isBefore(a,r):!this.isAfter(a,r))||(s?this.isBefore(o,r):!this.isAfter(o,r))&&(c?this.isAfter(a,r):!this.isBefore(a,r))}}}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return le}));var r,i,o=n(5),a=n(8),s=n(158),c=29,l=39,u=123,f=126,d=128,h=129,p=132,v=135,m=136,g=138,b={inf:146,nan:147,bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},y={avg:8,atan2:7,bottomk:9,count:10,count_values:11,group:12,max:13,min:14,quantile:15,stddev:16,stdvar:17,sum:18,topk:19,by:20,without:21,and:22,or:23,unless:24,start:25,end:26},O={__proto__:null,absent_over_time:307,absent:309,abs:311,acos:313,acosh:315,asin:317,asinh:319,atan:321,atanh:323,avg_over_time:325,ceil:327,changes:329,clamp:331,clamp_max:333,clamp_min:335,cos:337,cosh:339,count_over_time:341,days_in_month:343,day_of_month:345,day_of_week:347,deg:349,delta:351,deriv:353,exp:355,floor:357,histogram_quantile:359,holt_winters:361,hour:363,idelta:365,increase:367,irate:369,label_replace:371,label_join:373,last_over_time:375,ln:377,log10:379,log2:381,max_over_time:383,min_over_time:385,minute:387,month:389,pi:391,predict_linear:393,present_over_time:395,quantile_over_time:397,rad:399,rate:401,resets:403,round:405,scalar:407,sgn:409,sin:411,sinh:413,sort:415,sort_desc:417,sqrt:419,stddev_over_time:421,stdvar_over_time:423,sum_over_time:425,tan:427,tanh:429,timestamp:431,time:433,vector:435,year:437},w=s.a.deserialize({version:13,states:"6[OYQPOOO&{QPOOOOQO'#C{'#C{O'QQPO'#CzQ']QQOOOOQO'#De'#DeO'WQPO'#DdOOQO'#E}'#E}O(jQPO'#FTOYQPO'#FPOYQPO'#FSOOQO'#FV'#FVO.fQSO'#FWO.nQQO'#FUOOQO'#FU'#FUOOQO'#Cy'#CyOOQO'#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'#EgOOQO'#Eh'#EhOOQO'#Ei'#EiOOQO'#Ej'#EjOOQO'#Ek'#EkOOQO'#El'#ElOOQO'#Em'#EmOOQO'#En'#EnOOQO'#Eo'#EoOOQO'#Ep'#EpOOQO'#Eq'#EqOOQO'#Er'#ErOOQO'#Es'#EsOOQO'#Et'#EtOOQO'#Eu'#EuOOQO'#Ev'#EvOOQO'#Ew'#EwOOQO'#Ex'#ExOOQO'#Ey'#EyOOQO'#Ez'#EzQOQPOOO0XQPO'#C|O0^QPO'#DRO'WQPO,59fO0eQQO,59fO2RQPO,59oO2RQPO,59oO2RQPO,59oO2RQPO,59oO2RQPO,59oO7}QQO,5;gO8SQQO,5;jO8[QPO,5;yOOQO,5:O,5:OOOQO,5;i,5;iO8sQQO,5;kO8zQQO,5;nO:bQPO'#FYO:pQPO,5;rOOQO'#FX'#FXOOQO,5;r,5;rOOQO,5;p,5;pO:xQSO'#C}OOQO,59h,59hO;QQPO,59mO;YQQO'#DSOOQO,59m,59mOOQO1G/Q1G/QO0XQPO'#DWOAVQPO'#DVOAaQPO'#DVOYQPO1G/ZOYQPO1G/ZOYQPO1G/ZOYQPO1G/ZOYQPO1G/ZOAkQSO1G1ROOQO1G1U1G1UOAsQQO1G1UOAxQPO'#E}OOQO'#Fa'#FaOOQO1G1e1G1eOBTQPO1G1eOOQO1G1V1G1VOOQO'#FZ'#FZOBYQPO,5;tOB_QSO1G1^OOQO1G1^1G1^OOQO'#DP'#DPOBgQPO,59iOOQO'#DO'#DOOOQO,59i,59iOYQPO,59nOOQO1G/X1G/XOOQO,59r,59rOH_QPO,59qOHfQPO,59qOI}QQO7+$uOJ_QQO7+$uOKsQQO7+$uOLZQQO7+$uOMrQQO7+$uOOQO7+&m7+&mON]QQO7+&sOOQO7+&p7+&pONeQPO7+'POOQO1G1`1G1`OOQO1G1_1G1_OOQO7+&x7+&xONjQSO1G/TOOQO1G/T1G/TONrQQO1G/YOOQO1G/]1G/]ON|QPO1G/]OOQO<1?i-1:0),a=1;a=o.length?t.node:null}function _(e){var t=e.cursor;if(!t.next())return!1;for(var n=!1,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o1?r-1:0),o=1;o=i.length}function I(e,t,n){var r=[];return function e(r,i){var o=null===r||void 0===r?void 0:r.getChild(t),a=null===r||void 0===r?void 0:r.lastChild;o&&o.type.id===t&&e(o,i),a&&a.type.id===n&&i.push(a)}(e,r),r}function z(e){var t;if(!e)return i.none;switch(e.type.id){case c:case f:return z(e.firstChild);case 30:case p:return i.vector;case d:return i.string;case 125:return i.scalar;case u:case h:return i.matrix;case 127:case 130:case 141:return z(N(e,c));case l:var n=z(e.firstChild),r=z(e.lastChild);return n===i.scalar&&r===i.scalar?i.scalar:i.vector;case 54:var o=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;return o?P(o.type.id).returnType:i.none;default:return i.none}}!function(e){e.CardOneToOne="one-to-one",e.CardManyToOne="many-to-one",e.CardOneToMany="one-to-many",e.CardManyToMany="many-to-many"}(T||(T={}));var B=n(24);var F,$=function(){function e(t){Object(o.a)(this,e),this.tree=Object(B.j)(t),this.state=t,this.diagnostics=[]}return Object(a.a)(e,[{key:"getDiagnostics",value:function(){return this.diagnostics.sort((function(e,t){return e.from-t.from}))}},{key:"analyze",value:function(){this.checkAST(this.tree.topNode.firstChild),this.diagnoseAllErrorNodes()}},{key:"diagnoseAllErrorNodes",value:function(){for(var e=this.tree.cursor();e.next();)if(0===e.type.id&&e.to!==this.tree.topNode.to){var t=e.node.parent;this.diagnostics.push({severity:"error",message:"unexpected expression",from:t?t.from:e.from,to:t?t.to:e.to})}}},{key:"checkAST",value:function(e){if(!e)return i.none;switch(e.type.id){case c:return this.checkAST(e.firstChild);case 30:this.checkAggregationExpr(e);break;case l:this.checkBinaryExpr(e);break;case 54:this.checkCallFunction(e);break;case 127:case u:this.checkAST(N(e,c));break;case 130:var t=this.checkAST(N(e,c));t!==i.scalar&&t!==i.vector&&this.addDiagnostic(e,"unary expression only allowed on expressions of type scalar or instant vector, got ".concat(t));break;case h:var n=this.checkAST(N(e,c));n!==i.vector&&this.addDiagnostic(e,"subquery is only allowed on instant vector, got ".concat(n," in ").concat(e.name," instead"));break;case p:this.checkVectorSelector(e);break;case 141:var r=this.checkAST(N(e,c));r!==i.vector&&r!==i.matrix&&this.addDiagnostic(e,"@ modifier must be preceded by an instant selector vector or range vector selector or a subquery")}return z(e)}},{key:"checkAggregationExpr",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=N(e,37,38,c);if(r){this.expectType(r,i.vector,"aggregation expression");var o=N(e,37,38,38,c);if(19===n.type.id||9===n.type.id||15===n.type.id){if(!o)return void this.addDiagnostic(e,"no parameter found");this.expectType(o,i.scalar,"aggregation parameter")}if(11===n.type.id){if(!o)return void this.addDiagnostic(e,"no parameter found");this.expectType(o,i.string,"aggregation parameter")}}else this.addDiagnostic(e,"unable to find the parameter for the expression")}else this.addDiagnostic(e,"aggregation operator expected in aggregation expression but got nothing")}},{key:"checkBinaryExpr",value:function(e){var t=e.firstChild,n=e.lastChild;if(t&&n){var r=this.checkAST(t),o=this.checkAST(n),a=N(e,41,1),s=_(e,48,53,51,52,49,50),c=_(e,22,23,24);a?s||this.addDiagnostic(e,"bool modifier can only be used on comparison operators"):s&&r===i.scalar&&o===i.scalar&&this.addDiagnostic(e,"comparisons between scalars must use BOOL modifier");var u=function(e,t){if(!t||t.type.id!==l)return null;var n={card:T.CardOneToOne,matchingLabels:[],on:!1,include:[]},r=t.getChild(41);if(r){var i=r.getChild(42);if(i){n.on=null!==i.getChild(3);var o=I(i.getChild(33),34,35);if(o.length>0){var a,s=Object(x.a)(o);try{for(s.s();!(a=s.n()).done;){var c=a.value;n.matchingLabels.push(e.sliceDoc(c.from,c.to))}}catch(m){s.e(m)}finally{s.f()}}}var u=r.getChild(4),f=r.getChild(5);if(u||f){n.card=u?T.CardManyToOne:T.CardOneToMany;var d=I(r.getChild(33),34,35);if(d.length>0){var h,p=Object(x.a)(d);try{for(p.s();!(h=p.n()).done;){var v=h.value;n.include.push(e.sliceDoc(v.from,v.to))}}catch(m){p.e(m)}finally{p.f()}}}}return _(t,22,23,24)&&n.card===T.CardOneToOne&&(n.card=T.CardManyToMany),n}(this.state,e);if(null!==u&&u.on){var f,d=Object(x.a)(u.matchingLabels);try{for(d.s();!(f=d.n()).done;){var h,p=f.value,v=Object(x.a)(u.include);try{for(v.s();!(h=v.n()).done;){p===h.value&&this.addDiagnostic(e,'label "'.concat(p,'" must not occur in ON and GROUP clause at once'))}}catch(m){v.e(m)}finally{v.f()}}}catch(m){d.e(m)}finally{d.f()}}r!==i.scalar&&r!==i.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),o!==i.scalar&&o!==i.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),r===i.vector&&o===i.vector||null===u?c&&((null===u||void 0===u?void 0:u.card)!==T.CardOneToMany&&(null===u||void 0===u?void 0:u.card)!==T.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===u||void 0===u?void 0:u.card)!==T.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")):u.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"),r!==i.scalar&&o!==i.scalar||!c||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=I(N(e,37),38,c),i=P(n.type.id),o=i.argTypes.length;if(0===i.variadic)r.length!==o&&this.addDiagnostic(e,"expected ".concat(o,' argument(s) in call to "').concat(i.name,'", got ').concat(r.length));else{var a=o-1;if(a>r.length)this.addDiagnostic(e,"expected at least ".concat(a,' argument(s) in call to "').concat(i.name,'", got ').concat(r.length));else{var s=a+i.variadic;i.variadic>0&&s=i.argTypes.length){if(0===i.variadic)break;l=i.argTypes.length-1}this.expectType(r[u],i.argTypes[l],'call to function "'.concat(i.name,'"'))}}else this.addDiagnostic(e,"function not defined")}},{key:"checkVectorSelector",value:function(e){var t=A(I(N(e,134,v),v,m),this.state),n="",r=N(e,133,57);if(r&&(n=this.state.sliceDoc(r.from,r.to)),""!==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 E(g,"__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.from,to:e.to})}}]),e}(),W=n(58),V=[{label:"^"},{label:"*"},{label:"/"},{label:"%"},{label:"+"},{label:"-"},{label:"=="},{label:">="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"atan2"},{label:"and"},{label:"or"},{label:"unless"}],H=[{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"}],q=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:Object(W.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(W.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(W.c)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')},{label:"topk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Largest k elements by sample value",apply:Object(W.c)("topk(${__rank_number__}, ${__input_vector__})")},{label:"bottomk(__rank_number__, __input_vector__)",type:"function",detail:"snippet",info:"Smallest k elements by sample value",apply:Object(W.c)("bottomk(${__rank_number__}, ${__input_vector__})")},{label:'count_values("__label_name__", __input_vector__)',type:"function",detail:"snippet",info:"Count the number of series per distinct sample value",apply:Object(W.c)('count_values("${__label_name__}", ${__metric__})')}],Q={matchOp:[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],binOp:V,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"}],atModifier:[{label:"start()",info:"resolve to the start of the query",type:"keyword"},{label:"end()",info:"resolve to the end of the query",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:"acos",detail:"function",info:"Calculate the arccosine, in radians, for input series",type:"function"},{label:"acosh",detail:"function",info:"Calculate the inverse hyperbolic cosine, in radians, for input series",type:"function"},{label:"asin",detail:"function",info:"Calculate the arcsine, in radians, for input series",type:"function"},{label:"asinh",detail:"function",info:"Calculate the inverse hyperbolic sine, in radians, for input series",type:"function"},{label:"atan",detail:"function",info:"Calculate the arctangent, in radians, for input series",type:"function"},{label:"atanh",detail:"function",info:"Calculate the inverse hyperbolic tangent, in radians, for input series",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",detail:"function",info:"Limit the value of input series between a minimum and a maximum",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:"cos",detail:"function",info:"Calculate the cosine, in radians, for input series",type:"function"},{label:"cosh",detail:"function",info:"Calculate the hyperbolic cosine, in radians, for input series",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:"deg",detail:"function",info:"Convert radians to degrees for input series",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:"last_over_time",detail:"function",info:"The most recent point value in specified interval.",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:"pi",detail:"function",info:"Return pi",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"present_over_time",detail:"function",info:"the value 1 for any series in the specified interval",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rad",detail:"function",info:"Convert degrees to radians 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:"sgn",detail:"function",info:"Returns the sign of the instant vector",type:"function"},{label:"sin",detail:"function",info:"Calculate the sine, in radians, for input series",type:"function"},{label:"sinh",detail:"function",info:"Calculate the hyperbolic sine, in radians, for input series",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:"tan",detail:"function",info:"Calculate the tangent, in radians, for input series",type:"function"},{label:"tanh",detail:"function",info:"Calculate the hyperbolic tangent, in radians, for input series",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:H,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"}],number:[{label:"nan",info:"Floating-point NaN value",type:"constant"},{label:"inf",info:"Floating-point infinity",type:"constant"}]};function U(e,t){var n=R(e,p);return n&&(n=N(n,133,57))?t.sliceDoc(n.from,n.to):""}!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",e[e.Bool=11]="Bool",e[e.AtModifiers=12]="AtModifiers",e[e.Number=13]="Number"}(F||(F={}));var X=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4;Object(o.a)(this,e),this.prometheusClient=t,this.maxMetricsMetadata=n}return Object(a.a)(e,[{key:"getPrometheusClient",value:function(){return this.prometheusClient}},{key:"promQL",value:function(e){var t,n=this,r=e.state,i=e.pos,o=Object(B.j)(r).resolve(i,-1),a=function(e,t){var n,r,i,o,a,s,b,y,O,w,k,j,x,S,C,M,P=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===f){P.push({kind:F.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===m){P.push({kind:F.MatchOp});break}if((null===(i=t.parent)||void 0===i?void 0:i.type.id)===u){P.push({kind:F.Duration});break}if((null===(o=t.parent)||void 0===o?void 0:o.type.id)===h&&_(t.parent,124)){P.push({kind:F.Duration});break}var T=e.sliceDoc(t.from,t.to);V.filter((function(e){return e.label.includes(T)})).length>0&&P.push({kind:F.BinOp});break;case 57:if(0===(null===(a=t.parent)||void 0===a?void 0:a.type.id)){var E=t.parent.parent;if(141===(null===E||void 0===E?void 0:E.type.id)){P.push({kind:F.AtModifiers});break}if(30===(null===E||void 0===E?void 0:E.type.id)){P.push({kind:F.AggregateOpModifier},{kind:F.BinOp});break}if((null===E||void 0===E?void 0:E.type.id)===p){var D=U(t,e);H.filter((function(e){return e.label===D})).length>0&&P.push({kind:F.AggregateOpModifier}),P.push({kind:F.BinOp},{kind:F.Offset});break}if(E&&L(E,c)){P.push({kind:F.BinOp},{kind:F.Offset});break}}var z=null===(y=null===(b=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===b?void 0:b.parent)||void 0===y?void 0:y.parent;if(!z){P.push({kind:F.MetricName,metricName:e.sliceDoc(t.from,t.to)});break}L(z,c,c)?z.type.id!==l||_(z,0)||(P.push({kind:F.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:F.Function},{kind:F.Aggregation},{kind:F.BinOpModifier},{kind:F.Number}),_(z,48,49,50,51,52,53)&&!N(z,41,1)&&P.push({kind:F.Bool})):(P.push({kind:F.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:F.Function},{kind:F.Aggregation}),38!==z.type.id&&z.type.id!==u&&P.push({kind:F.Number}));break;case 28:t.firstChild||P.push({kind:F.MetricName,metricName:""},{kind:F.Function},{kind:F.Aggregation},{kind:F.Number});break;case 33:P.push({kind:F.LabelName});break;case 134:P.push({kind:F.LabelName,metricName:U(t,e)});break;case 36:35===(null===(O=t.parent)||void 0===O?void 0:O.type.id)?P.push({kind:F.LabelName}):(null===(w=t.parent)||void 0===w?void 0:w.type.id)===m&&P.push({kind:F.LabelName,metricName:U(t,e)});break;case d:if((null===(k=t.parent)||void 0===k?void 0:k.type.id)===m){var B="";36===(null===(j=t.parent.firstChild)||void 0===j?void 0:j.type.id)&&(B=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to));var $=U(t,e),W=A(I(R(t,v),v,m),e);P.push({kind:F.LabelValue,metricName:$,labelName:B,matchers:W})}break;case 125:0===(null===(x=t.parent)||void 0===x?void 0:x.type.id)&&(null===(S=t.parent.parent)||void 0===S?void 0:S.type.id)===h?P.push({kind:F.Duration}):P.push({kind:F.Number});break;case 124:case f:P.push({kind:F.Duration});break;case 37:P.push({kind:F.MetricName,metricName:""},{kind:F.Function},{kind:F.Aggregation});break;case 53:137===(null===(C=t.parent)||void 0===C?void 0:C.type.id)?P.push({kind:F.MatchOp}):(null===(M=t.parent)||void 0===M?void 0:M.type.id)===l&&P.push({kind:F.BinOp});break;case g:case 139:case 140:case 137:P.push({kind:F.MatchOp});break;case 40:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 22:case 24:case 23:case l:P.push({kind:F.BinOp})}return P}(r,o),s=Promise.resolve([]),b=!1,y=!0,O=Object(x.a)(a);try{var w=function(){var e=t.value;switch(e.kind){case F.Aggregation:b=!0,s=s.then((function(e){return e.concat(Q.aggregateOp)}));break;case F.Function:b=!0,s=s.then((function(e){return e.concat(Q.functionIdentifier)}));break;case F.BinOpModifier:s=s.then((function(e){return e.concat(Q.binOpModifier)}));break;case F.BinOp:s=s.then((function(e){return e.concat(Q.binOp)}));break;case F.MatchOp:s=s.then((function(e){return e.concat(Q.matchOp)}));break;case F.AggregateOpModifier:s=s.then((function(e){return e.concat(Q.aggregateOpModifier)}));break;case F.Duration:y=!1,s=s.then((function(e){return e.concat(Q.duration)}));break;case F.Offset:s=s.then((function(e){return e.concat([{label:"offset"}])}));break;case F.Bool:s=s.then((function(e){return e.concat([{label:"bool"}])}));break;case F.AtModifiers:s=s.then((function(e){return e.concat(Q.atModifier)}));break;case F.Number:s=s.then((function(e){return e.concat(Q.number)}));break;case F.MetricName:s=s.then((function(t){return n.autocompleteMetricName(t,e)}));break;case F.LabelName:s=s.then((function(t){return n.autocompleteLabelName(t,e)}));break;case F.LabelValue:s=s.then((function(t){return n.autocompleteLabelValue(t,e)}))}};for(O.s();!(t=O.n()).done;)w()}catch(k){O.e(k)}finally{O.f()}return s.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(S.a)(q)),{from:t,to:n,options:i,span:r?/^[a-zA-Z0-9_:]+$/:void 0}}(e,function(e,t){var n,r,i,o,a,s,c=e.from;return 134===e.type.id||33===e.type.id?c=function(e,t){var n=e.from+1;return null!==e.firstChild&&(n=t),n}(e,t):37===e.type.id||e.type.id===d&&(null===(n=e.parent)||void 0===n?void 0:n.type.id)===m?c++:(e.type.id===f||125===e.type.id&&0===(null===(r=e.parent)||void 0===r?void 0:r.type.id)&&(null===(i=e.parent.parent)||void 0===i?void 0:i.type.id)===h||0===e.type.id&&((null===(o=e.parent)||void 0===o?void 0:o.type.id)===f||(null===(a=e.parent)||void 0===a?void 0:a.type.id)===u||(null===(s=e.parent)||void 0===s?void 0:s.type.id)===h&&_(e.parent,124)))&&(c=t),c}(o,i),i,b,y)}))}},{key:"autocompleteMetricName",value:function(e,t){var n=this;if(!this.prometheusClient)return e;var r=new Map;return this.prometheusClient.metricNames(t.metricName).then((function(e){var t,i,o=Object(x.a)(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.set(a,{label:a,type:"constant"})}}catch(s){o.e(s)}finally{o.f()}if(e.length<=n.maxMetricsMetadata)return null===(t=n.prometheusClient)||void 0===t?void 0:t.metricMetadata()})).then((function(t){if(t){var n,i=Object(x.a)(r);try{for(i.s();!(n=i.n()).done;){var o=Object(j.a)(n.value,2),a=o[0],s=o[1],c=t[a.replace(/(_count|_sum|_bucket)$/,"")];if(c)if(c.length>1){var l,u=Object(x.a)(c);try{for(u.s();!(l=u.n()).done;){var f=l.value;""===s.detail?s.detail=f.type:s.detail!==f.type&&(s.detail="unknown",s.info="multiple different definitions for this metric"),""===s.info?s.info=f.help:s.info!==f.help&&(s.info="multiple different definitions for this metric")}}catch(v){u.e(v)}finally{u.f()}}else if(1===c.length){var d=c[0],h=d.type,p=d.help;"histogram"!==h&&"summary"!==h||(a.endsWith("_count")&&(h="counter",p="The total number of observations for: ".concat(p)),a.endsWith("_sum")&&(h="counter",p="The total sum of observations for: ".concat(p)),a.endsWith("_bucket")&&(h="counter",p="The total count of observations for a bucket in the histogram: ".concat(p))),s.detail=h,s.info=p}}}catch(v){i.e(v)}finally{i.f()}}return e.concat(Array.from(r.values()))}))}},{key:"autocompleteLabelName",value:function(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t.metricName).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"constant"}})))})):e}},{key:"autocompleteLabelValue",value:function(e,t){return this.prometheusClient&&t.labelName?this.prometheusClient.labelValues(t.labelName,t.metricName,t.matchers).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"text"}})))})):e}}]),e}(),Y=n(132),G=n.n(Y),K=400,J=422,Z=503,ee=function(){function e(t){Object(o.a)(this,e),this.lookbackInterval=432e5,this.httpMethod="POST",this.apiPrefix="/api/v1",this.fetchFn=function(e,t){return fetch(e,t)},this.url=t.url,this.errorHandler=t.httpErrorHandler,t.lookbackInterval&&(this.lookbackInterval=t.lookbackInterval),t.fetchFn&&(this.fetchFn=t.fetchFn),t.httpMethod&&(this.httpMethod=t.httpMethod),t.apiPrefix&&(this.apiPrefix=t.apiPrefix)}return Object(a.a)(e,[{key:"labelNames",value:function(e){var t=this,n=new Date,r=new Date(n.getTime()-this.lookbackInterval);if(void 0===e||""===e){var i=this.buildRequest(this.labelsEndpoint(),new URLSearchParams({start:r.toISOString(),end:n.toISOString()}));return this.fetchAPI(i.uri,{method:this.httpMethod,body:i.body}).catch((function(e){return t.errorHandler&&t.errorHandler(e),[]}))}return this.series(e).then((function(e){var t,n=new Set,r=Object(x.a)(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value,o=0,a=Object.entries(i);o0?Promise.resolve(n):void 0===e||""===e?this.client.labelNames().then((function(e){return t.cache.setLabelNames(e),e})):this.series(e).then((function(){return t.cache.getLabelNames(e)}))}},{key:"labelValues",value:function(e,t){var n=this,r=this.cache.getLabelValues(e,t);return r&&r.length>0?Promise.resolve(r):void 0===t||""===t?this.client.labelValues(e).then((function(t){return n.cache.setLabelValues(e,t),t})):this.series(t).then((function(){return n.cache.getLabelValues(e,t)}))}},{key:"metricMetadata",value:function(){var e=this,t=this.cache.getMetricMetadata();return t&&Object.keys(t).length>0?Promise.resolve(t):this.client.metricMetadata().then((function(t){return e.cache.setMetricMetadata(t),e.cache.getMetricMetadata()}))}},{key:"series",value:function(e){var t=this;return this.client.series(e).then((function(n){return t.cache.setAssociations(e,n),n}))}},{key:"metricNames",value:function(){return this.labelValues("__name__")}}]),e}();function re(e){return(null===e||void 0===e?void 0:e.completeStrategy)?e.completeStrategy:(null===e||void 0===e?void 0:e.remote)?void 0===e.remote.url?new X(e.remote,e.maxMetricsMetadata):new X(new ne(new ee(e.remote),e.remote.cache),e.maxMetricsMetadata):new X}var ie,oe=n(109),ae=function(){function e(){Object(o.a)(this,e)}return Object(a.a)(e,[{key:"promQL",value:function(){return function(e){var t=new $(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();function se(e,t){return Object(oe.b)(e.call(t))}function ce(e){return B.b.define({parser:w.configure({top:e,props:[Object(k.b)({LineComment:k.c.comment,LabelName:k.c.labelName,StringLiteral:k.c.string,NumberLiteral:k.c.number,Duration:k.c.number,"Abs Absent AbsentOverTime Acos Acosh Asin Asinh Atan Atanh AvgOverTime Ceil Changes Clamp ClampMax ClampMin Cos Cosh CountOverTime DaysInMonth DayOfMonth DayOfWeek Deg Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month Pi PredictLinear PresentOverTime QuantileOverTime Rad Rate Resets Round Scalar Sgn Sin Sinh Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Tan Tanh Time Timestamp Vector Year":k.c.function(k.c.variableName),"Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":k.c.operatorKeyword,"By Without Bool On Ignoring GroupLeft GroupRight Offset Start End":k.c.modifier,"And Unless Or":k.c.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":k.c.operator,UnaryOp:k.c.arithmeticOperator,"( )":k.c.paren,"[ ]":k.c.squareBracket,"{ }":k.c.brace,"\u26a0":k.c.invalid})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})}!function(e){e.PromQL="PromQL",e.MetricName="MetricName"}(ie||(ie={}));var le=function(){function e(){Object(o.a)(this,e),this.complete=re(),this.lint=new ae,this.enableLinter=!0,this.enableCompletion=!0}return Object(a.a)(e,[{key:"setComplete",value:function(e){return this.complete=re(e),this}},{key:"getComplete",value:function(){return this.complete}},{key:"activateCompletion",value:function(e){return this.enableCompletion=e,this}},{key:"setLinter",value:function(e){return this.lint=e,this}},{key:"getLinter",value:function(){return this.lint}},{key:"activateLinter",value:function(e){return this.enableLinter=e,this}},{key:"asExtension",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie.PromQL,n=ce(t),r=[n];if(this.enableCompletion){var i=n.data.of({autocomplete:function(t){return e.complete.promQL(t)}});r=r.concat(i)}return this.enableLinter&&(r=r.concat(se(this.lint.promQL,this.lint))),r}}]),e}()},function(e,t,n){"use strict";var r=n(3),i=n(2),o=n(7),a=n(134),s=n(243);function c(e,t,n){var o;return Object(i.a)({toolbar:(o={minHeight:56},Object(r.a)(o,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(o,e.up("sm"),{minHeight:64}),o)},n)}var l=n(116),u=n(299),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:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},h={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},p={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"},v={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"},m={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"},g={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},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=["mode","contrastThreshold","tonalOffset"],O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:f.white},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}},w={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},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 k(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(u.e)(e.main,i):"dark"===t&&(e.dark=Object(u.b)(e.main,o)))}function j(e){var t=e.mode,n=void 0===t?"light":t,r=e.contrastThreshold,s=void 0===r?3:r,c=e.tonalOffset,j=void 0===c?.2:c,x=Object(o.a)(e,y),S=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[200],light:m[50],dark:m[400]}:{main:m[700],light:m[400],dark:m[800]}}(n),C=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:h[200],light:h[50],dark:h[400]}:{main:h[500],light:h[300],dark:h[700]}}(n),M=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:p[500],light:p[300],dark:p[700]}:{main:p[700],light:p[400],dark:p[800]}}(n),P=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:g[700],light:g[500],dark:g[900]}}(n),T=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[400],light:b[300],dark:b[700]}:{main:b[800],light:b[500],dark:b[900]}}(n),E=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[400],light:v[300],dark:v[700]}:{main:"#ed6c02",light:v[500],dark:v[900]}}(n);function A(e){return Object(u.d)(e,w.text.primary)>=s?w.text.primary:O.text.primary}var D=function(e){var t=e.color,n=e.name,r=e.mainShade,o=void 0===r?500:r,a=e.lightShade,s=void 0===a?300:a,c=e.darkShade,u=void 0===c?700:c;if(!(t=Object(i.a)({},t)).main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error(Object(l.a)(11,n?" (".concat(n,")"):"",o));if("string"!==typeof t.main)throw new Error(Object(l.a)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return k(t,"light",s,j),k(t,"dark",u,j),t.contrastText||(t.contrastText=A(t.main)),t},R={dark:w,light:O};return Object(a.a)(Object(i.a)({common:f,mode:n,primary:D({color:S,name:"primary"}),secondary:D({color:C,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:D({color:M,name:"error"}),warning:D({color:E,name:"warning"}),info:D({color:P,name:"info"}),success:D({color:T,name:"success"}),grey:d,contrastThreshold:s,getContrastText:A,augmentColor:D,tonalOffset:j},R[n]),x)}var x=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];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,c=n.fontSize,l=void 0===c?14:c,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,w=n.pxToRem,k=Object(o.a)(n,x);var j=l/14,M=w||function(e){return"".concat(e/y*j,"rem")},P=function(e,t,n,r,o){return Object(i.a)({fontFamily:s,fontWeight:e,fontSize:M(t),lineHeight:n},s===C?{letterSpacing:"".concat((a=r/t,Math.round(1e5*a)/1e5),"em")}:{},o,O);var a},T={h1:P(f,96,1.167,-1.5),h2:P(f,60,1.2,-.5),h3:P(h,48,1.167,0),h4:P(h,34,1.235,.25),h5:P(h,24,1.334,0),h6:P(v,20,1.6,.15),subtitle1:P(h,16,1.75,.15),subtitle2:P(v,14,1.57,.1),body1:P(h,16,1.5,.15),body2:P(h,14,1.43,.15),button:P(v,14,1.75,.4,S),caption:P(h,12,1.66,.4),overline:P(h,12,2.66,1,S)};return Object(a.a)(Object(i.a)({htmlFontSize:y,pxToRem:M,fontFamily:s,fontSize:l,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},T),k,{clone:!1})}function P(){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",P(0,2,1,-1,0,1,1,0,0,1,3,0),P(0,3,1,-2,0,2,2,0,0,1,5,0),P(0,3,3,-2,0,3,4,0,0,1,8,0),P(0,2,4,-1,0,4,5,0,0,1,10,0),P(0,3,5,-1,0,5,8,0,0,1,14,0),P(0,3,5,-1,0,6,10,0,0,1,18,0),P(0,4,5,-2,0,7,10,1,0,2,16,1),P(0,5,5,-3,0,8,10,1,0,3,14,2),P(0,5,6,-3,0,9,12,1,0,3,16,2),P(0,6,6,-3,0,10,14,1,0,4,18,3),P(0,6,7,-4,0,11,15,1,0,4,20,3),P(0,7,8,-4,0,12,17,2,0,5,22,4),P(0,7,8,-4,0,13,19,2,0,5,24,4),P(0,7,9,-4,0,14,21,2,0,5,26,4),P(0,8,9,-5,0,15,22,2,0,6,28,5),P(0,8,10,-5,0,16,24,2,0,6,30,5),P(0,8,11,-5,0,17,26,2,0,6,32,5),P(0,9,11,-5,0,18,28,2,0,7,34,6),P(0,9,12,-6,0,19,29,2,0,7,36,6),P(0,10,13,-6,0,20,31,3,0,8,38,7),P(0,10,13,-6,0,21,33,3,0,8,40,7),P(0,10,14,-6,0,22,35,3,0,8,42,7),P(0,11,14,-7,0,23,36,3,0,9,44,8),P(0,11,15,-7,0,24,38,3,0,9,46,8)],E=n(46),A={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},D=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,n=void 0===t?{}:t,r=e.palette,l=void 0===r?{}:r,u=e.transitions,f=void 0===u?{}:u,d=e.typography,h=void 0===d?{}:d,p=Object(o.a)(e,D),v=j(l),m=Object(s.a)(e),g=Object(a.a)(m,{mixins:c(m.breakpoints,m.spacing,n),palette:v,shadows:T.slice(),typography:M(v,h),transitions:Object(E.a)(f),zIndex:Object(i.a)({},A)});g=Object(a.a)(g,p);for(var b=arguments.length,y=new Array(b>1?b-1:0),O=1;O0&&void 0!==arguments[0]?arguments[0]:{};return[h,d.of(e),i.d.domEventHandlers({beforeinput:function(e,t){return"historyUndo"==e.inputType?m(t):"historyRedo"==e.inputType&&g(t)}})]}function v(e,t){return function(n){var r=n.state,i=n.dispatch,o=r.field(h,!1);if(!o)return!1;var a=o.pop(e,r,t);return!!a&&(i(a),!0)}}var m=v(0,!1),g=v(1,!1),b=v(0,!0),y=v(1,!0);var O=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return Object(c.a)(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}},{key:"toJSON",value:function(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((function(e){return e.toJSON()}))}}}],[{key:"fromJSON",value:function(t){return new e(t.changes&&o.c.fromJSON(t.changes),[],t.mapped&&o.b.fromJSON(t.mapped),t.startSelection&&o.e.fromJSON(t.startSelection),t.selectionsAfter.map(o.e.fromJSON))}},{key:"fromTransaction",value:function(t){var n,r=j,i=Object(a.a)(t.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var o=(0,n.value)(t);o.length&&(r=r.concat(o))}}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,j)}},{key:"selection",value:function(t){return new e(void 0,j,void 0,void 0,t)}}]),e}();function w(e,t,n,r){var i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function k(e,t){return e.length?t.length?e.concat(t):e:t}var j=[];function x(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),w(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=j;n;){var i=M(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=e.slice(0,n);return o[n-1]=i,o}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[O.selection(r)]:j}function M(e,t,n){var r=k(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):j,n);if(!e.changes)return O.selection(r);var i=e.changes.map(t),a=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(a):a;return new O(i,o.j.mapEffects(e.effects,t),s,e.startSelection.map(a),r)}var P=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(c.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,o){var a=this.done,s=a[a.length-1];return a=s&&s.changes&&!s.changes.empty&&t.changes&&(!s.selectionsAfter.length&&n-this.prevTime=s&&i<=c&&(r=!0)}})),r}(s.changes,t.changes)||"input.type.compose"==r)?w(a,a.length-1,o,new O(t.changes.compose(s.changes),k(t.effects,s.effects),s.mapped,s.startSelection,j)):w(a,a.length,o,t),new e(a,j,n,r)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:j;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="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=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)i(o);this.markers=V(n.markers(t)),n.initialSpacer&&(this.spacer=new U(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Object(c.a)(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=V(this.config.markers(e.view)),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])}var r=e.view.viewport;return!R.a.eq(this.markers,t,r.from,r.to)}}]),e}(),U=function(){function e(t,n,r,i){Object(s.a)(this,e),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,n,r,i)}return Object(c.a)(e,[{key:"update",value:function(e,t,n,r){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 i;i=this.dom.lastChild;)i.remove();var o,s="cm-gutterElement",c=Object(a.a)(r);try{for(c.s();!(o=c.n()).done;){var l=o.value;l.toDOM&&this.dom.appendChild(l.toDOM(e));var u=l.elementClass;u&&(s+=" "+u)}}catch(f){c.e(f)}finally{c.f()}this.dom.className=s}}}]),e}();var X=o.g.define(),Y=o.g.define({combine:function(e){return Object(o.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}})}}),G=function(e){Object(E.a)(n,e);var t=Object(A.a)(n);function n(e){var r;return Object(s.a)(this,n),(r=t.call(this)).number=e,r}return Object(c.a)(n,[{key:"eq",value:function(e){return this.number==e.number}},{key:"toDOM",value:function(e){return document.createTextNode(this.number)}}]),n}(N);function K(e,t){return e.state.facet(Y).formatNumber(t,e.state)}var J=I.compute([Y],(function(e){return{class:"cm-lineNumbers",renderEmptyElements:!1,markers:function(e){return e.state.facet(X)},lineMarker:function(e,t,n){return n.some((function(e){return e.toDOM}))?null:new G(K(e,e.state.doc.lineAt(t.from).number))},initialSpacer:function(e){return new G(K(e,ee(e.state.doc.lines)))},updateSpacer:function(e,t){var n=K(t.view,ee(t.view.state.doc.lines));return n==e.number?e:new G(n)},domEventHandlers:e.facet(Y).domEventHandlers}}));function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[Y.of(e),$(),J]}function ee(e){for(var t=9;tr&&(r=s,n.push(te.range(s)))}}}catch(c){i.e(c)}finally{i.f()}return R.a.of(n)}));function re(){return ne}function ie(e,t){var n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var oe=o.j.define({map:ie}),ae=o.j.define({map:ie});function se(e){var t,n=[],r=Object(a.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(o){r.e(o)}finally{r.f()}return n}var ce=o.k.define({create:function(){return i.b.none},update:function(e,t){e=e.map(t.changes);var n,r=Object(a.a)(t.effects);try{var i=function(){var t=n.value;t.is(oe)&&!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:[me.range(t.value.from,t.value.to)]}):t.is(ae)&&(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(c){r.e(c)}finally{r.f()}if(t.selection){var o=!1,s=t.selection.main.head;e.between(s,s,(function(e,t){es&&(o=!0)})),o&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:function(e){return i.d.decorations.from(e)}});function le(e,t,n){var r,i=null;return null===(r=e.field(ce,!1))||void 0===r||r.between(t,n,(function(e,t){(!i||i.from>e)&&(i={from:e,to:t})})),i}function ue(e,t){return e.field(ce,!1)?t:t.concat(o.j.appendConfig.of(ve()))}function fe(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return i.d.announce.of("".concat(e.state.phrase(n?"Folded lines":"Unfolded lines")," ").concat(r," ").concat(e.state.phrase("to")," ").concat(o,"."))}var de=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=Object(a.a)(se(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=Object(D.c)(e.state,r.from,r.to);if(i)return e.dispatch({effects:ue(e.state,[oe.of(i),fe(e,i)])}),!0}}catch(o){n.e(o)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(ce,!1))return!1;var t,n=[],r=Object(a.a)(se(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=le(e.state,i.from,i.to);o&&n.push(ae.of(o),fe(e,o,!1))}}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;r0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},ge),e),n=new be(t,!0),r=new be(t,!1),o=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.from=t.viewport.from,this.markers=this.buildMarkers(t)}return Object(c.a)(e,[{key:"update",value:function(e){(e.docChanged||e.viewportChanged||e.startState.facet(D.i)!=e.state.facet(D.i)||e.startState.field(ce,!1)!=e.state.field(ce,!1))&&(this.markers=this.buildMarkers(e.view))}},{key:"buildMarkers",value:function(e){var t=new R.b;return e.viewportLines((function(i){var o=le(e.state,i.from,i.to)?r:Object(D.c)(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)})),t.finish()}}]),e}());return[o,z({class:"cm-foldGutter",markers:function(e){var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.markers)||R.a.empty},initialSpacer:function(){return new be(t,!1)},domEventHandlers:{click:function(e,t){var n=le(e.state,t.from,t.to);if(n)return e.dispatch({effects:ae.of(n)}),!0;var r=Object(D.c)(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:oe.of(r)}),!0)}}}),ve()]}var Oe=i.d.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),we=n(110),ke=n(63),je=n(19),xe={brackets:["(","[","{","'",'"'],before:")]}'\":;>"},Se=o.j.define({map:function(e,t){var n=t.mapPos(e,-1,o.h.TrackAfter);return null==n?void 0:n}}),Ce=o.j.define({map:function(e,t){return t.mapPos(e)}}),Me=new(function(e){Object(E.a)(n,e);var t=Object(A.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return n}(R.c));Me.startSide=1,Me.endSide=-1;var Pe=o.k.define({create:function(){return R.a.empty},update:function(e,t){if(t.selection){var n=t.state.doc.lineAt(t.selection.main.head).from,r=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(r,-1)&&(e=R.a.empty)}e=e.map(t.changes);var i,o=Object(a.a)(t.effects);try{var s=function(){var t=i.value;t.is(Se)?e=e.update({add:[Me.range(t.value,t.value+1)]}):t.is(Ce)&&(e=e.update({filter:function(e){return e!=t.value}}))};for(o.s();!(i=o.n()).done;)s()}catch(c){o.e(c)}finally{o.f()}return e}});function Te(){return[i.d.inputHandler.of(Re),Pe]}var Ee="()[]{}<>";function Ae(e){for(var t=0;t2||2==r.length&&1==Object(je.c)(Object(je.b)(r,0))||t!=i.from||n!=i.to)return!1;var o=function(e,t){var n,r=De(e,e.selection.main.head),i=r.brackets||xe.brackets,o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,c=Ae(Object(je.b)(s,0));if(t==s)return c==s?Be(e,s,i.indexOf(s+s+s)>-1):Ie(e,s,c,r.before||xe.before);if(t==c&&_e(e,e.selection.main.from))return ze(e,s,c)}}catch(l){o.e(l)}finally{o.f()}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}var Ne=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch,r=De(t,t.selection.main.head).brackets||xe.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(je.c)(Object(je.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),c=Object(a.a)(r);try{for(c.s();!(n=c.n()).done;){var l=n.value;if(l==s&&Le(t.doc,e.head)==Ae(Object(je.b)(l,0)))return{changes:{from:e.head-l.length,to:e.head+l.length},range:o.e.cursor(e.head-l.length),userEvent:"delete.backward"}}}catch(u){c.e(u)}finally{c.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function _e(e,t){var n=!1;return e.field(Pe).between(0,e.doc.length,(function(e){e==t&&(n=!0)})),n}function Le(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(je.c)(Object(je.b)(n,0)))}function Ie(e,t,n,r){var i=null,a=e.changeByRange((function(a){if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:Se.of(a.to+t.length),range:o.e.range(a.anchor+t.length,a.head+t.length)};var s=Le(e.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:a.head},effects:Se.of(a.head+t.length),range:o.e.cursor(a.head+t.length)}:{range:i=a}}));return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function ze(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&Le(e.doc,t.head)==n?o.e.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:o.e.create(i,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((function(e){var t=e.from;return Ce.of(t)}))})}function Be(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}],effects:Se.of(i.to+t.length),range:o.e.range(i.anchor+t.length,i.head+t.length)};var a=i.head,s=Le(e.doc,a);if(s==t){if(Fe(e,a))return{changes:{insert:t+t,from:a},effects:Se.of(a+t.length),range:o.e.cursor(a+t.length)};if(_e(e,a)){var c=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:o.e.cursor(a+t.length*(c?3:1)),effects:Ce.of(a)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&Fe(e,a-2*t.length))return{changes:{insert:t+t+t+t,from:a},effects:Se.of(a+t.length),range:o.e.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=o.d.Word){var l=e.sliceDoc(a-1,a);if(l!=t&&e.charCategorizer(a)(l)!=o.d.Word)return{changes:{insert:t+t,from:a},effects:Se.of(a+t.length),range:o.e.cursor(a+t.length)}}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Fe(e,t){var n=Object(D.j)(e).resolveInner(t+1);return n.parent&&n.from==t}var $e=n(9),We=n(59),Ve=n(29),He="function"==typeof String.prototype.normalize?function(e){return e.normalize("NFKD")}:function(e){return e},qe=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,o=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=o?function(e){return o(He(e))}:He,this.query=this.normalize(n)}return Object(c.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 Object(je.b)(this.buffer,this.bufferPos)}},{key:"next",value:function(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}},{key:"nextOverlapping",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=Object(je.g)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Object(je.c)(e);for(var r=this.normalize(t),i=0,o=n;;i++){var a=r.charCodeAt(i),s=this.match(a,o);if(s)return this.value=s,this;if(i==r.length-1)break;o==n&&i3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.length;if(Object(s.a)(this,e),this.to=o,this.curLine="",this.done=!1,this.value=Qe,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Ke(t,n,r,i,o);this.re=new RegExp(n,Ue+((null===r||void 0===r?void 0:r.ignoreCase)?"i":"")),this.iter=t.iter();var a=t.lineAt(i);this.curLineStart=a.from,this.matchPos=i,this.getLine(this.curLineStart)}return Object(c.a)(e,[{key:"getLine",value:function(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}},{key:"nextLine",value:function(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}},{key:"next",value:function(){for(var e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;var t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){var n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=r+(n==r?1:0),n==this.curLine.length&&this.nextLine(),nthis.value.to)return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=r||i.to<=n){var o=new e(n,t.sliceString(n,r));return Ye.set(t,o),o}if(i.from==n&&i.to==r)return i;var a=i.text,s=i.from;return s>n&&(a=t.sliceString(n,s)+a,s=n),i.to=this.to?this.to:this.text.lineAt(e).to}},{key:"next",value:function(){for(;;){var e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){var n=this.flat.from+t.index,r=n+t[0].length;return this.value={from:n,to:r,match:t},this.matchPos=r+(n==r?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ge.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}]),e}();function Je(e){var t=Object(Ve.a)("input",{class:"cm-textfield",name:"line"});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(n){var r=e.state,i=r.doc.lineAt(r.selection.main.head),a=Object($e.a)(n,5),s=a[1],c=a[2],l=a[3],u=a[4],f=l?+l.slice(1):0,d=c?+c:i.number;if(c&&u){var h=d/100;s&&(h=h*("-"==s?-1:1)+i.number/r.doc.lines),d=Math.round(r.doc.lines*h)}else c&&s&&(d=d*("-"==s?-1:1)+i.number);var p=r.doc.line(Math.max(1,Math.min(r.doc.lines,d)));e.dispatch({effects:Ze.of(!1),selection:o.e.cursor(p.from+Math.max(0,Math.min(f,p.length))),scrollIntoView:!0}),e.focus()}}return{dom:Object(Ve.a)("form",{class:"cm-gotoLine",onkeydown:function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({effects:Ze.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:function(e){e.preventDefault(),n()}},Object(Ve.a)("label",e.state.phrase("Go to line"),": ",t)," ",Object(Ve.a)("button",{class:"cm-button",type:"submit"},e.state.phrase("go"))),pos:-10}}var Ze=o.j.define(),et=o.k.define({create:function(){return!0},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Ze)&&(e=i.value)}}catch(o){r.e(o)}finally{r.f()}return e},provide:function(e){return We.b.from(e,(function(e){return e?Je:null}))}}),tt=i.d.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),nt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},rt=o.g.define({combine:function(e){return Object(o.m)(e,nt,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});function it(e){var t=[ct,st];return e&&t.push(rt.of(e)),t}var ot=i.b.mark({class:"cm-selectionMatch"}),at=i.b.mark({class:"cm-selectionMatch cm-selectionMatch-main"}),st=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(c.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(rt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,c=r.main,l=null;if(c.empty){if(!t.highlightWordAroundCursor)return i.b.none;var u=n.wordAt(c.head);if(!u)return i.b.none;l=n.charCategorizer(c.head),s=n.sliceDoc(u.from,u.to)}else{var f=c.to-c.from;if(f200)return i.b.none;if(!(s=n.sliceDoc(c.from,c.to).trim()))return i.b.none}var d,h=[],p=Object(a.a)(e.visibleRanges);try{for(p.s();!(d=p.n()).done;)for(var v=d.value,m=new qe(n.doc,s,v.from,v.to);!m.next().done;){var g=m.value,b=g.from,y=g.to;if((!l||(0==b||l(n.sliceDoc(b-1,b))!=o.d.Word)&&(y==n.doc.length||l(n.sliceDoc(y,y+1))!=o.d.Word))&&(l&&b<=c.from&&y>=c.to?h.push(at.range(b,y)):(b>=c.to||y<=c.from)&&h.push(ot.range(b,y)),h.length>t.maxMatches))return i.b.none}}catch(O){p.e(O)}finally{p.f()}return i.b.set(h)}}]),e}(),{decorations:function(e){return e.decorations}}),ct=i.d.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});var lt=o.g.define({combine:function(e){var t=e.some((function(e){return e.matchCase}));return{top:e.some((function(e){return e.top})),matchCase:void 0===t||t}}});var ut=function(){function e(t,n,r){Object(s.a)(this,e),this.search=t,this.replace=n,this.caseInsensitive=r}return Object(c.a)(e,[{key:"eq",value:function(e){return this.search==e.search&&this.replace==e.replace&&this.caseInsensitive==e.caseInsensitive&&this.constructor==e.constructor}}]),e}(),ft=function(e){Object(E.a)(n,e);var t=Object(A.a)(n);function n(e,r,i){var o;return Object(s.a)(this,n),(o=t.call(this,e,r,i)).unquoted=e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"})),o}return Object(c.a)(n,[{key:"cursor",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]:e.length;return new qe(e,this.unquoted,t,n,this.caseInsensitive?function(e){return e.toLowerCase()}:void 0)}},{key:"nextMatch",value:function(e,t,n){var r=this.cursor(e,n).nextOverlapping();return r.done&&(r=this.cursor(e,0,t).nextOverlapping()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(e,t,n){for(var r=n;;){for(var i=Math.max(t,r-1e4-this.unquoted.length),o=this.cursor(e,i,r),a=null;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(i==t)return null;r-=1e4}}},{key:"prevMatch",value:function(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}},{key:"getReplacement",value:function(e){return this.replace}},{key:"matchAll",value:function(e,t){for(var n=this.cursor(e),r=[];!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=this.cursor(e,Math.max(0,t-this.unquoted.length),Math.min(n+this.unquoted.length,e.length));!i.next().done;)r(i.value.from,i.value.to)}},{key:"valid",get:function(){return!!this.search}}]),n}(ut),dt=function(e){Object(E.a)(n,e);var t=Object(A.a)(n);function n(e,r,i){var o;return Object(s.a)(this,n),(o=t.call(this,e,r,i)).valid=!!e&&function(e){try{return new RegExp(e,Ue),!0}catch(t){return!1}}(e),o}return Object(c.a)(n,[{key:"cursor",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]:e.length;return new Xe(e,this.search,this.caseInsensitive?{ignoreCase:!0}:void 0,t,n)}},{key:"nextMatch",value:function(e,t,n){var r=this.cursor(e,n).next();return r.done&&(r=this.cursor(e,0,t).next()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(e,t,n){for(var r=1;;r++){for(var i=Math.max(t,n-1e4*r),o=this.cursor(e,i,n),a=null;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==t)return null}}},{key:"prevMatch",value:function(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}},{key:"getReplacement",value:function(e){return this.replace.replace(/\$([$&\d+])/g,(function(t,n){return"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=this.cursor(e,Math.max(0,t-250),Math.min(n+250,e.length));!i.next().done;)r(i.value.from,i.value.to)}}]),n}(ut),ht=o.j.define(),pt=o.j.define(),vt=o.k.define({create:function(e){return new mt(Mt(e),Ct)},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(ht)?e=new mt(i.value,e.panel):i.is(pt)&&(e=new mt(e.query,i.value?Ct:null))}}catch(o){r.e(o)}finally{r.f()}return e},provide:function(e){return We.b.from(e,(function(e){return e.panel}))}}),mt=function e(t,n){Object(s.a)(this,e),this.query=t,this.panel=n},gt=i.b.mark({class:"cm-searchMatch"}),bt=i.b.mark({class:"cm-searchMatch cm-searchMatch-selected"}),yt=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.decorations=this.highlight(t.state.field(vt))}return Object(c.a)(e,[{key:"update",value:function(e){var t=e.state.field(vt);(t!=e.startState.field(vt)||e.docChanged||e.selectionSet)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel||!t.valid)return i.b.none;for(var n=this.view,r=new R.b,o=0,a=n.visibleRanges,s=a.length;oa[o+1].from-500;)u=a[++o].to;t.highlight(n.state.doc,l,u,(function(e,t){var i=n.state.selection.ranges.some((function(n){return n.from==e&&n.to==t}));r.add(e,t,i?bt:gt)}))}return r.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function Ot(e){return function(t){var n=t.state.field(vt,!1);return n&&n.query.valid?e(t,n):Pt(t)}}var wt=Ot((function(e,t){var n=t.query,r=e.state.selection.main,i=r.from,o=r.to,a=n.nextMatch(e.state.doc,i,o);return!(!a||a.from==i&&a.to==o)&&(e.dispatch({selection:{anchor:a.from,head:a.to},scrollIntoView:!0,effects:Rt(e,a)}),!0)})),kt=Ot((function(e,t){var n=t.query,r=e.state,i=r.selection.main,o=i.from,a=i.to,s=n.prevMatch(r.doc,o,a);return!!s&&(e.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:Rt(e,s)}),!0)})),jt=Ot((function(e,t){var n=t.query.matchAll(e.state.doc,1e3);return!(!n||!n.length)&&(e.dispatch({selection:o.e.create(n.map((function(e){return o.e.range(e.from,e.to)})))}),!0)})),xt=Ot((function(e,t){var n=t.query,r=e.state,i=r.selection.main,o=i.from,a=i.to;if(r.readOnly)return!1;var s=n.nextMatch(r.doc,o,o);if(!s)return!1;var c,l,u=[];if(s.from==o&&s.to==a&&(l=r.toText(n.getReplacement(s)),u.push({from:s.from,to:s.to,insert:l}),s=n.nextMatch(r.doc,s.from,s.to)),s){var f=0==u.length||u[0].from>=s.to?0:s.to-s.from-l.length;c={anchor:s.from-f,head:s.to-f}}return e.dispatch({changes:u,selection:c,scrollIntoView:!!c,effects:s?Rt(e,s):void 0}),!0})),St=Ot((function(e,t){var n=t.query;if(e.state.readOnly)return!1;var r=n.matchAll(e.state.doc,1e9).map((function(e){return{from:e.from,to:e.to,insert:n.getReplacement(e)}}));return!!r.length&&(e.dispatch({changes:r}),!0)}));function Ct(e){var t=e.state.field(vt).query;return{dom:At({view:e,query:t,updateQuery:function(n){t.eq(n)||(t=n,e.dispatch({effects:ht.of(t)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,top:e.state.facet(lt).top}}function Mt(e,t){var n,r=e.selection.main,i=r.empty||r.to>r.from+100?"":e.sliceDoc(r.from,r.to),o=null!==(n=null===t||void 0===t?void 0:t.caseInsensitive)&&void 0!==n?n:!e.facet(lt).matchCase;return t&&!i?t:new ft(i.replace(/\n/g,"\\n"),"",o)}var Pt=function(e){var t=e.state.field(vt,!1);if(t&&t.panel){var n=Object(We.a)(e,Ct);if(!n)return!1;var r=n.dom.querySelector("[name=search]");r.focus(),r.select()}else e.dispatch({effects:[pt.of(!0),t?ht.of(Mt(e.state,t.query)):o.j.appendConfig.of(_t)]});return!0},Tt=function(e){var t=e.state.field(vt,!1);if(!t||!t.panel)return!1;var n=Object(We.a)(e,Ct);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:pt.of(!1)}),!0},Et=[{key:"Mod-f",run:Pt,scope:"editor search-panel"},{key:"F3",run:wt,shift:kt,scope:"editor search-panel"},{key:"Mod-g",run:wt,shift:kt,scope:"editor search-panel"},{key:"Escape",run:Tt,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.main.empty)return!1;for(var i=r.main,a=i.from,s=i.to,c=[],l=0,u=new qe(t.doc,t.sliceDoc(a,s));!u.next().done;){if(c.length>1e3)return!1;u.value.from==a&&(l=c.length),c.push(o.e.range(u.value.from,u.value.to))}return n(t.update({selection:o.e.create(c,l)})),!0}},{key:"Alt-g",run:function(e){var t=Object(We.a)(e,Je);if(!t){var n=[Ze.of(!0)];null==e.state.field(et,!1)&&n.push(o.j.appendConfig.of([et,tt])),e.dispatch({effects:n}),t=Object(We.a)(e,Je)}return t&&t.dom.querySelector("input").focus(),!0}},{key:"Mod-d",run:function(e){var t=e.state,n=e.dispatch,r=t.selection.ranges;if(r.some((function(e){return e.from===e.to})))return function(e){var t=e.state,n=e.dispatch,r=t.selection,i=o.e.create(r.ranges.map((function(e){return t.wordAt(e.head)||o.e.cursor(e.head)})),r.mainIndex);return!i.eq(r)&&(n(t.update({selection:i})),!0)}({state:t,dispatch:n});var i=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some((function(e){return t.sliceDoc(e.from,e.to)!=i})))return!1;var a=function(e,t){for(var n=e.selection,r=n.main,i=n.ranges,o=e.wordAt(r.head),a=o&&o.from==r.from&&o.to==r.to,s=function(n,r){if(r.next(),!r.done){if(n&&i.some((function(e){return e.from==r.value.from})))return l=r,c=n,"continue";if(a){var o=e.wordAt(r.value.from);if(!o||o.from!=r.value.from||o.to!=r.value.to)return l=r,c=n,"continue"}return c=n,l=r,{v:r.value}}if(n)return l=r,c=n,{v:null};r=new qe(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),c=n=!0,l=r},c=!1,l=new qe(e.doc,t,i[i.length-1].to);;){var u=s(c,l);if("continue"!==u&&"object"===typeof u)return u.v}}(t,i);return!!a&&(n(t.update({selection:t.selection.addRange(o.e.range(a.from,a.to),!1),scrollIntoView:!0})),!0)},preventDefault:!0}];function At(e){function t(t){return e.view.state.phrase(t)}var n=Object(Ve.a)("input",{value:e.query.search,placeholder:t("Find"),"aria-label":t("Find"),class:"cm-textfield",name:"search",onchange:s,onkeyup:s}),r=Object(Ve.a)("input",{value:e.query.replace,placeholder:t("Replace"),"aria-label":t("Replace"),class:"cm-textfield",name:"replace",onchange:s,onkeyup:s}),o=Object(Ve.a)("input",{type:"checkbox",name:"case",checked:!e.query.caseInsensitive,onchange:s}),a=Object(Ve.a)("input",{type:"checkbox",name:"re",checked:e.query instanceof dt,onchange:s});function s(){e.updateQuery(new(a.checked?dt:ft)(n.value,r.value,!o.checked))}function c(e,t,n){return Object(Ve.a)("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}return Object(Ve.a)("div",{onkeydown:function(t){Object(i.m)(e.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==n?(t.preventDefault(),(t.shiftKey?kt:wt)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),xt(e.view))},class:"cm-search"},[n,c("next",(function(){return wt(e.view)}),[t("next")]),c("prev",(function(){return kt(e.view)}),[t("previous")]),c("select",(function(){return jt(e.view)}),[t("all")]),Object(Ve.a)("label",null,[o,t("match case")]),Object(Ve.a)("label",null,[a,t("regexp")]),Object(Ve.a)("br"),r,c("replace",(function(){return xt(e.view)}),[t("replace")]),c("replaceAll",(function(){return St(e.view)}),[t("replace all")]),Object(Ve.a)("button",{name:"close",onclick:function(){return Tt(e.view)},"aria-label":t("close"),type:"button"},["\xd7"])])}var Dt=/[\s\.,:;?!]/;function Rt(e,t){var n=t.from,r=t.to,o=e.state.doc.lineAt(n).from,a=e.state.doc.lineAt(r).to,s=Math.max(o,n-30),c=Math.min(a,r+30),l=e.state.sliceDoc(s,c);if(s!=o)for(var u=0;u<30;u++)if(!Dt.test(l[u+1])&&Dt.test(l[u])){l=l.slice(u);break}if(c!=a)for(var f=l.length-1;f>l.length-30;f--)if(!Dt.test(l[f-1])&&Dt.test(l[f])){l=l.slice(0,f);break}return i.d.announce.of("".concat(e.state.phrase("current match"),". ").concat(l," ").concat(e.state.phrase("on line")," ").concat(e.state.doc.lineAt(n).number))}var Nt=i.d.baseTheme({".cm-panel.cm-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, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),_t=[vt,o.i.fallback(yt),Nt],Lt=n(58);function It(e,t){return function(n){var r=n.state,i=n.dispatch,o=e(t,r.selection.ranges,r);return!!o&&(i(r.update(o)),!0)}}var zt=It(Vt,0),Bt=It(Wt,0),Ft=[{key:"Mod-/",run:function(e){var t=$t(e.state);return t.line?zt(e):!!t.block&&Bt(e)}},{key:"Alt-A",run:Bt}];function $t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.main.head,n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Wt(e,t,n){var r=t.map((function(e){return $t(n,e.from).block}));if(!r.every((function(e){return e})))return null;var i=t.map((function(e,t){return function(e,t,n,r){var i,o,a=t.open,s=t.close,c=e.sliceDoc(n-50,n),l=e.sliceDoc(r,r+50),u=/\s*$/.exec(c)[0].length,f=/^\s*/.exec(l)[0].length,d=c.length-u;if(c.slice(d-a.length,d)==a&&l.slice(f,f+s.length)==s)return{open:{pos:n-u,margin:u&&1},close:{pos:r+f,margin:f&&1}};r-n<=100?i=o=e.sliceDoc(n,r):(i=e.sliceDoc(n,n+50),o=e.sliceDoc(r-50,r));var h=/^\s*/.exec(i)[0].length,p=/\s*$/.exec(o)[0].length,v=o.length-p-s.length;return i.slice(h,h+a.length)==a&&o.slice(v,v+s.length)==s?{open:{pos:n+h+a.length,margin:/\s/.test(i.charAt(h+a.length))?1:0},close:{pos:r-p-s.length,margin:/\s/.test(o.charAt(v-1))?1:0}}:null}(n,r[t],e.from,e.to)}));if(2!=e&&!i.every((function(e){return e}))){var a=0;return n.changeByRange((function(e){var t=r[a++],n=t.open,s=t.close;if(i[a])return{range:e};var c=n.length+1;return{changes:[{from:e.from,insert:n+" "},{from:e.to,insert:" "+s}],range:o.e.range(e.anchor+c,e.head+c)}}))}if(1!=e&&i.some((function(e){return e}))){for(var s,c=[],l=0;lo&&(l==u||u>p.from)){o=p.from;var v=$t(n,h).line;if(!v)continue;var m=/^\s*/.exec(p.text)[0].length,g=m==p.length,b=p.text.slice(m,m+v.length)==v?m:-1;m=0}))){var T,E=[],A=Object(a.a)(i);try{for(A.s();!(T=A.n()).done;){var D=T.value,R=D.line,N=D.comment,_=D.token;if(N>=0){var L=R.from+N,I=L+_.length;" "==R.text[I-R.from]&&I++,E.push({from:L,to:I})}}}catch(z){A.e(z)}finally{A.f()}return{changes:E}}return null}var Ht=2e3;function qt(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>Ht?-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(je.d)(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function Qt(e,t){var n=qt(e,t),r=e.state.selection;return n?{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.startState.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,a){var s=qt(e,t);if(!s)return r;var c=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>Ht||n.off>Ht||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),c=Math.max(t.off,n.off),l=r;l<=i;l++){var u=e.doc.line(l);u.length<=c&&a.push(o.e.range(u.from+s,u.to+c))}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=Object(je.f)(p.text,f,e.tabSize,!0);if(v>-1){var m=Object(je.f)(p.text,d,e.tabSize);a.push(o.e.range(p.from+v,p.from+m))}}return a}(e.state,n,s);return c.length?a?o.e.create(c.concat(r.ranges)):o.e.create(c):r}}:null}function Ut(e){var t=(null===e||void 0===e?void 0:e.eventFilter)||function(e){return e.altKey&&0==e.button};return i.d.mouseSelectionStyle.of((function(e,n){return t(n)?Qt(e,n):null}))}var Xt=n(32),Yt=n(109),Gt=[Z(),re(),Object(i.j)(),p(),ye(),Object(i.h)(),o.f.allowMultipleSelections.of(!0),Object(D.f)(),Xt.a.fallback,Object(ke.a)(),Te(),Object(Lt.a)(),Ut(),Object(i.i)(),it(),i.k.of([].concat(Object(r.a)(Ne),Object(r.a)(we.a),Object(r.a)(Et),Object(r.a)(T),Object(r.a)(de),Object(r.a)(Ft),Object(r.a)(Lt.b),Object(r.a)(Yt.a)))]},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(116);function i(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";function r(e,t,n){var r={};return Object.keys(e).forEach((function(i){r[i]=e[i].reduce((function(e,r){return r&&(n&&n[r]&&e.push(n[r]),e.push(t(r))),e}),[]).join(" ")})),r}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(9),i=n(1),o=0;function a(e){var t=i.useState(e),n=Object(r.a)(t,2),a=n[0],s=n[1],c=e||a;return i.useEffect((function(){null==a&&s("mui-".concat(o+=1))}),[a]),c}},function(e,t,n){"use strict";var r=n(7),i=n(2),o=n(1),a=(n(17),n(11)),s=n(176),c=n(299),l=n(10),u=n(14),f=n(119),d=n(133);function h(e){return Object(f.a)("MuiPaper",e)}Object(d.a)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var p=n(0),v=["className","component","elevation","square","variant"],m=function(e){return((e<1?5.11916*Math.pow(e,2):4.5*Math.log(e+1)+2)/100).toFixed(2)},g=Object(l.a)("div",{name:"MuiPaper",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t["elevation".concat(n.elevation)]]}})((function(e){var t=e.theme,n=e.ownerState;return Object(i.a)({backgroundColor:t.palette.background.paper,color:t.palette.text.primary,transition:t.transitions.create("box-shadow")},!n.square&&{borderRadius:t.shape.borderRadius},"outlined"===n.variant&&{border:"1px solid ".concat(t.palette.divider)},"elevation"===n.variant&&Object(i.a)({boxShadow:t.shadows[n.elevation]},"dark"===t.palette.mode&&{backgroundImage:"linear-gradient(".concat(Object(c.a)("#fff",m(n.elevation)),", ").concat(Object(c.a)("#fff",m(n.elevation)),")")}))})),b=o.forwardRef((function(e,t){var n=Object(u.a)({props:e,name:"MuiPaper"}),o=n.className,c=n.component,l=void 0===c?"div":c,f=n.elevation,d=void 0===f?1:f,m=n.square,b=void 0!==m&&m,y=n.variant,O=void 0===y?"elevation":y,w=Object(r.a)(n,v),k=Object(i.a)({},n,{component:l,elevation:d,square:b,variant:O}),j=function(e){var t=e.square,n=e.elevation,r=e.variant,i=e.classes,o={root:["root",r,!t&&"rounded","elevation"===r&&"elevation".concat(n)]};return Object(s.a)(o,h,i)}(k);return Object(p.jsx)(g,Object(i.a)({as:l,ownerState:k,className:Object(a.default)(j.root,o),ref:t},w))}));t.a=b},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(123),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,c=60112;t.Suspense=60113;var l=60115,u=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;i=f("react.element"),o=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),a=f("react.provider"),s=f("react.context"),c=f("react.forward_ref"),t.Suspense=f("react.suspense"),l=f("react.memo"),u=f("react.lazy")}var d="function"===typeof Symbol&&Symbol.iterator;function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n