diff --git a/app/vmselect/Makefile b/app/vmselect/Makefile index ffe7dd4ba..18ff48d2d 100644 --- a/app/vmselect/Makefile +++ b/app/vmselect/Makefile @@ -8,64 +8,64 @@ run-vmselect: $(MAKE) run-via-docker vmselect: - APP_NAME=vmselect $(MAKE) app-local + APP_NAME=vmselect $(MAKE) vmui app-local vmselect-race: - APP_NAME=vmselect RACE=-race $(MAKE) app-local + APP_NAME=vmselect RACE=-race $(MAKE) vmui app-local vmselect-prod: - APP_NAME=vmselect $(MAKE) app-via-docker + APP_NAME=vmselect $(MAKE) vmui app-via-docker vmselect-pure-prod: - APP_NAME=vmselect $(MAKE) app-via-docker-pure + APP_NAME=vmselect $(MAKE) vmui app-via-docker-pure vmselect-amd64-prod: - APP_NAME=vmselect $(MAKE) app-via-docker-amd64 + APP_NAME=vmselect $(MAKE) vmui app-via-docker-amd64 vmselect-arm-prod: - APP_NAME=vmselect $(MAKE) app-via-docker-arm + APP_NAME=vmselect $(MAKE) vmui app-via-docker-arm vmselect-arm64-prod: - APP_NAME=vmselect $(MAKE) app-via-docker-arm64 + APP_NAME=vmselect $(MAKE) vmui app-via-docker-arm64 vmselect-ppc64le-prod: - APP_NAME=vmselect $(MAKE) app-via-docker-ppc64le + APP_NAME=vmselect $(MAKE) vmui app-via-docker-ppc64le vmselect-386-prod: - APP_NAME=vmselect $(MAKE) app-via-docker-386 + APP_NAME=vmselect $(MAKE) vmui app-via-docker-386 vmselect-prod-race: - APP_NAME=vmselect RACE=-race $(MAKE) app-via-docker + APP_NAME=vmselect RACE=-race $(MAKE) vmui app-via-docker package-vmselect: - APP_NAME=vmselect $(MAKE) package-via-docker + APP_NAME=vmselect $(MAKE) vmui package-via-docker package-vmselect-race: - APP_NAME=vmselect RACE=-race $(MAKE) package-via-docker + APP_NAME=vmselect RACE=-race $(MAKE) vmui package-via-docker publish-vmselect: - APP_NAME=vmselect $(MAKE) publish-via-docker + APP_NAME=vmselect $(MAKE) vmui publish-via-docker publish-vmselect-race: - APP_NAME=vmselect RACE=-race $(MAKE) publish-via-docker + APP_NAME=vmselect RACE=-race $(MAKE) vmui publish-via-docker vmselect-amd64: - CGO_ENABLED=1 GOARCH=amd64 $(MAKE) vmselect-local-with-goarch + CGO_ENABLED=1 GOARCH=amd64 $(MAKE) vmui vmselect-local-with-goarch vmselect-arm: - CGO_ENABLED=0 GOARCH=arm $(MAKE) vmselect-local-with-goarch + CGO_ENABLED=0 GOARCH=arm $(MAKE) vmui vmselect-local-with-goarch vmselect-arm64: - CGO_ENABLED=0 GOARCH=arm64 $(MAKE) vmselect-local-with-goarch + CGO_ENABLED=0 GOARCH=arm64 $(MAKE) vmui vmselect-local-with-goarch vmselect-ppc64le: - CGO_ENABLED=0 GOARCH=ppc64le $(MAKE) vmselect-local-with-goarch + CGO_ENABLED=0 GOARCH=ppc64le $(MAKE) vmui vmselect-local-with-goarch vmselect-386: - CGO_ENABLED=0 GOARCH=386 $(MAKE) vmselect-local-with-goarch + CGO_ENABLED=0 GOARCH=386 $(MAKE) vmui vmselect-local-with-goarch vmselect-local-with-goarch: - APP_NAME=vmselect $(MAKE) app-local-with-goarch + APP_NAME=vmselect $(MAKE) vmui app-local-with-goarch vmselect-pure: - APP_NAME=vmselect $(MAKE) app-local-pure + APP_NAME=vmselect $(MAKE) vmui app-local-pure diff --git a/app/vmselect/main.go b/app/vmselect/main.go index 7306785f8..d9ad2f8ab 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -1,6 +1,7 @@ package main import ( + "embed" "errors" "flag" "fmt" @@ -29,6 +30,10 @@ import ( "github.com/VictoriaMetrics/metrics" ) +// static content +//go:embed ui +var files embed.FS + var ( httpListenAddr = flag.String("httpListenAddr", ":8481", "Address to listen for http connections") cacheDataPath = flag.String("cacheDataPath", "", "Path to directory for cache files. Cache isn't saved if empty") @@ -136,8 +141,13 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool { fmt.Fprintf(w, "vmselect - a component of VictoriaMetrics cluster. See docs at https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html") return true } + // ui access. + if strings.HasPrefix(r.URL.Path, "/ui") { + http.FileServer(http.FS(files)).ServeHTTP(w, r) + return true + } startTime := time.Now() - defer requestDuration.UpdateDuration(startTime) + defer requestDuration.UpdateDuration(startTime) // Limit the number of concurrent queries. select { case concurrencyCh <- struct{}{}: diff --git a/app/vmselect/ui/apple-touch-icon.png b/app/vmselect/ui/apple-touch-icon.png new file mode 100644 index 000000000..997096906 Binary files /dev/null and b/app/vmselect/ui/apple-touch-icon.png differ diff --git a/app/vmselect/ui/asset-manifest.json b/app/vmselect/ui/asset-manifest.json new file mode 100644 index 000000000..825daf711 --- /dev/null +++ b/app/vmselect/ui/asset-manifest.json @@ -0,0 +1,17 @@ +{ + "files": { + "main.css": "./static/css/main.0ba440d3.chunk.css", + "main.js": "./static/js/main.37569ff7.chunk.js", + "runtime-main.js": "./static/js/runtime-main.04462c68.js", + "static/js/2.644dfc9f.chunk.js": "./static/js/2.644dfc9f.chunk.js", + "static/js/3.1aaf74ff.chunk.js": "./static/js/3.1aaf74ff.chunk.js", + "index.html": "./index.html", + "static/js/2.644dfc9f.chunk.js.LICENSE.txt": "./static/js/2.644dfc9f.chunk.js.LICENSE.txt" + }, + "entrypoints": [ + "static/js/runtime-main.04462c68.js", + "static/js/2.644dfc9f.chunk.js", + "static/css/main.0ba440d3.chunk.css", + "static/js/main.37569ff7.chunk.js" + ] +} \ No newline at end of file diff --git a/app/vmselect/ui/favicon-32x32.png b/app/vmselect/ui/favicon-32x32.png new file mode 100644 index 000000000..7173be44c Binary files /dev/null and b/app/vmselect/ui/favicon-32x32.png differ diff --git a/app/vmselect/ui/index.html b/app/vmselect/ui/index.html new file mode 100644 index 000000000..491062fcd --- /dev/null +++ b/app/vmselect/ui/index.html @@ -0,0 +1 @@ +VM UI
\ No newline at end of file diff --git a/app/vmselect/ui/manifest.json b/app/vmselect/ui/manifest.json new file mode 100644 index 000000000..82c9590a3 --- /dev/null +++ b/app/vmselect/ui/manifest.json @@ -0,0 +1,20 @@ +{ + "short_name": "Victoria Metrics UI", + "name": "Victoria Metrics UI is a metric explorer for Victoria Metrics", + "icons": [ + { + "src": "favicon-32x32.png", + "sizes": "32x32", + "type": "image/png" + }, + { + "src": "apple-touch-icon.png", + "type": "image/png", + "sizes": "192x192" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/app/vmselect/ui/robots.txt b/app/vmselect/ui/robots.txt new file mode 100644 index 000000000..e9e57dc4d --- /dev/null +++ b/app/vmselect/ui/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/app/vmselect/ui/static/css/main.0ba440d3.chunk.css b/app/vmselect/ui/static/css/main.0ba440d3.chunk.css new file mode 100644 index 000000000..9d6ded082 --- /dev/null +++ b/app/vmselect/ui/static/css/main.0ba440d3.chunk.css @@ -0,0 +1 @@ +body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:10px 0!important}.cm-activeLine{background-color:inherit!important}.cm-wrap{border-radius:4px;border:1px solid #b9b9b9;font-size:10px}.one-line-scroll .cm-wrap{height:24px}.line{fill:none;stroke-width:2}.overlay{fill:none;pointer-events:all}.dot{fill:#621773;stroke:#fff} \ No newline at end of file diff --git a/app/vmselect/ui/static/js/2.644dfc9f.chunk.js b/app/vmselect/ui/static/js/2.644dfc9f.chunk.js new file mode 100644 index 000000000..aa6c8092a --- /dev/null +++ b/app/vmselect/ui/static/js/2.644dfc9f.chunk.js @@ -0,0 +1,2 @@ +/*! For license information please see 2.644dfc9f.chunk.js.LICENSE.txt */ +(this["webpackJsonpvictoria-metrics-ui"]=this["webpackJsonpvictoria-metrics-ui"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(334)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"composeDesc",value:function(e){return this.empty?e:e.empty?this:b(this,e)}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t)}},{key:"mapPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=c.Simple&&l>=e&&(n==c.TrackDel&&re||n==c.TrackBefore&&re))return-1;if(l>e||l==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=l}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"mapPosStable",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0,r=0,i=0,o=0;oe)return r+Math.max(0,e-n);i=r+=a}else{if(t<=0&&l>=e)return i;r+=s}n=l}return r}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&a>=e)return!(rt)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];return g(this,e,t,!0)}},{key:"invert",value:function(e){for(var t=this.sections.slice(),r=[],i=0,o=0;i=0){t[i]=s,t[i+1]=a;for(var c=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:g(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m(this,e,t)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new y(this);e:for(var a=0,s=0;;){for(var l=a==e.length?1e9:e[a++];s0&&v(r,t,o.text),o.forward(c),s+=c}for(var f=e[a++];s>1].toJSON()])}return e}},{key:"desc",get:function(){return new d(this.sections)}}],[{key:"of",value:function(e,t,i){var o=[],a=[],s=0,c=null;function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||o.length){sy||g<0||y>t)throw new RangeError("Invalid change range ".concat(g," to ").concat(y," (in doc of length ").concat(t,")"));var w=O?"string"==typeof O?l.a.of(O.split(i||f)):O:l.a.empty,k=w.length;if(g==y&&0==k)return;gs&&p(o,g-s,-1),p(o,y-g,k),v(a,o,w),s=y}}(e),u(!c),c}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){for(var t=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function v(e,t,n){if(0!=n.length){var r=t.length-2>>1;if(r>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],c=e.sections[a++];t(i,u,o,f,d),i=u,o=f}}}function g(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new y(e),s=new y(t),l=0,c=0;;)if(-1==a.ins)l+=a.len,a.next();else if(-1==s.ins&&c=0&&(a.done||cc&&!a.done&&l+a.len=0)){if(a.done&&s.done)return o?new h(i,o):new d(i);throw new Error("Mismatched change set lengths")}for(var f=0,m=l+a.len;;)if(s.ins>=0&&c>l&&c+s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new y(e),a=new y(t),s=!1;;){if(o.done&&a.done)return i?new h(r,i):new d(r);if(0==o.ins)p(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var l=Math.min(o.len2,a.len),c=r.length;if(-1==o.ins){var u=-1==a.ins?-1:a.off?0:a.ins;p(r,l,u,s),i&&u&&v(i,r,a.text)}else-1==a.ins?(p(r,o.off?0:o.len,l,s),i&&v(i,r,o.textBit(l))):(p(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&v(i,r,a.text));s=(o.ins>l||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}else p(r,0,a.ins,s),i&&v(i,r,a.text),a.next()}}var y=function(){function e(t){Object(a.a)(this,e),this.set=t,this.i=0,this.next()}return Object(s.a)(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return n>=t.length&&!e?l.a.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},{key:"done",get:function(){return-2==this.ins}},{key:"len2",get:function(){return this.ins<0?this.len:this.ins}},{key:"text",get:function(){var e=this.set.inserted,t=this.i-2>>1;return t>=e.length?l.a.empty:e[t]}}]),e}(),O=function(){function e(t,n,r){Object(a.a)(this,e),this.from=t,this.to=n,this.flags=r}return Object(s.a)(e,[{key:"map",value:function(t){var n=t.mapPos(this.from),r=t.mapPos(this.to);return n==this.from&&r==this.to?this:new e(n,r,this.flags)}},{key:"extend",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e<=this.anchor&&t>=this.anchor)return w.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return w.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}},{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return w.range(e.anchor,e.head)}}]),e}(),w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(a.a)(this,e),this.ranges=t,this.primaryIndex=n}return Object(s.a)(e,[{key:"map",value:function(t){return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t)})),this.primaryIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.primaryIndex!=e.primaryIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.primaryIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.primaryIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.primaryIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),primaryIndex:this.primaryIndex}}},{key:"primary",get:function(){return this.ranges[this.primaryIndex]}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.primaryIndex||t.primaryIndex>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return O.fromJSON(e)})),t.primaryIndex)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return new O(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!==r&&void 0!==r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!==n&&void 0!==n?n:33554431)<<5;return t1&&void 0!==arguments[1]?arguments[1]:0,n=e[t];e.sort((function(e,t){return e.from-t.from})),t=e.indexOf(n);for(var r=1;ri.head?w.range(s,a):w.range(a,s))}}return new w(e,t)}function x(e,t){var n,i=Object(r.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(o){i.e(o)}finally{i.f()}}var j=0,S=function(){function e(t,n,r,i){Object(a.a)(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=j++,this.default=t([])}return Object(s.a)(e,[{key:"of",value:function(e){return new E([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new E(e,this,2,t)}},{key:"from",value:function(e,t){var n=this;return function(r){return A(t,n.compute([r],(function(t){return e(t.field(r))})))}}},{key:"nFrom",value:function(e,t){var n=this;return function(r){return A(t,n.computeN([r],(function(t){return e(t.field(r))})))}}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:C),!!t.static)}}]),e}();function C(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var E=function(){function e(t,n,r,i){Object(a.a)(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=j++}return Object(s.a)(e,[{key:"dynamicSlot",value:function(e){var t,n=this.value,i=this.facet.compareInput,o=e[this.id]>>1,a=2==this.type,s=!1,l=!1,c=[],u=Object(r.a)(this.dependencies);try{for(u.s();!(t=u.n()).done;){var f=t.value;"doc"==f?s=!0:"selection"==f?l=!0:0==(1&e[f.id])&&c.push(e[f.id])}}catch(d){u.e(d)}finally{u.f()}return function(e,t){if(!t||t.reconfigure)return e.values[o]=n(e),1;if(!(s&&t.docChanged||l&&(t.docChanged||t.selection)||c.some((function(t){return(1&I(e,t))>0}))))return 0;var r=n(e),u=t.startState.values[o];return(a?function(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return function(e,n){var l,c=n?n.reconfigure?n.startState.config.address[t.id]:s<<1:null,u=null==c,f=Object(r.a)(a);try{for(f.s();!(l=f.n()).done;){1&I(e,l.value)&&(u=!0)}}catch(y){f.e(y)}finally{f.f()}if(!u)return 0;for(var d=[],h=0;h>1;return function(e,r){if(!r)return e.values[n]=t.createF(e),1;var i,o=0;if(r.reconfigure){var a=function(e,t){var n=e.config.address[t];return null==n?null:n>>1}(r.startState,t.id);i=null==a?t.createF(r.startState):r.startState.values[a],o=1}else i=r.startState.values[n];var s=t.updateF(i,r);return o||t.compareF(i,s)||(o=1),o&&(e.values[n]=s),o}}}],[{key:"define",value:function(t){var n=[],i=new e(j++,t.create,t.update,t.compare||function(e,t){return e===t},n);if(t.provide){var o,a=Object(r.a)(t.provide);try{for(a.s();!(o=a.n()).done;){var s=o.value;s instanceof S?n.push(s.compute([i],(function(e){return e.field(i)}))):n.push(s(i))}}catch(l){a.e(l)}finally{a.f()}}return i}}]),e}(),T={fallback:3,default:2,extend:1,override:0};function D(e,t){if(!T.hasOwnProperty(t))throw new RangeError("Invalid precedence: ".concat(t));return new _(e,T[t])}function A(e,t){return e?D(t,e):t}var _=function e(t,n){Object(a.a)(this,e),this.e=t,this.prec=n},R=function e(t,n){Object(a.a)(this,e),this.tag=t,this.extension=n};var N=function(){function e(t,n,r,i,o){for(Object(a.a)(this,e),this.source=t,this.replacements=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.create(null),o=arguments.length>2?arguments[2]:void 0,a=[],s=Object.create(null),l=Object(r.a)(L(t,i));try{for(l.s();!(n=l.n()).done;){var c=n.value;c instanceof P?a.push(c):(s[c.facet.id]||(s[c.facet.id]=[])).push(c)}}catch(b){l.e(b)}finally{l.f()}for(var u=Object.create(null),f=[],d=[],h=function(){var e=v[p];u[e.id]=d.length<<1,d.push((function(t){return e.slot(t)}))},p=0,v=a;p=s)return;var c=n[l].indexOf(e);c>-1&&n[l].splice(c,1)}if(i.set(e,s),Array.isArray(e)){var u,f=Object(r.a)(e);try{for(f.s();!(u=f.n()).done;){a(u.value,s)}}catch(d){f.e(d)}finally{f.f()}}else if(e instanceof R){if(e.tag in o)throw new RangeError("Duplicate use of tag '".concat(String(e.tag),"' in extensions"));o[e.tag]=!0,a(t[e.tag]||e.extension,s)}else e.extension?a(e.extension,s):e instanceof _?a(e.e,e.prec):(n[s].push(e),e instanceof P&&a(e.facets,s))}a(e,T.default);var s,l,c=Object(r.a)((l=t,(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l):[]).concat(Object.keys(l))));try{for(c.s();!(s=c.n()).done;){var u=s.value;!(u in o)&&"full"!=u&&t[u]&&(o[u]=!0,a(t[u],T.default))}}catch(f){c.e(f)}finally{c.f()}return n.reduce((function(e,t){return e.concat(t)}))}function I(e,t){if(1&t)return 2;var n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.config.dynamicSlots[n](e,e.applying);return e.status[n]=2|i}function z(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var $=S.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),Q=S.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),B=S.define(),F=S.define(),W=new u.c,H=S.define(),V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(a.a)(this,e),this.state=t,this.options=n}return Object(s.a)(e,[{key:"textAfterPos",value:function(e){var t,n,r=null===(t=this.options)||void 0===t?void 0:t.simulateBreak;return e==r&&(null===(n=this.options)||void 0===n?void 0:n.simulateDoubleBreak)?"":this.state.sliceDoc(e,Math.min(e+100,null!=r&&r>e?r:1e9,this.state.doc.lineAt(e).to))}},{key:"countColumn",value:function(e,t){return Object(l.d)(t<0?e:e.slice(0,t),0,this.state.tabSize)}},{key:"lineIndent",value:function(e){var t,n=null===(t=this.options)||void 0===t?void 0:t.overrideIndentation;if(n){var r=n(e.from);if(r>-1)return r}var i=e.slice(0,Math.min(100,e.length));return this.countColumn(i,i.search(/\S/))}},{key:"column",value:function(e){var t,n=this.state.doc.lineAt(e),r=n.slice(0,e-n.from),i=this.countColumn(r,e-n.from),o=(null===(t=this.options)||void 0===t?void 0:t.overrideIndentation)?this.options.overrideIndentation(n.from):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S/))),i}},{key:"unit",get:function(){return this.state.indentUnit}}]),e}(),q=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,null,[{key:"define",value:function(){return new U}}]),e}(),U=function(){function e(){Object(a.a)(this,e)}return Object(s.a)(e,[{key:"of",value:function(e){return new q(this,e)}}]),e}(),Y=function(){function e(t,n){Object(a.a)(this,e),this.type=t,this.value=n}return Object(s.a)(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return void 0===n?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(e){return this.type==e}}],[{key:"define",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new X(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,i=[],o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;){var a=n.value.map(t);a&&i.push(a)}}catch(s){o.e(s)}finally{o.f()}return i}}]),e}(),X=function(){function e(t){Object(a.a)(this,e),this.map=t}return Object(s.a)(e,[{key:"of",value:function(e){return new Y(this,e)}}]),e}(),K=function(){function e(t,n,r,i,o,s,l){Object(a.a)(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.reconfigure=s,this.scrollIntoView=l,this._doc=null,this._state=null,r&&x(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Object(s.a)(e,[{key:"annotation",value:function(e){var t,n=Object(r.a)(this.annotations);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.type==e)return i.value}}catch(o){n.e(o)}finally{n.f()}}},{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"docChanged",get:function(){return!this.changes.empty}}]),e}();function G(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;f--){var d=u[f](e);e=d instanceof K?d:Array.isArray(d)&&1==d.length&&d[0]instanceof K?d[0]:ee(n,Array.isArray(d)?d:[d],!1)}return e}(s):s}K.time=q.define(),K.userEvent=q.define(),K.addToHistory=q.define();var te,ne=[];!function(e){e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other"}(te||(te={}));var re,ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{re=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(le){}function oe(e){return function(t){if(!/\S/.test(t))return te.Space;if(function(e){if(re)return re.test(e);for(var t=0;t"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ie.test(n)))return!0}return!1}(t))return te.Word;for(var n=0;n-1)return te.Word;return te.Other}}var ae=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(Object(a.a)(this,e),this.config=t,this.doc=n,this.selection=r,this.applying=null,this.status=t.statusTemplate.slice(),i&&!i.reconfigure)this.values=i.startState.values.slice();else if(this.values=t.dynamicSlots.map((function(e){return null})),i)for(var o in t.address){var s=t.address[o],l=i.startState.config.address[o];null!=l&&0==(1&s)&&(this.values[s>>1]=z(i.startState,l))}this.applying=i,i&&(i._state=this);for(var c=0;c1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return I(this,n),z(this,n);if(t)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[];return t instanceof h?t:h.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return l.a.of(t.split(this.facet(e.lineSeparator)||f))}},{key:"sliceDoc",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.doc.length;return this.doc.sliceString(e,t,this.lineBreak)}},{key:"facet",value:function(e){var t=this.config.address[e.id];return null==t?e.default:(I(this,t),z(this,t))}},{key:"toJSON",value:function(){return{doc:this.sliceDoc(),selection:this.selection.toJSON()}}},{key:"indentString",value:function(t){var n="";if(9==this.facet(e.indentUnit).charCodeAt(0))for(;t>=this.tabSize;)n+="\t",t-=this.tabSize;for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");return e.create({doc:t.doc,selection:w.fromJSON(t.selection),extensions:n.extensions})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=N.resolve(t.extensions||[]),r=t.doc instanceof l.a?t.doc:l.a.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||f)),i=t.selection?t.selection instanceof w?t.selection:w.single(t.selection.anchor,t.selection.head):w.single(0);return x(i,r.length),n.staticFacet($)||(i=i.asSingle()),new e(n,r,i)}}]),e}();function se(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={},a=Object(r.a)(e);try{for(a.s();!(n=a.n()).done;)for(var s=n.value,l=0,c=Object.keys(s);l=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(44);function i(e,t){if(null==e)return{};var n,i,o=Object(r.a)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},O="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),w="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),k="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),x="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),j="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),S=O&&(x||+O[1]<57)||k&&x,C=0;C<10;C++)b[48+C]=b[96+C]=String(C);for(C=1;C<=24;C++)b[C+111]="F"+C;for(C=65;C<=90;C++)b[C]=String.fromCharCode(C+32),y[C]=String.fromCharCode(C);for(var E in b)y.hasOwnProperty(E)||(y[E]=b[E]);var M="undefined"!=typeof navigator?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],P=Object(h.a)(M,2),T=P[0],D=P[1],A=/Edge\/(\d+)/.exec(T.userAgent),_=/MSIE \d/.test(T.userAgent),R=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(T.userAgent),N=!!(_||R||A),L=!N&&/gecko\/(\d+)/i.test(T.userAgent),I=!N&&/Chrome\/(\d+)/.exec(T.userAgent),z="webkitFontSmoothing"in D.documentElement.style,$={mac:/Mac/.test(T.platform),ie:N,ie_version:_?D.documentMode||6:R?+R[1]:A?+A[1]:0,gecko:L,gecko_version:L?+(/Firefox\/(\d+)/.exec(T.userAgent)||[0,0])[1]:0,chrome:!!I,chrome_version:I?+I[1]:0,ios:!N&&/AppleWebKit/.test(T.userAgent)&&/Mobile\/\w+/.test(T.userAgent),android:/Android\b/.test(T.userAgent),webkit:z,safari:/Apple Computer/.test(T.vendor),webkit_version:z?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=D.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function Q(e){return e.getSelection?e.getSelection():document.getSelection()}function B(e,t){if(!t.anchorNode)return!1;try{return e.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)}catch(n){return!1}}function F(e){if(3==e.nodeType){var t=J();return t.setEnd(e,e.nodeValue.length),t.setStart(e,0),t.getClientRects()}return 1==e.nodeType?e.getClientRects():[]}function W(e,t,n,r){return!!n&&(V(e,t,n,r,-1)||V(e,t,n,r,1))}function H(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function V(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:q(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=H(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;e=e.childNodes[t+(i<0?-1:0)],t=i<0?q(e):0}}}function q(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function U(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Y(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var X,K=function(){function e(){Object(f.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(d.a)(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}}]),e}(),G=null;function Z(e){if(e.setActive)return e.setActive();if(G)return e.focus(G);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==G?{get preventScroll(){return G={preventScroll:!0},!0}}:void 0),!G){G=!1;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];Object(f.a)(this,e),this.node=t,this.offset=n,this.precise=r}return Object(d.a)(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,H(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,H(t)+1,n)}}]),e}(),te=[],ne=function(){function e(){Object(f.a)(this,e),this.parent=null,this.dom=null,this.dirty=2}return Object(d.a)(e,[{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=Object(u.a)(this.children);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i==e)return n;n+=i.length+i.breakAfter}}catch(o){r.e(o)}finally{r.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(e){return this.posBefore(e)+e.length}},{key:"coordsAt",value:function(e,t){return null}},{key:"sync",value:function(t){if(2&this.dirty){var n,r=this.dom,i=null,o=Object(u.a)(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||e.get(s)||a.reuseDOM(s),a.sync(t),a.dirty=0}t&&t.node==r&&i!=a.dom&&(t.written=!0),ie(r,i,a.dom),i=a.dom}}catch(h){o.e(h)}finally{o.f()}var l=i?i.nextSibling:r.firstChild;for(l&&t&&t.node==r&&(t.written=!0);l;)l=re(l)}else if(1&this.dirty){var c,f=Object(u.a)(this.children);try{for(f.s();!(c=f.n()).done;){var d=c.value;d.dirty&&(d.sync(t),d.dirty=0)}}catch(h){f.e(h)}finally{f.f()}}}},{key:"reuseDOM",value:function(e){return!1}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==q(t)?0:0==n?-1:1;;){var o=t.parentNode;if(o==this.dom)break;0==i&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var l=this.children[a];if(l.dom==r)return s;s+=l.length+l.breakAfter}}},{key:"domBoundsAround",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=-1,i=-1,o=-1,a=-1,s=0,l=n;st)return c.domBoundsAround(e,t,l);if(u>=e&&-1==r&&(r=s,i=l),u>=t&&-1==o){o=s,a=u;break}l=u+c.breakAfter}return{from:i,to:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o0&&void 0!==arguments[0]&&arguments[0];2&this.dirty||(this.dirty|=2,this.markParentsDirty(e))}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom=e,e.cmView=this}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:te;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new oe(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function re(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}function ie(e,t,n){var r=t?t.nextSibling:e.firstChild;if(n.parentNode==e)for(;r!=n;)r=re(r);else e.insertBefore(n,r)}ne.prototype.breakAfter=0;var oe=function(){function e(t,n,r){Object(f.a)(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Object(d.a)(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}(),ae=[],se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"become",value:function(e){return!1}},{key:"getSide",value:function(){return 0}}]),n}(ne);se.prototype.children=ae;var le=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).text=e,r}return Object(d.a)(n,[{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){return 3==e.nodeType&&(this.createDOM(e),!0)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"slice",value:function(e){return new n(this.text.slice(e))}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new ee(this.dom,e)}},{key:"domBoundsAround",value:function(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(e,t){return ue(this.dom,e,t,this.length)}},{key:"length",get:function(){return this.text.length}}]),n}(se),ce=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(f.a)(this,n),(r=t.call(this)).mark=e,r.children=o,r.length=a;var s,l=Object(u.a)(o);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.setParent(Object(i.a)(r))}}catch(d){l.e(d)}finally{l.f()}return r}return Object(d.a)(n,[{key:"createDOM",value:function(){var e=document.createElement(this.mark.tagName);if(this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(var t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);this.setDOM(e)}},{key:"sync",value:function(e){this.dom||this.createDOM(),Object(o.a)(Object(a.a)(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,o){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&i<=0||tt&&r.push(i=0?$.chrome||$.gecko||(t?(i--,a=1):(o++,a=-1)):n<0?i--:o++;var s=J();s.setEnd(e,o),s.setStart(e,i);var l=s.getBoundingClientRect();return a?U(l,a<0):l}var fe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o}return Object(d.a)(n,[{key:"slice",value:function(e){return n.create(this.widget,this.length-e,this.side)}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,o){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return r}},{key:"overrideDOMText",get:function(){if(0==this.length)return g.a.empty;for(var e=this;e.parent;)e=e.parent;var t=e.editorView,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):g.a.empty}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(se),de=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){return Object(f.a)(this,n),t.apply(this,arguments)}return Object(d.a)(n,[{key:"domAtPos",value:function(e){return new ee(this.widget.text,e)}},{key:"sync",value:function(){this.dom||this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){return t?3==e.nodeType?Math.min(t,this.length):this.length:0}},{key:"ignoreMutation",value:function(){return!1}},{key:"coordsAt",value:function(e,t){return ue(this.widget.text,e,t,this.length)}},{key:"overrideDOMText",get:function(){return null}}]),n}(fe);function he(e,t,n,r,i,o){var a,s=e.childCursor(),l=s.findPos(n,1),c=l.i,f=l.off,d=s.findPos(t,-1),h=d.i,p=d.off,v=t-n,m=Object(u.a)(r);try{for(m.s();!(a=m.n()).done;){v+=a.value.length}}catch(x){m.e(x)}finally{m.f()}e.length+=v;var g=e.children;if(h==c&&p){var b=g[h];if(1==r.length&&b.merge(p,f,r[0],i,o))return;if(0==r.length)return void b.merge(p,f,null,i,o);var y=b.slice(f);y.merge(0,0,r[r.length-1],0,o)?r[r.length-1]=y:r.push(y),c++,o=f=0}if(f){var O=g[c];r.length&&O.merge(0,f,r[r.length-1],0,o)?(r.pop(),o=0):O.merge(0,f,null,0,0)}else ci&&n0;r--){var s=t[r-1].dom;if(s.parentNode==e)return ee.after(s)}return new ee(e,0)}function ve(e,t,n){var r,i=e.children;n>0&&t instanceof ce&&i.length&&(r=i[i.length-1])instanceof ce&&r.mark.eq(t.mark)?ve(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function me(e,t,n){for(var r=0,i=0;i=t:a>t)return o.coordsAt(t-r,n);r=a}}return(e.dom.lastChild||e.dom).getBoundingClientRect()}function ge(e,t){for(var n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function be(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}},{key:"heightRelevant",get:function(){return!1}}],[{key:"mark",value:function(e){return new xe(e)}},{key:"widget",value:function(e){var t=e.side||0;return e.block&&(t+=200000001*(t>0?1:-1)),new Se(e,t,t,!!e.block,e.widget||null,!1)}},{key:"replace",value:function(e){var t=!!e.block,n=Ce(e),r=n.start,i=n.end;return new Se(e,t?-2e8*(r?2:1):1e8*(r?-1:1),t?2e8*(i?2:1):1e8*(i?1:-1),t,e.widget||null,!0)}},{key:"line",value:function(e){return new je(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return m.b.of(e,t)}}]),n}(m.d);ke.none=m.b.empty;var xe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;Object(f.a)(this,n);var i=Ce(e),o=i.start,a=i.end;return(r=t.call(this,1e8*(o?-1:1),1e8*(a?1:-1),null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Object(d.a)(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&be(this.attrs,e.attrs)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(e>=t)throw new RangeError("Mark decorations may not be empty");return Object(o.a)(Object(a.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(ke);xe.prototype.point=!1;var je=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,-1e8,-1e8,null,e)}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&be(this.spec.attributes,e.spec.attributes)}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return Object(o.a)(Object(a.a)(n.prototype),"range",this).call(this,e,t)}}]),n}(ke);je.prototype.mapMode=p.h.TrackBefore,je.prototype.point=!0;var Se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i,o,a,s){var l;return Object(f.a)(this,n),(l=t.call(this,r,i,a,e)).block=o,l.isReplace=s,l.mapMode=o?r<0?p.h.TrackBefore:p.h.TrackAfter:p.h.TrackDel,l}return Object(d.a)(n,[{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return Object(o.a)(Object(a.a)(n.prototype),"range",this).call(this,e,t)}},{key:"type",get:function(){return this.startSide=5}}]),n}(ke);function Ce(e){var t=e.inclusiveStart,n=e.inclusiveEnd;return null==t&&(t=e.inclusive),null==n&&(n=e.inclusive),{start:t||!1,end:n||!1}}Se.prototype.point=!0;function Ee(e,t,n){var r=n.length-1;r>=0&&n[r]+4>e?n[r]=Math.max(n[r],t):n.push(e,t)}var Me=p.f.define({combine:function(e){return e.join(" ")}}),Pe=p.f.define({combine:function(e){return e.indexOf(!0)>-1}}),Te=v.a.newName();function De(e){return e.replace(/\$\w[\w\.]*/g,(function(e){for(var t=e.slice(1).split("."),n="",r=1;r<=t.length;r++)n+=".cm-"+t.slice(0,r).join("-");return n}))}function Ae(e,t){return new v.a(t,{process:function(t){return t=De(t),/\$/.test(t)?t.replace(/\$/,e):e+" "+t},extend:function(t,n){return t=De(t),n.slice(0,e.length+1)==e+" "?e+" "+t.replace(/&/,n.slice(e.length+1)):t.replace(/&/,n)}})}function _e(e){if(e.indexOf(".")<0)return"cm-"+e;for(var t=e.split("."),n="",r=1;r<=t.length;r++)n+=(n?" ":"")+"cm-"+t.slice(0,r).join("-");return n}var Re,Ne=Ae("."+Te,{$:{position:"relative !important",boxSizing:"border-box","&$focused":{outline_fallback:"1px dotted #212121",outline:"5px auto -webkit-focus-ring-color"},display:"flex !important",flexDirection:"column"},$scroller:{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},$content:{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",boxSizing:"border-box",padding:"4px 0",outline:"none"},"$$light $content":{caretColor:"black"},"$$dark $content":{caretColor:"white"},$line:{display:"block",padding:"0 2px 0 4px"},$selectionLayer:{zIndex:-1,contain:"size style"},$selectionBackground:{position:"absolute"},"$$light $selectionBackground":{background:"#d9d9d9"},"$$dark $selectionBackground":{background:"#222"},"$$focused$light $selectionBackground":{background:"#d7d4f0"},"$$focused$dark $selectionBackground":{background:"#233"},$cursorLayer:{zIndex:100,contain:"size style",pointerEvents:"none"},"$$focused $cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},$cursor:{position:"absolute",borderLeft:"1.2px solid #aaa",marginLeft:"-0.6px",pointerEvents:"none"},"$$focused $cursor":{borderLeft:"1.2px solid black"},$placeholder:{color:"#888",display:"inline-block"},$button:{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"$$light $button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"$$dark $button":{backgroundImage:"linear-gradient(#555, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},$textfield:{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"$$light $textfield":{backgroundColor:"white"},"$$dark $textfield":{border:"1px solid #555",backgroundColor:"inherit"}}),Le=_e("line"),Ie=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(f.a)(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){if(r){if(!(r instanceof n))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),he(this,e,t,r?r.children:ze,o,a),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,o=r.off;o&&(t.append(this.children[i].slice(o),0),this.children[i].merge(o,this.children[i].length,null,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[i-1].parent=null,i--;return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(e){be(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){ve(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes;t&&(this.attrs=ge(t,this.attrs||{}))}},{key:"domAtPos",value:function(e){return pe(this.dom,this.children,e)}},{key:"sync",value:function(e){this.dom||(this.setDOM(document.createElement("div")),this.dom.className=Le,this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ye(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add(Le),this.prevAttrs=void 0),Object(o.a)(Object(a.a)(n.prototype),"sync",this).call(this,e);var t=this.dom.lastChild;if(!t||"BR"!=t.nodeName&&ne.get(t)instanceof fe){var r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof le))return null;var i=F(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(o){n.e(o)}finally{n.f()}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}}},{key:"coordsAt",value:function(e,t){return me(this,e,t)}},{key:"match",value:function(e){return!1}},{key:"type",get:function(){return Oe.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;;r++){var o=e.children[r],a=i+o.length;if(a>=t){if(o instanceof n)return o;if(o.length)return null}i=a+o.breakAfter}}}]),n}(ne),ze=[],$e=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o}return Object(d.a)(n,[{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t=0;n--)e=new ce(t[n],[e],e.length);return e}},{key:"buildText",value:function(e,t,n){for(;e>0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e);this.getLine().append(this.wrapMarks(new le(this.text.slice(this.textOff,this.textOff+s)),t),n),e-=s,this.textOff+=s}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i){var o=t-e;if(n instanceof Se)if(n.block){var a=n.type;a!=Oe.WidgetAfter||this.posCovered()||this.getLine(),this.addWidget(new $e(n.widget||new Be("div"),o,a))}else{var s=this.wrapMarks(fe.create(n.widget||new Be("span"),o,n.startSide),r);this.getLine().append(s,i)}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=i)}}],[{key:"build",value:function(t,n,r,i){var o=new e(t,n,r);return o.openEnd=m.b.spans(i,n,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(),o}}]),e}(),Be=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).tag=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(e){return e.nodeName.toLowerCase()==this.tag}}]),n}(we);!function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Re||(Re={}));var Fe=Re.LTR,We=Re.RTL;function He(e){for(var t=[],n=0;n=t){if(a.level==n)return o;(i<0||(0!=r?r<0?a.fromt:e[i].level>a.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}]),e}(),Xe=[];function Ke(e,t){var n,r=e.length,i=t==Fe?1:2;if(!e||1==i&&!Ue.test(e))return Ge(r);for(var o=0,a=i,s=i;ox;){for(var C=S,E=2!=Xe[--S];S>x&&E==(2!=Xe[S-1]);)S--;w.push(new Ye(S,C,E?2:1))}else w.push(new Ye(x,k,0))}else for(var M=0;M-1!=this.lineWrapping||this.direction!=n}},{key:"refresh",value:function(e,t,n,r,i,o){var a=tt.indexOf(e)>-1,s=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a||this.direction!=t;if(this.lineWrapping=a,this.direction=t,this.lineHeight=n,this.charWidth=r,this.lineLength=i,s){this.heightSamples={};for(var l=0;l2&&void 0!==arguments[2]?arguments[2]:2;Object(f.a)(this,e),this.length=t,this.height=n,this.flags=r}return Object(d.a)(e,[{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>1e-4&&(e.heightChanged=!0),this.height=t)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(this)}},{key:"decomposeRight",value:function(e,t){t.push(this)}},{key:"applyChanges",value:function(e,t,n,r){for(var i=this,o=r.length-1;o>=0;o--){var a=r[o],s=a.fromA,l=a.toA,c=a.fromB,u=a.toB,f=i.lineAt(s,et.ByPosNoHeight,t,0,0),d=f.to>=l?f:i.lineAt(l,et.ByPosNoHeight,t,0,0);for(u+=d.to-l,l=d.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,c=r[o-1].fromB,o--,s0},set:function(e){this.flags=(e?2:0)|-3&this.flags}}],[{key:"empty",value:function(){return new st(0,0)}},{key:"of",value:function(t){if(1==t.length)return t[0];for(var n=0,r=t.length,i=0,o=0;;)if(n==r)if(i>2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>3?arguments[3]:void 0;return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(ot),st=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this,e,r,Oe.Text)).collapsed=0,i.widgetHeight=0,i}return Object(d.a)(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof lt&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof lt?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):ot.of(r)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(at),lt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){return Object(f.a)(this,n),t.call(this,e,0)}return Object(d.a)(n,[{key:"lines",value:function(e,t){var n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}},{key:"blockAt",value:function(e,t,n,r){var i=this.lines(t,r),o=i.firstLine,a=i.lastLine,s=i.lineHeight,l=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),c=t.line(o+l),u=c.from,f=c.length;return new it(u,f,n+s*l,s,Oe.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==et.ByHeight)return this.blockAt(e,n,r,i);if(t==et.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new it(a,s-a,0,0,Oe.Text)}var l=this.lines(n,i),c=l.firstLine,u=l.lineHeight,f=n.lineAt(e),d=f.from,h=f.length,p=f.number;return new it(d,h,r+u*(p-c),u,Oe.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,l=a.lineHeight,c=e;c0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(e>0){var a=r[0];a instanceof n?r[0]=new n(e+a.length):r.unshift(new n(e-1),null)}return ot.of(r)}},{key:"decomposeLeft",value:function(e,t){t.push(new n(e-1),null)}},{key:"decomposeRight",value:function(e,t){t.push(null,new n(this.length-e-1))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=t+this.length;if(i&&i.from<=t+this.length&&i.more){var a=[],s=Math.max(t,i.from);for(i.from>t&&a.push(new n(i.from-t-1).updateHeight(e,t));s<=o&&i.more;){var l=e.doc.lineAt(s).length;a.length&&a.push(null);var c=new st(l,i.heights[i.index++]);c.outdated=!1,a.push(c),s+=l+1}return s<=o&&a.push(null,new n(o-s).updateHeight(e,s)),e.heightChanged=!0,ot.of(a)}return(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(ot),ct=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r,i){var o;return Object(f.a)(this,n),(o=t.call(this,e.length+r+i.length,e.height+i.height,r|(e.outdated||i.outdated?2:0))).left=e,o.right=i,o.size=e.size+i.size,o}return Object(d.a)(n,[{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return ea))return l;var c=t==et.ByPosNoHeight?et.ByPosNoHeight:et.ByPos;return s?l.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,i).join(l)}},{key:"forEachLine",value:function(e,t,n,r,i,o){var a=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,t,n,a,s,o);else{var l=this.lineAt(s,et.ByPos,n,r,i);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,a,s,o)}}},{key:"replace",value:function(e,t,n){var r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));var i=[];e>0&&this.decomposeLeft(e,i);var o,a=i.length,s=Object(u.a)(n);try{for(s.s();!(o=s.n()).done;){var l=o.value;i.push(l)}}catch(f){s.e(f)}finally{s.f()}if(e>0&&ut(i,a-1),t=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}},{key:"decomposeRight",value:function(e,t){var n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?ot.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}},{key:"break",get:function(){return 1&this.flags}}]),n}(ot);function ut(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof lt&&(r=e[t+1])instanceof lt&&e.splice(t-1,3,new lt(n.length+1+r.length))}var ft=function(){function e(t,n){Object(f.a)(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Object(d.a)(e,[{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof st?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new st(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}},{key:"point",value:function(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)){var e=this.oracle.doc.lineAt(this.pos),t=e.from,n=e.to;this.lineStart=t,this.lineEnd=n,this.writtenTot&&this.nodes.push(new st(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new lt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}},{key:"ensureLine",value:function(){this.enterLine();var e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof st)return e;var t=new st(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=Oe.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=Oe.WidgetBefore&&(this.covering=e)}},{key:"addLineDeco",value:function(e,t){var n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}},{key:"finish",value:function(e){var t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof st||this.isCovered?(this.writtenTo0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;o+=2}if(!l)return r;new e(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}]),e}(),Lt=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pt;Object(f.a)(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.prevState=t.state,this.changes=p.b.empty(this.prevState.doc.length);var i,o=Object(u.a)(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(c){o.e(c)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new Nt(e,t,n,r))})),this.changedRanges=s;var l=t.hasFocus;l!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=l,this.flags),this.docChanged&&(this.flags|=2)}return Object(d.a)(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(18&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return this.transactions.some((function(e){return e.docChanged}))}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}]),e}();var It=function(){function e(t,n,r){Object(f.a)(this,e),this.from=t,this.to=n,this.size=r}return Object(d.a)(e,[{key:"draw",value:function(e){return ke.replace({widget:new zt(this.size,e)}).range(this.from,this.to)}}],[{key:"same",value:function(e,t){if(e.length!=t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=this.state;this.state=e.state;var r=this.state.facet(_t),i=e.changedRanges,o=Nt.extendWithRanges(i,dt(e.prevState.facet(_t),r,e?e.changes:p.b.empty(this.state.doc.length))),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(r,n.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(e.flags|=2);var s=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t)),s.eq(this.viewport)||(this.viewport=s,e.flags|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(e.flags|=this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes)))),this.computeVisibleRanges(),t&&(this.scrollTo=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.primary.empty&&e.state.selection.primary.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e,t){var n=e.dom,r="",i=Re.LTR;if(!t){var o=window.getComputedStyle(n);r=o.whiteSpace,i="rtl"==o.direction?Re.RTL:Re.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(e,t){for(var n=e.getBoundingClientRect(),r=Math.max(0,n.left),i=Math.min(innerWidth,n.right),o=Math.max(0,n.top),a=Math.min(innerHeight,n.bottom),s=e.parentNode;s;)if(1==s.nodeType){if((s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth)&&"visible"!=window.getComputedStyle(s).overflow){var l=s.getBoundingClientRect();r=Math.max(r,l.left),i=Math.min(i,l.right),o=Math.max(o,l.top),a=Math.min(a,l.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+t),bottom:a-(n.top+t)}}(n,this.paddingTop),s=a.top-this.pixelViewport.top,l=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 c=e.measureVisibleLineHeights(),u=!1,f=0,d=0,h=this.heightOracle;if(!t){var p=e.dom.clientWidth;if(h.mustRefresh(c,r,i)||h.lineWrapping&&Math.abs(p-this.contentWidth)>h.charWidth){var v=e.measureTextSize(),m=v.lineHeight,g=v.charWidth;(u=h.refresh(r,i,m,g,p/g,c))&&(e.minWidth=0,d|=16)}this.contentWidth!=p&&(this.contentWidth=p,d|=16),s>0&&l>0?f=Math.max(s,l):s<0&&l<0&&(f=Math.min(s,l))}return h.heightChanged=!1,this.heightMap=this.heightMap.updateHeight(h,0,u,new rt(this.viewport.from,c)),h.heightChanged&&(d|=2),(!this.viewportIsAppropriate(this.viewport,f)||this.scrollTo&&(this.scrollTo.headthis.viewport.to))&&(this.viewport=this.getViewport(f,this.scrollTo),d|=4),(this.lineGaps.length||this.viewport.to-this.viewport.from>15e3)&&(d|=this.updateLineGaps(this.ensureLineGaps(u?[]:this.lineGaps))),this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.enforceCursorAssoc()),d}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.pixelViewport,a=o.top,s=o.bottom,l=new Qt(r.lineAt(a-1e3*n,et.ByHeight,i,0,0).from,r.lineAt(s+1e3*(1-n),et.ByHeight,i,0,0).to);if(t)if(t.headl.to){var u=r.lineAt(t.head,et.ByPos,i,0,0).bottom;l=new Qt(r.lineAt(u-(s-a)-500,et.ByHeight,i,0,0).from,r.lineAt(u+500,et.ByHeight,i,0,0).to)}return l}},{key:"mapViewport",value:function(e,t){var n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Qt(this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(r,et.ByPos,this.state.doc,0,0).to)}},{key:"viewportIsAppropriate",value:function(e){var t=e.from,n=e.to,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.heightMap.lineAt(t,et.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,et.ByPos,this.state.doc,0,0),s=a.bottom;return(0==t||o<=this.pixelViewport.top-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=this.pixelViewport.bottom+Math.max(10,Math.min(r,250)))&&o>this.pixelViewport.top-2e3&&si&&(r.push({from:i,to:e}),o+=e-i),i=t},minPointSize:20}),i=r.from&&(o=l.from),l.from<=r.to&&l.to>=a&&(a=l.to);var c=o-1e4,u=a+1e4;c>r.from+5e3&&n.push(Wt(e,(function(e){return e.from==r.from&&e.to>c-5e3&&e.tou-5e3&&e.from=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,l=a.to-s;if(i<=l)return s+i;i-=l}}function Ft(e,t){var n,r=0,i=Object(u.a)(e.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(t<=s){r+=t-a;break}r+=s-a}}catch(l){i.e(l)}finally{i.f()}return r/e.total}function Wt(e,t){var n,r=Object(u.a)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t(i))return i}}catch(o){r.e(o)}finally{r.f()}}var Ht=[],Vt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).view=e,r.viewports=Ht,r.compositionDeco=ke.none,r.decorations=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.setDOM(e.contentDOM),r.children=[new Ie],r.children[0].setParent(Object(i.a)(r)),r.updateInner([new Nt(0,0,0,e.state.doc.length)],r.updateDeco(),0),r}return Object(d.a)(n,[{key:"update",value:function(e){var t,n=this,r=e.changedRanges;this.minWidth>0&&r.length&&(r.every((function(e){var t=e.fromA;return e.toAn.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),(null===(t=this.view.inputState)||void 0===t?void 0:t.composing)?e.transactions.length&&(this.compositionDeco=function(e,t){var n=Q(e.root),r=n.focusNode&&Xt(n.focusNode,n.focusOffset,0);if(!r)return ke.none;var i,o,a=e.docView.nearest(r),s=r;if(a instanceof se){for(;a.parent instanceof se;)a=a.parent;o=(i=a.posAtStart)+a.length,s=a.dom}else{if(!(a instanceof Ie))return ke.none;for(;s.parentNode!=a.dom;)s=s.parentNode;for(var l=s.previousSibling;l&&!ne.get(l);)l=l.previousSibling;i=o=l?ne.get(l).posAtEnd:a.posAtStart}var c=t.mapPos(i,1),u=Math.max(c,t.mapPos(o,-1)),f=r.nodeValue,d=e.state;if(u-c=this.view.viewport.from&&e.state.selection.primary.to<=this.view.viewport.to?(this.updateSelection(i,l),!1):(this.updateInner(r,a,e.prevState.doc.length,i,l),!0)}},{key:"updateInner",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.updateChildren(e,t,n),this.view.observer.ignore((function(){r.dom.style.height=r.view.viewState.heightMap.height+"px",r.dom.style.minWidth=r.minWidth?r.minWidth+"px":"";var e=$.chrome?{node:Q(r.view.root).focusNode,written:!1}:void 0;r.sync(e),r.dirty=0,(null===e||void 0===e?void 0:e.written)&&(i=!0),r.updateSelection(i,o),r.dom.style.height=""}))}},{key:"updateChildren",value:function(e,t,n){for(var r=this.childCursor(n),i=e.length-1;;i--){var o=i>=0?e[i]:null;if(!o)break;var a=o.fromA,s=o.toA,l=o.fromB,c=o.toB,u=Qe.build(this.view.state.doc,l,c,t),f=u.content,d=u.breakAtStart,h=u.openStart,p=u.openEnd,v=r.findPos(s,1),m=v.i,g=v.off,b=r.findPos(a,-1),y=b.i,O=b.off;this.replaceRange(y,O,m,g,f,d,h,p)}}},{key:"replaceRange",value:function(e,t,n,r,i,o,a,s){var l=this.children[e],c=i.length?i[i.length-1]:null,u=c?c.breakAfter:o;if(e!=n||o||u||!(i.length<2)||!l.merge(t,r,i.length?c:null,0==t,a,s)){var f=this.children[n];for(r0&&(!o&&i.length&&l.merge(t,l.length,i[0],!1,a,0)?l.breakAfter=i.shift().breakAfter:(t0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t||this.mayControlSelection()){var n=this.view.state.selection.primary,r=this.domAtPos(n.anchor),i=this.domAtPos(n.head),o=Q(this.root);(e||!o.focusNode||$.gecko&&n.empty&&Kt(o.focusNode,o.focusOffset)||!W(r.node,r.offset,o.anchorNode,o.anchorOffset)||!W(i.node,i.offset,o.focusNode,o.focusOffset))&&this.view.observer.ignore((function(){if(n.empty){if($.gecko){var e=Kt(r.node,r.offset);if(e&&3!=e){var t=Xt(r.node,r.offset,1==e?1:-1);t&&(r=new ee(t,1==e?0:t.nodeValue.length))}}o.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=o.cursorBidiLevel&&(o.cursorBidiLevel=n.bidiLevel)}else if(o.extend)o.collapse(r.node,r.offset),o.extend(i.node,i.offset);else{var a=document.createRange();if(n.anchor>n.head){var s=[i,r];r=s[0],i=s[1]}a.setEnd(i.node,i.offset),a.setStart(r.node,r.offset),o.removeAllRanges(),o.addRange(a)}})),this.impreciseAnchor=r.precise?null:new ee(o.anchorNode,o.anchorOffset),this.impreciseHead=i.precise?null:new ee(o.focusNode,o.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){var e=this.view.state.selection.primary,t=Q(this.root);if(e.empty&&e.assoc&&t.modify){var n=Ie.find(this,e.head);if(n){var r=n.posAtStart;if(e.head!=r&&e.head!=r+n.length){var i=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(i&&o&&!(i.bottom>o.top)){var a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}}}}}},{key:"mayControlSelection",value:function(){return this.view.state.facet(kt)?this.root.activeElement==this.dom:B(this.dom,Q(this.root))}},{key:"nearest",value:function(e){for(var t=e;t;){var n=ne.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;n=o&&i.type!=Oe.WidgetAfter)return i.coordsAt(e-o,t);n=o}}},{key:"measureVisibleLineHeights",value:function(){for(var e=[],t=this.view.viewState.viewport,n=t.from,r=t.to,i=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=0,a=0;ar)break;if(o>=n){e.push(s.dom.getBoundingClientRect().height);var c=s.dom.scrollWidth;c>i&&(this.minWidth=i=c,this.minWidthFrom=o,this.minWidthTo=l)}o=l+s.breakAfter}return e}},{key:"measureTextSize",value:function(){var e,t=this,n=Object(u.a)(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof Ie){var i=r.measureTextSize();if(i)return i}}}catch(l){n.e(l)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=F(s.firstChild)[0];o=s.getBoundingClientRect().height,a=e?e.width/27:7,s.remove()})),{lineHeight:o,charWidth:a}}},{key:"childCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length,t=this.children.length;return t&&(e-=this.children[--t].length),new oe(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){var e=this.view.viewState.viewport,t=[e],n=this.view.state.selection.primary,r=n.head,i=n.anchor;if(re.to){var o=this.view.viewState.lineAt(r,0),a=o.from,s=o.to;t.push(new Qt(a,s))}if(!t.some((function(e){var t=e.from,n=e.to;return i>=t&&i<=n}))){var l=this.view.viewState.lineAt(i,0),c=l.from,u=l.to;t.push(new Qt(c,u))}this.viewports=t.sort((function(e,t){return e.from-t.from}));for(var f=[],d=0,h=0;;h++){var p=h==t.length?null:t[h],v=p?p.from-1:this.length;if(v>d){var m=this.view.viewState.lineAt(v,0).bottom-this.view.viewState.lineAt(d,0).top;f.push(ke.replace({widget:new Ut(m),block:!0,inclusive:!0}).range(d,v))}if(!p)break;d=p.to+1}return ke.set(f)}},{key:"updateDeco",value:function(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco].concat(Object(c.a)(this.view.state.facet(_t)),Object(c.a)(this.view.pluginField(Mt)))}},{key:"scrollPosIntoView",value:function(e,t){var n=this.coordsAt(e,t);if(n){var r,i=0,o=0,a=0,s=0,l=Object(u.a)(this.view.pluginField(jt.scrollMargins));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c){var f=c.left,d=c.right,h=c.top,p=c.bottom;null!=f&&(i=Math.max(i,f)),null!=d&&(o=Math.max(o,d)),null!=h&&(a=Math.max(a,h)),null!=p&&(s=Math.max(s,p))}}}catch(v){l.e(v)}finally{l.f()}!function(e,t){for(var n=e.ownerDocument.defaultView,r=e.parentNode;r;)if(1==r.nodeType){var i=void 0,o=r==document.body;if(o)i=Y(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,l=0;if(t.topi.bottom&&(l=t.bottom-i.bottom+5),t.lefti.right&&(s=t.right-i.right+5),s||l)if(o)n.scrollBy(s,l);else{if(l){var c=r.scrollTop;r.scrollTop+=l,l=r.scrollTop-c}if(s){var u=r.scrollLeft;r.scrollLeft+=s,s=r.scrollLeft-u}t={left:t.left-s,top:t.top-l,right:t.right-s,bottom:t.bottom-l}}if(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}(ne),qt=1e7,Ut=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).height=e,r}return Object(d.a)(n,[{key:"toDOM",value:function(){var e=document.createElement("div");return this.updateDOM(e),e}},{key:"eq",value:function(e){return e.height==this.height}},{key:"updateDOM",value:function(e){if(this.height0;t-=qt){e.appendChild(document.createElement("div")).style.height=Math.min(t,qt)+"px"}}return!0}},{key:"estimatedHeight",get:function(){return this.height}}]),n}(we);var Yt=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).top=e,i.text=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return this.top==e.top&&this.text==e.text}},{key:"toDOM",value:function(){return this.top}},{key:"ignoreEvent",value:function(){return!1}},{key:"customView",get:function(){return de}}]),n}(we);function Xt(e,t,n){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0&&n<=0)t=q(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function Kt(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(te?t.left-e:Math.max(0,e-t.right)}function Jt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function en(e,t){return e.topt.top+1}function tn(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function rn(e,t,n){for(var r,i,o,a,s,l,c,u,f=e.firstChild;f;f=f.nextSibling)for(var d=F(f),h=0;hm||a==m&&o>v)&&(r=f,i=p,o=v,a=m),0==v?n>p.bottom&&(!c||c.bottomp.top)&&(l=f,u=p):c&&en(c,p)?c=nn(c,p.bottom):u&&en(u,p)&&(u=tn(u,p.top))}if(c&&c.bottom>=n?(r=s,i=c):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};var g=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?on(r,g,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:rn(r,g,n)}function on(e,t,n){for(var r=e.nodeValue.length,i=J(),o=0;o=t&&l.top-1<=n&&l.bottom+1>=n)){var c=t>=(l.left+l.right)/2,u=c;if($.chrome||$.gecko)i.setEnd(e,o),i.getBoundingClientRect().left==l.right&&(u=!c);return{node:e,offset:o+(u?1:0)}}}}return{node:e,offset:0}}function an(e,t){for(var n,r=t.x,i=t.y,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,a=e.contentDOM.getBoundingClientRect(),s=e.defaultLineHeight/2,l=!1;;){if((n=e.blockAtHeight(i,a.top)).top>i||n.bottomi?-1:1,i=Math.min(n.bottom-s,Math.max(n.top+s,i)),l)return-1;l=!0}if(n.type==Oe.Text)break;i=o>0?n.bottom+s:n.top-s}var c=n.from;if(ce.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:-1;r=Math.max(a.left+1,Math.min(a.right-1,r));var u,f=e.root,d=f.elementFromPoint(r,i),h=-1;if(d&&e.contentDOM.contains(d)&&!(e.docView.nearest(d)instanceof fe))if(f.caretPositionFromPoint){var p=f.caretPositionFromPoint(r,i);p&&(u=p.offsetNode,h=p.offset)}else if(f.caretRangeFromPoint){var v=f.caretRangeFromPoint(r,i);v&&(u=v.startContainer,h=v.startOffset)}if(!u||!e.docView.dom.contains(u)){var m=Ie.find(e.docView,c),g=rn(m.dom,r,i);u=g.node,h=g.offset}return e.docView.posFromDOM(u,h)}function sn(e,t,n,r){var i=e.state.doc.lineAt(t.head),o=r&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){var a=e.dom.getBoundingClientRect(),s=e.posAtCoords({x:n==(e.textDirection==Re.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(s>-1)return p.d.cursor(s,n?-1:1)}var l=Ie.find(e.docView,t.head),c=l?n?l.posAtEnd:l.posAtStart:n?i.to:i.from;return p.d.cursor(c,n?-1:1)}function ln(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=t,s=null;;){var l=Je(i,o,e.textDirection,a,n),c=Ze;if(!l){if(i.number==(n?e.state.doc.lines:1))return a;c="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),l=p.d.cursor(n?i.from:i.to)}if(s){if(!s(c))return a}else{if(!r)return l;s=r(c)}a=l}}var cn=function(){function e(t){var n=this;Object(f.a)(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=!1,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(e){var r=dn[e];t.contentDOM.addEventListener(e,(function(i){fn(t,i)&&!n.ignoreDuringComposition(i)&&(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i))})),n.registeredEvents.push(e)};for(var i in dn)r(i);t.contentDOM.addEventListener("keydown",(function(e){t.inputState.lastKeyCode=e.keyCode,t.inputState.lastKeyTime=Date.now()})),this.notifiedFocused=t.hasFocus,this.ensureHandlers(t)}return Object(d.a)(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e){var t,n=this,r=this.customHandlers=e.pluginField(Pt),i=Object(u.a)(r);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=function(t){n.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(n.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(r){fn(e,r)&&n.runCustomHandlers(t,e,r)&&r.preventDefault()})))};for(var s in o.handlers)a(s)}}catch(l){i.e(l)}finally{i.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=Object(u.a)(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers[e];if(a)try{if(a.call(o.plugin,n,t)||n.defaultPrevented)return!0}catch(s){wt(t.state,s)}}}catch(l){i.e(l)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){var n,r=Object(u.a)(this.customHandlers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.handlers.scroll;if(o)try{o.call(i.plugin,t,e)}catch(a){wt(e.state,a)}}}catch(s){r.e(s)}finally{r.f()}}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(!!this.composing||!!($.safari&&e.timeStamp-this.compositionEndedAt<500)&&(this.compositionEndedAt=0,!0))}},{key:"mustFlushObserver",value:function(e){return"keydown"==e.type||"compositionend"==e.type}},{key:"startMouseSelection",value:function(e,t,n){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=new un(this,e,t,n)}},{key:"update",value:function(e){this.mouseSelection&&this.mouseSelection.update(e),this.lastKeyCode=this.lastSelectionTime=0}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),un=function(){function e(t,n,r,i){Object(f.a)(this,e),this.inputState=t,this.view=n,this.startEvent=r,this.style=i;var o=n.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=r.shiftKey,this.multiple=n.state.facet(p.e.allowMultipleSelections)&&function(e,t){var n=e.state.facet(vt);return n.length?n[0](t):$.mac?t.metaKey:t.ctrlKey}(n,r),this.dragMove=function(e,t){var n=e.state.facet(mt);return n.length?n[0](t):$.mac?!t.altKey:!t.ctrlKey}(n,r),this.dragging=!!function(e,t){if(e.state.selection.primary.empty)return!1;var n=Q(e.root);if(0==n.rangeCount)return!0;for(var r=n.getRangeAt(0).getClientRects(),i=0;i=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}(n,r)&&null,!1===this.dragging&&(r.preventDefault(),this.select(r))}return Object(d.a)(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.startEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);t.eq(this.view.state.selection)&&t.primary.assoc==this.view.state.selection.primary.assoc||this.view.dispatch({selection:t,annotations:p.l.userEvent.of("pointerselection"),scrollIntoView:!0})}},{key:"update",value:function(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)}}]),e}();function fn(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=ne.get(r))&&n.ignoreEvent(t))return!1;return!0}var dn=Object.create(null),hn=$.ie&&$.ie_version<15||$.ios&&$.webkit_version<604;function pn(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length;n=xn&&r.selection.ranges.every((function(e){return e.empty}))&&xn==o.toString()?{changes:r.selection.ranges.map((function(e){return r.doc.lineAt(e.from)})).filter((function(e,t,n){return 0==t||n[t-1]!=e})).map((function(e){return{from:e.from,insert:(a?o.line(i++).slice():t)+r.lineBreak}}))}:a?r.changeByRange((function(e){var t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.slice()},range:p.d.cursor(e.from+t.length)}})):r.replaceSelection(o),e.dispatch(n,{annotations:p.l.userEvent.of("paste"),scrollIntoView:!0})}function vn(e,t,n,r){if(1==r)return p.d.cursor(t,n);if(2==r)return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return p.d.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=i.findClusterBreak(o,!1):s=i.findClusterBreak(o,!0);for(var l=r(i.slice(a,s));a>0;){var c=i.findClusterBreak(a,!1);if(r(i.slice(c,a))!=l)break;a=c}for(;sDate.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(kn+1)%3:1}(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.changes&&(n&&(n.pos=e.changes.mapPos(n.pos)),i=i.map(e.changes))},get:function(t,s,l){var c;if(t.clientX==a.clientX&&t.clientY==a.clientY?c=o:(c=o=yn(e,t),a=t),!c||!n)return i;var u=vn(e,c.pos,c.bias,r);if(n.pos!=c.pos&&!s){var f=vn(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d=t.top&&e<=t.bottom},gn=function(e,t,n){return mn(t,n)&&e>=n.left&&e<=n.right};function bn(e,t,n,r){var i=Ie.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&gn(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&gn(n,r,s)?1:a&&mn(r,a)?-1:1}function yn(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY});return n<0?null:{pos:n,bias:bn(e,n,t.clientX,t.clientY)}}var On=$.ie&&$.ie_version<=11,wn=null,kn=0;dn.dragstart=function(e,t){var n=e.state.selection.primary,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},dn.drop=function(e,t){if(t.dataTransfer){var n=e.posAtCoords({x:t.clientX,y:t.clientY}),r=t.dataTransfer.getData("Text");if(!(n<0)&&r){t.preventDefault();var i=e.inputState.mouseSelection,o=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,a={from:n,insert:r},s=e.state.changes(o?[o,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(n,-1),head:s.mapPos(n,1)},annotations:p.l.userEvent.of("drop")})}}},dn.paste=function(e,t){e.observer.flush();var n=hn?null:t.clipboardData,r=n&&n.getData("text/plain");r?(pn(e,r),t.preventDefault()):function(e){var t=e.dom.parentNode;if(t){var n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((function(){e.focus(),n.remove(),pn(e,n.value)}),50)}}(e)};var xn=null;function jn(e){e.docView.compositionDeco.size&&e.update([])}dn.copy=dn.cut=function(e,t){var n=function(e){var t,n=[],r=[],i=!1,o=Object(u.a)(e.selection.ranges);try{for(o.s();!(t=o.n()).done;){var a=t.value;a.empty||(n.push(e.sliceDoc(a.from,a.to)),r.push(a))}}catch(h){o.e(h)}finally{o.f()}if(!n.length){var s,l=-1,c=Object(u.a)(e.selection.ranges);try{for(c.s();!(s=c.n()).done;){var f=s.value.from,d=e.doc.lineAt(f);d.number>l&&(n.push(d.slice()),r.push({from:d.from,to:Math.min(e.doc.length,d.to+1)})),l=d.number}}catch(h){c.e(h)}finally{c.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r){xn=o?r:null;var a=hn?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"==t.type&&e.dispatch({changes:i,scrollIntoView:!0,annotations:p.l.userEvent.of("cut")})}},dn.focus=dn.blur=function(e){setTimeout((function(){e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)},dn.beforeprint=function(e){e.viewState.printing=!0,e.requestMeasure(),setTimeout((function(){e.viewState.printing=!1,e.requestMeasure()}),2e3)},dn.compositionstart=dn.compositionupdate=function(e){e.inputState.composing||(e.docView.compositionDeco.size&&(e.observer.flush(),jn(e)),e.inputState.composing=!0)},dn.compositionend=function(e){e.inputState.composing=!1,e.inputState.compositionEndedAt=Date.now(),setTimeout((function(){e.inputState.composing||jn(e)}),50)};var Sn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},Cn=$.ie&&$.ie_version<=11,En=function(){function e(t,n,r){var i=this;Object(f.a)(this,e),this.view=t,this.onChange=n,this.onScrollChanged=r,this.active=!1,this.ignoreSelection=new K,this.delayedFlush=-1,this.queue=[],this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var t,n=Object(u.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;i.queue.push(r)}}catch(o){n.e(o)}finally{n.f()}$.ie&&$.ie_version<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?i.flushSoon():i.flush()})),Cn&&(this.onCharData=function(e){i.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),i.flushSoon()}),this.onSelectionChange=function(){if(i.view.root.activeElement==i.dom){if($.ie&&$.ie_version<=11&&!i.view.state.selection.primary.empty){var e=Q(i.view.root);if(e.focusNode&&W(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return i.flushSoon()}i.flush()}},this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((function(e){i.parentCheck<0&&(i.parentCheck=setTimeout(i.listenForScroll.bind(i),1e3)),e[e.length-1].intersectionRatio>0!=i.intersecting&&(i.intersecting=!i.intersecting,i.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom)),this.listenForScroll()}return Object(d.a)(e,[{key:"onScroll",value:function(e){this.intersecting&&(this.flush(),this.onScrollChanged(e))}},{key:"listenForScroll",value:function(){this.parentCheck=-1;for(var e=0,t=null,n=this.dom;n;)if(1==n.nodeType)!t&&e=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}},{key:"flush",value:function(){var e=this;if(!(this.delayedFlush>=0)){var t,n=this.queue,r=Object(u.a)(this.observer.takeRecords());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(i)}}catch(m){r.e(m)}finally{r.f()}n.length&&(this.queue=[]);var o=Q(this.view.root),a=!this.ignoreSelection.eq(o)&&B(this.dom,o);if(0!=n.length||a){var s,l=-1,c=-1,f=!1,d=Object(u.a)(n);try{for(d.s();!(s=d.n()).done;){var h=s.value,p=this.readMutation(h);p&&(p.typeOver&&(f=!0),-1==l?(l=p.from,c=p.to):(l=Math.min(p.from,l),c=Math.max(p.to,c)))}}catch(m){d.e(m)}finally{d.f()}var v=this.view.state;(l>-1||a)&&this.onChange(l,c,f),this.view.state==v&&(this.view.docView.dirty&&(this.ignore((function(){return e.view.docView.sync()})),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(),"childList"==e.type){var n=Mn(t,e.previousSibling||e.target.previousSibling,-1),r=Mn(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},{key:"destroy",value:function(){this.stop(),this.intersection&&this.intersection.disconnect();var e,t=Object(u.a)(this.scrollTargets);try{for(t.s();!(e=t.n()).done;){e.value.removeEventListener("scroll",this.onScroll)}}catch(n){t.e(n)}finally{t.f()}window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}]),e}();function Mn(e,t,n){for(;t;){var r=ne.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}var Pn="\ufdda";function Tn(e,t,n,r){var i,o,a,s=e.state.selection.primary;if(t>-1&&(a=e.docView.domBoundsAround(t,n,0))){var l=a,c=l.from,u=l.to,f=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e,t){var n=[];if(t.activeElement!=e)return n;var r=Q(t),i=r.anchorNode,o=r.anchorOffset,a=r.focusNode,s=r.focusOffset;i&&(n.push(new _n(i,o)),a==i&&s==o||n.push(new _n(a,s)));return n}(e.contentDOM,e.root),d=new Dn(f);d.readRange(a.startDOM,a.endDOM),o=function(e,t){if(0==e.length)return null;var n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?p.d.single(n+t,r+t):null}(f,c);var h=s.from,v=null;8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100&&(h=s.to,v="end");var m=function(e,t,n,r){var i=Math.min(e.length,t.length),o=0;for(;o0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.doc.sliceString(c,u,Pn),d.text,h-c,v);m&&(i={from:c+m.from,to:c+m.toA,insert:p.k.of(d.text.slice(m.from,m.toB).split(Pn))})}else if(e.hasFocus){var g=Q(e.root),b=e.docView,y=b.impreciseHead,O=b.impreciseAnchor,w=y&&y.node==g.focusNode&&y.offset==g.focusOffset?e.state.selection.primary.head:e.docView.posFromDOM(g.focusNode,g.focusOffset),k=O&&O.node==g.anchorNode&&O.offset==g.anchorOffset?e.state.selection.primary.anchor:function(e){var t=e.isCollapsed;return t&&$.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t}(g)?w:e.docView.posFromDOM(g.anchorNode,g.anchorOffset);w==s.head&&k==s.anchor||(o=p.d.single(k,w))}if(i||o)if(!i&&r&&!s.empty&&o&&o.primary.empty&&(i={from:s.from,to:s.to,insert:e.state.doc.slice(s.from,s.to)}),i){var x=e.state;if($.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&Rn(e,"Enter",10)||i.from==s.from-1&&i.to==s.to&&0==i.insert.length&&Rn(e,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&Rn(e,"Delete",46)))return;var j,S=i.insert.toString();if(e.state.facet(Ot).some((function(t){return t(e,i.from,i.to,S)})))return;if(i.from>=s.from&&i.to<=s.to&&i.to-i.from>=(s.to-s.from)/3){var C=s.fromi.to?x.doc.sliceString(i.to,s.to,Pn):"";j=x.replaceSelection(p.k.of((C+i.insert.sliceString(0,void 0,Pn)+E).split(Pn)))}else{var M=x.changes(i);j={changes:M,selection:o&&!x.selection.primary.eq(o.primary)&&o.primary.to<=M.newLength?x.selection.replaceRange(o.primary):void 0}}e.dispatch(j,{scrollIntoView:!0,annotations:p.l.userEvent.of("input")})}else if(o&&!o.primary.eq(s)){var P,T=!1;e.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==e.inputState.lastSelectionOrigin?T=!0:P=p.l.userEvent.of(e.inputState.lastSelectionOrigin)),e.dispatch({selection:o,scrollIntoView:T,annotations:P})}}var Dn=function(){function e(t){Object(f.a)(this,e),this.points=t,this.text=""}return Object(d.a)(e,[{key:"readRange",value:function(e,t){if(e){for(var n=e.parentNode,r=e;;){this.findPointBefore(n,r),this.readNode(r);var i=r.nextSibling;if(i==t)break;var o=ne.get(r),a=ne.get(i);((o?o.breakAfter:An(r))||(a?a.breakAfter:An(i))&&("BR"!=r.nodeName||r.cmIgnore))&&(this.text+=Pn),r=i}this.findPointBefore(n,t)}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t,n=ne.get(e),r=n&&n.overrideDOMText;null!=r?t=r.sliceString(0,void 0,Pn):3==e.nodeType?t=e.nodeValue:"BR"==e.nodeName?t=e.nextSibling?Pn:"":1==e.nodeType&&this.readRange(e.firstChild,null),null!=t&&(this.findPointIn(e,t.length),this.text+=t)}}},{key:"findPointBefore",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}}catch(o){r.e(o)}finally{r.f()}}},{key:"findPointIn",value:function(e,t){var n,r=Object(u.a)(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t))}}catch(o){r.e(o)}finally{r.f()}}}]),e}();function An(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var _n=function e(t,n){Object(f.a)(this,e),this.node=t,this.offset=n,this.pos=-1};function Rn(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);e.contentDOM.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return e.contentDOM.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}var Nn=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(f.a)(this,e),this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.className=_e("scroller"),this.scrollDOM.appendChild(this.contentDOM),this.dom=document.createElement("div"),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(e){return t.update([e])},this.dispatch=this.dispatch.bind(this),this.root=n.root||document,this.viewState=new $t(n.state||p.e.create()),this.plugins=this.state.facet(Ct).map((function(e){return Tt.create(e,t)})),this.observer=new En(this,(function(e,n,r){return Tn(t,e,n,r)}),(function(e){t.inputState.runScrollHandlers(t,e),t.measure()})),this.docView=new Vt(this),this.inputState=new cn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,$n(),this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Object(d.a)(e,[{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof p.l?arguments.length<=0?void 0:arguments[0]:(e=this.state).update.apply(e,arguments))}},{key:"update",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");this.updateState=2;var t,n=this.state,r=Object(u.a)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=i.state}}catch(f){r.e(f)}finally{r.f()}var o=new Lt(this,n,e),a=e.some((function(e){return e.scrollIntoView}))?n.selection.primary:null;this.viewState.update(o,a),this.bidiCache=Fn.update(this.bidiCache,o.changes),o.empty||this.updatePlugins(o);var s=this.docView.update(o);this.state.facet(Rt)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.updateState=0,(s||a||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure();var l,c=Object(u.a)(this.state.facet(yt));try{for(c.s();!(l=c.n()).done;){(0,l.value)(o)}}catch(f){c.e(f)}finally{c.f()}}},{key:"setState",value:function(e){var t=this;if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;var n,r=Object(u.a)(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(i){r.e(i)}finally{r.f()}this.viewState=new $t(e),this.plugins=e.facet(Ct).map((function(e){return Tt.create(e,t)})),this.docView=new Vt(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[],this.updateState=0,this.requestMeasure()}},{key:"updatePlugins",value:function(e){var t=e.prevState.facet(Ct),n=e.state.facet(Ct);if(t!=n){var r,i=[],o=[],a=Object(u.a)(n);try{for(a.s();!(r=a.n()).done;){var s=r.value,l=t.indexOf(s);if(l<0)i.push(Tt.create(s,this));else{var c=this.plugins[l].update(e);o.push(c),i.push(c)}}}catch(v){a.e(v)}finally{a.f()}var f,d=Object(u.a)(this.plugins);try{for(d.s();!(f=d.n()).done;){var h=f.value;o.indexOf(h)<0&&h.destroy(this)}}catch(v){d.e(v)}finally{d.f()}this.plugins=i,this.inputState.ensureHandlers(this)}else for(var p=0;p-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=-1;for(var t=null,n=0;;n++){this.updateState=1;var r=this.viewState.measure(this.docView,n>0),i=this.measureRequests;if(!r&&!i.length&&null==this.viewState.scrollTo)break;if(this.measureRequests=[],n>5){console.warn("Viewport failed to stabilize");break}var o=i.map((function(t){try{return t.read(e)}catch(n){return wt(e.state,n),Bn}})),a=new Lt(this,this.state);a.flags|=r,t?t.flags|=r:t=a,this.updateState=2,this.updatePlugins(a),r&&this.docView.update(a);for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure()}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((function(){return t.measure()}))),e){if(null!=e.key)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;return this.viewState.lineAt(e,t)}},{key:"viewportLines",value:function(e,t){var n=this.viewport,r=n.from,i=n.to;this.viewState.forEachLine(r,i,e,In(t,this.contentDOM))}},{key:"moveByChar",value:function(e,t,n){return ln(this,e,t,n)}},{key:"moveByGroup",value:function(e,t){var n=this;return ln(this,e,t,(function(t){return function(e,t,n){var r=e.state.charCategorizer(t),i=r(n);return function(e){var t=r(e);return i==p.c.Space&&(i=t),i==t}}(n,e.head,t)}))}},{key:"moveToLineBoundary",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return sn(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return function(e,t,n,r){var i,o=t.head,a=n?1:-1;if(o==(n?e.state.doc.length:0))return p.d.cursor(o);var s=e.coordsAtPos(o);if(s)for(var l=e.dom.getBoundingClientRect(),c=null!==(i=t.goalColumn)&&void 0!==i?i:s.left-l.left,u=l.left+c,f=null!==r&&void 0!==r?r:5,d=a<0?s.top:s.bottom,h=0;h<50;h+=10){var v=an(e,{x:u,y:d+(f+h)*a},a);if(v<0)break;if(v!=o)return p.d.cursor(v,void 0,void 0,c)}var m=e.state.doc,b=m.lineAt(o),y=e.state.tabSize,O=t.goalColumn,w=0;if(null==O){for(var k=m.iterRange(b.from,o);!k.next().done;)w=Object(g.d)(k.value,w,y);O=w*e.defaultCharacterWidth}else w=Math.round(O/e.defaultCharacterWidth);if(a<0&&0==b.from)return p.d.cursor(0);if(a>0&&b.to==m.length)return p.d.cursor(b.to);for(var x=m.line(b.number+a),j=x.from,S=0,C=m.iterRange(x.from,x.to);S>=w&&!C.next().done;){var E=Object(g.e)(C.value,S,w,y),M=E.offset;S=w-E.leftOver,j+=M}return p.d.cursor(j,void 0,void 0,O)}(this,e,t,n)}},{key:"scrollPosIntoView",value:function(e){this.viewState.scrollTo=p.d.cursor(e),this.requestMeasure()}},{key:"posAtCoords",value:function(e){return this.readMeasured(),an(this,e)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),o=i[Ye.find(i,e-r.from,-1,t)];return U(n,o.dir==Re.LTR==t>0)}},{key:"bidiSpans",value:function(e){if(e.length>Ln)return Ge(e.length);var t,n=this.textDirection,r=Object(u.a)(this.bidiCache);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.from==e.from&&i.dir==n)return i.order}}catch(a){r.e(a)}finally{r.f()}var o=Ke(e.slice(),this.textDirection);return this.bidiCache.push(new Fn(e.from,e.to,n,o)),o}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){Z(e.contentDOM),e.docView.updateSelection()}))}},{key:"destroy",value:function(){var e,t=Object(u.a)(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(n){t.e(n)}finally{t.f()}this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled)}},{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing}},{key:"themeClasses",get:function(){return Te+" "+(this.state.facet(Pe)?"cm-dark":"cm-light")+" "+this.state.facet(Me)}},{key:"contentHeight",get:function(){return this.viewState.heightMap.height+this.viewState.paddingTop+this.viewState.paddingBottom}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.heightOracle.direction}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"hasFocus",get:function(){return this.root.activeElement==this.contentDOM}}],[{key:"domEventHandlers",value:function(e){return Et.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=v.a.newName(),r=[Me.of(n),Rt.of(Ae(".".concat(Te,".").concat(n),e))];return t&&t.dark&&r.push(Pe.of(!0)),r}},{key:"baseTheme",value:function(e){return Object(p.o)(Rt.of(Ae("."+Te,e)),"fallback")}}]),e}();Nn.styleModule=Rt,Nn.inputHandler=Ot,Nn.exceptionSink=bt,Nn.updateListener=yt,Nn.editable=kt,Nn.dragMovesSelection=mt,Nn.clickAddsSelectionRange=vt,Nn.mouseSelectionStyle=gt,Nn.decorations=_t,Nn.lineWrapping=Nn.theme({$content:{whiteSpace:"pre-wrap"}}),Nn.contentAttributes=At,Nn.editorAttributes=Dt;var Ln=4096;function In(e,t){return null==e?t.getBoundingClientRect().top:e}var zn=-1;function $n(){window.addEventListener("resize",(function(){-1==zn&&(zn=setTimeout(Qn,50))}))}function Qn(){zn=-1;for(var e=document.querySelectorAll(".cm-content"),t=0;t1&&void 0!==arguments[1]?arguments[1]:Wn,r=Object.create(null),i=Object.create(null),o=function(e,t){var n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},a=function(e,t,i,a){for(var s=r[e]||(r[e]=Object.create(null)),l=t.split(/ (?!$)/).map((function(e){return Hn(e,n)})),c=function(t){var n=l.slice(0,t).join(" ");o(n,!0),s[n]||(s[n]={preventDefault:!0,commands:[function(t){var r=Kn={view:t,prefix:n,scope:e};return setTimeout((function(){Kn==r&&(Kn=null)}),4e3),!0}]})},u=1;u0&&void 0!==arguments[0]?arguments[0]:{};return[er.of(e),rr,or]}var nr=function(){function e(t,n,r,i,o){Object(f.a)(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=o}return Object(d.a)(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px",e}},{key:"eq",value:function(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}]),e}(),rr=Et.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className=_e("selectionLayer"),this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className=_e("cursorLayer"),this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}return Object(d.a)(e,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(er).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.prevState.facet(er)!=e.state.facet(er);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((function(e){return e.scrollIntoView}))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}},{key:"readPos",value:function(){var e,t=this,n=this.view.state,r=n.facet(er),i=n.selection.ranges.map((function(e){return e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];var n=Math.max(t.from,e.viewport.from),r=Math.min(t.to,e.viewport.to),i=e.textDirection==Re.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),s=sr(e),l=window.getComputedStyle(o.firstChild),c=a.left+parseInt(l.paddingLeft),f=a.right-parseInt(l.paddingRight),d=e.visualLineAt(n),h=e.visualLineAt(r);if(d.from==h.from)return y(O(t.from,t.to));var v=O(t.from,null),m=O(null,t.to),g=[];return d.tod&&m.from=b)break;j>g&&s(Math.max(x,g),null==t&&x<=d,Math.min(j,b),null==n&&j>=h,k.dir)}}catch(C){w.e(C)}finally{w.f()}if((g=O.to+1)>=b)break}}}catch(C){v.e(C)}finally{v.f()}if(0==a.length){var S=e.coordsAtPos(d,-1);r=Math.min(S.top,r),o=Math.max(S.bottom,o)}return{top:r,bottom:o,horizontal:a}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),o=[],a=Object(u.a)(n.selection.ranges);try{for(a.s();!(e=a.n()).done;){var s=e.value,l=s==n.selection.primary;if(s.empty?!l||Jn:r.drawRangeCursor){var c=ur(this.view,s,l);c&&o.push(c)}}}catch(f){a.e(f)}finally{a.f()}return{rangePieces:i,cursors:o}}},{key:"drawSel",value:function(e){var t=this,n=e.rangePieces,r=e.cursors;if(n.length!=this.rangePieces.length||n.some((function(e,n){return!e.eq(t.rangePieces[n])}))){this.selectionLayer.textContent="";var i,o=Object(u.a)(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(f){o.e(f)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){this.cursorLayer.textContent="";var s,l=Object(u.a)(r);try{for(l.s();!(s=l.n()).done;){var c=s.value;this.cursorLayer.appendChild(c.draw())}}catch(f){l.e(f)}finally{l.f()}this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),ir={$content:{"& ::selection":{backgroundColor:"transparent !important"}}};Jn&&(ir.$content.caretColor="transparent !important");var or=Object(p.o)(Nn.theme(ir),"override"),ar=_e("selectionBackground");function sr(e){var t=e.scrollDOM.getBoundingClientRect();return{left:t.left-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}var lr=_e("cursor.primary"),cr=_e("cursor.secondary");function ur(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=sr(e);return new nr(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?lr:cr)}var fr=/[\0-\x08\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200C\u200E\u200F\u2028\u2029\uFEFF\uFFF9-\uFFFC]/g,dr={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},hr=null;function pr(){if(null==hr&&"undefined"!=typeof document&&document.body){var e=document.body.style;hr=null!=(e.tabSize||e.MozTabSize)}return hr||!1}var vr=null!=/x/.unicode?"gu":"g",mr=p.f.define({combine:function(e){var t=Object(p.m)(e,{render:null,specialChars:fr,addSpecialChars:null});return(t.replaceTabs=!pr())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,vr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,vr)),t}});function gr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[mr.of(e),br];return pr()||t.push(kr),t}var br=Et.fromClass(function(){function e(t){Object(f.a)(this,e),this.view=t,this.decorations=ke.none,this.decorationCache=Object.create(null),this.recompute()}return Object(d.a)(e,[{key:"update",value:function(e){var t=e.prevState.facet(mr)!=e.state.facet(mr);t&&(this.decorationCache=Object.create(null)),(t||e.changes.length||e.viewportChanged)&&this.recompute()}},{key:"recompute",value:function(){var e,t=[],n=Object(u.a)(this.view.visibleRanges);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.from,o=r.to;this.getDecorationsFor(i,o,t)}}catch(a){n.e(a)}finally{n.f()}this.decorations=ke.set(t)}},{key:"getDecorationsFor",value:function(e,t,n){for(var r,i=this.view.state.facet(mr),o=this.view.state.doc,a=e,s=o.iterRange(e,t);!s.next().done;){if(!s.lineBreak)for(;r=i.specialChars.exec(s.value);){var l=Object(g.b)(r[0],0),c=void 0;if(null!=l){if(9==l){var u=o.lineAt(a+r.index),f=this.view.state.tabSize,d=Object(g.d)(o.sliceString(u.from,a+r.index),0,f);c=ke.replace({widget:new Or((f-d%f)*this.view.defaultCharacterWidth)})}else c=this.decorationCache[l]||(this.decorationCache[l]=ke.replace({widget:new yr(i,l)}));n.push(c.range(a+r.index,a+r.index+r[0].length))}}a+=s.value.length}}}]),e}(),{decorations:function(e){return e.decorations}});var yr=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,r){var i;return Object(f.a)(this,n),(i=t.call(this)).options=e,i.code=r,i}return Object(d.a)(n,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(){var e,t=((e=this.code)>=32?null:10==e?"\u2424":String.fromCharCode(9216+e))||"\u2022",n="Control character "+(dr[this.code]||this.code),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;var i=document.createElement("span");return i.textContent=t,i.title=n,i.setAttribute("aria-label",n),i.style.color="red",i}},{key:"ignoreEvent",value:function(){return!1}}]),n}(we),Or=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var r;return Object(f.a)(this,n),(r=t.call(this)).width=e,r}return Object(d.a)(n,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className=wr,e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}(we),wr=v.a.newName(),kr=Nn.styleModule.of(new v.a(Object(r.a)({},"."+wr,{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"})));function xr(){return p.e.transactionFilter.of((function(e){if(!e.docChanged||"input"!=e.annotation(p.l.userEvent))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.primary.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.primary.head,i=n.lineAt(r);if(r>i.from+200)return e;var o=n.sliceString(i.from,r);if(!t.some((function(e){return e.test(o)})))return e;var a,s=e.state,l=-1,f=[],d=Object(u.a)(s.selection.ranges);try{var h=function(){var e=a.value.head,t=s.doc.lineAt(e);if(t.from==l)return"continue";l=t.from;var n=Math.max.apply(Math,Object(c.a)(s.facet(p.e.indentation).map((function(e){return e(new p.g(s),t.from)}))));if(n<0)return"continue";var r=/^\s*/.exec(t.slice(0,Math.min(t.length,200)))[0],i=s.indentString(n);r!=i&&f.push({from:t.from,to:t.from+r.length,insert:i})};for(d.s();!(a=d.n()).done;)h()}catch(v){d.e(v)}finally{d.f()}return f.length?[e,{changes:f}]:e}))}},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(0),a=n.n(o),s=(n(11),n(103)),l=n.n(s),c=n(351),u=n(381),f=n(200),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,d=void 0!==s&&s,h=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var v=h,m=Object(c.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:v},p)),g=a.a.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=m(Object(r.a)(Object(r.a)({},n.defaultProps),e)),v=c;return("string"===typeof h||d)&&(s=Object(f.a)()||o,h&&(v=Object(u.a)({theme:s,name:h,props:c})),d&&!v.theme&&(v.theme=s)),a.a.createElement(n,Object(r.a)({ref:l||t,classes:p},v))}));return l()(g,n),g}},h=n(68);t.a=function(e,t){return d(e,Object(r.a)({defaultTheme:h.a},t))}},function(e,t,n){e.exports=n(339)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(13);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;te)return u[t-1]<=e;return!1}function h(e){return e>=127462&&e<=127487}function p(e,t){if(t==e.length)return t;t&&m(e.charCodeAt(t))&&g(e.charCodeAt(t-1))&&t--;var n=b(e,t);for(t+=O(n);t=0&&h(b(e,o));)i++,o-=2;if(i%2==0)break;t+=2}}return t}function v(e,t){for(;t>0;){var n=p(e,t-2);if(n=56320&&e<57344}function g(e){return e>=55296&&e<56320}function b(e,t){var n=e.charCodeAt(t);if(!g(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return m(r)?r-56320+(n-55296<<10)+65536:n}function y(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function O(e){return e<65536?1:2}function w(e,t,n){for(var r=0;r=n)return{offset:i,leftOver:0};t+=9==e.charCodeAt(i)?r-t%r:1,i=p(e,i)}return{offset:e.length,leftOver:n-t}}var x=function(){function e(){Object(l.a)(this,e)}return Object(c.a)(e,[{key:"lineAt",value:function(e){if(e<0||e>this.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.from<=e&&r.to>=e)return r}}catch(i){n.e(i)}finally{n.f()}return C(this.lineInner(e,!1,1,0).finish(this))}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));var t,n=Object(s.a)(j);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.doc==this&&r.number==e)return r}}catch(i){n.e(i)}finally{n.f()}return C(this.lineInner(e,!0,1,0).finish(this))}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r),r.push(n),this.decompose(t,this.length,r),M.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return 0==this.length?e:0==e.length?this:M.from([this,e],this.length+e.length)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n),M.from(n,t-e)}},{key:"eq",value:function(e){return this==e||function(e,t){if(e.length!=t.length||e.lines!=t.lines)return!1;for(var n=new A(e),r=new A(t),i=0,o=0;;){if(n.lineBreak!=r.lineBreak||n.done!=r.done)return!1;if(n.done)return!0;if(n.lineBreak)n.next(),r.next(),i=o=0;else{var a=n.value.slice(i),s=r.value.slice(o);if(a.length==s.length){if(a!=s)return!1;n.next(),r.next(),i=o=0}else if(a.length>s.length){if(a.slice(0,s.length)!=s)return!1;i+=s.length,r.next(),o=0}else{if(s.slice(0,a.length)!=a)return!1;o+=a.length,n.next(),i=0}}}}(this,e)}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new A(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new _(this,e,t)}},{key:"iterLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new R(this,e)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){for(var e=[],t=this.iterLines();!t.next().done;)e.push(t.value);return e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");if(1==t.length&&!t[0]&&e.empty)return e.empty;var n=P(t);return n<1024?new E(t,n):M.from(E.split(t,[]),n)}}]),e}();"undefined"!=typeof Symbol&&(x.prototype[Symbol.iterator]=function(){return this.iter()});var j=[],S=-1;function C(e){return j[S=(S+1)%10]=e}var E=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P(e);return Object(l.a)(this,n),(r=t.call(this)).text=e,r.length=i,r}return Object(c.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new N(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,t,r){r.push(new n(D(this.text,e,t),Math.min(t,this.length)-Math.max(0,e)))}},{key:"lastLineLength",value:function(){return this.text[this.text.length-1].length}},{key:"firstLineLength",value:function(){return this.text[0].length}},{key:"replace",value:function(e,t,o){var a=this.length+o.length-(t-e);return a>=1024||!(o instanceof n)?Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,o):new n(T(this.text,T(o.text,D(this.text,0,e)),t),a)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;i<=t&&oe&&o&&(r+=n),ei&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){e[e.length-1]+=this.text[0];for(var t=1;t=56320&&f<57344&&u++,i.push(l.slice(0,u)),t.push(new n(i,512)),l=l.slice(u),o=-1,i=[]}}catch(d){a.e(d)}finally{a.f()}return-1!=o&&t.push(new n(i,o)),t}}]),n}(x),M=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e,r){var i;Object(l.a)(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=1;var o,a=Object(s.a)(e);try{for(a.s();!(o=a.n()).done;){var c=o.value;i.lines+=c.lines-1}}catch(u){a.e(u)}finally{a.f()}return i}return Object(c.a)(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e){var l=o.lineInner(e,t,n,r),c=void 0;return l.from==r&&(c=this.lineLengthTo(i))&&(l.from-=c,l.content=null),l.to==a&&(c=this.lineLengthFrom(i+1))&&(l.to+=c,l.content=null),l}r=a,n=s}}},{key:"decompose",value:function(e,t,n){for(var r=0,i=0;ii&&(i>=e&&a<=t?n.push(o):o.decompose(e-i,t-i,n)),i=a}}},{key:"lineLengthTo",value:function(e){for(var t=0,n=e-1;n>=0;n--){var r=this.children[n];if(r.lines>1)return t+r.lastLineLength();t+=r.length}return t}},{key:"lastLineLength",value:function(){return this.lineLengthTo(this.children.length)}},{key:"lineLengthFrom",value:function(e){for(var t=0,n=e;n1)return t+r.firstLineLength();t+=r.length}return t}},{key:"firstLineLength",value:function(){return this.lineLengthFrom(0)}},{key:"replace",value:function(e,t,o){if(o.length<512&&t-e<512)for(var a=o.length-(t-e),s=0,l=0;s=l&&t<=u&&c.length+a>2&&c.length+a>0){var f=this.children.slice();return f[s]=c.replace(e-l,t-l,o),new n(f,this.length+a)}l=u}return Object(r.a)(Object(i.a)(n.prototype),"replace",this).call(this,e,t,o)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;oo){var l=a.sliceString(e-o,t-o,n);if(e>=o&&t<=s)return l;r+=l}o=s}return r}},{key:"flatten",value:function(e){var t,n=Object(s.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(r){n.e(r)}finally{n.f()}}}],[{key:"from",value:function(e,t){if(!e.every((function(e){return e instanceof x})))throw new Error("NOP");if(t<1024){var r,i=[""],o=Object(s.a)(e);try{for(o.s();!(r=o.n()).done;){r.value.flatten(i)}}catch(g){o.e(g)}finally{o.f()}return new E(i,t)}var a=Math.max(512,t>>3),l=a<<1,c=a>>1,u=[],f=0,d=[];function h(e){var t,r=e.length;if(r)if(r>l&&e instanceof n){var i,o=Object(s.a)(e.children);try{for(o.s();!(i=o.n()).done;){h(i.value)}}catch(g){o.e(g)}finally{o.f()}}else r>c&&(f>c||0==f)?(p(),u.push(e)):e instanceof E&&f>0&&(t=d[d.length-1])instanceof E&&e.length+t.length<=512?(f+=r,d[d.length-1]=new E(T(e.text,t.text.slice()),e.length+t.length)):(f+r>a&&p(),f+=r,d.push(e))}function p(){0!=f&&(u.push(1==d.length?d[0]:n.from(d,f)),f=0,d.length=0)}var v,m=Object(s.a)(e);try{for(m.s();!(v=m.n()).done;){h(v.value)}}catch(g){m.e(g)}finally{m.f()}return p(),1==u.length?u[0]:new n(u,t)}}]),n}(x);function P(e){var t,n=-1,r=Object(s.a)(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(i){r.e(i)}finally{r.f()}return n}function T(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(l>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;Object(l.a)(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?0:t instanceof E?t.text.length:t.children.length]}return Object(c.a)(e,[{key:"next",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;;){var t=this.nodes.length-1;if(t<0)return this.done=!0,this.value="",this.lineBreak=!1,this;var n=this.nodes[t],r=this.offsets[t];if(n instanceof E){if(r!=(this.dir>0?0:n.text.length)&&!this.lineBreak){if(this.lineBreak=!0,0==e)return this.value="\n",this;e--;continue}var i=n.text[r-(this.dir<0?1:0)];if(this.offsets[t]=r+=this.dir,r==(this.dir>0?n.text.length:0)&&(this.nodes.pop(),this.offsets.pop()),this.lineBreak=!1,i.length>Math.max(0,e))return this.value=0==e?i:this.dir>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else if(r==(this.dir>0?n.children.length:0))this.nodes.pop(),this.offsets.pop();else{var o=n.children[this.dir>0?r:r-1],a=o.length;this.offsets[t]=r+this.dir,e>a?e-=a:(this.nodes.push(o),this.offsets.push(this.dir>0?0:o instanceof E?o.text.length:o.children.length))}}}}]),e}(),_=function(){function e(t,n,r){Object(l.a)(this,e),this.value="",this.cursor=new A(t,n>r?-1:1),n>r?(this.skip=t.length-n,this.limit=n-r):(this.skip=n,this.limit=r-n)}return Object(c.a)(e,[{key:"next",value:function(){if(this.limit<=0)this.limit=-1;else{var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;this.skip=0,this.value=t;var i=n?1:t.length;i>this.limit&&(this.value=this.cursor.dir>0?t.slice(0,this.limit):t.slice(i-this.limit)),r||0==this.value.length?this.limit=-1:this.limit-=this.value.length}return this}},{key:"lineBreak",get:function(){return this.cursor.lineBreak}},{key:"done",get:function(){return this.limit<0}}]),e}(),R=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object(l.a)(this,e),this.value="",this.done=!1,this.cursor=t.iter(),this.skip=n}return Object(c.a)(e,[{key:"next",value:function(){if(this.cursor.done)return this.done=!0,this.value="",this;for(this.value="";;){var e=this.cursor.next(this.skip),t=e.value,n=e.lineBreak,r=e.done;if(this.skip=0,r||n)return this;this.value+=t}}},{key:"lineBreak",get:function(){return!1}}]),e}(),N=function(){function e(t,n,r,i){Object(l.a)(this,e),this.from=t,this.to=n,this.number=r,this.content=i}return Object(c.a)(e,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;if(e==t)return"";if("string"==typeof this.content)return this.content.slice(e,t);this.content||(this.content=new L(this.doc,this.from));var n=this.content.slice(e,t);return 0==e&&t==this.length&&(this.content=n),n}},{key:"finish",value:function(e){return this.doc=e,this}},{key:"findClusterBreak",value:function(e,t){if(e<0||e>this.length)throw new RangeError("Invalid position given to Line.findClusterBreak");var n,r;return"string"==this.content?(n=this.from,r=this.content):(n=Math.max(0,e-256),r=this.slice(n,Math.min(this.length,n+512))),(t?p:v)(r,e-n)+n}},{key:"length",get:function(){return this.to-this.from}}]),e}(),L=function(){function e(t,n){Object(l.a)(this,e),this.doc=t,this.start=n,this.cursor=null,this.strings=null}return Object(c.a)(e,[{key:"slice",value:function(e,t){this.cursor||(this.cursor=this.doc.iter(),this.strings=[this.cursor.next(this.start).value]);for(var n="",r=0,i=0;;i++){if(i==this.strings.length){var o=this.cursor.next().value;if(!o)return n;this.strings.push(o)}var a=this.strings[i],s=r;if(!((r+=a.length)<=e)&&(n+=a.slice(Math.max(0,e-s),Math.min(a.length,t-s)),r>=t))return n}}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(80);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||Object(r.a)(e,t)||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(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(38);function i(e){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=n(90);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}function s(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=Object(r.a)(e);if(t){var o=Object(r.a)(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return a(this,n)}}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",(function(){return i}))},,function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return f})),n.d(t,"e",(function(){return d}));var r=n(201);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e){var t="hsl"===(e=o(e)).type?o(function(e){var t=(e=o(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),a({type:c,values:u})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?f(e,t):d(e,t)}function u(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function f(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(37);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return y}));var r=n(19),i=n(18),o=n(4),a=n(5),s=n(7),l=1024,c=function(){function e(t,n){Object(a.a)(this,e),this.enter=t,this.leave=n,this.result=void 0}return Object(s.a)(e,[{key:"doEnter",value:function(e,t,n){var r=this.enter(e,t,n);return void 0===r||(!1!==r&&(this.result=r),!1)}},{key:"done",get:function(){return void 0!==this.result}}]),e}(),u=0,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.deserialize;Object(a.a)(this,e),this.id=u++,this.deserialize=n||function(){throw new Error("This node type doesn't define a deserialize function")}}return Object(s.a)(e,[{key:"set",value:function(e,t){return e[this.id]=t,e}},{key:"add",value:function(e){return new d(this,"function"==typeof e?e:h.match(e))}}],[{key:"string",value:function(){return new e({deserialize:function(e){return e}})}},{key:"number",value:function(){return new e({deserialize:Number})}},{key:"flag",value:function(){return new e({deserialize:function(){return!0}})}}]),e}();f.error=f.flag(),f.skipped=f.flag(),f.closedBy=new f({deserialize:function(e){return e.split(" ")}}),f.openedBy=new f({deserialize:function(e){return e.split(" ")}}),f.top=f.flag();var d=function e(t,n){Object(a.a)(this,e),this.prop=t,this.f=n},h=function(){function e(t,n,r){Object(a.a)(this,e),this.name=t,this.props=n,this.id=r}return Object(s.a)(e,[{key:"prop",value:function(e){return this.props[e.id]}}],[{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=Object(o.a)(n.split(" "));try{for(i.s();!(r=i.n()).done;){var a=r.value;t[a]=e[n]}}catch(s){i.e(s)}finally{i.f()}}return function(e){return t[e.name]}}}]),e}();h.none=new h("",Object.create(null),0);var p=function(){function e(t){Object(a.a)(this,e),this.types=t;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0,n=this.resolveAt(e);if(0!=t)for(;;){var r=t<0?n.childBefore(e):n.childAfter(e);if(!r||(t<0?r.end:r.start)!=e)break;n=r}return n}},{key:"name",get:function(){return this.type.name}},{key:"depth",get:function(){for(var e=0,t=this.parent;t;t=t.parent)e++;return e}},{key:"root",get:function(){for(var e=this;e.parent;)e=e.parent;return e}},{key:"firstChild",get:function(){return this.childAfter(this.start-1)}},{key:"lastChild",get:function(){return this.childBefore(this.end+1)}}]),e}(),m=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o){var s;return Object(a.a)(this,n),(s=t.call(this)).type=e,s.children=r,s.positions=i,s.length=o,s}return Object(s.a)(n,[{key:"toString",value:function(){var e=this.children.map((function(e){return e.toString()})).join();return this.name?(/\W/.test(this.name)&&!this.type.prop(f.error)?JSON.stringify(this.name):this.name)+(e.length?"("+e+")":""):e}},{key:"partial",value:function(e,t,r,i,o){for(var a=0;at)break;var l=this.children[a],c=s+l.length;c=c?(i.push(l),o.push(s+r)):l instanceof n&&l.partial(e-s,t-s,r+s,i,o))}}},{key:"applyChanges",value:function(e){if(0==e.length)return this;var t=[],r=[];function i(e,t,n){var r=-1;return e.iterate({from:t,to:n<0?0:e.length,enter:function(){return r<0&&void 0},leave:function(e,i,o){r<0&&(n<0?o<=t:i>=t)&&!e.prop(f.error)&&(r=n<0?Math.min(t,o-1):Math.max(t,i+1))}}),r>-1?r:n<0?0:e.length}for(var o=0,a=0,s=0;;a++){var l=a==e.length?null:e[a],c=l?i(this,l.fromA,-1):this.length;if(c>s&&this.partial(s,c,o,t,r),!l)break;s=i(this,l.toA,1),o+=l.toB-l.fromB-(l.toA-l.fromA)}return new n(h.none,t,r,this.length+o)}},{key:"cut",value:function(e){if(e>=this.length)return this;for(var t=[],r=[],i=0;i=e)break;var a=this.children[i],s=o+a.length;t.push(s<=e?a:a.cut(e-o)),r.push(o)}return new n(this.type,t,r,e)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,o=e.enter,a=e.leave,s=new c(o,a);return this.iterInner(n,i,0,s),s.result}},{key:"iterInner",value:function(e,t,n,r){if(!this.type.name||r.doEnter(this.type,n,n+this.length)){if(e<=t)for(var i=0;it)break;s=0&&!r.done;l--){var c=this.children[l],u=this.positions[l]+n;if(u+c.lengthe||c.iterInner(e,t,u,r)}r.leave&&this.type.name&&r.leave(this.type,n,n+this.length)}}},{key:"resolveAt",value:function(e){if(g==this)for(var t=b;;){var n=t.parent;if(!n)break;if(t.starte)return t.resolve(e);t=n}return g=this,b=this.resolveInner(e,0,this)}},{key:"childBefore",value:function(e){return this.findChild(e,-1,0,this)}},{key:"childAfter",value:function(e){return this.findChild(e,1,0,this)}},{key:"findChild",value:function(e,t,r,i){for(var o=0;o=e)if(t<0&&o>0)s=o-1;else{if(!(t>0))break;s=o}if(s<0&&(a+this.children[o].length>e||t<0&&o==this.children.length-1)&&(s=o),s>=0){var l=this.children[s],c=this.positions[s]+r;if(0==l.length&&c==e)continue;if(l instanceof n)return l.type.name?new O(l,c,i):l.findChild(e,t,c,i);var u=l.findIndex(e,t,c,0,l.buffer.length);if(u>-1)return new w(l,c,u,i)}}return null}},{key:"resolveInner",value:function(e,t,n){var r=this.findChild(e,0,t,n);return r?r.resolveAt(e):n}},{key:"append",value:function(e){if(e.children.length&&e.positions[0]0&&void 0!==arguments[0]?arguments[0]:l;return this.children.length<=x?this:S(this.type,h.none,this.children,this.positions,0,this.children.length,0,e,this.length)}},{key:"start",get:function(){return 0}},{key:"end",get:function(){return this.length}}],[{key:"build",value:function(e){return j(e)}}]),n}(v);m.empty=new m(h.none,[],[],0),m.prototype.parent=null;var g=m.empty,b=m.empty,y=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.none;Object(a.a)(this,e),this.buffer=t,this.length=n,this.group=r,this.type=i}return Object(s.a)(e,[{key:"toString",value:function(){for(var e=[],t=0;t(e+=4)){for(var a=[];et)return this.buffer.length;if(s>=e&&i.doEnter(o,a,s)){for(;r0?(l=s.pop(),c=a.buffer[l+3]):c=-1};u();e:for(var f=i;f>r&&!o.done;){for(;c==f;){var d=l,h=this.buffer[d],p=this.buffer[d+1]+n,v=this.buffer[d+2]+n;if(u(),p<=e&&v>=t&&!o.doEnter(this.group.types[h],p,v)){for(f=d;c>d;)u();continue e}}var m=this.buffer[--f],g=this.buffer[--f]+n,b=this.buffer[--f]+n,y=this.buffer[--f];b>e||g=e){if(t>0&&!u)return a;break}if(c>e)return a;u||(o=a),a=s[a+3]}return t<0?o:-1}}]),e}(),O=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i){var o;return Object(a.a)(this,n),(o=t.call(this)).node=e,o.start=r,o.parent=i,o}return Object(s.a)(n,[{key:"resolveAt",value:function(e){return e<=this.start||e>=this.end?this.parent.resolveAt(e):this.node.resolveInner(e,this.start,this)}},{key:"childBefore",value:function(e){return this.node.findChild(e,-1,this.start,this)}},{key:"childAfter",value:function(e){return this.node.findChild(e,1,this.start,this)}},{key:"toString",value:function(){return this.node.toString()}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,o=e.enter,a=e.leave,s=new c(o,a);return this.node.iterInner(n,i,this.start,s),s.result}},{key:"type",get:function(){return this.node.type}},{key:"end",get:function(){return this.start+this.node.length}}]),n}(v),w=function(e){Object(r.a)(n,e);var t=Object(i.a)(n);function n(e,r,i,o){var s;return Object(a.a)(this,n),(s=t.call(this)).buffer=e,s.bufferStart=r,s.index=i,s.parent=o,s}return Object(s.a)(n,[{key:"childBefore",value:function(e){var t=this.buffer.findIndex(e,-1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"childAfter",value:function(e){var t=this.buffer.findIndex(e,1,this.bufferStart,this.index+4,this.endIndex);return t<0?null:new n(this.buffer,this.bufferStart,t,this)}},{key:"iterate",value:function(e){var t=e.from,n=void 0===t?this.start:t,r=e.to,i=void 0===r?this.end:r,o=e.enter,a=e.leave,s=new c(o,a);return n<=i?this.buffer.iterChild(n,i,this.bufferStart,this.index,s):this.buffer.iterRev(n,i,this.bufferStart,this.index,this.endIndex,s),s.result}},{key:"resolveAt",value:function(e){if(e<=this.start||e>=this.end)return this.parent.resolveAt(e);var t=this.buffer.findIndex(e,0,this.bufferStart,this.index+4,this.endIndex);return t<0?this:new n(this.buffer,this.bufferStart,t,this).resolveAt(e)}},{key:"toString",value:function(){var e=[];return this.buffer.childToString(this.index,e),e.join("")}},{key:"type",get:function(){return this.buffer.group.types[this.buffer.buffer[this.index]]}},{key:"start",get:function(){return this.buffer.buffer[this.index+1]+this.bufferStart}},{key:"end",get:function(){return this.buffer.buffer[this.index+2]+this.bufferStart}},{key:"endIndex",get:function(){return this.buffer.buffer[this.index+3]}}]),n}(v),k=function(){function e(t,n){Object(a.a)(this,e),this.buffer=t,this.index=n}return Object(s.a)(e,[{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}}]),e}(),x=8;function j(e){var t=e.buffer,n=e.group,r=e.topID,i=void 0===r?0:r,o=e.maxBufferLength,a=void 0===o?l:o,s=e.reused,c=void 0===s?[]:s,u=e.minRepeatType,f=void 0===u?n.types.length:u,d=Array.isArray(t)?new k(t,t.length):t,p=n.types;function v(e,t,r,i,o){for(var s=d.id,l=d.start,u=d.end,b=d.size;s==o;)d.next(),s=d.id,l=d.start,u=d.end,b=d.size;var O=l-e;if(b<0)return r.push(c[s]),i.push(O),void d.next();var w,k,j=p[s];if(u-l<=a&&(k=function(e,t){var n=d.fork(),r=0,i=0,o=0,s=n.end-a,l={size:0,start:0,skip:0};e:for(var c=n.pos-e;n.pos>c;)if(n.id!=t){var u=n.size,h=n.pos-u;if(u<0||h=f?4:0,v=n.start;for(n.next();n.pos>h;){if(n.size<0)break e;n.id>=f&&(p+=4),n.next()}i=v,r+=u,o+=p}else l.size=r,l.start=i,l.skip=o,o+=4,r+=4,n.next();(t<0||r==e)&&(l.size=r,l.start=i,l.skip=o);return l.size>4?l:void 0}(d.pos-t,o))){for(var C=new Uint16Array(k.size-k.skip),E=d.pos-k.size,M=C.length;d.pos>E;)M=g(k.start,C,M,o);w=new y(C,u-k.start,n,o<0?h.none:p[o]),O=k.start-e}else{var P=d.pos-b;d.next();for(var T=[],D=[],A=s>=f?s:-1;d.pos>P;)v(l,P,T,D,A);T.reverse(),D.reverse(),w=A>-1&&T.length>x?S(j,j,T,D,0,T.length,0,a,u-l):new m(j,T,D,u-l)}r.push(w),i.push(O)}function g(e,t,n,r){var i=d.id,o=d.start,a=d.end,s=d.size;if(d.next(),i==r)return n;var l=n;if(s>4)for(var c=d.pos-(s-4);d.pos>c;)n=g(e,t,n,r);return i0;)v(0,0,b,O,-1);var w=b.length?O[0]+b[0].length:0;return new m(n.types[i],b.reverse(),O.reverse(),w)}function S(e,t,n,r,i,o,a,s,l){var c=[],u=[];if(l<=s)for(var f=i;fd)break}if(p==v+1){var b=n[v];if(b instanceof m&&b.type==t&&b.length>d<<1){for(var y=0;yt?1:e>=t?0:NaN},i=function(e){var t=e,n=e;function i(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[o],t)<0?r=o+1:i=o}return r}return 1===e.length&&(t=function(t,n){return e(t)-n},n=function(e){return function(t,n){return r(e(t),n)}}(e)),{left:i,center:function(e,n,r,o){null==r&&(r=0),null==o&&(o=e.length);var a=i(e,n,r,o-1);return a>r&&t(e[a-1],n)>-t(e[a],n)?a-1:a},right:function(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[o],t)>0?i=o:r=o+1}return r}}};var o=n(4);function a(e,t){var n;if(void 0===t){var r,i=Object(o.a)(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;null!=a&&(n=a)&&(n=a)}}catch(f){i.e(f)}finally{i.f()}}else{var s,l=-1,c=Object(o.a)(e);try{for(c.s();!(s=c.n()).done;){var u=s.value;null!=(u=t(u,++l,e))&&(n=u)&&(n=u)}}catch(f){c.e(f)}finally{c.f()}}return n}function s(e,t){var n;if(void 0===t){var r,i=Object(o.a)(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;null!=a&&(n>a||void 0===n&&a>=a)&&(n=a)}}catch(f){i.e(f)}finally{i.f()}}else{var s,l=-1,c=Object(o.a)(e);try{for(c.s();!(s=c.n()).done;){var u=s.value;null!=(u=t(u,++l,e))&&(n>u||void 0===n&&u>=u)&&(n=u)}}catch(f){c.e(f)}finally{c.f()}}return n}var l=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function j(e,t){for(var n,r=0,i=e.length;r0)for(var n,r,i=new Array(n),o=0;ot?1:e>=t?0:NaN}var q="http://www.w3.org/1999/xhtml",U={svg:"http://www.w3.org/2000/svg",xhtml:q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Y=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),U.hasOwnProperty(t)?{space:U[t],local:e}:e};function X(e){return function(){this.removeAttribute(e)}}function K(e){return function(){this.removeAttributeNS(e.space,e.local)}}function G(e,t){return function(){this.setAttribute(e,t)}}function Z(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function J(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function ee(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}var te=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView};function ne(e){return function(){this.style.removeProperty(e)}}function re(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ie(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function oe(e,t){return e.style.getPropertyValue(t)||te(e).getComputedStyle(e,null).getPropertyValue(t)}function ae(e){return function(){delete this[e]}}function se(e,t){return function(){this[e]=t}}function le(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function ce(e){return e.trim().split(/^|\s+/)}function ue(e){return e.classList||new fe(e)}function fe(e){this._node=e,this._names=ce(e.getAttribute("class")||"")}function de(e,t){for(var n=ue(e),r=-1,i=t.length;++r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ge(){this.textContent=""}function be(e){return function(){this.textContent=e}}function ye(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Oe(){this.innerHTML=""}function we(e){return function(){this.innerHTML=e}}function ke(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function xe(){this.nextSibling&&this.parentNode.appendChild(this)}function je(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Se(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===q&&t.documentElement.namespaceURI===q?t.createElement(e):t.createElementNS(n,e)}}function Ce(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}var Ee=function(e){var t=Y(e);return(t.local?Ce:Se)(t)};function Me(){return null}function Pe(){var e=this.parentNode;e&&e.removeChild(this)}function Te(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function De(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ae(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function _e(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,o=t.length;r=w&&(w=O+1);!(y=m[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=V);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==t?ne:"function"===typeof t?ie:re)(e,t,null==n?"":n)):oe(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?ae:"function"===typeof t?le:se)(e,t)):this.node()[e]},classed:function(e,t){var n=ce(e+"");if(arguments.length<2){for(var r=ue(this.node()),i=-1,o=n.length;++i>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?mt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?mt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ot.exec(e))?new yt(t[1],t[2],t[3],1):(t=at.exec(e))?new yt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=st.exec(e))?mt(t[1],t[2],t[3],t[4]):(t=lt.exec(e))?mt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ct.exec(e))?xt(t[1],t[2]/100,t[3]/100,1):(t=ut.exec(e))?xt(t[1],t[2]/100,t[3]/100,t[4]):ft.hasOwnProperty(e)?vt(ft[e]):"transparent"===e?new yt(NaN,NaN,NaN,0):null}function vt(e){return new yt(e>>16&255,e>>8&255,255&e,1)}function mt(e,t,n,r){return r<=0&&(e=t=n=NaN),new yt(e,t,n,r)}function gt(e){return e instanceof Ze||(e=pt(e)),e?new yt((e=e.rgb()).r,e.g,e.b,e.opacity):new yt}function bt(e,t,n,r){return 1===arguments.length?gt(e):new yt(e,t,n,null==r?1:r)}function yt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ot(){return"#"+kt(this.r)+kt(this.g)+kt(this.b)}function wt(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function kt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function xt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new St(e,t,n,r)}function jt(e){if(e instanceof St)return new St(e.h,e.s,e.l,e.opacity);if(e instanceof Ze||(e=pt(e)),!e)return new St;if(e instanceof St)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&l<1?0:a,new St(a,s,l,e.opacity)}function St(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ct(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Et(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}Ke(Ze,pt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:dt,formatHex:dt,formatHsl:function(){return jt(this).formatHsl()},formatRgb:ht,toString:ht}),Ke(yt,bt,Ge(Ze,{brighter:function(e){return e=null==e?et:Math.pow(et,e),new yt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Je:Math.pow(Je,e),new yt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ot,formatHex:Ot,formatRgb:wt,toString:wt})),Ke(St,(function(e,t,n,r){return 1===arguments.length?jt(e):new St(e,t,n,null==r?1:r)}),Ge(Ze,{brighter:function(e){return e=null==e?et:Math.pow(et,e),new St(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Je:Math.pow(Je,e),new St(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yt(Ct(e>=240?e-240:e+120,i,r),Ct(e,i,r),Ct(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Mt=function(e){return function(){return e}};function Pt(e,t){return function(n){return e+n*t}}function Tt(e){return 1===(e=+e)?Dt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Mt(isNaN(t)?n:t)}}function Dt(e,t){var n=t-e;return n?Pt(e,n):Mt(isNaN(e)?t:e)}var At=function e(t){var n=Tt(t);function r(e,t){var r=n((e=bt(e)).r,(t=bt(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Dt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function _t(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=ro&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:zt(n,r)})),o=Bt.lastIndex;return o=0&&t._call.call(null,e),t=t._next;--Ut}()}finally{Ut=0,function(){var e,t,n=Ft,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Ft=t);Wt=e,ln(r)}(),Gt=0}}function sn(){var e=Jt.now(),t=e-Kt;t>1e3&&(Zt-=t,Kt=e)}function ln(e){Ut||(Yt&&(Yt=clearTimeout(Yt)),e-Gt>24?(e<1/0&&(Yt=setTimeout(an,e-Jt.now()-Zt)),Xt&&(Xt=clearInterval(Xt))):(Xt||(Kt=Jt.now(),Xt=setInterval(sn,1e3)),Ut=1,en(an)))}rn.prototype=on.prototype={constructor:rn,restart:function(e,t,n){if("function"!==typeof e)throw new TypeError("callback is not a function");n=(null==n?tn():+n)+(null==t?0:+t),this._next||Wt===this||(Wt?Wt._next=this:Ft=this,Wt=this),this._call=e,this._time=n,ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,ln())}};var cn=function(e,t,n){var r=new rn;return t=null==t?0:+t,r.restart((function(n){r.stop(),e(n+t)}),t,n),r},un=C("start","end","cancel","interrupt"),fn=[],dn=function(e,t,n,r,i,o){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,i=e.__transition;function o(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(o){var c,u,f,d;if(1!==n.state)return l();for(c in i)if((d=i[c]).name===n.name){if(3===d.state)return cn(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function pn(e,t){var n=vn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function vn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}var mn,gn=function(e,t){var n,r,i,o=e.__transition,a=!0;if(o){for(i in t=null==t?null:t+"",o)(n=o[i]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete e.__transition}},bn=180/Math.PI,yn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},On=function(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:zt(e,t)})):t&&n.push(i(n)+"rotate("+t+r)}(o.rotate,a.rotate,s,l),function(e,t,n,o){e!==t?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:zt(e,t)}):t&&n.push(i(n)+"skewX("+t+r)}(o.skewX,a.skewX,s,l),function(e,t,n,r,o,a){if(e!==n||t!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:zt(e,n)},{i:s-2,x:zt(t,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,l),o=a=null,function(e){for(var t,n=-1,r=l.length;++n=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?hn:pn;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}var Hn=Ve.prototype.constructor;function Vn(e){return function(){this.style.removeProperty(e)}}function qn(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Un(e,t,n){var r,i;function o(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&qn(e,o,n)),r}return o._value=t,o}function Yn(e){return function(t){this.textContent=e.call(this,t)}}function Xn(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Yn(r)),t}return r._value=e,r}var Kn=0;function Gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zn(){return++Kn}var Jn=Ve.prototype;Gn.prototype=function(e){return Ve().transition(e)}.prototype=Object(E.a)({constructor:Gn,select:function(e){var t=this._name,n=this._id;"function"!==typeof e&&(e=P(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a1&&B()}else i=C[0][0],l=C[0][1],d=C[1][0],p=C[1][1];s=i,c=l,h=d,v=p;var L=qe(y).attr("pointer-events","none"),I=L.selectAll(".overlay").attr("cursor",gr[O]);gn(y);var z=f(y,arguments,!0).beforestart();if(n.touches)z.moved=Q,z.ended=F;else{var $=qe(n.view).on("mousemove.brush",Q,!0).on("mouseup.brush",F,!0);a&&$.on("keydown.brush",W,!0).on("keyup.brush",H,!0),Ye(n.view)}u.call(y),z.start(n,w.name)}function Q(e){var t,n=Object(o.a)(e.changedTouches||[e]);try{for(n.s();!(t=n.n()).done;){var r,i=t.value,a=Object(o.a)(R);try{for(a.s();!(r=a.n()).done;){var s=r.value;s.identifier===i.identifier&&(s.cur=qt(i,y))}}catch(d){a.e(d)}finally{a.f()}}}catch(d){n.e(d)}finally{n.f()}if(_&&!g&&!b&&1===R.length){var l=R[0];ur(l.cur[0]-l[0])>ur(l.cur[1]-l[1])?b=!0:g=!0}var c,u=Object(o.a)(R);try{for(u.s();!(c=u.n()).done;){var f=c.value;f.cur&&(f[0]=f.cur[0],f[1]=f.cur[1])}}catch(d){u.e(d)}finally{u.f()}m=!0,or(e),B(e)}function B(e){var t,n=R[0],r=n.point0;switch(D=n[0]-r[0],A=n[1]-r[1],w){case sr:case ar:k&&(D=fr(E-i,dr(P-d,D)),s=i+D,h=d+D),x&&(A=fr(M-l,dr(T-p,A)),c=l+A,v=p+A);break;case lr:R[1]?(k&&(s=fr(E,dr(P,R[0][0])),h=fr(E,dr(P,R[1][0])),k=1),x&&(c=fr(M,dr(T,R[0][1])),v=fr(M,dr(T,R[1][1])),x=1)):(k<0?(D=fr(E-i,dr(P-i,D)),s=i+D,h=d):k>0&&(D=fr(E-d,dr(P-d,D)),s=i,h=d+D),x<0?(A=fr(M-l,dr(T-l,A)),c=l+A,v=p):x>0&&(A=fr(M-p,dr(T-p,A)),c=l,v=p+A));break;case cr:k&&(s=fr(E,dr(P,i-D*k)),h=fr(E,dr(P,d+D*k))),x&&(c=fr(M,dr(T,l-A*x)),v=fr(M,dr(T,p+A*x)))}h0&&(i=s-D),x<0?p=v-A:x>0&&(l=c-A),w=sr,I.attr("cursor",gr.selection),B());break;default:return}or(e)}function H(e){switch(e.keyCode){case 16:_&&(g=b=_=!1,B());break;case 18:w===cr&&(k<0?d=h:k>0&&(i=s),x<0?p=v:x>0&&(l=c),w=lr,B());break;case 32:w===sr&&(e.altKey?(k&&(d=h-D*k,i=s+D*k),x&&(p=v-A*x,l=c+A*x),w=cr):(k<0?d=h:k>0&&(i=s),x<0?p=v:x>0&&(l=c),w=lr),I.attr("cursor",gr[O]),B());break;default:return}or(e)}}function p(e){f(this,arguments).moved(e)}function v(e){f(this,arguments).ended(e)}function m(){var t=this.__brush||{selection:null};return t.extent=pr(n.apply(this,arguments)),t.dim=e,t}return c.move=function(t,n){t.tween?t.on("start.brush",(function(e){f(this,arguments).beforestart().start(e)})).on("interrupt.brush end.brush",(function(e){f(this,arguments).end(e)})).tween("brush",(function(){var t=this,r=t.__brush,i=f(t,arguments),o=r.selection,a=e.input("function"===typeof n?n.apply(this,arguments):n,r.extent),s=Vt(o,a);function l(e){r.selection=1===e&&null===a?null:s(e),u.call(t),i.brush()}return null!==o&&null!==a?l:l(1)})):t.each((function(){var t=this,r=arguments,i=t.__brush,o=e.input("function"===typeof n?n.apply(t,r):n,i.extent),a=f(t,r).beforestart();gn(t),i.selection=null===o?null:o,u.call(t),a.start().brush().end()}))},c.clear=function(e){c.move(e,null)},d.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(e,t){return this.starting?(this.starting=!1,this.emit("start",e,t)):this.emit("brush",e),this},brush:function(e,t){return this.emit("brush",e,t),this},end:function(e,t){return 0===--this.active&&(delete this.state.emitter,this.emit("end",e,t)),this},emit:function(t,n,r){var i=qe(this.that).datum();s.call(t,this.that,new rr(t,{sourceEvent:n,target:c,selection:e.output(this.state.selection),mode:r,dispatch:s}),i)}},c.extent=function(e){return arguments.length?(n="function"===typeof e?e:nr(pr(e)),c):n},c.filter=function(e){return arguments.length?(r="function"===typeof e?e:nr(!!e),c):r},c.touchable=function(e){return arguments.length?(i="function"===typeof e?e:nr(!!e),c):i},c.handleSize=function(e){return arguments.length?(l=+e,c):l},c.keyModifiers=function(e){return arguments.length?(a=!!e,c):a},c.on=function(){var e=s.on.apply(s,arguments);return e===s?c:e},c}var Tr=Math.sqrt(50),Dr=Math.sqrt(10),Ar=Math.sqrt(2);function _r(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Tr?10:o>=Dr?5:o>=Ar?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Tr?10:o>=Dr?5:o>=Ar?2:1)}function Rr(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Tr?i*=10:o>=Dr?i*=5:o>=Ar&&(i*=2),tt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Hr:Wr,i=o=null,f}function f(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return f.invert=function(n){return c(t((o||(o=r(s,a.map(e),zt)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,$r),u()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),l=zr,u()},f.clamp=function(e){return arguments.length?(c=!!e||Br,u()):c!==Br},f.interpolate=function(e){return arguments.length?(l=e,u()):l},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,u()}}function Ur(){return qr()(Br,Br)}function Yr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Xr=n(128),Kr=n(57),Gr=n(417);function Zr(e,t,n,r){var i,o=Rr(e,t,n);switch((r=Object(Xr.a)(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Object(Kr.a)(t)/3)))-Object(Kr.a)(Math.abs(e)))}(o,a))||(r.precision=i),Object(Gr.b)(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Object(Kr.a)(t)-Object(Kr.a)(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Object(Kr.a)(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Object(Gr.a)(r)}function Jr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s0;){if((i=_r(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function ei(){var e=Ur();return e.copy=function(){return Vr(e,ei())},Yr.apply(e,arguments),Jr(e)}var ti=Symbol("implicit");function ni(){var e=new Map,t=[],n=[],r=ti;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==ti)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Map;var r,a=Object(o.a)(n);try{for(a.s();!(r=a.n()).done;){var s=r.value,l=s+"";e.has(l)||e.set(l,t.push(s))}}catch(c){a.e(c)}finally{a.f()}return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return ni(t,n).unknown(r)},Yr.apply(i,arguments),i}var ri=new Date,ii=new Date;function oi(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return ri.setTime(+t),ii.setTime(+r),e(ri),e(ii),Math.floor(n(ri,ii))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}var ai=oi((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));ai.every=function(e){return isFinite(e=Math.floor(e))&&e>0?oi((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var si=ai,li=(ai.range,oi((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),ci=li,ui=(li.range,1e3),fi=6e4,di=36e5,hi=864e5,pi=6048e5;function vi(e){return oi((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fi)/pi}))}var mi=vi(0),gi=vi(1),bi=vi(2),yi=vi(3),Oi=vi(4),wi=vi(5),ki=vi(6),xi=(mi.range,gi.range,bi.range,yi.range,Oi.range,wi.range,ki.range,oi((function(e){return e.setHours(0,0,0,0)}),(function(e,t){return e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fi)/hi}),(function(e){return e.getDate()-1}))),ji=xi,Si=(xi.range,oi((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*ui-e.getMinutes()*fi)}),(function(e,t){e.setTime(+e+t*di)}),(function(e,t){return(t-e)/di}),(function(e){return e.getHours()}))),Ci=Si,Ei=(Si.range,oi((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*ui)}),(function(e,t){e.setTime(+e+t*fi)}),(function(e,t){return(t-e)/fi}),(function(e){return e.getMinutes()}))),Mi=Ei,Pi=(Ei.range,oi((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*ui)}),(function(e,t){return(t-e)/ui}),(function(e){return e.getUTCSeconds()}))),Ti=Pi,Di=(Pi.range,oi((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));Di.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?oi((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Di:null};var Ai=Di;Di.range;function _i(e){return oi((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/pi}))}var Ri=_i(0),Ni=_i(1),Li=_i(2),Ii=_i(3),zi=_i(4),$i=_i(5),Qi=_i(6),Bi=(Ri.range,Ni.range,Li.range,Ii.range,zi.range,$i.range,Qi.range,oi((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/hi}),(function(e){return e.getUTCDate()-1}))),Fi=Bi,Wi=(Bi.range,oi((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));Wi.every=function(e){return isFinite(e=Math.floor(e))&&e>0?oi((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var Hi=Wi;Wi.range;function Vi(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function qi(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ui(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var Yi,Xi,Ki={"-":"",_:" ",0:"0"},Gi=/^\s*\d+/,Zi=/^%/,Ji=/[\\^$*+?|[\]().{}]/g;function eo(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function fo(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ho(e,t,n){var r=Gi.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function po(e,t,n){var r=Gi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function vo(e,t,n){var r=Gi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function mo(e,t,n){var r=Gi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function go(e,t,n){var r=Gi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function bo(e,t,n){var r=Gi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yo(e,t,n){var r=Gi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Oo(e,t,n){var r=Gi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function wo(e,t,n){var r=Gi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ko(e,t,n){var r=Zi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function xo(e,t,n){var r=Gi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jo(e,t,n){var r=Gi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function So(e,t){return eo(e.getDate(),t,2)}function Co(e,t){return eo(e.getHours(),t,2)}function Eo(e,t){return eo(e.getHours()%12||12,t,2)}function Mo(e,t){return eo(1+ji.count(si(e),e),t,3)}function Po(e,t){return eo(e.getMilliseconds(),t,3)}function To(e,t){return Po(e,t)+"000"}function Do(e,t){return eo(e.getMonth()+1,t,2)}function Ao(e,t){return eo(e.getMinutes(),t,2)}function _o(e,t){return eo(e.getSeconds(),t,2)}function Ro(e){var t=e.getDay();return 0===t?7:t}function No(e,t){return eo(mi.count(si(e)-1,e),t,2)}function Lo(e){var t=e.getDay();return t>=4||0===t?Oi(e):Oi.ceil(e)}function Io(e,t){return e=Lo(e),eo(Oi.count(si(e),e)+(4===si(e).getDay()),t,2)}function zo(e){return e.getDay()}function $o(e,t){return eo(gi.count(si(e)-1,e),t,2)}function Qo(e,t){return eo(e.getFullYear()%100,t,2)}function Bo(e,t){return eo((e=Lo(e)).getFullYear()%100,t,2)}function Fo(e,t){return eo(e.getFullYear()%1e4,t,4)}function Wo(e,t){var n=e.getDay();return eo((e=n>=4||0===n?Oi(e):Oi.ceil(e)).getFullYear()%1e4,t,4)}function Ho(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+eo(t/60|0,"0",2)+eo(t%60,"0",2)}function Vo(e,t){return eo(e.getUTCDate(),t,2)}function qo(e,t){return eo(e.getUTCHours(),t,2)}function Uo(e,t){return eo(e.getUTCHours()%12||12,t,2)}function Yo(e,t){return eo(1+Fi.count(Hi(e),e),t,3)}function Xo(e,t){return eo(e.getUTCMilliseconds(),t,3)}function Ko(e,t){return Xo(e,t)+"000"}function Go(e,t){return eo(e.getUTCMonth()+1,t,2)}function Zo(e,t){return eo(e.getUTCMinutes(),t,2)}function Jo(e,t){return eo(e.getUTCSeconds(),t,2)}function ea(e){var t=e.getUTCDay();return 0===t?7:t}function ta(e,t){return eo(Ri.count(Hi(e)-1,e),t,2)}function na(e){var t=e.getUTCDay();return t>=4||0===t?zi(e):zi.ceil(e)}function ra(e,t){return e=na(e),eo(zi.count(Hi(e),e)+(4===Hi(e).getUTCDay()),t,2)}function ia(e){return e.getUTCDay()}function oa(e,t){return eo(Ni.count(Hi(e)-1,e),t,2)}function aa(e,t){return eo(e.getUTCFullYear()%100,t,2)}function sa(e,t){return eo((e=na(e)).getUTCFullYear()%100,t,2)}function la(e,t){return eo(e.getUTCFullYear()%1e4,t,4)}function ca(e,t){var n=e.getUTCDay();return eo((e=n>=4||0===n?zi(e):zi.ceil(e)).getUTCFullYear()%1e4,t,4)}function ua(){return"+0000"}function fa(){return"%"}function da(e){return+e}function ha(e){return Math.floor(+e/1e3)}Yi=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=no(i),u=ro(i),f=no(o),d=ro(o),h=no(a),p=ro(a),v=no(s),m=ro(s),g=no(l),b=ro(l),y={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:So,e:So,f:To,g:Bo,G:Wo,H:Co,I:Eo,j:Mo,L:Po,m:Do,M:Ao,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:da,s:ha,S:_o,u:Ro,U:No,V:Io,w:zo,W:$o,x:null,X:null,y:Qo,Y:Fo,Z:Ho,"%":fa},O={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Vo,e:Vo,f:Ko,g:sa,G:ca,H:qo,I:Uo,j:Yo,L:Xo,m:Go,M:Zo,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:da,s:ha,S:Jo,u:ea,U:ta,V:ra,w:ia,W:oa,x:null,X:null,y:aa,Y:la,Z:ua,"%":fa},w={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return j(e,t,n,r)},d:vo,e:vo,f:wo,g:uo,G:co,H:go,I:go,j:mo,L:Oo,m:po,M:bo,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:ho,Q:xo,s:jo,S:yo,u:oo,U:ao,V:so,w:io,W:lo,x:function(e,t,r){return j(e,n,t,r)},X:function(e,t,n){return j(e,r,t,n)},y:uo,Y:co,Z:fo,"%":ko};function k(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=qi(Ui(o.y,0,1))).getUTCDay(),r=i>4||0===i?Ni.ceil(r):Ni(r),r=Fi.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Vi(Ui(o.y,0,1))).getDay(),r=i>4||0===i?gi.ceil(r):gi(r),r=ji.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?qi(Ui(o.y,0,1)).getUTCDay():Vi(Ui(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,qi(o)):Vi(o)}}function j(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in Ki?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return y.x=k(n,y),y.X=k(r,y),y.c=k(t,y),O.x=k(n,O),O.X=k(r,O),O.c=k(t,O),{format:function(e){var t=k(e+="",y);return t.toString=function(){return e},t},parse:function(e){var t=x(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",O);return t.toString=function(){return e},t},utcParse:function(e){var t=x(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Xi=Yi.format,Yi.parse,Yi.utcFormat,Yi.utcParse;var pa=1e3,va=6e4,ma=36e5,ga=864e5,ba=2592e6,ya=31536e6;function Oa(e){return new Date(e)}function wa(e){return e instanceof Date?+e:+new Date(+e)}function ka(e,t,n,r,o,a,s,l,c){var u=Ur(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),v=c("%I:%M"),m=c("%I %p"),g=c("%a %d"),b=c("%b %d"),y=c("%B"),O=c("%Y"),w=[[s,1,pa],[s,5,5e3],[s,15,15e3],[s,30,3e4],[a,1,va],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,ma],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,ga],[r,2,1728e5],[n,1,6048e5],[t,1,ba],[t,3,7776e6],[e,1,ya]];function k(i){return(s(i)180||n<-180?n-360*Math.round(n/360):n):Mt(isNaN(e)?t:e)}));var $a=za(Dt),Qa=($a(La(-100,.75,.35),La(80,1.5,.8)),$a(La(260,.75,.35),La(80,1.5,.8)),La()),Ba=function(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Qa.h=360*e-100,Qa.s=1.5-1.5*t,Qa.l=.8-.9*t,Qa+""},Fa=Math.PI,Wa=2*Fa,Ha=1e-6,Va=Wa-Ha;function qa(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ua(){return new qa}qa.prototype=Ua.prototype={constructor:qa,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,f=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>Ha)if(Math.abs(u*s-l*c)>Ha&&i){var d=n-o,h=r-a,p=s*s+l*l,v=d*d+h*h,m=Math.sqrt(p),g=Math.sqrt(f),b=i*Math.tan((Fa-Math.acos((p+f-v)/(2*m*g)))/2),y=b/g,O=b/m;Math.abs(y-1)>Ha&&(this._+="L"+(e+y*c)+","+(t+y*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*h)+","+(this._x1=e+O*s)+","+(this._y1=t+O*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Ha||Math.abs(this._y1-c)>Ha)&&(this._+="L"+l+","+c),n&&(f<0&&(f=f%Wa+Wa),f>Va?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):f>Ha&&(this._+="A"+n+","+n+",0,"+ +(f>=Fa)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Ya=Ua,Xa=(Array.prototype.slice,function(e){return function(){return e}});function Ka(e){this._context=e}Ka.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ga=function(e){return new Ka(e)};function Za(e){return e[0]}function Ja(e){return e[1]}var es=function(e,t){var n=Xa(!0),r=null,i=Ga,o=null;function a(a){var s,l,c,u=(a=function(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}(a)).length,f=!1;for(null==r&&(o=i(c=Ya())),s=0;s<=u;++s)!(s1&&void 0!==arguments[1]?arguments[1]:e;return new l(e,t,this)}}]),e}();s.prototype.startSide=s.prototype.endSide=0,s.prototype.point=!1,s.prototype.mapMode=a.h.TrackDel;var l=function e(t,n,r){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r};function c(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var u=500,f=1e9,d=function(){function e(t,n,r,o){Object(i.a)(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=o}return Object(o.a)(e,[{key:"findIndex",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t*f,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(e<=0)return r;for(var i=t<0?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,l=i[s]-e||(t<0?this.value[s].startSide:this.value[s].endSide)-n;if(s==o)return l>=0?o:a;l>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1),o=this.findIndex(n,1,void 0,i);i(h=n.mapPos(f,c.endSide))||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-a),o.push(h-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}},{key:"length",get:function(){return this.to[this.to.length-1]}}]),e}(),h=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.empty,o=arguments.length>3?arguments[3]:void 0;Object(i.a)(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=o}return Object(o.a)(e,[{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,o=void 0!==i&&i,a=t.filter,s=t.filterFrom,u=void 0===s?0:s,f=t.filterTo,d=void 0===f?this.length:f;if(0==r.length&&!a)return this;if(o&&r.slice().sort(c),this==e.empty)return r.length?e.of(r):this;for(var h=new v(this,null,-1).goto(0),m=0,g=[],b=new p;h.value||m=0){var y=r[m++];b.addInner(y.from,y.to,y.value)||g.push(y)}else 1==h.rangeIndex&&h.chunkIndexthis.chunkEnd(h.chunkIndex)||dh.to||d=o&&t<=o+a.length&&!1===a.between(o,t-o,n-o,r))return}this.nextLayer.between(t,n,r)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return m.from([this]).goto(e)}},{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this==e.empty)return 0;var t,n=this.nextLayer.size,i=Object(r.a)(this.chunk);try{for(i.s();!(t=i.n()).done;){n+=t.value.value.length}}catch(o){i.e(o)}finally{i.f()}return n}}],[{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return m.from(e).goto(t)}},{key:"compare",value:function(t,n,i,o){var a,s=null!==(a=o.minPointSize)&&void 0!==a?a:-1,l=t.filter((function(t){return t.maxPoint>=500||t!=e.empty&&n.indexOf(t)<0&&t.maxPoint>=s})),c=n.filter((function(n){return n.maxPoint>=500||n!=e.empty&&t.indexOf(n)<0&&n.maxPoint>=s})),f=function(e,t){var n,i=new Map,o=Object(r.a)(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0;sl?1:0)):l>a&&(r.span(a,l,o.active,s),s=o.openEnd(l)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new p,o=Object(r.a)(e instanceof l?[e]:n?e.slice().sort(c):e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return i.finish()}}]),e}();h.empty=new h([],[],null,-1),h.empty.nextLayer=h.empty;var p=function(){function e(){Object(i.a)(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-f,this.lastTo=-f,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Object(o.a)(e,[{key:"finishChunk",value:function(e){this.chunks.push(new d(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(e,t,n){var r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}},{key:"addChunk",value:function(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);var n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}},{key:"finish",value:function(){return this.finishInner(h.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=new h(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();var v=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=o}return Object(o.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"nextChunk",value:function(){this.chunkIndex++,this.rangeIndex=0,this.next()}},{key:"compare",value:function(e){return this.from-e.from||this.startSide-e.startSide||this.to-e.to||this.endSide-e.endSide}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}}]),e}(),m=function(){function e(t){Object(i.a)(this,e),this.heap=t}return Object(o.a)(e,[{key:"goto",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f,i=Object(r.a)(this.heap);try{for(i.s();!(t=i.n()).done;){var o=t.value;o.goto(e,n)}}catch(s){i.e(s)}finally{i.f()}for(var a=this.heap.length>>1;a>=0;a--)g(this.heap,a);return this.next(),this}},{key:"forward",value:function(e,t){var n,i=Object(r.a)(this.heap);try{for(i.s();!(n=i.n()).done;){n.value.forward(e,t)}}catch(a){i.e(a)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)g(this.heap,o);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=f,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),g(this.heap,0)}}},{key:"startSide",get:function(){return this.value?this.value.startSide:0}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new v(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function g(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var b=function(){function e(t,n,r){Object(i.a)(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-f,this.endSide=0,this.openStart=-1,this.cursor=m.from(t,n,r)}return Object(o.a)(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-f;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){w(this.active,e),w(this.activeTo,e),w(this.activeRank,e),this.minActive=x(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),t&&w(t,r)}else{if(!this.cursor.value){this.to=this.endSide=f;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var i=this.cursor.value;if(i.point){this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.frome&&this.forward(this.to,this.endSide);break}this.addActive(t),this.cursor.next()}}if(t){for(var o=0;othis.pointRank);n++)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>this.point.endSide)&&t.push(this.active[n]);return t}},{key:"openEnd",value:function(e){for(var t=0;te;)t++;return t}}]),e}();function y(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,l=r-t;;){var c=e.to+l-n.to||e.endSide-n.endSide,u=c<0?e.to+l:n.to,f=Math.min(u,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))||o.comparePoint(s,f,e.point,n.point):f>s&&!O(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),u>a)break;s=u,c<=0&&e.next(),c>=0&&n.next()}}function O(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function x(e,t){for(var n=-1,r=f,i=0;i-1?n.panels[r]:null}var d=a.f.fromClass(function(){function e(t){Object(r.a)(this,e),this.specs=t.state.facet(u),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(l);this.top=new p(t,!0,n.topContainer),this.bottom=new p(t,!1,n.bottomContainer),this.top.sync(this.panels.filter((function(e){return e.top}))),this.bottom.sync(this.panels.filter((function(e){return!e.top})));var i,a=Object(o.a)(this.panels);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.dom.className+=" "+h(s),s.mount&&s.mount()}}catch(c){a.e(c)}finally{a.f()}}return Object(i.a)(e,[{key:"update",value:function(e){var t=e.state.facet(l);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new p(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new p(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(u);if(n!=this.specs){var r,i=[],a=[],s=[],c=[],f=Object(o.a)(n);try{for(f.s();!(r=f.n()).done;){var d=r.value,v=this.specs.indexOf(d),m=void 0;v<0?(m=d(e.view),c.push(m)):(m=this.panels[v]).update&&m.update(e),i.push(m),(m.top?a:s).push(m)}}catch(x){f.e(x)}finally{f.f()}this.specs=n,this.panels=i,this.top.sync(a),this.bottom.sync(s);for(var g=0,b=c;g0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,f=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(345)},,function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),t)for(var s=0;s1?r[0]+r.slice(2):r,+e.slice(n+1)]}n.d(t,"b",(function(){return r})),t.a=function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}},function(e,t,n){e.exports=function(){"use strict";var e="millisecond",t="second",n="minute",r="hour",i="day",o="week",a="month",s="quarter",l="year",c="date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},p={s:h,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+h(r,2,"0")+":"+h(i,2,"0")},m:function e(t,n){if(t.date()0&&m(t.state,l.head-1,1,a)||a.afterCursor&&(m(t.state,l.head,1,a)||l.head0&&void 0!==arguments[0]?arguments[0]:{};return[u.of(e),h]}function v(e,t,n){var r=e.prop(t<0?a.c.openedBy:a.c.closedBy);if(r)return r;if(1==e.name.length){var i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function m(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.maxScanDistance||l,a=i.brackets||c,s=e.tree,u=s.resolve(t,n);return(r=v(u.type,n,a))?g(e,t,n,u,r,a):b(e,t,n,s,u.type,o,a)}function g(e,t,n,r,i,o){var a=r.parent,s={from:r.start,to:r.end},l=0;return a&&a.iterate({from:n<0?r.start:r.end,to:n<0?a.start:a.end,enter:function(e,t,a){if(!(n<0?a>r.start:t-1)return{start:s,end:{from:t,to:a},matched:!0};if(v(e,n,o))l++;else if(v(e,-n,o)&&0==--l)return{start:s,end:{from:t,to:a},matched:!1};return!1}}})||{start:s,matched:!1}}function b(e,t,n,r,i,o,a){var s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,d=0;!u.next().done&&d<=o;){var h=u.value;n<0&&(d+=h.length);for(var p=t+d*n,v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){var g=a.indexOf(h[v]);if(!(g<0||r.resolve(p+v,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:c,end:{from:p+v,to:p+v+1},matched:g>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(38);function i(e,t,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(24),o=!0,a=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:d,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(28);function i(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";var r=n(197),i=Object(r.a)();t.a=i},function(e,t,n){"use strict";var r=n(350);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},,function(e,t,n){"use strict";e.exports=n(341)},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function o(e){return e.startAdornment}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return J})),n.d(t,"b",(function(){return ee})),n.d(t,"c",(function(){return K}));n(16);var r=n(25),i=n(19),o=n(18),a=n(4),s=n(5),l=n(7),c=n(91),u=n(3),f=n(9),d=n(15),h=function(){function e(t,n,r){Object(s.a)(this,e),this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}return Object(l.a)(e,[{key:"tokenBefore",value:function(e){for(var t=this.state.tree.resolve(this.pos,-1);t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.start,to:this.pos,text:this.state.sliceDoc(t.start,this.pos),type:t.type}:null}},{key:"matchBefore",value:function(e){var t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.slice(n-t.from,this.pos-t.from),i=r.search(m(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}},{key:"addEventListener",value:function(e,t){this.abortListeners&&this.abortListeners.push(t)}},{key:"aborted",get:function(){return null==this.abortListeners}}]),e}(),p=function e(t,n,r){Object(s.a)(this,e),this.completion=t,this.source=n,this.match=r};function v(e){return e.selection.primary.head}function m(e,t){var n,r=e.source,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?new RegExp("".concat(i?"^":"","(?:").concat(r,")").concat(o?"$":""),null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}function g(e,t){var n=t.completion.apply||t.completion.label,r=t.source;"string"==typeof n?e.dispatch({changes:{from:r.from,to:r.to,insert:n},selection:{anchor:r.from+n.length}}):n(e,t.completion,r.from,r.to)}var b=function(){function e(t){Object(s.a)(this,e),this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(var n=0;n=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(j=Object(d.f)(x))!=j.toLowerCase()?1:j!=j.toUpperCase()?2:0;(1==S||0==k&&0!=S&&(this.chars[v]==x||this.folded[v]==x&&(m=!0)))&&(o[v++]=O),k=S,O+=Object(d.c)(x)}return v==l&&0==o[0]?this.result((m?-200:0)-100,o,e):g==l&&0==b?[-200,0,y]:s>-1?[-700,s,s+this.pattern.length]:g==l?[-900,b,y]:v==l?this.result((m?-200:0)-100-700,o,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}},{key:"result",value:function(e,t,n){var r,i=[e],o=1,s=Object(a.a)(t);try{for(s.s();!(r=s.n()).done;){var l=r.value,c=l+(this.astral?Object(d.c)(Object(d.b)(n,l)):1);o>1&&i[o-1]==l?i[o-1]=c:(i[o++]=l,i[o++]=c)}}catch(u){s.e(u)}finally{s.f()}return i}}]),e}(),y=u.f.define({combine:function(e){return Object(u.m)(e,{activateOnTyping:!0,override:null,maxRenderedOptions:100})}}),O=f.d.baseTheme({"$tooltip.autocomplete":{"& > ul":{fontFamily:"monospace",overflowY:"auto",whiteSpace:"nowrap",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2},"& > li[aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"}}},"$completionListIncompleteTop:before, $completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},"$tooltip.completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},"$tooltip.completionInfo.left":{right:"100%"},"$tooltip.completionInfo.right":{left:"100%"},"$$light $snippetField":{backgroundColor:"#ddd"},"$$dark $snippetField":{backgroundColor:"#333"},$snippetFieldPosition:{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},$completionMatchedText:{textDecoration:"underline"},$completionDetail:{marginLeft:"0.5em",fontStyle:"italic"},$completionIcon:{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},"$completionIcon.function, $completionIcon.method":{"&:after":{content:"'\u0192'"}},"$completionIcon.class":{"&:after":{content:"'\u25cb'"}},"$completionIcon.interface":{"&:after":{content:"'\u25cc'"}},"$completionIcon.variable":{"&:after":{content:"'\ud835\udc65'"}},"$completionIcon.constant":{"&:after":{content:"'\ud835\udc36'"}},"$completionIcon.type":{"&:after":{content:"'\ud835\udc61'"}},"$completionIcon.enum":{"&:after":{content:"'\u222a'"}},"$completionIcon.property":{"&:after":{content:"'\u25a1'"}},"$completionIcon.keyword":{"&:after":{content:"'\ud83d\udd11\ufe0e'"}},"$completionIcon.namespace":{"&:after":{content:"'\u25a2'"}},"$completionIcon.text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});function w(e,t,n){var r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true");for(var i=n.from;ip&&u.appendChild(document.createTextNode(d.slice(p,m)));var b=u.appendChild(document.createElement("span"));b.appendChild(document.createTextNode(d.slice(m,g))),b.className=Object(f.n)("completionMatchedText"),p=g}if(p>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var x=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.stateField=n,this.info=null,this.placeInfo={read:function(){return r.measureInfo()},write:function(e){return r.positionInfo(e)},key:this};var i=t.state.field(n),o=i.open,a=o.options,l=o.selected,c=t.state.facet(y);this.range=k(a.length,l,c.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.addEventListener("mousedown",(function(e){for(var n=r.range.from,i=e.target;i&&i!=r.list&&i.parentNode!=r.list;)i=i.parentNode;for(;i=i.previousSibling;)n++;n>=0&&n=this.range.to)&&(this.range=k(n.options.length,n.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(w(n.options,t.id,this.range)),this.list.addEventListener("scroll",(function(){e.info&&e.view.requestMeasure(e.placeInfo)}))),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);var r=n.options[n.selected];r.completion.info&&(this.info=this.dom.appendChild(function(e){var t=document.createElement("div");t.className=Object(f.n)("tooltip.completionInfo");var n=e.completion.info;return"string"==typeof n?t.textContent=n:t.appendChild(n(e.completion)),t}(r)),this.view.requestMeasure(this.placeInfo))}}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e)return null;var t=this.dom.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;if(n<0||n>this.list.clientHeight-10)return null;var r=this.view.textDirection==f.c.RTL,i=t.left,o=innerWidth-t.right;return r&&i=this.options.length?this:new e(this.options,C(n,t),this.tooltip,this.timestamp,t)}},{key:"map",value:function(t){return new e(this.options,this.attrs,[Object.assign(Object.assign({},this.tooltip[0]),{pos:t.mapPos(this.tooltip[0].pos)})],this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i){var o=function(e,t){var n,r=[],i=Object(a.a)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.hasResult()){var s,l=new b(t.sliceDoc(o.from,o.to)),c=void 0,u=Object(a.a)(o.result.options);try{for(u.s();!(s=u.n()).done;){var f=s.value;(c=l.match(f.label))&&(null!=f.boost&&(c[0]+=f.boost),r.push(new p(f,o,c)))}}catch(d){u.e(d)}finally{u.f()}}}}catch(d){i.e(d)}finally{i.f()}return r.sort(P),r.length>300?r.slice(0,300):r}(t,n);if(!o.length)return null;var s,l=0;if(i)for(var c=i.options[i.selected].completion,u=0;uo?new T(this.source,"input"==t&&r.activateOnTyping?1:0,!1):this.span&&(i==o||this.span.test(e.state.sliceDoc(i,o)))?new n(this.source,this.explicit,this.result,i,o,this.span):new T(this.source,1,this.explicit)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new T(this.source,0,!1):new n(this.source,this.explicit,this.result,e.changes.mapPos(this.from),e.changes.mapPos(this.to,1),this.span)}},{key:"map",value:function(e){return new n(this.source,this.explicit,this.result,e.mapPos(this.from),e.mapPos(this.to,1),this.span)}}]),n}(T),A=u.i.define(),_=u.i.define({map:function(e,t){return e.map((function(e){return e.hasResult()&&!t.empty?e.map(t):e}))}}),R=u.i.define(),N=u.j.define({create:function(){return S.start()},update:function(e,t){return e.update(t)},provide:[c.b.nFrom((function(e){return e.tooltip})),f.d.contentAttributes.from((function(e){return e.attrs}))]});function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(N,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,o=1;"page"==t&&(i=n.dom.querySelector(".cm-tooltip-autocomplete"))&&(o=Math.max(2,Math.floor(i.offsetHeight/i.firstChild.offsetHeight)));var a=r.open.selected+o*(e?1:-1),s=r.open.options.length;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:R.of(a)}),!0}}var I=function(e){var t=e.state.field(N,!1);return!(!t||!t.open||Date.now()-t.open.timestamp<75)&&(g(e,t.open.options[t.open.selected]),!0)},z=function e(t,n){Object(s.a)(this,e),this.source=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0},$=f.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1;var n,r=Object(a.a)(t.state.field(N).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(o){r.e(o)}finally{r.f()}}return Object(l.a)(e,[{key:"update",value:function(e){var t=this,n=e.state.field(N);if(e.selectionSet||e.docChanged||e.prevState.field(N)!=n){for(var i=e.transactions.some((function(e){var t=e.annotation(u.l.userEvent);return(e.selection||e.docChanged)&&"input"!=t&&"delete"!=t})),o=0;o50&&s.time-Date.now()>1e3){var l,c=Object(a.a)(s.context.abortListeners);try{for(c.s();!(l=c.n()).done;){var d=l.value;try{d()}catch(p){Object(f.l)(this.view.state,p)}}}catch(v){c.e(v)}finally{c.f()}s.context.abortListeners=null,this.running.splice(o--,1)}else{var h;(h=s.updates).push.apply(h,Object(r.a)(e.transactions))}}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=this.view.state.field(N),r=Object(a.a)(n.active);try{var i=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.source==n.source}))||e.startQuery(n)};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=v(n),i=new h(n,r,e.explicit),o=new z(e.source,i);this.running.push(o),Promise.resolve(e.source(i)).then((function(e){o.context.aborted||(o.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:A.of(!1)}),Object(f.l)(t.view.state,e)}))}},{key:"scheduleAccept",value:function(){var e=this;this.running.every((function(e){return void 0!==e.done}))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((function(){return e.accept()}),50))}},{key:"accept",value:function(){var e,t=this;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;for(var n=[],r=this.view.state.facet(y),i=function(i){var s=t.running[i];if(void 0===s.done)return o=i,"continue";if(t.running.splice(i--,1),s.done){var l,c=new D(s.source,s.context.explicit,s.done,s.done.from,null!==(e=s.done.to)&&void 0!==e?e:v(s.updates.length?s.updates[0].startState:t.view.state),s.done.span?m(s.done.span,!0):null),u=Object(a.a)(s.updates);try{for(u.s();!(l=u.n()).done;){var f=l.value;c=c.update(f,r)}}catch(y){u.e(y)}finally{u.f()}if(c.hasResult())return n.push(c),o=i,"continue"}var d=t.view.state.field(N).active.find((function(e){return e.source==s.source}));if(d&&1==d.state)if(null==s.done){var h,p=new T(s.source,0,!1),g=Object(a.a)(s.updates);try{for(g.s();!(h=g.n()).done;){var b=h.value;p=p.update(b,r)}}catch(y){g.e(y)}finally{g.f()}1!=p.state&&n.push(p)}else t.startQuery(d);o=i},o=0;o=e.to}))}))}}]),e}(),q=u.i.define({map:function(e,t){return e&&e.map(t)}}),U=u.i.define(),Y=u.j.define({create:function(){return null},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(q))return i.value;if(i.is(U)&&e)return new V(e.ranges,i.value)}}catch(o){r.e(o)}finally{r.f()}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:[f.d.decorations.from((function(e){return e?e.deco:f.b.none}))]});function X(e,t){return u.d.create(e.filter((function(e){return e.field==t})).map((function(e){return u.d.range(e.from,e.to)})))}function K(e){var t=F.parse(e);return function(e,n,r,i){var o=t.instantiate(e.state,r),a=o.text,s=o.ranges,l={changes:{from:r,to:i,insert:u.k.of(a)}};s.length&&(l.selection=X(s,0)),s.length>1&&(l.effects=q.of(new V(s,0)),void 0===e.state.field(Y,!1)&&(l.reconfigure={append:[Y,Z,O]})),e.dispatch(e.state.update(l))}}function G(e){return function(t){var n=t.state,r=t.dispatch,i=n.field(Y,!1);if(!i||e<0&&0==i.active)return!1;var o=i.active+e,a=e>0&&!i.ranges.some((function(t){return t.field==o+e}));return r(n.update({selection:X(i.ranges,o),effects:q.of(a?null:new V(i.ranges,o))})),!0}}var Z=Object(u.o)(Object(f.k)([{key:"Tab",run:G(1),shift:G(-1)},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch;return!!t.field(Y,!1)&&(n(t.update({effects:q.of(null)})),!0)}}]),"override");function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[N,y.of(e),$,O,Object(c.c)(),Object(u.o)(Object(f.k)([{key:"ArrowDown",run:L(!0)},{key:"ArrowUp",run:L(!1)},{key:"PageDown",run:L(!0,"page")},{key:"PageUp",run:L(!1,"page")},{key:"Enter",run:I}]),"override")]}var ee=[{key:"Mod-Space",run:function(e){return!!e.state.field(N,!1)&&(e.dispatch({effects:A.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(N,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:A.of(!1)}),!0)}}]},,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(88);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(89);function i(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(0),i=n.n(r);t.a=i.a.createContext(null)},,,,,function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.bottom||s.right<=t.left||s.left>=t.right)o.style.top="-10000px";else{var c=l.right-l.left,u=l.bottom-l.top,f=this.view.textDirection==a.c.LTR?Math.min(s.left,e.innerWidth-c):Math.max(0,s.left-c),d=!!r.above;!r.strictSide&&(d?s.top-(l.bottom-l.top)<0:s.bottom+(l.bottom-l.top)>e.innerHeight)&&(d=!d),o.style.top=(d?s.top-u:s.bottom)+"px",o.style.left=f+"px",o.classList.toggle("cm-tooltip-above",d),o.classList.toggle("cm-tooltip-below",!d),i.positioned&&i.positioned()}}}},{key:"maybeMeasure",value:function(){this.tooltips.length&&((this.view.inView||this.inView)&&this.view.requestMeasure(this.measureReq),this.inView=this.view.inView)}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),c=a.d.baseTheme({$tooltip:{position:"fixed",border:"1px solid #ddd",backgroundColor:"#f5f5f5",zIndex:100}});function u(){return[l,c]}var f=s.f.define(),d=function(){function e(t,n,r,o){Object(i.a)(this,e),this.view=t,this.source=n,this.field=r,this.setHover=o,this.lastMouseMove=null,this.hoverTimeout=-1,this.mouseInside=!1,this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseenter",this.mouseenter=this.mouseenter.bind(this)),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Object(o.a)(e,[{key:"checkHover",value:function(){var e=this;if(this.hoverTimeout=-1,this.mouseInside&&!this.active){var t=Date.now(),n=this.lastMouseMove;if(t-n.timeStamp<750)this.hoverTimeout=setTimeout(this.checkHover,750-(t-n.timeStamp));else{var r=this.view.contentDOM.contains(n.target)?this.view.posAtCoords({x:n.clientX,y:n.clientY}):-1,i=r<0?null:this.source(this.view,(function(t,i){return t<=r&&i>=r&&(t==i||h(e.view,t,i,n.clientX,n.clientY))}));i&&this.view.dispatch({effects:this.setHover.of(i)})}}}},{key:"mousemove",value:function(e){var t;this.lastMouseMove=e,this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,750));var n=this.active;if(n&&!function(e){for(var t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(e.target)){var r=n.pos,i=null!==(t=n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords({x:e.clientX,y:e.clientY})==r:h(this.view,r,i,e.clientX,e.clientY,10))||this.view.dispatch({effects:this.setHover.of(null)})}}},{key:"mouseenter",value:function(){this.mouseInside=!0}},{key:"mouseleave",value:function(){this.mouseInside=!1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}},{key:"destroy",value:function(){this.view.dom.removeEventListener("mouseenter",this.mouseenter),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},{key:"active",get:function(){return this.view.state.field(this.field)}}]),e}();function h(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=document.createRange(),s=e.domAtPos(t),l=e.domAtPos(n);a.setEnd(l.node,l.offset),a.setStart(s.node,s.offset);for(var c=a.getClientRects(),u=0;u1&&void 0!==arguments[1]?arguments[1]:{},n=s.i.define(),i=s.j.define({create:function(){return null},update:function(e,i){if(e&&t.hideOnChange&&(i.docChanged||i.selection))return null;var o,a=Object(r.a)(i.effects);try{for(a.s();!(o=a.n()).done;){var l=o.value;if(l.is(n))return l.value}}catch(f){a.e(f)}finally{a.f()}if(e&&i.docChanged){var c=i.changes.mapPos(e.pos,-1,s.h.TrackDel);if(c<0)return null;var u=Object.assign(Object.create(null),e);return u.pos=c,null!=e.end&&(u.end=i.changes.mapPos(e.end)),u}return e},provide:[f.nFrom((function(e){return e?[e]:[]}))]});return[i,a.f.define((function(t){return new d(t,e,i,n)})),u()]}},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(0),a=(n(11),n(8)),s=n(10),l=n(14),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},u=o.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,u=e.classes,f=e.className,d=e.color,h=void 0===d?"initial":d,p=e.component,v=e.display,m=void 0===v?"initial":v,g=e.gutterBottom,b=void 0!==g&&g,y=e.noWrap,O=void 0!==y&&y,w=e.paragraph,k=void 0!==w&&w,x=e.variant,j=void 0===x?"body1":x,S=e.variantMapping,C=void 0===S?c:S,E=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),M=p||(k?"p":C[j]||c[j])||"span";return o.createElement(M,Object(r.a)({className:Object(a.a)(u.root,f,"inherit"!==j&&u[j],"initial"!==h&&u["color".concat(Object(l.a)(h))],O&&u.noWrap,b&&u.gutterBottom,k&&u.paragraph,"inherit"!==s&&u["align".concat(Object(l.a)(s))],"initial"!==m&&u["display".concat(Object(l.a)(m))]),ref:t},E))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(u)},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(0),a=(n(11),n(24)),s=n(8),l=n(22),c=n(29),u=n(10),f=n(66),d=n(55),h=n(423),p="undefined"===typeof window?o.useEffect:o.useLayoutEffect;var v=function(e){var t=e.classes,n=e.pulsate,r=void 0!==n&&n,i=e.rippleX,a=e.rippleY,l=e.rippleSize,u=e.in,f=e.onExited,d=void 0===f?function(){}:f,h=e.timeout,v=o.useState(!1),m=v[0],g=v[1],b=Object(s.a)(t.ripple,t.rippleVisible,r&&t.ripplePulsate),y={width:l,height:l,top:-l/2+a,left:-l/2+i},O=Object(s.a)(t.child,m&&t.childLeaving,r&&t.childPulsate),w=Object(c.a)(d);return p((function(){if(!u){g(!0);var e=setTimeout(w,h);return function(){clearTimeout(e)}}}),[w,u,h]),o.createElement("span",{className:b,style:y},o.createElement("span",{className:O}))},m=o.forwardRef((function(e,t){var n=e.center,a=void 0!==n&&n,l=e.classes,c=e.className,u=Object(i.a)(e,["center","classes","className"]),f=o.useState([]),p=f[0],m=f[1],g=o.useRef(0),b=o.useRef(null);o.useEffect((function(){b.current&&(b.current(),b.current=null)}),[p]);var y=o.useRef(!1),O=o.useRef(null),w=o.useRef(null),k=o.useRef(null);o.useEffect((function(){return function(){clearTimeout(O.current)}}),[]);var x=o.useCallback((function(e){var t=e.pulsate,n=e.rippleX,r=e.rippleY,i=e.rippleSize,a=e.cb;m((function(e){return[].concat(Object(d.a)(e),[o.createElement(v,{key:g.current,classes:l,timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:i})])})),g.current+=1,b.current=a}),[l]),j=o.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&y.current)y.current=!1;else{"touchstart"===e.type&&(y.current=!0);var u,f,d,h=c?null:k.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(p.width/2),f=Math.round(p.height/2);else{var v=e.touches?e.touches[0]:e,m=v.clientX,g=v.clientY;u=Math.round(m-p.left),f=Math.round(g-p.top)}if(s)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var b=2*Math.max(Math.abs((h?h.clientWidth:0)-u),u)+2,j=2*Math.max(Math.abs((h?h.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(b,2)+Math.pow(j,2))}e.touches?null===w.current&&(w.current=function(){x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})},O.current=setTimeout((function(){w.current&&(w.current(),w.current=null)}),80)):x({pulsate:i,rippleX:u,rippleY:f,rippleSize:d,cb:n})}}),[a,x]),S=o.useCallback((function(){j({},{pulsate:!0})}),[j]),C=o.useCallback((function(e,t){if(clearTimeout(O.current),"touchend"===e.type&&w.current)return e.persist(),w.current(),w.current=null,void(O.current=setTimeout((function(){C(e,t)})));w.current=null,m((function(e){return e.length>0?e.slice(1):e})),b.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:S,start:j,stop:C}}),[S,j,C]),o.createElement("span",Object(r.a)({className:Object(s.a)(l.root,c),ref:k},u),o.createElement(h.a,{component:null,exit:!0},p))})),g=Object(u.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(m)),b=o.forwardRef((function(e,t){var n=e.action,u=e.buttonRef,d=e.centerRipple,h=void 0!==d&&d,p=e.children,v=e.classes,m=e.className,b=e.component,y=void 0===b?"button":b,O=e.disabled,w=void 0!==O&&O,k=e.disableRipple,x=void 0!==k&&k,j=e.disableTouchRipple,S=void 0!==j&&j,C=e.focusRipple,E=void 0!==C&&C,M=e.focusVisibleClassName,P=e.onBlur,T=e.onClick,D=e.onFocus,A=e.onFocusVisible,_=e.onKeyDown,R=e.onKeyUp,N=e.onMouseDown,L=e.onMouseLeave,I=e.onMouseUp,z=e.onTouchEnd,$=e.onTouchMove,Q=e.onTouchStart,B=e.onDragLeave,F=e.tabIndex,W=void 0===F?0:F,H=e.TouchRippleProps,V=e.type,q=void 0===V?"button":V,U=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),Y=o.useRef(null);var X=o.useRef(null),K=o.useState(!1),G=K[0],Z=K[1];w&&G&&Z(!1);var J=Object(f.a)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return Object(c.a)((function(r){return t&&t(r),!n&&X.current&&X.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){Z(!0),Y.current.focus()}}}),[]),o.useEffect((function(){G&&E&&!x&&X.current.pulsate()}),[x,E,G]);var ie=re("start",N),oe=re("stop",B),ae=re("stop",I),se=re("stop",(function(e){G&&e.preventDefault(),L&&L(e)})),le=re("start",Q),ce=re("stop",z),ue=re("stop",$),fe=re("stop",(function(e){G&&(te(e),Z(!1)),P&&P(e)}),!1),de=Object(c.a)((function(e){Y.current||(Y.current=e.currentTarget),ee(e)&&(Z(!0),A&&A(e)),D&&D(e)})),he=function(){var e=a.findDOMNode(Y.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),ve=Object(c.a)((function(e){E&&!pe.current&&G&&X.current&&" "===e.key&&(pe.current=!0,e.persist(),X.current.stop(e,(function(){X.current.start(e)}))),e.target===e.currentTarget&&he()&&" "===e.key&&e.preventDefault(),_&&_(e),e.target===e.currentTarget&&he()&&"Enter"===e.key&&!w&&(e.preventDefault(),T&&T(e))})),me=Object(c.a)((function(e){E&&" "===e.key&&X.current&&G&&!e.defaultPrevented&&(pe.current=!1,e.persist(),X.current.stop(e,(function(){X.current.pulsate(e)}))),R&&R(e),T&&e.target===e.currentTarget&&he()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ge=y;"button"===ge&&U.href&&(ge="a");var be={};"button"===ge?(be.type=q,be.disabled=w):("a"===ge&&U.href||(be.role="button"),be["aria-disabled"]=w);var ye=Object(l.a)(u,t),Oe=Object(l.a)(ne,Y),we=Object(l.a)(ye,Oe),ke=o.useState(!1),xe=ke[0],je=ke[1];o.useEffect((function(){je(!0)}),[]);var Se=xe&&!x&&!w;return o.createElement(ge,Object(r.a)({className:Object(s.a)(v.root,m,G&&[v.focusVisible,M],w&&v.disabled),onBlur:fe,onClick:T,onFocus:de,onKeyDown:ve,onKeyUp:me,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ce,onTouchMove:ue,onTouchStart:le,ref:we,tabIndex:w?-1:W},be,U),p,Se?o.createElement(g,Object(r.a)({ref:X,center:h},H)):null)}));t.a=Object(u.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(b)},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e){var t=r.useState(e),n=t[0],i=t[1],o=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}},function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n(55),n(1);var r=n(59),i=(n(11),n(69),{xs:0,sm:600,md:960,lg:1280,xl:1920}),o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function a(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===Object(r.a)(t)){var a=e.theme.breakpoints||o;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}},function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(72),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=l(t),v=l(n),m=0;m2||/[^\s,.;:]/.test(e.sliceDoc(t.start,t.end)))||t.firstChild}function b(e,t,n){for(var r=e.tree.resolve(t.head),o=n?l.c.closedBy:l.c.openedBy,a=t.head;;){var c=n?r.childAfter(a):r.childBefore(a);if(!c)break;g(e,c,o)?r=c:a=n?c.end:c.start}var u,f;return f=r.type.prop(o)&&(u=n?Object(s.b)(e,r.start,1):Object(s.b)(e,r.end,-1))&&u.matched?n?u.end.to:u.end.from:n?r.end:r.start,i.d.cursor(f,n?-1:1)}function y(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t):d(n,t)}))}var O=function(e){return y(e,!1)},w=function(e){return y(e,!0)};function k(e,t){return f(e,(function(n){return n.empty?e.moveVertically(n,t,e.dom.clientHeight):d(n,t)}))}var x=function(e){return k(e,!1)},j=function(e){return k(e,!0)};function S(e,t,n){var r=e.visualLineAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){var a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head>r.from+a&&(o=i.d.cursor(r.from+a))}return o}var C=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).from,1)}))},E=function(e){return f(e,(function(t){return i.d.cursor(e.visualLineAt(t.head).to,-1)}))};function M(e,t,n){var r=!1,o=c(e.selection,(function(t){var o=Object(s.b)(e,t.head,-1)||Object(s.b)(e,t.head,1)||t.head>0&&Object(s.b)(e,t.head-1,1)||t.headl.from&&r-1)return a}}catch(s){o.e(s)}finally{o.f()}return-1}function ne(e,t){var n=-1;return e.changeByRange((function(r){for(var o=[],a=e.doc.lineAt(r.from);a.number>n&&(t(a,o,r),n=a.number),!(r.to<=a.to);)a=e.doc.lineAt(a.to+1);var s=e.changes(o);return{changes:o,range:i.d.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}}))}var re=[{key:"ArrowLeft",run:p,shift:D},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function(e){return m(e,e.textDirection!=a.c.LTR)},shift:function(e){return _(e,e.textDirection!=a.c.LTR)}},{mac:"Cmd-ArrowLeft",run:C,shift:Q},{key:"ArrowRight",run:v,shift:A},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function(e){return m(e,e.textDirection==a.c.LTR)},shift:function(e){return _(e,e.textDirection==a.c.LTR)}},{mac:"Cmd-ArrowRight",run:E,shift:B},{key:"ArrowUp",run:O,shift:N},{mac:"Cmd-ArrowUp",run:F,shift:H},{mac:"Ctrl-ArrowUp",run:x,shift:z},{key:"ArrowDown",run:w,shift:L},{mac:"Cmd-ArrowDown",run:W,shift:V},{mac:"Ctrl-ArrowDown",run:j,shift:$},{key:"PageUp",run:x,shift:z},{key:"PageDown",run:j,shift:$},{key:"Home",run:function(e){return f(e,(function(t){return S(e,t,!1)}))},shift:function(e){return P(e,(function(t){return S(e,t,!1)}))}},{key:"Mod-Home",run:F,shift:H},{key:"End",run:function(e){return f(e,(function(t){return S(e,t,!0)}))},shift:function(e){return P(e,(function(t){return S(e,t,!0)}))}},{key:"Mod-End",run:W,shift:V},{key:"Enter",run:function(e){var t=e.state,n=e.dispatch,r=t.changeByRange((function(e){var n=e.from,r=e.to,a=n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=e.tree.resolve(t),i=r.childBefore(t),o=r.childAfter(t);return i&&o&&i.end<=t&&o.start>=t&&(n=i.type.prop(l.c.closedBy))&&n.indexOf(o.name)>-1?{from:i.end,to:o.start}:null}(t,n),s=new i.g(t,{simulateBreak:n,simulateDoubleBreak:!!a}),c=te(s,n);c<0&&(c=/^\s*/.exec(t.doc.lineAt(n).slice(0,50))[0].length);for(var u=t.doc.lineAt(n);ru.from&&n",run:W},{key:"Ctrl-v",run:j},{key:"Alt-v",run:x}].map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))),ie=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection!=a.c.LTR)}))},shift:function(e){return P(e,(function(t){return b(e.state,t,e.textDirection!=a.c.LTR)}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(e){return f(e,(function(t){return b(e.state,t,e.textDirection==a.c.LTR)}))},shift:function(e){return P(e,(function(t){return b(e.state,t,e.textDirection==a.c.LTR)}))}},{key:"Alt-ArrowUp",run:function(e){return J(e.state,e.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(e){return ee(e.state,e.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(e){return J(e.state,e.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(e){return ee(e.state,e.dispatch,!0)}},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch,r=t.selection,o=null;return r.ranges.length>1?o=new i.d([r.primary]):r.primary.empty||(o=new i.d([i.d.cursor(r.primary.head)])),!!o&&(n(u(t,o)),!0)}},{key:"Mod-l",run:function(e){var t=e.state,n=e.dispatch,r=Z(t).map((function(e){var n=e.from,r=e.to;return i.d.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:new i.d(r),annotations:i.l.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=c(t.selection,(function(e){for(var n,r=t.tree.resolve(e.head,1);!(r.start=e.to||r.end>e.to&&r.start<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return i.d.range(r.end,r.start)}));return n(u(t,r)),!0}},{key:"Mod-[",run:function(e){var t=e.state;return(0,e.dispatch)(t.update(ne(t,(function(e,n){var r=e.slice(0,Math.min(e.length,200)),i=/^\s*/.exec(r)[0];if(i){for(var a=Object(o.d)(i,0,t.tabSize),s=t.indentString(Math.max(0,a-t.indentUnit)),l=0;l0?n--:r30||this.typeNames.length>Math.pow(2,30-this.flags.length))throw new RangeError("Too many style tag flags to fit in a 30-bit integer")}return Object(o.a)(e,[{key:"get",value:function(e){var t,n=0,i=Object(r.a)(e.split(" "));try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o){var a=this.flags.indexOf(o);if(a>-1)n+=1<>this.typeShift)throw new RangeError("Multiple tag types specified in '".concat(e,"'"));n+=s<1&&void 0!==arguments[1]?arguments[1]:{},n=this.getWithMode(e),r=n.mode,i=n.tag;return this.prop.set(t,new h(i,r,d))}},{key:"add",value:function(e){var t=Object.create(null);for(var n in e){var i,o=e[n],a=this.getWithMode(o),s=a.mode,l=a.tag,c=Object(r.a)(n.split(" "));try{for(c.s();!(i=c.n()).done;){var u=i.value.split("/"),f=u[u.length-1],p=u.length>1?u.slice(0,u.length-1).map((function(e){return"*"==e?null:e})):d,v=new h(l,s,p);t[f]=v.sort(t[f])}}catch(m){c.e(m)}finally{c.f()}}return this.prop.add(t)}},{key:"highlighter",value:function(e){var t=this,n=new m(this,e);return[Object(c.o)(l.f.define((function(e){return new g(e,t.prop,n)}),{decorations:function(e){return e.decorations}}),"fallback"),l.d.styleModule.of(n.module)]}},{key:"specificity",value:function(e){for(var t=e&this.flagMask,n=0,r=1;r<=this.flags.length;r++)t&1<>this.typeShift;i;i=this.parents[i])n+=/#/.test(this.typeNames[i])?500:1e3;return n}}]),e}())({flags:["invalid","meta","standard","definition","constant","local","control","link","strong","emphasis","monospace","changed","inserted","deleted"],subtypes:7,types:["comment","lineComment=comment","blockComment=comment","docComment=comment","name","variableName=name","typeName=name","propertyName=name","className=name","labelName=name","functionName=name","namespace=name","literal","string=literal","docString=string","character=string","number=literal","integer=number","float=number","bool=literal","regexp=literal","escape=literal","color=literal","content","heading=content","list=content","quote=content","keyword","self=keyword","null=keyword","atom=keyword","unit=keyword","modifier=keyword","operatorKeyword=keyword","operator","derefOperator=operator","arithmeticOperator=operator","logicOperator=operator","bitwiseOperator=operator","compareOperator=operator","updateOperator=operator","typeOperator=operator","punctuation","separator=punctuation","bracket=punctuation","angleBracket=bracket","squareBracket=bracket","paren=bracket","brace=bracket"]}),d=[],h=function(){function e(t,n,r,o){Object(i.a)(this,e),this.tag=t,this.mode=n,this.context=r,this.next=o}return Object(o.a)(e,[{key:"sort",value:function(e){return!e||e.context.length>t.typeShift,h&t.flagMask,t.specificity(h),c))}}catch(p){f.e(p)}finally{f.f()}}this.rules=a.sort((function(e,t){return t.specificity-e.specificity})),this.module=new s.a(o)}return Object(o.a)(e,[{key:"match",value:function(e){var t=this.cache[e];if(null!=t)return t;for(var n="",i=e>>this.tags.typeShift,o=e&this.tags.flagMask;;){var a,s=Object(r.a)(this.rules);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.type==i&&(l.flags&o)==l.flags&&(n&&(n+=" "),n+=l.cls,o&=~l.flags,i))break}}catch(c){s.e(c)}finally{s.f()}if(!i)break;i=this.tags.parents[i]}return this.cache[e]=n}}]),e}(),g=function(){function e(t,n,r){Object(i.a)(this,e),this.prop=n,this.styling=r,this.nodeStack=[""],this.classStack=[""],this.inheritStack=[""],this.tree=t.state.tree,this.decorations=this.buildDeco(t.visibleRanges,this.tree)}return Object(o.a)(e,[{key:"update",value:function(e){var t=e.state.facet(c.e.syntax);t.length?t[0].parsePos(e.state)n&&t&&s.add(n,e,l.b.mark({class:t})),n=e}var f,d=this.nodeStack,h=this.classStack,p=this.inheritStack,v=Object(r.a)(e);try{var m=function(){var e=f.value,r=e.from,s=e.to;i="",o=0,n=r,t.iterate({from:r,to:s,enter:function(e,t){o++;for(var n=p[o-1],r=n,s=e.prop(a.prop),l=!1;s;){if(!s.context.length||b(s.context,d,o)){var u=a.styling.match(s.tag);u&&(r&&(r+=" "),r+=u,1==s.mode?n=r:0==s.mode&&(l=!0));break}s=s.next}if(r!=i&&(c(t,i),i=r),l)return o--,!1;h[o]=r,p[o]=n,d[o]=e.name},leave:function(e,t,n){o--;var r=h[o];r!=i&&(c(Math.min(s,n),i),i=r)}})};for(v.s();!(f=v.n()).done;)m()}catch(g){v.e(g)}finally{v.f()}return s.finish()}}]),e}();function b(e,t,n){if(e.length>n-1)return!1;for(var r=n-1,i=e.length-1;i>=0;i--,r--){var o=e[i];if(o&&o!=t[r])return!1}return!0}var y,O=(y={deleted:{textDecoration:"line-through"},inserted:{textDecoration:"underline"},link:{textDecoration:"underline"},strong:{fontWeight:"bold"},emphasis:{fontStyle:"italic"},keyword:{color:"#708"},"atom, bool":{color:"#219"},number:{color:"#164"},string:{color:"#a11"},"regexp, escape, string#2":{color:"#e40"},"variableName definition":{color:"#00f"},typeName:{color:"#085"},className:{color:"#167"},"name#2":{color:"#256"},"propertyName definition":{color:"#00c"},comment:{color:"#940"},meta:{color:"#555"},invalid:{color:"#f00"}},f.highlighter(y))},function(e,t,n){"use strict";n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return S}));var r=n(19),i=n(18),o=n(7),a=n(4),s=n(5),l=n(9),c=n(3),u=n(91),f=n(34),d=function e(t,n,r){Object(s.a)(this,e),this.from=t,this.to=n,this.diagnostic=r},h=function e(t,n,r){Object(s.a)(this,e),this.diagnostics=t,this.panel=n,this.selected=r};function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null;return e.between(n,e.length,(function(e,n,i){var o=i.spec;if(!t||o.diagnostic==t)return r=new d(e,n,o.diagnostic),!1})),r}function v(e){return e.field(y,!1)?void 0:{append:[y,l.d.decorations.compute([y],(function(e){var t=e.field(y),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?l.b.set([O.range(n.from,n.to)]):l.b.none})),Object(f.b)(),Object(u.a)(w),D]}}var m=c.i.define(),g=c.i.define(),b=c.i.define(),y=c.j.define({create:function(){return new h(l.b.none,null,null)},update:function(e,t){if(t.docChanged){var n=e.diagnostics.map(t.changes),r=null;if(e.selected){var i=t.changes.mapPos(e.selected.from,1);r=p(n,e.selected.diagnostic,i)||p(n,null,i)}e=new h(n,e.panel,r)}var o,s=Object(a.a)(t.effects);try{for(s.s();!(o=s.n()).done;){var c=o.value;if(c.is(m)){var u=l.b.set(c.value.map((function(e){return e.fromi&&(e.items.splice(i,u-i),o=!0)),r&&l.diagnostic==r.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),a=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),i++}));ir.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.items.length||this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}},{key:"sync",value:function(){var e=this.list.firstChild;function t(){var t=e;e=t.nextSibling,t.remove()}var n,r=Object(a.a)(this.items);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e)}}catch(o){r.e(o)}finally{r.f()}for(;e;)t();this.list.firstChild||this.list.appendChild(C(this.view,{severity:"info",message:this.view.state.phrase("No diagnostics")}))}},{key:"moveSelection",value:function(e){if(0!=this.items.length){var t=p(this.view.state.field(y).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:b.of(t)})}}},{key:"selectedIndex",get:function(){var e=this.view.state.field(y).selected;if(!e)return-1;for(var t=0;t\n ');return"url('data:image/svg+xml;base64,".concat(btoa(t),"')")}var D=l.d.baseTheme({$diagnostic:{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block"},"$diagnostic.error":{borderLeft:"5px solid #d11"},"$diagnostic.warning":{borderLeft:"5px solid orange"},"$diagnostic.info":{borderLeft:"5px solid #999"},$diagnosticAction:{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},$lintRange:{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x"},"$lintRange.error":{backgroundImage:T("#d11")},"$lintRange.warning":{backgroundImage:T("orange")},"$lintRange.info":{backgroundImage:T("#999")},"$lintRange.active":{backgroundColor:"#ffdd9980"},$lintPoint:{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},"$lintPoint.warning":{"&:after":{borderBottomColor:"orange"}},"$lintPoint.info":{"&:after":{borderBottomColor:"#999"}},"$panel.lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd"},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"$tooltip.lint":{padding:0,margin:0}})},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(342),i=n(343),o=n(179);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return k}));var r=n(23);n.d(t,"a",(function(){return r.c}));var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var o,a=function(){function e(e,t,n,r,i,o,a,s,l){this.cx=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=a,this.bufferBase=s,this.parent=l}return e.prototype.toString=function(){return"["+this.stack.filter((function(e,t){return t%3==0})).concat(this.state)+"]@"+this.pos+(this.score?"!"+this.score:"")},e.start=function(t,n,r){return void 0===r&&(r=0),new e(t,[],n,r,r,0,[],0,null)},e.prototype.pushState=function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e},e.prototype.reduce=function(e){var t=e>>19,n=65535&e,r=this.cx.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return no;)this.stack.pop()},e.prototype.storeNode=function(e,t,n,r,i){if(void 0===r&&(r=4),void 0===i&&(i=!1),0==e){var o=this,a=this.buffer.length;if(0==a&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&0==o.buffer[a-4]&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t)return void(o.buffer[a-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)},e.prototype.shift=function(e,t,n){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var r=this.pos,i=e,o=this.cx.parser;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else t<=this.cx.parser.maxNode&&this.buffer.push(t,this.pos,n,4),this.pos=n},e.prototype.apply=function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)},e.prototype.useNode=function(e,t){var n=this.cx.reused.length-1;(n<0||this.cx.reused[n]!=e)&&(this.cx.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1)},e.prototype.split=function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.cx,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,t)},e.prototype.recoverByDelete=function(e,t){var n=e<=this.cx.parser.maxNode;n&&this.storeNode(e,this.pos,t),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=200},e.prototype.canShift=function(e){for(var t=new s(this);;){var n=this.cx.parser.stateSlot(t.top,4)||this.cx.parser.hasAction(t.top,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}},Object.defineProperty(e.prototype,"ruleStart",{get:function(){for(var e=this.state,t=this.stack.length;;){var n=this.cx.parser.stateSlot(e,5);if(!(65536&n))return 0;if(t-=3*(n>>19),(65535&n)>19,a=65535&i;if(e.indexOf(a)>-1){var s=n-3*(i>>19);return this.stack[s+1]}if(0==n)return-1;0==o?(n-=3,t=this.stack[n]):(n-=3*(o-1),t=r.getGoto(this.stack[n-3],a,!0))}},e.prototype.recoverByInsert=function(e){var t=this;if(this.stack.length>=300)return[];var n=this.cx.parser.nextStates(this.state);if(n.length>4||this.stack.length>=120){var r=n.filter((function(n){return n!=t.state&&t.cx.parser.hasAction(n,e)}));if(this.stack.length<120)for(var i=0;r.length<4&&i>19;0==n?(this.rest==this.stack.stack&&(this.rest=this.rest.slice()),this.rest.push(this.top,0,0),this.offset+=3):this.offset-=3*(n-1);var r=this.stack.cx.parser.getGoto(this.rest[this.offset-3],t,!0);this.top=r},e}(),l=function(){function e(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}return e.create=function(t){return new e(t,t.bufferBase+t.buffer.length,t.buffer.length)},e.prototype.maybeNext=function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)},Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer[this.index-4]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"start",{get:function(){return this.buffer[this.index-3]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this.buffer[this.index-2]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.buffer[this.index-1]},enumerable:!0,configurable:!0}),e.prototype.next=function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()},e.prototype.fork=function(){return new e(this.stack,this.pos,this.index)},e}(),c=function(){function e(){this.start=-1,this.value=-1,this.end=-1}return e.prototype.accept=function(e,t){this.value=e,this.end=t},e}(),u=function(){function e(e,t){void 0===t&&(t=e.length),this.string=e,this.length=t}return e.prototype.get=function(e){return e<0||e>=this.length?-1:this.string.charCodeAt(e)},e.prototype.read=function(e,t){return this.string.slice(e,Math.min(this.length,t))},e.prototype.clip=function(t){return new e(this.string,t)},e}(),f=function(){function e(e,t){this.data=e,this.id=t}return e.prototype.token=function(e,t,n){!function(e,t,n,r,i){var o=0,a=1<0){var f=e[u];if(s.allows(f)&&(-1==n.value||n.value==f||r.cx.parser.overrides(f,n.value))){n.accept(f,l);break}}for(var d=t.get(l++),h=0,p=e[o+2];h>1,m=c+v+(v<<1),g=e[m],b=e[m+1];if(d=b)){o=e[m+2];continue e}h=v+1}}break}}(this.data,e,t,n,this.id)},e}();f.prototype.contextual=f.prototype.fallback=f.prototype.extend=!1;function d(e,t){if(void 0===t&&(t=Uint16Array),"string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&a--,a>=34&&a--;var l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}var h="undefined"!=typeof e&&/\bparse\b/.test(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}).LOG),p=null,v=function(){function e(e){this.start=[0],this.index=[0],this.nextStart=0,this.trees=[e]}return e.prototype.nodeAt=function(e){if(e=e)return a==e?o:null;o instanceof r.f?(this.index[t]++,this.nextStart=a+o.length):(this.index[t]++,a+o.length>=e&&(this.trees.push(o),this.start.push(a),this.index.push(0)))}else this.trees.pop(),this.start.pop(),this.index.pop()}},e}(),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.extended=-1,t.mask=0,t}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.clear=function(e){this.start=e,this.value=this.extended=-1},t}(c),g=new c,b=function(){function e(e){this.tokens=[],this.mainToken=g,this.actions=[],this.tokens=e.tokenizers.map((function(e){return new m}))}return e.prototype.getActions=function(e,t){for(var n=0,r=null,i=e.cx.parser,o=i.tokenizers,a=i.stateSlot(e.state,3),s=0;s-1&&(n=this.addActions(e,c.extended,c.end,n)),n=this.addActions(e,c.value,c.end,n),!l.extend&&(r=c,n>u))break}}for(;this.actions.length>n;)this.actions.pop();return r||((r=g).start=e.pos,e.pos==t.length?r.accept(e.cx.parser.eofTerm,e.pos):r.accept(0,e.pos+1)),this.mainToken=r,this.actions},e.prototype.updateCachedToken=function(e,t,n,r){if(e.clear(n.pos),t.token(r,e,n),e.value>-1){for(var i=n.cx.parser,o=0;o=0&&n.cx.dialect.allows(a>>1)){0==(1&a)?e.value=a>>1:e.extended=a>>1;break}}}else n.pos==r.length?e.accept(n.cx.parser.eofTerm,n.pos):e.accept(0,n.pos+1)},e.prototype.putAction=function(e,t,n,r){for(var i=0;it)this.putStack(o);else{var a=this.advanceStack(o,e);if(a){o=a;continue}n||(n=[],r=[]),n.push(o);var s=o.cx.tokens.mainToken;r.push(s.value,s.end)}break}if(!this.stacks.length){var l;if(l=n&&function(e){for(var t=null,n=0,r=e;nc&&(this.stacks.sort((function(e,t){return t.score-e.score})),this.stacks.length=c),this.stacks.some((function(e){return e.reducePos>t}))&&this.recovering--}else if(this.stacks.length>1)e:for(i=0;i200&&f.buffer.length>200){if(!((o.score-f.score||o.buffer.length-f.buffer.length)>0)){this.stacks.splice(i--,1);continue e}this.stacks.splice(u--,1)}}}return this.tokenCount++,null},e.prototype.advanceStack=function(e,t){var n=e.pos,i=e.cx,o=i.input,s=i.parser,l=h?this.stackID(e)+" -> ":"";if(this.cache)for(var c=this.cache.nodeAt(n);c;){var u=s.group.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1)return e.useNode(c,u),h&&console.log(l+this.stackID(e)+" (via reuse of "+s.getName(c.type.id)+")"),e;if(!(c instanceof r.e)||0==c.children.length||c.positions[0]>0)break;var f=c.children[0];if(!(f instanceof r.e))break;c=f}var d=s.startNested(e.state);e:if(d>-1){var p=s.nested[d],v=p.grammar,m=p.end,g=p.placeholder,b=void 0,O=null,w=void 0,k=void 0,x=void 0,j=void 0;if("function"==typeof v){var S=v(o,e);if(S.stay)break e;O=S.parseNode,w=S.parser,k=S.top,x=S.dialect,b=S.filterEnd,j=S.wrapType}else w=v;var C=this.scanForNestEnd(e,m,b),E=e.cx.input.clip(C);if(O||!w){var M=O?O(E,e.pos):r.e.empty;return M.length!=C-e.pos&&(M=new r.e(M.type,M.children,M.positions,C-e.pos)),null!=j&&(M=new r.e(s.group.types[j],[M],[0],M.length)),e.useNode(M,s.getGoto(e.state,g,!0)),e}var P=k?w.topRules[k]:w.defaultTop,T=a.start(new y(w,e.cx.maxBufferLength,E,P[1],w.parseDialect(x),e,j),P[0],e.pos);return h&&console.log(l+this.stackID(T)+" (nested)"),T}var D=s.stateSlot(e.state,4);if(D>0)return e.reduce(D),h&&console.log(l+this.stackID(e)+" (via always-reduce "+s.getName(65535&D)+")"),e;for(var A=e.cx.tokens.getActions(e,o),_=0;_n?this.putStack(I):t.push(I)}return e.cx.parent&&e.pos==o.length?this.finishNested(e):null},e.prototype.advanceFully=function(e){for(var t=e.pos;;){var n=this.advanceStack(e,null);if(!n)return e;if(n.pos>t)return this.putStackDedup(n),null;e=n}},e.prototype.runRecovery=function(e,t){for(var n=null,r=!1,i=0;i ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),h&&console.log(l+this.stackID(o)+" (restarted)"),!(d=this.advanceFully(o)))continue;o=d}for(var c=o.split(),u=l,f=0;c.forceReduce()&&f<10;f++){var d;if(h&&console.log(u+this.stackID(c)+" (via force-reduce)"),!(d=this.advanceFully(c)))break;c=d,h&&(u=this.stackID(d)+" -> ")}for(var p=0,v=o.recoverByInsert(a);po.pos?(s==o.pos&&(s++,a=0),o.recoverByDelete(a,s),h&&console.log(l+this.stackID(o)+" (via recover-delete "+o.cx.parser.getName(a)+")"),this.putStackDedup(o)):o.cx.parent||n&&!(n.score-1&&(!n||n(r.read(i,g.end))))return i;return r.length},e.prototype.finishNested=function(e){if(-2==e.cx.wrapType)return null;var t=e.cx.parent,n=e.forceAll().toTree(),i=t.cx.parser,o=i.nested[i.startNested(t.state)];return n=new r.e(n.type,n.children,n.positions.map((function(e){return e-t.pos})),e.pos-t.pos),e.cx.wrapType>-1&&(n=new r.e(i.group.types[e.cx.wrapType],[n],[0],n.length)),e.cx.wrapType=-2,t.useNode(n,i.getGoto(t.state,o.placeholder,!0)),h&&console.log(this.stackID(t)+" (via unnest "+(e.cx.wrapType>-1?i.getName(e.cx.wrapType):n.type.name)+")"),t},e.prototype.stackID=function(e){var t=(p||(p=new WeakMap)).get(e);return t||p.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e},e}(),w=function(){function e(e,t,n){this.source=e,this.flags=t,this.disabled=n}return e.prototype.allows=function(e){return!this.disabled||0==this.disabled[e]},e}(),k=function(){function e(e){this.nextStateCache=[],this.cachedDialect=null;var t=d(e.tokenData),n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(var i=0;i=r[0])return-1;for(var i=r[t+1];;){var o=r[i++],a=1&o,s=r[i++];if(a&&n)return s;for(var l=i+(o>>1);i0},e.prototype.startNested=function(e){var t=this.stateSlot(e,0);return 4&t?t>>10:-1},e.prototype.validAction=function(e,t){if(t==this.stateSlot(e,4))return!0;for(var n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=x(this.data,n+2)}if(t==x(this.data,n+1))return!0}},e.prototype.nextStates=function(e){var t=this.nextStateCache[e];if(t)return t;for(var n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=x(this.data,r+2)}0==(1&this.data[r+2])&&n.indexOf(this.data[r+1])<0&&n.push(this.data[r+1])}for(var i=this.goto,o=i[0],a=0;a>1);s0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultTop",{get:function(){return this.topRules[Object.keys(this.topRules)[0]]},enumerable:!0,configurable:!0}),e.prototype.dynamicPrecedence=function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0},Object.defineProperty(e.prototype,"topType",{get:function(){return this.group.types[this.defaultTop[1]]},enumerable:!0,configurable:!0}),e.prototype.parseDialect=function(e){if(this.cachedDialect&&this.cachedDialect.source==e)return this.cachedDialect;var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e)for(var r=0,i=e.split(" ");r=0&&(n[c]=!0)}for(var a=null,s=0;s=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(e){if(!(t=r.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?n+=t.charAt(r):o<128?n+=i[o]:o<2048?n+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?n+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(r+=1,o=65536+((1023&o)<<10|1023&t.charCodeAt(r)),n+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return n},isBuffer:function(e){return null!==e&&"undefined"!==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!==typeof n){if(Array.isArray(t))t.push(n);else{if("object"!==typeof t)return[t,n];(i.plainObjects||i.allowPrototypes||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if("object"!==typeof t)return[t].concat(n);var a=t;return Array.isArray(t)&&!Array.isArray(n)&&(a=o(t,i)),Array.isArray(t)&&Array.isArray(n)?(n.forEach((function(n,o){r.call(t,o)?t[o]&&"object"===typeof t[o]?t[o]=e(t[o],n,i):t.push(n):t[o]=n})),t):Object.keys(n).reduce((function(t,o){var a=n[o];return r.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t}),a)}}},function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g;e.exports={default:"RFC3986",formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(e,t,n){e.exports=function(){"use strict";var e,t,n=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,r=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,i={years:31536e6,months:2592e6,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},o=function(e){return e instanceof f},a=function(e,t,n){return new f(e,n,t.$l)},s=function(e){return t.p(e)+"s"},l=function(e){return e<0},c=function(e){return l(e)?Math.ceil(e):Math.floor(e)},u=function(e,t){return e?l(e)?{negative:!0,format:""+function(e){return Math.abs(e)}(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},f=function(){function l(e,t,n){var o=this;if(this.$d={},this.$l=n,t)return a(e*i[s(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){o.$d[s(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var l=e.match(r);if(l)return this.$d.years=l[2],this.$d.months=l[3],this.$d.weeks=l[4],this.$d.days=l[5],this.$d.hours=l[6],this.$d.minutes=l[7],this.$d.seconds=l[8],this.calMilliseconds(),this}return this}var f=l.prototype;return f.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*i[n]}),0)},f.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=c(e/31536e6),e%=31536e6,this.$d.months=c(e/2592e6),e%=2592e6,this.$d.days=c(e/864e5),e%=864e5,this.$d.hours=c(e/36e5),e%=36e5,this.$d.minutes=c(e/6e4),e%=6e4,this.$d.seconds=c(e/1e3),e%=1e3,this.$d.milliseconds=e},f.toISOString=function(){var e=u(this.$d.years,"Y"),t=u(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=u(n,"D"),i=u(this.$d.hours,"H"),o=u(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=u(a,"S"),l=e.negative||t.negative||r.negative||i.negative||o.negative||s.negative,c=i.format||o.format||s.format?"T":"",f=(l?"-":"")+"P"+e.format+t.format+r.format+c+i.format+o.format+s.format;return"P"===f||"-P"===f?"P0D":f},f.toJSON=function(){return this.toISOString()},f.format=function(e){var r=e||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return r.replace(n,(function(e,t){return t||String(i[e])}))},f.as=function(e){return this.$ms/i[s(e)]},f.get=function(e){var t=this.$ms,n=s(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?c(t/i[n]):this.$d[n],0===t?0:t},f.add=function(e,t,n){var r;return r=t?e*i[s(t)]:o(e)?e.$ms:a(e,this).$ms,a(this.$ms+r*(n?-1:1),this)},f.subtract=function(e,t){return this.add(e,t,!0)},f.locale=function(e){var t=this.clone();return t.$l=e,t},f.clone=function(){return a(this.$ms,this)},f.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},f.milliseconds=function(){return this.get("milliseconds")},f.asMilliseconds=function(){return this.as("milliseconds")},f.seconds=function(){return this.get("seconds")},f.asSeconds=function(){return this.as("seconds")},f.minutes=function(){return this.get("minutes")},f.asMinutes=function(){return this.as("minutes")},f.hours=function(){return this.get("hours")},f.asHours=function(){return this.as("hours")},f.days=function(){return this.get("days")},f.asDays=function(){return this.as("days")},f.weeks=function(){return this.get("weeks")},f.asWeeks=function(){return this.as("weeks")},f.months=function(){return this.get("months")},f.asMonths=function(){return this.as("months")},f.years=function(){return this.get("years")},f.asYears=function(){return this.as("years")},l}();return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){var n=i.locale();return a(e,{$l:n},t)},i.isDuration=o;var s=r.prototype.add,l=r.prototype.subtract;r.prototype.add=function(e,t){return o(e)&&(e=e.asMilliseconds()),s.bind(this)(e,t)},r.prototype.subtract=function(e,t){return o(e)&&(e=e.asMilliseconds()),l.bind(this)(e,t)}}}()},function(e,t,n){"use strict";(function(e){var n="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,r=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}();var i=n&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),r))}};function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function s(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=a(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:l(s(e))}function c(e){return e&&e.referenceNode?e.referenceNode:e}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),f=n&&/MSIE 10/.test(navigator.userAgent);function d(e){return 11===e?u:10===e?f:u||f}function h(e){if(!e)return document.documentElement;for(var t=d(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?h(n):n:e?e.ownerDocument.documentElement:document.documentElement}function p(e){return null!==e.parentNode?p(e.parentNode):e}function v(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||h(e.firstElementChild)===e)}(a)?a:h(a);var s=p(e);return s.host?v(s.host,t):v(e,p(t).host)}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(t,"top"),i=m(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function b(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function y(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],d(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=d(10)&&getComputedStyle(n);return{height:y("Height",t,n,r),width:y("Width",t,n,r)}}var w=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},k=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=d(10),i="HTML"===t.nodeName,o=C(e),s=C(t),c=l(e),u=a(t),f=parseFloat(u.borderTopWidth),h=parseFloat(u.borderLeftWidth);n&&i&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var p=S({top:o.top-s.top-f,left:o.left-s.left-h,width:o.width,height:o.height});if(p.marginTop=0,p.marginLeft=0,!r&&i){var v=parseFloat(u.marginTop),m=parseFloat(u.marginLeft);p.top-=f-v,p.bottom-=f-v,p.left-=h-m,p.right-=h-m,p.marginTop=v,p.marginLeft=m}return(r&&!n?t.contains(c):t===c&&"BODY"!==c.nodeName)&&(p=g(p,t)),p}function M(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=E(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:m(n),s=t?0:m(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return S(l)}function P(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===a(e,"position"))return!0;var n=s(e);return!!n&&P(n)}function T(e){if(!e||!e.parentElement||d())return document.documentElement;for(var t=e.parentElement;t&&"none"===a(t,"transform");)t=t.parentElement;return t||document.documentElement}function D(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?T(e):v(e,c(t));if("viewport"===r)o=M(a,i);else{var u=void 0;"scrollParent"===r?"BODY"===(u=l(s(t))).nodeName&&(u=e.ownerDocument.documentElement):u="window"===r?e.ownerDocument.documentElement:r;var f=E(u,a,i);if("HTML"!==u.nodeName||P(a))o=f;else{var d=O(e.ownerDocument),h=d.height,p=d.width;o.top+=f.top-f.marginTop,o.bottom=h+f.top,o.left+=f.left-f.marginLeft,o.right=p+f.left}}var m="number"===typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function A(e){return e.width*e.height}function _(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=D(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return j({key:e},s[e],{area:A(s[e])})})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,f=e.split("-")[1];return u+(f?"-"+f:"")}function R(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?T(t):v(t,c(n));return E(n,i,r)}function N(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function L(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function I(e,t,n){n=n.split("-")[0];var r=N(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[c]:t[L(s)],i}function z(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function $(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=z(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&o(n)&&(t.offsets.popper=S(t.offsets.popper),t.offsets.reference=S(t.offsets.reference),t=n(t,e))})),t}function Q(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=R(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=_(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=I(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=$(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function B(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function F(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=ee.indexOf(e),r=ee.slice(n+1).concat(ee.slice(0,n));return t?r.reverse():r}var ne="flip",re="clockwise",ie="counterclockwise";function oe(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(z(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(c=c.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return S(s)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){X(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var ae={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:x({},l,o[l]),end:x({},l,o[l]+o[c]-a[c])};e.offsets.popper=j({},a,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=X(+n)?[+n,0]:oe(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||h(e.instance.popper);e.instance.reference===n&&(n=h(n));var r=F("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=D(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var c=t.priority,u=e.offsets.popper,f={primary:function(e){var n=u[e];return u[e]l[e]&&!t.escapeWithReference&&(r=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),x({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=j({},u,f[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Z(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,s=o.popper,l=o.reference,c=-1!==["left","right"].indexOf(i),u=c?"height":"width",f=c?"Top":"Left",d=f.toLowerCase(),h=c?"left":"top",p=c?"bottom":"right",v=N(r)[u];l[p]-vs[p]&&(e.offsets.popper[d]+=l[d]+v-s[p]),e.offsets.popper=S(e.offsets.popper);var m=l[d]+l[u]/2-v/2,g=a(e.instance.popper),b=parseFloat(g["margin"+f]),y=parseFloat(g["border"+f+"Width"]),O=m-e.offsets.popper[d]-b-y;return O=Math.max(Math.min(s[u]-v,O),0),e.arrowElement=r,e.offsets.arrow=(x(n={},d,Math.round(O)),x(n,h,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(B(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=D(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=L(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case ne:a=[r,i];break;case re:a=te(r);break;case ie:a=te(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=L(r);var c=e.offsets.popper,u=e.offsets.reference,f=Math.floor,d="left"===r&&f(c.right)>f(u.left)||"right"===r&&f(c.left)f(u.top)||"bottom"===r&&f(c.top)f(n.right),v=f(c.top)f(n.bottom),g="left"===r&&h||"right"===r&&p||"top"===r&&v||"bottom"===r&&m,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===o&&h||b&&"end"===o&&p||!b&&"start"===o&&v||!b&&"end"===o&&m),O=!!t.flipVariationsByContent&&(b&&"start"===o&&p||b&&"end"===o&&h||!b&&"start"===o&&m||!b&&"end"===o&&v),w=y||O;(d||g||w)&&(e.flipped=!0,(d||g)&&(r=a[l+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=j({},e.offsets.popper,I(e.instance.popper,e.offsets.reference,e.placement)),e=$(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=L(t),e.offsets.popper=S(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Z(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=z(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};w(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=i(this.update.bind(this)),this.options=j({},e.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(j({},e.Defaults.modifiers,a.modifiers)).forEach((function(t){r.options.modifiers[t]=j({},e.Defaults.modifiers[t]||{},a.modifiers?a.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return j({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&o(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return k(e,[{key:"update",value:function(){return Q.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return U.call(this)}},{key:"disableEventListeners",value:function(){return Y.call(this)}}]),e}();se.Utils=("undefined"!==typeof window?window:e).PopperUtils,se.placements=J,se.Defaults=ae,t.a=se}).call(this,n(125))},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"PlayCircleOutline");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"}),"Equalizer");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}),"Code");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5v11zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2zM3 19c0 1.1.9 2 2 2h3V10H3v9z"}),"TableChart");t.default=a},function(e,t,n){"use strict";var r=n(1),i=n(44),o=n(39),a=n(0),s=n(11),l=n.n(s),c=n(188),u=["client","offset","scroll","bounds","margin"];function f(e){var t=[];return u.forEach((function(n){e[n]&&t.push(n)})),t}function d(e,t){var n={};if(t.indexOf("client")>-1&&(n.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf("offset")>-1&&(n.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf("scroll")>-1&&(n.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf("bounds")>-1){var r=e.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(t.indexOf("margin")>-1){var i=getComputedStyle(e);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function h(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||window}var p=function(e){return function(t){var n,s;return s=n=function(n){function s(){for(var t,r=arguments.length,i=new Array(r),o=0;o0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;a.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),c=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),w="undefined"!==typeof WeakMap?new WeakMap:new n,k=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=l.getInstance(),r=new O(t,n,this);w.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){k.prototype[e]=function(){var t;return(t=w.get(this))[e].apply(t,arguments)}}));var x="undefined"!==typeof i.ResizeObserver?i.ResizeObserver:k;t.a=x}).call(this,n(125))},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"}),"Security");t.default=a},function(e,t,n){"use strict";var r=n(50),i=n(51);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(52)).default)(o.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy");t.default=a},function(e,t,n){"use strict";var r=n(62),i=n.n(r),o=n(195),a=n.n(o),s=n(196),l=n.n(s);i.a.extend(a.a),i.a.extend(l.a);var c=function(){function e(e){var t=void 0===e?{}:e,n=t.locale,r=t.instance,o=t.dayjs;this.yearFormat="YYYY",this.yearMonthFormat="MMMM YYYY",this.dateTime12hFormat="MMMM Do hh:mm a",this.dateTime24hFormat="MMMM Do HH:mm",this.time12hFormat="hh:mm A",this.time24hFormat="HH:mm",this.dateFormat="MMMM Do",this.dayjs=function(e,t){return t?function(){for(var n=[],r=0;r-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},f={A:[o,function(e){this.afternoon=u(e,!1)}],a:[o,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,s("seconds")],ss:[i,s("seconds")],m:[i,s("minutes")],mm:[i,s("minutes")],H:[i,s("hours")],h:[i,s("hours")],HH:[i,s("hours")],hh:[i,s("hours")],D:[i,s("day")],DD:[r,s("day")],Do:[o,function(e){var t=a.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[i,s("month")],MM:[r,s("month")],MMM:[o,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.substr(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,s("year")],YY:[r,function(e){e=+e,this.year=e+(e>68?1900:2e3)}],YYYY:[/\d{4}/,s("year")],Z:l,ZZ:l},d=function(e,r,i){try{var o=function(e){for(var r=(e=t(e,a&&a.formats)).match(n),i=r.length,o=0;o0?l-1:m.getMonth());var O=u||0,w=d||0,k=h||0,x=p||0;return v?new Date(Date.UTC(b,y,g,O,w,k,x+60*v.offset*1e3)):i?new Date(Date.UTC(b,y,g,O,w,k,x)):new Date(b,y,g,O,w,k,x)}catch(e){return new Date("")}};return function(e,t,n){n.p.customParseFormat=!0;var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var s=o[1];if("string"==typeof s){var l=!0===o[2],c=!0===o[3],u=l||c,f=o[2];c&&(f=o[2]),a=this.$locale(),!l&&f&&(a=n.Ls[f]),this.$d=d(t,s,r),this.init(),f&&!0!==f&&(this.$L=this.locale(f).$L),u&&t!==this.format(s)&&(this.$d=new Date("")),a={}}else if(s instanceof Array)for(var h=s.length,p=1;p<=h;p+=1){o[1]=s[p-1];var v=n.apply(this,o);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}p===h&&(this.$d=new Date(""))}else i.call(this,e)}}}()},function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){var r=t.prototype,i=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale(),r=this.$utils(),o=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(o)}}}()},function(e,t,n){"use strict";var r=n(17),i=n(6),o=n(350),a=n(1),s=["xs","sm","md","lg","xl"];function l(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,o=void 0===r?"px":r,l=e.step,c=void 0===l?5:l,u=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function d(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(o,")")},between:d,only:function(e){return d(e,e)},width:function(e){return n[e]}},u)}function c(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var u=n(201),f={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},g={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(21),O={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function k(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(y.e)(e.main,i):"dark"===t&&(e.dark=Object(y.a)(e.main,o)))}function x(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,l=e.error,c=void 0===l?{light:v[300],main:v[500],dark:v[700]}:l,x=e.warning,j=void 0===x?{light:m[300],main:m[500],dark:m[700]}:x,S=e.info,C=void 0===S?{light:g[300],main:g[500],dark:g[700]}:S,E=e.success,M=void 0===E?{light:b[300],main:b[500],dark:b[700]}:E,P=e.type,T=void 0===P?"light":P,D=e.contrastThreshold,A=void 0===D?3:D,_=e.tonalOffset,R=void 0===_?.2:_,N=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function L(e){return Object(y.d)(e,w.text.primary)>=A?w.text.primary:O.text.primary}var I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(u.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(u.a)(5,JSON.stringify(e.main)));return k(e,"light",n,R),k(e,"dark",r,R),e.contrastText||(e.contrastText=L(e.main)),e},z={dark:w,light:O};return Object(o.a)(Object(a.a)({common:f,type:T,primary:I(n),secondary:I(s,"A400","A200","A700"),error:I(c),warning:I(j),info:I(C),success:I(M),grey:d,contrastThreshold:A,getContrastText:L,augmentColor:I,tonalOffset:R},z[T]),N)}function j(e){return Math.round(1e5*e)/1e5}var S={textTransform:"uppercase"},C='"Roboto", "Helvetica", "Arial", sans-serif';function E(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?C:r,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,f=void 0===u?300:u,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,v=void 0===p?500:p,m=n.fontWeightBold,g=void 0===m?700:m,b=n.htmlFontSize,y=void 0===b?16:b,O=n.allVariants,w=n.pxToRem,k=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var x=c/14,E=w||function(e){return"".concat(e/y*x,"rem")},M=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:E(t),lineHeight:n},s===C?{letterSpacing:"".concat(j(r/t),"em")}:{},i,O)},P={h1:M(f,96,1.167,-1.5),h2:M(f,60,1.2,-.5),h3:M(h,48,1.167,0),h4:M(h,34,1.235,.25),h5:M(h,24,1.334,0),h6:M(v,20,1.6,.15),subtitle1:M(h,16,1.75,.15),subtitle2:M(v,14,1.57,.1),body1:M(h,16,1.5,.15),body2:M(h,14,1.43,.15),button:M(v,14,1.75,.4,S),caption:M(h,12,1.66,.4),overline:M(h,12,2.66,1,S)};return Object(o.a)(Object(a.a)({htmlFontSize:y,pxToRem:E,round:j,fontFamily:s,fontSize:c,fontWeightLight:f,fontWeightRegular:h,fontWeightMedium:v,fontWeightBold:g},P),k,{clone:!1})}function M(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var P=["none",M(0,2,1,-1,0,1,1,0,0,1,3,0),M(0,3,1,-2,0,2,2,0,0,1,5,0),M(0,3,3,-2,0,3,4,0,0,1,8,0),M(0,2,4,-1,0,4,5,0,0,1,10,0),M(0,3,5,-1,0,5,8,0,0,1,14,0),M(0,3,5,-1,0,6,10,0,0,1,18,0),M(0,4,5,-2,0,7,10,1,0,2,16,1),M(0,5,5,-3,0,8,10,1,0,3,14,2),M(0,5,6,-3,0,9,12,1,0,3,16,2),M(0,6,6,-3,0,10,14,1,0,4,18,3),M(0,6,7,-4,0,11,15,1,0,4,20,3),M(0,7,8,-4,0,12,17,2,0,5,22,4),M(0,7,8,-4,0,13,19,2,0,5,24,4),M(0,7,9,-4,0,14,21,2,0,5,26,4),M(0,8,9,-5,0,15,22,2,0,6,28,5),M(0,8,10,-5,0,16,24,2,0,6,30,5),M(0,8,11,-5,0,17,26,2,0,6,32,5),M(0,9,11,-5,0,18,28,2,0,7,34,6),M(0,9,12,-6,0,19,29,2,0,7,36,6),M(0,10,13,-6,0,20,31,3,0,8,38,7),M(0,10,13,-6,0,21,33,3,0,8,40,7),M(0,10,14,-6,0,22,35,3,0,8,42,7),M(0,11,14,-7,0,23,36,3,0,9,44,8),M(0,11,15,-7,0,24,38,3,0,9,46,8)],T={borderRadius:4},D=n(429);function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(D.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,s=e.palette,u=void 0===s?{}:s,f=e.spacing,d=e.typography,h=void 0===d?{}:d,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),v=x(u),m=l(n),g=A(f),b=Object(o.a)({breakpoints:m,direction:"ltr",mixins:c(m,g,a),overrides:{},palette:v,props:{},shadows:P,typography:E(v,h),spacing:g,shape:T,transitions:_.a,zIndex:R.a},p),y=arguments.length,O=new Array(y>1?y-1:0),w=1;w-1;return function(e){return b(e,!0,1,void 0,o&&!function(e){var t,n;return e.pos==(null===(t=e.options)||void 0===t?void 0:t.simulateBreak)&&(null===(n=e.options)||void 0===n?void 0:n.simulateDoubleBreak)}(e)?i.start:void 0)}}return null==e.parent?v:null}function v(){return 0}var m=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e,i,o){var a;return Object(r.a)(this,n),(a=t.call(this,e.state,e.options)).pos=i,a.node=o,a}return Object(i.a)(n,[{key:"textAfter",get:function(){return this.textAfterPos(this.pos)}},{key:"baseIndent",get:function(){for(var e=this.state.doc.lineAt(this.node.start);;){for(var t=this.node.resolve(e.from);t.parent&&t.parent.start==t.start;)t=t.parent;if(g(t,this.node))break;e=this.state.doc.lineAt(t.start)}return this.lineIndent(e)}}]),n}(u.g);function g(e,t){for(var n=t;n;n=n.parent)if(e==n)return!0;return!1}function b(e,t,n,r,i){var o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,l=t?function(e){var t,n=e.node,r=n.childAfter(n.start),i=n.lastChild;if(!r)return null;for(var o=null===(t=e.options)||void 0===t?void 0:t.simulateBreak,a=e.state.doc.lineAt(r.start),s=null==o||o<=a.from?a.to:Math.min(a.to,o),l=r.end;;){var u=n.childAfter(l);if(!u||u==i)return null;if(!u.type.prop(c.c.skipped))return u.startn)){if(r&&i.start=t&&s.to>n&&(r=s)}}return r})))]}return Object(i.a)(e,[{key:"withDialect",value:function(t){return new e(this.parser,t,this.languageData)}},{key:"getTree",value:function(e){return e.field(this.field).tree}},{key:"parsePos",value:function(e){return e.field(this.field).upto}},{key:"ensureTree",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=e.field(this.field);if(r.upto>=t)return r.updatedTree;if(r.parse||r.startParse(this,e.doc),r.parse.pos1&&void 0!==arguments[1]?arguments[1]:{},r=u.f.define({combine:n.languageData?function(e){return e.concat(n.languageData)}:void 0});return new e(t.withProps(u.n.add(Object(a.a)({},t.topType.name,r))),n.dialect||"",r)}}]),e}(),w=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length;Object(r.a)(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Object(i.a)(e,[{key:"get",value:function(e){if(e>=this.length)return-1;var t=this.cursorPos-this.string.length;return(e=this.cursorPos)&&(e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},{key:"clip",value:function(t){return new e(this.doc,t)}}]),e}();function k(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e6,r=Date.now()+t;;){var i=e.advance();if(i)return i;if(e.pos>n||Date.now()>r)return null}}function x(e,t){var n=e.forceFinish(),r=n.applyChanges([{fromA:e.pos,toA:n.length,fromB:e.pos,toB:n.length}]).append(t.applyChanges([{fromA:0,toA:e.pos,fromB:0,toB:e.pos}]));return{parsed:n,cache:r}}var j=function(){function e(t,n,i){Object(r.a)(this,e),this.tree=t,this.upto=n,this.cache=i,this.parse=null,this.updatedTree=t}return Object(i.a)(e,[{key:"apply",value:function(t,n,r){var i,a=Object(o.a)(t.effects);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(s.is(r))return s.value}}catch(c){a.e(c)}finally{a.f()}if(!t.docChanged)return this;var l=[];return t.changes.iterChangedRanges((function(e,t,n,r){return l.push({fromA:e,toA:t,fromB:n,toB:r})})),e.advance((this.parse?x(this.parse,this.updatedTree).cache:this.cache).applyChanges(l),n,t.state.doc)}},{key:"startParse",value:function(e,t){this.parse=e.parser.startParse(new w(t),{cache:this.cache,dialect:e.dialect})}},{key:"stopParse",value:function(e,t){if(e)this.cache=e;else{var n=x(this.parse,this.updatedTree);e=n.parsed,this.cache=n.cache}return this.updatedTree=e,this.upto=null!==t&&void 0!==t?t:this.parse.pos,this.parse=null,e}}],[{key:"advance",value:function(t,n,r){var i=n.parser.startParse(new w(r),{cache:t,dialect:n.dialect}),o=k(i,25);if(o)return new e(o,r.length,o);var a=x(i,t);return new e(a.parsed,i.pos,a.cache)}}]),e}(),S="undefined"!=typeof window&&window.requestIdleCallback||function(e,t){var n=t.timeout;return setTimeout(e,n)},C="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout,E=function(){function e(t,n,i){Object(r.a)(this,e),this.view=t,this.syntax=n,this.setSyntax=i,this.working=-1,this.work=this.work.bind(this),this.scheduleWork()}return Object(i.a)(e,[{key:"update",value:function(e){e.docChanged&&this.scheduleWork()}},{key:"scheduleWork",value:function(){if(!(this.working>-1)){var e=this.view.state;e.field(this.syntax.field).upto>=e.doc.length||(this.working=S(this.work,{timeout:200}))}}},{key:"work",value:function(e){this.working=-1;var t=this.view.state,n=t.field(this.syntax.field);if(!(n.upto>=t.doc.length)){n.parse||n.startParse(this.syntax,t.doc);var r=k(n.parse,e?Math.max(25,e.timeRemaining()):100);if(r||n.parse.badness>.8){var i=n.stopParse(r,t.doc.length);this.view.dispatch({effects:this.setSyntax.of(new j(i,t.doc.length,n.cache))})}else this.scheduleWork()}}},{key:"destroy",value:function(){this.working>=0&&C(this.working)}}]),e}(),M=n(115),P={bool:1,ignoring:2,on:3,group_left:4,group_right:5,offset:6},T={avg:7,bottomk:8,count:9,count_values:10,group:11,max:12,min:13,quantile:14,stddev:15,stdvar:16,sum:17,topk:18,by:19,without:20,and:21,or:22,unless:23},D={__proto__:null,absent_over_time:257,absent:259,abs:261,avg_over_time:263,ceil:265,changes:267,clamp_max:269,clamp_min:271,count_over_time:273,days_in_month:275,day_of_month:277,day_of_week:279,delta:281,deriv:283,exp:285,floor:287,histogram_quantile:289,holt_winters:291,hour:293,idelta:295,increase:297,irate:299,label_replace:301,label_join:303,ln:305,log10:307,log2:309,max_over_time:311,min_over_time:313,minute:315,month:317,predict_linear:319,quantile_over_time:321,rate:323,resets:325,round:327,scalar:329,sort:331,sort_desc:333,sqrt:335,stddev_over_time:337,stdvar_over_time:339,sum_over_time:341,timestamp:343,time:345,vector:347,year:349},A=M.b.deserialize({states:"2SO%jQPOOOOQO'#Cx'#CxO%nQPO'#CwQ'QQQOOOOQO'#De'#DeO%tQPO'#DdO%jQPO'#ElOOQO'#Ep'#EpO%jQPO'#EoOOQO'#Er'#ErO'UQSO'#EsO'^QQO'#EqOOQO'#Eq'#EqOOQO'#Cv'#CvOOQO'#Df'#DfOOQO'#Dh'#DhOOQO'#Di'#DiOOQO'#Dj'#DjOOQO'#Dk'#DkOOQO'#Dl'#DlOOQO'#Dm'#DmOOQO'#Dn'#DnOOQO'#Do'#DoOOQO'#Dp'#DpOOQO'#Dq'#DqOOQO'#Dr'#DrOOQO'#Ds'#DsOOQO'#Dt'#DtOOQO'#Du'#DuOOQO'#Dv'#DvOOQO'#Dw'#DwOOQO'#Dx'#DxOOQO'#Dy'#DyOOQO'#Dz'#DzOOQO'#D{'#D{OOQO'#D|'#D|OOQO'#D}'#D}OOQO'#EO'#EOOOQO'#EP'#EPOOQO'#EQ'#EQOOQO'#ER'#EROOQO'#ES'#ESOOQO'#ET'#ETOOQO'#EU'#EUOOQO'#EV'#EVOOQO'#EW'#EWOOQO'#EX'#EXOOQO'#EY'#EYOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#E]'#E]OOQO'#E^'#E^OOQO'#E_'#E_OOQO'#E`'#E`OOQO'#Ea'#EaOOQO'#Eb'#EbOOQO'#Ec'#EcOOQO'#Ed'#EdOOQO'#Ee'#EeOOQO'#Ef'#EfOOQO'#Eg'#EgO(qQPO'#CyO(vQPO'#DOO%tQPO,59cO(}QQO,59cO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/OQPO,59lO/SQQO,5;SO/XQQO,5;VOOQO,5:O,5:OO/^QQO,5;WO/eQQO,5;ZO0uQPO'#EuO1TQPO,5;_OOQO'#Et'#EtOOQO,5;_,5;_OOQO,5;],5;]O1]QSO'#CzOOQO,59e,59eO1eQPO,59jO1mQQO'#DPOOQO,59j,59jOOQO1G.}1G.}OOQO'#DU'#DUO6XQPO'#DTO6cQPO'#DTOOQO'#DS'#DSO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO%jQPO1G/WO6mQSO1G0nOOQO1G0q1G0qOOQO1G0r1G0rOOQO'#Ev'#EvO6uQPO,5;aO6zQSO1G0yOOQO1G0y1G0yOOQO'#C|'#C|O7SQPO,59fOOQO'#C{'#C{OOQO,59f,59fO%jQPO,59kOOQO1G/U1G/UO(qQPO,59qO7[QPO,59oO]QQO7+$rO>sQQO7+$rO@XQQO7+$rOOQO7+&Y7+&YO@oQQO7+&`OOQO1G0{1G0{OOQO1G0z1G0zOOQO7+&e7+&eO@wQSO1G/QOOQO1G/Q1G/QOAPQQO1G/VOOQO1G/]1G/]OOQO'#DW'#DWOOQO1G/Z1G/ZOOQO<|Q;xP#]Q!Q![;{QR#g#h+rQ>UR!Q![>R#a#b>_#g#h>eQ>bP#g#h+rQ>jP#]Q!Q![>mQ>pQ!Q![>m#a#b>vQ>yP#g#h+rQ?RP#]Q!Q![?UQ?XQ!Q![?U#a#b?_Q?bP#g#h+rQ?jP#]Q!Q![?mQ?pR!Q![?m#a#b?y#g#hAPQ@OQ#]Q!Q![@U#g#h+rQ@XR!Q![@U#a#b@b#g#h@hQ@eP#g#h+rQ@mP#]Q!Q![@pQ@sQ!Q![@p#a#b@yQ@|P#g#h+rQAUP#]Q!Q![AXQA[Q!Q![AX#a#bAbQAeP#g#h+rQAmQ#]Q!Q![As#g#h+rQAvR!Q![As#a#bBP#g#hBVQBSP#g#h+rQB[P#]Q!Q![B_QBbQ!Q![B_#a#bBhQBkP#g#h+rQBsP#]Q!Q![BvQByQ!Q![Bv#a#bCPQCSP#g#h+rQC[P#]Q!Q![C_QCbT!Q![C_#W#XCq#[#]Gz#a#bI}#g#hKTQCvP#]Q!Q![CyQC|S!Q![Cy#[#]DY#a#bF]#g#hGcQD_P#]Q!Q![DbQDeR!Q![Db#a#bDn#g#hEtQDsQ#]Q!Q![Dy#g#h+rQD|R!Q![Dy#a#bEV#g#hE]QEYP#g#h+rQEbP#]Q!Q![EeQEhQ!Q![Ee#a#bEnQEqP#g#h+rQEyP#]Q!Q![E|QFPQ!Q![E|#a#bFVQFYP#g#h+rQFbQ#]Q!Q![Fh#g#h+rQFkR!Q![Fh#a#bFt#g#hFzQFwP#g#h+rQGPP#]Q!Q![GSQGVQ!Q![GS#a#bG]QG`P#g#h+rQGhP#]Q!Q![GkQGnQ!Q![Gk#a#bGtQGwP#g#h+rQHPP#]Q!Q![HSQHVR!Q![HS#a#bH`#g#hIfQHeQ#]Q!Q![Hk#g#h+rQHnR!Q![Hk#a#bHw#g#hH}QHzP#g#h+rQISP#]Q!Q![IVQIYQ!Q![IV#a#bI`QIcP#g#h+rQIkP#]Q!Q![InQIqQ!Q![In#a#bIwQIzP#g#h+rQJSQ#]Q!Q![JY#g#h+rQJ]R!Q![JY#a#bJf#g#hJlQJiP#g#h+rQJqP#]Q!Q![JtQJwQ!Q![Jt#a#bJ}QKQP#g#h+rQKYP#]Q!Q![K]QK`Q!Q![K]#a#bKfQKiP#g#h+rPKoR!Q![Kx!c!iKx#T#ZKxPK}R#^P!Q![Kx!c!iKx#T#ZKxVL_T$wS!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLnRLsT!ZR!Q![Ln![!]Ln!c!}Ln#R#SLn#T#oLn~MXP!U~!_!`M[~MaO!T~~MfQ#kP!_!`Ml#r#sMqQMqO!QQ~MvO#l~~M{P!S~!_!`NO~NTO!R~VN[T!ZRqS!Q![NT![!]Ln!c!}NT#R#SNT#T#oNT~NpO$u~~NuO$v~~NzOu~~N}RO#SNz#S#T%Y#T~Nz~! ]O$z~~! bO${~",tokenizers:[0,1,2],topRules:{"@top":[0,25]},specialized:[{term:57,get:function(e,t){return function(e,t){return P[e.toLowerCase()]||-1}(e)<<1}},{term:57,get:function(e,t){return function(e,t){return T[e.toLowerCase()]||-1}(e)<<1|1}},{term:57,get:function(e){return D[e]||-1}}],tokenPrec:0}),_=26,R=36,N=38,L=39,I=104,z=107,$=109,Q=113,B=117,F=119,W=n(110),H=n(16),V=n(25);function q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=n.length){var a=e.resolve(o,-1);if(a.type.id===t.id&&a.start===r&&a.end===o)return a;for(a=e.resolve(r,1);a&&(a.type.id!==t.id||a.start!==r||a.end!==o);)a=a.parent;return a}}})}function U(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r="},{label:">"},{label:"<"},{label:"<="},{label:"!="},{label:"and"},{label:"or"},{label:"unless"}],Z=[{label:"avg",detail:"aggregation",info:"Calculate the average over dimensions",type:"keyword"},{label:"bottomk",detail:"aggregation",info:"Smallest k elements by sample value",type:"keyword"},{label:"count",detail:"aggregation",info:"Count number of elements in the vector",type:"keyword"},{label:"count_values",detail:"aggregation",info:"Count number of elements with the same value",type:"keyword"},{label:"group",detail:"aggregation",info:"Group series, while setting the sample value to 1",type:"keyword"},{label:"max",detail:"aggregation",info:"Select maximum over dimensions",type:"keyword"},{label:"min",detail:"aggregation",info:"Select minimum over dimensions",type:"keyword"},{label:"quantile",detail:"aggregation",info:"Calculate \u03c6-quantile (0 \u2264 \u03c6 \u2264 1) over dimensions",type:"keyword"},{label:"stddev",detail:"aggregation",info:"Calculate population standard deviation over dimensions",type:"keyword"},{label:"stdvar",detail:"aggregation",info:"Calculate population standard variance over dimensions",type:"keyword"},{label:"sum",detail:"aggregation",info:"Calculate sum over dimensions",type:"keyword"},{label:"topk",detail:"aggregation",info:"Largest k elements by sample value",type:"keyword"}],J=[{label:"sum(rate(__input_vector__[5m]))",type:"function",detail:"snippet",info:"Sum over rates of increase",apply:Object(K.c)("sum(rate(${__input_vector__}[5m]))")},{label:"histogram_quantile(__quantile__, sum by(le) (rate(__histogram_metric__[5m])))",type:"function",detail:"snippet",info:"Approximate a quantile value from an aggregated histogram",apply:Object(K.c)("histogram_quantile(${__quantile__}, sum by(le) (rate(${__histogram_metric__}[5m])))")},{label:'label_replace(__input_vector__, "__dst__", "__replacement__", "__src__", "__regex__")',type:"function",detail:"snippet",info:"Set or replace a label value in an input vector",apply:Object(K.c)('label_replace(${__input_vector__}, "${__dst__}", "${__replacement__}", "${__src__}", "${__regex__}")')}],ee={matchOp:[{label:"="},{label:"!="},{label:"=~"},{label:"!~"}],binOp:G,duration:[{label:"y"},{label:"w"},{label:"d"},{label:"h"},{label:"m"},{label:"s"},{label:"ms"}],binOpModifier:[{label:"on",info:"Match only on specified labels",type:"keyword"},{label:"ignoring",info:"Ignore specified labels for matching",type:"keyword"},{label:"group_left",info:"Allow many-to-one matching",type:"keyword"},{label:"group_right",info:"Allow one-to-many matching",type:"keyword"}],functionIdentifier:[{label:"abs",detail:"function",info:"Return absolute values of input series",type:"function"},{label:"absent",detail:"function",info:"Determine whether input vector is empty",type:"function"},{label:"absent_over_time",detail:"function",info:"Determine whether input range vector is empty",type:"function"},{label:"avg_over_time",detail:"function",info:"Average series values over time",type:"function"},{label:"ceil",detail:"function",info:"Round up values of input series to nearest integer",type:"function"},{label:"changes",detail:"function",info:"Return number of value changes in input series over time",type:"function"},{label:"clamp_max",detail:"function",info:"Limit the value of input series to a maximum",type:"function"},{label:"clamp_min",detail:"function",info:"Limit the value of input series to a minimum",type:"function"},{label:"count_over_time",detail:"function",info:"Count the number of values for each input series",type:"function"},{label:"days_in_month",detail:"function",info:"Return the number of days in current month for provided timestamps",type:"function"},{label:"day_of_month",detail:"function",info:"Return the day of the month for provided timestamps",type:"function"},{label:"day_of_week",detail:"function",info:"Return the day of the week for provided timestamps",type:"function"},{label:"delta",detail:"function",info:"Calculate the difference between beginning and end of a range vector (for gauges)",type:"function"},{label:"deriv",detail:"function",info:"Calculate the per-second derivative over series in a range vector (for gauges)",type:"function"},{label:"exp",detail:"function",info:"Calculate exponential function for input vector values",type:"function"},{label:"floor",detail:"function",info:"Round down values of input series to nearest integer",type:"function"},{label:"histogram_quantile",detail:"function",info:"Calculate quantiles from histogram buckets",type:"function"},{label:"holt_winters",detail:"function",info:"Calculate smoothed value of input series",type:"function"},{label:"hour",detail:"function",info:"Return the hour of the day for provided timestamps",type:"function"},{label:"idelta",detail:"function",info:"Calculate the difference between the last two samples of a range vector (for counters)",type:"function"},{label:"increase",detail:"function",info:"Calculate the increase in value over a range of time (for counters)",type:"function"},{label:"irate",detail:"function",info:"Calculate the per-second increase over the last two samples of a range vector (for counters)",type:"function"},{label:"label_replace",detail:"function",info:"Set or replace label values",type:"function"},{label:"label_join",detail:"function",info:"Join together label values into new label",type:"function"},{label:"ln",detail:"function",info:"Calculate natural logarithm of input series",type:"function"},{label:"log10",detail:"function",info:"Calulcate base-10 logarithm of input series",type:"function"},{label:"log2",detail:"function",info:"Calculate base-2 logarithm of input series",type:"function"},{label:"max_over_time",detail:"function",info:"Return the maximum value over time for input series",type:"function"},{label:"min_over_time",detail:"function",info:"Return the minimum value over time for input series",type:"function"},{label:"minute",detail:"function",info:"Return the minute of the hour for provided timestamps",type:"function"},{label:"month",detail:"function",info:"Return the month for provided timestamps",type:"function"},{label:"predict_linear",detail:"function",info:"Predict the value of a gauge into the future",type:"function"},{label:"quantile_over_time",detail:"function",info:"Calculate value quantiles over time for input series",type:"function"},{label:"rate",detail:"function",info:"Calculate per-second increase over a range vector (for counters)",type:"function"},{label:"resets",detail:"function",info:"Return number of value decreases (resets) in input series of time",type:"function"},{label:"round",detail:"function",info:"Round values of input series to nearest integer",type:"function"},{label:"scalar",detail:"function",info:"Convert single-element series vector into scalar value",type:"function"},{label:"sort",detail:"function",info:"Sort input series ascendingly by value",type:"function"},{label:"sort_desc",detail:"function",info:"Sort input series descendingly by value",type:"function"},{label:"sqrt",detail:"function",info:"Return the square root for input series",type:"function"},{label:"stddev_over_time",detail:"function",info:"Calculate the standard deviation within input series over time",type:"function"},{label:"stdvar_over_time",detail:"function",info:"Calculate the standard variation within input series over time",type:"function"},{label:"sum_over_time",detail:"function",info:"Calculate the sum over the values of input series over time",type:"function"},{label:"time",detail:"function",info:"Return the Unix timestamp at the current evaluation time",type:"function"},{label:"timestamp",detail:"function",info:"Return the Unix timestamp for the samples in the input vector",type:"function"},{label:"vector",detail:"function",info:"Convert a scalar value into a single-element series vector",type:"function"},{label:"year",detail:"function",info:"Return the year for provided timestamps",type:"function"}],aggregateOp:Z,aggregateOpModifier:[{label:"by",info:"Keep the listed labels, remove all others.",type:"keyword"},{label:"without",info:"Remove the listed labels, preserve all others.",type:"keyword"}]};function te(e,t){var n=function(e,t){for(var n=e;n&&n.type.id!==t;)n=n.parent;return n}(e,Q);return n&&(n=q(n,114,57))?t.sliceDoc(n.start,n.end):""}function ne(e,t){var n,r,i,o,a,s,l,c,u,f,d,h,p,v,m,g,b,y=[];switch(t.type.id){case 0:if((null===(n=t.parent)||void 0===n?void 0:n.type.id)===z){y.push({kind:X.Duration});break}if((null===(r=t.parent)||void 0===r?void 0:r.type.id)===I){y.push({kind:X.Duration});break}var O=e.sliceDoc(t.start,t.end);G.filter((function(e){return e.label.includes(O)})).length>0&&y.push({kind:X.BinOp});break;case 57:if(0===(null===(i=t.parent)||void 0===i?void 0:i.type.id)){if(27===(null===(o=t.parent.parent)||void 0===o?void 0:o.type.id)){y.push({kind:X.AggregateOpModifier},{kind:X.BinOp});break}if((null===(a=t.parent.parent)||void 0===a?void 0:a.type.id)===Q){var w=te(t,e);Z.filter((function(e){return e.label===w})).length>0&&y.push({kind:X.AggregateOpModifier}),y.push({kind:X.BinOp},{kind:X.Offset});break}}var k=null===(c=null===(l=null===(s=t.parent)||void 0===s?void 0:s.parent)||void 0===l?void 0:l.parent)||void 0===c?void 0:c.parent;if(!k){y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break}(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&i++;var o=0,a=e.iterate({enter:function(t){if(t.id!==e.type.id||0!==i)return(t.id===n[o]||t.name===n[o])&&++o>=n.length;i++}});return void 0!==a&&a})(k,_,_)?k.type.id!==R||U(k,0)?(k.type.id!==R||k.type.id===R&&U(k,0))&&y.push({kind:X.BinOp},{kind:X.Offset}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation},{kind:X.BinOpModifier}):y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 30:y.push({kind:X.LabelName});break;case 115:y.push({kind:X.LabelName,metricName:te(t,e)});break;case 33:32===(null===(u=t.parent)||void 0===u?void 0:u.type.id)?y.push({kind:X.LabelName}):(null===(f=t.parent)||void 0===f?void 0:f.type.id)===B&&y.push({kind:X.LabelName,metricName:te(t,e)});break;case B:33===(null===(d=t.firstChild)||void 0===d?void 0:d.type.id)&&0===(null===(h=t.lastChild)||void 0===h?void 0:h.type.id)&&null===(null===(p=t.lastChild)||void 0===p?void 0:p.firstChild)&&y.push({kind:X.MatchOp});break;case $:if((null===(v=t.parent)||void 0===v?void 0:v.type.id)===B){var x="";33===(null===(m=t.parent.firstChild)||void 0===m?void 0:m.type.id)&&(x=e.sliceDoc(t.parent.firstChild.start,t.parent.firstChild.end));var j=te(t,e);y.push({kind:X.LabelValue,metricName:j,labelName:x})}break;case 105:case z:y.push({kind:X.Duration});break;case 34:y.push({kind:X.MetricName},{kind:X.Function},{kind:X.Aggregation});break;case 53:118===(null===(g=t.parent)||void 0===g?void 0:g.type.id)?y.push({kind:X.MatchOp}):(null===(b=t.parent)||void 0===b?void 0:b.type.id)===R&&y.push({kind:X.BinOp});break;case F:case 120:case 121:case 118:y.push({kind:X.MatchOp});break;case 37:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 21:case 23:case 22:case R:y.push({kind:X.BinOp})}return y}!function(e){e[e.MetricName=0]="MetricName",e[e.LabelName=1]="LabelName",e[e.LabelValue=2]="LabelValue",e[e.Function=3]="Function",e[e.Aggregation=4]="Aggregation",e[e.BinOpModifier=5]="BinOpModifier",e[e.BinOp=6]="BinOp",e[e.MatchOp=7]="MatchOp",e[e.AggregateOpModifier=8]="AggregateOpModifier",e[e.Duration=9]="Duration",e[e.Offset=10]="Offset"}(X||(X={}));var re=function(){function e(t){Object(r.a)(this,e),this.prometheusClient=t}return Object(i.a)(e,[{key:"promQL",value:function(e){var t,n=this,r=e.state,i=e.pos,a=r.tree.resolve(i,-1),s=ne(r,a),l=Promise.resolve([]),c=!1,u=!0,f=Object(o.a)(s);try{var d=function(){var e=t.value;switch(e.kind){case X.Aggregation:l=l.then((function(e){return e.concat(ee.aggregateOp)}));break;case X.Function:l=l.then((function(e){return e.concat(ee.functionIdentifier)}));break;case X.BinOpModifier:l=l.then((function(e){return e.concat(ee.binOpModifier)}));break;case X.BinOp:l=l.then((function(e){return e.concat(ee.binOp)}));break;case X.MatchOp:l=l.then((function(e){return e.concat(ee.matchOp)}));break;case X.AggregateOpModifier:l=l.then((function(e){return e.concat(ee.aggregateOpModifier)}));break;case X.Duration:u=!1,l=l.then((function(e){return e.concat(ee.duration)}));break;case X.Offset:l=l.then((function(e){return e.concat([{label:"offset"}])}));break;case X.MetricName:l=l.then((function(e){return c=!0,n.autocompleteMetricName(e)}));break;case X.LabelName:l=l.then((function(t){return n.autocompleteLabelName(t,e.metricName)}));break;case X.LabelValue:l=l.then((function(t){return n.autocompleteLabelValue(t,e.labelName,e.metricName)}))}};for(f.s();!(t=f.n()).done;)d()}catch(h){f.e(h)}finally{f.f()}return l.then((function(e){return function(e,t,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=e;return arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&i.push.apply(i,Object(V.a)(J)),{from:t,to:n,options:i,span:r?/^[a-zA-Z0-9_:]+$/:void 0}}(e,function(e,t){var n,r,i,o,a,s,l=e.start;return 30===e.type.id||115===e.type.id||34===e.type.id||e.type.id===$&&(null===(n=e.parent)||void 0===n?void 0:n.type.id)===B?l++:e.type.id===B&&33===(null===(r=e.firstChild)||void 0===r?void 0:r.type.id)&&0===(null===(i=e.lastChild)||void 0===i?void 0:i.type.id)&&null===(null===(o=e.lastChild)||void 0===o?void 0:o.firstChild)?l=e.lastChild.start:e.type.id!==z&&(0!==e.type.id||(null===(a=e.parent)||void 0===a?void 0:a.type.id)!==z&&(null===(s=e.parent)||void 0===s?void 0:s.type.id)!==I)||(l=t),l}(a,i),i,c,u)}))}},{key:"autocompleteMetricName",value:function(e){var t=this;if(!this.prometheusClient)return e;var n=new Map;return this.prometheusClient.labelValues("__name__").then((function(e){var r,i,a=Object(o.a)(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;n.set(s,{label:s,type:"constant"})}}catch(l){a.e(l)}finally{a.f()}if(e.length<=1e4)return null===(r=t.prometheusClient)||void 0===r?void 0:r.metricMetadata()})).then((function(t){if(t){var r,i=Object(o.a)(n);try{for(i.s();!(r=i.n()).done;){var a=Object(H.a)(r.value,2),s=a[0],l=a[1],c=t.get(s.replace(/(_count|_sum|_bucket)$/,""));if(c)if(c.length>1){var u,f=Object(o.a)(c);try{for(f.s();!(u=f.n()).done;){var d=u.value;""===l.detail?l.detail=d.type:l.detail!==d.type&&(l.detail="unknown",l.info="multiple different definitions for this metric"),""===l.info?l.info=d.help:l.info!==d.help&&(l.info="multiple different definitions for this metric")}}catch(m){f.e(m)}finally{f.f()}}else if(1===c.length){var h=c[0],p=h.type,v=h.help;"histogram"!==p&&"summary"!==p||(s.endsWith("_count")&&(p="counter",v="The total number of observations for: ".concat(v)),s.endsWith("_sum")&&(p="counter",v="The total sum of observations for: ".concat(v)),s.endsWith("_bucket")&&(p="counter",v="The total count of observations for a bucket in the histogram: ".concat(v))),l.detail=p,l.info=v}}}catch(m){i.e(m)}finally{i.f()}}return e.concat(Array.from(n.values()))}))}},{key:"autocompleteLabelName",value:function(e,t){return this.prometheusClient?this.prometheusClient.labelNames(t).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"constant"}})))})):e}},{key:"autocompleteLabelValue",value:function(e,t,n){return this.prometheusClient&&t?this.prometheusClient.labelValues(t,n).then((function(t){return e.concat(t.map((function(e){return{label:e,type:"text"}})))})):e}}]),e}(),ie="/api/v1/label/:name/values",oe=function(){function e(){Object(r.a)(this,e),this.completeAssociation=new Map,this.metricMetadata=new Map,this.labelValues=new Map,this.labelNames=[]}return Object(i.a)(e,[{key:"setAssociation",value:function(e,t){var n=this.completeAssociation.get(e);n||(n=new Map,this.completeAssociation.set(e,n));for(var r=0,i=Object.entries(t);r0)return Promise.resolve(this.cache.getLabelNames(e));var n=new Date,r=new Date(n.getTime()-this.lookbackInterval);if(void 0===e||""===e){var i=new URLSearchParams({start:r.toISOString(),end:n.toISOString()});return this.fetchAPI("".concat("/api/v1/labels","?").concat(i)).then((function(e){return t.cache.setLabelNames(e),e})).catch((function(e){return t.errorHandler&&t.errorHandler(e),[]}))}return this.series(e,r,n).then((function(n){return t.cache.getLabelNames(e)}))}},{key:"labelValues",value:function(e,t){var n=this;if(this.cache.getLabelValues(e,t)&&this.cache.getLabelValues(e,t).length>0)return Promise.resolve(this.cache.getLabelValues(e,t));var r=new Date,i=new Date(r.getTime()-this.lookbackInterval);if(!t||0===t.length){var o=new URLSearchParams({start:i.toISOString(),end:r.toISOString()});return this.fetchAPI("".concat(ie.replace(/:name/gi,e),"?").concat(o)).then((function(t){return n.cache.setLabelValues(e,t),t})).catch((function(e){return n.errorHandler&&n.errorHandler(e),[]}))}return this.series(t,i,r).then((function(r){return n.cache.getLabelValues(e,t)}))}},{key:"metricMetadata",value:function(){var e=this;return this.cache.getMetricMetadata()&&this.cache.getMetricMetadata().size>0?Promise.resolve(this.cache.getMetricMetadata()):this.fetchAPI("/api/v1/metadata").then((function(t){for(var n=0,r=Object.entries(t);n0){var s,l=Object(o.a)(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;n.matchingLabels.push(e.sliceDoc(c.start,c.end))}}catch(m){l.e(m)}finally{l.f()}}}var u=q(t,N,L,4),f=q(t,N,L,5);if(u||f){n.card=u?pe.CardManyToOne:pe.CardOneToMany;var d=Y(q(t,N,L,42,30),31,32);if(d.length>0){var h,p=Object(o.a)(d);try{for(p.s();!(h=p.n()).done;){var v=h.value;n.include.push(e.sliceDoc(v.start,v.end))}}catch(m){p.e(m)}finally{p.f()}}}return U(t,21,22,23)&&n.card===pe.CardOneToOne&&(n.card=pe.CardManyToMany),n}(this.state,e);if(null!==c&&c.on){var u,f=Object(o.a)(c.matchingLabels);try{for(f.s();!(u=f.n()).done;){var d,h=u.value,p=Object(o.a)(c.include);try{for(p.s();!(d=p.n()).done;){h===d.value&&this.addDiagnostic(e,'label "'.concat(h,'" must not occur in ON and GROUP clause at once'))}}catch(v){p.e(v)}finally{p.f()}}}catch(v){f.e(v)}finally{f.f()}}r!==de.scalar&&r!==de.vector&&this.addDiagnostic(t,"binary expression must contain only scalar and instant vector types"),i!==de.scalar&&i!==de.vector&&this.addDiagnostic(n,"binary expression must contain only scalar and instant vector types"),r===de.vector&&i===de.vector||null===c?l&&((null===c||void 0===c?void 0:c.card)!==pe.CardOneToMany&&(null===c||void 0===c?void 0:c.card)!==pe.CardManyToOne||this.addDiagnostic(e,"no grouping allowed for set operations"),(null===c||void 0===c?void 0:c.card)!==pe.CardManyToMany&&this.addDiagnostic(e,"set operations must always be many-to-many")):c.matchingLabels.length>0&&this.addDiagnostic(e,"vector matching only allowed between instant vectors"),r!==de.scalar&&i!==de.scalar||!l||this.addDiagnostic(e,"set operator not allowed in binary scalar expression")}else this.addDiagnostic(e,"left or right expression is missing in binary expression")}},{key:"checkCallFunction",value:function(e){var t,n=null===(t=e.firstChild)||void 0===t?void 0:t.firstChild;if(n){var r=Y(q(e,34),35,_),i=me(n.type.id),o=i.argTypes.length;if(0===i.variadic)r.length!==o&&this.addDiagnostic(e,"expected ".concat(o," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var a=o-1;if(a>r.length)this.addDiagnostic(e,"expected at least ".concat(a," argument(s) in call to ").concat(i.name,", got ").concat(r.length));else{var s=a+i.variadic;i.variadic>0&&s=i.argTypes.length){if(0===i.variadic)break;l=i.argTypes.length-1}this.expectType(r[c],i.argTypes[l],"call to function ".concat(i.name))}}else this.addDiagnostic(e,"function not defined")}},{key:"checkVectorSelector",value:function(e){var t=ye(Y(q(e,115,116),116,B),this.state),n="",r=q(e,114,57);if(r&&(n=this.state.sliceDoc(r.start,r.end)),""!==n){var i=t.find((function(e){return"__name__"===e.name}));i&&this.addDiagnostic(e,"metric name must not be set twice: ".concat(n," or ").concat(i.value)),t.push(new be(F,"__name__",n))}t.every((function(e){return e.matchesEmpty()}))&&this.addDiagnostic(e,"vector selector must contain at least one non-empty matcher")}},{key:"expectType",value:function(e,t,n){var r=this.checkAST(e);r!==t&&this.addDiagnostic(e,"expected type ".concat(t," in ").concat(n,", got ").concat(r))}},{key:"addDiagnostic",value:function(e,t){this.diagnostics.push({severity:"error",message:t,from:e.start,to:e.end})}}]),e}(),we=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,[{key:"promQL",value:function(){return function(e){var t=new Oe(e.state);return t.analyze(),t.getDiagnostics()}}}]),e}();var ke=O.define(A.withProps(Object(W.b)({LineComment:"comment",LabelName:"labelName",StringLiteral:"string",NumberLiteral:"number",Duration:"number","Abs Absent AbsentOverTime AvgOverTime Ceil Changes ClampMax ClampMin CountOverTime DaysInMonth DayOfMonth DayOfWeek Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin Ln Log10 Log2 MaxOverTime MinOverTime Minute Month PredictLinear QuantileOverTime Rate Resets Round Scalar Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Time Timestamp Vector Year":"functionName","Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk":"operatorKeyword","By Without Bool On Ignoring GroupLeft GroupRight Offset":"modifier","And Unless Or":"logicOperator","Sub Add Mul Mod Div Eql Neq Lte Lss Gte Gtr EqlRegex EqlSingle NeqRegex Pow":"operator",UnaryOp:"arithmeticOperator","( )":"paren","[ ]":"squareBracket","{ }":"brace","\u26a0":"invalid"})),{languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}),xe=function(){function e(){Object(r.a)(this,e),this.complete=ue(),this.lint=new we,this.enableLinter=!0,this.enableCompletion=!0}return Object(i.a)(e,[{key:"setComplete",value:function(e){return this.complete=ue(e),this}},{key:"activateCompletion",value:function(e){return this.enableCompletion=e,this}},{key:"activateLinter",value:function(e){return this.enableLinter=e,this}},{key:"asExtension",value:function(){var e,t,n=this,r=[ke];if(this.enableCompletion){var i=ke.languageData.of({autocomplete:function(e){return n.complete.promQL(e)}});r=r.concat(i)}return this.enableLinter&&(r=r.concat((e=this.lint.promQL,t=this.lint,Object(he.b)(e.call(t))))),r}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return Pt}));var r=n(25),i=n(9),o=n(3),a=n(4),s=n(5),l=n(7),c=o.a.define(),u=o.a.define(),f=o.f.define(),d=o.f.define({combine:function(e){return Object(o.m)(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),h=o.j.define({create:function(){return M.empty},update:function(e,t){var n=t.state.facet(d),r=t.annotation(c);if(r){var i=O.fromTransaction(t),a=r.side,s=0==a?e.undone:e.done;return s=i?w(s,s.length,n.minDepth,i):j(s,t.startState.selection),new M(0==a?r.rest:s,0==a?s:r.rest)}var l=t.annotation(u);if("full"!=l&&"before"!=l||(e=e.isolate()),!1===t.annotation(o.l.addToHistory))return t.changes.length?e.addMapping(t.changes.desc):e;var f=O.fromTransaction(t),h=t.annotation(o.l.time),p=t.annotation(o.l.userEvent);return f?e=e.addChanges(f,h,p,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,h,p,n.newGroupDelay)),"full"!=l&&"after"!=l||(e=e.isolate()),e}});function p(e,t){return function(n){var r=n.state,i=n.dispatch,o=r.field(h,!1);if(!o)return!1;var a=o.pop(e,r,t);return!!a&&(i(a),!0)}}var v=p(0,!1),m=p(1,!1),g=p(0,!0),b=p(1,!0);function y(e){return function(t){var n=t.field(h,!1);if(!n)return 0;var r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}y(0),y(1);var O=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return Object(l.a)(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}}],[{key:"fromTransaction",value:function(t){var n,r=x,i=Object(a.a)(t.startState.facet(f));try{for(i.s();!(n=i.n()).done;){var o=(0,n.value)(t);o.length&&(r=r.concat(o))}}catch(s){i.e(s)}finally{i.f()}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,t.startState.selection,x)}},{key:"selection",value:function(t){return new e(void 0,x,void 0,void 0,t)}}]),e}();function w(e,t,n,r){var i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function k(e,t){return e.length?t.length?e.concat(t):e:t}var x=[];function j(e,t){if(e.length){var n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),w(e,e.length-1,1e9,n.setSelAfter(r)))}return[O.selection([t])]}function S(e){var t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function C(e,t){if(!e.length)return e;for(var n=e.length,r=x;n;){var i=E(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){var o=e.slice(0,n);return o[n-1]=i,o}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[O.selection(r)]:x}function E(e,t,n){var r=k(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):x,n);if(!e.changes)return O.selection(r);var i=e.changes.map(t),a=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(a):a;return new O(i,o.i.mapEffects(e.effects,t),s,e.startSelection.map(a),r)}var M=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;Object(s.a)(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Object(l.a)(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,o){var a=this.done,s=a[a.length-1];return new e(a=s&&s.changes&&n-this.prevTime=s&&i<=l&&(r=!0)}})),r}(s.changes,t.changes)?w(a,a.length-1,o,new O(t.changes.compose(s.changes),k(t.effects,s.effects),s.mapped,s.startSelection,x)):w(a,a.length,o,t),x,n,r)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:x;return s.length>0&&n-this.prevTimethis.i;)e.dom.removeChild(e.elements.pop().dom)}}]),e}(),F=function(){function e(t,n){var r=this;Object(s.a)(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className=Object(i.n)("gutter"+(this.config.style?"."+this.config.style:"")),this.elementClass=Object(i.n)("gutterElement"+(this.config.style?"."+this.config.style:""));var o=function(e){r.dom.addEventListener(e,(function(r){var i=t.visualLineAtHeight(r.clientY,t.contentDOM.getBoundingClientRect().top);n.domEventHandlers[e](t,i,r)&&r.preventDefault()}))};for(var a in n.domEventHandlers)o(a);this.markers=n.markers(t.state),n.initialSpacer&&(this.spacer=new W(t,0,0,[n.initialSpacer(t)],this.elementClass),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Object(l.a)(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=this.config.markers(e.state),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n],this.elementClass)}return this.markers!=t}}]),e}(),W=function(){function e(t,n,r,i,o){Object(s.a)(this,e),this.height=-1,this.above=0,this.dom=document.createElement("div"),this.update(t,n,r,i,o)}return Object(l.a)(e,[{key:"update",value:function(e,t,n,r,i){if(this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),this.markers!=r){this.markers=r;for(var o;o=this.dom.lastChild;)o.remove();var s,l=i,c=Object(a.a)(r);try{for(c.s();!(s=c.n()).done;){var u=s.value,f=u.toDOM(e);f&&this.dom.appendChild(f);var d=u.elementClass;d&&(l+=" "+d)}}catch(h){c.e(h)}finally{c.f()}this.dom.className=l}}}]),e}();var H=o.f.define(),V=o.f.define({combine:function(e){return Object(o.m)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function(e,t){var n=Object.assign({},e),r=function(e){var r=n[e],i=t[e];n[e]=r?function(e,t,n){return r(e,t,n)||i(e,t,n)}:i};for(var i in t)r(i);return n}})}}),q=function(e){Object(T.a)(n,e);var t=Object(D.a)(n);function n(e){var r;return Object(s.a)(this,n),(r=t.call(this)).number=e,r}return Object(l.a)(n,[{key:"eq",value:function(e){return this.number==e.number}},{key:"toDOM",value:function(e){var t=e.state.facet(V);return document.createTextNode(t.formatNumber(this.number))}}]),n}(_),U=L({style:"lineNumber",markers:function(e){return e.facet(H)},lineMarker:function(e,t,n){return n.length?null:new q(e.state.doc.lineAt(t.from).number)},initialSpacer:function(e){return new q(Y(e.state.doc.lines))},updateSpacer:function(e,t){var n=Y(t.view.state.doc.lines);return n==e.number?e:new q(n)}});function Y(e){for(var t=9;t=r?void 0:{from:n,to:r}}var K=o.i.define({map:X}),G=o.i.define({map:X});function Z(e){var t,n=[],r=Object(a.a)(e.state.selection.ranges);try{var i=function(){var r=t.value.head;if(n.some((function(e){return e.from<=r&&e.to>=r})))return"continue";n.push(e.visualLineAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(o){r.e(o)}finally{r.f()}return n}var J=o.j.define({create:function(){return i.b.none},update:function(e,t){e=e.map(t.changes);var n,r=Object(a.a)(t.effects);try{var i=function(){var t=n.value;t.is(K)&&!function(e,t,n){var r=!1;return e.between(t,t,(function(e,i){e==t&&i==n&&(r=!0)})),r}(e,t.value.from,t.value.to)?e=e.update({add:[se.range(t.value.from,t.value.to)]}):t.is(G)&&(e=e.update({filter:function(e,n){return t.value.from!=e||t.value.to!=n},filterFrom:t.value.from,filterTo:t.value.to}))};for(r.s();!(n=r.n()).done;)i()}catch(l){r.e(l)}finally{r.f()}if(t.selection){var o=!1,s=t.selection.primary.head;e.between(s,s,(function(e,t){es&&(o=!0)})),o&&(e=e.update({filterFrom:s,filterTo:s,filter:function(e,t){return t<=s||e>=s}}))}return e},provide:[i.d.decorations]});function ee(e,t,n){var r,i=null;return null===(r=e.field(J,!1))||void 0===r||r.between(t,n,(function(e,t){(!i||i.from>e)&&(i={from:e,to:t})})),i}function te(e,t,n){return e.facet(o.e.foldable).reduce((function(r,i){return r||i(e,t,n)}),null)}function ne(e){return e.field(J,!1)?void 0:{append:ae()}}var re=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=Object(a.a)(Z(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=te(e.state,r.from,r.to);if(i)return e.dispatch({effects:K.of(i),reconfigure:ne(e.state)}),!0}}catch(o){n.e(o)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(J,!1))return!1;var t,n=[],r=Object(a.a)(Z(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=ee(e.state,i.from,i.to);o&&n.push(G.of(o))}}catch(s){r.e(s)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r"};var ve="()[]{}<>";function me(e){for(var t=0;t2||2==r.length&&1==Object(he.c)(Object(he.b)(r,0))||t!=i.from||n!=i.to)return!1;var o=function(e,t){var n,r=ge(e,e.selection.primary.head),i=r.brackets||pe.brackets,o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,l=me(Object(he.b)(s,0));if(t==s)return l==s?xe(e,s,i.indexOf(s+s+s)>-1):we(e,s,l,r.before||pe.before);if(t==l)return ke(e,s,l)}}catch(c){o.e(c)}finally{o.f()}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}var ye=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch,r=ge(t,t.selection.primary.head).brackets||pe.brackets,i=null,s=t.changeByRange((function(e){if(e.empty){var n,s=function(e,t){var n=e.sliceString(t-2,t);return Object(he.c)(Object(he.b)(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),l=Object(a.a)(r);try{for(l.s();!(n=l.n()).done;){var c=n.value;if(c==s&&Oe(t.doc,e.head)==me(Object(he.b)(c,0)))return{changes:{from:e.head-c.length,to:e.head+c.length},range:o.d.cursor(e.head-c.length),annotations:o.l.userEvent.of("delete")}}}catch(u){l.e(u)}finally{l.f()}}return{range:i=e}}));return i||n(t.update(s,{scrollIntoView:!0})),!i}}];function Oe(e,t){var n=e.sliceString(t,t+2);return n.slice(0,Object(he.c)(Object(he.b)(n,0)))}function we(e,t,n,r){var i=null,a=e.changeByRange((function(a){if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],range:o.d.range(a.anchor+t.length,a.head+t.length)};var s=Oe(e.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:a.head},range:o.d.cursor(a.head+t.length)}:{range:i=a}}));return i?null:e.update(a,{scrollIntoView:!0,annotations:o.l.userEvent.of("input")})}function ke(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&Oe(e.doc,t.head)==n?o.d.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:o.d.create(i,e.selection.primaryIndex),scrollIntoView:!0})}function xe(e,t,n){var r=null,i=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],range:o.d.range(i.anchor+t.length,i.head+t.length)};var a=i.head,s=Oe(e.doc,a);if(s==t){if(je(e,a))return{changes:{insert:t+t,from:a},range:o.d.cursor(a+t.length)};var l=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:o.d.cursor(a+t.length*(l?3:1))}}if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&je(e,a-2*t.length))return{changes:{insert:t+t+t+t,from:a},range:o.d.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=o.c.Word){var c=e.sliceDoc(a-1,a);if(c!=t&&e.charCategorizer(a)(c)!=o.c.Word)return{changes:{insert:t+t,from:a},range:o.d.cursor(a+t.length)}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,annotations:o.l.userEvent.of("input")})}function je(e,t){var n=e.tree.resolve(t+1);return n.parent&&n.start==t}var Se=n(34),Ce="function"==typeof String.prototype.normalize?function(e){return e.normalize("NFKD")}:function(e){return e},Ee=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,o=arguments.length>4?arguments[4]:void 0;Object(s.a)(this,e),this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?function(e){return o(Ce(e))}:Ce,this.query=this.normalize(n)}return Object(l.a)(e,[{key:"peek",value:function(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return this.buffer.charCodeAt(this.bufferPos)}},{key:"next",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=String.fromCharCode(e),n=this.bufferStart+this.bufferPos;for(this.bufferPos++;;){var r=this.peek();if(r<56320||r>=57344)break;this.bufferPos++,t+=String.fromCharCode(r)}for(var i=this.normalize(t),o=0,a=n;;o++){var s=i.charCodeAt(o),l=this.match(s,a);if(l)return this.value=l,this;if(o==i.length-1)break;a==n&&o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;return new Ee(e,this.search,t,n,this.caseInsensitive?function(e){return e.toLowerCase()}:void 0)}},{key:"valid",get:function(){return!!this.search}}]),e}(),Pe=o.i.define(),Te=o.i.define(),De=o.j.define({create:function(){return new Ae(new Me("","",!1),[])},update:function(e,t){var n,r=Object(a.a)(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(Pe)?e=new Ae(i.value,e.panel):i.is(Te)&&(e=new Ae(e.query,i.value?[He]:[]))}}catch(o){r.e(o)}finally{r.f()}return e},provide:[Se.c.nFrom((function(e){return e.panel}))]}),Ae=function e(t,n){Object(s.a)(this,e),this.query=t,this.panel=n},_e=i.b.mark({class:Object(i.n)("searchMatch")}),Re=i.b.mark({class:Object(i.n)("searchMatch.selected")}),Ne=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.view=t,this.decorations=this.highlight(t.state.field(De))}return Object(l.a)(e,[{key:"update",value:function(e){var t=e.state.field(De);(t!=e.prevState.field(De)||e.docChanged||e.selectionSet)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel.length||!t.valid)return i.b.none;for(var n=this.view.state,r=this.view.viewport,o=t.cursor(n.doc,Math.max(0,r.from-t.search.length),Math.min(r.to+t.search.length,n.doc.length)),a=new A.c,s=function(){var e=o.value,t=e.from,r=e.to,i=n.selection.ranges.some((function(e){return e.from==t&&e.to==r}));a.add(t,r,i?Re:_e)};!o.next().done;)s();return a.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function Le(e){return function(t){var n=t.state.field(De,!1);return n&&n.query.valid?e(t,n):Ve(t)}}function Ie(e,t,n){var r=n.cursor(e,t).next();return r.done&&(r=n.cursor(e,0,t+n.search.length-1).next()).done?null:r.value}var ze=Le((function(e,t){var n=e.state.selection.primary,r=n.from,i=n.to,o=Ie(e.state.doc,e.state.selection.primary.from+1,t.query);return!(!o||o.from==r&&o.to==i)&&(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),Ge(e),!0)}));function $e(e,t,n,r){for(var i=r;;){for(var o=Math.max(n,i-1e4-e.search.length),a=e.cursor(t,o,i),s=null;!a.next().done;)s=a.value;if(s)return s;if(o==n)return null;i-=1e4}}var Qe=Le((function(e,t){var n=t.query,r=e.state,i=$e(n,r.doc,0,r.selection.primary.to-1)||$e(n,r.doc,r.selection.primary.from+1,r.doc.length);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),Ge(e),!0)})),Be=Le((function(e,t){for(var n=t.query.cursor(e.state.doc),r=[];!n.next().done;)r.push(o.d.range(n.value.from,n.value.to));return!!r.length&&(e.dispatch({selection:o.d.create(r)}),!0)})),Fe=Le((function(e,t){var n=t.query,r=e.state,i=Ie(r.doc,r.selection.primary.from,n);if(!i)return!1;var o,a=r.selection.primary,s=a.from,l=a.to,c=[];if(i.from==s&&i.to==l&&(c.push({from:i.from,to:i.to,insert:n.replace}),i=Ie(r.doc,i.to,n)),i){var u=0==c.length||c[0].from>=i.to?0:i.to-i.from-n.replace.length;o={anchor:i.from-u,head:i.to-u}}return e.dispatch({changes:c,selection:o,scrollIntoView:!!o}),i&&Ge(e),!0})),We=Le((function(e,t){for(var n=t.query,r=n.cursor(e.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&&(e.dispatch({changes:i}),!0)}));function He(e){var t=e.state.field(De).query;return{dom:Xe({view:e,query:t,updateQuery:function(n){t.eq(n)||(t=n,e.dispatch({effects:Pe.of(t)}))}}),mount:function(){this.dom.querySelector("[name=search]").select()},pos:80,style:"search"}}var Ve=function(e){var t=e.state.field(De,!1);if(t&&t.panel.length){var n=Object(Se.a)(e,He);if(!n)return!1;n.dom.querySelector("[name=search]").focus()}else e.dispatch({effects:Te.of(!0),reconfigure:t?void 0:{append:et}});return!0},qe=function(e){var t=e.state.field(De,!1);if(!t||!t.panel.length)return!1;var n=Object(Se.a)(e,He);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Te.of(!1)}),!0},Ue=[{key:"Mod-f",run:Ve,scope:"editor search-panel"},{key:"F3",run:ze,shift:Qe,scope:"editor search-panel"},{key:"Mod-g",run:ze,shift:Qe,scope:"editor search-panel"},{key:"Escape",run:qe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.primary.empty)return!1;for(var i=r.primary,a=i.from,s=i.to,l=[],c=0,u=new Ee(t.doc,t.sliceDoc(a,s));!u.next().done;){if(l.length>1e3)return!1;u.value.from==a&&(c=l.length),l.push(o.d.range(u.value.from,u.value.to))}return n(t.update({selection:new o.d(l,c)})),!0}}];function Ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=document.createElement(e);if(t)for(var i in t){var o=t[i];"string"==typeof o?r.setAttribute(i,o):r[i]=o}var s,l=Object(a.a)(n);try{for(l.s();!(s=l.n()).done;){var c=s.value;r.appendChild("string"==typeof c?document.createTextNode(c):c)}}catch(u){l.e(u)}finally{l.f()}return r}function Xe(e){function t(t){return e.view.state.phrase(t)}var n=Ye("input",{value:e.query.search,placeholder:t("Find"),"aria-label":t("Find"),class:Object(i.n)("textfield"),name:"search",onchange:a,onkeyup:a}),r=Ye("input",{value:e.query.replace,placeholder:t("Replace"),"aria-label":t("Replace"),class:Object(i.n)("textfield"),name:"replace",onchange:a,onkeyup:a}),o=Ye("input",{type:"checkbox",name:"case",checked:!e.query.caseInsensitive,onchange:a});function a(){e.updateQuery(new Me(n.value,r.value,!o.checked))}function s(e,t,n){return Ye("button",{class:Object(i.n)("button"),name:e,onclick:t},n)}return Ye("div",{onkeydown:function(t){Object(i.m)(e.view,t,"search-panel")?t.preventDefault():13==t.keyCode&&t.target==n?(t.preventDefault(),(t.shiftKey?Qe:ze)(e.view)):13==t.keyCode&&t.target==r&&(t.preventDefault(),Fe(e.view))}},[n,s("next",(function(){return ze(e.view)}),[t("next")]),s("prev",(function(){return Qe(e.view)}),[t("previous")]),s("select",(function(){return Be(e.view)}),[t("all")]),Ye("label",null,[o,"match case"]),Ye("br"),r,s("replace",(function(){return Fe(e.view)}),[t("replace")]),s("replaceAll",(function(){return We(e.view)}),[t("replace all")]),Ye("button",{name:"close",onclick:function(){return qe(e.view)},"aria-label":t("close")},["\xd7"]),Ye("div",{style:"position: absolute; top: -10000px","aria-live":"polite"})])}var Ke=/[\s\.,:;?!]/;function Ge(e){var t=e.state.selection.primary,n=t.from,r=t.to,i=e.state.doc.lineAt(n).from,o=e.state.doc.lineAt(r).to,a=Math.max(i,n-30),s=Math.min(o,r+30),l=e.state.sliceDoc(a,s);if(a!=i)for(var c=0;c<30;c++)if(!Ke.test(l[c+1])&&Ke.test(l[c])){l=l.slice(c);break}if(s!=o)for(var u=l.length-1;u>l.length-30;u--)if(!Ke.test(l[u-1])&&Ke.test(l[u])){l=l.slice(0,u);break}var f=Object(Se.a)(e,He);f&&f.dom.contains(e.root.activeElement)&&(f.dom.querySelector("div[aria-live]").textContent=e.state.phrase("current match")+". "+l)}var Ze,Je=i.d.baseTheme({"$panel.search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button":{margin:".2em .5em .2em 0"},"& label":{fontSize:"80%"}},"$$light $searchMatch":{backgroundColor:"#ffff0054"},"$$dark $searchMatch":{backgroundColor:"#00ffff8a"},"$$light $searchMatch.selected":{backgroundColor:"#ff6a0054"},"$$dark $searchMatch.selected":{backgroundColor:"#ff00ff8a"}}),et=[De,Object(o.o)(Ne,"override"),Object(Se.b)(),Je],tt=n(75),nt=[{key:"Mod-/",run:function(e){return rt(at(Ze.Toggle),e)}},{key:"Alt-A",run:function(e){return rt(ot(Ze.Toggle),e)}}];function rt(e,t){var n=e(t.state);return!!n&&(t.dispatch(n),!0)}function it(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.primary.head;return e.languageDataAt("commentTokens",t)[0]||{}}!function(e){e[e.Toggle=0]="Toggle",e[e.OnlyComment=1]="OnlyComment",e[e.OnlyUncomment=2]="OnlyUncomment"}(Ze||(Ze={}));var ot=function(e){return function(t){var n=it(t);return n.block?new st(n.block.open,n.block.close).toggle(e,t):null}},at=function(e){return function(t){var n=it(t);return n.line?new ct(n.line).toggle(e,t):null}},st=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";Object(s.a)(this,e),this.open=t,this.close=n,this.margin=r}return Object(l.a)(e,[{key:"toggle",value:function(e,t){var n=this,r=this.isSelectionCommented(t);if(null!==r){if(e!==Ze.OnlyComment)return t.update({changes:r.map((function(e){var t=e.open,r=e.close;return[{from:t.pos-n.open.length,to:t.pos+t.margin},{from:r.pos-r.margin,to:r.pos+n.close.length}]}))})}else if(e!==Ze.OnlyUncomment)return t.update(t.changeByRange((function(e){var t=(n.open+n.margin).length;return{changes:[{from:e.from,insert:n.open+n.margin},{from:e.to,insert:n.margin+n.close}],range:o.d.range(e.anchor+t,e.head+t)}})));return null}},{key:"isSelectionCommented",value:function(e){var t,n=[],r=Object(a.a)(e.selection.ranges);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=this.isRangeCommented(e,i);if(null===o)return null;n.push(o)}}catch(s){r.e(s)}finally{r.f()}return n}},{key:"isRangeCommented",value:function(e,t){var n,r,i=e.sliceDoc(t.from-lt,t.from),o=e.sliceDoc(t.to,t.to+lt),a=/\s*$/.exec(i)[0].length,s=/^\s*/.exec(o)[0].length,l=i.length-a;if(i.slice(l-this.open.length,l)==this.open&&o.slice(s,s+this.close.length)==this.close)return{open:{pos:t.from-a,margin:a&&1},close:{pos:t.to+s,margin:s&&1}};t.to-t.from<=2*lt?n=r=e.sliceDoc(t.from,t.to):(n=e.sliceDoc(t.from,t.from+lt),r=e.sliceDoc(t.to-lt,t.to));var c=/^\s*/.exec(n)[0].length,u=/\s*$/.exec(r)[0].length,f=r.length-u-this.close.length;return n.slice(c,c+this.open.length)==this.open&&r.slice(f,f+this.close.length)==this.close?{open:{pos:t.from+c+this.open.length,margin:/\s/.test(n.charAt(c+this.open.length))?1:0},close:{pos:t.to-u-this.close.length,margin:/\s/.test(r.charAt(f-1))?1:0}}:null}}]),e}(),lt=50,ct=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";Object(s.a)(this,e),this.lineCommentToken=t,this.margin=n}return Object(l.a)(e,[{key:"toggle",value:function(e,t){for(var n=[],i={},o=0;o1&&l.isLineSkipped[p.number])){var v=p.from+l.minCol,m=l.minCol+this.lineCommentToken.length,g=" "==p.slice(m,m+1)?1:0;c.push({from:v,to:v+this.lineCommentToken.length+g})}}}catch(j){h.e(j)}finally{h.f()}}return t.update({changes:c})}}else if(e!=Ze.OnlyUncomment){for(var b=[],y=0;yft?-1:i==r.length?function(e,t){var n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Object(he.d)(r.slice(0,n-r.from),0,e.state.tabSize);return{line:r.number,col:o,off:i}}function ht(e,t){var n=dt(e,t),r=e.state.selection;return{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.prevState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get:function(t,i,a){var s=dt(e,t),l=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>ft||n.off>ft||t.col<0||n.col<0)for(var s=Math.min(t.off,n.off),l=Math.max(t.off,n.off),c=r;c<=i;c++){var u=e.doc.line(c);u.length<=l&&a.push(o.d.range(u.from+s,u.to+l))}else for(var f=Math.min(t.col,n.col),d=Math.max(t.col,n.col),h=r;h<=i;h++){var p=e.doc.line(h),v=p.length>ft?p.slice(0,2*d):p.slice(),m=Object(he.e)(v,0,f,e.tabSize),g=Object(he.e)(v,0,d,e.tabSize);m.leftOver||a.push(o.d.range(p.from+m.offset,p.from+g.offset))}return a}(e.state,n,s);return l.length?a?o.d.create(l.concat(r.ranges)):o.d.create(l):r}}}var pt=n(13),vt="undefined"==typeof Symbol?"__goto-line":Symbol("goto-line");function mt(e){var t=document.createElement("form");t.innerHTML="\n");var n=t.querySelector("input");function r(){var t=parseInt(n.value,10);e.dispatch({reconfigure:Object(pt.a)({},vt,[gt]),selection:!isNaN(t)&&t>0&&t<=e.state.doc.lines?o.d.cursor(e.state.doc.line(t).from):void 0,scrollIntoView:!0}),e.focus()}return t.addEventListener("keydown",(function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({reconfigure:{append:[gt]}}),e.focus()):13==t.keyCode&&(t.preventDefault(),r())})),t.addEventListener("submit",r),{dom:t,style:"gotoLine",pos:-10}}var gt=i.d.baseTheme({"$panel.gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),bt=[{key:"Alt-g",run:function(e){var t=Object(Se.a)(e,mt);return t||(e.dispatch({reconfigure:{append:[Object(Se.b)(),Se.c.of(mt),gt]}}),t=Object(Se.a)(e,mt)),t&&t.dom.querySelector("input").focus(),!0}}];var yt=i.b.line({attributes:{class:Object(i.n)("activeLine")}}),Ot=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],o=Object(a.a)(e.state.selection.ranges);try{for(o.s();!(t=o.n()).done;){var s=t.value;if(s.empty){var l=e.visualLineAt(s.head);l.from>n&&(r.push(yt.range(l.from)),n=l.from)}}}catch(c){o.e(c)}finally{o.f()}return i.b.set(r)}}]),e}(),{decorations:function(e){return e.decorations}}),wt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100},kt=o.f.define({combine:function(e){return Object(o.m)(e,wt,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});var xt=i.b.mark({class:Object(i.n)("selectionMatch")}),jt=i.b.mark({class:Object(i.n)("selectionMatch.main")}),St=i.f.fromClass(function(){function e(t){Object(s.a)(this,e),this.decorations=this.getDeco(t)}return Object(l.a)(e,[{key:"update",value:function(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t=e.state.facet(kt),n=e.state,r=n.selection;if(r.ranges.length>1)return i.b.none;var s,l=r.primary,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return i.b.none;if(c=n.charCategorizer(l.head),!(s=function(e,t,n){for(var r=e.lineAt(t),i=t-r.from,a=t-r.from;i>0;){var s=r.findClusterBreak(i,!1);if(n(r.slice(s,i))!=o.c.Word)break;i=s}for(;a200)return i.b.none;if(!(s=n.sliceDoc(l.from,l.to).trim()))return i.b.none}var f,d=[],h=Object(a.a)(e.visibleRanges);try{for(h.s();!(f=h.n()).done;)for(var p=f.value,v=new Ee(n.doc,s,p.from,p.to);!v.next().done;){var m=v.value,g=m.from,b=m.to;if((!c||(0==g||c(n.sliceDoc(g-1,g))!=o.c.Word)&&(b==n.doc.length||c(n.sliceDoc(b,b+1))!=o.c.Word))&&(c&&g<=l.from&&b>=l.to?d.push(jt.range(g,b)):(g>=l.to||b<=l.from)&&d.push(xt.range(g,b)),d.length>t.maxMatches))return i.b.none}}catch(y){h.e(y)}finally{h.f()}return i.b.set(d)}}]),e}(),{decorations:function(e){return e.decorations}}),Ct=i.d.baseTheme({"$$light $activeLine":{backgroundColor:"#eff5ff"},"$$dark $activeLine":{backgroundColor:"#223039"},$selectionMatch:{backgroundColor:"#99ff7780"},"$searchMatch $selectionMatch":{backgroundColor:"transparent"}}),Et=n(110),Mt=n(111),Pt=[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[V.of(e),U]}(),Object(i.i)(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[h,d.of(e)]}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},le),e),n=new ce(t,!0),r=new ce(t,!1);return[L({style:"foldGutter",lineMarker:function(e,t){return ee(e.state,t.from,t.to)?r:te(e.state,t.from,t.to)?n:null},initialSpacer:function(){return new ce(t,!1)},domEventHandlers:{click:function(e,t){var n=ee(e.state,t.from,t.to);if(n)return e.dispatch({effects:G.of(n)}),!0;var r=te(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:K.of(r)}),!0)}}}),ae()]}(),Object(i.h)(),o.e.allowMultipleSelections.of(!0),Object(i.j)(),Et.a,Object(de.a)(),i.d.inputHandler.of(be),Object(tt.a)(),function(e){var t=e||function(e){return e.altKey&&0==e.button};return i.d.mouseSelectionStyle.of((function(e,n){return t(n)?ht(e,n):null}))}(),[Ct,Ot],function(e){var t=[Ct,St];return e&&t.push(kt.of(e)),t}(),Object(i.k)([].concat(Object(r.a)(ye),Object(r.a)(fe.a),Object(r.a)(Ue),Object(r.a)(P),Object(r.a)(re),Object(r.a)(nt),Object(r.a)(bt),Object(r.a)(tt.b),Object(r.a)(Mt.a)))]},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),i=n.n(r),o=n(99);function a(){return i.a.useContext(o.a)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n