/*! For license information please see 2.a835ef7b.chunk.js.LICENSE.txt */ (this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(175)},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,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return X})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return ae})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return ce})),n.d(t,"g",(function(){return j})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return N})),n.d(t,"j",(function(){return K})),n.d(t,"k",(function(){return P})),n.d(t,"l",(function(){return J})),n.d(t,"m",(function(){return ue}));var r=n(3),i=n(18),o=n(17),a=n(5),s=n(6),l=n(15),c=/\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&&l>=e&&(n==u.TrackDel&&re||n==u.TrackBefore&&re))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"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 c=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 y(this);e:for(var a=0,s=0;;){for(var l=a==e.length?1e9:e[a++];s0&&p(r,t,o.text),o.forward(c),s+=c}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){sb||g<0||b>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(b," (in doc of length ").concat(t,")"));var k=O?"string"==typeof O?l.a.of(O.split(i||c)):O:l.a.empty,w=k.length;if(g==b&&0==w)return;gs&&h(o,g-s,-1),h(o,b-g,w),p(a,o,k),s=b}}(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++],c=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 y(e),s=new y(t),l=0,c=0;;)if(-1==a.ins)l+=a.len,a.next();else if(-1==s.ins&&c=0&&(a.done||cc&&!a.done&&l+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=l+a.len;;)if(s.ins>=0&&c>l&&c+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new y(e),a=new y(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 l=Math.min(o.len2,a.len),c=r.length;if(-1==o.ins){var u=-1==a.ins?-1:a.off?0:a.ins;h(r,l,u,s),i&&u&&p(i,r,a.text)}else-1==a.ins?(h(r,o.off?0:o.len,l,s),i&&p(i,r,o.textBit(l))):(h(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&p(i,r,a.text));s=(o.ins>l||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}else h(r,0,a.ins,s),i&&p(i,r,a.text),a.next()}}var y=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?l.a.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?l.a.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}]),e}(),b=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 b.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 b(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 w(e,t){var n,i=Object(r.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(o){i.e(o)}finally{i.f()}}var x=0,j=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=x++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new E([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(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 E=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=x++}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,l=!1,c=!1,u=[],f=Object(r.a)(this.dependencies);try{for(f.s();!(n=f.n()).done;){var d=n.value;"doc"==d?l=!0:"selection"==d?c=!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){if(!t||t.reconfigured)return e.values[a]=i(e),1;if(!(l&&t.docChanged||c&&(t.docChanged||t.selection)||u.some((function(t){return(1&z(e,t))>0}))))return 0;var n=i(e),r=t.startState.values[a];return(s?function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1}var M=j.define({static:!0}),P=function(){function e(t,n,r,i,o){Object(a.a)(this,e),this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}return Object(s.a)(e,[{key:"create",value:function(e){var t=this,n=e.facet(M).find((function(e){return e.field==t}));return((null===n||void 0===n?void 0:n.create)||this.createF)(e)}},{key:"slot",value:function(e){var t=this,n=e[this.id]>>1;return function(e,r){if(!r||r.reconfigured&&null==C(r.startState,t.id))return e.values[n]=t.create(e),1;var i,o=0;r.reconfigured?(i=r.startState.values[C(r.startState,t.id)],o=1):i=r.startState.values[n];var a=t.updateF(i,r);return o||t.compareF(i,a)||(o=1),o&&(e.values[n]=a),o}}},{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(x++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),T=2,A=1,D=0;function R(e){return function(t){return new _(t,e)}}var N={fallback:R(3),default:R(T),extend:R(A),override:R(D)},_=function e(t,n){Object(a.a)(this,e),this.inner=t,this.prec=n},L=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new I(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}(),I=function e(t,n){Object(a.a)(this,e),this.compartment=t,this.inner=n},$=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),l=new Map,c=Object(r.a)(function(e,t,n){var i=[[],[],[],[]],o=new Map;function a(e,s){var l=o.get(e);if(null!=l){if(l>=s)return;var c=i[l].indexOf(e);c>-1&&i[l].splice(c,1),e instanceof I&&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 I){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 _)a(e.inner,e.prec);else if(e instanceof P)i[s].push(e),e.provides&&a(e.provides,s);else if(e instanceof E)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,T),i.reduce((function(e,t){return e.concat(t)}))}(t,n,l));try{for(c.s();!(o=c.n()).done;){var u=o.value;u instanceof P?a.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u)}}catch(b){c.e(b)}finally{c.f()}for(var f=Object.create(null),d=[],h=[],p=function(){var e=m[v];f[e.id]=h.length<<1,h.push((function(t){return e.slot(t)}))},v=0,m=a;v>1;return function(e,n){var l,c=n?n.reconfigured?n.startState.config.address[t.id]:s<<1:null,u=null==c,f=Object(r.a)(a);try{for(f.s();!(l=f.n()).done;)1&z(e,l.value)&&(u=!0)}catch(b){f.e(b)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h>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 B(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var F=j.define(),W=j.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),V=j.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),H=j.define(),Q=j.define(),q=j.define(),U=j.define({combine:function(e){return!!e.length&&e[0]}}),X=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 Y}}]),e}(),Y=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new X(this,e)}}]),e}(),G=function(){function e(t){Object(a.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new K(this,e)}}]),e}(),K=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 G(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}();K.reconfigure=K.define(),K.appendConfig=K.define();var J=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&&w(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 Z(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=ee(e,te(t,o,e.changes.newLength),!0))}return r==e?e:new J(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(H));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:Z(i,a))}}catch(p){o.e(p)}finally{o.f()}if(!0!==i){var s,l;if(!1===i)l=e.changes.invertedDesc,s=d.empty(n.doc.length);else{var c=e.changes.filter(i);s=c.changes,l=c.filtered.invertedDesc}e=new J(n,s,e.selection&&e.selection.map(l),K.mapEffects(e.effects,l),e.annotations,e.scrollIntoView)}for(var u=n.facet(Q),f=u.length-1;f>=0;f--){var h=u[f](e);e=h instanceof J?h:Array.isArray(h)&&1==h.length&&h[0]instanceof J?h[0]:ne(n,ie(h),!1)}return e}(s):s)}J.time=X.define(),J.userEvent=X.define(),J.addToHistory=X.define(),J.remote=X.define();var re=[];function ie(e){return null==e?re:Array.isArray(e)?e:[e]}var oe,ae=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ae||(ae={})),se=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{oe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(fe){}function le(e){return function(t){if(!/\S/.test(t))return ae.Space;if(function(e){if(oe)return oe.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||se.test(n)))return!0}return!1}(t))return ae.Word;for(var n=0;n-1)return ae.Word;return ae.Other}}var ce=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(Object(a.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.applying=null,this.status=t.statusTemplate.slice(),i&&i.startState.config==t)this.values=i.startState.values.slice();else if(this.values=t.dynamicSlots.map((function(e){return null})),i)for(var o in t.address){var s=t.address[o],l=i.startState.config.address[o];null!=l&&0==(1&s)&&(this.values[s>>1]=B(i.startState,l))}this.applying=i,i&&(i._state=this);for(var c=0;c1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return z(this,n),B(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 l.a.of(t.split(this.facet(e.lineSeparator)||c))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(z(this,t),B(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(U)}},{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(F));try{for(a.s();!(n=a.n()).done;){var s,l=n.value,c=Object(r.a)(l(this,t,i));try{for(c.s();!(s=c.n()).done;){var u=s.value;Object.prototype.hasOwnProperty.call(u,e)&&o.push(u[e])}}catch(f){c.e(f)}finally{c.f()}}}catch(f){a.e(f)}finally{a.f()}return o}},{key:"charCategorizer",value:function(e){return le(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 c=Object(l.e)(n,a,!1);if(o(n.slice(c,a))!=ae.Word)break;a=c}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=$.resolve(t.extensions||[],new Map),r=t.doc instanceof l.a?t.doc:l.a.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||c)),i=t.selection?t.selection instanceof O?t.selection:O.single(t.selection.anchor,t.selection.head):O.single(0);return w(i,r.length),n.staticFacet(W)||(i=i.asSingle()),new e(n,r,i)}}]),e}();function ue(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,l=0,c=Object.keys(s);l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},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"},b="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),O="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),k="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),w="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),x="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),j=b&&(w||+b[1]<57)||k&&w,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),y[S]=String.fromCharCode(S);for(var E in g)y.hasOwnProperty(E)||(y[E]=g[E]);function C(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function M(e,t){return!!t&&e.contains(1!=t.nodeType?t.parentNode:t)}function P(e,t){if(!t.anchorNode)return!1;try{return M(e,t.anchorNode)}catch(n){return!1}}function T(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=function(){function e(){Object(f.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}}]),e}(),B=null;function F(e){if(e.setActive)return e.setActive();if(B)return e.focus(B);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==B?{get preventScroll(){return B={preventScroll:!0},!0}}:void 0),!B){B=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=$||($=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}var H=null;function Q(){if(null==H){H=!1;var e=document.createElement("div");try{e.contentEditable="plaintext-only",H="plaintext-only"==e.contentEditable}catch(t){}}return H}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}(),U=[],X=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=null,a=Object(u.a)(this.children);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.dirty){var l=o?o.nextSibling:i.firstChild;s.dom||!l||(null===(n=e.get(l))||void 0===n?void 0:n.parent)||s.reuseDOM(l),s.sync(t),s.dirty=0}t&&t.node==i&&o!=s.dom&&(t.written=!0),G(i,o,s.dom),o=s.dom}}catch(p){a.e(p)}finally{a.f()}var c=o?o.nextSibling:i.firstChild;for(c&&t&&t.node==i&&(t.written=!0);c;)c=Y(c)}else if(1&this.dirty){var f,d=Object(u.a)(this.children);try{for(d.s();!(f=d.n()).done;){var h=f.value;h.dirty&&(h.sync(t),h.dirty=0)}}catch(p){d.e(p)}finally{d.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 l=this.children[a];if(l.dom==r)return s;s+=l.length+l.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,l=n,c=n;st)return u.domBoundsAround(e,t,l);if(f>=e&&-1==r&&(r=s,i=l),l>t&&u.dom.parentNode==this.dom){o=s,a=c;break}c=f,l=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]:U;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new K(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:"get",value:function(e){return e.cmView}}]),e}();function Y(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}function G(e,t,n){var r=t?t.nextSibling:e.firstChild;if(n.parentNode==e)for(;r!=n;)r=Y(r);else e.insertBefore(n,r)}X.prototype.breakAfter=0;var K=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}(),J="undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],Z=Object(l.a)(J,2),ee=Z[0],te=Z[1],ne=/Edge\/(\d+)/.exec(ee.userAgent),re=/MSIE \d/.test(ee.userAgent),ie=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee.userAgent),oe=!!(re||ie||ne),ae=!oe&&/gecko\/(\d+)/i.test(ee.userAgent),se=!oe&&/Chrome\/(\d+)/.exec(ee.userAgent),le="webkitFontSmoothing"in te.documentElement.style,ce=!oe&&/Apple Computer/.test(ee.vendor),ue={mac:/Mac/.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:ce&&(/Mobile\/\w+/.test(ee.userAgent)||ee.maxTouchPoints>2),android:/Android\b/.test(ee.userAgent),webkit:le,safari:ce,webkit_version:le?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=te.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},fe=[],de=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:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}}]),n}(X);de.prototype.children=fe;var he=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:"slice",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 ve(this.dom,e,t)}}]),n}(de),pe=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,l=Object(u.a)(o);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.setParent(Object(r.a)(i))}}catch(d){l.e(d)}finally{l.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){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&i<=0||te&&r.push(i=e&&(o=a),i=c,a++}}catch(d){s.e(d)}finally{s.f()}var f=this.length-e;return this.length=e,o>-1&&this.replaceChildren(o,this.children.length),new n(this.mark,r,f)}},{key:"domAtPos",value:function(e){return be(this.dom,this.children,e)}},{key:"coordsAt",value:function(e,t){return ke(this,e,t)}}]),n}(de);function ve(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?ue.chrome||ue.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=W(e,i,o).getClientRects();if(!s.length)return _;var l=s[(a?a<0:n>=0)?0:s.length-1];return ue.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(s,(function(e){return e.width}))||l),a?L(l,a<0):l}var me=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:"slice",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){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?r:L(r,0==e)}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(de),ge=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 ve(this.widget.text,e,t)}}]),n}(me);function ye(e,t,n,r,i,o){var a,s=e.childCursor(),l=s.findPos(n,1),c=l.i,f=l.off,d=s.findPos(t,-1),h=d.i,p=d.off,v=t-n,m=Object(u.a)(r);try{for(m.s();!(a=m.n()).done;){v+=a.value.length}}catch(x){m.e(x)}finally{m.f()}e.length+=v;var g=e.children;if(h==c&&p){var y=g[h];if(1==r.length&&y.merge(p,f,r[0],i,o))return;if(0==r.length)return void y.merge(p,f,null,i,o);var b=y.slice(f);b.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=b:r.push(b),c++,o=f=0}if(f){var O=g[c];r.length&&O.merge(0,f,r[r.length-1],0,o)?(r.pop(),o=r.length?0:i):O.merge(0,f,null,0,0)}else ci&&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 pe&&i.length&&(r=i[i.length-1])instanceof pe&&r.mark.eq(t.mark)?Oe(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function ke(e,t,n){for(var r=0,i=0;i0?a>=t:a>t)&&(t0)){var l=0;if(a==r){if(o.getSide()<=0)continue;l=n=-o.getSide()}var c=o.coordsAt(t-r,n);return l&&c?L(c,n<0):c}r=a}var u=e.dom.lastChild;if(!u)return e.dom.getBoundingClientRect();var f=T(u);return f[f.length-1]}function we(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 xe(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 Me(e)}},{key:"widget",value:function(e){var t=e.side||0;return e.block&&(t+=200000001*(t>0?1:-1)),new Te(e,t,t,!!e.block,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ae(e),r=n.start,i=n.end;return new Te(e,t?-2e8*(r?2:1):1e8*(r?-1:1),t?2e8*(i?2:1):1e8*(i?1:-1),t,e.widget||null,!0)}},{key:"line",value:function(e){return new Pe(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);Ce.none=m.a.empty;var Me=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,1e8*(o?-1:1),1e8*(a?1:-1),null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Object(d.a)(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&xe(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}(Ce);Me.prototype.point=!1;var Pe=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,-1e8,-1e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&xe(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}(Ce);Pe.prototype.mapMode=h.h.TrackBefore,Pe.prototype.point=!0;var Te=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e,r,i,o,a,s){var l;return Object(f.a)(this,n),(l=t.call(this,r,i,a,e)).block=o,l.isReplace=s,l.mapMode=o?r<0?h.h.TrackBefore:h.h.TrackAfter:h.h.TrackDel,l}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}(Ce);function Ae(e){var t=e.inclusiveStart,n=e.inclusiveEnd;return null==t&&(t=e.inclusive),null==n&&(n=e.inclusive),{start:t||!1,end:n||!1}}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)}Te.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),ye(this,e,t,r?r.children:Ne,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].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){xe(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;t&&(this.attrs=we(t,this.attrs||{}))}},{key:"domAtPos",value:function(e){return be(this.dom,this.children,e)}},{key:"sync",value:function(e){(!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&&(je(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 t=this.dom.lastChild;t&&X.get(t)instanceof pe;)t=t.lastChild;if(!t||"BR"!=t.nodeName&&X.get(t)instanceof me&&(!ue.ios||!this.children.some((function(e){return e instanceof he})))){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof he))return null;var i=T(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 ke(this,e,t)}},{key:"match",value:function(e){return!1}},{key:"type",get:function(){return Ee.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}(X),Ne=[],_e=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.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e,512);this.getLine().append(this.wrapMarks(new he(this.text.slice(this.textOff,this.textOff+s)),t),n),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 Te)if(n.block){var a=n.type;a!=Ee.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new _e(n.widget||new Ie("div"),o,a))}else{var s=this.wrapMarks(me.create(n.widget||new Ie("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,r,i){var o=new e(t,n,r);return o.openEnd=m.a.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),e}(),Ie=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)).tag=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}}]),n}(Se),$e=[],ze=h.g.define(),Be=h.g.define(),Fe=h.g.define(),We=h.g.define(),Ve=h.g.define(),He=h.g.define(),Qe=h.j.define({map:function(e,t){return e.map(t)}});function qe(e,t,n){var r=e.facet(We);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}var Ue=h.g.define({combine:function(e){return!e.length||e[0]}}),Xe=function e(t,n){Object(f.a)(this,e),this.field=t,this.get=n},Ye=function(){function e(){Object(f.a)(this,e)}return Object(d.a)(e,[{key:"from",value:function(e){return new Xe(this,e)}}],[{key:"define",value:function(){return new e}}]),e}();Ye.decorations=Ye.define(),Ye.atomicRanges=Ye.define(),Ye.scrollMargins=Ye.define();var Ge=0,Ke=h.g.define(),Je=function(){function e(t,n,r){Object(f.a)(this,e),this.id=t,this.create=n,this.fields=r,this.extension=Ke.of(this)}return Object(d.a)(e,null,[{key:"define",value:function(t,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var l,c=Object(u.a)(Array.isArray(o)?o:[o]);try{for(c.s();!(l=c.n()).done;){var f=l.value;s.push(f)}}catch(d){c.e(d)}finally{c.f()}}return i&&s.push(Ze.from((function(e){return{plugin:e,handlers:i}}))),a&&s.push(Ye.decorations.from(a)),new e(Ge++,t,s)}},{key:"fromClass",value:function(t,n){return e.define((function(e){return new t(e)}),n)}}]),e}(),Ze=Ye.define(),et=function(){function e(t){Object(f.a)(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return Object(d.a)(e,[{key:"takeField",value:function(e,t){var n,r=Object(u.a)(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==e&&t.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}},{key:"update",value:function(t){if(this.value){if(this.mustUpdate){var n=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(n)}catch(r){if(qe(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}return e.dummy}}}else try{this.value=this.spec.create(t)}catch(r){return qe(t.state,r,"CodeMirror plugin crashed"),e.dummy}return this}},{key:"destroy",value:function(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(n){qe(e.state,n,"CodeMirror plugin crashed")}}}]),e}();et.dummy=new et(Je.define((function(){return{}})));var tt=h.g.define({combine:function(e){return e.reduce((function(e,t){return we(t,e)}),{})}}),nt=h.g.define({combine:function(e){return e.reduce((function(e,t){return we(t,e)}),{})}}),rt=h.g.define(),it=h.g.define(),ot=function(){function e(t,n,r,i){Object(f.a)(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return Object(d.a)(e,[{key:"join",value:function(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}},{key:"addToSet",value:function(e){for(var t=e.length,n=this;t>0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;o+=2}if(!l)return r;new e(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}]),e}(),at=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$e;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(c){o.e(c)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new ot(e,t,n,r))})),this.changedRanges=s;var l=t.hasFocus;l!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=l,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.transactions.some((function(e){return e.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}(),st=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(f.a)(this,n),(i=t.call(this)).view=e,i.compositionDeco=Ce.none,i.decorations=[],i.minWidth=0,i.minWidthFrom=0,i.minWidthTo=0,i.impreciseAnchor=null,i.impreciseHead=null,i.setDOM(e.contentDOM),i.children=[new Re],i.children[0].setParent(Object(r.a)(i)),i.updateInner([new ot(0,0,0,e.state.doc.length)],i.updateDeco(),0),i}return Object(d.a)(n,[{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}},{key:"update",value:function(e){var t=this,n=e.changedRanges;this.minWidth>0&&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=0),this.view.inputState.composing<0?this.compositionDeco=Ce.none:e.transactions.length&&(this.compositionDeco=function(e,t){var n=e.observer.selectionRange,r=n.focusNode&&ft(n.focusNode,n.focusOffset,0);if(!r)return Ce.none;var i,o,a=e.docView.nearest(r),s=r;if(a instanceof de){for(;a.parent instanceof de;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Re))return Ce.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!X.get(l);)l=l.previousSibling;i=o=l?X.get(l).posAtEnd:a.posAtStart}var c=t.mapPos(i,1),u=Math.max(c,t.mapPos(o,-1)),f=r.nodeValue,d=e.state;if(u-c=this.view.viewport.from&&e.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(r,s),!1):(this.updateInner(n,o,e.startState.doc.length,r,s),!0)}},{key:"updateInner",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(e,t,n);var a=this.view.observer;a.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var e=ue.chrome||ue.ios?{node:a.selectionRange.focusNode,written:!1}:void 0;r.sync(e),r.dirty=0,e&&(e.written||a.selectionRange.focusNode!=e.node)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}));var s=[];if(this.view.viewport.from||this.view.viewport.to=0?e[i]:null;if(!o)break;var a=o.fromA,s=o.toA,l=o.fromB,c=o.toB,u=Le.build(this.view.state.doc,l,c,t),f=u.content,d=u.breakAtStart,h=u.openStart,p=u.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,y=r.findPos(a,-1),b=y.i,O=y.off;this.replaceRange(b,O,m,g,f,d,h,p)}}},{key:"replaceRange",value:function(e,t,n,r,i,o,a,s){var l=this.children[e],c=i.length?i[i.length-1]:null,u=c?c.breakAfter:o;if(e!=n||o||u||!(i.length<2)||!l.merge(t,r,i.length?c:null,0==t,a,s)){var f=this.children[n];for(r0&&(!o&&i.length&&l.merge(t,l.length,i[0],!1,a,0)?l.breakAfter=i.shift().breakAfter:(t0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!n&&!this.mayControlSelection()||ue.ios&&this.view.inputState.rapidCompositionStart)){var r=this.view.state.selection.main,i=this.domAtPos(r.anchor),o=r.empty?i:this.domAtPos(r.head);if(ue.gecko&&r.empty&<(i)){var a=document.createTextNode("");this.view.observer.ignore((function(){return i.node.insertBefore(a,i.node.childNodes[i.offset]||null)})),i=o=new q(a,0),t=!0}var s=this.view.observer.selectionRange;!t&&s.focusNode&&A(i.node,i.offset,s.anchorNode,s.anchorOffset)&&A(o.node,o.offset,s.focusNode,s.focusOffset)||(this.view.observer.ignore((function(){var t=C(e.root);if(r.empty){if(ue.gecko){var n=dt(i.node,i.offset);if(n&&3!=n){var a=ft(i.node,i.offset,1==n?1:-1);a&&(i=new q(a,1==n?0:a.nodeValue.length))}}t.collapse(i.node,i.offset),null!=r.bidiLevel&&null!=s.cursorBidiLevel&&(s.cursorBidiLevel=r.bidiLevel)}else if(t.extend)t.collapse(i.node,i.offset),t.extend(o.node,o.offset);else{var l=document.createRange();if(r.anchor>r.head){var c=[o,i];i=c[0],o=c[1]}l.setEnd(o.node,o.offset),l.setStart(i.node,i.offset),t.removeAllRanges(),t.addRange(l)}})),this.view.observer.setSelectionRange(i,o)),this.impreciseAnchor=i.precise?null:new q(s.anchorNode,s.anchorOffset),this.impreciseHead=o.precise?null:new q(s.focusNode,s.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.view.composing){var e=this.view.state.selection.main,t=C(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(Ue)?this.root.activeElement==this.dom:P(this.dom,this.view.observer.selectionRange)}},{key:"nearest",value:function(e){for(var t=e;t;){var n=X.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!=Ee.WidgetBefore&&i.type!=Ee.WidgetAfter&&(!r||2==t||this.children[r-1].breakAfter||this.children[r-1].type==Ee.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=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;ar)break;if(o>=n){e.push(s.dom.getBoundingClientRect().height);var c=s.dom.scrollWidth;c>i&&(this.minWidth=i=c,this.minWidthFrom=o,this.minWidthTo=l)}o=l+s.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof Re){var i=r.measureTextSize();if(i)return i}}}catch(l){n.e(l)}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=T(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 K(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.lineAt(o,0).bottom-t.lineAt(n,0).top;e.push(Ce.replace({widget:new ct(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Ce.set(e)}},{key:"updateDeco",value:function(){return this.decorations=[].concat(Object(c.a)(this.view.pluginField(Ye.decorations)),Object(c.a)(this.view.state.facet(rt)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco])}},{key:"scrollRangeIntoView",value:function(e){var t,n=this.coordsAt(e.head,e.empty?e.assoc:e.head>e.anchor?-1:1);if(n){!e.empty&&(t=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});var r,i=0,o=0,a=0,s=0,l=Object(u.a)(this.view.pluginField(Ye.scrollMargins));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c){var f=c.left,d=c.right,h=c.top,p=c.bottom;null!=f&&(i=Math.max(i,f)),null!=d&&(o=Math.max(o,d)),null!=h&&(a=Math.max(a,h)),null!=p&&(s=Math.max(s,p))}}}catch(v){l.e(v)}finally{l.f()}!function(e,t,n){for(var r=e.ownerDocument,i=r.defaultView,o=e.parentNode;o;)if(1==o.nodeType){var a=void 0,s=o==r.body;if(s)a=I(i);else{if(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth){o=o.parentNode;continue}var l=o.getBoundingClientRect();a={left:l.left,right:l.left+o.clientWidth,top:l.top,bottom:l.top+o.clientHeight}}var c=0,u=0;if(t.top0&&t.bottom>a.bottom+u&&(u=t.bottom-a.bottom+u+5)):t.bottom>a.bottom&&(u=t.bottom-a.bottom+5,n<0&&t.top-u0&&t.right>a.right+c&&(c=t.right-a.right+c+5)):t.right>a.right&&(c=t.right-a.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 dt(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t=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}(),Tt=[];function At(e,t){var n=e.length,r=t==vt?1:2,i=t==vt?2:1;if(!e||1==r&&!Mt.test(e))return Dt(n);for(var o=0,a=r,s=r;o=0;w-=3)if(kt[w+1]==-g){var x=kt[w+2],j=2&x?r:4&x?1&x?i:r:0;j&&(Tt[b]=Tt[kt[w]]=j),O=w;break}}else{if(189==kt.length)break;kt[O++]=b,kt[O++]=m,kt[O++]=k}else if(2==(y=Tt[b])||1==y){var S=y==r;k=S?0:1;for(var E=O-3;E>=0;E-=3){var C=kt[E+2];if(2&C)break;if(S)kt[E+2]|=2;else{if(4&C)break;kt[E+2]|=4}}}for(var M=0;M_;){for(var $=I,z=2!=Tt[--I];I>_&&z==(2!=Tt[I-1]);)I--;R.push(new Pt(I,$,z?2:1))}else R.push(new Pt(_,N,0))}else for(var B=0;Be?t.left-e:Math.max(0,e-t.right)}function Lt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function It(e,t){return e.topt.top+1}function $t(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Bt(e,t,n){for(var r,i,o,a,s,l,c,u,f=e.firstChild;f;f=f.nextSibling)for(var d=T(f),h=0;hm||a==m&&o>v)&&(r=f,i=p,o=v,a=m),0==v?n>p.bottom&&(!c||c.bottomp.top)&&(l=f,u=p):c&&It(c,p)?c=zt(c,p.bottom):u&&It(u,p)&&(u=$t(u,p.top))}if(c&&c.bottom>=n?(r=s,i=c):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?Ft(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)}:Bt(r,g,n)}function Ft(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(ue.chrome||ue.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 Wt(e,t,n){for(var r,i=t.x,o=t.y,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=e.contentDOM.getBoundingClientRect(),l=e.defaultLineHeight/2,c=!1;;){if((r=e.blockAtHeight(o,s.top)).top>o||r.bottomo?-1:1,o=Math.min(r.bottom-l,Math.max(r.top+l,o)),c)return n?null:0;c=!0}if(r.type==Ee.Text)break;o=a>0?r.bottom+l:r.top-l}var u=r.from;if(i=Math.max(s.left+1,Math.min(s.right-1,i)),ue.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:Vt(e,s,r,i,o);var f,d=e.dom.ownerDocument,h=(e.root.elementFromPoint?e.root:d).elementFromPoint(i,o),p=-1;if(h&&e.contentDOM.contains(h)&&!(e.docView.nearest(h)instanceof me))if(d.caretPositionFromPoint){var v=d.caretPositionFromPoint(i,o);v&&(f=v.offsetNode,p=v.offset)}else if(d.caretRangeFromPoint){var m=d.caretRangeFromPoint(i,o);m&&(f=m.startContainer,p=m.startOffset,ue.safari&&Ht(f,p,i)&&(f=void 0))}if(!f||!e.docView.dom.contains(f)){var g=Re.find(e.docView,u),y=Bt(g.dom,i,o);f=y.node,p=y.offset}return e.docView.posFromDOM(f,p)}function Vt(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 Ht(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 Qt(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==pt.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 l=Re.find(e.docView,t.head),c=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return h.e.cursor(c,n?-1:1)}function qt(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var l=Nt(i,o,e.textDirection,a,n),c=Rt;if(!l){if(i.number==(n?e.state.doc.lines:1))return a;c="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),l=h.e.cursor(n?i.from:i.to)}if(s){if(!s(c))return a}else{if(!r)return l;s=r(c)}a=l}}function Ut(e,t,n){for(var r=e.pluginField(Ye.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 Xt=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.pendingIOSKey=null,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=Jt[e];t.contentDOM.addEventListener(e,(function(i){"keydown"==e&&n.keydown(t,i)||Kt(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 Jt)r(i);this.notifiedFocused=t.hasFocus,this.ensureHandlers(t),ue.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(Ze),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){Kt(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in o.handlers)a(s)}}catch(l){i.e(l)}finally{i.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=Object(u.a)(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[e],s=!1;if(a){try{s=a.call(o.plugin,n,t)}catch(l){qe(t.state,l)}if(s||n.defaultPrevented)return ue.android&&"keydown"==e&&13==n.keyCode&&t.observer.flushSoon(),!0}}}catch(c){i.e(c)}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){qe(e.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"keydown",value:function(e,t){var n=this;return this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),!!this.screenKeyEvent(e,t)||!(!ue.ios||13!=t.keyCode&&8!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey||t.synthetic)&&(this.pendingIOSKey=13==t.keyCode?"enter":"backspace",setTimeout((function(){return n.flushIOSKey(e)}),250),!0)}},{key:"flushIOSKey",value:function(e){if(!this.pendingIOSKey)return!1;var t=e.contentDOM,n=this.pendingIOSKey;return this.pendingIOSKey=null,"enter"==n?V(t,"Enter",13):V(t,"Backspace",8)}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(ue.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}(n,r)&&null,!1===this.dragging&&(r.preventDefault(),this.select(r))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(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.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0})}},{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 Kt(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=X.get(r))&&n.ignoreEvent(t))return!1;return!0}var Jt=Object.create(null),Zt=ue.ie&&ue.ie_version<15||ue.ios&&ue.webkit_version<604;function en(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length,s=null!=hn&&r.selection.ranges.every((function(e){return e.empty}))&&hn==o.toString();if(s){var l=-1;n=r.changeByRange((function(e){var n=r.doc.lineAt(e.from);if(n.from==l)return{range:e};l=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})}Jt.keydown=function(e,t){e.inputState.setSelectionOrigin("select")};var tn=0;function nn(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 l=r(i.text.slice(a,s));a>0;){var c=Object(p.e)(i.text,a,!1);if(r(i.text.slice(c,a))!=l)break;a=c}for(;sDate.now()-2e3)){var n,r=null,i=Object(u.a)(e.state.facet(Fe));try{for(i.s();!(n=i.n()).done;){if(r=(0,n.value)(e,t))break}}catch(o){i.e(o)}finally{i.f()}r||0!=t.button||(r=function(e,t){var n=sn(e,t),r=function(e){if(!ln)return e.detail;var t=cn,n=fn;return cn=e,fn=Date.now(),un=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(un+1)%3:1}(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.changes&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes),a=null)},get:function(t,s,l){var c;if(a&&t.clientX==a.clientX&&t.clientY==a.clientY?c=o:(c=o=sn(e,t),a=t),!c||!n)return i;var u=nn(e,c.pos,c.bias,r);if(n.pos!=c.pos&&!s){var f=nn(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},on=function(e,t,n){return rn(t,n)&&e>=n.left&&e<=n.right};function an(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&&on(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&on(n,r,s)?1:a&&rn(r,a)?-1:1}function sn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:an(e,n,t.clientX,t.clientY)}}var ln=ue.ie&&ue.ie_version<=11,cn=null,un=0,fn=0;function dn(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},l=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}Jt.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")},Jt.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&&dn(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;sl&&(n.push(d.text),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),l=d.number}}catch(h){c.e(h)}finally{c.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){hn=o?r:null;var a=Zt?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"})}},Jt.focus=Jt.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},Jt.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},Jt.compositionstart=Jt.compositionupdate=function(e){null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.docView.compositionDeco.size&&(e.observer.flush(),pn(e,!0)),e.inputState.composing=0)},Jt.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((function(){e.inputState.composing<0&&pn(e,!1)}),50)},Jt.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()};var vn=["pre-wrap","normal","pre-line"],mn=function(){function e(){Object(f.a)(this,e),this.doc=p.a.empty,this.lineWrapping=!1,this.direction=pt.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:"mustRefresh",value:function(e,t,n){for(var r=!1,i=0;i-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(e,t,n,r,i,o){var a=vn.indexOf(e)>-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 l=0;l2&&void 0!==arguments[2]?arguments[2]:2;Object(f.a)(this,e),this.length=t,this.height=n,this.flags=r}return Object(d.a)(e,[{key:"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)>1e-4&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,l=a.toA,c=a.fromB,u=a.toB,f=i.lineAt(s,bn.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,bn.ByPosNoHeight,t,0,0);for(u+=d.to-l,l=d.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,c=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}(On),wn=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,Ee.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 xn&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):On.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}(kn),xn=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,l=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),c=t.line(o+l),u=c.from,f=c.length;return new yn(u,f,n+s*l,s,Ee.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==bn.ByHeight)return this.blockAt(e,n,r,i);if(t==bn.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new yn(a,s-a,0,0,Ee.Text)}var l=this.lines(n,i),c=l.firstLine,u=l.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new yn(d,h,r+u*(p-c),u,Ee.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,l=a.lineHeight,c=Math.max(e,i),u=Math.min(i+this.length,t);c<=u;){var f=n.lineAt(c);c==e&&(r+=l*(f.number-s)),o(new yn(f.from,f.length,r,l,Ee.Text)),r+=l,c=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 On.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);for(i.from>t&&a.push(new n(i.from-t-1).updateHeight(e,t));s<=o&&i.more;){var l=e.doc.lineAt(s).length;a.length&&a.push(null);var c=new wn(l,i.heights[i.index++]);c.outdated=!1,a.push(c),s+=l+1}return s<=o&&a.push(null,new n(o-s).updateHeight(e,s)),e.heightChanged=!0,On.of(a)}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}(On),jn=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 l;var c=t==bn.ByPosNoHeight?bn.ByPosNoHeight:bn.ByPos;return s?l.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,i).join(l)}},{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 l=this.lineAt(s,bn.ByPos,n,r,i);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.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 l=o.value;i.push(l)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&Sn(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?On.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}(On);function Sn(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof xn&&(r=e[t+1])instanceof xn&&e.splice(t-1,3,new xn(n.length+1+r.length))}var En=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 wn?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new wn(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 wn(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new xn(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 wn)return e;var t=new wn(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Ee.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Ee.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 wn||this.isCovered?(this.writtenTo=t&&i<=n}))){var o=e.lineAt(i,0),a=o.from,s=o.to;t.push(new Dn(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?Ln:new In(this.heightOracle.doc,this.heightMap,this.viewports)}},{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(rt),i=e.changedRanges,o=ot.extendWithRanges(i,Cn(e.startState.facet(rt),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.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t)),this.viewport=s,this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTo=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,t){var n=e.dom,r="",i=pt.LTR,o=0;if(!t){var a=window.getComputedStyle(n);r=a.whiteSpace,i="rtl"==a.direction?pt.RTL:pt.LTR;var s=parseInt(a.paddingTop)||0,l=parseInt(a.paddingBottom)||0;this.paddingTop==s&&this.paddingBottom==l||(o|=8,this.paddingTop=s,this.paddingBottom=l)}var c=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.parentNode;s;)if(1==s.nodeType){var l=window.getComputedStyle(s);if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=l.overflow){var c=s.getBoundingClientRect();r=Math.max(r,c.left),i=Math.min(i,c.right),o=Math.max(o,c.top),a=Math.min(a,c.bottom)}s="absolute"==l.position||"fixed"==l.position?s.offsetParent:s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+t),bottom:a-(n.top+t)}}(n,this.paddingTop),u=c.top-this.pixelViewport.top,f=c.bottom-this.pixelViewport.bottom;if(this.pixelViewport=c,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var d=e.measureVisibleLineHeights(),h=!1,p=0,v=this.heightOracle;if(!t){var m=e.dom.clientWidth;if(v.mustRefresh(d,r,i)||v.lineWrapping&&Math.abs(m-this.contentWidth)>v.charWidth){var g=e.measureTextSize(),y=g.lineHeight,b=g.charWidth;(h=v.refresh(r,i,y,b,m/b,d))&&(e.minWidth=0,o|=8)}this.contentWidth!=m&&(this.contentWidth=m,o|=8),u>0&&f>0?p=Math.max(u,f):u<0&&f<0&&(p=Math.min(u,f))}return v.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(v,0,h,new gn(this.viewport.from,d)),v.heightChanged&&(o|=2),(!this.viewportIsAppropriate(this.viewport,p)||this.scrollTo&&(this.scrollTo.headthis.viewport.to))&&(this.viewport=this.getViewport(p,this.scrollTo)),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&this.updateLineGaps(this.ensureLineGaps(h?[]:this.lineGaps)),o|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.enforceCursorAssoc()),o}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top,0)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom,0)}},{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 Dn(r.lineAt(o-1e3*n,bn.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),bn.ByHeight,i,0,0).to);if(t)if(t.heads.to){var c=r.lineAt(t.head,bn.ByPos,i,0,0).bottom;s=new Dn(r.lineAt(c-(a-o)-500,bn.ByHeight,i,0,0).from,r.lineAt(c+500,bn.ByHeight,i,0,0).to)}return s}},{key:"mapViewport",value:function(e,t){var n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Dn(this.heightMap.lineAt(n,bn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,bn.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(e){var t=e.from,n=e.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(t,bn.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,bn.ByPos,this.state.doc,0,0),s=a.bottom,l=this.visibleTop,c=this.visibleBottom;return(0==t||o<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=c+Math.max(10,Math.min(r,250)))&&o>l-2e3&&si&&(r.push({from:i,to:e}),o+=e-i),i=t}},20),i=r.from&&(o=l.from),l.from<=r.to&&l.to>=a&&(a=l.to);var c=o-1e4,u=a+1e4;c>r.from+5e3&&n.push(_n(e,(function(e){return e.from==r.from&&e.to>c-5e3&&e.tou-5e3&&e.from=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,l=a.to-s;if(i<=l)return s+i;i-=l}}function Nn(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(l){i.e(l)}finally{i.f()}return r/e.total}function _n(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()}}var Ln={toDOM:function(e){return e},fromDOM:function(e){return e},scale:1},In=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,bn.ByPos,t,0,0).top,s=n.lineAt(o,bn.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,l=Object(u.a)(this.viewports);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.domTop=a+(c.top-o)*this.scale,a=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}}catch(d){l.e(d)}finally{l.f()}}return Object(d.a)(e,[{key:"toDOM",value:function(e,t){e-=t;for(var n=0,r=0,i=0;;n++){var o=n-1}}),Fn=v.a.newName(),Wn=v.a.newName(),Vn=v.a.newName(),Hn={"&light":"."+Wn,"&dark":"."+Vn};function Qn(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 qn=Qn("."+Fn,{"&":{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"},".cm-lineWrapping":{whiteSpace:"pre-wrap",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"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&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"}},Hn),Un={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Xn=ue.ie&&ue.ie_version<=11,Yn=function(){function e(t,n,r){var i=this;Object(f.a)(this,e),this.view=t,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new z,this.delayedFlush=-1,this.queue=[],this.lastFlush=0,this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this._selectionRange=null,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()}i._selectionRange=null,(ue.ie&&ue.ie_version<=11||ue.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()})),Xn&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(e){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.intersecting!=i.view.inView&&i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((function(e){e[e.length-1].intersectionRatio>0&&i.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll()}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&this.flush(),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){this.lastFlush=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var e=this;if(!(this.delayedFlush>=0)){this.lastFlush=Date.now();var t,n=this.queue,r=Object(u.a)(this.observer.takeRecords());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(m){r.e(m)}finally{r.f()}n.length&&(this.queue=[]);var o=this.selectionRange,a=!this.ignoreSelection.eq(o)&&P(this.dom,o);if(0!=n.length||a){var s,l=-1,c=-1,f=!1,d=Object(u.a)(n);try{for(d.s();!(s=d.n()).done;){var h=s.value,p=this.readMutation(h);p&&(p.typeOver&&(f=!0),-1==l?(l=p.from,c=p.to):(l=Math.min(p.from,l),c=Math.max(p.to,c)))}}catch(m){d.e(m)}finally{d.f()}var v=this.view.state;(l>-1||a)&&this.onChange(l,c,f),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return e.view.docView.sync()})),this.view.docView.dirty=0),a&&this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){var n=Gn(t,e.previousSibling||e.target.previousSibling,-1),r=Gn(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(){this.stop(),this.intersection&&this.intersection.disconnect(),this.gapIntersection&&this.gapIntersection.disconnect();var e,t=Object(u.a)(this.scrollTargets);try{for(t.s();!(e=t.n()).done;){e.value.removeEventListener("scroll",this.onScroll)}}catch(n){t.e(n)}finally{t.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),e}();function Gn(e,t,n){for(;t;){var r=X.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 Kn(e,t,n,r){var i,o,a,s=e.state.selection.main;if(t>-1&&!e.state.readOnly&&(a=e.docView.domBoundsAround(t,n,0))){var l=a,c=l.from,u=l.to,f=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 er(r,i)),o==r&&a==i||t.push(new er(o,a)));return t}(e),d=new Jn(f,e);d.readRange(a.startDOM,a.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}(f,c);var p=s.from,v=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||ue.android&&d.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,u),d.text,p-c,v);m&&(i={from:c+m.from,to:c+m.toA,insert:e.state.toText(d.text.slice(m.from,m.toB))})}else if(e.hasFocus||!e.state.facet(Ue)){var g=e.observer.selectionRange,y=e.docView,b=y.impreciseHead,O=y.impreciseAnchor,k=b&&b.node==g.focusNode&&b.offset==g.focusOffset||!M(e.contentDOM,g.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(g.focusNode,g.focusOffset),w=O&&O.node==g.anchorNode&&O.offset==g.anchorOffset||!M(e.contentDOM,g.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(g.anchorNode,g.anchorOffset);k==s.head&&w==s.anchor||(o=h.e.single(w,k))}if(i||o)if(!i&&r&&!s.empty&&o&&o.main.empty?i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}:i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4&&(i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,s.to))}),i){var x=e.state;if(ue.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&V(e.contentDOM,"Enter",13)||i.from==s.from-1&&i.to==s.to&&0==i.insert.length&&V(e.contentDOM,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&V(e.contentDOM,"Delete",46))||ue.ios&&e.inputState.flushIOSKey(e))return;var j,S=i.insert.toString();if(e.state.facet(He).some((function(t){return t(e,i.from,i.to,S)})))return;if(e.inputState.composing>=0&&e.inputState.composing++,i.from>=s.from&&i.to<=s.to&&i.to-i.from>=(s.to-s.from)/3&&(!o||o.main.empty&&o.main.from==i.from+i.insert.length)){var E=s.fromi.to?x.sliceDoc(i.to,s.to):"";j=x.replaceSelection(e.state.toText(E+i.insert.sliceString(0,void 0,e.state.lineBreak)+C))}else{var P=x.changes(i);j={changes:P,selection:o&&!x.selection.main.eq(o.main)&&o.main.to<=P.newLength?x.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(s)){var A=!1,D="select";e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(A=!0),D=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:A,userEvent:D})}}var Jn=function(){function e(t,n){Object(f.a)(this,e),this.points=t,this.view=n,this.text="",this.lineBreak=n.state.lineBreak}return Object(d.a)(e,[{key:"readRange",value:function(e,t){if(e){for(var n=e.parentNode,r=e;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==t)break;var o=X.get(r),a=X.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:Zn(r))||Zn(i)&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=this.lineBreak),r=i}this.findPointBefore(n,t)}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t,n=X.get(e),r=n&&n.overrideDOMText;null!=r?t=r.sliceString(0,void 0,this.lineBreak):3==e.nodeType?t=e.nodeValue:"BR"==e.nodeName?t=e.nextSibling?this.lineBreak:"":1==e.nodeType&&this.readRange(e.firstChild,null),null!=t&&(this.findPointIn(e,t.length),this.text+=t,ue.chrome&&13==this.view.inputState.lastKeyCode&&!e.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}},{key:"findPointBefore",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t))}}catch(o){r.e(o)}finally{r.f()}}}]),e}();function Zn(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var er=function e(t,n){Object(f.a)(this,e),this.node=t,this.offset=n,this.pos=-1};var tr=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.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||document,this.viewState=new An(n.state||h.f.create()),this.plugins=this.state.facet(Ke).map((function(e){return new et(e).update(t)})),this.observer=new Yn(this,(function(e,n,r){Kn(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.observer.intersecting&&t.measure()})),this.inputState=new Xt(this),this.docView=new st(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,or(),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(b){o.e(b)}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 at(this,i,e);var s=null;try{this.updateState=2;var l,c=Object(u.a)(e);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(s&&(s=s.map(f.changes)),f.scrollIntoView){var d=f.state.selection.main;s=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=m.value)}}catch(b){v.e(b)}finally{v.f()}}}catch(b){c.e(b)}finally{c.f()}this.viewState.update(t,s),this.bidiCache=lr.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),r=this.docView.update(t),this.state.facet(it)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(e)}finally{this.updateState=0}if((r||s||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!t.empty){var g,y=Object(u.a)(this.state.facet(Ve));try{for(y.s();!(g=y.n()).done;){(0,g.value)(t)}}catch(b){y.e(b)}finally{y.f()}}}}},{key:"setState",value:function(e){var t=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=e;else{this.updateState=2;try{var n,r=Object(u.a)(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new An(e),this.plugins=e.facet(Ke).map((function(e){return new et(e).update(t)})),this.docView=new st(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(Ke),n=e.state.facet(Ke);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 et(a));else{var l=this.plugins[s];l.mustUpdate=e,i.push(l)}}}catch(m){o.e(m)}finally{o.f()}var c,f=Object(u.a)(this.plugins);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.mustUpdate!=e&&d.destroy(this)}}catch(m){f.e(m)}finally{f.f()}this.plugins=i,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=-1,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.docView,r>0);if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTo)break;if(r>5){console.warn("Viewport failed to stabilize");break}var a=[];if(!(4&o)){var s=[a,this.measureRequests];this.measureRequests=s[0],a=s[1]}var l=a.map((function(t){try{return t.read(e)}catch(n){return qe(e.state,n),sr}})),c=new at(this,this.state);c.flags|=o,n?n.flags|=o:n=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c)),this.updateAttrs(),o&&this.docView.update(c);for(var f=0;f-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.viewState.lineAt(e,t)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"moveByChar",value:function(e,t,n){return Ut(this,e,qt(this,e,t,n))}},{key:"moveByGroup",value:function(e,t){var n=this;return Ut(this,e,qt(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 Qt(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return Ut(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,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i);if(c)null==s&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{var u=e.viewState.lineAt(i,e.dom.getBoundingClientRect().top);null==s&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-u.from))),a=o<0?u.top:u.bottom}for(var f=l.left+s,d=null!==r&&void 0!==r?r:e.defaultLineHeight>>1,p=0;;p+=10){var v=a+(d+p)*o,m=Wt(e,{x:f,y:v},!1,o);if(vl.bottom||(o<0?mi))return h.e.cursor(m,void 0,void 0,s)}}(this,e,t,n))}},{key:"scrollPosIntoView",value:function(e){this.viewState.scrollTo=h.e.cursor(e),this.requestMeasure()}},{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(),Wt(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[Pt.find(i,e-r.from,-1,t)];return L(n,o.dir==pt.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>nr)return Dt(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=At(e.text,this.textDirection);return this.bidiCache.push(new lr(e.from,e.to,n,o)),o}},{key:"hasFocus",get:function(){var e;return(document.hasFocus()||ue.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(){F(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 Je.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[zn.of(n),it.of(Qn(".".concat(n),e))];return t&&t.dark&&r.push(Bn.of(!0)),r}},{key:"baseTheme",value:function(e){return h.i.fallback(it.of(Qn("."+Fn,e,Hn)))}}]),e}();tr.scrollTo=Qe,tr.styleModule=it,tr.inputHandler=He,tr.exceptionSink=We,tr.updateListener=Ve,tr.editable=Ue,tr.mouseSelectionStyle=Fe,tr.dragMovesSelection=Be,tr.clickAddsSelectionRange=ze,tr.decorations=rt,tr.contentAttributes=nt,tr.editorAttributes=tt,tr.lineWrapping=tr.contentAttributes.of({class:"cm-lineWrapping"}),tr.announce=h.j.define();var nr=4096;function rr(e,t){return null==e?t.getBoundingClientRect().top:e}var ir=-1;function or(){window.addEventListener("resize",(function(){-1==ir&&(ir=setTimeout(ar,50))}))}function ar(){ir=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t1&&void 0!==arguments[1]?arguments[1]:cr,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)),l=t.split(/ (?!$)/).map((function(e){return ur(e,n)})),c=function(t){var n=l.slice(0,t).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=gr={view:t,prefix:n,scope:e};return setTimeout((function(){gr==r&&(gr=null)}),yr),!0}]})},u=1;u0&&void 0!==arguments[0]?arguments[0]:{};return[kr.of(e),jr,Er]}var xr=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}(),jr=Je.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(kr).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.startState.facet(kr)!=e.state.facet(kr);(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(kr),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==pt.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),s=Cr(e),l=window.getComputedStyle(o.firstChild),c=a.left+parseInt(l.paddingLeft),f=a.right-parseInt(l.paddingRight),d=Pr(e,n),h=Pr(e,r),p=d.type==Ee.Text?d:null,v=h.type==Ee.Text?h:null;e.lineWrapping&&(p&&(p=Mr(e,n,p)),v&&(v=Mr(e,r,v)));if(p&&v&&p.from==v.from)return O(k(t.from,t.to,p));var m=p?k(t.from,null,p):w(d,!1),g=v?k(null,t.to,v):w(h,!0),y=[];return(p||d).to<(v||h).from-1?y.push(b(c,m.bottom,f,g.top)):m.bottomh&&m.from=y)break;j>g&&l(Math.max(x,g),null==t&&x<=h,Math.min(j,y),null==n&&j>=p,w.dir)}}catch(S){k.e(S)}finally{k.f()}if((g=O.to+1)>=y)break}}}catch(S){v.e(S)}finally{v.f()}return 0==s.length&&l(h,null==t,p,null==n,e.textDirection),{top:o,bottom:a,horizontal:s}}function w(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,l=s==n.selection.main;if(s.empty?!l||Or:r.drawRangeCursor){var c=Tr(this.view,s,l);c&&o.push(c)}}}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 l,c=Object(u.a)(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;this.cursorLayer.appendChild(f.draw())}}catch(d){c.e(d)}finally{c.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}()),Sr={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Or&&(Sr[".cm-line"].caretColor="transparent !important");var Er=h.i.override(tr.theme(Sr));function Cr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==pt.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function Mr(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:Ee.Text}}function Pr(e,t){var n=e.visualLineAt(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==Ee.Text))return o}}catch(a){i.e(a)}finally{i.f()}}return n}function Tr(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=Cr(e);return new xr(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 Ar(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 Dr=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;Ar(e.state.doc,this.regexp,a,s,(function(t,i,o){return r.add(t,i,n.getDeco(o,e,t))}))}}catch(l){i.e(l)}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,l=Math.max(s.from,n),c=Math.min(s.to,r);c>l&&function(){var n=e.state.doc.lineAt(l),r=n.ton.from;l--)if(o.boundary.test(n.text[l-1-n.from])){i=l;break}for(;ca},add:u})}()}}catch(f){a.e(f)}finally{a.f()}return t}}]),e}(),Rr=null!=/x/.unicode?"gu":"g",Nr=new RegExp("[\0-\b\n-\x1f\x7f-\x9f\xad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]",Rr),_r={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Lr=null;var Ir=h.g.define({combine:function(e){var t=Object(h.m)(e,{render:null,specialChars:Nr,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==Lr&&"undefined"!=typeof document&&document.body){var t=document.body.style;Lr=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return Lr||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,Rr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Rr)),t}});function $r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[Ir.of(e),Br()]}var zr=null;function Br(){return zr||(zr=Je.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=Ce.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ir)),this.decorations=this.decorator.createDeco(t)}return Object(d.a)(e,[{key:"makeDecorator",value:function(e){var t=this;return new Dr({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),l=r.state.tabSize,c=Object(p.d)(s.text,l,i-s.from);return Ce.replace({widget:new Wr((l-c%l)*t.view.defaultCharacterWidth)})}return t.decorationCache[a]||(t.decorationCache[a]=Ce.replace({widget:new Fr(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}},{key:"update",value:function(e){var t=e.state.facet(Ir);e.startState.facet(Ir)!=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 Fr=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")+" "+(_r[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),Wr=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 Vr(){return Qr}var Hr=Ce.line({attributes:{class:"cm-activeLine"}}),Qr=Je.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 Ce.none;var a=e.visualLineAt(o.head);a.from>n&&(r.push(Hr.range(a.from)),n=a.from)}}catch(s){i.e(s)}finally{i.f()}return Ce.set(r)}}]),e}(),{decorations:function(e){return e.decorations}})},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(0),a=n.n(o),s=(n(11),n(96)),l=n.n(s),c=n(210),u=n(240),f=n(155),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=h,m=Object(c.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:v},p)),g=a.a.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=m(Object(r.a)({},n.defaultProps,e)),v=c;return("string"===typeof h||d)&&(s=Object(f.a)()||o,h&&(v=Object(u.a)({theme:s,name:h,props:c})),d&&!v.theme&&(v.theme=s)),a.a.createElement(n,Object(r.a)({ref:l||t,classes:p},v))}));return l()(g,n),g}},h=n(68);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){e.exports=n(181)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(14);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&&y(e.charCodeAt(t))&&b(e.charCodeAt(t-1))&&t--;var n=O(e,t);for(t+=w(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 b(e){return e>=55296&&e<56320}function O(e,t){var n=e.charCodeAt(t);if(!b(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return y(r)?r-56320+(n-55296<<10)+65536:n}function k(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function w(e){return e<65536?1:2}function x(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(c.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),C.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),C.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 E(t):C.from(E.split(t,[])):e.empty}}]),e}(),E=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M(e);return Object(c.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(T(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=P(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var l=s.length>>1;r.push(new n(s.slice(0,l)),new n(s.slice(l)))}}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=P(this.text,P(r.text,T(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new n(i,s):C.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 l=r.value;o.push(l),a+=l.length+1,32==o.length&&(t.push(new n(o,a)),o=[],a=-1)}}catch(c){s.e(c)}finally{s.f()}return a>-1&&t.push(new n(o,a)),t}}]),n}(S),C=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var o;Object(c.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 l=a.value;o.lines+=l.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 l=r&((o<=e?1:0)|(s>=t?2:0));o>=e&&s<=t&&!l?n.push(a):a.decompose(e-o,t-o,n,l)}o=s+1}}},{key:"replace",value:function(e,t,r){if(r.lines=s&&t<=c){var u=l.replace(e-s,t-s,r),f=this.lines-l.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,c,u)}s=c+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],l=a[1],c=a[2],u=a[3];;s+=t,l+=t){if(s==c||l==u)return i;var f=this.children[s],d=e.children[l];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(j){a.e(j)}finally{a.f()}if(o<32){var l,c=[],u=Object(i.a)(e);try{for(u.s();!(l=u.n()).done;){var f=l.value;f.flatten(c)}}catch(j){u.e(j)}finally{u.f()}return new E(c,r)}var d=Math.max(32,o>>5),h=d<<1,p=d>>1,v=[],m=0,g=-1,y=[];function b(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;){b(r.value)}}catch(j){o.e(j)}finally{o.f()}}else e.lines>p&&(m>p||!m)?(O(),v.push(e)):e instanceof E&&m&&(t=y[y.length-1])instanceof E&&e.lines+t.lines<=32?(m+=e.lines,g+=e.length+1,y[y.length-1]=new E(t.text.concat(e.text),t.length+1+e.length)):(m+e.lines>d&&O(),m+=e.lines,g+=e.length+1,y.push(e))}function O(){0!=m&&(v.push(1==y.length?y[0]:n.from(y,g)),g=-1,m=y.length=0)}var k,w=Object(i.a)(e);try{for(w.s();!(k=w.n()).done;){var x=k.value;b(x)}}catch(j){w.e(j)}finally{w.f()}return O(),1==v.length?v[0]:new n(v,r)}}]),n}(S);function M(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 P(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(l>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;Object(c.a)(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof E?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 E?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 E){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 l=r.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof E?l.text.length:l.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(c.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(c.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(c.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,"a",(function(){return i}));var r=n(156);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";n.d(t,"a",(function(){return s}));var r=n(35);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(85);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";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return W})),n.d(t,"d",(function(){return M})),n.d(t,"e",(function(){return T})),n.d(t,"f",(function(){return z})),n.d(t,"g",(function(){return P})),n.d(t,"h",(function(){return C})),n.d(t,"i",(function(){return S})),n.d(t,"j",(function(){return m}));var r=n(18),i=n(17),o=n(3),a=n(5),s=n(6),l=n(23),c=n(4),u=n(9),f=n(15),d=new l.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,c.f.prototype.hasOwnProperty("tree")||Object.defineProperty(c.f.prototype,"tree",{get:function(){return m(this)}}),this.parser=n,this.extension=[S.of(this),c.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(l.b.mounted);if(a){if(a.tree.prop(d)==t.data){if(a.overlay){var s,c=Object(o.a)(a.overlay);try{for(c.s();!(s=c.n()).done;){var u=s.value;r.push({from:u.from+i,to:u.to+i})}}catch(v){c.e(v)}finally{c.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,c.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:l.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}(),y=null,b=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,l=arguments.length>6?arguments[6]:void 0,c=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=l,this.scheduleOn=c,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!=l.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(l.g.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(e){var t=y;y=this;try{return e()}finally{y=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,c=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=l.g.applyChanges(r,u),i=l.f.empty,a=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){c=[];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)(c,t);var n=Object(i.a)(c);function c(){return Object(a.a)(this,c),n.apply(this,arguments)}return Object(s.a)(c,[{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=y;if(t){var n,s=Object(o.a)(r);try{for(s.s();!(n=s.n()).done;){var c=n.value;t.tempSkipped.push(c)}}catch(u){s.e(u)}finally{s.f()}e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new l.f(l.d.none,[],[],a-i)},stoppedAt:null,stopAt:function(){}}}}]),c}(l.e))}},{key:"get",value:function(){return y}}]),e}();function O(e,t,n){return l.g.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var k=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 b(t.facet(S).parser,t,[],l.f.empty,0,{from:0,to:t.doc.length},[],null);return n.work(25)||n.takeTree(),new e(n)}}]),e}();h.state=c.k.define({create:k.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)?k.init(t.state):e.apply(t)}});var w="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},x="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,j=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=w(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 k(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&&x(this.working)}}]),e}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),S=c.g.define({combine:function(e){return e.length?e[0]:null},enables:[h.state,j]}),E=c.g.define(),C=c.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 M(e){var t=e.facet(C);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function P(e,t){var n="",r=e.tabSize;if(9==e.facet(C).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=M(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 l.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(l.b.closedBy))){var i=e.lastChild,o=i&&n.indexOf(i.name)>-1;return function(e){return $(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 $(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,l=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 l=t.childAfter(s);if(!l||l==r)return null;if(!l.type.isSkipped)return l.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,l=e.state,c=-1,u=[],f=Object(o.a)(l.selection.ranges);try{for(f.s();!(s=f.n()).done;){var d=s.value.head,h=l.doc.lineAt(d);if(h.from!=c){c=h.from;var p=T(l,h.from);if(null!=p){var v=/^\s*/.exec(h.text)[0],m=P(l,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 B=c.g.define(),F=new l.b;function W(e,t,n){var r,i=Object(o.a)(e.facet(B));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,"e",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"f",(function(){return h}));var r=n(156);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t="hsl"===(e=o(e)).type?o(function(e){var t=(e=o(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),a({type:c,values:u})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?d(e,t):h(e,t)}function u(e,t){return f(e,t)}function f(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function h(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},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 T}));var r=n(13),i=n(3),o=n(6),a=n(5),s=1024,l=0,c=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=l++,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 l=a.value;if(Array.isArray(l)||(l=l(o)),l){if(l[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[l[0].id]=l[1]}}}catch(c){s.e(c)}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 j(n);return null!=e&&(r.moveTo(e,t),p.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new j(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(),l=function(){return s.node};;){var c=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==t(s.type,s.from,s.to,l))){if(s.firstChild())continue;s.type.isAnonymous||(c=!0)}for(;c&&n&&n(s.type,s.from,s.to,l),c=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;c=!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:P(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 E(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,l=0;s=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function b(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,l=s.children,c=s.positions,f=n>0?l.length:-1;t!=f;t+=n){var d=l[t],h=c[t]+a._from;if(y(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 x(new w(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,l=t-this.from,c=Object(i.a)(r.overlay);try{for(c.s();!(s=c.n()).done;){var f=s.value,d=f.from,h=f.to;if((n>0?d<=l:d=l:h>l))return new e(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(p){c.e(p)}finally{c.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 j(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 b(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=k(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 k(this,e,t,n)}},{key:"toString",value:function(){return this.node.toString()}}]),e}();function k(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 w=function e(t,n,r,i){Object(a.a)(this,e),this.parent=t,this.buffer=n,this.index=r,this.start=i},x=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 j(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 b(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=k(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 k(this,e,t,n)}}]),e}(),j=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,l=e<0?-1:n.node.children.length;s!=l;s+=e){var c=n.node.children[s];if(1&this.mode||c instanceof g||!c.type.isAnonymous||S(c))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;ac;){var u=n.size;if(n.id==t&&u>=0)l.size=r,l.start=i,l.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)&&(l.size=r,l.start=i,l.skip=a);return l.size>4?l:void 0}(d.pos-t,a))){for(var A=new Uint16Array(C.size-C.skip),D=d.pos-C.size,R=A.length;d.pos>D;)R=w(C.start,A,R);E=new g(A,m-C.start,r),T=C.start-e}else{var N=d.pos-x;d.next();for(var _=[],L=[],I=s>=f?s:-1,$=0,z=m;d.pos>N;)I>=0&&d.id==I&&d.size>=0?(d.end<=z-o&&(O(_,L,c,$,d.end,z,I,j),$=_.length,z=d.end),d.next()):b(c,N,_,L,I);if(I>=0&&$>0&&$<_.length&&O(_,L,c,$,c,z,I,j),_.reverse(),L.reverse(),I>-1&&$>0){var B=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 k(e,t,n,r,a)}}(M);E=P(M,_,L,0,_.length,0,m-c,B,B)}else E=k(M,_,L,m-c,j-m)}n.push(E),i.push(T)}function O(e,t,n,i,o,a,s,l){for(var c=[],u=[];e.length>i;)c.push(e.pop()),u.push(t.pop()+n-o);e.push(k(r.types[s],c,u,a-o,l-a)),t.push(o-n)}function k(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 w(e,t,n){var r=d.id,i=d.start,o=d.end,a=d.size;if(d.next(),a>=0&&r4)for(var l=d.pos-(a-4);d.pos>l;)n=w(e,t,n);t[--n]=s,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==a?p=r:-4==a&&(y=r);return n}for(var x=[],j=[];d.pos>0;)b(e.start||0,e.bufferStart||0,x,j,-1);var S=null!==(t=e.length)&&void 0!==t?t:x.length?j[0]+x[0].length:0;return new v(h[e.topID],x.reverse(),j.reverse(),S)}var C=new WeakMap;function M(e,t){if(!e.isAnonymous||t instanceof g||t.type!=e)return 1;var n=C.get(t);return null==n&&(n=t.children.reduce((function(t,n){return t+M(e,n)}),1),C.set(t,n)),n}function P(e,t,n,r,i,o,a,s,l){for(var c=0,u=r;u=f)break;v+=m}if(c==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 y=r[c-1]+n[c-1].length-p;d.push(P(e,n,r,u,c,p,y,null,l))}h.push(p+s-o)}}(t,n,r,i,0),(s||l)(d,h,a)}var T=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 l=n.value;l.to>t.length&&a.push(l)}}catch(c){s.e(c)}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,l=0,c=0;;s++){var u=s=r)for(;a&&a.from=d.from||f<=d.to||c){var h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new e(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=o1&&void 0!==arguments[1]?arguments[1]:e;return new l(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=a.h.TrackDel;var l=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function c(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=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,l=i[s]-e||(n?this.value[s].endSide:this.value[s].startSide)-t;if(s==o)return l>=0?o:a;l>=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,c.endSide))||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),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(c),this.isEmpty)return r.length?e.of(r):this;for(var p=new v(this,null,-1).goto(0),m=0,g=[],y=new h;p.value||m=0){var b=r[m++];y.addInner(b.from,b.to,b.value)||g.push(b)}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),l=new y(o,s,i),c=new y(a,s,i);n.iterGaps((function(e,t,n){return b(l,e,c,t,n,r)})),n.empty&&0==n.length&&b(l,0,c,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 y(i,a,0).goto(n),l=new y(o,a,0).goto(n);;){if(s.to!=l.to||!O(s.active,l.active)||s.point&&(!l.point||!s.point.eq(l.point)))return!1;if(s.to>=r)return!0;s.next(),l.next()}}},{key:"spans",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new y(e,null,i).goto(t),a=t,s=o.openStart;;){var l=Math.min(o.to,n);if(o.point?(r.point(a,l,o.point,o.activeForPoint(o.to),s),s=o.openEnd(l)+(o.to>l?1:0)):l>a&&(r.span(a,l,o.active,s),s=o.openEnd(l)),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 l?[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(c);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 y=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){k(this.active,e),k(this.activeTo,e),k(this.activeRank,e),this.minActive=x(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&&k(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 b(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,l=r-t;;){var c=e.to+l-n.to||e.endSide-n.endSide,u=c<0?e.to+l:n.to,f=Math.min(u,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&O(e.activeForPoint(e.to+l),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,c<=0&&e.next(),c>=0&&n.next()}}function O(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function x(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),l=Object(r.a)(n);try{for(l.s();!(o=l.n()).done;){o.value.instances.push(s)}}catch(y){l.e(y)}finally{l.f()}var c,u=m(n),f=Object(r.a)(t.set);try{for(f.s();!(c=f.n()).done;){var d,p=c.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(y){v.e(y)}finally{v.f()}}}catch(y){f.e(y)}finally{f.f()}return s}}]),e}();function m(e){for(var t=[e],n=0;n0&&f+3==s.length){c=1;break}var d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!d)throw new RangeError("Invalid path: "+s);if(l.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){c=0;break}if("/"!=h)throw new RangeError("Invalid path: "+s);u=s.slice(f)}var p=l.length-1,v=l[p];if(!v)throw new RangeError("Invalid path: "+s);var m=new w(i,c,p>0?l.slice(0,p):null);t[v]=m.sort(t[v])}}}catch(g){a.e(g)}finally{a.f()}}return y.add(t)}var y=new a.b,b=c.g.define({combine:function(e){return e.length?x.combinedMatch(e):null}}),O=c.g.define({combine:function(e){return e.length?e[0].match:null}});function k(e){return e.facet(b)||e.facet(O)}var w=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 l=e.type,c=e.from,u=e.to;if(!(c>=n||u<=t)){E[o]=l.name,l.isTop&&(s=l);for(var f=i,d=l.prop(y),h=!1;d;){if(!d.context||P(d.context,E,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(T){v.e(T)}finally{v.f()}break}d=d.next}if(this.startSpan(e.from,f),!h){var b=e.tree&&e.tree.prop(a.b.mounted);if(b&&b.overlay){for(var O=e.node.enter(b.overlay[0].from+c,1),k=e.firstChild(),w=0,x=c;;w++){var j=w=S)&&e.nextSibling()););if(!j||S>n)break;(x=j.to+c)>t&&(this.highlightRange(O.cursor,Math.max(t,j.from+c),Math.min(n,x),i,o,b.tree.type),this.startSpan(x,f))}k&&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 M(e,t,n,r,i){var o=new C(t,r,i);o.highlightRange(e.cursor(),t,n,"",0,e.type),o.flush(n)}function P(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 T=h.define,A=T(),D=T(),R=T(D),N=T(D),_=T(),L=T(_),I=T(_),$=T(),z=T($),B=T(),F=T(),W=T(),V=T(W),H=T(),Q={comment:A,lineComment:T(A),blockComment:T(A),docComment:T(A),name:D,variableName:T(D),typeName:R,tagName:T(R),propertyName:N,attributeName:T(N),className:T(D),labelName:T(D),namespace:T(D),macroName:T(D),literal:_,string:L,docString:T(L),character:T(L),attributeValue:T(L),number:I,integer:T(I),float:T(I),bool:T(_),regexp:T(_),escape:T(_),color:T(_),url:T(_),keyword:B,self:T(B),null:T(B),atom:T(B),unit:T(B),modifier:T(B),operatorKeyword:T(B),controlKeyword:T(B),definitionKeyword:T(B),operator:F,derefOperator:T(F),arithmeticOperator:T(F),logicOperator:T(F),bitwiseOperator:T(F),compareOperator:T(F),updateOperator:T(F),definitionOperator:T(F),typeOperator:T(F),controlOperator:T(F),punctuation:W,separator:T(W),bracket:V,angleBracket:T(V),squareBracket:T(V),paren:T(V),brace:T(V),content:$,heading:z,heading1:T(z),heading2:T(z),heading3:T(z),heading4:T(z),heading5:T(z),heading6:T(z),contentSeparator:T($),list:T($),quote:T($),emphasis:T($),strong:T($),link:T($),monospace:T($),strikethrough:T($),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:H,documentMeta:T(H),annotation:T(H),processingInstruction:T(H),definition:h.defineModifier(),constant:h.defineModifier(),function:h.defineModifier(),standard:h.defineModifier(),local:h.defineModifier(),special:h.defineModifier()},q=x.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.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(0),i=(n(11),Object(r.createContext)(null)),o=function(e){var t=e.utils,n=e.children,o=e.locale,a=e.libInstance,s=Object(r.useMemo)((function(){return new t({locale:o,instance:a})}),[t,a,o]);return Object(r.createElement)(i.Provider,{value:s,children:n})};function a(){var e=Object(r.useContext)(i);return function(e){if(!e)throw new Error("Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.")}(e),e}},,function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",a="hour",s="day",l="week",c="month",u="quarter",f="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},y={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&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,f=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";function r(e,t){return function(){return null}}n.d(t,"a",(function(){return r}))},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";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(84);var i=n(94),o=n(78);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,"b",(function(){return o}));var r=n(0),i=r.createContext();function o(){return r.useContext(i)}t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5),i=n(6),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:{},l=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=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&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(!l)throw new RangeError("The value of a property ("+u+") should be a primitive value.");a(o(u),f,s,c)}else null!=f&&s.push(u.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+f+";")}(s.length||c)&&n.push((!i||l||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}(),c=null,u=function(){function e(t){if(Object(r.a)(this,e),!t.head&&t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(c)return t.adoptedStyleSheets=[c.sheet].concat(t.adoptedStyleSheets),t[a]=c;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),c=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[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&&j<=57||j>=97&&j<=122?2:j>=65&&j<=90?1:0:(S=Object(f.g)(j))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(1==E&&O||0==x&&0!=E)&&(t[v]==j||n[v]==j&&(m=!0))&&(o[v++]=k),x=E,k+=Object(f.c)(j)}return v==l&&0==o[0]?this.result((m?-200:0)-100,o,e):g==l&&0==y?[-200,0,b]:s>-1?[-700,s,s+this.pattern.length]:g==l?[-900,y,b]:v==l?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 l=r.value,c=l+(this.astral?Object(f.c)(Object(f.b)(n,l)):1);o>1&&i[o-1]==l?i[o-1]=c:(i[o++]=l,i[o++]=c)}}catch(u){a.e(u)}finally{a.f()}return i}}]),e}(),S=u.g.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100,defaultKeymap:!0,optionClass:function(){return""},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)}})}});var E=d.d.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 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"}}});function C(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 M=function(){function e(t,n){var r=this;Object(l.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,c=a.selected,u=t.state.facet(S);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 c=r.appendChild(document.createElement("span"));c.appendChild(document.createTextNode(i.slice(s,l))),c.className="cm-completionMatchedText",o=l}return o=this.range.to)&&(this.range=C(n.options.length,n.selected,this.view.state.facet(S).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)return null;var t=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;if(n<0||n>this.list.clientHeight-10)return null;var r=this.view.textDirection==d.c.RTL,i=t.left,o=innerWidth-t.right;return r&&i=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){var o=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 l,c=Object(s.a)(a.result.options);try{for(c.s();!(l=c.n()).done;){var u=l.value;r.push(new y(u,a,[1e9-i++]))}}catch(w){c.e(w)}finally{c.f()}}else{var f,d=new j(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 y(v,a,h)))}}catch(w){p.e(w)}finally{p.f()}}}}catch(w){o.e(w)}finally{o.f()}r.sort(_);var m,g=[],b=null,O=Object(s.a)(r.sort(_));try{for(O.s();!(m=O.n()).done;){var k=m.value;if(300==g.length)break;b&&b.label==k.completion.label&&b.detail==k.completion.detail?P(k.completion)>P(b)&&(g[g.length-1]=k):g.push(k),b=k.completion}}catch(w){O.e(w)}finally{O.f()}return g}(t,n);if(!o.length)return null;var a,l=0;if(i&&i.selected)for(var c=i.options[i.selected].completion,u=0;u2&&void 0!==arguments[2]?arguments[2]:-1;Object(l.a)(this,e),this.source=t,this.state=n,this.explicitPos=r}return Object(c.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 l=o.value;if(l.is(z))i=new e(i.source,1,l.value?b(t.state):-1);else if(l.is(B))i=new e(i.source,0);else if(l.is(F)){var c,u=Object(s.a)(l.value);try{for(u.s();!(c=u.n()).done;){var f=c.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(b(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}(),$=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o,a,s){var c;return Object(l.a)(this,n),(c=t.call(this,e,2,r)).result=i,c.from=o,c.to=a,c.span=s,c}return Object(c.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=b(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),z=u.j.define(),B=u.j.define(),F=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(l.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(l.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(c.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 l,c=Object(s.a)(a.context.abortListeners);try{for(c.s();!(l=c.n()).done;){var u=l.value;try{u()}catch(m){Object(d.l)(this.view.state,m)}}}catch(g){c.e(g)}finally{c.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=b(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:B.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(S),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 l,c=new $(a.active.source,a.active.explicitPos,a.done,a.done.from,null!==(e=a.done.to)&&void 0!==e?e:b(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();!(l=u.n()).done;){var f=l.value;c=c.update(f,r)}}catch(g){u.e(g)}finally{u.f()}if(c.hasResult())return n.push(c),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=d&&g.field++}}catch(y){m.e(y)}finally{m.f()}}a.push(new U(d,o.length,n.index,n.index+f.length)),c=c.slice(0,n.index)+f+c.slice(n.index+n[0].length)}o.push(c)}}catch(y){l.e(y)}finally{l.f()}return new e(o,a)}}]),e}(),G=d.b.widget({widget:new(function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(c.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))}),K=d.b.mark({class:"cm-snippetField"}),J=function(){function e(t,n){Object(l.a)(this,e),this.ranges=t,this.active=n,this.deco=d.b.set(t.map((function(e){return(e.from==e.to?G:K).range(e.from,e.to)})))}return Object(c.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}(),Z=u.j.define({map:function(e,t){return e&&e.map(t)}}),ee=u.j.define(),te=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(Z))return i.value;if(i.is(ee)&&e)return new J(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 ne(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 re(e){var t=Y.parse(e);return function(e,n,r,i){var o=t.instantiate(e.state,r),a=o.text,s=o.ranges,l={changes:{from:r,to:i,insert:f.a.of(a)}};if(s.length&&(l.selection=ne(s,0)),s.length>1){var c=new J(s,0),d=l.effects=[Z.of(c)];void 0===e.state.field(te,!1)&&d.push(u.j.appendConfig.of([te.init((function(){return c})),se,le,E]))}e.dispatch(e.state.update(l))}}function ie(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(te,!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:ne(i.ranges,o),effects:Z.of(a?null:new J(i.ranges,o))})),!0}}var oe=[{key:"Tab",run:ie(1),shift:ie(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(te,!1)&&(n(t.update({effects:Z.of(null)})),!0)}}],ae=u.g.define({combine:function(e){return e.length?e[0]:oe}}),se=u.i.override(d.k.compute([ae],(function(e){return e.facet(ae)})));var le=d.d.domEventHandlers({mousedown:function(e,t){var n,r=t.state.field(te,!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:ne(r.ranges,i.field),effects:Z.of(r.ranges.some((function(e){return e.field>i.field}))?new J(r.ranges,i.field):null)}),!0)}});function ce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V,S.of(e),q,fe,E]}var ue=[{key:"Ctrl-Space",run:function(e){return!!e.state.field(V,!1)&&(e.dispatch({effects:z.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:B.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)}}],fe=u.i.override(d.k.computeN([S],(function(e){return e.facet(S).defaultKeymap?[ue]:[]})))},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return p}));var r=n(5),i=n(6),o=n(3),a=n(9),s=n(4),l=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 c(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(l);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(c){a.e(c)}finally{a.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(l);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new 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=[],c=[],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:c).push(m)}}catch(x){d.e(x)}finally{d.f()}this.specs=i,this.panels=a,this.top.sync(s),this.bottom.sync(c);for(var g=0,y=u;g0&&g(t.state,l.head-1,1,o)||o.afterCursor&&(g(t.state,l.head,1,o)||l.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||c,a=r.brackets||u,s=Object(o.j)(e),l=s.resolveInner(t,n),f=l;f;f=f.parent){var d=m(f.type,n,a);if(d&&f.from=r.to){if(0==l&&i.indexOf(c.type.name)>-1&&c.from0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,d=0;!u.next().done&&d<=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:c,end:{from:p+v,to:p+v+1},matched:g>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(27),o=!0,a=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(30);function i(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(153),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},,function(e,t,n){"use strict";function r(e){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)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function 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(196)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(83);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(84);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},,,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&b.current)b.current=!1;else{"touchstart"===e.type&&(b.current=!0);var u,f,d,h=c?null:w.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(p.width/2),f=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,g=v.clientY;u=Math.round(m-p.left),f=Math.round(g-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var y=2*Math.max(Math.abs((h?h.clientWidth:0)-u),u)+2,j=2*Math.max(Math.abs((h?h.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(y,2)+Math.pow(j,2))}e.touches?null===k.current&&(k.current=function(){x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})},O.current=setTimeout((function(){k.current&&(k.current(),k.current=null)}),80)):x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})}}),[a,x]),S=o.useCallback((function(){j({},{pulsate:!0})}),[j]),E=o.useCallback((function(e,t){if(clearTimeout(O.current),"touchend"===e.type&&k.current)return e.persist(),k.current(),k.current=null,void(O.current=setTimeout((function(){E(e,t)})));k.current=null,m((function(e){return e.length>0?e.slice(1):e})),y.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:S,start:j,stop:E}}),[S,j,E]),o.createElement("span",Object(r.a)({className:Object(s.a)(l.root,c),ref:w},u),o.createElement(h.a,{component:null,exit:!0},p))})),g=Object(u.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(m)),y=o.forwardRef((function(e,t){var n=e.action,u=e.buttonRef,d=e.centerRipple,h=void 0!==d&&d,p=e.children,v=e.classes,m=e.className,y=e.component,b=void 0===y?"button":y,O=e.disabled,k=void 0!==O&&O,w=e.disableRipple,x=void 0!==w&&w,j=e.disableTouchRipple,S=void 0!==j&&j,E=e.focusRipple,C=void 0!==E&&E,M=e.focusVisibleClassName,P=e.onBlur,T=e.onClick,A=e.onFocus,D=e.onFocusVisible,R=e.onKeyDown,N=e.onKeyUp,_=e.onMouseDown,L=e.onMouseLeave,I=e.onMouseUp,$=e.onTouchEnd,z=e.onTouchMove,B=e.onTouchStart,F=e.onDragLeave,W=e.tabIndex,V=void 0===W?0:W,H=e.TouchRippleProps,Q=e.type,q=void 0===Q?"button":Q,U=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),X=o.useRef(null);var Y=o.useRef(null),G=o.useState(!1),K=G[0],J=G[1];k&&K&&J(!1);var Z=Object(f.a)(),ee=Z.isFocusVisible,te=Z.onBlurVisible,ne=Z.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(c.a)((function(r){return t&&t(r),!n&&Y.current&&Y.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){J(!0),X.current.focus()}}}),[]),o.useEffect((function(){K&&C&&!x&&Y.current.pulsate()}),[x,C,K]);var ie=re("start",_),oe=re("stop",F),ae=re("stop",I),se=re("stop",(function(e){K&&e.preventDefault(),L&&L(e)})),le=re("start",B),ce=re("stop",$),ue=re("stop",z),fe=re("stop",(function(e){K&&(te(e),J(!1)),P&&P(e)}),!1),de=Object(c.a)((function(e){X.current||(X.current=e.currentTarget),ee(e)&&(J(!0),D&&D(e)),A&&A(e)})),he=function(){var e=a.findDOMNode(X.current);return b&&"button"!==b&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),ve=Object(c.a)((function(e){C&&!pe.current&&K&&Y.current&&" "===e.key&&(pe.current=!0,e.persist(),Y.current.stop(e,(function(){Y.current.start(e)}))),e.target===e.currentTarget&&he()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&he()&&"Enter"===e.key&&!k&&(e.preventDefault(),T&&T(e))})),me=Object(c.a)((function(e){C&&" "===e.key&&Y.current&&K&&!e.defaultPrevented&&(pe.current=!1,e.persist(),Y.current.stop(e,(function(){Y.current.pulsate(e)}))),N&&N(e),T&&e.target===e.currentTarget&&he()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ge=b;"button"===ge&&U.href&&(ge="a");var ye={};"button"===ge?(ye.type=q,ye.disabled=k):("a"===ge&&U.href||(ye.role="button"),ye["aria-disabled"]=k);var be=Object(l.a)(u,t),Oe=Object(l.a)(ne,X),ke=Object(l.a)(be,Oe),we=o.useState(!1),xe=we[0],je=we[1];o.useEffect((function(){je(!0)}),[]);var Se=xe&&!x&&!k;return o.createElement(ge,Object(r.a)({className:Object(s.a)(v.root,m,K&&[v.focusVisible,M],k&&v.disabled),onBlur:fe,onClick:T,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ce,onTouchMove:ue,onTouchStart:le,ref:ke,tabIndex:k?-1:V},ye,U),p,Se?o.createElement(g,Object(r.a)({ref:Y,center:h},H)):null)}));t.a=Object(u.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(y)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e){var t=r.useState(e),n=t[0],i=t[1],o=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n(57),n(1);var r=n(71),i=(n(11),n(64),{xs:0,sm:600,md:960,lg:1280,xl:1920}),o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function a(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===Object(r.a)(t)){var a=e.theme.breakpoints||o;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(183),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=l(t),v=l(n),m=0;m2),h="-10000px",p=function(){function e(t,n,r){Object(l.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(c.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=[],l=0;l=t.bottom||l.right<=t.left||l.left>=t.right)a.style.top=h;else{var f=!!i.arrow,d=!!i.above,p=c.right-c.left,v=c.bottom-c.top+(f?7:0),m=this.view.textDirection==u.c.LTR?Math.min(l.left-(f?14:0),e.innerWidth-p):Math.max(0,l.left-p+(f?14:0));!i.strictSide&&(d?l.top-(c.bottom-c.top)<0:l.bottom+(c.bottom-c.top)>e.innerHeight)&&(d=!d);var g,y=d?l.top-v:l.bottom+(f?7:0),b=m+p,O=Object(s.a)(n);try{for(O.s();!(g=O.n()).done;){var k=g.value;k.leftm&&k.topy&&(y=d?k.top-v:k.bottom)}}catch(w){O.e(w)}finally{O.f()}"absolute"==this.position?(a.style.top=y-e.parent.top+"px",a.style.left=m-e.parent.left+"px"):(a.style.top=y+"px",a.style.left=m+"px"),n.push({left:m,top:y,right:b,bottom:y+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",y=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"}}),b=f.g.define({enables:[m,y]}),O=f.g.define(),k=function(){function e(t){var n=this;Object(l.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(c.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}(),w=b.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:k.create,above:t[0].above,arrow:t.some((function(e){return e.arrow}))}})),x=function(){function e(t,n,r,i,o){Object(l.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(c.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,l=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 l=r.changes.mapPos(e.pos,-1,f.h.TrackDel);if(null==l)return null;var c=Object.assign(Object.create(null),e);return c.pos=l,null!=e.end&&(c.end=r.changes.mapPos(e.end)),c}return e},provide:function(e){return O.from(e)}}),i=t.hoverTime||750;return[r,u.f.define((function(t){return new x(t,e,r,n,i)})),w]}},function(e,t,n){e.exports=n(206)},function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return M}));var r=n(18),i=n(17),o=n(25),a=n(3),s=n(6),l=n(5),c=n(9),u=n(4),f=n(100),d=n(61),h=n(28),p=function e(t,n,r){Object(l.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},v=function(){function e(t,n,r){Object(l.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=c.b.set(t.map((function(e){return e.from==e.to||e.from==e.to-1&&r.doc.lineAt(e.from).to==e.from?c.b.widget({widget:new A(e),diagnostic:e}).range(e.from):c.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(k,!1)?t:t.concat(u.j.appendConfig.of([k.init(n),c.d.decorations.compute([k],(function(e){var t=e.field(k),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?c.b.set([w.range(n.from,n.to)]):c.b.none})),Object(f.a)(x),_]))}var y=u.j.define(),b=u.j.define(),O=u.j.define(),k=u.k.define({create:function(){return new v(c.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 l=o.value;l.is(y)?e=v.init(l.value,e.panel,t.state):l.is(b)?e=new v(e.diagnostics,l.value?R.open:null,e.selected):l.is(O)&&(e=new v(e.diagnostics,e.panel,l.value))}}catch(c){s.e(c)}finally{s.f()}return e},provide:function(e){return[d.b.from(e,(function(e){return e.panel})),c.d.decorations.from(e,(function(e){return e.diagnostics}))]}});var w=c.b.mark({class:"cm-lintRange cm-lintRange-active"});function x(e,t,n){var r=e.state.field(k).diagnostics,i=[],o=2e8,a=0;return r.between(t-(n<0?1:0),t+(n>0?1:0),(function(e,r,s){var l=s.spec;t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t1&&void 0!==arguments[1]?arguments[1]:{};return C.of({source:e,delay:null!==(t=n.delay)&&void 0!==t?t:750})}function P(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=P(r.actions),o=0;oi&&(e.items.splice(i,u-i),o=!0)),r&&l.diagnostic==r.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),a=l):l.dom.hasAttribute("aria-selected")&&l.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(k).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 _=c.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 ce}));var r=n(3),i=n(4),o=n(15),a=n(9),s=n(65),l=n(21),c=n(23);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 y(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 b(e,t,n){for(var r=Object(l.j)(e).resolveInner(t.head),o=n?c.b.closedBy:c.b.openedBy,a=t.head;;){var u=n?r.childAfter(a):r.childBefore(a);if(!u)break;y(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 k=function(e){return O(e,!1)},w=function(e){return O(e,!0)};function x(e,t){return d(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):h(n,t)}))}var j=function(e){return x(e,!1)},S=function(e){return x(e,!0)};function E(e,t,n){var r=e.visualLineAt(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 C=function(e){return d(e,(function(t){return E(e,t,!0)}))},M=function(e){return d(e,(function(t){return E(e,t,!1)}))};function P(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 c=n[n.length-1];c.to=l.to,c.ranges.push(a)}else n.push({from:s.from,to:l.to,ranges:[a]});i=l.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=[],l=Object(r.a)(te(e));try{for(l.s();!(o=l.n()).done;){var c=o.value;if(n?c.to!=e.doc.length:0!=c.from){var u=e.doc.lineAt(n?c.to+1:c.from-1),f=u.length+1;if(n){a.push({from:c.to,to:u.to},{from:c.from,insert:u.text+e.lineBreak});var d,h=Object(r.a)(c.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(y){h.e(y)}finally{h.f()}}else{a.push({from:u.from,to:c.from},{from:c.to,insert:e.lineBreak+u.text});var v,m=Object(r.a)(c.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(y){m.e(y)}finally{m.f()}}}}}catch(y){l.e(y)}finally{l.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(l){a.e(l)}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(l.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(c.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 l.a(n,{simulateBreak:r,simulateDoubleBreak:!!u}),d=Object(l.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 l=e.changes(o);return{changes:o,range:i.e.range(l.mapPos(r.anchor,1),l.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(l.h)})})),{userEvent:"input.indent"})),!0)},le=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(l.g)(t,Math.max(0,i-Object(l.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(l.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:le},{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 l.a(t,{overrideIndentation:function(e){var t=r[e];return null==t?-1:t}}),o=ae(t,(function(e,n,o){var a=Object(l.e)(i,e.from);if(null!=a){/\S/.test(e.text)||(a=0);var s=/^\s*/.exec(e.text)[0],c=Object(l.g)(t,a);(s!=c||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:k,shift:L},{key:"Ctrl-n",run:w,shift:I},{key:"Ctrl-a",run:function(e){return d(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).from,1)}))},shift:function(e){return T(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).from)}))}},{key:"Ctrl-e",run:function(e){return d(e,(function(t){return i.e.cursor(e.visualLineAt(t.head).to,-1)}))},shift:function(e){return T(e,(function(t){return i.e.cursor(e.visualLineAt(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:j}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))))},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},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";var r=n(56),i=n(49),o=(n(11),n(0)),a=n.n(o),s=n(27),l=n.n(s),c=!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]:[l.a.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),u=r?s.appear:s.enter;!e&&!n||c?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:l.a.findDOMNode(this);t&&!c?(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:l.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";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,l=a(e),c=1;c1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');var n=E(e),r=n.length>0?n[0]:"",o=C("%"+r+"%",t),s=o.name,c=o.value,u=!1,f=o.alias;f&&(r=f[0],k(n,O([0,1],f)));for(var d=1,h=!0;d=n.length){var y=l(c,p);c=(h=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else h=b(c,p),c=c[p];h&&!u&&(v[s]=c)}}return c}},function(e,t,n){"use strict";var r=n(189);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 function(){return null}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n,r,i){return null}n.d(t,"a",(function(){return r}))},function(e,t){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?(e.exports=n=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),n(t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){(function(t){var n="__lodash_hash_undefined__",r="[object Function]",i="[object GeneratorFunction]",o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,s=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,u=/^\[object .+?Constructor\]$/,f="object"==typeof t&&t&&t.Object===Object&&t,d="object"==typeof self&&self&&self.Object===Object&&self,h=f||d||Function("return this")();var p=Array.prototype,v=Function.prototype,m=Object.prototype,g=h["__core-js_shared__"],y=function(){var e=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),b=v.toString,O=m.hasOwnProperty,k=m.toString,w=RegExp("^"+b.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=h.Symbol,j=p.splice,S=L(h,"Map"),E=L(Object,"create"),C=x?x.prototype:void 0,M=C?C.toString:void 0;function P(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1},T.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 P,map:new(S||T),string:new P}},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=z((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(W(e))return M?M.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return s.test(e)&&n.push(""),e.replace(l,(function(e,t,r,i){n.push(r?i.replace(c,"$1"):t||e)})),n}));function $(e){if("string"==typeof e||W(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function z(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(z.Cache||A),n}z.Cache=A;var B=Array.isArray;function F(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]"==k.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(113))},function(e,t,n){"use strict";var r=n(202),i=n(203),o=n(204),a=Symbol("max"),s=Symbol("length"),l=Symbol("lengthCalculator"),c=Symbol("allowStale"),u=Symbol("maxAge"),f=Symbol("dispose"),d=Symbol("noDisposeOnSet"),h=Symbol("lruList"),p=Symbol("cache"),v=Symbol("updateAgeOnGet"),m=function(){return 1},g=function(){function e(t){if(r(this,e),"number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[a]=t.max||1/0;var n=t.length||m;if(this[l]="function"!==typeof n?m:n,this[c]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[f]=t.dispose,this[d]=t.noDisposeOnSet||!1,this[v]=t.updateAgeOnGet||!1,this.reset()}return i(e,[{key:"max",get:function(){return this[a]},set:function(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,O(this)}},{key:"allowStale",get:function(){return this[c]},set:function(e){this[c]=!!e}},{key:"maxAge",get:function(){return this[u]},set:function(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[u]=e,O(this)}},{key:"lengthCalculator",get:function(){return this[l]},set:function(e){var t=this;"function"!==typeof e&&(e=m),e!==this[l]&&(this[l]=e,this[s]=0,this[h].forEach((function(e){e.length=t[l](e.value,e.key),t[s]+=e.length}))),O(this)}},{key:"length",get:function(){return this[s]}},{key:"itemCount",get:function(){return this[h].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[h].tail;null!==n;){var r=n.prev;x(this,e,n,t),n=r}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[h].head;null!==n;){var r=n.next;x(this,e,n,t),n=r}}},{key:"keys",value:function(){return this[h].toArray().map((function(e){return e.key}))}},{key:"values",value:function(){return this[h].toArray().map((function(e){return e.value}))}},{key:"reset",value:function(){var e=this;this[f]&&this[h]&&this[h].length&&this[h].forEach((function(t){return e[f](t.key,t.value)})),this[p]=new Map,this[h]=new o,this[s]=0}},{key:"dump",value:function(){var e=this;return this[h].map((function(t){return!b(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}})).toArray().filter((function(e){return e}))}},{key:"dumpLru",value:function(){return this[h]}},{key:"set",value:function(e,t,n){if((n=n||this[u])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[l](t,e);if(this[p].has(e)){if(i>this[a])return k(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 c=new w(e,t,i,r,n);return c.length>this[a]?(this[f]&&this[f](e,t),!1):(this[s]+=c.length,this[h].unshift(c),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!b(this,t)}},{key:"get",value:function(e){return y(this,e,!0)}},{key:"peek",value:function(e){return y(this,e,!1)}},{key:"pop",value:function(){var e=this[h].tail;return e?(k(this,e),e.value):null}},{key:"del",value:function(e){k(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 y(e,n,!1)}))}}]),e}(),y=function(e,t,n){var r=e[p].get(t);if(r){var i=r.value;if(b(e,i)){if(k(e,r),!e[c])return}else n&&(e[v]&&(r.value.now=Date.now()),e[h].unshiftNode(r));return i.value}},b=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;k(e,t),t=n}},k=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)}},w=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},x=function(e,t,n,r){var i=n.value;b(e,i)&&(k(e,n),e[c]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=g},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,l="object"==typeof self&&self&&self.Object===Object&&self,c=s||l||Function("return this")(),u=Object.prototype.toString,f=Math.max,d=Math.min,h=function(){return c.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,l,c=0,u=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function b(e){return c=e,s=setTimeout(k,t),u?y(e):a}function O(e){var n=e-l;return void 0===l||n>=t||n<0||m&&e-c>=o}function k(){var e=h();if(O(e))return w(e);s=setTimeout(k,function(e){var n=t-(e-l);return m?d(n,o-(e-c)):n}(e))}function w(e){return s=void 0,g&&r?y(e):(r=i=void 0,a)}function x(){var e=h(),n=O(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return b(l);if(m)return s=setTimeout(k,t),y(l)}return void 0===s&&(s=setTimeout(k,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),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},x.flush=function(){return void 0===s?a:w(h())},x}}).call(this,n(113))},,,,,,,,,,,function(e,t,n){"use strict";var r=n(112),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){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)?l+=s.charAt(c):u<128?l+=a[u]:u<2048?l+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?l+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(c)),l+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return l},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=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:l(s(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?u:10===e?f:u||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(a)?a:h(a);var s=p(e);return s.host?v(s.host,t):v(e,p(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),i=m(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function y(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function b(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:b("Height",t,n,r),width:b("Width",t,n,r)}}var k=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},w=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=E(e),s=E(t),c=l(e),u=a(t),f=parseFloat(u.borderTopWidth),h=parseFloat(u.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:o.top-s.top-f,left:o.left-s.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var v=parseFloat(u.marginTop),m=parseFloat(u.marginLeft);p.top-=f-v,p.bottom-=f-v,p.left-=h-m,p.right-=h-m,p.marginTop=v,p.marginLeft=m}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(p=g(p,t)),p}function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=C(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:m(n),s=t?0:m(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return S(l)}function P(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=s(e);return!!n&&P(n)}function T(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function A(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?T(e):v(e,c(t));if("viewport"===r)o=M(a,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=l(s(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===r?e.ownerDocument.documentElement:r;var f=C(u,a,i);if("HTML"!==u.nodeName||P(a))o=f;else{var d=O(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var m="number"===typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function D(e){return e.width*e.height}function R(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=A(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return j({key:e},s[e],{area:D(s[e])})})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function N(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?T(t):v(t,c(n));return C(n,i,r)}function _(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function L(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function I(e,t,n){n=n.split("-")[0];var r=_(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[c]:t[L(s)],i}function $(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function z(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=$(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function B(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=N(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=R(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=I(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=z(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function F(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function W(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ie="counterclockwise";function oe(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf($(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return c=c.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){return S("%p"===a?n:r)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))})),c.forEach((function(e,t){e.forEach((function(n,r){Y(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var ae={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:x({},l,o[l]),end:x({},l,o[l]+o[c]-a[c])};e.offsets.popper=j({},a,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=Y(+n)?[+n,0]:oe(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=W("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=A(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var c=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]l[e]&&!t.escapeWithReference&&(r=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),x({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=j({},u,f[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!J(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,s=o.popper,l=o.reference,c=-1!==["left","right"].indexOf(i),u=c?"height":"width",f=c?"Top":"Left",d=f.toLowerCase(),h=c?"left":"top",p=c?"bottom":"right",v=_(r)[u];l[p]-vs[p]&&(e.offsets.popper[d]+=l[d]+v-s[p]),e.offsets.popper=S(e.offsets.popper);var m=l[d]+l[u]/2-v/2,g=a(e.instance.popper),y=parseFloat(g["margin"+f]),b=parseFloat(g["border"+f+"Width"]),O=m-e.offsets.popper[d]-y-b;return O=Math.max(Math.min(s[u]-v,O),0),e.arrowElement=r,e.offsets.arrow=(x(n={},d,Math.round(O)),x(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(F(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=A(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=L(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case ne:a=[r,i];break;case re:a=te(r);break;case ie:a=te(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=L(r);var c=e.offsets.popper,u=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(u.left)||"right"===r&&f(c.left)f(u.top)||"bottom"===r&&f(c.top)f(n.right),v=f(c.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&v||"bottom"===r&&m,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&v||!y&&"end"===o&&m),O=!!t.flipVariationsByContent&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&m||!y&&"end"===o&&v),k=b||O;(d||g||k)&&(e.flipped=!0,(d||g)&&(r=a[l+1]),k&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=j({},e.offsets.popper,I(e.instance.popper,e.offsets.reference,e.placement)),e=z(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=L(t),e.offsets.popper=S(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!J(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=$(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};k(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=j({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(j({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=j({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return j({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return w(e,[{key:"update",value:function(){return B.call(this)}},{key:"destroy",value:function(){return V.call(this)}},{key:"enableEventListeners",value:function(){return U.call(this)}},{key:"disableEventListeners",value:function(){return X.call(this)}}]),e}();le.Utils=("undefined"!==typeof window?window:e).PopperUtils,le.placements=Z,le.Defaults=se,t.a=le}).call(this,n(113))},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=a},function(e,t,n){"use strict";var r=n(51),i=n(52);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(53)).default)(o.createElement("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"}),"TableChart");t.default=a},function(e,t,n){var r;window,r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./react/uplot-react.tsx")}({"./common/index.ts":function(e,t,n){"use strict";n.r(t),n.d(t,"optionsUpdateState",(function(){return i})),n.d(t,"dataMatch",(function(){return o}));var r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i=g&&!o||"t"===o?(m+=d.abbreviations.trillion,t/=g):a=y&&!o||"b"===o?(m+=d.abbreviations.billion,t/=y):a=b&&!o||"m"===o?(m+=d.abbreviations.million,t/=b):(a=O&&!o||"k"===o)&&(m+=d.abbreviations.thousand,t/=O)),e._.includes(n,"[.]")&&(p=!0,n=n.replace("[.]",".")),s=t.toString().split(".")[0],l=n.split(".")[1],u=n.indexOf(","),v=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,l?(e._.includes(l,"[")?(l=(l=l.replace("]","")).split("["),k=e._.toFixed(t,l[0].length+l[1].length,r,l[1].length)):k=e._.toFixed(t,l.length,r),s=k.split(".")[0],k=e._.includes(k,".")?d.delimiters.decimal+k.split(".")[1]:"",p&&0===Number(k.slice(1))&&(k="")):s=e._.toFixed(t,0,r),m&&!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),w=!0),s.length0;x--)s="0"+s;return u>-1&&(s=s.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),0===n.indexOf(".")&&(s=""),f=s+k+(m||""),h?f=(h&&w?"(":"")+f+(h&&w?")":""):c>=0?f=0===c?(w?"-":"+")+f:f+(w?"-":"+"):w&&(f="-"+f),f},stringToNumber:function(e){var t,n,r,o=i[a.currentLocale],s=e,l={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,".")),l)if(r=new RegExp("[^a-zA-Z]"+o.abbreviations[t]+"(?:\\)|(\\"+o.currency.symbol+")?(?:\\))?)?$"),s.match(r)){n*=Math.pow(10,l[t]);break}n*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),n*=Number(e)}return n},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return"number"===typeof e&&isNaN(e)})),includes:function(e,t){return-1!==e.indexOf(t)},insert:function(e,t,n){return e.slice(0,n)+t+e.slice(n)},reduce:function(e,t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!==typeof t)throw new TypeError(t+" is not a function");var n,r=Object(e),i=r.length>>>0,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,l=e.toString().split("."),c=t-(r||0);return i=2===l.length?Math.min(Math.max(l[1].length,c),t):c,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,l,c,u;if("string"!==typeof t&&(t+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",t)),(t=t.trim()).match(/^\d+$/))return!0;if(""===t)return!1;try{c=e.localeData(n)}catch(f){c=e.localeData(e.locale())}return o=c.currency.symbol,s=c.abbreviations,r=c.delimiters.decimal,i="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(u=t.match(/^[^\d]+/))||(t=t.substr(1),u[0]===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))&&(l=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(l):1===a[0].length?!!a[0].match(/^\d+$/)&&!a[0].match(l)&&!!a[1].match(/^\d+$/):!!a[0].match(/^\d+.*\d$/)&&!a[0].match(l)&&!!a[1].match(/^\d+$/)))},e.fn=s.prototype={clone:function(){return e(this)},format:function(t,n){var i,o,s,l=this._value,c=t||a.defaultFormat;if(n=n||Math.round,0===l&&null!==a.zeroFormat)o=a.zeroFormat;else if(null===l&&null!==a.nullFormat)o=a.nullFormat;else{for(i in r)if(c.match(r[i].regexps.format)){s=r[i].format;break}o=(s=s||e._.numberToFormat)(l,c,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,l,c=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<=c.suffixes.length;a++)if(s=Math.pow(c.base,a),l=Math.pow(c.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){"use strict";(function(e){n.d(t,"a",(function(){return T}));var r,i=n(25),o=n(18),a=n(17),s=n(3),l=n(5),c=n(6),u=n(23),f=function(){function e(t,n,r,i,o,a,s,c,u){var f=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10?arguments[10]:void 0;Object(l.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=c,this.curContext=u,this.lookAhead=f,this.parent=d}return Object(c.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(l.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(l.a)(this,e),this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}return Object(c.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(l.a)(this,e),this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,0==this.index&&this.maybeNext()}return Object(c.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(l.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(l.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(c.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}(),y=function(){function e(t,n){Object(l.a)(this,e),this.data=t,this.id=n}return Object(c.a)(e,[{key:"token",value:function(e,t){!function(e,t,n,r){var i=0,o=1<0){var u=e[c];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=l+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}();y.prototype.contextual=y.prototype.fallback=y.prototype.extend=!1;function b(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 l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}var O,k="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),w=null;function x(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 j,S=function(){function e(t,n){Object(l.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(c.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?x(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?x(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}(),E=function(){function e(t,n){Object(l.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(c.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,l=0;lu.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),!c.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(c.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 l=this.tokens.getMainToken(a);t.push(l.value,l.end)}break}if(!i.length){var c=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,l=this.fragments.nodeAt(r);l;){var c=this.parser.nodeSet.types[l.type.id]==l.type?i.getGoto(e.state,l.type.id):-1;if(c>-1&&l.length&&(!a||(l.prop(u.b.contextHash)||0)==s))return e.useNode(l,c),k&&console.log(o+this.stackID(e)+" (via reuse of ".concat(i.getName(l.type.id),")")),!0;if(!(l instanceof u.f)||0==l.children.length||l.positions[0]>0)break;var f=l.children[0];if(!(f instanceof u.f&&0==l.positions[0]))break;l=f}var d=i.stateSlot(e.state,4);if(d>0)return e.reduce(d),k&&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(b):n.push(b)}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 M(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(),k&&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(k&&console.log(d+this.stackID(f)+" (via force-reduce)"),this.advanceFully(f,n))break;k&&(d=this.stackID(f)+" -> ")}var p,v=Object(s.a)(a.recoverByInsert(l));try{for(v.s();!(p=v.n()).done;){var m=p.value;k&&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?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),k&&console.log(u+this.stackID(a)+" (via recover-delete ".concat(this.parser.getName(l),")")),M(a,n)):(!r||r.score=0)d(O,m,v[g++]);else{for(var k=v[g+-O],w=-O;w>0;w--)d(v[g++],m,k);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:c[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 x=b(e.tokenData);if(r.context=e.context,r.specialized=new Uint16Array(e.specialized?e.specialized.length:0),r.specializers=[],e.specialized)for(var j=0;j2&&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 l=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 l=null,c=0;c68?1900:2e3)},s=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=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=c("months"),n=(c("monthsShort")||t.map((function(e){return e.substr(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(e){this.year=a(e)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l};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,l=0;l-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,l=r.minutes,c=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,y=l||0,b=c||0,O=u||0;return f?new Date(Date.UTC(v,m,p,g,y,b,O+60*f.offset*1e3)):n?new Date(Date.UTC(v,m,p,g,y,b,O)):new Date(v,m,p,g,y,b,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";return function(e,t,n){var r=t.prototype,i=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return i.bind(this)(e);var r=this.$utils(),o=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(o)}}}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return ce}));var r,i,o=n(5),a=n(6),s=n(141),l=29,c=39,u=123,f=126,d=128,h=129,p=132,v=135,m=136,g=138,y={inf:146,nan:147,bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},b={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},k=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 $(e){var t;if(!e)return i.none;switch(e.type.id){case l:case f:return $(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 $(N(e,l));case c:var n=$(e.firstChild),r=$(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?M(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"}(P||(P={}));var z=n(21);var B,F=function(){function e(t){Object(o.a)(this,e),this.tree=Object(z.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 l:return this.checkAST(e.firstChild);case 30:this.checkAggregationExpr(e);break;case c:this.checkBinaryExpr(e);break;case 54:this.checkCallFunction(e);break;case 127:case u:this.checkAST(N(e,l));break;case 130:var t=this.checkAST(N(e,l));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,l));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,l));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 $(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,l);if(r){this.expectType(r,i.vector,"aggregation expression");var o=N(e,37,38,38,l);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),l=_(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!==c)return null;var n={card:P.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(j.a)(o);try{for(s.s();!(a=s.n()).done;){var l=a.value;n.matchingLabels.push(e.sliceDoc(l.from,l.to))}}catch(m){s.e(m)}finally{s.f()}}}var u=r.getChild(4),f=r.getChild(5);if(u||f){n.card=u?P.CardManyToOne:P.CardOneToMany;var d=I(r.getChild(33),34,35);if(d.length>0){var h,p=Object(j.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===P.CardOneToOne&&(n.card=P.CardManyToMany),n}(this.state,e);if(null!==u&&u.on){var f,d=Object(j.a)(u.matchingLabels);try{for(d.s();!(f=d.n()).done;){var h,p=f.value,v=Object(j.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?l&&((null===u||void 0===u?void 0:u.card)!==P.CardOneToMany&&(null===u||void 0===u?void 0:u.card)!==P.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===u||void 0===u?void 0:u.card)!==P.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||!l||this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}else this.addDiagnostic(e,"left or right expression is missing in binary expression")}},{key:"checkCallFunction",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=I(N(e,37),38,l),i=M(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;c=i.argTypes.length-1}this.expectType(r[u],i.argTypes[c],'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 T(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(60),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"}(B||(B={}));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(z.j)(r).resolve(i,-1),a=function(e,t){var n,r,i,o,a,s,y,b,O,k,w,x,j,S,E,C,M=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===f){M.push({kind:B.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===m){M.push({kind:B.MatchOp});break}if((null===(i=t.parent)||void 0===i?void 0:i.type.id)===u){M.push({kind:B.Duration});break}if((null===(o=t.parent)||void 0===o?void 0:o.type.id)===h&&_(t.parent,124)){M.push({kind:B.Duration});break}var P=e.sliceDoc(t.from,t.to);V.filter((function(e){return e.label.includes(P)})).length>0&&M.push({kind:B.BinOp});break;case 57:if(0===(null===(a=t.parent)||void 0===a?void 0:a.type.id)){var T=t.parent.parent;if(141===(null===T||void 0===T?void 0:T.type.id)){M.push({kind:B.AtModifiers});break}if(30===(null===T||void 0===T?void 0:T.type.id)){M.push({kind:B.AggregateOpModifier},{kind:B.BinOp});break}if((null===T||void 0===T?void 0:T.type.id)===p){var D=U(t,e);H.filter((function(e){return e.label===D})).length>0&&M.push({kind:B.AggregateOpModifier}),M.push({kind:B.BinOp},{kind:B.Offset});break}if(T&&L(T,l)){M.push({kind:B.BinOp},{kind:B.Offset});break}}var $=null===(b=null===(y=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===y?void 0:y.parent)||void 0===b?void 0:b.parent;if(!$){M.push({kind:B.MetricName,metricName:e.sliceDoc(t.from,t.to)});break}L($,l,l)?$.type.id!==c||_($,0)||(M.push({kind:B.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:B.Function},{kind:B.Aggregation},{kind:B.BinOpModifier},{kind:B.Number}),_($,48,49,50,51,52,53)&&!N($,41,1)&&M.push({kind:B.Bool})):(M.push({kind:B.MetricName,metricName:e.sliceDoc(t.from,t.to)},{kind:B.Function},{kind:B.Aggregation}),38!==$.type.id&&$.type.id!==u&&M.push({kind:B.Number}));break;case 28:t.firstChild||M.push({kind:B.MetricName,metricName:""},{kind:B.Function},{kind:B.Aggregation},{kind:B.Number});break;case 33:M.push({kind:B.LabelName});break;case 134:M.push({kind:B.LabelName,metricName:U(t,e)});break;case 36:35===(null===(O=t.parent)||void 0===O?void 0:O.type.id)?M.push({kind:B.LabelName}):(null===(k=t.parent)||void 0===k?void 0:k.type.id)===m&&M.push({kind:B.LabelName,metricName:U(t,e)});break;case d:if((null===(w=t.parent)||void 0===w?void 0:w.type.id)===m){var z="";36===(null===(x=t.parent.firstChild)||void 0===x?void 0:x.type.id)&&(z=e.sliceDoc(t.parent.firstChild.from,t.parent.firstChild.to));var F=U(t,e),W=A(I(R(t,v),v,m),e);M.push({kind:B.LabelValue,metricName:F,labelName:z,matchers:W})}break;case 125:0===(null===(j=t.parent)||void 0===j?void 0:j.type.id)&&(null===(S=t.parent.parent)||void 0===S?void 0:S.type.id)===h?M.push({kind:B.Duration}):M.push({kind:B.Number});break;case 124:case f:M.push({kind:B.Duration});break;case 37:M.push({kind:B.MetricName,metricName:""},{kind:B.Function},{kind:B.Aggregation});break;case 53:137===(null===(E=t.parent)||void 0===E?void 0:E.type.id)?M.push({kind:B.MatchOp}):(null===(C=t.parent)||void 0===C?void 0:C.type.id)===c&&M.push({kind:B.BinOp});break;case g:case 139:case 140:case 137:M.push({kind:B.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 c:M.push({kind:B.BinOp})}return M}(r,o),s=Promise.resolve([]),y=!1,b=!0,O=Object(j.a)(a);try{var k=function(){var e=t.value;switch(e.kind){case B.Aggregation:y=!0,s=s.then((function(e){return e.concat(q.aggregateOp)}));break;case B.Function:y=!0,s=s.then((function(e){return e.concat(q.functionIdentifier)}));break;case B.BinOpModifier:s=s.then((function(e){return e.concat(q.binOpModifier)}));break;case B.BinOp:s=s.then((function(e){return e.concat(q.binOp)}));break;case B.MatchOp:s=s.then((function(e){return e.concat(q.matchOp)}));break;case B.AggregateOpModifier:s=s.then((function(e){return e.concat(q.aggregateOpModifier)}));break;case B.Duration:b=!1,s=s.then((function(e){return e.concat(q.duration)}));break;case B.Offset:s=s.then((function(e){return e.concat([{label:"offset"}])}));break;case B.Bool:s=s.then((function(e){return e.concat([{label:"bool"}])}));break;case B.AtModifiers:s=s.then((function(e){return e.concat(q.atModifier)}));break;case B.Number:s=s.then((function(e){return e.concat(q.number)}));break;case B.MetricName:s=s.then((function(t){return n.autocompleteMetricName(t,e)}));break;case B.LabelName:s=s.then((function(t){return n.autocompleteLabelName(t,e)}));break;case B.LabelValue:s=s.then((function(t){return n.autocompleteLabelValue(t,e)}))}};for(O.s();!(t=O.n()).done;)k()}catch(w){O.e(w)}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,l=e.from;return 134===e.type.id||33===e.type.id?l=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?l++:(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)))&&(l=t),l}(o,i),i,y,b)}))}},{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(j.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(j.a)(r);try{for(i.s();!(n=i.n()).done;){var o=Object(x.a)(n.value,2),a=o[0],s=o[1],l=t[a.replace(/(_count|_sum|_bucket)$/,"")];if(l)if(l.length>1){var c,u=Object(j.a)(l);try{for(u.s();!(c=u.n()).done;){var f=c.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===l.length){var d=l[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(118),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(j.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(102),ae=function(){function e(){Object(o.a)(this,e)}return Object(a.a)(e,[{key:"promQL",value:function(){return function(e){var t=new F(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();function se(e,t){return Object(oe.b)(e.call(t))}function le(e){return z.b.define({parser:k.configure({top:e,props:[Object(w.b)({LineComment:w.c.comment,LabelName:w.c.labelName,StringLiteral:w.c.string,NumberLiteral:w.c.number,Duration:w.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":w.c.function(w.c.variableName),"Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":w.c.operatorKeyword,"By Without Bool On Ignoring GroupLeft GroupRight Offset Start End":w.c.modifier,"And Unless Or":w.c.logicOperator,"Sub Add Mul Mod Div Atan2 Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow At":w.c.operator,UnaryOp:w.c.arithmeticOperator,"( )":w.c.paren,"[ ]":w.c.squareBracket,"{ }":w.c.brace,"\u26a0":w.c.invalid})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}})}!function(e){e.PromQL="PromQL",e.MetricName="MetricName"}(ie||(ie={}));var ce=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=le(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(19),i=n(7),o=n(209),a=n(1),s=["xs","sm","md","lg","xl"];function l(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,o=void 0===r?"px":r,l=e.step,c=void 0===l?5:l,u=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(o,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},u)}function c(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(156),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={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"},b=n(22),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function w(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(b.f)(e.main,i):"dark"===t&&(e.dark=Object(b.b)(e.main,o)))}function x(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,l=e.error,c=void 0===l?{light:v[300],main:v[500],dark:v[700]}:l,x=e.warning,j=void 0===x?{light:m[300],main:m[500],dark:m[700]}:x,S=e.info,E=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,C=e.success,M=void 0===C?{light:y[300],main:y[500],dark:y[700]}:C,P=e.type,T=void 0===P?"light":P,A=e.contrastThreshold,D=void 0===A?3:A,R=e.tonalOffset,N=void 0===R?.2:R,_=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function L(e){return Object(b.e)(e,k.text.primary)>=D?k.text.primary:O.text.primary}var I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return w(e,"light",n,N),w(e,"dark",r,N),e.contrastText||(e.contrastText=L(e.main)),e},$={dark:k,light:O};return Object(o.a)(Object(a.a)({common:f,type:T,primary:I(n),secondary:I(s,"A400","A200","A700"),error:I(c),warning:I(j),info:I(E),success:I(M),grey:d,contrastThreshold:D,getContrastText:L,augmentColor:I,tonalOffset:N},$[T]),_)}function j(e){return Math.round(1e5*e)/1e5}function S(e){return j(e)}var E={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function M(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?C:r,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,f=void 0===u?300:u,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,y=n.htmlFontSize,b=void 0===y?16:y,O=n.allVariants,k=n.pxToRem,w=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var x=c/14,M=k||function(e){return"".concat(e/b*x,"rem")},P=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:M(t),lineHeight:n},s===C?{letterSpacing:"".concat(j(r/t),"em")}:{},i,O)},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,E),caption:P(h,12,1.66,.4),overline:P(h,12,2.66,1,E)};return Object(o.a)(Object(a.a)({htmlFontSize:b,pxToRem:M,round:S,fontFamily:s,fontSize:c,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},T),w,{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)],A={borderRadius:4},D=n(287);function R(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(D.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,s=e.palette,u=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=x(u),m=l(n),g=R(f),y=Object(o.a)({breakpoints:m,direction:"ltr",mixins:c(m,g,a),overrides:{},palette:v,props:{},shadows:T,typography:M(v,h),spacing:g,shape:A,transitions:N.a,zIndex:_.a},p),b=arguments.length,O=new Array(b>1?b-1:0),k=1;k0&&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),y=v(0,!0),b=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(l.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=x,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,x)}},{key:"selection",value:function(t){return new e(void 0,x,void 0,void 0,t)}}]),e}();function k(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 w(e,t){return e.length?t.length?e.concat(t):e:t}var x=[];function j(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),k(e,e.length-1,1e9,n.setSelAfter(r)))}return[O.selection([t])]}function S(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function E(e,t){if(!e.length)return e;for(var n=e.length,r=x;n;){var i=C(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)]:x}function C(e,t,n){var r=w(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):x,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 M=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;Object(s.a)(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Object(l.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,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<=l&&(r=!0)}})),r}(s.changes,t.changes)||"input.type.compose"==r)?k(a,a.length-1,o,new O(t.changes.compose(s.changes),w(t.effects,s.effects),s.mapped,s.startSelection,x)):k(a,a.length,o,t),new e(a,x,n,r)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:x;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(l.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(l.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",l=Object(a.a)(r);try{for(l.s();!(o=l.n()).done;){var c=o.value;c.toDOM&&this.dom.appendChild(c.toDOM(e));var u=c.elementClass;u&&(s+=" "+u)}}catch(f){l.e(f)}finally{l.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(T.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(l.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),F(),J]}function ee(e){for(var t=9;tr&&(r=s,n.push(te.range(s)))}}}catch(l){i.e(l)}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 le=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(l){r.e(l)}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 ce(e,t,n){var r,i=null;return null===(r=e.field(le,!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(le,!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(le,!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=ce(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 ye(t,!0),r=new ye(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(l.a)(e,[{key:"update",value:function(e){(e.docChanged||e.viewportChanged||e.startState.facet(D.i)!=e.state.facet(D.i)||e.startState.field(le,!1)!=e.state.field(le,!1))&&(this.markers=this.buildMarkers(e.view))}},{key:"buildMarkers",value:function(e){var t=new R.b;return e.viewportLines((function(i){var o=ce(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,$({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 ye(t,!1)},domEventHandlers:{click:function(e,t){var n=ce(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"}}),ke=n(103),we=n(65),xe=n(15),je={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}}),Ee=o.j.define({map:function(e,t){return t.mapPos(e)}}),Ce=new(function(e){Object(T.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));Ce.startSide=1,Ce.endSide=-1;var Me=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:[Ce.range(t.value,t.value+1)]}):t.is(Ee)&&(e=e.update({filter:function(e){return e!=t.value}}))};for(o.s();!(i=o.n()).done;)s()}catch(l){o.e(l)}finally{o.f()}return e}});function Pe(){return[i.d.inputHandler.of(Re),Me]}var Te="()[]{}<>";function Ae(e){for(var t=0;t2||2==r.length&&1==Object(xe.c)(Object(xe.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||je.brackets,o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=Ae(Object(xe.b)(s,0));if(t==s)return l==s?ze(e,s,i.indexOf(s+s+s)>-1):Ie(e,s,l,r.before||je.before);if(t==l&&_e(e,e.selection.main.from))return $e(e,s,l)}}catch(c){o.e(c)}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||je.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(xe.c)(Object(xe.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),l=Object(a.a)(r);try{for(l.s();!(n=l.n()).done;){var c=n.value;if(c==s&&Le(t.doc,e.head)==Ae(Object(xe.b)(c,0)))return{changes:{from:e.head-c.length,to:e.head+c.length},range:o.e.cursor(e.head-c.length),userEvent:"delete.backward"}}}catch(u){l.e(u)}finally{l.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function _e(e,t){var n=!1;return e.field(Me).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(xe.c)(Object(xe.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 $e(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 Ee.of(t)}))})}function ze(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(Be(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 l=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:o.e.cursor(a+t.length*(l?3:1)),effects:Ee.of(a)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&Be(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 c=e.sliceDoc(a-1,a);if(c!=t&&e.charCategorizer(a)(c)!=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 Be(e,t){var n=Object(D.j)(e).resolveInner(t+1);return n.parent&&n.from==t}var Fe=n(13),We=n(61),Ve=n(28),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(l.a)(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Object(xe.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(xe.g)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Object(xe.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(l.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(Fe.a)(n,5),s=a[1],l=a[2],c=a[3],u=a[4],f=c?+c.slice(1):0,d=l?+l:i.number;if(l&&u){var h=d/100;s&&(h=h*("-"==s?-1:1)+i.number/r.doc.lines),d=Math.round(r.doc.lines*h)}else l&&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=[lt,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(l.a)(e,[{key:"update",value:function(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t=e.state.facet(rt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,l=r.main,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return i.b.none;var u=n.wordAt(l.head);if(!u)return i.b.none;c=n.charCategorizer(l.head),s=n.sliceDoc(u.from,u.to)}else{var f=l.to-l.from;if(f200)return i.b.none;if(!(s=n.sliceDoc(l.from,l.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,y=g.from,b=g.to;if((!c||(0==y||c(n.sliceDoc(y-1,y))!=o.d.Word)&&(b==n.doc.length||c(n.sliceDoc(b,b+1))!=o.d.Word))&&(c&&y<=l.from&&b>=l.to?h.push(at.range(y,b)):(y>=l.to||b<=l.from)&&h.push(ot.range(y,b)),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}}),lt=i.d.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});var ct=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(l.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(T.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(l.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(T.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(l.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(Ct(e),Et)},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?Et: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"}),yt=i.b.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bt=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(l.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,c,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?yt: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):Mt(t)}}var kt=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)})),wt=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)})),xt=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)})),jt=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 l,c,u=[];if(s.from==o&&s.to==a&&(c=r.toText(n.getReplacement(s)),u.push({from:s.from,to:s.to,insert:c}),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-c.length;l={anchor:s.from-f,head:s.to-f}}return e.dispatch({changes:u,selection:l,scrollIntoView:!!l,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 Et(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(ct).top}}function Ct(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(ct).matchCase;return t&&!i?t:new ft(i.replace(/\n/g,"\\n"),"",o)}var Mt=function(e){var t=e.state.field(vt,!1);if(t&&t.panel){var n=Object(We.a)(e,Et);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(Ct(e.state,t.query)):o.j.appendConfig.of(_t)]});return!0},Pt=function(e){var t=e.state.field(vt,!1);if(!t||!t.panel)return!1;var n=Object(We.a)(e,Et);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:pt.of(!1)}),!0},Tt=[{key:"Mod-f",run:Mt,scope:"editor search-panel"},{key:"F3",run:kt,shift:wt,scope:"editor search-panel"},{key:"Mod-g",run:kt,shift:wt,scope:"editor search-panel"},{key:"Escape",run:Pt,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,l=[],c=0,u=new Qe(t.doc,t.sliceDoc(a,s));!u.next().done;){if(l.length>1e3)return!1;u.value.from==a&&(c=l.length),l.push(o.e.range(u.value.from,u.value.to))}return n(t.update({selection:o.e.create(l,c)})),!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 c=r,l=n,"continue";if(a){var o=e.wordAt(r.value.from);if(!o||o.from!=r.value.from||o.to!=r.value.to)return c=r,l=n,"continue"}return l=n,c=r,{v:r.value}}if(n)return c=r,l=n,{v:null};r=new Qe(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),l=n=!0,c=r},l=!1,c=new Qe(e.doc,t,i[i.length-1].to);;){var u=s(l,c);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 l(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?wt:kt)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),jt(e.view))},class:"cm-search"},[n,l("next",(function(){return kt(e.view)}),[t("next")]),l("prev",(function(){return wt(e.view)}),[t("previous")]),l("select",(function(){return xt(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,l("replace",(function(){return jt(e.view)}),[t("replace")]),l("replaceAll",(function(){return St(e.view)}),[t("replace all")]),Object(Ve.a)("button",{name:"close",onclick:function(){return Pt(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),l=Math.min(a,r+30),c=e.state.sliceDoc(s,l);if(s!=o)for(var u=0;u<30;u++)if(!Dt.test(c[u+1])&&Dt.test(c[u])){c=c.slice(u);break}if(l!=a)for(var f=c.length-1;f>c.length-30;f--)if(!Dt.test(c[f-1])&&Dt.test(c[f])){c=c.slice(0,f);break}return i.d.announce.of("".concat(e.state.phrase("current match"),". ").concat(c," ").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(bt),Nt],Lt=n(60);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 $t=It(Vt,0),zt=It(Wt,0),Bt=[{key:"Mod-/",run:function(e){var t=Ft(e.state);return t.line?$t(e):!!t.block&&zt(e)}},{key:"Alt-A",run:zt}];function Ft(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 Ft(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,l=e.sliceDoc(n-50,n),c=e.sliceDoc(r,r+50),u=/\s*$/.exec(l)[0].length,f=/^\s*/.exec(c)[0].length,d=l.length-u;if(l.slice(d-a.length,d)==a&&c.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 l=n.length+1;return{changes:[{from:e.from,insert:n+" "},{from:e.to,insert:" "+s}],range:o.e.range(e.anchor+l,e.head+l)}}))}if(1!=e&&i.some((function(e){return e}))){for(var s,l=[],c=0;co&&(c==u||u>p.from)){o=p.from;var v=Ft(n,h).line;if(!v)continue;var m=/^\s*/.exec(p.text)[0].length,g=m==p.length,y=p.text.slice(m,m+v.length)==v?m:-1;m=0}))){var P,T=[],A=Object(a.a)(i);try{for(A.s();!(P=A.n()).done;){var D=P.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++,T.push({from:L,to:I})}}}catch($){A.e($)}finally{A.f()}return{changes:T}}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(xe.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 l=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),l=Math.max(t.off,n.off),c=r;c<=i;c++){var u=e.doc.line(c);u.length<=l&&a.push(o.e.range(u.from+s,u.to+l))}else for(var f=Math.min(t.col,n.col),d=Math.max(t.col,n.col),h=r;h<=i;h++){var p=e.doc.line(h),v=Object(xe.f)(p.text,f,e.tabSize,!0);if(v>-1){var m=Object(xe.f)(p.text,d,e.tabSize);a.push(o.e.range(p.from+v,p.from+m))}}return a}(e.state,n,s);return l.length?a?o.e.create(l.concat(r.ranges)):o.e.create(l):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(102),Gt=[Z(),re(),Object(i.j)(),p(),be(),Object(i.h)(),o.f.allowMultipleSelections.of(!0),Object(D.f)(),Xt.a.fallback,Object(we.a)(),Pe(),Object(Lt.a)(),Ut(),Object(i.i)(),it(),i.k.of([].concat(Object(r.a)(Ne),Object(r.a)(ke.a),Object(r.a)(Tt),Object(r.a)(P),Object(r.a)(de),Object(r.a)(Bt),Object(r.a)(Lt.b),Object(r.a)(Yt.a)))]},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=n.n(r),o=n(92);function a(){return i.a.useContext(o.a)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n