var e,t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b,k,w,j,x,S,_,C,$,O,E,P,M,A,T,N,I,R,D,L,z,B,q,F,V,W,H,J,U,K,G,Q,Y,Z,X,ee,te,ne,re,ie,oe,ae,se,ue,ce,le,fe,he,de,ve,pe,me,ge,ye,be,ke,we,je,xe,Se,_e,Ce,$e,Oe,Ee,Pe,Me,Ae,Te,Ne,Ie,Re,De,Le,ze,Be,qe,Fe,Ve,We,He,Je,Ue,Ke,Ge,Qe,Ye,Ze,Xe,et,tt,nt,rt,it,ot,at,st,ut,ct,lt,ft,ht,dt,vt,pt,mt,gt,yt,bt,kt,wt,jt,xt,St,_t,Ct,$t,Ot,Et,Pt,Mt,At,Tt,Nt,It,Rt,Dt,Lt,zt,Bt,qt,Ft,Vt,Wt,Ht,Jt,Ut,Kt,Gt,Qt,Yt,Zt,Xt,en,tn,nn,rn,on,an,sn,un,cn,ln,fn,hn,dn,vn,pn,mn,gn,yn,bn,kn,wn,jn,xn,Sn,_n,Cn,$n,On,En,Pn,Mn,An,Tn,Nn,In,Rn,Dn,Ln,zn,Bn,qn,Fn,Vn,Wn,Hn,Jn,Un,Kn,Gn,Qn,Yn,Zn,Xn,er,tr,nr,rr,ir,or,ar,sr,ur,cr,lr,fr,hr,dr,vr,pr,mr,gr,yr,br,kr,wr,jr,xr,Sr,_r,Cr,$r,Or,Er,Pr,Mr,Ar,Tr,Nr,Ir,Rr,Dr,Lr,zr,Br,qr,Fr,Vr,Wr,Hr,Jr,Ur,Kr,Gr,Qr,Yr,Zr,Xr,ei,ti,ni,ri,ii,oi,ai,si,ui,ci,li,fi,hi;function di(e){var t="function"==typeof Map?new Map:void 0;return di=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return vi(e,arguments,Ai(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),$i(r,e)},di(e)}function vi(e,t,n){return vi=Mi()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&$i(i,n.prototype),i},vi.apply(null,arguments)}function pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function mi(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */mi=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new x(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return _()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function h(){}function d(){}var v={};s(v,i,(function(){return this}));var p=Object.getPrototypeOf,m=p&&p(p(S([])));m&&m!==t&&n.call(m,i)&&(v=m);var g=d.prototype=f.prototype=Object.create(v);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==zi(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function k(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,k(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;j(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function gi(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function yi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){gi(o,r,i,a,s,"next",e)}function s(e){gi(o,r,i,a,s,"throw",e)}a(void 0)}))}}function bi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ni(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ki(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Ni(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 wi(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 ji(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n32){for(var t=[],n=e.ctx.length/32,r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.bubbles,i=void 0!==r&&r,o=n.cancelable,a=void 0!==o&&o,s=document.createEvent("CustomEvent");return s.initCustomEvent(e,i,a,t),s}var Ro=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Ri(this,e),this.is_svg=!1,this.is_svg=t,this.e=this.n=null}return Li(e,[{key:"c",value:function(e){this.h(e)}},{key:"m",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.e||(this.is_svg?this.e=yo(t.nodeName):this.e=go(t.nodeName),this.t=t,this.c(e)),this.i(n)}},{key:"h",value:function(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}},{key:"i",value:function(e){for(var t=0;t>>0}function Fo(e,t){var n={stylesheet:fo(t),rules:{}};return zo.set(e,n),n}function Vo(e,t,n,r,i,o,a){for(var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,u=16.666/r,c="{\n",l=0;l<=1;l+=u){var f=t+(n-t)*o(l);c+=100*l+"%{".concat(a(f,1-f),"}\n")}var h=c+"100% {".concat(a(n,1-n),"}\n}"),d="__svelte_".concat(qo(h),"_").concat(s),v=lo(e),p=zo.get(v)||Fo(v,e),m=p.stylesheet,g=p.rules;g[d]||(g[d]=!0,m.insertRule("@keyframes ".concat(d," ").concat(h),m.cssRules.length));var y=e.style.animation||"";return e.style.animation="".concat(y?"".concat(y,", "):"").concat(d," ").concat(r,"ms linear ").concat(i,"ms 1 both"),Bo+=1,d}function Wo(e,t){var n=(e.style.animation||"").split(", "),r=n.filter(t?function(e){return e.indexOf(t)<0}:function(e){return-1===e.indexOf("__svelte")}),i=n.length-r.length;i&&(e.style.animation=r.join(", "),(Bo-=i)||oo((function(){Bo||(zo.forEach((function(e){var t=e.stylesheet.ownerNode;t&&po(t)})),zo.clear())})))}function Ho(e){Lo=e}function Jo(){if(!Lo)throw new Error("Function called outside component initialization");return Lo}function Uo(e){Jo().$$.before_update.push(e)}function Ko(e){Jo().$$.on_mount.push(e)}function Go(e){Jo().$$.on_destroy.push(e)}function Qo(){var e=Jo();return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.cancelable,o=void 0!==i&&i,a=e.$$.callbacks[t];if(a){var s=Io(t,n,{cancelable:o});return a.slice().forEach((function(t){t.call(e,s)})),!s.defaultPrevented}return!0}}function Yo(e,t){return Jo().$$.context.set(e,t),t}function Zo(e){return Jo().$$.context.get(e)}var Xo=[],ea=[],ta=[],na=[],ra=Promise.resolve(),ia=!1;function oa(){ia||(ia=!0,ra.then(ha))}function aa(){return oa(),ra}function sa(e){ta.push(e)}function ua(e){na.push(e)}var ca,la=new Set,fa=0;function ha(){var e=Lo;do{for(;fas.start&&(a=l(s,v),s=null,va(e,a.b,"start"),b&&(c(),u=Vo(e,o,a.b,a.duration,0,m,i.css))),a)if(t>=a.end)y(o=a.b,1-o),va(e,a.b,"end"),s||(a.b?c():--a.group.r||Hi(a.group.c)),a=null;else if(t>=a.start){var n=t-a.start;o=a.a+a.d*m(n/a.duration),y(o,1-o)}return!(!a&&!s)},0===ao.size&&oo(so),new Promise((function(e){ao.add({c:n,f:e})})))}return{run:function(e){Ji(i)?(ca||(ca=Promise.resolve()).then((function(){ca=null})),ca).then((function(){i=i(),f(e)})):f(e)},end:function(){c(),a=s=null}}}var xa="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Sa(e,t){e.d(1),t.delete(e.key)}function _a(e,t){ka(e,1,1,(function(){t.delete(e.key)}))}function Ca(e,t,n,r,i,o,a,s,u,c,l,f){for(var h=e.length,d=o.length,v=h,p={};v--;)p[e[v].key]=v;var m=[],g=new Map,y=new Map;for(v=d;v--;){var b=f(i,o,v),k=n(b),w=a.get(k);w?r&&w.p(b,t):(w=c(k,b)).c(),g.set(k,m[v]=w),k in p&&y.set(k,Math.abs(v-p[k]))}var j=new Set,x=new Set;function S(e){ba(e,1),e.m(s,l),a.set(e.key,e),l=e.first,d--}for(;h&&d;){var _=m[d-1],C=e[h-1],$=_.key,O=C.key;_===C?(l=_.first,h--,d--):g.has(O)?!a.has($)||j.has($)?S(_):x.has(O)?h--:y.get($)>y.get(O)?(x.add($),S(_)):(j.add(O),h--):(u(C,a),h--)}for(;h--;){var E=e[h];g.has(E.key)||u(E,a)}for(;d;)S(m[d-1]);return m}function $a(e,t){for(var n={},r={},i={$$scope:1},o=e.length;o--;){var a=e[o],s=t[o];if(s){for(var u in a)u in s||(r[u]=1);for(var c in s)i[c]||(n[c]=s[c],i[c]=1);e[o]=s}else for(var l in a)i[l]=1}for(var f in r)f in n||(n[f]=void 0);return n}function Oa(e){return"object"===zi(e)&&null!==e?e:{}}function Ea(e,t,n){var r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function Pa(e){e&&e.c()}function Ma(e,t,n,r){var i=e.$$,o=i.fragment,a=i.after_update;o&&o.m(t,n),r||sa((function(){var t,n=e.$$.on_mount.map(Vi).filter(Ji);e.$$.on_destroy?(t=e.$$.on_destroy).push.apply(t,Ti(n)):Hi(n);e.$$.on_mount=[]})),a.forEach(sa)}function Aa(e,t){var n=e.$$;null!==n.fragment&&(Hi(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Ta(e,t){-1===e.$$.dirty[0]&&(Xo.push(e),oa(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<7&&void 0!==arguments[7]?arguments[7]:[-1],u=Lo;Ho(e);var c=e.$$={fragment:null,ctx:[],props:o,update:Bi,not_equal:i,bound:Wi(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Wi(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(c.root);var l=!1;if(c.ctx=n?n(e,t.props||{},(function(t,n){var r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&i(c.ctx[t],c.ctx[t]=r)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](r),l&&Ta(e,t)),n})):[],c.update(),l=!0,Hi(c.before_update),c.fragment=!!r&&r(c.ctx),t.target){if(t.hydrate){var f=Oo(t.target);c.fragment&&c.fragment.l(f),f.forEach(po)}else c.fragment&&c.fragment.c();t.intro&&ba(e.$$.fragment),Ma(e,t.target,t.anchor,t.customElement),ha()}Ho(u)}var Ia=function(){function e(){Ri(this,e)}return Li(e,[{key:"$destroy",value:function(){Aa(this,1),this.$destroy=Bi}},{key:"$on",value:function(e,t){if(!Ji(t))return Bi;var n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)}}},{key:"$set",value:function(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}]),e}(),Ra=function(e){Ci(n,Ia);var t=Oi(n);function n(e){if(Ri(this,n),!e||!e.target&&!e.$$inline)throw new Error("'target' is a required option");return t.call(this)}return Li(n,[{key:"$destroy",value:function(){Si(Ai(n.prototype),"$destroy",this).call(this),this.$destroy=function(){console.warn("Component was already destroyed")}}},{key:"$capture_state",value:function(){}},{key:"$inject_state",value:function(){}}]),n}(),Da=function(e){Ci(n,Ra);var t=Oi(n);function n(e){return Ri(this,n),t.call(this,e)}return Li(n)}();function La(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!!Ba("debug");if(t){var n=qa(e);return function(){for(var t,r=arguments.length,i=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=t.delay,r=void 0===n?0:n,i=t.duration,o=void 0===i?400:i,a=t.easing,s=void 0===a?qi:a,u=+getComputedStyle(e).opacity;return{delay:r,duration:o,easing:s,css:function(e){return"opacity: ".concat(e*u)}}}var Wa=xa.window;function Ha(e){co(e,"svelte-g4wg3a",".svelte-g4wg3a{box-sizing:border-box}.bg.svelte-g4wg3a{position:fixed;z-index:1000;top:0;left:0;display:flex;flex-direction:column;justify-content:center;width:100vw;height:100vh;background:rgba(0, 0, 0, 0.66)}.wrap.svelte-g4wg3a{position:relative;margin:2rem;max-height:100%}.window.svelte-g4wg3a{position:relative;width:40rem;max-width:100%;max-height:100%;margin:2rem auto;color:black;border-radius:0.5rem;background:white}.content.svelte-g4wg3a{position:relative;padding:1rem;max-height:calc(100vh - 4rem);overflow:auto}.close.svelte-g4wg3a{display:block;box-sizing:border-box;position:absolute;z-index:1000;top:1rem;right:1rem;margin:0;padding:0;width:1.5rem;height:1.5rem;border:0;color:black;border-radius:1.5rem;background:white;box-shadow:0 0 0 1px black;transition:transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close.svelte-g4wg3a:before,.close.svelte-g4wg3a:after{content:'';display:block;box-sizing:border-box;position:absolute;top:50%;width:1rem;height:1px;background:black;transform-origin:center;transition:height 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close.svelte-g4wg3a:before{-webkit-transform:translate(0, -50%) rotate(45deg);-moz-transform:translate(0, -50%) rotate(45deg);transform:translate(0, -50%) rotate(45deg);left:0.25rem}.close.svelte-g4wg3a:after{-webkit-transform:translate(0, -50%) rotate(-45deg);-moz-transform:translate(0, -50%) rotate(-45deg);transform:translate(0, -50%) rotate(-45deg);left:0.25rem}.close.svelte-g4wg3a:hover{background:black}.close.svelte-g4wg3a:hover:before,.close.svelte-g4wg3a:hover:after{height:2px;background:white}.close.svelte-g4wg3a:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close.svelte-g4wg3a:active{transform:scale(0.9)}.close.svelte-g4wg3a:hover,.close.svelte-g4wg3a:focus,.close.svelte-g4wg3a:active{outline:none}")}function Ja(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y=e[1].closeButton&&Ua(e),b=e[2];return b&&(a=Do(b,{})),{c:function(){t=go("div"),n=go("div"),r=go("div"),y&&y.c(),i=ko(),o=go("div"),a&&Pa(a.$$.fragment),So(o,"class",s=eo(e[1].classContent)+" svelte-g4wg3a"),So(o,"style",e[9]),No(o,"content",!e[0]),So(r,"class",u=eo(e[1].classWindow)+" svelte-g4wg3a"),So(r,"role","dialog"),So(r,"aria-modal","true"),So(r,"aria-label",c=e[1].ariaLabelledBy?null:e[1].ariaLabel||null),So(r,"aria-labelledby",l=e[1].ariaLabelledBy||null),So(r,"style",e[8]),No(r,"window",!e[0]),So(n,"class",h=eo(e[1].classWindowWrap)+" svelte-g4wg3a"),So(n,"style",e[7]),No(n,"wrap",!e[0]),So(t,"class",d=eo(e[1].classBg)+" svelte-g4wg3a"),So(t,"style",e[6]),No(t,"bg",!e[0])},m:function(s,u){vo(s,t,u),uo(t,n),uo(n,r),y&&y.m(r,null),uo(r,i),uo(r,o),a&&Ma(a,o,null),e[49](r),e[50](n),e[51](t),p=!0,m||(g=[jo(r,"introstart",(function(){Ji(e[13])&&e[13].apply(this,arguments)})),jo(r,"outrostart",(function(){Ji(e[14])&&e[14].apply(this,arguments)})),jo(r,"introend",(function(){Ji(e[15])&&e[15].apply(this,arguments)})),jo(r,"outroend",(function(){Ji(e[16])&&e[16].apply(this,arguments)})),jo(t,"mousedown",e[20]),jo(t,"mouseup",e[21])],m=!0)},p:function(f,v){if((e=f)[1].closeButton?y?(y.p(e,v),2&v[0]&&ba(y,1)):((y=Ua(e)).c(),ba(y,1),y.m(r,i)):y&&(ga(),ka(y,1,1,(function(){y=null})),ya()),b!==(b=e[2])){if(a){ga();var m=a;ka(m.$$.fragment,1,0,(function(){Aa(m,1)})),ya()}b?(Pa((a=Do(b,{})).$$.fragment),ba(a.$$.fragment,1),Ma(a,o,null)):a=null}(!p||2&v[0]&&s!==(s=eo(e[1].classContent)+" svelte-g4wg3a"))&&So(o,"class",s),(!p||512&v[0])&&So(o,"style",e[9]),(!p||3&v[0])&&No(o,"content",!e[0]),(!p||2&v[0]&&u!==(u=eo(e[1].classWindow)+" svelte-g4wg3a"))&&So(r,"class",u),(!p||2&v[0]&&c!==(c=e[1].ariaLabelledBy?null:e[1].ariaLabel||null))&&So(r,"aria-label",c),(!p||2&v[0]&&l!==(l=e[1].ariaLabelledBy||null))&&So(r,"aria-labelledby",l),(!p||256&v[0])&&So(r,"style",e[8]),(!p||3&v[0])&&No(r,"window",!e[0]),(!p||2&v[0]&&h!==(h=eo(e[1].classWindowWrap)+" svelte-g4wg3a"))&&So(n,"class",h),(!p||128&v[0])&&So(n,"style",e[7]),(!p||3&v[0])&&No(n,"wrap",!e[0]),(!p||2&v[0]&&d!==(d=eo(e[1].classBg)+" svelte-g4wg3a"))&&So(t,"class",d),(!p||64&v[0])&&So(t,"style",e[6]),(!p||3&v[0])&&No(t,"bg",!e[0])},i:function(n){p||(ba(y),a&&ba(a.$$.fragment,n),sa((function(){f||(f=ja(r,e[12],e[1].transitionWindowProps,!0)),f.run(1)})),sa((function(){v||(v=ja(t,e[11],e[1].transitionBgProps,!0)),v.run(1)})),p=!0)},o:function(n){ka(y),a&&ka(a.$$.fragment,n),f||(f=ja(r,e[12],e[1].transitionWindowProps,!1)),f.run(0),v||(v=ja(t,e[11],e[1].transitionBgProps,!1)),v.run(0),p=!1},d:function(n){n&&po(t),y&&y.d(),a&&Aa(a),e[49](null),n&&f&&f.end(),e[50](null),e[51](null),n&&v&&v.end(),m=!1,Hi(g)}}}function Ua(e){var t,n,r,i,o,a=[Ga,Ka],s=[];function u(e,n){return 2&n[0]&&(t=null),null==t&&(t=!!e[17](e[1].closeButton)),t?0:1}return n=u(e,[-1,-1,-1]),r=s[n]=a[n](e),{c:function(){r.c(),i=wo()},m:function(e,t){s[n].m(e,t),vo(e,i,t),o=!0},p:function(e,t){var o=n;(n=u(e,t))===o?s[n].p(e,t):(ga(),ka(s[o],1,1,(function(){s[o]=null})),ya(),(r=s[n])?r.p(e,t):(r=s[n]=a[n](e)).c(),ba(r,1),r.m(i.parentNode,i))},i:function(e){o||(ba(r),o=!0)},o:function(e){ka(r),o=!1},d:function(e){s[n].d(e),e&&po(i)}}}function Ka(e){var t,n,r,i;return{c:function(){So(t=go("button"),"class",n=eo(e[1].classCloseButton)+" svelte-g4wg3a"),So(t,"aria-label","Close modal"),So(t,"style",e[10]),So(t,"type","button"),No(t,"close",!e[0])},m:function(n,o){vo(n,t,o),r||(i=jo(t,"click",e[18]),r=!0)},p:function(e,r){2&r[0]&&n!==(n=eo(e[1].classCloseButton)+" svelte-g4wg3a")&&So(t,"class",n),1024&r[0]&&So(t,"style",e[10]),3&r[0]&&No(t,"close",!e[0])},i:Bi,o:Bi,d:function(e){e&&po(t),r=!1,i()}}}function Ga(e){var t,n,r,i=e[1].closeButton;function o(e){return{props:{onClose:e[18]}}}return i&&(t=Do(i,o(e))),{c:function(){t&&Pa(t.$$.fragment),n=wo()},m:function(e,i){t&&Ma(t,e,i),vo(e,n,i),r=!0},p:function(e,r){if(i!==(i=e[1].closeButton)){if(t){ga();var a=t;ka(a.$$.fragment,1,0,(function(){Aa(a,1)})),ya()}i?(Pa((t=Do(i,o(e))).$$.fragment),ba(t.$$.fragment,1),Ma(t,n.parentNode,n)):t=null}},i:function(e){r||(t&&ba(t.$$.fragment,e),r=!0)},o:function(e){t&&ka(t.$$.fragment,e),r=!1},d:function(e){e&&po(n),t&&Aa(t,e)}}}function Qa(e){var t,n,r,i,o=e[2]&&Ja(e),a=e[48].default,s=Gi(a,e,e[47],null);return{c:function(){o&&o.c(),t=ko(),s&&s.c()},m:function(a,u){o&&o.m(a,u),vo(a,t,u),s&&s.m(a,u),n=!0,r||(i=jo(Wa,"keydown",e[19]),r=!0)},p:function(e,r){e[2]?o?(o.p(e,r),4&r[0]&&ba(o,1)):((o=Ja(e)).c(),ba(o,1),o.m(t.parentNode,t)):o&&(ga(),ka(o,1,1,(function(){o=null})),ya()),s&&s.p&&(!n||65536&r[1])&&Zi(s,a,e,e[47],n?Yi(a,e[47],r,null):Xi(e[47]),null)},i:function(e){n||(ba(o),ba(s,e),n=!0)},o:function(e){ka(o),ka(s,e),n=!1},d:function(e){o&&o.d(e),e&&po(t),s&&s.d(e),r=!1,i()}}}function Ya(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){return new e(ji(ji({},n),{},{props:ji(ji({},t),n.props)}))}}function Za(e,t,n){var r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y=t.$$slots,b=void 0===y?{}:y,k=t.$$scope,w=Qo(),j=Yo,x=t.isTabbable,S=void 0===x?function(e){return e.tabIndex>=0&&!e.hidden&&!e.disabled&&"none"!==e.style.display&&"hidden"!==e.type&&Boolean(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}:x,_=t.show,C=void 0===_?null:_,$=t.key,O=void 0===$?"simple-modal":$,E=t.ariaLabel,P=void 0===E?null:E,M=t.ariaLabelledBy,A=void 0===M?null:M,T=t.closeButton,N=void 0===T||T,I=t.closeOnEsc,R=void 0===I||I,D=t.closeOnOuterClick,L=void 0===D||D,z=t.styleBg,B=void 0===z?{}:z,q=t.styleWindowWrap,F=void 0===q?{}:q,V=t.styleWindow,W=void 0===V?{}:V,H=t.styleContent,J=void 0===H?{}:H,U=t.styleCloseButton,K=void 0===U?{}:U,G=t.classBg,Q=void 0===G?null:G,Y=t.classWindowWrap,Z=void 0===Y?null:Y,X=t.classWindow,ee=void 0===X?null:X,te=t.classContent,ne=void 0===te?null:te,re=t.classCloseButton,ie=void 0===re?null:re,oe=t.unstyled,ae=void 0!==oe&&oe,se=t.setContext,ue=void 0===se?j:se,ce=t.transitionBg,le=void 0===ce?Va:ce,fe=t.transitionBgProps,he=void 0===fe?{duration:250}:fe,de=t.transitionWindow,ve=void 0===de?le:de,pe=t.transitionWindowProps,me=void 0===pe?he:pe,ge=t.disableFocusTrap,ye=void 0!==ge&&ge,be={ariaLabel:P,ariaLabelledBy:A,closeButton:N,closeOnEsc:R,closeOnOuterClick:L,styleBg:B,styleWindowWrap:F,styleWindow:W,styleContent:J,styleCloseButton:K,classBg:Q,classWindowWrap:Z,classWindow:ee,classContent:ne,classCloseButton:ie,transitionBg:le,transitionBgProps:he,transitionWindow:ve,transitionWindowProps:me,disableFocusTrap:ye,isTabbable:S,unstyled:ae},ke=ji({},be),we=null,je=function(e){return e?Object.keys(e).reduce((function(t,n){return"".concat(t,"; ").concat(function(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}(n),": ").concat(e[n])}),""):""},xe=function(e){return!!(e&&e.constructor&&e.call&&e.apply)},Se=function(){n(6,s=je(Object.assign({},{width:window.innerWidth,height:window.innerHeight},ke.styleBg))),n(7,u=je(ke.styleWindowWrap)),n(8,c=je(ke.styleWindow)),n(9,l=je(ke.styleContent)),n(10,f=je(ke.styleCloseButton)),n(11,h=ke.transitionBg),n(12,d=ke.transitionWindow)},_e=function(){},Ce=_e,$e=_e,Oe=_e,Ee=_e,Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n(2,we=Ya(e,t)),n(1,ke=ji(ji({},be),r)),Se(),Ae(),n(13,Ce=function(e){i.onOpen&&i.onOpen(e),w("open"),w("opening")}),n(14,$e=function(e){i.onClose&&i.onClose(e),w("close"),w("closing")}),n(15,Oe=function(e){i.onOpened&&i.onOpened(e),w("opened")}),n(16,Ee=function(e){i.onClosed&&i.onClosed(e),w("closed")})},Me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};we&&(n(14,$e=e.onClose||$e),n(16,Ee=e.onClosed||Ee),n(2,we=null),Te())},Ae=function(){a=window.scrollY,v=document.body.style.position,p=document.body.style.overflow,m=document.body.style.width,document.body.style.position="fixed",document.body.style.top="-".concat(a,"px"),document.body.style.overflow="hidden",document.body.style.width="100%"},Te=function(){document.body.style.position=v||"",document.body.style.top="",document.body.style.overflow=p||"",document.body.style.width=m||"",window.scrollTo(0,a)};ue(O,{open:Pe,close:Me});var Ne=!1;return Go((function(){Ne&&Me()})),Ko((function(){n(46,Ne=!0)})),e.$$set=function(e){"isTabbable"in e&&n(22,S=e.isTabbable),"show"in e&&n(23,C=e.show),"key"in e&&n(24,O=e.key),"ariaLabel"in e&&n(25,P=e.ariaLabel),"ariaLabelledBy"in e&&n(26,A=e.ariaLabelledBy),"closeButton"in e&&n(27,N=e.closeButton),"closeOnEsc"in e&&n(28,R=e.closeOnEsc),"closeOnOuterClick"in e&&n(29,L=e.closeOnOuterClick),"styleBg"in e&&n(30,B=e.styleBg),"styleWindowWrap"in e&&n(31,F=e.styleWindowWrap),"styleWindow"in e&&n(32,W=e.styleWindow),"styleContent"in e&&n(33,J=e.styleContent),"styleCloseButton"in e&&n(34,K=e.styleCloseButton),"classBg"in e&&n(35,Q=e.classBg),"classWindowWrap"in e&&n(36,Z=e.classWindowWrap),"classWindow"in e&&n(37,ee=e.classWindow),"classContent"in e&&n(38,ne=e.classContent),"classCloseButton"in e&&n(39,ie=e.classCloseButton),"unstyled"in e&&n(0,ae=e.unstyled),"setContext"in e&&n(40,ue=e.setContext),"transitionBg"in e&&n(41,le=e.transitionBg),"transitionBgProps"in e&&n(42,he=e.transitionBgProps),"transitionWindow"in e&&n(43,ve=e.transitionWindow),"transitionWindowProps"in e&&n(44,me=e.transitionWindowProps),"disableFocusTrap"in e&&n(45,ye=e.disableFocusTrap),"$$scope"in e&&n(47,k=e.$$scope)},e.$$.update=function(){8388608&e.$$.dirty[0]|32768&e.$$.dirty[1]&&Ne&&(xe(C)?Pe(C):Me())},[ae,ke,we,r,i,o,s,u,c,l,f,h,d,Ce,$e,Oe,Ee,xe,Me,function(e){if(ke.closeOnEsc&&we&&"Escape"===e.key&&(e.preventDefault(),Me()),we&&"Tab"===e.key&&!ke.disableFocusTrap){var t=o.querySelectorAll("*"),n=Array.from(t).filter(ke.isTabbable).sort((function(e,t){return e.tabIndex-t.tabIndex})),r=n.indexOf(document.activeElement);-1===r&&e.shiftKey&&(r=0),r+=n.length+(e.shiftKey?-1:1),n[r%=n.length].focus(),e.preventDefault()}},function(e){!ke.closeOnOuterClick||e.target!==r&&e.target!==i||(g=e.target)},function(e){ke.closeOnOuterClick&&e.target===g&&(e.preventDefault(),Me())},S,C,O,P,A,N,R,L,B,F,W,J,K,Q,Z,ee,ne,ie,ue,le,he,ve,me,ye,Ne,k,b,function(e){ea[e?"unshift":"push"]((function(){n(5,o=e)}))},function(e){ea[e?"unshift":"push"]((function(){n(4,i=e)}))},function(e){ea[e?"unshift":"push"]((function(){n(3,r=e)}))}]}var Xa=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,Za,Qa,Ui,{isTabbable:22,show:23,key:24,ariaLabel:25,ariaLabelledBy:26,closeButton:27,closeOnEsc:28,closeOnOuterClick:29,styleBg:30,styleWindowWrap:31,styleWindow:32,styleContent:33,styleCloseButton:34,classBg:35,classWindowWrap:36,classWindow:37,classContent:38,classCloseButton:39,unstyled:0,setContext:40,transitionBg:41,transitionBgProps:42,transitionWindow:43,transitionWindowProps:44,disableFocusTrap:45},Ha,[-1,-1,-1]),r}return Li(n)}(),es=[{start:0,end:100}],ts={closeButton:!1,classBg:"jse-modal-bg",classWindow:"jse-modal-window",classWindowWrap:"jse-modal-window-wrap",classContent:"jse-modal-content"},ns=ji(ji({},ts),{},{classWindow:"jse-modal-window jse-modal-window-sort"}),rs=ji(ji({},ts),{},{classWindow:"jse-modal-window jse-modal-window-transform"}),is="Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value",os="Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)",as="NO",ss="SELF",us="NEXT_INSIDE",cs=0;function ls(){return++cs}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function fs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hs={exports:{}};!function(e){function t(e){return t="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},t(e)}function n(e){return Array.isArray(e)}function r(e){return null!==e&&"object"===t(e)&&e.constructor===Object}function i(e){return!(!e||"object"!==t(e))&&"string"==typeof e.op}function o(e){return!(!e||"object"!==t(e))&&"add"===e.op}function a(e){return!(!e||"object"!==t(e))&&"remove"===e.op}function s(e){return!(!e||"object"!==t(e))&&"replace"===e.op}function u(e){return!(!e||"object"!==t(e))&&"copy"===e.op}function c(e){return!(!e||"object"!==t(e))&&"move"===e.op}function l(e){return!(!e||"object"!==t(e))&&"test"===e.op}function f(e){return f="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},f(e)}function h(e,t){return JSON.stringify(e)===JSON.stringify(t)}function d(e,t){return e===t}function v(e){return e.slice(0,e.length-1)}function p(e){return e[e.length-1]}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d;if(e.length3&&void 0!==arguments[3]&&arguments[3];if(0===t.length)return i;var a=t[0],s=S(e?e[a]:void 0,t.slice(1),i,o);if(r(e)||n(e))return j(e,a,s);if(o){var u=_.test(a)?[]:{};return u[a]=s,u}throw new Error("Path does not exist")}var _=/^\d+$/;function C(e,t,n){if(0===t.length)return n(e);if(!g(e))throw new Error("Path doesn't exist");var r=t[0];return j(e,r,C(e[r],t.slice(1),n))}function $(e,t){if(0===t.length)return e;if(!g(e))throw new Error("Path does not exist");if(1===t.length){var i=t[0];if(i in e){var o=w(e);return n(o)&&o.splice(parseInt(i),1),r(o)&&delete o[i],o}return e}var a=t[0];return j(e,a,$(e[a],t.slice(1)))}function O(e,t,n){var r=t.slice(0,t.length-1),i=t[t.length-1];return C(e,r,(function(e){if(!Array.isArray(e))throw new TypeError("Array expected at path "+JSON.stringify(r));var t=w(e);return t.splice(parseInt(i),0,n),t}))}function E(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=t(e,i);if(n(o)){for(var a,s=0;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?r=function(){var t="",n=!0;"-"==e[a]&&(t+=h());t+="0"==e[a]?h():p(),"."==e[a]&&(t+=h()+p(),n=!1);"e"!=e[a]&&"E"!=e[a]||(t+=h(),"+"!=e[a]&&"-"!=e[a]||(t+=h()),t+=p(),n=!1);var r=+t;return s&&n&&(r>Number.MAX_SAFE_INTEGER||r="a"&&n<="f"?t+=n.charCodeAt()-ps+10:n>="0"&&n<="9"?t+=+n:k()}return String.fromCharCode(t)}function p(){for(var t="";e[a]>="0"&&e[a]<="9";)t+=h();if(t.length)return t;w(),b()}function m(e,t){g(e,t,y())}function g(e,t,n){r[e]=r[e]||{},r[e][t]=n}function y(){return{line:i,column:o,pos:a}}function b(){throw new SyntaxError("Unexpected token "+e[a]+" in JSON at position "+a)}function k(){d(),b()}function w(){if(a>=e.length)throw new SyntaxError("Unexpected end of JSON input")}},ds.stringify=function(e,t,n){if(gs(e)){var r,i,o=0,a="object"==zi(n)?n.space:n;switch(zi(a)){case"number":var s=a>10?10:a<0?0:Math.floor(a);a=s&&y(s," "),r=s,i=s;break;case"string":a=a.slice(0,10),r=0,i=0;for(var u=0;u=0}var ys=/"|\\/g,bs=/[\b]/g,ks=/\f/g,ws=/\n/g,js=/\r/g,xs=/\t/g;function Ss(e){return'"'+(e=e.replace(ys,"\\$&").replace(ks,"\\f").replace(bs,"\\b").replace(ws,"\\n").replace(js,"\\r").replace(xs,"\\t"))+'"'}var _s=/~/g,Cs=/\//g;function $s(e){return e.replace(_s,"~0").replace(Cs,"~1")}var Os={exports:{}},Es=Os.exports=function(){function e(t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.message=t+" (char "+n+")",this.char=n,this.stack=(new Error).stack}(e.prototype=new Error).constructor=Error;var t={"'":!0,"‘":!0,"’":!0,"`":!0,"´":!0},n={'"':!0,"“":!0,"”":!0};function r(e){return i.test(e)}var i=/^[a-zA-Z_]$/,o=/^[0-9a-fA-F]$/;function a(e){return s.test(e)}var s=/^[0-9]$/;function u(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function c(e){return" "===e||" "<=e&&e<=" "||" "===e||" "===e||" "===e}function l(e){return!0===t[e]}function f(e){return!0===n[e]}function h(e){return!0===t[e]?"'":!0===n[e]?'"':e}function d(e,t){return-1!==(t=e.lastIndexOf(t))?e.substring(0,t)+e.substring(t+1):e}function v(e,t){var n=e.length;if(!u(e[n-1]))return e+t;for(;u(e[n-1]);)n--;return e.substring(0,n)+t+e.substring(n)}var p=0,m=1,g=2,y=3,b=4,k=5,w=6,j={"":!0,"{":!0,"}":!0,"[":!0,"]":!0,":":!0,",":!0,"(":!0,")":!0,";":!0,"+":!0},x={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},S={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},_={null:"null",true:"true",false:"false"},C={None:"null",True:"true",False:"false"},$="",O="",E=0,P="",M="",A=w;function T(){E++,P=$.charAt(E)}function N(){T(),"\\"===P&&T()}function I(){return A===p&&("["===M||"{"===M)||A===g||A===m||A===y}function R(){O+=M,A=w,M="",j[P]?(A=p,M=P,T()):function(){if(a(P)||"-"===P){if(A=m,"-"===P){if(M+=P,T(),!a(P))throw new e("Invalid number, digit expected",E)}else"0"===P&&(M+=P,T());for(;a(P);)M+=P,T();if("."===P){if(M+=P,T(),!a(P))throw new e("Invalid number, digit expected",E);for(;a(P);)M+=P,T()}if("e"===P||"E"===P){if(M+=P,T(),"+"!==P&&"-"!==P||(M+=P,T()),!a(P))throw new e("Invalid number, digit expected",E);for(;a(P);)M+=P,T()}}else"\\"===P&&'"'===$.charAt(E+1)?(T(),L(N)):L(T)}(),A===b&&(M=function(e){for(var t="",n=0;n9466848e5&&isFinite(e)&&Math.floor(e)===e&&!isNaN(new Date(e).valueOf());if("bigint"==typeof e)return Is(Number(e));try{var t=e.valueOf();if(t!==e)return Is(t)}catch(e){return!1}}function Rs(e){var t=window.document.createElement("div");return t.style.color=e,t.style.color.split(/\s+/).join("").toLowerCase()||null}function Ds(e,t){if("number"==typeof e||"string"==typeof e||"boolean"==typeof e||void 0===e)return zi(e);if("bigint"==typeof e)return"number";if(null===e)return"null";if(Array.isArray(e))return"array";if(Ts(e))return"object";var n,r=t.stringify(e);return r&&(n=r[0],Ms.test(n))?"number":"true"===r||"false"===r?"boolean":"null"===r?"null":"unknown"}var Ls=/^https?:\/\/\S+$/;function zs(e){return"string"==typeof e&&Ls.test(e)}function Bs(e,t){if(""===e)return"";var n,r=e.trim();return"null"===r?null:"true"===r||"false"!==r&&(n=r,As.test(n)?t.parse(r):e)}function qs(e){return Fs.test(e)}var Fs=/^-?[0-9]+$/,Vs="object"==("undefined"==typeof global?"undefined":zi(global))&&global&&global.Object===Object&&global,Ws="object"==("undefined"==typeof self?"undefined":zi(self))&&self&&self.Object===Object&&self,Hs=Vs||Ws||Function("return this")(),Js=Hs.Symbol,Us=Object.prototype,Ks=Us.hasOwnProperty,Gs=Us.toString,Qs=Js?Js.toStringTag:void 0;var Ys=Object.prototype.toString;var Zs=Js?Js.toStringTag:void 0;function Xs(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Zs&&Zs in Object(e)?function(e){var t=Ks.call(e,Qs),n=e[Qs];try{e[Qs]=void 0;var r=!0}catch(e){}var i=Gs.call(e);return r&&(t?e[Qs]=n:delete e[Qs]),i}(e):function(e){return Ys.call(e)}(e)}function eu(e){return null!=e&&"object"==zi(e)}function tu(e){return"symbol"==zi(e)||eu(e)&&"[object Symbol]"==Xs(e)}function nu(e){return"number"==typeof e?e:tu(e)?NaN:+e}function ru(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var fc=lc(Bu),hc=/\{\n\/\* \[wrapped with (.+)\] \*/,dc=/,? & /;var vc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function pc(e){return function(){return e}}var mc=function(){try{var e=Du(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),gc=mc?function(e,t){return mc(e,"toString",{configurable:!0,enumerable:!1,value:pc(t),writable:!0})}:xu,yc=lc(gc);function bc(e,t){for(var n=-1,r=null==e?0:e.length;++n-1}var Sc=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function _c(e,t,n){var r=t+"";return yc(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(vc,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return bc(Sc,(function(n){var r="_."+n[0];t&n[1]&&!xc(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(hc);return t?t[1].split(dc):[]}(r),n)))}function Cc(e,t,n,r,i,o,a,s,u,c){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var f=[e,t,i,l?o:void 0,l?a:void 0,l?void 0:o,l?void 0:a,s,u,c],h=n.apply(void 0,f);return uc(e)&&fc(h,f),h.placeholder=r,_c(h,e,t)}function $c(e){return e.placeholder}var Oc=/^(?:0|[1-9]\d*)$/;function Ec(e,t){var n=zi(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Oc.test(e))&&e>-1&&e%1==0&&e1&&y.reverse(),l&&u-1&&e%1==0&&e<=9007199254740991}function Uc(e){return null!=e&&Jc(e.length)&&!Su(e)}function Kc(e,t,n){if(!vu(n))return!1;var r=zi(t);return!!("number"==r?Uc(n)&&Ec(t,n.length):"string"==r&&t in n)&&zc(n[t],e)}function Gc(e){return Hc((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&Kc(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r-1},ql.prototype.set=function(e,t){var n=this.__data__,r=zl(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Fl=Du(Hs,"Map");function Vl(e,t){var n,r,i=e.__data__;return("string"==(r=zi(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Wl(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0&&n(s)?t>1?of(s,t-1,n,r,i):tf(i,s):r||(i[i.length]=s)}return i}function af(e){return(null==e?0:e.length)?of(e,1):[]}function sf(e){return yc(Wc(e,void 0,af),e+"")}var uf=sf(ef),cf=bl(Object.getPrototypeOf,Object),lf=Function.prototype,ff=Object.prototype,hf=lf.toString,df=ff.hasOwnProperty,vf=hf.call(Object);function pf(e){if(!eu(e)||"[object Object]"!=Xs(e))return!1;var t=cf(e);if(null===t)return!0;var n=df.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&hf.call(n)==vf}function mf(e){if(!eu(e))return!1;var t=Xs(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!pf(e)}var gf=Hc((function(e,t){try{return Wu(e,void 0,t)}catch(e){return mf(e)?e:new Error(e)}}));function yf(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=wu(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var bf=Hc((function(e,t,n){var r=1;if(n.length){var i=Ac(n,$c(bf));r|=32}return Rc(e,r,t,n,i)}));bf.placeholder={};var kf=sf((function(e,t){return bc(t,(function(t){t=Yl(t),Lc(e,t,bf(e[t],e))})),e})),wf=Hc((function(e,t,n){var r=3;if(n.length){var i=Ac(n,$c(wf));r|=32}return Rc(t,r,e,n,i)}));function jf(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=r?e:jf(e,t,n)}wf.placeholder={};var Sf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function _f(e){return Sf.test(e)}var Cf="[\\ud800-\\udfff]",$f="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Of="\\ud83c[\\udffb-\\udfff]",Ef="[^\\ud800-\\udfff]",Pf="(?:\\ud83c[\\udde6-\\uddff]){2}",Mf="[\\ud800-\\udbff][\\udc00-\\udfff]",Af="(?:"+$f+"|"+Of+")"+"?",Tf="[\\ufe0e\\ufe0f]?"+Af+("(?:\\u200d(?:"+[Ef,Pf,Mf].join("|")+")[\\ufe0e\\ufe0f]?"+Af+")*"),Nf="(?:"+[Ef+$f+"?",$f,Pf,Mf,Cf].join("|")+")",If=RegExp(Of+"(?="+Of+")|"+Nf+Tf,"g");function Rf(e){return _f(e)?function(e){return e.match(If)||[]}(e):function(e){return e.split("")}(e)}function Df(e){return function(t){var n=_f(t=Gl(t))?Rf(t):void 0,r=n?n[0]:t.charAt(0),i=n?xf(n,1).join(""):t.slice(1);return r[e]()+i}}var Lf=Df("toUpperCase");function zf(e){return Lf(Gl(e).toLowerCase())}function Bf(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i=t?e:t)),e}function xh(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=bu(n))==n?n:0),void 0!==t&&(t=(t=bu(t))==t?t:0),jh(bu(e),t,n)}function Sh(e){var t=this.__data__=new ql(e);this.size=t.size}function _h(e,t){return e&&Fc(t,xl(t),e)}Sh.prototype.clear=function(){this.__data__=new ql,this.size=0},Sh.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Sh.prototype.get=function(e){return this.__data__.get(e)},Sh.prototype.has=function(e){return this.__data__.has(e)},Sh.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ql){var r=n.__data__;if(!Fl||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wl(r)}return n.set(e,t),this.size=n.size,this};var Ch="object"==("undefined"==typeof exports?"undefined":zi(exports))&&exports&&!exports.nodeType&&exports,$h=Ch&&"object"==("undefined"==typeof module?"undefined":zi(module))&&module&&!module.nodeType&&module,Oh=$h&&$h.exports===Ch?Hs.Buffer:void 0,Eh=Oh?Oh.allocUnsafe:void 0;function Ph(e,t){if(t)return e.slice();var n=e.length,r=Eh?Eh(n):new e.constructor(n);return e.copy(r),r}function Mh(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++ns))return!1;var c=o.get(e),l=o.get(t);if(c&&l)return c==t&&l==e;var f=-1,h=!0,d=2&n?new yd:void 0;for(o.set(e,t),o.set(t,e);++f=t||n<0||f&&e-c>=o}function m(){var e=av();if(p(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-u);return f?uv(n,o-(e-c)):n}(e))}function g(e){return s=void 0,h&&r?d(e):(r=i=void 0,a)}function y(){var e=av(),n=p(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return v(u);if(f)return clearTimeout(s),s=setTimeout(m,t),d(u)}return void 0===s&&(s=setTimeout(m,t)),a}return t=bu(t)||0,vu(n)&&(l=!!n.leading,o=(f="maxWait"in n)?sv(bu(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0},y.flush=function(){return void 0===s?a:g(av())},y}function lv(e,t){return null==e||e!=e?t:e}var fv=Object.prototype,hv=fv.hasOwnProperty,dv=Hc((function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&Kc(t[0],t[1],i)&&(r=1);++n=200&&(o=kd,a=!1,t=new yd(t));e:for(;++i=0&&e.slice(n,i)==t}function Hv(e){return function(t){var n=Gh(t);return"[object Map]"==n?jd(t):"[object Set]"==n?function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}(t):function(e,t){return ru(t,(function(t){return[t,e[t]]}))}(t,e(t))}}var Jv=Hv(xl),Uv=Hv(Ol),Kv=qf({"&":"&","<":"<",">":">",'"':""","'":"'"}),Gv=/[&<>"']/g,Qv=RegExp(Gv.source);function Yv(e){return(e=Gl(e))&&Qv.test(e)?e.replace(Gv,Kv):e}var Zv=/[\\^$.*+?()[\]{}|]/g,Xv=RegExp(Zv.source);function ep(e){return(e=Gl(e))&&Xv.test(e)?e.replace(Zv,"\\$&"):e}function tp(e,t){for(var n=-1,r=null==e?0:e.length;++ni?0:i+n),(r=void 0===r||r>i?i:wu(r))<0&&(r+=i),r=n>r?0:ip(r);n-1?i[o?t[a]:a]:void 0}}var cp=Math.max;function lp(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:wu(n);return i<0&&(i=cp(r+i,0)),kc(e,Fd(t),i)}var fp=up(lp);function hp(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function dp(e,t){return hp(e,Fd(t),Qd)}var vp=Math.max,pp=Math.min;function mp(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=wu(n),i=n<0?vp(r+i,0):pp(i,r-1)),kc(e,Fd(t),i,!0)}var gp=up(mp);function yp(e,t){return hp(e,Fd(t),qv)}function bp(e){return e&&e.length?e[0]:void 0}function kp(e,t){var n=-1,r=Uc(e)?Array(e.length):[];return Zd(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function wp(e,t){return(iu(e)?ru:kp)(e,Fd(t))}function jp(e,t){return of(wp(e,t),1)}function xp(e,t){return of(wp(e,t),Infinity)}function Sp(e,t,n){return n=void 0===n?1:wu(n),of(wp(e,t),n)}function _p(e){return(null==e?0:e.length)?of(e,Infinity):[]}function Cp(e,t){return(null==e?0:e.length)?of(e,t=void 0===t?1:wu(t)):[]}function $p(e){return Rc(e,512)}var Op=mh("floor");function Ep(e){return sf((function(t){var n=t.length,r=n,i=rc.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==nc(o))var a=new rc([],!0)}for(r=a?r:n;++rt}function Vp(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=bu(t),n=bu(n)),e(t,n)}}var Wp=Vp(Fp),Hp=Vp((function(e,t){return e>=t})),Jp=Object.prototype.hasOwnProperty;function Up(e,t){return null!=e&&Jp.call(e,t)}function Kp(e,t){return null!=e&&Dd(e,t,Up)}var Gp=Math.max,Qp=Math.min;function Yp(e,t,n){return t=ku(t),void 0===n?(n=t,t=0):n=ku(n),function(e,t,n){return e>=Qp(t,n)&&e-1:!!i&&jc(e,t,n)>-1}var rm=Math.max;function im(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:wu(n);return i<0&&(i=rm(r+i,0)),jc(e,t,i)}function om(e){return(null==e?0:e.length)?jf(e,0,-1):[]}var am=Math.min;function sm(e,t,n){for(var r=n?_v:xc,i=e[0].length,o=e.length,a=o,s=Array(o),u=1/0,c=[];a--;){var l=e[a];a&&t&&(l=ru(l,ll(t))),u=am(l.length,u),s[a]=!n&&(t||i>=120&&l.length>=120)?new yd(a&&l):void 0}l=e[0];var f=-1,h=s[0];e:for(;++f=-9007199254740991&&e<=9007199254740991}function Um(e){return void 0===e}function Km(e){return eu(e)&&"[object WeakMap]"==Gh(e)}function Gm(e){return eu(e)&&"[object WeakSet]"==Xs(e)}function Qm(e){return Fd("function"==typeof e?e:ld(e,1))}var Ym=Array.prototype.join;function Zm(e,t){return null==e?"":Ym.call(e,t)}var Xm=fh((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),eg=ev((function(e,t,n){Lc(e,n,t)}));var tg=Math.max,ng=Math.min;function rg(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=wu(n))<0?tg(r+i,0):ng(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):kc(e,wc,i,!0)}var ig=fh((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),og=Df("toLowerCase");function ag(e,t){return e=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}}function Mg(e,t){var n=e.length;if(n)return Ec(t+=t<0?n:0,n)?e[t]:void 0}function Ag(e,t){return e&&e.length?Mg(e,wu(t)):void 0}function Tg(e){return e=wu(e),Hc((function(t){return Mg(t,e)}))}function Ng(e,t){return null==(e=bm(e,t=Ql(t,e)))||delete e[Yl(Ov(t))]}function Ig(e){return pf(e)?void 0:e}var Rg=sf((function(e,t){var n={};if(null==e)return n;var r=!1;t=ru(t,(function(t){return t=Ql(t,e),r||(r=t.length>1),t})),Fc(e,zh(e),n),r&&(n=ld(n,7,Ig));for(var i=t.length;i--;)Ng(n,t[i]);return n}));function Dg(e,t,n,r){if(!vu(e))return e;for(var i=-1,o=(t=Ql(t,e)).length,a=o-1,s=e;null!=s&&++it||o&&a&&u&&!s&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!c&&e=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Wg(e,t,n,r){return null==e?[]:(iu(t)||(t=null==t?[]:[t]),iu(n=r?void 0:n)||(n=null==n?[]:[n]),Vg(e,t,n))}function Hg(e){return sf((function(t){return t=ru(t,ll(Fd)),Hc((function(n){var r=this;return e(t,(function(e){return Wu(e,r,n)}))}))}))}var Jg=Hg(ru),Ug=Hc,Kg=Math.min,Gg=Ug((function(e,t){var n=(t=1==t.length&&iu(t[0])?ru(t[0],ll(Fd)):ru(of(t,1),ll(Fd))).length;return Hc((function(r){for(var i=-1,o=Kg(r.length,n);++i9007199254740991)return n;do{t%2&&(n+=e),(t=Zg(t/2))&&(e+=e)}while(t);return n}var ey=Bd("length"),ty="[\\ud800-\\udfff]",ny="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ry="\\ud83c[\\udffb-\\udfff]",iy="[^\\ud800-\\udfff]",oy="(?:\\ud83c[\\udde6-\\uddff]){2}",ay="[\\ud800-\\udbff][\\udc00-\\udfff]",sy="(?:"+ny+"|"+ry+")"+"?",uy="[\\ufe0e\\ufe0f]?"+sy+("(?:\\u200d(?:"+[iy,oy,ay].join("|")+")[\\ufe0e\\ufe0f]?"+sy+")*"),cy="(?:"+[iy+ny+"?",ny,oy,ay,ty].join("|")+")",ly=RegExp(ry+"(?="+ry+")|"+cy+uy,"g");function fy(e){return _f(e)?function(e){for(var t=ly.lastIndex=0;ly.test(e);)++t;return t}(e):ey(e)}var hy=Math.ceil;function dy(e,t){var n=(t=void 0===t?" ":su(t)).length;if(n<2)return n?Xg(t,e):t;var r=Xg(t,hy(e/fy(t)));return _f(t)?xf(Rf(r),0,e).join(""):r.slice(0,e)}var vy=Math.ceil,py=Math.floor;function my(e,t,n){e=Gl(e);var r=(t=wu(t))?fy(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return dy(py(i),n)+e+dy(vy(i),n)}function gy(e,t,n){e=Gl(e);var r=(t=wu(t))?fy(e):0;return t&&r-1;)s!==e&&Ey.call(s,u,1),Ey.call(e,u,1);return e}function My(e,t){return e&&e.length&&t&&t.length?Py(e,t):e}var Ay=Hc(My);function Ty(e,t,n){return e&&e.length&&t&&t.length?Py(e,t,Fd(n)):e}function Ny(e,t,n){return e&&e.length&&t&&t.length?Py(e,t,void 0,n):e}var Iy=Array.prototype.splice;function Ry(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;Ec(i)?Iy.call(e,i,1):Ng(e,i)}}return e}var Dy=sf((function(e,t){var n=null==e?0:e.length,r=ef(e,t);return Ry(e,ru(t,(function(e){return Ec(e,n)?+e:e})).sort(Fg)),r})),Ly=Math.floor,zy=Math.random;function By(e,t){return e+Ly(zy()*(t-e+1))}var qy=parseFloat,Fy=Math.min,Vy=Math.random;function Wy(e,t,n){if(n&&"boolean"!=typeof n&&Kc(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=ku(e),void 0===t?(t=e,e=0):t=ku(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=Vy();return Fy(e+i*(t-e+qy("1e-"+((i+"").length-1))),t)}return By(e,t)}var Hy=Math.ceil,Jy=Math.max;function Uy(e){return function(t,n,r){return r&&"number"!=typeof r&&Kc(t,n,r)&&(n=r=void 0),t=ku(t),void 0===n?(n=t,t=0):n=ku(n),function(e,t,n,r){for(var i=-1,o=Jy(Hy((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,n,r=void 0===r?t1&&Kc(e,t[0],t[1])?t=[]:n>2&&Kc(t[0],t[1],t[2])&&(t=[t[0]]),Vg(e,of(t,1),[])})),Ob=Math.floor,Eb=Math.min;function Pb(e,t,n,r){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,s=null===t,u=tu(t),c=void 0===t;i>>1,a=e[o];null!==a&&!tu(a)&&(n?a<=t:a>>0)?(e=Gl(e))&&("string"==typeof t||null!=t&&!Hm(t))&&!(t=su(t))&&_f(e)?xf(Rf(e),0,n):e.split(t,n):[]}var Fb=Math.max;function Vb(e,t){if("function"!=typeof e)throw new TypeError("Expected a function");return t=null==t?0:Fb(wu(t),0),Hc((function(n){var r=n[t],i=xf(n,0,t);return r&&tf(i,r),Wu(e,this,i)}))}var Wb=fh((function(e,t,n){return e+(n?" ":"")+Lf(t)}));function Hb(e,t,n){return e=Gl(e),n=null==n?0:jh(wu(n),0,e.length),t=su(t),e.slice(n,n+t.length)==t}function Jb(){return{}}function Ub(){return""}function Kb(){return!0}var Gb=uu((function(e,t){return e-t}),0);function Qb(e){return e&&e.length?mg(e,xu):0}function Yb(e,t){return e&&e.length?mg(e,Fd(t)):0}function Zb(e){var t=null==e?0:e.length;return t?jf(e,1,t):[]}function Xb(e,t,n){return e&&e.length?jf(e,0,(t=n||void 0===t?1:wu(t))<0?0:t):[]}function ek(e,t,n){var r=null==e?0:e.length;return r?jf(e,(t=r-(t=n||void 0===t?1:wu(t)))<0?0:t,r):[]}function tk(e,t){return e&&e.length?Nv(e,Fd(t),!1,!0):[]}function nk(e,t){return e&&e.length?Nv(e,Fd(t)):[]}function rk(e,t){return t(e),e}var ik=Object.prototype,ok=ik.hasOwnProperty;function ak(e,t,n,r){return void 0===e||zc(e,ik[n])&&!ok.call(r,n)?t:e}var sk={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function uk(e){return"\\"+sk[e]}var ck=/<%=([\s\S]+?)%>/g,lk={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ck,variable:"",imports:{_:{escape:Yv}}},fk=/\b__p \+= '';/g,hk=/\b(__p \+=) '' \+/g,dk=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vk=/[()=,{}\[\]\/\s]/,pk=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mk=/($^)/,gk=/['\n\r\u2028\u2029\\]/g,yk=Object.prototype.hasOwnProperty;function bk(e,t,n){var r=lk.imports._.templateSettings||lk;n&&Kc(e,t,n)&&(t=void 0),e=Gl(e),t=Pl({},t,r,ak);var i,o,a=Pl({},t.imports,r.imports,ak),s=xl(a),u=Xp(a,s),c=0,l=t.interpolate||mk,f="__p += '",h=RegExp((t.escape||mk).source+"|"+l.source+"|"+(l===ck?pk:mk).source+"|"+(t.evaluate||mk).source+"|$","g"),d=yk.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(h,(function(t,n,r,a,s,u){return r||(r=a),f+=e.slice(c,u).replace(gk,uk),n&&(i=!0,f+="' +\n__e("+n+") +\n'"),s&&(o=!0,f+="';\n"+s+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),f+="';\n";var v=yk.call(t,"variable")&&t.variable;if(v){if(vk.test(v))throw new Error("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace(fk,""):f).replace(hk,"$1").replace(dk,"$1;"),f="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var p=gf((function(){return Function(s,d+"return "+f).apply(void 0,u)}));if(p.source=f,mf(p))throw p;return p}function kk(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return vu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),cv(e,t,{leading:r,maxWait:t,trailing:i})}function wk(e,t){return t(e)}var jk=Math.min;function xk(e,t){if((e=wu(e))<1||e>9007199254740991)return[];var n=4294967295,r=jk(e,4294967295);e-=4294967295;for(var i=Zc(r,t=Dv(t));++n-1;);return n}function Tk(e,t){for(var n=-1,r=e.length;++n-1;);return n}function Nk(e,t,n){if((e=Gl(e))&&(n||void 0===t))return du(e);if(!e||!(t=su(t)))return e;var r=Rf(e),i=Rf(t);return xf(r,Tk(r,i),Ak(r,i)+1).join("")}function Ik(e,t,n){if((e=Gl(e))&&(n||void 0===t))return e.slice(0,fu(e)+1);if(!e||!(t=su(t)))return e;var r=Rf(e);return xf(r,0,Ak(r,Rf(t))+1).join("")}var Rk=/^\s+/;function Dk(e,t,n){if((e=Gl(e))&&(n||void 0===t))return e.replace(Rk,"");if(!e||!(t=su(t)))return e;var r=Rf(e);return xf(r,Tk(r,Rf(t))).join("")}var Lk=/\w*$/;function zk(e,t){var n=30,r="...";if(vu(t)){var i="separator"in t?t.separator:i;n="length"in t?wu(t.length):n,r="omission"in t?su(t.omission):r}var o=(e=Gl(e)).length;if(_f(e)){var a=Rf(e);o=a.length}if(n>=o)return e;var s=n-fy(r);if(s<1)return r;var u=a?xf(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Hm(i)){if(e.slice(s).search(i)){var c,l=u;for(i.global||(i=RegExp(i.source,Gl(Lk.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var f=c.index;u=u.slice(0,void 0===f?s:f)}}else if(e.indexOf(su(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+r}function Bk(e){return Dc(e,1)}var qk=qf({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Fk=/&(?:amp|lt|gt|quot|#39);/g,Vk=RegExp(Fk.source);function Wk(e){return(e=Gl(e))&&Vk.test(e)?e.replace(Fk,qk):e}var Hk=Fh&&1/xd(new Fh([,-0]))[1]==1/0?function(e){return new Fh(e)}:Zu;function Jk(e,t,n){var r=-1,i=xc,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=_v;else if(o>=200){var c=t?null:Hk(e);if(c)return xd(c);a=!1,i=kd,u=new yd}else u=t?[]:s;e:for(;++r1||this.__actions__.length)&&r instanceof Yu&&Ec(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:wk,args:[i],thisArg:void 0}),new rc(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));function dw(){return yh(this)}function vw(){var e=this.__wrapped__;if(e instanceof Yu){var t=e;return this.__actions__.length&&(t=new Yu(this)),(t=t.reverse()).__actions__.push({func:wk,args:[ub],thisArg:void 0}),new rc(t,this.__chain__)}return this.thru(ub)}function pw(e,t,n){var r=e.length;if(r<2)return r?Jk(e[0]):[];for(var i=-1,o=Array(r);++i1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,iw(e,n)})),Sw={chunk:wh,compact:md,concat:gd,difference:$v,differenceBy:Ev,differenceWith:Pv,drop:Av,dropRight:Tv,dropRightWhile:Iv,dropWhile:Rv,fill:op,findIndex:lp,findLastIndex:mp,first:bp,flatten:af,flattenDeep:_p,flattenDepth:Cp,fromPairs:Rp,head:bp,indexOf:im,initial:om,intersection:cm,intersectionBy:lm,intersectionWith:fm,join:Zm,last:Ov,lastIndexOf:rg,nth:Ag,pull:Ay,pullAll:My,pullAllBy:Ty,pullAllWith:Ny,pullAt:Dy,remove:nb,reverse:ub,slice:xb,sortedIndex:Ab,sortedIndexBy:Tb,sortedIndexOf:Nb,sortedLastIndex:Ib,sortedLastIndexBy:Rb,sortedLastIndexOf:Db,sortedUniq:zb,sortedUniqBy:Bb,tail:Zb,take:Xb,takeRight:ek,takeRightWhile:tk,takeWhile:nk,union:Uk,unionBy:Kk,unionWith:Gk,uniq:Qk,uniqBy:Yk,uniqWith:Zk,unzip:rw,unzipWith:iw,without:lw,xor:mw,xorBy:gw,xorWith:yw,zip:bw,zipObject:ww,zipObjectDeep:jw,zipWith:xw},_w={countBy:nv,each:Lv,eachRight:Vv,every:rp,filter:sp,find:fp,findLast:gp,flatMap:jp,flatMapDeep:xp,flatMapDepth:Sp,forEach:Lv,forEachRight:Vv,groupBy:qp,includes:nm,invokeMap:jm,keyBy:eg,map:wp,orderBy:Wg,partition:Sy,reduce:Zy,reduceRight:eb,reject:tb,sample:hb,sampleSize:mb,shuffle:wb,size:jb,some:Cb,sortBy:$b},Cw=av,$w={after:ju,ary:Dc,before:yf,bind:bf,bindKey:wf,curry:iv,curryRight:ov,debounce:cv,defer:xv,delay:Sv,flip:$p,memoize:Hl,negate:$g,once:qg,overArgs:Gg,partial:jy,partialRight:xy,rearg:Qy,rest:ob,spread:Vb,throttle:kk,unary:Bk,wrap:fw},Ow={castArray:dh,clone:fd,cloneDeep:hd,cloneDeepWith:dd,cloneWith:vd,conformsTo:Jd,eq:zc,gt:Wp,gte:Hp,isArguments:rl,isArray:iu,isArrayBuffer:Sm,isArrayLike:Uc,isArrayLikeObject:pv,isBoolean:_m,isBuffer:ul,isDate:$m,isElement:Om,isEmpty:Pm,isEqual:Mm,isEqualWith:Am,isError:mf,isFinite:Nm,isFunction:Su,isInteger:Im,isLength:Jc,isMap:ad,isMatch:Rm,isMatchWith:Dm,isNaN:zm,isNative:qm,isNil:Fm,isNull:Vm,isNumber:Lm,isObject:vu,isObjectLike:eu,isPlainObject:pf,isRegExp:Hm,isSafeInteger:Jm,isSet:ud,isString:Zp,isSymbol:tu,isTypedArray:ml,isUndefined:Um,isWeakMap:Km,isWeakSet:Gm,lt:sg,lte:ug,toArray:Eg,toFinite:ku,toInteger:wu,toLength:ip,toNumber:bu,toPlainObject:gv,toSafeInteger:Ek,toString:Gl},Ew={add:cu,ceil:gh,divide:Mv,floor:Op,max:vg,maxBy:pg,mean:yg,meanBy:bg,min:xg,minBy:Sg,multiply:Cg,round:cb,subtract:Gb,sum:Qb,sumBy:Yb},Pw=xh,Mw=Yp,Aw=Wy,Tw={assign:_l,assignIn:El,assignInWith:Pl,assignWith:Ml,at:uf,create:rv,defaults:dv,defaultsDeep:wv,entries:Jv,entriesIn:Uv,extend:El,extendWith:Pl,findKey:dp,findLastKey:yp,forIn:Ap,forInRight:Tp,forOwn:Np,forOwnRight:Ip,functions:Lp,functionsIn:zp,get:Xl,has:Kp,hasIn:Ld,invert:vm,invertBy:ym,invoke:wm,keys:xl,keysIn:Ol,mapKeys:cg,mapValues:lg,merge:kg,mergeWith:kv,omit:Rg,omitBy:Bg,pick:_y,pickBy:zg,result:ab,set:gb,setWith:yb,toPairs:Jv,toPairsIn:Uv,transform:Mk,unset:tw,update:aw,updateWith:sw,values:em,valuesIn:cw},Nw={at:hw,chain:yh,commit:pd,lodash:sc,next:Pg,plant:Cy,reverse:vw,tap:rk,thru:wk,toIterator:Sk,toJSON:Ck,value:Ck,valueOf:Ck,wrapperChain:dw},Iw={camelCase:hh,capitalize:zf,deburr:Hf,endsWith:Wv,escape:Yv,escapeRegExp:ep,kebabCase:Xm,lowerCase:ig,lowerFirst:og,pad:my,padEnd:gy,padStart:yy,parseInt:wy,repeat:rb,replace:ib,snakeCase:Sb,split:qb,startCase:Wb,startsWith:Hb,template:bk,templateSettings:lk,toLower:$k,toUpper:Pk,trim:Nk,trimEnd:Ik,trimStart:Dk,truncate:zk,unescape:Wk,upperCase:uw,upperFirst:Lf,words:ch},Rw={attempt:gf,bindAll:kf,cond:Vd,conforms:Hd,constant:pc,defaultTo:lv,flow:Pp,flowRight:Mp,identity:xu,iteratee:Qm,matches:fg,matchesProperty:hg,method:wg,methodOf:jg,mixin:_g,noop:Zu,nthArg:Tg,over:Jg,overEvery:Qg,overSome:Yg,property:qd,propertyOf:$y,range:Ky,rangeRight:Gy,stubArray:Ah,stubFalse:il,stubObject:Jb,stubString:Ub,stubTrue:Kb,times:xk,toPath:Ok,uniqueId:ew};var Dw=Math.max,Lw=Math.min;var zw=Math.min; /** * @license * Lodash (Custom Build) * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var Bw,qw=Array.prototype,Fw=Object.prototype.hasOwnProperty,Vw=Js?Js.iterator:void 0,Ww=Math.max,Hw=Math.min,Jw=function(e){return function(t,n,r){if(null==r){var i=vu(n),o=i&&xl(n),a=o&&o.length&&Dp(n,o);(a?a.length:i)||(r=n,n=t,t=this)}return e(t,n,r)}}(_g);sc.after=$w.after,sc.ary=$w.ary,sc.assign=Tw.assign,sc.assignIn=Tw.assignIn,sc.assignInWith=Tw.assignInWith,sc.assignWith=Tw.assignWith,sc.at=Tw.at,sc.before=$w.before,sc.bind=$w.bind,sc.bindAll=Rw.bindAll,sc.bindKey=$w.bindKey,sc.castArray=Ow.castArray,sc.chain=Nw.chain,sc.chunk=Sw.chunk,sc.compact=Sw.compact,sc.concat=Sw.concat,sc.cond=Rw.cond,sc.conforms=Rw.conforms,sc.constant=Rw.constant,sc.countBy=_w.countBy,sc.create=Tw.create,sc.curry=$w.curry,sc.curryRight=$w.curryRight,sc.debounce=$w.debounce,sc.defaults=Tw.defaults,sc.defaultsDeep=Tw.defaultsDeep,sc.defer=$w.defer,sc.delay=$w.delay,sc.difference=Sw.difference,sc.differenceBy=Sw.differenceBy,sc.differenceWith=Sw.differenceWith,sc.drop=Sw.drop,sc.dropRight=Sw.dropRight,sc.dropRightWhile=Sw.dropRightWhile,sc.dropWhile=Sw.dropWhile,sc.fill=Sw.fill,sc.filter=_w.filter,sc.flatMap=_w.flatMap,sc.flatMapDeep=_w.flatMapDeep,sc.flatMapDepth=_w.flatMapDepth,sc.flatten=Sw.flatten,sc.flattenDeep=Sw.flattenDeep,sc.flattenDepth=Sw.flattenDepth,sc.flip=$w.flip,sc.flow=Rw.flow,sc.flowRight=Rw.flowRight,sc.fromPairs=Sw.fromPairs,sc.functions=Tw.functions,sc.functionsIn=Tw.functionsIn,sc.groupBy=_w.groupBy,sc.initial=Sw.initial,sc.intersection=Sw.intersection,sc.intersectionBy=Sw.intersectionBy,sc.intersectionWith=Sw.intersectionWith,sc.invert=Tw.invert,sc.invertBy=Tw.invertBy,sc.invokeMap=_w.invokeMap,sc.iteratee=Rw.iteratee,sc.keyBy=_w.keyBy,sc.keys=xl,sc.keysIn=Tw.keysIn,sc.map=_w.map,sc.mapKeys=Tw.mapKeys,sc.mapValues=Tw.mapValues,sc.matches=Rw.matches,sc.matchesProperty=Rw.matchesProperty,sc.memoize=$w.memoize,sc.merge=Tw.merge,sc.mergeWith=Tw.mergeWith,sc.method=Rw.method,sc.methodOf=Rw.methodOf,sc.mixin=Jw,sc.negate=$g,sc.nthArg=Rw.nthArg,sc.omit=Tw.omit,sc.omitBy=Tw.omitBy,sc.once=$w.once,sc.orderBy=_w.orderBy,sc.over=Rw.over,sc.overArgs=$w.overArgs,sc.overEvery=Rw.overEvery,sc.overSome=Rw.overSome,sc.partial=$w.partial,sc.partialRight=$w.partialRight,sc.partition=_w.partition,sc.pick=Tw.pick,sc.pickBy=Tw.pickBy,sc.property=Rw.property,sc.propertyOf=Rw.propertyOf,sc.pull=Sw.pull,sc.pullAll=Sw.pullAll,sc.pullAllBy=Sw.pullAllBy,sc.pullAllWith=Sw.pullAllWith,sc.pullAt=Sw.pullAt,sc.range=Rw.range,sc.rangeRight=Rw.rangeRight,sc.rearg=$w.rearg,sc.reject=_w.reject,sc.remove=Sw.remove,sc.rest=$w.rest,sc.reverse=Sw.reverse,sc.sampleSize=_w.sampleSize,sc.set=Tw.set,sc.setWith=Tw.setWith,sc.shuffle=_w.shuffle,sc.slice=Sw.slice,sc.sortBy=_w.sortBy,sc.sortedUniq=Sw.sortedUniq,sc.sortedUniqBy=Sw.sortedUniqBy,sc.split=Iw.split,sc.spread=$w.spread,sc.tail=Sw.tail,sc.take=Sw.take,sc.takeRight=Sw.takeRight,sc.takeRightWhile=Sw.takeRightWhile,sc.takeWhile=Sw.takeWhile,sc.tap=Nw.tap,sc.throttle=$w.throttle,sc.thru=wk,sc.toArray=Ow.toArray,sc.toPairs=Tw.toPairs,sc.toPairsIn=Tw.toPairsIn,sc.toPath=Rw.toPath,sc.toPlainObject=Ow.toPlainObject,sc.transform=Tw.transform,sc.unary=$w.unary,sc.union=Sw.union,sc.unionBy=Sw.unionBy,sc.unionWith=Sw.unionWith,sc.uniq=Sw.uniq,sc.uniqBy=Sw.uniqBy,sc.uniqWith=Sw.uniqWith,sc.unset=Tw.unset,sc.unzip=Sw.unzip,sc.unzipWith=Sw.unzipWith,sc.update=Tw.update,sc.updateWith=Tw.updateWith,sc.values=Tw.values,sc.valuesIn=Tw.valuesIn,sc.without=Sw.without,sc.words=Iw.words,sc.wrap=$w.wrap,sc.xor=Sw.xor,sc.xorBy=Sw.xorBy,sc.xorWith=Sw.xorWith,sc.zip=Sw.zip,sc.zipObject=Sw.zipObject,sc.zipObjectDeep=Sw.zipObjectDeep,sc.zipWith=Sw.zipWith,sc.entries=Tw.toPairs,sc.entriesIn=Tw.toPairsIn,sc.extend=Tw.assignIn,sc.extendWith=Tw.assignInWith,Jw(sc,sc),sc.add=Ew.add,sc.attempt=Rw.attempt,sc.camelCase=Iw.camelCase,sc.capitalize=Iw.capitalize,sc.ceil=Ew.ceil,sc.clamp=Pw,sc.clone=Ow.clone,sc.cloneDeep=Ow.cloneDeep,sc.cloneDeepWith=Ow.cloneDeepWith,sc.cloneWith=Ow.cloneWith,sc.conformsTo=Ow.conformsTo,sc.deburr=Iw.deburr,sc.defaultTo=Rw.defaultTo,sc.divide=Ew.divide,sc.endsWith=Iw.endsWith,sc.eq=Ow.eq,sc.escape=Iw.escape,sc.escapeRegExp=Iw.escapeRegExp,sc.every=_w.every,sc.find=_w.find,sc.findIndex=Sw.findIndex,sc.findKey=Tw.findKey,sc.findLast=_w.findLast,sc.findLastIndex=Sw.findLastIndex,sc.findLastKey=Tw.findLastKey,sc.floor=Ew.floor,sc.forEach=_w.forEach,sc.forEachRight=_w.forEachRight,sc.forIn=Tw.forIn,sc.forInRight=Tw.forInRight,sc.forOwn=Tw.forOwn,sc.forOwnRight=Tw.forOwnRight,sc.get=Tw.get,sc.gt=Ow.gt,sc.gte=Ow.gte,sc.has=Tw.has,sc.hasIn=Tw.hasIn,sc.head=Sw.head,sc.identity=xu,sc.includes=_w.includes,sc.indexOf=Sw.indexOf,sc.inRange=Mw,sc.invoke=Tw.invoke,sc.isArguments=Ow.isArguments,sc.isArray=iu,sc.isArrayBuffer=Ow.isArrayBuffer,sc.isArrayLike=Ow.isArrayLike,sc.isArrayLikeObject=Ow.isArrayLikeObject,sc.isBoolean=Ow.isBoolean,sc.isBuffer=Ow.isBuffer,sc.isDate=Ow.isDate,sc.isElement=Ow.isElement,sc.isEmpty=Ow.isEmpty,sc.isEqual=Ow.isEqual,sc.isEqualWith=Ow.isEqualWith,sc.isError=Ow.isError,sc.isFinite=Ow.isFinite,sc.isFunction=Ow.isFunction,sc.isInteger=Ow.isInteger,sc.isLength=Ow.isLength,sc.isMap=Ow.isMap,sc.isMatch=Ow.isMatch,sc.isMatchWith=Ow.isMatchWith,sc.isNaN=Ow.isNaN,sc.isNative=Ow.isNative,sc.isNil=Ow.isNil,sc.isNull=Ow.isNull,sc.isNumber=Ow.isNumber,sc.isObject=vu,sc.isObjectLike=Ow.isObjectLike,sc.isPlainObject=Ow.isPlainObject,sc.isRegExp=Ow.isRegExp,sc.isSafeInteger=Ow.isSafeInteger,sc.isSet=Ow.isSet,sc.isString=Ow.isString,sc.isSymbol=Ow.isSymbol,sc.isTypedArray=Ow.isTypedArray,sc.isUndefined=Ow.isUndefined,sc.isWeakMap=Ow.isWeakMap,sc.isWeakSet=Ow.isWeakSet,sc.join=Sw.join,sc.kebabCase=Iw.kebabCase,sc.last=Ov,sc.lastIndexOf=Sw.lastIndexOf,sc.lowerCase=Iw.lowerCase,sc.lowerFirst=Iw.lowerFirst,sc.lt=Ow.lt,sc.lte=Ow.lte,sc.max=Ew.max,sc.maxBy=Ew.maxBy,sc.mean=Ew.mean,sc.meanBy=Ew.meanBy,sc.min=Ew.min,sc.minBy=Ew.minBy,sc.stubArray=Rw.stubArray,sc.stubFalse=Rw.stubFalse,sc.stubObject=Rw.stubObject,sc.stubString=Rw.stubString,sc.stubTrue=Rw.stubTrue,sc.multiply=Ew.multiply,sc.nth=Sw.nth,sc.noop=Rw.noop,sc.now=Cw,sc.pad=Iw.pad,sc.padEnd=Iw.padEnd,sc.padStart=Iw.padStart,sc.parseInt=Iw.parseInt,sc.random=Aw,sc.reduce=_w.reduce,sc.reduceRight=_w.reduceRight,sc.repeat=Iw.repeat,sc.replace=Iw.replace,sc.result=Tw.result,sc.round=Ew.round,sc.sample=_w.sample,sc.size=_w.size,sc.snakeCase=Iw.snakeCase,sc.some=_w.some,sc.sortedIndex=Sw.sortedIndex,sc.sortedIndexBy=Sw.sortedIndexBy,sc.sortedIndexOf=Sw.sortedIndexOf,sc.sortedLastIndex=Sw.sortedLastIndex,sc.sortedLastIndexBy=Sw.sortedLastIndexBy,sc.sortedLastIndexOf=Sw.sortedLastIndexOf,sc.startCase=Iw.startCase,sc.startsWith=Iw.startsWith,sc.subtract=Ew.subtract,sc.sum=Ew.sum,sc.sumBy=Ew.sumBy,sc.template=Iw.template,sc.times=Rw.times,sc.toFinite=Ow.toFinite,sc.toInteger=wu,sc.toLength=Ow.toLength,sc.toLower=Iw.toLower,sc.toNumber=Ow.toNumber,sc.toSafeInteger=Ow.toSafeInteger,sc.toString=Ow.toString,sc.toUpper=Iw.toUpper,sc.trim=Iw.trim,sc.trimEnd=Iw.trimEnd,sc.trimStart=Iw.trimStart,sc.truncate=Iw.truncate,sc.unescape=Iw.unescape,sc.uniqueId=Rw.uniqueId,sc.upperCase=Iw.upperCase,sc.upperFirst=Iw.upperFirst,sc.each=_w.forEach,sc.eachRight=_w.forEachRight,sc.first=Sw.head,Jw(sc,(Bw={},Qd(sc,(function(e,t){Fw.call(sc.prototype,t)||(Bw[t]=e)})),Bw),{chain:!1}),sc.VERSION="4.17.21",(sc.templateSettings=Iw.templateSettings).imports._=sc,bc(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){sc[e].placeholder=sc})),bc(["drop","take"],(function(e,t){Yu.prototype[e]=function(n){n=void 0===n?1:Ww(wu(n),0);var r=this.__filtered__&&!t?new Yu(this):this.clone();return r.__filtered__?r.__takeCount__=Hw(n,r.__takeCount__):r.__views__.push({size:Hw(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},Yu.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),bc(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Yu.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Fd(e),type:n}),t.__filtered__=t.__filtered__||r,t}})),bc(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Yu.prototype[e]=function(){return this[n](1).value()[0]}})),bc(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Yu.prototype[e]=function(){return this.__filtered__?new Yu(this):this[n](1)}})),Yu.prototype.compact=function(){return this.filter(xu)},Yu.prototype.find=function(e){return this.filter(e).head()},Yu.prototype.findLast=function(e){return this.reverse().find(e)},Yu.prototype.invokeMap=Hc((function(e,t){return"function"==typeof e?new Yu(this):this.map((function(n){return km(n,e,t)}))})),Yu.prototype.reject=function(e){return this.filter($g(Fd(e)))},Yu.prototype.slice=function(e,t){e=wu(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Yu(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=wu(t))<0?n.dropRight(-t):n.take(t-e)),n)},Yu.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Yu.prototype.toArray=function(){return this.take(4294967295)},Qd(Yu.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=sc[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(sc.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof Yu,u=a[0],c=s||iu(t),l=function(e){var t=i.apply(sc,tf([e],a));return r&&f?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(s=c=!1);var f=this.__chain__,h=!!this.__actions__.length,d=o&&!f,v=s&&!h;if(!o&&c){t=v?t:new Yu(this);var p=e.apply(t,a);return p.__actions__.push({func:wk,args:[l],thisArg:void 0}),new rc(p,f)}return d&&v?e.apply(this,a):(p=this.thru(l),d?r?p.value()[0]:p.value():p)})})),bc(["pop","push","shift","sort","splice","unshift"],(function(e){var t=qw[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);sc.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(iu(i)?i:[],e)}return this[n]((function(n){return t.apply(iu(n)?n:[],e)}))}})),Qd(Yu.prototype,(function(e,t){var n=sc[t];if(n){var r=n.name+"";Fw.call(ec,r)||(ec[r]=[]),ec[r].push({name:t,func:n})}})),ec[Tc(void 0,2).name]=[{name:"wrapper",func:void 0}],Yu.prototype.clone=function(){var e=new Yu(this.__wrapped__);return e.__actions__=ic(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ic(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ic(this.__views__),e},Yu.prototype.reverse=function(){if(this.__filtered__){var e=new Yu(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Yu.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=iu(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */;var Uw=Object.freeze({__proto__:null,add:cu,after:ju,ary:Dc,assign:_l,assignIn:El,assignInWith:Pl,assignWith:Ml,at:uf,attempt:gf,before:yf,bind:bf,bindAll:kf,bindKey:wf,camelCase:hh,capitalize:zf,castArray:dh,ceil:gh,chain:yh,chunk:wh,clamp:xh,clone:fd,cloneDeep:hd,cloneDeepWith:dd,cloneWith:vd,commit:pd,compact:md,concat:gd,cond:Vd,conforms:Hd,conformsTo:Jd,constant:pc,countBy:nv,create:rv,curry:iv,curryRight:ov,debounce:cv,deburr:Hf,defaultTo:lv,defaults:dv,defaultsDeep:wv,defer:xv,delay:Sv,difference:$v,differenceBy:Ev,differenceWith:Pv,divide:Mv,drop:Av,dropRight:Tv,dropRightWhile:Iv,dropWhile:Rv,each:Lv,eachRight:Vv,endsWith:Wv,entries:Jv,entriesIn:Uv,eq:zc,escape:Yv,escapeRegExp:ep,every:rp,extend:El,extendWith:Pl,fill:op,filter:sp,find:fp,findIndex:lp,findKey:dp,findLast:gp,findLastIndex:mp,findLastKey:yp,first:bp,flatMap:jp,flatMapDeep:xp,flatMapDepth:Sp,flatten:af,flattenDeep:_p,flattenDepth:Cp,flip:$p,floor:Op,flow:Pp,flowRight:Mp,forEach:Lv,forEachRight:Vv,forIn:Ap,forInRight:Tp,forOwn:Np,forOwnRight:Ip,fromPairs:Rp,functions:Lp,functionsIn:zp,get:Xl,groupBy:qp,gt:Wp,gte:Hp,has:Kp,hasIn:Ld,head:bp,identity:xu,inRange:Yp,includes:nm,indexOf:im,initial:om,intersection:cm,intersectionBy:lm,intersectionWith:fm,invert:vm,invertBy:ym,invoke:wm,invokeMap:jm,isArguments:rl,isArray:iu,isArrayBuffer:Sm,isArrayLike:Uc,isArrayLikeObject:pv,isBoolean:_m,isBuffer:ul,isDate:$m,isElement:Om,isEmpty:Pm,isEqual:Mm,isEqualWith:Am,isError:mf,isFinite:Nm,isFunction:Su,isInteger:Im,isLength:Jc,isMap:ad,isMatch:Rm,isMatchWith:Dm,isNaN:zm,isNative:qm,isNil:Fm,isNull:Vm,isNumber:Lm,isObject:vu,isObjectLike:eu,isPlainObject:pf,isRegExp:Hm,isSafeInteger:Jm,isSet:ud,isString:Zp,isSymbol:tu,isTypedArray:ml,isUndefined:Um,isWeakMap:Km,isWeakSet:Gm,iteratee:Qm,join:Zm,kebabCase:Xm,keyBy:eg,keys:xl,keysIn:Ol,last:Ov,lastIndexOf:rg,lodash:sc,lowerCase:ig,lowerFirst:og,lt:sg,lte:ug,map:wp,mapKeys:cg,mapValues:lg,matches:fg,matchesProperty:hg,max:vg,maxBy:pg,mean:yg,meanBy:bg,memoize:Hl,merge:kg,mergeWith:kv,method:wg,methodOf:jg,min:xg,minBy:Sg,mixin:_g,multiply:Cg,negate:$g,next:Pg,noop:Zu,now:av,nth:Ag,nthArg:Tg,omit:Rg,omitBy:Bg,once:qg,orderBy:Wg,over:Jg,overArgs:Gg,overEvery:Qg,overSome:Yg,pad:my,padEnd:gy,padStart:yy,parseInt:wy,partial:jy,partialRight:xy,partition:Sy,pick:_y,pickBy:zg,plant:Cy,property:qd,propertyOf:$y,pull:Ay,pullAll:My,pullAllBy:Ty,pullAllWith:Ny,pullAt:Dy,random:Wy,range:Ky,rangeRight:Gy,rearg:Qy,reduce:Zy,reduceRight:eb,reject:tb,remove:nb,repeat:rb,replace:ib,rest:ob,result:ab,reverse:ub,round:cb,sample:hb,sampleSize:mb,set:gb,setWith:yb,shuffle:wb,size:jb,slice:xb,snakeCase:Sb,some:Cb,sortBy:$b,sortedIndex:Ab,sortedIndexBy:Tb,sortedIndexOf:Nb,sortedLastIndex:Ib,sortedLastIndexBy:Rb,sortedLastIndexOf:Db,sortedUniq:zb,sortedUniqBy:Bb,split:qb,spread:Vb,startCase:Wb,startsWith:Hb,stubArray:Ah,stubFalse:il,stubObject:Jb,stubString:Ub,stubTrue:Kb,subtract:Gb,sum:Qb,sumBy:Yb,tail:Zb,take:Xb,takeRight:ek,takeRightWhile:tk,takeWhile:nk,tap:rk,template:bk,templateSettings:lk,throttle:kk,thru:wk,times:xk,toArray:Eg,toFinite:ku,toInteger:wu,toIterator:Sk,toJSON:Ck,toLength:ip,toLower:$k,toNumber:bu,toPairs:Jv,toPairsIn:Uv,toPath:Ok,toPlainObject:gv,toSafeInteger:Ek,toString:Gl,toUpper:Pk,transform:Mk,trim:Nk,trimEnd:Ik,trimStart:Dk,truncate:zk,unary:Bk,unescape:Wk,union:Uk,unionBy:Kk,unionWith:Gk,uniq:Qk,uniqBy:Yk,uniqWith:Zk,uniqueId:ew,unset:tw,unzip:rw,unzipWith:iw,update:aw,updateWith:sw,upperCase:uw,upperFirst:Lf,value:Ck,valueOf:Ck,values:em,valuesIn:cw,without:lw,words:ch,wrap:fw,wrapperAt:hw,wrapperChain:dw,wrapperCommit:pd,wrapperLodash:sc,wrapperNext:Pg,wrapperPlant:Cy,wrapperReverse:vw,wrapperToIterator:Sk,wrapperValue:Ck,xor:mw,xorBy:gw,xorWith:yw,zip:bw,zipObject:ww,zipObjectDeep:jw,zipWith:xw,default:sc}),Kw=[];function Gw(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={};if(!Array.isArray(e))throw new TypeError("Array expected");function r(e,i){(!Array.isArray(e)&&!Ts(e)||t&&i.length>0)&&(n[hs.exports.compileJSONPointer(i)]=!0),Ts(e)&&Object.keys(e).forEach((function(t){r(e[t],i.concat(t))}))}for(var i=Math.min(e.length,1e4),o=0;ot?e.slice(0,t):e}function Zw(e){return ji({},e)}function Xw(e){return Object.values(e)}function ej(e,t,n,r){var i=e.slice(0),o=i.splice(t,n);return i.splice.apply(i,[t+r,0].concat(Ti(o))),i}function tj(e,t){try{return t.parse(e)}catch(n){return t.parse(Es(e))}}function nj(e,t){try{return tj(e,t)}catch(e){return}}function rj(e,t){e=e.replace(oj,"");try{return t(e)}catch(e){}try{return t("["+e+"]")}catch(e){}try{return t("{"+e+"}")}catch(e){}throw new Error("Failed to parse partial JSON")}function ij(e){e=e.replace(oj,"");try{return Es(e)}catch(e){}try{var t=Es("["+e+"]");return t.substring(1,t.length-1)}catch(e){}try{var n=Es("{"+e+"}");return n.substring(1,n.length-1)}catch(e){}throw new Error("Failed to repair partial JSON")}var oj=/,\s*$/;function aj(e,t){var n=gj.exec(t);if(n){var r=Ps(n[2]),i=function(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]:e.length,i=0,o=n;ot}function fj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;if(uj(e))return e.text.length;var n=e.json,r=0;function i(e){if(Array.isArray(e)){if((r+=e.length-1+2)>t)return r;for(var n=0;nt)return r}}else if(Ts(e)){var o=Object.keys(e);r+=2+o.length+(o.length-1);for(var a=0;a0&&t.height>0})),l),c=l(n);function l(e){var t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2,rect:t,element:e}}function f(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.x-t.x,i=(e.y-t.y)*n;return Math.sqrt(r*r+i*i)}var h=function(e){return f(e,c)};if("Left"===r||"Right"===r){var d="Left"===r?u.filter((function(e){return t=c,e.rect.left+st.rect.right+s;var t})),v=Sg(d.filter((function(e){return t=e,n=c,Math.abs(t.y-n.y)t.y+s;var t})),m=Sg(p.filter((function(e){return o(e.element)})),h)||Sg(p,h);return null==m?void 0:m.element}}var Hj="undefined"!=typeof navigator&&navigator.platform.toUpperCase().indexOf("MAC")>=0;function Jj(e){var t=[];e.ctrlKey&&t.push("Ctrl"),e.metaKey&&t.push("Command"),e.altKey&&t.push(Hj?"Option":"Alt"),e.shiftKey&&t.push("Shift");var n=function(e){return Kj[e]||""}(e.which);return Uj[n]||t.push(n),t.join("+")}var Uj={Ctrl:!0,Command:!0,Alt:!0,Option:!0,Shift:!0},Kj={8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause_Break",20:"Caps_Lock",27:"Escape",33:"Page_Up",34:"Page_Down",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Left_Window_Key",92:"Right_Window_Key",93:"Select_Key",96:"Numpad_0",97:"Numpad_1",98:"Numpad_2",99:"Numpad_3",100:"Numpad_4",101:"Numpad_5",102:"Numpad_6",103:"Numpad_7",104:"Numpad_8",105:"Numpad_9",106:"Numpad_*",107:"Numpad_+",109:"Numpad_-",110:"Numpad_.",111:"Numpad_/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Num_Lock",145:"Scroll_Lock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Gj=xa.window;function Qj(e){co(e,"svelte-1r8q3m8",".jse-absolute-popup.svelte-1r8q3m8.svelte-1r8q3m8{position:relative;left:0;top:0;width:0;height:0;z-index:1001}.jse-absolute-popup.svelte-1r8q3m8 .jse-hidden-input.svelte-1r8q3m8{position:fixed;left:0;top:0;width:0;height:0;padding:0;margin:0;border:none;outline:none;overflow:hidden}.jse-absolute-popup.svelte-1r8q3m8 .jse-absolute-popup-content.svelte-1r8q3m8{position:absolute}")}function Yj(e){var t,n,r,i,o,a,s=[e[0].props],u=e[0].component;function c(e){for(var t={},n=0;nwindow.innerHeight&&d>o,g="left"===l||h+r>window.innerWidth&&h>r;return{left:g?p-c:h+c,top:m?d-s:v+s,positionAbove:m,positionLeft:g}}if("number"==typeof t.left&&"number"==typeof t.top){var y=t.left,b=t.top,k=t.width,w=void 0===k?0:k,j=t.height,x=void 0===j?0:j;return{left:y,top:b,positionAbove:b+x>window.innerHeight&&b>x,positionLeft:y+w>window.innerWidth&&y>w}}throw new Error('Invalid config: pass either "left" and "top", or pass "anchor"')}(),i=r.left,o=r.top,a=r.positionAbove,s=r.positionLeft;return(a?"bottom: ".concat(n.top-o,"px;"):"top: ".concat(o-n.top,"px;"))+(s?"right: ".concat(n.left-i,"px;"):"left: ".concat(i-n.left,"px;"))}function tx(e,t,n){var r,i,o=t.popup,a=t.closeAbsolutePopup;function s(e){o.options&&o.options.closeOnOuterClick&&!Ij(e.target,(function(e){return e===r}))&&a(o.id)}return Ko((function(){i&&i.focus()})),e.$$set=function(e){"popup"in e&&n(0,o=e.popup),"closeAbsolutePopup"in e&&n(6,a=e.closeAbsolutePopup)},[o,r,i,function(e){s(e)},function(e){"Escape"===Jj(e)&&a(o.id)},function(e){s(e)},a,function(e){ea[e?"unshift":"push"]((function(){n(2,i=e)}))},function(e){ea[e?"unshift":"push"]((function(){n(1,r=e)}))}]}var nx=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,tx,Zj,Ui,{popup:0,closeAbsolutePopup:6},Qj),r}return Li(n)}();function rx(e,t,n){var r=e.slice();return r[6]=t[n],r}function ix(e){var t,n;return t=new nx({props:{popup:e[6],closeAbsolutePopup:e[1]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};1&n&&(r.popup=e[6]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function ox(e){for(var t,n,r=e[0],i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:1e3;if(e<.9*t)return e.toFixed()+" B";var n=e/t;if(n<.9*t)return n.toFixed(1)+" KB";var r=n/t;if(r<.9*t)return r.toFixed(1)+" MB";var i=r/t;if(i<.9*t)return i.toFixed(1)+" GB";var o=i/t;return o.toFixed(1)+" TB"}var Bx=La("jsoneditor:FocusTracker");function qx(e){var t,n=e.onMount,r=e.onDestroy,i=e.getWindow,o=e.hasFocus,a=e.onFocus,s=e.onBlur,u=!1;function c(){var e=o();e&&(clearTimeout(t),u||(Bx("focus"),a(),u=e))}function l(){u&&(clearTimeout(t),t=setTimeout((function(){Bx("blur"),u=!1,s()})))}n((function(){Bx("mount FocusTracker");var e=i();e&&(e.addEventListener("focusin",c,!0),e.addEventListener("focusout",l,!0))})),r((function(){Bx("destroy FocusTracker");var e=i();e&&(e.removeEventListener("focusin",c,!0),e.removeEventListener("focusout",l,!0))}))}function Fx(e){for(var t,n,r=[{id:n="path-"+e[0]},e[1]],i={},o=0;o0;){var r=t.match(_S);if(!r)throw new SyntaxError('Cannot parse path: unexpected part "'.concat(t,'" at position ').concat(e.length-t.length));n.push(r[1]||r[2]||r[3]),t=t.substring(r[0].length)}return n}var _S=new RegExp(["^\\.([A-zA-Z$_][a-zA-Z$_0-9]*)","^\\[([0-9]+)]","^\\['(.*)']"].join("|"));function CS(e){return{value:e,label:Pm(e)?"(whole item)":xS(wS(e))}}function $S(e){return e.map((function(e){return ES.test(e)?"?.[".concat(e,"]"):OS.test(e)?"?.".concat(e):"?.[".concat(JSON.stringify(e),"]")})).join("")}var OS=/^[a-zA-Z$_][a-zA-Z$_\d]*$/,ES=/^\d+$/;function PS(e){co(e,"svelte-1oe8e8r",".jse-validation-errors-overview.svelte-1oe8e8r.svelte-1oe8e8r{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);background:var(--jse-message-warning-background);color:var(--jse-message-warning-color);overflow:auto;max-height:25%}.jse-validation-errors-overview.svelte-1oe8e8r table.svelte-1oe8e8r{border-collapse:collapse;width:100%}.jse-validation-errors-overview.svelte-1oe8e8r table tr.svelte-1oe8e8r{cursor:pointer}.jse-validation-errors-overview.svelte-1oe8e8r table tr.svelte-1oe8e8r:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.svelte-1oe8e8r{padding:4px var(--jse-padding);vertical-align:middle}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-icon.svelte-1oe8e8r{width:36px;box-sizing:border-box}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-action.svelte-1oe8e8r{width:36px;box-sizing:border-box;padding:0}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-action button.jse-validation-errors-collapse.svelte-1oe8e8r{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;width:36px;height:26px;cursor:pointer}.jse-validation-errors-overview.svelte-1oe8e8r table tr td.jse-validation-error-action button.jse-validation-errors-collapse.svelte-1oe8e8r:hover{background-color:rgba(255, 255, 255, 0.2)}.jse-validation-errors-overview.svelte-1oe8e8r table tr td div.jse-validation-errors-expand.svelte-1oe8e8r{display:inline-block;position:relative;top:3px}")}function MS(e,t,n){var r=e.slice();return r[6]=t[n],r[8]=n,r}function AS(e){var t,n,r,i,o=[NS,TS],a=[];function s(e,t){return e[2]||1===e[0].length?0:1}return n=s(e),r=a[n]=o[n](e),{c:function(){t=go("div"),r.c(),So(t,"class","jse-validation-errors-overview svelte-1oe8e8r")},m:function(e,r){vo(e,t,r),a[n].m(t,null),i=!0},p:function(e,i){var u=n;(n=s(e))===u?a[n].p(e,i):(ga(),ka(a[u],1,1,(function(){a[u]=null})),ya(),(r=a[n])?r.p(e,i):(r=a[n]=o[n](e)).c(),ba(r,1),r.m(t,null))},i:function(e){i||(ba(r),i=!0)},o:function(e){ka(r),i=!1},d:function(e){e&&po(t),a[n].d()}}}function TS(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p=e[0].length+"";return o=new hS({props:{data:Lx}}),f=new hS({props:{data:px}}),{c:function(){t=go("table"),n=go("tbody"),r=go("tr"),i=go("td"),Pa(o.$$.fragment),a=ko(),s=go("td"),u=bo(p),c=bo(" validation errors\n "),l=go("div"),Pa(f.$$.fragment),So(i,"class","jse-validation-error-icon svelte-1oe8e8r"),So(l,"class","jse-validation-errors-expand svelte-1oe8e8r"),So(s,"class","svelte-1oe8e8r"),So(r,"class","jse-validation-error svelte-1oe8e8r"),So(t,"class","svelte-1oe8e8r")},m:function(p,m){vo(p,t,m),uo(t,n),uo(n,r),uo(r,i),Ma(o,i,null),uo(r,a),uo(r,s),uo(s,u),uo(s,c),uo(s,l),Ma(f,l,null),h=!0,d||(v=jo(r,"click",e[4]),d=!0)},p:function(e,t){(!h||1&t)&&p!==(p=e[0].length+"")&&Eo(u,p)},i:function(e){h||(ba(o.$$.fragment,e),ba(f.$$.fragment,e),h=!0)},o:function(e){ka(o.$$.fragment,e),ka(f.$$.fragment,e),h=!1},d:function(e){e&&po(t),Aa(o),Aa(f),d=!1,v()}}}function NS(e){for(var t,n,r,i=e[0],o=[],a=0;a1&&IS(e);function b(){return e[5](e[6])}return{c:function(){t=go("tr"),n=go("td"),Pa(r.$$.fragment),i=ko(),o=go("td"),a=bo(m),s=ko(),u=go("td"),c=bo(g),l=ko(),f=go("td"),y&&y.c(),h=ko(),So(n,"class","jse-validation-error-icon svelte-1oe8e8r"),So(o,"class","svelte-1oe8e8r"),So(u,"class","svelte-1oe8e8r"),So(f,"class","jse-validation-error-action svelte-1oe8e8r"),So(t,"class","jse-validation-error svelte-1oe8e8r")},m:function(e,m){vo(e,t,m),uo(t,n),Ma(r,n,null),uo(t,i),uo(t,o),uo(o,a),uo(t,s),uo(t,u),uo(u,c),uo(t,l),uo(t,f),y&&y.m(f,null),uo(t,h),d=!0,v||(p=jo(t,"click",b),v=!0)},p:function(t,n){e=t,(!d||1&n)&&m!==(m=xS(wS(e[6].path))+"")&&Eo(a,m),(!d||1&n)&&g!==(g=e[6].message+"")&&Eo(c,g),0===e[8]&&e[0].length>1?y?(y.p(e,n),1&n&&ba(y,1)):((y=IS(e)).c(),ba(y,1),y.m(f,null)):y&&(ga(),ka(y,1,1,(function(){y=null})),ya())},i:function(e){d||(ba(r.$$.fragment,e),ba(y),d=!0)},o:function(e){ka(r.$$.fragment,e),ka(y),d=!1},d:function(e){e&&po(t),Aa(r),y&&y.d(),v=!1,p()}}}function DS(e){var t,n,r=!Pm(e[0]),i=r&&AS(e);return{c:function(){i&&i.c(),t=wo()},m:function(e,r){i&&i.m(e,r),vo(e,t,r),n=!0},p:function(e,n){var o=ki(n,1)[0];1&o&&(r=!Pm(e[0])),r?i?(i.p(e,o),1&o&&ba(i,1)):((i=AS(e)).c(),ba(i,1),i.m(t.parentNode,t)):i&&(ga(),ka(i,1,1,(function(){i=null})),ya())},i:function(e){n||(ba(i),n=!0)},o:function(e){ka(i),n=!1},d:function(e){i&&i.d(e),e&&po(t)}}}function LS(e,t,n){var r=t.validationErrors,i=t.selectError,o=!0;return e.$$set=function(e){"validationErrors"in e&&n(0,r=e.validationErrors),"selectError"in e&&n(1,i=e.selectError)},[r,i,o,function(){n(2,o=!1)},function(){n(2,o=!0)},function(e){setTimeout((function(){return i(e)}))}]}var zS=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,LS,DS,Ki,{validationErrors:0,selectError:1},PS),r}return Li(n)}(),BS={prefix:"fas",iconName:"jsoneditor-expand",icon:[512,512,[],null,"M 0,448 V 512 h 512 v -64 z M 0,0 V 64 H 512 V 0 Z M 256,96 128,224 h 256 z M 256,416 384,288 H 128 Z"]},qS={prefix:"fas",iconName:"jsoneditor-collapse",icon:[512,512,[],null,"m 0,224 v 64 h 512 v -64 z M 256,192 384,64 H 128 Z M 256,320 128,448 h 256 z"]},FS={prefix:"fas",iconName:"jsoneditor-format",icon:[512,512,[],null,"M 0,32 v 64 h 416 v -64 z M 160,160 v 64 h 352 v -64 z M 160,288 v 64 h 288 v -64 z M 0,416 v 64 h 320 v -64 z"]},VS={prefix:"fas",iconName:"jsoneditor-compact",icon:[512,512,[],null,"M 0,32 v 64 h 512 v -64 z M 0,160 v 64 h 512 v -64 z M 0,288 v 64 h 352 v -64 z"]};function WS(e){co(e,"svelte-v4jelk",".jse-menu.svelte-v4jelk.svelte-v4jelk{background:var(--jse-theme-color);border-bottom:1px solid var(--jse-theme-color);color:var(--jse-menu-color);display:flex;flex-wrap:wrap;align-items:center;position:relative}.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk{width:var(--jse-menu-button-size);height:var(--jse-menu-button-size);border:none;background:transparent;color:inherit;cursor:pointer;padding:calc(0.5 * var(--jse-padding));margin:0;border-radius:0}.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk:hover,.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk:focus{background:var(--jse-theme-color-highlight)}.jse-menu.svelte-v4jelk .jse-button.svelte-v4jelk:disabled{color:var(--jse-menu-color);opacity:0.5;background:transparent}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk{border:1px solid var(--jse-menu-color);padding:0;margin:calc(0.5 * var(--jse-padding)) 0;height:calc(var(--jse-menu-button-size) - var(--jse-padding));width:40px}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk:not(.jse-last){border-right:none}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.jse-first.svelte-v4jelk{margin-left:calc(0.5 * var(--jse-padding))}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.jse-last.svelte-v4jelk{margin-right:calc(0.5 * var(--jse-padding))}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk:hover,.jse-menu.svelte-v4jelk .jse-button.jse-group-button.svelte-v4jelk:focus{background:var(--jse-theme-color-highlight)}.jse-menu.svelte-v4jelk .jse-button.jse-group-button.jse-selected.svelte-v4jelk{background:var(--jse-menu-color);color:var(--jse-theme-color)}.jse-menu.svelte-v4jelk .jse-space.svelte-v4jelk{flex:1}.jse-menu.svelte-v4jelk .jse-separator.svelte-v4jelk{background:var(--jse-menu-color);opacity:0.3;box-sizing:border-box;width:1px;height:calc(var(--jse-menu-button-size) - 6px);margin:3px}")}var HS=function(e){return{}},JS=function(e){return{}};function US(e,t,n){var r=e.slice();return r[3]=t[n],r}var KS=function(e){return{}},GS=function(e){return{}};function QS(e){var t,n,r,i,o,a,s,u,c=e[3].icon&&XS(e),l=e[3].text&&e_(e);return{c:function(){t=go("button"),c&&c.c(),n=ko(),l&&l.c(),So(t,"type","button"),So(t,"class",r="jse-button "+e[3].className+" svelte-v4jelk"),So(t,"title",i=e[3].title),t.disabled=o=e[3].disabled||!1},m:function(r,i){vo(r,t,i),c&&c.m(t,null),uo(t,n),l&&l.m(t,null),a=!0,s||(u=jo(t,"click",(function(){Ji(e[3].onClick)&&e[3].onClick.apply(this,arguments)})),s=!0)},p:function(s,u){(e=s)[3].icon?c?(c.p(e,u),1&u&&ba(c,1)):((c=XS(e)).c(),ba(c,1),c.m(t,n)):c&&(ga(),ka(c,1,1,(function(){c=null})),ya()),e[3].text?l?l.p(e,u):((l=e_(e)).c(),l.m(t,null)):l&&(l.d(1),l=null),(!a||1&u&&r!==(r="jse-button "+e[3].className+" svelte-v4jelk"))&&So(t,"class",r),(!a||1&u&&i!==(i=e[3].title))&&So(t,"title",i),(!a||1&u&&o!==(o=e[3].disabled||!1))&&(t.disabled=o)},i:function(e){a||(ba(c),a=!0)},o:function(e){ka(c),a=!1},d:function(e){e&&po(t),c&&c.d(),l&&l.d(),s=!1,u()}}}function YS(e){var t;return{c:function(){So(t=go("div"),"class","jse-space svelte-v4jelk")},m:function(e,n){vo(e,t,n)},p:Bi,i:Bi,o:Bi,d:function(e){e&&po(t)}}}function ZS(e){var t;return{c:function(){So(t=go("div"),"class","jse-separator svelte-v4jelk")},m:function(e,n){vo(e,t,n)},p:Bi,i:Bi,o:Bi,d:function(e){e&&po(t)}}}function XS(e){var t,n;return t=new hS({props:{data:e[3].icon}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};1&n&&(r.data=e[3].icon),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function e_(e){var t,n=e[3].text+"";return{c:function(){t=bo(n)},m:function(e,n){vo(e,t,n)},p:function(e,r){1&r&&n!==(n=e[3].text+"")&&Eo(t,n)},d:function(e){e&&po(t)}}}function t_(e){var t,n,r,i,o=[ZS,YS,QS],a=[];function s(e,t){return!0===e[3].separator?0:!0===e[3].space?1:2}return t=s(e),n=a[t]=o[t](e),{c:function(){n.c(),r=wo()},m:function(e,n){a[t].m(e,n),vo(e,r,n),i=!0},p:function(e,i){var u=t;(t=s(e))===u?a[t].p(e,i):(ga(),ka(a[u],1,1,(function(){a[u]=null})),ya(),(n=a[t])?n.p(e,i):(n=a[t]=o[t](e)).c(),ba(n,1),n.m(r.parentNode,r))},i:function(e){i||(ba(n),i=!0)},o:function(e){ka(n),i=!1},d:function(e){a[t].d(e),e&&po(r)}}}function n_(e){for(var t,n,r,i,o=e[2].left,a=Gi(o,e,e[1],GS),s=e[0],u=[],c=0;cthis.length)throw new RangeError("Invalid position ".concat(e," in document of length ").concat(this.length));return this.lineInner(e,!1,1,0)}},{key:"line",value:function(e){if(e<1||e>this.lines)throw new RangeError("Invalid line number ".concat(e," in ").concat(this.lines,"-line document"));return this.lineInner(e,!0,1,0)}},{key:"replace",value:function(e,t,n){var r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),l_.from(r,this.length-(t-e)+n.length)}},{key:"append",value:function(e){return this.replace(this.length,this.length,e)}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=[];return this.decompose(e,t,n,0),l_.from(n,t-e)}},{key:"eq",value:function(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;for(var t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new v_(this),i=new v_(e),o=t,a=t;;){if(r.next(o),i.next(o),o=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new v_(this,e)}},{key:"iterRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return new p_(this,e,t)}},{key:"iterLines",value:function(e,t){var n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);var r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new m_(n)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var e=[];return this.flatten(e),e}}],[{key:"of",value:function(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new c_(t):l_.from(c_.split(t,[])):e.empty}}]),e}(),c_=function(e){Ci(n,u_);var t=Oi(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f_(e);return Ri(this,n),(r=t.call(this)).text=e,r.length=i,r}return Li(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.text[i],a=r+o.length;if((t?n:a)>=e)return new g_(r,a,n,o);r=a+1,n++}}},{key:"decompose",value:function(e,t,r,i){var o=e<=0&&t>=this.length?this:new n(d_(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){var a=r.pop(),s=h_(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new n(s,a.length+o.length));else{var u=s.length>>1;r.push(new n(s.slice(0,u)),new n(s.slice(u)))}}else r.push(o)}},{key:"replace",value:function(e,t,r){if(!(r instanceof n))return Si(Ai(n.prototype),"replace",this).call(this,e,t,r);var i=h_(this.text,h_(r.text,d_(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new n(i,o):l_.from(n.split(i,[]),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;i<=t&&oe&&o&&(r+=n),ei&&(r+=a.slice(Math.max(0,e-i),t-i)),i=s+1}return r}},{key:"flatten",value:function(e){var t,n=bi(this.text);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(e){n.e(e)}finally{n.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(e,t){var r,i=[],o=-1,a=bi(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;i.push(s),o+=s.length+1,32==i.length&&(t.push(new n(i,o)),i=[],o=-1)}}catch(e){a.e(e)}finally{a.f()}return o>-1&&t.push(new n(i,o)),t}}]),n}(),l_=function(e){Ci(n,u_);var t=Oi(n);function n(e,r){var i;Ri(this,n),(i=t.call(this)).children=e,i.length=r,i.lines=0;var o,a=bi(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;i.lines+=s.lines}}catch(e){a.e(e)}finally{a.f()}return i}return Li(n,[{key:"lineInner",value:function(e,t,n,r){for(var i=0;;i++){var o=this.children[i],a=r+o.length,s=n+o.lines-1;if((t?s:a)>=e)return o.lineInner(e,t,n,r);r=a+1,n=s+1}}},{key:"decompose",value:function(e,t,n,r){for(var i=0,o=0;o<=t&&i=o){var u=r&((o<=e?1:0)|(s>=t?2:0));o>=e&&s<=t&&!u?n.push(a):a.decompose(e-o,t-o,n,u)}o=s+1}}},{key:"replace",value:function(e,t,r){if(r.lines=o&&t<=s){var u=a.replace(e-o,t-o,r),c=this.lines-a.lines+u.lines;if(u.lines>4&&u.lines>c>>6){var l=this.children.slice();return l[i]=u,new n(l,this.length-(t-e)+r.length)}return Si(Ai(n.prototype),"replace",this).call(this,o,s,u)}o=s+1}return Si(Ai(n.prototype),"replace",this).call(this,e,t,r)}},{key:"sliceString",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"\n",r="",i=0,o=0;ie&&i&&(r+=n),eo&&(r+=a.sliceString(e-o,t-o,n)),o=s+1}return r}},{key:"flatten",value:function(e){var t,n=bi(this.children);try{for(n.s();!(t=n.n()).done;){t.value.flatten(e)}}catch(e){n.e(e)}finally{n.f()}}},{key:"scanIdentical",value:function(e,t){if(!(e instanceof n))return 0;for(var r=0,i=ki(t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1],4),o=i[0],a=i[1],s=i[2],u=i[3];;o+=t,a+=t){if(o==s||a==u)return r;var c=this.children[o],l=e.children[a];if(c!=l)return r+c.scanIdentical(l,t);r+=c.length+1}}}],[{key:"from",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.reduce((function(e,t){return e+t.length+1}),-1),i=0,o=bi(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;i+=a.lines}}catch(e){o.e(e)}finally{o.f()}if(i<32){var s,u=[],c=bi(e);try{for(c.s();!(s=c.n()).done;){var l=s.value;l.flatten(u)}}catch(e){c.e(e)}finally{c.f()}return new c_(u,r)}var f=Math.max(32,i>>5),h=f<<1,d=f>>1,v=[],p=0,m=-1,g=[];function y(e){var t;if(e.lines>h&&e instanceof n){var r,i=bi(e.children);try{for(i.s();!(r=i.n()).done;){y(r.value)}}catch(e){i.e(e)}finally{i.f()}}else e.lines>d&&(p>d||!p)?(b(),v.push(e)):e instanceof c_&&p&&(t=g[g.length-1])instanceof c_&&e.lines+t.lines<=32?(p+=e.lines,m+=e.length+1,g[g.length-1]=new c_(t.text.concat(e.text),t.length+1+e.length)):(p+e.lines>f&&b(),p+=e.lines,m+=e.length+1,g.push(e))}function b(){0!=p&&(v.push(1==g.length?g[0]:n.from(g,m)),m=-1,p=g.length=0)}var k,w=bi(e);try{for(w.s();!(k=w.n()).done;){var j=k.value;y(j)}}catch(e){w.e(e)}finally{w.f()}return b(),1==v.length?v[0]:new n(v,r)}}]),n}();function f_(e){var t,n=-1,r=bi(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.length+1}}catch(e){r.e(e)}finally{r.f()}return n}function h_(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&&(u>r&&(s=s.slice(0,r-i)),i1&&void 0!==arguments[1]?arguments[1]:1;Ri(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof c_?t.text.length:t.children.length)<<1]}return Li(e,[{key:"nextInner",value:function(e,t){for(this.done=this.lineBreak=!1;;){var n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,a=r instanceof c_?r.text.length:r.children.length;if(o==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof c_){var s=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,s.length>Math.max(0,e))return this.value=0==e?s:t>0?s.slice(e):s.slice(0,s.length-e),this;e-=s.length}else{var u=r.children[o+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof c_?u.text.length:u.children.length)<<1))}}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}]),e}(),p_=function(){function e(t,n,r){Ri(this,e),this.value="",this.done=!1,this.cursor=new v_(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return Li(e,[{key:"nextInner",value:function(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);var n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;var r=this.cursor.next(e).value;return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&""!=this.value}}]),e}(),m_=function(){function e(t){Ri(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return Li(e,[{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.inner.next(e),n=t.done,r=t.lineBreak,i=t.value;return n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();"undefined"!=typeof Symbol&&(u_.prototype[Symbol.iterator]=function(){return this.iter()},v_.prototype[Symbol.iterator]=p_.prototype[Symbol.iterator]=m_.prototype[Symbol.iterator]=function(){return this});for(var g_=function(){function e(t,n,r,i){Ri(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return Li(e,[{key:"length",get:function(){return this.to-this.from}}]),e}(),y_="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((function(e){return e?parseInt(e,36):1})),b_=1;b_e)return y_[t-1]<=e;return!1}function w_(e){return e>=127462&&e<=127487}function j_(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return(n?x_:S_)(e,t,r)}function x_(e,t,n){if(t==e.length)return t;t&&__(e.charCodeAt(t))&&C_(e.charCodeAt(t-1))&&t--;var r=$_(e,t);for(t+=E_(r);t=0&&w_($_(e,a));)o++,a-=2;if(o%2==0)break;t+=2}}return t}function S_(e,t,n){for(;t>0;){var r=x_(e,t-2,n);if(r=56320&&e<57344}function C_(e){return e>=55296&&e<56320}function $_(e,t){var n=e.charCodeAt(t);if(!C_(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return __(r)?r-56320+(n-55296<<10)+65536:n}function O_(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function E_(e){return e<65536?1:2}var P_=/\r\n?|\n/,M_=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(M_||(M_={})),A_=function(){function e(t){Ri(this,e),this.sections=t}return Li(e,[{key:"length",get:function(){for(var e=0,t=0;t1&&void 0!==arguments[1]&&arguments[1];R_(this,e,t)}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:D_(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]:M_.Simple,r=0,i=0,o=0;oe)return i+(e-r);i+=a}else{if(n!=M_.Simple&&u>=e&&(n==M_.TrackDel&&re||n==M_.TrackBefore&&re))return null;if(u>e||u==e&&t<0&&!a)return e==r||t<0?i:i+s;i+=s}r=u}if(e>r)throw new RangeError("Position ".concat(e," is out of range for changeset of length ").concat(r));return i}},{key:"touchesRange",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=0,r=0;n=0&&r<=t&&a>=e)return!(rt)||"cover";r=a}return!1}},{key:"toString",value:function(){for(var e="",t=0;t=0?":"+r:"")}return e}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(t){if(!Array.isArray(t)||t.length%2||t.some((function(e){return"number"!=typeof e})))throw new RangeError("Invalid JSON representation of ChangeDesc");return new e(t)}},{key:"create",value:function(t){return new e(t)}}]),e}(),T_=function(e){Ci(n,A_);var t=Oi(n);function n(e,r){var i;return Ri(this,n),(i=t.call(this,e)).inserted=r,i}return Li(n,[{key:"apply",value:function(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return R_(this,(function(t,n,r,i,o){return e=e.replace(r,r+(n-t),o)}),!1),e}},{key:"mapDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return D_(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 u=i>>1;r.length1&&void 0!==arguments[1]&&arguments[1];return e.empty?this:D_(this,e,t,!0)}},{key:"iterChanges",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];R_(this,e,t)}},{key:"desc",get:function(){return A_.create(this.sections)}},{key:"filter",value:function(e){var t=[],r=[],i=[],o=new z_(this);e:for(var a=0,s=0;;){for(var u=a==e.length?1e9:e[a++];s0&&I_(r,t,o.text),o.forward(c),s+=c}for(var f=e[a++];s>1].toJSON()))}return e}}],[{key:"of",value:function(e,t,r){var i=[],o=[],a=0,s=null;function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||i.length){av||h<0||v>t)throw new RangeError("Invalid change range ".concat(h," to ").concat(v," (in doc of length ").concat(t,")"));var m=p?"string"==typeof p?u_.of(p.split(r||P_)):p:u_.empty,g=m.length;if(h==v&&0==g)return;ha&&N_(i,h-a,-1),N_(i,v-h,g),I_(o,i,m),a=v}}(e),u(!s),s}},{key:"empty",value:function(e){return new n(e?[e,-1]:[],[])}},{key:"fromJSON",value:function(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");for(var t=[],r=[],i=0;i3&&void 0!==arguments[3]&&arguments[3];if(!(0==t&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function I_(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++],u=e.sections[a++];t(i,c,o,l,f),i=c,o=l}}}function D_(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],o=r?[]:null,a=new z_(e),s=new z_(t),u=-1;;)if(-1==a.ins&&-1==s.ins){var c=Math.min(a.len,s.len);N_(i,c,-1),a.forward(c),s.forward(c)}else if(s.ins>=0&&(a.ins<0||u==a.i||0==a.off&&(s.len=0&&u=0)){if(a.done&&s.done)return o?T_.createSet(i,o):A_.create(i);throw new Error("Mismatched change set lengths")}for(var h=0,d=a.len;d;)if(-1==s.ins){var v=Math.min(d,s.len);h+=v,d-=v,s.forward(v)}else{if(!(0==s.ins&&s.len2&&void 0!==arguments[2]&&arguments[2],r=[],i=n?[]:null,o=new z_(e),a=new z_(t),s=!1;;){if(o.done&&a.done)return i?T_.createSet(r,i):A_.create(r);if(0==o.ins)N_(r,o.len,0,s),o.next();else if(0!=a.len||a.done){if(o.done||a.done)throw new Error("Mismatched change set lengths");var u=Math.min(o.len2,a.len),c=r.length;if(-1==o.ins){var l=-1==a.ins?-1:a.off?0:a.ins;N_(r,u,l,s),i&&l&&I_(i,r,a.text)}else-1==a.ins?(N_(r,o.off?0:o.len,u,s),i&&I_(i,r,o.textBit(u))):(N_(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&I_(i,r,a.text));s=(o.ins>u||a.ins>=0&&a.len>u)&&(s||r.length>c),o.forward2(u),a.forward(u)}else N_(r,0,a.ins,s),i&&I_(i,r,a.text),a.next()}}var z_=function(){function e(t){Ri(this,e),this.set=t,this.i=0,this.next()}return Li(e,[{key:"next",value:function(){var e=this.set.sections;this.i>1;return t>=e.length?u_.empty:e[t]}},{key:"textBit",value:function(e){var t=this.set.inserted,n=this.i-2>>1;return n>=t.length&&!e?u_.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}},{key:"forward",value:function(e){e==this.len?this.next():(this.len-=e,this.off+=e)}},{key:"forward2",value:function(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}]),e}(),B_=function(){function e(t,n,r){Ri(this,e),this.from=t,this.to=n,this.flags=r}return Li(e,[{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var e=3&this.flags;return 3==e?null:e}},{key:"goalColumn",get:function(){var e=this.flags>>5;return 33554431==e?void 0:e}},{key:"map",value:function(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return this.empty?n=r=t.mapPos(this.from,i):(n=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),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 q_.range(e,t);var n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q_.range(this.anchor,n)}},{key:"eq",value:function(e){return this.anchor==e.anchor&&this.head==e.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return q_.range(e.anchor,e.head)}},{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}(),q_=function(){function e(t,n){Ri(this,e),this.ranges=t,this.mainIndex=n}return Li(e,[{key:"map",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t.empty?this:e.create(this.ranges.map((function(e){return e.map(t,n)})),this.mainIndex)}},{key:"eq",value:function(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(var t=0;t1&&void 0!==arguments[1])||arguments[1];return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map((function(e){return e.toJSON()})),main:this.mainIndex}}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map((function(e){return B_.fromJSON(e)})),t.main)}},{key:"single",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return B_.create(e,e,(0==t?0:t<0?4:8)|(null==n?3:Math.min(2,n))|(null!=r?r:33554431)<<5)}},{key:"range",value:function(e,t,n){var r=(null!=n?n:33554431)<<5;return te?4:0))}},{key:"normalized",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t[n];t.sort((function(e,t){return e.from-t.from})),n=t.indexOf(r);for(var i=1;io.head?e.range(u,s):e.range(s,u))}}return new e(t,n)}}]),e}();function F_(e,t){var n,r=bi(e.ranges);try{for(r.s();!(n=r.n()).done;){if(n.value.to>t)throw new RangeError("Selection points outside of document")}}catch(e){r.e(e)}finally{r.f()}}var V_=0,W_=function(){function e(t,n,r,i,o){Ri(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=V_++,this.default=t([]),this.extensions="function"==typeof o?o(this):o}return Li(e,[{key:"of",value:function(e){return new J_([],this,0,e)}},{key:"compute",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new J_(e,this,1,t)}},{key:"computeN",value:function(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new J_(e,this,2,t)}},{key:"from",value:function(e,t){return t||(t=function(e){return e}),this.compute([e],(function(n){return t(n.field(e))}))}}],[{key:"define",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t.combine||function(e){return e},t.compareInput||function(e,t){return e===t},t.compare||(t.combine?function(e,t){return e===t}:H_),!!t.static,t.enables)}}]),e}();function H_(e,t){return e==t||e.length==t.length&&e.every((function(e,n){return e===t[n]}))}var J_=function(){function e(t,n,r,i){Ri(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=V_++}return Li(e,[{key:"dynamicSlot",value:function(e){var t,n,r=this,i=this.value,o=this.facet.compareInput,a=this.id,s=e[a]>>1,u=2==this.type,c=!1,l=!1,f=[],h=bi(this.dependencies);try{for(h.s();!(n=h.n()).done;){var d=n.value;"doc"==d?c=!0:"selection"==d?l=!0:0==(1&(null!==(t=e[d.id])&&void 0!==t?t:1))&&f.push(e[d.id])}}catch(e){h.e(e)}finally{h.f()}return{create:function(e){return e.values[s]=i(e),1},update:function(e,t){if(c&&t.docChanged||l&&(t.docChanged||t.selection)||K_(e,f)){var n=i(e);if(u?!U_(n,e.values[s],o):!o(n,e.values[s]))return e.values[s]=n,1}return 0},reconfigure:function(e,t){var n=i(e),c=t.config.address[a];if(null!=c){var l=uC(t,c);if(r.dependencies.every((function(n){return n instanceof W_?t.facet(n)===e.facet(n):!(n instanceof Q_)||t.field(n,!1)==e.field(n,!1)}))||(u?U_(n,l,o):o(n,l)))return e.values[s]=l,0}return e.values[s]=n,1}}}}]),e}();function U_(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return{create:function(e){return e.values[n]=t.create(e),1},update:function(e,r){var i=e.values[n],o=t.updateF(i,r);return t.compareF(i,o)?0:(e.values[n]=o,1)},reconfigure:function(e,r){return null!=r.config.address[t.id]?(e.values[n]=r.field(t),0):(e.values[n]=t.create(e),1)}}}},{key:"init",value:function(e){return[this,G_.of({field:this,create:e})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e(V_++,t.create,t.update,t.compare||function(e,t){return e===t},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),Y_=4,Z_=3,X_=2,eC=1;function tC(e){return function(t){return new rC(t,e)}}var nC={highest:tC(0),high:tC(eC),default:tC(X_),low:tC(Z_),lowest:tC(Y_)},rC=Li((function e(t,n){Ri(this,e),this.inner=t,this.prec=n})),iC=function(){function e(){Ri(this,e)}return Li(e,[{key:"of",value:function(e){return new oC(this,e)}},{key:"reconfigure",value:function(t){return e.reconfigure.of({compartment:this,extension:t})}},{key:"get",value:function(e){return e.config.compartments.get(this)}}]),e}(),oC=Li((function e(t,n){Ri(this,e),this.compartment=t,this.inner=n})),aC=function(){function e(t,n,r,i,o,a){for(Ri(this,e),this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t,n,r){var i,o=[],a=Object.create(null),s=new Map,u=bi(function(e,t,n){var r=[[],[],[],[],[]],i=new Map;function o(e,a){var s=i.get(e);if(null!=s){if(s<=a)return;var u=r[s].indexOf(e);u>-1&&r[s].splice(u,1),e instanceof oC&&n.delete(e.compartment)}if(i.set(e,a),Array.isArray(e)){var c,l=bi(e);try{for(l.s();!(c=l.n()).done;){o(c.value,a)}}catch(e){l.e(e)}finally{l.f()}}else if(e instanceof oC){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");var f=t.get(e.compartment)||e.inner;n.set(e.compartment,f),o(f,a)}else if(e instanceof rC)o(e.inner,e.prec);else if(e instanceof Q_)r[a].push(e),e.provides&&o(e.provides,a);else if(e instanceof J_)r[a].push(e),e.facet.extensions&&o(e.facet.extensions,X_);else{var h=e.extension;if(!h)throw new Error("Unrecognized extension value in extension set (".concat(e,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));o(h,a)}}return o(e,X_),r.reduce((function(e,t){return e.concat(t)}))}(t,n,s));try{for(u.s();!(i=u.n()).done;){var c=i.value;c instanceof Q_?o.push(c):(a[c.facet.id]||(a[c.facet.id]=[])).push(c)}}catch(e){u.e(e)}finally{u.f()}for(var l=Object.create(null),f=[],h=[],d=function(){var e=p[v];l[e.id]=h.length<<1,h.push((function(t){return e.slot(t)}))},v=0,p=o;v>1;function s(e){for(var n=[],o=0;o>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.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function uC(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var cC=W_.define(),lC=W_.define({combine:function(e){return e.some((function(e){return e}))},static:!0}),fC=W_.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),hC=W_.define(),dC=W_.define(),vC=W_.define(),pC=W_.define({combine:function(e){return!!e.length&&e[0]}}),mC=function(){function e(t,n){Ri(this,e),this.type=t,this.value=n}return Li(e,null,[{key:"define",value:function(){return new gC}}]),e}(),gC=function(){function e(){Ri(this,e)}return Li(e,[{key:"of",value:function(e){return new mC(this,e)}}]),e}(),yC=function(){function e(t){Ri(this,e),this.map=t}return Li(e,[{key:"of",value:function(e){return new bC(this,e)}}]),e}(),bC=function(){function e(t,n){Ri(this,e),this.type=t,this.value=n}return Li(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 yC(e.map||function(e){return e})}},{key:"mapEffects",value:function(e,t){if(!e.length)return e;var n,r=[],i=bi(e);try{for(i.s();!(n=i.n()).done;){var o=n.value.map(t);o&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r}}]),e}();bC.reconfigure=bC.define(),bC.appendConfig=bC.define();var kC=function(){function e(t,n,r,i,o,a){Ri(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&F_(r,n.newLength),o.some((function(t){return t.type==e.time}))||(this.annotations=o.concat(e.time.of(Date.now())))}return Li(e,[{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"annotation",value:function(e){var t,n=bi(this.annotations);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.type==e)return r.value}}catch(e){n.e(e)}finally{n.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(t){var n=this.annotation(e.userEvent);return!(!n||!(n==t||n.length>t.length&&n.slice(0,t.length)==t&&"."==n[t.length]))}}],[{key:"create",value:function(t,n,r,i,o,a){return new e(t,n,r,i,o,a)}}]),e}();function wC(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;i--){var o=n[i](e);o&&Object.keys(o).length&&(r=jC(r,xC(t,o,e.changes.newLength),!0))}return r==e?e:kC.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){var t,n=e.startState,r=!0,i=bi(n.facet(hC));try{for(i.s();!(t=i.n()).done;){var o=(0,t.value)(e);if(!1===o){r=!1;break}Array.isArray(o)&&(r=!0===r?o:wC(r,o))}}catch(e){i.e(e)}finally{i.f()}if(!0!==r){var a,s;if(!1===r)s=e.changes.invertedDesc,a=T_.empty(n.doc.length);else{var u=e.changes.filter(r);a=u.changes,s=u.filtered.mapDesc(u.changes).invertedDesc}e=kC.create(n,a,e.selection&&e.selection.map(s),bC.mapEffects(e.effects,s),e.annotations,e.scrollIntoView)}for(var c=n.facet(dC),l=c.length-1;l>=0;l--){var f=c[l](e);e=f instanceof kC?f:Array.isArray(f)&&1==f.length&&f[0]instanceof kC?f[0]:SC(n,CC(f),!1)}return e}(a):a)}kC.time=mC.define(),kC.userEvent=mC.define(),kC.addToHistory=mC.define(),kC.remote=mC.define();var _C=[];function CC(e){return null==e?_C:Array.isArray(e)?e:[e]}var $C,OC=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(OC||(OC={})),EC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{$C=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Uw){}function PC(e){return function(t){if(!/\S/.test(t))return OC.Space;if(function(e){if($C)return $C.test(e);for(var t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||EC.test(n)))return!0}return!1}(t))return OC.Word;for(var n=0;n-1)return OC.Word;return OC.Other}}var MC=function(){function e(t,n,r,i,o,a){Ri(this,e),this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(var s=0;s1&&void 0!==arguments[1])||arguments[1],n=this.config.address[e.id];if(null!=n)return sC(this,n),uC(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 T_?t:T_.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return u_.of(t.split(this.facet(e.lineSeparator)||P_))}},{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:(sC(this,t),uC(this,t))}},{key:"toJSON",value:function(e){var t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(var n in e){var r=e[n];r instanceof Q_&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}},{key:"tabSize",get:function(){return this.facet(e.tabSize)}},{key:"lineBreak",get:function(){return this.facet(e.lineSeparator)||"\n"}},{key:"readOnly",get:function(){return this.facet(pC)}},{key:"phrase",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;ir.length?e:r[n-1]}))),t}},{key:"languageDataAt",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=bi(this.facet(cC));try{for(o.s();!(n=o.n()).done;){var a,s=n.value,u=bi(s(this,t,r));try{for(u.s();!(a=u.n()).done;){var c=a.value;Object.prototype.hasOwnProperty.call(c,e)&&i.push(c[e])}}catch(e){u.e(e)}finally{u.f()}}}catch(e){o.e(e)}finally{o.f()}return i}},{key:"charCategorizer",value:function(e){return PC(this.languageDataAt("wordChars",e).join(""))}},{key:"wordAt",value:function(e){for(var t=this.doc.lineAt(e),n=t.text,r=t.from,i=t.length,o=this.charCategorizer(e),a=e-r,s=e-r;a>0;){var u=j_(n,a,!1);if(o(n.slice(u,a))!=OC.Word)break;a=u}for(;s1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r)for(var o in r)Object.prototype.hasOwnProperty.call(t,o)&&function(){var e=r[o],n=t[o];i.push(e.init((function(t){return e.spec.fromJSON(n,t)})))}();return e.create({doc:t.doc,selection:q_.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=aC.resolve(t.extensions||[],new Map),r=t.doc instanceof u_?t.doc:u_.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||P_)),i=t.selection?t.selection instanceof q_?t.selection:q_.single(t.selection.anchor,t.selection.head):q_.single(0);return F_(i,r.length),n.staticFacet(lC)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map((function(){return null})),(function(e,t){return t.create(e)}),null)}}]),e}();function AC(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={},o=bi(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0,u=Object.keys(a);s1&&void 0!==arguments[1]?arguments[1]:e;return NC.create(e,t,this)}}]),e}();TC.prototype.startSide=TC.prototype.endSide=0,TC.prototype.point=!1,TC.prototype.mapMode=M_.TrackDel;var NC=function(){function e(t,n,r){Ri(this,e),this.from=t,this.to=n,this.value=r}return Li(e,null,[{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}();function IC(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var RC=function(){function e(t,n,r,i){Ri(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=i}return Li(e,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n?this.to:this.from,o=r,a=i.length;;){if(o==a)return o;var s=o+a>>1,u=i[s]-e||(n?this.value[s].endSide:this.value[s].startSide)-t;if(s==o)return u>=0?o:a;u>=0?a=s:o=s+1}}},{key:"between",value:function(e,t,n,r){for(var i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i(d=n.mapPos(f,c.endSide))||h==d&&c.startSide>0&&c.endSide<=0)continue;(d-h||c.endSide-c.startSide)<0||(a<0&&(a=h),c.point&&(s=Math.max(s,d-h)),r.push(c),i.push(h-a),o.push(d-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}}]),e}(),DC=function(){function e(t,n,r,i){Ri(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return Li(e,[{key:"length",get:function(){var e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}},{key:"size",get:function(){if(this.isEmpty)return 0;var e,t=this.nextLayer.size,n=bi(this.chunk);try{for(n.s();!(e=n.n()).done;){t+=e.value.value.length}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"chunkEnd",value:function(e){return this.chunkPos[e]+this.chunk[e].length}},{key:"update",value:function(t){var n=t.add,r=void 0===n?[]:n,i=t.sort,o=void 0!==i&&i,a=t.filterFrom,s=void 0===a?0:a,u=t.filterTo,c=void 0===u?this.length:u,l=t.filter;if(0==r.length&&!l)return this;if(o&&(r=r.slice().sort(IC)),this.isEmpty)return r.length?e.of(r):this;for(var f=new qC(this,null,-1).goto(0),h=0,d=[],v=new zC;f.value||h=0){var p=r[h++];v.addInner(p.from,p.to,p.value)||d.push(p)}else 1==f.rangeIndex&&f.chunkIndexthis.chunkEnd(f.chunkIndex)||cf.to||c=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}},{key:"iter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return FC.from([this]).goto(e)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{key:"create",value:function(t,n,r,i){return new e(t,n,r,i)}},{key:"iter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return FC.from(e).goto(t)}},{key:"compare",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=e.filter((function(e){return e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i})),a=t.filter((function(e){return e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i})),s=BC(o,a,n),u=new WC(o,s,i),c=new WC(a,s,i);n.iterGaps((function(e,t,n){return HC(u,e,c,t,n,r)})),n.empty&&0==n.length&&HC(u,0,c,0,0,r)}},{key:"eq",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;null==r&&(r=1e9);var i=e.filter((function(e){return!e.isEmpty&&t.indexOf(e)<0})),o=t.filter((function(t){return!t.isEmpty&&e.indexOf(t)<0}));if(i.length!=o.length)return!1;if(!i.length)return!0;for(var a=BC(i,o),s=new WC(i,a,0).goto(n),u=new WC(o,a,0).goto(n);;){if(s.to!=u.to||!JC(s.active,u.active)||s.point&&(!u.point||!s.point.eq(u.point)))return!1;if(s.to>r)return!0;s.next(),u.next()}}},{key:"spans",value:function(e,t,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=new WC(e,null,i).goto(t),a=t,s=o.openStart;;){var u=Math.min(o.to,n);if(o.point?(r.point(a,u,o.point,o.activeForPoint(o.to),s,o.pointRank),s=o.openEnd(u)+(o.to>u?1:0)):u>a&&(r.span(a,u,o.active,s),s=o.openEnd(u)),o.to>n)break;a=o.to,o.next()}return s}},{key:"of",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new zC,i=bi(e instanceof NC?[e]:n?LC(e):e);try{for(i.s();!(t=i.n()).done;){var o=t.value;r.add(o.from,o.to,o.value)}}catch(e){i.e(e)}finally{i.f()}return r.finish()}}]),e}();function LC(e){if(e.length>1)for(var t=e[0],n=1;n0)return e.slice().sort(IC);t=r}return e}DC.empty=new DC([],[],null,-1),DC.empty.nextLayer=DC.empty;var zC=function(){function e(){Ri(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return Li(e,[{key:"finishChunk",value:function(e){this.chunks.push(new RC(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(DC.empty)}},{key:"finishInner",value:function(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;var t=DC.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}]),e}();function BC(e,t,n){var r,i=new Map,o=bi(e);try{for(o.s();!(r=o.n()).done;)for(var a=r.value,s=0;s3&&void 0!==arguments[3]?arguments[3]:0;Ri(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}return Li(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}},{key:"gotoInner",value:function(e,t,n){for(;this.chunkIndex=this.minPoint)break}}},{key:"setRangeIndex",value:function(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex1&&void 0!==arguments[1]?arguments[1]:-1e9,r=bi(this.heap);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.goto(e,n)}}catch(e){r.e(e)}finally{r.f()}for(var o=this.heap.length>>1;o>=0;o--)VC(this.heap,o);return this.next(),this}},{key:"forward",value:function(e,t){var n,r=bi(this.heap);try{for(r.s();!(n=r.n()).done;){n.value.forward(e,t)}}catch(e){r.e(e)}finally{r.f()}for(var i=this.heap.length>>1;i>=0;i--)VC(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}},{key:"next",value:function(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),VC(this.heap,0)}}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=[],o=0;o=r&&i.push(new qC(a,n,r,o));return 1==i.length?i[0]:new e(i)}}]),e}();function VC(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 WC=function(){function e(t,n,r){Ri(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=FC.from(t,n,r)}return Li(e,[{key:"goto",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1e9;return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}},{key:"forward",value:function(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}},{key:"removeActive",value:function(e){UC(this.active,e),UC(this.activeTo,e),UC(this.activeRank,e),this.minActive=GC(this.active,this.activeTo)}},{key:"addActive",value:function(e){for(var t=0,n=this.cursor,r=n.value,i=n.to,o=n.rank;t-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&UC(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var o=this.cursor.value;if(o.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&r++,this.cursor.next()}}if(n){for(var a=0;a=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}},{key:"openEnd",value:function(e){for(var t=0,n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}]),e}();function HC(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,u=r-t;;){var c=e.to+u-n.to||e.endSide-n.endSide,l=c<0?e.to+u:n.to,f=Math.min(l,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&JC(e.activeForPoint(e.to+u),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!JC(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),l>a)break;s=l,c<=0&&e.next(),c>=0&&n.next()}}function JC(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 GC(e,t){for(var n=-1,r=1e9,i=0;i2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0;i=t)return i;if(i==e.length)break;o+=9==e.charCodeAt(i)?n-o%n:1,i=j_(e,i)}return!0===r?-1:e.length}var ZC="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),XC="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),e$="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},t$=function(){function e(t,n){Ri(this,e),this.rules=[];var r=(n||{}).finish;function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function o(e,t,n,a){var s=[],u=/^@(\w+)\b/.exec(e[0]),c=u&&"keyframes"==u[1];if(u&&null==t)return n.push(e[0]+";");for(var l in t){var f=t[l];if(/&/.test(l))o(l.split(/,\s*/).map((function(t){return e.map((function(e){return t.replace(/&/,e)}))})).reduce((function(e,t){return e.concat(t)})),f,n);else if(f&&"object"==zi(f)){if(!u)throw new RangeError("The value of a property ("+l+") should be a primitive value.");o(i(l),f,s,c)}else null!=f&&s.push(l.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+f+";")}(s.length||c)&&n.push((!r||u||a?e:e.map(r)).join(", ")+" {"+s.join(" ")+"}")}for(var a in t)o(i(a),t[a],this.rules)}return Li(e,[{key:"getRules",value:function(){return this.rules.join("\n")}}],[{key:"newName",value:function(){var e=e$[ZC]||1;return e$[ZC]=e+1,"ͼ"+e.toString(36)}},{key:"mount",value:function(e,t){(e[XC]||new r$(e)).mount(Array.isArray(t)?t:[t])}}]),e}(),n$=null,r$=function(){function e(t){if(Ri(this,e),!t.head&&t.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(n$)return t.adoptedStyleSheets=[n$.sheet].concat(t.adoptedStyleSheets),t[XC]=n$;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),n$=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[XC]=this}return Li(e,[{key:"mount",value:function(e){for(var t=this.sheet,n=0,r=0,i=0;i-1&&(this.modules.splice(a,1),r--,a=-1),-1==a){if(this.modules.splice(r++,0,o),t)for(var s=0;s",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a$="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent);"undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent);for(var s$="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),u$="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c$=s$||a$&&+a$[1]<57,l$=0;l$<10;l$++)i$[48+l$]=i$[96+l$]=String(l$);for(l$=1;l$<=24;l$++)i$[l$+111]="F"+l$;for(l$=65;l$<=90;l$++)i$[l$]=String.fromCharCode(l$+32),o$[l$]=String.fromCharCode(l$);for(var f$ in i$)o$.hasOwnProperty(f$)||(o$[f$]=i$[f$]);function h$(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function d$(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function v$(e,t){if(!t.anchorNode)return!1;try{return d$(e,t.anchorNode)}catch(e){return!1}}function p$(e){return 3==e.nodeType?$$(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function m$(e,t,n,r){return!!n&&(y$(e,t,n,r,-1)||y$(e,t,n,r,1))}function g$(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function y$(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:b$(e))){if("DIV"==e.nodeName)return!1;var o=e.parentNode;if(!o||1!=o.nodeType)return!1;t=g$(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?b$(e):0}}}function b$(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var k$={left:0,right:0,top:0,bottom:0};function w$(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function j$(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var x$,S$=function(){function e(){Ri(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Li(e,[{key:"eq",value:function(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}},{key:"setRange",value:function(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}},{key:"set",value:function(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}]),e}(),_$=null;function C$(e){if(e.setActive)return e.setActive();if(_$)return e.focus(_$);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==_$?{get preventScroll(){return _$={preventScroll:!0},!0}}:void 0),!_$){_$=!1;for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=x$||(x$=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function O$(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,e.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,e.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function E$(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function P$(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}var M$=function(){function e(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Ri(this,e),this.node=t,this.offset=n,this.precise=r}return Li(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,g$(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,g$(t)+1,n)}}]),e}(),A$=[],T$=function(){function e(){Ri(this,e),this.parent=null,this.dom=null,this.dirty=2}return Li(e,[{key:"editorView",get:function(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}},{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"posBefore",value:function(e){var t,n=this.posAtStart,r=bi(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(e){r.e(e)}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,i=this.dom,o=null,a=bi(this.children);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(s.dirty){if(!s.dom&&(n=o?o.nextSibling:i.firstChild)){var u=e.get(n);(!u||!u.parent&&u.canReuseDOM(s))&&s.reuseDOM(n)}s.sync(t),s.dirty=0}if(n=o?o.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&n!=s.dom&&(t.written=!0),s.dom.parentNode==i)for(;n&&n!=s.dom;)n=N$(n);else i.insertBefore(s.dom,n);o=s.dom}}catch(e){a.e(e)}finally{a.f()}for((n=o?o.nextSibling:i.firstChild)&&t&&t.node==i&&(t.written=!0);n;)n=N$(n)}else if(1&this.dirty){var c,l=bi(this.children);try{for(l.s();!(c=l.n()).done;){var f=c.value;f.dirty&&(f.sync(t),f.dirty=0)}}catch(e){l.e(e)}finally{l.f()}}}},{key:"reuseDOM",value:function(e){}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=0==b$(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 u=this.children[a];if(u.dom==r)return s;s+=u.length+u.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,u=n,c=n;st)return l.domBoundsAround(e,t,u);if(f>=e&&-1==r&&(r=s,i=u),u>t&&l.dom.parentNode==this.dom){o=s,a=c;break}c=f,u=f+l.breakAfter}return{from:i,to:a<0?n+this.length:a,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}},{key:"markDirty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.dirty|=2,this.markParentsDirty(e)}},{key:"markParentsDirty",value:function(e){for(var t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}},{key:"setParent",value:function(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}},{key:"rootView",get:function(){for(var e=this;;){var t=e.parent;if(!t)return e;e=t}}},{key:"replaceChildren",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:A$;this.markDirty();for(var i=e;i0&&void 0!==arguments[0]?arguments[0]:this.length;return new I$(this.children,e,this.children.length)}},{key:"childPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.childCursor().findPos(e,t)}},{key:"toString",value:function(){var e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"isEditable",get:function(){return!0}},{key:"merge",value:function(e,t,n,r,i,o){return!1}},{key:"become",value:function(e){return!1}},{key:"canReuseDOM",value:function(e){return e.constructor==this.constructor}},{key:"getSide",value:function(){return 0}},{key:"destroy",value:function(){this.parent=null}}],[{key:"get",value:function(e){return e.cmView}}]),e}();function N$(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}T$.prototype.breakAfter=0;var I$=function(){function e(t,n,r){Ri(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return Li(e,[{key:"findPos",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;var n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}]),e}();function R$(e,t,n,r,i,o,a,s,u){var c=e.children,l=c.length?c[t]:null,f=o.length?o[o.length-1]:null,h=f?f.breakAfter:a;if(!(t==r&&l&&!a&&!h&&o.length<2&&l.merge(n,i,o.length?f:null,0==n,s,u))){if(r0&&(!a&&o.length&&l.merge(n,l.length,o[0],!1,s,0)?l.breakAfter=o.shift().breakAfter:(n2),G$={mac:K$||/Mac/.test(L$.platform),windows:/Win/.test(L$.platform),linux:/Linux|X11/.test(L$.platform),ie:V$,ie_version:q$?z$.documentMode||6:F$?+F$[1]:B$?+B$[1]:0,gecko:W$,gecko_version:W$?+(/Firefox\/(\d+)/.exec(L$.userAgent)||[0,0])[1]:0,chrome:!!H$,chrome_version:H$?+H$[1]:0,ios:K$,android:/Android\b/.test(L$.userAgent),webkit:J$,safari:U$,webkit_version:J$?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=z$.documentElement.style.tabSize?"tab-size":"-moz-tab-size"},Q$=function(e){Ci(n,T$);var t=Oi(n);function n(e){var r;return Ri(this,n),(r=t.call(this)).text=e,r}return Li(n,[{key:"length",get:function(){return this.text.length}},{key:"createDOM",value:function(e){this.setDOM(e||document.createTextNode(this.text))}},{key:"sync",value:function(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(e){3==e.nodeType&&this.createDOM(e)}},{key:"merge",value:function(e,t,r){return(!r||r instanceof n&&!(this.length-(t-e)+r.length>256))&&(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}},{key:"split",value:function(e){var t=new n(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}},{key:"localPosFromDOM",value:function(e,t){return e==this.dom?t:t?this.text.length:0}},{key:"domAtPos",value:function(e){return new M$(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 Z$(this.dom,e,t)}}]),n}(),Y$=function(e){Ci(n,T$);var t=Oi(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Ri(this,n),(r=t.call(this)).mark=e,r.children=i,r.length=o;var a,s=bi(i);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.setParent(Pi(r))}}catch(e){s.e(e)}finally{s.f()}return r}return Li(n,[{key:"setAttrs",value:function(e){if(P$(e),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]);return e}},{key:"reuseDOM",value:function(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}},{key:"sync",value:function(e){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),Si(Ai(n.prototype),"sync",this).call(this,e)}},{key:"merge",value:function(e,t,r,i,o,a){return(!r||!(!(r instanceof n&&r.mark.eq(this.mark))||e&&o<=0||te&&r.push(i=e&&(o=a),i=c,a++}}catch(e){s.e(e)}finally{s.f()}var l=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new n(this.mark,r,l)}},{key:"domAtPos",value:function(e){return iO(this,e)}},{key:"coordsAt",value:function(e,t){return aO(this,e,t)}}]),n}();function Z$(e,t,n){var r=e.nodeValue.length;t>r&&(t=r);var i=t,o=t,a=0;0==t&&n<0||t==r&&n>=0?G$.chrome||G$.gecko||(t?(i--,a=1):o=0)?0:s.length-1];return G$.safari&&!a&&0==u.width&&(u=Array.prototype.find.call(s,(function(e){return e.width}))||u),a?w$(u,a<0):u||null}var X$=function(e){Ci(n,T$);var t=Oi(n);function n(e,r,i){var o;return Ri(this,n),(o=t.call(this)).widget=e,o.length=r,o.side=i,o.prevWidget=null,o}return Li(n,[{key:"split",value:function(e){var t=n.create(this.widget,this.length-e,this.side);return this.length-=e,t}},{key:"sync",value:function(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t0?n.length-1:0;r=n[i],!(e>0?0==i:i==n.length-1||r.top0?-1:1);return w$(r,this.side>0)}},{key:"isEditable",get:function(){return!1}},{key:"destroy",value:function(){Si(Ai(n.prototype),"destroy",this).call(this),this.dom&&this.widget.destroy(this.dom)}}],[{key:"create",value:function(e,t,r){return new(e.customView||n)(e,t,r)}}]),n}(),eO=function(e){Ci(n,X$);var t=Oi(n);function n(){return Ri(this,n),t.apply(this,arguments)}return Li(n,[{key:"domAtPos",value:function(e){var t=this.widget,n=t.topView,r=t.text;return n?tO(e,0,n,r,(function(e,t){return e.domAtPos(t)}),(function(e){return new M$(r,Math.min(e,r.nodeValue.length))})):new M$(r,Math.min(e,r.nodeValue.length))}},{key:"sync",value:function(){this.setDOM(this.widget.toDOM())}},{key:"localPosFromDOM",value:function(e,t){var n=this.widget,r=n.topView,i=n.text;return r?nO(e,t,r,i):Math.min(t,this.length)}},{key:"ignoreMutation",value:function(){return!1}},{key:"overrideDOMText",get:function(){return null}},{key:"coordsAt",value:function(e,t){var n=this.widget,r=n.topView,i=n.text;return r?tO(e,t,r,i,(function(e,t,n){return e.coordsAt(t,n)}),(function(e,t){return Z$(i,e,t)})):Z$(i,e,t)}},{key:"destroy",value:function(){var e;Si(Ai(n.prototype),"destroy",this).call(this),null===(e=this.widget.topView)||void 0===e||e.destroy()}},{key:"isEditable",get:function(){return!0}},{key:"canReuseDOM",value:function(){return!0}}]),n}();function tO(e,t,n,r,i,o){if(n instanceof Y$){for(var a=n.dom.firstChild;a;a=a.nextSibling){var s=T$.get(a);if(!s)return o(e,t);var u=d$(a,r),c=s.length+(u?r.nodeValue.length:0);if(e=0;)if(t<0?r>0:r0?-1:1);return n&&n.topt.top?{left:t.left,right:t.right,top:n.top,bottom:n.bottom}:t}},{key:"overrideDOMText",get:function(){return u_.empty}}]),n}();function iO(e,t){for(var n=e.dom,r=e.children,i=0,o=0;io&&t0;u--){var c=r[u-1];if(c.dom.parentNode==n)return c.domAtPos(c.length)}for(var l=i;l0&&t instanceof Y$&&i.length&&(r=i[i.length-1])instanceof Y$&&r.mark.eq(t.mark)?oO(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function aO(e,t,n){return e.children.length?(n<=0?sO:uO)(e,t):function(e){var t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();var n=p$(t);return n[n.length-1]||null}(e)}function sO(e,t){var n=null,r=-1;return function e(t,i){for(var o=0,a=0;o=i)if(s.children.length){if(e(s,i-a))return!0}else if(u>=i){if(u==i&&s.getSide()>0)return!0;n=s,r=i-a}a=u}}(e,t),n?n.coordsAt(Math.max(0,r),-1):uO(e,t)}function uO(e,t){var n=null,r=-1;return function e(t,i){for(var o=t.children.length-1,a=t.length;o>=0&&a>=i;o--){var s=t.children[o];if((a-=s.length)<=i)if(s.children.length){if(e(s,i-a))return!0}else if(a<=i){if(a==i&&s.getSide()<0)return!0;n=s,r=i-a}}}(e,t),n?n.coordsAt(Math.max(0,r),1):sO(e,t)}function cO(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 lO(e,t){if(e==t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0,o=n;i-1}}],[{key:"mark",value:function(e){return new pO(e)}},{key:"widget",value:function(e){var t=e.side||0,n=!!e.block;return new gO(e,t+=n?t>0?3e8:-4e8:t>0?1e8:-1e8,t,n,e.widget||null,!1)}},{key:"replace",value:function(e){var t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{var i=yO(e,r);t=(i.start?r?-3e8:-1:5e8)-1,n=1+(i.end?r?2e8:1:-6e8)}return new gO(e,t,n,r,e.widget||null,!0)}},{key:"line",value:function(e){return new mO(e)}},{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return DC.of(e,t)}}]),n}();vO.none=DC.empty;var pO=function(e){Ci(n,vO);var t=Oi(n);function n(e){var r;Ri(this,n);var i=yO(e),o=i.start,a=i.end;return(r=t.call(this,o?-1:5e8,a?1:-6e8,null,e)).tagName=e.tagName||"span",r.class=e.class||"",r.attrs=e.attributes||null,r}return Li(n,[{key:"eq",value:function(e){return this==e||e instanceof n&&this.tagName==e.tagName&&this.class==e.class&&lO(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 Si(Ai(n.prototype),"range",this).call(this,e,t)}}]),n}();pO.prototype.point=!1;var mO=function(e){Ci(n,vO);var t=Oi(n);function n(e){return Ri(this,n),t.call(this,-2e8,-2e8,null,e)}return Li(n,[{key:"eq",value:function(e){return e instanceof n&&lO(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 Si(Ai(n.prototype),"range",this).call(this,e,t)}}]),n}();mO.prototype.mapMode=M_.TrackBefore,mO.prototype.point=!0;var gO=function(e){Ci(n,vO);var t=Oi(n);function n(e,r,i,o,a,s){var u;return Ri(this,n),(u=t.call(this,r,i,a,e)).block=o,u.isReplace=s,u.mapMode=o?r<=0?M_.TrackBefore:M_.TrackAfter:M_.TrackDel,u}return Li(n,[{key:"type",get:function(){return this.startSide=5}},{key:"eq",value:function(e){return e instanceof n&&(t=this.widget,r=e.widget,t==r||!!(t&&r&&t.compare(r)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,r}},{key:"range",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return Si(Ai(n.prototype),"range",this).call(this,e,t)}}]),n}();function yO(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.inclusiveStart,r=e.inclusiveEnd;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function bO(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}gO.prototype.point=!0;var kO=function(e){Ci(n,T$);var t=Oi(n);function n(){var e;return Ri(this,n),(e=t.apply(this,arguments)).children=[],e.length=0,e.prevAttrs=void 0,e.attrs=null,e.breakAfter=0,e}return Li(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),D$(this,e,t,r?r.children:[],o,a),!0}},{key:"split",value:function(e){var t=new n;if(t.breakAfter=this.breakAfter,0==this.length)return t;var r=this.childPos(e),i=r.i,o=r.off;o&&(t.append(this.children[i].split(o),0),this.children[i].merge(o,this.children[i].length,null,!1,0,0),i++);for(var a=i;a0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}},{key:"transferDOM",value:function(e){this.dom&&(this.markDirty(),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){lO(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}},{key:"append",value:function(e,t){oO(this,e,t)}},{key:"addLineDeco",value:function(e){var t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=cO(t,this.attrs||{})),n&&(this.attrs=cO({class:n},this.attrs||{}))}},{key:"domAtPos",value:function(e){return iO(this,e)}},{key:"reuseDOM",value:function(e){"DIV"==e.nodeName&&(this.setDOM(e),this.dirty|=6)}},{key:"sync",value:function(e){var t;this.dom?4&this.dirty&&(P$(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(fO(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),Si(Ai(n.prototype),"sync",this).call(this,e);for(var r=this.dom.lastChild;r&&T$.get(r)instanceof Y$;)r=r.lastChild;if(!(r&&this.length&&("BR"==r.nodeName||0!=(null===(t=T$.get(r))||void 0===t?void 0:t.isEditable)||G$.ios&&this.children.some((function(e){return e instanceof Q$}))))){var i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}},{key:"measureTextSize",value:function(){if(0==this.children.length||this.length>20)return null;var e,t=0,n=bi(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(!(r instanceof Q$)||/[^ -~]/.test(r.text))return null;var i=p$(r.dom);if(1!=i.length)return null;t+=i[0].width}}catch(e){n.e(e)}finally{n.f()}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length}:null}},{key:"coordsAt",value:function(e,t){return aO(this,e,t)}},{key:"become",value:function(e){return!1}},{key:"type",get:function(){return dO.Text}}],[{key:"find",value:function(e,t){for(var r=0,i=0;r=t){if(o instanceof n)return o;if(a>t)break}i=a+o.breakAfter}return null}}]),n}(),wO=function(e){Ci(n,T$);var t=Oi(n);function n(e,r,i){var o;return Ri(this,n),(o=t.call(this)).widget=e,o.length=r,o.type=i,o.breakAfter=0,o.prevWidget=null,o}return Li(n,[{key:"merge",value:function(e,t,r,i,o,a){return!(r&&(!(r instanceof n&&this.widget.compare(r.widget))||e>0&&o<=0||t0;){if(this.textOff==this.text.length){var r=this.cursor.next(this.skip),i=r.value,o=r.lineBreak,a=r.done;if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=i,this.textOff=0}var s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,n)),this.getLine().append(xO(new Q$(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}},{key:"span",value:function(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}},{key:"point",value:function(e,t,n,r,i,o){if(this.disallowBlockEffectsFor[o]&&n instanceof gO){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}var a=t-e;if(n instanceof gO)if(n.block){var s=n.type;s!=dO.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new wO(n.widget||new SO("div"),a,s))}else{var u=X$.create(n.widget||new SO("span"),a,a?0:n.startSide),c=this.atCursorPos&&!u.isEditable&&i<=r.length&&(e0),l=!u.isEditable&&(e1&&void 0!==arguments[1]?arguments[1]:"nearest",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"nearest",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;Ri(this,e),this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o}return Li(e,[{key:"map",value:function(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin)}}]),e}(),TO=bC.define({map:function(e,t){return e.map(t)}});function NO(e,t,n){var r=e.facet(OO);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}var IO=W_.define({combine:function(e){return!e.length||e[0]}}),RO=0,DO=W_.define(),LO=function(){function e(t,n,r,i){Ri(this,e),this.id=t,this.create=n,this.domEventHandlers=r,this.extension=i(this)}return Li(e,null,[{key:"define",value:function(t,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations;return new e(RO++,t,i,(function(e){var t=[DO.of(e)];return a&&t.push(FO.of((function(t){var n=t.plugin(e);return n?a(n):vO.none}))),o&&t.push(o(e)),t}))}},{key:"fromClass",value:function(t,n){return e.define((function(e){return new t(e)}),n)}}]),e}(),zO=function(){function e(t){Ri(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return Li(e,[{key:"update",value:function(e){if(this.value){if(this.mustUpdate){var t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(NO(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){NO(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}},{key:"destroy",value:function(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){NO(e.state,t,"CodeMirror plugin crashed")}}},{key:"deactivate",value:function(){this.spec=this.value=null}}]),e}(),BO=W_.define(),qO=W_.define(),FO=W_.define(),VO=W_.define(),WO=W_.define(),HO=W_.define(),JO=function(){function e(t,n,r,i){Ri(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return Li(e,[{key:"join",value:function(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}},{key:"addToSet",value:function(e){for(var t=e.length,n=this;t>0;t--){var r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAl)break;o+=2}if(!u)return r;new e(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),e}(),UO=function(){function e(t,n,r){Ri(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=T_.empty(this.startState.doc.length);var i,o=bi(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(e){o.e(e)}finally{o.f()}var s=[];this.changes.iterChangedRanges((function(e,t,n,r){return s.push(new JO(e,t,n,r))})),this.changedRanges=s;var u=t.hasFocus;u!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=u,this.flags|=1)}return Li(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"selectionSet",get:function(){return this.transactions.some((function(e){return e.selection}))}},{key:"empty",get:function(){return 0==this.flags&&0==this.transactions.length}}],[{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}(),KO=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(KO||(KO={})),GO=KO.LTR,QO=KO.RTL;function YO(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}(),lE=[];function fE(e){return[new cE(0,e,0)]}var hE="";function dE(e,t,n,r,i){var o,a=r.head-e.from,s=-1;if(0==a){if(!i||!e.length)return null;t[0].level!=n&&(a=t[0].side(!1,n),s=0)}else if(a==e.length){if(i)return null;var u=t[t.length-1];u.level!=n&&(a=u.side(!0,n),s=t.length-1)}s<0&&(s=cE.find(t,a,null!==(o=r.bidiLevel)&&void 0!==o?o:-1,r.assoc));var c=t[s];a==c.side(i,n)&&(a=(c=t[s+=i?1:-1]).side(!i,n));var l=i==(c.dir==n),f=j_(e.text,a,l);if(hE=e.text.slice(Math.min(a,f),Math.max(a,f)),f!=c.side(i,n))return q_.cursor(f+e.from,l?-1:1,c.level);var h=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return h||c.level==n?h&&h.level1){var l,f=bi(this.points);try{for(f.s();!(l=f.n()).done;){var h=l.value;h.node==e&&h.pos>this.text.length&&(h.pos-=u-1)}}catch(e){f.e(e)}finally{f.f()}}o=s+u}}},{key:"readNode",value:function(e){if(!e.cmIgnore){var t=T$.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(var r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}}},{key:"findPointBefore",value:function(e,t){var n,r=bi(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(e){r.e(e)}finally{r.f()}}},{key:"findPointInside",value:function(e,t){var n,r=bi(this.points);try{for(r.s();!(n=r.n()).done;){var i=n.value;(3==e.nodeType?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}catch(e){r.e(e)}finally{r.f()}}}]),e}();function pE(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var mE=Li((function e(t,n){Ri(this,e),this.node=t,this.offset=n,this.pos=-1})),gE=function(e){Ci(n,T$);var t=Oi(n);function n(e){var r;return Ri(this,n),(r=t.call(this)).view=e,r.compositionDeco=vO.none,r.decorations=[],r.dynamicDecorationMap=[],r.minWidth=0,r.minWidthFrom=0,r.minWidthTo=0,r.impreciseAnchor=null,r.impreciseHead=null,r.forceSelection=!1,r.lastUpdate=Date.now(),r.setDOM(e.contentDOM),r.children=[new kO],r.children[0].setParent(Pi(r)),r.updateDeco(),r.updateInner([new JO(0,0,0,e.state.doc.length)],0),r}return Li(n,[{key:"editorView",get:function(){return this.view}},{key:"length",get:function(){return this.view.state.doc.length}},{key:"update",value:function(e){var t=this,n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((function(e){var n=e.fromA;return e.toAt.minWidthTo}))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=vO.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){var n=kE(e);if(!n)return vO.none;var r=n.from,i=n.to,o=n.node,a=n.text,s=t.mapPos(r,1),u=Math.max(s,t.mapPos(i,-1)),c=e.state,l=3==o.nodeType?o.nodeValue:new vE([],c).readRange(o.firstChild,null).text;if(u-s=0?e[r]:null;if(!i)break;var o=i.fromA,a=i.toA,s=i.fromB,u=i.toB,c=jO.build(this.view.state.doc,s,u,this.decorations,this.dynamicDecorationMap),l=c.content,f=c.breakAtStart,h=c.openStart,d=c.openEnd,v=n.findPos(a,1),p=v.i,m=v.off,g=n.findPos(o,-1);R$(this,g.i,g.off,p,m,l,f,h,d)}}},{key:"updateSelection",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange(),n||this.mayControlSelection()){var r=this.forceSelection;this.forceSelection=!1;var i=this.view.state.selection.main,o=this.domAtPos(i.anchor),a=i.empty?o:this.domAtPos(i.head);if(G$.gecko&&i.empty&&yE(o)){var s=document.createTextNode("");this.view.observer.ignore((function(){return o.node.insertBefore(s,o.node.childNodes[o.offset]||null)})),o=a=new M$(s,0),r=!0}var u=this.view.observer.selectionRange;!r&&u.focusNode&&m$(o.node,o.offset,u.anchorNode,u.anchorOffset)&&m$(a.node,a.offset,u.focusNode,u.focusOffset)||(this.view.observer.ignore((function(){G$.android&&G$.chrome&&e.dom.contains(u.focusNode)&&_E(u.focusNode,e.dom)&&(e.dom.blur(),e.dom.focus({preventScroll:!0}));var t=h$(e.view.root);if(t)if(i.empty){if(G$.gecko){var n=xE(o.node,o.offset);if(n&&3!=n){var r=jE(o.node,o.offset,1==n?1:-1);r&&(o=new M$(r,1==n?0:r.nodeValue.length))}}t.collapse(o.node,o.offset),null!=i.bidiLevel&&null!=u.cursorBidiLevel&&(u.cursorBidiLevel=i.bidiLevel)}else if(t.extend){t.collapse(o.node,o.offset);try{t.extend(a.node,a.offset)}catch(e){}}else{var s=document.createRange();if(i.anchor>i.head){var c=[a,o];o=c[0],a=c[1]}s.setEnd(a.node,a.offset),s.setStart(o.node,o.offset),t.removeAllRanges(),t.addRange(s)}else;})),this.view.observer.setSelectionRange(o,a)),this.impreciseAnchor=o.precise?null:new M$(u.anchorNode,u.anchorOffset),this.impreciseHead=a.precise?null:new M$(u.focusNode,u.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.compositionDeco.size){var e=this.view.state.selection.main,t=h$(this.view.root);if(t&&e.empty&&e.assoc&&t.modify){var n=kO.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(){var e=this.view.root.activeElement;return e==this.dom||v$(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}},{key:"nearest",value:function(e){for(var t=e;t;){var n=T$.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}},{key:"posFromDOM",value:function(e,t){var n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}},{key:"domAtPos",value:function(e){for(var t=this.childCursor().findPos(e,-1),n=t.i,r=t.off;no||e==o&&i.type!=dO.WidgetBefore&&i.type!=dO.WidgetAfter&&(!r||2==t||this.children[r-1].breakAfter||this.children[r-1].type==dO.WidgetBefore&&t>-2))return i.coordsAt(e-o,t);n=o}}},{key:"measureVisibleLineHeights",value:function(e){for(var t=[],n=e.from,r=e.to,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,s=this.view.textDirection==KO.LTR,u=0,c=0;cr)break;if(u>=n){var h=l.dom.getBoundingClientRect();if(t.push(h.height),o){var d=l.dom.lastChild,v=d?p$(d):[];if(v.length){var p=v[v.length-1],m=s?p.right-h.left:h.right-p.left;m>a&&(a=m,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=f)}}}u=f+l.breakAfter}return t}},{key:"textDirectionAt",value:function(e){var t=this.childPos(e,1).i;return"rtl"==getComputedStyle(this.children[t].dom).direction?KO.RTL:KO.LTR}},{key:"measureTextSize",value:function(){var e,t=this,n=bi(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r instanceof kO){var i=r.measureTextSize();if(i)return i}}}catch(e){n.e(e)}finally{n.f()}var o,a,s=document.createElement("div");return s.className="cm-line",s.style.width="99999px",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((function(){t.dom.appendChild(s);var e=p$(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 I$(this.children,e,t)}},{key:"computeBlockGapDeco",value:function(){for(var e=[],t=this.view.viewState,n=0,r=0;;r++){var i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){var a=t.lineBlockAt(o).bottom-t.lineBlockAt(n).top;e.push(vO.replace({widget:new bE(a),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return vO.set(e)}},{key:"updateDeco",value:function(){for(var e=this,t=this.view.state.facet(FO).map((function(t,n){return(e.dynamicDecorationMap[n]="function"==typeof t)?t(e.view):t})),n=t.length;nr.anchor?-1:1);if(i){!r.empty&&(t=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,t.left),top:Math.min(i.top,t.top),right:Math.max(i.right,t.right),bottom:Math.max(i.bottom,t.bottom)});var o,a=0,s=0,u=0,c=0,l=bi(this.view.state.facet(WO).map((function(e){return e(n.view)})));try{for(l.s();!(o=l.n()).done;){var f=o.value;if(f){var h=f.left,d=f.right,v=f.top,p=f.bottom;null!=h&&(a=Math.max(a,h)),null!=d&&(s=Math.max(s,d)),null!=v&&(u=Math.max(u,v)),null!=p&&(c=Math.max(c,p))}}}catch(e){l.e(e)}finally{l.f()}var m={left:i.left-a,top:i.top-u,right:i.right+s,bottom:i.bottom+c};!function(e,t,n,r,i,o,a,s){for(var u=e.ownerDocument,c=u.defaultView||window,l=e;l;)if(1==l.nodeType){var f=void 0,h=l==u.body;if(h)f=j$(c);else{if(l.scrollHeight<=l.clientHeight&&l.scrollWidth<=l.clientWidth){l=l.assignedSlot||l.parentNode;continue}var d=l.getBoundingClientRect();f={left:d.left,right:d.left+l.clientWidth,top:d.top,bottom:d.top+l.clientHeight}}var v=0,p=0;if("nearest"==i)t.top0&&t.bottom>f.bottom+p&&(p=t.bottom-f.bottom+p+a)):t.bottom>f.bottom&&(p=t.bottom-f.bottom+a,n<0&&t.top-p0&&t.right>f.right+v&&(v=t.right-f.right+v+o)):t.right>f.right&&(v=t.right-f.right+o,n<0&&t.left0&&n<=0)t=b$(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}function xE(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 $E(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function OE(e,t){return e.topt.top+1}function EE(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function ME(e,t,n){for(var r,i,o,a,s,u,c,l,f=!1,h=e.firstChild;h;h=h.nextSibling)for(var d=p$(h),v=0;vg||a==g&&o>m)&&(r=h,i=p,o=m,a=g,f=!m||(m>0?v0)),0==m?n>p.bottom&&(!c||c.bottomp.top)&&(u=h,l=p):c&&OE(c,p)?c=PE(c,p.bottom):l&&OE(l,p)&&(l=EE(l,p.top))}if(c&&c.bottom>=n?(r=s,i=c):l&&l.top<=n&&(r=u,i=l),!r)return{node:e,offset:0};var y=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?AE(r,y,n):f&&"false"!=r.contentEditable?ME(r,y,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}}function AE(e,t,n){for(var r=e.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?l.top-n:n-l.bottom)-1;if(l.left-1<=t&&l.right+1>=t&&f=(l.left+l.right)/2,d=h;if(G$.chrome||G$.gecko)$$(e,s).getBoundingClientRect().left==l.right&&(d=!h);if(f<=0)return{node:e,offset:s+(d?1:0)};i=s+(d?1:0),o=f}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function TE(e,t,n){var r,i,o=t.x,a=t.y,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,u=e.contentDOM.getBoundingClientRect(),c=u.top+e.viewState.paddingTop,l=e.viewState.docHeight,f=a-c;if(f<0)return 0;if(f>l)return e.state.doc.length;for(var h=e.defaultLineHeight/2,d=!1;(i=e.elementAtHeight(f)).type!=dO.Text;)for(;!((f=s>0?i.bottom+h:i.top-h)>=0&&f<=l);){if(d)return n?null:0;d=!0,s=-s}a=c+f;var v=i.from;if(ve.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:NE(e,u,i,o,a);var p=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:p,g=m.elementFromPoint(o,a);g&&!e.contentDOM.contains(g)&&(g=null),g||(o=Math.max(u.left+1,Math.min(u.right-1,o)),(g=m.elementFromPoint(o,a))&&!e.contentDOM.contains(g)&&(g=null));var y,b=-1;if(g&&0!=(null===(r=e.docView.nearest(g))||void 0===r?void 0:r.isEditable))if(p.caretPositionFromPoint){var k=p.caretPositionFromPoint(o,a);k&&(y=k.offsetNode,b=k.offset)}else if(p.caretRangeFromPoint){var w=p.caretRangeFromPoint(o,a);w&&(y=w.startContainer,b=w.startOffset,(!e.contentDOM.contains(y)||G$.safari&&IE(y,b,o)||G$.chrome&&RE(y,b,o))&&(y=void 0))}if(!y||!e.docView.dom.contains(y)){var j=kO.find(e.docView,v);if(!j)return f>i.top+i.height/2?i.to:i.from;var x=ME(j.dom,o,a);y=x.node,b=x.offset}return e.docView.posFromDOM(y,b)}function NE(e,t,n,r,i){var o=Math.round((r-t.left)*e.defaultCharacterWidth);e.lineWrapping&&n.height>1.5*e.defaultLineHeight&&(o+=Math.floor((i-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);var a=e.state.sliceDoc(n.from,n.to);return n.from+YC(a,o,e.state.tabSize)}function IE(e,t,n){var r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(var i=e.nextSibling;i;i=i.nextSibling)if(1!=i.nodeType||"BR"!=i.nodeName)return!1;return $$(e,r-1,r).getBoundingClientRect().left>n}function RE(e,t,n){if(0!=t)return!1;for(var r=e;;){var i=r.parentNode;if(!i||1!=i.nodeType||i.firstChild!=r)return!1;if(i.classList.contains("cm-line"))break;r=i}return n-(1==e.nodeType?e.getBoundingClientRect():$$(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}function DE(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.textDirectionAt(i.from),u=e.posAtCoords({x:n==(s==KO.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(null!=u)return q_.cursor(u,n?-1:1)}var c=kO.find(e.docView,t.head),l=c?n?c.posAtEnd:c.posAtStart:n?i.to:i.from;return q_.cursor(l,n?-1:1)}function LE(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=e.textDirectionAt(i.from),s=t,u=null;;){var c=dE(i,o,a,s,n),l=hE;if(!c){if(i.number==(n?e.state.doc.lines:1))return s;l="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=q_.cursor(n?i.from:i.to)}if(u){if(!u(l))return s}else{if(!r)return c;u=r(l)}s=c}}function zE(e,t,n){for(var r=e.state.facet(VO).map((function(t){return t(e)}));;){var i,o=!1,a=bi(r);try{for(a.s();!(i=a.n()).done;){i.value.between(n.from-1,n.from+1,(function(e,r,i){n.from>e&&n.fromn.from?q_.cursor(e,1):q_.cursor(r,-1),o=!0)}))}}catch(e){a.e(e)}finally{a.f()}if(!o)return n}}var BE=function(){function e(t){var n=this;Ri(this,e),this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;var r=function(e){var r=JE[e];t.contentDOM.addEventListener(e,(function(i){HE(t,i)&&!n.ignoreDuringComposition(i)&&("keydown"==e&&n.keydown(t,i)||(n.mustFlushObserver(i)&&t.observer.forceFlush(),n.runCustomHandlers(e,t,i)?i.preventDefault():r(t,i)))}),UE[e]),n.registeredEvents.push(e)};for(var i in JE)r(i);G$.chrome&&102==G$.chrome_version&&t.scrollDOM.addEventListener("wheel",(function(){n.chromeScrollHack<0?t.contentDOM.style.pointerEvents="none":window.clearTimeout(n.chromeScrollHack),n.chromeScrollHack=setTimeout((function(){n.chromeScrollHack=-1,t.contentDOM.style.pointerEvents=""}),100)}),{passive:!0}),this.notifiedFocused=t.hasFocus,G$.safari&&t.contentDOM.addEventListener("input",(function(){return null}))}return Li(e,[{key:"setSelectionOrigin",value:function(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(e,t){var n,r,i=this;this.customHandlers=[];var o,a=bi(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(r=null===(n=s.update(e).spec)||void 0===n?void 0:n.domEventHandlers){this.customHandlers.push({plugin:s.value,handlers:r});var u=function(t){i.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(i.registeredEvents.push(t),e.contentDOM.addEventListener(t,(function(n){HE(e,n)&&i.runCustomHandlers(t,e,n)&&n.preventDefault()})))};for(var c in r)u(c)}}}catch(e){a.e(e)}finally{a.f()}}},{key:"runCustomHandlers",value:function(e,t,n){var r,i=bi(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(e){NO(t.state,e)}}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"runScrollHandlers",value:function(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;var n,r=bi(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(t){NO(e.state,t)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"keydown",value:function(e,t){var n,r=this;return this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()-1&&t.ctrlKey&&!t.shiftKey))&&(this.pendingIOSKey=n||t,setTimeout((function(){return r.flushIOSKey(e)}),250),!0):(e.observer.delayAndroidKey(t.key,t.keyCode),!0))}},{key:"flushIOSKey",value:function(e){var t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,O$(e.contentDOM,t.key,t.keyCode))}},{key:"ignoreDuringComposition",value:function(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(G$.safari&&!G$.ios&&Date.now()-this.compositionEndedAt<100)&&(this.compositionEndedAt=0,!0))}},{key:"mustFlushObserver",value:function(e){return"keydown"==e.type&&229!=e.keyCode}},{key:"startMouseSelection",value:function(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}},{key:"update",value:function(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),qE=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],FE="dthko",VE=[16,17,18,20,91,92,224,225],WE=function(){function e(t,n,r,i){Ri(this,e),this.view=t,this.style=r,this.mustSelect=i,this.lastEvent=n;var o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(MC.allowMultipleSelections)&&function(e,t){var n=e.state.facet(_O);return n.length?n[0](t):G$.mac?t.metaKey:t.ctrlKey}(t,n),this.dragMove=function(e,t){var n=e.state.facet(CO);return n.length?n[0](t):G$.mac?!t.altKey:!t.ctrlKey}(t,n),this.dragging=!(!function(e,t){if(e.state.selection.main.empty)return!1;var n=h$(e.root);if(!n||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}(t,n)||1!=oP(n))&&null,!1===this.dragging&&(n.preventDefault(),this.select(n))}return Li(e,[{key:"move",value:function(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}},{key:"up",value:function(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}},{key:"destroy",value:function(){var e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}},{key:"select",value:function(e){var t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}},{key:"update",value:function(e){var t=this;e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((function(){return t.select(t.lastEvent)}),20)}}]),e}();function HE(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=T$.get(r))&&n.ignoreEvent(t))return!1;return!0}var JE=Object.create(null),UE=Object.create(null),KE=G$.ie&&G$.ie_version<15||G$.ios&&G$.webkit_version<604;function GE(e,t){var n,r=e.state,i=1,o=r.toText(t),a=o.lines==r.selection.ranges.length,s=null!=sP&&r.selection.ranges.every((function(e){return e.empty}))&&sP==o.toString();if(s){var u=-1;n=r.changeByRange((function(e){var n=r.doc.lineAt(e.from);if(n.from==u)return{range:e};u=n.from;var s=r.toText((a?o.line(i++).text:t)+r.lineBreak);return{changes:{from:n.from,insert:s},range:q_.cursor(e.from+s.length)}}))}else n=a?r.changeByRange((function(e){var t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:q_.cursor(e.from+t.length)}})):r.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function QE(e,t,n,r){if(1==r)return q_.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 q_.cursor(t);0==o?n=1:o==i.length&&(n=-1);var a=o,s=o;n<0?a=j_(i.text,o,!1):s=j_(i.text,o);for(var u=r(i.text.slice(a,s));a>0;){var c=j_(i.text,a,!1);if(r(i.text.slice(c,a))!=u)break;a=c}for(;sDate.now()-2e3)){var n,r=null,i=bi(e.state.facet($O));try{for(i.s();!(n=i.n()).done;){if(r=(0,n.value)(e,t))break}}catch(e){i.e(e)}finally{i.f()}if(r||0!=t.button||(r=function(e,t){var n=eP(e,t),r=oP(t),i=e.state.selection,o=n,a=t;return{update:function(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes),a=null)},get:function(t,s,u){var c;a&&t.clientX==a.clientX&&t.clientY==a.clientY?c=o:(c=o=eP(e,t),a=t);var l=QE(e,c.pos,c.bias,r);if(n.pos!=c.pos&&!s){var f=QE(e,n.pos,n.bias,r),h=Math.min(f.from,l.from),d=Math.max(f.to,l.to);l=h1&&i.ranges.some((function(e){return e.eq(l)}))?function(e,t){for(var n=0;;n++)if(e.ranges[n].eq(t))return q_.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}(i,l):u?i.addRange(l):q_.create([l])}}}(e,t)),r){var o=e.root.activeElement!=e.contentDOM;o&&e.observer.ignore((function(){return C$(e.contentDOM)})),e.inputState.startMouseSelection(new WE(e,t,r,o))}}};var YE=function(e,t){return e>=t.top&&e<=t.bottom},ZE=function(e,t,n){return YE(t,n)&&e>=n.left&&e<=n.right};function XE(e,t,n,r){var i=kO.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&&ZE(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&ZE(n,r,s)?1:a&&YE(r,a)?-1:1}function eP(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:XE(e,n,t.clientX,t.clientY)}}var tP=G$.ie&&G$.ie_version<=11,nP=null,rP=0,iP=0;function oP(e){if(!tP)return e.detail;var t=nP,n=iP;return nP=e,iP=Date.now(),rP=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(rP+1)%3:1}function aP(e,t,n,r){if(n){var i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();var o=e.inputState.mouseSelection,a=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:i,insert:n},u=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}JE.dragstart=function(e,t){var n=e.state.selection.main,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},JE.drop=function(e,t){if(t.dataTransfer){if(e.state.readOnly)return t.preventDefault();var n=t.dataTransfer.files;n&&n.length?function(){t.preventDefault();for(var r=Array(n.length),i=0,o=function(){++i==n.length&&aP(e,t,r.filter((function(e){return null!=e})).join(e.state.lineBreak),!1)},a=function(e){var t=new FileReader;t.onerror=o,t.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])},s=0;su&&(n.push(f.text),r.push({from:f.from,to:Math.min(e.doc.length,f.to+1)})),u=f.number}}catch(e){c.e(e)}finally{c.f()}i=!0}return{text:n.join(e.lineBreak),ranges:r,linewise:i}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){sP=o?r:null;var a=KE?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(e,t){var n=e.dom.parentNode;if(n){var r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((function(){r.remove(),e.focus()}),50)}}(e,r),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})}},JE.focus=function(e){e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),uP(e)},JE.blur=function(e){e.observer.clearSelectionRange(),uP(e)},JE.compositionstart=JE.compositionupdate=function(e){null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},JE.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,G$.chrome&&G$.android&&e.observer.flushSoon(),setTimeout((function(){e.inputState.composing<0&&e.docView.compositionDeco.size&&e.update([])}),50)},JE.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()},JE.beforeinput=function(e,t){var n,r;if(G$.chrome&&G$.android&&(r=qE.find((function(e){return e.inputType==t.inputType})))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){var i=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((function(){var t;((null===(t=window.visualViewport)||void 0===t?void 0:t.height)||0)>i+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};var cP=["pre-wrap","normal","pre-line","break-spaces"],lP=function(){function e(){Ri(this,e),this.doc=u_.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}return Li(e,[{key:"heightForGap",value:function(e,t){var n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}},{key:"heightForLine",value:function(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(e){return this.doc=e,this}},{key:"mustRefreshForWrapping",value:function(e){return cP.indexOf(e)>-1!=this.lineWrapping}},{key:"mustRefreshForHeights",value:function(e){for(var t=!1,n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.lineLength=r,a){this.heightSamples={};for(var s=0;s2&&void 0!==arguments[2]?arguments[2]:2;Ri(this,e),this.length=t,this.height=n,this.flags=r}return Li(e,[{key:"outdated",get:function(){return(2&this.flags)>0},set:function(e){this.flags=(e?2:0)|-3&this.flags}},{key:"setHeight",value:function(e,t){this.height!=t&&(Math.abs(this.height-t)>.001&&(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,u=a.toA,c=a.fromB,l=a.toB,f=i.lineAt(s,dP.ByPosNoHeight,t,0,0),h=f.to>=u?f:i.lineAt(u,dP.ByPosNoHeight,t,0,0);for(l+=h.to-u,u=h.to;o>0&&f.from<=r[o-1].toA;)s=r[o-1].fromA,c=r[o-1].fromB,o--,s2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i=i&&o(this.blockAt(0,n,r,i))}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&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}(),mP=function(e){Ci(n,pP);var t=Oi(n);function n(e,r){var i;return Ri(this,n),(i=t.call(this,e,r,dO.Text)).collapsed=0,i.widgetHeight=0,i}return Li(n,[{key:"replace",value:function(e,t,r){var i=r[0];return 1==r.length&&(i instanceof n||i instanceof gP&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof gP?i=new n(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):vP.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}(),gP=function(e){Ci(n,vP);var t=Oi(n);function n(e){return Ri(this,n),t.call(this,e,0)}return Li(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,u=Math.max(0,Math.min(a-o,Math.floor((e-n)/s))),c=t.line(o+u),l=c.from,f=c.length;return new hP(l,f,n+s*u,s,dO.Text)}},{key:"lineAt",value:function(e,t,n,r,i){if(t==dP.ByHeight)return this.blockAt(e,n,r,i);if(t==dP.ByPosNoHeight){var o=n.lineAt(e),a=o.from,s=o.to;return new hP(a,s-a,0,0,dO.Text)}var u=this.lines(n,i),c=u.firstLine,l=u.lineHeight,f=n.lineAt(e),h=f.from,d=f.length,v=f.number;return new hP(h,d,r+l*(v-c),l,dO.Text)}},{key:"forEachLine",value:function(e,t,n,r,i,o){for(var a=this.lines(n,i),s=a.firstLine,u=a.lineHeight,c=Math.max(e,i),l=Math.min(i+this.length,t);c<=l;){var f=n.lineAt(c);c==e&&(r+=u*(f.number-s)),o(new hP(f.from,f.length,r,u,dO.Text)),r+=u,c=f.to+1}}},{key:"replace",value:function(e,t,r){var i=this.length-t;if(i>0){var o=r[r.length-1];o instanceof n?r[r.length-1]=new n(o.length+i):r.push(null,new n(i-1))}if(e>0){var a=r[0];a instanceof n?r[0]=new n(e+a.length):r.unshift(new n(e-1),null)}return vP.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),u=-1,c=e.heightChanged;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 f=i.heights[i.index++];-1==u?u=f:Math.abs(f-u)>=.001&&(u=-2);var h=new mP(l,f);h.outdated=!1,a.push(h),s+=l+1}s<=o&&a.push(null,new n(o-s).updateHeight(e,s));var d=vP.of(a);return e.heightChanged=c||u<0||Math.abs(d.height-this.height)>=.001||Math.abs(u-this.lines(e.doc,t).lineHeight)>=.001,d}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}(),yP=function(e){Ci(n,vP);var t=Oi(n);function n(e,r,i){var o;return Ri(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 Li(n,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(e,t,n,r){var i=n+this.left.height;return ea))return u;var c=t==dP.ByPosNoHeight?dP.ByPosNoHeight:dP.ByPos;return s?u.join(this.right.lineAt(a,c,n,o,a)):this.left.lineAt(a,c,n,r,i).join(u)}},{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 u=this.lineAt(s,dP.ByPos,n,r,i);e=e&&u.from<=t&&o(u),t>u.to&&this.right.forEachLine(u.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=bi(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;i.push(u)}}catch(e){s.e(e)}finally{s.f()}if(e>0&&bP(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?vP.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}},{key:"updateHeight",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=this.left,o=this.right,a=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=a+o.length&&r.more?s=o=o.updateHeight(e,a,n,r):o.updateHeight(e,a,n),s?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),n}();function bP(e,t){var n,r;null==e[t]&&(n=e[t-1])instanceof gP&&(r=e[t+1])instanceof gP&&e.splice(t-1,3,new gP(n.length+1+r.length))}var kP=function(){function e(t,n){Ri(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return Li(e,[{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{key:"span",value:function(e,t){if(this.lineStart>-1){var n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof mP?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new mP(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 mP(this.pos-t,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(e,t){var n=new gP(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 mP)return e;var t=new mP(0,-1);return this.nodes.push(t),t}},{key:"addBlock",value:function(e){this.enterLine(),e.type!=dO.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=dO.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 mP||this.isCovered?(this.writtenTol.clientHeight||l.scrollWidth>l.clientWidth)&&"visible"!=f.overflow){var h=l.getBoundingClientRect();o=Math.max(o,h.left),a=Math.min(a,h.right),s=Math.max(s,h.top),u=c==e.parentNode?h.bottom:Math.min(u,h.bottom)}c="absolute"==f.position||"fixed"==f.position?l.offsetParent:l.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+t),bottom:Math.max(s,u)-(n.top+t)}}function SP(e,t){var n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var _P=function(){function e(t,n,r){Ri(this,e),this.from=t,this.to=n,this.size=r}return Li(e,[{key:"draw",value:function(e){return vO.replace({widget:new CP(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;n=t&&i<=n}))){var o=e.lineBlockAt(i),a=o.from,s=o.to;t.push(new OP(a,s))}},i=0;i<=1;i++)r(i);this.viewports=t.sort((function(e,t){return e.from-t.from})),this.scaler=this.heightMap.height<=7e6?AP:new TP(this.heightOracle.doc,this.heightMap,this.viewports)}},{key:"updateViewportLines",value:function(){var e=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(function(t){e.viewportLines.push(1==e.scaler.scale?t:NP(t,e.scaler))}))}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.state=e.state;var n=this.stateDeco;this.stateDeco=this.state.facet(FO).filter((function(e){return"function"!=typeof e}));var r=e.changedRanges,i=JO.extendWithRanges(r,wP(n,this.stateDeco,e?e.changes:T_.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),this.heightMap.height!=o&&(e.flags|=2);var a=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));var s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(e){var t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?KO.RTL:KO.LTR;var o=this.heightOracle.mustRefreshForWrapping(i),a=o||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight;this.contentDOMHeight=t.clientHeight,this.mustMeasureContent=!1;var s=0,u=0,c=parseInt(n.paddingTop)||0,l=parseInt(n.paddingBottom)||0;this.paddingTop==c&&this.paddingBottom==l||(this.paddingTop=c,this.paddingBottom=l,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);var f=(this.printing?SP:xP)(t,this.paddingTop),h=f.top-this.pixelViewport.top,d=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;var v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;var p=t.clientWidth;if(this.contentDOMWidth==p&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=p,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){var m=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(m)&&(o=!0),o||r.lineWrapping&&Math.abs(p-this.contentDOMWidth)>r.charWidth){var g=e.docView.measureTextSize(),y=g.lineHeight,b=g.charWidth;(o=y>0&&r.refresh(i,y,b,p/b,m))&&(e.docView.minWidth=0,s|=8)}h>0&&d>0?u=Math.max(h,d):h<0&&d<0&&(u=Math.min(h,d)),r.heightChanged=!1;var k,w=bi(this.viewports);try{for(w.s();!(k=w.n()).done;){var j=k.value,x=j.from==this.viewport.from?m:e.docView.measureVisibleLineHeights(j);this.heightMap=this.heightMap.updateHeight(r,0,o,new fP(j.from,x))}}catch(e){w.e(e)}finally{w.f()}r.heightChanged&&(s|=2)}var S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(2&s||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom)}},{key:"getViewport",value:function(e,t){var n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,o=this.visibleTop,a=this.visibleBottom,s=new OP(r.lineAt(o-1e3*n,dP.ByHeight,i,0,0).from,r.lineAt(a+1e3*(1-n),dP.ByHeight,i,0,0).to);if(t){var u=t.range.head;if(us.to){var c,l=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(u,dP.ByPos,i,0,0);c="center"==t.y?(f.top+f.bottom)/2-l/2:"start"==t.y||"nearest"==t.y&&u1&&void 0!==arguments[1]?arguments[1]:0;if(!this.inView)return!0;var i=this.heightMap.lineAt(t,dP.ByPos,this.state.doc,0,0),o=i.top,a=this.heightMap.lineAt(n,dP.ByPos,this.state.doc,0,0),s=a.bottom,u=this.visibleTop,c=this.visibleBottom;return(0==t||o<=u-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=c+Math.max(10,Math.min(r,250)))&&o>u-2e3&&s>1,a=i<<1;if(this.defaultTextDirection!=KO.LTR&&!r)return[];var s,u=[],c=function i(a,s,c,l){if(!(s-aa&&p=c.from&&e.to<=c.to&&Math.abs(e.from-a)t}))}));if(!m){if(s=s}))){var g=t.moveToLineBoundary(q_.cursor(s),!1,!0).head;g>a&&(s=g)}m=new _P(a,s,n.gapSize(c,a,s,l))}u.push(m)}},l=bi(this.viewportLines);try{for(l.s();!(s=l.n()).done;){var f=s.value;if(!(f.lengthf.from&&c(f.from,v,f,h),p=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((function(t){return t.from<=e&&t.to>=e}))||NP(this.heightMap.lineAt(e,dP.ByPos,this.state.doc,0,0),this.scaler)}},{key:"lineBlockAtHeight",value:function(e){return NP(this.heightMap.lineAt(this.scaler.fromDOM(e),dP.ByHeight,this.state.doc,0,0),this.scaler)}},{key:"elementAtHeight",value:function(e){return NP(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}},{key:"docHeight",get:function(){return this.scaler.toDOM(this.heightMap.height)}},{key:"contentHeight",get:function(){return this.docHeight+this.paddingTop+this.paddingBottom}}]),e}(),OP=Li((function e(t,n){Ri(this,e),this.from=t,this.to=n}));function EP(e,t,n){var r=[],i=e,o=0;return DC.spans(n,e,t,{span:function(){},point:function(e,t){e>i&&(r.push({from:i,to:e}),o+=e-i),i=t}},20),i=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function MP(e,t){var n,r=0,i=bi(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(e){i.e(e)}finally{i.f()}return r/e.total}var AP={toDOM:function(e){return e},fromDOM:function(e){return e},scale:1},TP=function(){function e(t,n,r){Ri(this,e);var i=0,o=0,a=0;this.viewports=r.map((function(e){var r=e.from,o=e.to,a=n.lineAt(r,dP.ByPos,t,0,0).top,s=n.lineAt(o,dP.ByPos,t,0,0).bottom;return i+=s-a,{from:r,to:o,top:a,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-i)/(n.height-i);var s,u=bi(this.viewports);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.domTop=a+(c.top-o)*this.scale,a=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}}catch(e){u.e(e)}finally{u.f()}}return Li(e,[{key:"toDOM",value:function(e){for(var t=0,n=0,r=0;;t++){var i=t-1}}),DP=t$.newName(),LP=t$.newName(),zP=t$.newName(),BP={"&light":"."+LP,"&dark":"."+zP};function qP(e,t,n){return new t$(t,{finish:function(t){return/&/.test(t)?t.replace(/&\w*/,(function(t){if("&"==t)return e;if(!n||!n[t])throw new RangeError("Unsupported selector: ".concat(t));return n[t]})):e+" "+t}})}var FP=qP("."+DP,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},BP),VP=Li((function e(t,n,r,i){Ri(this,e),this.typeOver=i,this.bounds=null,this.text="";var o=t.docView,a=o.impreciseHead,s=o.impreciseAnchor;if(n>-1&&!t.state.readOnly&&(this.bounds=t.docView.domBoundsAround(n,r,0))){var u=a||s?[]:function(e){var t=[];if(e.root.activeElement!=e.contentDOM)return t;var n=e.observer.selectionRange,r=n.anchorNode,i=n.anchorOffset,o=n.focusNode,a=n.focusOffset;r&&(t.push(new mE(r,i)),o==r&&a==i||t.push(new mE(o,a)));return t}(t),c=new vE(u,t.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=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?q_.single(n+t,r+t):null}(u,this.bounds.from)}else{var l=t.observer.selectionRange,f=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!d$(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),h=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!d$(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=q_.single(h,f)}}));function WP(e,t){var n,r=t.newSel,i=e.state.selection.main;if(t.bounds){var o=t.bounds,a=o.from,s=o.to,u=i.from,c=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||G$.android&&t.text.length0&&s>0&&e.charCodeAt(a-1)==t.charCodeAt(s-1);)a--,s--;if("end"==r){n-=a+Math.max(0,o-Math.min(a,s))-o}if(a=a?o-n:0)+(s-a),a=o}else if(s=s?o-n:0)+(a-s),s=o}return{from:o,toA:a,toB:s}}(e.state.doc.sliceString(a,s,"￿"),t.text,u-a,c);l&&(G$.chrome&&13==e.inputState.lastKeyCode&&l.toB==l.from+2&&"￿￿"==t.text.slice(l.from,l.toB)&&l.toB--,n={from:a+l.from,to:a+l.toA,insert:u_.of(t.text.slice(l.from,l.toB).split("￿"))})}else!r||e.hasFocus&&e.state.facet(IO)&&!r.main.eq(i)||(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:(G$.mac||G$.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&(r&&2==n.insert.length&&(r=q_.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:u_.of([" "])}),n){var f=e.state;if(G$.ios&&e.inputState.flushIOSKey(e))return!0;if(G$.android&&(n.from==i.from&&n.to==i.to&&1==n.insert.length&&2==n.insert.lines&&O$(e.contentDOM,"Enter",13)||n.from==i.from-1&&n.to==i.to&&0==n.insert.length&&O$(e.contentDOM,"Backspace",8)||n.from==i.from&&n.to==i.to+1&&0==n.insert.length&&O$(e.contentDOM,"Delete",46)))return!0;var h,d=n.insert.toString();if(e.state.facet(PO).some((function(t){return t(e,n.from,n.to,d)})))return!0;if(e.inputState.composing>=0&&e.inputState.composing++,n.from>=i.from&&n.to<=i.to&&n.to-n.from>=(i.to-i.from)/3&&(!r||r.main.empty&&r.main.from==n.from+n.insert.length)&&e.inputState.composing<0){var v=i.fromn.to?f.sliceDoc(n.to,i.to):"";h=f.replaceSelection(e.state.toText(v+n.insert.sliceString(0,void 0,e.state.lineBreak)+p))}else{var m=f.changes(n),g=r&&!f.selection.main.eq(r.main)&&r.main.to<=m.newLength?r.main:void 0;if(f.selection.ranges.length>1&&e.inputState.composing>=0&&n.to<=i.to&&n.to>=i.to-10){var y=e.state.sliceDoc(n.from,n.to),b=kE(e)||e.state.doc.lineAt(i.head),k=i.to-n.to,w=i.to-i.from;h=f.changeByRange((function(t){if(t.from==i.from&&t.to==i.to)return{changes:m,range:g||t.map(m)};var r=t.to-k,o=r-y.length;if(t.to-t.from!=w||e.state.sliceDoc(o,r)!=y||b&&t.to>=b.from&&t.from<=b.to)return{range:t};var a=f.changes({from:o,to:r,insert:n.insert}),s=t.to-i.to;return{changes:a,range:g?q_.range(Math.max(0,g.anchor+s),Math.max(0,g.head+s)):t.map(a)}}))}else h={changes:m,selection:g&&f.selection.replaceRange(g)}}var j="input.type";return e.composing&&(j+=".compose",e.inputState.compositionFirstChange&&(j+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(h,{scrollIntoView:!0,userEvent:j}),!0}if(r&&!r.main.eq(i)){var x=!1,S="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(x=!0),S=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:x,userEvent:S}),!0}return!1}var HP={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},JP=G$.ie&&G$.ie_version<=11,UP=function(){function e(t){var n=this;Ri(this,e),this.view=t,this.active=!1,this.selectionRange=new S$,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((function(e){var r,i=bi(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.queue.push(o)}}catch(e){i.e(e)}finally{i.f()}(G$.ie&&G$.ie_version<=11||G$.ios&&t.composing)&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?n.flushSoon():n.flush()})),JP&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver((function(){n.view.docView.lastUpdate0&&e[e.length-1].intersectionRatio>0!=n.intersecting&&(n.intersecting=!n.intersecting,n.intersecting!=n.view.inView&&n.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((function(e){e.length>0&&e[e.length-1].intersectionRatio>0&&n.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}return Li(e,[{key:"onScrollChanged",value:function(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}},{key:"onScroll",value:function(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}},{key:"onResize",value:function(){var e=this;this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((function(){e.resizeTimeout=-1,e.view.requestMeasure()}),50))}},{key:"onPrint",value:function(){var e=this;this.view.viewState.printing=!0,this.view.measure(),setTimeout((function(){e.view.viewState.printing=!1,e.view.requestMeasure()}),500)}},{key:"updateGaps",value:function(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((function(t,n){return t!=e[n]})))){this.gapIntersection.disconnect();var t,n=bi(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.gapIntersection.observe(r)}}catch(e){n.e(e)}finally{n.f()}this.gaps=e}}},{key:"onSelectionChange",value:function(e){var t=this.selectionChanged;if(this.readSelectionRange()&&!this.delayedAndroidKey){var n=this.view,r=this.selectionRange;if(n.state.facet(IO)?n.root.activeElement==this.dom:v$(n.dom,r)){var i=r.anchorNode&&n.docView.nearest(r.anchorNode);i&&i.ignoreEvent(e)?t||(this.selectionChanged=!1):(G$.ie&&G$.ie_version<=11||G$.android&&G$.chrome)&&!n.state.selection.main.empty&&r.focusNode&&m$(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}}}},{key:"readSelectionRange",value:function(){var e=this.view,t=G$.safari&&11==e.root.nodeType&&function(e){for(var t=e.activeElement;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){var t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;var r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);if(m$(s.node,s.offset,o,a)){var u=[o,a,r,i];r=u[0],i=u[1],o=u[2],a=u[3]}return{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}(this.view)||h$(e.root);if(!t||this.selectionRange.eq(t))return!1;var n=v$(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}},{key:"processRecords",value:function(){var e,t=this.queue,n=bi(this.observer.takeRecords());try{for(n.s();!(e=n.n()).done;){var r=e.value;t.push(r)}}catch(e){n.e(e)}finally{n.f()}t.length&&(this.queue=[]);var i,o=-1,a=-1,s=!1,u=bi(t);try{for(u.s();!(i=u.n()).done;){var c=i.value,l=this.readMutation(c);l&&(l.typeOver&&(s=!0),-1==o?(o=l.from,a=l.to):(o=Math.min(l.from,o),a=Math.max(l.to,a)))}}catch(e){u.e(e)}finally{u.f()}return{from:o,to:a,typeOver:s}}},{key:"readChange",value:function(){var e=this.processRecords(),t=e.from,n=e.to,r=e.typeOver,i=this.selectionChanged&&v$(this.dom,this.selectionRange);return t<0&&!i?null:(t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new VP(this.view,t,n,r))}},{key:"flush",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();var t=this.readChange();if(!t)return!1;var n=this.view.state,r=WP(this.view,t);return this.view.state==n&&this.view.update([]),r}},{key:"readMutation",value:function(e){var t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){var n=KP(t,e.previousSibling||e.target.previousSibling,-1),r=KP(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}},{key:"setWindow",value:function(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}},{key:"addWindowListeners",value:function(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}},{key:"removeWindowListeners",value:function(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"destroy",value:function(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resize)||void 0===n||n.disconnect();var r,i=bi(this.scrollTargets);try{for(i.s();!(r=i.n()).done;){r.value.removeEventListener("scroll",this.onScroll)}}catch(e){i.e(e)}finally{i.f()}this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}]),e}();function KP(e,t,n){for(;t;){var r=T$.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 GP=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ri(this,e),this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(e){return t.update([e])},this.dispatch=this.dispatch.bind(this),this._root=n.root||E$(n.parent)||document,this.viewState=new $P(n.state||MC.create(n)),this.plugins=this.state.facet(DO).map((function(e){return new zO(e)}));var r,i=bi(this.plugins);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.update(this)}}catch(e){i.e(e)}finally{i.f()}this.observer=new UP(this),this.inputState=new BE(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new gE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return Li(e,[{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"compositionStarted",get:function(){return this.inputState.composing>=0}},{key:"root",get:function(){return this._root}},{key:"win",get:function(){return this.dom.ownerDocument.defaultView||window}},{key:"dispatch",value:function(){var e;this._dispatch(1==arguments.length&&(arguments.length<=0?void 0:arguments[0])instanceof kC?arguments.length<=0?void 0:arguments[0]:(e=this.state).update.apply(e,arguments))}},{key:"update",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var t,n,r=!1,i=!1,o=this.state,a=bi(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=s.state}}catch(e){a.e(e)}finally{a.f()}if(this.destroyed)this.viewState.state=o;else{var u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),((c=this.observer.readChange())&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(MC.phrases)!=this.state.facet(MC.phrases))return this.setState(o);t=UO.create(this,o,e);var l=this.viewState.scrollTarget;try{this.updateState=2;var f,h=bi(e);try{for(h.s();!(f=h.n()).done;){var d=f.value;if(l&&(l=l.map(d.changes)),d.scrollIntoView){var v=d.state.selection.main;l=new AO(v.empty?v:q_.cursor(v.head,v.head>v.anchor?-1:1))}var p,m=bi(d.effects);try{for(m.s();!(p=m.n()).done;){var g=p.value;g.is(TO)&&(l=g.value)}}catch(e){m.e(e)}finally{m.f()}}}catch(e){h.e(e)}finally{h.f()}this.viewState.update(t,l),this.bidiCache=ZP.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),r=this.docView.update(t),this.state.facet(HO)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(r,e.some((function(e){return e.isUserEvent("select.pointer")})))}finally{this.updateState=0}if(t.startState.facet(IP)!=t.state.facet(IP)&&(this.viewState.mustMeasureContent=!0),(r||i||l||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty){var y,b=bi(this.state.facet(EO));try{for(b.s();!(y=b.n()).done;){(0,y.value)(t)}}catch(e){b.e(e)}finally{b.f()}}c&&!WP(this,c)&&u.force&&O$(this.contentDOM,u.key,u.keyCode)}}},{key:"setState",value:function(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=e;else{this.updateState=2;var t=this.hasFocus;try{var n,r=bi(this.plugins);try{for(r.s();!(n=r.n()).done;){n.value.destroy(this)}}catch(e){r.e(e)}finally{r.f()}this.viewState=new $P(e),this.plugins=e.facet(DO).map((function(e){return new zO(e)})),this.pluginMap.clear();var i,o=bi(this.plugins);try{for(o.s();!(i=o.n()).done;){i.value.update(this)}}catch(e){o.e(e)}finally{o.f()}this.docView=new gE(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}}},{key:"updatePlugins",value:function(e){var t=e.startState.facet(DO),n=e.state.facet(DO);if(t!=n){var r,i=[],o=bi(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=t.indexOf(a);if(s<0)i.push(new zO(a));else{var u=this.plugins[s];u.mustUpdate=e,i.push(u)}}}catch(e){o.e(e)}finally{o.f()}var c,l=bi(this.plugins);try{for(l.s();!(c=l.n()).done;){var f=c.value;f.mustUpdate!=e&&f.destroy(this)}}catch(e){l.e(e)}finally{l.f()}this.plugins=i,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else{var h,d=bi(this.plugins);try{for(d.s();!(h=d.n()).done;){h.value.mustUpdate=e}}catch(e){d.e(e)}finally{d.f()}}for(var v=0;v0&&void 0!==arguments[0])||arguments[0];if(!this.destroyed){this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,t&&this.observer.forceFlush();var n=null,r=this.scrollDOM,i=r.scrollHeight,o=r.scrollTop,a=r.clientHeight,s=o>i-a-4?i:o;try{for(var u=0;;u++){this.updateState=1;var c=this.viewport,l=this.viewState.lineBlockAtHeight(s),f=this.viewState.measure(this);if(!f&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}var h=[];if(!(4&f)){var d=[h,this.measureRequests];this.measureRequests=d[0],h=d[1]}var v=h.map((function(t){try{return t.read(e)}catch(t){return NO(e.state,t),YP}})),p=UO.create(this,this.state,[]),m=!1,g=!1;p.flags|=f,n?n.flags|=f:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),m=this.docView.update(p));for(var y=0;y1||k<-1)&&(this.scrollDOM.scrollTop+=k,g=!0)}if(m&&this.docView.updateSelection(!0),this.viewport.from==c.from&&this.viewport.to==c.to&&!g&&0==this.measureRequests.length)break}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty){var w,j=bi(this.state.facet(EO));try{for(j.s();!(w=j.n()).done;){var x=w.value;x(n)}}catch(e){j.e(e)}finally{j.f()}}}}},{key:"themeClasses",get:function(){return DP+" "+(this.state.facet(RP)?zP:LP)+" "+this.state.facet(IP)}},{key:"updateAttrs",value:function(){var e=this,t=XP(this,BO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(IO)?"true":"false",class:"cm-content",style:"".concat(G$.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),XP(this,qO,n);var r=this.observer.ignore((function(){var r=fO(e.contentDOM,e.contentAttrs,n),i=fO(e.dom,e.editorAttrs,t);return r||i}));return this.editorAttrs=t,this.contentAttrs=n,r}},{key:"showAnnouncements",value:function(t){var n,r=!0,i=bi(t);try{for(i.s();!(n=i.n()).done;){var o,a=bi(n.value.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.is(e.announce))r&&(this.announceDOM.textContent=""),r=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=s.value}}catch(e){a.e(e)}finally{a.f()}}}catch(e){i.e(e)}finally{i.f()}}},{key:"mountStyles",value:function(){this.styleModules=this.state.facet(HO),t$.mount(this.root,this.styleModules.concat(FP).reverse())}},{key:"readMeasured",value:function(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}},{key:"requestMeasure",value:function(e){var t=this;if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((function(){return t.measure()}))),e){if(null!=e.key)for(var n=0;n2&&void 0!==arguments[2])||arguments[2];return DE(this,e,t,n)}},{key:"moveVertically",value:function(e,t,n){return zE(this,e,function(e,t,n,r){var i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return q_.cursor(i,t.assoc);var a,s=t.goalColumn,u=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i),l=e.documentTop;if(c)null==s&&(s=c.left-u.left),a=o<0?c.top:c.bottom;else{var f=e.viewState.lineBlockAt(i);null==s&&(s=Math.min(u.right-u.left,e.defaultCharacterWidth*(i-f.from))),a=(o<0?f.top:f.bottom)+l}for(var h=u.left+s,d=null!=r?r:e.defaultLineHeight>>1,v=0;;v+=10){var p=a+(d+v)*o,m=TE(e,{x:h,y:p},!1,o);if(pu.bottom||(o<0?mi))return q_.cursor(m,t.assoc,void 0,s)}}(this,e,t,n))}},{key:"domAtPos",value:function(e){return this.docView.domAtPos(e)}},{key:"posAtDOM",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.posFromDOM(e,t)}},{key:"posAtCoords",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.readMeasured(),TE(this,e,t)}},{key:"coordsAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.readMeasured();var n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;var r=this.state.doc.lineAt(e),i=this.bidiSpans(r),o=i[cE.find(i,e-r.from,-1,t)];return w$(n,o.dir==KO.LTR==t>0)}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.defaultTextDirection}},{key:"textDirectionAt",value:function(e){return!this.state.facet(MO)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"bidiSpans",value:function(e){if(e.length>QP)return fE(e.length);var t,n=this.textDirectionAt(e.from),r=bi(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(e){r.e(e)}finally{r.f()}var o=function(e,t){var n=e.length,r=t==GO?1:2,i=t==GO?2:1;if(!e||1==r&&!uE.test(e))return fE(n);for(var o=0,a=r,s=r;o=0;j-=3)if(tE[j+1]==-g){var x=tE[j+2],S=2&x?r:4&x?1&x?i:r:0;S&&(lE[b]=lE[tE[j]]=S),k=j;break}}else{if(189==tE.length)break;tE[k++]=b,tE[k++]=m,tE[k++]=w}else if(2==(y=lE[b])||1==y){var _=y==r;w=_?0:1;for(var C=k-3;C>=0;C-=3){var $=tE[C+2];if(2&$)break;if(_)tE[C+2]|=2;else{if(4&$)break;tE[C+2]|=4}}}for(var O=0;OI;){for(var L=D,z=2!=lE[--D];D>I&&z==(2!=lE[D-1]);)D--;T.push(new cE(D,L,z?2:1))}else T.push(new cE(I,N,0))}else for(var B=0;BDate.now()-3e4)&&this.root.activeElement==this.contentDOM}},{key:"focus",value:function(){var e=this;this.observer.ignore((function(){C$(e.contentDOM),e.docView.updateSelection()}))}},{key:"setRoot",value:function(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}},{key:"destroy",value:function(){var e,t=bi(this.plugins);try{for(t.s();!(e=t.n()).done;){e.value.destroy(this)}}catch(e){t.e(e)}finally{t.f()}this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}}],[{key:"scrollIntoView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return TO.of(new AO("number"==typeof e?q_.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}},{key:"domEventHandlers",value:function(e){return LO.define((function(){return{}}),{eventHandlers:e})}},{key:"theme",value:function(e,t){var n=t$.newName(),r=[IP.of(n),HO.of(qP(".".concat(n),e))];return t&&t.dark&&r.push(RP.of(!0)),r}},{key:"baseTheme",value:function(e){return nC.lowest(HO.of(qP("."+DP,e,BP)))}},{key:"findFromDOM",value:function(e){var t,n=e.querySelector(".cm-content"),r=n&&T$.get(n)||T$.get(e);return(null===(t=null==r?void 0:r.rootView)||void 0===t?void 0:t.view)||null}}]),e}();GP.styleModule=HO,GP.inputHandler=PO,GP.perLineTextDirection=MO,GP.exceptionSink=OO,GP.updateListener=EO,GP.editable=IO,GP.mouseSelectionStyle=$O,GP.dragMovesSelection=CO,GP.clickAddsSelectionRange=_O,GP.decorations=FO,GP.atomicRanges=VO,GP.scrollMargins=WO,GP.darkTheme=RP,GP.contentAttributes=qO,GP.editorAttributes=BO,GP.lineWrapping=GP.contentAttributes.of({class:"cm-lineWrapping"}),GP.announce=bC.define();var QP=4096,YP={},ZP=function(){function e(t,n,r,i){Ri(this,e),this.from=t,this.to=n,this.dir=r,this.order=i}return Li(e,null,[{key:"update",value:function(t,n){if(n.empty)return t;for(var r=[],i=t.length?t[t.length-1].dir:KO.LTR,o=Math.max(0,t.length-10);o=0;i--){var o=r[i],a="function"==typeof o?o(e):o;a&&cO(a,n)}return n}var eM=G$.mac?"mac":G$.windows?"win":G$.linux?"linux":"key";function tM(e,t){var n,r,i,o,a=e.split(/-(?!$)/),s=a[a.length-1];"Space"==s&&(s=" ");for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:eM,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,u,c=r[e]||(r[e]=Object.create(null)),l=t.split(/ (?!$)/).map((function(e){return tM(e,n)})),f=function(t){var n=l.slice(0,t).join(" ");o(n,!0),c[n]||(c[n]={preventDefault:!0,run:[function(t){var r=sM={view:t,prefix:n,scope:e};return setTimeout((function(){sM==r&&(sM=null)}),4e3),!0}]})},h=1;h127)&&(c=i$[t.keyCode])&&c!=i){if(h(d[s+nM(c,t,!0)]))return!0;if(t.shiftKey&&(l=o$[t.keyCode])!=i&&l!=c&&h(d[s+nM(l,t,!1)]))return!0}else if(a&&t.shiftKey&&h(d[s+nM(i,t,!0)]))return!0;if(h(d._any))return!0}return u}var cM=!G$.ios,lM=W_.define({combine:function(e){return AC(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:function(e,t){return Math.min(e,t)},drawRangeCursor:function(e,t){return e||t}})}});function fM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[lM.of(e),dM,pM]}var hM=function(){function e(t,n,r,i,o){Ri(this,e),this.left=t,this.top=n,this.width=r,this.height=i,this.className=o}return Li(e,[{key:"draw",value:function(){var e=document.createElement("div");return e.className=this.className,this.adjust(e),e}},{key:"adjust",value:function(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}},{key:"eq",value:function(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}]),e}(),dM=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=t.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}return Li(e,[{key:"setBlinkRate",value:function(){this.cursorLayer.style.animationDuration=this.view.state.facet(lM).cursorBlinkRate+"ms"}},{key:"update",value:function(e){var t=e.startState.facet(lM)!=e.state.facet(lM);(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(lM),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==KO.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),s=mM(e),u=window.getComputedStyle(o.firstChild),c=a.left+parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)),l=a.right-parseInt(u.paddingRight),f=yM(e,n),h=yM(e,r),d=f.type==dO.Text?f:null,v=h.type==dO.Text?h:null;e.lineWrapping&&(d&&(d=gM(e,n,d)),v&&(v=gM(e,r,v)));if(d&&v&&d.from==v.from)return b(k(t.from,t.to,d));var p=d?k(t.from,null,d):w(f,!1),m=v?k(null,t.to,v):w(h,!0),g=[];return(d||f).to<(v||h).from-1?g.push(y(c,p.bottom,l,m.top)):p.bottomh&&p.from=g)break;x>m&&u(Math.max(j,m),null==t&&j<=h,Math.min(x,g),null==n&&x>=d,w.dir)}}catch(e){k.e(e)}finally{k.f()}if((m=b.to+1)>=g)break}}}catch(e){v.e(e)}finally{v.f()}return 0==s.length&&u(h,null==t,d,null==n,e.textDirection),{top:o,bottom:a,horizontal:s}}function w(e,t){var n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(t.view,e)})).reduce((function(e,t){return e.concat(t)})),o=[],a=bi(n.selection.ranges);try{for(a.s();!(e=a.n()).done;){var s=e.value,u=s==n.selection.main;if(s.empty?!u||cM:r.drawRangeCursor){var c=bM(this.view,s,u);c&&o.push(c)}}}catch(e){a.e(e)}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=bi(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.selectionLayer.appendChild(a.draw())}}catch(e){o.e(e)}finally{o.f()}this.rangePieces=n}if(r.length!=this.cursors.length||r.some((function(e,n){return!e.eq(t.cursors[n])}))){var s=this.cursorLayer.children;if(s.length!==r.length){this.cursorLayer.textContent="";var u,c=bi(r);try{for(c.s();!(u=c.n()).done;){var l=u.value;this.cursorLayer.appendChild(l.draw())}}catch(e){c.e(e)}finally{c.f()}}else r.forEach((function(e,t){return e.adjust(s[t])}));this.cursors=r}}},{key:"destroy",value:function(){this.selectionLayer.remove(),this.cursorLayer.remove()}}]),e}()),vM={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};cM&&(vM[".cm-line"].caretColor="transparent !important");var pM=nC.highest(GP.theme(vM));function mM(e){var t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==KO.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function gM(e,t,n){var r=q_.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(r,!0,!0).from),type:dO.Text}}function yM(e,t){var n=e.lineBlockAt(t);if(Array.isArray(n.type)){var r,i=bi(n.type);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.to>t||o.to==t&&(o.to==n.to||o.type==dO.Text))return o}}catch(e){i.e(e)}finally{i.f()}}return n}function bM(e,t,n){var r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;var i=mM(e);return new hM(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}var kM=bC.define({map:function(e,t){return null==e?null:t.mapPos(e)}}),wM=Q_.define({create:function(){return null},update:function(e,t){return null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((function(e,t){return t.is(kM)?t.value:e}),e)}}),jM=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}return Li(e,[{key:"update",value:function(e){var t,n=e.state.field(wM);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(wM)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}},{key:"readPos",value:function(){var e=this.view.state.field(wM),t=null!=e&&this.view.coordsAtPos(e);if(!t)return null;var n=this.view.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+this.view.scrollDOM.scrollLeft,top:t.top-n.top+this.view.scrollDOM.scrollTop,height:t.bottom-t.top}}},{key:"drawCursor",value:function(e){this.cursor&&(e?(this.cursor.style.left=e.left+"px",this.cursor.style.top=e.top+"px",this.cursor.style.height=e.height+"px"):this.cursor.style.left="-100000px")}},{key:"destroy",value:function(){this.cursor&&this.cursor.remove()}},{key:"setDropPos",value:function(e){this.view.state.field(wM)!=e&&this.view.dispatch({effects:kM.of(e)})}}]),e}(),{eventHandlers:{dragover:function(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave:function(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend:function(){this.setDropPos(null)},drop:function(){this.setDropPos(null)}}});function xM(e,t,n,r,i){t.lastIndex=0;for(var o,a=e.iterRange(n,r),s=n;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=t.exec(a.value);)i(s+o.index,o)}var SM=function(){function e(t){Ri(this,e);var n=t.regexp,r=t.decoration,i=t.decorate,o=t.boundary,a=t.maxLength,s=void 0===a?1e3:a;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=function(e,t,n,r){return i(r,n,n+e[0].length,e,t)};else if("function"==typeof r)this.addMatch=function(e,t,n,i){var o=r(e,t,n);o&&i(n,n+e[0].length,o)};else{if(!r)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=function(e,t,n,i){return i(n,n+e[0].length,r)}}this.boundary=o,this.maxLength=s}return Li(e,[{key:"createDeco",value:function(e){var t,n=this,r=new zC,i=r.add.bind(r),o=bi(function(e,t){var n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;var r,i=[],o=bi(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.from,u=a.to;s=Math.max(e.state.doc.lineAt(s).from,s-t),u=Math.min(e.state.doc.lineAt(u).to,u+t),i.length&&i[i.length-1].to>=s?i[i.length-1].to=u:i.push({from:s,to:u})}}catch(e){o.e(e)}finally{o.f()}return i}(e,this.maxLength));try{for(o.s();!(t=o.n()).done;){var a=t.value,s=a.from,u=a.to;xM(e.state.doc,this.regexp,s,u,(function(t,r){return n.addMatch(r,e,t,i)}))}}catch(e){o.e(e)}finally{o.f()}return r.finish()}},{key:"updateDeco",value:function(e,t){var n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((function(t,i,o,a){a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}},{key:"updateRange",value:function(e,t,n,r){var i,o=this,a=bi(e.visibleRanges);try{for(a.s();!(i=a.n()).done;){var s=i.value,u=Math.max(s.from,n),c=Math.min(s.to,r);c>u&&function(){var n=e.state.doc.lineAt(u),r=n.ton.from;u--)if(o.boundary.test(n.text[u-1-n.from])){i=u;break}for(;ca},add:l})}()}}catch(e){a.e(e)}finally{a.f()}return t}}]),e}(),_M=null!=/x/.unicode?"gu":"g",CM=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",_M),$M={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},OM=null;var EM=W_.define({combine:function(e){var t=AC(e,{render:null,specialChars:CM,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==OM&&"undefined"!=typeof document&&document.body){var t=document.body.style;OM=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return OM||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,_M)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,_M)),t}});function PM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[EM.of(e),AM()]}var MM=null;function AM(){return MM||(MM=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.decorations=vO.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(EM)),this.decorations=this.decorator.createDeco(t)}return Li(e,[{key:"makeDecorator",value:function(e){var t=this;return new SM({regexp:e.specialChars,decoration:function(n,r,i){var o=r.state.doc,a=$_(n[0],0);if(9==a){var s=o.lineAt(i),u=r.state.tabSize,c=QC(s.text,u,i-s.from);return vO.replace({widget:new NM((u-c%u)*t.view.defaultCharacterWidth)})}return t.decorationCache[a]||(t.decorationCache[a]=vO.replace({widget:new TM(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}},{key:"update",value:function(e){var t=e.state.facet(EM);e.startState.facet(EM)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}}]),e}(),{decorations:function(e){return e.decorations}}))}var TM=function(e){Ci(n,hO);var t=Oi(n);function n(e,r){var i;return Ri(this,n),(i=t.call(this)).options=e,i.code=r,i}return Li(n,[{key:"eq",value:function(e){return e.code==this.code}},{key:"toDOM",value:function(e){var t=function(e){return e>=32?"•":10==e?"␤":String.fromCharCode(9216+e)}(this.code),n=e.state.phrase("Control character")+" "+($M[this.code]||"0x"+this.code.toString(16)),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.className="cm-specialChar",i}},{key:"ignoreEvent",value:function(){return!1}}]),n}(),NM=function(e){Ci(n,hO);var t=Oi(n);function n(e){var r;return Ri(this,n),(r=t.call(this)).width=e,r}return Li(n,[{key:"eq",value:function(e){return e.width==this.width}},{key:"toDOM",value:function(){var e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}},{key:"ignoreEvent",value:function(){return!1}}]),n}();var IM=vO.line({class:"cm-activeLine"}),RM=LO.fromClass(function(){function e(t){Ri(this,e),this.decorations=this.getDeco(t)}return Li(e,[{key:"update",value:function(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}},{key:"getDeco",value:function(e){var t,n=-1,r=[],i=bi(e.state.selection.ranges);try{for(i.s();!(t=i.n()).done;){var o=t.value,a=e.lineBlockAt(o.head);a.from>n&&(r.push(IM.range(a.from)),n=a.from)}}catch(e){i.e(e)}finally{i.f()}return vO.set(r)}}]),e}(),{decorations:function(e){return e.decorations}});function DM(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>2e3?-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):QC(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function LM(e,t){var n=DM(e,t),r=e.state.selection;return n?{update:function(e){if(e.docChanged){var t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get:function(t,i,o){var a=DM(e,t);if(!a)return r;var s=function(e,t,n){var r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0)for(var a=Math.min(t.off,n.off),s=Math.max(t.off,n.off),u=r;u<=i;u++){var c=e.doc.line(u);c.length<=s&&o.push(q_.range(c.from+a,c.to+s))}else for(var l=Math.min(t.col,n.col),f=Math.max(t.col,n.col),h=r;h<=i;h++){var d=e.doc.line(h),v=YC(d.text,l,e.tabSize,!0);if(v>-1){var p=YC(d.text,f,e.tabSize);o.push(q_.range(d.from+v,d.from+p))}}return o}(e.state,n,a);return s.length?o?q_.create(s.concat(r.ranges)):q_.create(s):r}}:null}function zM(e){var t=(null==e?void 0:e.eventFilter)||function(e){return e.altKey&&0==e.button};return GP.mouseSelectionStyle.of((function(e,n){return t(n)?LM(e,n):null}))}var BM={Alt:[18,function(e){return e.altKey}],Control:[17,function(e){return e.ctrlKey}],Shift:[16,function(e){return e.shiftKey}],Meta:[91,function(e){return e.metaKey}]},qM={style:"cursor: crosshair"};function FM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ki(BM[e.key||"Alt"],2),n=t[0],r=t[1],i=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.isDown=!1}return Li(e,[{key:"set",value:function(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}}]),e}(),{eventHandlers:{keydown:function(e){this.set(e.keyCode==n||r(e))},keyup:function(e){e.keyCode!=n&&r(e)||this.set(!1)}}});return[i,GP.contentAttributes.of((function(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.isDown)?qM:null}))]}var VM=function(){function e(t,n,r){Ri(this,e),this.facet=n,this.createTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter((function(e){return e})),this.tooltipViews=this.tooltips.map(r)}return Li(e,[{key:"update",value:function(e){var t=e.state.facet(this.facet),n=t.filter((function(e){return e}));if(t===this.input){var r,i=bi(this.tooltipViews);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.update&&o.update(e)}}catch(e){i.e(e)}finally{i.f()}return!1}for(var a=[],s=0;sn.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&n.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}return Li(e,[{key:"createContainer",value:function(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}},{key:"observeIntersection",value:function(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var e,t=bi(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){var n=e.value;this.intersectionObserver.observe(n.dom)}}catch(e){t.e(e)}finally{t.f()}}}},{key:"measureSoon",value:function(){var e=this;this.measureTimeout<0&&(this.measureTimeout=setTimeout((function(){e.measureTimeout=-1,e.maybeMeasure()}),50))}},{key:"update",value:function(e){e.transactions.length&&(this.lastTransaction=Date.now());var t=this.manager.update(e);t&&this.observeIntersection();var n=t||e.geometryChanged,r=e.state.facet(HM);if(r.position!=this.position){this.position=r.position;var i,o=bi(this.manager.tooltipViews);try{for(o.s();!(i=o.n()).done;){i.value.dom.style.position=this.position}}catch(e){o.e(e)}finally{o.f()}n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();var a,s=bi(this.manager.tooltipViews);try{for(s.s();!(a=s.n()).done;){var u=a.value;this.container.appendChild(u.dom)}}catch(e){s.e(e)}finally{s.f()}n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}},{key:"createTooltip",value:function(e){var t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){var n=document.createElement("div");n.className="cm-tooltip-arrow",t.dom.appendChild(n)}return t.dom.style.position=this.position,t.dom.style.top="-10000px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}},{key:"destroy",value:function(){var e;this.view.win.removeEventListener("resize",this.measureSoon);var t,n=bi(this.manager.tooltipViews);try{for(n.s();!(t=n.n()).done;){t.value.dom.remove()}}catch(e){n.e(e)}finally{n.f()}null===(e=this.intersectionObserver)||void 0===e||e.disconnect(),clearTimeout(this.measureTimeout)}},{key:"readMeasure",value:function(){var e=this,t=this.view.dom.getBoundingClientRect();return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((function(t,n){var r=e.manager.tooltipViews[n];return r.getCoords?r.getCoords(t.pos):e.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((function(e){return e.dom.getBoundingClientRect()})),space:this.view.state.facet(HM).tooltipSpace(this.view)}}},{key:"writeMeasure",value:function(e){for(var t=e.editor,n=e.space,r=[],i=0;i=Math.min(t.bottom,n.bottom)||u.rightMath.min(t.right,n.right)+.1)s.style.top="-10000px";else{var l=o.arrow?a.dom.querySelector(".cm-tooltip-arrow"):null,f=l?7:0,h=c.right-c.left,d=c.bottom-c.top,v=a.offset||KM,p=this.view.textDirection==KO.LTR,m=c.width>n.right-n.left?p?n.left:n.right-c.width:p?Math.min(u.left-(l?14:0)+v.x,n.right-h):Math.max(n.left,u.left-h+(l?14:0)-v.x),g=!!o.above;!o.strictSide&&(g?u.top-(c.bottom-c.top)-v.yn.bottom)&&g==n.bottom-u.bottom>u.top-n.top&&(g=!g);var y=g?u.top-d-f-v.y:u.bottom+f+v.y,b=m+h;if(!0!==a.overlap){var k,w=bi(r);try{for(w.s();!(k=w.n()).done;){var j=k.value;j.leftm&&j.topy&&(y=g?j.top-d-2-f:j.bottom+f+2)}}catch(e){w.e(e)}finally{w.f()}}"absolute"==this.position?(s.style.top=y-e.parent.top+"px",s.style.left=m-e.parent.left+"px"):(s.style.top=y+"px",s.style.left=m+"px"),l&&(l.style.left="".concat(u.left+(p?v.x:-v.x)-(m+14-7),"px")),!0!==a.overlap&&r.push({left:m,top:y,right:b,bottom:y+d}),s.classList.toggle("cm-tooltip-above",g),s.classList.toggle("cm-tooltip-below",!g),a.positioned&&a.positioned()}}}},{key:"maybeMeasure",value:function(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var e,t=bi(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){e.value.dom.style.top="-10000px"}}catch(e){t.e(e)}finally{t.f()}}}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),UM=GP.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"".concat(7,"px"),width:"".concat(14,"px"),position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"".concat(7,"px solid transparent"),borderRight:"".concat(7,"px solid transparent")},".cm-tooltip-above &":{bottom:"-".concat(7,"px"),"&:before":{borderTop:"".concat(7,"px solid #bbb")},"&:after":{borderTop:"".concat(7,"px solid #f5f5f5"),bottom:"1px"}},".cm-tooltip-below &":{top:"-".concat(7,"px"),"&:before":{borderBottom:"".concat(7,"px solid #bbb")},"&:after":{borderBottom:"".concat(7,"px solid #f5f5f5"),top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),KM={x:0,y:0},GM=W_.define({enables:[JM,UM]}),QM=W_.define(),YM=function(){function e(t){var n=this;Ri(this,e),this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new VM(t,QM,(function(e){return n.createHostedView(e)}))}return Li(e,[{key:"createHostedView",value:function(e){var t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}},{key:"mount",value:function(e){var t,n=bi(this.manager.tooltipViews);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.mount&&r.mount(e)}}catch(e){n.e(e)}finally{n.f()}this.mounted=!0}},{key:"positioned",value:function(){var e,t=bi(this.manager.tooltipViews);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.positioned&&n.positioned()}}catch(e){t.e(e)}finally{t.f()}}},{key:"update",value:function(e){this.manager.update(e)}}],[{key:"create",value:function(t){return new e(t)}}]),e}(),ZM=GM.compute([QM],(function(e){var t=e.facet(QM).filter((function(e){return e}));return 0===t.length?null:{pos:Math.min.apply(Math,Ti(t.map((function(e){return e.pos})))),end:Math.max.apply(Math,Ti(t.filter((function(e){return null!=e.end})).map((function(e){return e.end})))),create:YM.create,above:t[0].above,arrow:t.some((function(e){return e.arrow}))}})),XM=function(){function e(t,n,r,i,o){Ri(this,e),this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return Li(e,[{key:"update",value:function(){var e=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((function(){return e.startHover()}),20))}},{key:"active",get:function(){return this.view.state.field(this.field)}},{key:"checkHover",value:function(){if(this.hoverTimeout=-1,!this.active){var e=Date.now()-this.lastMove.time;er.bottom||t.xr.right+this.view.defaultCharacterWidth)){var i=this.view.bidiSpans(this.view.state.doc.lineAt(n)).find((function(e){return e.from<=n&&e.to>=n})),o=i&&i.dir==KO.RTL?-1:1,a=this.source(this.view,n,t.x1&&void 0!==arguments[1]?arguments[1]:{},n=bC.define(),r=Q_.define({create:function(){return null},update:function(e,r){if(e&&(t.hideOnChange&&(r.docChanged||r.selection)||t.hideOn&&t.hideOn(r,e)))return null;if(e&&r.docChanged){var i=r.changes.mapPos(e.pos,-1,M_.TrackDel);if(null==i)return null;var o=Object.assign(Object.create(null),e);o.pos=i,null!=e.end&&(o.end=r.changes.mapPos(e.end)),e=o}var a,s=bi(r.effects);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.is(n)&&(e=u.value),u.is(nA)&&(e=null)}}catch(e){s.e(e)}finally{s.f()}return e},provide:function(e){return QM.from(e)}});return[r,LO.define((function(i){return new XM(i,e,r,n,t.hoverTime||300)})),ZM]}function tA(e,t){var n=e.plugin(JM);if(!n)return null;var r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var nA=bC.define(),rA=W_.define({combine:function(e){var t,n,r,i=bi(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;t=t||o.topContainer,n=n||o.bottomContainer}}catch(e){i.e(e)}finally{i.f()}return{topContainer:t,bottomContainer:n}}});function iA(e,t){var n=e.plugin(oA),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var oA=LO.fromClass(function(){function e(t){Ri(this,e),this.input=t.state.facet(uA),this.specs=this.input.filter((function(e){return e})),this.panels=this.specs.map((function(e){return e(t)}));var n=t.state.facet(rA);this.top=new aA(t,!0,n.topContainer),this.bottom=new aA(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 r,i=bi(this.panels);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.dom.classList.add("cm-panel"),o.mount&&o.mount()}}catch(e){i.e(e)}finally{i.f()}}return Li(e,[{key:"update",value:function(e){var t=e.state.facet(rA);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new aA(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new aA(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var n=e.state.facet(uA);if(n!=this.input){var r,i=n.filter((function(e){return e})),o=[],a=[],s=[],u=[],c=bi(i);try{for(c.s();!(r=c.n()).done;){var l=r.value,f=this.specs.indexOf(l),h=void 0;f<0?(h=l(e.view),u.push(h)):(h=this.panels[f]).update&&h.update(e),o.push(h),(h.top?a:s).push(h)}}catch(e){c.e(e)}finally{c.f()}this.specs=i,this.panels=o,this.top.sync(a),this.bottom.sync(s);for(var d=0,v=u;dthis.i;){var t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}]),e}(),kA=function(){function e(t,n){var r=this;Ri(this,e),this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");var i=function(e){r.dom.addEventListener(e,(function(r){var i=t.lineBlockAtHeight(r.clientY-t.documentTop);n.domEventHandlers[e](t,i,r)&&r.preventDefault()}))};for(var o in n.domEventHandlers)i(o);this.markers=gA(n.markers(t)),n.initialSpacer&&(this.spacer=new wA(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}return Li(e,[{key:"update",value:function(e){var t=this.markers;if(this.markers=gA(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){var n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}var r=e.view.viewport;return!DC.eq(this.markers,t,r.from,r.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}},{key:"destroy",value:function(){var e,t=bi(this.elements);try{for(t.s();!(e=t.n()).done;){e.value.destroy()}}catch(e){t.e(e)}finally{t.f()}}}]),e}(),wA=function(){function e(t,n,r,i){Ri(this,e),this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}return Li(e,[{key:"update",value:function(e,t,n,r){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return[xA.of(e),pA(),CA]}function OA(e){for(var t=9;tr&&(r=a,n.push(EA.range(a)))}}catch(e){i.e(e)}finally{i.f()}return DC.of(n)}));var MA=0,AA=Li((function e(t,n){Ri(this,e),this.from=t,this.to=n})),TA=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ri(this,e),this.id=MA++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function")}}return Li(e,[{key:"add",value:function(e){var t=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=IA.match(e)),function(n){var r=e(n);return void 0===r?null:[t,r]}}}]),e}();TA.closedBy=new TA({deserialize:function(e){return e.split(" ")}}),TA.openedBy=new TA({deserialize:function(e){return e.split(" ")}}),TA.group=new TA({deserialize:function(e){return e.split(" ")}}),TA.contextHash=new TA({perNode:!0}),TA.lookAhead=new TA({perNode:!0}),TA.mounted=new TA({perNode:!0});var NA=Object.create(null),IA=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Ri(this,e),this.name=t,this.props=n,this.id=r,this.flags=i}return Li(e,[{key:"prop",value:function(e){return this.props[e.id]}},{key:"isTop",get:function(){return(1&this.flags)>0}},{key:"isSkipped",get:function(){return(2&this.flags)>0}},{key:"isError",get:function(){return(4&this.flags)>0}},{key:"isAnonymous",get:function(){return(8&this.flags)>0}},{key:"is",value:function(e){if("string"==typeof e){if(this.name==e)return!0;var t=this.prop(TA.group);return!!t&&t.indexOf(e)>-1}return this.id==e}}],[{key:"define",value:function(t){var n=t.props&&t.props.length?Object.create(null):NA,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),i=new e(t.name||"",n,t.id,r);if(t.props){var o,a=bi(t.props);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}}catch(e){a.e(e)}finally{a.f()}}return i}},{key:"match",value:function(e){var t=Object.create(null);for(var n in e){var r,i=bi(n.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value;t[o]=e[n]}}catch(e){i.e(e)}finally{i.f()}}return function(e){for(var n=e.prop(TA.group),r=-1;r<(n?n.length:0);r++){var i=t[r<0?e.name:n[r]];if(i)return i}}}}]),e}();IA.none=new IA("",Object.create(null),0,8);var RA,DA=function(){function e(t){Ri(this,e),this.types=t;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0;return new YA(this.topNode,e)}},{key:"cursorAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=LA.get(this)||this.topNode,r=new YA(n);return r.moveTo(e,t),LA.set(this,r._tree),r}},{key:"topNode",get:function(){return new JA(this,0,0,null)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=HA(LA.get(this)||this.topNode,e,t,!1);return LA.set(this,n),n}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=HA(zA.get(this)||this.topNode,e,t,!0);return zA.set(this,n),n}},{key:"iterate",value:function(e){for(var t=e.enter,n=e.leave,r=e.from,i=void 0===r?0:r,o=e.to,a=void 0===o?this.length:o,s=this.cursor((e.mode||0)|RA.IncludeAnonymous);;){var u=!1;if(s.from<=a&&s.to>=i&&(s.type.isAnonymous||!1!==t(s))){if(s.firstChild())continue;u=!0}for(;u&&n&&!s.type.isAnonymous&&n(s),!s.nextSibling();){if(!s.parent())return;u=!0}}}},{key:"prop",value:function(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}},{key:"propValues",get:function(){var e=[];if(this.props)for(var t in this.props)e.push([+t,this.props[t]]);return e}},{key:"balance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.children.length<=8?this:nT(IA.none,this.children,this.positions,0,this.children.length,0,this.length,(function(n,r,i){return new e(t.type,n,r,i,t.propValues)}),n.makeTree||function(t,n,r){return new e(IA.none,t,n,r)})}}],[{key:"build",value:function(e){return XA(e)}}]),e}();BA.empty=new BA(IA.none,[],[],0);var qA=function(){function e(t,n){Ri(this,e),this.buffer=t,this.index=n}return Li(e,[{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"pos",get:function(){return this.index}},{key:"next",value:function(){this.index-=4}},{key:"fork",value:function(){return new e(this.buffer,this.index)}}]),e}(),FA=function(){function e(t,n,r){Ri(this,e),this.buffer=t,this.length=n,this.set=r}return Li(e,[{key:"type",get:function(){return IA.none}},{key:"toString",value:function(){for(var e=[],t=0;t0));s=o[s+3]);return a}},{key:"slice",value:function(t,n,r,i){for(var o=this.buffer,a=new Uint16Array(n-t),s=t,u=0;s=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function WA(e,t){for(var n=e.childBefore(t);n;){var r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(e=n,n=r.prevSibling):n=r}return e}function HA(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to4&&void 0!==arguments[4]?arguments[4]:0,a=this;;){for(var s=a._tree,u=s.children,c=s.positions,l=n>0?u.length:-1;t!=l;t+=n){var f=u[t],h=c[t]+a.from;if(VA(i,r,h,h+f.length))if(f instanceof FA){if(o&RA.ExcludeBuffers)continue;var d=f.findChild(0,f.buffer.length,n,r-h,i);if(d>-1)return new QA(new GA(a,f,t,h),null,d)}else if(o&RA.IncludeAnonymous||!f.type.isAnonymous||ZA(f)){var v=void 0;if(!(o&RA.IgnoreMounts)&&f.props&&(v=f.prop(TA.mounted))&&!v.overlay)return new e(v.tree,h,t,a);var p=new e(f,h,t,a);return o&RA.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?f.children.length-1:0,n,r,i)}}if(o&RA.IncludeAnonymous||!a.type.isAnonymous)return null;if(t=a.index>=0?a.index+n:n<0?-1:a._parent._tree.children.length,!(a=a._parent))return null}}},{key:"firstChild",get:function(){return this.nextChild(0,1,0,4)}},{key:"lastChild",get:function(){return this.nextChild(this._tree.children.length-1,-1,0,4)}},{key:"childAfter",value:function(e){return this.nextChild(0,1,e,2)}},{key:"childBefore",value:function(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}},{key:"enter",value:function(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(i&RA.IgnoreOverlays)&&(r=this._tree.prop(TA.mounted))&&r.overlay){var o,a=t-this.from,s=bi(r.overlay);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.from,l=u.to;if((n>0?c<=a:c=a:l>a))return new e(r.tree,r.overlay[0].from+this.from,-1,this)}}catch(e){s.e(e)}finally{s.f()}}return this.nextChild(0,1,t,n,i)}},{key:"nextSignificantParent",value:function(){for(var e=this;e.type.isAnonymous&&e._parent;)e=e._parent;return e}},{key:"parent",get:function(){return this._parent?this._parent.nextSignificantParent():null}},{key:"nextSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}},{key:"prevSibling",get:function(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}},{key:"cursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new YA(this,e)}},{key:"tree",get:function(){return this._tree}},{key:"toTree",value:function(){return this._tree}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return HA(this,e,t,!1)}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return HA(this,e,t,!0)}},{key:"enterUnfinishedNodesBefore",value:function(e){return WA(this,e)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=UA(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return UA(this,e,t,n)}},{key:"toString",value:function(){return this._tree.toString()}},{key:"node",get:function(){return this}},{key:"matchContext",value:function(e){return KA(this,e)}}]),e}();function UA(e,t,n,r){var i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function KA(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length-1,r=e.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var GA=Li((function e(t,n,r,i){Ri(this,e),this.parent=t,this.buffer=n,this.index=r,this.start=i})),QA=function(){function e(t,n,r){Ri(this,e),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}return Li(e,[{key:"name",get:function(){return this.type.name}},{key:"from",get:function(){return this.context.start+this.context.buffer.buffer[this.index+1]}},{key:"to",get:function(){return this.context.start+this.context.buffer.buffer[this.index+2]}},{key:"child",value:function(t,n,r){var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new e(this.context,this,o)}},{key:"firstChild",get:function(){return this.child(1,0,4)}},{key:"lastChild",get:function(){return this.child(-1,0,4)}},{key:"childAfter",value:function(e){return this.child(1,e,2)}},{key:"childBefore",value:function(e){return this.child(-1,e,-2)}},{key:"enter",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r&RA.ExcludeBuffers)return null;var i=this.context.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new e(this.context,this,o)}},{key:"parent",get:function(){return this._parent||this.context.parent.nextSignificantParent()}},{key:"externalSibling",value:function(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}},{key:"nextSibling",get:function(){var t=this.context.buffer,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}},{key:"prevSibling",get:function(){var t=this.context.buffer,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}},{key:"cursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new YA(this,e)}},{key:"tree",get:function(){return null}},{key:"toTree",value:function(){var e=[],t=[],n=this.context.buffer,r=this.index+4,i=n.buffer[this.index+3];if(i>r){var o=n.buffer[this.index+1],a=n.buffer[this.index+2];e.push(n.slice(r,i,o,a)),t.push(0)}return new BA(this.type,e,t,this.to-this.from)}},{key:"resolve",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return HA(this,e,t,!1)}},{key:"resolveInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return HA(this,e,t,!0)}},{key:"enterUnfinishedNodesBefore",value:function(e){return WA(this,e)}},{key:"toString",value:function(){return this.context.buffer.childString(this.index)}},{key:"getChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=UA(this,e,t,n);return r.length?r[0]:null}},{key:"getChildren",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return UA(this,e,t,n)}},{key:"node",get:function(){return this}},{key:"matchContext",value:function(e){return KA(this,e)}}]),e}(),YA=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(Ri(this,e),this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof JA)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}return Li(e,[{key:"name",get:function(){return this.type.name}},{key:"yieldNode",value:function(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}},{key:"yieldBuf",value:function(e,t){this.index=e;var n=this.buffer,r=n.start,i=n.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}},{key:"yield",value:function(e){return!!e&&(e instanceof JA?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}},{key:"toString",value:function(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}},{key:"enterChild",value:function(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));var r=this.buffer.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}},{key:"firstChild",value:function(){return this.enterChild(1,0,4)}},{key:"lastChild",value:function(){return this.enterChild(-1,0,4)}},{key:"childAfter",value:function(e){return this.enterChild(1,e,2)}},{key:"childBefore",value:function(e){return this.enterChild(-1,e,-2)}},{key:"enter",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.mode;return this.buffer?!(n&RA.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}},{key:"parent",value:function(){if(!this.buffer)return this.yieldNode(this.mode&RA.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var e=this.mode&RA.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}},{key:"sibling",value:function(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));var t=this.buffer.buffer,n=this.stack.length-1;if(e<0){var r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{var i=t.buffer[this.index+3];if(i<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}},{key:"nextSibling",value:function(){return this.sibling(1)}},{key:"prevSibling",value:function(){return this.sibling(-1)}},{key:"atLastNode",value:function(e){var t,n,r=this.buffer;if(r){if(e>0){if(this.index-1)for(var s=t+e,u=e<0?-1:n._tree.children.length;s!=u;s+=e){var c=n._tree.children[s];if(this.mode&RA.IncludeAnonymous||c instanceof FA||!c.type.isAnonymous||ZA(c))return!1}}return!0}},{key:"move",value:function(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}},{key:"next",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(1,e)}},{key:"prev",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.move(-1,e)}},{key:"moveTo",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(var o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(var a=n;a=0;i--){if(i<0)return KA(this.node,e,r);var o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}]),e}();function ZA(e){return e.children.some((function(e){return e instanceof FA||!e.type.isAnonymous||ZA(e)}))}function XA(e){var t,n=e.buffer,r=e.nodeSet,i=e.maxBufferLength,o=void 0===i?1024:i,a=e.reused,s=void 0===a?[]:a,u=e.minRepeatType,c=void 0===u?r.types.length:u,l=Array.isArray(n)?new qA(n,n.length):n,f=r.types,h=0,d=0;function v(e,t,n,i,a){for(var u=l.id,y=l.start,b=l.end,k=l.size,w=d;k<0;){if(l.next(),-1==k){var j=s[u];return n.push(j),void i.push(y-e)}if(-3==k)return void(h=u);if(-4==k)return void(d=u);throw new RangeError("Unrecognized record size: ".concat(k))}var x,S,_=f[u],C=y-e;if(b-y<=o&&(S=function(e,t){var n=l.fork(),r=0,i=0,a=0,s=n.end-o,u={size:0,start:0,skip:0};e:for(var f=n.pos-e;n.pos>f;){var h=n.size;if(n.id==t&&h>=0)u.size=r,u.start=i,u.skip=a,a+=4,r+=4,n.next();else{var d=n.pos-h;if(h<0||d=c?4:0,p=n.start;for(n.next();n.pos>d;){if(n.size<0){if(-3!=n.size)break e;v+=4}else n.id>=c&&(v+=4);n.next()}i=p,r+=h,a+=v}}(t<0||r==e)&&(u.size=r,u.start=i,u.skip=a);return u.size>4?u:void 0}(l.pos-t,a))){for(var $=new Uint16Array(S.size-S.skip),O=l.pos-S.size,E=$.length;l.pos>O;)E=g(S.start,$,E);x=new FA($,b-S.start,r),C=S.start-e}else{var P=l.pos-k;l.next();for(var M=[],A=[],T=u>=c?u:-1,N=0,I=b;l.pos>P;)T>=0&&l.id==T&&l.size>=0?(l.end<=I-o&&(p(M,A,y,N,l.end,I,T,w),N=M.length,I=l.end),l.next()):v(y,P,M,A,T);if(T>=0&&N>0&&N-1&&N>0){var R=function(e){return function(t,n,r){var i,o,a=0,s=t.length-1;if(s>=0&&(i=t[s])instanceof BA){if(!s&&i.type==e&&i.length==r)return i;(o=i.prop(TA.lookAhead))&&(a=n[s]+i.length+o)}return m(e,t,n,r,a)}}(_);x=nT(_,M,A,0,M.length,0,b-y,R,R)}else x=m(_,M,A,b-y,w-b)}n.push(x),i.push(C)}function p(e,t,n,i,o,a,s,u){for(var c=[],l=[];e.length>i;)c.push(e.pop()),l.push(t.pop()+n-o);e.push(m(r.types[s],c,l,a-o,u-a)),t.push(o-n)}function m(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;if(h){var a=[TA.contextHash,h];o=o?[a].concat(o):[a]}if(i>25){var s=[TA.lookAhead,i];o=o?[s].concat(o):[s]}return new BA(e,t,n,r,o)}function g(e,t,n){var r=l.id,i=l.start,o=l.end,a=l.size;if(l.next(),a>=0&&r4)for(var u=l.pos-(a-4);l.pos>u;)n=g(e,t,n);t[--n]=s,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==a?h=r:-4==a&&(d=r);return n}for(var y=[],b=[];l.pos>0;)v(e.start||0,e.bufferStart||0,y,b,-1);var k=null!==(t=e.length)&&void 0!==t?t:y.length?b[0]+y[0].length:0;return new BA(f[e.topID],y.reverse(),b.reverse(),k)}var eT=new WeakMap;function tT(e,t){if(!e.isAnonymous||t instanceof FA||t.type!=e)return 1;var n=eT.get(t);if(null==n){n=1;var r,i=bi(t.children);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.type!=e||!(o instanceof BA)){n=1;break}n+=tT(e,o)}}catch(e){i.e(e)}finally{i.f()}eT.set(t,n)}return n}function nT(e,t,n,r,i,o,a,s,u){for(var c=0,l=r;l=f)break;p+=m}if(c==l+1){if(p>f){var g=n[l];t(g.children,g.positions,0,g.children.length,r[l]+s);continue}h.push(n[l])}else{var y=r[c-1]+n[c-1].length-v;h.push(nT(e,n,r,l,c,v,y,null,u))}d.push(v+s-o)}}(t,n,r,i,0),(s||u)(h,d,a)}var rT=function(){function e(t,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];Ri(this,e),this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(a?2:0)}return Li(e,[{key:"openStart",get:function(){return(1&this.open)>0}},{key:"openEnd",get:function(){return(2&this.open)>0}}],[{key:"addTree",value:function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=[new e(0,t.length,t,0,!1,i)],a=bi(r);try{for(a.s();!(n=a.n()).done;){var s=n.value;s.to>t.length&&o.push(s)}}catch(e){a.e(e)}finally{a.f()}return o}},{key:"applyChanges",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:128;if(!n.length)return t;for(var i=[],o=1,a=t.length?t[0]:null,s=0,u=0,c=0;;s++){var l=s=r)for(;a&&a.from=h.from||f<=h.to||c){var d=Math.max(h.from,u)-c,v=Math.min(h.to,f)-c;h=d>=v?null:new e(d,v,h.tree,h.offset+c,s>0,!!l)}if(h&&i.push(h),a.to>f)break;a=o-1?t:cT.get(t.base||t,t.modified.concat(e).sort((function(e,t){return e.id-t.id})))}}}]),e}(),uT=0,cT=function(){function e(){Ri(this,e),this.instances=[],this.id=uT++}return Li(e,null,[{key:"get",value:function(t,n){if(!n.length)return t;var r=n[0].instances.find((function(e){return e.base==t&&(r=n,i=e.modified,r.length==i.length&&r.every((function(e,t){return e==i[t]})));var r,i}));if(r)return r;var i,o=[],a=new sT(o,t,n),s=bi(n);try{for(s.s();!(i=s.n()).done;){i.value.instances.push(a)}}catch(e){s.e(e)}finally{s.f()}var u,c=lT(n),l=bi(t.set);try{for(l.s();!(u=l.n()).done;){var f,h=u.value,d=bi(c);try{for(d.s();!(f=d.n()).done;){var v=f.value;o.push(e.get(h,v))}}catch(e){d.e(e)}finally{d.f()}}}catch(e){l.e(e)}finally{l.f()}return a}}]),e}();function lT(e){for(var t=[e],n=0;n0&&l+3==a.length){u=1;break}var f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!f)throw new RangeError("Invalid path: "+a);if(s.push("*"==f[0]?"":'"'==f[0][0]?JSON.parse(f[0]):f[0]),(l+=f[0].length)==a.length)break;var h=a[l++];if(l==a.length&&"!"==h){u=0;break}if("/"!=h)throw new RangeError("Invalid path: "+a);c=a.slice(l)}var d=s.length-1,v=s[d];if(!v)throw new RangeError("Invalid path: "+a);var p=new dT(r,u,d>0?s.slice(0,d):null);t[v]=p.sort(t[v])}}}catch(e){o.e(e)}finally{o.f()}}return hT.add(t)}var hT=new TA,dT=function(){function e(t,n,r,i){Ri(this,e),this.tags=t,this.mode=n,this.context=r,this.next=i}return Li(e,[{key:"sort",value:function(e){return!e||e.depth3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.length,o=new yT(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}var gT,yT=function(){function e(t,n,r){Ri(this,e),this.at=t,this.highlighters=n,this.span=r,this.class=""}return Li(e,[{key:"startSpan",value:function(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}},{key:"flush",value:function(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}},{key:"highlightRange",value:function(e,t,n,r,i){var o=e.type,a=e.from,s=e.to;if(!(a>=n||s<=t)){o.isTop&&(i=this.highlighters.filter((function(e){return!e.scope||e.scope(o)})));for(var u=r,c=o.prop(hT),l=!1;c;){if(!c.context||e.matchContext(c.context)){var f=pT(i,c.tags);f&&(u&&(u+=" "),u+=f,1==c.mode?r+=(r?" ":"")+f:0==c.mode&&(l=!0));break}c=c.next}if(this.startSpan(e.from,u),!l){var h=e.tree&&e.tree.prop(TA.mounted);if(h&&h.overlay){for(var d=e.node.enter(h.overlay[0].from+a,1),v=this.highlighters.filter((function(e){return!e.scope||e.scope(h.tree.type)})),p=e.firstChild(),m=0,g=a;;m++){var y=m=b)&&e.nextSibling()););if(!y||b>n)break;(g=y.to+a)>t&&(this.highlightRange(d.cursor(),Math.max(t,y.from+a),Math.min(n,g),r,v),this.startSpan(g,u))}p&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),u)}}while(e.nextSibling());e.parent()}}}}}]),e}(),bT=sT.define,kT=bT(),wT=bT(),jT=bT(wT),xT=bT(wT),ST=bT(),_T=bT(ST),CT=bT(ST),$T=bT(),OT=bT($T),ET=bT(),PT=bT(),MT=bT(),AT=bT(MT),TT=bT(),NT={comment:kT,lineComment:bT(kT),blockComment:bT(kT),docComment:bT(kT),name:wT,variableName:bT(wT),typeName:jT,tagName:bT(jT),propertyName:xT,attributeName:bT(xT),className:bT(wT),labelName:bT(wT),namespace:bT(wT),macroName:bT(wT),literal:ST,string:_T,docString:bT(_T),character:bT(_T),attributeValue:bT(_T),number:CT,integer:bT(CT),float:bT(CT),bool:bT(ST),regexp:bT(ST),escape:bT(ST),color:bT(ST),url:bT(ST),keyword:ET,self:bT(ET),null:bT(ET),atom:bT(ET),unit:bT(ET),modifier:bT(ET),operatorKeyword:bT(ET),controlKeyword:bT(ET),definitionKeyword:bT(ET),moduleKeyword:bT(ET),operator:PT,derefOperator:bT(PT),arithmeticOperator:bT(PT),logicOperator:bT(PT),bitwiseOperator:bT(PT),compareOperator:bT(PT),updateOperator:bT(PT),definitionOperator:bT(PT),typeOperator:bT(PT),controlOperator:bT(PT),punctuation:MT,separator:bT(MT),bracket:AT,angleBracket:bT(AT),squareBracket:bT(AT),paren:bT(AT),brace:bT(AT),content:$T,heading:OT,heading1:bT(OT),heading2:bT(OT),heading3:bT(OT),heading4:bT(OT),heading5:bT(OT),heading6:bT(OT),contentSeparator:bT($T),list:bT($T),quote:bT($T),emphasis:bT($T),strong:bT($T),link:bT($T),monospace:bT($T),strikethrough:bT($T),inserted:bT(),deleted:bT(),changed:bT(),invalid:bT(),meta:TT,documentMeta:bT(TT),annotation:bT(TT),processingInstruction:bT(TT),definition:sT.defineModifier(),constant:sT.defineModifier(),function:sT.defineModifier(),standard:sT.defineModifier(),local:sT.defineModifier(),special:sT.defineModifier()};vT([{tag:NT.link,class:"tok-link"},{tag:NT.heading,class:"tok-heading"},{tag:NT.emphasis,class:"tok-emphasis"},{tag:NT.strong,class:"tok-strong"},{tag:NT.keyword,class:"tok-keyword"},{tag:NT.atom,class:"tok-atom"},{tag:NT.bool,class:"tok-bool"},{tag:NT.url,class:"tok-url"},{tag:NT.labelName,class:"tok-labelName"},{tag:NT.inserted,class:"tok-inserted"},{tag:NT.deleted,class:"tok-deleted"},{tag:NT.literal,class:"tok-literal"},{tag:NT.string,class:"tok-string"},{tag:NT.number,class:"tok-number"},{tag:[NT.regexp,NT.escape,NT.special(NT.string)],class:"tok-string2"},{tag:NT.variableName,class:"tok-variableName"},{tag:NT.local(NT.variableName),class:"tok-variableName tok-local"},{tag:NT.definition(NT.variableName),class:"tok-variableName tok-definition"},{tag:NT.special(NT.variableName),class:"tok-variableName2"},{tag:NT.definition(NT.propertyName),class:"tok-propertyName tok-definition"},{tag:NT.typeName,class:"tok-typeName"},{tag:NT.namespace,class:"tok-namespace"},{tag:NT.className,class:"tok-className"},{tag:NT.macroName,class:"tok-macroName"},{tag:NT.propertyName,class:"tok-propertyName"},{tag:NT.operator,class:"tok-operator"},{tag:NT.comment,class:"tok-comment"},{tag:NT.meta,class:"tok-meta"},{tag:NT.invalid,class:"tok-invalid"},{tag:NT.punctuation,class:"tok-punctuation"}]);var IT=new TA;var RT=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Ri(this,e),this.data=t,MC.prototype.hasOwnProperty("tree")||Object.defineProperty(MC.prototype,"tree",{get:function(){return zT(this)}}),this.parser=n,this.extension=[KT.of(this),MC.languageData.of((function(e,t,n){return e.facet(DT(e,t,n))}))].concat(r)}return Li(e,[{key:"isActiveAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return DT(e,t,n)==this.data}},{key:"findRegions",value:function(e){var t=this,n=e.facet(KT);if((null==n?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];var r=[];return function e(n,i){if(n.prop(IT)!=t.data){var o=n.prop(TA.mounted);if(o){if(o.tree.prop(IT)==t.data){if(o.overlay){var a,s=bi(o.overlay);try{for(s.s();!(a=s.n()).done;){var u=a.value;r.push({from:u.from+i,to:u.to+i})}}catch(e){s.e(e)}finally{s.f()}}else r.push({from:i,to:i+n.length});return}if(o.overlay){var c=r.length;if(e(o.tree,o.overlay[0].from+i),r.length>c)return}}for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:t.length;Ri(this,e),this.doc=t,this.length=n,this.cursorPos=0,this.string="",this.cursor=t.iter()}return Li(e,[{key:"syncTo",value:function(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}},{key:"chunk",value:function(e){return this.syncTo(e),this.string}},{key:"lineChunks",get:function(){return!0}},{key:"read",value:function(e,t){var n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}]),e}(),qT=null,FT=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;Ri(this,e),this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=a,this.skipped=s,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}return Li(e,[{key:"startParse",value:function(){return this.parser.startParse(new BT(this.state.doc),this.fragments)}},{key:"work",value:function(e,t){var n=this;return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=BA.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((function(){var r;if("number"==typeof e){var i=Date.now()+e;e=function(){return Date.now()>i}}for(n.parse||(n.parse=n.startParse()),null!=t&&(null==n.parse.stoppedAt||n.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((function(){for(;!(t=n.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(rT.addTree(this.tree,this.fragments,!0)),this.parse=null)}},{key:"withContext",value:function(e){var t=qT;qT=this;try{return e()}finally{qT=t}}},{key:"withoutTempSkipped",value:function(e){for(var t;t=this.tempSkipped.pop();)e=VT(e,t.from,t.to);return e}},{key:"changes",value:function(t,n){var r=this.fragments,i=this.tree,o=this.treeLen,a=this.viewport,s=this.skipped;if(this.takeTree(),!t.empty){var u=[];if(t.iterChangedRanges((function(e,t,n,r){return u.push({fromA:e,toA:t,fromB:n,toB:r})})),r=rT.applyChanges(r,u),i=BA.empty,o=0,a={from:t.mapPos(a.from,-1),to:t.mapPos(a.to,1)},this.skipped.length){s=[];var c,l=bi(this.skipped);try{for(l.s();!(c=l.n()).done;){var f=c.value,h=t.mapPos(f.from,1),d=t.mapPos(f.to,-1);he.from&&(this.fragments=VT(this.fragments,i,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}},{key:"reset",value:function(){this.parse&&(this.takeTree(),this.parse=null)}},{key:"skipUntilInView",value:function(e,t){this.skipped.push({from:e,to:t})}},{key:"isDone",value:function(e){e=Math.min(e,this.state.doc.length);var t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}}],[{key:"create",value:function(t,n,r){return new e(t,n,[],BA.empty,0,r,[],null)}},{key:"getSkippingParser",value:function(e){return new(function(t){Ci(r,iT);var n=Oi(r);function r(){return Ri(this,r),n.apply(this,arguments)}return Li(r,[{key:"createParse",value:function(t,n,r){var i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance:function(){var t=qT;if(t){var n,a=bi(r);try{for(a.s();!(n=a.n()).done;){var s=n.value;t.tempSkipped.push(s)}}catch(e){a.e(e)}finally{a.f()}e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new BA(IA.none,[],[],o-i)},stoppedAt:null,stopAt:function(){}}}}]),r}())}},{key:"get",value:function(){return qT}}]),e}();function VT(e,t,n){return rT.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var WT=function(){function e(t){Ri(this,e),this.context=t,this.tree=t.tree}return Li(e,[{key:"apply",value:function(t){if(!t.docChanged&&this.tree==this.context.tree)return this;var n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}}],[{key:"init",value:function(t){var n=Math.min(3e3,t.doc.length),r=FT.create(t.facet(KT).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}}]),e}();RT.state=Q_.define({create:WT.init,update:function(e,t){var n,r=bi(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.is(RT.setState))return i.value}}catch(e){r.e(e)}finally{r.f()}return t.startState.facet(KT)!=t.state.facet(KT)?WT.init(t.state):e.apply(t)}});var HT=function(e){var t=setTimeout((function(){return e()}),500);return function(){return clearTimeout(t)}};"undefined"!=typeof requestIdleCallback&&(HT=function(e){var t=-1,n=setTimeout((function(){t=requestIdleCallback(e,{timeout:400})}),100);return function(){return t<0?clearTimeout(n):cancelIdleCallback(t)}});var JT="undefined"!=typeof navigator&&(null===(gT=navigator.scheduling)||void 0===gT?void 0:gT.isInputPending)?function(){return navigator.scheduling.isInputPending()}:null,UT=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}return Li(e,[{key:"update",value:function(e){var t=this.view.state.field(RT.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}},{key:"scheduleWork",value:function(){if(!this.working){var e=this.view.state,t=e.field(RT.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=HT(this.work))}}},{key:"work",value:function(e){this.working=null;var t=Date.now();if(this.chunkEndi+1e3,u=o.context.work((function(){return JT&&JT()||Date.now()>a}),i+(s?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:RT.setState.of(new WT(o.context))})),this.chunkBudget>0&&(!u||s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}}}},{key:"checkAsyncSchedule",value:function(e){var t=this;e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((function(){return t.scheduleWork()})).catch((function(e){return NO(t.view.state,e)})).then((function(){return t.workScheduled--})),e.scheduleOn=null)}},{key:"destroy",value:function(){this.working&&this.working()}},{key:"isWorking",value:function(){return!!(this.working||this.workScheduled>0)}}]),e}(),{eventHandlers:{focus:function(){this.scheduleWork()}}}),KT=W_.define({combine:function(e){return e.length?e[0]:null},enables:[RT.state,UT]}),GT=Li((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Ri(this,e),this.language=t,this.support=n,this.extension=[t,n]})),QT=W_.define(),YT=W_.define({combine:function(e){if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function ZT(e){var t=e.facet(YT);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function XT(e,t){var n="",r=e.tabSize;if(9==e.facet(YT).charCodeAt(0))for(;t>=r;)n+="\t",t-=r;for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};Ri(this,e),this.state=t,this.options=n,this.unit=ZT(t)}return Li(e,[{key:"lineAt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.state.doc.lineAt(e),r=this.options,i=r.simulateBreak,o=r.simulateDoubleBreak;return null!=i&&i>=n.from&&i<=n.to?o&&i==e?{text:"",from:e}:(t<0?i1&&void 0!==arguments[1]?arguments[1]:1;if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";var n=this.lineAt(e,t),r=n.text,i=n.from;return r.slice(e-i,Math.min(r.length,e+100-i))}},{key:"column",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}},{key:"countColumn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return QC(e,this.state.tabSize,t)}},{key:"lineIndent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.lineAt(e,t),r=n.text,i=n.from,o=this.options.overrideIndentation;if(o){var a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}},{key:"simulatedBreak",get:function(){return this.options.simulateBreak||null}}]),e}(),nN=new TA;function rN(e){var t=e.type.prop(nN);if(t)return t;var n,r=e.firstChild;if(r&&(n=r.type.prop(TA.closedBy))){var i=e.lastChild,o=i&&n.indexOf(i.name)>-1;return function(e){return function(e,t,n,r,i){var o=e.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==e.pos+a,u=t?function(e){var t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;for(var i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),a=null==i||i<=o.from?o.to:Math.min(o.to,i),s=n.to;;){var u=t.childAfter(s);if(!u||u==r)return null;if(!u.type.isSkipped)return u.from0&&void 0!==arguments[0]?arguments[0]:{},t=e.except,n=e.units,r=void 0===n?1:n;return function(e){var n=t&&t.test(e.textAfter);return e.baseIndent+(n?0:r*e.unit)}}var cN=W_.define(),lN=new TA;function fN(e,t,n){var r,i=bi(e.facet(cN));try{for(i.s();!(r=i.n()).done;){var o=(0,r.value)(e,t,n);if(o)return o}}catch(e){i.e(e)}finally{i.f()}return function(e,t,n){var r=zT(e);if(r.lengthn)){if(a&&s.from=t&&c.to>n&&(a=c)}}return a}(e,t,n)}function hN(e,t){var n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var dN=bC.define({map:hN}),vN=bC.define({map:hN});function pN(e){var t,n=[],r=bi(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.lineBlockAt(r))};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return n}var mN=Q_.define({create:function(){return vO.none},update:function(e,t){e=e.map(t.changes);var n,r=bi(t.effects);try{var i=function(){var t=n.value;t.is(dN)&&!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:[SN.range(t.value.from,t.value.to)]}):t.is(vN)&&(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(e){r.e(e)}finally{r.f()}if(t.selection){var o=!1,a=t.selection.main.head;e.between(a,a,(function(e,t){ea&&(o=!0)})),o&&(e=e.update({filterFrom:a,filterTo:a,filter:function(e,t){return t<=a||e>=a}}))}return e},provide:function(e){return GP.decorations.from(e)},toJSON:function(e,t){var n=[];return e.between(0,t.doc.length,(function(e,t){n.push(e,t)})),n},fromJSON:function(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");for(var t=[],n=0;ne)&&(i={from:e,to:t})})),i}function yN(e,t){return e.field(mN,!1)?t:t.concat(bC.appendConfig.of(xN()))}function bN(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return GP.announce.of("".concat(e.state.phrase(n?"Folded lines":"Unfolded lines")," ").concat(r," ").concat(e.state.phrase("to")," ").concat(i,"."))}var kN=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function(e){var t,n=bi(pN(e));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=fN(e.state,r.from,r.to);if(i)return e.dispatch({effects:yN(e.state,[dN.of(i),bN(e,i)])}),!0}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function(e){if(!e.state.field(mN,!1))return!1;var t,n=[],r=bi(pN(e));try{for(r.s();!(t=r.n()).done;){var i=t.value,o=gN(e.state,i.from,i.to);o&&n.push(vN.of(o),bN(e,o,!1))}}catch(e){r.e(e)}finally{r.f()}return n.length&&e.dispatch({effects:n}),n.length>0}},{key:"Ctrl-Alt-[",run:function(e){for(var t=e.state,n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},_N),e),n=new CN(t,!0),r=new CN(t,!1),i=LO.fromClass(function(){function e(t){Ri(this,e),this.from=t.viewport.from,this.markers=this.buildMarkers(t)}return Li(e,[{key:"update",value:function(e){(e.docChanged||e.viewportChanged||e.startState.facet(KT)!=e.state.facet(KT)||e.startState.field(mN,!1)!=e.state.field(mN,!1)||zT(e.startState)!=zT(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}},{key:"buildMarkers",value:function(e){var t,i=new zC,o=bi(e.viewportLineBlocks);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=gN(e.state,a.from,a.to)?r:fN(e.state,a.from,a.to)?n:null;s&&i.add(a.from,a.from,s)}}catch(e){o.e(e)}finally{o.f()}return i.finish()}}]),e}()),o=t.domEventHandlers;return[i,dA({class:"cm-foldGutter",markers:function(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.markers)||DC.empty},initialSpacer:function(){return new CN(t,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:function(e,t,n){if(o.click&&o.click(e,t,n))return!0;var r=gN(e.state,t.from,t.to);if(r)return e.dispatch({effects:vN.of(r)}),!0;var i=fN(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:dN.of(i)}),!0)}})}),xN()]}var ON=GP.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),EN=function(){function e(t,n){var r;function i(e){var t=t$.newName();return(r||(r=Object.create(null)))["."+t]=e,t}Ri(this,e);var o="string"==typeof n.all?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof RT?function(e){return e.prop(IT)==a.data}:a?function(e){return e==a}:void 0,this.style=vT(t.map((function(e){return{tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))}})),{all:o}).style,this.module=r?new t$(r):null,this.themeType=n.themeType}return Li(e,null,[{key:"define",value:function(t,n){return new e(t,n||{})}}]),e}(),PN=W_.define(),MN=W_.define({combine:function(e){return e.length?[e[0]]:null}});function AN(e){var t=e.facet(PN);return t.length?t:e.facet(MN)}function TN(e,t){var n,r=[IN];return e instanceof EN&&(e.module&&r.push(GP.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(MN.of(e)):n?r.push(PN.computeN([GP.darkTheme],(function(t){return t.facet(GP.darkTheme)==("dark"==n)?[e]:[]}))):r.push(PN.of(e)),r}var NN=function(){function e(t){Ri(this,e),this.markCache=Object.create(null),this.tree=zT(t.state),this.decorations=this.buildDeco(t,AN(t.state))}return Li(e,[{key:"update",value:function(e){var t=zT(e.state),n=AN(e.state),r=n!=AN(e.startState);t.length0&&JN(t.state,a.head-1,1,i)||i.afterCursor&&(JN(t.state,a.head,1,i)||a.head0&&void 0!==arguments[0]?arguments[0]:{};return[LN.of(e),VN]}function HN(e,t,n){var r=e.prop(t<0?TA.openedBy:TA.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 JN(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.maxScanDistance||1e4,o=r.brackets||"()[]{}",a=zT(e),s=a.resolveInner(t,n),u=s;u;u=u.parent){var c=HN(u.type,n,o);if(c&&u.from=r.to){if(0==u&&i.indexOf(c.type.name)>-1&&c.from0)return null;for(var c={from:n<0?t-1:t,to:n>0?t+1:t},l=e.doc.iterRange(t,n>0?e.doc.length:0),f=0,h=0;!l.next().done&&h<=o;){var d=l.value;n<0&&(h+=d.length);for(var v=t+h*n,p=n>0?0:d.length-1,m=n>0?d.length:-1;p!=m;p+=n){var g=a.indexOf(d[p]);if(!(g<0||r.resolveInner(v+p,1).type!=i))if(g%2==0==n>0)f++;else{if(1==f)return{start:c,end:{from:v+p,to:v+p+1},matched:g>>1==u>>1};f--}}n>0&&(h+=d.length)}return l.done?{start:c,matched:!1}:null}for(var GN=Object.create(null),QN=[IA.none],YN=[],ZN=Object.create(null),XN=0,eI=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];XN-1||(YN.push(e),console.warn(t))}function oI(e,t){var n,r=null,i=bi(t.split("."));try{for(i.s();!(n=i.n()).done;){var o=n.value,a=e[o]||NT[o];a?"function"==typeof a?r?r=a(r):iI(o,"Modifier ".concat(o," used at start of tag")):r?iI(o,"Tag ".concat(o," used as modifier")):r=a:iI(o,"Unknown highlighting tag ".concat(o))}}catch(e){i.e(e)}finally{i.f()}if(!r)return 0;var s=t.replace(/ /g,"_"),u=IA.define({id:QN.length,name:s,props:[fT(xi({},s,r))]});return QN.push(u),u.id}function aI(e,t){return function(n){var r=n.state,i=n.dispatch;if(r.readOnly)return!1;var o=e(t,r);return!!o&&(i(r.update(o)),!0)}}var sI=aI(dI,0),uI=aI(hI,0),cI=aI((function(e,t){return hI(e,t,function(e){var t,n=[],r=bi(e.selection.ranges);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=e.doc.lineAt(i.from),a=i.to<=o.to?o:e.doc.lineAt(i.to),s=n.length-1;s>=0&&n[s].to>o.from?n[s].to=a.to:n.push({from:o.from,to:a.to})}}catch(e){r.e(e)}finally{r.f()}return n}(t))}),0);function lI(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.selection.main.head,n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function fI(e,t,n,r){var i,o,a=t.open,s=t.close,u=e.sliceDoc(n-50,n),c=e.sliceDoc(r,r+50),l=/\s*$/.exec(u)[0].length,f=/^\s*/.exec(c)[0].length,h=u.length-l;if(u.slice(h-a.length,h)==a&&c.slice(f,f+s.length)==s)return{open:{pos:n-l,margin:l&&1},close:{pos:r+f,margin:f&&1}};r-n<=100?i=o=e.sliceDoc(n,r):(i=e.sliceDoc(n,n+50),o=e.sliceDoc(r-50,r));var d=/^\s*/.exec(i)[0].length,v=/\s*$/.exec(o)[0].length,p=o.length-v-s.length;return i.slice(d,d+a.length)==a&&o.slice(p,p+s.length)==s?{open:{pos:n+d+a.length,margin:/\s/.test(i.charAt(d+a.length))?1:0},close:{pos:r-v-s.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null}function hI(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.selection.ranges,r=n.map((function(e){return lI(t,e.from).block}));if(!r.every((function(e){return e})))return null;var i=n.map((function(e,n){return fI(t,r[n],e.from,e.to)}));if(2!=e&&!i.every((function(e){return e})))return{changes:t.changes(n.map((function(e,t){return i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]})))};if(1!=e&&i.some((function(e){return e}))){for(var o,a=[],s=0;s2&&void 0!==arguments[2]?arguments[2]:t.selection.ranges,i=[],o=-1,a=bi(r);try{for(a.s();!(n=a.n()).done;){for(var s=n.value,u=s.from,c=s.to,l=i.length,f=1e9,h=u;h<=c;){var d=t.doc.lineAt(h);if(d.from>o&&(u==c||c>d.from)){o=d.from;var v=lI(t,h).line;if(!v)continue;var p=/^\s*/.exec(d.text)[0].length,m=p==d.length,g=d.text.slice(p,p+v.length)==v?p:-1;p=0}))){var E,P=[],M=bi(i);try{for(M.s();!(E=M.n()).done;){var A=E.value,T=A.line,N=A.comment,I=A.token;if(N>=0){var R=T.from+N,D=R+I.length;" "==T.text[D-T.from]&&D++,P.push({from:R,to:D})}}}catch(e){M.e(e)}finally{M.f()}return{changes:P}}return null}var vI=mC.define(),pI=mC.define(),mI=W_.define(),gI=W_.define({combine:function(e){return AC(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}});var yI=Q_.define({create:function(){return DI.empty},update:function(e,t){var n,r,i=t.state.facet(gI),o=t.annotation(vI);if(o){var a=t.docChanged?q_.single((n=t.changes,r=0,n.iterChangedRanges((function(e,t){return r=t})),r)):void 0,s=OI.fromTransaction(t,a),u=o.side,c=0==u?e.undone:e.done;return c=s?EI(c,c.length,i.minDepth,s):AI(c,t.startState.selection),new DI(0==u?o.rest:c,0==u?c:o.rest)}var l=t.annotation(pI);if("full"!=l&&"before"!=l||(e=e.isolate()),!1===t.annotation(kC.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);var f=OI.fromTransaction(t),h=t.annotation(kC.time),d=t.annotation(kC.userEvent);return f?e=e.addChanges(f,h,d,i.newGroupDelay,i.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,h,d,i.newGroupDelay)),"full"!=l&&"after"!=l||(e=e.isolate()),e},toJSON:function(e){return{done:e.done.map((function(e){return e.toJSON()})),undone:e.undone.map((function(e){return e.toJSON()}))}},fromJSON:function(e){return new DI(e.done.map(OI.fromJSON),e.undone.map(OI.fromJSON))}});function bI(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[yI,gI.of(e),GP.domEventHandlers({beforeinput:function(e,t){var n="historyUndo"==e.inputType?wI:"historyRedo"==e.inputType?jI:null;return!!n&&(e.preventDefault(),n(t))}})]}function kI(e,t){return function(n){var r=n.state,i=n.dispatch;if(!t&&r.readOnly)return!1;var o=r.field(yI,!1);if(!o)return!1;var a=o.pop(e,r,t);return!!a&&(i(a),!0)}}var wI=kI(0,!1),jI=kI(1,!1),xI=kI(0,!0),SI=kI(1,!0);function _I(e){return function(t){var n=t.field(yI,!1);if(!n)return 0;var r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}var CI=_I(0),$I=_I(1),OI=function(){function e(t,n,r,i,o){Ri(this,e),this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}return Li(e,[{key:"setSelAfter",value:function(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}},{key:"toJSON",value:function(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((function(e){return e.toJSON()}))}}}],[{key:"fromJSON",value:function(t){return new e(t.changes&&T_.fromJSON(t.changes),[],t.mapped&&A_.fromJSON(t.mapped),t.startSelection&&q_.fromJSON(t.startSelection),t.selectionsAfter.map(q_.fromJSON))}},{key:"fromTransaction",value:function(t,n){var r,i=MI,o=bi(t.startState.facet(mI));try{for(o.s();!(r=o.n()).done;){var a=(0,r.value)(t);a.length&&(i=i.concat(a))}}catch(e){o.e(e)}finally{o.f()}return!i.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,MI)}},{key:"selection",value:function(t){return new e(void 0,MI,void 0,void 0,t)}}]),e}();function EI(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 PI(e,t){return e.length?t.length?e.concat(t):e:t}var MI=[];function AI(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),EI(e,e.length-1,1e9,n.setSelAfter(r)))}return[OI.selection([t])]}function TI(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 NI(e,t){if(!e.length)return e;for(var n=e.length,r=MI;n;){var i=II(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?[OI.selection(r)]:MI}function II(e,t,n){var r=PI(e.selectionsAfter.length?e.selectionsAfter.map((function(e){return e.map(t)})):MI,n);if(!e.changes)return OI.selection(r);var i=e.changes.map(t),o=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(o):o;return new OI(i,bC.mapEffects(e.effects,t),a,e.startSelection.map(o),r)}var RI=/^(input\.type|delete)($|\.)/,DI=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;Ri(this,e),this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}return Li(e,[{key:"isolate",value:function(){return this.prevTime?new e(this.done,this.undone):this}},{key:"addChanges",value:function(t,n,r,i,o){var a=this.done,s=a[a.length-1];return a=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||RI.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime=s&&i<=u&&(r=!0)}})),r}(s.changes,t.changes)||"input.type.compose"==r)?EI(a,a.length-1,o,new OI(t.changes.compose(s.changes),PI(t.effects,s.effects),s.mapped,s.startSelection,MI)):EI(a,a.length,o,t),new e(a,MI,n,r)}},{key:"addSelection",value:function(t,n,r,i){var o,a,s=this.done.length?this.done[this.done.length-1].selectionsAfter:MI;return s.length>0&&n-this.prevTime2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function GI(e,t,n){for(var r=zT(e).resolveInner(t.head),i=n?TA.closedBy:TA.openedBy,o=t.head;;){var a=n?r.childAfter(o):r.childBefore(o);if(!a)break;KI(e,a,i)?r=a:o=n?a.to:a.from}var s,u;return u=r.type.prop(i)&&(s=n?JN(e,r.from,1):JN(e,r.to,-1))&&s.matched?n?s.end.to:s.end.from:n?r.to:r.from,q_.cursor(u,n?-1:1)}function QI(e,t){return qI(e,(function(n){if(!n.empty)return FI(n,t);var r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}var YI=function(e){return QI(e,!1)},ZI=function(e){return QI(e,!0)};function XI(e){return Math.max(e.defaultLineHeight,Math.min(e.dom.clientHeight,innerHeight)-5)}function eR(e,t){var n=e.state,r=zI(n.selection,(function(n){return n.empty?e.moveVertically(n,t,XI(e)):FI(n,t)}));if(r.eq(n.selection))return!1;var i,o=e.coordsAtPos(n.selection.main.head),a=e.scrollDOM.getBoundingClientRect();return o&&o.top>a.top&&o.bottomi&&(n="delete.forward",a=kR(e,a,!0)),i=Math.min(i,a),o=Math.max(o,a)}else i=kR(e,i,!1),o=kR(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:q_.cursor(i)}}));return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?GP.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function kR(e,t,n){if(e instanceof GP){var r,i=bi(e.state.facet(GP.atomicRanges).map((function(t){return t(e)})));try{for(i.s();!(r=i.n()).done;){r.value.between(t,t,(function(e,r){et&&(t=n?r:e)}))}}catch(e){i.e(e)}finally{i.f()}}return t}var wR=function(e,t){return bR(e,(function(n){var r,i,o=e.state,a=o.doc.lineAt(n);if(!t&&n>a.from&&n=a.number){var u=n[n.length-1];u.to=s.to,u.ranges.push(o)}else n.push({from:a.from,to:s.to,ranges:[o]});r=s.number+1}}catch(e){i.e(e)}finally{i.f()}return n}function OR(e,t,n){if(e.readOnly)return!1;var r,i=[],o=[],a=bi($R(e));try{for(a.s();!(r=a.n()).done;){var s=r.value;if(n?s.to!=e.doc.length:0!=s.from){var u=e.doc.lineAt(n?s.to+1:s.from-1),c=u.length+1;if(n){i.push({from:s.to,to:u.to},{from:s.from,insert:u.text+e.lineBreak});var l,f=bi(s.ranges);try{for(f.s();!(l=f.n()).done;){var h=l.value;o.push(q_.range(Math.min(e.doc.length,h.anchor+c),Math.min(e.doc.length,h.head+c)))}}catch(e){f.e(e)}finally{f.f()}}else{i.push({from:u.from,to:s.from},{from:s.to,insert:e.lineBreak+u.text});var d,v=bi(s.ranges);try{for(v.s();!(d=v.n()).done;){var p=d.value;o.push(q_.range(p.anchor-c,p.head-c))}}catch(e){v.e(e)}finally{v.f()}}}}}catch(e){a.e(e)}finally{a.f()}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:q_.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function ER(e,t,n){if(e.readOnly)return!1;var r,i=[],o=bi($R(e));try{for(o.s();!(r=o.n()).done;){var a=r.value;n?i.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):i.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)})}}catch(e){o.e(e)}finally{o.f()}return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var PR=AR(!1),MR=AR(!0);function AR(e){return function(t){var n=t.state,r=t.dispatch;if(n.readOnly)return!1;var i=n.changeByRange((function(t){var r=t.from,i=t.to,o=n.doc.lineAt(r),a=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};var n,r=zT(e).resolveInner(t),i=r.childBefore(t),o=r.childAfter(t);return i&&o&&i.to<=t&&o.from>=t&&(n=i.type.prop(TA.closedBy))&&n.indexOf(o.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(o.from).from?{from:i.to,to:o.from}:null}(n,r);e&&(r=i=(i<=o.to?o:n.doc.lineAt(i)).to);var s=new tN(n,{simulateBreak:r,simulateDoubleBreak:!!a}),u=eN(s,r);for(null==u&&(u=/^\s*/.exec(n.doc.lineAt(r).text)[0].length);io.from&&rn&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),o=a.to+1}var s=e.changes(i);return{changes:i,range:q_.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}}))}var NR=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(TR(t,(function(e,n){n.push({from:e.from,insert:t.facet(YT)})})),{userEvent:"input.indent"})),!0)},IR=function(e){var t=e.state,n=e.dispatch;return!t.readOnly&&(n(t.update(TR(t,(function(e,n){var r=/^\s*/.exec(e.text)[0];if(r){for(var i=QC(r,t.tabSize),o=0,a=XT(t,Math.max(0,i-ZT(t)));on?n:Math.max(0,t-1)}))}},{mac:"Mod-Delete",run:CR}].concat(RR.map((function(e){return{mac:e.key,run:e.run,shift:e.shift}}))),LR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function(e){return qI(e,(function(t){return GI(e.state,t,!WI(e))}))},shift:function(e){return iR(e,(function(t){return GI(e.state,t,!WI(e))}))}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function(e){return qI(e,(function(t){return GI(e.state,t,WI(e))}))},shift:function(e){return iR(e,(function(t){return GI(e.state,t,WI(e))}))}},{key:"Alt-ArrowUp",run:function(e){return OR(e.state,e.dispatch,!1)}},{key:"Shift-Alt-ArrowUp",run:function(e){return ER(e.state,e.dispatch,!1)}},{key:"Alt-ArrowDown",run:function(e){return OR(e.state,e.dispatch,!0)}},{key:"Shift-Alt-ArrowDown",run:function(e){return ER(e.state,e.dispatch,!0)}},{key:"Escape",run:function(e){var t=e.state,n=e.dispatch,r=t.selection,i=null;return r.ranges.length>1?i=q_.create([r.main]):r.main.empty||(i=q_.create([q_.cursor(r.main.head)])),!!i&&(n(BI(t,i)),!0)}},{key:"Mod-Enter",run:MR},{key:"Alt-l",mac:"Ctrl-l",run:function(e){var t=e.state,n=e.dispatch,r=$R(t).map((function(e){var n=e.from,r=e.to;return q_.range(n,Math.min(r+1,t.doc.length))}));return n(t.update({selection:q_.create(r),userEvent:"select"})),!0}},{key:"Mod-i",run:function(e){var t=e.state,n=e.dispatch,r=zI(t.selection,(function(e){for(var n,r=zT(t).resolveInner(e.head,1);!(r.from=e.to||r.to>e.to&&r.from<=e.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent);)r=r.parent;return q_.range(r.to,r.from)}));return n(BI(t,r)),!0},preventDefault:!0},{key:"Mod-[",run:IR},{key:"Mod-]",run:NR},{key:"Mod-Alt-\\",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=Object.create(null),i=new tN(t,{overrideIndentation:function(e){var t=r[e];return null==t?-1:t}}),o=TR(t,(function(e,n,o){var a=eN(i,e.from);if(null!=a){/\S/.test(e.text)||(a=0);var s=/^\s*/.exec(e.text)[0],u=XT(t,a);(s!=u||o.from0?n--:r0&&JN(e,t.head-1,1)||t.head2&&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,a=arguments.length>5?arguments[5]:void 0;Ri(this,e),this.test=a,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(FR(e))}:FR,this.query=this.normalize(n)}return Li(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,this.bufferPos)}},{key:"next",value:function(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}},{key:"nextOverlapping",value:function(){for(;;){var e=this.peek();if(e<0)return this.done=!0,this;var t=O_(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=E_(e);for(var r=this.normalize(t),i=0,o=n;;i++){var a=r.charCodeAt(i),s=this.match(a,o);if(s)return this.value=s,this;if(i==r.length-1)break;o==n&&i3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.length;if(Ri(this,e),this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=WR,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new GR(t,n,r,i,o);this.re=new RegExp(n,HR+((null==r?void 0:r.ignoreCase)?"i":"")),this.test=null==r?void 0:r.test,this.iter=t.iter();var a=t.lineAt(i);this.curLineStart=a.from,this.matchPos=QR(t,i),this.getLine(this.curLineStart)}return Li(e,[{key:"getLine",value:function(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}},{key:"nextLine",value:function(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}},{key:"next",value:function(){for(var e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;var t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){var n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=QR(this.text,r+(n==r?1:0)),n==this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=r||i.to<=n){var o=new e(n,t.sliceString(n,r));return UR.set(t,o),o}if(i.from==n&&i.to==r)return i;var a=i.text,s=i.from;return s>n&&(a=t.sliceString(n,s)+a,s=n),i.to=this.to?this.to:this.text.lineAt(e).to}},{key:"next",value:function(){for(;;){var e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){var n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=QR(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=KR.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}]),e}();function QR(e,t){if(t>=e.length)return t;for(var n,r=e.lineAt(t);t=56320&&n<57344;)t++;return t}function YR(e){var t=BR("input",{class:"cm-textfield",name:"line"});function n(){var n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(n){var r=e.state,i=r.doc.lineAt(r.selection.main.head),o=ki(n,5),a=o[1],s=o[2],u=o[3],c=o[4],l=u?+u.slice(1):0,f=s?+s:i.number;if(s&&c){var h=f/100;a&&(h=h*("-"==a?-1:1)+i.number/r.doc.lines),f=Math.round(r.doc.lines*h)}else s&&a&&(f=f*("-"==a?-1:1)+i.number);var d=r.doc.line(Math.max(1,Math.min(r.doc.lines,f)));e.dispatch({effects:ZR.of(!1),selection:q_.cursor(d.from+Math.max(0,Math.min(l,d.length))),scrollIntoView:!0}),e.focus()}}return{dom:BR("form",{class:"cm-gotoLine",onkeydown:function(t){27==t.keyCode?(t.preventDefault(),e.dispatch({effects:ZR.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:function(e){e.preventDefault(),n()}},BR("label",e.state.phrase("Go to line"),": ",t)," ",BR("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(JR.prototype[Symbol.iterator]=GR.prototype[Symbol.iterator]=function(){return this});var ZR=bC.define(),XR=Q_.define({create:function(){return!0},update:function(e,t){var n,r=bi(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(ZR)&&(e=i.value)}}catch(e){r.e(e)}finally{r.f()}return e},provide:function(e){return uA.from(e,(function(e){return e?YR:null}))}}),eD=GP.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tD={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},nD=W_.define({combine:function(e){return AC(e,tD,{highlightWordAroundCursor:function(e,t){return e||t},minSelectionLength:Math.min,maxMatches:Math.min})}});var rD=vO.mark({class:"cm-selectionMatch"}),iD=vO.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function oD(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==OC.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==OC.Word)}var aD=LO.fromClass(function(){function e(t){Ri(this,e),this.decorations=this.getDeco(t)}return Li(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(nD),n=e.state,r=n.selection;if(r.ranges.length>1)return vO.none;var i,o=r.main,a=null;if(o.empty){if(!t.highlightWordAroundCursor)return vO.none;var s=n.wordAt(o.head);if(!s)return vO.none;a=n.charCategorizer(o.head),i=n.sliceDoc(s.from,s.to)}else{var u=o.to-o.from;if(u200)return vO.none;if(t.wholeWords){if(i=n.sliceDoc(o.from,o.to),!oD(a=n.charCategorizer(o.head),n,o.from,o.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==OC.Word&&e(t.sliceDoc(r-1,r))==OC.Word}(a,n,o.from,o.to))return vO.none}else if(!(i=n.sliceDoc(o.from,o.to).trim()))return vO.none}var c,l=[],f=bi(e.visibleRanges);try{for(f.s();!(c=f.n()).done;)for(var h=c.value,d=new VR(n.doc,i,h.from,h.to);!d.next().done;){var v=d.value,p=v.from,m=v.to;if((!a||oD(a,n,p,m))&&(o.empty&&p<=o.from&&m>=o.to?l.push(iD.range(p,m)):(p>=o.to||m<=o.from)&&l.push(rD.range(p,m)),l.length>t.maxMatches))return vO.none}}catch(e){f.e(e)}finally{f.f()}return vO.set(l)}}]),e}(),{decorations:function(e){return e.decorations}}),sD=GP.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});var uD=W_.define({combine:function(e){return AC(e,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:function(e){return new RD(e)}})}});function cD(e){return e?[uD.of(e),qD]:qD}var lD=function(){function e(t){Ri(this,e),this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,HR),!0}catch(e){return!1}}(this.search)),this.unquoted=this.literal?this.search:this.search.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"})),this.wholeWord=!!t.wholeWord}return Li(e,[{key:"eq",value:function(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}},{key:"create",value:function(){return this.regexp?new gD(this):new dD(this)}},{key:"getCursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=e.doc?e:MC.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?vD(this,r,t,n):hD(this,r,t,n)}}]),e}(),fD=Li((function e(t){Ri(this,e),this.spec=t}));function hD(e,t,n,r){return new VR(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:function(e){return e.toLowerCase()},e.wholeWord?function(e,t){return function(n,r,i,o){return(o>n||o+i.length=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=hD(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));!i.next().done;)r(i.value.from,i.value.to)}}]),n}();function vD(e,t,n,r){return new JR(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(i=t.charCategorizer(t.selection.main.head),function(e,t,n){return!n[0].length||(i(pD(n.input,n.index))!=OC.Word||i(mD(n.input,n.index))!=OC.Word)&&(i(mD(n.input,n.index+n[0].length))!=OC.Word||i(pD(n.input,n.index+n[0].length))!=OC.Word)}):void 0},n,r);var i}function pD(e,t){return e.slice(j_(e,t,!1),t)}function mD(e,t){return e.slice(t,j_(e,t))}var gD=function(e){Ci(n,fD);var t=Oi(n);function n(){return Ri(this,n),t.apply(this,arguments)}return Li(n,[{key:"nextMatch",value:function(e,t,n){var r=vD(this.spec,e,n,e.doc.length).next();return r.done&&(r=vD(this.spec,e,0,t).next()),r.done?null:r.value}},{key:"prevMatchInRange",value:function(e,t,n){for(var r=1;;r++){for(var i=Math.max(t,n-1e4*r),o=vD(this.spec,e,i,n),a=null;!o.next().done;)a=o.value;if(a&&(i==t||a.from>i+10))return a;if(i==t)return null}}},{key:"prevMatch",value:function(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}},{key:"getReplacement",value:function(e){return this.spec.replace.replace(/\$([$&\d+])/g,(function(t,n){return"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;r.push(n.value)}return r}},{key:"highlight",value:function(e,t,n,r){for(var i=vD(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));!i.next().done;)r(i.value.from,i.value.to)}}]),n}(),yD=bC.define(),bD=bC.define(),kD=Q_.define({create:function(e){return new wD(AD(e).create(),null)},update:function(e,t){var n,r=bi(t.effects);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.is(yD)?e=new wD(i.value.create(),e.panel):i.is(bD)&&(e=new wD(e.query,i.value?MD:null))}}catch(e){r.e(e)}finally{r.f()}return e},provide:function(e){return uA.from(e,(function(e){return e.panel}))}}),wD=Li((function e(t,n){Ri(this,e),this.query=t,this.panel=n})),jD=vO.mark({class:"cm-searchMatch"}),xD=vO.mark({class:"cm-searchMatch cm-searchMatch-selected"}),SD=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.decorations=this.highlight(t.state.field(kD))}return Li(e,[{key:"update",value:function(e){var t=e.state.field(kD);(t!=e.startState.field(kD)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}},{key:"highlight",value:function(e){var t=e.query;if(!e.panel||!t.spec.valid)return vO.none;for(var n=this.view,r=new zC,i=0,o=n.visibleRanges,a=o.length;io[i+1].from-500;)c=o[++i].to;t.highlight(n.state,u,c,(function(e,t){var i=n.state.selection.ranges.some((function(n){return n.from==e&&n.to==t}));r.add(e,t,i?xD:jD)}))}return r.finish()}}]),e}(),{decorations:function(e){return e.decorations}});function _D(e){return function(t){var n=t.state.field(kD,!1);return n&&n.query.spec.valid?e(t,n):TD(t)}}var CD=_D((function(e,t){var n=t.query,r=e.state.selection.main.to,i=n.nextMatch(e.state,r,r);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:zD(e,i),userEvent:"select.search"}),!0)})),$D=_D((function(e,t){var n=t.query,r=e.state,i=r.selection.main.from,o=n.prevMatch(r,i,i);return!!o&&(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0,effects:zD(e,o),userEvent:"select.search"}),!0)})),OD=_D((function(e,t){var n=t.query.matchAll(e.state,1e3);return!(!n||!n.length)&&(e.dispatch({selection:q_.create(n.map((function(e){return q_.range(e.from,e.to)}))),userEvent:"select.search.matches"}),!0)})),ED=_D((function(e,t){var n=t.query,r=e.state,i=r.selection.main,o=i.from,a=i.to;if(r.readOnly)return!1;var s=n.nextMatch(r,o,o);if(!s)return!1;var u,c,l=[],f=[];if(s.from==o&&s.to==a&&(c=r.toText(n.getReplacement(s)),l.push({from:s.from,to:s.to,insert:c}),s=n.nextMatch(r,s.from,s.to),f.push(GP.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(o).number)+"."))),s){var h=0==l.length||l[0].from>=s.to?0:s.to-s.from-c.length;u={anchor:s.from-h,head:s.to-h},f.push(zD(e,s))}return e.dispatch({changes:l,selection:u,scrollIntoView:!!u,effects:f,userEvent:"input.replace"}),!0})),PD=_D((function(e,t){var n=t.query;if(e.state.readOnly)return!1;var r=n.matchAll(e.state,1e9).map((function(e){return{from:e.from,to:e.to,insert:n.getReplacement(e)}}));if(!r.length)return!1;var i=e.state.phrase("replaced $ matches",r.length)+".";return e.dispatch({changes:r,effects:GP.announce.of(i),userEvent:"input.replace.all"}),!0}));function MD(e){return e.state.facet(uD).createPanel(e)}function AD(e,t){var n,r,i,o,a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;var u=e.facet(uD);return new lD({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:u.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:u.caseSensitive,literal:null!==(i=null==t?void 0:t.literal)&&void 0!==i?i:u.literal,wholeWord:null!==(o=null==t?void 0:t.wholeWord)&&void 0!==o?o:u.wholeWord})}var TD=function(e){var t=e.state.field(kD,!1);if(t&&t.panel){var n=iA(e,MD);if(!n)return!1;var r=n.dom.querySelector("[main-field]");if(r&&r!=e.root.activeElement){var i=AD(e.state,t.query.spec);i.valid&&e.dispatch({effects:yD.of(i)}),r.focus(),r.select()}}else e.dispatch({effects:[bD.of(!0),t?yD.of(AD(e.state,t.query.spec)):bC.appendConfig.of(qD)]});return!0},ND=function(e){var t=e.state.field(kD,!1);if(!t||!t.panel)return!1;var n=iA(e,MD);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:bD.of(!1)}),!0},ID=[{key:"Mod-f",run:TD,scope:"editor search-panel"},{key:"F3",run:CD,shift:$D,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:CD,shift:$D,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ND,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function(e){var t=e.state,n=e.dispatch,r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;for(var i=r.main,o=i.from,a=i.to,s=[],u=0,c=new VR(t.doc,t.sliceDoc(o,a));!c.next().done;){if(s.length>1e3)return!1;c.value.from==o&&(u=s.length),s.push(q_.range(c.value.from,c.value.to))}return n(t.update({selection:q_.create(s,u),userEvent:"select.search.matches"})),!0}},{key:"Alt-g",run:function(e){var t=iA(e,YR);if(!t){var n=[ZR.of(!0)];null==e.state.field(XR,!1)&&n.push(bC.appendConfig.of([XR,eD])),e.dispatch({effects:n}),t=iA(e,YR)}return t&&t.dom.querySelector("input").focus(),!0}},{key:"Mod-d",run:function(e){var t=e.state,n=e.dispatch,r=t.selection.ranges;if(r.some((function(e){return e.from===e.to})))return function(e){var t=e.state,n=e.dispatch,r=t.selection,i=q_.create(r.ranges.map((function(e){return t.wordAt(e.head)||q_.cursor(e.head)})),r.mainIndex);return!i.eq(r)&&(n(t.update({selection:i})),!0)}({state:t,dispatch:n});var i=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some((function(e){return t.sliceDoc(e.from,e.to)!=i})))return!1;var o=function(e,t){for(var n=e.selection,r=n.main,i=n.ranges,o=e.wordAt(r.head),a=o&&o.from==r.from&&o.to==r.to,s=function(n,r){if(r.next(),!r.done){if(n&&i.some((function(e){return e.from==r.value.from})))return c=r,u=n,"continue";if(a){var o=e.wordAt(r.value.from);if(!o||o.from!=r.value.from||o.to!=r.value.to)return c=r,u=n,"continue"}return u=n,c=r,{v:r.value}}if(n)return c=r,u=n,{v:null};r=new VR(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),u=n=!0,c=r},u=!1,c=new VR(e.doc,t,i[i.length-1].to);;){var l=s(u,c);if("continue"!==l&&"object"===zi(l))return l.v}}(t,i);return!!o&&(n(t.update({selection:t.selection.addRange(q_.range(o.from,o.to),!1),effects:GP.scrollIntoView(o.to)})),!0)},preventDefault:!0}],RD=function(){function e(t){var n=this;Ri(this,e),this.view=t;var r=this.query=t.state.field(kD).query.spec;function i(e,t,n){return BR("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=BR("input",{value:r.search,placeholder:DD(t,"Find"),"aria-label":DD(t,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=BR("input",{value:r.replace,placeholder:DD(t,"Replace"),"aria-label":DD(t,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=BR("input",{type:"checkbox",name:"case",checked:r.caseSensitive,onchange:this.commit}),this.reField=BR("input",{type:"checkbox",name:"re",checked:r.regexp,onchange:this.commit}),this.wordField=BR("input",{type:"checkbox",name:"word",checked:r.wholeWord,onchange:this.commit}),this.dom=BR("div",{onkeydown:function(e){return n.keydown(e)},class:"cm-search"},[this.searchField,i("next",(function(){return CD(t)}),[DD(t,"next")]),i("prev",(function(){return $D(t)}),[DD(t,"previous")]),i("select",(function(){return OD(t)}),[DD(t,"all")]),BR("label",null,[this.caseField,DD(t,"match case")]),BR("label",null,[this.reField,DD(t,"regexp")]),BR("label",null,[this.wordField,DD(t,"by word")])].concat(Ti(t.state.readOnly?[]:[BR("br"),this.replaceField,i("replace",(function(){return ED(t)}),[DD(t,"replace")]),i("replaceAll",(function(){return PD(t)}),[DD(t,"replace all")]),BR("button",{name:"close",onclick:function(){return ND(t)},"aria-label":DD(t,"close"),type:"button"},["×"])])))}return Li(e,[{key:"commit",value:function(){var e=new lD({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:yD.of(e)}))}},{key:"keydown",value:function(e){var t,n,r;t=this.view,n=e,r="search-panel",uM(aM(t.state),n,t,r)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$D:CD)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ED(this.view))}},{key:"update",value:function(e){var t,n=bi(e.transactions);try{for(n.s();!(t=n.n()).done;){var r,i=bi(t.value.effects);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.is(yD)&&!o.value.eq(this.query)&&this.setQuery(o.value)}}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}}},{key:"setQuery",value:function(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}},{key:"mount",value:function(){this.searchField.select()}},{key:"pos",get:function(){return 80}},{key:"top",get:function(){return this.view.state.facet(uD).top}}]),e}();function DD(e,t){return e.state.phrase(t)}var LD=/[\s\.,:;?!]/;function zD(e,t){var n=t.from,r=t.to,i=e.state.doc.lineAt(n),o=e.state.doc.lineAt(r).to,a=Math.max(i.from,n-30),s=Math.min(o,r+30),u=e.state.sliceDoc(a,s);if(a!=i.from)for(var c=0;c<30;c++)if(!LD.test(u[c+1])&&LD.test(u[c])){u=u.slice(c);break}if(s!=o)for(var l=u.length-1;l>u.length-30;l--)if(!LD.test(u[l-1])&&LD.test(u[l])){u=u.slice(0,l);break}return GP.announce.of("".concat(e.state.phrase("current match"),". ").concat(u," ").concat(e.state.phrase("on line")," ").concat(i.number,"."))}var BD=GP.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),qD=[kD,nC.lowest(SD),BD],FD=function(){function e(t,n,r){Ri(this,e),this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}return Li(e,[{key:"tokenBefore",value:function(e){for(var t=zT(this.state).resolveInner(this.pos,-1);t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,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.text.slice(n-t.from,this.pos-t.from),i=r.search(UD(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}},{key:"aborted",get:function(){return null==this.abortListeners}},{key:"addEventListener",value:function(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}]),e}();function VD(e){var t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),"[".concat(n?"\\w":"").concat(t.replace(/[^\w\s]/g,"\\$&"),"]")}function WD(e){var t=e.map((function(e){return"string"==typeof e?{label:e}:e})),n=t.every((function(e){return/^\w+$/.test(e.label)}))?[/\w*$/,/\w+$/]:function(e){var t,n=Object.create(null),r=Object.create(null),i=bi(e);try{for(i.s();!(t=i.n()).done;){var o=t.value.label;n[o[0]]=!0;for(var a=1;a=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(_=O_(S))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!w||1==C&&b||0==x&&0!=C)&&(t[v]==S||n[v]==S&&(p=!0)?o[v++]=w:o.length&&(k=!1)),x=C,w+=E_(S)}return v==u&&0==o[0]&&k?this.result((p?-200:0)-100,o,e):m==u&&0==g?[-200-e.length,0,y]:s>-1?[-700-e.length,s,s+this.pattern.length]:m==u?[-900-e.length,g,y]:v==u?this.result((p?-200:0)-100-700+(k?0:-1100),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-n.length],o=1,a=bi(t);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=s+(this.astral?E_($_(n,s)):1);o>1&&i[o-1]==s?i[o-1]=u:(i[o++]=s,i[o++]=u)}}catch(e){a.e(e)}finally{a.f()}return i}}]),e}(),ZD=W_.define({combine:function(e){return AC(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:function(){return""},aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:function(e,t){return e.label.localeCompare(t.label)}},{defaultKeymap:function(e,t){return e&&t},closeOnBlur:function(e,t){return e&&t},icons:function(e,t){return e&&t},optionClass:function(e,t){return function(n){return function(e,t){return e?t?e+" "+t:e:t}(e(n),t(n))}},addToOptions:function(e,t){return e.concat(t)}})}});function XD(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){var r=Math.floor(t/n);return{from:r*n,to:(r+1)*n}}var i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}var eL=function(){function e(t,n){var r=this;Ri(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,s=o.selected,u=t.state.facet(ZD);this.optionContent=function(e){var t=e.addToOptions.slice();return e.icons&&t.push({render:function(e){var t,n=document.createElement("div");return n.classList.add("cm-completionIcon"),e.type&&(t=n.classList).add.apply(t,Ti(e.type.split(/\s+/g).map((function(e){return"cm-completionIcon-"+e})))),n.setAttribute("aria-hidden","true"),n},position:20}),t.push({render:function(e,t,n){var r=document.createElement("span");r.className="cm-completionLabel";for(var i=e.label,o=0,a=1;ao&&r.appendChild(document.createTextNode(i.slice(o,s)));var c=r.appendChild(document.createElement("span"));c.appendChild(document.createTextNode(i.slice(s,u))),c.className="cm-completionMatchedText",o=u}return o=this.range.to)&&(this.range=XD(n.options.length,n.selected,this.view.state.facet(ZD).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(n.options,t.id,this.range)),this.list.addEventListener("scroll",(function(){e.info&&e.view.requestMeasure(e.placeInfo)}))),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);var r=n.options[n.selected].completion,i=r.info;if(!i)return;var o="string"==typeof i?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then((function(n){n&&e.view.state.field(e.stateField,!1)==t&&e.addInfoPane(n)})).catch((function(t){return NO(e.view.state,t,"completion info")})):this.addInfoPane(o)}}},{key:"addInfoPane",value:function(e){var t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}},{key:"updateSelectedOption",value:function(e){for(var t=null,n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}},{key:"measureInfo",value:function(){var e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;var t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect();if(r.top>Math.min(innerHeight,t.bottom)-10||r.bottom=this.options.length?this:new e(this.options,oL(n,t),this.tooltip,this.timestamp,t)}},{key:"map",value:function(t){return new e(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}],[{key:"build",value:function(t,n,r,i,o){var a=function(e,t){var n,r=[],i=0,o=bi(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.hasResult())if(!1===a.result.filter){var s,u=a.result.getMatch,c=bi(a.result.options);try{for(c.s();!(s=c.n()).done;){var l=s.value,f=[1e9-i++];if(u){var h,d=bi(u(l));try{for(d.s();!(h=d.n()).done;){var v=h.value;f.push(v)}}catch(e){d.e(e)}finally{d.f()}}r.push(new HD(l,a,f))}}catch(e){c.e(e)}finally{c.f()}}else{var p,m=new YD(t.sliceDoc(a.from,a.to)),g=void 0,y=bi(a.result.options);try{for(y.s();!(p=y.n()).done;){var b=p.value;(g=m.match(b.label))&&(null!=b.boost&&(g[0]+=b.boost),r.push(new HD(b,a,g)))}}catch(e){y.e(e)}finally{y.f()}}}}catch(e){o.e(e)}finally{o.f()}var k,w=[],j=null,x=t.facet(ZD).compareCompletions,S=bi(r.sort((function(e,t){return t.match[0]-e.match[0]||x(e.completion,t.completion)})));try{for(S.s();!(k=S.n()).done;){var _=k.value;!j||j.label!=_.completion.label||j.detail!=_.completion.detail||null!=j.type&&null!=_.completion.type&&j.type!=_.completion.type||j.apply!=_.completion.apply?w.push(_):tL(_.completion)>tL(j)&&(w[w.length-1]=_),j=_.completion}}catch(e){S.e(e)}finally{S.f()}return w}(t,n);if(!a.length)return null;var s,u=n.facet(ZD).selectOnOpen?0:-1;if(i&&i.selected!=u&&-1!=i.selected)for(var c=i.options[i.selected].completion,l=0;l-1&&(n["aria-activedescendant"]=e+"-"+t),n}var aL=[];function sL(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}var uL=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;Ri(this,e),this.source=t,this.state=n,this.explicitPos=r}return Li(e,[{key:"hasResult",value:function(){return!1}},{key:"update",value:function(t,n){var r=sL(t),i=this;r?i=i.handleUserEvent(t,r,n):t.docChanged?i=i.handleChange(t):t.selection&&0!=i.state&&(i=new e(i.source,0));var o,a=bi(t.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.is(lL))i=new e(i.source,1,s.value?JD(t.state):-1);else if(s.is(fL))i=new e(i.source,0);else if(s.is(hL)){var u,c=bi(s.value);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.source==i.source&&(i=l)}}catch(e){c.e(e)}finally{c.f()}}}}catch(e){a.e(e)}finally{a.f()}return i}},{key:"handleUserEvent",value:function(t,n,r){return"delete"!=n&&r.activateOnTyping?new e(this.source,1):this.map(t.changes)}},{key:"handleChange",value:function(t){return t.changes.touchesRange(JD(t.startState))?new e(this.source,0):this.map(t.changes)}},{key:"map",value:function(t){return t.empty||this.explicitPos<0?this:new e(this.source,this.state,t.mapPos(this.explicitPos))}}]),e}(),cL=function(e){Ci(n,uL);var t=Oi(n);function n(e,r,i,o,a){var s;return Ri(this,n),(s=t.call(this,e,2,r)).result=i,s.from=o,s.to=a,s}return Li(n,[{key:"hasResult",value:function(){return!0}},{key:"handleUserEvent",value:function(e,t,r){var i,o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),s=JD(e.state);if((this.explicitPos<0?s<=o:sa||"delete"==t&&JD(e.startState)==this.from)return new uL(this.source,"input"==t&&r.activateOnTyping?1:0);var u,c=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,r){if(!e)return!1;var i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):UD(e,!0).test(i)}(this.result.validFor,e.state,o,a)?new n(this.source,c,this.result,o,a):this.result.update&&(u=this.result.update(this.result,o,a,new FD(e.state,s,c>=0)))?new n(this.source,c,u,u.from,null!==(i=u.to)&&void 0!==i?i:JD(e.state)):new uL(this.source,1,c)}},{key:"handleChange",value:function(e){return e.changes.touchesRange(this.from,this.to)?new uL(this.source,0):this.map(e.changes)}},{key:"map",value:function(e){return e.empty?this:new n(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}]),n}();var lL=bC.define(),fL=bC.define(),hL=bC.define({map:function(e,t){return e.map((function(e){return e.map(t)}))}}),dL=bC.define(),vL=Q_.define({create:function(){return rL.start()},update:function(e,t){return e.update(t)},provide:function(e){return[GM.from(e,(function(e){return e.tooltip})),GP.contentAttributes.from(e,(function(e){return e.attrs}))]}});function pL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"option";return function(n){var r=n.state.field(vL,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;var i,o=1;"page"==t&&(i=tA(n,r.open.tooltip))&&(o=Math.max(2,Math.floor(i.dom.offsetHeight/i.dom.querySelector("li").offsetHeight)-1));var a=r.open.options.length,s=r.open.selected>-1?r.open.selected+o*(e?1:-1):e?0:a-1;return s<0?s="page"==t?0:a-1:s>=a&&(s="page"==t?a-1:0),n.dispatch({effects:dL.of(s)}),!0}}var mL=Li((function e(t,n){Ri(this,e),this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0})),gL=LO.fromClass(function(){function e(t){Ri(this,e),this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;var n,r=bi(t.state.field(vL).active);try{for(r.s();!(n=r.n()).done;){var i=n.value;1==i.state&&this.startQuery(i)}}catch(e){r.e(e)}finally{r.f()}}return Li(e,[{key:"update",value:function(e){var t=this,n=e.state.field(vL);if(e.selectionSet||e.docChanged||e.startState.field(vL)!=n){for(var r=e.transactions.some((function(e){return(e.selection||e.docChanged)&&!sL(e)})),i=0;i50&&Date.now()-o.time>1e3){var a,s=bi(o.context.abortListeners);try{for(s.s();!(a=s.n()).done;){var u=a.value;try{u()}catch(e){NO(this.view.state,e)}}}catch(e){s.e(e)}finally{s.f()}o.context.abortListeners=null,this.running.splice(i--,1)}else{var c;(c=o.updates).push.apply(c,Ti(e.transactions))}}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=n.active.some((function(e){return 1==e.state&&!t.running.some((function(t){return t.active.source==e.source}))}))?setTimeout((function(){return t.startUpdate()}),50):-1,0!=this.composing){var l,f=bi(e.transactions);try{for(f.s();!(l=f.n()).done;){var h=l.value;"input"==sL(h)?this.composing=2:2==this.composing&&h.selection&&(this.composing=3)}}catch(e){f.e(e)}finally{f.f()}}}}},{key:"startUpdate",value:function(){var e=this;this.debounceUpdate=-1;var t,n=bi(this.view.state.field(vL).active);try{var r=function(){var n=t.value;1!=n.state||e.running.some((function(e){return e.active.source==n.source}))||e.startQuery(n)};for(n.s();!(t=n.n()).done;)r()}catch(e){n.e(e)}finally{n.f()}}},{key:"startQuery",value:function(e){var t=this,n=this.view.state,r=JD(n),i=new FD(n,r,e.explicitPos==r),o=new mL(e,i);this.running.push(o),Promise.resolve(e.source(i)).then((function(e){o.context.aborted||(o.done=e||null,t.scheduleAccept())}),(function(e){t.view.dispatch({effects:fL.of(null)}),NO(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(ZD),i=function(i){var a=t.running[i];if(void 0===a.done)return o=i,"continue";if(t.running.splice(i--,1),a.done){var s,u=new cL(a.active.source,a.active.explicitPos,a.done,a.done.from,null!==(e=a.done.to)&&void 0!==e?e:JD(a.updates.length?a.updates[0].startState:t.view.state)),c=bi(a.updates);try{for(c.s();!(s=c.n()).done;){var l=s.value;u=u.update(l,r)}}catch(e){c.e(e)}finally{c.f()}if(u.hasResult())return n.push(u),o=i,"continue"}var f=t.view.state.field(vL).active.find((function(e){return e.source==a.active.source}));if(f&&1==f.state)if(null==a.done){var h,d=new uL(a.active.source,0),v=bi(a.updates);try{for(v.s();!(h=v.n()).done;){var p=h.value;d=d.update(p,r)}}catch(e){v.e(e)}finally{v.f()}1!=d.state&&n.push(d)}else t.startQuery(f);o=i},o=0;o ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),bL={brackets:["(","[","{","'",'"'],before:")]}:;>"},kL=bC.define({map:function(e,t){var n=t.mapPos(e,-1,M_.TrackAfter);return null==n?void 0:n}}),wL=bC.define({map:function(e,t){return t.mapPos(e)}}),jL=new(function(e){Ci(n,TC);var t=Oi(n);function n(){return Ri(this,n),t.apply(this,arguments)}return Li(n)}());jL.startSide=1,jL.endSide=-1;var xL=Q_.define({create:function(){return DC.empty},update:function(e,t){if(t.selection){var n=t.state.doc.lineAt(t.selection.main.head).from,r=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(r,-1)&&(e=DC.empty)}e=e.map(t.changes);var i,o=bi(t.effects);try{var a=function(){var t=i.value;t.is(kL)?e=e.update({add:[jL.range(t.value,t.value+1)]}):t.is(wL)&&(e=e.update({filter:function(e){return e!=t.value}}))};for(o.s();!(i=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}return e}});function SL(e){for(var t=0;t<"()[]{}<>".length;t+=2)if("()[]{}<>".charCodeAt(t)==e)return"()[]{}<>".charAt(t+1);return O_(e<128?e:e+1)}function _L(e,t){return e.languageDataAt("closeBrackets",t)[0]||bL}var CL="object"==("undefined"==typeof navigator?"undefined":zi(navigator))&&/Android\b/.test(navigator.userAgent),$L=GP.inputHandler.of((function(e,t,n,r){if((CL?e.composing:e.compositionStarted)||e.state.readOnly)return!1;var i=e.state.selection.main;if(r.length>2||2==r.length&&1==E_($_(r,0))||t!=i.from||n!=i.to)return!1;var o=function(e,t){var n,r=_L(e,e.selection.main.head),i=r.brackets||bL.brackets,o=bi(i);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=SL($_(a,0));if(t==a)return s==a?TL(e,a,i.indexOf(a+a+a)>-1):ML(e,a,s,r.before||bL.before);if(t==s&&EL(e,e.selection.main.from))return AL(e,a,s)}}catch(e){o.e(e)}finally{o.f()}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)})),OL=[{key:"Backspace",run:function(e){var t=e.state,n=e.dispatch;if(t.readOnly)return!1;var r=_L(t,t.selection.main.head).brackets||bL.brackets,i=null,o=t.changeByRange((function(e){if(e.empty){var n,o=function(e,t){var n=e.sliceString(t-2,t);return E_($_(n,0))==n.length?n:n.slice(1)}(t.doc,e.head),a=bi(r);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(s==o&&PL(t.doc,e.head)==SL($_(s,0)))return{changes:{from:e.head-s.length,to:e.head+s.length},range:q_.cursor(e.head-s.length),userEvent:"delete.backward"}}}catch(e){a.e(e)}finally{a.f()}}return{range:i=e}}));return i||n(t.update(o,{scrollIntoView:!0})),!i}}];function EL(e,t){var n=!1;return e.field(xL).between(0,e.doc.length,(function(e){e==t&&(n=!0)})),n}function PL(e,t){var n=e.sliceString(t,t+2);return n.slice(0,E_($_(n,0)))}function ML(e,t,n,r){var i=null,o=e.changeByRange((function(o){if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:kL.of(o.to+t.length),range:q_.range(o.anchor+t.length,o.head+t.length)};var a=PL(e.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:kL.of(o.head+t.length),range:q_.cursor(o.head+t.length)}:{range:i=o}}));return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function AL(e,t,n){var r=null,i=e.selection.ranges.map((function(t){return t.empty&&PL(e.doc,t.head)==n?q_.cursor(t.head+n.length):r=t}));return r?null:e.update({selection:q_.create(i,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((function(e){var t=e.from;return wL.of(t)}))})}function TL(e,t,n){var r=null,i=e.changeByRange((function(i){if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:kL.of(i.to+t.length),range:q_.range(i.anchor+t.length,i.head+t.length)};var o=i.head,a=PL(e.doc,o);if(a==t){if(NL(e,o))return{changes:{insert:t+t,from:o},effects:kL.of(o+t.length),range:q_.cursor(o+t.length)};if(EL(e,o)){var s=n&&e.sliceDoc(o,o+3*t.length)==t+t+t;return{range:q_.cursor(o+t.length*(s?3:1)),effects:wL.of(o)}}}else{if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&NL(e,o-2*t.length))return{changes:{insert:t+t+t+t,from:o},effects:kL.of(o+t.length),range:q_.cursor(o+t.length)};if(e.charCategorizer(o)(a)!=OC.Word){var u=e.sliceDoc(o-1,o);if(u!=t&&e.charCategorizer(o)(u)!=OC.Word&&!function(e,t,n){for(var r=zT(e).resolveInner(t,-1),i=0;i<5;i++){if(e.sliceDoc(r.from,r.from+n.length)==n){for(var o=r.firstChild;o&&o.from==r.from&&o.to-o.from>n.length;){if(e.sliceDoc(o.to-n.length,o.to)==n)return!1;o=o.firstChild}return!0}var a=r.to==t&&r.parent;if(!a)break;r=a}return!1}(e,o,t))return{changes:{insert:t+t,from:o},effects:kL.of(o+t.length),range:q_.cursor(o+t.length)}}}return{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function NL(e,t){var n=zT(e).resolveInner(t+1);return n.parent&&n.from==t}function IL(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[vL,ZD.of(e),gL,DL,yL]}var RL=[{key:"Ctrl-Space",run:function(e){return!!e.state.field(vL,!1)&&(e.dispatch({effects:lL.of(!0)}),!0)}},{key:"Escape",run:function(e){var t=e.state.field(vL,!1);return!(!t||!t.active.some((function(e){return 0!=e.state})))&&(e.dispatch({effects:fL.of(null)}),!0)}},{key:"ArrowDown",run:pL(!0)},{key:"ArrowUp",run:pL(!1)},{key:"PageDown",run:pL(!0,"page")},{key:"PageUp",run:pL(!1,"page")},{key:"Enter",run:function(e){var t=e.state.field(vL,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75||t.open.selected<0)&&(KD(e,t.open.options[t.open.selected]),!0)}}],DL=nC.highest(iM.computeN([ZD],(function(e){return e.facet(ZD).defaultKeymap?[RL]:[]}))),LL=Li((function e(t,n,r){Ri(this,e),this.from=t,this.to=n,this.diagnostic=r})),zL=function(){function e(t,n,r){Ri(this,e),this.diagnostics=t,this.panel=n,this.selected=r}return Li(e,null,[{key:"init",value:function(t,n,r){var i=t,o=r.facet(XL).markerFilter;o&&(i=o(i));var a=vO.set(i.map((function(e){return e.from==e.to||e.from==e.to-1&&r.doc.lineAt(e.from).to==e.from?vO.widget({widget:new nz(e),diagnostic:e}).range(e.from):vO.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity},diagnostic:e}).range(e.from,e.to)})),!0);return new e(a,n,BL(a))}}]),e}();function BL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=null;return e.between(n,1e9,(function(e,n,i){var o=i.spec;if(!t||o.diagnostic==t)return r=new LL(e,n,o.diagnostic),!1})),r}function qL(e,t){return!(!e.effects.some((function(e){return e.is(VL)}))&&!e.changes.touchesRange(t.pos))}function FL(e,t){return e.field(JL,!1)?t:t.concat(bC.appendConfig.of([JL,GP.decorations.compute([JL],(function(e){var t=e.field(JL),n=t.selected,r=t.panel;return n&&r&&n.from!=n.to?vO.set([UL.range(n.from,n.to)]):vO.none})),eA(KL,{hideOn:qL}),sz]))}var VL=bC.define(),WL=bC.define(),HL=bC.define(),JL=Q_.define({create:function(){return new zL(vO.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=BL(n,e.selected.diagnostic,i)||BL(n,null,i)}e=new zL(n,e.panel,r)}var o,a=bi(t.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.is(VL)?e=zL.init(s.value,e.panel,t.state):s.is(WL)?e=new zL(e.diagnostics,s.value?iz.open:null,e.selected):s.is(HL)&&(e=new zL(e.diagnostics,e.panel,s.value))}}catch(e){a.e(e)}finally{a.f()}return e},provide:function(e){return[uA.from(e,(function(e){return e.panel})),GP.decorations.from(e,(function(e){return e.diagnostics}))]}}),UL=vO.mark({class:"cm-lintRange cm-lintRange-active"});function KL(e,t,n){var r=e.state.field(JL).diagnostics,i=[],o=2e8,a=0;r.between(t-(n<0?1:0),t+(n>0?1:0),(function(e,r,s){var u=s.spec;t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t=65&&e.keyCode<=90&&n.selectedIndex>=0))return;for(var r=n.items[n.selectedIndex].diagnostic,i=ez(r.actions),o=0;oi&&(e.items.splice(i,l-i),o=!0)),r&&u.diagnostic==r.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),a=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}));ir.bottom&&(e.list.scrollTop+=n.bottom-r.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}},{key:"sync",value:function(){var e=this.list.firstChild;function t(){var t=e;e=t.nextSibling,t.remove()}var n,r=bi(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(e){r.e(e)}finally{r.f()}for(;e;)t()}},{key:"moveSelection",value:function(e){if(!(this.selectedIndex<0)){var t=BL(this.view.state.field(JL).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:HL.of(t)})}}}],[{key:"open",value:function(t){return new e(t)}}]),e}();function oz(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:'viewBox="0 0 40 40"';return'url(\'data:image/svg+xml,").concat(encodeURIComponent(e),"')")}function az(e){return oz(''),'width="6" height="3"')}var sz=GP.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:az("#d11")},".cm-lintRange-warning":{backgroundImage:az("orange")},".cm-lintRange-info":{backgroundImage:az("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),uz=function(e){Ci(n,cA);var t=Oi(n);function n(e){var r;return Ri(this,n),(r=t.call(this)).diagnostics=e,r.severity=e.reduce((function(e,t){var n=t.severity;return"error"==n||"warning"==n&&"info"==e?n:e}),"info"),r}return Li(n,[{key:"toDOM",value:function(e){var t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;var n=this.diagnostics,r=e.state.facet(pz).tooltipFilter;return r&&(n=r(n)),n.length&&(t.onmouseover=function(){return function(e,t,n){function r(){var r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:hz.of({pos:r.from,above:!1,create:function(){return{dom:GL(e,n),getCoords:function(){return t.getBoundingClientRect()}}}})}),t.onmouseout=t.onmousemove=null,function(e,t){var n=function n(r){var i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientY')},".cm-lint-marker-warning":{content:oz('')},".cm-lint-marker-error:before":{content:oz('')}}),pz=W_.define({combine:function(e){return AC(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function mz(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[pz.of(e),fz,lz,vz,dz]}var gz,yz=function(){return[$A(),PA,PM(),bI(),$N(),fM(),[wM,jM],MC.allowMultipleSelections.of(!0),MC.transactionFilter.of((function(e){if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;var t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;var n=e.newDoc,r=e.newSelection.main.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,u=-1,c=[],l=bi(s.selection.ranges);try{for(l.s();!(a=l.n()).done;){var f=a.value.head,h=s.doc.lineAt(f);if(h.from!=u){u=h.from;var d=eN(s,h.from);if(null!=d){var v=/^\s*/.exec(h.text)[0],p=XT(s,d);v!=p&&c.push({from:h.from,to:h.from+v.length,insert:p})}}}}catch(e){l.e(e)}finally{l.f()}return c.length?[e,{changes:c,sequential:!0}]:e})),TN(RN,{fallback:!0}),WN(),[$L,xL],IL(),zM(),FM(),RM,(t=[sD,aD],e&&t.push(nD.of(e)),t),iM.of([].concat(OL,Ti(LR),ID,LI,kN,RL,YL))];var e,t}(),bz=function(){function e(t,n,r,i,o,a,s,u,c){var l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,f=arguments.length>10?arguments[10]:void 0;Ri(this,e),this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=u,this.curContext=c,this.lookAhead=l,this.parent=f}return Li(e,[{key:"toString",value:function(){return"[".concat(this.stack.filter((function(e,t){return t%3==0})).concat(this.state),"]@").concat(this.pos).concat(this.score?"!"+this.score:"")}},{key:"context",get:function(){return this.curContext?this.curContext.context:null}},{key:"pushState",value:function(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}},{key:"reduce",value:function(e){var t=e>>19,n=65535&e,r=this.p.parser,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return this.pushState(r.getGoto(this.state,n,!0),this.reducePos),no;)this.stack.pop();this.reduceContext(n,a)}},{key:"storeNode",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==o.buffer[a-4]&&o.buffer[a-1]>-1){if(t==n)return;if(o.buffer[a-2]>=t)return void(o.buffer[a-2]=n)}}if(i&&this.pos!=n){var s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>n;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=n,this.buffer[s+3]=r}else this.buffer.push(e,t,n,r)}},{key:"shift",value:function(e,t,n){var r=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){var i=e,o=this.p.parser;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}},{key:"apply",value:function(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}},{key:"useNode",value:function(e,t){var n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);var r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}},{key:"split",value:function(){for(var t=this,n=t.buffer.length;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;for(var r=t.buffer.slice(n),i=t.bufferBase+n;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}},{key:"recoverByDelete",value:function(e,t){var n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}},{key:"canShift",value:function(e){for(var t=new wz(this);;){var n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}}},{key:"recoverByInsert",value:function(e){if(this.stack.length>=300)return[];var t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){for(var n,r=[],i=0;i>19,r=65535&e,i=this.stack.length-3*n;if(i<0||t.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}},{key:"forceAll",value:function(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}},{key:"deadEnd",get:function(){if(3!=this.stack.length)return!1;var e=this.p.parser;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}},{key:"restart",value:function(){this.state=this.stack[0],this.stack.length=0}},{key:"sameState",value:function(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(var t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}},{key:"close",value:function(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}],[{key:"start",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new kz(i,i.start):null,0,null)}}]),e}(),kz=Li((function e(t,n){Ri(this,e),this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}));!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(gz||(gz={}));var wz=function(){function e(t){Ri(this,e),this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}return Li(e,[{key:"reduce",value:function(e){var t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);var r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}]),e}(),jz=function(){function e(t,n,r){Ri(this,e),this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,0==this.index&&this.maybeNext()}return Li(e,[{key:"maybeNext",value:function(){var e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}},{key:"id",get:function(){return this.buffer[this.index-4]}},{key:"start",get:function(){return this.buffer[this.index-3]}},{key:"end",get:function(){return this.buffer[this.index-2]}},{key:"size",get:function(){return this.buffer[this.index-1]}},{key:"next",value:function(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}},{key:"fork",value:function(){return new e(this.stack,this.pos,this.index)}}],[{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.bufferBase+t.buffer.length;return new e(t,n,n-t.bufferBase)}}]),e}(),xz=Li((function e(){Ri(this,e),this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0})),Sz=new xz,_z=function(){function e(t,n){Ri(this,e),this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Sz,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}return Li(e,[{key:"resolveOffset",value:function(e,t){for(var n=this.range,r=this.rangeIndex,i=this.pos+e;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;var a=this.ranges[++r];i+=a.from-n.to,n=a}return i}},{key:"clipPos",value:function(e){if(e>=this.range.from&&ee)return Math.max(e,r.from)}}catch(e){n.e(e)}finally{n.f()}return this.end}},{key:"peek",value:function(e){var t,n,r=this.chunkOff+e;if(r>=0&&r=this.chunk2Pos&&ta.to&&(this.chunk2=this.chunk2.slice(0,a.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}},{key:"acceptToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?n.slice(0,this.range.to-this.pos):n,this.chunkPos=this.pos,this.chunkOff=0}}},{key:"readNext",value:function(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}},{key:"advance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}},{key:"setDone",value:function(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}},{key:"reset",value:function(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Sz,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);var n,r="",i=bi(this.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.from>=t)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}}catch(e){i.e(e)}finally{i.f()}return r}}]),e}(),Cz=function(){function e(t,n){Ri(this,e),this.data=t,this.id=n}return Li(e,[{key:"token",value:function(e,t){!function(e,t,n,r){var i=0,o=1<0){var l=e[c];if(s.allows(l)&&(-1==t.token.value||t.token.value==l||a.overrides(l,t.token.value))){t.acceptToken(l);break}}var f=t.next,h=0,d=e[i+2];if(!(t.next<0&&d>h&&65535==e[u+3*d-3])){for(;h>1,p=u+v+(v<<1),m=e[p],g=e[p+1];if(f=g)){i=e[p+2],t.advance();continue e}h=v+1}}break}i=e[u+3*d-1]}}(this.data,e,t,this.id)}}]),e}();function $z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uint16Array;if("string"!=typeof e)return e;for(var n=null,r=0,i=0;r=92&&a--,a>=34&&a--;var u=a-32;if(u>=46&&(u-=46,s=!0),o+=u,s)break;o*=46}n?n[i++]=o:n=new t(o)}return n}Cz.prototype.contextual=Cz.prototype.fallback=Cz.prototype.extend=!1;var Oz,Ez="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG),Pz=null;function Mz(e,t,n){var r=e.cursor(RA.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.tot)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(Oz||(Oz={}));var Az,Tz=function(){function e(t,n){Ri(this,e),this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}return Li(e,[{key:"nextFragment",value:function(){var e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Mz(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Mz(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}},{key:"nodeAt",value:function(e){if(ee)return this.nextStart=o,null;if(i instanceof BA){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}else this.trees.pop(),this.start.pop(),this.index.pop()}}}]),e}(),Nz=function(){function e(t,n){Ri(this,e),this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((function(e){return new xz}))}return Li(e,[{key:"getActions",value:function(e){for(var t=0,n=null,r=e.p.parser,i=r.tokenizers,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,s=0,u=0;ul.end+25&&(s=Math.max(l.lookAhead,s)),0!=l.value)){var f=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),n||e.pos!=this.stream.end||((n=new xz).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}},{key:"getMainToken",value:function(e){if(this.mainToken)return this.mainToken;var t=new xz,n=e.pos,r=e.p;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}},{key:"updateCachedToken",value:function(e,t,n){var r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){for(var i=n.p.parser,o=0;o=0&&n.p.parser.dialect.allows(a>>1)){0==(1&a)?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}},{key:"putAction",value:function(e,t,n,r){for(var i=0;i4*t.bufferLength?new Tz(r,t.nodeSet):null}return Li(e,[{key:"parsedPos",get:function(){return this.minStackPos}},{key:"advance",value:function(){for(var e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[],o=0;or)i.push(a);else{if(this.advanceStack(a,i,n))continue;e||(e=[],t=[]),e.push(a);var s=this.tokens.getMainToken(a);t.push(s.value,s.end)}break}if(!i.length){var u=e&&function(e){var t,n=null,r=bi(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=o&&i.pos>o)&&i.p.parser.stateFlag(i.state,2)&&(!n||n.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,i);if(c)return this.stackToTree(c.forceAll())}if(this.recovering){var l=1==this.recovering?1:3*this.recovering;if(i.length>l)for(i.sort((function(e,t){return t.score-e.score}));i.length>l;)i.pop();i.some((function(e){return e.reducePos>r}))&&this.recovering--}else if(i.length>1)e:for(var f=0;f500&&v.buffer.length>500){if(!((h.score-v.score||h.buffer.length-v.buffer.length)>0)){i.splice(f--,1);continue e}i.splice(d--,1)}}this.minStackPos=i[0].pos;for(var p=1;p ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments)for(var a=e.curContext&&e.curContext.tracker.strict,s=a?e.curContext.hash:0,u=this.fragments.nodeAt(r);u;){var c=this.parser.nodeSet.types[u.type.id]==u.type?i.getGoto(e.state,u.type.id):-1;if(c>-1&&u.length&&(!a||(u.prop(TA.contextHash)||0)==s))return e.useNode(u,c),Ez&&console.log(o+this.stackID(e)+" (via reuse of ".concat(i.getName(u.type.id),")")),!0;if(!(u instanceof BA)||0==u.children.length||u.positions[0]>0)break;var l=u.children[0];if(!(l instanceof BA&&0==u.positions[0]))break;u=l}var f=i.stateSlot(e.state,4);if(f>0)return e.reduce(f),Ez&&console.log(o+this.stackID(e)+" (via always-reduce ".concat(i.getName(65535&f),")")),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););for(var h=this.tokens.getActions(e),d=0;dr?t.push(y):n.push(y)}return!1}},{key:"advanceFully",value:function(e,t){for(var n=e.pos;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Rz(e,t),!0}}},{key:"runRecovery",value:function(e,t,n){for(var r=null,i=!1,o=0;o ":"";if(a.deadEnd){if(i)continue;if(i=!0,a.restart(),Ez&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))continue}for(var l=a.split(),f=c,h=0;l.forceReduce()&&h<10;h++){if(Ez&&console.log(f+this.stackID(l)+" (via force-reduce)"),this.advanceFully(l,n))break;Ez&&(f=this.stackID(l)+" -> ")}var d,v=bi(a.recoverByInsert(s));try{for(v.s();!(d=v.n()).done;){var p=d.value;Ez&&console.log(c+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,n)}}catch(e){v.e(e)}finally{v.f()}this.stream.end>a.pos?(u==a.pos&&(u++,s=0),a.recoverByDelete(s,u),Ez&&console.log(c+this.stackID(a)+" (via recover-delete ".concat(this.parser.getName(s),")")),Rz(a,n)):(!r||r.score=0)l(m,v,d[p++]);else{for(var g=d[p+-m],y=-m;y>0;y--)l(d[p++],v,g);p++}}}}catch(e){h.e(e)}finally{h.f()}}i.nodeSet=new DA(o.map((function(t,n){return IA.define({name:n>=i.minRepeatTerm?void 0:t,id:n,props:u[n],top:s.indexOf(n)>-1,error:0==n,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1})}))),e.propSources&&(i.nodeSet=(r=i.nodeSet).extend.apply(r,Ti(e.propSources))),i.strict=!1,i.bufferLength=1024;var b=$z(e.tokenData);i.context=e.context,i.specializerSpecs=e.specialized||[],i.specialized=new Uint16Array(i.specializerSpecs.length);for(var k=0;k2&&void 0!==arguments[2]&&arguments[2],r=this.goto;if(t>=r[0])return-1;for(var i=r[t+1];;){var o=r[i++],a=1&o,s=r[i++];if(a&&n)return s;for(var u=i+(o>>1);i0}},{key:"validAction",value:function(e,t){if(t==this.stateSlot(e,4))return!0;for(var n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=zz(this.data,n+2)}if(t==zz(this.data,n+1))return!0}}},{key:"nextStates",value:function(e){for(var t=this,n=[],r=this.stateSlot(e,1);;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=zz(this.data,r+2)}0==(1&this.data[r+2])&&function(){var e=t.data[r+1];n.some((function(t,n){return 1&n&&t==e}))||n.push(t.data[r],e)}()}return n}},{key:"overrides",value:function(e,t){var n=Bz(this.data,this.tokenPrecTable,t);return n<0||Bz(this.data,this.tokenPrecTable,e)0}},{key:"getName",value:function(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}},{key:"eofTerm",get:function(){return this.maxNode+1}},{key:"topNode",get:function(){return this.nodeSet.types[this.top[1]]}},{key:"dynamicPrecedence",value:function(e){var t=this.dynamicPrecedences;return null==t?0:t[e]||0}},{key:"parseDialect",value:function(e){var t=Object.keys(this.dialects),n=t.map((function(){return!1}));if(e){var r,i=bi(e.split(" "));try{for(i.s();!(r=i.n()).done;){var o=r.value,a=t.indexOf(o);a>=0&&(n[a]=!0)}}catch(e){i.e(e)}finally{i.f()}}for(var s=null,u=0;u0&&Kz(e);return{c:function(){t=go("div"),i&&i.c(),n=ko(),o&&o.c(),r=ko(),a&&a.c(),So(t,"class","jse-status-bar svelte-1oo7hnc")},m:function(e,s){vo(e,t,s),i&&i.m(t,null),uo(t,n),o&&o.m(t,null),uo(t,r),a&&a.m(t,null)},p:function(e,s){var u=ki(s,1)[0];void 0!==e[0]?i?i.p(e,u):((i=Jz(e)).c(),i.m(t,n)):i&&(i.d(1),i=null),void 0!==e[1]?o?o.p(e,u):((o=Uz(e)).c(),o.m(t,r)):o&&(o.d(1),o=null),void 0!==e[2]&&e[2]>0?a?a.p(e,u):((a=Kz(e)).c(),a.m(t,null)):a&&(a.d(1),a=null)},i:Bi,o:Bi,d:function(e){e&&po(t),i&&i.d(),o&&o.d(),a&&a.d()}}}function Qz(e,t,n){var r,i,o,a,s,u=t.editorState;return e.$$set=function(e){"editorState"in e&&n(3,u=e.editorState)},e.$$.update=function(){var t,c,l,f,h,d,v,p;8&e.$$.dirty&&n(4,r=null===(t=u)||void 0===t||null===(c=t.selection)||void 0===c||null===(l=c.main)||void 0===l?void 0:l.head);24&e.$$.dirty&&n(5,i=null===(f=u)||void 0===f||null===(h=f.doc)||void 0===h?void 0:h.lineAt(r));(32&e.$$.dirty&&n(0,o=i?i.number:void 0),48&e.$$.dirty&&n(1,a=i?r-i.from+1:void 0),8&e.$$.dirty)&&n(2,s=null===(d=u)||void 0===d||null===(v=d.selection)||void 0===v||null===(p=v.ranges)||void 0===p?void 0:p.reduce((function(e,t){return e+t.to-t.from}),0))},[o,a,s,u,r,i]}var Yz=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,Qz,Gz,Ui,{editorState:3},Hz),r}return Li(n)}(),Zz=EN.define([{tag:NT.propertyName,color:"var(--jse-key-color)"},{tag:NT.number,color:"var(--jse-value-color-number)"},{tag:NT.bool,color:"var(--jse-value-color-boolean)"},{tag:NT.string,color:"var(--jse-value-color-string)"},{tag:NT.keyword,color:"var(--jse-value-color-null)"}]),Xz=TN(Zz),eB=Zz.style;function tB(e){return"object"===zi(e.parseError)&&null!==e.parseError}Zz.style=function(e){return eB(e||[])};var nB=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function rB(e,t){if(e.length!==t.length)return!1;for(var n=0;n104857600)return{validationErrors:[{path:[],message:"Validation turned off: the document is too large",severity:pj.info}]};if(0===e.length)return{validationErrors:[]};try{var i=oB((function(){return n.parse(e)}),(function(e){return aB("validate: parsed json in ".concat(e," ms"))}));if(!t)return{validationErrors:[]};var o=n===r?i:oB((function(){return r.parse(e)}),(function(e){return aB("validate: parsed json with the validationParser in ".concat(e," ms"))}));return{validationErrors:oB((function(){return t(o)}),(function(e){return aB("validate: validated json in ".concat(e," ms"))}))}}catch(t){var a=oB((function(){return function(e,t){if(e.length>1048576)return!1;try{return t.parse(Es(e)),!0}catch(e){return!1}}(e,n)}),(function(e){return aB("validate: checked whether repairable in ".concat(e," ms"))}));return{parseError:aj(e,t.message||t.toString()),isRepairable:a}}}function cB(e){co(e,"svelte-o0o8bj",'.jse-text-mode.svelte-o0o8bj.svelte-o0o8bj{flex:1;box-sizing:border-box;display:flex;flex-direction:column;background:var(--jse-background-color)}.jse-text-mode.no-main-menu.svelte-o0o8bj.svelte-o0o8bj{border-top:var(--jse-main-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;min-height:0;border-left:var(--jse-main-border);border-right:var(--jse-main-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj:last-child{border-bottom:var(--jse-main-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.jse-hidden.svelte-o0o8bj{visibility:hidden}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor{flex:1;overflow:hidden}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-scroller{font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);line-height:var(--jse-line-height);color:var(--jse-delimiter-color)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-gutters{background:var(--jse-panel-background);color:var(--jse-panel-color-readonly);border-right:var(--jse-panel-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-activeLine,.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-activeLineGutter{background:var(--jse-hover-background-color)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-selectionBackground{background:var(--jse-selection-background-color)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-searchMatch{background-color:var(--jse-search-match-color);outline:var(--jse-search-match-outline)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-searchMatch.cm-searchMatch-selected{background-color:var(--jse-search-match-active-color);outline:var(--jse-search-match-active-outline)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-foldPlaceholder{background:var(--jse-tag-background);color:var(--jse-tag-color);border:none;padding:0 var(--jse-padding)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-tooltip{font-size:var(--jse-font-size);font-family:var(--jse-font-family);color:var(--jse-tooltip-color);background:var(--jse-tooltip-background);border:var(--jse-tooltip-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-diagnosticAction{background:var(--jse-tooltip-action-button-color);background:var(--jse-tooltip-action-button-background)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-panels{border-bottom:var(--jse-panel-border)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search{background:var(--jse-panel-background);color:var(--jse-panel-color);font-family:var(--jse-font-family);font-size:var(--jse-font-size)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search input{font-family:var(--jse-font-family);font-size:var(--jse-font-size-text-mode-search);color:var(--jse-input-color);border:var(--jse-input-border);background:var(--jse-input-background);margin-right:2px}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search button{font-family:var(--jse-font-family);font-size:var(--jse-font-size-text-mode-search);color:var(--jse-panel-button-color);background:var(--jse-panel-button-background);border:none;cursor:pointer;text-transform:capitalize;padding:calc(0.5 * var(--jse-padding)) var(--jse-padding);margin:0}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search button:hover{color:var(--jse-panel-button-color-highlight);background:var(--jse-panel-button-background-highlight)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search label{font-family:var(--jse-font-family);font-size:var(--jse-font-size-text-mode-search);padding-left:var(--jse-padding)}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search label input{margin-right:2px}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-search button[name="close"]{width:32px;height:32px;font-size:24px;line-height:24px;padding:0;right:0;top:-4px}.jse-text-mode.svelte-o0o8bj .jse-contents.svelte-o0o8bj .cm-editor .cm-cursor-primary{border-color:var(--jse-text-color)}.jse-text-mode.svelte-o0o8bj .jse-contents .jse-loading-space.svelte-o0o8bj{flex:1}.jse-text-mode.svelte-o0o8bj .jse-contents .jse-loading.svelte-o0o8bj{flex:2;text-align:center;color:var(--jse-panel-color-readonly);box-sizing:border-box;font-family:var(--jse-font-family);font-size:var(--jse-font-size)}')}function lB(e){var t,n;return t=new s_({props:{readOnly:e[0],onFormat:e[17],onCompact:e[18],onSort:e[19],onTransform:e[20],onToggleSearch:e[21],onUndo:e[22],onRedo:e[23],canFormat:!e[15],canCompact:!e[15],canSort:!e[15],canTransform:!e[15],canUndo:e[11],canRedo:e[12],onRenderMenu:e[4]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};1&n[0]&&(r.readOnly=e[0]),32768&n[0]&&(r.canFormat=!e[15]),32768&n[0]&&(r.canCompact=!e[15]),32768&n[0]&&(r.canSort=!e[15]),32768&n[0]&&(r.canTransform=!e[15]),2048&n[0]&&(r.canUndo=e[11]),4096&n[0]&&(r.canRedo=e[12]),16&n[0]&&(r.onRenderMenu=e[4]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function fB(e){var t;return{c:function(){(t=go("div")).innerHTML='
\n
loading...
',So(t,"class","jse-contents svelte-o0o8bj")},m:function(e,n){vo(e,t,n)},p:Bi,i:Bi,o:Bi,d:function(e){e&&po(t)}}}function hB(e){var t,n,r,i,o,a,s=e[10]&&dB(e),u=e[2]&&vB(e),c=!e[10]&&pB(e);return{c:function(){s&&s.c(),t=ko(),n=go("div"),r=ko(),u&&u.c(),i=ko(),c&&c.c(),o=wo(),So(n,"class","jse-contents svelte-o0o8bj"),No(n,"jse-hidden",e[10])},m:function(l,f){s&&s.m(l,f),vo(l,t,f),vo(l,n,f),e[48](n),vo(l,r,f),u&&u.m(l,f),vo(l,i,f),c&&c.m(l,f),vo(l,o,f),a=!0},p:function(e,r){e[10]?s?(s.p(e,r),1024&r[0]&&ba(s,1)):((s=dB(e)).c(),ba(s,1),s.m(t.parentNode,t)):s&&(ga(),ka(s,1,1,(function(){s=null})),ya()),(!a||1024&r[0])&&No(n,"jse-hidden",e[10]),e[2]?u?(u.p(e,r),4&r[0]&&ba(u,1)):((u=vB(e)).c(),ba(u,1),u.m(i.parentNode,i)):u&&(ga(),ka(u,1,1,(function(){u=null})),ya()),e[10]?c&&(ga(),ka(c,1,1,(function(){c=null})),ya()):c?(c.p(e,r),1024&r[0]&&ba(c,1)):((c=pB(e)).c(),ba(c,1),c.m(o.parentNode,o))},i:function(e){a||(ba(s),ba(u),ba(c),a=!0)},o:function(e){ka(s),ka(u),ka(c),a=!1},d:function(a){s&&s.d(a),a&&po(t),a&&po(n),e[48](null),a&&po(r),u&&u.d(a),a&&po(i),c&&c.d(a),a&&po(o)}}}function dB(e){var t,n;return t=new kS({props:{icon:Lx,type:"error",message:"The JSON document is larger than ".concat(zx(10485760,1024),", ")+"and may crash your browser when loading it in text mode. Actual size: ".concat(zx(e[5].length,1024),"."),actions:[{text:"Open anyway",title:"Open the document in text mode. This may freeze or crash your browser.",onClick:e[24]},{text:"Open in tree mode",title:"Open the document in tree mode. Tree mode can handle large documents.",onClick:e[3]},{text:"Cancel",title:"Cancel opening this large document.",onClick:e[25]}]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};32&n[0]&&(r.message="The JSON document is larger than ".concat(zx(10485760,1024),", ")+"and may crash your browser when loading it in text mode. Actual size: ".concat(zx(e[5].length,1024),".")),8&n[0]&&(r.actions=[{text:"Open anyway",title:"Open the document in text mode. This may freeze or crash your browser.",onClick:e[24]},{text:"Open in tree mode",title:"Open the document in tree mode. Tree mode can handle large documents.",onClick:e[3]},{text:"Cancel",title:"Cancel opening this large document.",onClick:e[25]}]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function vB(e){var t,n;return t=new Yz({props:{editorState:e[8]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};256&n[0]&&(r.editorState=e[8]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function pB(e){var t,n,r,i=e[13]&&mB(e);return n=new zS({props:{validationErrors:e[9],selectError:e[26]}}),{c:function(){i&&i.c(),t=ko(),Pa(n.$$.fragment)},m:function(e,o){i&&i.m(e,o),vo(e,t,o),Ma(n,e,o),r=!0},p:function(e,r){e[13]?i?(i.p(e,r),8192&r[0]&&ba(i,1)):((i=mB(e)).c(),ba(i,1),i.m(t.parentNode,t)):i&&(ga(),ka(i,1,1,(function(){i=null})),ya());var o={};512&r[0]&&(o.validationErrors=e[9]),n.$set(o)},i:function(e){r||(ba(i),ba(n.$$.fragment,e),r=!0)},o:function(e){ka(i),ka(n.$$.fragment,e),r=!1},d:function(e){i&&i.d(e),e&&po(t),Aa(n,e)}}}function mB(e){var t,n;return t=new kS({props:{type:"error",icon:Lx,message:e[13].message,actions:e[14],onClick:e[49]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};8192&n[0]&&(r.message=e[13].message),16384&n[0]&&(r.actions=e[14]),8192&n[0]&&(r.onClick=e[49]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function gB(e){var t,n,r,i,o,a=e[1]&&lB(e),s=[hB,fB],u=[];return r=function(e,t){return e[16]?1:0}(e),i=u[r]=s[r](e),{c:function(){t=go("div"),a&&a.c(),n=ko(),i.c(),So(t,"class","jse-text-mode svelte-o0o8bj"),No(t,"no-main-menu",!e[1])},m:function(i,s){vo(i,t,s),a&&a.m(t,null),uo(t,n),u[r].m(t,null),e[50](t),o=!0},p:function(e,r){e[1]?a?(a.p(e,r),2&r[0]&&ba(a,1)):((a=lB(e)).c(),ba(a,1),a.m(t,n)):a&&(ga(),ka(a,1,1,(function(){a=null})),ya()),i.p(e,r),(!o||2&r[0])&&No(t,"no-main-menu",!e[1])},i:function(e){o||(ba(a),ba(i),o=!0)},o:function(e){ka(a),ka(i),o=!1},d:function(n){n&&po(t),a&&a.d(),u[r].d(),e[50](null)}}}function yB(e){return{from:e.from,to:e.to,message:e.message,actions:e.actions,severity:e.severity,source:void 0}}function bB(e,t,n){var r,i,o,a,s,u,c,l=t.readOnly,f=t.mainMenuBar,h=t.statusBar,d=t.externalContent,v=t.indentation,p=t.tabSize,m=t.escapeUnicodeCharacters,g=t.parser,y=t.validator,b=t.validationParser,k=t.onChange,w=t.onSwitchToTreeMode,j=t.onError,x=t.onFocus,S=t.onBlur,_=t.onRenderMenu,C=t.onSortModal,$=t.onTransformModal,O=La("jsoneditor:TextMode"),E={key:"Mod-i",run:G,shift:Q,preventDefault:!0},P="undefined"==typeof window;O("isSSR:",P);var M=!1,A=[],T=new iC,N=new iC,I=new iC,R=new iC,D=new iC,L=d,z=cj(L,v,g),B=he(z,M),q=m;Ko(yi(mi().mark((function e(){return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P){e.next=2;break}return e.abrupt("return");case 2:try{s=re({target:a,initialText:B?"":i.escapeValue(z),readOnly:l,indentation:v}),J()}catch(e){console.error(e)}case 3:case"end":return e.stop()}}),e)})))),Go((function(){s&&(O("Destroy CodeMirror editor"),s.destroy())}));var F=!1,V=!1,W=ew(),H=ew();function J(){s&&(O("focus"),s.focus())}var U=!1;function K(e){O("patch",e);var t=g.parse(z),n=hs.exports.immutableJSONPatch(t,e),r=hs.exports.revertJSONPatch(t,e);return ae({text:g.stringify(n,null,v)}),{json:n,previousJson:t,undo:r,redo:e}}function G(){if(O("format"),!l)try{var e=g.parse(z);ae({text:g.stringify(e,null,v)})}catch(e){j(e)}}function Q(){if(O("compact"),!l)try{var e=g.parse(z);ae({text:g.stringify(e)})}catch(e){j(e)}}function Y(){if(O("repair"),!l)try{ae({text:Es(z)}),n(47,de="valid"),n(13,ve=void 0)}catch(e){j(e)}}function Z(e){var t=e.id,n=e.selectedPath,r=e.onTransform,i=e.onClose;try{var o=g.parse(z);U=!0,$({id:t||H,json:o,selectedPath:n,onTransform:r?function(e){r({operations:e,json:o,transformedJson:hs.exports.immutableJSONPatch(o,e)})}:function(e){O("onTransform",e),K(e)},onClose:function(){U=!1,J(),i&&i()}})}catch(e){j(e)}}function X(e){O("select parse error",e);var t=oe(e,!1);ee(t.from,t.to),J()}function ee(e,t){O("setSelection",{anchor:e,head:t}),s&&s.dispatch(s.state.update({selection:{anchor:e,head:t},scrollIntoView:!0}))}function te(e,t){if(1===t.state.selection.ranges.length){var n=t.state.selection.ranges[0],r=z.slice(n.from,n.to);if("{"===r||"["===r){var i=ds.parse(z),o=Object.keys(i.pointers).find((function(e){var t;return(null===(t=i.pointers[e].value)||void 0===t?void 0:t.pos)===n.from})),a=i.pointers[o];if(o&&a&&a.value&&a.valueEnd)O("pointer found, selecting inner contents of path:",o,a),ee(a.value.pos+1,a.valueEnd.pos-1)}}}function ne(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return XL.of({source:e,config:t})}(pe,{delay:300})}function re(e){var t=e.target,r=e.initialText,i=e.readOnly,o=e.indentation;O("Create CodeMirror editor",{readOnly:i,indentation:o});var a=MC.create({doc:r,extensions:[iM.of([zR,E]),T.of(ne()),mz(),yz,Xz,GP.domEventHandlers({dblclick:te}),GP.updateListener.of((function(e){n(8,c=e.state),e.docChanged&&le()})),new GT(Wz),cD({top:!0}),I.of(MC.readOnly.of(i)),N.of(GP.editable.of(!i)),D.of(MC.tabSize.of(p)),R.of(ue(o)),GP.lineWrapping]});return s=new GP({state:a,parent:t})}function ie(e){var t=e.path,n=e.message,r=function(e,t){try{var n=ds.parse(e),r=hs.exports.compileJSONPointer(t),i=n.pointers[r];if(i)return{path:t,line:i.key?i.key.line:i.value?i.value.line:0,column:i.key?i.key.column:i.value?i.value.column:0,from:i.key?i.key.pos:i.value?i.value.pos:0,to:i.keyEnd?i.keyEnd.pos:i.valueEnd?i.valueEnd.pos:0}}catch(e){console.error(e)}return null}(i.escapeValue(z),t);return{path:t,line:r.line,column:r.column,from:r.from,to:r.to,message:n,severity:pj.warning,actions:[]}}function oe(e,t){var n=e.line,r=e.column,i=e.position,o=e.message;return{path:null,line:n,column:r,from:i||0,to:i||0,severity:pj.error,message:o,actions:t&&!l?[{name:"Auto repair",apply:function(){return Y()}}]:null}}function ae(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=cj(e,v,g);if(n(10,B=he(r,M)),B)O("externalContent not applying text: editor is disabled");else{var o=!Mm(e,L);if(O("setCodeMirrorContent",{isChanged:o,forceUpdate:t}),s&&(o||t)){var a=L;L=e,n(5,z=r),s.dispatch({changes:{from:0,to:s.state.doc.length,insert:i.escapeValue(z)}}),ce(),o&&fe(L,a)}}}function se(){if(s){var e=s?i.unescapeValue(s.state.doc.toString()):"",t=e!==z;if(O("onChangeCodeMirrorValue",{isChanged:t}),t){var r=L;n(5,z=e),L={text:z},ce(),fe(L,r)}}}function ue(e){return YT.of("number"==typeof e?" ".repeat(e):e)}function ce(){n(11,F=CI(s.state)>0),n(12,V=$I(s.state)>0),O({canUndo:F,canRedo:V})}qx({onMount:Ko,onDestroy:Go,getWindow:function(){return Lj(u)},hasFocus:function(){return U&&document.hasFocus()||zj(u)},onFocus:x,onBlur:S});var le=cv(se,300);function fe(e,t){k&&k(e,t,{contentErrors:me(),patchResult:null})}function he(e,t){return e&&e.length>10485760&&!t}var de="valid",ve=null;function pe(){if(B)return[];var e=me();return tB(e)?[yB(oe(e.parseError,e.isRepairable))]:function(e){return Array.isArray(e.validationErrors)}(e)?e.validationErrors.map(ie).map(yB):[]}function me(){O("validate:start"),le.flush();var e=ge(i.escapeValue(z),y,g,b);return tB(e)?(n(47,de=e.isRepairable?"repairable":"invalid"),n(13,ve=e.parseError),n(9,A=[])):(n(47,de="valid"),n(13,ve=null),n(9,A=e.validationErrors)),O("validate:end"),e}var ge=iB(uB);return e.$$set=function(e){"readOnly"in e&&n(0,l=e.readOnly),"mainMenuBar"in e&&n(1,f=e.mainMenuBar),"statusBar"in e&&n(2,h=e.statusBar),"externalContent"in e&&n(28,d=e.externalContent),"indentation"in e&&n(29,v=e.indentation),"tabSize"in e&&n(30,p=e.tabSize),"escapeUnicodeCharacters"in e&&n(31,m=e.escapeUnicodeCharacters),"parser"in e&&n(32,g=e.parser),"validator"in e&&n(33,y=e.validator),"validationParser"in e&&n(34,b=e.validationParser),"onChange"in e&&n(35,k=e.onChange),"onSwitchToTreeMode"in e&&n(3,w=e.onSwitchToTreeMode),"onError"in e&&n(36,j=e.onError),"onFocus"in e&&n(37,x=e.onFocus),"onBlur"in e&&n(38,S=e.onBlur),"onRenderMenu"in e&&n(4,_=e.onRenderMenu),"onSortModal"in e&&n(39,C=e.onSortModal),"onTransformModal"in e&&n(40,$=e.onTransformModal)},e.$$.update=function(){32&e.$$.dirty[0]&&n(15,r=0===z.length),1&e.$$.dirty[1]&&(i=wj({escapeControlCharacters:!1,escapeUnicodeCharacters:m})),268435456&e.$$.dirty[0]&&ae(d),4&e.$$.dirty[1]&&function(e){O("updateLinter",e),s&&s.dispatch({effects:T.reconfigure(ne())})}(y),536870912&e.$$.dirty[0]&&function(e){s&&(O("updateIndentation",e),s.dispatch({effects:R.reconfigure(ue(e))}))}(v),1073741824&e.$$.dirty[0]&&function(e){s&&(O("updateTabSize",e),s.dispatch({effects:D.reconfigure(MC.tabSize.of(e))}))}(p),1&e.$$.dirty[0]&&function(e){s&&(O("updateReadOnly",e),s.dispatch({effects:[I.reconfigure(MC.readOnly.of(e)),N.reconfigure(GP.editable.of(!e))]}))}(l),32769&e.$$.dirty[1]&&q!==m&&(n(46,q=m),O("forceUpdateText",{escapeUnicodeCharacters:m}),s&&s.dispatch({changes:{from:0,to:s.state.doc.length,insert:i.escapeValue(z)}})),1&e.$$.dirty[0]|65536&e.$$.dirty[1]&&n(14,o="repairable"!==de||l?[]:[{icon:bx,text:"Auto repair",title:"Automatically repair JSON",onClick:Y}])},[l,f,h,w,_,z,a,u,c,A,B,F,V,ve,o,r,P,G,Q,function(){var e;if(!l)try{var t=g.parse(z);U=!0,C({id:W,json:t,selectedPath:[],onSort:(e=yi(mi().mark((function e(t){return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O("onSort",t),K(t);case 2:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),onClose:function(){U=!1,J()}})}catch(e){j(e)}},function(){l||Z({selectedPath:[]})},function(){s&&(a&&a.querySelector(".cm-search")?ND(s):TD(s))},function(){l||s&&(wI(s),J())},function(){l||s&&(jI(s),J())},function(){M=!0,ae(d,!0)},function(){se()},function(e){O("select validation error",e);var t=ie(e);ee(t.from,t.to),J()},X,d,v,p,m,g,y,b,k,j,x,S,C,$,J,K,Z,function(){O("refresh");var e=s.state.doc.length;s.dispatch({changes:{from:e,to:e,insert:" "}}),s.dispatch({changes:{from:e,to:e+1,insert:""}})},me,q,de,function(e){ea[e?"unshift":"push"]((function(){n(6,a=e)}))},function(){return X(ve)},function(e){ea[e?"unshift":"push"]((function(){n(7,u=e)}))}]}var kB=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,bB,gB,Ki,{readOnly:0,mainMenuBar:1,statusBar:2,externalContent:28,indentation:29,tabSize:30,escapeUnicodeCharacters:31,parser:32,validator:33,validationParser:34,onChange:35,onSwitchToTreeMode:3,onError:36,onFocus:37,onBlur:38,onRenderMenu:4,onSortModal:39,onTransformModal:40,focus:41,patch:42,openTransformModal:43,refresh:44,validate:45},cB,[-1,-1,-1]),r}return Li(n,[{key:"focus",get:function(){return this.$$.ctx[41]}},{key:"patch",get:function(){return this.$$.ctx[42]}},{key:"openTransformModal",get:function(){return this.$$.ctx[43]}},{key:"refresh",get:function(){return this.$$.ctx[44]}},{key:"validate",get:function(){return this.$$.ctx[45]}}]),n}(),wB=La("jsoneditor:AutoScrollHandler");var jB=function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},xB=function(){var e,t,n,r,i,o,a,s,u,c,l,f,h;function d(){return e.scrollY||e.pageYOffset||e.scrollTop}function v(t){return t.getBoundingClientRect().top-(e.getBoundingClientRect?e.getBoundingClientRect().top:0)+n}function p(t){e.scrollTo?e.scrollTo(0,t):e.scrollTop=t}function m(e){c||(c=e),p(o(l=e-c,n,s,u)),h=!0,l1&&void 0!==arguments[1]?arguments[1]:{};switch(u=p.duration||1e3,i=p.offset||0,f=p.callback,o=p.easing||jB,a=p.a11y||!1,zi(p.container)){case"object":e=p.container;break;case"string":e=document.querySelector(p.container);break;default:e=window}switch(n=d(),zi(l)){case"number":t=void 0,a=!1,r=n+l;break;case"object":r=v(t=l);break;case"string":t=document.querySelector(l),r=v(t)}switch(s=r-n+i,zi(p.duration)){case"number":u=p.duration;break;case"function":u=p.duration(s)}h?c=!1:requestAnimationFrame(m)}};function SB(e){for(var t=$b(e,(function(e){return e.start})),n=[t[0]],r=0;r=e.start&&t0){var u=EB(t,s);PB(n,u,(function(t){o[a]=String(t),e(n[t])})),o.pop()}}}else if(Ts(n)&&r(o)){i[hs.exports.compileJSONPointer(o)]=!0;var c=Object.keys(n);if(c.length>0){var l,f=bi(c);try{for(f.s();!(l=f.n()).done;){var h=l.value;o[a]=h,e(n[h])}}catch(e){f.e(e)}finally{f.f()}o.pop()}}}(hs.exports.getIn(e,n)),ji(ji({},t),{},{expandedMap:i})}function TB(e,t){return ji(ji({},e),{},{expandedMap:ji(ji({},e.expandedMap),{},xi({},hs.exports.compileJSONPointer(t),!0))})}function NB(e,t){var n=zB(e.expandedMap,t),r=zB(e.enforceStringMap,t),i=zB(e.visibleSectionsMap,t);return ji(ji({},e),{},{expandedMap:n,enforceStringMap:r,visibleSectionsMap:i})}function IB(e,t,n){if(n){var r=ji({},e.enforceStringMap);return r[t]=n,ji(ji({},e),{},{enforceStringMap:r})}if("boolean"==typeof e.enforceStringMap[t]){var i=ji({},e.enforceStringMap);return delete i[t],ji(ji({},e),{},{enforceStringMap:i})}return e}function RB(e,t,n){var r=hs.exports.immutableJSONPatch(e,n),i=n.reduce((function(e,t){return hs.exports.isJSONPatchAdd(t)?DB(r,e,t):hs.exports.isJSONPatchRemove(t)?LB(r,e,t):hs.exports.isJSONPatchReplace(t)?function(e,t,n){var r=n.path,i=WB(e,t.expandedMap),o=WB(e,t.enforceStringMap),a=WB(e,t.visibleSectionsMap);hs.exports.isJSONObject(n.value)||hs.exports.isJSONArray(n.value)||delete i[r];hs.exports.isJSONArray(n.value)||delete a[r];(hs.exports.isJSONObject(n.value)||hs.exports.isJSONArray(n.value))&&delete o[r];return ji(ji({},t),{},{expandedMap:i,enforceStringMap:o,visibleSectionsMap:a})}(r,e,t):hs.exports.isJSONPatchCopy(t)||hs.exports.isJSONPatchMove(t)?function(e,t,n){if(hs.exports.isJSONPatchMove(n)&&n.from===n.path)return t;var r=function(e){return n.path+e.substring(n.from.length)},i=FB(BB(t.expandedMap,n.from),r),o=FB(BB(t.enforceStringMap,n.from),r),a=FB(BB(t.visibleSectionsMap,n.from),r),s=t;hs.exports.isJSONPatchMove(n)&&(s=LB(e,s,{op:"remove",path:n.from}));var u=qB((s=DB(e,s,{op:"add",path:n.path,value:null})).expandedMap,i),c=qB(s.enforceStringMap,o),l=qB(s.visibleSectionsMap,a);return ji(ji({},t),{},{expandedMap:u,enforceStringMap:c,visibleSectionsMap:l})}(r,e,t):e}),t);return{json:r,documentState:i}}function DB(e,t,n){var r=hs.exports.parsePath(e,n.path),i=om(r),o=hs.exports.compileJSONPointer(i),a=hs.exports.getIn(e,i);if(hs.exports.isJSONArray(a)){var s=Ps(Ov(r)),u=VB(t.expandedMap,i,s,1),c=VB(t.enforceStringMap,i,s,1),l=VB(t.visibleSectionsMap,i,s,1);return l=HB(l,o,(function(e){return JB(e,s,1)})),ji(ji({},t),{},{expandedMap:u,enforceStringMap:c,visibleSectionsMap:l})}return t}function LB(e,t,n){var r=hs.exports.parsePath(e,n.path),i=om(r),o=hs.exports.compileJSONPointer(i),a=hs.exports.getIn(e,i),s=t.expandedMap,u=t.enforceStringMap,c=t.visibleSectionsMap;if(s=zB(s,r),u=zB(u,r),c=zB(c,r),hs.exports.isJSONArray(a)){var l=Ps(Ov(r));s=VB(s,i,l,-1),u=VB(u,i,l,-1),c=HB(c=VB(c,i,l,-1),o,(function(e){return JB(e,l,-1)}))}return ji(ji({},t),{},{expandedMap:s,enforceStringMap:u,visibleSectionsMap:c})}function zB(e,t){var n={},r=hs.exports.compileJSONPointer(t);return Object.keys(e).forEach((function(t){hs.exports.startsWithJSONPointer(t,r)||(n[t]=e[t])})),n}function BB(e,t){var n={};return Object.keys(e).forEach((function(r){hs.exports.startsWithJSONPointer(r,t)&&(n[r]=e[r])})),n}function qB(e,t){return ji(ji({},e),t)}function FB(e,t){var n={};return Object.keys(e).forEach((function(r){var i=t(r);n[i]=e[r]})),n}function VB(e,t,n,r){for(var i=t.length,o=hs.exports.compileJSONPointer(t),a=[],s=0,u=Object.keys(e);s=n&&(l[i]=String(f+r),a.push({oldPointer:c,newPointer:hs.exports.compileJSONPointer(l),value:e[c]}))}}if(0===a.length)return e;var h=ji({},e);return a.forEach((function(e){delete h[e.oldPointer]})),a.forEach((function(e){h[e.newPointer]=e.value})),h}function WB(e,t){var n={};return Object.keys(t).filter((function(t){return hs.exports.existsIn(e,hs.exports.parsePath(e,t))})).forEach((function(e){n[e]=t[e]})),n}function HB(e,t,n){var r=e[t];if(t in e){var i=n(r);if(!Mm(r,i)){var o=ji({},e);return void 0===i?delete o[t]:o[t]=i,o}}return e}function JB(e,t,n){return e.map((function(e){return{start:e.start>t?e.start+n:e.start,end:e.end>=t?e.end+n:e.end}}))}function UB(e,t,n,r){var i=t?t[n]:void 0;return"boolean"==typeof i?i:function(e,t){return"string"==typeof e&&"string"!=typeof Bs(e,t)}(e,r)}function KB(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.indexOf(t);return-1!==r?n?e.slice(r):e.slice(r+1):[]}function GB(e,t){var n=[];return function e(r,i){n.push(i);var o=hs.exports.compileJSONPointer(i);if(r&&!0===t.expandedMap[o]){if(hs.exports.isJSONArray(r)){var a=EB(t,o);PB(r,a,(function(t){e(r[t],i.concat(String(t)))}))}hs.exports.isJSONObject(r)&&Object.keys(r).forEach((function(t){e(r[t],i.concat(t))}))}}(e,[]),n}function QB(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=[];function i(e,o){r.push({path:o,type:vj.value});var a=hs.exports.compileJSONPointer(o);if(e&&!0===t.expandedMap[a]){if(n&&r.push({path:o,type:vj.inside}),hs.exports.isJSONArray(e)){var s=EB(t,a);PB(e,s,(function(t){var a=o.concat(String(t));i(e[t],a),n&&r.push({path:a,type:vj.after})}))}if(hs.exports.isJSONObject(e))Object.keys(e).forEach((function(t){var a=o.concat(t);r.push({path:a,type:vj.key}),i(e[t],a),n&&r.push({path:a,type:vj.after})}))}}return i(e,[]),r}function YB(e,t,n){var r=GB(e,t),i=r.map(hs.exports.compileJSONPointer),o=hs.exports.compileJSONPointer(n),a=i.indexOf(o);return-1!==a&&a>0?r[a-1]:null}function ZB(e,t,n){var r=GB(e,t),i=r.map(hs.exports.compileJSONPointer).indexOf(hs.exports.compileJSONPointer(n));return-1!==i&&i0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxItems||1e3,n=[],r=0;function i(){return r0}function a(){return{canUndo:i(),canRedo:o(),length:n.length}}function s(){e.onChange&&e.onChange(a())}function u(e){XB("add",e),n=[e].concat(n.slice(r)).slice(0,t),r=0,s()}function c(){XB("clear"),n=[],r=0,s()}function l(){if(i()){var e=n[r];return r+=1,XB("undo",e),s(),e}}function f(){if(o())return XB("redo",n[r-=1]),s(),n[r]}return{add:u,clear:c,getState:a,undo:l,redo:f}}function tq(e,t){for(var n=new Set(t),r=e.replace(/ \(copy( \d+)?\)$/,""),i=e,o=1;n.has(i);){var a="copy"+(o>1?" "+o:"");i="".concat(r," (").concat(a,")"),o++}return i}function nq(e,t){var n=t-"...".length;return e.length>t?e.substring(0,n)+"...":e}function rq(e){if(""===e)return"";var t=e.toLowerCase();if("null"===t)return null;if("true"===t)return!0;if("false"===t)return!1;if("undefined"!==t){var n=Number(e),r=parseFloat(e);return isNaN(n)||isNaN(r)?e:n}}function iq(e){return e&&e.type===dj.after}function oq(e){return e&&e.type===dj.inside}function aq(e){return e&&e.type===dj.key}function sq(e){return e&&e.type===dj.value}function uq(e){return e&&e.type===dj.multi}function cq(e){return oq(e)?e.focusPath:om(e.focusPath)}function lq(e){return uq(e)?bp(e.paths):e.focusPath}function fq(e){return uq(e)?Ov(e.paths):e.focusPath}function hq(e,t){return wq(e.focusPath,t)&&(e.focusPath.length>t.length||oq(e))}function dq(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t.selection,o=!r&&uq(i)?bp(i.paths):i.focusPath,a=YB(e,t,o);if(null===a)return null;var s=a,u=a;if(n)return iq(i)||oq(i)?$q(e,i.anchorPath,i.anchorPath):$q(e,i.anchorPath,u);if(aq(i)){var c=om(a),l=hs.exports.getIn(e,c);return Array.isArray(l)||Pm(a)?Sq(a,!1):xq(a,!1)}return sq(i)?Sq(a,!1):iq(i)||oq(i)?$q(e,o,o):$q(e,s,u)}function vq(e,t,n){var r=t.selection,i=QB(e,t,n),o=i.findIndex((function(e){return Mm(e.path,r.focusPath)&&String(e.type)===String(r.type)}));return{caret:-1!==o?i[o]:null,previous:-1!==o&&o>0?i[o-1]:null,next:-1!==o&&on[r].length;)r++;var i=n[r];return 0===i.length||Array.isArray(hs.exports.getIn(e,om(i)))?Sq(i,!1):xq(i,!1)}function mq(e,t){if(1===t.length){var n=bp(t);if("replace"===n.op||"move"===n.op)return Sq(hs.exports.parsePath(e,n.path),!1)}if(!Pm(t)&&t.every((function(e){return"move"===e.op}))){var r=bp(t),i=t.slice(1);if((hs.exports.isJSONPatchCopy(r)||hs.exports.isJSONPatchMove(r))&&r.from!==r.path&&i.every((function(e){return(hs.exports.isJSONPatchCopy(e)||hs.exports.isJSONPatchMove(e))&&e.from===e.path})))return xq(hs.exports.parsePath(e,r.path),!1)}var o=t.filter((function(e){return"test"!==e.op&&"remove"!==e.op&&("move"!==e.op||e.from!==e.path)&&"string"==typeof e.path})).map((function(t){return hs.exports.parsePath(e,t.path)}));return Pm(o)?null:{type:dj.multi,paths:o,anchorPath:bp(o),focusPath:Ov(o),pointersMap:gq(o)}}function gq(e){var t={};return e.forEach((function(e){t[hs.exports.compileJSONPointer(e)]=!0})),t}function yq(e){return xi({},hs.exports.compileJSONPointer(e),!0)}function bq(e){return e&&(aq(e)||sq(e)||uq(e)&&1===e.paths.length)}function kq(e,t){return bq(t)&&Ns(hs.exports.getIn(e,t.focusPath))?t.focusPath:om(t.focusPath)}function wq(e,t){if(e.length0?0:-1,n=e.items[t],r=e.items.map((function(e,n){return ji(ji({},e),{},{active:n===t})}));return ji(ji({},e),{},{items:r,itemsMap:qp(r,(function(e){return hs.exports.compileJSONPointer(e.path)})),activeItem:n,activeIndex:t})}function Hq(e){var t=e.activeIndex>0?e.activeIndex-1:e.items.length-1,n=e.items[t],r=e.items.map((function(e,n){return ji(ji({},e),{},{active:n===t})}));return ji(ji({},e),{},{items:r,itemsMap:qp(r,(function(e){return hs.exports.compileJSONPointer(e.path)})),activeItem:n,activeIndex:t})}function Jq(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,i=[],o=[];function a(e){i.length=r)return;o.pop()}else if(hs.exports.isJSONObject(t)){var c=Object.keys(t),l=o.length;o.push("");for(var f=0,h=c;f=r)return}o.pop()}else Uq(String(t),e,o,mj.value,a)}if("string"==typeof e&&""!==e){var u=e.toLowerCase();s(u,t)}return i}function Uq(e,t,n,r,i){var o=e.toLowerCase(),a=0,s=-1,u=-1;do{-1!==(u=o.indexOf(t,s))&&(s=u+t.length,i({path:n.slice(0),field:r,fieldIndex:a,start:u,end:s}),a++)}while(-1!==u)}function Kq(e,t,n,r){return e.substring(0,n)+t+e.substring(r)}function Gq(e,t,n){var r=e;return Vv(n,(function(e){r=Kq(r,t,e.start,e.end)})),r}function Qq(e,t,n,r,i){var o=r.field,a=r.path,s=r.start,u=r.end;if(o===mj.key){var c=om(a),l=hs.exports.getIn(e,c),f=Ov(a),h=Dq(c,Object.keys(l),f,Kq(f,n,s,u));return{newSelection:mq(e,h),operations:h}}if(o===mj.value){var d=hs.exports.getIn(e,a);if(void 0===d)throw new Error("Cannot replace: path not found ".concat(hs.exports.compileJSONPointer(a)));var v="string"==typeof d?d:String(d),p=hs.exports.compileJSONPointer(a),m=UB(d,t.enforceStringMap,p,i),g=Kq(v,n,s,u),y=[{op:"replace",path:hs.exports.compileJSONPointer(a),value:m?g:Bs(g,i)}];return{newSelection:mq(e,y),operations:y}}throw new Error("Cannot replace: unknown type of search result field ".concat(o))}function Yq(e,t,n,r,i){for(var o=Jq(n,e,t,1/0),a=[],s=0;s"',xe=bo(" Value"),Ce=ko(),$e=go("div"),Oe=ko(),Ee=go("div"),Pe=go("button"),Pa(Me.$$.fragment),Ae=bo(" Insert before"),Ne=ko(),Ie=go("button"),Pa(Re.$$.fragment),De=bo(" Insert after"),ze=ko(),Ve&&Ve.c(),So(r,"type","button"),So(r,"title","Edit the key (Double-click on the key)"),r.disabled=a=!e[14],So(r,"class","svelte-1yai37q"),So(n,"class","jse-row svelte-1yai37q"),So(l,"class","jse-separator svelte-1yai37q"),So(g,"type","button"),So(g,"title","Paste clipboard contents (Ctrl+V)"),g.disabled=k=!e[3],So(g,"class","svelte-1yai37q"),So(h,"class","jse-row svelte-1yai37q"),So(j,"class","jse-separator svelte-1yai37q"),So(C,"type","button"),So(C,"title","Remove selected contents (Delete)"),C.disabled=E=!e[1],So(C,"class","svelte-1yai37q"),So(M,"type","button"),So(M,"title","Duplicate selected contents (Ctrl+D)"),M.disabled=N=!e[16],So(M,"class","svelte-1yai37q"),So(R,"type","button"),So(R,"title","Extract selected contents"),R.disabled=z=!e[15],So(R,"class","svelte-1yai37q"),So(q,"type","button"),So(q,"title","Sort array or object contents"),q.disabled=W=!e[1],So(q,"class","svelte-1yai37q"),So(J,"type","button"),So(J,"title","Transform array or object contents (filter, sort, project)"),J.disabled=G=!e[1],So(J,"class","svelte-1yai37q"),So(_,"class","jse-column svelte-1yai37q"),So(Z,"class","jse-label svelte-1yai37q"),So(ie,"class","jse-plus svelte-1yai37q"),So(re,"class","jse-insert svelte-1yai37q"),So(ne,"type","button"),So(ne,"title",ae=e[13]+" structure"),ne.disabled=se=!e[12],So(ne,"class","svelte-1yai37q"),So(le,"class","jse-insert svelte-1yai37q"),So(ce,"type","button"),So(ce,"title",he=e[13]+" object"),ce.disabled=de=!e[11],So(ce,"class","svelte-1yai37q"),So(me,"class","jse-insert svelte-1yai37q"),So(pe,"type","button"),So(pe,"title",ye=e[13]+" array"),pe.disabled=be=!e[10],So(pe,"class","svelte-1yai37q"),So(je,"class","jse-insert svelte-1yai37q"),So(we,"type","button"),So(we,"title",Se=e[13]+" value"),we.disabled=_e=!e[9],So(we,"class","svelte-1yai37q"),So(Y,"class","jse-column svelte-1yai37q"),So(S,"class","jse-row svelte-1yai37q"),So($e,"class","jse-separator svelte-1yai37q"),So(Pe,"type","button"),So(Pe,"title","Select area before current entry to insert or paste contents"),Pe.disabled=Te=!e[1]||e[4],So(Pe,"class","svelte-1yai37q"),So(Ie,"type","button"),So(Ie,"title","Select area after current entry to insert or paste contents"),Ie.disabled=Le=!e[1]||e[4],So(Ie,"class","svelte-1yai37q"),So(Ee,"class","jse-row svelte-1yai37q"),So(t,"class","jse-contextmenu svelte-1yai37q")},m:function(a,k){vo(a,t,k),uo(t,n),uo(n,r),Ma(i,r,null),uo(r,o),uo(n,s),Ma(u,n,null),uo(t,c),uo(t,l),uo(t,f),uo(t,h),Ma(d,h,null),uo(h,v),Ma(p,h,null),uo(h,m),uo(h,g),Ma(y,g,null),uo(g,b),uo(t,w),uo(t,j),uo(t,x),uo(t,S),uo(S,_),uo(_,C),Ma($,C,null),uo(C,O),uo(_,P),uo(_,M),Ma(A,M,null),uo(M,T),uo(_,I),uo(_,R),Ma(D,R,null),uo(R,L),uo(_,B),uo(_,q),Ma(F,q,null),uo(q,V),uo(_,H),uo(_,J),Ma(U,J,null),uo(J,K),uo(S,Q),uo(S,Y),uo(Y,Z),uo(Z,X),uo(Z,ee),uo(Y,te),uo(Y,ne),uo(ne,re),uo(re,ie),uo(ne,oe),uo(Y,ue),uo(Y,ce),uo(ce,le),uo(ce,fe),uo(Y,ve),uo(Y,pe),uo(pe,me),uo(pe,ge),uo(Y,ke),uo(Y,we),uo(we,je),uo(we,xe),uo(t,Ce),uo(t,$e),uo(t,Oe),uo(t,Ee),uo(Ee,Pe),Ma(Me,Pe,null),uo(Pe,Ae),uo(Ee,Ne),uo(Ee,Ie),Ma(Re,Ie,null),uo(Ie,De),uo(t,ze),Ve&&Ve.m(t,null),e[59](t),Be=!0,qe||(Fe=[jo(r,"click",e[17]),jo(g,"click",e[21]),jo(C,"click",e[22]),jo(M,"click",e[23]),jo(R,"click",e[24]),jo(q,"click",e[26]),jo(J,"click",e[27]),jo(ne,"click",e[55]),jo(ce,"click",e[56]),jo(pe,"click",e[57]),jo(we,"click",e[58]),jo(Pe,"click",e[28]),jo(Ie,"click",e[29]),jo(t,"keydown",e[30])],qe=!0)},p:function(e,n){(!Be||16384&n[0]&&a!==(a=!e[14]))&&(r.disabled=a);var i={};256&n[0]&&(i.items=e[8]),4&n[0]|2&n[2]&&(i.$$scope={dirty:n,ctx:e}),u.$set(i);var o={};128&n[0]&&(o.items=e[7]),2&n[0]|2&n[2]&&(o.$$scope={dirty:n,ctx:e}),d.$set(o);var s={};64&n[0]&&(s.items=e[6]),2&n[0]|2&n[2]&&(s.$$scope={dirty:n,ctx:e}),p.$set(s),(!Be||8&n[0]&&k!==(k=!e[3]))&&(g.disabled=k),(!Be||2&n[0]&&E!==(E=!e[1]))&&(C.disabled=E),(!Be||65536&n[0]&&N!==(N=!e[16]))&&(M.disabled=N),(!Be||32768&n[0]&&z!==(z=!e[15]))&&(R.disabled=z),(!Be||2&n[0]&&W!==(W=!e[1]))&&(q.disabled=W),(!Be||2&n[0]&&G!==(G=!e[1]))&&(J.disabled=G),(!Be||8192&n[0])&&Eo(X,e[13]),(!Be||8192&n[0]&&ae!==(ae=e[13]+" structure"))&&So(ne,"title",ae),(!Be||4096&n[0]&&se!==(se=!e[12]))&&(ne.disabled=se),(!Be||8192&n[0]&&he!==(he=e[13]+" object"))&&So(ce,"title",he),(!Be||2048&n[0]&&de!==(de=!e[11]))&&(ce.disabled=de),(!Be||8192&n[0]&&ye!==(ye=e[13]+" array"))&&So(pe,"title",ye),(!Be||1024&n[0]&&be!==(be=!e[10]))&&(pe.disabled=be),(!Be||8192&n[0]&&Se!==(Se=e[13]+" value"))&&So(we,"title",Se),(!Be||512&n[0]&&_e!==(_e=!e[9]))&&(we.disabled=_e),(!Be||18&n[0]&&Te!==(Te=!e[1]||e[4]))&&(Pe.disabled=Te),(!Be||18&n[0]&&Le!==(Le=!e[1]||e[4]))&&(Ie.disabled=Le),e[0]?Ve?(Ve.p(e,n),1&n[0]&&ba(Ve,1)):((Ve=LF()).c(),ba(Ve,1),Ve.m(t,null)):Ve&&(ga(),ka(Ve,1,1,(function(){Ve=null})),ya())},i:function(e){Be||(ba(i.$$.fragment,e),ba(u.$$.fragment,e),ba(d.$$.fragment,e),ba(p.$$.fragment,e),ba(y.$$.fragment,e),ba($.$$.fragment,e),ba(A.$$.fragment,e),ba(D.$$.fragment,e),ba(F.$$.fragment,e),ba(U.$$.fragment,e),ba(Me.$$.fragment,e),ba(Re.$$.fragment,e),ba(Ve),Be=!0)},o:function(e){ka(i.$$.fragment,e),ka(u.$$.fragment,e),ka(d.$$.fragment,e),ka(p.$$.fragment,e),ka(y.$$.fragment,e),ka($.$$.fragment,e),ka(A.$$.fragment,e),ka(D.$$.fragment,e),ka(F.$$.fragment,e),ka(U.$$.fragment,e),ka(Me.$$.fragment,e),ka(Re.$$.fragment,e),ka(Ve),Be=!1},d:function(n){n&&po(t),Aa(i),Aa(u),Aa(d),Aa(p),Aa(y),Aa($),Aa(A),Aa(D),Aa(F),Aa(U),Aa(Me),Aa(Re),Ve&&Ve.d(),e[59](null),qe=!1,Hi(Fe)}}}function BF(e,t,n){var r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b,k,w,j,x,S=t.json,_=t.documentState,C=t.parser,$=t.showTip,O=t.onCloseContextMenu,E=t.onEditKey,P=t.onEditValue,M=t.onToggleEnforceString,A=t.onCut,T=t.onCopy,N=t.onPaste,I=t.onRemove,R=t.onDuplicate,D=t.onExtract,L=t.onInsertBefore,z=t.onInsert,B=t.onConvert,q=t.onInsertAfter,F=t.onSort,V=t.onTransform;function W(){O(),P()}function H(){O(),M()}function J(){O(),A(!0)}function U(){O(),A(!1)}function K(){O(),T(!0)}function G(){O(),T(!1)}function Q(e){O(),u?B(e):z(e)}Ko((function(){setTimeout((function(){var e=Ti(x.querySelectorAll("button")).find((function(e){return!e.disabled}));e&&e.focus()}))}));return e.$$set=function(e){"json"in e&&n(31,S=e.json),"documentState"in e&&n(32,_=e.documentState),"parser"in e&&n(33,C=e.parser),"showTip"in e&&n(0,$=e.showTip),"onCloseContextMenu"in e&&n(34,O=e.onCloseContextMenu),"onEditKey"in e&&n(35,E=e.onEditKey),"onEditValue"in e&&n(36,P=e.onEditValue),"onToggleEnforceString"in e&&n(37,M=e.onToggleEnforceString),"onCut"in e&&n(38,A=e.onCut),"onCopy"in e&&n(39,T=e.onCopy),"onPaste"in e&&n(40,N=e.onPaste),"onRemove"in e&&n(41,I=e.onRemove),"onDuplicate"in e&&n(42,R=e.onDuplicate),"onExtract"in e&&n(43,D=e.onExtract),"onInsertBefore"in e&&n(44,L=e.onInsertBefore),"onInsert"in e&&n(45,z=e.onInsert),"onConvert"in e&&n(46,B=e.onConvert),"onInsertAfter"in e&&n(47,q=e.onInsertAfter),"onSort"in e&&n(48,F=e.onSort),"onTransform"in e&&n(49,V=e.onTransform)},e.$$.update=function(){2&e.$$.dirty[1]&&n(51,r=_.selection),1&e.$$.dirty[1]&&n(54,i=void 0!==S),1048576&e.$$.dirty[1]&&n(3,o=null!=r),8&e.$$.dirty[0]|1048576&e.$$.dirty[1]&&n(4,a=o&&Pm(r.focusPath)),8&e.$$.dirty[0]|1048577&e.$$.dirty[1]&&n(52,s=o?hs.exports.getIn(S,r.focusPath):void 0),9437184&e.$$.dirty[1]&&n(1,u=i&&(uq(r)||aq(r)||sq(r))),18&e.$$.dirty[0]|8388608&e.$$.dirty[1]&&n(16,c=i&&u&&!a),16&e.$$.dirty[0]|9437184&e.$$.dirty[1]&&n(15,l=i&&null!=r&&(uq(r)||sq(r))&&!a),16&e.$$.dirty[0]|9437185&e.$$.dirty[1]&&n(14,f=i&&null!=r&&bq(r)&&!a&&!Array.isArray(hs.exports.getIn(S,om(r.focusPath)))),11534336&e.$$.dirty[1]&&n(2,h=i&&null!=r&&bq(r)&&!Ns(s)),2&e.$$.dirty[0]&&n(53,d=u),4194304&e.$$.dirty[1]&&n(13,v=d?"Convert to":"Insert"),8&e.$$.dirty[0]|4194304&e.$$.dirty[1]&&n(12,p=!d&&o),8&e.$$.dirty[0]|7340032&e.$$.dirty[1]&&n(11,m=d?Mq(r)&&!Ts(s):o),8&e.$$.dirty[0]|7340032&e.$$.dirty[1]&&n(10,g=d?Mq(r)&&!Array.isArray(s):o),8&e.$$.dirty[0]|7340032&e.$$.dirty[1]&&n(9,y=d?Mq(r)&&Ns(s):o),3145734&e.$$.dirty[1]&&n(50,b=null!=r&&UB(s,_.enforceStringMap,hs.exports.compileJSONPointer(r.focusPath),C)),4&e.$$.dirty[0]|524288&e.$$.dirty[1]&&n(8,k=[{icon:kx,text:"Edit value",title:"Edit the value (Double-click on the value)",onClick:W,disabled:!h},{icon:b?MF:AF,text:"Enforce string",title:"Enforce keeping the value as string when it contains a numeric value",onClick:H,disabled:!h}]),2&e.$$.dirty[0]&&n(7,w=[{icon:fx,text:"Cut formatted",title:"Cut selected contents, formatted with indentation (Ctrl+X)",onClick:J,disabled:!u},{icon:fx,text:"Cut compacted",title:"Cut selected contents, without indentation (Ctrl+Shift+X)",onClick:U,disabled:!u}]),2&e.$$.dirty[0]&&n(6,j=[{icon:Ax,text:"Copy formatted",title:"Copy selected contents, formatted with indentation (Ctrl+C)",onClick:K,disabled:!u},{icon:Ax,text:"Copy compacted",title:"Copy selected contents, without indentation (Ctrl+Shift+C)",onClick:G,disabled:!u}])},[$,u,h,o,a,x,j,w,k,y,g,m,p,v,f,l,c,function(){O(),E()},W,J,K,function(){O(),N()},function(){O(),I()},function(){O(),R()},function(){O(),D()},Q,function(){O(),F()},function(){O(),V()},function(){O(),L()},function(){O(),q()},function(e){var t=Jj(e).replace(/^Command\+/,"Ctrl+");if("Up"===t||"Down"===t||"Left"===t||"Right"===t){e.preventDefault();var n=Wj({allElements:Array.from(x.querySelectorAll("button:not([disabled])")),currentElement:e.target,direction:t,hasPrio:function(e){return"jse-open-dropdown"!==e.getAttribute("data-type")}});n&&n.focus()}},S,_,C,O,E,P,M,A,T,N,I,R,D,L,z,B,q,F,V,b,r,s,d,i,function(){return Q("structure")},function(){return Q("object")},function(){return Q("array")},function(){return Q("value")},function(e){ea[e?"unshift":"push"]((function(){n(5,x=e)}))}]}var qF=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,BF,zF,Ki,{json:31,documentState:32,parser:33,showTip:0,onCloseContextMenu:34,onEditKey:35,onEditValue:36,onToggleEnforceString:37,onCut:38,onCopy:39,onPaste:40,onRemove:41,onDuplicate:42,onExtract:43,onInsertBefore:44,onInsert:45,onConvert:46,onInsertAfter:47,onSort:48,onTransform:49},NF,[-1,-1,-1]),r}return Li(n)}(),FF={exports:{}}; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r=n.end&&i.end<=s.start;return c&&u.push(i),s.start>=(c?i.end:n.end)&&u.push(s),u}(i,o))},[f,v,o,i,s,a,u,c,l,h,d,r,function(e){return v(f,e)}]}var YF=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,QF,UF,Ki,{visibleSections:6,sectionIndex:7,total:8,path:0,pointer:9,selection:10,onExpandSection:1},WF),r}return Li(n)}();function ZF(e){co(e,"svelte-dol684",".jse-context-menu-button.svelte-dol684{position:absolute;top:calc(-0.5 * var(--jse-context-menu-button-size));right:calc(-0.5 * var(--jse-context-menu-button-size));width:var(--jse-context-menu-button-size);height:var(--jse-context-menu-button-size);padding:0;margin:0;z-index:2;cursor:pointer;background:transparent;border-radius:2px;background:var(--jse-context-menu-button-background);color:var(--jse-context-menu-button-color);border:none;box-shadow:var(--jse-controls-box-shadow)}.jse-context-menu-button.svelte-dol684:hover{background:var(--jse-context-menu-button-background-highlight)}")}function XF(e){var t,n,r,i,o;return n=new hS({props:{data:_x}}),{c:function(){t=go("button"),Pa(n.$$.fragment),So(t,"type","button"),So(t,"class","jse-context-menu-button svelte-dol684"),So(t,"title",os),No(t,"jse-selected",e[0])},m:function(a,s){vo(a,t,s),Ma(n,t,null),r=!0,i||(o=jo(t,"click",e[1]),i=!0)},p:function(e,n){var i=ki(n,1)[0];(!r||1&i)&&No(t,"jse-selected",e[0])},i:function(e){r||(ba(n.$$.fragment,e),r=!0)},o:function(e){ka(n.$$.fragment,e),r=!1},d:function(e){e&&po(t),Aa(n),i=!1,o()}}}function eV(e,t,n){var r=t.selected,i=t.onContextMenu;return e.$$set=function(e){"selected"in e&&n(0,r=e.selected),"onContextMenu"in e&&n(2,i=e.onContextMenu)},[r,function(e){for(var t=e.target;t&&"BUTTON"!==t.nodeName;)t=t.parentNode;t&&i({anchor:t,left:0,top:0,width:260,height:336,offsetTop:2,offsetLeft:0,showTip:!0})},i]}var tV=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,eV,XF,Ki,{selected:0,onContextMenu:2},ZF),r}return Li(n)}();function nV(e){co(e,"svelte-s6kbew",".jse-highlight.svelte-s6kbew{background-color:var(--jse-search-match-color);outline:var(--jse-search-match-outline)}.jse-highlight.jse-active.svelte-s6kbew{background-color:var(--jse-search-match-active-color);outline:var(--jse-search-match-active-outline)}")}function rV(e,t,n){var r=e.slice();return r[3]=t[n],r}function iV(e){var t,n,r=Aj(e[3].text)+"";return{c:function(){t=go("span"),n=bo(r),So(t,"class","jse-highlight svelte-s6kbew"),No(t,"jse-active",e[3].active)},m:function(e,r){vo(e,t,r),uo(t,n)},p:function(e,i){1&i&&r!==(r=Aj(e[3].text)+"")&&Eo(n,r),1&i&&No(t,"jse-active",e[3].active)},d:function(e){e&&po(t)}}}function oV(e){var t,n=e[3].text+"";return{c:function(){t=bo(n)},m:function(e,n){vo(e,t,n)},p:function(e,r){1&r&&n!==(n=e[3].text+"")&&Eo(t,n)},d:function(e){e&&po(t)}}}function aV(e){var t;function n(e,t){return"normal"===e[3].type?oV:iV}var r=n(e),i=r(e);return{c:function(){i.c(),t=wo()},m:function(e,n){i.m(e,n),vo(e,t,n)},p:function(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),(i=r(e))&&(i.c(),i.m(t.parentNode,t)))},d:function(e){i.d(e),e&&po(t)}}}function sV(e){for(var t,n=e[0],r=[],i=0;iu+a()/2;)u+=a(),s-=1;var c=t[s].path,l=s-o;return s!==o&&void 0!==t[s]?{beforePath:c,offset:l}:void 0}({json:t,selection:o,deltaY:r,items:i}):function(e){var t,n=e.json,r=e.items,i=e.selection,o=e.deltaY,a=fq(i),s=r.findIndex((function(e){return Mm(e.path,a)})),u=0,c=s,l=function(){var e;return null===(e=r[c+1])||void 0===e?void 0:e.height};for(;void 0!==l()&&Math.abs(o)>u+l()/2;)u+=l(),c+=1;var f=om(a),h=hs.exports.getIn(n,f),d=Array.isArray(h),v=null===(t=r[d?c:c+1])||void 0===t?void 0:t.path,p=c-s;return v?{beforePath:v,offset:p}:{append:!0,offset:p}}({json:t,selection:o,deltaY:r,items:i});if(!a||0===a.offset)return{operations:void 0,updatedSelection:void 0,offset:0};var s=function(e,t,n){var r=n.beforePath,i=n.append,o=om(t.focusPath),a=hs.exports.getIn(e,o);if(!(i||r&&wq(r,o)&&r.length>o.length))return[];var s=lq(t),u=fq(t),c=Ov(s),l=Ov(u),f=r?r[o.length]:void 0;if(!hs.exports.isJSONObject(a)){if(hs.exports.isJSONArray(a)){var h=Ps(c),d=Ps(l),v=void 0!==f?Ps(f):a.length;return xk(d-h+1,vm?[].concat(Ti(p.slice(m,g+1)),Ti(p.slice(y,p.length))).map((function(e){return Bq(o,e)})):[].concat(Ti(p.slice(y,m)),Ti(p.slice(g+1,p.length))).map((function(e){return Bq(o,e)})):void 0}(t,n.selection,a),u=om(lq(o)),c=hs.exports.getIn(t,u);if(Array.isArray(c)){var l=function(e){var t,n,r=e.items,i=e.json,o=e.selection,a=e.offset,s=lq(o),u=fq(o),c=r.findIndex((function(e){return Mm(e.path,s)})),l=r.findIndex((function(e){return Mm(e.path,u)})),f=null===(t=r[c+a])||void 0===t?void 0:t.path,h=null===(n=r[l+a])||void 0===n?void 0:n.path;return $q(i,f,h)}({items:i,json:t,selection:o,offset:a.offset});return{operations:s,updatedSelection:l,offset:a.offset}}return{operations:s,updatedSelection:void 0,offset:a.offset}}function PV(e,t){return function(e,t){if(e){for(var n={},r=0,i=Object.keys(e);r0?n:void 0}}(e,(function(e){return hs.exports.startsWithJSONPointer(e,t)}))}function MV(e){co(e,"svelte-r4omvg",".jse-tooltip.svelte-r4omvg{font-family:var(--jse-font-family);font-size:var(--jse-font-size);line-height:normal;padding:calc(0.5 * var(--jse-padding)) var(--jse-padding);border-radius:3px;background:var(--jse-context-menu-background);color:var(--jse-context-menu-color);white-space:nowrap;box-shadow:var(--jse-controls-box-shadow)}")}function AV(e){var t,n;return{c:function(){t=go("div"),n=bo(e[0]),So(t,"class","jse-tooltip svelte-r4omvg")},m:function(e,r){vo(e,t,r),uo(t,n)},p:function(e,t){1&ki(t,1)[0]&&Eo(n,e[0])},i:Bi,o:Bi,d:function(e){e&&po(t)}}}function TV(e,t,n){var r=t.text;return e.$$set=function(e){"text"in e&&n(0,r=e.text)},[r]}var NV=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,TV,AV,Ui,{text:0},MV),r}return Li(n)}();function IV(e,t){var n,r=t.text,i=t.openAbsolutePopup,o=t.closeAbsolutePopup;function a(){n=i(NV,{text:r},{position:"top",width:10*r.length,offsetTop:3,anchor:e,closeOnOuterClick:!0})}function s(){o(n)}return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),{destroy:function(){e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}}function RV(e){co(e,"svelte-1q62mys","button.jse-validation-error.svelte-1q62mys{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;color:var(--jse-warning-color);padding:0 5px;margin:0;font-size:var(--jse-font-size-mono);height:var(--jse-line-height);overflow:hidden}")}function DV(e){var t,n,r,i,o,a;return n=new hS({props:{data:Lx}}),{c:function(){t=go("button"),Pa(n.$$.fragment),So(t,"type","button"),So(t,"class","jse-validation-error svelte-1q62mys")},m:function(s,u){vo(s,t,u),Ma(n,t,null),i=!0,o||(a=[jo(t,"click",(function(){Ji(e[0])&&e[0].apply(this,arguments)})),to(r=IV.call(null,t,ji({text:e[1]},e[2])))],o=!0)},p:function(t,n){var i=ki(n,1)[0];e=t,r&&Ji(r.update)&&2&i&&r.update.call(null,ji({text:e[1]},e[2]))},i:function(e){i||(ba(n.$$.fragment,e),i=!0)},o:function(e){ka(n.$$.fragment,e),i=!1},d:function(e){e&&po(t),Aa(n),o=!1,Hi(a)}}}function LV(e,t,n){var r,i=Zo("absolute-popup"),o=t.validationError,a=t.onExpand;return e.$$set=function(e){"validationError"in e&&n(3,o=e.validationError),"onExpand"in e&&n(0,a=e.onExpand)},e.$$.update=function(){8&e.$$.dirty&&n(1,r=o.isChildError?"Contains invalid data":o.message)},[a,r,i,o]}var zV=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,LV,DV,Ui,{validationError:3,onExpand:0},RV),r}return Li(n)}();function BV(e){co(e,"svelte-uj4yd7",".jse-json-node.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative;color:var(--jse-text-color)}.jse-json-node.jse-root.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{min-height:100%;padding-bottom:2px;box-sizing:border-box}.jse-json-node.jse-root.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7 .jse-context-menu-button,.jse-json-node.jse-root.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7 .jse-context-menu-button{top:0;right:calc(-2px - var(--jse-context-menu-button-size))}.jse-json-node.jse-root.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7.svelte-uj4yd7{padding-left:0}.jse-json-node.jse-hovered.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-hovered.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{background:var(--jse-hover-background-color)}.jse-json-node.svelte-uj4yd7 .jse-props.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.svelte-uj4yd7 .jse-items.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative}.jse-json-node.svelte-uj4yd7 .jse-header-outer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.svelte-uj4yd7 .jse-footer-outer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex}.jse-json-node.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative}.jse-json-node.svelte-uj4yd7 .jse-header .jse-meta.svelte-uj4yd7>.jse-meta-inner.svelte-uj4yd7.svelte-uj4yd7{display:flex;justify-content:center}.jse-json-node.svelte-uj4yd7 .jse-contents-outer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex}.jse-json-node.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex;flex-direction:row}.jse-json-node.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding-left:var(--jse-indent-size)}.jse-json-node.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:inline-flex;padding-left:calc(var(--jse-indent-size) + 5px)}.jse-json-node.svelte-uj4yd7 .jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{visibility:hidden;padding:0 calc(0.5 * var(--jse-padding));flex:1}.jse-json-node.svelte-uj4yd7 .jse-insert-selection-area.jse-inside.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:inline-flex;align-items:center}.jse-json-node.svelte-uj4yd7 .jse-insert-selection-area.jse-after.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex;align-items:flex-end}.jse-json-node.svelte-uj4yd7:hover>.jse-contents-outer .jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:not(.jse-selected),.jse-json-node.svelte-uj4yd7 .jse-header-outer.svelte-uj4yd7:hover>.jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7:not(.jse-selected),.jse-json-node.svelte-uj4yd7 .jse-footer-outer:hover .jse-insert-selection-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:not(.jse-selected){visibility:visible;z-index:1}.jse-json-node.svelte-uj4yd7 .jse-context-menu-button-anchor.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{position:relative}.jse-json-node.svelte-uj4yd7 .jse-insert-area.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{display:flex;position:relative;max-width:250px;min-width:100px;height:0;margin-right:calc(0.5 * var(--jse-padding));outline:1px solid}.jse-json-node.svelte-uj4yd7 .jse-insert-area.svelte-uj4yd7 .jse-context-menu-button{right:-1px;background:var(--jse-selection-background-color)}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-hovered.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{outline-color:var(--jse-selection-background-color)}.jse-json-node.jse-selected.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-color) !important;cursor:grab}.jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{cursor:pointer}.jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-identifier>.jse-key,.jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-identifier>.jse-key{background:var(--jse-selection-background-color);cursor:grab}.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-value{background:var(--jse-selection-background-color);cursor:grab}.jse-json-node.svelte-uj4yd7 .jse-collapsed-items.jse-selected,.jse-json-node.jse-selected.svelte-uj4yd7 .jse-collapsed-items,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-collapsed-items{background-color:var(--jse-selection-background-color);cursor:grab;background-image:linear-gradient(var(--jse-collapsed-items-selected-background-color), var(--jse-collapsed-items-selected-background-color)), linear-gradient(to bottom right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to bottom left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%)}.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{background:var(--jse-selection-background-color) !important}.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-value,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-key,.jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-color);cursor:grab}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{z-index:2;outline-color:var(--jse-context-menu-button-background)}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button{background:var(--jse-context-menu-button-background)}.jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button:hover{background:var(--jse-context-menu-button-background-highlight)}.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-light-color) !important;cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{cursor:pointer}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-identifier>.jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-key.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-identifier>.jse-key{background:var(--jse-selection-background-light-color);cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-contents-outer.svelte-uj4yd7>.jse-contents.svelte-uj4yd7>.jse-value{background:var(--jse-selection-background-light-color);cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-collapsed-items.jse-selected,.jse-main:not(.jse-focus) .jse-json-node.jse-selected.svelte-uj4yd7 .jse-collapsed-items,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-collapsed-items{background-color:var(--jse-selection-background-light-color);cursor:grab;background-image:linear-gradient(var(--jse-collapsed-items-selected-background-color), var(--jse-collapsed-items-selected-background-color)), linear-gradient(to bottom right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to bottom left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top right, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%), linear-gradient(to top left, transparent 50.5%, var(--jse-collapsed-items-selected-background-color) 50.5%)}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{background:var(--jse-selection-background-light-color) !important}.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-meta.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-header-outer.svelte-uj4yd7>.jse-header.svelte-uj4yd7>.jse-meta.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7>.jse-footer-outer.svelte-uj4yd7>.jse-footer.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-contents.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-header.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-footer.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-props .jse-expand.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-contents.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-header.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-footer.svelte-uj4yd7 .jse-value,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-key,.jse-main:not(.jse-focus) .jse-json-node.jse-selected-value.svelte-uj4yd7 .jse-items .jse-expand.svelte-uj4yd7 .jse-value{background:var(--jse-selection-background-light-color);cursor:grab}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{z-index:2;outline-color:var(--jse-selection-background-color)}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button{background:var(--jse-selection-background-color)}.jse-main:not(.jse-focus) .jse-json-node.svelte-uj4yd7 .jse-insert-area.jse-selected.svelte-uj4yd7 .jse-context-menu-button:hover{background:var(--jse-selection-background-color)}.jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{width:var(--jse-indent-size);padding:0;margin:0;border:none;cursor:pointer;background:transparent;color:var(--jse-delimiter-color);font-size:var(--jse-font-size-mono);height:var(--jse-line-height)}.jse-expand.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:hover{opacity:0.8}.jse-meta.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-separator.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-index.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7,.jse-bracket.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{vertical-align:top;color:var(--jse-delimiter-color)}.jse-index.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding:0 calc(0.5 * var(--jse-padding))}.jse-bracket.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding:0 2px}.jse-bracket.jse-expanded.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{padding-right:var(--jse-padding)}.jse-tag.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{border:none;font-size:80%;font-family:var(--jse-font-family);color:var(--jse-tag-color);background:var(--jse-tag-background);border-radius:2px;cursor:pointer;position:relative;display:inline-block;padding:0 4px;line-height:normal;margin:1px 0}.jse-tag.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7:hover{opacity:0.8}.jse-tag.jse-expanded.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{opacity:0.7;cursor:inherit}.jse-identifier.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7.svelte-uj4yd7{vertical-align:top;position:relative}")}var qV=function(e){return{}},FV=function(e){return{}};function VV(e,t,n){var r=e.slice();return r[53]=t[n],r}var WV=function(e){return{}},HV=function(e){return{}};function JV(e,t,n){var r=e.slice();return r[47]=t[n],r[49]=n,r}function UV(e,t,n){var r=e.slice();return r[50]=t[n],r}var KV=function(e){return{}},GV=function(e){return{}};function QV(e){var t,n,r,i,o,a,s,u,c,l=!e[8].readOnly&&e[16]&&e[7]&&(sq(e[7])||uq(e[7]))&&!e[7].edit&&Mm(e[7].focusPath,e[1]),f=e[34].identifier,h=Gi(f,e,e[35],FV),d=!e[17]&&XV();o=new $V({props:{path:e[1],value:e[0],enforceString:e[13],isSelected:e[16],selection:e[16]?e[7]:void 0,searchResultItems:eF(e[6],e[9]),context:e[8]}});var v=l&&eW(e),p=e[15]&&tW(e),m=!e[17]&&nW(e);return{c:function(){t=go("div"),n=go("div"),h&&h.c(),r=ko(),d&&d.c(),i=ko(),Pa(o.$$.fragment),a=ko(),v&&v.c(),s=ko(),p&&p.c(),u=ko(),m&&m.c(),So(n,"class","jse-contents svelte-uj4yd7"),So(t,"class","jse-contents-outer svelte-uj4yd7"),So(t,"style",e[18])},m:function(e,l){vo(e,t,l),uo(t,n),h&&h.m(n,null),uo(n,r),d&&d.m(n,null),uo(n,i),Ma(o,n,null),uo(n,a),v&&v.m(n,null),uo(t,s),p&&p.m(t,null),uo(t,u),m&&m.m(t,null),c=!0},p:function(e,r){h&&h.p&&(!c||16&r[1])&&Zi(h,f,e,e[35],c?Yi(f,e[35],r,qV):Xi(e[35]),FV),e[17]?d&&(d.d(1),d=null):d||((d=XV()).c(),d.m(n,i));var a={};2&r[0]&&(a.path=e[1]),1&r[0]&&(a.value=e[0]),8192&r[0]&&(a.enforceString=e[13]),65536&r[0]&&(a.isSelected=e[16]),65664&r[0]&&(a.selection=e[16]?e[7]:void 0),576&r[0]&&(a.searchResultItems=eF(e[6],e[9])),256&r[0]&&(a.context=e[8]),o.$set(a),65922&r[0]&&(l=!e[8].readOnly&&e[16]&&e[7]&&(sq(e[7])||uq(e[7]))&&!e[7].edit&&Mm(e[7].focusPath,e[1])),l?v?(v.p(e,r),65922&r[0]&&ba(v,1)):((v=eW(e)).c(),ba(v,1),v.m(n,null)):v&&(ga(),ka(v,1,1,(function(){v=null})),ya()),e[15]?p?(p.p(e,r),32768&r[0]&&ba(p,1)):((p=tW(e)).c(),ba(p,1),p.m(t,u)):p&&(ga(),ka(p,1,1,(function(){p=null})),ya()),e[17]?m&&(m.d(1),m=null):m?m.p(e,r):((m=nW(e)).c(),m.m(t,null)),(!c||262144&r[0])&&So(t,"style",e[18])},i:function(e){c||(ba(h,e),ba(o.$$.fragment,e),ba(v),ba(p),c=!0)},o:function(e){ka(h,e),ka(o.$$.fragment,e),ka(v),ka(p),c=!1},d:function(e){e&&po(t),h&&h.d(e),d&&d.d(),Aa(o),v&&v.d(),p&&p.d(),m&&m.d()}}}function YV(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b=!e[8].readOnly&&e[16]&&e[7]&&(sq(e[7])||uq(e[7]))&&!e[7].edit&&Mm(e[7].focusPath,e[1]),k=[iW,rW],w=[];function j(e,t){return e[12]?0:1}i=j(e),o=w[i]=k[i](e);var x=e[34].identifier,S=Gi(x,e,e[35],HV),_=!e[17]&&oW();function C(e,t){return e[12]?sW:aW}var $=C(e),O=$(e),E=b&&uW(e),P=e[15]&&(!e[12]||!e[15].isChildError)&&cW(e);function M(e,t){return e[12]?fW:e[17]?void 0:lW}var A=M(e),T=A&&A(e),N=e[12]&&hW(e);return{c:function(){t=go("div"),n=go("div"),r=go("button"),o.c(),a=ko(),S&&S.c(),s=ko(),_&&_.c(),u=ko(),c=go("div"),l=go("div"),O.c(),f=ko(),E&&E.c(),h=ko(),P&&P.c(),d=ko(),T&&T.c(),v=ko(),N&&N.c(),p=wo(),So(r,"type","button"),So(r,"class","jse-expand svelte-uj4yd7"),So(r,"title","Expand or collapse this object (Ctrl+Click to expand/collapse recursively)"),So(l,"class","jse-meta-inner svelte-uj4yd7"),So(c,"class","jse-meta svelte-uj4yd7"),So(c,"data-type","selectable-value"),So(n,"class","jse-header svelte-uj4yd7"),So(t,"class","jse-header-outer svelte-uj4yd7"),So(t,"style",e[18])},m:function(o,b){vo(o,t,b),uo(t,n),uo(n,r),w[i].m(r,null),uo(n,a),S&&S.m(n,null),uo(n,s),_&&_.m(n,null),uo(n,u),uo(n,c),uo(c,l),O.m(l,null),uo(n,f),E&&E.m(n,null),uo(t,h),P&&P.m(t,null),uo(t,d),T&&T.m(t,null),vo(o,v,b),N&&N.m(o,b),vo(o,p,b),m=!0,g||(y=jo(r,"click",e[21]),g=!0)},p:function(e,a){var s=i;(i=j(e))===s?w[i].p(e,a):(ga(),ka(w[s],1,1,(function(){w[s]=null})),ya(),(o=w[i])?o.p(e,a):(o=w[i]=k[i](e)).c(),ba(o,1),o.m(r,null)),S&&S.p&&(!m||16&a[1])&&Zi(S,x,e,e[35],m?Yi(x,e[35],a,WV):Xi(e[35]),HV),e[17]?_&&(_.d(1),_=null):_||((_=oW()).c(),_.m(n,u)),$===($=C(e))&&O?O.p(e,a):(O.d(1),(O=$(e))&&(O.c(),O.m(l,null))),65922&a[0]&&(b=!e[8].readOnly&&e[16]&&e[7]&&(sq(e[7])||uq(e[7]))&&!e[7].edit&&Mm(e[7].focusPath,e[1])),b?E?(E.p(e,a),65922&a[0]&&ba(E,1)):((E=uW(e)).c(),ba(E,1),E.m(n,null)):E&&(ga(),ka(E,1,1,(function(){E=null})),ya()),!e[15]||e[12]&&e[15].isChildError?P&&(ga(),ka(P,1,1,(function(){P=null})),ya()):P?(P.p(e,a),36864&a[0]&&ba(P,1)):((P=cW(e)).c(),ba(P,1),P.m(t,d)),A===(A=M(e))&&T?T.p(e,a):(T&&T.d(1),(T=A&&A(e))&&(T.c(),T.m(t,null))),(!m||262144&a[0])&&So(t,"style",e[18]),e[12]?N?(N.p(e,a),4096&a[0]&&ba(N,1)):((N=hW(e)).c(),ba(N,1),N.m(p.parentNode,p)):N&&(ga(),ka(N,1,1,(function(){N=null})),ya())},i:function(e){m||(ba(o),ba(S,e),ba(E),ba(P),ba(N),m=!0)},o:function(e){ka(o),ka(S,e),ka(E),ka(P),ka(N),m=!1},d:function(e){e&&po(t),w[i].d(),S&&S.d(e),_&&_.d(),O.d(),E&&E.d(),P&&P.d(),T&&T.d(),e&&po(v),N&&N.d(e),e&&po(p),g=!1,y()}}}function ZV(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b=!e[8].readOnly&&e[16]&&e[7]&&(sq(e[7])||uq(e[7]))&&!e[7].edit&&Mm(e[7].focusPath,e[1]),k=[yW,gW],w=[];function j(e,t){return e[12]?0:1}i=j(e),o=w[i]=k[i](e);var x=e[34].identifier,S=Gi(x,e,e[35],GV),_=!e[17]&&bW();function C(e,t){return e[12]?wW:kW}var $=C(e),O=$(e),E=b&&jW(e),P=e[15]&&(!e[12]||!e[15].isChildError)&&xW(e);function M(e,t){return e[12]?_W:SW}var A=M(e),T=A(e),N=e[12]&&CW(e);return{c:function(){t=go("div"),n=go("div"),r=go("button"),o.c(),a=ko(),S&&S.c(),s=ko(),_&&_.c(),u=ko(),c=go("div"),l=go("div"),O.c(),f=ko(),E&&E.c(),h=ko(),P&&P.c(),d=ko(),T.c(),v=ko(),N&&N.c(),p=wo(),So(r,"type","button"),So(r,"class","jse-expand svelte-uj4yd7"),So(r,"title","Expand or collapse this array (Ctrl+Click to expand/collapse recursively)"),So(l,"class","jse-meta-inner svelte-uj4yd7"),So(l,"data-type","selectable-value"),So(c,"class","jse-meta svelte-uj4yd7"),So(n,"class","jse-header svelte-uj4yd7"),So(t,"class","jse-header-outer svelte-uj4yd7"),So(t,"style",e[18])},m:function(o,b){vo(o,t,b),uo(t,n),uo(n,r),w[i].m(r,null),uo(n,a),S&&S.m(n,null),uo(n,s),_&&_.m(n,null),uo(n,u),uo(n,c),uo(c,l),O.m(l,null),uo(n,f),E&&E.m(n,null),uo(t,h),P&&P.m(t,null),uo(t,d),T.m(t,null),vo(o,v,b),N&&N.m(o,b),vo(o,p,b),m=!0,g||(y=jo(r,"click",e[21]),g=!0)},p:function(e,a){var s=i;(i=j(e))===s?w[i].p(e,a):(ga(),ka(w[s],1,1,(function(){w[s]=null})),ya(),(o=w[i])?o.p(e,a):(o=w[i]=k[i](e)).c(),ba(o,1),o.m(r,null)),S&&S.p&&(!m||16&a[1])&&Zi(S,x,e,e[35],m?Yi(x,e[35],a,KV):Xi(e[35]),GV),e[17]?_&&(_.d(1),_=null):_||((_=bW()).c(),_.m(n,u)),$===($=C(e))&&O?O.p(e,a):(O.d(1),(O=$(e))&&(O.c(),O.m(l,null))),65922&a[0]&&(b=!e[8].readOnly&&e[16]&&e[7]&&(sq(e[7])||uq(e[7]))&&!e[7].edit&&Mm(e[7].focusPath,e[1])),b?E?(E.p(e,a),65922&a[0]&&ba(E,1)):((E=jW(e)).c(),ba(E,1),E.m(n,null)):E&&(ga(),ka(E,1,1,(function(){E=null})),ya()),!e[15]||e[12]&&e[15].isChildError?P&&(ga(),ka(P,1,1,(function(){P=null})),ya()):P?(P.p(e,a),36864&a[0]&&ba(P,1)):((P=xW(e)).c(),ba(P,1),P.m(t,d)),A===(A=M(e))&&T?T.p(e,a):(T.d(1),(T=A(e))&&(T.c(),T.m(t,null))),(!m||262144&a[0])&&So(t,"style",e[18]),e[12]?N?(N.p(e,a),4096&a[0]&&ba(N,1)):((N=CW(e)).c(),ba(N,1),N.m(p.parentNode,p)):N&&(ga(),ka(N,1,1,(function(){N=null})),ya())},i:function(e){m||(ba(o),ba(S,e),ba(E),ba(P),ba(N),m=!0)},o:function(e){ka(o),ka(S,e),ka(E),ka(P),ka(N),m=!1},d:function(e){e&&po(t),w[i].d(),S&&S.d(e),_&&_.d(),O.d(),E&&E.d(),P&&P.d(),T.d(),e&&po(v),N&&N.d(e),e&&po(p),g=!1,y()}}}function XV(e){var t;return{c:function(){(t=go("div")).textContent=":",So(t,"class","jse-separator svelte-uj4yd7")},m:function(e,n){vo(e,t,n)},d:function(e){e&&po(t)}}}function eW(e){var t,n,r;return n=new tV({props:{selected:!0,onContextMenu:e[8].onContextMenu}}),{c:function(){t=go("div"),Pa(n.$$.fragment),So(t,"class","jse-context-menu-button-anchor svelte-uj4yd7")},m:function(e,i){vo(e,t,i),Ma(n,t,null),r=!0},p:function(e,t){var r={};256&t[0]&&(r.onContextMenu=e[8].onContextMenu),n.$set(r)},i:function(e){r||(ba(n.$$.fragment,e),r=!0)},o:function(e){ka(n.$$.fragment,e),r=!1},d:function(e){e&&po(t),Aa(n)}}}function tW(e){var t,n;return t=new zV({props:{validationError:e[15],onExpand:e[22]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};32768&n[0]&&(r.validationError=e[15]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function nW(e){var t,n,r;return{c:function(){So(t=go("div"),"class","jse-insert-selection-area jse-after svelte-uj4yd7"),So(t,"data-type","insert-selection-area-after")},m:function(i,o){vo(i,t,o),n||(r=jo(t,"click",e[30]),n=!0)},p:Bi,d:function(e){e&&po(t),n=!1,r()}}}function rW(e){var t,n;return t=new hS({props:{data:ux}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:Bi,i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function iW(e){var t,n;return t=new hS({props:{data:_x}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:Bi,i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function oW(e){var t;return{c:function(){(t=go("div")).textContent=":",So(t,"class","jse-separator svelte-uj4yd7")},m:function(e,n){vo(e,t,n)},d:function(e){e&&po(t)}}}function aW(e){var t,n,r,i,o,a,s,u,c,l,f=Object.keys(e[0]).length+"",h=1===Object.keys(e[0]).length?"prop":"props";return{c:function(){(t=go("div")).textContent="{",n=ko(),r=go("button"),i=bo(f),o=ko(),a=bo(h),s=ko(),(u=go("div")).textContent="}",So(t,"class","jse-bracket svelte-uj4yd7"),So(r,"type","button"),So(r,"class","jse-tag svelte-uj4yd7"),So(u,"class","jse-bracket svelte-uj4yd7")},m:function(f,h){vo(f,t,h),vo(f,n,h),vo(f,r,h),uo(r,i),uo(r,o),uo(r,a),vo(f,s,h),vo(f,u,h),c||(l=jo(r,"click",e[22]),c=!0)},p:function(e,t){1&t[0]&&f!==(f=Object.keys(e[0]).length+"")&&Eo(i,f),1&t[0]&&h!==(h=1===Object.keys(e[0]).length?"prop":"props")&&Eo(a,h)},d:function(e){e&&po(t),e&&po(n),e&&po(r),e&&po(s),e&&po(u),c=!1,l()}}}function sW(e){var t;return{c:function(){(t=go("div")).textContent="{",So(t,"class","jse-bracket jse-expanded svelte-uj4yd7")},m:function(e,n){vo(e,t,n)},p:Bi,d:function(e){e&&po(t)}}}function uW(e){var t,n,r;return n=new tV({props:{selected:!0,onContextMenu:e[8].onContextMenu}}),{c:function(){t=go("div"),Pa(n.$$.fragment),So(t,"class","jse-context-menu-button-anchor svelte-uj4yd7")},m:function(e,i){vo(e,t,i),Ma(n,t,null),r=!0},p:function(e,t){var r={};256&t[0]&&(r.onContextMenu=e[8].onContextMenu),n.$set(r)},i:function(e){r||(ba(n.$$.fragment,e),r=!0)},o:function(e){ka(n.$$.fragment,e),r=!1},d:function(e){e&&po(t),Aa(n)}}}function cW(e){var t,n;return t=new zV({props:{validationError:e[15],onExpand:e[22]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};32768&n[0]&&(r.validationError=e[15]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function lW(e){var t,n,r;return{c:function(){So(t=go("div"),"class","jse-insert-selection-area jse-after svelte-uj4yd7"),So(t,"data-type","insert-selection-area-after")},m:function(i,o){vo(i,t,o),n||(r=jo(t,"click",e[30]),n=!0)},p:Bi,d:function(e){e&&po(t),n=!1,r()}}}function fW(e){var t,n,r;return{c:function(){So(t=go("div"),"class","jse-insert-selection-area jse-inside svelte-uj4yd7"),So(t,"data-type","insert-selection-area-inside")},m:function(i,o){vo(i,t,o),n||(r=jo(t,"click",e[29]),n=!0)},p:Bi,d:function(e){e&&po(t),n=!1,r()}}}function hW(e){for(var t,n,r,i,o,a,s,u=!e[8].readOnly&&("hover-insert-inside"===e[10]||e[16]&&oq(e[7])),c=u&&dW(e),l=e[19](e[1],e[0],e[2],e[3],e[4],e[5],e[6],e[7],e[11]),f=[],h=0;h}',a=ko(),v&&v.c(),So(t,"class","jse-props svelte-uj4yd7"),So(o,"data-type","selectable-value"),So(o,"class","jse-footer svelte-uj4yd7"),So(i,"class","jse-footer-outer svelte-uj4yd7"),So(i,"style",e[18])},m:function(e,u){vo(e,t,u),c&&c.m(t,null),uo(t,n);for(var l=0;l]',a=ko(),g&&g.c(),So(t,"class","jse-items svelte-uj4yd7"),So(o,"data-type","selectable-value"),So(o,"class","jse-footer svelte-uj4yd7"),So(i,"class","jse-footer-outer svelte-uj4yd7"),So(i,"style",e[18])},m:function(e,u){vo(e,t,u),f&&f.m(t,null),uo(t,n);for(var l=0;l0;){if(!0===e.pointersMap[hs.exports.compileJSONPointer(r)])return!0;r.pop()}if(aq(e))return n===dj.key&&Mm(e.focusPath,t);if(sq(e)){if(n===dj.value&&Mm(e.focusPath,t))return!0;if(wq(t,e.focusPath)&&t.length>e.focusPath.length&&(n===dj.key||n===dj.value||n===dj.multi))return!0}return!1}(w,p,t))0===e.button&&x(e);else{if(OV.selecting=!0,OV.selectionAnchor=p,OV.selectionAnchorType=t,OV.selectionFocus=p,e.shiftKey)w&&j.onSelect($q(n,w.anchorPath,p));else if(t===dj.multi)if(r&&e.target.hasAttribute("data-path")){var o=Ov(QB(v,i));j.onSelect(Aq(o))}else j.onSelect($q(n,p,p));else j.onSelect(Tq(n,t,p));j.focus()}}},function(e){if(OV.selecting){e.preventDefault(),e.stopPropagation(),null==OV.selectionFocus&&window.getSelection&&window.getSelection().empty();var t=qj(e.target);if(!Mm(p,OV.selectionFocus)||t!==OV.selectionAnchorType){OV.selectionFocus=p,OV.selectionAnchorType=t;var n=j.getJson();j.onSelect($q(n,OV.selectionAnchor,OV.selectionFocus))}}},function(e){if(!j.readOnly){var t=om(w.focusPath);if(Mm(p,t)){var r=function(e,t){var n=[];function r(e){var t=p.concat(e),r=j.findElement(t);null!=r&&n.push({path:t,height:r.clientHeight})}if(Array.isArray(v)){var i=lq(e),o=fq(e),a=Ov(i),s=Ov(o),u=t.find((function(e){return a>=e.start&&s<=e.end}));if(!u)return null;var c=u.start,l=u.end;Qw(c,Math.min(v.length,l),(function(e){return r(String(e))}))}else Object.keys(v).forEach(r);return n}(w,u||es);if(S("dragSelectionStart",{selection:w,items:r}),r){var i=lq(w),o=r.findIndex((function(e){return Mm(e.path,i)})),a=EV({json:j.getJson(),documentState:j.getDocumentState(),deltaY:0,items:r}).offset;n(11,$={initialTarget:e.target,initialClientY:e.clientY,initialContentTop:M(),selectionStartIndex:o,selectionItemsCount:Eq(w).length,items:r,offset:a,didMoveItems:!1}),OV.dragging=!0,document.addEventListener("mousemove",T,!0),document.addEventListener("mouseup",N)}else S("Cannot drag the current selection (probably spread over multiple sections)")}else x(e)}},function(e){OV.selecting||OV.dragging||(e.stopPropagation(),Nj(e.target,"data-type","selectable-value")?n(10,_="hover-collection"):Nj(e.target,"data-type","insert-selection-area-inside")?n(10,_="hover-insert-inside"):Nj(e.target,"data-type","insert-selection-area-after")&&n(10,_="hover-insert-after"),clearTimeout(C))},function(e){e.stopPropagation(),C=setTimeout((function(){return n(10,_=void 0)}))},function(e){e.shiftKey||(e.stopPropagation(),e.preventDefault(),j.onSelect(_q(p)))},function(e){e.shiftKey||(e.stopPropagation(),e.preventDefault(),j.onSelect(Cq(p)))},function(e){j.onSelect(_q(p)),j.onContextMenu(e)},function(e){j.onSelect(Cq(p)),j.onContextMenu(e)},x,h,d]}var DW=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,RW,NW,Ki,{value:0,path:1,expandedMap:2,enforceStringMap:3,visibleSectionsMap:4,validationErrorsMap:5,searchResultItemsMap:6,selection:7,context:8,onDragSelectionStart:33},BV,[-1,-1]),r}return Li(n)}(),LW=DW;function zW(e){var t,n;return t=new i_({props:{items:e[0]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};1&ki(n,1)[0]&&(r.items=e[0]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function BW(e,t,n){var r,i,o,a,s,u,c,l=t.json,f=t.selection,h=t.readOnly,d=t.showSearch,v=void 0!==d&&d,p=t.historyState,m=t.onExpandAll,g=t.onCollapseAll,y=t.onUndo,b=t.onRedo,k=t.onSort,w=t.onTransform,j=t.onContextMenu,x=t.onCopy,S=t.onRenderMenu,_=void 0===S?Zu:S;function C(){n(1,v=!v)}return e.$$set=function(e){"json"in e&&n(2,l=e.json),"selection"in e&&n(3,f=e.selection),"readOnly"in e&&n(4,h=e.readOnly),"showSearch"in e&&n(1,v=e.showSearch),"historyState"in e&&n(5,p=e.historyState),"onExpandAll"in e&&n(6,m=e.onExpandAll),"onCollapseAll"in e&&n(7,g=e.onCollapseAll),"onUndo"in e&&n(8,y=e.onUndo),"onRedo"in e&&n(9,b=e.onRedo),"onSort"in e&&n(10,k=e.onSort),"onTransform"in e&&n(11,w=e.onTransform),"onContextMenu"in e&&n(12,j=e.onContextMenu),"onCopy"in e&&n(13,x=e.onCopy),"onRenderMenu"in e&&n(14,_=e.onRenderMenu)},e.$$.update=function(){4&e.$$.dirty&&n(20,r=void 0!==l),e.$$.dirty,1048584&e.$$.dirty&&n(17,i=r&&(uq(f)||aq(f)||sq(f))),68&e.$$.dirty&&n(19,o={icon:BS,title:"Expand all",className:"jse-expand-all",onClick:m,disabled:!Ns(l)}),132&e.$$.dirty&&n(18,a={icon:qS,title:"Collapse all",className:"jse-collapse-all",onClick:g,disabled:!Ns(l)}),4&e.$$.dirty&&n(16,s={icon:Px,title:"Search (Ctrl+F)",className:"jse-search",onClick:C,disabled:void 0===l}),999220&e.$$.dirty&&n(15,u=h?[o,a,{separator:!0},{icon:Ax,title:"Copy (Ctrl+C)",className:"jse-copy",onClick:x,disabled:!i},{separator:!0},s,{space:!0}]:[o,a,{separator:!0},{icon:$x,title:"Sort",className:"jse-sort",onClick:k,disabled:h||void 0===l},{icon:gx,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:w,disabled:h||void 0===l},s,{icon:Cx,title:os,className:"jse-contextmenu",onClick:j},{separator:!0},{icon:jx,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:y,disabled:!p.canUndo},{icon:wx,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:b,disabled:!p.canRedo},{space:!0}]),49152&e.$$.dirty&&n(0,c=_("tree",u)||u)},[c,v,l,f,h,p,m,g,y,b,k,w,j,x,_,u,s,i,a,o,r]}var qW=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,BW,zW,Ki,{json:2,selection:3,readOnly:4,showSearch:1,historyState:5,onExpandAll:6,onCollapseAll:7,onUndo:8,onRedo:9,onSort:10,onTransform:11,onContextMenu:12,onCopy:13,onRenderMenu:14}),r}return Li(n)}();function FW(e){co(e,"svelte-1q2qkk2",'@charset "UTF-8";.jse-welcome.svelte-1q2qkk2.svelte-1q2qkk2{flex:1;overflow:auto;font-family:var(--jse-font-family);font-size:var(--jse-font-size);display:flex;flex-direction:column;align-items:center;border-left:var(--jse-main-border);border-right:var(--jse-main-border)}.jse-welcome.svelte-1q2qkk2.svelte-1q2qkk2:last-child{border-bottom:var(--jse-main-border)}.jse-welcome.svelte-1q2qkk2 .jse-space.jse-before.svelte-1q2qkk2{flex:1}.jse-welcome.svelte-1q2qkk2 .jse-space.jse-after.svelte-1q2qkk2{flex:2}.jse-welcome.svelte-1q2qkk2 .jse-contents.svelte-1q2qkk2{margin:2em var(--jse-padding) 0;color:var(--jse-panel-color-readonly)}.jse-welcome.svelte-1q2qkk2 .jse-contents ul.svelte-1q2qkk2{list-style:"●";list-style-position:outside;padding-left:20px}.jse-welcome.svelte-1q2qkk2 .jse-contents ul li.svelte-1q2qkk2{padding-left:10px}.jse-welcome.svelte-1q2qkk2 .jse-contents ul li span.jse-bold.svelte-1q2qkk2{font-family:var(--jse-font-family-mono);font-weight:bold}')}function VW(e){var t;return{c:function(){(t=go("ul")).innerHTML='
  • Click inside the editor
  • \n
  • Paste clipboard data using Ctrl+V
  • \n
  • Create a new object by typing {
  • \n
  • Create a new array by typing [
  • ',So(t,"class","svelte-1q2qkk2")},m:function(e,n){vo(e,t,n)},d:function(e){e&&po(t)}}}function WW(e){var t,n,r,i,o,a,s,u=!e[0]&&VW();return{c:function(){t=go("div"),n=go("div"),r=ko(),i=go("div"),o=bo("Empty document\n "),u&&u.c(),a=ko(),s=go("div"),So(n,"class","jse-space jse-before svelte-1q2qkk2"),So(i,"class","jse-contents svelte-1q2qkk2"),So(s,"class","jse-space jse-after svelte-1q2qkk2"),So(t,"class","jse-welcome svelte-1q2qkk2")},m:function(e,c){vo(e,t,c),uo(t,n),uo(t,r),uo(t,i),uo(i,o),u&&u.m(i,null),uo(t,a),uo(t,s)},p:function(e,t){ki(t,1)[0];e[0]?u&&(u.d(1),u=null):u||((u=VW()).c(),u.m(i,null))},i:Bi,o:Bi,d:function(e){e&&po(t),u&&u.d()}}}function HW(e,t,n){var r=t.readOnly;return e.$$set=function(e){"readOnly"in e&&n(0,r=e.readOnly)},[r]}var JW=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,HW,WW,Ki,{readOnly:0},FW),r}return Li(n)}(),UW={exports:{}},KW=function(e,t){var n,r,i=1,o=0,a=0,s=String.alphabet;function u(e,t,r){if(r){for(n=t;(r=u(e,n))<76&&r>65;)++n;return+e.slice(t-1,n)}return(r=s&&s.indexOf(e.charAt(t)))>-1?r+76:(r=e.charCodeAt(t)||0)<45||r>127?r:r<46?65:r<48?r-1:r<58?r+18:r<65?r-11:r<91?r+11:r<97?r-37:r<123?r+5:r-63}if((e+="")!=(t+=""))for(;i;)if(r=u(e,o++),i=u(t,a++),r<76&&i<76&&r>66&&i>66&&(r=u(e,o,o),i=u(t,a,o=n),a=n),r!=i)return ro?t:inH&&eH();return{c:function(){t=go("div");for(var e=0;enH?l?l.p(e,u):((l=eH()).c(),l.m(t,null)):l&&(l.d(1),l=null)},i:Bi,o:Bi,d:function(e){e&&po(t);for(var n=0;n0&&(s("scrollTo ",e),o.scrollTo({left:e,behavior:"smooth"}))}}))},[u,f,h,r,o,a,d,i,function(e){s("get items for path",e);var t=hs.exports.getIn(u,e);if(Array.isArray(t))return Ky(0,t.length).map(String);if(Ts(t)){var n=Object.keys(t).slice(0);return n.sort(GW),n}return[]},function(e){return hs.exports.existsIn(u,e)},v,function(){n(6,d=!d)},p,function(e){p(),v(e)},c,l,function(e){ea[e?"unshift":"push"]((function(){n(5,a=e)}))},function(e){ea[e?"unshift":"push"]((function(){n(4,o=e)}))}]}var _H=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,SH,xH,Ki,{json:0,documentState:14,onSelect:15,onError:1,pathParser:2},gH),r}return Li(n)}();function CH(e){co(e,"svelte-18vllqh",".jse-search-box.svelte-18vllqh.svelte-18vllqh{border:var(--jse-panel-border);border-radius:3px;font-family:var(--jse-font-family);font-size:var(--jse-font-size);background:var(--jse-panel-background);color:var(--jse-panel-color-readonly);box-shadow:var(--jse-controls-box-shadow);display:inline-block;width:400px;max-width:100%;overflow:auto}.jse-search-box.svelte-18vllqh .jse-search-form.svelte-18vllqh{display:flex;align-items:stretch}.jse-search-box.svelte-18vllqh .jse-search-form button.svelte-18vllqh,.jse-search-box.svelte-18vllqh .jse-search-form input.svelte-18vllqh{font-family:inherit;font-size:inherit}.jse-search-box.svelte-18vllqh .jse-search-form button.svelte-18vllqh{display:block;text-align:center;border:none;padding:0 5px;margin:0;cursor:pointer;color:var(--jse-panel-button-color);background:var(--jse-panel-button-background)}.jse-search-box.svelte-18vllqh .jse-search-form button.svelte-18vllqh:hover{color:var(--jse-panel-button-color-highlight);background:var(--jse-panel-button-background-highlight)}.jse-search-box.svelte-18vllqh .jse-search-form input.svelte-18vllqh{color:var(--jse-panel-color);border:var(--jse-input-border);border-radius:3px;background:var(--jse-input-background);height:28px;padding:0 5px;margin:0;flex:1;outline:none}.jse-search-box.svelte-18vllqh .jse-search-form .jse-replace-toggle.svelte-18vllqh{padding:var(--jse-padding) calc(0.5 * var(--jse-padding));min-width:20px;background:var(--jse-panel-button-background-highlight)}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents.svelte-18vllqh{flex:1;display:flex;flex-direction:column;padding:calc(0.5 * var(--jse-padding));gap:calc(0.5 * var(--jse-padding))}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section.svelte-18vllqh{flex:1;display:flex;align-items:center;position:relative;padding-left:32px}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section .jse-search-icon.svelte-18vllqh{color:inherit;cursor:inherit;background:inherit;position:absolute;top:calc(0.5 * var(--jse-padding));left:calc(0.5 * var(--jse-padding))}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section label.jse-search-input-label.svelte-18vllqh{flex:1;display:flex}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.svelte-18vllqh{color:inherit;font-size:80%;visibility:hidden;padding:0 5px;min-width:36px;text-align:center}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.jse-visible.svelte-18vllqh{visibility:visible}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-replace-section.svelte-18vllqh{padding-left:32px;flex:1;display:flex}.jse-search-box.svelte-18vllqh .jse-search-form .jse-search-contents .jse-replace-section button.svelte-18vllqh{width:auto}")}function $H(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b,k,w,j,x,S,_,C,$,O,E=(-1!==e[3]?"".concat(e[3]+1,"/"):"")+"",P=!e[4]&&OH(e),M=[PH,EH],A=[];function T(e,t){return e[2]?0:1}s=T(e),u=A[s]=M[s](e),y=new hS({props:{data:Mx}}),w=new hS({props:{data:vx}}),S=new hS({props:{data:Ix}});var N=e[0]&&!e[4]&&MH(e);return{c:function(){t=go("div"),n=go("form"),P&&P.c(),r=ko(),i=go("div"),o=go("div"),a=go("div"),u.c(),c=ko(),l=go("label"),f=go("input"),h=ko(),d=go("div"),v=bo(E),p=bo(e[10]),m=ko(),g=go("button"),Pa(y.$$.fragment),b=ko(),k=go("button"),Pa(w.$$.fragment),j=ko(),x=go("button"),Pa(S.$$.fragment),_=ko(),N&&N.c(),So(a,"class","jse-search-icon svelte-18vllqh"),So(f,"class","jse-search-input svelte-18vllqh"),So(f,"title","Enter text to search"),So(f,"type","text"),So(f,"placeholder","Find"),So(l,"class","jse-search-input-label svelte-18vllqh"),So(l,"about","jse-search input"),So(d,"class","jse-search-count svelte-18vllqh"),No(d,"jse-visible",""!==e[8]),So(g,"type","button"),So(g,"class","jse-search-next svelte-18vllqh"),So(g,"title","Go to next search result (Enter)"),So(k,"type","button"),So(k,"class","jse-search-previous svelte-18vllqh"),So(k,"title","Go to previous search result (Shift+Enter)"),So(x,"type","button"),So(x,"class","jse-search-clear svelte-18vllqh"),So(x,"title","Close search box (Esc)"),So(o,"class","jse-search-section svelte-18vllqh"),So(i,"class","jse-search-contents svelte-18vllqh"),So(n,"class","jse-search-form svelte-18vllqh"),So(t,"class","jse-search-box svelte-18vllqh")},m:function(u,E){vo(u,t,E),uo(t,n),P&&P.m(n,null),uo(n,r),uo(n,i),uo(i,o),uo(o,a),A[s].m(a,null),uo(o,c),uo(o,l),uo(l,f),Po(f,e[8]),uo(o,h),uo(o,d),uo(d,v),uo(d,p),uo(o,m),uo(o,g),Ma(y,g,null),uo(o,b),uo(o,k),Ma(w,k,null),uo(o,j),uo(o,x),Ma(S,x,null),uo(i,_),N&&N.m(i,null),C=!0,$||(O=[jo(f,"input",e[21]),to(TH.call(null,f)),jo(g,"click",e[22]),jo(k,"click",e[23]),jo(x,"click",e[24]),jo(n,"submit",e[12]),jo(n,"keydown",e[13])],$=!0)},p:function(e,t){e[4]?P&&(ga(),ka(P,1,1,(function(){P=null})),ya()):P?(P.p(e,t),16&t&&ba(P,1)):((P=OH(e)).c(),ba(P,1),P.m(n,r));var o=s;(s=T(e))===o?A[s].p(e,t):(ga(),ka(A[o],1,1,(function(){A[o]=null})),ya(),(u=A[s])?u.p(e,t):(u=A[s]=M[s](e)).c(),ba(u,1),u.m(a,null)),256&t&&f.value!==e[8]&&Po(f,e[8]),(!C||8&t)&&E!==(E=(-1!==e[3]?"".concat(e[3]+1,"/"):"")+"")&&Eo(v,E),(!C||1024&t)&&Eo(p,e[10]),(!C||256&t)&&No(d,"jse-visible",""!==e[8]),e[0]&&!e[4]?N?N.p(e,t):((N=MH(e)).c(),N.m(i,null)):N&&(N.d(1),N=null)},i:function(e){C||(ba(P),ba(u),ba(y.$$.fragment,e),ba(w.$$.fragment,e),ba(S.$$.fragment,e),C=!0)},o:function(e){ka(P),ka(u),ka(y.$$.fragment,e),ka(w.$$.fragment,e),ka(S.$$.fragment,e),C=!1},d:function(e){e&&po(t),P&&P.d(),A[s].d(),Aa(y),Aa(w),Aa(S),N&&N.d(),$=!1,Hi(O)}}}function OH(e){var t,n,r,i,o;return n=new hS({props:{data:e[0]?_x:ux}}),{c:function(){t=go("button"),Pa(n.$$.fragment),So(t,"type","button"),So(t,"class","jse-replace-toggle svelte-18vllqh"),So(t,"title","Toggle visibility of replace options (Ctrl+H)")},m:function(a,s){vo(a,t,s),Ma(n,t,null),r=!0,i||(o=jo(t,"click",e[11]),i=!0)},p:function(e,t){var r={};1&t&&(r.data=e[0]?_x:ux),n.$set(r)},i:function(e){r||(ba(n.$$.fragment,e),r=!0)},o:function(e){ka(n.$$.fragment,e),r=!1},d:function(e){e&&po(t),Aa(n),i=!1,o()}}}function EH(e){var t,n;return t=new hS({props:{data:Px}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:Bi,i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function PH(e){var t,n;return t=new hS({props:{data:lx,spin:!0}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:Bi,i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function MH(e){var t,n,r,i,o,a,s,u;return{c:function(){t=go("div"),n=go("input"),r=ko(),(i=go("button")).textContent="Replace",o=ko(),(a=go("button")).textContent="All",So(n,"class","jse-replace-input svelte-18vllqh"),So(n,"title","Enter replacement text"),So(n,"type","text"),So(n,"placeholder","Replace"),So(i,"type","button"),So(i,"title","Replace current occurrence (Ctrl+Enter)"),So(i,"class","svelte-18vllqh"),So(a,"type","button"),So(a,"title","Replace all occurrences"),So(a,"class","svelte-18vllqh"),So(t,"class","jse-replace-section svelte-18vllqh")},m:function(c,l){vo(c,t,l),uo(t,n),Po(n,e[9]),uo(t,r),uo(t,i),uo(t,o),uo(t,a),s||(u=[jo(n,"input",e[25]),jo(i,"click",e[14]),jo(a,"click",e[15])],s=!0)},p:function(e,t){512&t&&n.value!==e[9]&&Po(n,e[9])},d:function(e){e&&po(t),s=!1,Hi(u)}}}function AH(e){var t,n,r=e[1]&&$H(e);return{c:function(){r&&r.c(),t=wo()},m:function(e,i){r&&r.m(e,i),vo(e,t,i),n=!0},p:function(e,n){var i=ki(n,1)[0];e[1]?r?(r.p(e,i),2&i&&ba(r,1)):((r=$H(e)).c(),ba(r,1),r.m(t.parentNode,t)):r&&(ga(),ka(r,1,1,(function(){r=null})),ya())},i:function(e){n||(ba(r),n=!0)},o:function(e){ka(r),n=!1},d:function(e){r&&r.d(e),e&&po(t)}}}function TH(e){e.select()}function NH(e,t,n){var r,i,o=t.show,a=void 0!==o&&o,s=t.searching,u=t.resultCount,c=void 0===u?0:u,l=t.activeIndex,f=void 0===l?0:l,h=t.showReplace,d=void 0!==h&&h,v=t.readOnly,p=void 0!==v&&v,m=t.onChange,g=void 0===m?Zu:m,y=t.onPrevious,b=void 0===y?Zu:y,k=t.onNext,w=void 0===k?Zu:k,j=t.onReplace,x=void 0===j?Zu:j,S=t.onReplaceAll,_=void 0===S?Zu:S,C=t.onClose,$=void 0===C?Zu:C,O="",E="",P="";function M(){n(0,d=!d&&!p)}function A(){p||x(O,P)}return e.$$set=function(e){"show"in e&&n(1,a=e.show),"searching"in e&&n(2,s=e.searching),"resultCount"in e&&n(16,c=e.resultCount),"activeIndex"in e&&n(3,f=e.activeIndex),"showReplace"in e&&n(0,d=e.showReplace),"readOnly"in e&&n(4,p=e.readOnly),"onChange"in e&&n(17,g=e.onChange),"onPrevious"in e&&n(5,b=e.onPrevious),"onNext"in e&&n(6,w=e.onNext),"onReplace"in e&&n(18,x=e.onReplace),"onReplaceAll"in e&&n(19,_=e.onReplaceAll),"onClose"in e&&n(7,$=e.onClose)},e.$$.update=function(){65536&e.$$.dirty&&n(10,r=c>=1e3?"".concat(999,"+"):String(c)),131072&e.$$.dirty&&n(20,i=cv(g,300)),1048832&e.$$.dirty&&i(O),2&e.$$.dirty&&a&&""!==O&&g(O)},[d,a,s,f,p,b,w,$,O,P,r,M,function(e){e.preventDefault(),O!==E?(E=O,i.cancel(),g(O)):w()},function(e){e.stopPropagation();var t=Jj(e);"Enter"===t&&(e.preventDefault(),w()),"Shift+Enter"===t&&(e.preventDefault(),b()),"Ctrl+Enter"!==t&&"Command+Enter"!==t||(e.preventDefault(),d?A():w()),"Ctrl+H"===t&&(e.preventDefault(),M()),"Escape"===t&&(e.preventDefault(),$())},A,function(){p||_(O,P)},c,g,x,_,i,function(){O=this.value,n(8,O)},function(){return w()},function(){return b()},function(){return $()},function(){P=this.value,n(9,P)}]}var IH=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,NH,AH,Ki,{show:1,searching:2,resultCount:16,activeIndex:3,showReplace:0,readOnly:4,onChange:17,onPrevious:5,onNext:6,onReplace:18,onReplaceAll:19,onClose:7},CH),r}return Li(n)}(),RH=xa.window;function DH(e){co(e,"svelte-1chflnh",".jse-tree-mode.svelte-1chflnh.svelte-1chflnh{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color);min-width:0;min-height:0;font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);color:var(--jse-text-color);line-height:var(--jse-line-height)}.jse-tree-mode.svelte-1chflnh .jse-hidden-input-label.svelte-1chflnh{position:fixed;right:0;top:0;width:0;height:0}.jse-tree-mode.svelte-1chflnh .jse-hidden-input-label .jse-hidden-input.svelte-1chflnh{width:0;height:0;padding:0;border:0;outline:none}.jse-tree-mode.svelte-1chflnh .jse-search-box-container.svelte-1chflnh{position:relative;height:0;top:var(--jse-padding);margin-right:calc(var(--jse-padding) + 20px);margin-left:var(--jse-padding);text-align:right;z-index:3}.jse-tree-mode.no-main-menu.svelte-1chflnh.svelte-1chflnh{border-top:var(--jse-main-border)}.jse-tree-mode.svelte-1chflnh .jse-contents.svelte-1chflnh{border-left:var(--jse-main-border);border-right:var(--jse-main-border);flex:1;overflow:auto;position:relative;padding:2px;display:flex;flex-direction:column}.jse-tree-mode.svelte-1chflnh .jse-contents.svelte-1chflnh:last-child{border-bottom:var(--jse-main-border)}.jse-tree-mode.svelte-1chflnh .jse-contents .jse-loading-space.svelte-1chflnh{flex:1}.jse-tree-mode.svelte-1chflnh .jse-contents .jse-loading.svelte-1chflnh{flex:2;text-align:center;color:var(--jse-panel-color-readonly);box-sizing:border-box;font-family:var(--jse-font-family);font-size:var(--jse-font-size)}.jse-tree-mode.svelte-1chflnh .jse-preview.svelte-1chflnh{flex:1;color:var(--jse-panel-color-readonly);overflow:auto;white-space:pre-wrap;padding:2px}")}function LH(e){var t,n,r;function i(t){e[73](t)}var o={json:e[9],selection:e[15].selection,readOnly:e[0],historyState:e[21],onExpandAll:e[39],onCollapseAll:e[40],onUndo:e[35],onRedo:e[36],onSort:e[37],onTransform:e[38],onContextMenu:e[44],onCopy:e[33],onRenderMenu:e[6]};return void 0!==e[18]&&(o.showSearch=e[18]),t=new qW({props:o}),ea.push((function(){return Ea(t,"showSearch",i)})),{c:function(){Pa(t.$$.fragment)},m:function(e,n){Ma(t,e,n),r=!0},p:function(e,r){var i={};512&r[0]&&(i.json=e[9]),32768&r[0]&&(i.selection=e[15].selection),1&r[0]&&(i.readOnly=e[0]),2097152&r[0]&&(i.historyState=e[21]),64&r[0]&&(i.onRenderMenu=e[6]),!n&&262144&r[0]&&(n=!0,i.showSearch=e[18],ua((function(){return n=!1}))),t.$set(i)},i:function(e){r||(ba(t.$$.fragment,e),r=!0)},o:function(e){ka(t.$$.fragment,e),r=!1},d:function(e){Aa(t,e)}}}function zH(e){var t,n;return t=new _H({props:{json:e[9],documentState:e[15],onSelect:e[47],onError:e[4],pathParser:e[3]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};512&n[0]&&(r.json=e[9]),32768&n[0]&&(r.documentState=e[15]),16&n[0]&&(r.onError=e[4]),8&n[0]&&(r.pathParser=e[3]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function BH(e){var t;return{c:function(){(t=go("div")).innerHTML='
    \n
    loading...
    ',So(t,"class","jse-contents svelte-1chflnh")},m:function(e,n){vo(e,t,n)},p:Bi,i:Bi,o:Bi,d:function(e){e&&po(t)}}}function qH(e){var t,n,r,i,o,a,s,u,c,l=[VH,FH],f=[];function h(e,t){return void 0===e[9]?0:1}return i=h(e),o=f[i]=l[i](e),{c:function(){t=go("label"),n=go("input"),r=ko(),o.c(),a=wo(),So(n,"type","text"),n.readOnly="readonly",So(n,"tabindex","-1"),So(n,"class","jse-hidden-input svelte-1chflnh"),So(t,"class","jse-hidden-input-label svelte-1chflnh")},m:function(o,l){vo(o,t,l),uo(t,n),e[74](n),vo(o,r,l),f[i].m(o,l),vo(o,a,l),s=!0,u||(c=jo(n,"paste",e[34]),u=!0)},p:function(e,t){var n=i;(i=h(e))===n?f[i].p(e,t):(ga(),ka(f[n],1,1,(function(){f[n]=null})),ya(),(o=f[i])?o.p(e,t):(o=f[i]=l[i](e)).c(),ba(o,1),o.m(a.parentNode,a))},i:function(e){s||(ba(o),s=!0)},o:function(e){ka(o),s=!1},d:function(n){n&&po(t),e[74](null),n&&po(r),f[i].d(n),n&&po(a),u=!1,c()}}}function FH(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v;a=new IH({props:{show:e[18],resultCount:(null===(t=e[16])||void 0===t||null===(n=t.items)||void 0===n?void 0:n.length)||0,activeIndex:(null===(r=e[16])||void 0===r?void 0:r.activeIndex)||0,showReplace:e[19],searching:e[20],readOnly:e[0],onChange:e[26],onNext:e[27],onPrevious:e[28],onReplace:e[29],onReplaceAll:e[30],onClose:e[31]}}),c=new LW({props:{value:e[9],path:e[25],expandedMap:e[15].expandedMap,enforceStringMap:e[15].enforceStringMap,visibleSectionsMap:e[15].visibleSectionsMap,validationErrorsMap:e[23],searchResultItemsMap:null===(i=e[16])||void 0===i?void 0:i.itemsMap,selection:e[15].selection,context:e[12],onDragSelectionStart:Zu}});var p=e[17]&&WH(e),m=e[22]&&HH(e);return d=new zS({props:{validationErrors:e[11],selectError:e[32]}}),{c:function(){o=go("div"),Pa(a.$$.fragment),s=ko(),u=go("div"),Pa(c.$$.fragment),l=ko(),p&&p.c(),f=ko(),m&&m.c(),h=ko(),Pa(d.$$.fragment),So(o,"class","jse-search-box-container svelte-1chflnh"),So(u,"class","jse-contents svelte-1chflnh"),So(u,"data-jsoneditor-scrollable-contents",!0)},m:function(t,n){vo(t,o,n),Ma(a,o,null),vo(t,s,n),vo(t,u,n),Ma(c,u,null),e[75](u),vo(t,l,n),p&&p.m(t,n),vo(t,f,n),m&&m.m(t,n),vo(t,h,n),Ma(d,t,n),v=!0},p:function(e,t){var n,r,i,o,s={};262144&t[0]&&(s.show=e[18]),65536&t[0]&&(s.resultCount=(null===(n=e[16])||void 0===n||null===(r=n.items)||void 0===r?void 0:r.length)||0),65536&t[0]&&(s.activeIndex=(null===(i=e[16])||void 0===i?void 0:i.activeIndex)||0),524288&t[0]&&(s.showReplace=e[19]),1048576&t[0]&&(s.searching=e[20]),1&t[0]&&(s.readOnly=e[0]),a.$set(s);var u={};512&t[0]&&(u.value=e[9]),32768&t[0]&&(u.expandedMap=e[15].expandedMap),32768&t[0]&&(u.enforceStringMap=e[15].enforceStringMap),32768&t[0]&&(u.visibleSectionsMap=e[15].visibleSectionsMap),8388608&t[0]&&(u.validationErrorsMap=e[23]),65536&t[0]&&(u.searchResultItemsMap=null===(o=e[16])||void 0===o?void 0:o.itemsMap),32768&t[0]&&(u.selection=e[15].selection),4096&t[0]&&(u.context=e[12]),c.$set(u),e[17]?p?(p.p(e,t),131072&t[0]&&ba(p,1)):((p=WH(e)).c(),ba(p,1),p.m(f.parentNode,f)):p&&(ga(),ka(p,1,1,(function(){p=null})),ya()),e[22]?m?(m.p(e,t),4194304&t[0]&&ba(m,1)):((m=HH(e)).c(),ba(m,1),m.m(h.parentNode,h)):m&&(ga(),ka(m,1,1,(function(){m=null})),ya());var l={};2048&t[0]&&(l.validationErrors=e[11]),d.$set(l)},i:function(e){v||(ba(a.$$.fragment,e),ba(c.$$.fragment,e),ba(p),ba(m),ba(d.$$.fragment,e),v=!0)},o:function(e){ka(a.$$.fragment,e),ka(c.$$.fragment,e),ka(p),ka(m),ka(d.$$.fragment,e),v=!1},d:function(t){t&&po(o),Aa(a),t&&po(s),t&&po(u),Aa(c),e[75](null),t&&po(l),p&&p.d(t),t&&po(f),m&&m.d(t),t&&po(h),Aa(d,t)}}}function VH(e){var t,n,r,i,o=[UH,JH],a=[];function s(e,t){return""===e[10]||void 0===e[10]?0:1}return t=s(e),n=a[t]=o[t](e),{c:function(){n.c(),r=wo()},m:function(e,n){a[t].m(e,n),vo(e,r,n),i=!0},p:function(e,i){var u=t;(t=s(e))===u?a[t].p(e,i):(ga(),ka(a[u],1,1,(function(){a[u]=null})),ya(),(n=a[t])?n.p(e,i):(n=a[t]=o[t](e)).c(),ba(n,1),n.m(r.parentNode,r))},i:function(e){i||(ba(n),i=!0)},o:function(e){ka(n),i=!1},d:function(e){a[t].d(e),e&&po(r)}}}function WH(e){var t,n;return t=new kS({props:{type:"info",message:"You pasted a JSON ".concat(Array.isArray(e[17].contents)?"array":"object"," as text"),actions:[{icon:bx,text:"Paste as JSON instead",onMouseDown:e[45]},{text:"Leave as is",onClick:e[46]}]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};131072&n[0]&&(r.message="You pasted a JSON ".concat(Array.isArray(e[17].contents)?"array":"object"," as text")),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function HH(e){var t,n;return t=new kS({props:{type:"success",message:"The loaded JSON document was invalid but is successfully repaired.",actions:e[0]?[]:[{icon:Dx,text:"Ok",onClick:e[7]},{icon:yx,text:"Repair manually instead",onClick:e[5]}]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};33&n[0]&&(r.actions=e[0]?[]:[{icon:Dx,text:"Ok",onClick:e[7]},{icon:yx,text:"Repair manually instead",onClick:e[5]}]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function JH(e){var t,n,r,i,o,a=nq(e[10],2e4)+"";return t=new kS({props:{type:"error",message:"The loaded JSON document is invalid and could not be repaired automatically.",actions:e[0]?[]:[{icon:yx,text:"Repair manually",onClick:e[5]}]}}),{c:function(){Pa(t.$$.fragment),n=ko(),r=go("div"),i=bo(a),So(r,"class","jse-preview svelte-1chflnh")},m:function(e,a){Ma(t,e,a),vo(e,n,a),vo(e,r,a),uo(r,i),o=!0},p:function(e,n){var r={};33&n[0]&&(r.actions=e[0]?[]:[{icon:yx,text:"Repair manually",onClick:e[5]}]),t.$set(r),(!o||1024&n[0])&&a!==(a=nq(e[10],2e4)+"")&&Eo(i,a)},i:function(e){o||(ba(t.$$.fragment,e),o=!0)},o:function(e){ka(t.$$.fragment,e),o=!1},d:function(e){Aa(t,e),e&&po(n),e&&po(r)}}}function UH(e){var t,n;return t=new JW({props:{readOnly:e[0]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};1&n[0]&&(r.readOnly=e[0]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function KH(e){var t,n,r,i,o,a,s,u,c=e[1]&&LH(e),l=e[2]&&zH(e),f=[qH,BH],h=[];return i=function(e,t){return e[24]?1:0}(e),o=h[i]=f[i](e),{c:function(){t=go("div"),c&&c.c(),n=ko(),l&&l.c(),r=ko(),o.c(),So(t,"class","jse-tree-mode svelte-1chflnh"),No(t,"no-main-menu",!e[1])},m:function(o,f){vo(o,t,f),c&&c.m(t,null),uo(t,n),l&&l.m(t,null),uo(t,r),h[i].m(t,null),e[76](t),a=!0,s||(u=[jo(RH,"mousedown",e[48]),jo(t,"keydown",e[41]),jo(t,"mousedown",e[42]),jo(t,"contextmenu",e[43])],s=!0)},p:function(e,i){e[1]?c?(c.p(e,i),2&i[0]&&ba(c,1)):((c=LH(e)).c(),ba(c,1),c.m(t,n)):c&&(ga(),ka(c,1,1,(function(){c=null})),ya()),e[2]?l?(l.p(e,i),4&i[0]&&ba(l,1)):((l=zH(e)).c(),ba(l,1),l.m(t,r)):l&&(ga(),ka(l,1,1,(function(){l=null})),ya()),o.p(e,i),(!a||2&i[0])&&No(t,"no-main-menu",!e[1])},i:function(e){a||(ba(c),ba(l),ba(o),a=!0)},o:function(e){ka(c),ka(l),ka(o),a=!1},d:function(n){n&&po(t),c&&c.d(),l&&l.d(),h[i].d(),e[76](null),s=!1,Hi(u)}}}function GH(e){return 0===e.length||1===e.length&&"0"===e[0]}function QH(){return!0}function YH(e,t,n){var r,i=La("jsoneditor:TreeMode"),o="undefined"==typeof window;i("isSSR:",o);var a,s,u,c,l,f=Zo("simple-modal").open,h=ew(),d=ew(),v=Zo("absolute-popup"),p=v.openAbsolutePopup,m=v.closeAbsolutePopup,g=!1,y=xB(),b=t.readOnly,k=t.externalContent,w=t.mainMenuBar,j=t.navigationBar,x=t.escapeControlCharacters,S=t.escapeUnicodeCharacters,_=t.parser,C=t.validator,$=t.validationParser,O=t.pathParser,E=t.indentation,P=t.onError,M=t.onChange,A=t.onRenderValue,T=t.onRequestRepair,N=t.onRenderMenu,I=t.onClassName,R=t.onFocus,D=t.onBlur,L=t.onSortModal,z=t.onTransformModal,B=!1;qx({onMount:Ko,onDestroy:Go,getWindow:function(){return Lj(u)},hasFocus:function(){return B&&document.hasFocus()||zj(u)},onFocus:function(){g=!0,R&&R()},onBlur:function(){g=!1,D&&D()}});var q=[],F=void 0;function V(e){i("updateSelection",e);var t="function"==typeof e?e(K.selection):e;Mm(t,K.selection)||n(15,K=ji(ji({},K),{},{selection:t}))}var W,H,J,U=!1,K=OB();var G=!1,Q=!1,Y=!1,Z="";function X(e){return ee.apply(this,arguments)}function ee(){return ee=yi(mi().mark((function e(t){return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i("search text updated",t),n(72,Z=t),e.next=4,aa();case 4:return e.next=6,oe();case 6:case"end":return e.stop()}}),e)}))),ee.apply(this,arguments)}function te(){return(te=yi(mi().mark((function e(){return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(16,W=W?Wq(W):void 0),e.next=3,oe();case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(){return(ne=yi(mi().mark((function e(){return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(16,W=W?Hq(W):void 0),e.next=3,oe();case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function re(){return(re=yi(mi().mark((function e(t,n){var r,o,a,s,u;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null===(r=W)||void 0===r?void 0:r.activeItem,i("handleReplace",{replacementText:n,activeItem:o}),o){e.next=4;break}return e.abrupt("return");case 4:return a=Qq(c,K,n,o,_),s=a.operations,u=a.newSelection,ot(s,(function(e,t){return{state:ji(ji({},t),{},{selection:u})}})),e.next=8,aa();case 8:return e.next=10,oe();case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return ie=yi(mi().mark((function e(t,n){var r,o,a;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i("handleReplaceAll",{text:t,replacementText:n}),r=Yq(c,K,t,n,_),o=r.operations,a=r.newSelection,ot(o,(function(e,t){return{state:ji(ji({},t),{},{selection:a})}})),e.next=5,aa();case 5:return e.next=7,oe();case 7:case"end":return e.stop()}}),e)}))),ie.apply(this,arguments)}function oe(){return ae.apply(this,arguments)}function ae(){return(ae=yi(mi().mark((function e(){var t,r,o;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null===(t=W)||void 0===t?void 0:t.activeItem,i("focusActiveSearchResult",W),!r){e.next=9;break}return o=r.path,n(15,K=ji(ji({},MB(c,K,o)),{},{selection:void 0})),e.next=7,aa();case 7:return e.next=9,et(o);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var se=eq({onChange:function(e){n(21,ue=e)}}),ue=se.getState();var ce,le,fe=kk((function(){if(""===Z)return i("clearing search result"),void(void 0!==W&&n(16,W=void 0));n(20,Y=!0),setTimeout((function(){i("searching...",Z);var e=Jq(Z,c,K,1e3);n(16,W=function(e,t,n){var r=null!=n&&n.activeItem?Zq(n.activeItem):void 0,i=t.findIndex((function(e){return Mm(r,Zq(e))})),o=-1!==i?i:(null==n?void 0:n.activeIndex)0?0:-1,a=t.map((function(e,t){return ji(ji({},e),{},{active:t===o})})),s=a[o];return{items:a,itemsMap:qp(a,(function(e){return hs.exports.compileJSONPointer(e.path)})),activeItem:s,activeIndex:o}}(0,e,W)),n(20,Y=!1)}))}),300),he=!1,de=[],ve=iB(sB);function pe(e,t,r,o){oB((function(){var a;try{a=ve(e,t,r,o)}catch(e){a=[{path:[],message:"Failed to validate: "+e.message,severity:pj.warning}]}Mm(a,de)||(i("validationErrors changed:",a),n(11,de=a))}),(function(e){return i("validationErrors updated in ".concat(e," ms"))}))}function me(){return i("validate"),F?{parseError:F,isRepairable:!1}:(pe(c,C,_,$),{validationErrors:de})}function ge(){return c}function ye(){return K}function be(e){void 0!==e.json&&function(e){if(void 0===e)return;var t=!Mm(c,e);if(i("update external json",{isChanged:t,currentlyText:void 0===c}),!t)return;var r={json:c,text:l},o=K,a=c,s=l,u=he;n(9,c=e),ke(c),n(10,l=void 0),n(22,he=!1),we(c),je({previousJson:a,previousState:o,previousText:s,previousTextIsRepaired:u}),it(r,null)}(e.json),void 0!==e.text&&function(e){if(void 0===e||void 0!==k.json)return;var t=e===l;if(i("update external text",{isChanged:t}),t)return;var r={json:c,text:l},o=c,a=K,s=l,u=he;try{n(9,c=_.parse(e)),ke(c),n(10,l=e),n(22,he=!1),F=void 0,we(c)}catch(t){try{n(9,c=_.parse(Es(e))),ke(c),n(10,l=e),n(22,he=!0),F=void 0,we(c)}catch(e){n(9,c=void 0),n(10,l=k.text),n(22,he=!1),F=aj(l,t.message||t.toString()),we(c)}}je({previousJson:o,previousState:a,previousText:s,previousTextIsRepaired:u}),it(r,null)}(e.text)}function ke(e){U||(U=!0,n(15,K=AB(e,K,q,function(e){return lj({json:e},10240)?GH:QH}(e))))}function we(e){void 0!==K.selection&&(K.selection&&hs.exports.existsIn(e,K.selection.anchorPath)&&hs.exports.existsIn(e,K.selection.focusPath)||(i("clearing selection: path does not exist anymore",K.selection),n(15,K=ji(ji({},K),{},{selection:void 0}))))}function je(e){var t=e.previousJson,n=e.previousState,r=e.previousText,i=e.previousTextIsRepaired;void 0===t&&void 0===r||(void 0!==c?void 0!==t?se.add({undo:{patch:[{op:"replace",path:"",value:t}],state:jq(n),json:void 0,text:r,textIsRepaired:i},redo:{patch:[{op:"replace",path:"",value:c}],state:jq(K),json:void 0,text:l,textIsRepaired:he}}):se.add({undo:{patch:void 0,json:void 0,text:r,state:jq(n),textIsRepaired:i},redo:{patch:void 0,json:c,state:jq(K),text:l,textIsRepaired:he}}):void 0!==t&&se.add({undo:{patch:void 0,json:t,state:jq(n),text:r,textIsRepaired:i},redo:{patch:void 0,json:void 0,text:l,textIsRepaired:he,state:jq(K)}}))}function xe(){i("createDefaultSelection"),n(15,K=ji(ji({},K),{},{selection:$q(c||{},[],[])}))}function Se(e,t){if(i("patch",e,t),void 0===c)throw new Error("Cannot apply patch: no JSON");var r={json:c,text:l},o=c,a=K,s=l,u=he,f=function(e,t){return hs.exports.revertJSONPatch(e,t,{before:function(e,t,n){if(hs.exports.isJSONPatchRemove(t)){var r=hs.exports.parseJSONPointer(t.path);return{revertOperations:[].concat(Ti(n),Ti(Vq(e,r)))}}if(hs.exports.isJSONPatchMove(t)){var i=hs.exports.parseJSONPointer(t.from);return{revertOperations:[].concat(Ti(n),Ti(Vq(e,i)))}}return{revertOperations:n}}})}(c,e),h=RB(c,K,e),d=mq(c,e),v=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return void 0!==t||n?ji(ji({},e),{},{selection:t}):e}(h.documentState,d,!1);i("patch updatedSelection",d);var p="function"==typeof t?t(h.json,v):void 0;n(9,c=p&&void 0!==p.json?p.json:h.json);var m=p&&void 0!==p.state?p.state:v;n(15,K=m),n(10,l=void 0),n(22,he=!1),we(c),se.add({undo:{patch:f,json:void 0,text:s,state:jq(a),textIsRepaired:u},redo:{patch:e,json:void 0,state:jq(m),text:l,textIsRepaired:he}});var g={json:c,previousJson:o,undo:f,redo:e};return it(r,g),g}function _e(e){return uq(e)||aq(e)||sq(e)}function Ce(){!b&&K.selection&&V(xq(K.selection.focusPath,!0))}function $e(){!b&&K.selection&&V(Sq(K.selection.focusPath,!0))}function Oe(){if(!b&&sq(K.selection)){var e=K.selection.focusPath,t=hs.exports.compileJSONPointer(e),n=hs.exports.getIn(c,e),r=!UB(n,K.enforceStringMap,t,_),o=r?String(n):Bs(String(n),_);i("handleToggleEnforceString",{enforceString:r,value:n,updatedValue:o}),ot([{op:"replace",path:hs.exports.compileJSONPointer(e),value:o}],(function(e,n){return{state:IB(n,t,r)}}))}}function Ee(){return Pe.apply(this,arguments)}function Pe(){return Pe=yi(mi().mark((function e(){var t,n,r,o,a,s,u=arguments;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(u.length>0&&void 0!==u[0])||u[0],!b&&_e(K.selection)){e.next=3;break}return e.abrupt("return");case 3:if(n=t?E:null,null!=(r=Oq(c,K.selection,n,_))){e.next=7;break}return e.abrupt("return");case 7:return i("cut",{selection:K.selection,clipboard:r,indent:t}),e.next=10,tF(r);case 10:o=Fq(c,K.selection),a=o.operations,s=o.newSelection,ot(a,(function(e,t){return{state:ji(ji({},t),{},{selection:s})}}));case 12:case"end":return e.stop()}}),e)}))),Pe.apply(this,arguments)}function Me(){return Ae.apply(this,arguments)}function Ae(){return Ae=yi(mi().mark((function e(){var t,n,r,o=arguments;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(o.length>0&&void 0!==o[0])||o[0],n=t?E:null,null!=(r=Oq(c,K.selection,n,_))){e.next=5;break}return e.abrupt("return");case 5:return i("copy",{clipboard:r,indent:t}),e.next=8,tF(r);case 8:case"end":return e.stop()}}),e)}))),Ae.apply(this,arguments)}function Te(){f(cF,{},ji(ji({},ts),{},{styleWindow:{width:"450px"}}),{onClose:function(){return pt()}})}function Ne(e){if(void 0!==c){K.selection||xe();var t=Lq(c,K.selection,e,_);i("paste",{clipboardText:e,operations:t,selection:K.selection}),ot(t,(function(e,n){var r=n;return t.filter((function(e){return(hs.exports.isJSONPatchAdd(e)||hs.exports.isJSONPatchReplace(e))&&Ns(e.value)})).forEach((function(t){var n=hs.exports.parsePath(c,t.path);r=st(e,r,n)})),{state:r}}))}else i("paste text",{clipboardText:e}),function(e,t){i("handleChangeText");var r=K,o=c,a=l,s={json:c,text:l},u=he;try{n(9,c=_.parse(e)),n(15,K=AB(c,K,q,GH)),n(10,l=void 0),n(22,he=!1)}catch(t){try{n(9,c=_.parse(Es(e))),n(15,K=AB(c,K,q,GH)),n(10,l=e),n(22,he=!0)}catch(t){n(9,c=void 0),n(15,K=OB({json:c,expand:GH})),n(10,l=e),n(22,he=!1)}}if("function"==typeof t){var f=t(c,K);n(9,c=f&&f.json?f.json:c),n(15,K=f&&f.state?f.state:K)}we(c),je({previousJson:o,previousState:r,previousText:a,previousTextIsRepaired:u}),it(s,null)}(e,(function(e,t){if(e){return{state:st(e,t,[])}}}))}function Ie(){if(!b&&K.selection){var e=aq(K.selection)||sq(K.selection)?$q(c,K.selection.anchorPath,K.selection.focusPath):K.selection;if(Pm(K.selection.focusPath))i("remove root",{selection:K.selection}),M({text:"",json:void 0},{text:l,json:c},{contentErrors:me(),patchResult:null});else{var t=Fq(c,e),n=t.operations,r=t.newSelection;i("remove",{operations:n,selection:K.selection,newSelection:r}),ot(n,(function(e,t){return{state:ji(ji({},t),{},{selection:r})}}))}}}function Re(){if(!b&&_e(K.selection)&&!Pm(K.selection.focusPath)){i("duplicate",{selection:K.selection});var e=function(e,t){var n=Ov(t);if(Pm(n))throw new Error("Cannot duplicate root object");var r=om(n),i=Ov(n),o=hs.exports.getIn(e,r);if(hs.exports.isJSONArray(o)){var a=Ov(t),s=a?Ps(Ov(a))+1:0;return Ti(t.map((function(e,t){return{op:"copy",from:hs.exports.compileJSONPointer(e),path:hs.exports.compileJSONPointer(r.concat(String(t+s)))}})))}if(hs.exports.isJSONObject(o)){var u=Object.keys(o),c=KB(u,i,!1);return[].concat(Ti(t.map((function(e){var t=tq(Ov(e),u);return{op:"copy",from:hs.exports.compileJSONPointer(e),path:hs.exports.compileJSONPointer(r.concat(t))}}))),Ti(c.map((function(e){return Bq(r,e)}))))}throw new Error("Cannot create duplicate operations: parent must be an Object or Array")}(c,Eq(K.selection));ot(e)}}function De(){if(!b&&K.selection&&(uq(K.selection)||sq(K.selection))&&!Pm(K.selection.focusPath)){i("extract",{selection:K.selection});var e=function(e,t){if(sq(t))return[{op:"move",from:hs.exports.compileJSONPointer(t.focusPath),path:""}];if(!uq(t))throw new Error("Cannot create extract operations: parent must be an Object or Array");var n=om(t.focusPath),r=hs.exports.getIn(e,n);if(hs.exports.isJSONArray(r))return[{op:"replace",path:"",value:t.paths.map((function(e){var t=Ps(Ov(e));return r[t]}))}];if(hs.exports.isJSONObject(r)){var i={};return t.paths.forEach((function(e){var t=String(Ov(e));i[t]=r[t]})),[{op:"replace",path:"",value:i}]}throw new Error("Cannot extract: unsupported type of selection "+JSON.stringify(t))}(c,K.selection);ot(e,(function(e,t){if(Ns(e)){return{state:st(e,t,[])}}}))}}function Le(e){if(!b&&K.selection){var t=function(e,t,n){if("object"===n)return{};if("array"===n)return[];if("structure"===n){var r=cq(t),i=hs.exports.getIn(e,r);if(Array.isArray(i)&&!Pm(i)){var o=bp(i);return Ns(o)?dd(o,(function(e){return Array.isArray(e)?[]:Ts(e)?void 0:""})):""}}return""}(c,K.selection,e);if(void 0!==c){var n=_.stringify(t),r=Lq(c,K.selection,n,_);i("handleInsert",{type:e,operations:r,newValue:t,data:n});var o=Ov(r.filter((function(e){return"add"===e.op||"replace"===e.op})));ot(r,(function(e,n){if(o){var r=hs.exports.parsePath(e,o.path);if(Ns(t))return{state:ji(ji({},AB(e,n,r,QH)),{},{selection:_q(r)})};if(""===t){var a=Pm(r)?null:hs.exports.getIn(e,om(r));return i("test A",r,_q(r)),{state:MB(e,ji(ji({},K),{},{selection:Ts(a)?xq(r,!0):Sq(r,!0)}),r)}}}else;})),i("after patch"),o&&""===t&&aa().then((function(){setTimeout((function(){return Ve("",!0)}))}))}else{i("handleInsert",{type:e,newValue:t});var a=[];at(t,(function(e,t){return{state:ji(ji({},st(e,t,a)),{},{selection:_q(a)})}}))}}}function ze(e){aq(K.selection)&&V(Sq(K.selection.focusPath,!1)),Le(e)}function Be(e){if(!b&&K.selection)if(Mq(K.selection))try{var t=K.selection.anchorPath,n=hs.exports.getIn(c,t),r=function(e,t,n){if("array"===t){if(Array.isArray(e))return e;if(Ts(e))return Xw(e);if("string"==typeof e)try{var r=n.parse(e);if(Array.isArray(r))return r;if(Ts(r))return Xw(r)}catch(t){return[e]}return[e]}if("object"===t){if(Array.isArray(e))return Zw(e);if(Ts(e))return e;if("string"==typeof e)try{var i=n.parse(e);if(Ts(i))return i;if(Array.isArray(i))return Zw(i)}catch(t){return{value:e}}return{value:e}}if("value"===t)return Ns(e)?n.stringify(e):e;throw new Error("Cannot convert ".concat(Ds(e,n)," to ").concat(t))}(n,e,_);if(r===n)return;var o=[{op:"replace",path:hs.exports.compileJSONPointer(t),value:r}];i("handleConvert",{selection:K.selection,path:t,type:e,operations:o}),ot(o,(function(e,t){return{state:st(e,t,K.selection.focusPath)}}))}catch(e){P(e)}else P(new Error("Cannot convert current selection to ".concat(e)))}function qe(){var e=dq(c,K,!1),t=om(K.selection.focusPath);!Pm(e.focusPath)&&Mm(t,om(e.focusPath))?V(Cq(e.focusPath)):V(_q(t)),i("insert before",{selection:K.selection,selectionBefore:e,parentPath:t}),aa().then(dt)}function Fe(){var e=uq(K.selection)?Ov(K.selection.paths):K.selection.focusPath;i("insert after",e),V(Cq(e)),aa().then(dt)}function Ve(e,t){var n=Lj(u).document.activeElement;n.isContentEditable&&(n.textContent=t?e:n.textContent+e,Dj(n))}function We(e){return He.apply(this,arguments)}function He(){return(He=yi(mi().mark((function e(t){var n,r;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b&&K.selection){e.next=2;break}return e.abrupt("return");case 2:if(!aq(K.selection)){e.next=9;break}return n=!K.selection.edit,V(ji(ji({},K.selection),{},{edit:!0})),e.next=7,aa();case 7:return setTimeout((function(){return Ve(t,n)})),e.abrupt("return");case 9:if("{"!==t){e.next=13;break}Le("object"),e.next=28;break;case 13:if("["!==t){e.next=17;break}Le("array"),e.next=28;break;case 17:if(!sq(K.selection)){e.next=26;break}if(Ns(hs.exports.getIn(c,K.selection.focusPath))){e.next=24;break}return r=!K.selection.edit,V(ji(ji({},K.selection),{},{edit:!0})),e.next=23,aa();case 23:setTimeout((function(){return Ve(t,r)}));case 24:e.next=28;break;case 26:return e.next=28,Je(t);case 28:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Je(e){return Ue.apply(this,arguments)}function Ue(){return Ue=yi(mi().mark((function e(t){var n,r,i;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!b&&K.selection){e.next=2;break}return e.abrupt("return");case 2:return Le("value"),n=!Pq(K.selection),r=K.selection.focusPath,i=hs.exports.getIn(c,om(r)),Array.isArray(i)||!i||sq(K.selection)?V(Sq(r,!0)):V(xq(r,!0)),e.next=9,aa();case 9:setTimeout((function(){return Ve(t,n)}));case 10:case"end":return e.stop()}}),e)}))),Ue.apply(this,arguments)}function Ke(){if(!b&&se.getState().canUndo){var e=se.undo();if(e){var t={json:c,text:l};n(9,c=e.undo.patch?hs.exports.immutableJSONPatch(c,e.undo.patch):e.undo.json),n(15,K=e.undo.state),n(10,l=e.undo.text),n(22,he=e.undo.textIsRepaired),i("undo",{item:e,json:c,documentState:K}),it(t,{json:c,previousJson:t.json,redo:e.undo.patch,undo:e.redo.patch}),pt(),K.selection&&et(K.selection.focusPath,!1)}}}function Ge(){if(!b&&se.getState().canRedo){var e=se.redo();if(e){var t={json:c,text:l};n(9,c=e.redo.patch?hs.exports.immutableJSONPatch(c,e.redo.patch):e.redo.json),n(15,K=e.redo.state),n(10,l=e.redo.text),n(22,he=e.redo.textIsRepaired),i("redo",{item:e,json:c,documentState:K}),it(t,{json:c,previousJson:t.json,redo:e.redo.patch,undo:e.undo.patch}),pt(),K.selection&&et(K.selection.focusPath,!1)}}}function Qe(e){var t;b||(B=!0,L({id:h,json:c,selectedPath:e,onSort:(t=yi(mi().mark((function t(n){return mi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i("onSort",e,n),ot(n,(function(t,n){return{state:ji(ji({},st(t,n,e)),{},{selection:Sq(e,!1)})}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)}),onClose:function(){B=!1,pt()}}))}function Ye(){K.selection&&Qe(kq(c,K.selection))}function Ze(e){var t=e.id,n=e.selectedPath,r=e.onTransform,o=e.onClose;B=!0,z({id:t||d,json:c,selectedPath:n,onTransform:r?function(e){r({operations:e,json:c,transformedJson:hs.exports.immutableJSONPatch(c,e)})}:function(e){i("onTransform",n,e),ot(e,(function(e,t){return{state:ji(ji({},st(e,t,n)),{},{selection:Sq(n,!1)})}}))},onClose:function(){B=!1,pt(),o&&o()}})}function Xe(){K.selection&&Ze({selectedPath:kq(c,K.selection)})}function et(e){return tt.apply(this,arguments)}function tt(){return tt=yi(mi().mark((function e(t){var r,o,s,u,l,f=arguments;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!(f.length>1&&void 0!==f[1])||f[1],n(15,K=MB(c,K,om(t))),e.next=4,aa();case 4:if(!(o=nt(t))){e.next=14;break}if(i("scrollTo",{path:t,elem:o,refContents:a}),s=a.getBoundingClientRect(),u=o.getBoundingClientRect(),r){e.next=12;break}if(!(u.bottom>s.top&&u.topn.bottom-20&&y(t,{container:a,offset:-(n.height-i-20),duration:0})}}function it(e,t){void 0===e.json&&void 0===(null==e?void 0:e.text)||(void 0!==l?M({text:l,json:void 0},e,{contentErrors:me(),patchResult:t}):void 0!==c&&M({text:void 0,json:c},e,{contentErrors:me(),patchResult:t}))}function ot(e,t){if(!b){i("handlePatch",e,t);var r=Se(e,t);return n(17,J=void 0),r}}function at(e,t){var r=K,i=c,o=l,a={json:c,text:l},s=he,u=AB(c,K,q,GH),f="function"==typeof t?t(e,u):void 0;n(9,c=f&&void 0!==f.json?f.json:e),n(15,K=f&&void 0!==f.state?f.state:u),n(10,l=void 0),n(22,he=!1),we(c),je({previousJson:i,previousState:r,previousText:o,previousTextIsRepaired:s});it(a,null)}function st(e,t,n){return AB(e,t,n,!lj({json:hs.exports.getIn(e,n)},10240)?QH:GH)}function ut(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i("expand",{path:e,expanded:t,recursive:r}),n(15,K=t?r?AB(c,K,e,QH):TB(K,e):NB(K,e)),K.selection&&!t&&hq(K.selection,e)&&V(void 0),setTimeout((function(){zj(u)||pt()}))}function ct(e){i("openFind",{findAndReplace:e}),n(18,G=!1),n(19,Q=!1),aa().then((function(){n(18,G=!0),n(19,Q=e)}))}function lt(e,t){i("handleExpandSection",e,t);var r=hs.exports.compileJSONPointer(e);n(15,K=function(e,t,n,r){return ji(ji({},t),{},{visibleSectionsMap:ji(ji({},t.visibleSectionsMap),{},xi({},n,SB(EB(t,n).concat(r))))})}(0,K,r,t))}function ft(e){i("pasted json as text",e),n(17,J=e)}function ht(e){var t=e.anchor,n=e.left,r=e.top,i=e.width,o=e.height,a=e.offsetTop,s=e.offsetLeft,u=e.showTip;B=!0;var l=p(qF,{json:c,documentState:K,parser:_,showTip:u,onEditKey:Ce,onEditValue:$e,onToggleEnforceString:Oe,onCut:Ee,onCopy:Me,onPaste:Te,onRemove:Ie,onDuplicate:Re,onExtract:De,onInsertBefore:qe,onInsert:ze,onConvert:Be,onInsertAfter:Fe,onSort:Ye,onTransform:Xe,onCloseContextMenu:function(){m(l),pt()}},{left:n,top:r,offsetTop:a,offsetLeft:s,width:i,height:o,anchor:t,closeOnOuterClick:!0,onClose:function(){B=!1,pt()}})}function dt(e){if(!b&&!Pq(K.selection)){if(e&&(e.stopPropagation(),e.preventDefault()),e&&"contextmenu"===e.type&&e.target!==s)ht({left:e.clientX,top:e.clientY,width:260,height:336,showTip:!1});else{var t,n=null===(t=a)||void 0===t?void 0:t.querySelector(".jse-context-menu-button.jse-selected");if(n)ht({anchor:n,offsetTop:2,width:260,height:336,showTip:!1});else{var r,i=null===(r=a)||void 0===r?void 0:r.getBoundingClientRect();i&&ht({top:i.top+2,left:i.left+2,width:260,height:336,showTip:!1})}}return!1}}function vt(){return(vt=yi(mi().mark((function e(){var t,n,r;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i("apply pasted json",J),n=(t=J).path,r=t.contents,V(Sq(n,!1)),e.next=5,aa();case 5:ot([{op:"replace",path:hs.exports.compileJSONPointer(n),value:r}],(function(e,t){return{state:st(e,t,n)}}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pt(){i("focus"),s&&(s.focus(),s.select())}function mt(e){r&&r.onDrag(e)}function gt(){r&&r.onDragEnd()}return e.$$set=function(e){"readOnly"in e&&n(0,b=e.readOnly),"externalContent"in e&&n(49,k=e.externalContent),"mainMenuBar"in e&&n(1,w=e.mainMenuBar),"navigationBar"in e&&n(2,j=e.navigationBar),"escapeControlCharacters"in e&&n(50,x=e.escapeControlCharacters),"escapeUnicodeCharacters"in e&&n(51,S=e.escapeUnicodeCharacters),"parser"in e&&n(52,_=e.parser),"validator"in e&&n(53,C=e.validator),"validationParser"in e&&n(54,$=e.validationParser),"pathParser"in e&&n(3,O=e.pathParser),"indentation"in e&&n(55,E=e.indentation),"onError"in e&&n(4,P=e.onError),"onChange"in e&&n(56,M=e.onChange),"onRenderValue"in e&&n(57,A=e.onRenderValue),"onRequestRepair"in e&&n(5,T=e.onRequestRepair),"onRenderMenu"in e&&n(6,N=e.onRenderMenu),"onClassName"in e&&n(58,I=e.onClassName),"onFocus"in e&&n(59,R=e.onFocus),"onBlur"in e&&n(60,D=e.onBlur),"onSortModal"in e&&n(61,L=e.onSortModal),"onTransformModal"in e&&n(62,z=e.onTransformModal)},e.$$.update=function(){1572864&e.$$.dirty[1]&&n(71,H=wj({escapeControlCharacters:x,escapeUnicodeCharacters:S})),262144&e.$$.dirty[1]&&be(k),512&e.$$.dirty[0]|1024&e.$$.dirty[2]&&fe(Z,c),e.$$.dirty[0],512&e.$$.dirty[0]|14680064&e.$$.dirty[1]&&pe(c,C,_,$),2048&e.$$.dirty[0]&&n(23,ce=function(e){var t={};return e.forEach((function(e){t[hs.exports.compileJSONPointer(e.path)]=e})),e.forEach((function(e){for(var n=e.path;n.length>0;){n=om(n);var r=hs.exports.compileJSONPointer(n);r in t||(t[r]={isChildError:!0,path:n,message:"Contains invalid data"})}})),t}(de)),256&e.$$.dirty[0]&&(r=a?function(e){var t,n;function r(e){return e<20?200:e<50?400:1200}function i(){if(e){var n=.05*t;e.scrollTop+=n}}function o(e){n&&e===t||(a(),wB("startAutoScroll",e),t=e,n=setInterval(i,50))}function a(){n&&(wB("stopAutoScroll"),clearInterval(n),n=void 0,t=void 0)}return wB("createAutoScrollHandler",e),{onDrag:function(t){if(e){var n=t.clientY,i=e.getBoundingClientRect(),s=i.top,u=i.bottom;nu?o(r(n-u)):a()}},onDragEnd:function(){a()}}}(a):void 0),1&e.$$.dirty[0]|203423744&e.$$.dirty[1]|512&e.$$.dirty[2]&&n(12,le={readOnly:b,parser:_,normalization:H,getJson:ge,getDocumentState:ye,findElement:nt,focus:pt,onPatch:ot,onInsert:Le,onExpand:ut,onSelect:V,onFind:ct,onExpandSection:lt,onPasteJson:ft,onRenderValue:A,onContextMenu:ht,onClassName:I||function(){},onDrag:mt,onDragEnd:gt}),4096&e.$$.dirty[0]&&i("context changed",le)},[b,w,j,O,P,T,N,function(){return he&&void 0!==c&&at(c),{json:c,text:l}},a,c,l,de,le,s,u,K,W,J,G,Q,Y,ue,he,ce,o,q,X,function(){return te.apply(this,arguments)},function(){return ne.apply(this,arguments)},function(e,t){return re.apply(this,arguments)},function(e,t){return ie.apply(this,arguments)},function(){n(18,G=!1),n(19,Q=!1),X(""),pt()},function(e){i("select validation error",e),V(Sq(e.path,!1)),et(e.path)},Me,function(e){if(e.preventDefault(),!b){var t=e.clipboardData.getData("text/plain");try{Ne(t)}catch(e){!function(e,t){f(kF,{text:e,onParse:rj,onRepair:ij,onApply:t,onRenderMenu:N},ji(ji({},ts),{},{styleWindow:{width:"600px",height:"500px"},styleContent:{padding:0,height:"100%"}}),{onClose:function(){return pt()}})}(t,(function(e){i("repaired pasted text: ",e),Ne(e)}))}}},Ke,Ge,function(){Qe([])},function(){Ze({selectedPath:[]})},function(){ut([],!0,!0)},function(){ut([],!1,!0)},function(e){var t=Jj(e).replace(/^Command\+/,"Ctrl+"),n=e.shiftKey;if(i("keydown",{combo:t,key:e.key}),"Ctrl+X"===t&&(e.preventDefault(),Ee(!0)),"Ctrl+Shift+X"===t&&(e.preventDefault(),Ee(!1)),"Ctrl+C"===t&&(e.preventDefault(),Me(!0)),"Ctrl+Shift+C"===t&&(e.preventDefault(),Me(!1)),"Ctrl+D"===t&&(e.preventDefault(),Re()),"Delete"!==t&&"Backspace"!==t||(e.preventDefault(),Ie()),"Insert"===t&&(e.preventDefault(),Le("structure")),"Ctrl+A"===t&&(e.preventDefault(),V(Sq([],!1))),"Ctrl+Q"===t&&dt(e),"Up"===t||"Shift+Up"===t){e.preventDefault();var r=K.selection?dq(c,K,n,!0)||K.selection:pq(c,K);V(r),rt(r.focusPath)}if("Down"===t||"Shift+Down"===t){e.preventDefault();var o=K.selection?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=t.selection,o=!r&&uq(i)?Ov(i.paths):i.focusPath,a=ZB(e,t,o),s=a,u=a;if(null===a)return null;if(n){var c=ZB(e,Ns(hs.exports.getIn(e,o))?NB(t,o):t,o);return null===c?null:iq(i)?$q(e,c,c):oq(i)?$q(e,s,u):$q(e,i.anchorPath,c)}if(aq(i)){var l=om(a),f=hs.exports.getIn(e,l);return Array.isArray(f)?Sq(u,!1):xq(u,!1)}return sq(i)?Sq(u,!1):oq(i)?$q(e,s,u):$q(e,a,a)}(c,K,n,!0)||K.selection:pq(c,K);V(o),rt(o.focusPath)}if("Left"===t||"Shift+Left"===t){e.preventDefault();var a=K.selection?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=t.selection,o=vq(e,t,r),a=o.caret,s=o.previous;if(n)return uq(i)?null:$q(e,i.anchorPath,i.focusPath);if(a&&s)return Aq(s);var u=om(i.focusPath),c=hs.exports.getIn(e,u);return sq(i)&&Array.isArray(c)?$q(e,i.focusPath,i.focusPath):uq(i)&&!Array.isArray(c)?xq(i.focusPath,!1):null}(c,K,n,!b)||K.selection:pq(c,K);V(a),rt(a.focusPath)}if("Right"===t||"Shift+Right"===t){e.preventDefault();var s=K.selection?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=t.selection,o=vq(e,t,r),a=o.caret,s=o.next;return n?uq(i)?null:$q(e,i.anchorPath,i.focusPath):a&&s?Aq(s):uq(i)?Sq(i.focusPath,!1):null}(c,K,n,!b)||K.selection:pq(c,K);V(s),rt(s.focusPath)}if("Enter"===t&&K.selection){if(!b&&uq(K.selection)&&1===K.selection.paths.length){var u=K.selection.focusPath,l=hs.exports.getIn(c,om(u));Array.isArray(l)&&V(Sq(u,!1))}if(!b&&aq(K.selection)&&(e.preventDefault(),V(ji(ji({},K.selection),{},{edit:!0}))),sq(K.selection))e.preventDefault(),Ns(hs.exports.getIn(c,K.selection.focusPath))?ut(K.selection.focusPath,!0):b||V(ji(ji({},K.selection),{},{edit:!0}))}if(1===t.replace(/^Shift\+/,"").replace(/^Numpad_/,"").length&&K.selection)return e.preventDefault(),void We(e.key);if("Enter"===t&&(iq(K.selection)||oq(K.selection)))return e.preventDefault(),void We("");if("Ctrl+Enter"===t&&sq(K.selection)){var f=hs.exports.getIn(c,K.selection.focusPath);zs(f)&&window.open(String(f),"_blank")}if("Escape"===t&&K.selection&&(e.preventDefault(),V(void 0)),"Ctrl+F"===t&&(e.preventDefault(),ct(!1)),"Ctrl+H"===t&&(e.preventDefault(),ct(!0)),"Ctrl+Z"===t){e.preventDefault();var h=document.activeElement;h&&h.blur&&h.focus?(h.blur(),setTimeout((function(){Ke(),setTimeout((function(){return h.select()}))}))):Ke()}if("Ctrl+Shift+Z"===t){e.preventDefault();var d=document.activeElement;d&&d.blur&&d.focus?(d.blur(),setTimeout((function(){Ge(),setTimeout((function(){return d.select()}))}))):Ge()}},function(e){i("handleMouseDown",e),setTimeout((function(){setTimeout((function(){g||Tj(e.target,"BUTTON")||(pt(),K.selection||void 0!==c||""!==l&&void 0!==l||xe())}))}))},dt,function(e){b||ht({anchor:Bj(e.target,"BUTTON"),offsetTop:0,width:260,height:336,showTip:!0})},function(){return vt.apply(this,arguments)},function(){i("clear pasted json"),n(17,J=void 0)},function(e){V(e),pt(),et(e.focusPath)},function(e){var t=!Ij(e.target,(function(e){return e===u}));t&&Pq(K.selection)&&(i("click outside the editor, stop edit mode"),V((function(e){return aq(e)||sq(e)?ji(ji({},e),{},{edit:!1}):e})),g&&s&&(s.focus(),s.blur()),aa().then((function(){setTimeout((function(){s&&s.blur()}))})))},k,x,S,_,C,$,E,M,A,I,R,D,L,z,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};i("expand");var t=ji(ji({},K),{},{expandedMap:{},visibleSectionsMap:{}});n(15,K=AB(c,t,q,e))},me,ge,Se,Ze,et,nt,pt,H,Z,function(e){n(18,G=e)},function(e){ea[e?"unshift":"push"]((function(){n(13,s=e)}))},function(e){ea[e?"unshift":"push"]((function(){n(8,a=e)}))},function(e){ea[e?"unshift":"push"]((function(){n(14,u=e)}))}]}var ZH=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,YH,KH,Ki,{readOnly:0,externalContent:49,mainMenuBar:1,navigationBar:2,escapeControlCharacters:50,escapeUnicodeCharacters:51,parser:52,validator:53,validationParser:54,pathParser:3,indentation:55,onError:4,onChange:56,onRenderValue:57,onRequestRepair:5,onRenderMenu:6,onClassName:58,onFocus:59,onBlur:60,onSortModal:61,onTransformModal:62,expand:63,validate:64,getJson:65,patch:66,acceptAutoRepair:7,openTransformModal:67,scrollTo:68,findElement:69,focus:70},DH,[-1,-1,-1,-1,-1]),r}return Li(n,[{key:"expand",get:function(){return this.$$.ctx[63]}},{key:"validate",get:function(){return this.$$.ctx[64]}},{key:"getJson",get:function(){return this.$$.ctx[65]}},{key:"patch",get:function(){return this.$$.ctx[66]}},{key:"acceptAutoRepair",get:function(){return this.$$.ctx[7]}},{key:"openTransformModal",get:function(){return this.$$.ctx[67]}},{key:"scrollTo",get:function(){return this.$$.ctx[68]}},{key:"findElement",get:function(){return this.$$.ctx[69]}},{key:"focus",get:function(){return this.$$.ctx[70]}}]),n}(),XH={id:"javascript",name:"JavaScript",description:"\n

    \n Enter a JavaScript function to filter, sort, or transform the data.\n

    \n",createQuery:function(e,t){var n=t.filter,r=t.sort,i=t.projection,o=[];if(n&&n.path&&n.relation&&n.value){var a="item => item".concat($S(n.path)),s=rq(n.value),u="string"==typeof s?"'".concat(n.value,"'"):qs(n.value)&&!Number.isSafeInteger(s)?"".concat(n.value,"n"):n.value;o.push(" data = data.filter(".concat(a," ").concat(n.relation," ").concat(u,")\n"))}r&&r.path&&r.direction&&("desc"===r.direction?o.push(" data = data.slice().sort((a, b) => {\n // sort descending\n"+" const valueA = a".concat($S(r.path),"\n")+" const valueB = b".concat($S(r.path),"\n")+" return valueA > valueB ? -1 : valueA < valueB ? 1 : 0\n })\n"):o.push(" data = data.slice().sort((a, b) => {\n // sort ascending\n"+" const valueA = a".concat($S(r.path),"\n")+" const valueB = b".concat($S(r.path),"\n")+" return valueA > valueB ? 1 : valueA < valueB ? -1 : 0\n })\n"));if(i&&i.paths)if(i.paths.length>1){var c=i.paths.map((function(e){var t=e[e.length-1]||"item",n="item".concat($S(e));return" ".concat(JSON.stringify(t),": ").concat(n)}));o.push(" data = data.map(item => ({\n".concat(c.join(",\n"),"})\n )\n"))}else{var l="item".concat($S(i.paths[0]));o.push(" data = data.map(item => ".concat(l,")\n"))}return o.push(" return data\n"),"function query (data) {\n".concat(o.join(""),"}")},executeQuery:function(e,t){var n=new Function('"use strict";\n\n'+t+'\n\nif (typeof query !== "function") {\n throw new Error("Cannot execute query: expecting a function named \'query\' but is undefined")\n}\n\nreturn query;\n')()(e);return void 0!==n?n:null}};function eJ(e){co(e,"svelte-zs5o25",".jse-boolean-toggle.svelte-zs5o25{color:var(--jse-value-color-boolean);position:relative;padding-left:calc(0.5 * var(--jse-padding));padding-top:1px;height:var(--jse-line-height)}")}function tJ(e){var t,n,r,i,o,a;return n=new hS({props:{data:!0===e[0]?MF:AF}}),{c:function(){t=go("div"),Pa(n.$$.fragment),So(t,"class","jse-boolean-toggle svelte-zs5o25"),So(t,"title",r=e[1]?"Boolean value ".concat(e[0]):"Click to toggle this boolean value")},m:function(r,s){vo(r,t,s),Ma(n,t,null),i=!0,o||(a=jo(t,"mousedown",e[2]),o=!0)},p:function(e,o){var a=ki(o,1)[0],s={};1&a&&(s.data=!0===e[0]?MF:AF),n.$set(s),(!i||3&a&&r!==(r=e[1]?"Boolean value ".concat(e[0]):"Click to toggle this boolean value"))&&So(t,"title",r)},i:function(e){i||(ba(n.$$.fragment,e),i=!0)},o:function(e){ka(n.$$.fragment,e),i=!1},d:function(e){e&&po(t),Aa(n),o=!1,a()}}}function nJ(e,t,n){var r=t.path,i=t.value,o=t.readOnly,a=t.onPatch,s=t.focus;return e.$$set=function(e){"path"in e&&n(3,r=e.path),"value"in e&&n(0,i=e.value),"readOnly"in e&&n(1,o=e.readOnly),"onPatch"in e&&n(4,a=e.onPatch),"focus"in e&&n(5,s=e.focus)},[i,o,function(e){e.stopPropagation(),o||(a([{op:"replace",path:hs.exports.compileJSONPointer(r),value:!i}]),setTimeout(s))},r,a,s]}var rJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,nJ,tJ,Ki,{path:3,value:0,readOnly:1,onPatch:4,focus:5},eJ),r}return Li(n)}();function iJ(e){co(e,"svelte-1gn8yt9",".jse-color-picker-popup.svelte-1gn8yt9 .picker_wrapper.popup,.jse-color-picker-popup.svelte-1gn8yt9 .picker_wrapper.popup .picker_arrow::before,.jse-color-picker-popup.svelte-1gn8yt9 .picker_wrapper.popup .picker_arrow::after{background:var(--jse-color-picker-background);line-height:normal}.jse-color-picker-popup.svelte-1gn8yt9 .picker_slider,.jse-color-picker-popup.svelte-1gn8yt9 .picker_sl,.jse-color-picker-popup.svelte-1gn8yt9 .picker_editor input,.jse-color-picker-popup.svelte-1gn8yt9 .picker_sample,.jse-color-picker-popup.svelte-1gn8yt9 .picker_done button{box-shadow:var(--jse-color-picker-border-box-shadow)}.jse-color-picker-popup.svelte-1gn8yt9 .picker_editor input{background:var(--jse-background-color);color:var(--jse-text-color)}.jse-color-picker-popup.svelte-1gn8yt9 .picker_done button{background:var(--jse-button-background);color:var(--jse-button-color)}.jse-color-picker-popup.svelte-1gn8yt9 .picker_done button:hover{background:var(--jse-button-background-highlight)}")}function oJ(e){var t;return{c:function(){So(t=go("div"),"class","jse-color-picker-popup svelte-1gn8yt9")},m:function(n,r){vo(n,t,r),e[4](t)},p:Bi,i:Bi,o:Bi,d:function(n){n&&po(t),e[4](null)}}}function aJ(e,t,n){var r,i,o=t.color,a=t.onChange,s=t.showOnTop;return Ko(yi(mi().mark((function e(){var t;return mi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.resolve().then((function(){return hG}));case 2:t=e.sent.default,i=new t({parent:r,color:o,popup:s?"top":"bottom",onDone:function(e){var t=1===e.rgba[3]?e.hex.substring(0,7):e.hex;a(t)}}),i.show();case 5:case"end":return e.stop()}}),e)})))),Go((function(){i&&i.destroy()})),e.$$set=function(e){"color"in e&&n(1,o=e.color),"onChange"in e&&n(2,a=e.onChange),"showOnTop"in e&&n(3,s=e.showOnTop)},[r,o,a,s,function(e){ea[e?"unshift":"push"]((function(){n(0,r=e)}))}]}var sJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,aJ,oJ,Ui,{color:1,onChange:2,showOnTop:3},iJ),r}return Li(n)}();function uJ(e){co(e,"svelte-fk1u9y",".jse-color-picker-button.svelte-fk1u9y{font-size:var(--jse-font-size-mono);width:var(--jse-color-picker-button-size);height:var(--jse-color-picker-button-size);box-sizing:border-box;padding:0;margin:2px;border:1px solid var(--jse-text-color);border-radius:2px;background:inherit;outline:none;cursor:pointer}")}function cJ(e){var t,n,r,i;return{c:function(){So(t=go("button"),"type","button"),So(t,"class","jse-color-picker-button svelte-fk1u9y"),Mo(t,"background",e[2]),So(t,"title",n=e[1]?"Color ".concat(e[0]):"Click to open a color picker")},m:function(n,o){vo(n,t,o),r||(i=jo(t,"click",e[3]),r=!0)},p:function(e,r){var i=ki(r,1)[0];4&i&&Mo(t,"background",e[2]),3&i&&n!==(n=e[1]?"Color ".concat(e[0]):"Click to open a color picker")&&So(t,"title",n)},i:Bi,o:Bi,d:function(e){e&&po(t),r=!1,i()}}}function lJ(e,t,n){var r,i=Zo("absolute-popup").openAbsolutePopup,o=t.path,a=t.value,s=t.readOnly,u=t.onPatch,c=t.focus;function l(e){u([{op:"replace",path:hs.exports.compileJSONPointer(o),value:e}]),f()}function f(){c()}return e.$$set=function(e){"path"in e&&n(4,o=e.path),"value"in e&&n(0,a=e.value),"readOnly"in e&&n(1,s=e.readOnly),"onPatch"in e&&n(5,u=e.onPatch),"focus"in e&&n(6,c=e.focus)},e.$$.update=function(){1&e.$$.dirty&&n(2,r=Rs(a))},[a,s,r,function(e){if(!s){var t=e.target.getBoundingClientRect().top,n=Lj(e.target).innerHeight;i(sJ,{color:a,onChange:l,showOnTop:n-t<300&&t>300},{anchor:e.target,closeOnOuterClick:!0,onClose:f,offsetTop:18,offsetLeft:-8,height:300})}},o,u,c]}var fJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,lJ,cJ,Ki,{path:4,value:0,readOnly:1,onPatch:5,focus:6},uJ),r}return Li(n)}();function hJ(e,t){var n=Ds(e,t);return VF("jse-value","jse-"+n,{"jse-url":zs(e),"jse-empty":"string"==typeof e&&0===e.length})}function dJ(e){var t,n;return t=new dV({props:{value:e[1].escapeValue(e[0]),onChange:e[3],onCancel:e[4],onPaste:e[5],onFind:e[2],onValueClass:e[6]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r=ki(n,1)[0],i={};3&r&&(i.value=e[1].escapeValue(e[0])),4&r&&(i.onFind=e[2]),t.$set(i)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function vJ(e,t,n){var r=t.path,i=t.value,o=t.parser,a=t.normalization,s=t.enforceString,u=t.onPatch,c=t.onPasteJson,l=t.onSelect,f=t.onFind,h=t.focus;function d(e){return s?e:Bs(e,o)}return e.$$set=function(e){"path"in e&&n(7,r=e.path),"value"in e&&n(0,i=e.value),"parser"in e&&n(8,o=e.parser),"normalization"in e&&n(1,a=e.normalization),"enforceString"in e&&n(9,s=e.enforceString),"onPatch"in e&&n(10,u=e.onPatch),"onPasteJson"in e&&n(11,c=e.onPasteJson),"onSelect"in e&&n(12,l=e.onSelect),"onFind"in e&&n(2,f=e.onFind),"focus"in e&&n(13,h=e.focus)},[i,a,f,function(e,t){u([{op:"replace",path:hs.exports.compileJSONPointer(r),value:d(a.unescapeValue(e))}],(function(e,n){var i=t===us?function(e,t,n){var r=om(n),i=[Ov(n)],o=ZB(hs.exports.getIn(e,r),t,i);return o?Sq(r.concat(o),!1):Cq(n)}(e,n,r)||n.selection:Sq(r,!1);return{state:ji(ji({},n),{},{selection:i})}})),t!==ss&&h()},function(){l(Sq(r,!1)),h()},function(e){try{var t=o.parse(e);Ns(t)&&c({path:r,contents:t})}catch(e){}},function(e){return hJ(d(a.unescapeValue(e)),o)},r,o,s,u,c,l,h]}var pJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,vJ,dJ,Ki,{path:7,value:0,parser:8,normalization:1,enforceString:9,onPatch:10,onPasteJson:11,onSelect:12,onFind:2,focus:13}),r}return Li(n)}();function mJ(e){co(e,"svelte-6ci2p7",'.jse-value.jse-string.svelte-6ci2p7{color:var(--jse-value-color-string)}.jse-value.jse-object.svelte-6ci2p7,.jse-value.jse-array.svelte-6ci2p7{min-width:16px;color:var(--jse-delimiter-color)}.jse-value.jse-number.svelte-6ci2p7{color:var(--jse-value-color-number)}.jse-value.jse-boolean.svelte-6ci2p7{color:var(--jse-value-color-boolean)}.jse-value.jse-null.svelte-6ci2p7{color:var(--jse-value-color-null)}.jse-value.jse-invalid.svelte-6ci2p7{color:var(--jse-text-color)}.jse-value.jse-url.svelte-6ci2p7{color:var(--jse-value-color-url);text-decoration:underline}.jse-value.svelte-6ci2p7{min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;word-break:normal;overflow-wrap:anywhere;white-space:pre-wrap}.jse-value.svelte-6ci2p7:hover{background:var(--jse-hover-background-color)}.jse-value.jse-empty.svelte-6ci2p7{min-width:4em;outline:1px dotted var(--jse-tag-background);-moz-outline-radius:2px}.jse-value.jse-empty.svelte-6ci2p7::after{pointer-events:none;color:var(--jse-tag-background);content:"value"}')}function gJ(e){var t,n=Aj(e[1].escapeValue(e[0]))+"";return{c:function(){t=bo(n)},m:function(e,n){vo(e,t,n)},p:function(e,r){3&r&&n!==(n=Aj(e[1].escapeValue(e[0]))+"")&&Eo(t,n)},i:Bi,o:Bi,d:function(e){e&&po(t)}}}function yJ(e){var t,n;return t=new cV({props:{text:e[1].escapeValue(e[0]),searchResultItems:e[3]}}),{c:function(){Pa(t.$$.fragment)},m:function(e,r){Ma(t,e,r),n=!0},p:function(e,n){var r={};3&n&&(r.text=e[1].escapeValue(e[0])),8&n&&(r.searchResultItems=e[3]),t.$set(r)},i:function(e){n||(ba(t.$$.fragment,e),n=!0)},o:function(e){ka(t.$$.fragment,e),n=!1},d:function(e){Aa(t,e)}}}function bJ(e){var t,n,r,i,o,a,s,u,c=[yJ,gJ],l=[];function f(e,t){return e[3]?0:1}return n=f(e),r=l[n]=c[n](e),{c:function(){t=go("div"),r.c(),So(t,"data-type","selectable-value"),So(t,"class",i=eo(hJ(e[0],e[2]))+" svelte-6ci2p7"),So(t,"title",o=e[4]?"Ctrl+Click or Ctrl+Enter to open url in new window":null)},m:function(r,i){vo(r,t,i),l[n].m(t,null),a=!0,s||(u=[jo(t,"click",e[5]),jo(t,"dblclick",e[6])],s=!0)},p:function(e,s){var u=ki(s,1)[0],h=n;(n=f(e))===h?l[n].p(e,u):(ga(),ka(l[h],1,1,(function(){l[h]=null})),ya(),(r=l[n])?r.p(e,u):(r=l[n]=c[n](e)).c(),ba(r,1),r.m(t,null)),(!a||5&u&&i!==(i=eo(hJ(e[0],e[2]))+" svelte-6ci2p7"))&&So(t,"class",i),(!a||16&u&&o!==(o=e[4]?"Ctrl+Click or Ctrl+Enter to open url in new window":null))&&So(t,"title",o)},i:function(e){a||(ba(r),a=!0)},o:function(e){ka(r),a=!1},d:function(e){e&&po(t),l[n].d(),s=!1,Hi(u)}}}function kJ(e,t,n){var r,i=t.path,o=t.value,a=t.readOnly,s=t.normalization,u=t.parser,c=t.onSelect,l=t.searchResultItems;return e.$$set=function(e){"path"in e&&n(7,i=e.path),"value"in e&&n(0,o=e.value),"readOnly"in e&&n(8,a=e.readOnly),"normalization"in e&&n(1,s=e.normalization),"parser"in e&&n(2,u=e.parser),"onSelect"in e&&n(9,c=e.onSelect),"searchResultItems"in e&&n(3,l=e.searchResultItems)},e.$$.update=function(){1&e.$$.dirty&&n(4,r=zs(o))},[o,s,u,l,r,function(e){"string"==typeof o&&r&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),window.open(o,"_blank"))},function(e){a||(e.preventDefault(),c(Sq(i,!0)))},i,a,c]}var wJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,kJ,bJ,Ki,{path:7,value:0,readOnly:8,normalization:1,parser:2,onSelect:9,searchResultItems:3},mJ),r}return Li(n)}();function jJ(e){co(e,"svelte-1u00zub",".jse-timestamp.svelte-1u00zub{padding:0;margin:0;height:var(--jse-line-height);color:var(--jse-value-color-number);border-radius:3px}")}function xJ(e){var t,n,r,i,o,a;return n=new hS({props:{data:TF}}),{c:function(){t=go("div"),Pa(n.$$.fragment),So(t,"class","jse-timestamp svelte-1u00zub")},m:function(s,u){vo(s,t,u),Ma(n,t,null),i=!0,o||(a=to(r=IV.call(null,t,ji({text:e[0]},e[1]))),o=!0)},p:function(e,t){var n=ki(t,1)[0];r&&Ji(r.update)&&1&n&&r.update.call(null,ji({text:e[0]},e[1]))},i:function(e){i||(ba(n.$$.fragment,e),i=!0)},o:function(e){ka(n.$$.fragment,e),i=!1},d:function(e){e&&po(t),Aa(n),o=!1,a()}}}function SJ(e,t,n){var r,i=Zo("absolute-popup"),o=t.value;return e.$$set=function(e){"value"in e&&n(2,o=e.value)},e.$$.update=function(){4&e.$$.dirty&&n(0,r="Time: ".concat(new Date(o).toString()))},[r,i,o]}var _J=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,SJ,xJ,Ki,{value:2},jJ),r}return Li(n)}();function CJ(e){var t=e.path,n=e.value,r=e.readOnly,i=e.enforceString,o=e.searchResultItems,a=e.isEditing,s=e.parser,u=e.normalization,c=e.onPatch,l=e.onPasteJson,f=e.onSelect,h=e.onFind,d=e.focus,v=[];return!a&&function(e){return!0===e||!1===e}(n)&&v.push({component:rJ,props:{path:t,value:n,readOnly:r,onPatch:c,focus:d}}),!a&&function(e){return"string"==typeof e&&!!Rs(e)}(n)&&v.push({component:fJ,props:{path:t,value:n,readOnly:r,onPatch:c,focus:d}}),a&&v.push({component:pJ,props:{path:t,value:n,enforceString:i,parser:s,normalization:u,onPatch:c,onPasteJson:l,onSelect:f,onFind:h,focus:d}}),a||v.push({component:wJ,props:{path:t,value:n,readOnly:r,parser:s,normalization:u,searchResultItems:o,onSelect:f}}),!a&&Is(n)&&v.push({component:_J,props:{value:n}}),v}var $J={};function OJ(e){co(e,"svelte-3e0qet",".item.svelte-3e0qet{cursor:default;height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--itemPadding, 0 20px);color:var(--itemColor, inherit);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.groupHeader.svelte-3e0qet{text-transform:var(--groupTitleTextTransform, uppercase)}.groupItem.svelte-3e0qet{padding-left:var(--groupItemPaddingLeft, 40px)}.item.svelte-3e0qet:active{background:var(--itemActiveBackground, #b9daff)}.item.active.svelte-3e0qet{background:var(--itemIsActiveBG, #007aff);color:var(--itemIsActiveColor, #fff)}.item.notSelectable.svelte-3e0qet{color:var(--itemIsNotSelectableColor, #999)}.item.first.svelte-3e0qet{border-radius:var(--itemFirstBorderRadius, 4px 4px 0 0)}.item.hover.svelte-3e0qet:not(.active){background:var(--itemHoverBG, #e7f2ff);color:var(--itemHoverColor, inherit)}")}function EJ(e){var t,n,r=e[0](e[1],e[2])+"";return{c:function(){So(t=go("div"),"class",n="item "+e[3]+" svelte-3e0qet")},m:function(e,n){vo(e,t,n),t.innerHTML=r},p:function(e,i){var o=ki(i,1)[0];7&o&&r!==(r=e[0](e[1],e[2])+"")&&(t.innerHTML=r),8&o&&n!==(n="item "+e[3]+" svelte-3e0qet")&&So(t,"class",n)},i:Bi,o:Bi,d:function(e){e&&po(t)}}}function PJ(e,t,n){var r=t.isActive,i=void 0!==r&&r,o=t.isFirst,a=void 0!==o&&o,s=t.isHover,u=void 0!==s&&s,c=t.isSelectable,l=void 0!==c&&c,f=t.getOptionLabel,h=void 0===f?void 0:f,d=t.item,v=void 0===d?void 0:d,p=t.filterText,m=void 0===p?"":p,g="";return e.$$set=function(e){"isActive"in e&&n(4,i=e.isActive),"isFirst"in e&&n(5,a=e.isFirst),"isHover"in e&&n(6,u=e.isHover),"isSelectable"in e&&n(7,l=e.isSelectable),"getOptionLabel"in e&&n(0,h=e.getOptionLabel),"item"in e&&n(1,v=e.item),"filterText"in e&&n(2,m=e.filterText)},e.$$.update=function(){if(242&e.$$.dirty){var t=[];i&&t.push("active"),a&&t.push("first"),u&&t.push("hover"),v.isGroupHeader&&t.push("groupHeader"),v.isGroupItem&&t.push("groupItem"),l||t.push("notSelectable"),n(3,g=t.join(" "))}},[h,v,m,g,i,a,u,l]}var MJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,PJ,EJ,Ui,{isActive:4,isFirst:5,isHover:6,isSelectable:7,getOptionLabel:0,item:1,filterText:2},OJ),r}return Li(n)}();function AJ(e){co(e,"svelte-1uyqfml",".listContainer.svelte-1uyqfml{box-shadow:var(--listShadow, 0 2px 3px 0 rgba(44, 62, 80, 0.24));border-radius:var(--listBorderRadius, 4px);max-height:var(--listMaxHeight, 250px);overflow-y:auto;background:var(--listBackground, #fff);border:var(--listBorder, none);position:var(--listPosition, absolute);z-index:var(--listZIndex, 2);width:100%;left:var(--listLeft, 0);right:var(--listRight, 0)}.virtualList.svelte-1uyqfml{height:var(--virtualListHeight, 200px)}.listGroupTitle.svelte-1uyqfml{color:var(--groupTitleColor, #8f8f8f);cursor:default;font-size:var(--groupTitleFontSize, 12px);font-weight:var(--groupTitleFontWeight, 600);height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--groupTitlePadding, 0 20px);text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:var(--groupTitleTextTransform, uppercase)}.empty.svelte-1uyqfml{text-align:var(--listEmptyTextAlign, center);padding:var(--listEmptyPadding, 20px 0);color:var(--listEmptyColor, #78848f)}")}function TJ(e,t,n){var r=e.slice();return r[41]=t[n],r[42]=n,r}function NJ(e){for(var t,n,r=e[1],i=[],o=0;o0&&_===p.length-1?n(2,_=0):n(2,t<0&&0===_?_=p.length-1:_+=t),r=!JJ(p[_]);return e.next=6,aa();case 6:ne("hover");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(e){if(!d&&s){var t,r=s.querySelector(".listItem .".concat(e));r&&(t=s.getBoundingClientRect().bottom-r.getBoundingClientRect().bottom),n(0,s.scrollTop-=t,s)}}function re(){var e=q.getBoundingClientRect(),t=e.height,r=e.width;n(14,i=""),n(14,i+="min-width:".concat(r,"px;width:").concat(H?"auto":"100%",";")),"top"===V||"auto"===V&&function(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={};return i.top=n.top<0,i.left=n.left<0,i.bottom=n.bottom+r.height>(window.innerHeight||document.documentElement.clientHeight),i.right=n.right>(window.innerWidth||document.documentElement.clientWidth),i.any=i.top||i.left||i.bottom||i.right,i}(q,s).bottom?n(14,i+="bottom:".concat(t+U,"px;")):n(14,i+="top:".concat(t+U,"px;"))}Ko((function(){if(p.length>0&&!I&&$){var e=p.findIndex((function(e){return e[E]===$[E]}));e&&n(2,_=e)}ne("active"),s.addEventListener("scroll",(function(){clearTimeout(K),K=setTimeout((function(){G=!1}),100)}),!1)})),Uo((function(){p||n(1,p=[]),p!==r&&p.length>0&&n(2,_=0),r=p}));return e.$$set=function(e){"container"in e&&n(0,s=e.container),"VirtualList"in e&&n(3,c=e.VirtualList),"Item"in e&&n(4,f=e.Item),"isVirtualList"in e&&n(5,d=e.isVirtualList),"items"in e&&n(1,p=e.items),"labelIdentifier"in e&&n(20,g=e.labelIdentifier),"getOptionLabel"in e&&n(6,b=e.getOptionLabel),"getGroupHeaderLabel"in e&&n(7,w=e.getGroupHeaderLabel),"itemHeight"in e&&n(8,x=e.itemHeight),"hoverItemIndex"in e&&n(2,_=e.hoverItemIndex),"value"in e&&n(9,$=e.value),"optionIdentifier"in e&&n(10,E=e.optionIdentifier),"hideEmptyState"in e&&n(11,M=e.hideEmptyState),"noOptionsMessage"in e&&n(12,T=e.noOptionsMessage),"isMulti"in e&&n(21,I=e.isMulti),"activeItemIndex"in e&&n(19,D=e.activeItemIndex),"filterText"in e&&n(13,z=e.filterText),"parent"in e&&n(22,q=e.parent),"listPlacement"in e&&n(23,V=e.listPlacement),"listAutoWidth"in e&&n(24,H=e.listAutoWidth),"listOffset"in e&&n(25,U=e.listOffset)},e.$$.update=function(){4194305&e.$$.dirty[0]&&q&&s&&re()},[s,p,_,c,f,d,b,w,x,$,E,M,T,z,i,Y,Z,function(e){switch(e.key){case"Escape":e.preventDefault(),X();break;case"ArrowDown":e.preventDefault(),p.length&&ee(1);break;case"ArrowUp":e.preventDefault(),p.length&&ee(-1);break;case"Enter":if(e.preventDefault(),0===p.length)break;var t=p[_];if($&&!I&&$[E]===t[E]){X();break}t.isCreator?o("itemCreated",z):(n(19,D=_),Q(p[_]));break;case"Tab":if(e.preventDefault(),0===p.length)return X();if($&&$[E]===p[_][E])return X();n(19,D=_),Q(p[_])}},re,D,g,I,q,V,H,U,function(e){return Y(e)},function(e){return Y(e)},function(e,t,n){return Z({item:e,i:t,event:n})},function(e){return Y(e)},function(e){return Y(e)},function(e,t,n){return Z({item:e,i:t,event:n})},function(e){ea[e?"unshift":"push"]((function(){n(0,s=e)}))}]}var KJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,UJ,FJ,Ui,{container:0,VirtualList:3,Item:4,isVirtualList:5,items:1,labelIdentifier:20,getOptionLabel:6,getGroupHeaderLabel:7,itemHeight:8,hoverItemIndex:2,value:9,optionIdentifier:10,hideEmptyState:11,noOptionsMessage:12,isMulti:21,activeItemIndex:19,filterText:13,parent:22,listPlacement:23,listAutoWidth:24,listOffset:25},AJ,[-1,-1]),r}return Li(n)}();function GJ(e){co(e,"svelte-pu1q1n",".selection.svelte-pu1q1n{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap}")}function QJ(e){var t,n=e[0](e[1])+"";return{c:function(){So(t=go("div"),"class","selection svelte-pu1q1n")},m:function(e,r){vo(e,t,r),t.innerHTML=n},p:function(e,r){3&ki(r,1)[0]&&n!==(n=e[0](e[1])+"")&&(t.innerHTML=n)},i:Bi,o:Bi,d:function(e){e&&po(t)}}}function YJ(e,t,n){var r=t.getSelectionLabel,i=void 0===r?void 0:r,o=t.item,a=void 0===o?void 0:o;return e.$$set=function(e){"getSelectionLabel"in e&&n(0,i=e.getSelectionLabel),"item"in e&&n(1,a=e.item)},[i,a]}var ZJ=function(e){Ci(n,Ia);var t=Oi(n);function n(e){var r;return Ri(this,n),Na(Pi(r=t.call(this)),e,YJ,QJ,Ui,{getSelectionLabel:0,item:1},GJ),r}return Li(n)}();function XJ(e){co(e,"svelte-liu9pa",".multiSelectItem.svelte-liu9pa.svelte-liu9pa{background:var(--multiItemBG, #ebedef);margin:var(--multiItemMargin, 5px 5px 0 0);border-radius:var(--multiItemBorderRadius, 16px);height:var(--multiItemHeight, 32px);line-height:var(--multiItemHeight, 32px);display:flex;cursor:default;padding:var(--multiItemPadding, 0 10px 0 15px);max-width:100%}.multiSelectItem_label.svelte-liu9pa.svelte-liu9pa{margin:var(--multiLabelMargin, 0 5px 0 0);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multiSelectItem.svelte-liu9pa.svelte-liu9pa:hover,.multiSelectItem.active.svelte-liu9pa.svelte-liu9pa{background-color:var(--multiItemActiveBG, #006fff);color:var(--multiItemActiveColor, #fff)}.multiSelectItem.disabled.svelte-liu9pa.svelte-liu9pa:hover{background:var(--multiItemDisabledHoverBg, #ebedef);color:var(--multiItemDisabledHoverColor, #c1c6cc)}.multiSelectItem_clear.svelte-liu9pa.svelte-liu9pa{border-radius:var(--multiClearRadius, 50%);background:var(--multiClearBG, #52616f);min-width:var(--multiClearWidth, 16px);max-width:var(--multiClearWidth, 16px);height:var(--multiClearHeight, 16px);position:relative;top:var(--multiClearTop, 8px);text-align:var(--multiClearTextAlign, center);padding:var(--multiClearPadding, 1px)}.multiSelectItem_clear.svelte-liu9pa.svelte-liu9pa:hover,.active.svelte-liu9pa .multiSelectItem_clear.svelte-liu9pa{background:var(--multiClearHoverBG, #fff)}.multiSelectItem_clear.svelte-liu9pa:hover svg.svelte-liu9pa,.active.svelte-liu9pa .multiSelectItem_clear svg.svelte-liu9pa{fill:var(--multiClearHoverFill, #006fff)}.multiSelectItem_clear.svelte-liu9pa svg.svelte-liu9pa{fill:var(--multiClearFill, #ebedef);vertical-align:top}")}function eU(e,t,n){var r=e.slice();return r[9]=t[n],r[11]=n,r}function tU(e){var t,n,r;function i(){for(var t,n=arguments.length,r=new Array(n),i=0;i