text: (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[102],{86876:function(t,e,n){"use strict";n.d(e,{wQ:function(){return kt},xi:function(){return mt},at:function(){return gt}});var r=n(77885),i=n(23414),o=n(19753),a=n(64928),s=n(26856);function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var h=o.tk.baseTheme({".cm-matchingBracket":{color:"#0b0"},".cm-nonmatchingBracket":{color:"#a22"}}),c=1e4,f="()[]{}",d=r.r$.define({combine:function(t){return(0,r.BO)(t,{afterCursor:!0,brackets:f,maxScanDistance:c})}}),v=o.p.mark({class:"cm-matchingBracket"}),p=o.p.mark({class:"cm-nonmatchingBracket"});r.QQ.define({create:function(){return o.p.none},update:function(t,e){if(!e.docChanged&&!e.selection)return t;var n,r=[],i=e.state.facet(d),a=u(e.state.selection.ranges);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.empty){var l=m(e.state,s.head,-1,i)||s.head>0&&m(e.state,s.head-1,1,i)||i.afterCursor&&(m(e.state,s.head,1,i)||s.head<e.state.doc.length&&m(e.state,s.head+1,-1,i));if(l){var h=l.matched?v:p;r.push(h.range(l.start.from,l.start.to)),l.end&&r.push(h.range(l.end.from,l.end.to))}}}}catch(c){a.e(c)}finally{a.f()}return o.p.set(r,!0)},provide:function(t){return o.tk.decorations.from(t)}});function g(t,e,n){var r=t.prop(e<0?s.md.openedBy:s.md.closedBy);if(r)return r;if(1==t.name.length){var i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function m(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||c,s=i.brackets||f,u=(0,a.qz)(t),l=u.resolve(e,n);return(r=g(l.type,n,s))?y(t,e,n,l,r,s):k(t,e,n,u,l.type,o,s)}function y(t,e,n,r,i,o){var a=r.parent,s={from:r.from,to:r.to},u=0,l=null==a?void 0:a.cursor;if(l&&(n<0?l.childBefore(r.from):l.childAfter(r.to)))do{if(n<0?l.to<=r.from:l.from>=r.to){if(0==u&&i.indexOf(l.type.name)>-1)return{start:s,end:{from:l.from,to:l.to},matched:!0};if(g(l.type,n,o))u++;else if(g(l.type,-n,o)&&0==--u)return{start:s,end:{from:l.from,to:l.to},matched:!1}}}while(n<0?l.prevSibling():l.nextSibling());return{start:s,matched:!1}}function k(t,e,n,r,i,o,a){var s=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(s);if(u<0||u%2==0!=n>0)return null;for(var l={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),c=0,f=0;!h.next().done&&f<=o;){var d=h.value;n<0&&(f+=d.length);for(var v=e+f*n,p=n>0?0:d.length-1,g=n>0?d.length:-1;p!=g;p+=n){var m=a.indexOf(d[p]);if(!(m<0||r.resolve(v+p,1).type!=i))if(m%2==0==n>0)c++;else{if(1==c)return{start:l,end:{from:v+p,to:v+p+1},matched:m>>1==u>>1};c--}}n>0&&(f+=d.length)}return h.done?{start:l,matched:!1}:null}function b(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function S(t,e){return r.jT.create(t.ranges.map(e),t.mainIndex)}function x(t,e){return t.update({selection:e,scrollIntoView:!0,annotations:r.YW.userEvent.of("keyboardselection")})}function A(t,e){var n=t.state,r=t.dispatch,i=S(n.selection,e);return!i.eq(n.selection)&&(r(x(n,i)),!0)}function C(t,e){return r.jT.cursor(e?t.to:t.from)}function M(t,e){return A(t,(function(n){return n.empty?t.moveByChar(n,e):C(n,e)}))}var O=function(t){return M(t,t.textDirection!=o.Nm.LTR)},T=function(t){return M(t,t.textDirection==o.Nm.LTR)};function D(t,e){return A(t,(function(n){return n.empty?t.moveByGroup(n,e):C(n,e)}))}function E(t,e,n){if(e.type.prop(n))return!0;var r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function P(t,e,n){for(var i=(0,a.qz)(t).resolve(e.head),o=n?s.md.closedBy:s.md.openedBy,u=e.head;;){var l=n?i.childAfter(u):i.childBefore(u);if(!l)break;E(t,l,o)?i=l:u=n?l.to:l.from}var h,c;return c=i.type.prop(o)&&(h=n?m(t,i.from,1):m(t,i.to,-1))&&h.matched?n?h.end.to:h.end.from:n?i.to:i.from,r.jT.cursor(c,n?-1:1)}function R(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e):C(n,e)}))}var B=function(t){return R(t,!1)},L=function(t){return R(t,!0)};function N(t,e){return A(t,(function(n){return n.empty?t.moveVertically(n,e,t.dom.clientHeight):C(n,e)}))}var j=function(t){return N(t,!1)},I=function(t){return N(t,!0)};function V(t,e,n){var i=t.visualLineAt(e.head),o=t.moveToLineBoundary(e,n);if(o.head==e.head&&o.head!=(n?i.to:i.from)&&(o=t.moveToLineBoundary(e,n,!1)),!n&&o.head==i.from&&i.length){var a=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;a&&e.head!=i.from+a&&(o=r.jT.cursor(i.from+a))}return o}var W=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from,1)}))},z=function(t){return A(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to,-1)}))};function H(t,e,n){var i=!1,o=S(t.selection,(function(e){var o=m(t,e.head,-1)||m(t,e.head,1)||e.head>0&&m(t,e.head-1,1)||e.head<t.doc.length&&m(t,e.head+1,-1);if(!o||!o.end)return e;i=!0;var a=o.start.from==e.head?o.end.to:o.end.from;return n?r.jT.range(e.anchor,a):r.jT.cursor(a)}));return!!i&&(e(x(t,o)),!0)}function _(t,e){var n=S(t.state.selection,(function(t){var n=e(t);return r.jT.range(t.anchor,n.head,n.goalColumn)}));return!n.eq(t.state.selection)&&(t.dispatch(x(t.state,n)),!0)}function q(t,e){return _(t,(function(n){return t.moveByChar(n,e)}))}var F=function(t){return q(t,t.textDirection!=o.Nm.LTR)},$=function(t){return q(t,t.textDirection==o.Nm.LTR)};function U(t,e){return _(t,(function(n){return t.moveByGroup(n,e)}))}function G(t,e){return _(t,(function(n){return t.moveVertically(n,e)}))}var K=function(t){return G(t,!1)},J=function(t){return G(t,!0)};function Y(t,e){return _(t,(function(n){return t.moveVertically(n,e,t.dom.clientHeight)}))}var X=function(t){return Y(t,!1)},Q=function(t){return Y(t,!0)},Z=function(t){return _(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).from)}))},tt=function(t){return _(t,(function(e){return r.jT.cursor(t.visualLineAt(e.head).to)}))},et=function(t){var e=t.state;return(0,t.dispatch)(x(e,{anchor:0})),!0},nt=function(t){var e=t.state;return(0,t.dispatch)(x(e,{anchor:e.doc.length})),!0},rt=function(t){var e=t.state;return(0,t.dispatch)(x(e,{anchor:e.selection.main.anchor,head:0})),!0},it=function(t){var e=t.state;return(0,t.dispatch)(x(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0};function ot(t,e){var n=t.state,i=t.dispatch,o=n.changeByRange((function(t){var n=t.from,i=t.to;if(n==i){var o=e(n);n=Math.min(n,o),i=Math.max(i,o)}return n==i?{range:t}:{changes:{from:n,to:i},range:r.jT.cursor(n)}}));return!o.changes.empty&&(i(n.update(o,{scrollIntoView:!0,annotations:r.YW.userEvent.of("delete")})),!0)}var at=function(t,e,n){return ot(t,(function(r){var o,s,u=t.state,l=u.doc.lineAt(r);if(!e&&r>l.from&&r<l.from+200&&!/[^ \t]/.test(o=l.text.slice(0,r-l.from))){if("\t"==o[o.length-1])return r-1;for(var h=(0,i.IS)(o,0,u.tabSize)%(0,a.y1)(u)||(0,a.y1)(u),c=0;c<h&&" "==o[o.length-1-c];c++)r--;return r}if(n){var f=l.text.slice(r-l.from+(e?0:-2),r-l.from+(e?2:0)),d=f?(0,i.nZ)((0,i.gm)(f,0)):1;s=e?Math.min(u.doc.length,r+d):Math.max(0,r-d)}else s=(0,i.cp)(l.text,r-l.from,e)+l.from;return s==r&&l.number!=(e?u.doc.lines:1)&&(s+=e?1:-1),s}))},st=function(t){return at(t,!0,!1)},ut=function(t,e){return ot(t,(function(n){for(var r=n,o=t.state,a=o.doc.lineAt(r),s=o.charCategorizer(r),u=null;;){if(r==(e?a.to:a.from)){r==n&&a.number!=(e?o.doc.lines:1)&&(r+=e?1:-1);break}var l=(0,i.cp)(a.text,r-a.from,e)+a.from,h=a.text.slice(Math.min(r,l)-a.from,Math.max(r,l)-a.from),c=s(h);if(null!=u&&c!=u)break;" "==h&&r==n||(u=c),r=l}return r}))},lt=function(t){return ut(t,!1)},ht=function(t){return ut(t,!0)};function ct(t){var e,n=[],r=-1,i=b(t.selection.ranges);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=t.doc.lineAt(o.from),s=t.doc.lineAt(o.to);r==a.number?n[n.length-1].to=s.to:n.push({from:a.from,to:s.to}),r=s.number}}catch(u){i.e(u)}finally{i.f()}return n}function ft(t,e,n){var r,i=[],o=b(ct(t));try{for(o.s();!(r=o.n()).done;){var a=r.value;if(n?a.to!=t.doc.length:0!=a.from){var s=t.doc.lineAt(n?a.to+1:a.from-1);n?i.push({from:a.to,to:s.to},{from:a.from,insert:s.text+t.lineBreak}):i.push({from:s.from,to:a.from},{from:a.to,insert:t.lineBreak+s.text})}}}catch(u){o.e(u)}finally{o.f()}return!!i.length&&(e(t.update({changes:i,scrollIntoView:!0})),!0)}function dt(t,e,n){var r,i=[],o=b(ct(t));try{for(o.s();!(r=o.n()).done;){var a=r.value;n?i.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):i.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)})}}catch(s){o.e(s)}finally{o.f()}return e(t.update({changes:i,scrollIntoView:!0})),!0}function vt(t,e){var n=-1;return t.changeByRange((function(i){for(var o=[],a=i.from;a<=i.to;){var s=t.doc.lineAt(a);s.number>n&&(i.empty||i.to>s.from)&&(e(s,o,i),n=s.number),a=s.to+1}var u=t.changes(o);return{changes:o,range:r.jT.range(u.mapPos(i.anchor,1),u.mapPos(i.head,1))}}))}var pt=function(t){var e=t.state,n=t.dispatch,r=Object.create(null),i=new a.Gn(e,{overrideIndentation:function(t){var e=r[t];return null==e?-1:e}}),o=vt(e,(function(t,n,o){var s=(0,a.K0)(i,t.from);if(null!=s){var u=/^\s*/.exec(t.text)[0],l=(0,a.SS)(e,s);(u!=l||o.from<t.from+u.length)&&(r[t.from]=s,n.push({from:t.from,to:t.from+u.length,insert:l}))}}));return o.changes.empty||n(e.update(o)),!0},gt=function(t){var e=t.state;return(0,t.dispatch)(e.update(vt(e,(function(t,n){n.push({from:t.from,insert:e.facet(a.c)})})))),!0},mt=function(t){var e=t.state;return(0,t.dispatch)(e.update(vt(e,(function(t,n){var r=/^\s*/.exec(t.text)[0];if(r){for(var o=(0,i.IS)(r,0,e.tabSize),s=0,u=(0,a.SS)(e,Math.max(0,o-(0,a.y1)(e)));s<r.length&&s<u.length&&r.charCodeAt(s)==u.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+r.length,insert:u.slice(s)})}})))),!0},yt=[{key:"ArrowLeft",run:O,shift:F},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function(t){return D(t,t.textDirection!=o.Nm.LTR)},shift:function(t){return U(t,t.textDirection!=o.Nm.LTR)}},{mac:"Cmd-ArrowLeft",run:W,shift:Z},{key:"ArrowRight",run:T,shift:$},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function(t){return D(t,t.textDirection==o.Nm.LTR)},shift:function(t){return U(t,t.textDirection==o.Nm.LTR)}},{mac:"Cmd-ArrowRight",run:z,shift:tt},{key:"ArrowUp",run:B,shift:K},{mac:"Cmd-ArrowUp",run:et,shift:rt},{mac:"Ctrl-ArrowUp",run:j,shift:X},{key:"ArrowDown",run:L,shift:J},{mac:"Cmd-ArrowDown",run:nt,shift:it},{mac:"Ctrl-ArrowDown",run:I,shift:Q},{key:"PageUp",run:j,shift:X},{key:"PageDown",run:I,shift:Q},{key:"Home",run:function(t){return A(t,(function(e){return V(t,e,!1)}))},shift:function(t){return _(t,(function(e){return V(t,e,!1)}))}},{key:"Mod-Home",run:et,shift:rt},{key:"End",run:function(t){return A(t,(function(e){return V(t,e,!0)}))},shift:function(t){return _(t,(function(e){return V(t,e,!0)}))}},{key:"Mod-End",run:nt,shift:it},{key:"Enter",run:function(t){var e=t.state,n=t.dispatch,o=e.changeByRange((function(t){var n=t.from,o=t.to,u=n==o&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};var n,r=(0,a.qz)(t).resolve(e),i=r.childBefore(e),o=r.childAfter(e);return i&&o&&i.to<=e&&o.from>=e&&(n=i.type.prop(s.md.closedBy))&&n.indexOf(o.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(e,n),l=new a.Gn(e,{simulateBreak:n,simulateDoubleBreak:!!u}),h=(0,a.K0)(l,n);null==h&&(h=/^\s*/.exec(e.doc.lineAt(n).text)[0].length);for(var c=e.doc.lineAt(n);o<c.to&&/\s/.test(c.text.slice(o-c.from,o+1-c.from));)o++;u?(n=u.from,o=u.to):n>c.from&&n<c.from+100&&!/\S/.test(c.text.slice(0,n))&&(n=c.from);var f=["",(0,a.SS)(e,h)];return u&&f.push((0,a.SS)(e,l.lineIndent(c))),{changes:{from:n,to:o,insert:i.xv.of(f)},range:r.jT.cursor(n+1+f[1].length)}}));return n(e.update(o,{scrollIntoView:!0})),!0}},{key:"Mod-a",run:function(t){var e=t.state;return(0,t.dispatch)(e.update({selection:{anchor:0,head:e.doc.length},annotations:r.YW.userEvent.of("keyboardselection")})),!0}},{key:"Backspace",run:function(t){return at(t,!1,!0)}},{key:"Delete",run:st},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lt},{key:"Mod-Delete",mac:"Alt-Delete",run:ht}].concat([{key:"Ctrl-b",run:O,shift:F},{key:"Ctrl-f",run:T,shift:$},{key:"Ctrl-p",run:B,shift:K},{key:"Ctrl-n",run:L,shift:J},{key:"Ctrl-a",run:W,shift:Z},{key:"Ctrl-e",run:z,shift:tt},{key:"Ctrl-d",run:st},{key:"Ctrl-h",run:function(t){return at(t,!1,!1)}},{key:"Ctrl-k",run:function(t){return ot(t,(function(e){var n=t.visualLineAt(e).to;return e<n?n:Math.min(t.state.doc.length,e+1)}))}},{key:"Alt-d",run:ht},{key:"Ctrl-Alt-h",run:lt},{key:"Ctrl-o",run:function(t){var e=t.state,n=t.dispatch,o=e.changeByRange((function(t){return{changes:{from:t.from,to:t.to,insert:i.xv.of(["",""])},range:r.jT.cursor(t.from)}}));return n(e.update(o,{scrollIntoView:!0,annotations:r.YW.userEvent.of("input")})),!0}},{key:"Ctrl-t",run:function(t){var e=t.state,n=t.dispatch,o=e.changeByRange((function(t){if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};var n=t.from,o=e.doc.lineAt(n),a=n==o.from?n-1:(0,i.cp)(o.text,n-o.from,!1)+o.from,s=n==o.to?n+1:(0,i.cp)(o.text,n-o.from,!0)+o.from;return{changes:{from:a,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(a,n))},range:r.jT.cursor(s)}}));return!o.changes.empty&&(n(e.update(o,{scrollIntoView:!0})),!0)}},{key:"Alt-f",run:function(t){return D(t,!0)},shift:function(t){return U(t,!0)}},{key:"Alt-b",run:function(t){return D(t,!1)},shift:function(t){return U(t,!1)}},{key:"Alt-<",run:et},{key:"Alt->",run:nt},{key:"Ctrl-v",run:I},{key:"Alt-v",run:j}].map((function(t){return{mac:t.key,run:t.run,shift:t.shift}}))),kt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(t){return A(t,(function(e){return P(t.state,e,t.textDirection!=o.Nm.LTR)}))},shift:function(t){return _(t,(function(e){return P(t.state,e,t.textDirection!=o.Nm.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(t){return A(t,(function(e){return P(t.state,e,t.textDirection==o.Nm.LTR)}))},shift:function(t){return _(t,(function(e){return P(t.state,e,t.textDirection==o.Nm.LTR)}))}},{key:"Alt-ArrowUp",run:function(t){return ft(t.state,t.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(t){return dt(t.state,t.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(t){return ft(t.state,t.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(t){return dt(t.state,t.dispatch,!0)}},{key:"Escape",run:function(t){var e=t.state,n=t.dispatch,i=e.selection,o=null;return i.ranges.length>1?o=r.jT.create([i.main]):i.main.empty||(o=r.jT.create([r.jT.cursor(i.main.head)])),!!o&&(n(x(e,o)),!0)}},{key:"Alt-l",run:function(t){var e=t.state,n=t.dispatch,i=ct(e).map((function(t){var n=t.from,i=t.to;return r.jT.range(n,Math.min(i+1,e.doc.length))}));return n(e.update({selection:r.jT.create(i),annotations:r.YW.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(t){var e=t.state,n=t.dispatch,i=S(e.selection,(function(t){for(var n,i=(0,a.qz)(e).resolve(t.head,1);!(i.from<t.from&&i.to>=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent);)i=i.parent;return r.jT.range(i.to,i.from)}));return n(x(e,i)),!0}},{key:"Mod-[",run:mt},{key:"Mod-]",run:gt},{key:"Mod-Alt-\\",run:pt},{key:"Shift-Mod-k",run:function(t){var e=t.state,n=e.changes(ct(e).map((function(t){var n=t.from,r=t.to;return n>0?n--:r<e.doc.length&&r++,{from:n,to:r}}))),r=S(e.selection,(function(e){return t.moveVertically(e,!0)})).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0}),!0}},{key:"Shift-Mod-\\",run:function(t){return H(t.state,t.dispatch,!1)}}].concat(yt)},11254:function(t,e,n){"use strict";n.d(e,{Eu:function(){return L}});var r=n(19753),i=n(13764),o=n(77885);function a(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t){var e=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(t){return!1}}();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p(this,n)}}function p(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var m=function(t){f(n,t);var e=v(n);function n(){return l(this,n),e.apply(this,arguments)}return c(n,[{key:"compare",value:function(t){return this==t||this.constructor==t.constructor&&this.eq(t)}},{key:"toDOM",value:function(t){return null}},{key:"at",value:function(t){return this.range(t)}}]),n}(i.uU);m.prototype.elementClass="",m.prototype.mapMode=o.gc.TrackBefore;var y={class:"",renderEmptyElements:!1,elementStyle:"",markers:function(){return i.Xs.empty},lineMarker:function(){return null},initialSpacer:null,updateSpacer:null,domEventHandlers:{}},k=o.r$.define();var b=r.tk.baseTheme({".cm-gutters":{display:"flex",height:"100%",boxSizing:"border-box",left:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#999",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",height:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"}}),w=o.r$.define({combine:function(t){return t.some((function(t){return t}))}});function S(t){var e=[x,b];return t&&!1===t.fixed&&e.push(w.of(!0)),e}var x=r.lg.fromClass(function(){function t(e){l(this,t),this.view=e,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.gutters=e.state.facet(k).map((function(t){return new M(e,t)}));var n,r=a(this.gutters);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.dom.appendChild(i.dom)}}catch(o){r.e(o)}finally{r.f()}this.fixed=!e.state.facet(w),this.fixed&&(this.dom.style.position="sticky"),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}return c(t,[{key:"update",value:function(t){var e=this;if(this.updateGutters(t)){var n=this.gutters.map((function(t){return new C(t,e.view.viewport)}));this.view.viewportLines((function(t){var i;if(Array.isArray(t.type)){var o,s=a(t.type);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.type==r.kH.Text){i=u;break}}}catch(c){s.e(c)}finally{s.f()}}else i=t.type==r.kH.Text?t:void 0;if(i){var l,h=a(n);try{for(h.s();!(l=h.n()).done;){l.value.line(e.view,i)}}catch(c){h.e(c)}finally{h.f()}}}),0);var i,o=a(n);try{for(o.s();!(i=o.n()).done;){i.value.finish()}}catch(s){o.e(s)}finally{o.f()}this.dom.style.minHeight=this.view.contentHeight+"px",t.state.facet(w)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"")}}},{key:"updateGutters",value:function(t){var e=t.startState.facet(k),n=t.state.facet(k),r=t.docChanged||t.heightChanged||t.viewportChanged;if(e==n){var i,o=a(this.gutters);try{for(o.s();!(i=o.n()).done;){i.value.update(t)&&(r=!0)}}catch(m){o.e(m)}finally{o.f()}}else{r=!0;var s,u=[],l=a(n);try{for(l.s();!(s=l.n()).done;){var h=s.value,c=e.indexOf(h);c<0?u.push(new M(this.view,h)):(this.gutters[c].update(t),u.push(this.gutters[c]))}}catch(m){l.e(m)}finally{l.f()}var f,d=a(this.gutters);try{for(d.s();!(f=d.n()).done;){f.value.dom.remove()}}catch(m){d.e(m)}finally{d.f()}for(var v=0,p=u;v<p.length;v++){var g=p[v];this.dom.appendChild(g.dom)}this.gutters=u}return r}},{key:"destroy",value:function(){this.dom.remove()}}]),t}(),{provide:r.BF.scrollMargins.from((function(t){return 0!=t.gutters.length&&t.fixed?t.view.textDirection==r.Nm.LTR?{left:t.dom.offsetWidth}:{right:t.dom.offsetWidth}:null}))});function A(t){return Array.isArray(t)?t:[t]}var C=function(){function t(e,n){l(this,t),this.gutter=e,this.localMarkers=[],this.i=0,this.height=0,this.cursor=i.Xs.iter(e.markers,n.from)}return c(t,[{key:"line",value:function(t,e){for(this.localMarkers.length&&(this.localMarkers=[]);this.cursor.value&&this.cursor.from<=e.from;)this.cursor.from==e.from&&this.localMarkers.push(this.cursor.value),this.cursor.next();var n=this.gutter.config.lineMarker(t,e,this.localMarkers);n&&this.localMarkers.unshift(n);var r=this.gutter;if(0!=this.localMarkers.length||r.config.renderEmptyElements){var i=e.top-this.height;if(this.i==r.elements.length){var o=new O(t,e.height,i,this.localMarkers);r.elements.push(o),r.dom.appendChild(o.dom)}else{var a=this.localMarkers,s=r.elements[this.i];(function(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0})(a,s.markers)&&(a=s.markers,this.localMarkers.length=0),s.update(t,e.height,i,a)}this.height=e.bottom,this.i++}}},{key:"finish",value:function(){for(var t=this.gutter;t.elements.length>this.i;)t.dom.removeChild(t.elements.pop().dom)}}]),t}(),M=function(){function t(e,n){var r=this;l(this,t),this.view=e,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(t){r.dom.addEventListener(t,(function(r){var i=e.visualLineAtHeight(r.clientY,e.contentDOM.getBoundingClientRect().top);n.domEventHandlers[t](e,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=A(n.markers(e)),n.initialSpacer&&(this.spacer=new O(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return c(t,[{key:"update",value:function(t){var e=this.markers;if(this.markers=A(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],t);n!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[n])}return this.markers!=e}}]),t}(),O=function(){function t(e,n,r,i){l(this,t),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(e,n,r,i)}return c(t,[{key:"update",value:function(t,e,n,r){if(this.height!=e&&(this.dom.style.height=(this.height=e)+"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",u=a(r);try{for(u.s();!(o=u.n()).done;){var l=o.value,h=l.toDOM(t);h&&this.dom.appendChild(h);var c=l.elementClass;c&&(s+=" "+c)}}catch(f){u.e(f)}finally{u.f()}this.dom.className=s}}}]),t}();var T=o.r$.define(),D=o.r$.define({combine:function(t){return(0,o.BO)(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(t,e){var n=Object.assign({},t),r=function(t){var r=n[t],i=e[t];n[t]=r?function(t,e,n){return r(t,e,n)||i(t,e,n)}:i};for(var i in e)r(i);return n}})}}),E=function(t){f(n,t);var e=v(n);function n(t){var r;return l(this,n),(r=e.call(this)).number=t,r}return c(n,[{key:"eq",value:function(t){return this.number==t.number}},{key:"toDOM",value:function(){return document.createTextNode(this.number)}}]),n}(m);function P(t,e){return t.state.facet(D).formatNumber(e,t.state)}var R,B=(R={class:"cm-lineNumbers",markers:function(t){return t.state.facet(T)},lineMarker:function(t,e,n){return n.length?null:new E(P(t,t.state.doc.lineAt(e.from).number))},initialSpacer:function(t){return new E(P(t,N(t.state.doc.lines)))},updateSpacer:function(t,e){var n=P(e.view,N(e.view.state.doc.lines));return n==t.number?t:new E(n)}},[S(),k.of(Object.assign(Object.assign({},y),R))]);function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[D.of(t),B]}function N(t){for(var e=9;e<t;)e=10*e+9;return e}},49619:function(t,e,n){"use strict";n.d(e,{Qf:function(){return M},Gv:function(){return k},pJ:function(){return U}});var r=n(26856),i=n(62038),o=n(19753),a=n(77885),s=n(64928),u=n(13764);function l(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t}var v=0,p=function(){function t(e,n,r){c(this,t),this.set=e,this.base=n,this.modified=r,this.id=v++}return d(t,null,[{key:"define",value:function(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");var n=new t([],null,[]);if(n.set.push(n),e){var r,i=l(e.set);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.set.push(o)}}catch(a){i.e(a)}finally{i.f()}}return n}},{key:"defineModifier",value:function(){var t=new m;return function(e){return e.modified.indexOf(t)>-1?e:m.get(e.base||e,e.modified.concat(t).sort((function(t,e){return t.id-e.id})))}}}]),t}(),g=0,m=function(){function t(){c(this,t),this.instances=[],this.id=g++}return d(t,null,[{key:"get",value:function(e,n){if(!n.length)return e;var r=n[0].instances.find((function(t){return t.base==e&&(r=n,i=t.modified,r.length==i.length&&r.every((function(t,e){return t==i[e]})));var r,i}));if(r)return r;var i,o=[],a=new p(o,e,n),s=l(n);try{for(s.s();!(i=s.n()).done;){i.value.instances.push(a)}}catch(m){s.e(m)}finally{s.f()}var u,h=y(n),c=l(e.set);try{for(c.s();!(u=c.n()).done;){var f,d=u.value,v=l(h);try{for(v.s();!(f=v.n()).done;){var g=f.value;o.push(t.get(d,g))}}catch(m){v.e(m)}finally{v.f()}}}catch(m){c.e(m)}finally{c.f()}return a}}]),t}();function y(t){for(var e=[t],n=0;n<t.length;n++){var r,i=l(y(t.slice(0,n).concat(t.slice(n+1))));try{for(i.s();!(r=i.n()).done;){var o=r.value;e.push(o)}}catch(a){i.e(a)}finally{i.f()}}return e}function k(t){var e=Object.create(null);for(var n in t){var r=t[n];Array.isArray(r)||(r=[r]);var i,o=l(n.split(" "));try{for(o.s();!(i=o.n()).done;){var a=i.value;if(a){for(var s=[],u=2,h=a,c=0;;){if("..."==h&&c>0&&c+3==a.length){u=1;break}var f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(h);if(!f)throw new RangeError("Invalid path: "+a);if(s.push("*"==f[0]?null:'"'==f[0][0]?JSON.parse(f[0]):f[0]),(c+=f[0].length)==a.length)break;var d=a[c++];if(c==a.length&&"!"==d){u=0;break}if("/"!=d)throw new RangeError("Invalid path: "+a);h=a.slice(c)}var v=s.length-1,p=s[v];if(!p)throw new RangeError("Invalid path: "+a);var g=new C(r,u,v>0?s.slice(0,v):null);e[p]=g.sort(e[p])}}}catch(m){o.e(m)}finally{o.f()}}return b.add(e)}var b=new r.md,w=a.r$.define({combine:function(t){return t.length?M.combinedMatch(t):null}}),S=a.r$.define({combine:function(t){return t.length?t[0].match:null}});function x(){return null}function A(t){return t.facet(w)||t.facet(S)||x}var C=function(){function t(e,n,r,i){c(this,t),this.tags=e,this.mode=n,this.context=r,this.next=i}return d(t,[{key:"sort",value:function(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}},{key:"depth",get:function(){return this.context?this.context.length:0}}]),t}(),M=function(){function t(e,n){var r;function a(t){var e=i.V.newName();return(r||(r=Object.create(null)))["."+e]=t,e}c(this,t),this.map=Object.create(null),this.all="string"==typeof n.all?n.all:n.all?a(n.all):null;var s,u=l(e);try{for(u.s();!(s=u.n()).done;){var h=s.value,f=(h.class||a(Object.assign({},h,{tag:null})))+(this.all?" "+this.all:""),d=h.tag;if(Array.isArray(d)){var v,p=l(d);try{for(p.s();!(v=p.n()).done;){var g=v.value;this.map[g.id]=f}}catch(y){p.e(y)}finally{p.f()}}else this.map[d.id]=f}}catch(y){u.e(y)}finally{u.f()}this.module=r?new i.V(r):null,this.scope=n.scope||null,this.match=this.match.bind(this);var m=[T];this.module&&m.push(o.tk.styleModule.of(this.module)),this.extension=m.concat(w.of(this)),this.fallback=m.concat(S.of(this))}return d(t,[{key:"match",value:function(t,e){if(this.scope&&e!=this.scope)return null;var n,r=l(t.set);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.map[i.id];if(void 0!==o)return i!=t&&(this.map[t.id]=o),o}}catch(a){r.e(a)}finally{r.f()}return this.map[t.id]=this.all}}],[{key:"combinedMatch",value:function(t){if(1==t.length)return t[0].match;var e=t.some((function(t){return t.scope}))?void 0:Object.create(null);return function(n,r){var i=e&&e[n.id];if(void 0!==i)return i;var o,a=null,s=l(t);try{for(s.s();!(o=s.n()).done;){var u=o.value.match(n,r);u&&(a=a?a+" "+u:u)}}catch(h){s.e(h)}finally{s.f()}return e&&(e[n.id]=a),a}}},{key:"define",value:function(e,n){return new t(e,n||{})}},{key:"get",value:function(t,e,n){return A(t)(e,n||r.Jq.none)}}]),t}();var O=function(){function t(e){c(this,t),this.markCache=Object.create(null),this.tree=(0,s.qz)(e.state),this.decorations=this.buildDeco(e,A(e.state))}return d(t,[{key:"update",value:function(t){var e=(0,s.qz)(t.state),n=A(t.state),r=n!=t.startState.facet(w);e.length<t.view.viewport.to&&!r?this.decorations=this.decorations.map(t.changes):(e!=this.tree||t.viewportChanged||r)&&(this.tree=e,this.decorations=this.buildDeco(t.view,n))}},{key:"buildDeco",value:function(t,e){var n=this;if(e==x||!this.tree.length)return o.p.none;var r,i=new u.f_,a=l(t.visibleRanges);try{for(a.s();!(r=a.n()).done;){var s=r.value,h=s.from,c=s.to;E(this.tree,h,c,e,(function(t,e,r){i.add(t,e,n.markCache[r]||(n.markCache[r]=o.p.mark({class:r})))}))}}catch(f){a.e(f)}finally{a.f()}return i.finish()}}]),t}(),T=a.Wl.fallback(o.lg.fromClass(O,{decorations:function(t){return t.decorations}})),D=[""];function E(t,e,n,r,i){var o=e,a="",s=t.topNode.cursor;!function t(u,h,c){var f=s.type,d=s.from,v=s.to;if(!(d>=n||v<=e)){D[h]=f.name,f.isTop&&(c=f);for(var p=u,g=f.prop(b),m=!1;g;){if(!g.context||P(g.context,D,h)){var y,k=l(g.tags);try{for(k.s();!(y=k.n()).done;){var w=y.value,S=r(w,c);S&&(p&&(p+=" "),p+=S,1==g.mode?u+=(u?" ":"")+S:0==g.mode&&(m=!0))}}catch(C){k.e(C)}finally{k.f()}break}g=g.next}if(p!=a&&(d>o&&a&&i(o,s.from,a),o=d,a=p),!m&&s.firstChild()){do{var x=s.to;if(t(u,h+1,c),a!=p){var A=Math.min(n,x);A>o&&a&&i(o,A,a),o=A,a=p}}while(s.nextSibling());s.parent()}}}("",0,t.type)}function P(t,e,n){if(t.length>n-1)return!1;for(var r=n-1,i=t.length-1;i>=0;i--,r--){var o=t[i];if(o&&o!=e[r])return!1}return!0}var R=p.define,B=R(),L=R(),N=R(L),j=R(),I=R(j),V=R(j),W=R(),z=R(W),H=R(),_=R(),q=R(),F=R(q),$=R(),U={comment:B,lineComment:R(B),blockComment:R(B),docComment:R(B),name:L,variableName:R(L),typeName:N,tagName:R(N),propertyName:R(L),className:R(L),labelName:R(L),namespace:R(L),macroName:R(L),literal:j,string:I,docString:R(I),character:R(I),number:V,integer:R(V),float:R(V),bool:R(j),regexp:R(j),escape:R(j),color:R(j),url:R(j),keyword:H,self:R(H),null:R(H),atom:R(H),unit:R(H),modifier:R(H),operatorKeyword:R(H),controlKeyword:R(H),definitionKeyword:R(H),operator:_,derefOperator:R(_),arithmeticOperator:R(_),logicOperator:R(_),bitwiseOperator:R(_),compareOperator:R(_),updateOperator:R(_),definitionOperator:R(_),typeOperator:R(_),controlOperator:R(_),punctuation:q,separator:R(q),bracket:F,angleBracket:R(F),squareBracket:R(F),paren:R(F),brace:R(F),content:W,heading:z,heading1:R(z),heading2:R(z),heading3:R(z),heading4:R(z),heading5:R(z),heading6:R(z),contentSeparator:R(W),list:R(W),quote:R(W),emphasis:R(W),strong:R(W),link:R(W),monospace:R(W),inserted:R(),deleted:R(),changed:R(),invalid:R(),meta:$,documentMeta:R($),annotation:R($),processingInstruction:R($),definition:p.defineModifier(),constant:p.defineModifier(),function:p.defineModifier(),standard:p.defineModifier(),local:p.defineModifier(),special:p.defineModifier()};M.define([{tag:U.link,textDecoration:"underline"},{tag:U.heading,textDecoration:"underline",fontWeight:"bold"},{tag:U.emphasis,fontStyle:"italic"},{tag:U.strong,fontWeight:"bold"},{tag:U.keyword,color:"#708"},{tag:[U.atom,U.bool,U.url,U.contentSeparator,U.labelName],color:"#219"},{tag:[U.literal,U.inserted],color:"#164"},{tag:[U.string,U.deleted],color:"#a11"},{tag:[U.regexp,U.escape,U.special(U.string)],color:"#e40"},{tag:U.definition(U.variableName),color:"#00f"},{tag:U.local(U.variableName),color:"#30a"},{tag:[U.typeName,U.namespace],color:"#085"},{tag:U.className,color:"#167"},{tag:[U.special(U.variableName),U.macroName],color:"#256"},{tag:U.definition(U.propertyName),color:"#00c"},{tag:U.comment,color:"#940"},{tag:U.meta,color:"#7a757a"},{tag:U.invalid,color:"#f00"}]),M.define([{tag:U.link,class:"cmt-link"},{tag:U.heading,class:"cmt-heading"},{tag:U.emphasis,class:"cmt-emphasis"},{tag:U.strong,class:"cmt-strong"},{tag:U.keyword,class:"cmt-keyword"},{tag:U.atom,class:"cmt-atom"},{tag:U.bool,class:"cmt-bool"},{tag:U.url,class:"cmt-url"},{tag:U.labelName,class:"cmt-labelName"},{tag:U.inserted,class:"cmt-inserted"},{tag:U.deleted,class:"cmt-deleted"},{tag:U.literal,class:"cmt-literal"},{tag:U.string,class:"cmt-string"},{tag:U.number,class:"cmt-number"},{tag:[U.regexp,U.escape,U.special(U.string)],class:"cmt-string2"},{tag:U.variableName,class:"cmt-variableName"},{tag:U.local(U.variableName),class:"cmt-variableName cmt-local"},{tag:U.definition(U.variableName),class:"cmt-variableName cmt-definition"},{tag:U.special(U.variableName),class:"cmt-variableName2"},{tag:U.typeName,class:"cmt-typeName"},{tag:U.namespace,class:"cmt-namespace"},{tag:U.macroName,class:"cmt-macroName"},{tag:U.propertyName,class:"cmt-propertyName"},{tag:U.operator,class:"cmt-operator"},{tag:U.comment,class:"cmt-comment"},{tag:U.meta,class:"cmt-meta"},{tag:U.invalid,class:"cmt-invalid"},{tag:U.punctuation,class:"cmt-punctuation"}])},62118:function(t,e,n){"use strict";n.d(e,{m8:function(){return p},f$:function(){return P}});var r=n(77885),i=n(19753);function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t}var h=r.q6.define(),c=r.q6.define(),f=r.r$.define(),d=r.r$.define({combine:function(t){return(0,r.BO)(t,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),v=r.QQ.define({create:function(){return E.empty},update:function(t,e){var n=e.state.facet(d),i=e.annotation(h);if(i){var o=S.fromTransaction(e),a=i.side,s=0==a?t.undone:t.done;return s=o?x(s,s.length,n.minDepth,o):M(s,e.startState.selection),new E(0==a?i.rest:s,0==a?s:i.rest)}var u=e.annotation(c);if("full"!=u&&"before"!=u||(t=t.isolate()),!1===e.annotation(r.YW.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);var l=S.fromTransaction(e),f=e.annotation(r.YW.time),v=e.annotation(r.YW.userEvent);return l?t=t.addChanges(l,f,v,n.newGroupDelay,n.minDepth):e.selection&&(t=t.addSelection(e.startState.selection,f,v,n.newGroupDelay)),"full"!=u&&"after"!=u||(t=t.isolate()),t}});function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[v,d.of(t),i.tk.domEventHandlers({beforeinput:function(t,e){return"historyUndo"==t.inputType?m(e):"historyRedo"==t.inputType&&y(e)}})]}function g(t,e){return function(n){var r=n.state,i=n.dispatch,o=r.field(v,!1);if(!o)return!1;var a=o.pop(t,r,e);return!!a&&(i(a),!0)}}var m=g(0,!1),y=g(1,!1),k=g(0,!0),b=g(1,!0);function w(t){return function(e){var n=e.field(v,!1);if(!n)return 0;var r=0==t?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}w(0),w(1);var S=function(){function t(e,n,r,i,o){s(this,t),this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return l(t,[{key:"setSelAfter",value:function(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}}],[{key:"fromTransaction",value:function(e){var n,r=C,i=o(e.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var a=(0,n.value)(e);a.length&&(r=r.concat(a))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),r,void 0,e.startState.selection,C)}},{key:"selection",value:function(e){return new t(void 0,C,void 0,void 0,e)}}]),t}();function x(t,e,n,r){var i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function A(t,e){return t.length?e.length?t.concat(e):t:e}var C=[];function M(t,e){if(t.length){var n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),x(t,t.length-1,1e9,n.setSelAfter(r)))}return[S.selection([e])]}function O(t){var e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function T(t,e){if(!t.length)return t;for(var n=t.length,r=C;n;){var i=D(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=t.slice(0,n);return o[n-1]=i,o}e=i.mapped,n--,r=i.selectionsAfter}return r.length?[S.selection(r)]:C}function D(t,e,n){var i=A(t.selectionsAfter.length?t.selectionsAfter.map((function(t){return t.map(e)})):C,n);if(!t.changes)return S.selection(i);var o=t.changes.map(e),a=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(a):a;return new S(o,r.Py.mapEffects(t.effects,e),s,t.startSelection.map(a),i)}var E=function(){function t(e,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;s(this,t),this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return l(t,[{key:"isolate",value:function(){return this.prevTime?new t(this.done,this.undone):this}},{key:"addChanges",value:function(e,n,r,i,o){var a=this.done,s=a[a.length-1];return new t(a=s&&s.changes&&n-this.prevTime<i&&!s.selectionsAfter.length&&!s.changes.empty&&e.changes&&function(t,e){var n=[],r=!1;return t.iterChangedRanges((function(t,e){return n.push(t,e)})),e.iterChangedRanges((function(t,e,i,o){for(var a=0;a<n.length;){var s=n[a++],u=n[a++];o>=s&&i<=u&&(r=!0)}})),r}(s.changes,e.changes)?x(a,a.length-1,o,new S(e.changes.compose(s.changes),A(e.effects,s.effects),s.mapped,s.startSelection,C)):x(a,a.length,o,e),C,n,r)}},{key:"addSelection",value:function(e,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:C;return s.length>0&&n-this.prevTime<i&&"keyboardselection"==r&&this.prevUserEvent==r&&(o=s[s.length-1],a=e,o.ranges.length==a.ranges.length&&0===o.ranges.filter((function(t,e){return t.empty!=a.ranges[e].empty})).length)?this:new t(M(this.done,e),this.undone,n,r)}},{key:"addMapping",value:function(e){return new t(T(this.done,e),T(this.undone,e),this.prevTime,this.prevUserEvent)}},{key:"pop",value:function(t,e,n){var r=0==t?this.done:this.undone;if(0==r.length)return null;var i=r[r.length-1];if(n&&i.selectionsAfter.length)return e.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:h.of({side:t,rest:O(r)})});if(i.changes){var o=1==r.length?C:r.slice(0,r.length-1);return i.mapped&&(o=T(o,i.mapped)),e.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:h.of({side:t,rest:o}),filter:!1})}return null}}]),t}();E.empty=new E(C,C);var P=[{key:"Mod-z",run:m,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:y,preventDefault:!0},{key:"Mod-u",run:k,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:b,preventDefault:!0}]},64928:function(t,e,n){"use strict";n.d(e,{Gn:function(){return j},SQ:function(){return b},kU:function(){return k},y1:function(){return B},K0:function(){return N},tK:function(){return P},SS:function(){return L},c:function(){return R},mi:function(){return y},qz:function(){return S}});var r=n(26856),i=n(23414),o=n(77885),a=n(19753);function s(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=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(t){return!1}}();return function(){var n,r=v(t);if(e){var i=v(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function d(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e,n){return e&&g(t.prototype,e),n&&g(t,n),t}var y=new r.md;function k(t){return o.r$.define({combine:t?function(e){return e.concat(t)}:void 0})}var b=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];p(this,t),this.data=e,this.topNode=r,o.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(o.yy.prototype,"tree",{get:function(){return S(this)}}),this.parser=n,this.extension=[E.of(this),o.yy.languageData.of((function(t,e){return t.facet(w(t,e))}))].concat(i)}return m(t,[{key:"isActiveAt",value:function(t,e){return w(t,e)==this.data}},{key:"findRegions",value:function(t){var e=this,n=t.facet(E);if((null==n?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return S(t).iterate({enter:function(t,n,i){if(t.isTop&&t.prop(y)==e.data)return r.push({from:n,to:i}),!1}}),r}},{key:"parseString",value:function(t){for(var e,n=i.xv.of(t.split("\n")),a=this.parser.startParse(new x(n),0,new A(this.parser,o.yy.create({doc:n}),[],r.mp.empty,{from:0,to:t.length},[]));!(e=a.advance()););return e}},{key:"allowsNesting",get:function(){return!0}}]),t}();function w(t,e){var n=t.facet(E);if(!n)return null;if(!n.allowsNesting)return n.data;for(var r=S(t).resolve(e,-1);r;){var i=r.type.prop(y);if(i)return i;r=r.parent}return n.data}b.setState=o.Py.define();function S(t){var e=t.field(b.state,!1);return e?e.tree:r.mp.empty}var x=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;p(this,t),this.doc=e,this.length=n,this.cursorPos=0,this.string="",this.prevString="",this.cursor=e.iter()}return m(t,[{key:"syncTo",value:function(t){return t<this.cursorPos&&(this.cursor=this.doc.iter(),this.cursorPos=0),this.prevString=t==this.cursorPos?this.string:"",this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}},{key:"get",value:function(t){if(t>=this.length)return-1;var e=this.cursorPos-this.string.length;if(t<e||t>=this.cursorPos){if(t<e&&t>=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}},{key:"lineAfter",value:function(t){if(t>=this.length||t<0)return"";var e=this.cursorPos-this.string.length;return(t<e||t>=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e)}},{key:"read",value:function(t,e){var n=this.cursorPos-this.string.length;return t<n||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-n,e-n)}},{key:"clip",value:function(e){return new t(this.doc,e)}}]),t}(),A=function(){function t(e,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,a=arguments.length>5?arguments[5]:void 0;p(this,t),this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.viewport=o,this.skipped=a,this.parse=null,this.tempSkipped=[]}return m(t,[{key:"work",value:function(t,e){if(this.tree!=r.mp.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new x(this.state.doc),0,this));for(var n=Date.now()+t;;){var i=this.parse.advance();if(i)return this.fragments=this.withoutTempSkipped(r.i9.addTree(i)),this.parse=null,this.tree=i,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>n)return!1}}},{key:"takeTree",value:function(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)))}},{key:"withoutTempSkipped",value:function(t){for(var e;e=this.tempSkipped.pop();)t=C(t,e.from,e.to);return t}},{key:"changes",value:function(e,n){var i=this.fragments,o=this.tree,a=this.viewport,u=this.skipped;if(this.takeTree(),!e.empty){var l=[];if(e.iterChangedRanges((function(t,e,n,r){return l.push({fromA:t,toA:e,fromB:n,toB:r})})),i=r.i9.applyChanges(i,l),o=r.mp.empty,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];var h,c=s(this.skipped);try{for(c.s();!(h=c.n()).done;){var f=h.value,d=e.mapPos(f.from,1),v=e.mapPos(f.to,-1);d<v&&u.push({from:d,to:v})}}catch(p){c.e(p)}finally{c.f()}}}return new t(this.parser,n,i,o,a,u)}},{key:"updateViewport",value:function(t){this.viewport=t;for(var e=this.skipped.length,n=0;n<this.skipped.length;n++){var r=this.skipped[n],i=r.from,o=r.to;i<t.to&&o>t.from&&(this.fragments=C(this.fragments,i,o),this.skipped.splice(n--,1))}return this.skipped.length<e}},{key:"reset",value:function(){this.parse&&(this.takeTree(),this.parse=null)}},{key:"skipUntilInView",value:function(t,e){this.skipped.push({from:t,to:e})}},{key:"movedPast",value:function(t){return this.tree.length<t&&this.parse&&this.parse.pos>=t}}]),t}();function C(t,e,n){return r.i9.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}A.skippingParser={startParse:function(t,e,n){return{pos:e,advance:function(){return n.tempSkipped.push({from:e,to:t.length}),this.pos=t.length,new r.mp(r.Jq.none,[],[],t.length-e)},forceFinish:function(){return this.advance()}}}};var M=function(){function t(e){p(this,t),this.context=e,this.tree=e.tree}return m(t,[{key:"apply",value:function(e){if(!e.docChanged)return this;var n=this.context.changes(e.changes,e.state),r=this.context.tree.length==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.tree.length),n.viewport.to);return n.work(25,r)||n.takeTree(),new t(n)}}],[{key:"init",value:function(e){var n=new A(e.facet(E).parser,e,[],r.mp.empty,{from:0,to:e.doc.length},[]);return n.work(25)||n.takeTree(),new t(n)}}]),t}();b.state=o.QQ.define({create:M.init,update:function(t,e){var n,r=s(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(b.setState))return i.value}}catch(o){r.e(o)}finally{r.f()}return e.startState.facet(E)!=e.state.facet(E)?M.init(e.state):t.apply(e)}});var O="undefined"!=typeof window&&window.requestIdleCallback||function(t,e){var n=e.timeout;return setTimeout(t,n)},T="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,D=a.lg.fromClass(function(){function t(e){p(this,t),this.view=e,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return m(t,[{key:"update",value:function(t){if(t.viewportChanged){var e=this.view.state.field(b.state).context;e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()}t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork())}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var t=this.view.state;t.field(b.state).tree.length>=t.doc.length||(this.working=O(this.work,{timeout:500}))}}},{key:"work",value:function(t){this.working=-1;var e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),!(this.chunkBudget<=0)){var n=this.view,r=n.state,i=n.viewport.to,o=r.field(b.state);if(!(o.tree.length>=i+1e6)){var a=Math.min(this.chunkBudget,t?Math.max(25,t.timeRemaining()):100),s=o.context.work(a,i+1e6);this.chunkBudget-=Date.now()-e,(s||this.chunkBudget<=0||o.context.movedPast(i))&&(o.context.takeTree(),this.view.dispatch({effects:b.setState.of(new M(o.context))})),!s&&this.chunkBudget>0&&this.scheduleWork()}}}},{key:"destroy",value:function(){this.working>=0&&T(this.working)}}]),t}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),E=o.r$.define({combine:function(t){return t.length?t[0]:null},enables:[b.state,D]}),P=o.r$.define(),R=o.r$.define({combine:function(t){if(!t.length)return"  ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function B(t){var e=t.facet(R);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function L(t,e){var n="",r=t.tabSize;if(9==t.facet(R).charCodeAt(0))for(;e>=r;)n+="\t",e-=r;for(var i=0;i<e;i++)n+=" ";return n}function N(t,e){t instanceof o.yy&&(t=new j(t));var n,r=s(t.state.facet(P));try{for(r.s();!(n=r.n()).done;){var i=(0,n.value)(t,e);if(null!=i)return i}}catch(u){r.e(u)}finally{r.f()}var a=S(t.state);return a?function(t,e,n){for(var r=e.resolve(n),i=r,o=n;;){var a=i.childBefore(o);if(!a)break;a.type.isError&&a.from==a.to?(r=i,o=a.from):o=(i=a).to+1}return W(r,n,t)}(t,a,e):null}var j=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,t),this.state=e,this.options=n,this.unit=B(e)}return m(t,[{key:"textAfterPos",value:function(t){var e,n,r=null===(e=this.options)||void 0===e?void 0:e.simulateBreak;return t==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(t,Math.min(t+100,null!=r&&r>t?r:1e9,this.state.doc.lineAt(t).to))}},{key:"column",value:function(t){var e,n=this.state.doc.lineAt(t),r=n.text.slice(0,t-n.from),i=this.countColumn(r,t-n.from),o=(null===(e=this.options)||void 0===e?void 0:e.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S/))),i}},{key:"countColumn",value:function(t,e){return(0,i.IS)(e<0?t:t.slice(0,e),0,this.state.tabSize)}},{key:"lineIndent",value:function(t){var e,n=null===(e=this.options)||void 0===e?void 0:e.overrideIndentation;if(n){var r=n(t.from);if(r>-1)return r}return this.countColumn(t.text,t.text.search(/\S/))}}]),t}(),I=new r.md;function V(t){var e=t.type.prop(I);if(e)return e;var n,i=t.firstChild;if(i&&(n=i.type.prop(r.md.closedBy))){var o=t.lastChild,a=o&&n.indexOf(o.name)>-1;return function(t){return q(t,!0,1,void 0,a&&!function(t){var e,n;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&(null===(n=t.options)||void 0===n?void 0:n.simulateDoubleBreak)}(t)?o.from:void 0)}}return null==t.parent?z:null}function W(t,e,n){for(;t;t=t.parent){var r=V(t);if(r)return r(new H(n,e,t))}return null}function z(){return 0}var H=function(t){h(n,t);var e=f(n);function n(t,r,i){var o;return p(this,n),(o=e.call(this,t.state,t.options)).base=t,o.pos=r,o.node=i,o}return m(n,[{key:"continue",value:function(){var t=this.node.parent;return t?W(t,this.pos,this.base):0}},{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var t=this.state.doc.lineAt(this.node.from);;){for(var e=this.node.resolve(t.from);e.parent&&e.parent.from==e.from;)e=e.parent;if(_(e,this.node))break;t=this.state.doc.lineAt(e.from)}return this.lineIndent(t)}}]),n}(j);function _(t,e){for(var n=e;n;n=n.parent)if(t==n)return!0;return!1}function q(t,e,n,r,i){var o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,u=e?function(t){var e,n=t.node,r=n.childAfter(n.from),i=n.lastChild;if(!r)return null;for(var o=null===(e=t.options)||void 0===e?void 0:e.simulateBreak,a=t.state.doc.lineAt(r.from),s=null==o||o<=a.from?a.to:Math.min(a.to,o),u=r.to;;){var l=n.childAfter(u);if(!l||l==i)return null;if(!l.type.isSkipped)return l.from<s?r:null;u=l.to}}(t):null;return u?s?t.column(u.from):t.column(u.to):t.baseIndent+(s?0:t.unit*n)}o.r$.define(),new r.md},49413:function(t,e,n){"use strict";n.d(e,{b:function(){return l}});var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],i=/^[+\-*&%=<>!?|~^]/,o=/^[:\[\(\{]/,a=["true","false"],s=/^(\d[+\-\*\/])?\d+(\.\d+)?/;function u(t,e){var n=t.peek();if(e.incomment)return t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(e.intag){if(e.operator){if(e.operator=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.sign){if(e.sign=!1,t.match(a))return"atom";if(t.match(s))return"number"}if(e.instring)return n==e.instring&&(e.instring=!1),t.next(),"string";if("'"==n||'"'==n)return e.instring=n,t.next(),"string";if(t.match(e.intag+"}")||t.eat("-")&&t.match(e.intag+"}"))return e.intag=!1,"tag";if(t.match(i))return e.operator=!0,"operator";if(t.match(o))e.sign=!0;else if(t.eat(" ")||t.sol()){if(t.match(r))return"keyword";if(t.match(a))return"atom";if(t.match(s))return"number";t.sol()&&t.next()}else t.next();return"variable"}if(t.eat("{")){if(t.eat("#"))return e.incomment=!0,t.skipTo("#}")?(t.eatWhile(/\#|}/),e.incomment=!1):t.skipToEnd(),"comment";if(n=t.eat(/\{|%/))return e.intag=n,"{"==n&&(e.intag="}"),t.eat("-"),"tag"}t.next()}r=new RegExp("(("+r.join(")|(")+"))\\b"),a=new RegExp("(("+a.join(")|(")+"))\\b");var l={startState:function(){return{tokenize:u}},token:function(t,e){return e.tokenize(t,e)},languageData:{commentTokens:{block:{open:"{#",close:"#}"}}}}},8987:function(t,e,n){"use strict";n.d(e,{r:function(){return i}});var r=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i"),i={token:function(t,e){var n=t.peek(),i=e.escaped;if(e.escaped=!1,"#"==n&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---"))return"def";if(t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==n?e.inlinePairs++:"}"==n?e.inlinePairs--:"["==n?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&","==n)return t.next(),"meta";if(e.inlinePairs>0&&!i&&","==n)return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(0==e.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(r))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped="\\"==n,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}}},13764:function(t,e,n){"use strict";n.d(e,{Xs:function(){return d},f_:function(){return v},uU:function(){return l}});var r=n(77885);function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}var l=function(){function t(){a(this,t)}return u(t,[{key:"eq",value:function(t){return this==t}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new h(t,e,this)}}]),t}();l.prototype.startSide=l.prototype.endSide=0,l.prototype.point=!1,l.prototype.mapMode=r.gc.TrackDel;var h=function t(e,n,r){a(this,t),this.from=e,this.to=n,this.value=r};function c(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var f=function(){function t(e,n,r,i){a(this,t),this.from=e,this.to=n,this.value=r,this.maxPoint=i}return u(t,[{key:"findIndex",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e9*e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t<=0)return r;for(var i=e<0?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-t||(e<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==o)return u>=0?o:a;u>=0?a=s:o=s+1}}},{key:"between",value:function(t,e,n,r){for(var i=this.findIndex(e,-1),o=this.findIndex(n,1,void 0,i);i<o;i++)if(!1===r(this.from[i]+t,this.to[i]+t,this.value[i]))return!1}},{key:"map",value:function(e,n){for(var r=[],i=[],o=[],a=-1,s=-1,u=0;u<this.value.length;u++){var l=this.value[u],h=this.from[u]+e,c=this.to[u]+e,f=void 0,d=void 0;if(h==c){var v=n.mapPos(h,l.startSide,l.mapMode);if(null==v)continue;f=d=v}else if((f=n.mapPos(h,l.startSide))>(d=n.mapPos(c,l.endSide))||f==d&&l.startSide>0&&l.endSide<=0)continue;(d-f||l.endSide-l.startSide)<0||(a<0&&(a=f),l.point&&(s=Math.max(s,d-f)),r.push(l),i.push(f-a),o.push(d-a))}return{mapped:r.length?new t(i,o,r,s):null,pos:a}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),t}(),d=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.empty,i=arguments.length>3?arguments[3]:void 0;a(this,t),this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return u(t,[{key:"chunkEnd",value:function(t){return this.chunkPos[t]+this.chunk[t].length}},{key:"update",value:function(e){var n=e.add,r=void 0===n?[]:n,i=e.sort,o=void 0!==i&&i,a=e.filterFrom,s=void 0===a?0:a,u=e.filterTo,l=void 0===u?this.length:u,f=e.filter;if(0==r.length&&!f)return this;if(o&&r.slice().sort(c),this==t.empty)return r.length?t.of(r):this;for(var d=new g(this,null,-1).goto(0),p=0,m=[],y=new v;d.value||p<r.length;)if(p<r.length&&(d.from-r[p].from||d.startSide-r[p].value.startSide)>=0){var k=r[p++];y.addInner(k.from,k.to,k.value)||m.push(k)}else 1==d.rangeIndex&&d.chunkIndex<this.chunk.length&&(p==r.length||this.chunkEnd(d.chunkIndex)<r[p].from)&&(!f||s>this.chunkEnd(d.chunkIndex)||l<this.chunkPos[d.chunkIndex])&&y.addChunk(this.chunkPos[d.chunkIndex],this.chunk[d.chunkIndex])?d.nextChunk():((!f||s>d.to||l<d.from||f(d.from,d.to,d.value))&&(y.addInner(d.from,d.to,d.value)||m.push(new h(d.from,d.to,d.value))),d.next());return y.finishInner(this.nextLayer!=t.empty||m.length?this.nextLayer.update({add:m,filter:f,filterFrom:s,filterTo:l}):t.empty)}},{key:"map",value:function(e){if(0==e.length||this==t.empty)return this;for(var n=[],r=[],i=-1,o=0;o<this.chunk.length;o++){var a=this.chunkPos[o],s=this.chunk[o],u=e.touchesRange(a,a+s.length);if(!1===u)i=Math.max(i,s.maxPoint),n.push(s),r.push(e.mapPos(a));else if(!0===u){var l=s.map(a,e),h=l.mapped,c=l.pos;h&&(i=Math.max(i,h.maxPoint),n.push(h),r.push(c))}}var f=this.nextLayer.map(e);return 0==n.length?f:new t(r,n,f,i)}},{key:"between",value:function(e,n,r){if(this!=t.empty){for(var i=0;i<this.chunk.length;i++){var o=this.chunkPos[i],a=this.chunk[i];if(n>=o&&e<=o+a.length&&!1===a.between(o,e-o,n-o,r))return}this.nextLayer.between(e,n,r)}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(t)}},{key:"length",get:function(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}},{key:"size",get:function(){if(this==t.empty)return 0;var e,n=this.nextLayer.size,r=i(this.chunk);try{for(r.s();!(e=r.n()).done;){n+=e.value.value.length}}catch(o){r.e(o)}finally{r.f()}return n}}],[{key:"iter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(t).goto(e)}},{key:"compare",value:function(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.filter((function(e){return e.maxPoint>=500||e!=t.empty&&n.indexOf(e)<0&&e.maxPoint>=o})),s=n.filter((function(n){return n.maxPoint>=500||n!=t.empty&&e.indexOf(n)<0&&n.maxPoint>=o})),u=p(a,s),l=new k(a,u,o),h=new k(s,u,o);r.iterGaps((function(t,e,n){return b(l,t,h,e,n,i)})),r.empty&&0==r.length&&b(l,0,h,0,0,i)}},{key:"spans",value:function(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new k(t,null,i).goto(e),a=e,s=o.openStart;;){var u=Math.min(o.to,n);if(o.point?(r.point(a,u,o.point,o.activeForPoint(o.to),s),s=o.openEnd(u)+(o.to>u?1:0)):u>a&&(r.span(a,u,o.active,s),s=o.openEnd(u)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new v,o=i(t instanceof h?[t]:n?t.slice().sort(c):t);try{for(o.s();!(e=o.n()).done;){var a=e.value;r.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return r.finish()}}]),t}();d.empty=new d([],[],null,-1),d.empty.nextLayer=d.empty;var v=function(){function t(){a(this,t),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 u(t,[{key:"finishChunk",value:function(t){this.chunks.push(new f(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,t&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,r)}},{key:"addInner",value:function(t,e,n){var r=t-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(t-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=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=n,this.lastFrom=t,this.lastTo=e,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}},{key:"addChunk",value:function(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var n=e.value.length-1;return this.last=e.value[n],this.lastFrom=e.from[n]+t,this.lastTo=e.to[n]+t,!0}},{key:"finish",value:function(){return this.finishInner(d.empty)}},{key:"finishInner",value:function(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=new d(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}]),t}();function p(t,e){var n,r=new Map,o=i(t);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;s<a.chunk.length;s++)a.chunk[s].maxPoint<500&&r.set(a.chunk[s],a.chunkPos[s])}catch(d){o.e(d)}finally{o.f()}var u,l=new Set,h=i(e);try{for(h.s();!(u=h.n()).done;)for(var c=u.value,f=0;f<c.chunk.length;f++)r.get(c.chunk[f])==c.chunkPos[f]&&l.add(c.chunk[f])}catch(d){h.e(d)}finally{h.f()}return l}var g=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;a(this,t),this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}},{key:"gotoInner",value:function(t,e,n){for(;this.chunkIndex<this.layer.chunk.length;){var r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<t||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}var i=this.chunkIndex==this.layer.chunk.length?0:this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],-1,e);(!n||this.rangeIndex<i)&&(this.rangeIndex=i),this.next()}},{key:"forward",value:function(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}},{key:"next",value:function(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}var t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],n=t+e.from[this.rangeIndex];if(this.from=n,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],++this.rangeIndex==e.value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}if(this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),t}(),m=function(){function t(e){a(this,t),this.heap=e}return u(t,[{key:"goto",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9,r=i(this.heap);try{for(r.s();!(e=r.n()).done;){var o=e.value;o.goto(t,n)}}catch(s){r.e(s)}finally{r.f()}for(var a=this.heap.length>>1;a>=0;a--)y(this.heap,a);return this.next(),this}},{key:"forward",value:function(t,e){var n,r=i(this.heap);try{for(r.s();!(n=r.n()).done;){n.value.forward(t,e)}}catch(a){r.e(a)}finally{r.f()}for(var o=this.heap.length>>1;o>=0;o--)y(this.heap,o);(this.to-t||this.value.endSide-e)<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 t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),y(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(e){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<e.length;o++)for(var a=e[o];a!=d.empty;a=a.nextLayer)a.maxPoint>=r&&i.push(new g(a,n,r,o));return 1==i.length?i[0]:new t(i)}}]),t}();function y(t,e){for(var n=t[e];;){var r=1+(e<<1);if(r>=t.length)break;var i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}var k=function(){function t(e,n,r){a(this,t),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(e,n,r)}return u(t,[{key:"goto",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}},{key:"forward",value:function(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}},{key:"removeActive",value:function(t){S(this.active,t),S(this.activeTo,t),S(this.activeRank,t),this.minActive=A(this.active,this.activeTo)}},{key:"addActive",value:function(t){for(var e=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;e<this.activeRank.length&&this.activeRank[e]<=o;)e++;x(this.active,e,r),x(this.activeTo,e,i),x(this.activeRank,e,o),t&&x(t,e,this.cursor.from),this.minActive=A(this.active,this.activeTo)}},{key:"next",value:function(){var t=this.to;this.point=null;for(var e=this.openStart<0?[]:null,n=0;;){var r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>t){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),e&&S(e,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.from<t&&(n=1),this.cursor.next(),this.to>t&&this.forward(this.to,this.endSide);break}this.addActive(e),this.cursor.next()}}if(e){for(var o=0;o<e.length&&e[o]<t;)o++;this.openStart=o+n}}},{key:"activeForPoint",value:function(t){if(!this.active.length)return this.active;for(var e=[],n=0;n<this.active.length&&!(this.activeRank[n]>this.pointRank);n++)(this.activeTo[n]>t||this.activeTo[n]==t&&this.active[n].endSide>this.point.endSide)&&e.push(this.active[n]);return e}},{key:"openEnd",value:function(t){for(var e=0;e<this.activeTo.length&&this.activeTo[e]>t;)e++;return e}}]),t}();function b(t,e,n,r,i,o){t.goto(e),n.goto(r);for(var a=r+i,s=r,u=r-e;;){var l=t.to+u-n.to||t.endSide-n.endSide,h=l<0?t.to+u:n.to,c=Math.min(h,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))||o.comparePoint(s,c,t.point,n.point):c>s&&!w(t.active,n.active)&&o.compareRange(s,c,t.active,n.active),h>a)break;s=h,l<=0&&t.next(),l>=0&&n.next()}}function w(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function S(t,e){for(var n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function x(t,e,n){for(var r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function A(t,e){for(var n=-1,r=1e9,i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}},63637:function(t,e,n){"use strict";n.d(e,{Z:function(){return l}});var r=n(77885),i=n(19753),o=n(23414),a=2e3;function s(t,e){var n=t.posAtCoords({x:e.clientX,y:e.clientY});if(null==n)return null;var r=t.state.doc.lineAt(n),i=n-r.from,s=i>a?-1:i==r.length?function(t,e){var n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):(0,o.IS)(r.text.slice(0,n-r.from),0,t.state.tabSize);return{line:r.number,col:s,off:i}}function u(t,e){var n=s(t,e),i=t.state.selection;return n?{update:function(t){if(t.docChanged){var e=t.changes.mapPos(t.startState.doc.line(n.line).from),r=t.state.doc.lineAt(e);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(t.changes)}},get:function(e,u,l){var h=s(t,e);if(!h)return i;var c=function(t,e,n){var i=Math.min(e.line,n.line),s=Math.max(e.line,n.line),u=[];if(e.off>a||n.off>a||e.col<0||n.col<0)for(var l=Math.min(e.off,n.off),h=Math.max(e.off,n.off),c=i;c<=s;c++){var f=t.doc.line(c);f.length<=h&&u.push(r.jT.range(f.from+l,f.to+h))}else for(var d=Math.min(e.col,n.col),v=Math.max(e.col,n.col),p=i;p<=s;p++){var g=t.doc.line(p),m=g.length>a?g.text.slice(0,2*v):g.text,y=(0,o.Gz)(m,0,d,t.tabSize),k=(0,o.Gz)(m,0,v,t.tabSize);y.leftOver||u.push(r.jT.range(g.from+y.offset,g.from+k.offset))}return u}(t.state,n,h);return c.length?l?r.jT.create(c.concat(i.ranges)):r.jT.create(c):i}}:null}function l(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button};return i.tk.mouseSelectionStyle.of((function(t,n){return e(n)?u(t,n):null}))}},72360:function(t,e,n){"use strict";n.d(e,{sW:function(){return W},Lp:function(){return lt}});var r=n(19753),i=n(77885);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}function u(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var h=i.r$.define({combine:function(t){var e,n,r,i=u(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;e=e||o.topContainer,n=n||o.bottomContainer}}catch(a){i.e(a)}finally{i.f()}return{topContainer:e,bottomContainer:n}}});function c(t){var e=[v,m];return t&&e.push(h.of(t)),e}var f=i.r$.define();function d(t,e){var n=t.plugin(v),r=t.state.facet(f).indexOf(e);return n&&r>-1?n.panels[r]:null}var v=r.lg.fromClass(function(){function t(e){o(this,t),this.specs=e.state.facet(f),this.panels=this.specs.map((function(t){return t(e)}));var n=e.state.facet(h);this.top=new p(e,!0,n.topContainer),this.bottom=new p(e,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(t){return t.top}))),this.bottom.sync(this.panels.filter((function(t){return!t.top})));var r,i=u(this.panels);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.dom.classList.add("cm-panel"),a.class&&a.dom.classList.add(a.class),a.mount&&a.mount()}}catch(s){i.e(s)}finally{i.f()}}return s(t,[{key:"update",value:function(t){var e=t.state.facet(h);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new p(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new p(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=t.state.facet(f);if(n!=this.specs){var r,i=[],o=[],a=[],s=[],l=u(n);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=this.specs.indexOf(c),v=void 0;d<0?(v=c(t.view),s.push(v)):(v=this.panels[d]).update&&v.update(t),i.push(v),(v.top?o:a).push(v)}}catch(S){l.e(S)}finally{l.f()}this.specs=n,this.panels=i,this.top.sync(o),this.bottom.sync(a);for(var g=0,m=s;g<m.length;g++){var y=m[g];y.dom.classList.add("cm-panel"),y.class&&y.dom.classList.add(y.class),y.mount&&y.mount()}}else{var k,b=u(this.panels);try{for(b.s();!(k=b.n()).done;){var w=k.value;w.update&&w.update(t)}}catch(S){b.e(S)}finally{b.f()}}}},{key:"destroy",value:function(){this.top.sync([]),this.bottom.sync([])}}]),t}(),{provide:r.BF.scrollMargins.from((function(t){return{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}}))}),p=function(){function t(e,n,r){o(this,t),this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}return s(t,[{key:"sync",value:function(t){this.panels=t,this.syncDOM()}},{key:"syncDOM",value:function(){if(0!=this.panels.length){if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";var t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}var e,n=this.dom.firstChild,r=u(this.panels);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.dom.parentNode==this.dom){for(;n!=i.dom;)n=g(n);n=n.nextSibling}else this.dom.insertBefore(i.dom,n)}}catch(o){r.e(o)}finally{r.f()}for(;n;)n=g(n)}else this.dom&&(this.dom.remove(),this.dom=void 0)}},{key:"scrollMargin",value:function(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-this.view.scrollDOM.getBoundingClientRect().top:this.view.scrollDOM.getBoundingClientRect().bottom-this.dom.getBoundingClientRect().top)}},{key:"syncClasses",value:function(){if(this.container&&this.classes!=this.view.themeClasses){var t,e=u(this.classes.split(" "));try{for(e.s();!(t=e.n()).done;){var n=t.value;n&&this.container.classList.remove(n)}}catch(a){e.e(a)}finally{e.f()}var r,i=u((this.classes=this.view.themeClasses).split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value;o&&this.container.classList.add(o)}}catch(a){i.e(a)}finally{i.f()}}}}]),t}();function g(t){var e=t.nextSibling;return t.remove(),e}var m=r.tk.baseTheme({".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"}}),y=n(13764);function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&"object"==k(n)&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?t.setAttribute(r,i):null!=i&&(t[r]=i)}e++}for(;e<arguments.length;e++)w(t,arguments[e]);return t}function w(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var n=0;n<e.length;n++)w(t,e[n])}}var S=n(23414);function x(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||M(t)||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 A(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=M(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||M(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){if(t){if("string"==typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function E(t,e,n){return e&&D(t.prototype,e),n&&D(t,n),t}var P="function"==typeof String.prototype.normalize?function(t){return t.normalize("NFKD")}:function(t){return t},R=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length,o=arguments.length>4?arguments[4]:void 0;T(this,t),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(t){return o(P(t))}:P,this.query=this.normalize(n)}return E(t,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var t=this.peek();if(t<0)return this.done=!0,this;var e=String.fromCharCode(t),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,e+=String.fromCharCode(r)}for(var i=this.normalize(e),o=0,a=n;;o++){var s=i.charCodeAt(o),u=this.match(s,a);if(u)return this.value=u,this;if(o==i.length-1)break;a==n&&o<e.length&&e.charCodeAt(o)==s&&a++}}}},{key:"match",value:function(t,e){for(var n=null,r=0;r<this.matches.length;r+=2){var i=this.matches[r],o=!1;this.query.charCodeAt(i)==t&&(i==this.query.length-1?n={from:this.matches[r+1],to:e+1}:(this.matches[r]++,o=!0)),o||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?n={from:e,to:e+1}:this.matches.push(1,e)),n}}]),t}();function B(t){var e=b("input",{class:"cm-textfield",name:"line"});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(n){var r=t.state,o=r.doc.lineAt(r.selection.main.head),a=C(n,5),s=a[1],u=a[2],l=a[3],h=a[4],c=l?+l.slice(1):0,f=u?+u:o.number;if(u&&h){var d=f/100;s&&(d=d*("-"==s?-1:1)+o.number/r.doc.lines),f=Math.round(r.doc.lines*d)}else u&&s&&(f=f*("-"==s?-1:1)+o.number);var v=r.doc.line(Math.max(1,Math.min(r.doc.lines,f)));t.dispatch({effects:L.of(!1),selection:i.jT.cursor(v.from+Math.max(0,Math.min(c,v.length))),scrollIntoView:!0}),t.focus()}}return{dom:b("form",{onkeydown:function(e){27==e.keyCode?(e.preventDefault(),t.dispatch({effects:L.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),n())},onsubmit:n},b("label",t.state.phrase("Go to line:")," ",e)," ",b("button",{class:"cm-button",type:"submit"},t.state.phrase("go"))),class:"cm-gotoLine",pos:-10}}var L=i.Py.define(),N=i.QQ.define({create:function(){return!0},update:function(t,e){var n,r=A(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(L)&&(t=i.value)}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return f.computeN([t],(function(e){return e.field(t)?[B]:[]}))}}),j=r.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),I={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},V=i.r$.define({combine:function(t){return(0,i.BO)(t,I,{highlightWordAroundCursor:function(t,e){return t||e},minSelectionLength:Math.min,maxMatches:Math.min})}});function W(t){var e=[q,_];return t&&e.push(V.of(t)),e}var z=r.p.mark({class:"cm-selectionMatch"}),H=r.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"}),_=r.lg.fromClass(function(){function t(e){T(this,t),this.decorations=this.getDeco(e)}return E(t,[{key:"update",value:function(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e=t.state.facet(V),n=t.state,o=n.selection;if(o.ranges.length>1)return r.p.none;var a,s=o.main,u=null;if(s.empty){if(!e.highlightWordAroundCursor)return r.p.none;if(u=n.charCategorizer(s.head),!(a=function(t,e,n){for(var r=t.lineAt(e),o=e-r.from,a=e-r.from;o>0;){var s=(0,S.cp)(r.text,o,!1);if(n(r.text.slice(s,o))!=i.D0.Word)break;o=s}for(;a<r.length;){var u=(0,S.cp)(r.text,a);if(n(r.text.slice(a,u))!=i.D0.Word)break;a=u}return o==a?null:r.text.slice(o,a)}(n.doc,s.head,u)))return r.p.none}else{var l=s.to-s.from;if(l<e.minSelectionLength||l>200)return r.p.none;if(!(a=n.sliceDoc(s.from,s.to).trim()))return r.p.none}var h,c=[],f=A(t.visibleRanges);try{for(f.s();!(h=f.n()).done;)for(var d=h.value,v=new R(n.doc,a,d.from,d.to);!v.next().done;){var p=v.value,g=p.from,m=p.to;if((!u||(0==g||u(n.sliceDoc(g-1,g))!=i.D0.Word)&&(m==n.doc.length||u(n.sliceDoc(m,m+1))!=i.D0.Word))&&(u&&g<=s.from&&m>=s.to?c.push(H.range(g,m)):(g>=s.to||m<=s.from)&&c.push(z.range(g,m)),c.length>e.maxMatches))return r.p.none}}catch(y){f.e(y)}finally{f.f()}return r.p.set(c)}}]),t}(),{decorations:function(t){return t.decorations}}),q=r.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),F=function(){function t(e,n,r){T(this,t),this.search=e,this.replace=n,this.caseInsensitive=r}return E(t,[{key:"eq",value:function(t){return this.search==t.search&&this.replace==t.replace&&this.caseInsensitive==t.caseInsensitive}},{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length;return new R(t,this.search,e,n,this.caseInsensitive?function(t){return t.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),t}(),$=i.Py.define(),U=i.Py.define(),G=i.QQ.define({create:function(){return new K(new F("","",!1),[])},update:function(t,e){var n,r=A(e.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is($)?t=new K(i.value,t.panel):i.is(U)&&(t=new K(t.query,i.value?[at]:[]))}}catch(o){r.e(o)}finally{r.f()}return t},provide:function(t){return f.computeN([t],(function(e){return e.field(t).panel}))}}),K=function t(e,n){T(this,t),this.query=e,this.panel=n},J=r.p.mark({class:"cm-searchMatch"}),Y=r.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),X=r.lg.fromClass(function(){function t(e){T(this,t),this.view=e,this.decorations=this.highlight(e.state.field(G))}return E(t,[{key:"update",value:function(t){var e=t.state.field(G);(e!=t.startState.field(G)||t.docChanged||t.selectionSet)&&(this.decorations=this.highlight(e))}},{key:"highlight",value:function(t){var e=t.query;if(!t.panel.length||!e.valid)return r.p.none;for(var n=this.view.state,i=this.view.viewport,o=e.cursor(n.doc,Math.max(0,i.from-e.search.length),Math.min(i.to+e.search.length,n.doc.length)),a=new y.f_,s=function(){var t=o.value,e=t.from,r=t.to,i=n.selection.ranges.some((function(t){return t.from==e&&t.to==r}));a.add(e,r,i?Y:J)};!o.next().done;)s();return a.finish()}}]),t}(),{decorations:function(t){return t.decorations}});function Q(t){return function(e){var n=e.state.field(G,!1);return n&&n.query.valid?t(e,n):st(e)}}function Z(t,e,n){var r=n.cursor(t,e).next();return r.done&&(r=n.cursor(t,0,e+n.search.length-1).next()).done?null:r.value}var tt=Q((function(t,e){var n=t.state.selection.main,r=n.from,i=n.to,o=Z(t.state.doc,t.state.selection.main.from+1,e.query);return!(!o||o.from==r&&o.to==i)&&(t.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0,effects:ft(t,o)}),!0)}));function et(t,e,n,r){for(var i=r;;){for(var o=Math.max(n,i-1e4-t.search.length),a=t.cursor(e,o,i),s=null;!a.next().done;)s=a.value;if(s)return s;if(o==n)return null;i-=1e4}}var nt=Q((function(t,e){var n=e.query,r=t.state,i=et(n,r.doc,0,r.selection.main.to-1)||et(n,r.doc,r.selection.main.from+1,r.doc.length);return!!i&&(t.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:ft(t,i)}),!0)})),rt=Q((function(t,e){for(var n=e.query.cursor(t.state.doc),r=[];!n.next().done;)r.push(i.jT.range(n.value.from,n.value.to));return!!r.length&&(t.dispatch({selection:i.jT.create(r)}),!0)})),it=Q((function(t,e){var n=e.query,r=t.state,i=Z(r.doc,r.selection.main.from,n);if(!i)return!1;var o,a=r.selection.main,s=a.from,u=a.to,l=[];if(i.from==s&&i.to==u&&(l.push({from:i.from,to:i.to,insert:n.replace}),i=Z(r.doc,i.to,n)),i){var h=0==l.length||l[0].from>=i.to?0:i.to-i.from-n.replace.length;o={anchor:i.from-h,head:i.to-h}}return t.dispatch({changes:l,selection:o,scrollIntoView:!!o,effects:i?ft(t,i):void 0}),!0})),ot=Q((function(t,e){for(var n=e.query,r=n.cursor(t.state.doc),i=[];!r.next().done;){var o=r.value,a=o.from,s=o.to;i.push({from:a,to:s,insert:n.replace})}return!!i.length&&(t.dispatch({changes:i}),!0)}));function at(t){var e=t.state.field(G).query;return{dom:ht({view:t,query:e,updateQuery:function(n){e.eq(n)||(e=n,t.dispatch({effects:$.of(e)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,class:"cm-search"}}var st=function(t){var e=t.state.field(G,!1);if(e&&e.panel.length){var n=d(t,at);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else t.dispatch({effects:[U.of(!0)].concat(x(e?[]:[i.Py.appendConfig.of(vt)]))});return!0},ut=function(t){var e=t.state.field(G,!1);if(!e||!e.panel.length)return!1;var n=d(t,at);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:U.of(!1)}),!0},lt=[{key:"Mod-f",run:st,scope:"editor search-panel"},{key:"F3",run:tt,shift:nt,scope:"editor search-panel"},{key:"Mod-g",run:tt,shift:nt,scope:"editor search-panel"},{key:"Escape",run:ut,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(t){var e=t.state,n=t.dispatch,r=e.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var o=r.main,a=o.from,s=o.to,u=[],l=0,h=new R(e.doc,e.sliceDoc(a,s));!h.next().done;){if(u.length>1e3)return!1;h.value.from==a&&(l=u.length),u.push(i.jT.range(h.value.from,h.value.to))}return n(e.update({selection:i.jT.create(u,l)})),!0}},{key:"Alt-g",run:function(t){var e=d(t,B);if(!e){var n=[L.of(!0)];null==t.state.field(N,!1)&&n.push(i.Py.appendConfig.of([c(),N,j])),t.dispatch({effects:n}),e=d(t,B)}return e&&e.dom.querySelector("input").focus(),!0}}];function ht(t){function e(e){return t.view.state.phrase(e)}var n=b("input",{value:t.query.search,placeholder:e("Find"),"aria-label":e("Find"),class:"cm-textfield",name:"search",onchange:a,onkeyup:a}),i=b("input",{value:t.query.replace,placeholder:e("Replace"),"aria-label":e("Replace"),class:"cm-textfield",name:"replace",onchange:a,onkeyup:a}),o=b("input",{type:"checkbox",name:"case",checked:!t.query.caseInsensitive,onchange:a});function a(){t.updateQuery(new F(n.value,i.value,!o.checked))}function s(t,e,n){return b("button",{class:"cm-button",name:t,onclick:e},n)}return b("div",{onkeydown:function(e){(0,r.$1)(t.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==n?(e.preventDefault(),(e.shiftKey?nt:tt)(t.view)):13==e.keyCode&&e.target==i&&(e.preventDefault(),it(t.view))}},[n,s("next",(function(){return tt(t.view)}),[e("next")]),s("prev",(function(){return nt(t.view)}),[e("previous")]),s("select",(function(){return rt(t.view)}),[e("all")]),b("label",null,[o,"match case"]),b("br"),i,s("replace",(function(){return it(t.view)}),[e("replace")]),s("replaceAll",(function(){return ot(t.view)}),[e("replace all")]),b("button",{name:"close",onclick:function(){return ut(t.view)},"aria-label":e("close")},["×"])])}var ct=/[\s\.,:;?!]/;function ft(t,e){var n=e.from,i=e.to;if(!t.hasFocus){var o=t.state.doc.lineAt(n).from,a=t.state.doc.lineAt(i).to,s=Math.max(o,n-30),u=Math.min(a,i+30),l=t.state.sliceDoc(s,u);if(s!=o)for(var h=0;h<30;h++)if(!ct.test(l[h+1])&&ct.test(l[h])){l=l.slice(h);break}if(u!=a)for(var c=l.length-1;c>l.length-30;c--)if(!ct.test(l[c-1])&&ct.test(l[c])){l=l.slice(0,c);break}return r.tk.announce.of("".concat(t.state.phrase("current match"),". ").concat(l," ").concat(t.state.phrase("on line")," ").concat(t.state.doc.lineAt(n).number))}}var dt=r.tk.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":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vt=[G,i.Wl.override(X),c(),dt]},77885:function(t,e,n){"use strict";n.d(e,{q6:function(){return X},as:function(){return m},D0:function(){return at},F6:function(){return z},jT:function(){return C},yy:function(){return ft},r$:function(){return D},gc:function(){return v},Wl:function(){return V},Py:function(){return tt},QQ:function(){return B},YW:function(){return et},BO:function(){return dt}});var r=n(23414);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){var e=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(t){return!1}}();return function(){var n,r=h(t);if(e){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t}var v,p=/\r\n?|\n/;!function(t){t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter"}(v||(v={}));var g=function(){function t(e){c(this,t),this.sections=e}return d(t,[{key:"iterGaps",value:function(t){for(var e=0,n=0,r=0;e<this.sections.length;){var i=this.sections[e++],o=this.sections[e++];o<0?(t(n,r,i),r+=i):r+=o,n+=i}}},{key:"iterChangedRanges",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"composeDesc",value:function(t){return this.empty?t:t.empty?this:S(this,t)}},{key:"mapDesc",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e)}},{key:"mapPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.Simple,r=0,i=0,o=0;o<this.sections.length;){var a=this.sections[o++],s=this.sections[o++],u=r+a;if(s<0){if(u>t)return i+(t-r);i+=a}else{if(n!=v.Simple&&u>=t&&(n==v.TrackDel&&r<t&&u>t||n==v.TrackBefore&&r<t||n==v.TrackAfter&&u>t))return null;if(u>t||u==t&&e<0&&!a)return t==r||e<0?i:i+s;i+=s}r=u}if(t>r)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=0,r=0;n<this.sections.length&&r<=e;){var i=this.sections[n++],o=this.sections[n++],a=r+i;if(o>=0&&r<=e&&a>=t)return!(r<t&&a>e)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var t="",e=0;e<this.sections.length;){var n=this.sections[e++],r=this.sections[e++];t+=(t?" ":"")+n+(r>=0?":"+r:"")}return t}},{key:"length",get:function(){for(var t=0,e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}},{key:"newLength",get:function(){for(var t=0,e=0;e<this.sections.length;e+=2){var n=this.sections[e+1];t+=n<0?this.sections[e]:n}return t}},{key:"empty",get:function(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}},{key:"invertedDesc",get:function(){for(var e=[],n=0;n<this.sections.length;){var r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new t(e)}}]),t}(),m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(n,t);var e=u(n);function n(t,r){var i;return c(this,n),(i=e.call(this,t)).inserted=r,i}return d(n,[{key:"apply",value:function(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return b(this,(function(e,n,r,i,o){return t=t.replace(r,r+(n-e),o)}),!1),t}},{key:"mapDesc",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return w(this,t,e,!0)}},{key:"invert",value:function(t){for(var e=this.sections.slice(),i=[],o=0,a=0;o<e.length;o+=2){var s=e[o],u=e[o+1];if(u>=0){e[o]=u,e[o+1]=s;for(var l=o>>1;i.length<l;)i.push(r.xv.empty);i.push(s?t.slice(a,a+s):r.xv.empty)}a+=s}return new n(e,i)}},{key:"compose",value:function(t){return this.empty?t:t.empty?this:S(this,t,!0)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.empty?this:w(this,t,e,!0)}},{key:"iterChanges",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];b(this,t,e)}},{key:"filter",value:function(t){var e=[],r=[],i=[],o=new x(this);t:for(var a=0,s=0;;){for(var u=a==t.length?1e9:t[a++];s<u||s==u&&0==o.len;){if(o.done)break t;var l=Math.min(o.len,u-s);y(i,l,-1);var h=-1==o.ins?-1:0==o.off?o.ins:0;y(e,l,h),h>0&&k(r,e,o.text),o.forward(l),s+=l}for(var c=t[a++];s<c;){if(o.done)break t;var f=Math.min(o.len,c-s);y(e,f,-1),y(i,f,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(f),s+=f}}return{changes:new n(e,r),filtered:new g(i)}}},{key:"toJSON",value:function(){for(var t=[],e=0;e<this.sections.length;e+=2){var n=this.sections[e],r=this.sections[e+1];r<0?t.push(n):0==r?t.push([n]):t.push([n].concat(this.inserted[e>>1].toJSON()))}return t}},{key:"desc",get:function(){return new g(this.sections)}}],[{key:"of",value:function(t,e,i){var a=[],s=[],u=0,l=null;function h(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t||a.length){u<e&&y(a,e-u,-1);var r=new n(a,s);l=l?l.compose(r.map(l)):r,a=[],s=[],u=0}}return function t(c){if(Array.isArray(c)){var f,d=o(c);try{for(d.s();!(f=d.n()).done;){t(f.value)}}catch(x){d.e(x)}finally{d.f()}}else if(c instanceof n){if(c.length!=e)throw new RangeError("Mismatched change set length (got ".concat(c.length,", expected ").concat(e,")"));h(),l=l?l.compose(c.map(l)):c}else{var v=c.from,g=c.to,m=void 0===g?v:g,b=c.insert;if(v>m||v<0||m>e)throw new RangeError("Invalid change range ".concat(v," to ").concat(m," (in doc of length ").concat(e,")"));var w=b?"string"==typeof b?r.xv.of(b.split(i||p)):b:r.xv.empty,S=w.length;if(v==m&&0==S)return;v<u&&h(),v>u&&y(a,v-u,-1),y(a,m-v,S),k(s,a,w),u=m}}(t),h(!l),l}},{key:"empty",value:function(t){return new n(t?[t,-1]:[],[])}},{key:"fromJSON",value:function(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");for(var e=[],i=[],o=0;o<t.length;o++){var a=t[o];if("number"==typeof a)e.push(a,-1);else{if(!Array.isArray(a)||"number"!=typeof a[0]||a.some((function(t,e){return e&&"string"!=typeof t})))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==a.length)e.push(a[0],0);else{for(;i.length<o;)i.push(r.xv.empty);i[o]=r.xv.of(a.slice(1)),e.push(a[0],i[o].length)}}}return new n(e,i)}}]),n}(g);function y(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!(0==e&&n<=0)){var i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:0==e&&0==t[i]?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}}function k(t,e,n){if(0!=n.length){var i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(r.xv.empty);t.push(n)}}}function b(t,e,n){for(var i=t.inserted,o=0,a=0,s=0;s<t.sections.length;){var u=t.sections[s++],l=t.sections[s++];if(l<0)o+=u,a+=u;else{for(var h=o,c=a,f=r.xv.empty;h+=u,c+=l,l&&i&&(f=f.append(i[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)u=t.sections[s++],l=t.sections[s++];e(o,h,a,c,f),o=h,a=c}}}function w(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new x(t),s=new x(e),u=0,l=0;;)if(-1==a.ins)u+=a.len,a.next();else if(-1==s.ins&&l<u){var h=Math.min(s.len,u-l);s.forward(h),y(i,h,-1),l+=h}else if(s.ins>=0&&(a.done||l<u||l==u&&(s.len<a.len||s.len==a.len&&!n))){for(y(i,s.ins,-1);u>l&&!a.done&&u+a.len<l+s.len;)u+=a.len,a.next();l+=s.len,s.next()}else{if(!(a.ins>=0)){if(a.done&&s.done)return o?new m(i,o):new g(i);throw new Error("Mismatched change set lengths")}for(var c=0,f=u+a.len;;)if(s.ins>=0&&l>u&&l+s.len<f)c+=s.ins,l+=s.len,s.next();else{if(!(-1==s.ins&&l<f))break;var d=Math.min(s.len,f-l);c+=d,s.forward(d),l+=d}y(i,c,a.ins),o&&k(o,i,a.text),u=f,a.next()}}function S(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new x(t),a=new x(e),s=!1;;){if(o.done&&a.done)return i?new m(r,i):new g(r);if(0==o.ins)y(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 u=Math.min(o.len2,a.len),l=r.length;if(-1==o.ins){var h=-1==a.ins?-1:a.off?0:a.ins;y(r,u,h,s),i&&h&&k(i,r,a.text)}else-1==a.ins?(y(r,o.off?0:o.len,u,s),i&&k(i,r,o.textBit(u))):(y(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&k(i,r,a.text));s=(o.ins>u||a.ins>=0&&a.len>u)&&(s||r.length>l),o.forward2(u),a.forward(u)}else y(r,0,a.ins,s),i&&k(i,r,a.text),a.next()}}var x=function(){function t(e){c(this,t),this.set=e,this.i=0,this.next()}return d(t,[{key:"next",value:function(){var t=this.set.sections;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}},{key:"textBit",value:function(t){var e=this.set.inserted,n=this.i-2>>1;return n>=e.length&&!t?r.xv.empty:e[n].slice(this.off,null==t?void 0:this.off+t)}},{key:"forward",value:function(t){t==this.len?this.next():(this.len-=t,this.off+=t)}},{key:"forward2",value:function(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?r.xv.empty:t[e]}}]),t}(),A=function(){function t(e,n,r){c(this,t),this.from=e,this.to=n,this.flags=r}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=e.mapPos(this.from,n),i=e.mapPos(this.to,n);return r==this.from&&i==this.to?this:new t(r,i,this.flags)}},{key:"extend",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return C.range(t,e);var n=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return C.range(this.anchor,n)}},{key:"eq",value:function(t){return this.anchor==t.anchor&&this.head==t.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var t=3&this.flags;return 3==t?null:t}},{key:"goalColumn",get:function(){var t=this.flags>>5;return 33554431==t?void 0:t}}],[{key:"fromJSON",value:function(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return C.range(t.anchor,t.head)}}]),t}(),C=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;c(this,t),this.ranges=e,this.mainIndex=n}return d(t,[{key:"map",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return e.empty?this:t.create(this.ranges.map((function(t){return t.map(e,n)})),this.mainIndex)}},{key:"eq",value:function(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].eq(t.ranges[e]))return!1;return!0}},{key:"asSingle",value:function(){return 1==this.ranges.length?this:new t([this.main])}},{key:"addRange",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=e,t.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(t){return t.toJSON()})),main:this.mainIndex}}},{key:"main",get:function(){return this.ranges[this.mainIndex]}}],[{key:"fromJSON",value:function(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map((function(t){return A.fromJSON(t)})),e.main)}},{key:"single",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new t([t.range(e,n)],0)}},{key:"create",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==e.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i<e.length;i++){var o=e[i];if(o.empty?o.from<=r:o.from<r)return M(e.slice(),n);r=o.to}return new t(e,n)}},{key:"cursor",value:function(t){var e=arguments.length>1&&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 A(t,t,(0==e?0:e<0?4:8)|(null==n?3:Math.min(2,n))|(null!=r?r:33554431)<<5)}},{key:"range",value:function(t,e,n){var r=(null!=n?n:33554431)<<5;return e<t?new A(e,t,16|r):new A(t,e,r)}}]),t}();function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t[e];t.sort((function(t,e){return t.from-e.from})),e=t.indexOf(n);for(var r=1;r<t.length;r++){var i=t[r],o=t[r-1];if(i.empty?i.from<=o.to:i.from<o.to){var a=o.from,s=Math.max(i.to,o.to);r<=e&&e--,t.splice(--r,2,i.anchor>i.head?C.range(s,a):C.range(a,s))}}return new C(t,e)}function O(t,e){var n,r=o(t.ranges);try{for(r.s();!(n=r.n()).done;){if(n.value.to>e)throw new RangeError("Selection points outside of document")}}catch(i){r.e(i)}finally{r.f()}}var T=0,D=function(){function t(e,n,r,i,o){c(this,t),this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.extensions=o,this.id=T++,this.default=e([])}return d(t,[{key:"of",value:function(t){return new P([],this,0,t)}},{key:"compute",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,1,e)}},{key:"computeN",value:function(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new P(t,this,2,e)}},{key:"from",value:function(t,e){return e||(e=function(t){return t}),this.compute([t],(function(n){return e(n.field(t))}))}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new t(e.combine||function(t){return t},e.compareInput||function(t,e){return t===e},e.compare||(e.combine?function(t,e){return t===e}:E),!!e.static,e.enables)}}]),t}();function E(t,e){return t==e||t.length==e.length&&t.every((function(t,n){return t===e[n]}))}var P=function(){function t(e,n,r,i){c(this,t),this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=T++}return d(t,[{key:"dynamicSlot",value:function(t){var e,n,r=this.value,i=this.facet.compareInput,a=t[this.id]>>1,s=2==this.type,u=!1,l=!1,h=[],c=o(this.dependencies);try{for(c.s();!(n=c.n()).done;){var f=n.value;"doc"==f?u=!0:"selection"==f?l=!0:0==(1&(null!==(e=t[f.id])&&void 0!==e?e:1))&&h.push(t[f.id])}}catch(d){c.e(d)}finally{c.f()}return function(t,e){if(!e||e.reconfigured)return t.values[a]=r(t),1;if(!(u&&e.docChanged||l&&(e.docChanged||e.selection)||h.some((function(e){return(1&q(t,e))>0}))))return 0;var n=r(t),o=e.startState.values[a];return(s?function(t,e,n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}(n,o,i):i(n,o))?0:(t.values[a]=n,1)}}}]),t}();var R=D.define({static:!0}),B=function(){function t(e,n,r,i,o){c(this,t),this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}return d(t,[{key:"create",value:function(t){var e=this,n=t.facet(R).find((function(t){return t.field==e}));return((null==n?void 0:n.create)||this.createF)(t)}},{key:"slot",value:function(t){var e=this,n=t[this.id]>>1;return function(t,r){if(!r)return t.values[n]=e.create(t),1;var i,o=0;if(r.reconfigured){var a=function(t,e){var n=t.config.address[e];return null==n?null:n>>1}(r.startState,e.id);i=null==a?e.create(r.startState):r.startState.values[a],o=1}else i=r.startState.values[n];var s=e.updateF(i,r);return o||e.compareF(i,s)||(o=1),o&&(t.values[n]=s),o}}},{key:"init",value:function(t){return[this,R.of({field:this,create:t})]}}],[{key:"define",value:function(e){var n=new t(T++,e.create,e.update,e.compare||function(t,e){return t===e},e);return e.provide&&(n.provides=e.provide(n)),n}}]),t}(),L=2,N=1,j=0;function I(t){return function(e){return new W(e,t)}}var V={fallback:I(3),default:I(L),extend:I(N),override:I(j)},W=function t(e,n){c(this,t),this.inner=e,this.prec=n},z=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new H(this,t)}},{key:"reconfigure",value:function(e){return t.reconfigure.of({compartment:this,extension:e})}}]),t}(),H=function t(e,n){c(this,t),this.compartment=e,this.inner=n},_=function(){function t(e,n,r,i,o){for(c(this,t),this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}return d(t,[{key:"staticFacet",value:function(t){var e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}}],[{key:"resolve",value:function(e,n,r){var i,a=[],s=Object.create(null),u=new Set,l=o(function(t,e,n){var r=[[],[],[],[]],i=new Map;function a(t,s){var u=i.get(t);if(null!=u){if(u>=s)return;var l=r[u].indexOf(t);l>-1&&r[u].splice(l,1),t instanceof H&&n.delete(t.compartment)}if(i.set(t,s),Array.isArray(t)){var h,c=o(t);try{for(c.s();!(h=c.n()).done;){a(h.value,s)}}catch(d){c.e(d)}finally{c.f()}}else if(t instanceof H){if(n.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");n.add(t.compartment),a(e.get(t.compartment)||t.inner,s)}else if(t instanceof W)a(t.inner,t.prec);else if(t instanceof B)r[s].push(t),t.provides&&a(t.provides,s);else if(t instanceof P)r[s].push(t),t.facet.extensions&&a(t.facet.extensions,s);else{var f=t.extension;if(!f)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));a(f,s)}}return a(t,L),r.reduce((function(t,e){return t.concat(e)}))}(e,n,u));try{for(l.s();!(i=l.n()).done;){var h=i.value;h instanceof B?a.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h)}}catch(k){l.e(k)}finally{l.f()}for(var c=Object.create(null),f=[],d=[],v=function(){var t=g[p];c[t.id]=d.length<<1,d.push((function(e){return t.slot(e)}))},p=0,g=a;p<g.length;p++)v();var m=function(t){var e=s[t],n=e[0].facet;if(e.every((function(t){return 0==t.type}))){c[n.id]=f.length<<1|1;var i=n.combine(e.map((function(t){return t.value}))),a=r?r.config.address[n.id]:null;if(null!=a){var u=F(r,a);n.compare(i,u)&&(i=u)}f.push(i)}else{var l,h=o(e);try{var v=function(){var t=l.value;0==t.type?(c[t.id]=f.length<<1|1,f.push(t.value)):(c[t.id]=d.length<<1,d.push((function(e){return t.dynamicSlot(e)})))};for(h.s();!(l=h.n()).done;)v()}catch(k){h.e(k)}finally{h.f()}c[n.id]=d.length<<1,d.push((function(t){return function(t,e,n){var r=n.map((function(e){return t[e.id]})),i=n.map((function(t){return t.type})),a=r.filter((function(t){return!(1&t)})),s=t[e.id]>>1;return function(t,n){var u,l=n?n.reconfigured?n.startState.config.address[e.id]:s<<1:null,h=null==l,c=o(a);try{for(c.s();!(u=c.n()).done;)1&q(t,u.value)&&(h=!0)}catch(k){c.e(k)}finally{c.f()}if(!h)return 0;for(var f=[],d=0;d<r.length;d++){var v=F(t,r[d]);if(2==i[d]){var p,g=o(v);try{for(g.s();!(p=g.n()).done;){var m=p.value;f.push(m)}}catch(k){g.e(k)}finally{g.f()}}else f.push(v)}var y=e.combine(f);return null!=l&&e.compare(y,F(n.startState,l))?0:(t.values[s]=y,1)}}(t,n,e)}))}};for(var y in s)m(y);return new t(e,function(t,e){var n=[];if(t.forEach((function(t,r){e.has(r)||n.push(r)})),!n.length)return t;var r=new Map;return t.forEach((function(t,e){n.indexOf(e)<0&&r.set(e,t)})),r}(n,u),d.map((function(t){return t(c)})),c,f)}}]),t}();function q(t,e){if(1&e)return 2;var n=e>>1,r=t.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;t.status[n]=4;var i=t.config.dynamicSlots[n](t,t.applying);return t.status[n]=2|i}function F(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}var $=D.define(),U=D.define({combine:function(t){return t.some((function(t){return t}))},static:!0}),G=D.define({combine:function(t){return t.length?t[0]:void 0},static:!0}),K=D.define(),J=D.define(),Y=D.define(),X=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,null,[{key:"define",value:function(){return new Q}}]),t}(),Q=function(){function t(){c(this,t)}return d(t,[{key:"of",value:function(t){return new X(this,t)}}]),t}(),Z=function(){function t(e){c(this,t),this.map=e}return d(t,[{key:"of",value:function(t){return new tt(this,t)}}]),t}(),tt=function(){function t(e,n){c(this,t),this.type=e,this.value=n}return d(t,[{key:"map",value:function(e){var n=this.type.map(this.value,e);return void 0===n?void 0:n==this.value?this:new t(this.type,n)}},{key:"is",value:function(t){return this.type==t}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Z(t.map||function(t){return t})}},{key:"mapEffects",value:function(t,e){if(!t.length)return t;var n,r=[],i=o(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.map(e);a&&r.push(a)}}catch(s){i.e(s)}finally{i.f()}return r}}]),t}();tt.reconfigure=tt.define(),tt.appendConfig=tt.define();var et=function(){function t(e,n,r,i,o,a){c(this,t),this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&O(r,n.newLength),o.some((function(e){return e.type==t.time}))||(this.annotations=o.concat(t.time.of(Date.now())))}return d(t,[{key:"annotation",value:function(t){var e,n=o(this.annotations);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.type==t)return r.value}}catch(i){n.e(i)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}}]),t}();function nt(t,e){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r<t.length&&(i==e.length||e[i]>=t[r]))o=t[r++],a=t[r++];else{if(!(i<e.length))return n;o=e[i++],a=e[i++]}!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function rt(t,e,n){var r,i,o,a;return n?(i=e.changes,o=m.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(o):null===(r=t.selection)||void 0===r?void 0:r.map(i),effects:tt.mapEffects(t.effects,i).concat(tt.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function it(t,e,n){var r=e.selection;return{changes:e.changes instanceof m?e.changes:m.of(e.changes||[],n,t.facet(G)),selection:r&&(r instanceof C?r:C.single(r.anchor,r.head)),effects:ut(e.effects),annotations:ut(e.annotations),scrollIntoView:!!e.scrollIntoView}}function ot(t,e,n){var r=it(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(n=!1);for(var i=1;i<e.length;i++){!1===e[i].filter&&(n=!1);var a=!!e[i].sequential;r=rt(r,it(t,e[i],a?r.changes.newLength:t.doc.length),a)}var s=new et(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(t){for(var e=t.startState,n=e.facet(Y),r=t,i=n.length-1;i>=0;i--){var o=n[i](t);o&&Object.keys(o).length&&(r=rt(t,it(e,o,t.changes.newLength),!0))}return r==t?t:new et(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(t){var e,n=t.startState,r=!0,i=o(n.facet(K));try{for(i.s();!(e=i.n()).done;){var a=(0,e.value)(t);if(!1===a){r=!1;break}Array.isArray(a)&&(r=!0===r?a:nt(r,a))}}catch(d){i.e(d)}finally{i.f()}if(!0!==r){var s,u;if(!1===r)u=t.changes.invertedDesc,s=m.empty(n.doc.length);else{var l=t.changes.filter(r);s=l.changes,u=l.filtered.invertedDesc}t=new et(n,s,t.selection&&t.selection.map(u),tt.mapEffects(t.effects,u),t.annotations,t.scrollIntoView)}for(var h=n.facet(J),c=h.length-1;c>=0;c--){var f=h[c](t);t=f instanceof et?f:Array.isArray(f)&&1==f.length&&f[0]instanceof et?f[0]:ot(n,ut(f),!1)}return t}(s):s)}et.time=X.define(),et.userEvent=X.define(),et.addToHistory=X.define();var at,st=[];function ut(t){return null==t?st:Array.isArray(t)?t:[t]}!function(t){t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other"}(at||(at={}));var lt,ht=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{lt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(vt){}function ct(t){return function(e){if(!/\S/.test(e))return at.Space;if(function(t){if(lt)return lt.test(t);for(var e=0;e<t.length;e++){var n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||ht.test(n)))return!0}return!1}(e))return at.Word;for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return at.Word;return at.Other}}var ft=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(c(this,t),this.config=e,this.doc=n,this.selection=r,this.applying=null,this.status=e.statusTemplate.slice(),i&&i.startState.config==e)this.values=i.startState.values.slice();else if(this.values=e.dynamicSlots.map((function(t){return null})),i)for(var o in e.address){var a=e.address[o],s=i.startState.config.address[o];null!=s&&0==(1&a)&&(this.values[a>>1]=F(i.startState,s))}this.applying=i,i&&(i._state=this);for(var u=0;u<this.config.dynamicSlots.length;u++)q(this,u<<1);this.applying=null}return d(t,[{key:"field",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.config.address[t.id];if(null!=n)return q(this,n),F(this,n);if(e)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ot(this,e,!0)}},{key:"applyTransaction",value:function(e){var n,r=this.config,i=r,a=i.base,s=i.compartments,u=o(e.effects);try{for(u.s();!(n=u.n()).done;){var l=n.value;l.is(z.reconfigure)?(r&&(s=new Map,r.compartments.forEach((function(t,e){return s.set(e,t)})),r=null),s.set(l.value.compartment,l.value.extension)):l.is(tt.reconfigure)?(r=null,a=l.value):l.is(tt.appendConfig)&&(r=null,a=ut(a).concat(l.value))}}catch(h){u.e(h)}finally{u.f()}new t(r||_.resolve(a,s,this),e.newDoc,e.newSelection,e)}},{key:"replaceSelection",value:function(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((function(e){return{changes:{from:e.from,to:e.to,insert:t},range:C.cursor(e.from+t.length)}}))}},{key:"changeByRange",value:function(t){for(var e=this.selection,n=t(e.ranges[0]),r=this.changes(n.changes),i=[n.range],o=ut(n.effects),a=1;a<e.ranges.length;a++){for(var s=t(e.ranges[a]),u=this.changes(s.changes),l=u.map(r),h=0;h<a;h++)i[h]=i[h].map(l);var c=r.mapDesc(u,!0);i.push(s.range.map(c)),r=r.compose(l),o=tt.mapEffects(o,l).concat(tt.mapEffects(ut(s.effects),c))}return{changes:r,selection:C.create(i,e.mainIndex),effects:o}}},{key:"changes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e instanceof m?e:m.of(e,this.doc.length,this.facet(t.lineSeparator))}},{key:"toText",value:function(e){return r.xv.of(e.split(this.facet(t.lineSeparator)||p))}},{key:"sliceDoc",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak)}},{key:"facet",value:function(t){var e=this.config.address[t.id];return null==e?t.default:(q(this,e),F(this,e))}},{key:"toJSON",value:function(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var n in t)e[n]=t[n].spec.toJSON(this.field(t[n]),this);return e}},{key:"phrase",value:function(e){var n,r=o(this.facet(t.phrases));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(Object.prototype.hasOwnProperty.call(i,e))return i[e]}}catch(a){r.e(a)}finally{r.f()}return e}},{key:"languageDataAt",value:function(t,e){var n,r=[],i=o(this.facet($));try{for(i.s();!(n=i.n()).done;){var a,s=o((0,n.value)(this,e));try{for(s.s();!(a=s.n()).done;){var u=a.value;Object.prototype.hasOwnProperty.call(u,t)&&r.push(u[t])}}catch(l){s.e(l)}finally{s.f()}}}catch(l){i.e(l)}finally{i.f()}return r}},{key:"charCategorizer",value:function(t){return ct(this.languageDataAt("wordChars",t).join(""))}},{key:"tabSize",get:function(){return this.facet(t.tabSize)}},{key:"lineBreak",get:function(){return this.facet(t.lineSeparator)||"\n"}}],[{key:"fromJSON",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(t){var n=r[t],o=e[t];i.push(n.init((function(t){return n.spec.fromJSON(o,t)})))};for(var a in r)o(a)}return t.create({doc:e.doc,selection:C.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=_.resolve(e.extensions||[],new Map),i=e.doc instanceof r.xv?e.doc:r.xv.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||p)),o=e.selection?e.selection instanceof C?e.selection:C.single(e.selection.anchor,e.selection.head):C.single(0);return O(o,i.length),n.staticFacet(U)||(o=o.asSingle()),new t(n,i,o)}}]),t}();function dt(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},a=o(t);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,u=0,l=Object.keys(s);u<l.length;u++){var h=l[u],c=s[h],f=i[h];if(void 0===f)i[h]=c;else if(f===c||void 0===c);else{if(!Object.hasOwnProperty.call(r,h))throw new Error("Config merge conflict for field "+h);i[h]=r[h](f,c)}}}catch(v){a.e(v)}finally{a.f()}for(var d in e)void 0===i[d]&&(i[d]=e[d]);return i}ft.allowMultipleSelections=U,ft.tabSize=D.define({combine:function(t){return t.length?t[0]:4}}),ft.lineSeparator=G,ft.phrases=D.define(),ft.languageData=$,ft.changeFilter=K,ft.transactionFilter=J,ft.transactionExtender=Y,z.reconfigure=tt.define()},11163:function(t,e,n){"use strict";n.d(e,{i:function(){return A}});var r=n(26856),i=n(49619),o=n(64928),a=n(23414);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=h(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=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(t){return!1}}();return function(){var n,r=g(t);if(e){var i=g(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function v(t,e){return!e||"object"!==m(e)&&"function"!=typeof e?p(t):e}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function b(t,e,n){return e&&k(t.prototype,e),n&&k(t,n),t}function w(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return null==e&&-1==(e=t.search(/[^\s\u00a0]/))&&(e=t.length),(0,a.IS)(t.slice(r,e),i,n)}var S=function(){function t(e,n,r){y(this,t),this.string=e,this.tabSize=n,this.indentUnit=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}return b(t,[{key:"eol",value:function(){return this.pos>=this.string.length}},{key:"sol",value:function(){return 0==this.pos}},{key:"peek",value:function(){return this.string.charAt(this.pos)||void 0}},{key:"next",value:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}},{key:"eat",value:function(t){var e=this.string.charAt(this.pos);if("string"==typeof t?e==t:e&&(t instanceof RegExp?t.test(e):t(e)))return++this.pos,e}},{key:"eatWhile",value:function(t){for(var e=this.pos;this.eat(t););return this.pos>e}},{key:"eatSpace",value:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}},{key:"skipToEnd",value:function(){this.pos=this.string.length}},{key:"skipTo",value:function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}},{key:"backUp",value:function(t){this.pos-=t}},{key:"column",value:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=w(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}},{key:"indentation",value:function(){return w(this.string,null,this.tabSize)}},{key:"match",value:function(t,e,n){if("string"==typeof t){var r=function(t){return n?t.toLowerCase():t};return r(this.string.substr(this.pos,t.length))==r(t)?(!1!==e&&(this.pos+=t.length),!0):null}var i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}},{key:"current",value:function(){return this.string.slice(this.start,this.pos)}}]),t}();function x(t){if("object"!=m(t))return t;var e={};for(var n in t){var r=t[n];e[n]=r instanceof Array?r.slice():r}return e}var A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(n,t);var e=d(n);function n(t){var i;y(this,n);var a,s=(0,o.kU)(t.languageData),u={token:(a=t).token,blankLine:a.blankLine||function(){},startState:a.startState||function(){return!0},copyState:a.copyState||x,indent:a.indent||function(){return null},languageData:a.languageData||{}};return(i=e.call(this,s,{startParse:function(t,e,n){return new O(p(i),t,e,n)}},function(t){var e=r.Jq.define({id:E.length,name:"Document",props:[o.mi.add((function(){return t}))]});return E.push(e),e}(s),[o.tK.of((function(t,e){return i.getIndent(t,e)}))])).streamParser=u,i.stateAfter=new WeakMap,i}return b(n,[{key:"getIndent",value:function(t,e){for(var n=(0,o.qz)(t.state),r=n.resolve(e);r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;var i,a,s=C(this,n,0,r.from,e);if(s?(a=s.state,i=s.pos+1):(a=this.streamParser.startState(t.unit),i=0),e-i>1e4)return null;for(;i<e;){var u=t.state.doc.lineAt(i),l=Math.min(e,u.to);if(u.length)for(var h=new S(u.text,t.state.tabSize,t.unit);h.pos<l-u.from;)T(this.streamParser.token,h,a);else this.streamParser.blankLine(a,t.unit);if(l==e)break;i=u.to+1}var c=t.state.doc.lineAt(e).text;return this.streamParser.indent(a,/^\s*(.*)/.exec(c)[1],t)}},{key:"allowsNesting",get:function(){return!1}}],[{key:"define",value:function(t){return new n(t)}}]),n}(o.SQ);function C(t,e,n,i,o){var a=n>=i&&n+e.length<=o&&t.stateAfter.get(e);if(a)return{state:t.streamParser.copyState(a),pos:n+e.length};for(var s=e.children.length-1;s>=0;s--){var u=e.children[s],l=n+e.positions[s],h=u instanceof r.mp&&l<o&&C(t,u,l,i,o);if(h)return h}return null}function M(t,e,n,i,o){if(o&&n<=0&&i>=e.length)return e;o||e.type!=t.topNode||(o=!0);for(var a=e.children.length-1;a>=0;a--){var s=e.positions[a]+n,u=e.children[a],l=void 0;if(s<i&&u instanceof r.mp){if(!(l=M(t,u,n-s,i-s,o)))break;return o?new r.mp(e.type,e.children.slice(0,a).concat(l),e.positions.slice(0,a+1),s+l.length):l}}return null}var O=function(){function t(e,n,i,a){y(this,t),this.lang=e,this.input=n,this.startPos=i,this.context=a,this.chunks=[],this.chunkPos=[],this.chunk=[];var s=function(t,e,n,i){var a,s=l(e);try{for(s.s();!(a=s.n()).done;){var u=a.value,h=u.from<=n&&u.to>n&&C(t,u.tree,0-u.offset,n,u.to),c=void 0;if(h&&(c=M(t,u.tree,n+u.offset,h.pos+u.offset,!1)))return{state:h.state,tree:c}}}catch(f){s.e(f)}finally{s.f()}return{state:t.streamParser.startState((0,o.y1)(i)),tree:r.mp.empty}}(e,a.fragments,i,a.state),u=s.state,h=s.tree;this.state=u,this.pos=this.chunkStart=i+h.length,h.length&&(this.chunks.push(h),this.chunkPos.push(i)),this.pos<a.viewport.from-1e5&&(this.state=this.lang.streamParser.startState((0,o.y1)(a.state)),a.skipUntilInView(this.pos,a.viewport.from),this.pos=a.viewport.from)}return b(t,[{key:"advance",value:function(){for(var t=Math.min(this.context.viewport.to,this.chunkStart+2048);this.pos<t;)this.parseLine();return this.chunkStart<this.pos&&this.finishChunk(),this.pos<this.context.viewport.to?null:(this.context.skipUntilInView(this.pos,this.input.length),this.finish())}},{key:"parseLine",value:function(){var t=this.input.lineAfter(this.pos),e=this.lang.streamParser,n=new S(t,this.context?this.context.state.tabSize:4,(0,o.y1)(this.context.state));if(n.eol())e.blankLine(this.state,n.indentUnit);else for(;!n.eol();){var r=T(e.token,n,this.state);r&&this.chunk.push(B(r),this.pos+n.start,this.pos+n.pos,4)}this.pos+=t.length,this.pos<this.input.length&&this.pos++}},{key:"finishChunk",value:function(){var t=r.mp.build({buffer:this.chunk,start:this.chunkStart,length:this.pos-this.chunkStart,nodeSet:P,topID:0,maxBufferLength:2048});this.lang.stateAfter.set(t,this.lang.streamParser.copyState(this.state)),this.chunks.push(t),this.chunkPos.push(this.chunkStart),this.chunk=[],this.chunkStart=this.pos}},{key:"finish",value:function(){return new r.mp(this.lang.topNode,this.chunks,this.chunkPos,this.pos-this.startPos).balance()}},{key:"forceFinish",value:function(){return this.finish()}}]),t}();function T(t,e,n){e.start=e.pos;for(var r=0;r<10;r++){var i=t(e,n);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}var D=Object.create(null),E=[r.Jq.none],P=new r.Lj(E),R=[];function B(t){return t?D[t]||(D[t]=function(t){var e,n=null,o=l(t.split("."));try{for(o.s();!(e=o.n()).done;){var a=e.value,u=i.pJ[a];u?"function"==typeof u?n?n=u(n):W(a,"Modifier ".concat(a," used at start of tag")):n?W(a,"Tag ".concat(a," used as modifier")):n=u:W(a,"Unknown highlighting tag ".concat(a))}}catch(f){o.e(f)}finally{o.f()}if(!n)return 0;var h=t.replace(/ /g,"_"),c=r.Jq.define({id:E.length,name:h,props:[(0,i.Gv)(s({},h,n))]});return E.push(c),c.id}(t)):0}for(var L=0,N=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","typeName"],["attribute","propertyName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];L<N.length;L++){var j=u(N[L],2),I=j[0],V=j[1];D[I]=B(V)}function W(t,e){R.indexOf(t)>-1||(R.push(t),console.warn(e))}},23414:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){var e=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(t){return!1}}();return function(){var n,r=c(t);if(e){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function h(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),t}n.d(e,{xv:function(){return T},gm:function(){return A},nZ:function(){return C},IS:function(){return M},cp:function(){return k},Gz:function(){return O}});for(var p="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((function(t){return t?parseInt(t,36):1})),g=1;g<p.length;g++)p[g]+=p[g-1];function m(t){for(var e=1;e<p.length;e+=2)if(p[e]>t)return p[e-1]<=t;return!1}function y(t){return t>=127462&&t<=127487}function k(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n?b:w)(t,e)}function b(t,e){if(e==t.length)return e;e&&S(t.charCodeAt(e))&&x(t.charCodeAt(e-1))&&e--;var n=A(t,e);for(e+=C(n);e<t.length;){var r=A(t,e);if(8205==n||8205==r||m(r))e+=C(r),n=r;else{if(!y(r))break;for(var i=0,o=e-2;o>=0&&y(A(t,o));)i++,o-=2;if(i%2==0)break;e+=2}}return e}function w(t,e){for(;e>0;){var n=b(t,e-2);if(n<e)return n;e--}return 0}function S(t){return t>=56320&&t<57344}function x(t){return t>=55296&&t<56320}function A(t,e){var n=t.charCodeAt(e);if(!x(n)||e+1==t.length)return n;var r=t.charCodeAt(e+1);return S(r)?r-56320+(n-55296<<10)+65536:n}function C(t){return t<65536?1:2}function M(t,e,n){for(var r=0;r<t.length;)9==t.charCodeAt(r)?(e+=n-e%n,r++):(e++,r=k(t,r));return e}function O(t,e,n,r){for(var i=0;i<t.length;){if(e>=n)return{offset:i,leftOver:0};e+=9==t.charCodeAt(i)?r-e%r:1,i=k(t,i)}return{offset:t.length,leftOver:n-e}}var T=function(){function t(){f(this,t)}return v(t,[{key:"lineAt",value:function(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0)}},{key:"line",value:function(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0)}},{key:"replace",value:function(t,e,n){var r=[];return this.decompose(0,t,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(e,this.length,r,1),E.from(r,this.length-(e-t)+n.length)}},{key:"append",value:function(t){return this.replace(this.length,this.length,t)}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(t,e,n,0),E.from(n,e-t)}},{key:"eq",value:function(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;for(var e=new L(this),n=new L(t);;){if(e.next(),n.next(),e.lineBreak!=n.lineBreak||e.done!=n.done||e.value!=n.value)return!1;if(e.done)return!0}}},{key:"iter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new L(this,t)}},{key:"iterRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new N(this,t,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var t=[];return this.flatten(t),t}}],[{key:"of",value:function(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new D(e):E.from(D.split(e,[])):t.empty}}]),t}();"undefined"!=typeof Symbol&&(T.prototype[Symbol.iterator]=function(){return this.iter()});var D=function(t){s(n,t);var e=l(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P(t);return f(this,n),(r=e.call(this)).text=t,r.length=i,r}return v(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((e?n:a)>=t)return new j(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(t,e,r,i){var o=t<=0&&e>=this.length?this:new n(B(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&i){var a=r.pop(),s=R(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var u=s.length>>1;r.push(new n(s.slice(0,u)),new n(s.slice(u)))}}else r.push(o)}},{key:"replace",value:function(t,e,r){if(!(r instanceof n))return a(c(n.prototype),"replace",this).call(this,t,e,r);var i=R(this.text,R(r.text,B(this.text,0,t)),e),o=this.length+r.length-(e-t);return i.length<=32?new n(i,o):E.from(n.split(i,[]),o)}},{key:"sliceString",value:function(t){for(var e=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<=e&&o<this.text.length;o++){var a=this.text[o],s=i+a.length;i>t&&o&&(r+=n),t<s&&e>i&&(r+=a.slice(Math.max(0,t-i),e-i)),i=s+1}return r}},{key:"flatten",value:function(t){var e,n=i(this.text);try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(o){n.e(o)}finally{n.f()}}},{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}}],[{key:"split",value:function(t,e){var r,o=[],a=-1,s=i(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;o.push(u),a+=u.length+1,32==o.length&&(e.push(new n(o,a)),o=[],a=-1)}}catch(l){s.e(l)}finally{s.f()}return a>-1&&e.push(new n(o,a)),e}}]),n}(T),E=function(t){s(n,t);var e=l(n);function n(t,r){var o;f(this,n),(o=e.call(this)).children=t,o.length=r,o.lines=0;var a,s=i(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.lines+=u.lines}}catch(l){s.e(l)}finally{s.f()}return o}return v(n,[{key:"lineInner",value:function(t,e,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((e?s:a)>=t)return o.lineInner(t,e,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(t,e,n,r){for(var i=0,o=0;o<=e&&i<this.children.length;i++){var a=this.children[i],s=o+a.length;if(t<=s&&e>=o){var u=r&((o<=t?1:0)|(s>=e?2:0));o>=t&&s<=e&&!u?n.push(a):a.decompose(t-o,e-o,n,u)}o=s+1}}},{key:"replace",value:function(t,e,r){if(r.lines<this.lines)for(var i=0,o=0;i<this.children.length;i++){var s=this.children[i],u=o+s.length;if(t>=o&&e<=u){var l=s.replace(t-o,e-o,r),h=this.lines-s.lines+l.lines;if(l.lines<h>>4&&l.lines>h>>6){var f=this.children.slice();return f[i]=l,new n(f,this.length-(e-t)+r.length)}return a(c(n.prototype),"replace",this).call(this,o,u,l)}o=u+1}return a(c(n.prototype),"replace",this).call(this,t,e,r)}},{key:"sliceString",value:function(t){for(var e=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<this.children.length&&o<=e;i++){var a=this.children[i],s=o+a.length;o>t&&i&&(r+=n),t<s&&e>o&&(r+=a.sliceString(t-o,e-o,n)),o=s+1}return r}},{key:"flatten",value:function(t){var e,n=i(this.children);try{for(n.s();!(e=n.n()).done;){e.value.flatten(t)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.reduce((function(t,e){return t+e.length+1}),-1),o=0,a=i(t);try{for(a.s();!(e=a.n()).done;){var s=e.value;o+=s.lines}}catch(A){a.e(A)}finally{a.f()}if(o<32){var u,l=[],h=i(t);try{for(h.s();!(u=h.n()).done;){var c=u.value;c.flatten(l)}}catch(A){h.e(A)}finally{h.f()}return new D(l,r)}var f=Math.max(32,o>>5),d=f<<1,v=f>>1,p=[],g=0,m=-1,y=[];function k(t){var e;if(t.lines>d&&t instanceof n){var r,o=i(t.children);try{for(o.s();!(r=o.n()).done;){k(r.value)}}catch(A){o.e(A)}finally{o.f()}}else t.lines>v&&(g>v||!g)?(b(),p.push(t)):t instanceof D&&g&&(e=y[y.length-1])instanceof D&&t.lines+e.lines<=32?(g+=t.lines,m+=t.length+1,y[y.length-1]=new D(e.text.concat(t.text),e.length+1+t.length)):(g+t.lines>f&&b(),g+=t.lines,m+=t.length+1,y.push(t))}function b(){0!=g&&(p.push(1==y.length?y[0]:n.from(y,m)),m=-1,g=y.length=0)}var w,S=i(t);try{for(S.s();!(w=S.n()).done;){var x=w.value;k(x)}}catch(A){S.e(A)}finally{S.f()}return b(),1==p.length?p[0]:new n(p,r)}}]),n}(T);function P(t){var e,n=-1,r=i(t);try{for(r.s();!(e=r.n()).done;){n+=e.value.length+1}}catch(o){r.e(o)}finally{r.f()}return n}function R(t,e){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<t.length&&i<=r;o++){var s=t[o],u=i+s.length;u>=n&&(u>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),a?(e[e.length-1]+=s,a=!1):e.push(s)),i=u+1}return e}function B(t,e,n){return R(t,[""],e,n)}T.empty=new D([""],0);var L=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;f(this,t),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?0:e instanceof D?e.text.length:e.children.length]}return v(t,[{key:"next",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var e=this.nodes.length-1;if(e<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[e],r=this.offsets[e],i=n instanceof D?n.text.length:n.children.length;if(r==(this.dir>0?i:0))this.nodes.pop(),this.offsets.pop();else if(this.lineBreak||r==(this.dir>0?0:i))if(n instanceof D){var o=n.text[r-(this.dir<0?1:0)];if(this.offsets[e]=r+=this.dir,this.lineBreak=!1,o.length>Math.max(0,t))return this.value=0==t?o:this.dir>0?o.slice(t):o.slice(0,o.length-t),this;t-=o.length}else{var a=n.children[this.dir>0?r:r-1];this.offsets[e]=r+this.dir,this.lineBreak=!1,t>a.length?t-=a.length:(this.nodes.push(a),this.offsets.push(this.dir>0?0:a instanceof D?a.text.length:a.children.length))}else{if(this.lineBreak=!0,0==t)return this.value="\n",this;t--}}}}]),t}(),N=function(){function t(e,n,r){f(this,t),this.value="",this.cursor=new L(e,n>r?-1:1),n>r?(this.skip=e.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return v(t,[{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip+t),n=e.value,r=e.lineBreak,i=e.done;this.skip=0,this.value=n;var o=r?1:n.length;o>this.limit&&(this.value=this.cursor.dir>0?n.slice(0,this.limit):n.slice(o-this.limit)),i||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),t}(),j=function(){function t(e,n,r,i){f(this,t),this.from=e,this.to=n,this.number=r,this.text=i}return v(t,[{key:"length",get:function(){return this.to-this.from}}]),t}()},19753:function(t,e,n){"use strict";n.d(e,{kH:function(){return Ct},p:function(){return Ot},Nm:function(){return fe},tk:function(){return _n},BF:function(){return Kt},lg:function(){return Xt},Uw:function(){return lr},ZO:function(){return br},$f:function(){return tr},$1:function(){return rr}});for(var r=n(77885),i=n(23414),o=n(62038),a=n(13764),s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},u={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},l="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),h="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),c="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),f="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),d="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),v=l&&(f||+l[1]<57)||c&&f,p=0;p<10;p++)s[48+p]=s[96+p]=String(p);for(p=1;p<=24;p++)s[p+111]="F"+p;for(p=65;p<=90;p++)s[p]=String.fromCharCode(p+32),u[p]=String.fromCharCode(p);for(var g in s)u.hasOwnProperty(g)||(u[g]=s[g]);function m(t,e,n){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=A(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=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(t){return!1}}();return function(){var n,r=A(t);if(e){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function S(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?x(t):e}function x(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||E(t)||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 M(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=E(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function D(t,e,n){return e&&T(t.prototype,e),n&&T(t,n),t}function E(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var R=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||E(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}("undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],2),B=R[0],L=R[1],N=/Edge\/(\d+)/.exec(B.userAgent),j=/MSIE \d/.test(B.userAgent),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(B.userAgent),V=!!(j||I||N),W=!V&&/gecko\/(\d+)/i.test(B.userAgent),z=!V&&/Chrome\/(\d+)/.exec(B.userAgent),H="webkitFontSmoothing"in L.documentElement.style,_=!V&&/Apple Computer/.test(B.vendor),q={mac:/Mac/.test(B.platform),ie:V,ie_version:j?L.documentMode||6:I?+I[1]:N?+N[1]:0,gecko:W,gecko_version:W?+(/Firefox\/(\d+)/.exec(B.userAgent)||[0,0])[1]:0,chrome:!!z,chrome_version:z?+z[1]:0,ios:_&&(/Mobile\/\w+/.test(B.userAgent)||B.maxTouchPoints>2),android:/Android\b/.test(B.userAgent),webkit:H,safari:_,webkit_version:H?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=L.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function F(t){return t.getSelection?t.getSelection():document.getSelection()}function $(t,e){if(!e.anchorNode)return!1;try{return t.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)}catch(n){return!1}}function U(t){if(3==t.nodeType){var e=it();return e.setEnd(t,t.nodeValue.length),e.setStart(t,0),e.getClientRects()}return 1==t.nodeType?t.getClientRects():[]}function G(t,e,n,r){return!!n&&(J(t,e,n,r,-1)||J(t,e,n,r,1))}function K(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function J(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Y(t))){if("DIV"==t.nodeName)return!1;var o=t.parentNode;if(!o||1!=o.nodeType)return!1;e=K(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(i<0?-1:0)],e=i<0?Y(t):0}}}function Y(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}var X={left:0,right:0,top:0,bottom:0};function Q(t,e){var n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Z(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}var tt,et=function(){function t(){O(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return D(t,[{key:"eq",value:function(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}},{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}]),t}(),nt=null;function rt(t){if(t.setActive)return t.setActive();if(nt)return t.focus(nt);for(var e=[],n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(null==nt?{get preventScroll(){return nt={preventScroll:!0},!0}}:void 0),!nt){nt=!1;for(var r=0;r<e.length;){var i=e[r++],o=e[r++],a=e[r++];i.scrollTop!=o&&(i.scrollTop=o),i.scrollLeft!=a&&(i.scrollLeft=a)}}}function it(){return tt||(tt=document.createRange())}var ot=function(){function t(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O(this,t),this.node=e,this.offset=n,this.precise=r}return D(t,null,[{key:"before",value:function(e,n){return new t(e.parentNode,K(e),n)}},{key:"after",value:function(e,n){return new t(e.parentNode,K(e)+1,n)}}]),t}(),at=[],st=function(){function t(){O(this,t),this.parent=null,this.dom=null,this.dirty=2}return D(t,[{key:"posBefore",value:function(t){var e,n=this.posAtStart,r=M(this.children);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i==t)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(t){return this.posBefore(t)+t.length}},{key:"coordsAt",value:function(t,e){return null}},{key:"sync",value:function(e){if(2&this.dirty){var n,r=this.dom,i=null,o=M(this.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.dirty){var s=i?i.nextSibling:r.firstChild;!s||a.dom||t.get(s)||a.reuseDOM(s),a.sync(e),a.dirty=0}e&&e.node==r&&i!=a.dom&&(e.written=!0),lt(r,i,a.dom),i=a.dom}}catch(f){o.e(f)}finally{o.f()}var u=i?i.nextSibling:r.firstChild;for(u&&e&&e.node==r&&(e.written=!0);u;)u=ut(u)}else if(1&this.dirty){var l,h=M(this.children);try{for(h.s();!(l=h.n()).done;){var c=l.value;c.dirty&&(c.sync(e),c.dirty=0)}}catch(f){h.e(f)}finally{h.f()}}}},{key:"reuseDOM",value:function(t){return!1}},{key:"localPosFromDOM",value:function(e,n){var r;if(e==this.dom)r=this.dom.childNodes[n];else{for(var i=0==Y(e)?0:0==n?-1:1;;){var o=e.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=e==o.firstChild?-1:1),e=o}r=i<0?e:e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!t.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var u=this.children[a];if(u.dom==r)return s;s+=u.length+u.breakAfter}}},{key:"domBoundsAround",value:function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,u=n;s<this.children.length;s++){var l=this.children[s],h=u+l.length;if(u<t&&h>e)return l.domBoundsAround(t,e,u);if(h>=t&&-1==r&&(r=s,i=u),h>=e&&h!=u&&-1==o){o=s,a=h;break}u=h+l.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<this.children.length-1&&o>=0?this.children[o+1].dom:null}}},{key:"markDirty",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(t))}},{key:"markParentsDirty",value:function(t){for(var e=this.parent;e;e=e.parent){if(t&&(e.dirty|=2),1&e.dirty)return;e.dirty|=1,t=!1}}},{key:"setParent",value:function(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(t){this.dom=t,t.cmView=this}},{key:"replaceChildren",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:at;this.markDirty();for(var i=t;i<e;i++)this.children[i].parent=null;(n=this.children).splice.apply(n,[t,e-t].concat(C(r)));for(var o=0;o<r.length;o++)r[o].setParent(this)}},{key:"ignoreMutation",value:function(t){return!1}},{key:"ignoreEvent",value:function(t){return!1}},{key:"childCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length;return new ht(this.children,t,this.children.length)}},{key:"childPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(t,e)}},{key:"toString",value:function(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var t=this;;){var e=t.parent;if(!e)return t;t=e}}}],[{key:"get",value:function(t){return t.cmView}}]),t}();function ut(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}function lt(t,e,n){var r=e?e.nextSibling:t.firstChild;if(n.parentNode==t)for(;r!=n;)r=ut(r);else t.insertBefore(n,r)}st.prototype.breakAfter=0;var ht=function(){function t(e,n,r){O(this,t),this.children=e,this.pos=n,this.i=r,this.off=0}return D(t,[{key:"findPos",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),t}(),ct=[],ft=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"become",value:function(t){return!1}},{key:"getSide",value:function(){return 0}}]),n}(st);ft.prototype.children=ct;var dt=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).text=t,r}return D(n,[{key:"createDOM",value:function(t){this.setDOM(t||document.createTextNode(this.text))}},{key:"sync",value:function(t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(t){return 3==t.nodeType&&(this.createDOM(t),!0)}},{key:"merge",value:function(t,e,r){return(!r||r instanceof n&&!(this.length-(e-t)+r.length>256))&&(this.text=this.text.slice(0,t)+(r?r.text:"")+this.text.slice(e),this.markDirty(),!0)}},{key:"slice",value:function(t){return new n(this.text.slice(t))}},{key:"localPosFromDOM",value:function(t,e){return t==this.dom?e:e?this.text.length:0}},{key:"domAtPos",value:function(t){return new ot(this.dom,t)}},{key:"domBoundsAround",value:function(t,e,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(t,e){return pt(this.dom,t,e)}},{key:"length",get:function(){return this.text.length}}]),n}(ft),vt=function(t){k(n,t);var e=w(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;O(this,n),(r=e.call(this)).mark=t,r.children=i,r.length=o;var a,s=M(i);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.setParent(x(r))}}catch(l){s.e(l)}finally{s.f()}return r}return D(n,[{key:"createDOM",value:function(){var t=document.createElement(this.mark.tagName);if(this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(var e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);this.setDOM(t)}},{key:"sync",value:function(t){this.dom||this.createDOM(),m(A(n.prototype),"sync",this).call(this,t)}},{key:"merge",value:function(t,e,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||t&&i<=0||e<this.length&&o<=0))&&(yt(this,t,e,r?r.children:ct,i-1,o-1),this.markDirty(),!0)}},{key:"slice",value:function(t){return new n(this.mark,function(t,e){var n,r=[],i=0,o=M(t);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=i+a.length;s>e&&r.push(i<e?a.slice(e-i):a),i=s}}catch(u){o.e(u)}finally{o.f()}return r}(this.children,t),this.length-t)}},{key:"domAtPos",value:function(t){return kt(this.dom,this.children,t)}},{key:"coordsAt",value:function(t,e){return wt(this,t,e)}}]),n}(ft);function pt(t,e,n){var r=t.nodeValue.length;e>r&&(e=r);var i=e,o=e,a=0;0==e&&n<0||e==r&&n>=0?q.chrome||q.gecko||(e?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=it();s.setEnd(t,o),s.setStart(t,i);var u=s.getClientRects();if(!u.length)return X;var l=u[(a?a<0:n>=0)?0:u.length-1];return q.safari&&!a&&0==l.width&&(l=Array.prototype.find.call(u,(function(t){return t.width}))||l),a?Q(l,a<0):l}var gt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.side=i,o}return D(n,[{key:"slice",value:function(t){return n.create(this.widget,this.length-t,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(t,e,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&i<=0||e<this.length&&o<=0))&&(this.length=t+(r?r.length:0)+(this.length-e),!0)}},{key:"become",value:function(t){return t.length==this.length&&t instanceof n&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.eq(t.widget)||this.markDirty(!0),this.widget=t.widget,!0)}},{key:"ignoreMutation",value:function(){return!0}},{key:"ignoreEvent",value:function(t){return this.widget.ignoreEvent(t)}},{key:"domAtPos",value:function(t){return 0==t?ot.before(this.dom):ot.after(this.dom,t==this.length)}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(t,e){var n=this.dom.getClientRects(),r=null;if(!n.length)return X;for(var i=t>0?n.length-1:0;r=n[i],!(t>0?0==i:i==n.length-1||r.top<r.bottom);i+=t>0?-1:1);return 0==t&&e>0||t==this.length&&e<=0?r:Q(r,0==t)}},{key:"overrideDOMText",get:function(){if(0==this.length)return i.xv.empty;for(var t=this;t.parent;)t=t.parent;var e=t.editorView,n=e&&e.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):i.xv.empty}}],[{key:"create",value:function(t,e,r){return new(t.customView||n)(t,e,r)}}]),n}(ft),mt=function(t){k(n,t);var e=w(n);function n(){return O(this,n),e.apply(this,arguments)}return D(n,[{key:"domAtPos",value:function(t){return new ot(this.widget.text,t)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(t,e){return e?3==t.nodeType?Math.min(e,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(t,e){return pt(this.widget.text,t,e)}},{key:"overrideDOMText",get:function(){return null}}]),n}(gt);function yt(t,e,n,r,i,o){var a,s=t.childCursor(),u=s.findPos(n,1),l=u.i,h=u.off,c=s.findPos(e,-1),f=c.i,d=c.off,v=e-n,p=M(r);try{for(p.s();!(a=p.n()).done;){v+=a.value.length}}catch(S){p.e(S)}finally{p.f()}t.length+=v;var g=t.children;if(f==l&&d){var m=g[f];if(1==r.length&&m.merge(d,h,r[0],i,o))return;if(0==r.length)return void m.merge(d,h,null,i,o);var y=m.slice(h);y.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=y:r.push(y),l++,o=h=0}if(h){var k=g[l];r.length&&k.merge(0,h,r[r.length-1],0,o)?(r.pop(),o=0):k.merge(0,h,null,0,0)}else l<g.length&&r.length&&g[l].merge(0,0,r[r.length-1],0,o)&&(r.pop(),o=0);if(d){var b=g[f];r.length&&b.merge(d,b.length,r[0],i,0)?(r.shift(),i=0):b.merge(d,b.length,null,0,0),f++}else if(f&&r.length){var w=g[f-1];w.merge(w.length,w.length,r[0],i,0)&&(r.shift(),i=0)}for(;f<l&&r.length&&g[l-1].become(r[r.length-1]);)r.pop(),l--,o=0;for(;f<l&&r.length&&g[f].become(r[0]);)r.shift(),f++,i=0;!r.length&&f&&l<g.length&&i&&o&&g[l].merge(0,0,g[f-1],i,o)&&f--,(r.length||f!=l)&&t.replaceChildren(f,l,r)}function kt(t,e,n){for(var r=0,i=0;r<e.length;r++){var o=e[r],a=i+o.length;if(!(a==i&&o.getSide()<=0)){if(n>i&&n<a&&o.dom.parentNode==t)return o.domAtPos(n-i);if(n<=i)break;i=a}}for(;r>0;r--){var s=e[r-1].dom;if(s.parentNode==t)return ot.after(s)}return new ot(t,0)}function bt(t,e,n){var r,i=t.children;n>0&&e instanceof vt&&i.length&&(r=i[i.length-1])instanceof vt&&r.mark.eq(e.mark)?bt(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function wt(t,e,n){for(var r=0,i=0;i<t.children.length;i++){var o=t.children[i],a=r+o.length;if(!(a==r&&o.getSide()<=0)){if(n<=0||a==t.length?a>=e:a>e)return o.coordsAt(e-r,n);r=a}}return(t.dom.lastChild||t.dom).getBoundingClientRect()}function St(t,e){for(var n in t)"class"==n&&e.class?e.class+=" "+t.class:"style"==n&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}function xt(t,e){if(t==e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0,o=n;i<o.length;i++){var a=o[i];if(-1==r.indexOf(a)||t[a]!==e[a])return!1}return!0}function At(t,e,n){if(e)for(var r in e)n&&r in n||t.removeAttribute(r);if(n)for(var i in n)e&&e[i]==n[i]||t.setAttribute(i,n[i])}var Ct,Mt=function(){function t(){O(this,t)}return D(t,[{key:"eq",value:function(t){return!1}},{key:"updateDOM",value:function(t){return!1}},{key:"compare",value:function(t){return this==t||this.constructor==t.constructor&&this.eq(t)}},{key:"ignoreEvent",value:function(t){return!0}},{key:"estimatedHeight",get:function(){return-1}},{key:"customView",get:function(){return null}}]),t}();!function(t){t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange"}(Ct||(Ct={}));var Ot=function(t){k(n,t);var e=w(n);function n(t,r,i,o){var a;return O(this,n),(a=e.call(this)).startSide=t,a.endSide=r,a.widget=i,a.spec=o,a}return D(n,[{key:"hasHeight",value:function(){return!!this.widget&&this.widget.estimatedHeight>-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(t){return new Tt(t)}},{key:"widget",value:function(t){var e=t.side||0;return t.block&&(e+=200000001*(e>0?1:-1)),new Et(t,e,e,!!t.block,t.widget||null,!1)}},{key:"replace",value:function(t){var e=!!t.block,n=Pt(t),r=n.start,i=n.end;return new Et(t,e?-2e8*(r?2:1):1e8*(r?-1:1),e?2e8*(i?2:1):1e8*(i?1:-1),e,t.widget||null,!0)}},{key:"line",value:function(t){return new Dt(t)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.Xs.of(t,e)}}]),n}(a.uU);Ot.none=a.Xs.empty;var Tt=function(t){k(n,t);var e=w(n);function n(t){var r;O(this,n);var i=Pt(t),o=i.start,a=i.end;return(r=e.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,t)).tagName=t.tagName||"span",r.class=t.class||"",r.attrs=t.attributes||null,r}return D(n,[{key:"eq",value:function(t){return this==t||t instanceof n&&this.tagName==t.tagName&&this.class==t.class&&xt(this.attrs,t.attrs)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Ot);Tt.prototype.point=!1;var Dt=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,-1e8,-1e8,null,t)}return D(n,[{key:"eq",value:function(t){return t instanceof n&&xt(this.spec.attributes,t.spec.attributes)}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return m(A(n.prototype),"range",this).call(this,t,e)}}]),n}(Ot);Dt.prototype.mapMode=r.gc.TrackBefore,Dt.prototype.point=!0;var Et=function(t){k(n,t);var e=w(n);function n(t,i,o,a,s,u){var l;return O(this,n),(l=e.call(this,i,o,s,t)).block=a,l.isReplace=u,l.mapMode=a?i<0?r.gc.TrackBefore:r.gc.TrackAfter:r.gc.TrackDel,l}return D(n,[{key:"eq",value:function(t){return t instanceof n&&(e=this.widget,r=t.widget,e==r||!!(e&&r&&e.compare(r)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,r}},{key:"range",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return m(A(n.prototype),"range",this).call(this,t,e)}},{key:"type",get:function(){return this.startSide<this.endSide?Ct.WidgetRange:this.startSide<0?Ct.WidgetBefore:Ct.WidgetAfter}},{key:"heightRelevant",get:function(){return this.block||!!this.widget&&this.widget.estimatedHeight>=5}}]),n}(Ot);function Pt(t){var e=t.inclusiveStart,n=t.inclusiveEnd;return null==e&&(e=t.inclusive),null==n&&(n=t.inclusive),{start:e||!1,end:n||!1}}function Rt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>t?n[i]=Math.max(n[i],e):n.push(t,e)}Et.prototype.point=!0;var Bt=function(t){k(n,t);var e=w(n);function n(){var t;return O(this,n),(t=e.apply(this,arguments)).children=[],t.length=0,t.prevAttrs=void 0,t.attrs=null,t.breakAfter=0,t}return D(n,[{key:"merge",value:function(t,e,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),yt(this,t,e,r?r.children:Lt,o,a),!0}},{key:"split",value:function(t){var e=new n;if(e.breakAfter=this.breakAfter,0==this.length)return e;var r=this.childPos(t),i=r.i,o=r.off;o&&(e.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a<this.children.length;a++)e.append(this.children[a],0);for(;i>0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=t,e}},{key:"transferDOM",value:function(t){this.dom&&(t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(t){xt(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}},{key:"append",value:function(t,e){bt(this,t,e)}},{key:"addLineDeco",value:function(t){var e=t.spec.attributes;e&&(this.attrs=St(e,this.attrs||{}))}},{key:"domAtPos",value:function(t){return kt(this.dom,this.children,t)}},{key:"sync",value:function(t){this.dom||(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(At(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),m(A(n.prototype),"sync",this).call(this,t);var e=this.dom.lastChild;if(!e||"BR"!=e.nodeName&&st.get(e)instanceof gt){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 t,e=0,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!(r instanceof dt))return null;var i=U(r.dom);if(1!=i.length)return null;e+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}}},{key:"coordsAt",value:function(t,e){return wt(this,t,e)}},{key:"match",value:function(t){return!1}},{key:"type",get:function(){return Ct.Text}}],[{key:"find",value:function(t,e){for(var r=0,i=0;;r++){var o=t.children[r],a=i+o.length;if(a>=e){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(st),Lt=[],Nt=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this)).widget=t,o.length=r,o.type=i,o.breakAfter=0,o}return D(n,[{key:"merge",value:function(t,e,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||t>0&&o<=0||e<this.length&&a<=0))&&(this.length=t+(r?r.length:0)+(this.length-e),!0)}},{key:"domAtPos",value:function(t){return 0==t?ot.before(this.dom):ot.after(this.dom,t==this.length)}},{key:"split",value:function(t){var e=this.length-t;return this.length=t,new n(this.widget,e,this.type)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"domBoundsAround",value:function(){return null}},{key:"match",value:function(t){return t instanceof n&&t.type==this.type&&t.widget.constructor==this.widget.constructor&&(t.widget.eq(this.widget)||this.markDirty(!0),this.widget=t.widget,this.length=t.length,this.breakAfter=t.breakAfter,!0)}},{key:"ignoreMutation",value:function(){return!0}},{key:"ignoreEvent",value:function(t){return this.widget.ignoreEvent(t)}},{key:"children",get:function(){return Lt}},{key:"overrideDOMText",get:function(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):i.xv.empty}}]),n}(st),jt=function(){function t(e,n,r){O(this,t),this.doc=e,this.pos=n,this.end=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}return D(t,[{key:"posCovered",value:function(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Nt&&t.type==Ct.WidgetBefore)}},{key:"getLine",value:function(){return this.curLine||this.content.push(this.curLine=new Bt),this.curLine}},{key:"addWidget",value:function(t){this.curLine=null,this.content.push(t)}},{key:"finish",value:function(){this.posCovered()||this.getLine()}},{key:"wrapMarks",value:function(t,e){for(var n=e.length-1;n>=0;n--)t=new vt(e[n],[t],t.length);return t}},{key:"buildText",value:function(t,e,n){for(;t>0;){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,t--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,t,512);this.getLine().append(this.wrapMarks(new dt(this.text.slice(this.textOff,this.textOff+s)),e),n),this.textOff+=s,t-=s,n=0}}},{key:"span",value:function(t,e,n,r){this.buildText(e-t,n,r),this.pos=e,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(t,e,n,r,i){var o=e-t;if(n instanceof Et)if(n.block){var a=n.type;a!=Ct.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new Nt(n.widget||new It("div"),o,a))}else{var s=this.wrapMarks(gt.create(n.widget||new It("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=e),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(e,n,r,i){var o=new t(e,n,r);return o.openEnd=a.Xs.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),t}(),It=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).tag=t,r}return D(n,[{key:"eq",value:function(t){return t.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(t){return t.nodeName.toLowerCase()==this.tag}}]),n}(Mt),Vt=[],Wt=r.r$.define(),zt=r.r$.define(),Ht=r.r$.define(),_t=r.r$.define(),qt=r.r$.define(),Ft=r.r$.define();function $t(t,e,n){var r=t.facet(_t);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}var Ut=r.r$.define({combine:function(t){return!t.length||t[0]}}),Gt=function t(e,n){O(this,t),this.field=e,this.get=n},Kt=function(){function t(){O(this,t)}return D(t,[{key:"from",value:function(t){return new Gt(this,t)}}],[{key:"define",value:function(){return new t}}]),t}();Kt.decorations=Kt.define(),Kt.scrollMargins=Kt.define();var Jt=0,Yt=r.r$.define(),Xt=function(){function t(e,n,r){O(this,t),this.id=e,this.create=n,this.fields=r,this.extension=Yt.of(this)}return D(t,null,[{key:"define",value:function(e,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations,s=[];if(o){var u,l=M(Array.isArray(o)?o:[o]);try{for(l.s();!(u=l.n()).done;){var h=u.value;s.push(h)}}catch(c){l.e(c)}finally{l.f()}}return i&&s.push(Qt.from((function(t){return{plugin:t,handlers:i}}))),a&&s.push(Kt.decorations.from(a)),new t(Jt++,e,s)}},{key:"fromClass",value:function(e,n){return t.define((function(t){return new e(t)}),n)}}]),t}(),Qt=Kt.define(),Zt=function(){function t(e){O(this,t),this.spec=e,this.mustUpdate=null,this.value=null}return D(t,[{key:"takeField",value:function(t,e){var n,r=M(this.spec.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.field,a=i.get;o==t&&e.push(a(this.value))}}catch(s){r.e(s)}finally{r.f()}}},{key:"update",value:function(e){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($t(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}return t.dummy}}}else try{this.value=this.spec.create(e)}catch(r){return $t(e.state,r,"CodeMirror plugin crashed"),t.dummy}return this}},{key:"destroy",value:function(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(n){$t(t.state,n,"CodeMirror plugin crashed")}}}]),t}();Zt.dummy=new Zt(Xt.define((function(){return{}})));var te=r.r$.define({combine:function(t){return t.reduce((function(t,e){return St(e,t)}),{})}}),ee=r.r$.define({combine:function(t){return t.reduce((function(t,e){return St(e,t)}),{})}}),ne=r.r$.define(),re=r.r$.define(),ie=function(){function t(e,n,r,i){O(this,t),this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}return D(t,[{key:"join",value:function(e){return new t(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}},{key:"addToSet",value:function(t){for(var e=t.length,n=this;e>0;e--){var r=t[e-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),t.splice(e-1,1)}}return t.splice(e,0,n),t}}],[{key:"extendWithRanges",value:function(e,n){if(0==n.length)return e;for(var r=[],i=0,o=0,a=0,s=0;;i++){for(var u=i==e.length?null:e[i],l=a-s,h=u?u.fromB:1e9;o<n.length&&n[o]<h;){var c=n[o],f=n[o+1],d=Math.max(s,c),v=Math.min(h,f);if(d<=v&&new t(d+l,v+l,d,v).addToSet(r),f>h)break;o+=2}if(!u)return r;new t(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),t}(),oe=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Vt;O(this,t),this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=r.as.empty(this.startState.doc.length);var o,a=M(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.changes=this.changes.compose(s.changes)}}catch(h){a.e(h)}finally{a.f()}var u=[];this.changes.iterChangedRanges((function(t,e,n,r){return u.push(new ie(t,e,n,r))})),this.changedRanges=u;var l=e.hasFocus;l!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=l,this.flags|=1),this.docChanged&&(this.flags|=2)}return D(t,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(t){return t.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(t){return t.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),t}(),ae=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).view=t,r.compositionDeco=Ot.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(t.contentDOM),r.children=[new Bt],r.children[0].setParent(x(r)),r.updateInner([new ie(0,0,0,t.state.doc.length)],r.updateDeco(),0),r}return D(n,[{key:"update",value:function(t){var e=this,n=t.changedRanges;this.minWidth>0&&n.length&&(n.every((function(t){var n=t.fromA;return t.toA<e.minWidthFrom||n>e.minWidthTo}))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Ot.none:t.transactions.length&&(this.compositionDeco=function(t,e){var n=F(t.root),r=n.focusNode&&he(n.focusNode,n.focusOffset,0);if(!r)return Ot.none;var i,o,a=t.docView.nearest(r),s=r;if(a instanceof ft){for(;a.parent instanceof ft;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Bt))return Ot.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var u=s.previousSibling;u&&!st.get(u);)u=u.previousSibling;i=o=u?st.get(u).posAtEnd:a.posAtStart}var l=e.mapPos(i,1),h=Math.max(l,e.mapPos(o,-1)),c=r.nodeValue,f=t.state;if(h-l<c.length)if(f.sliceDoc(l,Math.min(f.doc.length,l+c.length))==c)h=l+c.length;else{if(f.sliceDoc(Math.max(0,h-c.length),h)!=c)return Ot.none;l=h-c.length}else if(f.sliceDoc(l,h)!=c)return Ot.none;return Ot.set(Ot.replace({widget:new le(s,r)}).range(l,h))}(this.view,t.changes));var i,o,s,u,l=(q.ie||q.chrome)&&!this.compositionDeco.size&&t&&t.state.doc.lines!=t.startState.doc.lines,h=this.decorations,c=this.updateDeco(),f=(i=h,o=c,s=t.changes,u=new de,a.Xs.compare(i,o,s,u),u.changes);n=ie.extendWithRanges(n,f);var d=t.transactions.some((function(t){return"pointerselection"==t.annotation(r.YW.userEvent)}));return 0==this.dirty&&0==n.length&&!(12&t.flags)&&t.state.selection.main.from>=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(l,d),!1):(this.updateInner(n,c,t.startState.doc.length,l,d),!0)}},{key:"updateInner",value:function(t,e,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(t,e,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.domHeight+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var t=q.chrome?{node:F(r.view.root).focusNode,written:!1}:void 0;r.sync(t),r.dirty=0,(null==t?void 0:t.written)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}))}},{key:"updateChildren",value:function(t,e,n){for(var r=this.childCursor(n),i=t.length-1;;i--){var o=i>=0?t[i]:null;if(!o)break;var a=o.fromA,s=o.toA,u=o.fromB,l=o.toB,h=jt.build(this.view.state.doc,u,l,e),c=h.content,f=h.breakAtStart,d=h.openStart,v=h.openEnd,p=r.findPos(s,1),g=p.i,m=p.off,y=r.findPos(a,-1),k=y.i,b=y.off;this.replaceRange(k,b,g,m,c,f,d,v)}}},{key:"replaceRange",value:function(t,e,n,r,i,o,a,s){var u=this.children[t],l=i.length?i[i.length-1]:null,h=l?l.breakAfter:o;if(t!=n||o||h||!(i.length<2)||!u.merge(e,r,i.length?l:null,0==e,a,s)){var c=this.children[n];for(r<c.length||c.children.length&&0==c.children[c.children.length-1].length?(t==n&&(c=c.split(r),r=0),!h&&l&&c.merge(0,r,l,!0,0,s)?i[i.length-1]=c:((r||c.children.length&&0==c.children[0].length)&&c.merge(0,r,null,!1,0,s),i.push(c))):c.breakAfter&&(l?l.breakAfter=1:o=1),n++,u.breakAfter=o,e>0&&(!o&&i.length&&u.merge(e,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(e<u.length||u.children.length&&0==u.children[u.children.length-1].length)&&u.merge(e,u.length,null,!1,a,0),t++);t<n&&i.length;)if(this.children[n-1].match(i[i.length-1]))n--,i.pop();else{if(!this.children[t].match(i[0]))break;t++,i.shift()}(t<n||i.length)&&this.replaceChildren(t,n,i)}}},{key:"updateSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e||this.mayControlSelection()){var n=this.view.state.selection.main,r=this.domAtPos(n.anchor),i=n.empty?r:this.domAtPos(n.head);if(q.gecko&&n.empty&&se(r)){var o=document.createTextNode("");this.view.observer.ignore((function(){return r.node.insertBefore(o,r.node.childNodes[r.offset]||null)})),r=i=new ot(o,0),t=!0}var a=F(this.root);(t||!a.focusNode||q.gecko&&n.empty&&ce(a.focusNode,a.focusOffset)||!G(r.node,r.offset,a.anchorNode,a.anchorOffset)||!G(i.node,i.offset,a.focusNode,a.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if(q.gecko){var t=ce(r.node,r.offset);if(t&&3!=t){var e=he(r.node,r.offset,1==t?1:-1);e&&(r=new ot(e,1==t?0:e.nodeValue.length))}}a.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=a.cursorBidiLevel&&(a.cursorBidiLevel=n.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(i.node,i.offset);else{var o=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}o.setEnd(i.node,i.offset),o.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(o)}})),this.impreciseAnchor=r.precise?null:new ot(a.anchorNode,a.anchorOffset),this.impreciseHead=i.precise?null:new ot(a.focusNode,a.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var t=this.view.state.selection.main,e=F(this.root);if(t.empty&&t.assoc&&e.modify){var n=Bt.find(this,t.head);if(n){var r=n.posAtStart;if(t.head!=r&&t.head!=r+n.length){var i=this.coordsAt(t.head,-1),o=this.coordsAt(t.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(t.head+t.assoc);e.collapse(a.node,a.offset),e.modify("move",t.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(Ut)?this.root.activeElement==this.dom:$(this.dom,F(this.root))}},{key:"nearest",value:function(t){for(var e=t;e;){var n=st.get(e);if(n&&n.rootView==this)return n;e=e.parentNode}return null}},{key:"posFromDOM",value:function(t,e){var n=this.nearest(t);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(t,e)+n.posAtStart}},{key:"domAtPos",value:function(t){for(var e=this.childCursor().findPos(t,-1),n=e.i,r=e.off;n<this.children.length-1;){var i=this.children[n];if(r<i.length||i instanceof Bt)break;n++,r=0}return this.children[n].domAtPos(r)}},{key:"coordsAt",value:function(t,e){for(var n=this.length,r=this.children.length-1;;r--){var i=this.children[r],o=n-i.breakAfter-i.length;if(t>o||t==o&&(i.type==Ct.Text||!r||this.children[r-1].breakAfter))return i.coordsAt(t-o,e);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var t=[],e=this.view.viewState.viewport,n=e.from,r=e.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;a<this.children.length;a++){var s=this.children[a],u=o+s.length;if(u>r)break;if(o>=n){t.push(s.dom.getBoundingClientRect().height);var l=s.dom.scrollWidth;l>i&&(this.minWidth=i=l,this.minWidthFrom=o,this.minWidthTo=u)}o=u+s.breakAfter}return t}},{key:"measureTextSize",value:function(){var t,e=this,n=M(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r instanceof Bt){var i=r.measureTextSize();if(i)return i}}}catch(u){n.e(u)}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(){e.dom.appendChild(s);var t=U(s.firstChild)[0];o=s.getBoundingClientRect().height,a=t?t.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,e=this.children.length;return e&&(t-=this.children[--e].length),new ht(this.children,t,e)}},{key:"computeBlockGapDeco",value:function(){for(var t=[],e=this.view.viewState,n=0,r=0;;r++){var i=r==e.viewports.length?null:e.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=e.lineAt(o,0).bottom-e.lineAt(n,0).top;t.push(Ot.replace({widget:new ue(a),block:!0,inclusive:!0}).range(n,o))}if(!i)break;n=i.to+1}return Ot.set(t)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(C(this.view.state.facet(ne)),C(this.view.pluginField(Kt.decorations)))}},{key:"scrollPosIntoView",value:function(t,e){var n=this.coordsAt(t,e);if(n){var r,i=0,o=0,a=0,s=0,u=M(this.view.pluginField(Kt.scrollMargins));try{for(u.s();!(r=u.n()).done;){var l=r.value;if(l){var h=l.left,c=l.right,f=l.top,d=l.bottom;null!=h&&(i=Math.max(i,h)),null!=c&&(o=Math.max(o,c)),null!=f&&(a=Math.max(a,f)),null!=d&&(s=Math.max(s,d))}}}catch(v){u.e(v)}finally{u.f()}!function(t,e){for(var n=t.ownerDocument.defaultView,r=t.parentNode;r;)if(1==r.nodeType){var i=void 0,o=r==document.body;if(o)i=Z(n);else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}var a=r.getBoundingClientRect();i={left:a.left,right:a.left+r.clientWidth,top:a.top,bottom:a.top+r.clientHeight}}var s=0,u=0;if(e.top<i.top?u=-(i.top-e.top+5):e.bottom>i.bottom&&(u=e.bottom-i.bottom+5),e.left<i.left?s=-(i.left-e.left+5):e.right>i.right&&(s=e.right-i.right+5),s||u)if(o)n.scrollBy(s,u);else{if(u){var l=r.scrollTop;r.scrollTop+=u,u=r.scrollTop-l}if(s){var h=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-h}e={left:e.left-s,top:e.top-u,right:e.right-s,bottom:e.bottom-u}}if(o)break;r=r.parentNode}else{if(11!=r.nodeType)break;r=r.host}}(this.dom,{left:n.left-i,top:n.top-a,right:n.right+o,bottom:n.bottom+s})}}},{key:"root",get:function(){return this.view.root}},{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}}]),n}(st);function se(t){return 1==t.node.nodeType&&t.node.firstChild&&(0==t.offset||"false"==t.node.childNodes[t.offset-1].contentEditable)&&(t.offset<t.node.childNodes.length||"false"==t.node.childNodes[t.offset].contentEditable)}var ue=function(t){k(n,t);var e=w(n);function n(t){var r;return O(this,n),(r=e.call(this)).height=t,r}return D(n,[{key:"toDOM",value:function(){var t=document.createElement("div");return this.updateDOM(t),t}},{key:"eq",value:function(t){return t.height==this.height}},{key:"updateDOM",value:function(t){return t.style.height=this.height+"px",!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(Mt);var le=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this)).top=t,i.text=r,i}return D(n,[{key:"eq",value:function(t){return this.top==t.top&&this.text==t.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return mt}}]),n}(Mt);function he(t,e,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0&&n<=0)e=Y(t=t.childNodes[e-1]);else{if(!(1==t.nodeType&&e<t.childNodes.length&&n>=0))return null;t=t.childNodes[e],e=0}}}function ce(t,e){return 1!=t.nodeType?0:(e&&"false"==t.childNodes[e-1].contentEditable?1:0)|(e<t.childNodes.length&&"false"==t.childNodes[e].contentEditable?2:0)}var fe,de=function(){function t(){O(this,t),this.changes=[]}return D(t,[{key:"compareRange",value:function(t,e){Rt(t,e,this.changes)}},{key:"comparePoint",value:function(t,e){Rt(t,e,this.changes)}}]),t}();!function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"}(fe||(fe={}));var ve=fe.LTR,pe=fe.RTL;function ge(t){for(var e=[],n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var me=ge("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ye=ge("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");var ke=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,be=function(){function t(e,n,r){O(this,t),this.from=e,this.to=n,this.level=r}return D(t,[{key:"side",value:function(t,e){return this.dir==e==t?this.to:this.from}},{key:"dir",get:function(){return this.level%2?pe:ve}}],[{key:"find",value:function(t,e,n,r){for(var i=-1,o=0;o<t.length;o++){var a=t[o];if(a.from<=e&&a.to>=e){if(a.level==n)return o;(i<0||(0!=r?r<0?a.from<e:a.to>e:t[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),t}(),we=[];function Se(t,e){var n,r=t.length,i=e==ve?1:2;if(!t||1==i&&!ke.test(t))return xe(r);for(var o=0,a=i,s=i;o<r;o++){var u=(n=t.charCodeAt(o))<=247?me[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?ye[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8203||8204==n?256:1;512==u?u=a:8==u&&4==s&&(u=16),we[o]=4==u?2:u,7&u&&(s=u),a=u}for(var l=0,h=i,c=i;l<r;l++){var f=we[l];if(128==f)l<r-1&&h==we[l+1]&&24&h?f=we[l]=h:we[l]=256;else if(64==f){for(var d=l+1;d<r&&64==we[d];)d++;for(var v=l&&8==h||d<r&&8==we[d]?1==c?1:8:256,p=l;p<d;p++)we[p]=v;l=d-1}else 8==f&&1==c&&(we[l]=1);h=f,7&f&&(c=f)}for(var g=0;g<r;g++)if(256==we[g]){for(var m=g+1;m<r&&256==we[m];)m++;for(var y=1==(g?we[g-1]:i),k=y==(1==(m<r?we[m]:i))?y?1:2:i,b=g;b<m;b++)we[b]=k;g=m-1}var w=[];if(1==i)for(var S=0;S<r;){for(var x=S,A=1!=we[S++];S<r&&A==(1!=we[S]);)S++;if(A)for(var C=S;C>x;){for(var M=C,O=2!=we[--C];C>x&&O==(2!=we[C-1]);)C--;w.push(new be(C,M,O?2:1))}else w.push(new be(x,S,0))}else for(var T=0;T<r;){for(var D=T,E=2==we[T++];T<r&&E==(2==we[T]);)T++;w.push(new be(D,T,E?1:2))}return w}function xe(t){return[new be(0,t,0)]}var Ae="";function Ce(t,e,n,o,a){var s,u=o.head-t.from,l=-1;if(0==u){if(!a||!t.length)return null;e[0].level!=n&&(u=e[0].side(!1,n),l=0)}else if(u==t.length){if(a)return null;var h=e[e.length-1];h.level!=n&&(u=h.side(!0,n),l=e.length-1)}l<0&&(l=be.find(e,u,null!==(s=o.bidiLevel)&&void 0!==s?s:-1,o.assoc));var c=e[l];u==c.side(a,n)&&(u=(c=e[l+=a?1:-1]).side(!a,n));var f=a==(c.dir==n),d=(0,i.cp)(t.text,u,f);if(Ae=t.text.slice(Math.min(u,d),Math.max(u,d)),d!=c.side(a,n))return r.jT.cursor(d+t.from,f?-1:1,c.level);var v=l==(a?e.length-1:0)?null:e[l+(a?1:-1)];return v||c.level==n?v&&v.level<c.level?r.jT.cursor(v.side(!a,n)+t.from,0,v.level):r.jT.cursor(d+t.from,0,c.level):r.jT.cursor(a?t.to:t.from,a?-1:1,n)}function Me(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function Oe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Te(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function De(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function Ee(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Pe(t,e,n){for(var r,i,o,a,s,u,l,h,c=t.firstChild;c;c=c.nextSibling)for(var f=U(c),d=0;d<f.length;d++){var v=f[d];i&&Te(i,v)&&(v=De(Ee(v,i.bottom),i.top));var p=Me(e,v),g=Oe(n,v);if(0==p&&0==g)return 3==c.nodeType?Re(c,e,n):Pe(c,e,n);(!r||a>g||a==g&&o>p)&&(r=c,i=v,o=p,a=g),0==p?n>v.bottom&&(!l||l.bottom<v.bottom)?(s=c,l=v):n<v.top&&(!h||h.top>v.top)&&(u=c,h=v):l&&Te(l,v)?l=Ee(l,v.bottom):h&&Te(h,v)&&(h=De(h,v.top))}if(l&&l.bottom>=n?(r=s,i=l):h&&h.top<=n&&(r=u,i=h),!r)return{node:t,offset:0};var m=Math.max(i.left,Math.min(i.right,e));return 3==r.nodeType?Re(r,m,n):o||"true"!=r.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0)}:Pe(r,m,n)}function Re(t,e,n){for(var r=t.nodeValue.length,i=it(),o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);for(var a=i.getClientRects(),s=0;s<a.length;s++){var u=a[s];if(u.top!=u.bottom&&(u.left-1<=e&&u.right+1>=e&&u.top-1<=n&&u.bottom+1>=n)){var l=e>=(u.left+u.right)/2,h=l;if(q.chrome||q.gecko)i.setEnd(t,o),i.getBoundingClientRect().left==u.right&&(h=!l);return{node:t,offset:o+(h?1:0)}}}}return{node:t,offset:0}}function Be(t,e){for(var n,r=e.x,i=e.y,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=t.contentDOM.getBoundingClientRect(),s=t.defaultLineHeight/2,u=!1;;){if((n=t.blockAtHeight(i,a.top)).top>i||n.bottom<i){if(o=n.top>i?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),u)return-1;u=!0}if(n.type==Ct.Text)break;i=o>0?n.bottom+s:n.top-s}var l=n.from;if(l<t.viewport.from)return 0==t.viewport.from?0:null;if(l>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:null;r=Math.max(a.left+1,Math.min(a.right-1,r));var h,c=t.root,f=c.elementFromPoint(r,i),d=-1;if(f&&t.contentDOM.contains(f)&&!(t.docView.nearest(f)instanceof gt))if(c.caretPositionFromPoint){var v=c.caretPositionFromPoint(r,i);v&&(h=v.offsetNode,d=v.offset)}else if(c.caretRangeFromPoint){var p=c.caretRangeFromPoint(r,i);p&&(h=p.startContainer,d=p.startOffset)}if(!h||!t.docView.dom.contains(h)){var g=Bt.find(t.docView,l),m=Pe(g.dom,r,i);h=m.node,d=m.offset}return t.docView.posFromDOM(h,d)}function Le(t,e,n,i){var o=t.state.doc.lineAt(e.head),a=i&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head):null;if(a){var s=t.dom.getBoundingClientRect(),u=t.posAtCoords({x:n==(t.textDirection==fe.LTR)?s.right-1:s.left+1,y:(a.top+a.bottom)/2});if(null!=u)return r.jT.cursor(u,n?-1:1)}var l=Bt.find(t.docView,e.head),h=l?n?l.posAtEnd:l.posAtStart:n?o.to:o.from;return r.jT.cursor(h,n?-1:1)}function Ne(t,e,n,i){for(var o=t.state.doc.lineAt(e.head),a=t.bidiSpans(o),s=e,u=null;;){var l=Ce(o,a,t.textDirection,s,n),h=Ae;if(!l){if(o.number==(n?t.state.doc.lines:1))return s;h="\n",o=t.state.doc.line(o.number+(n?1:-1)),a=t.bidiSpans(o),l=r.jT.cursor(n?o.from:o.to)}if(u){if(!u(h))return s}else{if(!i)return l;u=i(h)}s=l}}var je=function(){function t(e){var n=this;O(this,t),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(t){var r=ze[t];e.contentDOM.addEventListener(t,(function(i){!We(e,i)||n.ignoreDuringComposition(i)||"keydown"==t&&n.screenKeyEvent(e,i)||(n.mustFlushObserver(i)&&e.observer.forceFlush(),n.runCustomHandlers(t,e,i)?i.preventDefault():r(e,i))})),n.registeredEvents.push(t)};for(var i in ze)r(i);e.contentDOM.addEventListener("keydown",(function(t){e.inputState.lastKeyCode=t.keyCode,e.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=e.hasFocus,this.ensureHandlers(e)}return D(t,[{key:"setSelectionOrigin",value:function(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(t){var e,n=this,r=M(this.customHandlers=t.pluginField(Qt));try{for(r.s();!(e=r.n()).done;){var i=e.value,o=function(e){n.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(n.registeredEvents.push(e),t.contentDOM.addEventListener(e,(function(r){We(t,r)&&n.runCustomHandlers(e,t,r)&&r.preventDefault()})))};for(var a in i.handlers)o(a)}}catch(s){r.e(s)}finally{r.f()}}},{key:"runCustomHandlers",value:function(t,e,n){var r,i=M(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[t],s=!1;if(a){try{s=a.call(o.plugin,n,e)}catch(u){$t(e.state,u)}if(s||n.defaultPrevented)return q.android&&"keydown"==t&&13==n.keyCode&&e.observer.flushSoon(),!0}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(t,e){var n,r=M(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,e,t)}catch(a){$t(t.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(q.safari&&t.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"screenKeyEvent",value:function(t,e){var n=9==e.keyCode&&Date.now()<this.lastEscPress+2e3;return 27==e.keyCode?this.lastEscPress=Date.now():Ie.indexOf(e.keyCode)<0&&(this.lastEscPress=0),n}},{key:"mustFlushObserver",value:function(t){return"keydown"==t.type&&229!=t.keyCode||"compositionend"==t.type}},{key:"startMouseSelection",value:function(t,e,n){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=new Ve(this,t,e,n)}},{key:"update",value:function(t){this.mouseSelection&&this.mouseSelection.update(t),this.lastKeyCode=this.lastSelectionTime=0}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),t}(),Ie=[16,17,18,20,91,92,224,225],Ve=function(){function t(e,n,i,o){O(this,t),this.inputState=e,this.view=n,this.startEvent=i,this.style=o;var a=n.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=n.state.facet(r.yy.allowMultipleSelections)&&function(t,e){var n=t.state.facet(Wt);return n.length?n[0](e):q.mac?e.metaKey:e.ctrlKey}(n,i),this.dragMove=function(t,e){var n=t.state.facet(zt);return n.length?n[0](e):q.mac?!e.altKey:!e.ctrlKey}(n,i),this.dragging=!!function(t,e){if(t.state.selection.main.empty)return!1;var n=F(t.root);if(0==n.rangeCount)return!0;for(var r=n.getRangeAt(0).getClientRects(),i=0;i<r.length;i++){var o=r[i];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}(n,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}return D(t,[{key:"move",value:function(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}},{key:"up",value:function(t){null==this.dragging&&this.select(this.startEvent),this.dragging||t.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(t){var e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,annotations:r.YW.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}]),t}();function We(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n,r=e.target;r!=t.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=st.get(r))&&n.ignoreEvent(e))return!1;return!0}var ze=Object.create(null),He=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function _e(t,e){var n,i=t.state,o=1,a=i.toText(e),s=a.lines==i.selection.ranges.length;if(Qe&&i.selection.ranges.every((function(t){return t.empty}))&&Qe==a.toString()){var u=-1;n=i.changeByRange((function(t){var n=i.doc.lineAt(t.from);if(n.from==u)return{range:t};u=n.from;var l=i.toText((s?a.line(o++).text:e)+i.lineBreak);return{changes:{from:n.from,insert:l},range:r.jT.cursor(t.from+l.length)}}))}else n=s?i.changeByRange((function(t){var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:r.jT.cursor(t.from+e.length)}})):i.replaceSelection(a);t.dispatch(n,{annotations:r.YW.userEvent.of("paste"),scrollIntoView:!0})}ze.keydown=function(t,e){(function(t){var e=(t.ctrlKey?1:0)|(t.metaKey?8:0)|(t.altKey?2:0)|(t.shiftKey?4:0),n=t.keyCode,r=q.mac&&1==e;return 8==n||r&&72==n||46==n||r&&68==n||27==n||e==(q.mac?8:1)&&(66==n||73==n||89==n||90==n)})(e)&&e.preventDefault(),t.inputState.setSelectionOrigin("keyboardselection")};var qe=0;function Fe(t,e,n,o){if(1==o)return r.jT.cursor(e,n);if(2==o)return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=t.charCategorizer(e),a=t.doc.lineAt(e),s=e-a.from;if(0==a.length)return r.jT.cursor(e);0==s?n=1:s==a.length&&(n=-1);var u=s,l=s;n<0?u=(0,i.cp)(a.text,s,!1):l=(0,i.cp)(a.text,s);for(var h=o(a.text.slice(u,l));u>0;){var c=(0,i.cp)(a.text,u,!1);if(o(a.text.slice(c,u))!=h)break;u=c}for(;l<a.length;){var f=(0,i.cp)(a.text,l);if(o(a.text.slice(l,f))!=h)break;l=f}return r.jT.range(u+a.from,l+a.from)}(t.state,e,n);var a=Bt.find(t.docView,e);if(a)return r.jT.range(a.posAtStart,a.posAtEnd);var s=t.state.doc.lineAt(e),u=s.from,l=s.to;return r.jT.range(u,l)}ze.touchstart=function(t,e){(function(t){return 1==t.touches.length&&t.touches[0].radiusX<=1&&t.touches[0].radiusY<=1})(e)||(qe=Date.now()),t.inputState.setSelectionOrigin("pointerselection")},ze.touchmove=function(t){t.inputState.setSelectionOrigin("pointerselection")},ze.mousedown=function(t,e){if(t.observer.flush(),!(qe>Date.now()-2e3)){var n,i=null,o=M(t.state.facet(Ht));try{for(o.s();!(n=o.n()).done;){if(i=(0,n.value)(t,e))break}}catch(a){o.e(a)}finally{o.f()}i||0!=e.button||(i=function(t,e){var n=Ke(t,e),i=function(t){if(!Je)return t.detail;var e=Ye;return Ye=t,Xe=!e||e.timeStamp>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Xe+1)%3:1}(e),o=t.state.selection,a=n,s=e;return{update:function(t){t.changes&&(n&&(n.pos=t.changes.mapPos(n.pos)),o=o.map(t.changes))},get:function(e,u,l){var h;if(e.clientX==s.clientX&&e.clientY==s.clientY?h=a:(h=a=Ke(t,e),s=e),!h||!n)return o;var c=Fe(t,h.pos,h.bias,i);if(n.pos!=h.pos&&!u){var f=Fe(t,n.pos,n.bias,i),d=Math.min(f.from,c.from),v=Math.max(f.to,c.to);c=d<c.from?r.jT.range(d,v):r.jT.range(v,d)}return u?o.replaceRange(o.main.extend(c.from,c.to)):l?o.addRange(c):r.jT.create([c])}}}(t,e)),i&&(t.root.activeElement!=t.contentDOM&&t.observer.ignore((function(){return rt(t.contentDOM)})),t.inputState.startMouseSelection(t,e,i))}};var $e=function(t,e){return t>=e.top&&t<=e.bottom},Ue=function(t,e,n){return $e(e,n)&&t>=n.left&&t<=n.right};function Ge(t,e,n,r){var i=Bt.find(t.docView,e);if(!i)return 1;var o=e-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&Ue(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&Ue(n,r,s)?1:a&&$e(r,a)?-1:1}function Ke(t,e){var n=t.posAtCoords({x:e.clientX,y:e.clientY});return null==n?null:{pos:n,bias:Ge(t,n,e.clientX,e.clientY)}}var Je=q.ie&&q.ie_version<=11,Ye=null,Xe=0;ze.dragstart=function(t,e){var n=t.state.selection.main,r=t.inputState.mouseSelection;r&&(r.dragging=n),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove")},ze.drop=function(t,e){if(e.dataTransfer){var n=t.posAtCoords({x:e.clientX,y:e.clientY}),i=e.dataTransfer.getData("Text");if(null!=n&&i){e.preventDefault();var o=t.inputState.mouseSelection,a=o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:n,insert:i},u=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(n,-1),head:u.mapPos(n,1)},annotations:r.YW.userEvent.of("drop")})}}},ze.paste=function(t,e){t.observer.flush();var n=He?null:e.clipboardData,r=n&&n.getData("text/plain");r?(_e(t,r),e.preventDefault()):function(t){var e=t.dom.parentNode;if(e){var n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){t.focus(),n.remove(),_e(t,n.value)}),50)}}(t)};var Qe=null;function Ze(t){t.docView.compositionDeco.size&&t.update([])}ze.copy=ze.cut=function(t,e){var n=function(t){var e,n=[],r=[],i=!1,o=M(t.selection.ranges);try{for(o.s();!(e=o.n()).done;){var a=e.value;a.empty||(n.push(t.sliceDoc(a.from,a.to)),r.push(a))}}catch(f){o.e(f)}finally{o.f()}if(!n.length){var s,u=-1,l=M(t.selection.ranges);try{for(l.s();!(s=l.n()).done;){var h=s.value.from,c=t.doc.lineAt(h);c.number>u&&(n.push(c.text),r.push({from:c.from,to:Math.min(t.doc.length,c.to+1)})),u=c.number}}catch(f){l.e(f)}finally{l.f()}i=!0}return{text:n.join(t.lineBreak),ranges:r,linewise:i}}(t.state),i=n.text,o=n.ranges,a=n.linewise;if(i){Qe=a?i:null;var s=He?null:e.clipboardData;s?(e.preventDefault(),s.clearData(),s.setData("text/plain",i)):function(t,e){var n=t.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout((function(){r.remove(),t.focus()}),50)}}(t,i),"cut"==e.type&&t.dispatch({changes:o,scrollIntoView:!0,annotations:r.YW.userEvent.of("cut")})}},ze.focus=ze.blur=function(t){setTimeout((function(){t.hasFocus!=t.inputState.notifiedFocused&&t.update([])}),10)},ze.beforeprint=function(t){t.viewState.printing=!0,t.requestMeasure(),setTimeout((function(){t.viewState.printing=!1,t.requestMeasure()}),2e3)},ze.compositionstart=ze.compositionupdate=function(t){t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),Ze(t)),t.inputState.composing=0)},ze.compositionend=function(t){t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout((function(){t.inputState.composing<0&&Ze(t)}),50)};var tn,en=["pre-wrap","normal","pre-line"],nn=function(){function t(){O(this,t),this.doc=i.xv.empty,this.lineWrapping=!1,this.direction=fe.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return D(t,[{key:"heightForGap",value:function(t,e){var n=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(n+=Math.ceil((e-t-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(t){return this.doc=t,this}},{key:"mustRefresh",value:function(t,e,n){for(var r=!1,i=0;i<t.length;i++){var o=t[i];o<0?i++:this.heightSamples[Math.floor(10*o)]||(r=!0,this.heightSamples[Math.floor(10*o)]=!0)}return r||en.indexOf(e)>-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(t,e,n,r,i,o){var a=en.indexOf(t)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=e;if(this.lineWrapping=a,this.direction=e,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var u=0;u<o.length;u++){var l=o[u];l<0?u++:this.heightSamples[Math.floor(10*l)]=!0}}return s}}]),t}(),rn=function(){function t(e,n){O(this,t),this.from=e,this.heights=n,this.index=0}return D(t,[{key:"more",get:function(){return this.index<this.heights.length}}]),t}(),on=function(){function t(e,n,r,i,o){O(this,t),this.from=e,this.length=n,this.top=r,this.height=i,this.type=o}return D(t,[{key:"join",value:function(e){var n=(Array.isArray(this.type)?this.type:[this]).concat(Array.isArray(e.type)?e.type:[e]);return new t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},{key:"to",get:function(){return this.from+this.length}},{key:"bottom",get:function(){return this.top+this.height}}]),t}();!function(t){t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight"}(tn||(tn={}));var an=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;O(this,t),this.length=e,this.height=n,this.flags=r}return D(t,[{key:"setHeight",value:function(t,e){this.height!=e&&(Math.abs(this.height-e)>1e-4&&(t.heightChanged=!0),this.height=e)}},{key:"replace",value:function(e,n,r){return t.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(this)}},{key:"decomposeRight",value:function(t,e){e.push(this)}},{key:"applyChanges",value:function(t,e,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,u=a.toA,l=a.fromB,h=a.toB,c=i.lineAt(s,tn.ByPosNoHeight,e,0,0),f=c.to>=u?c:i.lineAt(u,tn.ByPosNoHeight,e,0,0);for(h+=f.to-u,u=f.to;o>0&&c.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<c.from&&(c=i.lineAt(s,tn.ByPosNoHeight,e,0,0));l+=c.from-s,s=c.from;var d=fn.build(n,t,l,h);i=i.replace(s,u,d)}return i.updateHeight(n,0)}},{key:"outdated",get:function(){return(2&this.flags)>0},set:function(t){this.flags=(t?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new un(0,0)}},{key:"of",value:function(e){if(1==e.length)return e[0];for(var n=0,r=e.length,i=0,o=0;;)if(n==r)if(i>2*o){var a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i<o){var u=e[n++];u&&(i+=u.size)}else{var l=e[--r];l&&(o+=l.size)}var h=0;return null==e[n-1]?(h=1,n--):null==e[n]&&(h=1,r++),new hn(t.of(e.slice(0,n)),h,t.of(e.slice(r)))}}]),t}();an.prototype.size=1;var sn=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this,t,r)).type=i,o}return D(n,[{key:"blockAt",value:function(t,e,n,r){return new on(r,this.length,n,this.height,this.type)}},{key:"lineAt",value:function(t,e,n,r,i){return this.blockAt(0,n,r,i)}},{key:"forEachLine",value:function(t,e,n,r,i,o){o(this.blockAt(0,n,r,i))}},{key:"updateHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(an),un=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this,t,r,Ct.Text)).collapsed=0,i.widgetHeight=0,i}return D(n,[{key:"replace",value:function(t,e,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof ln&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof ln?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):an.of(r)}},{key:"updateHeight",value:function(t){var e=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<=e&&r.more?this.setHeight(t,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.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}(sn),ln=function(t){k(n,t);var e=w(n);function n(t){return O(this,n),e.call(this,t,0)}return D(n,[{key:"lines",value:function(t,e){var n=t.lineAt(e).number,r=t.lineAt(e+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(t,e,n,r){var i=this.lines(e,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,u=Math.max(0,Math.min(a-o,Math.floor((t-n)/s))),l=e.line(o+u),h=l.from,c=l.length;return new on(h,c,n+s*u,s,Ct.Text)}},{key:"lineAt",value:function(t,e,n,r,i){if(e==tn.ByHeight)return this.blockAt(t,n,r,i);if(e==tn.ByPosNoHeight){var o=n.lineAt(t),a=o.from,s=o.to;return new on(a,s-a,0,0,Ct.Text)}var u=this.lines(n,i),l=u.firstLine,h=u.lineHeight,c=n.lineAt(t),f=c.from,d=c.length,v=c.number;return new on(f,d,r+h*(v-l),h,Ct.Text)}},{key:"forEachLine",value:function(t,e,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,u=a.lineHeight,l=Math.max(t,i),h=Math.min(i+this.length,e);l<=h;){var c=n.lineAt(l);l==t&&(r+=u*(c.number-s)),o(new on(c.from,c.length,r,r+=u,Ct.Text)),l=c.to+1}}},{key:"replace",value:function(t,e,r){var i=this.length-e;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(t>0){var a=r[0];a instanceof n?r[0]=new n(t+a.length):r.unshift(new n(t-1),null)}return an.of(r)}},{key:"decomposeLeft",value:function(t,e){e.push(new n(t-1),null)}},{key:"decomposeRight",value:function(t,e){e.push(null,new n(this.length-t-1))}},{key:"updateHeight",value:function(t){var e=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=e+this.length;if(i&&i.from<=e+this.length&&i.more){var a=[],s=Math.max(e,i.from);for(i.from>e&&a.push(new n(i.from-e-1).updateHeight(t,e));s<=o&&i.more;){var u=t.doc.lineAt(s).length;a.length&&a.push(null);var l=new un(u,i.heights[i.index++]);l.outdated=!1,a.push(l),s+=u+1}return s<=o&&a.push(null,new n(o-s).updateHeight(t,s)),t.heightChanged=!0,an.of(a)}return(r||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(an),hn=function(t){k(n,t);var e=w(n);function n(t,r,i){var o;return O(this,n),(o=e.call(this,t.length+r+i.length,t.height+i.height,r|(t.outdated||i.outdated?2:0))).left=t,o.right=i,o.size=t.size+i.size,o}return D(n,[{key:"blockAt",value:function(t,e,n,r){var i=n+this.left.height;return t<i||0==this.right.height?this.left.blockAt(t,e,n,r):this.right.blockAt(t,e,i,r+this.left.length+this.break)}},{key:"lineAt",value:function(t,e,n,r,i){var o=r+this.left.height,a=i+this.left.length+this.break,s=e==tn.ByHeight?t<o||0==this.right.height:t<a,u=s?this.left.lineAt(t,e,n,r,i):this.right.lineAt(t,e,n,o,a);if(this.break||(s?u.to<a:u.from>a))return u;var l=e==tn.ByPosNoHeight?tn.ByPosNoHeight:tn.ByPos;return s?u.join(this.right.lineAt(a,l,n,o,a)):this.left.lineAt(a,l,n,r,i).join(u)}},{key:"forEachLine",value:function(t,e,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)t<s&&this.left.forEachLine(t,e,n,r,i,o),e>=s&&this.right.forEachLine(t,e,n,a,s,o);else{var u=this.lineAt(s,tn.ByPos,n,r,i);t<u.from&&this.left.forEachLine(t,u.from-1,n,r,i,o),u.to>=t&&u.from<=e&&o(u),e>u.to&&this.right.forEachLine(u.to+1,e,n,a,s,o)}}},{key:"replace",value:function(t,e,n){var r=this.left.length+this.break;if(e<r)return this.balanced(this.left.replace(t,e,n),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-r,e-r,n));var i=[];t>0&&this.decomposeLeft(t,i);var o,a=i.length,s=M(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.push(u)}}catch(h){s.e(h)}finally{s.f()}if(t>0&&cn(i,a-1),e<this.length){var l=i.length;this.decomposeRight(e,i),cn(i,l)}return an.of(i)}},{key:"decomposeLeft",value:function(t,e){var n=this.left.length;if(t<=n)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&t>=++n&&e.push(null),t>n&&this.right.decomposeLeft(t-n,e)}},{key:"decomposeRight",value:function(t,e){var n=this.left.length,r=n+this.break;if(t>=r)return this.right.decomposeRight(t-r,e);t<n&&this.left.decomposeRight(t,e),this.break&&t<r&&e.push(null),e.push(this.right)}},{key:"balanced",value:function(t,e){return t.size>2*e.size||e.size>2*t.size?an.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}},{key:"updateHeight",value:function(t){var e=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=e+i.length+this.break,s=null;return r&&r.from<=e+i.length&&r.more?s=i=i.updateHeight(t,e,n,r):i.updateHeight(t,e,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(t,a,n,r):o.updateHeight(t,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}},{key:"break",get:function(){return 1&this.flags}}]),n}(an);function cn(t,e){var n,r;null==t[e]&&(n=t[e-1])instanceof ln&&(r=t[e+1])instanceof ln&&t.splice(e-1,3,new ln(n.length+1+r.length))}var fn=function(){function t(e,n){O(this,t),this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}return D(t,[{key:"span",value:function(t,e){if(this.lineStart>-1){var n=Math.min(e,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof un?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new un(n-this.pos,-1)),this.writtenTo=n,e>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}},{key:"point",value:function(t,e,n){if(t<e||n.heightRelevant){var r=n.widget?Math.max(0,n.widget.estimatedHeight):0,i=e-t;n.block?this.addBlock(new sn(i,r,n.type)):(i||r>=5)&&this.addLineDeco(r,i)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}},{key:"enterLine",value:function(){if(!(this.lineStart>-1)){var t=this.oracle.doc.lineAt(this.pos),e=t.from,n=t.to;this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new un(this.pos-e,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(t,e){var n=new ln(e-t);return this.oracle.doc.lineAt(t).to==e&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof un)return t;var e=new un(0,-1);return this.nodes.push(e),e}},{key:"addBlock",value:function(t){this.enterLine(),t.type!=Ct.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ct.WidgetBefore&&(this.covering=t)}},{key:"addLineDeco",value:function(t,e){var n=this.ensureLine();n.length+=e,n.collapsed+=e,n.widgetHeight=Math.max(n.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}},{key:"finish",value:function(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof un||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new un(0,-1));var n,r=t,i=M(this.nodes);try{for(i.s();!(n=i.n()).done;){var o=n.value;o instanceof un&&o.updateHeight(this.oracle,r),r+=o?o.length:1}}catch(a){i.e(a)}finally{i.f()}return this.nodes}},{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}}],[{key:"build",value:function(e,n,r,i){var o=new t(r,e);return a.Xs.spans(n,r,i,o,0),o.finish(r)}}]),t}();function dn(t,e,n){var r=new vn;return a.Xs.compare(t,e,n,r,0),r.changes}var vn=function(){function t(){O(this,t),this.changes=[]}return D(t,[{key:"compareRange",value:function(){}},{key:"comparePoint",value:function(t,e,n,r){(t<e||n&&n.heightRelevant||r&&r.heightRelevant)&&Rt(t,e,this.changes,5)}}]),t}();var pn=function(){function t(e,n,r){O(this,t),this.from=e,this.to=n,this.size=r}return D(t,[{key:"draw",value:function(t){return Ot.replace({widget:new gn(this.size,t)}).range(this.from,this.to)}}],[{key:"same",value:function(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++){var r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}}]),t}(),gn=function(t){k(n,t);var e=w(n);function n(t,r){var i;return O(this,n),(i=e.call(this)).size=t,i.vertical=r,i}return D(n,[{key:"eq",value:function(t){return t.size==this.size&&t.vertical==this.vertical}},{key:"toDOM",value:function(){var t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}},{key:"estimatedHeight",get:function(){return this.vertical?this.size:-1}}]),n}(Mt),mn=function(){function t(e){O(this,t),this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentWidth=0,this.heightOracle=new nn,this.scaler=Sn,this.scrollTo=null,this.printing=!1,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.heightMap=an.empty().applyChanges(e.facet(ne),i.xv.empty,this.heightOracle.setDoc(e.doc),[new ie(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ot.set(this.lineGaps.map((function(t){return t.draw(!1)}))),this.computeVisibleRanges()}return D(t,[{key:"updateForViewport",value:function(){for(var t=this,e=[this.viewport],n=this.state.selection.main,r=function(r){var i=r?n.head:n.anchor;if(!e.some((function(t){var e=t.from,n=t.to;return i>=e&&i<=n}))){var o=t.lineAt(i,0),a=o.from,s=o.to;e.push(new yn(a,s))}},i=0;i<=1;i++)r(i);this.viewports=e.sort((function(t,e){return t.from-e.from})),this.scaler=this.heightMap.height<=7e6?Sn:new xn(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=t.state;var i=this.state.facet(ne),o=t.changedRanges,a=ie.extendWithRanges(o,dn(t.startState.facet(ne),i,t?t.changes:r.as.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(i,n.doc,this.heightOracle.setDoc(this.state.doc),a),this.heightMap.height!=s&&(t.flags|=2);var u=a.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.head<u.from||e.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,e)),u.eq(this.viewport)||(this.viewport=u,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(t.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes)))),this.computeVisibleRanges(),e&&(this.scrollTo=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(t,e){var n=t.dom,r="",i=fe.LTR;if(!e){var o=window.getComputedStyle(n);r=o.whiteSpace,i="rtl"==o.direction?fe.RTL:fe.LTR,this.paddingTop=parseInt(o.paddingTop)||0,this.paddingBottom=parseInt(o.paddingBottom)||0}var a=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:function(t,e){for(var n=t.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=t.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var u=s.getBoundingClientRect();r=Math.max(r,u.left),i=Math.min(i,u.right),o=Math.max(o,u.top),a=Math.min(a,u.bottom)}s=s.parentNode}else{if(11!=s.nodeType)break;s=s.host}return{left:r-n.left,right:i-n.left,top:o-(n.top+e),bottom:a-(n.top+e)}}(n,this.paddingTop),s=a.top-this.pixelViewport.top,u=a.bottom-this.pixelViewport.bottom;if(this.pixelViewport=a,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var l=t.measureVisibleLineHeights(),h=!1,c=0,f=0,d=this.heightOracle;if(!e){var v=t.dom.clientWidth;if(d.mustRefresh(l,r,i)||d.lineWrapping&&Math.abs(v-this.contentWidth)>d.charWidth){var p=t.measureTextSize(),g=p.lineHeight,m=p.charWidth;(h=d.refresh(r,i,g,m,v/m,l))&&(t.minWidth=0,f|=16)}this.contentWidth!=v&&(this.contentWidth=v,f|=16),s>0&&u>0?c=Math.max(s,u):s<0&&u<0&&(c=Math.min(s,u))}if(d.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(d,0,h,new rn(this.viewport.from,l)),d.heightChanged&&(f|=2),!this.viewportIsAppropriate(this.viewport,c)||this.scrollTo&&(this.scrollTo.head<this.viewport.from||this.scrollTo.head>this.viewport.to)){var y=this.getViewport(c,this.scrollTo);y.from==this.viewport.from&&y.to==this.viewport.to||(this.viewport=y,f|=4)}return this.updateForViewport(),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(f|=this.updateLineGaps(this.ensureLineGaps(h?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.enforceCursorAssoc()),f}},{key:"getViewport",value:function(t,e){var n=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.visibleTop,a=this.visibleBottom,s=new yn(r.lineAt(o-1e3*n,tn.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),tn.ByHeight,i,0,0).to);if(e)if(e.head<s.from){var u=r.lineAt(e.head,tn.ByPos,i,0,0).top;s=new yn(r.lineAt(u-500,tn.ByHeight,i,0,0).from,r.lineAt(u+(a-o)+500,tn.ByHeight,i,0,0).to)}else if(e.head>s.to){var l=r.lineAt(e.head,tn.ByPos,i,0,0).bottom;s=new yn(r.lineAt(l-(a-o)-500,tn.ByHeight,i,0,0).from,r.lineAt(l+500,tn.ByHeight,i,0,0).to)}return s}},{key:"mapViewport",value:function(t,e){var n=e.mapPos(t.from,-1),r=e.mapPos(t.to,1);return new yn(this.heightMap.lineAt(n,tn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,tn.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(t){var e=t.from,n=t.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(e,tn.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,tn.ByPos,this.state.doc,0,0),s=a.bottom,u=this.visibleTop,l=this.visibleBottom;return(0==e||o<=u-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(r,250)))&&o>u-2e3&&s<l+2e3}},{key:"mapLineGaps",value:function(t,e){if(!t.length||e.empty)return t;var n,r=[],i=M(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;e.touchesRange(o.from,o.to)||r.push(new pn(e.mapPos(o.from),e.mapPos(o.to),o.size))}}catch(a){i.e(a)}finally{i.f()}return r}},{key:"ensureLineGaps",value:function(t){var e=this,n=[];return this.heightOracle.direction!=fe.LTR||this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(function(r){if(!(r.length<1e4)){var i=function(t,e,n){var r=[],i=t,o=0;a.Xs.spans(n.facet(ne),t,e,{span:function(){},point:function(t,e){t>i&&(r.push({from:i,to:t}),o+=t-i),i=e}},20),i<e&&(r.push({from:i,to:e}),o+=e-i);return{total:o,ranges:r}}(r.from,r.to,e.state);if(!(i.total<1e4)){var o,s;if(e.heightOracle.lineWrapping)o=r.from!=e.viewport.from?r.from:kn(i,(e.visibleTop-r.top)/r.height),s=r.to!=e.viewport.to?r.to:kn(i,(e.visibleBottom-r.top)/r.height);else{var u=i.total*e.heightOracle.charWidth;o=kn(i,e.pixelViewport.left/u),s=kn(i,e.pixelViewport.right/u)}var l=e.state.selection.main;l.from<=o&&l.to>=r.from&&(o=l.from),l.from<=r.to&&l.to>=s&&(s=l.to);var h=o-1e4,c=s+1e4;h>r.from+5e3&&n.push(wn(t,(function(t){return t.from==r.from&&t.to>h-5e3&&t.to<h+5e3}))||new pn(r.from,h,e.gapSize(r,h,!0,i))),c<r.to-5e3&&n.push(wn(t,(function(t){return t.to==r.to&&t.from>c-5e3&&t.from<c+5e3}))||new pn(c,r.to,e.gapSize(r,c,!1,i)))}}})),n}},{key:"gapSize",value:function(t,e,n,r){if(this.heightOracle.lineWrapping){var i=t.height*bn(r,e);return n?i:t.height-i}var o=bn(r,e);return r.total*this.heightOracle.charWidth*(n?o:1-o)}},{key:"updateLineGaps",value:function(t){var e=this;return pn.same(t,this.lineGaps)?0:(this.lineGaps=t,this.lineGapDeco=Ot.set(t.map((function(t){return t.draw(e.heightOracle.lineWrapping)}))),8)}},{key:"computeVisibleRanges",value:function(){var t=this.state.facet(ne);this.lineGaps.length&&(t=t.concat(this.lineGapDeco));var e=[];a.Xs.spans(t,this.viewport.from,this.viewport.to,{span:function(t,n){e.push({from:t,to:n})},point:function(){}},20),this.visibleRanges=e}},{key:"lineAt",value:function(t,e){return e+=this.paddingTop,An(this.heightMap.lineAt(t,tn.ByPos,this.state.doc,e,0),this.scaler,e)}},{key:"lineAtHeight",value:function(t,e){return e+=this.paddingTop,An(this.heightMap.lineAt(this.scaler.fromDOM(t,e),tn.ByHeight,this.state.doc,e,0),this.scaler,e)}},{key:"blockAtHeight",value:function(t,e){return e+=this.paddingTop,An(this.heightMap.blockAt(this.scaler.fromDOM(t,e),this.state.doc,e,0),this.scaler,e)}},{key:"forEachLine",value:function(t,e,n,r){var i=this;return r+=this.paddingTop,this.heightMap.forEachLine(t,e,this.state.doc,r,0,1==this.scaler.scale?n:function(t){return n(An(t,i.scaler,r))})}},{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:"contentHeight",get:function(){return this.domHeight+this.paddingTop+this.paddingBottom}},{key:"domHeight",get:function(){return this.scaler.toDOM(this.heightMap.height,this.paddingTop)}}]),t}(),yn=function(){function t(e,n){O(this,t),this.from=e,this.to=n}return D(t,[{key:"eq",value:function(t){return this.from==t.from&&this.to==t.to}}]),t}();function kn(t,e){var n=t.total,r=t.ranges;if(e<=0)return r[0].from;if(e>=1)return r[r.length-1].to;for(var i=Math.floor(n*e),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function bn(t,e){var n,r=0,i=M(t.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(e<=s){r+=e-a;break}r+=s-a}}catch(u){i.e(u)}finally{i.f()}return r/t.total}function wn(t,e){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(e(i))return i}}catch(o){r.e(o)}finally{r.f()}}var Sn={toDOM:function(t){return t},fromDOM:function(t){return t},scale:1},xn=function(){function t(e,n,r){O(this,t);var i=0,o=0,a=0;this.viewports=r.map((function(t){var r=t.from,o=t.to,a=n.lineAt(r,tn.ByPos,e,0,0).top,s=n.lineAt(o,tn.ByPos,e,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,u=M(this.viewports);try{for(u.s();!(s=u.n()).done;){var l=s.value;l.domTop=a+(l.top-o)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}}catch(h){u.e(h)}finally{u.f()}}return D(t,[{key:"toDOM",value:function(t,e){t-=e;for(var n=0,r=0,i=0;;n++){var o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.top)return i+(t-r)*this.scale+e;if(t<=o.bottom)return o.domTop+(t-o.top)+e;r=o.bottom,i=o.domBottom}}},{key:"fromDOM",value:function(t,e){t-=e;for(var n=0,r=0,i=0;;n++){var o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.domTop)return r+(t-i)/this.scale+e;if(t<=o.domBottom)return o.top+(t-o.domTop)+e;r=o.bottom,i=o.domBottom}}}]),t}();function An(t,e,n){if(1==e.scale)return t;var r=e.toDOM(t.top,n),i=e.toDOM(t.bottom,n);return new on(t.from,t.length,r,i-r,Array.isArray(t.type)?t.type.map((function(t){return An(t,e,n)})):t.type)}var Cn=r.r$.define({combine:function(t){return t.join(" ")}}),Mn=r.r$.define({combine:function(t){return t.indexOf(!0)>-1}}),On=o.V.newName(),Tn=o.V.newName(),Dn=o.V.newName(),En={"&light":"."+Tn,"&dark":"."+Dn};function Pn(t,e,n){return new o.V(e,{finish:function(e){return/&/.test(e)?e.replace(/&\w*/,(function(e){if("&"==e)return t;if(!n||!n[e])throw new RangeError("Unsupported selector: ".concat(e));return n[e]})):t+" "+e}})}var Rn=Pn("."+On,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},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",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",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"}},En),Bn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},Ln=q.ie&&q.ie_version<=11,Nn=function(){function t(e,n,r){var i=this;O(this,t),this.view=e,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new et,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((function(t){var n,r=M(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.queue.push(o)}}catch(a){r.e(a)}finally{r.f()}(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?i.flushSoon():i.flush()})),Ln&&(this.onCharData=function(t){i.queue.push({target:t.target,type:"characterData",oldValue:t.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(t){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),t[t.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return D(t,[{key:"onScroll",value:function(t){this.intersecting&&(this.flush(),this.onScrollChanged(t))}},{key:"onSelectionChange",value:function(t){var e=this.view,n=F(e.root);if(e.state.facet(Ut)?e.root.activeElement==this.dom:$(e.dom,n)){var r=n.anchorNode&&e.docView.nearest(n.anchorNode);r&&r.ignoreEvent(t)||(q.ie&&q.ie_version<=11&&!e.state.selection.main.empty&&n.focusNode&&G(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush())}}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var t=0,e=null,n=this.dom;n;)if(1==n.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==n?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(n),n=n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){var r,i=M(this.scrollTargets);try{for(i.s();!(r=i.n()).done;){r.value.removeEventListener("scroll",this.onScroll)}}catch(s){i.e(s)}finally{i.f()}var o,a=M(this.scrollTargets=e);try{for(a.s();!(o=a.n()).done;){o.value.addEventListener("scroll",this.onScroll)}}catch(s){a.e(s)}finally{a.f()}}}},{key:"ignore",value:function(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}},{key:"start",value:function(){this.active||(this.observer.observe(this.dom,Bn),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange),Ln&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}},{key:"stop",value:function(){this.active&&(this.active=!1,this.observer.disconnect(),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),Ln&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}},{key:"clearSelection",value:function(){this.ignoreSelection.set(F(this.view.root))}},{key:"clear",value:function(){this.observer.takeRecords(),this.queue.length=0,this.clearSelection()}},{key:"flushSoon",value:function(){var t=this;this.delayedFlush<0&&(this.delayedFlush=window.setTimeout((function(){t.delayedFlush=-1,t.flush()}),20))}},{key:"forceFlush",value:function(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var t=this;if(!(this.delayedFlush>=0)){var e,n=this.queue,r=M(this.observer.takeRecords());try{for(r.s();!(e=r.n()).done;){var i=e.value;n.push(i)}}catch(p){r.e(p)}finally{r.f()}n.length&&(this.queue=[]);var o=F(this.view.root),a=!this.ignoreSelection.eq(o)&&$(this.dom,o);if(0!=n.length||a){var s,u=-1,l=-1,h=!1,c=M(n);try{for(c.s();!(s=c.n()).done;){var f=s.value,d=this.readMutation(f);d&&(d.typeOver&&(h=!0),-1==u?(u=d.from,l=d.to):(u=Math.min(d.from,u),l=Math.max(d.to,l)))}}catch(p){c.e(p)}finally{c.f()}var v=this.view.state;(u>-1||a)&&this.onChange(u,l,h),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return t.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(),"childList"==t.type){var n=jn(e,t.previousSibling||t.target.previousSibling,-1),r=jn(e,t.nextSibling||t.target.nextSibling,1);return{from:n?e.posAfter(n):e.posAtStart,to:r?e.posBefore(r):e.posAtEnd,typeOver:!1}}return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var t,e=M(this.scrollTargets);try{for(e.s();!(t=e.n()).done;){t.value.removeEventListener("scroll",this.onScroll)}}catch(n){e.e(n)}finally{e.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),t}();function jn(t,e,n){for(;e;){var r=st.get(e);if(r&&r.parent==t)return r;var i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function In(t,e,n,i){var o,a,s,u=t.state.selection.main;if(e>-1&&(s=t.docView.domBoundsAround(e,n,0))){var l=s,h=l.from,c=l.to,f=t.docView.impreciseHead||t.docView.impreciseAnchor?[]:function(t,e){var n=[];if(e.activeElement!=t)return n;var r=F(e),i=r.anchorNode,o=r.anchorOffset,a=r.focusNode,s=r.focusOffset;i&&(n.push(new zn(i,o)),a==i&&s==o||n.push(new zn(a,s)));return n}(t.contentDOM,t.root),d=new Vn(f,t);d.readRange(s.startDOM,s.endDOM),a=function(t,e){if(0==t.length)return null;var n=t[0].pos,i=2==t.length?t[1].pos:n;return n>-1&&i>-1?r.jT.single(n+e,i+e):null}(f,h);var v=u.from,p=null;(8===t.inputState.lastKeyCode&&t.inputState.lastKeyTime>Date.now()-100||q.android&&d.text.length<c-h)&&(v=u.to,p="end");var g=function(t,e,n,r){var i=Math.min(t.length,e.length),o=0;for(;o<i&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==i&&t.length==e.length)return null;var a=t.length,s=e.length;for(;a>0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a<o&&t.length<e.length){s=(o-=n<=o&&n>=a?o-n:0)+(s-a),a=o}else if(s<o){a=(o-=n<=o&&n>=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(t.state.sliceDoc(h,c),d.text,v-h,p);g&&(o={from:h+g.from,to:h+g.toA,insert:t.state.toText(d.text.slice(g.from,g.toB))})}else if(t.hasFocus||!t.state.facet(Ut)){var m=F(t.root),y=t.docView,k=y.impreciseHead,b=y.impreciseAnchor,w=k&&k.node==m.focusNode&&k.offset==m.focusOffset?t.state.selection.main.head:t.docView.posFromDOM(m.focusNode,m.focusOffset),S=b&&b.node==m.anchorNode&&b.offset==m.anchorOffset?t.state.selection.main.anchor:function(t){var e=t.isCollapsed;return e&&q.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e}(m)?w:t.docView.posFromDOM(m.anchorNode,m.anchorOffset);w==u.head&&S==u.anchor||(a=r.jT.single(S,w))}if(o||a)if(!o&&i&&!u.empty&&a&&a.main.empty&&(o={from:u.from,to:u.to,insert:t.state.doc.slice(u.from,u.to)}),o){var x=t.state;if(q.android&&(o.from==u.from&&o.to==u.to&&1==o.insert.length&&2==o.insert.lines&&Hn(t,"Enter",10)||o.from==u.from-1&&o.to==u.to&&0==o.insert.length&&Hn(t,"Backspace",8)||o.from==u.from&&o.to==u.to+1&&0==o.insert.length&&Hn(t,"Delete",46)))return;var A,C=o.insert.toString();if(t.state.facet(Ft).some((function(e){return e(t,o.from,o.to,C)})))return;if(t.inputState.composing>=0&&t.inputState.composing++,o.from>=u.from&&o.to<=u.to&&o.to-o.from>=(u.to-u.from)/3&&(!a||a.main.empty&&a.main.from==o.from+o.insert.length)){var M=u.from<o.from?x.sliceDoc(u.from,o.from):"",O=u.to>o.to?x.sliceDoc(o.to,u.to):"";A=x.replaceSelection(t.state.toText(M+o.insert.sliceString(0,void 0,t.state.lineBreak)+O))}else{var T=x.changes(o);A={changes:T,selection:a&&!x.selection.main.eq(a.main)&&a.main.to<=T.newLength?x.selection.replaceRange(a.main):void 0}}t.dispatch(A,{scrollIntoView:!0,annotations:r.YW.userEvent.of("input")})}else if(a&&!a.main.eq(u)){var D,E=!1;t.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==t.inputState.lastSelectionOrigin?E=!0:D=r.YW.userEvent.of(t.inputState.lastSelectionOrigin)),t.dispatch({selection:a,scrollIntoView:E,annotations:D})}}var Vn=function(){function t(e,n){O(this,t),this.points=e,this.view=n,this.text="",this.lineBreak=n.state.lineBreak}return D(t,[{key:"readRange",value:function(t,e){if(t){for(var n=t.parentNode,r=t;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==e)break;var o=st.get(r),a=st.get(i);((o?o.breakAfter:Wn(r))||(a?a.breakAfter:Wn(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=this.lineBreak),r=i}this.findPointBefore(n,e)}}},{key:"readNode",value:function(t){if(!t.cmIgnore){var e,n=st.get(t),r=n&&n.overrideDOMText;null!=r?e=r.sliceString(0,void 0,this.lineBreak):3==t.nodeType?e=t.nodeValue:"BR"==t.nodeName?e=t.nextSibling?this.lineBreak:"":1==t.nodeType&&this.readRange(t.firstChild,null),null!=e&&(this.findPointIn(t,e.length),this.text+=e,q.chrome&&13==this.view.inputState.lastKeyCode&&!t.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}},{key:"findPointBefore",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(t,e){var n,r=M(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}catch(o){r.e(o)}finally{r.f()}}}]),t}();function Wn(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}var zn=function t(e,n){O(this,t),this.node=e,this.offset=n,this.pos=-1};function Hn(t,e,n){var r={key:e,code:e,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);t.contentDOM.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return t.contentDOM.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}var _n=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(this,t),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.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(t){return e.update([t])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new mn(n.state||r.yy.create()),this.plugins=this.state.facet(Yt).map((function(t){return new Zt(t).update(e)})),this.observer=new Nn(this,(function(t,n,r){In(e,t,n,r)}),(function(t){e.inputState.runScrollHandlers(e,t),e.measure()})),this.inputState=new je(this),this.docView=new ae(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,Un(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return D(t,[{key:"dispatch",value:function(){var t;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof r.YW?arguments.length<=0?void 0:arguments[0]:(t=this.state).update.apply(t,arguments))}},{key:"update",value:function(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,n,i=!1,o=this.state,a=M(t);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=s.state}}catch(c){a.e(c)}finally{a.f()}if(o.facet(r.yy.phrases)!=this.state.facet(r.yy.phrases))return this.setState(o);e=new oe(this,o,t);try{this.updateState=2;var u=t.some((function(t){return t.scrollIntoView}))?o.selection.main:null;this.viewState.update(e,u),this.bidiCache=Jn.update(this.bidiCache,e.changes),e.empty||this.updatePlugins(e),i=this.docView.update(e),this.state.facet(re)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((i||scrollTo||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!e.empty){var l,h=M(this.state.facet(qt));try{for(h.s();!(l=h.n()).done;){(0,l.value)(e)}}catch(c){h.e(c)}finally{h.f()}}}},{key:"setState",value:function(t){var e=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;try{var n,r=M(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 mn(t),this.plugins=t.facet(Yt).map((function(t){return new Zt(t).update(e)})),this.docView=new ae(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}},{key:"updatePlugins",value:function(t){var e=t.startState.facet(Yt),n=t.state.facet(Yt);if(e!=n){var r,i=[],o=M(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.indexOf(a);if(s<0)i.push(new Zt(a));else{var u=this.plugins[s];u.mustUpdate=t,i.push(u)}}}catch(p){o.e(p)}finally{o.f()}var l,h=M(this.plugins);try{for(h.s();!(l=h.n()).done;){var c=l.value;c.mustUpdate!=t&&c.destroy(this)}}catch(p){h.e(p)}finally{h.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else{var f,d=M(this.plugins);try{for(d.s();!(f=d.n()).done;){f.value.mustUpdate=t}}catch(p){d.e(p)}finally{d.f()}}for(var v=0;v<this.plugins.length;v++)this.plugins[v]=this.plugins[v].update(this)}},{key:"measure",value:function(){var t=this;this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;var e=null;try{for(var n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var o=i.map((function(e){try{return e.read(t)}catch(n){return $t(t.state,n),Kn}})),a=new oe(this,this.state);a.flags|=r,e?e.flags|=r:e=a,this.updateState=2,a.empty||this.updatePlugins(a),this.updateAttrs(),r&&this.docView.update(a);for(var s=0;s<i.length;s++)if(o[s]!=Kn)try{i[s].write(o[s],this)}catch(h){$t(this.state,h)}if(this.viewState.scrollTo&&(this.docView.scrollPosIntoView(this.viewState.scrollTo.head,this.viewState.scrollTo.assoc),this.viewState.scrollTo=null),!(4&r)&&0==this.measureRequests.length)break}}finally{this.updateState=0}if(this.measureScheduled=-1,e&&!e.empty){var u,l=M(this.state.facet(qt));try{for(l.s();!(u=l.n()).done;){(0,u.value)(e)}}catch(c){l.e(c)}finally{l.f()}}}},{key:"updateAttrs",value:function(){var t=St(this.state.facet(te),{class:"cm-wrap"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses});At(this.dom,this.editorAttrs,t),this.editorAttrs=t;var e=St(this.state.facet(ee),{spellcheck:"false",contenteditable:String(this.state.facet(Ut)),class:"cm-content",style:"".concat(q.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"});At(this.contentDOM,this.contentAttrs,e),this.contentAttrs=e}},{key:"showAnnouncements",value:function(e){var n,r=!0,i=M(e);try{for(i.s();!(n=i.n()).done;){var o,a=M(n.value.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.is(t.announce))r&&(this.announceDOM.textContent=""),r=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=s.value}}catch(u){a.e(u)}finally{a.f()}}}catch(u){i.e(u)}finally{i.f()}}},{key:"mountStyles",value:function(){this.styleModules=this.state.facet(re),o.V.mount(this.root,this.styleModules.concat(Rn).reverse())}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure()}},{key:"requestMeasure",value:function(t){var e=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return e.measure()}))),t){if(null!=t.key)for(var n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key)return void(this.measureRequests[n]=t);this.measureRequests.push(t)}}},{key:"pluginField",value:function(t){var e,n=[],r=M(this.plugins);try{for(r.s();!(e=r.n()).done;){e.value.update(this).takeField(t,n)}}catch(i){r.e(i)}finally{r.f()}return n}},{key:"plugin",value:function(t){var e,n=M(this.plugins);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.spec==t)return r.update(this).value}}catch(i){n.e(i)}finally{n.f()}return null}},{key:"blockAtHeight",value:function(t,e){return this.readMeasured(),this.viewState.blockAtHeight(t,Fn(e,this.contentDOM))}},{key:"visualLineAtHeight",value:function(t,e){return this.readMeasured(),this.viewState.lineAtHeight(t,Fn(e,this.contentDOM))}},{key:"viewportLines",value:function(t,e){var n=this.viewport,r=n.from,i=n.to;this.viewState.forEachLine(r,i,t,Fn(e,this.contentDOM))}},{key:"visualLineAt",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(t,e)}},{key:"moveByChar",value:function(t,e,n){return Ne(this,t,e,n)}},{key:"moveByGroup",value:function(t,e){var n=this;return Ne(this,t,e,(function(e){return function(t,e,n){var i=t.state.charCategorizer(e),o=i(n);return function(t){var e=i(t);return o==r.D0.Space&&(o=e),o==e}}(n,t.head,e)}))}},{key:"moveToLineBoundary",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Le(this,t,e,n)}},{key:"moveVertically",value:function(t,e,n){return function(t,e,n,o){var a,s=e.head,u=n?1:-1;if(s==(n?t.state.doc.length:0))return r.jT.cursor(s);var l=t.coordsAtPos(s);if(l)for(var h=t.dom.getBoundingClientRect(),c=null!==(a=e.goalColumn)&&void 0!==a?a:l.left-h.left,f=h.left+c,d=null!=o?o:t.defaultLineHeight>>1,v=u<0?l.top:l.bottom,p=0;p<50;p+=10){var g=Be(t,{x:f,y:v+(d+p)*u},u);if(null==g)break;if(g!=s)return r.jT.cursor(g,void 0,void 0,c)}var m=t.state.doc,y=m.lineAt(s),k=t.state.tabSize,b=e.goalColumn,w=0;if(null==b){for(var S=m.iterRange(y.from,s);!S.next().done;)w=(0,i.IS)(S.value,w,k);b=w*t.defaultCharacterWidth}else w=Math.round(b/t.defaultCharacterWidth);if(u<0&&0==y.from)return r.jT.cursor(0);if(u>0&&y.to==m.length)return r.jT.cursor(y.to);for(var x=m.line(y.number+u),A=x.from,C=0,M=m.iterRange(x.from,x.to);C>=w&&!M.next().done;){var O=(0,i.Gz)(M.value,C,w,k),T=O.offset;C=w-O.leftOver,A+=T}return r.jT.cursor(A,void 0,void 0,b)}(this,t,e,n)}},{key:"scrollPosIntoView",value:function(t){this.viewState.scrollTo=r.jT.cursor(t),this.requestMeasure()}},{key:"domAtPos",value:function(t){return this.docView.domAtPos(t)}},{key:"posAtDOM",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(t,e)}},{key:"posAtCoords",value:function(t){return this.readMeasured(),Be(this,t)}},{key:"coordsAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(t,e);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(t),i=this.bidiSpans(r),o=i[be.find(i,t-r.from,-1,e)];return Q(n,o.dir==fe.LTR==e>0)}},{key:"bidiSpans",value:function(t){if(t.length>qn)return xe(t.length);var e,n=this.textDirection,r=M(this.bidiCache);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.from==t.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=Se(t.text,this.textDirection);return this.bidiCache.push(new Jn(t.from,t.to,n,o)),o}},{key:"focus",value:function(){var t=this;this.observer.ignore((function(){rt(t.contentDOM),t.docView.updateSelection()}))}},{key:"destroy",value:function(){var t,e=M(this.plugins);try{for(e.s();!(t=e.n()).done;){t.value.destroy(this)}}catch(n){e.e(n)}finally{e.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"themeClasses",get:function(){return On+" "+(this.state.facet(Mn)?Dn:Tn)+" "+this.state.facet(Cn)}},{key:"contentHeight",get:function(){return this.viewState.contentHeight}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return document.hasFocus()&&this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(t){return Xt.define((function(){return{}}),{eventHandlers:t})}},{key:"theme",value:function(t,e){var n=o.V.newName(),r=[Cn.of(n),re.of(Pn(".".concat(n),t))];return e&&e.dark&&r.push(Mn.of(!0)),r}},{key:"baseTheme",value:function(t){return r.Wl.fallback(re.of(Pn("."+On,t,En)))}}]),t}();_n.styleModule=re,_n.inputHandler=Ft,_n.exceptionSink=_t,_n.updateListener=qt,_n.editable=Ut,_n.mouseSelectionStyle=Ht,_n.dragMovesSelection=zt,_n.clickAddsSelectionRange=Wt,_n.decorations=ne,_n.contentAttributes=ee,_n.editorAttributes=te,_n.lineWrapping=_n.contentAttributes.of({class:"cm-lineWrapping"}),_n.announce=r.Py.define();var qn=4096;function Fn(t,e){return null==t?e.getBoundingClientRect().top:t}var $n=-1;function Un(){window.addEventListener("resize",(function(){-1==$n&&($n=setTimeout(Gn,50))}))}function Gn(){$n=-1;for(var t=document.querySelectorAll(".cm-content"),e=0;e<t.length;e++){var n=st.get(t[e]);n&&n.editorView.requestMeasure()}}var Kn={},Jn=function(){function t(e,n,r,i){O(this,t),this.from=e,this.to=n,this.dir=r,this.order=i}return D(t,null,[{key:"update",value:function(e,n){if(n.empty)return e;for(var r=[],i=e.length?e[e.length-1].dir:fe.LTR,o=Math.max(0,e.length-10);o<e.length;o++){var a=e[o];a.dir!=i||n.touchesRange(a.from,a.to)||r.push(new t(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.order))}return r}}]),t}(),Yn="undefined"==typeof navigator?"key":/Mac/.test(navigator.platform)?"mac":/Win/.test(navigator.platform)?"win":/Linux|X11/.test(navigator.platform)?"linux":"key";function Xn(t,e){var n,r,i,o,a=t.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(var u=0;u<a.length-1;++u){var l=a[u];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);"mac"==e?o=!0:r=!0}}return n&&(s="Alt-"+s),r&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function Qn(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}var Zn=_n.domEventHandlers({keydown:function(t,e){return ar(nr(e.state),t,e,"editor")}}),tr=r.r$.define({enables:Zn}),er=new WeakMap;function nr(t){var e=t.facet(tr),n=er.get(e);return n||er.set(e,n=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yn,r=Object.create(null),i=Object.create(null),o=function(t,e){var n=i[t];if(null==n)i[t]=e;else if(n!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},a=function(t,e,i,a){for(var s=r[t]||(r[t]=Object.create(null)),u=e.split(/ (?!$)/).map((function(t){return Xn(t,n)})),l=function(e){var n=u.slice(0,e).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(e){var r=ir={view:e,prefix:n,scope:t};return setTimeout((function(){ir==r&&(ir=null)}),or),!0}]})},h=1;h<u.length;h++)l(h);var c=u.join(" ");o(c,!1);var f=s[c]||(s[c]={preventDefault:!1,commands:[]});f.commands.push(i),a&&(f.preventDefault=!0)},s=M(t);try{for(s.s();!(e=s.n()).done;){var u=e.value,l=u[n]||u.key;if(l){var h,c=M(u.scope?u.scope.split(" "):["editor"]);try{for(c.s();!(h=c.n()).done;){var f=h.value;a(f,l,u.run,u.preventDefault),u.shift&&a(f,"Shift-"+l,u.shift,u.preventDefault)}}catch(d){c.e(d)}finally{c.f()}}}}catch(d){s.e(d)}finally{s.f()}return r}(e.reduce((function(t,e){return t.concat(e)}),[]))),n}function rr(t,e,n){return ar(nr(t.state),e,t,n)}var ir=null,or=4e3;function ar(t,e,n,r){var i=function(t){var e=!(v&&(t.ctrlKey||t.altKey||t.metaKey)||(h||d)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?u:s)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=1==i.length&&" "!=i,a="",l=!1;ir&&ir.view==n&&ir.scope==r&&(a=ir.prefix+" ",(l=Ie.indexOf(e.keyCode)<0)&&(ir=null));var c,f=function(t){if(t){var e,r=M(t.commands);try{for(r.s();!(e=r.n()).done;){if((0,e.value)(n))return!0}}catch(i){r.e(i)}finally{r.f()}t.preventDefault&&(l=!0)}return!1},p=t[r];if(p){if(f(p[a+Qn(i,e,!o)]))return!0;if(o&&(e.shiftKey||e.altKey||e.metaKey)&&(c=s[e.keyCode])&&c!=i){if(f(p[a+Qn(c,e,!0)]))return!0}else if(o&&e.shiftKey&&f(p[a+Qn(i,e,!0)]))return!0}return l}var sr=!q.ios,ur=r.r$.define({combine:function(t){return(0,r.BO)(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:function(t,e){return Math.min(t,e)},drawRangeCursor:function(t,e){return t||e}})}});function lr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[ur.of(t),cr,dr]}var hr=function(){function t(e,n,r,i,o){O(this,t),this.left=e,this.top=n,this.width=r,this.height=i,this.className=o}return D(t,[{key:"draw",value:function(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t}},{key:"adjust",value:function(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width>=0&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}},{key:"eq",value:function(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}}]),t}(),cr=Xt.fromClass(function(){function t(e){O(this,t),this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}return D(t,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(ur).cursorBlinkRate+"ms"}},{key:"update",value:function(t){var e=t.startState.facet(ur)!=t.state.facet(ur);(e||t.selectionSet||t.geometryChanged||t.viewportChanged)&&this.view.requestMeasure(this.measureReq),t.transactions.some((function(t){return t.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}},{key:"readPos",value:function(){var t,e=this,n=this.view.state,r=n.facet(ur),i=n.selection.ranges.map((function(t){return t.empty?[]:function(t,e){if(e.to<=t.viewport.from||e.from>=t.viewport.to)return[];var n=Math.max(e.from,t.viewport.from),r=Math.min(e.to,t.viewport.to),i=t.textDirection==fe.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),s=vr(t),u=window.getComputedStyle(o.firstChild),l=a.left+parseInt(u.paddingLeft),h=a.right-parseInt(u.paddingRight),c=t.visualLineAt(n),f=t.visualLineAt(r);t.lineWrapping&&(c=pr(t,n,c),f=pr(t,r,f));if(c.from==f.from)return m(y(e.from,e.to,c));var d=y(e.from,null,c),v=y(null,e.to,f),p=[];return c.to<f.from-1?p.push(g(l,d.bottom,h,v.top)):d.bottom<v.top&&v.top-d.bottom<4&&(d.bottom=v.top=(d.bottom+v.top)/2),m(d).concat(p).concat(m(v));function g(t,e,n,r){return new hr(t-s.left,e-s.top,n-t,r-e,"cm-selectionBackground")}function m(t){for(var e=t.top,n=t.bottom,r=t.horizontal,i=[],o=0;o<r.length;o+=2)i.push(g(r[o],e,r[o+1],n));return i}function y(e,n,r){var o=1e9,a=-1e9,s=[];function u(e,n,u,c,f){var d=t.coordsAtPos(e,e==r.to?-1:1),v=t.coordsAtPos(u,u==r.from?1:-1);o=Math.min(d.top,v.top,o),a=Math.max(d.bottom,v.bottom,a),f==fe.LTR?s.push(i&&n?l:d.left,i&&c?h:v.right):s.push(!i&&c?l:v.left,!i&&n?h:d.right)}var c,f=null!=e?e:r.from,d=null!=n?n:r.to,v=M(t.visibleRanges);try{for(v.s();!(c=v.n()).done;){var p=c.value;if(p.to>f&&p.from<d)for(var g=Math.max(p.from,f),m=Math.min(p.to,d);;){var y,k=t.state.doc.lineAt(g),b=M(t.bidiSpans(k));try{for(b.s();!(y=b.n()).done;){var w=y.value,S=w.from+k.from,x=w.to+k.from;if(S>=m)break;x>g&&u(Math.max(S,g),null==e&&S<=f,Math.min(x,m),null==n&&x>=d,w.dir)}}catch(C){b.e(C)}finally{b.f()}if((g=k.to+1)>=m)break}}}catch(C){v.e(C)}finally{v.f()}if(0==s.length){var A=t.coordsAtPos(f,-1);o=Math.min(A.top,o),a=Math.max(A.bottom,a)}return{top:o,bottom:a,horizontal:s}}}(e.view,t)})).reduce((function(t,e){return t.concat(e)})),o=[],a=M(n.selection.ranges);try{for(a.s();!(t=a.n()).done;){var s=t.value,u=s==n.selection.main;if(s.empty?!u||sr:r.drawRangeCursor){var l=gr(this.view,s,u);l&&o.push(l)}}}catch(h){a.e(h)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(t){var e=this,n=t.rangePieces,r=t.cursors;if(n.length!=this.rangePieces.length||n.some((function(t,n){return!t.eq(e.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=M(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(c){o.e(c)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(t,n){return!t.eq(e.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var u,l=M(r);try{for(l.s();!(u=l.n()).done;){var h=u.value;this.cursorLayer.appendChild(h.draw())}}catch(c){l.e(c)}finally{l.f()}}else r.forEach((function(t,e){return t.adjust(s[e])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),t}()),fr={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};sr&&(fr[".cm-line"].caretColor="transparent !important");var dr=r.Wl.override(_n.theme(fr));function vr(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==fe.LTR?e.left:e.right-t.scrollDOM.clientWidth)-t.scrollDOM.scrollLeft,top:e.top-t.scrollDOM.scrollTop}}function pr(t,e,n){var i=r.jT.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(i,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(i,!0,!0).from)}}function gr(t,e,n){var r=t.coordsAtPos(e.head,e.assoc||1);if(!r)return null;var i=vr(t);return new hr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}var mr=null!=/x/.unicode?"gu":"g",yr=new RegExp("[\0-\b\n--­؜​‎‏\u2028\u2029\ufeff￹-￼]",mr),kr=null;r.r$.define({combine:function(t){var e=(0,r.BO)(t,{render:null,specialChars:yr,addSpecialChars:null});return(e.replaceTabs=!function(){if(null==kr&&"undefined"!=typeof document&&document.body){var t=document.body.style;kr=null!=(t.tabSize||t.MozTabSize)}return kr||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,mr)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,mr)),e}});function br(){return Sr}var wr=Ot.line({attributes:{class:"cm-activeLine"}}),Sr=Xt.fromClass(function(){function t(e){O(this,t),this.decorations=this.getDeco(e)}return D(t,[{key:"update",value:function(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var e,n=-1,r=[],i=M(t.state.selection.ranges);try{for(i.s();!(e=i.n()).done;){var o=e.value;if(o.empty){var a=t.visualLineAt(o.head);a.from>n&&(r.push(wr.range(a.from)),n=a.from)}}}catch(s){i.e(s)}finally{i.f()}return Ot.set(r)}}]),t}(),{decorations:function(t){return t.decorations}})},26856:function(t,e,n){"use strict";function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}n.d(e,{md:function(){return c},Lj:function(){return v},Jq:function(){return d},mp:function(){return p},i9:function(){return D}});var u=1024,l=0,h=new WeakMap,c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.deserialize;o(this,t),this.id=l++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return s(t,[{key:"set",value:function(t,e){return t[this.id]=e,t}},{key:"add",value:function(t){var e=this;return"function"!=typeof t&&(t=d.match(t)),function(n){var r=t(n);return void 0===r?null:[e,r]}}}],[{key:"string",value:function(){return new t({deserialize:function(t){return t}})}},{key:"number",value:function(){return new t({deserialize:Number})}},{key:"flag",value:function(){return new t({deserialize:function(){return!0}})}}]),t}();c.closedBy=new c({deserialize:function(t){return t.split(" ")}}),c.openedBy=new c({deserialize:function(t){return t.split(" ")}}),c.group=new c({deserialize:function(t){return t.split(" ")}});var f=Object.create(null),d=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;o(this,t),this.name=e,this.props=n,this.id=r,this.flags=i}return s(t,[{key:"prop",value:function(t){return this.props[t.id]}},{key:"is",value:function(t){if("string"==typeof t){if(this.name==t)return!0;var e=this.prop(c.group);return!!e&&e.indexOf(t)>-1}return this.id==t}},{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:"define",value:function(e){var n=e.props&&e.props.length?Object.create(null):f,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new t(e.name||"",n,e.id,i);if(e.props){var a,s=r(e.props);try{for(s.s();!(a=s.n()).done;){var u=a.value;Array.isArray(u)||(u=u(o)),u&&u[0].set(n,u[1])}}catch(l){s.e(l)}finally{s.f()}}return o}},{key:"match",value:function(t){var e=Object.create(null);for(var n in t){var i,o=r(n.split(" "));try{for(o.s();!(i=o.n()).done;){var a=i.value;e[a]=t[n]}}catch(s){o.e(s)}finally{o.f()}}return function(t){for(var n=t.prop(c.group),r=-1;r<(n?n.length:0);r++){var i=e[r<0?t.name:n[r]];if(i)return i}}}}]),t}();d.none=new d("",Object.create(null),0,8);var v=function(){function t(e){o(this,t),this.types=e;for(var n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}return s(t,[{key:"extend",value:function(){for(var e=[],n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a,s=r(this.types);try{for(s.s();!(a=s.n()).done;){var u,l=a.value,h=null,c=r(i);try{for(c.s();!(u=c.n()).done;){var f=u.value,v=f(l);v&&(h||(h=Object.assign({},l.props)),v[0].set(h,v[1]))}}catch(p){c.e(p)}finally{c.f()}e.push(h?new d(l.name,h,l.id,l.flags):l)}}catch(p){s.e(p)}finally{s.f()}return new t(e)}}]),t}(),p=function(){function t(e,n,r,i){o(this,t),this.type=e,this.children=n,this.positions=r,this.length=i}return s(t,[{key:"toString",value:function(){var t=this.children.map((function(t){return t.toString()})).join();return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}},{key:"cursor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null!=t&&h.get(this)||this.topNode,r=new S(n);return null!=t&&(r.moveTo(t,e),h.set(this,r._tree)),r}},{key:"fullCursor",value:function(){return new S(this.topNode,!0)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor(t,e).node}},{key:"iterate",value:function(t){for(var e=t.enter,n=t.leave,r=t.from,i=void 0===r?0:r,o=t.to,a=void 0===o?this.length:o,s=this.cursor();;){var u=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==e(s.type,s.from,s.to))){if(s.firstChild())continue;s.type.isAnonymous||(u=!0)}for(;u&&n&&n(s.type,s.from,s.to),u=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;u=!0}}}},{key:"balance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u;return this.children.length<=C?this:O(this.type,d.none,this.children,this.positions,0,this.children.length,0,t,this.length,0)}},{key:"topNode",get:function(){return new y(this,0,0,null)}}],[{key:"build",value:function(t){return M(t)}}]),t}();function g(t,e){return e&&(t.contextHash=e),t}p.empty=new p(d.none,[],[],0);var m=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.none;o(this,t),this.buffer=e,this.length=n,this.set=r,this.type=i}return s(t,[{key:"toString",value:function(){for(var t=[],e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}},{key:"childString",value:function(t){var e=this.buffer[t],n=this.buffer[t+3],r=this.set.types[e],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(t+=4))return i;for(var o=[];t<n;)o.push(this.childString(t)),t=this.buffer[t+3];return i+"("+o.join(",")+")"}},{key:"findChild",value:function(t,e,n,r){for(var i=this.buffer,o=-1,a=t;a!=e;a=i[a+3])if(-1e8!=r){var s=i[a+1],u=i[a+2];if(n>0){if(u>r&&(o=a),u>r)break}else if(s<r&&(o=a),u>=r)break}else if(o=a,n>0)break;return o}}]),t}(),y=function(){function t(e,n,r,i){o(this,t),this.node=e,this.from=n,this.index=r,this._parent=i}return s(t,[{key:"nextChild",value:function(e,n,r){for(var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this;;){for(var a=o.node,s=a.children,u=a.positions,l=n>0?s.length:-1;e!=l;e+=n){var h=s[e],c=u[e]+o.from;if(-1e8==r||!(n<0?c>=r:c+h.length<=r))if(h instanceof m){var f=h.findChild(0,h.buffer.length,n,-1e8==r?-1e8:r-c);if(f>-1)return new w(new b(o,h,e,c),null,f)}else if(i||!h.type.isAnonymous||x(h)){var d=new t(h,c,e,o);return i||!d.type.isAnonymous?d:d.nextChild(n<0?h.children.length-1:0,n,r)}}if(i||!o.type.isAnonymous)return null;if(e=o.index+n,!(o=o._parent))return null}}},{key:"childAfter",value:function(t){return this.nextChild(0,1,t)}},{key:"childBefore",value:function(t){return this.nextChild(this.node.children.length-1,-1,t)}},{key:"nextSignificantParent",value:function(){for(var t=this;t.type.isAnonymous&&t._parent;)t=t._parent;return t}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,t,e,n)}},{key:"toString",value:function(){return this.node.toString()}},{key:"type",get:function(){return this.node.type}},{key:"name",get:function(){return this.node.type.name}},{key:"to",get:function(){return this.from+this.node.length}},{key:"firstChild",get:function(){return this.nextChild(0,1,-1e8)}},{key:"lastChild",get:function(){return this.nextChild(this.node.children.length-1,-1,-1e8)}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent?this._parent.nextChild(this.index+1,1,-1):null}},{key:"prevSibling",get:function(){return this._parent?this._parent.nextChild(this.index-1,-1,-1):null}},{key:"cursor",get:function(){return new S(this)}}]),t}();function k(t,e,n,r){var i=t.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(e)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}var b=function t(e,n,r,i){o(this,t),this.parent=e,this.buffer=n,this.index=r,this.start=i},w=function(){function t(e,n,r){o(this,t),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}return s(t,[{key:"child",value:function(e,n){var r=this.context.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,-1e8==n?-1e8:n-this.context.start);return i<0?null:new t(this.context,this,i)}},{key:"childAfter",value:function(t){return this.child(1,t)}},{key:"childBefore",value:function(t){return this.child(-1,t)}},{key:"externalSibling",value:function(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,-1)}},{key:"resolve",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.cursor.moveTo(t,e).node}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=k(this,t,e,n);return r.length?r[0]:null}},{key:"getChildren",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k(this,t,e,n)}},{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:"firstChild",get:function(){return this.child(1,-1e8)}},{key:"lastChild",get:function(){return this.child(-1,-1e8)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"nextSibling",get:function(){var e=this.context.buffer,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var e=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,-1e8))}},{key:"cursor",get:function(){return new S(this)}}]),t}(),S=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(this,t),this.full=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof y)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(var r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}return s(t,[{key:"yieldNode",value:function(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}},{key:"yieldBuf",value:function(t,e){this.index=t;var n=this.buffer,r=n.start,i=n.buffer;return this.type=e||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}},{key:"yield",value:function(t){return!!t&&(t instanceof y?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enter",value:function(t,e){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree.node.children.length-1:0,t,e,this.full));var n=this.buffer.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,-1e8==e?-1e8:e-this.buffer.start);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}},{key:"firstChild",value:function(){return this.enter(1,-1e8)}},{key:"lastChild",value:function(){return this.enter(-1,-1e8)}},{key:"childAfter",value:function(t){return this.enter(1,t)}},{key:"childBefore",value:function(t){return this.enter(-1,t)}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(this.full?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=this.full?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}},{key:"sibling",value:function(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree._parent.nextChild(this._tree.index+t,t,-1e8,this.full));var e=this.buffer.buffer,n=this.stack.length-1;if(t<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(e.findChild(r,this.index,-1,-1e8))}else{var i=e.buffer[this.index+3];if(i<(n<0?e.buffer.length:e.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,-1e8,this.full))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(t){var e,n,r=this.buffer;if(r){if(t>0){if(this.index<r.buffer.buffer.length)return!1}else for(var i=0;i<this.index;i++)if(r.buffer.buffer[i+3]<this.index)return!1;e=r.index,n=r.parent}else{var o=this._tree;e=o.index,n=o._parent}for(;n;e=(a=n).index,n=a._parent,a)for(var a,s=e+t,u=t<0?-1:n.node.children.length;s!=u;s+=t){var l=n.node.children[s];if(this.full||!l.type.isAnonymous||l instanceof m||x(l))return!1}return!0}},{key:"move",value:function(t){if(this.enter(t,-1e8))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}},{key:"next",value:function(){return this.move(1)}},{key:"prev",value:function(){return this.move(-1)}},{key:"moveTo",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;e<0?this.childBefore(t):this.childAfter(t);)if(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t)){this.parent();break}return this}},{key:"name",get:function(){return this.type.name}},{key:"node",get:function(){if(!this.buffer)return this._tree;var t=this.bufferNode,e=null,n=0;if(t&&t.context==this.buffer)t:for(var r=this.index,i=this.stack.length;i>=0;){for(var o=t;o;o=o._parent)if(o.index==r){if(r==this.index)return o;e=o,n=i+1;break t}r=this.stack[--i]}for(var a=n;a<this.stack.length;a++)e=new w(this.buffer,e,this.stack[a]);return this.bufferNode=new w(this.buffer,e,this.index)}},{key:"tree",get:function(){return this.buffer?null:this._tree.node}}]),t}();function x(t){return t.children.some((function(t){return!t.type.isAnonymous||t instanceof m||x(t)}))}var A=function(){function t(e,n){o(this,t),this.buffer=e,this.index=n}return s(t,[{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new t(this.buffer,this.index)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}}]),t}(),C=8;function M(t){var e,n=t.buffer,r=t.nodeSet,i=t.topID,o=void 0===i?0:i,a=t.maxBufferLength,s=void 0===a?u:a,l=t.reused,h=void 0===l?[]:l,c=t.minRepeatType,f=void 0===c?r.types.length:c,v=Array.isArray(n)?new A(n,n.length):n,y=r.types,k=0;function b(t,e,n,i,o){var a=v.id,u=v.start,l=v.end,c=v.size,S=u-t;if(c<0)return-1==c?(n.push(h[a]),i.push(S)):k=a,void v.next();var x,A,M=y[a];if(l-u<=s&&(A=function(t,e){var n=v.fork(),r=0,i=0,o=0,a=n.end-s,u={size:0,start:0,skip:0};t:for(var l=n.pos-t;n.pos>l;)if(n.id!=e){var h=n.size,c=n.pos-h;if(h<0||c<l||n.start<a)break;var d=n.id>=f?4:0,p=n.start;for(n.next();n.pos>c;){if(n.size<0)break t;n.id>=f&&(d+=4),n.next()}i=p,r+=h,o+=d}else u.size=r,u.start=i,u.skip=o,o+=4,r+=4,n.next();(e<0||r==t)&&(u.size=r,u.start=i,u.skip=o);return u.size>4?u:void 0}(v.pos-e,o))){for(var T=new Uint16Array(A.size-A.skip),D=v.pos-A.size,E=T.length;v.pos>D;)E=w(A.start,T,E,o);x=new m(T,l-A.start,r,o<0?d.none:y[o]),S=A.start-t}else{var P=v.pos-c;v.next();for(var R=[],B=[],L=a>=f?a:-1;v.pos>P;)v.id==L?v.next():b(u,P,R,B,L);R.reverse(),B.reverse(),x=L>-1&&R.length>C?O(M,M,R,B,0,R.length,0,s,l-u,k):g(new p(M,R,B,l-u),k)}n.push(x),i.push(S)}function w(t,e,n,r){var i=v.id,o=v.start,a=v.end,s=v.size;if(v.next(),i==r)return n;var u=n;if(s>4)for(var l=v.pos-(s-4);v.pos>l;)n=w(t,e,n,r);return i<f&&(e[--n]=u,e[--n]=a-t,e[--n]=o-t,e[--n]=i),n}for(var S=[],x=[];v.pos>0;)b(t.start||0,0,S,x,-1);var M=null!==(e=t.length)&&void 0!==e?e:S.length?x[0]+S[0].length:0;return new p(y[o],S.reverse(),x.reverse(),M)}function O(t,e,n,r,i,o,a,s,u,l){var h=[],c=[];if(u<=s)for(var f=i;f<o;f++)h.push(n[f]),c.push(r[f]-a);else for(var v=Math.max(s,Math.ceil(1.5*u/C)),m=i;m<o;){var y=m,k=r[m];for(m++;m<o;m++){if(r[m]+n[m].length-k>v)break}if(m==y+1){var b=n[y];if(b instanceof p&&b.type==e&&b.length>v<<1){for(var w=0;w<b.children.length;w++)h.push(b.children[w]),c.push(b.positions[w]+k-a);continue}h.push(b)}else if(m==y+1)h.push(n[y]);else{var S=O(e,e,n,r,y,m,k,s,r[m-1]+n[m-1].length-k,l);e==d.none||T(S.children,e)||(S=g(new p(d.none,S.children,S.positions,S.length),l)),h.push(S)}c.push(k-a)}return g(new p(t,h,c,u),l)}function T(t,e){var n,i=r(t);try{for(i.s();!(n=i.n()).done;){if(n.value.type==e)return!0}}catch(o){i.e(o)}finally{i.f()}return!1}var D=function(){function t(e,n,r,i,a){o(this,t),this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=a}return s(t,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"applyChanges",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return e;for(var i=[],o=1,a=e.length?e[0]:null,s=0,u=0,l=0;;){var h=s<n.length?n[s++]:null,c=h?h.fromA:1e9;if(c-u>=r)for(;a&&a.from<c;){var f=a;if(u>=f.from||c<=f.to||l){var d=Math.max(f.from,u)-l,v=Math.min(f.to,c)-l;f=d>=v?null:new t(d,v,f.tree,f.offset+l,(s>0?1:0)|(h?2:0))}if(f&&i.push(f),a.to>c)break;a=o<e.length?e[o++]:null}if(!h)break;u=h.toA,l=h.toA-h.toB}return i}},{key:"addTree",value:function(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[new t(0,e.length,e,0,o?2:0)],s=r(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.to>e.length&&a.push(u)}}catch(l){s.e(l)}finally{s.f()}return a}}]),t}()},62038:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}n.d(e,{V:function(){return h}});var s="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),u="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},h=function(){function t(e,n){i(this,t),this.rules=[];var o=(n||{}).finish;function a(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function s(t,e,n,i){var u=[],l=/^@(\w+)\b/.exec(t[0]),h=l&&"keyframes"==l[1];if(l&&null==e)return n.push(t[0]+";");for(var c in e){var f=e[c];if(/&/.test(c))s(c.split(/,\s*/).map((function(e){return t.map((function(t){return e.replace(/&/,t)}))})).reduce((function(t,e){return t.concat(e)})),f,n);else if(f&&"object"==r(f)){if(!l)throw new RangeError("The value of a property ("+c+") should be a primitive value.");s(a(c),f,u,h)}else null!=f&&u.push(c.replace(/_.*/,"").replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}))+": "+f+";")}(u.length||h)&&n.push((!o||l||i?t:t.map(o)).join(", ")+" {"+u.join(" ")+"}")}for(var u in e)s(a(u),e[u],this.rules)}return a(t,[{key:"getRules",value:function(){return this.rules.join("\n")}}],[{key:"newName",value:function(){var t=l[s]||1;return l[s]=t+1,"ͼ"+t.toString(36)}},{key:"mount",value:function(t,e){(t[u]||new f(t)).mount(Array.isArray(e)?e:[e])}}]),t}(),c=null,f=function(){function t(e){if(i(this,t),!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(c)return e.adoptedStyleSheets=[c.sheet].concat(e.adoptedStyleSheets),e[u]=c;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),c=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");var n=e.head||e;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],e[u]=this}return a(t,[{key:"mount",value:function(t){for(var e=this.sheet,n=0,r=0,i=0;i<t.length;i++){var o=t[i],a=this.modules.indexOf(o);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),e)for(var s=0;s<o.rules.length;s++)e.insertRule(o.rules[s],n++)}else{for(;r<a;)n+=this.modules[r++].rules.length;n+=o.rules.length,r++}}if(!e){for(var u="",l=0;l<this.modules.length;l++)u+=this.modules[l].getRules()+"\n";this.styleTag.textContent=u}}}]),t}()}}]);
  //# sourceMappingURL=chunk.4e6beec37a57a13ae7aa.js.map