From 90f19a2f29742cbe2f95fa4fd324d79acda15bc4 Mon Sep 17 00:00:00 2001 From: Juice10 Date: Thu, 13 Jun 2024 20:17:56 +0000 Subject: [PATCH] deploy: 557ee3a3484b1e5743085a568d6dbde1d5438d66 --- assets/{main.e25f77d0.js => main.f5e5a22a.js} | 2 +- assets/{play.50a49902.js => play.3cf94943.js} | 82 +++++++++---------- assets/populate-versions.01ca0e03.js | 1 + assets/populate-versions.b01ef36d.js | 1 - index.html | 4 +- play/index.html | 4 +- 6 files changed, 47 insertions(+), 47 deletions(-) rename assets/{main.e25f77d0.js => main.f5e5a22a.js} (60%) rename assets/{play.50a49902.js => play.3cf94943.js} (85%) create mode 100644 assets/populate-versions.01ca0e03.js delete mode 100644 assets/populate-versions.b01ef36d.js diff --git a/assets/main.e25f77d0.js b/assets/main.f5e5a22a.js similarity index 60% rename from assets/main.e25f77d0.js rename to assets/main.f5e5a22a.js index e94026c..7fa53e1 100644 --- a/assets/main.e25f77d0.js +++ b/assets/main.f5e5a22a.js @@ -1 +1 @@ -import{p as o}from"./populate-versions.b01ef36d.js";function e(){o(),console.log("Welcome to rrwebdebug.com!")}document.addEventListener("DOMContentLoaded",e); +import{p as o}from"./populate-versions.01ca0e03.js";function e(){o(),console.log("Welcome to rrwebdebug.com!")}document.addEventListener("DOMContentLoaded",e); diff --git a/assets/play.50a49902.js b/assets/play.3cf94943.js similarity index 85% rename from assets/play.50a49902.js rename to assets/play.3cf94943.js index a2671ba..288c2a4 100644 --- a/assets/play.50a49902.js +++ b/assets/play.3cf94943.js @@ -1,51 +1,51 @@ -var S6=Object.defineProperty,C6=Object.defineProperties;var O6=Object.getOwnPropertyDescriptors;var i1=Object.getOwnPropertySymbols;var M6=Object.prototype.hasOwnProperty,E6=Object.prototype.propertyIsEnumerable;var o1=(n,e,t)=>e in n?S6(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Tr=(n,e)=>{for(var t in e||(e={}))M6.call(e,t)&&o1(n,t,e[t]);if(i1)for(var t of i1(e))E6.call(e,t)&&o1(n,t,e[t]);return n},gs=(n,e)=>C6(n,O6(e));var A6=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);import{v as t$,p as T6}from"./populate-versions.b01ef36d.js";var rQ=A6((Si,Ci)=>{function Nn(n){return Array.isArray(n)}function Gn(n){return n!==null&&typeof n=="object"&&(n.constructor===void 0||n.constructor.name==="Object")}function n$(n){return n&&typeof n=="object"?n.op==="add":!1}function r$(n){return n&&typeof n=="object"?n.op==="remove":!1}function Gg(n){return n&&typeof n=="object"?n.op==="replace":!1}function om(n){return n&&typeof n=="object"?n.op==="copy":!1}function ll(n){return n&&typeof n=="object"?n.op==="move":!1}function P6(n,e){return JSON.stringify(n)===JSON.stringify(e)}function _6(n,e){return n===e}function i$(n){return n.slice(0,n.length-1)}function R6(n){return n[n.length-1]}function N6(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_6;if(n.length{e[t]=n[t]}),e}else if(Gn(n)){const e=Tr({},n);return Object.getOwnPropertySymbols(n).forEach(t=>{e[t]=n[t]}),e}else return n}function Yg(n,e,t){if(n[e]===t)return n;{const r=Qg(n);return r[e]=t,r}}function Ye(n,e){let t=n,r=0;for(;r3&&arguments[3]!==void 0?arguments[3]:!1;if(e.length===0)return t;const i=e[0],o=Xi(n?n[i]:void 0,e.slice(1),t,r);if(Gn(n)||Nn(n))return Yg(n,i,o);if(r){const s=I6.test(i)?[]:{};return s[i]=o,s}else throw new Error("Path does not exist")}const I6=/^\d+$/;function s$(n,e,t){if(e.length===0)return t(n);if(!o$(n))throw new Error("Path doesn't exist");const r=e[0],i=s$(n[r],e.slice(1),t);return Yg(n,r,i)}function Xg(n,e){if(e.length===0)return n;if(!o$(n))throw new Error("Path does not exist");if(e.length===1){const i=e[0];if(i in n){const o=Qg(n);return Nn(o)&&o.splice(parseInt(i),1),Gn(o)&&delete o[i],o}else return n}const t=e[0],r=Xg(n[t],e.slice(1));return Yg(n,t,r)}function Zg(n,e,t){const r=e.slice(0,e.length-1),i=e[e.length-1];return s$(n,r,o=>{if(!Array.isArray(o))throw new TypeError("Array expected at path "+JSON.stringify(r));const s=Qg(o);return s.splice(parseInt(i),0,t),s})}function Ii(n,e){return n===void 0?!1:e.length===0?!0:n===null?!1:Ii(n[e[0]],e.slice(1))}function ao(n){const e=n.split("/");return e.shift(),e.map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Ue(n){return n.map(ev).join("")}function ev(n){return"/"+String(n).replace(/~/g,"~0").replace(/\//g,"~1")}function s1(n,e){return n+ev(e)}function lh(n,e){return n.startsWith(e)&&(n.length===e.length||n[e.length]==="/")}function ro(n,e,t){let r=n;for(let i=0;i{let a;const l=Eo(o,s.path);if(s.op==="add")a=u$(o,l);else if(s.op==="remove")a=c$(o,l);else if(s.op==="replace")a=l$(o,l);else if(s.op==="copy")a=U6(o,l);else if(s.op==="move")a=W6(o,l,sm(s.from));else if(s.op==="test")a=[];else throw new Error("Unknown JSONPatch operation "+JSON.stringify(s));let c;if(t&&t.before){const u=t.before(o,s,a);if(u&&u.revertOperations&&(a=u.revertOperations),u&&u.document&&(c=u.document),u&&u.json)throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"')}if(r=a.concat(r),c!==void 0)return{document:c}}}),r}function l$(n,e){return[{op:"replace",path:Ue(e),value:Ye(n,e)}]}function c$(n,e){return[{op:"add",path:Ue(e),value:Ye(n,e)}]}function u$(n,e){return vu(n,e)||!Ii(n,e)?[{op:"remove",path:Ue(e)}]:l$(n,e)}function U6(n,e){return u$(n,e)}function W6(n,e,t){if(e.lengthe in n?S6(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Tr=(n,e)=>{for(var t in e||(e={}))M6.call(e,t)&&s1(n,t,e[t]);if(o1)for(var t of o1(e))E6.call(e,t)&&s1(n,t,e[t]);return n},gs=(n,e)=>C6(n,O6(e));var A6=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);import{v as Gg,p as T6}from"./populate-versions.01ca0e03.js";var iQ=A6((Si,Ci)=>{function Nn(n){return Array.isArray(n)}function Gn(n){return n!==null&&typeof n=="object"&&(n.constructor===void 0||n.constructor.name==="Object")}function n$(n){return n&&typeof n=="object"?n.op==="add":!1}function r$(n){return n&&typeof n=="object"?n.op==="remove":!1}function Qg(n){return n&&typeof n=="object"?n.op==="replace":!1}function om(n){return n&&typeof n=="object"?n.op==="copy":!1}function ll(n){return n&&typeof n=="object"?n.op==="move":!1}function P6(n,e){return JSON.stringify(n)===JSON.stringify(e)}function _6(n,e){return n===e}function i$(n){return n.slice(0,n.length-1)}function R6(n){return n[n.length-1]}function N6(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_6;if(n.length{e[t]=n[t]}),e}else if(Gn(n)){const e=Tr({},n);return Object.getOwnPropertySymbols(n).forEach(t=>{e[t]=n[t]}),e}else return n}function Xg(n,e,t){if(n[e]===t)return n;{const r=Yg(n);return r[e]=t,r}}function Ye(n,e){let t=n,r=0;for(;r3&&arguments[3]!==void 0?arguments[3]:!1;if(e.length===0)return t;const i=e[0],o=Xi(n?n[i]:void 0,e.slice(1),t,r);if(Gn(n)||Nn(n))return Xg(n,i,o);if(r){const s=I6.test(i)?[]:{};return s[i]=o,s}else throw new Error("Path does not exist")}const I6=/^\d+$/;function s$(n,e,t){if(e.length===0)return t(n);if(!o$(n))throw new Error("Path doesn't exist");const r=e[0],i=s$(n[r],e.slice(1),t);return Xg(n,r,i)}function Zg(n,e){if(e.length===0)return n;if(!o$(n))throw new Error("Path does not exist");if(e.length===1){const i=e[0];if(i in n){const o=Yg(n);return Nn(o)&&o.splice(parseInt(i),1),Gn(o)&&delete o[i],o}else return n}const t=e[0],r=Zg(n[t],e.slice(1));return Xg(n,t,r)}function ev(n,e,t){const r=e.slice(0,e.length-1),i=e[e.length-1];return s$(n,r,o=>{if(!Array.isArray(o))throw new TypeError("Array expected at path "+JSON.stringify(r));const s=Yg(o);return s.splice(parseInt(i),0,t),s})}function Ii(n,e){return n===void 0?!1:e.length===0?!0:n===null?!1:Ii(n[e[0]],e.slice(1))}function ao(n){const e=n.split("/");return e.shift(),e.map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Ue(n){return n.map(tv).join("")}function tv(n){return"/"+String(n).replace(/~/g,"~0").replace(/\//g,"~1")}function a1(n,e){return n+tv(e)}function lh(n,e){return n.startsWith(e)&&(n.length===e.length||n[e.length]==="/")}function ro(n,e,t){let r=n;for(let i=0;i{let a;const l=Eo(o,s.path);if(s.op==="add")a=u$(o,l);else if(s.op==="remove")a=c$(o,l);else if(s.op==="replace")a=l$(o,l);else if(s.op==="copy")a=U6(o,l);else if(s.op==="move")a=W6(o,l,sm(s.from));else if(s.op==="test")a=[];else throw new Error("Unknown JSONPatch operation "+JSON.stringify(s));let c;if(t&&t.before){const u=t.before(o,s,a);if(u&&u.revertOperations&&(a=u.revertOperations),u&&u.document&&(c=u.document),u&&u.json)throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"')}if(r=a.concat(r),c!==void 0)return{document:c}}}),r}function l$(n,e){return[{op:"replace",path:Ue(e),value:Ye(n,e)}]}function c$(n,e){return[{op:"add",path:Ue(e),value:Ye(n,e)}]}function u$(n,e){return vu(n,e)||!Ii(n,e)?[{op:"remove",path:Ue(e)}]:l$(n,e)}function U6(n,e){return u$(n,e)}function W6(n,e,t){if(e.length=0?W=f():$()}return y(F,"valueEnd"),c(),I&&sNumber.MAX_SAFE_INTEGER||W="a"&&W<="f"?I+=W.charCodeAt()-K6+10:W>="0"&&W<="9"?I+=+W:S()}return String.fromCharCode(I)}function b(){for(var F="";n[s]>="0"&&n[s]<="9";)F+=m();if(F.length)return F;_(),$()}function y(F,I){x(F,I,w())}function x(F,I,W){r[F]=r[F]||{},r[F][I]=W}function w(){return{line:i,column:o,pos:s}}function $(){throw new SyntaxError("Unexpected token "+n[s]+" in JSON at position "+s)}function S(){v(),$()}function _(){if(s>=n.length)throw new SyntaxError("Unexpected end of JSON input")}};od.stringify=function(n,e,t){if(!qu(n))return;var r=0,i,o,s=typeof t=="object"?t.space:t;switch(typeof s){case"number":var a=s>10?10:s<0?0:Math.floor(s);s=a&&x(a," "),i=a,o=a;break;case"string":s=s.slice(0,10),i=0,o=0;for(var l=0;lNumber.MAX_SAFE_INTEGER||W="a"&&W<="f"?I+=W.charCodeAt()-K6+10:W>="0"&&W<="9"?I+=+W:S()}return String.fromCharCode(I)}function b(){for(var F="";n[s]>="0"&&n[s]<="9";)F+=m();if(F.length)return F;_(),$()}function y(F,I){j(F,I,w())}function j(F,I,W){r[F]=r[F]||{},r[F][I]=W}function w(){return{line:i,column:o,pos:s}}function $(){throw new SyntaxError("Unexpected token "+n[s]+" in JSON at position "+s)}function S(){v(),$()}function _(){if(s>=n.length)throw new SyntaxError("Unexpected end of JSON input")}};od.stringify=function(n,e,t){if(!qu(n))return;var r=0,i,o,s=typeof t=="object"?t.space:t;switch(typeof s){case"number":var a=s>10?10:s<0?0:Math.floor(s);s=a&&j(a," "),i=a,o=a;break;case"string":s=s.slice(0,10),i=0,o=0;for(var l=0;l=0}var Q6=/"|\\/g,Y6=/[\b]/g,X6=/\f/g,Z6=/\n/g,e8=/\r/g,t8=/\t/g;function Vu(n){return n=n.replace(Q6,"\\$&").replace(X6,"\\f").replace(Y6,"\\b").replace(Z6,"\\n").replace(e8,"\\r").replace(t8,"\\t"),'"'+n+'"'}var n8=/~/g,r8=/\//g;function am(n){return n.replace(n8,"~0").replace(r8,"~1")}class Xs extends Error{constructor(e,t){super(e+" at position "+t),this.position=t}}const Hu=92,ap=47,i8=42,l1=123,Uu=125,c1=91,Wu=93,o8=40,s8=41,a8=32,tv=10,f$=9,d$=13,l8=8,c8=12,sd=34,u1=43,f1=45,h$=39,p$=48,m$=57,Ju=44,u8=46,f8=58,d8=59,h8=65,p8=97,m8=69,g8=101,v8=70,y8=102,b8=160,w8=8192,x8=8202,j8=8239,$8=8287,k8=12288,S8=8220,C8=8221,O8=8216,M8=8217,E8=96,A8=180;function T8(n){return n>=p$&&n<=m$||n>=h8&&n<=v8||n>=p8&&n<=y8}function Ku(n){return n>=p$&&n<=m$}function P8(n){return n>=32&&n<=1114111}function Gu(n){return _8.test(n)}const _8=/^[,:[\]/{}()\n+]$/;function d1(n){return R8.test(n)||n&&Ff(n.charCodeAt(0))}const R8=/^[[{\w-]$/;function N8(n){return n===tv||n===d$||n===f$||n===l8||n===c8}function $c(n){return n===a8||n===tv||n===f$||n===d$}function I8(n){return n===b8||n>=w8&&n<=x8||n===j8||n===$8||n===k8}function Ff(n){return g$(n)||lm(n)}function g$(n){return n===sd||n===S8||n===C8}function h1(n){return n===sd}function lm(n){return n===h$||n===O8||n===M8||n===E8||n===A8}function p1(n){return n===h$}function rc(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=n.lastIndexOf(e);return r!==-1?n.substring(0,r)+(t?"":n.substring(r+1)):n}function go(n,e){let t=n.length;if(!$c(n.charCodeAt(t-1)))return n+e;for(;$c(n.charCodeAt(t-1));)t--;return n.substring(0,t)+e+n.substring(t)}function D8(n,e,t){return n.substring(0,e)+n.substring(e+t)}function L8(n){return/[,\n][ \t\r]*$/.test(n)}const B8={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},z8={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` -`,r:"\r",t:" "};function Ao(n){let e=0,t="";o()||I();const i=c(Ju);for(i&&s(),d1(n[e])&&L8(t)?(i||(t=go(t,",")),p()):i&&(t=rc(t,","));n.charCodeAt(e)===Uu||n.charCodeAt(e)===Wu;)e++,s();if(e>=n.length)return t;F();function o(){s();const X=d()||h()||m()||g()||b()||x();return s(),X}function s(){const X=e;let K=a();do K=l(),K&&(K=a());while(K);return e>X}function a(){let X="",K;for(;(K=$c(n.charCodeAt(e)))||I8(n.charCodeAt(e));)K?X+=n[e]:X+=" ",e++;return X.length>0?(t+=X,!0):!1}function l(){if(n.charCodeAt(e)===ap&&n.charCodeAt(e+1)===i8){for(;e=n.length;T||(d1(n[e])||B?t=go(t,":"):D()),o()||(T||B?t+="null":D())}return n.charCodeAt(e)===Uu?(t+="}",e++):t=go(t,"}"),!0}return!1}function h(){if(n.charCodeAt(e)===c1){t+="[",e++,s();let X=!0;for(;e=0}var Q6=/"|\\/g,Y6=/[\b]/g,X6=/\f/g,Z6=/\n/g,e8=/\r/g,t8=/\t/g;function Vu(n){return n=n.replace(Q6,"\\$&").replace(X6,"\\f").replace(Y6,"\\b").replace(Z6,"\\n").replace(e8,"\\r").replace(t8,"\\t"),'"'+n+'"'}var n8=/~/g,r8=/\//g;function am(n){return n.replace(n8,"~0").replace(r8,"~1")}class Xs extends Error{constructor(e,t){super(e+" at position "+t),this.position=t}}const Hu=92,ap=47,i8=42,c1=123,Uu=125,u1=91,Wu=93,o8=40,s8=41,a8=32,nv=10,f$=9,d$=13,l8=8,c8=12,sd=34,f1=43,d1=45,h$=39,p$=48,m$=57,Ju=44,u8=46,f8=58,d8=59,h8=65,p8=97,m8=69,g8=101,v8=70,y8=102,b8=160,w8=8192,j8=8202,x8=8239,$8=8287,k8=12288,S8=8220,C8=8221,O8=8216,M8=8217,E8=96,A8=180;function T8(n){return n>=p$&&n<=m$||n>=h8&&n<=v8||n>=p8&&n<=y8}function Ku(n){return n>=p$&&n<=m$}function P8(n){return n>=32&&n<=1114111}function Gu(n){return _8.test(n)}const _8=/^[,:[\]/{}()\n+]$/;function h1(n){return R8.test(n)||n&&Ff(n.charCodeAt(0))}const R8=/^[[{\w-]$/;function N8(n){return n===nv||n===d$||n===f$||n===l8||n===c8}function $c(n){return n===a8||n===nv||n===f$||n===d$}function I8(n){return n===b8||n>=w8&&n<=j8||n===x8||n===$8||n===k8}function Ff(n){return g$(n)||lm(n)}function g$(n){return n===sd||n===S8||n===C8}function p1(n){return n===sd}function lm(n){return n===h$||n===O8||n===M8||n===E8||n===A8}function m1(n){return n===h$}function rc(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=n.lastIndexOf(e);return r!==-1?n.substring(0,r)+(t?"":n.substring(r+1)):n}function go(n,e){let t=n.length;if(!$c(n.charCodeAt(t-1)))return n+e;for(;$c(n.charCodeAt(t-1));)t--;return n.substring(0,t)+e+n.substring(t)}function D8(n,e,t){return n.substring(0,e)+n.substring(e+t)}function L8(n){return/[,\n][ \t\r]*$/.test(n)}const B8={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},z8={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` +`,r:"\r",t:" "};function Ao(n){let e=0,t="";o()||I();const i=c(Ju);for(i&&s(),h1(n[e])&&L8(t)?(i||(t=go(t,",")),p()):i&&(t=rc(t,","));n.charCodeAt(e)===Uu||n.charCodeAt(e)===Wu;)e++,s();if(e>=n.length)return t;F();function o(){s();const X=d()||h()||m()||g()||b()||j();return s(),X}function s(){const X=e;let K=a();do K=l(),K&&(K=a());while(K);return e>X}function a(){let X="",K;for(;(K=$c(n.charCodeAt(e)))||I8(n.charCodeAt(e));)K?X+=n[e]:X+=" ",e++;return X.length>0?(t+=X,!0):!1}function l(){if(n.charCodeAt(e)===ap&&n.charCodeAt(e+1)===i8){for(;e=n.length;T||(h1(n[e])||B?t=go(t,":"):D()),o()||(T||B?t+="null":D())}return n.charCodeAt(e)===Uu?(t+="}",e++):t=go(t,"}"),!0}return!1}function h(){if(n.charCodeAt(e)===u1){t+="[",e++,s();let X=!0;for(;e0&&arguments[0]!==void 0?arguments[0]:!1,K=n.charCodeAt(e)===Hu;if(K&&(e++,K=!0),Ff(n.charCodeAt(e))){const Y=h1(n.charCodeAt(e))?h1:p1(n.charCodeAt(e))?p1:lm(n.charCodeAt(e))?lm:g$,T=e,B=t.length;let O='"';for(e++;;){if(e>=n.length)return X?(O=go(O,'"'),t+=O,!0):(e=T,t=t.substring(0,B),m(!0));if(Y(n.charCodeAt(e))){const A=e,te=O.length;if(O+='"',e++,t+=O,s(),X||e>=n.length||Gu(n.charAt(e))||Ff(n.charCodeAt(e)))return v(),!0;if(Gu(n.charAt(w(A-1))))return e=T,t=t.substring(0,B),m(!0);t=t.substring(0,B),e=A+1,O=O.substring(0,te)+"\\"+O.substring(te)}else{if(X&&Gu(n[e]))return O=go(O,'"'),t+=O,v(),!0;if(n.charCodeAt(e)===Hu){const A=n.charAt(e+1);if(z8[A]!==void 0)O+=n.slice(e,e+2),e+=2;else if(A==="u"){let R=2;for(;R<6&&T8(n.charCodeAt(e+R));)R++;R===6?(O+=n.slice(e,e+6),e+=6):e+R>=n.length?e=n.length:U()}else O+=A,e+=2}else{const A=n.charAt(e),te=n.charCodeAt(e);te===sd&&n.charCodeAt(e-1)!==Hu?(O+="\\"+A,e++):N8(te)?(O+=B8[A],e++):(P8(te)||_(A),O+=A,e++)}}K&&f()}}return!1}function v(){let X=!1;for(s();n.charCodeAt(e)===u1;){X=!0,e++,s(),t=rc(t,'"',!0);const K=t.length;m()?t=D8(t,K,1):t=go(t,'"')}return X}function g(){const X=e;if(n.charCodeAt(e)===f1&&(e++,S(X)))return!0;for(;Ku(n.charCodeAt(e));)e++;if(n.charCodeAt(e)===u8){if(e++,S(X))return!0;for(;Ku(n.charCodeAt(e));)e++}if(n.charCodeAt(e)===g8||n.charCodeAt(e)===m8){if(e++,(n.charCodeAt(e)===f1||n.charCodeAt(e)===u1)&&e++,S(X))return!0;for(;Ku(n.charCodeAt(e));)e++}if(e>X){const K=n.slice(X,e);return t+=/^0\d/.test(K)?'"'.concat(K,'"'):K,!0}return!1}function b(){return y("true","true")||y("false","false")||y("null","null")||y("True","true")||y("False","false")||y("None","null")}function y(X,K){return n.slice(e,e+X.length)===X?(t+=K,e+=X.length,!0):!1}function x(){const X=e;for(;eX){if(n.charCodeAt(e)===o8)return e++,o(),n.charCodeAt(e)===s8&&(e++,n.charCodeAt(e)===d8&&e++),!0;{for(;$c(n.charCodeAt(e-1))&&e>0;)e--;const K=n.slice(X,e);return t+=K==="undefined"?"null":JSON.stringify(K),n.charCodeAt(e)===sd&&e++,!0}}}function w(X){let K=X;for(;K>0&&$c(n.charCodeAt(K));)K--;return K}function $(X){if(!Ku(n.charCodeAt(e))){const K=n.slice(X,e);throw new Xs("Invalid number '".concat(K,"', expecting a digit ").concat(q()),e)}}function S(X){return e>=n.length?(t+=n.slice(X,e)+"0",!0):($(X),!1)}function _(X){throw new Xs("Invalid character "+JSON.stringify(X),e)}function F(){throw new Xs("Unexpected character "+JSON.stringify(n[e]),e)}function I(){throw new Xs("Unexpected end of json string",n.length)}function W(){throw new Xs("Object key expected",e)}function D(){throw new Xs("Colon expected",e)}function U(){const X=n.slice(e,e+6);throw new Xs('Invalid unicode character "'.concat(X,'"'),e)}function q(){return n[e]?"but got '".concat(n[e],"'"):"but reached end of input"}}function F8(n,e){return n[e]==="*"&&n[e+1]==="/"}var q8=typeof global=="object"&&global&&global.Object===Object&&global,v$=q8,V8=typeof self=="object"&&self&&self.Object===Object&&self,H8=v$||V8||Function("return this")(),fo=H8,U8=fo.Symbol,qi=U8,y$=Object.prototype,W8=y$.hasOwnProperty,J8=y$.toString,ic=qi?qi.toStringTag:void 0;function K8(n){var e=W8.call(n,ic),t=n[ic];try{n[ic]=void 0;var r=!0}catch{}var i=J8.call(n);return r&&(e?n[ic]=t:delete n[ic]),i}var G8=Object.prototype,Q8=G8.toString;function Y8(n){return Q8.call(n)}var X8="[object Null]",Z8="[object Undefined]",m1=qi?qi.toStringTag:void 0;function Fl(n){return n==null?n===void 0?Z8:X8:m1&&m1 in Object(n)?K8(n):Y8(n)}function Ds(n){return n!=null&&typeof n=="object"}var e5="[object Symbol]";function va(n){return typeof n=="symbol"||Ds(n)&&Fl(n)==e5}function kc(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t0){if(++e>=N5)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function B5(n){return function(){return n}}var z5=function(){try{var n=Da(Object,"defineProperty");return n({},"",{}),n}catch{}}(),ad=z5,F5=ad?function(n,e){return ad(n,"toString",{configurable:!0,enumerable:!1,value:B5(e),writable:!0})}:yu,q5=F5,V5=L5(q5),H5=V5;function U5(n,e){for(var t=-1,r=n==null?0:n.length;++t-1&&n%1==0&&n-1&&n%1==0&&n<=X5}function ql(n){return n!=null&&rv(n.length)&&!w$(n)}function fm(n,e,t){if(!_o(t))return!1;var r=typeof e;return(r=="number"?ql(t)&&nv(e,t.length):r=="string"&&e in t)?uh(t[e],n):!1}var Z5=Object.prototype;function dh(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Z5;return n===t}function j$(n,e){for(var t=-1,r=Array(n);++t-1}function dM(n,e){var t=this.__data__,r=mh(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function fs(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e0&&t(a)?e>1?T$(a,e-1,t,r,i):lv(i,a):r||(i[i.length]=a)}return i}var AM=O$(Object.getPrototypeOf,Object),P$=AM;function TM(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=Array(i);++ra))return!1;var c=o.get(n),u=o.get(e);if(c&&u)return c==e&&u==n;var f=-1,d=!0,h=t&OA?new cd:void 0;for(o.set(n,e),o.set(e,n);++f=e||S<0||f&&_>=o}function g(){var $=fp();if(v($))return b($);a=setTimeout(g,m($))}function b($){return a=void 0,d&&r?h($):(r=i=void 0,s)}function y(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function x(){return a===void 0?s:b(fp())}function w(){var $=fp(),S=v($);if(r=arguments,i=this,l=$,S){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(g,e),h(l)}return a===void 0&&(a=setTimeout(g,e)),s}return w.cancel=y,w.flush=x,w}function en(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}function K$(n){return typeof n=="function"?n:yu}function w7(n,e){for(var t=n==null?0:n.length;t--&&e(n[t],t,n)!==!1;);return n}var x7=V$(!0),j7=x7;function $7(n,e){return n&&j7(n,e,Vl)}var k7=U$($7,!0),S7=k7;function C7(n,e){var t=Qr(n)?w7:S7;return t(n,K$(e))}function Qo(n){return n&&n.length?n[0]:void 0}function G$(n,e){var t=-1,r=ql(n)?Array(n.length):[];return W$(n,function(i,o,s){r[++t]=e(i,o,s)}),r}function O7(n,e){var t=Qr(n)?kc:G$;return t(n,bu(e))}var M7=Object.prototype,E7=M7.hasOwnProperty,A7=J$(function(n,e,t){E7.call(n,t)?n[t].push(e):ch(n,t,[e])}),wh=A7;function on(n){var e=n==null?0:n.length;return e?TM(n,0,-1):[]}var T7="[object Map]",P7="[object Set]",_7=Object.prototype,R7=_7.hasOwnProperty;function hn(n){if(n==null)return!0;if(ql(n)&&(Qr(n)||typeof n=="string"||typeof n.splice=="function"||Fc(n)||iv(n)||hh(n)))return!n.length;var e=Sl(n);if(e==T7||e==P7)return!n.size;if(dh(n))return!M$(n).length;for(var t in n)if(R7.call(n,t))return!1;return!0}function sn(n,e){return bh(n,e)}function N7(n,e){return ne||o&&s&&l&&!a&&!c||r&&s&&l||!t&&l||!i)return 1;if(!r&&!o&&!c&&n=a)return l;var c=t[r];return l*(c=="desc"?-1:1)}}return n.index-e.index}function F7(n,e,t){e.length?e=kc(e,function(o){return Qr(o)?function(s){return av(s,o.length===1?o[0]:o)}:o}):e=[yu];var r=-1;e=kc(e,ph(bu));var i=G$(n,function(o,s,a){var l=kc(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return L7(i,function(o,s){return z7(o,s,t)})}var q7=J$(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]}),V7=q7,H7=Math.ceil,U7=Math.max;function W7(n,e,t,r){for(var i=-1,o=U7(H7((e-n)/(t||1)),0),s=Array(o);o--;)s[r?o:++i]=n,n+=t;return s}function J7(n){return function(e,t,r){return r&&typeof r!="number"&&fm(e,t,r)&&(t=r=void 0),e=qf(e),t===void 0?(t=e,e=0):t=qf(t),r=r===void 0?e1&&fm(n,e[0],e[1])?e=[]:t>2&&fm(e[0],e[1],e[2])&&(e=[e[0]]),F7(n,T$(e,1),[])}),Y7=Q7,X7=9007199254740991,dp=4294967295,Z7=Math.min;function eT(n,e){if(n=d5(n),n<1||n>X7)return[];var t=dp,r=Z7(n,dp);e=K$(e),n-=dp;for(var i=j$(r,e);++t0&&arguments[0]!==void 0?arguments[0]:!1,K=n.charCodeAt(e)===Hu;if(K&&(e++,K=!0),Ff(n.charCodeAt(e))){const Y=p1(n.charCodeAt(e))?p1:m1(n.charCodeAt(e))?m1:lm(n.charCodeAt(e))?lm:g$,T=e,B=t.length;let O='"';for(e++;;){if(e>=n.length)return X?(O=go(O,'"'),t+=O,!0):(e=T,t=t.substring(0,B),m(!0));if(Y(n.charCodeAt(e))){const A=e,te=O.length;if(O+='"',e++,t+=O,s(),X||e>=n.length||Gu(n.charAt(e))||Ff(n.charCodeAt(e)))return v(),!0;if(Gu(n.charAt(w(A-1))))return e=T,t=t.substring(0,B),m(!0);t=t.substring(0,B),e=A+1,O=O.substring(0,te)+"\\"+O.substring(te)}else{if(X&&Gu(n[e]))return O=go(O,'"'),t+=O,v(),!0;if(n.charCodeAt(e)===Hu){const A=n.charAt(e+1);if(z8[A]!==void 0)O+=n.slice(e,e+2),e+=2;else if(A==="u"){let R=2;for(;R<6&&T8(n.charCodeAt(e+R));)R++;R===6?(O+=n.slice(e,e+6),e+=6):e+R>=n.length?e=n.length:U()}else O+=A,e+=2}else{const A=n.charAt(e),te=n.charCodeAt(e);te===sd&&n.charCodeAt(e-1)!==Hu?(O+="\\"+A,e++):N8(te)?(O+=B8[A],e++):(P8(te)||_(A),O+=A,e++)}}K&&f()}}return!1}function v(){let X=!1;for(s();n.charCodeAt(e)===f1;){X=!0,e++,s(),t=rc(t,'"',!0);const K=t.length;m()?t=D8(t,K,1):t=go(t,'"')}return X}function g(){const X=e;if(n.charCodeAt(e)===d1&&(e++,S(X)))return!0;for(;Ku(n.charCodeAt(e));)e++;if(n.charCodeAt(e)===u8){if(e++,S(X))return!0;for(;Ku(n.charCodeAt(e));)e++}if(n.charCodeAt(e)===g8||n.charCodeAt(e)===m8){if(e++,(n.charCodeAt(e)===d1||n.charCodeAt(e)===f1)&&e++,S(X))return!0;for(;Ku(n.charCodeAt(e));)e++}if(e>X){const K=n.slice(X,e);return t+=/^0\d/.test(K)?'"'.concat(K,'"'):K,!0}return!1}function b(){return y("true","true")||y("false","false")||y("null","null")||y("True","true")||y("False","false")||y("None","null")}function y(X,K){return n.slice(e,e+X.length)===X?(t+=K,e+=X.length,!0):!1}function j(){const X=e;for(;eX){if(n.charCodeAt(e)===o8)return e++,o(),n.charCodeAt(e)===s8&&(e++,n.charCodeAt(e)===d8&&e++),!0;{for(;$c(n.charCodeAt(e-1))&&e>0;)e--;const K=n.slice(X,e);return t+=K==="undefined"?"null":JSON.stringify(K),n.charCodeAt(e)===sd&&e++,!0}}}function w(X){let K=X;for(;K>0&&$c(n.charCodeAt(K));)K--;return K}function $(X){if(!Ku(n.charCodeAt(e))){const K=n.slice(X,e);throw new Xs("Invalid number '".concat(K,"', expecting a digit ").concat(q()),e)}}function S(X){return e>=n.length?(t+=n.slice(X,e)+"0",!0):($(X),!1)}function _(X){throw new Xs("Invalid character "+JSON.stringify(X),e)}function F(){throw new Xs("Unexpected character "+JSON.stringify(n[e]),e)}function I(){throw new Xs("Unexpected end of json string",n.length)}function W(){throw new Xs("Object key expected",e)}function D(){throw new Xs("Colon expected",e)}function U(){const X=n.slice(e,e+6);throw new Xs('Invalid unicode character "'.concat(X,'"'),e)}function q(){return n[e]?"but got '".concat(n[e],"'"):"but reached end of input"}}function F8(n,e){return n[e]==="*"&&n[e+1]==="/"}var q8=typeof global=="object"&&global&&global.Object===Object&&global,v$=q8,V8=typeof self=="object"&&self&&self.Object===Object&&self,H8=v$||V8||Function("return this")(),fo=H8,U8=fo.Symbol,qi=U8,y$=Object.prototype,W8=y$.hasOwnProperty,J8=y$.toString,ic=qi?qi.toStringTag:void 0;function K8(n){var e=W8.call(n,ic),t=n[ic];try{n[ic]=void 0;var r=!0}catch{}var i=J8.call(n);return r&&(e?n[ic]=t:delete n[ic]),i}var G8=Object.prototype,Q8=G8.toString;function Y8(n){return Q8.call(n)}var X8="[object Null]",Z8="[object Undefined]",g1=qi?qi.toStringTag:void 0;function Fl(n){return n==null?n===void 0?Z8:X8:g1&&g1 in Object(n)?K8(n):Y8(n)}function Ds(n){return n!=null&&typeof n=="object"}var e5="[object Symbol]";function va(n){return typeof n=="symbol"||Ds(n)&&Fl(n)==e5}function kc(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t0){if(++e>=N5)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function B5(n){return function(){return n}}var z5=function(){try{var n=Da(Object,"defineProperty");return n({},"",{}),n}catch{}}(),ad=z5,F5=ad?function(n,e){return ad(n,"toString",{configurable:!0,enumerable:!1,value:B5(e),writable:!0})}:yu,q5=F5,V5=L5(q5),H5=V5;function U5(n,e){for(var t=-1,r=n==null?0:n.length;++t-1&&n%1==0&&n-1&&n%1==0&&n<=X5}function ql(n){return n!=null&&iv(n.length)&&!w$(n)}function fm(n,e,t){if(!_o(t))return!1;var r=typeof e;return(r=="number"?ql(t)&&rv(e,t.length):r=="string"&&e in t)?uh(t[e],n):!1}var Z5=Object.prototype;function dh(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Z5;return n===t}function x$(n,e){for(var t=-1,r=Array(n);++t-1}function dM(n,e){var t=this.__data__,r=mh(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function fs(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e0&&t(a)?e>1?T$(a,e-1,t,r,i):cv(i,a):r||(i[i.length]=a)}return i}var AM=O$(Object.getPrototypeOf,Object),P$=AM;function TM(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=Array(i);++ra))return!1;var c=o.get(n),u=o.get(e);if(c&&u)return c==e&&u==n;var f=-1,d=!0,h=t&OA?new cd:void 0;for(o.set(n,e),o.set(e,n);++f=e||S<0||f&&_>=o}function g(){var $=fp();if(v($))return b($);a=setTimeout(g,m($))}function b($){return a=void 0,d&&r?h($):(r=i=void 0,s)}function y(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function j(){return a===void 0?s:b(fp())}function w(){var $=fp(),S=v($);if(r=arguments,i=this,l=$,S){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(g,e),h(l)}return a===void 0&&(a=setTimeout(g,e)),s}return w.cancel=y,w.flush=j,w}function en(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}function K$(n){return typeof n=="function"?n:yu}function w7(n,e){for(var t=n==null?0:n.length;t--&&e(n[t],t,n)!==!1;);return n}var j7=V$(!0),x7=j7;function $7(n,e){return n&&x7(n,e,Vl)}var k7=U$($7,!0),S7=k7;function C7(n,e){var t=Qr(n)?w7:S7;return t(n,K$(e))}function Qo(n){return n&&n.length?n[0]:void 0}function G$(n,e){var t=-1,r=ql(n)?Array(n.length):[];return W$(n,function(i,o,s){r[++t]=e(i,o,s)}),r}function O7(n,e){var t=Qr(n)?kc:G$;return t(n,bu(e))}var M7=Object.prototype,E7=M7.hasOwnProperty,A7=J$(function(n,e,t){E7.call(n,t)?n[t].push(e):ch(n,t,[e])}),wh=A7;function on(n){var e=n==null?0:n.length;return e?TM(n,0,-1):[]}var T7="[object Map]",P7="[object Set]",_7=Object.prototype,R7=_7.hasOwnProperty;function hn(n){if(n==null)return!0;if(ql(n)&&(Qr(n)||typeof n=="string"||typeof n.splice=="function"||Fc(n)||ov(n)||hh(n)))return!n.length;var e=Sl(n);if(e==T7||e==P7)return!n.size;if(dh(n))return!M$(n).length;for(var t in n)if(R7.call(n,t))return!1;return!0}function sn(n,e){return bh(n,e)}function N7(n,e){return ne||o&&s&&l&&!a&&!c||r&&s&&l||!t&&l||!i)return 1;if(!r&&!o&&!c&&n=a)return l;var c=t[r];return l*(c=="desc"?-1:1)}}return n.index-e.index}function F7(n,e,t){e.length?e=kc(e,function(o){return Qr(o)?function(s){return lv(s,o.length===1?o[0]:o)}:o}):e=[yu];var r=-1;e=kc(e,ph(bu));var i=G$(n,function(o,s,a){var l=kc(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return L7(i,function(o,s){return z7(o,s,t)})}var q7=J$(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]}),V7=q7,H7=Math.ceil,U7=Math.max;function W7(n,e,t,r){for(var i=-1,o=U7(H7((e-n)/(t||1)),0),s=Array(o);o--;)s[r?o:++i]=n,n+=t;return s}function J7(n){return function(e,t,r){return r&&typeof r!="number"&&fm(e,t,r)&&(t=r=void 0),e=qf(e),t===void 0?(t=e,e=0):t=qf(t),r=r===void 0?e1&&fm(n,e[0],e[1])?e=[]:t>2&&fm(e[0],e[1],e[2])&&(e=[e[0]]),F7(n,T$(e,1),[])}),Y7=Q7,X7=9007199254740991,dp=4294967295,Z7=Math.min;function eT(n,e){if(n=d5(n),n<1||n>X7)return[];var t=dp,r=Z7(n,dp);e=K$(e),n-=dp;for(var i=x$(r,e);++t65;)++t;return+c.slice(u-1,t)}return f=a&&a.indexOf(c.charAt(u)),f>-1?f+76:(f=c.charCodeAt(u)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((n+="")!=(e+="")){for(;i;)if(r=l(n,o++),i=l(e,s++),r<76&&i<76&&r>66&&i>66&&(r=l(n,o,o),i=l(e,s,o=t),s=t),r!=i)return rthis.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=Ol(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),jo.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ol(this,e,t);let r=[];return this.decompose(e,t,r,0),jo.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Oc(this),o=new Oc(e);for(let s=t,a=t;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Oc(this,e)}iterRange(e,t=this.length){return new ik(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ok(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Pn.empty:e.length<=32?new pr(e):jo.from(pr.split(e,[]))}}class pr extends Pn{constructor(e,t=_T(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((t?r:a)>=e)return new RT(i,a,r,s);i=a+1,r++}}decompose(e,t,r,i){let o=e<=0&&t>=this.length?this:new pr(X1(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=Vf(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new pr(a,s.length+o.length));else{let l=a.length>>1;r.push(new pr(a.slice(0,l)),new pr(a.slice(l)))}}else r.push(o)}replace(e,t,r){if(!(r instanceof pr))return super.replace(e,t,r);[e,t]=Ol(this,e,t);let i=Vf(this.text,Vf(r.text,X1(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new pr(i,o):jo.from(pr.split(i,[]),o)}sliceString(e,t=this.length,r=` -`){[e,t]=Ol(this,e,t);let i="";for(let o=0,s=0;o<=t&&se&&s&&(i+=r),eo&&(i+=a.slice(Math.max(0,e-o),t-o)),o=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(t.push(new pr(r,i)),r=[],i=-1);return i>-1&&t.push(new pr(r,i)),t}}class jo extends Pn{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((t?l:a)>=e)return s.lineInner(e,t,r,i);i=a+1,r=l+1}}decompose(e,t,r,i){for(let o=0,s=0;s<=t&&o=s){let c=i&((s<=e?1:0)|(l>=t?2:0));s>=e&&l<=t&&!c?r.push(a):a.decompose(e-s,t-s,r,c)}s=l+1}}replace(e,t,r){if([e,t]=Ol(this,e,t),r.lines=o&&t<=a){let l=s.replace(e-o,t-o,r),c=this.lines-s.lines+l.lines;if(l.lines>5-1&&l.lines>c>>5+1){let u=this.children.slice();return u[i]=l,new jo(u,this.length-(t-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` -`){[e,t]=Ol(this,e,t);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,t-s,r)),s=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof jo))return 0;let r=0,[i,o,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,o+=t){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new pr(h,t)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof jo)for(let m of h.children)f(m);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof pr&&l&&(p=u[u.length-1])instanceof pr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new pr(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:jo.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new jo(a,t)}}Pn.empty=new pr([""],0);function _T(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Vf(n,e,t=0,r=1e9){for(let i=0,o=0,s=!0;o=t&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof pr?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof pr?i.text.length:i.children.length;if(s==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(i instanceof pr){let l=i.text[s+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof pr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ik{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Oc(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(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);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=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)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ok{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol!="undefined"&&(Pn.prototype[Symbol.iterator]=function(){return this.iter()},Oc.prototype[Symbol.iterator]=ik.prototype[Symbol.iterator]=ok.prototype[Symbol.iterator]=function(){return this});class RT{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function Ol(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let fl="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(n=>n?parseInt(n,36):1);for(let n=1;nn)return fl[e-1]<=n;return!1}function Z1(n){return n>=127462&&n<=127487}const ey=8205;function Br(n,e,t=!0,r=!0){return(t?sk:IT)(n,e,r)}function sk(n,e,t){if(e==n.length)return e;e&&ak(n.charCodeAt(e))&&lk(n.charCodeAt(e-1))&&e--;let r=Rr(n,e);for(e+=Pi(r);e=0&&Z1(Rr(n,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function IT(n,e,t){for(;e>0;){let r=sk(n,e-2,t);if(r=56320&&n<57344}function lk(n){return n>=55296&&n<56320}function Rr(n,e){let t=n.charCodeAt(e);if(!lk(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return ak(r)?(t-55296<<10)+(r-56320)+65536:t}function hv(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Pi(n){return n<65536?1:2}const wm=/\r\n?|\n/;var ri=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ri||(ri={}));class Po{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return o+(e-i);o+=a}else{if(r!=ri.Simple&&c>=e&&(r==ri.TrackDel&&ie||r==ri.TrackBefore&&ie))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let r=0,i=0;r=0&&i<=t&&a>=e)return it?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Po(e)}static create(e){return new Po(e)}}class jr extends Po{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return xm(this,(t,r,i,o,s)=>e=e.replace(i,i+(r-t),s),!1),e}mapDesc(e,t=!1){return jm(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,o=0;i=0){t[i]=a,t[i+1]=s;let l=i>>1;for(;r.length0&&ks(r,t,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,t,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let p=h?typeof h=="string"?Pn.of(h.split(r||wm)):h:Pn.empty,m=p.length;if(f==d&&m==0)return;fs&&Ur(i,f-s,-1),Ur(i,d-f,m),ks(o,i,p),s=d}}return c(e),l(!a),a}static empty(e){return new jr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;r.length=0&&t<=0&&t==n[i+1]?n[i]+=e:e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function ks(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||s==n.sections.length||n.sections[s+1]<0);)a=n.sections[s++],l=n.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function jm(n,e,t,r=!1){let i=[],o=r?[]:null,s=new Wc(n),a=new Wc(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Ur(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class Wc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Pn.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?Pn.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ca{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new ca(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return _e.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return _e.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return _e.range(e.anchor,e.head)}static create(e,t,r){return new ca(e,t,r)}}class _e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:_e.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _e(e.ranges.map(t=>ca.fromJSON(t)),e.main)}static single(e,t=e){return new _e([_e.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,t=0){let r=e[t];e.sort((i,o)=>i.from-o.from),t=e.indexOf(r);for(let i=1;io.head?_e.range(l,a):_e.range(a,l))}}return new _e(e,t)}}function uk(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let pv=0;class ot{constructor(e,t,r,i,o){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=pv++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ot(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:mv),!!e.static,e.enables)}of(e){return new Hf([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hf(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hf(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function mv(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Hf{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=pv++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||$m(f,u)){let h=r(f);if(a?!ty(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let m=dd(d,p);if(this.dependencies.every(v=>v instanceof ot?d.facet(v)===f.facet(v):v instanceof kr?d.field(v,!1)==f.field(v,!1):!0)||(a?ty(h=r(f),m,i):i(h=r(f),m)))return f.values[s]=m,0}else h=r(f);return f.values[s]=h,1}}}}function ty(n,e,t){if(n.length!=e.length)return!1;for(let r=0;rn[l.id]),i=t.map(l=>l.type),o=r.filter(l=>!(l&1)),s=n[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ny).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let o=r.values[t],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[t]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}init(e){return[this,ny.of({field:this,create:e})]}get extension(){return this}}const ra={lowest:4,low:3,default:2,high:1,highest:0};function oc(n){return e=>new fk(e,n)}const Ba={highest:oc(ra.highest),high:oc(ra.high),default:oc(ra.default),low:oc(ra.low),lowest:oc(ra.lowest)};class fk{constructor(e,t){this.inner=e,this.prec=t}}class Uo{of(e){return new km(this,e)}reconfigure(e){return Uo.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class km{constructor(e,t){this.compartment=e,this.inner=t}}class fd{constructor(e,t,r,i,o,s){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let i=[],o=Object.create(null),s=new Map;for(let d of LT(e,t,s))d instanceof kr?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,m=u&&u[d]||[];if(h.every(v=>v.type==0))if(a[p.id]=l.length<<1|1,mv(m,h))l.push(r.facet(p));else{let v=p.combine(h.map(g=>g.value));l.push(r&&p.compare(v,r.facet(p))?r.facet(p):v)}else{for(let v of h)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(g=>v.dynamicSlot(g)));a[p.id]=c.length<<1,c.push(v=>DT(v,p,h))}}let f=c.map(d=>d(a));return new fd(e,s,f,a,l,o)}}function LT(n,e,t){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof km&&t.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof km){if(t.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;t.set(s.compartment,c),o(c,a)}else if(s instanceof fk)o(s.inner,s.prec);else if(s instanceof kr)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof Hf)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,ra.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(n,ra.default),r.reduce((s,a)=>s.concat(a))}function Mc(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function dd(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const dk=ot.define(),Sm=ot.define({combine:n=>n.some(e=>e),static:!0}),hk=ot.define({combine:n=>n.length?n[0]:void 0,static:!0}),pk=ot.define(),mk=ot.define(),gk=ot.define(),vk=ot.define({combine:n=>n.length?n[0]:!1});class hs{constructor(e,t){this.type=e,this.value=t}static define(){return new BT}}class BT{of(e){return new hs(this,e)}}class zT{constructor(e){this.map=e}of(e){return new cn(this,e)}}class cn{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new cn(this.type,t)}is(e){return this.type==e}static define(e={}){return new zT(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(t);o&&r.push(o)}return r}}cn.reconfigure=cn.define();cn.appendConfig=cn.define();class $r{constructor(e,t,r,i,o,s){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&uk(r,t.newLength),o.some(a=>a.type==$r.time)||(this.annotations=o.concat($r.time.of(Date.now())))}static create(e,t,r,i,o,s){return new $r(e,t,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation($r.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}$r.time=hs.define();$r.userEvent=hs.define();$r.addToHistory=hs.define();$r.remote=hs.define();function FT(n,e){let t=[];for(let r=0,i=0;;){let o,s;if(r=n[r]))o=n[r++],s=n[r++];else if(i=0;i--){let o=r[i](n);o instanceof $r?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof $r?n=o[0]:n=bk(e,dl(o),!1)}return n}function VT(n){let e=n.startState,t=e.facet(gk),r=n;for(let i=t.length-1;i>=0;i--){let o=t[i](n);o&&Object.keys(o).length&&(r=yk(r,Cm(e,o,n.changes.newLength),!0))}return r==n?n:$r.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const HT=[];function dl(n){return n==null?HT:Array.isArray(n)?n:[n]}var rr=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(rr||(rr={}));const UT=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Om;try{Om=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function WT(n){if(Om)return Om.test(n);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||UT.test(t)))return!0}return!1}function JT(n){return e=>{if(!/\S/.test(e))return rr.Space;if(WT(e))return rr.Word;for(let t=0;t-1)return rr.Word;return rr.Other}}class vn{constructor(e,t,r,i,o,s){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(cn.reconfigure)?(t=null,r=a.value):a.is(cn.appendConfig)&&(t=null,r=dl(r).concat(a.value));let o;t?o=e.startState.values.slice():(t=fd.resolve(r,i,this),o=new vn(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(Sm)?e.newSelection:e.newSelection.asSingle();new vn(t,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:_e.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),o=[r.range],s=dl(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return vn.create({doc:e.doc,selection:_e.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=fd.resolve(e.extensions||[],new Map),r=e.doc instanceof Pn?e.doc:Pn.of((e.doc||"").split(t.staticFacet(vn.lineSeparator)||wm)),i=e.selection?e.selection instanceof _e?e.selection:_e.single(e.selection.anchor,e.selection.head):_e.single(0);return uk(i,r.length),t.staticFacet(Sm)||(i=i.asSingle()),new vn(t,r,i,t.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(vn.tabSize)}get lineBreak(){return this.facet(vn.lineSeparator)||` -`}get readOnly(){return this.facet(vk)}phrase(e,...t){for(let r of this.facet(vn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>t.length?r:t[o-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let o of this.facet(dk))for(let s of o(this,t,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return JT(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=Br(t,s,!1);if(o(t.slice(l,s))!=rr.Word)break;s=l}for(;an.length?n[0]:4});vn.lineSeparator=hk;vn.readOnly=vk;vn.phrases=ot.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});vn.languageData=dk;vn.changeFilter=pk;vn.transactionFilter=mk;vn.transactionExtender=gk;Uo.reconfigure=cn.define();function Wi(n,e,t={}){let r={};for(let i of n)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(t,o))r[o]=t[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ba{eq(e){return this==e}range(e,t=e){return Jc.create(e,t,this)}}ba.prototype.startSide=ba.prototype.endSide=0;ba.prototype.point=!1;ba.prototype.mapMode=ri.TrackDel;class Jc{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new Jc(e,t,r)}}function Mm(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class gv{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,t,r,i){for(let o=this.findIndex(t,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new gv(i,o,r,a):null,pos:s}}}class wn{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new wn(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(t.length==0&&!s)return this;if(r&&(t=t.slice().sort(Mm)),this.isEmpty)return t.length?wn.of(t):this;let a=new wk(this,null,-1).goto(0),l=0,c=[],u=new Ro;for(;a.value||l=0){let f=t[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,t-o,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Kc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Kc.from(e).goto(t)}static compare(e,t,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=ry(s,a,r),c=new sc(s,l,o),u=new sc(a,l,o);r.iterGaps((f,d,h)=>iy(c,f,u,d,h,i)),r.empty&&r.length==0&&iy(c,0,u,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=1e9-1);let o=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),s=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=ry(o,s),l=new sc(o,a,0).goto(r),c=new sc(s,a,0).goto(r);for(;;){if(l.to!=c.to||!Em(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,t,r,i,o=-1){let s=new sc(e,null,o).goto(t),a=t,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,t=!1){let r=new Ro;for(let i of e instanceof Jc?[e]:t?KT(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return wn.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=wn.empty;i=i.nextLayer)t=new wn(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}wn.empty=new wn([],[],null,-1);function KT(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(Mm);e=r}return n}wn.empty.nextLayer=wn.empty;class Ro{finishChunk(e){this.chunks.push(new gv(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=[])}constructor(){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}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Ro)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(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);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(wn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=wn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function ry(n,e,t){let r=new Map;for(let o of n)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new wk(s,t,r,o));return i.length==1?i[0]:new Kc(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)hp(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)hp(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),hp(this.heap,0)}}}function hp(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class sc{constructor(e,t,r){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=Kc.from(e,t,r)}goto(e,t=-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}forward(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)}removeActive(e){Zu(this.active,e),Zu(this.activeTo,e),Zu(this.activeRank,e),this.minActive=oy(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:o}=this.cursor;for(;t0;)t++;ef(this.active,t,r),ef(this.activeTo,t,i),ef(this.activeRank,t,o),e&&ef(e,t,this.cursor.from),this.minActive=oy(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-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),r&&Zu(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function iy(n,e,t,r,i,o){n.goto(e),t.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=n.to+l-t.to||n.endSide-t.endSide,u=c<0?n.to+l:t.to,f=Math.min(u,s);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Em(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(a,f,n.point,t.point):f>a&&!Em(n.active,t.active)&&o.compareRange(a,f,n.active,t.active),u>s)break;a=u,c<=0&&n.next(),c>=0&&t.next()}}function Em(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;r--)n[r+1]=n[r];n[e]=t}function oy(n,e){let t=-1,r=1e9;for(let i=0;i=e)return i;if(i==n.length)break;o+=n.charCodeAt(i)==9?t-o%t:1,i=Br(n,i)}return r===!0?-1:n.length}const Tm="\u037C",sy=typeof Symbol=="undefined"?"__"+Tm:Symbol.for(Tm),Pm=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ay=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{};class Bs{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(m=>s.map(v=>m.replace(/&/,v))).reduce((m,v)=>m.concat(v)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=ay[sy]||1;return ay[sy]=e+1,Tm+e.toString(36)}static mount(e,t,r){let i=e[Pm],o=r&&r.nonce;i?o&&i.setNonce(o):i=new GT(e,o),i.mount(Array.isArray(t)?t:[t],e)}}let ly=new Map;class GT{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=ly.get(r);if(o)return e[Pm]=o;this.sheet=new i.CSSStyleSheet,ly.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Pm]=this}mount(e,t){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},QT=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),YT=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Nr=0;Nr<10;Nr++)zs[48+Nr]=zs[96+Nr]=String(Nr);for(var Nr=1;Nr<=24;Nr++)zs[Nr+111]="F"+Nr;for(var Nr=65;Nr<=90;Nr++)zs[Nr]=String.fromCharCode(Nr+32),Gc[Nr]=String.fromCharCode(Nr);for(var pp in zs)Gc.hasOwnProperty(pp)||(Gc[pp]=zs[pp]);function XT(n){var e=QT&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||YT&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Gc:zs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function hd(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function _m(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ZT(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Uf(n,e){if(!e.anchorNode)return!1;try{return _m(n,e.anchorNode)}catch{return!1}}function Qc(n){return n.nodeType==3?xa(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ec(n,e,t,r){return t?cy(n,e,t,r,-1)||cy(n,e,t,r,1):!1}function wa(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function pd(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function cy(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:rs(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=wa(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?rs(n):0}else return!1}}function rs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function vv(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function eP(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function xk(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function tP(n,e,t,r,i,o,s,a){let l=n.ownerDocument,c=l.defaultView||window;for(let u=n,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,m=1;if(h)d=eP(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let b=u.getBoundingClientRect();({scaleX:p,scaleY:m}=xk(u,b)),d={left:b.left,right:b.left+u.clientWidth*p,top:b.top,bottom:b.top+u.clientHeight*m}}let v=0,g=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+g&&(g=e.bottom-d.bottom+g+s)):e.bottom>d.bottom&&(g=e.bottom-d.bottom+s,t<0&&e.top-g0&&e.right>d.right+v&&(v=e.right-d.right+v+o)):e.right>d.right&&(v=e.right-d.right+o,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class rP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?rs(t):0),r,Math.min(e.focusOffset,r?rs(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let Va=null;function jk(n){if(n.setActive)return n.setActive();if(Va)return n.focus(Va);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Va==null?{get preventScroll(){return Va={preventScroll:!0},!0}}:void 0),!Va){Va=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function Sk(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=rs(t)}else if(t.parentNode&&!pd(t))r=wa(t),t=t.parentNode;else return null}}function Ck(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&rt)return f.domBoundsAround(e,t,c);if(d>=e&&i==-1&&(i=l,o=c),c>t&&f.dom.parentNode==this.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=yv){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Mk(n,e,t,r,i,o,s,a,l){let{children:c}=n,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(e==r&&u&&!s&&!d&&o.length<2&&u.merge(t,i,o.length?f:null,t==0,a,l))){if(r0&&(!s&&o.length&&u.merge(t,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(t2);var ft={mac:py||/Mac/.test(ji.platform),windows:/Win/.test(ji.platform),linux:/Linux|X11/.test(ji.platform),ie:Sh,ie_version:Ak?Rm.documentMode||6:Im?+Im[1]:Nm?+Nm[1]:0,gecko:dy,gecko_version:dy?+(/Firefox\/(\d+)/.exec(ji.userAgent)||[0,0])[1]:0,chrome:!!mp,chrome_version:mp?+mp[1]:0,ios:py,android:/Android\b/.test(ji.userAgent),webkit:hy,safari:Tk,webkit_version:hy?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Rm.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sP=256;class lo extends Bn{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof lo)||this.length-(t-e)+r.length>sP||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new lo(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Jr(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return aP(this.dom,e,t)}}class is extends Bn{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if($k(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,o,s){return r&&(!(r instanceof is&&r.mark.eq(this.mark))||e&&o<=0||te&&t.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new is(this.mark,t,s)}domAtPos(e){return Pk(this,e)}coordsAt(e,t){return Rk(this,e,t)}}function aP(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&t<0||e==r&&t>=0?ft.chrome||ft.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return ft.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?vv(l,s<0):l||null}class Ss extends Bn{static create(e,t,r){return new Ss(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=Ss.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,o,s){return r&&(!(r instanceof Ss)||!this.widget.compare(r.widget)||e>0&&o<=0||t0)?Jr.before(this.dom):Jr.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?Jr.before(this.dom):Jr.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Pn.empty}get isHidden(){return!0}}lo.prototype.children=Ss.prototype.children=Ml.prototype.children=yv;function Pk(n,e){let t=n.dom,{children:r}=n,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==t)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof is&&i.length&&(r=i[i.length-1])instanceof is&&r.mark.eq(e.mark)?_k(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function Rk(n,e,t){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&t>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=u-d):(d-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let o of r)if(o!=t&&(i.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function Lm(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function cP(n){let e=Object.create(null);for(let t=0;t0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){bv(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){_k(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=Dm(t,this.attrs||{})),r&&(this.attrs=Dm({class:r},this.attrs||{}))}domAtPos(e){return Pk(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&($k(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),this.prevAttrs!==void 0&&(Lm(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Bn.get(i)instanceof is;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Bn.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ft.ios||!this.children.some(o=>o instanceof lo))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof lo)||/[^ -~]/.test(r.text))return null;let i=Qc(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=Rk(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=t){if(o instanceof xr)return o;if(s>t)break}i=s+o.breakAfter}return null}}class As extends Bn{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,o,s){return r&&(!(r instanceof As)||!this.widget.compare(r.widget)||e>0&&o<=0||t0}}class Js{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ai=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(ai||(ai={}));class Ct extends ba{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new xu(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Fs(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=Nk(e,t);r=(o?t?-3e8:-1:5e8)-1,i=(s?t?2e8:1:-6e8)+1}return new Fs(e,r,i,t,e.widget||null,!0)}static line(e){return new ju(e)}static set(e,t=!1){return wn.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ct.none=wn.empty;class xu extends Ct{constructor(e){let{start:t,end:r}=Nk(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof xu&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&bv(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}xu.prototype.point=!1;class ju extends Ct{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ju&&this.spec.class==e.spec.class&&bv(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ju.prototype.mapMode=ri.TrackBefore;ju.prototype.point=!0;class Fs extends Ct{constructor(e,t,r,i,o,s){super(t,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?t<=0?ri.TrackBefore:ri.TrackAfter:ri.TrackDel}get type(){return this.startSide!=this.endSide?ai.WidgetRange:this.startSide<=0?ai.WidgetBefore:ai.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Fs&&uP(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=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 super.range(e,t)}}Fs.prototype.point=!0;function Nk(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t!=null?t:e,end:r!=null?r:e}}function uP(n,e){return n==e||!!(n&&e&&n.compare(e))}function Bm(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class Ac{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof As&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new xr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(tf(new Ml(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof As)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(tf(new lo(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Fs){if(r.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")}let a=t-e;if(r instanceof Fs)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new As(r.widget||ja.block,a,r));else{let l=Ss.create(r.widget||ja.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(tf(new Ml(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(tf(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,r,i,o){let s=new Ac(e,t,r,o);return s.openEnd=wn.spans(i,t,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function tf(n,e){for(let t of e)n=new is(t,[n],n.length);return n}class ja extends Js{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}ja.inline=new ja("span");ja.block=new ja("div");var Kn=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Kn||(Kn={}));const $a=Kn.LTR,wv=Kn.RTL;function Ik(n){let e=[];for(let t=0;t=t){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromt:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function Lk(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(vo[m+1]==-h){let v=vo[m+2],g=v&2?i:v&4?v&1?o:i:0;g&&(Ln[f]=Ln[vo[m]]=g),a=m;break}}else{if(vo.length==189)break;vo[a++]=f,vo[a++]=d,vo[a++]=l}else if((p=Ln[f])==2||p==1){let m=p==i;l=m?0:1;for(let v=a-3;v>=0;v-=3){let g=vo[v+2];if(g&2)break;if(m)vo[v+2]|=2;else{if(g&4)break;vo[v+2]|=4}}}}}function gP(n,e,t,r){for(let i=0,o=r;i<=t.length;i++){let s=i?t[i-1].to:n,a=il;)p==v&&(p=t[--m].from,v=m?t[m-1].to:n),Ln[--p]=h;l=u}else o=c,l++}}}function Fm(n,e,t,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new Cs(l,m.from,h));let v=m.direction==$a!=!(h%2);qm(n,v?r+1:r,i,m.inner,m.from,m.to,s),l=m.to}p=m.to}else{if(p==t||(u?Ln[p]!=a:Ln[p]==a))break;p++}d?Fm(n,l,p,r+1,i,d,s):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=Ln[l-1];m!=a&&(u=!1,f=m==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let m=o[--c];if(!u)for(let v=m.from,g=c;;){if(v==e)break e;if(g&&o[g-1].to==v)v=o[--g].from;else{if(Ln[v-1]==a)break e;break}}if(d)d.push(m);else{m.toLn.length;)Ln[Ln.length]=256;let r=[],i=e==$a?0:1;return qm(n,i,i,t,0,n.length,r),r}function Bk(n){return[new Cs(0,n,0)]}let zk="";function yP(n,e,t,r,i){var o;let s=r.head-n.from,a=Cs.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,t);if(s==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],s=l.side(!i,t),c=l.side(i,t)}let u=Br(n.text,s,l.forward(i,t));(ul.to)&&(u=c),zk=n.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)n.some(e=>e)}),Kk=ot.define({combine:n=>n.some(e=>e)}),Gk=ot.define();class pl{constructor(e,t="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new pl(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new pl(_e.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const nf=cn.define({map:(n,e)=>n.map(e)});function si(n,e,t){let r=n.facet(Hk);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Ch=ot.define({combine:n=>n.length?n[0]:!0});let wP=0;const mc=ot.define();class ar{constructor(e,t,r,i,o){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=t||{};return new ar(wP++,e,r,i,a=>{let l=[mc.of(a)];return s&&l.push(Yc.of(c=>{let u=c.plugin(a);return u?s(u):Ct.none})),o&&l.push(o(a)),l})}static fromClass(e,t){return ar.define(r=>new e(r),t)}}class gp{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(si(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){si(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){si(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Qk=ot.define(),xv=ot.define(),Yc=ot.define(),Yk=ot.define(),jv=ot.define(),Xk=ot.define();function gy(n,e){let t=n.state.facet(Xk);if(!t.length)return t;let r=t.map(o=>o instanceof Function?o(n):o),i=[];return wn.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=bP(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const Zk=ot.define();function eS(n){let e=0,t=0,r=0,i=0;for(let o of n.state.facet(Zk)){let s=o(n);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(t=Math.max(t,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:t,top:r,bottom:i}}const gc=ot.define();class Di{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new Di(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new Di(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class md{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=jr.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new Di(o,s,a,l))),this.changedRanges=i}static create(e,t,r){return new md(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class vy extends Bn{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.compositionBarrier=Ct.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new xr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Di(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!MP(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?$P(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new Di(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ft.ie||ft.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=CP(s,a,e.changes);return r=Di.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=ft.chrome||ft.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,m;if(r&&r.range.fromBu){let x=Ac.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Ac.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=x.breakAtStart,p=x.openStart,m=w.openEnd;let $=this.compositionView(r);w.breakAtStart?$.breakAfter=1:w.content.length&&$.merge($.length,$.length,w.content[0],!1,w.openStart,0)&&($.breakAfter=w.content[0].breakAfter,w.content.shift()),x.content.length&&$.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),d=x.content.concat($).concat(w.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=Ac.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:v,off:g}=o.findPos(c,1),{i:b,off:y}=o.findPos(l,-1);Mk(this,b,y,v,g,d,h,p,m)}r&&this.fixCompositionDOM(r)}compositionView(e){let t=new lo(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new is(i,[t],t.length);let r=new xr;return r.append(t,0),r}fixCompositionDOM(e){let t=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Bn.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],t(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&Uf(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(ft.gecko&&a.empty&&!this.hasComposition&&jP(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Jr(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!Ec(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ec(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{ft.android&&ft.chrome&&this.dom.contains(u.focusNode)&&OP(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=hd(this.view.root);if(f)if(a.empty){if(ft.gecko){let d=kP(l.node,l.offset);if(d&&d!=3){let h=(d==1?Sk:Ck)(l.node,l.offset);h&&(l=new Jr(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Jr(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Jr(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&!this.compositionBarrier.size&&Ec(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=hd(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let s=xr.find(this,t.head);if(!s)return;let a=s.posAtStart;if(t.head==a||t.head==a+s.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc);r.collapse(u.node,u.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&r.collapse(i,o)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i=0;i--){let o=Bn.get(t.childNodes[i]);o instanceof xr&&(r=o.domAtPos(o.length))}return r?new Jr(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=Bn.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof xr&&!(r instanceof xr&&t>=0))&&(r=a,i=c),o=c}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof xr))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof lo))return null;let o=Br(i.text,r);if(o==r)return null;let s=xa(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Kn.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(t.push(h.height),s){let p=f.dom.lastChild,m=p?Qc(p):[];if(m.length){let v=m[m.length-1],g=l?v.right-h.left:h.right-v.left;g>a&&(a=g,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Kn.RTL:Kn.LTR}measureTextSize(){for(let o of this.children)if(o instanceof xr){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=Qc(e.firstChild)[0];t=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ok(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let o=i==t.viewports.length?null:t.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(t.lineBlockAt(s).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Ct.replace({widget:new yy(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Ct.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Yc).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(Yk).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(wn.join(i))),this.decorations=[this.compositionBarrier,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e{a.point?r=!1:a.endSide<0&&ot.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=eS(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;tP(this.view.scrollDOM,s,t.head{re.from&&(t=!0)}),t}function EP(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),o=e-i.from;if(i.length==0)return _e.cursor(e);o==0?t=1:o==i.length&&(t=-1);let s=o,a=o;t<0?s=Br(i.text,o,!1):a=Br(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=Br(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;an?e.left-n:Math.max(0,n-e.right)}function TP(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function vp(n,e){return n.tope.top+1}function by(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Hm(n,e,t){let r,i,o,s,a=!1,l,c,u,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Qc(p);for(let v=0;vy||s==y&&o>b){r=p,i=g,o=b,s=y;let x=y?t0?v0)}b==0?t>g.bottom&&(!u||u.bottomg.top)&&(c=p,f=g):u&&vp(u,g)?u=wy(u,g.bottom):f&&vp(f,g)&&(f=by(f,g.top))}}if(u&&u.bottom>=t?(r=l,i=u):f&&f.top<=t&&(r=c,i=f),!r)return{node:n,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return xy(r,d,t);if(a&&r.contentEditable!="false")return Hm(r,d,t);let h=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:h}}function xy(n,e,t){let r=n.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;at?u.top-t:t-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,h=d;if((ft.chrome||ft.gecko)&&xa(n,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:n,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:n,offset:i>-1?i:s>0?n.nodeValue.length:0}}function nS(n,e,t,r=-1){var i,o;let s=n.contentDOM.getBoundingClientRect(),a=s.top+n.viewState.paddingTop,l,{docHeight:c}=n.viewState,{x:u,y:f}=e,d=f-a;if(d<0)return 0;if(d>c)return n.state.doc.length;for(let x=n.viewState.heightOracle.textHeight/2,w=!1;l=n.elementAtHeight(d),l.type!=ai.Text;)for(;d=r>0?l.bottom+x:l.top-x,!(d>=0&&d<=c);){if(w)return t?null:0;w=!0,r=-r}f=a+d;let h=l.from;if(hn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:jy(n,s,l,u,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,v=m.elementFromPoint(u,f);v&&!n.contentDOM.contains(v)&&(v=null),v||(u=Math.max(s.left+1,Math.min(s.right-1,u)),v=m.elementFromPoint(u,f),v&&!n.contentDOM.contains(v)&&(v=null));let g,b=-1;if(v&&((i=n.docView.nearest(v))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let x=p.caretPositionFromPoint(u,f);x&&({offsetNode:g,offset:b}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(u,f);x&&({startContainer:g,startOffset:b}=x,(!n.contentDOM.contains(g)||ft.safari&&PP(g,b,u)||ft.chrome&&_P(g,b,u))&&(g=void 0))}}if(!g||!n.docView.dom.contains(g)){let x=xr.find(n.docView,h);if(!x)return d>l.top+l.height/2?l.to:l.from;({node:g,offset:b}=Hm(x.dom,u,f))}let y=n.docView.nearest(g);if(!y)return null;if(y.isWidget&&((o=y.dom)===null||o===void 0?void 0:o.nodeType)==1){let x=y.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight;o+=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a)*n.viewState.heightOracle.lineLength}let s=n.state.sliceDoc(t.from,t.to);return t.from+Am(s,o,n.state.tabSize)}function PP(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return xa(n,r-1,r).getBoundingClientRect().left>t}function _P(n,e,t){if(e!=0)return!1;for(let i=n;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=n.nodeType==1?n.getBoundingClientRect():xa(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function Um(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let r of t.type)if(r.to>e||r.to==e&&(r.to==t.to||r.type==ai.Text))return r}return t}function RP(n,e,t,r){let i=Um(n,e.head),o=!r||i.type!=ai.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),l=n.posAtCoords({x:t==(a==Kn.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return _e.cursor(l,t?-1:1)}return _e.cursor(t?i.to:i.from,t?-1:1)}function $y(n,e,t,r){let i=n.state.doc.lineAt(e.head),o=n.bidiSpans(i),s=n.textDirectionAt(i.from);for(let a=e,l=null;;){let c=yP(i,o,s,a,t),u=zk;if(!c){if(i.number==(t?n.state.doc.lines:1))return a;u=` -`,i=n.state.doc.line(i.number+(t?1:-1)),o=n.bidiSpans(i),c=n.visualLineSide(i,!t)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function NP(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return o=>{let s=r(o);return i==rr.Space&&(i=s),i==s}}function IP(n,e,t,r){let i=e.head,o=t?1:-1;if(i==(t?n.state.doc.length:0))return _e.cursor(i,e.assoc);let s=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(i,e.assoc||-1),u=n.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=n.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,n.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r!=null?r:n.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,m=nS(n,{x:f,y:p},!1,o);if(pl.bottom||(o<0?mi)){let v=n.docView.coordsForChar(m),g=!v||p{if(e>o&&ei(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:_e.cursor(r,rnull),ft.gecko&&ZP(e.contentDOM.ownerDocument)}handleEvent(e){!UP(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=LP(e),r=this.handlers,i=this.view.contentDOM;for(let o in t)if(o!="scroll"){let s=!t[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!t[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()r.keyCode==e.keyCode))&&!e.ctrlKey||BP.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:ft.safari&&!ft.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ky(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){si(t.state,i)}}}function LP(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&t(o).handlers.push(ky(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&t(o).observers.push(ky(r.value,s))}}for(let r in co)t(r).handlers.push(co[r]);for(let r in Vi)t(r).observers.push(Vi[r]);return e}const rS=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],BP="dthko",iS=[16,17,18,20,91,92,224,225],rf=6;function of(n){return Math.max(0,n)*.7+8}function zP(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class FP{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=nP(e.contentDOM),this.atoms=e.state.facet(jv).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(vn.allowMultipleSelections)&&qP(e,t),this.dragging=HP(e,t)&&lS(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&zP(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,i=0,o=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},s=eS(this.view);e.clientX-s.left<=o.left+rf?r=-of(o.left-e.clientX):e.clientX+s.right>=o.right-rf&&(r=of(e.clientX-o.right)),e.clientY-s.top<=o.top+rf?i=-of(o.top-e.clientY):e.clientY+s.bottom>=o.bottom-rf&&(i=of(e.clientY-o.bottom)),this.setScrollSpeed(r,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;rthis.select(this.lastEvent),20)}}function qP(n,e){let t=n.state.facet(Fk);return t.length?t[0](e):ft.mac?e.metaKey:e.ctrlKey}function VP(n,e){let t=n.state.facet(qk);return t.length?t[0](e):ft.mac?!e.altKey:!e.ctrlKey}function HP(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=hd(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function UP(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=Bn.get(t))&&r.ignoreEvent(e))return!1;return!0}const co=Object.create(null),Vi=Object.create(null),oS=ft.ie&&ft.ie_version<15||ft.ios&&ft.webkit_version<604;function WP(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),sS(n,t.value)},50)}function sS(n,e){let{state:t}=n,r,i=1,o=t.toText(e),s=o.lines==t.selection.ranges.length;if(Wm!=null&&t.selection.ranges.every(l=>l.empty)&&Wm==o.toString()){let l=-1;r=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=t.toText((s?o.line(i++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:f},range:_e.cursor(c.from+f.length)}})}else s?r=t.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:_e.cursor(l.from+c.length)}}):r=t.replaceSelection(o);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Vi.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};co.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Vi.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Vi.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};co.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(Vk))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=GP(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new FP(n,e,t,r)),r&&n.observer.ignore(()=>jk(n.contentDOM));let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function Sy(n,e,t,r){if(r==1)return _e.cursor(e,t);if(r==2)return EP(n.state,e,t);{let i=xr.find(n.docView,e),o=n.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return an>=e.top&&n<=e.bottom,Cy=(n,e,t)=>aS(e,t)&&n>=t.left&&n<=t.right;function JP(n,e,t,r){let i=xr.find(n.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&Cy(t,r,s))return-1;let a=i.coordsAt(o,1);return a&&Cy(t,r,a)?1:s&&aS(r,s)?-1:1}function Oy(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:JP(n,t,e.clientX,e.clientY)}}const KP=ft.ie&&ft.ie_version<=11;let My=null,Ey=0,Ay=0;function lS(n){if(!KP)return n.detail;let e=My,t=Ay;return My=n,Ay=Date.now(),Ey=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Ey+1)%3:1}function GP(n,e){let t=Oy(n,e),r=lS(e),i=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),i=i.map(o.changes))},get(o,s,a){let l=Oy(n,o),c,u=Sy(n,l.pos,l.bias,r);if(t.pos!=l.pos&&!s){let f=Sy(n,t.pos,t.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=QP(i,l.pos))?c:a?i.addRange(u):_e.create([u])}}}function QP(n,e){for(let t=0;t=e)return _e.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}co.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=t.to||s<=t.from)&&(t=_e.range(o,s))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};co.dragend=n=>(n.inputState.draggedContent=null,!1);function Ty(n,e,t,r){if(!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,s=r&&o&&VP(n,e)?{from:o.from,to:o.to}:null,a={from:i,insert:t},l=n.state.changes(s?[s,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),n.inputState.draggedContent=null}co.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,o=()=>{++i==t.length&&Ty(n,e,r.filter(s=>s!=null).join(n.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(t[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Ty(n,e,r,!0),!0}return!1};co.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=oS?null:e.clipboardData;return t?(sS(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(WP(n),!1)};function YP(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function XP(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:o}of n.selection.ranges){let s=n.doc.lineAt(o);s.number>i&&(e.push(s.text),t.push({from:s.from,to:Math.min(n.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:r}}let Wm=null;co.copy=co.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=XP(n.state);if(!t&&!i)return!1;Wm=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=oS?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(YP(n,t),!1)};const cS=hs.define();function uS(n,e){let t=[];for(let r of n.facet(Wk)){let i=r(n,e);i&&t.push(i)}return t?n.update({effects:t,annotations:cS.of(!0)}):null}function fS(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=uS(n.state,e);t?n.dispatch(t):n.update([])}},10)}Vi.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),fS(n)};Vi.blur=n=>{n.observer.clearSelectionRange(),fS(n)};Vi.compositionstart=Vi.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0,n.docView.maybeCreateCompositionBarrier()&&(n.update([]),n.docView.clearCompositionBarrier()))};Vi.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,ft.chrome&&ft.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Vi.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};co.beforeinput=(n,e)=>{var t;let r;if(ft.chrome&&ft.android&&(r=rS.find(i=>i.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return ft.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),ft.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Vi.compositionend(n,e),20),!1};const Py=new Set;function ZP(n){Py.has(n)||(Py.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const _y=["pre-wrap","normal","pre-line","break-spaces"];class e_{constructor(e){this.lineWrapping=e,this.doc=Pn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return _y.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Jf&&(e.heightChanged=!0),this.height=t)}replace(e,t,r){return li.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Un.ByPosNoHeight,r.setDoc(t),0,0),h=d.to>=c?d:o.lineAt(c,Un.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class xi extends dS{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new $o(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof xi||i instanceof _r&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _r?i=new xi(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):li.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class _r extends li{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,t,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof _r?r[r.length-1]=new _r(o.length+i):r.push(null,new _r(i-1))}if(e>0){let o=r[0];o instanceof _r?r[0]=new _r(e+o.length):r.unshift(new _r(e-1),null)}return li.of(r)}decomposeLeft(e,t){t.push(new _r(e-1),null)}decomposeRight(e,t){t.push(null,new _r(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let o=t+this.length;if(i&&i.from<=t+this.length&&i.more){let s=[],a=Math.max(t,i.from),l=-1;for(i.from>t&&s.push(new _r(i.from-t-1).updateHeight(e,t));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=Jf&&(l=-2);let d=new xi(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new _r(o-a).updateHeight(e,a));let c=li.of(s);return(l<0||Math.abs(c.height-this.height)>=Jf||Math.abs(l-this.heightMetrics(e,t).perLine)>=Jf)&&(e.heightChanged=!0),c}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class n_ extends li{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let o=r+this.left.height;return ea))return c;let u=t==Un.ByPosNoHeight?Un.ByPosNoHeight:Un.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,t,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,t,r,a,l,s);else{let c=this.lineAt(l,Un.ByPos,r,i,o);e=e&&c.from<=t&&s(c),t>c.to&&this.right.forEachLine(c.to+1,t,r,a,l,s)}}replace(e,t,r){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&Ry(o,s-1),t=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?li.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)}updateHeight(e,t=0,r=!1,i){let{left:o,right:s}=this,a=t+o.length+this.break,l=null;return i&&i.from<=t+o.length&&i.more?l=o=o.updateHeight(e,t,r,i):o.updateHeight(e,t,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ry(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof _r&&(r=n[e+1])instanceof _r&&n.splice(e-1,3,new _r(t.length+1+r.length))}const r_=5;class $v{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof xi?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new xi(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e=r_)&&this.addLineDeco(i,o,s)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new xi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new _r(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof xi)return e;let t=new xi(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof xi)&&!this.isCovered?this.nodes.push(new xi(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=c==n.parentNode?d.bottom:Math.min(l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-t.left,right:Math.max(o,s)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function a_(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class bp{constructor(e,t,r){this.from=e,this.to=t,this.size=r}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new e_(t),this.stateDeco=e.facet(Yc).filter(r=>typeof r!="function"),this.heightMap=li.empty().applyChanges(this.stateDeco,Pn.empty,this.heightOracle.setDoc(e.doc),[new Di(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ct.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new sf(o,s))}}this.viewports=e.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?Iy:new f_(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:vc(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Yc).filter(u=>typeof u!="function");let i=e.changedRanges,o=Di.extendWithRanges(i,i_(r,this.stateDeco,e?e.changes:jr.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&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&&!e.state.facet(Kk)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Kn.RTL:Kn.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=t.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:x,scaleY:w}=xk(t,a);(x>.005&&Math.abs(this.scaleX-x)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=x,this.scaleY=w,c|=8,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=kk(e.scrollDOM);let p=(this.printing?a_:s_)(t,this.paddingTop),m=p.top-this.pixelViewport.top,v=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let x=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(x)&&(s=!0),s||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:$,textHeight:S}=e.docView.measureTextSize();s=w>0&&i.refresh(o,w,$,S,b/$,x),s&&(e.docView.minWidth=0,c|=8)}m>0&&v>0?u=Math.max(m,v):m<0&&v<0&&(u=Math.min(m,v)),i.heightChanged=!1;for(let w of this.viewports){let $=w.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(w);this.heightMap=(s?li.empty().applyChanges(this.stateDeco,Pn.empty,this.heightOracle,[new Di(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new t_(w.from,$))}i.heightChanged&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return y&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new sf(i.lineAt(s-r*1e3,Un.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Un.ByHeight,o,0,0).to);if(t){let{head:c}=t.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Un.ByPos,o,0,0),d;t.y=="center"?d=(f.top+f.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=Kn.LTR&&!r)return[];let a=[],l=(c,u,f,d)=>{if(u-cc&&vv.from>=f.from&&v.to<=f.to&&Math.abs(v.from-c)v.fromg));if(!m){if(uv.from<=u&&v.to>=u)){let v=t.moveToLineBoundary(_e.cursor(u),!1,!0).head;v>c&&(u=v)}m=new bp(c,u,this.gapSize(f,c,u,d))}a.push(m)};for(let c of this.viewportLines){if(c.lengthc.from&&l(c.from,d,c,u),ht.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];wn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){t.push({from:i,to:o})},point(){}},20);let r=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=t[o].from||i.to!=t[o].to);return this.visibleRanges=t,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||vc(this.heightMap.lineAt(e,Un.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return vc(this.heightMap.lineAt(this.scaler.fromDOM(e),Un.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return vc(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class sf{constructor(e,t){this.from=e,this.to=t}}function c_(n,e,t){let r=[],i=n,o=0;return wn.spans(t,n,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function lf(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function u_(n,e){for(let t of n)if(e(t))return t}const Iy={toDOM(n){return n},fromDOM(n){return n},scale:1};class f_{constructor(e,t,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=t.lineAt(a,Un.ByPos,e,0,0).top,u=t.lineAt(l,Un.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let o=tvc(i,e)):n._content)}const cf=ot.define({combine:n=>n.join(" ")}),Jm=ot.define({combine:n=>n.indexOf(!0)>-1}),Km=Bs.newName(),hS=Bs.newName(),pS=Bs.newName(),mS={"&light":"."+hS,"&dark":"."+pS};function Gm(n,e,t){return new Bs(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const d_=Gm("."+Km,{"&":{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,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",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 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .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":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&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",insetInlineStart: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-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".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"}},mS),yc="\uFFFF";class h_{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(vn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=yc}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=i.nextSibling;if(s==t)break;let a=Bn.get(i),l=Bn.get(s);(a&&l?a.breakAfter:(a?a.breakAfter:pd(i))||pd(s)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=s}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(t))&&(o=a.index,s=a[0].length),this.append(t.slice(r,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let t=Bn.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(p_(e,r.node,r.offset)?t:0))}}function p_(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let a=o||s?[]:y_(e),l=new h_(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=b_(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!_m(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!_m(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((ft.ios||ft.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||ft.android&&e.text.length=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:(ft.mac||ft.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=_e.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Pn.of([" "])}):ft.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` - `&&n.lineWrapping&&(r&&(r=_e.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Pn.of([" "])}),t){if(ft.ios&&n.inputState.flushIOSKey(t)||ft.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&n.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&hl(n.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||o==8&&t.insert.lengthi.head)&&hl(n.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&hl(n.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let a,l=()=>a||(a=g_(n,t,r));return n.state.facet(Uk).some(c=>c(n,t.from,t.to,s,l))||n.dispatch(l()),!0}else if(r&&!r.main.eq(i)){let s=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(s=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function g_(n,e,t){let r,i=n.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+l))}else{let a=i.changes(e),l=t&&t.main.to<=a.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=n.state.sliceDoc(e.from,e.to),u,f=t&&tS(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=n.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:l||p.map(a)};let m=p.to-d,v=m-c.length;if(p.to-p.from!=h||n.state.sliceDoc(v,m)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let g=i.changes({from:v,to:m,insert:e.insert}),b=p.to-o.to;return{changes:g,range:l?_e.range(Math.max(0,l.anchor+b),Math.max(0,l.head+b)):p.map(g)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,s+=".compose",n.inputState.compositionFirstChange&&(s+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function v_(n,e,t,r){let i=Math.min(n.length,e.length),o=0;for(;o0&&a>0&&n.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));t-=s+l-o}return s=s?o-t:0,a=o+(a-s),s=o):a=a?o-t:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}function y_(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new Dy(t,r)),(i!=t||o!=r)&&e.push(new Dy(i,o))),e}function b_(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?_e.single(t+e,r+e):null}const w_={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},wp=ft.ie&&ft.ie_version<=11;class x_{constructor(e){this.view=e,this.active=!1,this.selectionRange=new rP,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.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(ft.ie&&ft.ie_version<=11||ft.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),wp&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.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),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){e.type=="change"&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ch)?r.root.activeElement!=this.dom:!Uf(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ft.ie&&ft.ie_version<=11||ft.android&&ft.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Ec(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ft.safari&&e.root.nodeType==11&&ZT(this.dom.ownerDocument)==this.dom&&j_(this.view)||hd(e.root);if(!t||this.selectionRange.eq(t))return!1;let r=Uf(this.dom,t);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&hl(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);!s||(s.typeOver&&(i=!0),t==-1?{from:t,to:r}=s:(t=Math.min(s.from,t),r=Math.max(s.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Uf(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new m_(this.view,e,t,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=gS(this.view,t);return this.view.state==r&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=Ly(t,e.previousSibling||e.target.previousSibling,-1),i=Ly(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Ly(n,e,t){for(;e;){let r=Bn.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function j_(n){let e=null;function t(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,a=n.docView.domAtPos(n.state.selection.main.anchor);return Ec(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}class Ze{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(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.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(r=>r.forEach(i=>t(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||iP(e.parent)||document,this.viewState=new Ny(e.state||vn.create(e)),e.scrollTo&&e.scrollTo.is(nf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(mc).map(r=>new gp(r));for(let r of this.plugins)r.update(this);this.observer=new x_(this),this.inputState=new DP(this),this.inputState.ensureHandlers(this.plugins),this.docView=new vy(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof $r?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(cS))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=uS(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(vn.phrases)!=this.state.facet(vn.phrases))return this.setState(o);i=md.create(this,o,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new pl(h.empty?h:_e.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(nf)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=gd.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(gc)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(cf)!=i.state.facet(cf)&&(this.viewState.mustMeasureContent=!0),(t||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Vm))try{d(i)}catch(h){si(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!gS(this,u)&&c.force&&hl(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Ny(e),this.plugins=e.facet(mc).map(r=>new gp(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new vy(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(mc),r=e.state.facet(mc);if(t!=r){let i=[];for(let o of r){let s=t.indexOf(o);if(s<0)i.push(new gp(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(kk(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return si(this.state,p),By}}),f=md.create(this,this.state,[]),d=!1;f.flags|=l,t?t.flags|=l:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Vm))a(t)}get themeClasses(){return Km+" "+(this.state.facet(Jm)?pS:hS)+" "+this.state.facet(cf)}updateAttrs(){let e=zy(this,Qk,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ch)?"true":"false",class:"cm-content",style:`${ft.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),zy(this,xv,t);let r=this.observer.ignore(()=>{let i=Lm(this.contentDOM,this.contentAttrs,t),o=Lm(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(Ze.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(gc);let e=this.state.facet(Ze.cspNonce);Bs.mount(this.root,this.styleModules.concat(d_).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tr.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return yp(this,e,$y(this,e,t,r))}moveByGroup(e,t){return yp(this,e,$y(this,e,t,r=>NP(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[t?r.length-1:0];return _e.cursor(o.side(t,i)+e.from,o.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return RP(this,e,t,r)}moveVertically(e,t,r){return yp(this,e,IP(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),nS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Cs.find(o,e-i.from,-1,t)];return vv(r,s.dir==Kn.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Jk)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>$_)return Bk(e.length);let t=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||Lk(o.isolates,r=gy(this,e))))return o.order;r||(r=gy(this,e));let i=vP(e.text,t,r);return this.bidiCache.push(new gd(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ft.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{jk(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return nf.of(new pl(typeof e=="number"?_e.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return nf.of(new pl(_e.cursor(r.from),"start","start",r.top-e,t,!0))}static domEventHandlers(e){return ar.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ar.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Bs.newName(),i=[cf.of(r),gc.of(Gm(`.${r}`,e))];return t&&t.dark&&i.push(Jm.of(!0)),i}static baseTheme(e){return Ba.lowest(gc.of(Gm("."+Km,e,mS)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&Bn.get(r)||Bn.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}Ze.styleModule=gc;Ze.inputHandler=Uk;Ze.scrollHandler=Gk;Ze.focusChangeEffect=Wk;Ze.perLineTextDirection=Jk;Ze.exceptionSink=Hk;Ze.updateListener=Vm;Ze.editable=Ch;Ze.mouseSelectionStyle=Vk;Ze.dragMovesSelection=qk;Ze.clickAddsSelectionRange=Fk;Ze.decorations=Yc;Ze.outerDecorations=Yk;Ze.atomicRanges=jv;Ze.bidiIsolatedRanges=Xk;Ze.scrollMargins=Zk;Ze.darkTheme=Jm;Ze.cspNonce=ot.define({combine:n=>n.length?n[0]:""});Ze.contentAttributes=xv;Ze.editorAttributes=Qk;Ze.lineWrapping=Ze.contentAttributes.of({class:"cm-lineWrapping"});Ze.announce=cn.define();const $_=4096,By={};class gd{constructor(e,t,r,i,o,s){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Kn.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(n):o;s&&Dm(s,t)}return t}const k_=ft.mac?"mac":ft.windows?"win":ft.linux?"linux":"key";function S_(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),t}function O_(n,e,t){return yS(vS(n.state),e,n,t)}let xs=null;const M_=4e3;function E_(n,e=k_){let t=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=t[s]||(t[s]=Object.create(null)),p=a.split(/ (?!$)/).map(g=>S_(g,e));for(let g=1;g{let x=xs={view:y,prefix:b,scope:s};return setTimeout(()=>{xs==x&&(xs=null)},M_),!0}]})}let m=p.join(" ");i(m,!1);let v=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),u&&(v.stopPropagation=!0)};for(let s of n){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in u)u[f].run.push(s.any)}let l=s[e]||s.key;if(!!l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return t}function yS(n,e,t,r){let i=XT(e),o=Rr(i,0),s=Pi(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;xs&&xs.view==t&&xs.scope==r&&(a=xs.prefix+" ",iS.indexOf(e.keyCode)<0&&(c=!0,xs=null));let f=new Set,d=v=>{if(v){for(let g of v.run)if(!f.has(g)&&(f.add(g),g(t,e)))return v.stopPropagation&&(u=!0),!0;v.preventDefault&&(v.stopPropagation&&(u=!0),c=!0)}return!1},h=n[r],p,m;return h&&(d(h[a+uf(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ft.windows&&e.ctrlKey&&e.altKey)&&(p=zs[e.keyCode])&&p!=i?(d(h[a+uf(p,e,!0)])||e.shiftKey&&(m=Gc[e.keyCode])!=i&&m!=p&&d(h[a+uf(m,e,!1)]))&&(l=!0):s&&e.shiftKey&&d(h[a+uf(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),l}class $u{constructor(e,t,r,i,o){this.className=e,this.left=t,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=bS(e);return[new $u(t,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return A_(e,t,r)}}function bS(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Kn.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function qy(n,e,t){let r=_e.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(r,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(r,!0,!0).from),type:ai.Text}}function A_(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),o=n.textDirection==Kn.LTR,s=n.contentDOM,a=s.getBoundingClientRect(),l=bS(n),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=Um(n,r),p=Um(n,i),m=h.type==ai.Text?h:null,v=p.type==ai.Text?p:null;if(m&&(n.lineWrapping||h.widgetLineBreaks)&&(m=qy(n,r,m)),v&&(n.lineWrapping||p.widgetLineBreaks)&&(v=qy(n,i,v)),m&&v&&m.from==v.from)return b(y(t.from,t.to,m));{let w=m?y(t.from,null,m):x(h,!1),$=v?y(null,t.to,v):x(p,!0),S=[];return(m||h).to<(v||p).from-(m&&v?1:0)||h.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2<$.top?S.push(g(f,w.bottom,d,$.top)):w.bottom<$.top&&n.elementAtHeight((w.bottom+$.top)/2).type==ai.Text&&(w.bottom=$.top=(w.bottom+$.top)/2),b(w).concat(S).concat(b($))}function g(w,$,S,_){return new $u(e,w-l.left,$-l.top-.01,S-w,_-$+.01)}function b({top:w,bottom:$,horizontal:S}){let _=[];for(let F=0;FD&&q.from=K)break;O>X&&W(Math.max(B,X),w==null&&B<=D,Math.min(O,K),$==null&&O>=U,T.dir)}if(X=Y.to+1,X>=K)break}return I.length==0&&W(D,w==null,U,$==null,n.textDirection),{top:_,bottom:F,horizontal:I}}function x(w,$){let S=a.top+($?w.top:w.bottom);return{top:S,bottom:S,horizontal:[]}}}function T_(n,e){return n.constructor==e.constructor&&n.eq(e)}class P_{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Kf)!=e.state.facet(Kf)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(Kf);for(;t!T_(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Kf=ot.define();function wS(n){return[ar.define(e=>new P_(e,n)),Kf.of(n)]}const xS=!ft.ios,Xc=ot.define({combine(n){return Wi(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function __(n={}){return[Xc.of(n),R_,N_,I_,Kk.of(!0)]}function jS(n){return n.startState.facet(Xc)!=n.state.facet(Xc)}const R_=wS({above:!0,markers(n){let{state:e}=n,t=e.facet(Xc),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||xS:t.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:_e.cursor(i.head,i.head>i.anchor?-1:1);for(let l of $u.forRange(n,s,a))r.push(l)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=jS(n);return t&&Vy(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Vy(e.state,n)},class:"cm-cursorLayer"});function Vy(n,e){e.style.animationDuration=n.facet(Xc).cursorBlinkRate+"ms"}const N_=wS({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:$u.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||jS(n)},class:"cm-selectionLayer"}),Qm={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};xS&&(Qm[".cm-line"].caretColor="transparent !important",Qm[".cm-content"]={caretColor:"transparent !important"});const I_=Ba.highest(Ze.theme(Qm)),$S=cn.define({map(n,e){return n==null?null:e.mapPos(n)}}),bc=kr.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is($S)?r.value:t,n)}}),D_=ar.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(bc);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(bc)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(bc),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(bc)!=n&&this.view.dispatch({effects:$S.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function L_(){return[bc,D_]}function Hy(n,e,t,r,i){e.lastIndex=0;for(let o=n.iterRange(t,r),s=t,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function B_(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:o}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),o=Math.min(n.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class z_{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let t=new Ro,r=t.add.bind(t);for(let{from:i,to:o}of B_(e,this.maxLength))Hy(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(g.range(m,v));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(v,e,m,p));t=t.update({filterFrom:u,filterTo:f,filter:(m,v)=>mf,add:d})}}return t}}const Ym=/x/.unicode!=null?"gu":"g",F_=new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Ym),q_={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"};let xp=null;function V_(){var n;if(xp==null&&typeof document!="undefined"&&document.body){let e=document.body.style;xp=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return xp||!1}const Gf=ot.define({combine(n){let e=Wi(n,{render:null,specialChars:F_,addSpecialChars:null});return(e.replaceTabs=!V_())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ym)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ym)),e}});function H_(n={}){return[Gf.of(n),U_()]}let Uy=null;function U_(){return Uy||(Uy=ar.fromClass(class{constructor(n){this.view=n,this.decorations=Ct.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Gf)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new z_({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,o=Rr(e[0],0);if(o==9){let s=i.lineAt(r),a=t.state.tabSize,l=Hl(s.text,a,r-s.from);return Ct.replace({widget:new G_((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Ct.replace({widget:new K_(n,o)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Gf);n.startState.facet(Gf)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const W_="\u2022";function J_(n){return n>=32?W_:n==10?"\u2424":String.fromCharCode(9216+n)}class K_ extends Js{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=J_(this.code),r=e.state.phrase("Control character")+" "+(q_[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let o=document.createElement("span");return o.textContent=t,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class G_ extends Js{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Q_(){return X_}const Y_=Ct.line({class:"cm-activeLine"}),X_=ar.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(Y_.range(i.from)),e=i.from)}return Ct.set(t)}},{decorations:n=>n.decorations}),Xm=2e3;function Z_(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),o=[];if(e.off>Xm||t.off>Xm||e.col<0||t.col<0){let s=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=i;l++){let c=n.doc.line(l);c.length<=a&&o.push(_e.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=i;l++){let c=n.doc.line(l),u=Am(c.text,s,n.tabSize,!0);if(u<0)o.push(_e.cursor(c.to));else{let f=Am(c.text,a,n.tabSize);o.push(_e.range(c.from+u,c.from+f))}}}return o}function eR(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Wy(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,o=i>Xm?-1:i==r.length?eR(n,e.clientX):Hl(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:o,off:i}}function tR(n,e){let t=Wy(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(t.line).from),s=i.state.doc.lineAt(o);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=Wy(n,i);if(!a)return r;let l=Z_(n.state,t,a);return l.length?s?_e.create(l.concat(r.ranges)):_e.create(l):r}}:null}function nR(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return Ze.mouseSelectionStyle.of((t,r)=>e(r)?tR(t,r):null)}const rR={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},iR={style:"cursor: crosshair"};function oR(n={}){let[e,t]=rR[n.key||"Alt"],r=ar.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,Ze.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?iR:null})]}const ac="-10000px";class kS{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,t){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=t?[]:null;for(let l=0;lt[c]=l),t.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function sR(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const jp=ot.define({combine:n=>{var e,t,r;return{position:ft.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||sR}}}),Jy=new WeakMap,kv=ar.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(jp);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new kS(n,Oh,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){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}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(jp);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.insertBefore(i,r)}return t.dom.style.position=this.position,t.dom.style.top=ac,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ft.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==ac&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(jp).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:r}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:t,space:r,scaleX:i,scaleY:o}=n,s=[];for(let a=0;a=Math.min(t.bottom,r.bottom)||f.rightMath.min(t.right,r.right)+.1){u.style.top=ac;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,v=(e=Jy.get(c))!==null&&e!==void 0?e:d.bottom-d.top,g=c.offset||lR,b=this.view.textDirection==Kn.LTR,y=d.width>r.right-r.left?b?r.left:r.right-d.width:b?Math.min(f.left-(h?14:0)+g.x,r.right-m):Math.max(r.left,f.left-m+(h?14:0)-g.x),x=this.above[a];!l.strictSide&&(x?f.top-(d.bottom-d.top)-g.yr.bottom)&&x==r.bottom-f.bottom>f.top-r.top&&(x=this.above[a]=!x);let w=(x?f.top-r.top:r.bottom-f.bottom)-p;if(wy&&_.top<$+v&&_.bottom>$&&($=x?_.top-v-2-p:_.bottom+p+2);if(this.position=="absolute"?(u.style.top=($-n.parent.top)/o+"px",u.style.left=(y-n.parent.left)/i+"px"):(u.style.top=$/o+"px",u.style.left=y/i+"px"),h){let _=f.left+(b?g.x:-g.x)-(y+14-7);h.style.left=_/i+"px"}c.overlap!==!0&&s.push({left:y,top:$,right:S,bottom:$+v}),u.classList.toggle("cm-tooltip-above",x),u.classList.toggle("cm-tooltip-below",!x),c.positioned&&c.positioned(n.space)}}maybeMeasure(){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)))for(let n of this.manager.tooltipViews)n.dom.style.top=ac}},{eventObservers:{scroll(){this.maybeMeasure()}}}),aR=Ze.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&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:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),lR={x:0,y:0},Oh=ot.define({enables:[kv,aR]}),yd=ot.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Mh{static create(e){return new Mh(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new kS(e,yd,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const cR=Oh.compute([yd],n=>{let e=n.facet(yd);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:Mh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class uR{constructor(e,t,r,i,o){this.view=e,this.source=t,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:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||t.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==Kn.RTL?-1:1;o=t.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>si(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(kv),t=e?e.manager.tooltips.findIndex(r=>r.create==Mh.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!fR(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!dR(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const ff=4;function fR(n,e){let t=n.getBoundingClientRect();return e.clientX>=t.left-ff&&e.clientX<=t.right+ff&&e.clientY>=t.top-ff&&e.clientY<=t.bottom+ff}function dR(n,e,t,r,i,o){let s=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=e&&l<=t}function hR(n,e={}){let t=cn.define(),r=kr.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,ri.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(t)&&(i=s.value),s.is(pR)&&(i=[]);return i},provide:i=>yd.from(i)});return[r,ar.define(i=>new uR(i,n,r,t,e.hoverTime||300)),cR]}function SS(n,e){let t=n.plugin(kv);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const pR=cn.define(),Ky=ot.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Zc(n,e){let t=n.plugin(CS),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const CS=ar.fromClass(class{constructor(n){this.input=n.state.facet(eu),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Ky);this.top=new df(n,!0,e.topContainer),this.bottom=new df(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Ky);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new df(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new df(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(eu);if(t!=this.input){let r=t.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(n.view),a.push(u)):(u=this.panels[c],u.update&&u.update(n)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Ze.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class df{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Gy(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Gy(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Gy(n){let e=n.nextSibling;return n.remove(),e}const eu=ot.define({enables:CS});class No extends ba{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}No.prototype.elementClass="";No.prototype.toDOM=void 0;No.prototype.mapMode=ri.TrackBefore;No.prototype.startSide=No.prototype.endSide=-1;No.prototype.point=!0;const Qf=ot.define(),mR={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>wn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Tc=ot.define();function OS(n){return[MS(),Tc.of(Object.assign(Object.assign({},mR),n))]}const Zm=ot.define({combine:n=>n.some(e=>e)});function MS(n){let e=[gR];return n&&n.fixed===!1&&e.push(Zm.of(!0)),e}const gR=ar.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Tc).map(e=>new Yy(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Zm),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Zm)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=wn.iter(this.view.state.facet(Qf),this.view.viewport.from),r=[],i=this.gutters.map(o=>new vR(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ai.Text&&s){eg(t,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ai.Text){eg(t,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(Tc),t=n.state.facet(Tc),r=n.docChanged||n.heightChanged||n.viewportChanged||!wn.eq(n.startState.facet(Qf),n.state.facet(Qf),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let o of t){let s=e.indexOf(o);s<0?i.push(new Yy(this.view,o)):(this.gutters[s].update(n),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Ze.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Kn.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Qy(n){return Array.isArray(n)?n:[n]}function eg(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class vR{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=wn.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,o=(t.top-this.height)/e.scaleY,s=t.height/e.scaleY;if(this.i==i.elements.length){let a=new ES(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];eg(this.cursor,i,t.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,t,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t);r&&this.addElement(e,t,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Yy{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Qy(t.markers(e)),t.initialSpacer&&(this.spacer=new ES(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Qy(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!wn.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class ES{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),yR(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class $p extends No{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function kp(n,e){return n.state.facet(nl).formatNumber(e,n.state)}const wR=Tc.compute([nl],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(bR)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new $p(kp(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(nl)!=e.state.facet(nl),initialSpacer(e){return new $p(kp(e,Xy(e.state.doc.lines)))},updateSpacer(e,t){let r=kp(t.view,Xy(t.view.state.doc.lines));return r==e.number?e:new $p(r)},domEventHandlers:n.facet(nl).domEventHandlers}));function xR(n={}){return[nl.of(n),MS(),wR]}function Xy(n){let e=9;for(;e{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(jR.range(i)))}return wn.of(e)});function kR(){return $R}const AS=1024;let SR=0;class Sp{constructor(e,t){this.from=e,this.to=t}}class mn{constructor(e={}){this.id=SR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pi.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}mn.closedBy=new mn({deserialize:n=>n.split(" ")});mn.openedBy=new mn({deserialize:n=>n.split(" ")});mn.group=new mn({deserialize:n=>n.split(" ")});mn.isolate=new mn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});mn.contextHash=new mn({perNode:!0});mn.lookAhead=new mn({perNode:!0});mn.mounted=new mn({perNode:!0});class bd{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[mn.mounted.id]}}const CR=Object.create(null);class pi{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):CR,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pi(e.name||"",t,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(mn.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(mn.group),o=-1;o<(i?i.length:0);o++){let s=t[o<0?r.name:i[o]];if(s)return s}}}}pi.none=new pi("",Object.create(null),0,8);class Sv{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(s|Or.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Mv(pi.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new vr(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new vr(pi.none,t,r,i)))}static build(e){return AR(e)}}vr.empty=new vr(pi.none,[],[],0);class Cv{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Cv(this.buffer,this.index)}}class qs{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return pi.none}toString(){let e=[];for(let t=0;t0));l=s[l+3]);return a}slice(e,t,r){let i=this.buffer,o=new Uint16Array(t-e),s=0;for(let a=e,l=0;a=e&&te;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function tu(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?a.length:-1;e!=c;e+=t){let u=a[e],f=l[e]+s.from;if(!!TS(i,r,f,f+u.length)){if(u instanceof qs){if(o&Or.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,t,r-f,i);if(d>-1)return new Os(new OR(s,u,e,f),null,d)}else if(o&Or.IncludeAnonymous||!u.type.isAnonymous||Ov(u)){let d;if(!(o&Or.IgnoreMounts)&&(d=bd.get(u))&&!d.overlay)return new Li(d.tree,f,e,s);let h=new Li(u,f,e,s);return o&Or.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(t<0?u.children.length-1:0,t,r,i)}}}if(o&Or.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let i;if(!(r&Or.IgnoreOverlays)&&(i=bd.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((t>0?s<=o:s=o:a>o))return new Li(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function eb(n,e,t,r){let i=n.cursor(),o=[];if(!i.firstChild())return o;if(t!=null){for(let s=!1;!s;)if(s=i.type.is(t),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function tg(n,e,t=e.length-1){for(let r=n.parent;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class OR{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class Os extends PS{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return o<0?null:new Os(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&Or.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new Os(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Os(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Os(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),t.push(0)}return new vr(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function _S(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;ot.from||s.to=e){let a=new Li(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(tu(a,e,t,!1))}}return i?_S(i):r}class ng{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Li)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.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}yield(e){return e?e instanceof Li?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&Or.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Or.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(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)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=t+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&Or.IncludeAnonymous||a instanceof qs||!a.type.isAnonymous||Ov(a))return!1}return!0}move(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}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,r=o+1;break e}i=this.stack[--o]}}for(let i=r;i=0;o--){if(o<0)return tg(this.node,e,i);let s=r[t.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function Ov(n){return n.children.some(e=>e instanceof qs||!e.type.isAnonymous||Ov(e))}function AR(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=AS,reused:o=[],minRepeatType:s=r.types.length}=n,a=Array.isArray(t)?new Cv(t,t.length):t,l=r.types,c=0,u=0;function f(w,$,S,_,F,I){let{id:W,start:D,end:U,size:q}=a,X=u;for(;q<0;)if(a.next(),q==-1){let O=o[W];S.push(O),_.push(D-w);return}else if(q==-3){c=W;return}else if(q==-4){u=W;return}else throw new RangeError(`Unrecognized record size: ${q}`);let K=l[W],Y,T,B=D-w;if(U-D<=i&&(T=v(a.pos-$,F))){let O=new Uint16Array(T.size-T.skip),A=a.pos-T.size,te=O.length;for(;a.pos>A;)te=g(T.start,O,te);Y=new qs(O,U-T.start,r),B=T.start-w}else{let O=a.pos-q;a.next();let A=[],te=[],R=W>=s?W:-1,k=0,P=U;for(;a.pos>O;)R>=0&&a.id==R&&a.size>=0?(a.end<=P-i&&(p(A,te,D,k,a.end,P,R,X),k=A.length,P=a.end),a.next()):I>2500?d(D,O,A,te):f(D,O,A,te,R,I+1);if(R>=0&&k>0&&k-1&&k>0){let H=h(K);Y=Mv(K,A,te,0,A.length,0,U-D,H,H)}else Y=m(K,A,te,U-D,X-U)}S.push(Y),_.push(B)}function d(w,$,S,_){let F=[],I=0,W=-1;for(;a.pos>$;){let{id:D,start:U,end:q,size:X}=a;if(X>4)a.next();else{if(W>-1&&U=0;q-=3)D[X++]=F[q],D[X++]=F[q+1]-U,D[X++]=F[q+2]-U,D[X++]=X;S.push(new qs(D,F[2]-U,r)),_.push(U-w)}}function h(w){return($,S,_)=>{let F=0,I=$.length-1,W,D;if(I>=0&&(W=$[I])instanceof vr){if(!I&&W.type==w&&W.length==_)return W;(D=W.prop(mn.lookAhead))&&(F=S[I]+W.length+D)}return m(w,$,S,_,F)}}function p(w,$,S,_,F,I,W,D){let U=[],q=[];for(;w.length>_;)U.push(w.pop()),q.push($.pop()+S-F);w.push(m(r.types[W],U,q,I-F,D-I)),$.push(F-S)}function m(w,$,S,_,F=0,I){if(c){let W=[mn.contextHash,c];I=I?[W].concat(I):[W]}if(F>25){let W=[mn.lookAhead,F];I=I?[W].concat(I):[W]}return new vr(w,$,S,_,I)}function v(w,$){let S=a.fork(),_=0,F=0,I=0,W=S.end-i,D={size:0,start:0,skip:0};e:for(let U=S.pos-w;S.pos>U;){let q=S.size;if(S.id==$&&q>=0){D.size=_,D.start=F,D.skip=I,I+=4,_+=4,S.next();continue}let X=S.pos-q;if(q<0||X=s?4:0,Y=S.start;for(S.next();S.pos>X;){if(S.size<0)if(S.size==-3)K+=4;else break e;else S.id>=s&&(K+=4);S.next()}F=Y,_+=q,I+=K}return($<0||_==w)&&(D.size=_,D.start=F,D.skip=I),D.size>4?D:void 0}function g(w,$,S){let{id:_,start:F,end:I,size:W}=a;if(a.next(),W>=0&&_4){let U=a.pos-(W-4);for(;a.pos>U;)S=g(w,$,S)}$[--S]=D,$[--S]=I-w,$[--S]=F-w,$[--S]=_}else W==-3?c=_:W==-4&&(u=_);return S}let b=[],y=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,b,y,-1,0);let x=(e=n.length)!==null&&e!==void 0?e:b.length?y[0]+b[0].length:0;return new vr(l[n.topID],b.reverse(),y.reverse(),x)}const tb=new WeakMap;function Yf(n,e){if(!n.isAnonymous||e instanceof qs||e.type!=n)return 1;let t=tb.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof vr)){t=1;break}t+=Yf(n,r)}tb.set(e,t)}return t}function Mv(n,e,t,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;$+=S}if(y==x+1){if($>u){let S=p[x];h(S.children,S.positions,0,S.children.length,m[x]+b);continue}f.push(p[x])}else{let S=m[y-1]+p[y-1].length-w;f.push(Mv(n,p,m,x,y,w,S,null,l))}d.push(w+b-o)}}return h(e,t,r,i,0),(a||l)(f,d,s)}class pa{constructor(e,t,r,i,o=!1,s=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new pa(0,e.length,e,0,!1,r)];for(let o of t)o.to>e.length&&i.push(o);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new pa(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew Sp(i.from,i.to)):[new Sp(0,0)]:[new Sp(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let o=i.advance();if(o)return o}}}class TR{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new mn({perNode:!0});let PR=0;class xo{constructor(e,t,r){this.set=e,this.base=t,this.modified=r,this.id=PR++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new xo([],null,[]);if(t.set.push(t),e)for(let r of e.set)t.set.push(r);return t}static defineModifier(){let e=new wd;return t=>t.modified.indexOf(e)>-1?t:wd.get(t.base||t,t.modified.concat(e).sort((r,i)=>r.id-i.id))}}let _R=0;class wd{constructor(){this.instances=[],this.id=_R++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&RR(t,a.modified));if(r)return r;let i=[],o=new xo(i,e,t);for(let a of t)a.instances.push(o);let s=NR(t);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(wd.get(a,l));return o}}function RR(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function NR(n){let e=[[]];for(let t=0;tr.length-t.length)}function NS(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new xd(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return IS.add(e)}const IS=new mn;class xd{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let a of o)for(let l of a.set){let c=t[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function IR(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function DR(n,e,t,r=0,i=n.length){let o=new LR(r,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),r,i,"",o.highlighters),o.flush(i)}class LR{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=t)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=BR(e)||xd.empty,f=IR(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(mn.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(v=>!v.scope||v.scope(d.tree.type)),m=e.firstChild();for(let v=0,g=a;;v++){let b=v=y||!e.nextSibling())););if(!b||y>r)break;g=b.to+a,g>t&&(this.highlightRange(h.cursor(),Math.max(t,b.from+a),Math.min(r,g),"",p),this.startSpan(Math.min(r,g),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function BR(n){let e=n.type.prop(IS);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Ke=xo.define,pf=Ke(),bs=Ke(),nb=Ke(bs),rb=Ke(bs),ws=Ke(),mf=Ke(ws),Cp=Ke(ws),wo=Ke(),Zs=Ke(wo),yo=Ke(),bo=Ke(),rg=Ke(),lc=Ke(rg),gf=Ke(),Ve={comment:pf,lineComment:Ke(pf),blockComment:Ke(pf),docComment:Ke(pf),name:bs,variableName:Ke(bs),typeName:nb,tagName:Ke(nb),propertyName:rb,attributeName:Ke(rb),className:Ke(bs),labelName:Ke(bs),namespace:Ke(bs),macroName:Ke(bs),literal:ws,string:mf,docString:Ke(mf),character:Ke(mf),attributeValue:Ke(mf),number:Cp,integer:Ke(Cp),float:Ke(Cp),bool:Ke(ws),regexp:Ke(ws),escape:Ke(ws),color:Ke(ws),url:Ke(ws),keyword:yo,self:Ke(yo),null:Ke(yo),atom:Ke(yo),unit:Ke(yo),modifier:Ke(yo),operatorKeyword:Ke(yo),controlKeyword:Ke(yo),definitionKeyword:Ke(yo),moduleKeyword:Ke(yo),operator:bo,derefOperator:Ke(bo),arithmeticOperator:Ke(bo),logicOperator:Ke(bo),bitwiseOperator:Ke(bo),compareOperator:Ke(bo),updateOperator:Ke(bo),definitionOperator:Ke(bo),typeOperator:Ke(bo),controlOperator:Ke(bo),punctuation:rg,separator:Ke(rg),bracket:lc,angleBracket:Ke(lc),squareBracket:Ke(lc),paren:Ke(lc),brace:Ke(lc),content:wo,heading:Zs,heading1:Ke(Zs),heading2:Ke(Zs),heading3:Ke(Zs),heading4:Ke(Zs),heading5:Ke(Zs),heading6:Ke(Zs),contentSeparator:Ke(wo),list:Ke(wo),quote:Ke(wo),emphasis:Ke(wo),strong:Ke(wo),link:Ke(wo),monospace:Ke(wo),strikethrough:Ke(wo),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:gf,documentMeta:Ke(gf),annotation:Ke(gf),processingInstruction:Ke(gf),definition:xo.defineModifier(),constant:xo.defineModifier(),function:xo.defineModifier(),standard:xo.defineModifier(),local:xo.defineModifier(),special:xo.defineModifier()};DS([{tag:Ve.link,class:"tok-link"},{tag:Ve.heading,class:"tok-heading"},{tag:Ve.emphasis,class:"tok-emphasis"},{tag:Ve.strong,class:"tok-strong"},{tag:Ve.keyword,class:"tok-keyword"},{tag:Ve.atom,class:"tok-atom"},{tag:Ve.bool,class:"tok-bool"},{tag:Ve.url,class:"tok-url"},{tag:Ve.labelName,class:"tok-labelName"},{tag:Ve.inserted,class:"tok-inserted"},{tag:Ve.deleted,class:"tok-deleted"},{tag:Ve.literal,class:"tok-literal"},{tag:Ve.string,class:"tok-string"},{tag:Ve.number,class:"tok-number"},{tag:[Ve.regexp,Ve.escape,Ve.special(Ve.string)],class:"tok-string2"},{tag:Ve.variableName,class:"tok-variableName"},{tag:Ve.local(Ve.variableName),class:"tok-variableName tok-local"},{tag:Ve.definition(Ve.variableName),class:"tok-variableName tok-definition"},{tag:Ve.special(Ve.variableName),class:"tok-variableName2"},{tag:Ve.definition(Ve.propertyName),class:"tok-propertyName tok-definition"},{tag:Ve.typeName,class:"tok-typeName"},{tag:Ve.namespace,class:"tok-namespace"},{tag:Ve.className,class:"tok-className"},{tag:Ve.macroName,class:"tok-macroName"},{tag:Ve.propertyName,class:"tok-propertyName"},{tag:Ve.operator,class:"tok-operator"},{tag:Ve.comment,class:"tok-comment"},{tag:Ve.meta,class:"tok-meta"},{tag:Ve.invalid,class:"tok-invalid"},{tag:Ve.punctuation,class:"tok-punctuation"}]);var Op;const rl=new mn;function zR(n){return ot.define({combine:n?e=>e.concat(n):void 0})}const FR=new mn;class no{constructor(e,t,r=[],i=""){this.data=e,this.name=i,vn.prototype.hasOwnProperty("tree")||Object.defineProperty(vn.prototype,"tree",{get(){return Yr(this)}}),this.parser=t,this.extension=[Vs.of(this),vn.languageData.of((o,s,a)=>{let l=ib(o,s,a),c=l.type.prop(rl);if(!c)return[];let u=o.facet(c),f=l.type.prop(FR);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,t,r=-1){return ib(e,t,r).type.prop(rl)==this.data}findRegions(e){let t=e.facet(Vs);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(rl)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(mn.mounted);if(a){if(a.tree.prop(rl)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?t:void 0)]}),e.name)}configure(e,t){return new jd(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Yr(n){let e=n.field(no.state,!1);return e?e.tree:vr.empty}class qR{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let cc=null;class $d{constructor(e,t,r=[],i,o,s,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new $d(e,t,[],vr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new qR(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=vr.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(pa.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=cc;cc=this;try{return e()}finally{cc=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ob(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=pa.applyChanges(r,l),i=vr.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=ob(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends RS{createParse(t,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=cc;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new vr(pi.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return cc}}function ob(n,e,t){return pa.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class El{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new El(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=$d.create(e.facet(Vs).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new El(r)}}no.state=kr.define({create:El.init,update(n,e){for(let t of e.effects)if(t.is(no.setState))return t.value;return e.startState.facet(Vs)!=e.state.facet(Vs)?El.init(e.state):n.apply(e)}});let LS=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback!="undefined"&&(LS=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Mp=typeof navigator!="undefined"&&((Op=navigator.scheduling)===null||Op===void 0?void 0:Op.isInputPending)?()=>navigator.scheduling.isInputPending():null,VR=ar.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(no.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(no.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=LS(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>Mp&&Mp()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:no.setState.of(new El(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>si(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Vs=ot.define({combine(n){return n.length?n[0]:null},enables:n=>[no.state,VR,Ze.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class HR{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const UR=ot.define(),Eh=ot.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Hs(n){let e=n.facet(Eh);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function nu(n,e){let t="",r=n.tabSize,i=n.facet(Eh)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let o=0;o=e?WR(n,t,e):null}class Ah{constructor(e,t={}){this.state=e,this.options=t,this.unit=Hs(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(t<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,t=e.length){return Hl(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const BS=new mn;function WR(n,e,t){let r=e.resolveStack(t),i=r.node.enterUnfinishedNodesBefore(t);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return zS(r,n,t)}function zS(n,e,t){for(let r=n;r;r=r.next){let i=KR(r.node);if(i)return i(Av.create(e,t,r))}return 0}function JR(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function KR(n){let e=n.type.prop(BS);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(mn.closedBy))){let i=n.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>XR(s,!0,1,void 0,o&&!JR(s)?i.from:void 0)}return n.parent==null?GR:null}function GR(){return 0}class Av extends Ah{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Av(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(QR(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return zS(this.context.next,this.base,this.pos)}}function QR(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function YR(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const ZR=200;function e9(){return vn.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+ZR)return n;let o=t.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return n;let{state:s}=n,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=Ev(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=nu(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[n,{changes:l,sequential:!0}]:n})}const t9=ot.define(),FS=new mn;function n9(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(o&&a.from=e&&c.to>t&&(o=c)}}return o}function i9(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function kd(n,e,t){for(let r of n.facet(t9)){let i=r(n,e,t);if(i)return i}return r9(n,e,t)}function qS(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const Th=cn.define({map:qS}),ku=cn.define({map:qS});function VS(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const ka=kr.define({create(){return Ct.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(Th)&&!o9(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(Tv),i=r?Ct.replace({widget:new d9(r(e.state,t.value))}):ab;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(ku)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,o)=>{ir&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return n},provide:n=>Ze.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>o)&&(i={from:o,to:s})}),i}function o9(n,e,t){let r=!1;return n.between(e,e,(i,o)=>{i==e&&o==t&&(r=!0)}),r}function HS(n,e){return n.field(ka,!1)?e:e.concat(cn.appendConfig.of(WS()))}const s9=n=>{for(let e of VS(n)){let t=kd(n.state,e.from,e.to);if(t)return n.dispatch({effects:HS(n.state,[Th.of(t),US(n,t)])}),!0}return!1},a9=n=>{if(!n.state.field(ka,!1))return!1;let e=[];for(let t of VS(n)){let r=Sd(n.state,t.from,t.to);r&&e.push(ku.of(r),US(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function US(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return Ze.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const l9=n=>{let{state:e}=n,t=[];for(let r=0;r{let e=n.state.field(ka,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(ku.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},u9=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:s9},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:a9},{key:"Ctrl-Alt-[",run:l9},{key:"Ctrl-Alt-]",run:c9}],f9={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Tv=ot.define({combine(n){return Wi(n,f9)}});function WS(n){let e=[ka,m9];return n&&e.push(Tv.of(n)),e}function JS(n,e){let{state:t}=n,r=t.facet(Tv),i=s=>{let a=n.lineBlockAt(n.posAtDOM(s.target)),l=Sd(n.state,a.from,a.to);l&&n.dispatch({effects:ku.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",t.phrase("folded code")),o.title=t.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const ab=Ct.replace({widget:new class extends Js{toDOM(n){return JS(n,null)}}});class d9 extends Js{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return JS(e,this.value)}}const h9={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Ep extends No{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function p9(n={}){let e=Object.assign(Object.assign({},h9),n),t=new Ep(e,!0),r=new Ep(e,!1),i=ar.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Vs)!=s.state.facet(Vs)||s.startState.field(ka,!1)!=s.state.field(ka,!1)||Yr(s.startState)!=Yr(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new Ro;for(let l of s.viewportLineBlocks){let c=Sd(s.state,l.from,l.to)?r:kd(s.state,l.from,l.to)?t:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,OS({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||wn.empty},initialSpacer(){return new Ep(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=Sd(s.state,a.from,a.to);if(c)return s.dispatch({effects:ku.of(c)}),!0;let u=kd(s.state,a.from,a.to);return u?(s.dispatch({effects:Th.of(u)}),!0):!1}})}),WS()]}const m9=Ze.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"}});class Su{constructor(e,t){this.specs=e;let r;function i(a){let l=Bs.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof no?a=>a.prop(rl)==s.data:s?a=>a==s:void 0,this.style=DS(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Bs(r):null,this.themeType=t.themeType}static define(e,t){return new Su(e,t||{})}}const ig=ot.define(),KS=ot.define({combine(n){return n.length?[n[0]]:null}});function Ap(n){let e=n.facet(ig);return e.length?e:n.facet(KS)}function GS(n,e){let t=[v9],r;return n instanceof Su&&(n.module&&t.push(Ze.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(KS.of(n)):r?t.push(ig.computeN([Ze.darkTheme],i=>i.facet(Ze.darkTheme)==(r=="dark")?[n]:[])):t.push(ig.of(n)),t}class g9{constructor(e){this.markCache=Object.create(null),this.tree=Yr(e.state),this.decorations=this.buildDeco(e,Ap(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Yr(e.state),r=Ap(e.state),i=r!=Ap(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ct.none;let r=new Ro;for(let{from:i,to:o}of e.visibleRanges)DR(this.tree,t,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=Ct.mark({class:l})))},i,o);return r.finish()}}const v9=Ba.high(ar.fromClass(g9,{decorations:n=>n.decorations})),y9=Su.define([{tag:Ve.meta,color:"#404740"},{tag:Ve.link,textDecoration:"underline"},{tag:Ve.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ve.emphasis,fontStyle:"italic"},{tag:Ve.strong,fontWeight:"bold"},{tag:Ve.strikethrough,textDecoration:"line-through"},{tag:Ve.keyword,color:"#708"},{tag:[Ve.atom,Ve.bool,Ve.url,Ve.contentSeparator,Ve.labelName],color:"#219"},{tag:[Ve.literal,Ve.inserted],color:"#164"},{tag:[Ve.string,Ve.deleted],color:"#a11"},{tag:[Ve.regexp,Ve.escape,Ve.special(Ve.string)],color:"#e40"},{tag:Ve.definition(Ve.variableName),color:"#00f"},{tag:Ve.local(Ve.variableName),color:"#30a"},{tag:[Ve.typeName,Ve.namespace],color:"#085"},{tag:Ve.className,color:"#167"},{tag:[Ve.special(Ve.variableName),Ve.macroName],color:"#256"},{tag:Ve.definition(Ve.propertyName),color:"#00c"},{tag:Ve.comment,color:"#940"},{tag:Ve.invalid,color:"#f00"}]),b9=Ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),QS=1e4,YS="()[]{}",XS=ot.define({combine(n){return Wi(n,{afterCursor:!0,brackets:YS,maxScanDistance:QS,renderMatch:j9})}}),w9=Ct.mark({class:"cm-matchingBracket"}),x9=Ct.mark({class:"cm-nonmatchingBracket"});function j9(n){let e=[],t=n.matched?w9:x9;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const $9=kr.define({create(){return Ct.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(XS);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Co(e.state,i.head,-1,r)||i.head>0&&Co(e.state,i.head-1,1,r)||r.afterCursor&&(Co(e.state,i.head,1,r)||i.headZe.decorations.from(n)}),k9=[$9,b9];function S9(n={}){return[XS.of(n),k9]}const C9=new mn;function og(n,e,t){let r=n.prop(e<0?mn.openedBy:mn.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function sg(n){let e=n.type.prop(C9);return e?e(n.node):n}function Co(n,e,t,r={}){let i=r.maxScanDistance||QS,o=r.brackets||YS,s=Yr(n),a=s.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=og(l.type,t,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return O9(n,e,t,l,u,c,o)}}return M9(n,e,t,s,a.type,i,o)}function O9(n,e,t,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(t<0?u.childBefore(r.from):u.childAfter(r.to)))do if(t<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;t<0&&(d+=h.length);let p=e+d*t;for(let m=t>0?0:h.length-1,v=t>0?h.length:-1;m!=v;m+=t){let g=s.indexOf(h[m]);if(!(g<0||r.resolveInner(p+m,1).type!=i))if(g%2==0==t>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:g>>1==l>>1};f--}}t>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const E9=Object.create(null),lb=[pi.none],cb=[],ub=Object.create(null),A9=Object.create(null);for(let[n,e]of[["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"]])A9[n]=T9(E9,e);function Tp(n,e){cb.indexOf(n)>-1||(cb.push(n),console.warn(e))}function T9(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||Ve[c];u?typeof u=="function"?l.length?l=l.map(u):Tp(c,`Modifier ${c} used at start of tag`):l.length?Tp(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Tp(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),o=ub[i];if(o)return o.id;let s=ub[i]=pi.define({id:lb.length,name:r,props:[NS({[r]:t})]});return lb.push(s),s.id}Kn.RTL,Kn.LTR;const P9=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=_v(n.state,t.from);return r.line?_9(n):r.block?N9(n):!1};function Pv(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const _9=Pv(L9,0),R9=Pv(ZS,0),N9=Pv((n,e)=>ZS(n,e,D9(e)),0);function _v(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const uc=50;function I9(n,{open:e,close:t},r,i){let o=n.sliceDoc(r-uc,r),s=n.sliceDoc(i,i+uc),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*uc?u=f=n.sliceDoc(r,i):(u=n.sliceDoc(r,r+uc),f=n.sliceDoc(i-uc,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-t.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function D9(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function ZS(n,e,t=e.selection.ranges){let r=t.map(o=>_v(e,o.from).block);if(!r.every(o=>o))return null;let i=t.map((o,s)=>I9(e,r[s],o.from,o.to));if(n!=2&&!i.every(o=>o))return{changes:e.changes(t.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(n!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(n!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const ag=hs.define(),B9=hs.define(),z9=ot.define(),e3=ot.define({combine(n){return Wi(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),Rv=kr.define({create(){return Oo.empty},update(n,e){let t=e.state.facet(e3),r=e.annotation(ag);if(r){let l=di.fromTransaction(e,r.selection),c=r.side,u=c==0?n.undone:n.done;return l?u=Od(u,u.length,t.minDepth,l):u=r3(u,e.startState.selection),new Oo(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(B9);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation($r.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let o=di.fromTransaction(e),s=e.annotation($r.time),a=e.annotation($r.userEvent);return o?n=n.addChanges(o,s,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,s,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Oo(n.done.map(di.fromJSON),n.undone.map(di.fromJSON))}});function F9(n={}){return[Rv,e3.of(n),Ze.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?Nv:e.inputType=="historyRedo"?Cd:null;return r?(e.preventDefault(),r(t)):!1}})]}function Ph(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(Rv,!1);if(!i)return!1;let o=i.pop(n,t,e);return o?(r(o),!0):!1}}const Nv=Ph(0,!1),Cd=Ph(1,!1),q9=Ph(0,!0),V9=Ph(1,!0);function t3(n){return function(e){let t=e.field(Rv,!1);if(!t)return 0;let r=n==0?t.done:t.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const H9=t3(0),U9=t3(1);class di{constructor(e,t,r,i,o){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new di(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new di(e.changes&&jr.fromJSON(e.changes),[],e.mapped&&Po.fromJSON(e.mapped),e.startSelection&&_e.fromJSON(e.startSelection),e.selectionsAfter.map(_e.fromJSON))}static fromTransaction(e,t){let r=Ni;for(let i of e.startState.facet(z9)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new di(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Ni)}static selection(e){return new di(void 0,Ni,void 0,void 0,e)}}function Od(n,e,t,r){let i=e+1>t+20?e-t-1:0,o=n.slice(i,e);return o.push(r),o}function W9(n,e){let t=[],r=!1;return n.iterChangedRanges((i,o)=>t.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function J9(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function n3(n,e){return n.length?e.length?n.concat(e):n:e}const Ni=[],K9=200;function r3(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-K9));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),Od(n,n.length-1,1e9,t.setSelAfter(r)))}else return[di.selection([e])]}function G9(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Pp(n,e){if(!n.length)return n;let t=n.length,r=Ni;for(;t;){let i=Q9(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=n.slice(0,t);return o[t-1]=i,o}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[di.selection(r)]:Ni}function Q9(n,e,t){let r=n3(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Ni,t);if(!n.changes)return di.selection(r);let i=n.changes.map(e),o=e.mapDesc(n.changes,!0),s=n.mapped?n.mapped.composeDesc(o):o;return new di(i,cn.mapEffects(n.effects,e),s,n.startSelection.map(o),r)}const Y9=/^(input\.type|delete)($|\.)/;class Oo{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Oo(this.done,this.undone):this}addChanges(e,t,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||Y9.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):_h(t,e))}function Zr(n){return n.textDirectionAt(n.state.selection.main.head)==Kn.LTR}const o3=n=>i3(n,!Zr(n)),s3=n=>i3(n,Zr(n));function a3(n,e){return ho(n,t=>t.empty?n.moveByGroup(t,e):_h(t,e))}const Z9=n=>a3(n,!Zr(n)),eN=n=>a3(n,Zr(n));function tN(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Rh(n,e,t){let r=Yr(n).resolveInner(e.head),i=t?mn.closedBy:mn.openedBy;for(let l=e.head;;){let c=t?r.childAfter(l):r.childBefore(l);if(!c)break;tN(n,c,i)?r=c:l=t?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=t?Co(n,r.from,1):Co(n,r.to,-1))&&s.matched?a=t?s.end.to:s.end.from:a=t?r.to:r.from,_e.cursor(a,t?-1:1)}const nN=n=>ho(n,e=>Rh(n.state,e,!Zr(n))),rN=n=>ho(n,e=>Rh(n.state,e,Zr(n)));function l3(n,e){return ho(n,t=>{if(!t.empty)return _h(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const c3=n=>l3(n,!1),u3=n=>l3(n,!0);function f3(n){let e=n.scrollDOM.clientHeights.empty?n.moveVertically(s,e,t.height):_h(s,e));if(i.eq(r.selection))return!1;let o;if(t.selfScroll){let s=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;s&&s.top>l&&s.bottomd3(n,!1),lg=n=>d3(n,!0);function Ks(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let o=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=_e.cursor(r.from+o))}return i}const iN=n=>ho(n,e=>Ks(n,e,!0)),oN=n=>ho(n,e=>Ks(n,e,!1)),sN=n=>ho(n,e=>Ks(n,e,!Zr(n))),aN=n=>ho(n,e=>Ks(n,e,Zr(n))),lN=n=>ho(n,e=>_e.cursor(n.lineBlockAt(e.head).from,1)),cN=n=>ho(n,e=>_e.cursor(n.lineBlockAt(e.head).to,-1));function uN(n,e,t){let r=!1,i=Ul(n.selection,o=>{let s=Co(n,o.head,-1)||Co(n,o.head,1)||o.head>0&&Co(n,o.head-1,1)||o.headuN(n,e,!1);function Ji(n,e){let t=Ul(n.state.selection,r=>{let i=e(r);return _e.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Fo(n.state,t)),!0)}function h3(n,e){return Ji(n,t=>n.moveByChar(t,e))}const p3=n=>h3(n,!Zr(n)),m3=n=>h3(n,Zr(n));function g3(n,e){return Ji(n,t=>n.moveByGroup(t,e))}const dN=n=>g3(n,!Zr(n)),hN=n=>g3(n,Zr(n)),pN=n=>Ji(n,e=>Rh(n.state,e,!Zr(n))),mN=n=>Ji(n,e=>Rh(n.state,e,Zr(n)));function v3(n,e){return Ji(n,t=>n.moveVertically(t,e))}const y3=n=>v3(n,!1),b3=n=>v3(n,!0);function w3(n,e){return Ji(n,t=>n.moveVertically(t,e,f3(n).height))}const db=n=>w3(n,!1),hb=n=>w3(n,!0),gN=n=>Ji(n,e=>Ks(n,e,!0)),vN=n=>Ji(n,e=>Ks(n,e,!1)),yN=n=>Ji(n,e=>Ks(n,e,!Zr(n))),bN=n=>Ji(n,e=>Ks(n,e,Zr(n))),wN=n=>Ji(n,e=>_e.cursor(n.lineBlockAt(e.head).from)),xN=n=>Ji(n,e=>_e.cursor(n.lineBlockAt(e.head).to)),pb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:0})),!0),mb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:n.doc.length})),!0),gb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:n.selection.main.anchor,head:0})),!0),vb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),jN=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),$N=({state:n,dispatch:e})=>{let t=Nh(n).map(({from:r,to:i})=>_e.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:_e.create(t),userEvent:"select"})),!0},kN=({state:n,dispatch:e})=>{let t=Ul(n.selection,r=>{var i;let o=Yr(n).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&((i=a.parent)===null||i===void 0?void 0:i.parent))return _e.range(a.to,a.from)}return r});return e(Fo(n,t)),!0},SN=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=_e.create([t.main]):t.main.empty||(r=_e.create([_e.cursor(t.main.head)])),r?(e(Fo(n,r)),!0):!1};function Cu(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(t="delete.forward",l=vf(n,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=vf(n,s,!1),a=vf(n,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:_e.cursor(s,si(n)))r.between(e,e,(i,o)=>{ie&&(e=t?o:i)});return e}const x3=(n,e)=>Cu(n,t=>{let r=t.from,{state:i}=n,o=i.doc.lineAt(r),s,a;if(!e&&r>o.from&&rx3(n,!1),j3=n=>x3(n,!0),$3=(n,e)=>Cu(n,t=>{let r=t.head,{state:i}=n,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==t.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=Br(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=t.head)&&(a=u),r=l}return r}),k3=n=>$3(n,!1),CN=n=>$3(n,!0),ON=n=>Cu(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headCu(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),EN=n=>Cu(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Pn.of(["",""])},range:_e.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},TN=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,o=n.doc.lineAt(i),s=i==o.from?i-1:Br(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:Br(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(s,i))},range:_e.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nh(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),o=n.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=n.doc.lineAt(r.to-1)),t>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});t=o.number+1}return e}function S3(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let o of Nh(n)){if(t?o.to==n.doc.length:o.from==0)continue;let s=n.doc.lineAt(t?o.to+1:o.from-1),a=s.length+1;if(t){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+n.lineBreak});for(let l of o.ranges)i.push(_e.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:n.lineBreak+s.text});for(let l of o.ranges)i.push(_e.range(l.anchor-a,l.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:_e.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const PN=({state:n,dispatch:e})=>S3(n,e,!1),_N=({state:n,dispatch:e})=>S3(n,e,!0);function C3(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of Nh(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const RN=({state:n,dispatch:e})=>C3(n,e,!1),NN=({state:n,dispatch:e})=>C3(n,e,!0),IN=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Nh(e).map(({from:i,to:o})=>(i>0?i--:on.moveVertically(i,!0)).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function DN(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Yr(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(mn.closedBy))&&o.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const LN=O3(!1),BN=O3(!0);function O3(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!n&&o==s&&DN(e,o);n&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new Ah(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=Ev(c,o);for(u==null&&(u=Hl(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=n.doc.lineAt(s);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),s=a.to+1}let o=n.changes(i);return{changes:i,range:_e.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const zN=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Ah(n,{overrideIndentation:o=>{let s=t[o];return s==null?-1:s}}),i=Iv(n,(o,s,a)=>{let l=Ev(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=nu(n,l);(c!=u||a.fromn.readOnly?!1:(e(n.update(Iv(n,(t,r)=>{r.push({from:t.from,insert:n.facet(Eh)})}),{userEvent:"input.indent"})),!0),E3=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Iv(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let o=Hl(i,n.tabSize),s=0,a=nu(n,Math.max(0,o-Hs(n)));for(;s({mac:n.key,run:n.run,shift:n.shift}))),VN=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nN,shift:pN},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:rN,shift:mN},{key:"Alt-ArrowUp",run:PN},{key:"Shift-Alt-ArrowUp",run:RN},{key:"Alt-ArrowDown",run:_N},{key:"Shift-Alt-ArrowDown",run:NN},{key:"Escape",run:SN},{key:"Mod-Enter",run:BN},{key:"Alt-l",mac:"Ctrl-l",run:$N},{key:"Mod-i",run:kN,preventDefault:!0},{key:"Mod-[",run:E3},{key:"Mod-]",run:M3},{key:"Mod-Alt-\\",run:zN},{key:"Shift-Mod-k",run:IN},{key:"Shift-Mod-\\",run:fN},{key:"Mod-/",run:P9},{key:"Alt-A",run:R9}].concat(qN),HN={key:"Tab",run:M3,shift:E3};function qn(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;ea.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?Ct.widget({widget:new eI(a),diagnostic:a}).range(a.from):Ct.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a,inclusive:!0}).range(a.from,a.to)),!0);return new ia(s,t,Al(s))}}function Al(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new UN(i,o,s.diagnostic),!1}),r}function T3(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(r=>r.is(Ih))||n.changes.touchesRange(t.from,t.to))}function P3(n,e){return n.field($i,!1)?e:e.concat(cn.appendConfig.of(B3))}function WN(n,e){return{effects:P3(n,[Ih.of(e)])}}const Ih=cn.define(),Dv=cn.define(),_3=cn.define(),$i=kr.define({create(){return new ia(Ct.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),r=null;if(n.selected){let i=e.changes.mapPos(n.selected.from,1);r=Al(t,n.selected.diagnostic,i)||Al(t,null,i)}n=new ia(t,n.panel,r)}for(let t of e.effects)t.is(Ih)?n=ia.init(t.value,n.panel,e.state):t.is(Dv)?n=new ia(n.diagnostics,t.value?Dh.open:null,n.selected):t.is(_3)&&(n=new ia(n.diagnostics,n.panel,t.value));return n},provide:n=>[eu.from(n,e=>e.panel),Ze.decorations.from(n,e=>e.diagnostics)]}),JN=Ct.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function KN(n,e,t){let{diagnostics:r}=n.state.field($i),i=[],o=2e8,s=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||t>0)&&(eI3(n,t,!1)))}const GN=n=>{let e=n.state.field($i,!1);(!e||!e.panel)&&n.dispatch({effects:P3(n.state,[Dv.of(!0)])});let t=Zc(n,Dh.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},yb=n=>{let e=n.state.field($i,!1);return!e||!e.panel?!1:(n.dispatch({effects:Dv.of(!1)}),!0)},QN=n=>{let e=n.state.field($i,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},YN=[{key:"Mod-Shift-m",run:GN,preventDefault:!0},{key:"F8",run:QN}],XN=ar.fromClass(class{constructor(n){this.view=n,this.timeout=-1,this.set=!0;let{delay:e}=n.state.facet(ua);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let n=Date.now();if(nPromise.resolve(r(this.view)))).then(r=>{let i=r.reduce((o,s)=>o.concat(s));this.view.state.doc==e.doc&&this.view.dispatch(WN(this.view.state,i))},r=>{si(this.view.state,r)})}}update(n){let e=n.state.facet(ua);(n.docChanged||e!=n.startState.facet(ua)||e.needsRefresh&&e.needsRefresh(n))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),ua=ot.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},Wi(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function ZN(n,e={}){return[ua.of({source:n,config:e}),XN,B3]}function N3(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function I3(n,e,t){var r;let i=t?N3(e.actions):[];return qn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},qn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=Al(n.state.field($i).diagnostics,e);h&&o.apply(n,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),qn("u",c.slice(u,u+1)),c.slice(u+1)];return qn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&qn("div",{class:"cm-diagnosticSource"},e.source))}class eI extends Js{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return qn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class bb{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=I3(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Dh{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)yb(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=N3(o.actions);for(let a=0;a{for(let o=0;oyb(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field($i).selected;if(!e)return-1;for(let t=0;t{let c=-1,u;for(let f=r;fr&&(this.items.splice(r,c-r),i=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.topa.bottom&&(this.list.scrollTop+=(s.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field($i),r=Al(t.diagnostics,this.items[e].diagnostic);!r||this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:_3.of(r)})}static open(e){return new Dh(e)}}function Xf(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function yf(n){return Xf(``,'width="6" height="3"')}const tI=Ze.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-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:yf("#d11")},".cm-lintRange-warning":{backgroundImage:yf("orange")},".cm-lintRange-info":{backgroundImage:yf("#999")},".cm-lintRange-hint":{backgroundImage:yf("#66d")},".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-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function wb(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}class nI extends No{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,r)=>wb(t)iI(e,t,r)),t}}function rI(n,e){let t=r=>{let i=e.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,rI(n,e)}let{hoverTime:i}=n.state.facet(Lh),o=setTimeout(r,i);e.onmouseout=()=>{clearTimeout(o),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}}function oI(n,e){let t=Object.create(null);for(let i of e){let o=n.lineAt(i.from);(t[o.from]||(t[o.from]=[])).push(i)}let r=[];for(let i in t)r.push(new nI(t[i]).range(+i));return wn.of(r,!0)}const sI=OS({class:"cm-gutter-lint",markers:n=>n.state.field(D3)}),D3=kr.define({create(){return wn.empty},update(n,e){n=n.map(e.changes);let t=e.state.facet(Lh).markerFilter;for(let r of e.effects)if(r.is(Ih)){let i=r.value;t&&(i=t(i||[],e.state)),n=oI(e.state.doc,i.slice(0))}return n}}),Lv=cn.define(),L3=kr.define({create(){return null},update(n,e){return n&&e.docChanged&&(n=T3(e,n)?null:Object.assign(Object.assign({},n),{pos:e.changes.mapPos(n.pos)})),e.effects.reduce((t,r)=>r.is(Lv)?r.value:t,n)},provide:n=>Oh.from(n)}),aI=Ze.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Xf('')},".cm-lint-marker-warning":{content:Xf('')},".cm-lint-marker-error":{content:Xf('')}}),B3=[$i,Ze.decorations.compute([$i],n=>{let{selected:e,panel:t}=n.field($i);return!e||!t||e.from==e.to?Ct.none:Ct.set([JN.range(e.from,e.to)])}),hR(KN,{hideOn:T3}),tI],Lh=ot.define({combine(n){return Wi(n,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function lI(n={}){return[Lh.of(n),D3,sI,aI,L3]}class Md{constructor(e,t,r,i,o,s,a,l,c,u=0,f){this.p=e,this.stack=t,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let i=e.parser.context;return new Md(e,[],t,r,r,0,[],0,i?new xb(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,i=e&65535,{parser:o}=this.p,s=o.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(t==r)return;if(s.buffer[a-2]>=t){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,t,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>r;)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,i>4&&(i-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,t,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(t,r),t<=s.maxNode&&this.buffer.push(t,r,i,4)}else this.pos=i,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,i,4)}apply(e,t,r,i){e&65536?this.reduce(e):this.shift(e,t,r,i)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Md(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new cI(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(t[o],s)}t=i}let r=[];for(let i=0;i>19,i=t&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;t=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(i,o)=>{if(!t.includes(i))return t.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class xb{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class cI{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class Ed{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Ed(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ed(this.stack,this.pos,this.index)}}function bf(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}t?t[i++]=o:t=new e(o)}return t}class Zf{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jb=new Zf;class uI{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jb,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,i;if(t>=0&&t=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=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()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=jb,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);let r="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return r}}class ml{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;fI(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}ml.prototype.contextual=ml.prototype.fallback=ml.prototype.extend=!1;ml.prototype.fallback=ml.prototype.extend=!1;function fI(n,e,t,r,i,o){let s=0,a=1<0){let p=n[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||dI(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=n[s+2];if(e.next<0&&d>f&&n[c+d*3-3]==65535){s=n[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),m=n[p],v=n[p+1]||65536;if(u=v)f=h+1;else{s=n[p+2],e.advance();continue e}}break}}function $b(n,e,t){for(let r=e,i;(i=n[r])!=65535;r++)if(i==t)return r-e;return-1}function dI(n,e,t,r){let i=$b(t,r,e);return i<0||$b(t,r,n)e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class hI{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?kb(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?kb(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}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof vr){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+o.length}}}class pI{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Zf)}getActions(e){let t=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!u.extend&&(r=f,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Zf,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Zf,{pos:r,p:i}=e;return t.start=r,t.end=Math.min(r+1,i.stream.end),t.value=r==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,r){let i=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,r,i){for(let o=0;oe.bufferLength*4?new hI(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;st)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&vI(i);if(s)return bi&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw bi&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return bi&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(mn.contextHash)||0)==u))return e.useNode(f,d),bi&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof vr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof vr&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),bi&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?t.push(p):r.push(p)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Sb(e,t),!0}}runRecovery(e,t,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),bi&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(bi&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)bi&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))bi&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),bi&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Sb(a,r)):(!i||i.scoree.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new Sv(t.map((a,l)=>pi.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=AS;let s=bf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new ml(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let i=new mI(this,e,t,r);for(let o of this.wrappers)i=o(i,e,t,r);return i}getGoto(e,t,r=!1){let i=this.goto;if(t>=i[0])return-1;for(let o=i[t+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),i=r?t(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Ho(this.data,o+2);else break;i=t(Ho(this.data,o+1))}return i}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ho(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];t.some((o,s)=>s&1&&o==i)||t.push(this.data[r],i)}}return t}configure(e){let t=Object.assign(Object.create(Ad.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return t.specializers[i]=Cb(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let o of e.split(" ")){let s=t.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,r)<<1|e}return n.get}const yI=NS({String:Ve.string,Number:Ve.number,"True False":Ve.bool,PropertyName:Ve.propertyName,Null:Ve.null,",":Ve.separator,"[ ]":Ve.squareBracket,"{ }":Ve.brace}),bI=Ad.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[yI],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),wI=jd.define({name:"json",parser:bI.configure({props:[BS.add({Object:sb({except:/^\s*\}/}),Array:sb({except:/^\s*\]/})}),FS.add({"Object Array":n9})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function xI(){return new HR(wI)}const Ob=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Tl{constructor(e,t,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(Ob(a)):Ob,this.query=this.normalize(t)}peek(){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 Rr(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=hv(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Pi(e);let i=this.normalize(t);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Td(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let a=new gl(t,e.sliceString(t,r));return Rp.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:o,from:s}=i;return s>t&&(o=e.sliceString(t,s)+o,s=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let 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){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Td(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=gl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol!="undefined"&&(F3.prototype[Symbol.iterator]=q3.prototype[Symbol.iterator]=function(){return this});function jI(n){try{return new RegExp(n,Bv),!0}catch{return!1}}function Td(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function ug(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=qn("input",{class:"cm-textfield",name:"line",value:e}),r=qn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),n.dispatch({effects:Pd.of(!1)}),n.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},qn("label",n.state.phrase("Go to line"),": ",t)," ",qn("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!o)return;let{state:s}=n,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let v=h/100;l&&(v=v*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*v)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),m=_e.cursor(p.from+Math.max(0,Math.min(d,p.length)));n.dispatch({effects:[Pd.of(!1),Ze.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:r}}const Pd=cn.define(),Mb=kr.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Pd)&&(n=t.value);return n},provide:n=>eu.from(n,e=>e?ug:null)}),$I=n=>{let e=Zc(n,ug);if(!e){let t=[Pd.of(!0)];n.state.field(Mb,!1)==null&&t.push(cn.appendConfig.of([Mb,kI])),n.dispatch({effects:t}),e=Zc(n,ug)}return e&&e.dom.querySelector("input").select(),!0},kI=Ze.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),SI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},V3=ot.define({combine(n){return Wi(n,SI,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function CI(n){let e=[TI,AI];return n&&e.push(V3.of(n)),e}const OI=Ct.mark({class:"cm-selectionMatch"}),MI=Ct.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Eb(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=rr.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=rr.Word)}function EI(n,e,t,r){return n(e.sliceDoc(t,t+1))==rr.Word&&n(e.sliceDoc(r-1,r))==rr.Word}const AI=ar.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(V3),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Ct.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ct.none;let l=t.wordAt(i.head);if(!l)return Ct.none;s=t.charCategorizer(i.head),o=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return Ct.none;if(e.wholeWords){if(o=t.sliceDoc(i.from,i.to),s=t.charCategorizer(i.head),!(Eb(s,t,i.from,i.to)&&EI(s,t,i.from,i.to)))return Ct.none}else if(o=t.sliceDoc(i.from,i.to),!o)return Ct.none}let a=[];for(let l of n.visibleRanges){let c=new Tl(t.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||Eb(s,t,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(MI.range(u,f)):(u>=i.to||f<=i.from)&&a.push(OI.range(u,f)),a.length>e.maxMatches))return Ct.none}}return Ct.set(a)}},{decorations:n=>n.decorations}),TI=Ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),PI=({state:n,dispatch:e})=>{let{selection:t}=n,r=_e.create(t.ranges.map(i=>n.wordAt(i.head)||_e.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function _I(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),o=i&&i.from==t.from&&i.to==t.to;for(let s=!1,a=new Tl(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new Tl(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const RI=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(o=>o.from===o.to))return PI({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(o=>n.sliceDoc(o.from,o.to)!=r))return!1;let i=_I(n,r);return i?(e(n.update({selection:n.selection.addRange(_e.range(i.from,i.to),!1),effects:Ze.scrollIntoView(i.to)})),!0):!1},za=ot.define({combine(n){return Wi(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new JI(e),scrollToMatch:e=>Ze.scrollIntoView(e)})}});function NI(n){return n?[za.of(n),dg]:dg}class H3{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||jI(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new BI(this):new DI(this)}getCursor(e,t=0,r){let i=e.doc?e:vn.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Qa(this,i,t,r):Ga(this,i,t,r)}}class U3{constructor(e){this.spec=e}}function Ga(n,e,t,r){return new Tl(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?II(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function II(n,e){return(t,r,i,o)=>((o>t||o+i.length=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Ga(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Qa(n,e,t,r){return new F3(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?LI(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function _d(n,e){return n.slice(Br(n,e,!1),e)}function Rd(n,e){return n.slice(e,Br(n,e))}function LI(n){return(e,t,r)=>!r[0].length||(n(_d(r.input,r.index))!=rr.Word||n(Rd(r.input,r.index))!=rr.Word)&&(n(Rd(r.input,r.index+r[0].length))!=rr.Word||n(_d(r.input,r.index+r[0].length))!=rr.Word)}class BI extends U3{nextMatch(e,t,r){let i=Qa(this.spec,e,r,e.doc.length).next();return i.done&&(i=Qa(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let o=Math.max(t,r-i*1e4),s=Qa(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Qa(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const ru=cn.define(),zv=cn.define(),Ts=kr.define({create(n){return new Np(fg(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ru)?n=new Np(t.value.create(),n.panel):t.is(zv)&&(n=new Np(n.query,t.value?Fv:null));return n},provide:n=>eu.from(n,e=>e.panel)});class Np{constructor(e,t){this.query=e,this.panel=t}}const zI=Ct.mark({class:"cm-searchMatch"}),FI=Ct.mark({class:"cm-searchMatch cm-searchMatch-selected"}),qI=ar.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Ts))}update(n){let e=n.state.field(Ts);(e!=n.startState.field(Ts)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ct.none;let{view:t}=this,r=new Ro;for(let i=0,o=t.visibleRanges,s=o.length;io[i+1].from-2*250;)l=o[++i].to;n.highlight(t.state,a,l,(c,u)=>{let f=t.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?FI:zI)})}return r.finish()}},{decorations:n=>n.decorations});function Ou(n){return e=>{let t=e.state.field(Ts,!1);return t&&t.query.spec.valid?n(e,t):qv(e)}}const Nd=Ou((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=_e.single(r.from,r.to),o=n.state.facet(za);return n.dispatch({selection:i,effects:[Hv(n,r),o.scrollToMatch(i.main,n)],userEvent:"select.search"}),J3(n),!0}),Id=Ou((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let o=_e.single(i.from,i.to),s=n.state.facet(za);return n.dispatch({selection:o,effects:[Hv(n,i),s.scrollToMatch(o.main,n)],userEvent:"select.search"}),J3(n),!0}),VI=Ou((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:_e.create(t.map(r=>_e.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),HI=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,o=[],s=0;for(let a=new Tl(n.doc,n.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(_e.range(a.value.from,a.value.to))}return e(n.update({selection:_e.create(o,s),userEvent:"select.search.matches"})),!0},Ab=Ou((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let o=e.nextMatch(t,r,r);if(!o)return!1;let s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=t.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(t,o.from,o.to),c.push(Ze.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=_e.single(o.from-u,o.to-u),c.push(Hv(n,o)),c.push(t.facet(za).scrollToMatch(a.main,n))}return n.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),UI=Ou((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Ze.announce.of(r),userEvent:"input.replace.all"}),!0});function Fv(n){return n.state.facet(za).createPanel(n)}function fg(n,e){var t,r,i,o,s;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(za);return new H3({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function W3(n){let e=Zc(n,Fv);return e&&e.dom.querySelector("[main-field]")}function J3(n){let e=W3(n);e&&e==n.root.activeElement&&e.select()}const qv=n=>{let e=n.state.field(Ts,!1);if(e&&e.panel){let t=W3(n);if(t&&t!=n.root.activeElement){let r=fg(n.state,e.query.spec);r.valid&&n.dispatch({effects:ru.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[zv.of(!0),e?ru.of(fg(n.state,e.query.spec)):cn.appendConfig.of(dg)]});return!0},Vv=n=>{let e=n.state.field(Ts,!1);if(!e||!e.panel)return!1;let t=Zc(n,Fv);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:zv.of(!1)}),!0},WI=[{key:"Mod-f",run:qv,scope:"editor search-panel"},{key:"F3",run:Nd,shift:Id,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Nd,shift:Id,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Vv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:HI},{key:"Mod-Alt-g",run:$I},{key:"Mod-d",run:RI,preventDefault:!0}];class JI{constructor(e){this.view=e;let t=this.query=e.state.field(Ts).query.spec;this.commit=this.commit.bind(this),this.searchField=qn("input",{value:t.search,placeholder:wi(e,"Find"),"aria-label":wi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=qn("input",{value:t.replace,placeholder:wi(e,"Replace"),"aria-label":wi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=qn("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=qn("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=qn("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,o,s){return qn("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=qn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Nd(e),[wi(e,"next")]),r("prev",()=>Id(e),[wi(e,"previous")]),r("select",()=>VI(e),[wi(e,"all")]),qn("label",null,[this.caseField,wi(e,"match case")]),qn("label",null,[this.reField,wi(e,"regexp")]),qn("label",null,[this.wordField,wi(e,"by word")]),...e.state.readOnly?[]:[qn("br"),this.replaceField,r("replace",()=>Ab(e),[wi(e,"replace")]),r("replaceAll",()=>UI(e),[wi(e,"replace all")])],qn("button",{name:"close",onclick:()=>Vv(e),"aria-label":wi(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new H3({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:ru.of(e)}))}keydown(e){O_(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Id:Nd)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Ab(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(ru)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(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}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(za).top}}function wi(n,e){return n.state.phrase(e)}const wf=30,xf=/[\s\.,:;?!]/;function Hv(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,o=Math.max(r.from,e-wf),s=Math.min(i,t+wf),a=n.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-wf;l--)if(!xf.test(a[l-1])&&xf.test(a[l])){a=a.slice(0,l);break}}return Ze.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const KI=Ze.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"}}),dg=[Ts,Ba.low(qI),KI];class K3{constructor(e,t,r){this.state=e,this.pos=t,this.explicit=r,this.abortListeners=[]}tokenBefore(e){let t=Yr(this.state).resolveInner(this.pos,-1);for(;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}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),o=i.search(G3(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Tb(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function GI(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:GI(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:t}:null}}class Pb{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function Ps(n){return n.selection.main.from}function G3(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?n:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const YI=hs.define();function XI(n,e,t,r){let{main:i}=n.selection,o=t-i.from,s=r-i.from;return Object.assign(Object.assign({},n.changeByRange(a=>a!=i&&t!=r&&n.sliceDoc(a.from+o,a.from+s)!=n.sliceDoc(t,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:_e.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const _b=new WeakMap;function ZI(n){if(!Array.isArray(n))return n;let e=_b.get(n);return e||_b.set(n,e=QI(n)),e}const Dd=cn.define(),iu=cn.define();class eD{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:($=hv(w))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!b||S==1&&v||x==0&&S!=0)&&(t[f]==w||r[f]==w&&(d=!0)?s[f++]=b:s.length&&(g=!1)),x=S,b+=Pi(w)}return f==l&&s[0]==0&&g?this.result(-100+(d?-200:0),s,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-200+-700-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(g?0:-1100),s,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],o=0;for(let s of t){let a=s+(this.astral?Pi(Rr(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class tD{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:nD,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>Rb(e(r),t(r)),optionClass:(e,t)=>r=>Rb(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Rb(n,e){return n?e?n+" "+e:n:e}function nD(n,e,t,r,i,o){let s=n.textDirection==Kn.RTL,a=s,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&d=m||b>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let v=(e.bottom-e.top)/o.offsetHeight,g=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/v}px; max-width: ${f/g}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function rD(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return lt.position-r.position).map(t=>t.render)}function Ip(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class iD{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:s}=i.open,a=e.state.facet(Lr);this.optionContent=rD(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Ip(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Lr).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:iu.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=Ip(o.length,s,e.state.facet(Lr).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Ip(t.options.length,t.selected,this.view.state.facet(Lr).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>si(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&sD(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,t.bottom)-10||i.bottomr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=t+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew iD(t,n,e)}function sD(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.topt.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function Nb(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function aD(n,e){let t=[],r=null,i=c=>{t.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(Lr);for(let c of n)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new Pb(f,c.source,u?u(f):[],1e9-t.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new tD(f):new eD(f);for(let p of c.result.options)if(d=h.match(p.label)){let m=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new Pb(p,c.source,m,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,m;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((m=h.rank)!==null&&m!==void 0?m:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):Nb(c.completion)>Nb(a)&&(s[s.length-1]=c),a=c.completion}return s}class il{constructor(e,t,r,i,o,s){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new il(this.options,Ib(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,o){let s=aD(e,t);if(!s.length)return i&&e.some(l=>l.state==1)?new il(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=t.facet(Lr).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:dD,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new il(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Ld{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Ld(uD,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Lr),o=(r.override||t.languageDataAt("autocomplete",Ps(t)).map(ZI)).map(a=>(this.active.find(c=>c.source==a)||new ni(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!lD(o,this.active)?s=il.build(o,t,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new ni(a.source,0):a));for(let a of e.effects)a.is(Y3)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new Ld(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:cD}}function lD(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const uD=[];function hg(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ni{constructor(e,t,r=-1){this.source=e,this.state=t,this.explicitPos=r}hasResult(){return!1}update(e,t){let r=hg(e),i=this;r?i=i.handleUserEvent(e,r,t):e.docChanged?i=i.handleChange(e):e.selection&&i.state!=0&&(i=new ni(i.source,0));for(let o of e.effects)if(o.is(Dd))i=new ni(i.source,1,o.value?Ps(e.state):-1);else if(o.is(iu))i=new ni(i.source,0);else if(o.is(Q3))for(let s of o.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,t,r){return t=="delete"||!r.activateOnTyping?this.map(e.changes):new ni(this.source,1)}handleChange(e){return e.changes.touchesRange(Ps(e.startState))?new ni(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ni(this.source,this.state,e.mapPos(this.explicitPos))}}class vl extends ni{constructor(e,t,r,i,o){super(e,2,t),this.result=r,this.from=i,this.to=o}hasResult(){return!0}handleUserEvent(e,t,r){var i;let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let s=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=Ps(e.state);if((this.explicitPos<0?l<=s:la||!o||t=="delete"&&Ps(e.startState)==this.from)return new ni(this.source,t=="input"&&r.activateOnTyping?1:0);let c=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return fD(o.validFor,e.state,s,a)?new vl(this.source,c,o,s,a):o.update&&(o=o.update(o,s,a,new K3(e.state,l,c>=0)))?new vl(this.source,c,o,o.from,(i=o.to)!==null&&i!==void 0?i:Ps(e.state)):new ni(this.source,1,c)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ni(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new vl(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ni(this.source,0)}}function fD(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):G3(n,!0).test(i)}const Q3=cn.define({map(n,e){return n.map(t=>t.map(e))}}),Y3=cn.define(),ui=kr.define({create(){return Ld.start()},update(n,e){return n.update(e)},provide:n=>[Oh.from(n,e=>e.tooltip),Ze.contentAttributes.from(n,e=>e.attrs)]});function Uv(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(ui).active.find(i=>i.source==e.source);return r instanceof vl?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},XI(n.state,t,r.from,r.to)),{annotations:YI.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const dD=oD(ui,Uv);function jf(n,e="option"){return t=>{let r=t.state.field(ui,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(n?1:-1):n?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),t.dispatch({effects:Y3.of(a)}),!0}}const hD=n=>{let e=n.state.field(ui,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(ui,!1)?(n.dispatch({effects:Dd.of(!0)}),!0):!1,mD=n=>{let e=n.state.field(ui,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:iu.of(null)}),!0)};class gD{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const vD=50,yD=1e3,bD=ar.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(ui).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(ui);if(!n.selectionSet&&!n.docChanged&&n.startState.field(ui)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!hg(i));for(let i=0;ivD&&Date.now()-o.time>yD){for(let s of o.context.abortListeners)try{s()}catch(a){si(this.view.state,a)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(i=>i.effects.some(o=>o.is(Dd)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.state.facet(Lr).activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let i of n.transactions)hg(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(ui);for(let t of e.active)t.state==1&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=Ps(e),r=new K3(e,t,n.explicitPos==t),i=new gD(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:iu.of(null)}),si(this.view.state,o)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Lr).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Lr);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new ni(i.active.source,0);for(let a of i.updates)s=s.update(a,t);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:Q3.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(ui,!1);if(e&&e.tooltip&&this.view.state.facet(Lr).closeOnBlur){let t=e.open&&SS(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:iu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Dd.of(!1)}),20),this.composing=0}}}),wD=typeof navigator=="object"&&/Win/.test(navigator.platform),xD=Ba.highest(Ze.domEventHandlers({keydown(n,e){let t=e.state.field(ui,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(wD&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(n.key)>-1&&Uv(e,r),!1}})),jD=Ze.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",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",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),ou={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},fa=cn.define({map(n,e){let t=e.mapPos(n,-1,ri.TrackAfter);return t==null?void 0:t}}),Wv=new class extends ba{};Wv.startSide=1;Wv.endSide=-1;const X3=kr.define({create(){return wn.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(fa)&&(n=n.update({add:[Wv.range(t.value,t.value+1)]}));return n}});function $D(){return[SD,X3]}const Dp="()[]{}<>";function Z3(n){for(let e=0;e{if((kD?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&Pi(Rr(r,0))==1||e!=i.from||t!=i.to)return!1;let o=MD(n.state,r);return o?(n.dispatch(o),!0):!1}),CD=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=eC(n,n.selection.main.head).brackets||ou.brackets,i=null,o=n.changeByRange(s=>{if(s.empty){let a=ED(n.doc,s.head);for(let l of r)if(l==a&&Bh(n.doc,s.head)==Z3(Rr(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:_e.cursor(s.head-l.length)}}return{range:i=s}});return i||e(n.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},OD=[{key:"Backspace",run:CD}];function MD(n,e){let t=eC(n,n.selection.main.head),r=t.brackets||ou.brackets;for(let i of r){let o=Z3(Rr(i,0));if(e==i)return o==i?PD(n,i,r.indexOf(i+i+i)>-1,t):AD(n,i,o,t.before||ou.before);if(e==o&&tC(n,n.selection.main.from))return TD(n,i,o)}return null}function tC(n,e){let t=!1;return n.field(X3).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function Bh(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Pi(Rr(t,0)))}function ED(n,e){let t=n.sliceString(e-2,e);return Pi(Rr(t,0))==t.length?t:t.slice(1)}function AD(n,e,t,r){let i=null,o=n.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:t,from:s.to}],effects:fa.of(s.to+e.length),range:_e.range(s.anchor+e.length,s.head+e.length)};let a=Bh(n.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:s.head},effects:fa.of(s.head+e.length),range:_e.cursor(s.head+e.length)}:{range:i=s}});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function TD(n,e,t){let r=null,i=n.changeByRange(o=>o.empty&&Bh(n.doc,o.head)==t?{changes:{from:o.head,to:o.head+t.length,insert:t},range:_e.cursor(o.head+t.length)}:r={range:o});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function PD(n,e,t,r){let i=r.stringPrefixes||ou.stringPrefixes,o=null,s=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:fa.of(a.to+e.length),range:_e.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=Bh(n.doc,l),u;if(c==e){if(Db(n,l))return{changes:{insert:e+e,from:l},effects:fa.of(l+e.length),range:_e.cursor(l+e.length)};if(tC(n,l)){let d=t&&n.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:_e.cursor(l+d.length)}}}else{if(t&&n.sliceDoc(l-2*e.length,l)==e+e&&(u=Lb(n,l-2*e.length,i))>-1&&Db(n,u))return{changes:{insert:e+e+e+e,from:l},effects:fa.of(l+e.length),range:_e.cursor(l+e.length)};if(n.charCategorizer(l)(c)!=rr.Word&&Lb(n,l,i)>-1&&!_D(n,l,e,i))return{changes:{insert:e+e,from:l},effects:fa.of(l+e.length),range:_e.cursor(l+e.length)}}return{range:o=a}});return o?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Db(n,e){let t=Yr(n).resolveInner(e+1);return t.parent&&t.from==e}function _D(n,e,t,r){let i=Yr(n).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+o)),l=a.indexOf(t);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>t.length+l;){if(n.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Lb(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=rr.Word)return e;for(let i of t){let o=e-i.length;if(n.sliceDoc(o,e)==i&&r(n.sliceDoc(o-1,o))!=rr.Word)return o}return-1}function RD(n={}){return[xD,ui,Lr.of(n),bD,ND,jD]}const nC=[{key:"Ctrl-Space",run:pD},{key:"Escape",run:mD},{key:"ArrowDown",run:jf(!0)},{key:"ArrowUp",run:jf(!1)},{key:"PageDown",run:jf(!0,"page")},{key:"PageUp",run:jf(!1,"page")},{key:"Enter",run:hD}],ND=Ba.highest(vd.computeN([Lr],n=>n.facet(Lr).defaultKeymap?[nC]:[]));function ID(n,e=n.state){const t=new Set;for(const{from:r,to:i}of n.visibleRanges){let o=r;for(;o<=i;){const s=e.doc.lineAt(o);t.has(s)||t.add(s),o=s.to+1}}return t}function pg(n){const e=n.selection.main.head;return n.doc.lineAt(e)}function Bb(n,e){let t=0;e:for(let r=0;r=o.level&&this.markerType!=="codeOnly"?this.set(e,0,i.level):i.empty&&i.level===0&&o.level!==0?this.set(e,0,0):o.level>i.level?this.set(e,0,i.level+1):this.set(e,0,o.level)}const t=Bb(e.text,this.state.tabSize),r=Math.floor(t/this.unitWidth);return this.set(e,t,r)}closestNonEmpty(e,t){let r=e.number+t;for(;t===-1?r>=1:r<=this.state.doc.lines;){if(this.has(r)){const s=this.get(r);if(!s.empty)return s}const o=this.state.doc.line(r);if(o.text.trim().length){const s=Bb(o.text,this.state.tabSize),a=Math.floor(s/this.unitWidth);return this.set(o,s,a)}r+=t}const i=this.state.doc.line(t===-1?1:this.state.doc.lines);return this.set(i,0,0)}findAndSetActiveLines(){const e=pg(this.state);if(!this.has(e))return;let t=this.get(e);if(this.has(t.line.number+1)){const o=this.get(t.line.number+1);o.level>t.level&&(t=o)}if(this.has(t.line.number-1)){const o=this.get(t.line.number-1);o.level>t.level&&(t=o)}if(t.level===0)return;t.active=t.level;let r,i;for(r=t.line.number;r>1;r--){if(!this.has(r-1))continue;const o=this.get(r-1);if(o.level0&&a.push($f("--indent-marker-bg-color",r,e,s,l)),a.push($f("--indent-marker-active-bg-color",r,e,o-1,1)),o!==i&&a.push($f("--indent-marker-bg-color",r,e,o,i-o))}else a.push($f("--indent-marker-bg-color",r,e,s,i-s));return a.join(",")}class zD{constructor(e){this.view=e,this.unitWidth=Hs(e.state),this.currentLineNumber=pg(e.state).number,this.generate(e.state)}update(e){const t=Hs(e.state),r=t!==this.unitWidth;r&&(this.unitWidth=t);const i=pg(e.state).number,o=i!==this.currentLineNumber;this.currentLineNumber=i;const s=e.state.facet(Bd).highlightActiveBlock&&o;(e.docChanged||e.viewportChanged||r||s)&&this.generate(e.state)}generate(e){const t=new Ro,r=ID(this.view,e),{hideFirstIndent:i,markerType:o,thickness:s}=e.facet(Bd),a=new DD(r,e,this.unitWidth,o);for(const l of r){const c=a.get(l.number);if(!(c!=null&&c.level))continue;const u=BD(c,this.unitWidth,i,s);t.add(l.from,l.from,Ct.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${u}`}}))}this.decorations=t.finish()}}function FD(n={}){return[Bd.of(n),LD(n.colors),ar.fromClass(zD,{decorations:e=>e.decorations})]}class qD{constructor(e){this.view=e,this.indentUnit=Hs(e.state),this.initialPaddingLeft=null,this.isChrome=window==null?void 0:window.navigator.userAgent.includes("Chrome"),this.generate(e.state)}update(e){const t=Hs(e.state);(t!==this.indentUnit||e.docChanged||e.viewportChanged)&&(this.indentUnit=t,this.generate(e.state))}generate(e){const t=new Ro;this.initialPaddingLeft?this.addStyleToBuilder(t,e,this.initialPaddingLeft):this.view.requestMeasure({read:r=>{const i=r.contentDOM.querySelector(".cm-line");i&&(this.initialPaddingLeft=window.getComputedStyle(i).getPropertyValue("padding-left"),this.addStyleToBuilder(t,r.state,this.initialPaddingLeft)),this.decorations=t.finish()}}),this.decorations=t.finish()}addStyleToBuilder(e,t,r){const i=this.getVisibleLines(t);for(const o of i){const{numColumns:s,containsTab:a}=this.numColumns(o.text,t.tabSize),l=`calc(${s+this.indentUnit}ch + ${r})`,c=this.isChrome?`calc(-${s+this.indentUnit}ch - ${a?1:0}px)`:`-${s+this.indentUnit}ch`;e.add(o.from,o.from,Ct.line({attributes:{style:`padding-left: ${l}; text-indent: ${c};`}}))}}getVisibleLines(e){const t=new Set;let r=null;for(const{from:i,to:o}of this.view.visibleRanges){let s=i;for(;s<=o;){const a=e.doc.lineAt(s);r!==a&&(t.add(a),r=a),s=a.to+1}}return t}numColumns(e,t){let r=0,i=!1;e:for(let o=0;on.decorations})];var zb={exports:{}},rC={},io={},Pl={},Mu={},gn={},su={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.regexpCode=n.getEsmExportName=n.getProperty=n.safeStringify=n.stringify=n.strConcat=n.addCodeArg=n.str=n._=n.nil=n._Code=n.Name=n.IDENTIFIER=n._CodeOrName=void 0;class e{}n._CodeOrName=e,n.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class t extends e{constructor(b){if(super(),!n.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}n.Name=t;class r extends e{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((y,x)=>`${y}${x}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((y,x)=>(x instanceof t&&(y[x.str]=(y[x.str]||0)+1),y),{})}}n._Code=r,n.nil=new r("");function i(g,...b){const y=[g[0]];let x=0;for(;x{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,e._)`${c}${f.scopePath}`})}scopeCode(c=this._values,u,f){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,f)}_reduceValues(c,u,f={},d){let h=e.nil;for(const p in c){const m=c[p];if(!m)continue;const v=f[p]=f[p]||new Map;m.forEach(g=>{if(v.has(g))return;v.set(g,r.Started);let b=u(g);if(b){const y=this.opts.es5?n.varKinds.var:n.varKinds.const;h=(0,e._)`${h}${y} ${g} = ${b};${this.opts._n}`}else if(b=d==null?void 0:d(g))h=(0,e._)`${h}${b}${this.opts._n}`;else throw new t(g);v.set(g,r.Completed)})}return h}}n.ValueScope=a})(mg);(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.or=n.and=n.not=n.CodeGen=n.operators=n.varKinds=n.ValueScopeName=n.ValueScope=n.Scope=n.Name=n.regexpCode=n.stringify=n.getProperty=n.nil=n.strConcat=n.str=n._=void 0;const e=su,t=mg;var r=su;Object.defineProperty(n,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(n,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(n,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(n,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(n,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(n,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(n,"Name",{enumerable:!0,get:function(){return r.Name}});var i=mg;Object.defineProperty(n,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(n,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(n,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(n,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),n.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class o{optimizeNodes(){return this}optimizeNames(k,P){return this}}class s extends o{constructor(k,P,H){super(),this.varKind=k,this.name=P,this.rhs=H}render({es5:k,_n:P}){const H=k?t.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${H} ${this.name}${J};`+P}optimizeNames(k,P){if(!!k[this.name.str])return this.rhs&&(this.rhs=q(this.rhs,k,P)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(k,P,H){super(),this.lhs=k,this.rhs=P,this.sideEffects=H}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,P){if(!(this.lhs instanceof e.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=q(this.rhs,k,P),this}get names(){const k=this.lhs instanceof e.Name?{}:Tr({},this.lhs.names);return U(k,this.rhs)}}class l extends a{constructor(k,P,H,J){super(k,H,J),this.op=P}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class c extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class u extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends o{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class d extends o{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,P){return this.code=q(this.code,k,P),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class h extends o{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce((P,H)=>P+H.render(k),"")}optimizeNodes(){const{nodes:k}=this;let P=k.length;for(;P--;){const H=k[P].optimizeNodes();Array.isArray(H)?k.splice(P,1,...H):H?k[P]=H:k.splice(P,1)}return k.length>0?this:void 0}optimizeNames(k,P){const{nodes:H}=this;let J=H.length;for(;J--;){const he=H[J];he.optimizeNames(k,P)||(X(k,he.names),H.splice(J,1))}return H.length>0?this:void 0}get names(){return this.nodes.reduce((k,P)=>D(k,P.names),{})}}class p extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class m extends h{}class v extends p{}v.kind="else";class g extends p{constructor(k,P){super(P),this.condition=k}render(k){let P=`if(${this.condition})`+super.render(k);return this.else&&(P+="else "+this.else.render(k)),P}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let P=this.else;if(P){const H=P.optimizeNodes();P=this.else=Array.isArray(H)?new v(H):H}if(P)return k===!1?P instanceof g?P:P.nodes:this.nodes.length?this:new g(K(k),P instanceof g?[P]:P.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,P){var H;if(this.else=(H=this.else)===null||H===void 0?void 0:H.optimizeNames(k,P),!!(super.optimizeNames(k,P)||this.else))return this.condition=q(this.condition,k,P),this}get names(){const k=super.names;return U(k,this.condition),this.else&&D(k,this.else.names),k}}g.kind="if";class b extends p{}b.kind="for";class y extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,P){if(!!super.optimizeNames(k,P))return this.iteration=q(this.iteration,k,P),this}get names(){return D(super.names,this.iteration.names)}}class x extends b{constructor(k,P,H,J){super(),this.varKind=k,this.name=P,this.from=H,this.to=J}render(k){const P=k.es5?t.varKinds.var:this.varKind,{name:H,from:J,to:he}=this;return`for(${P} ${H}=${J}; ${H}<${he}; ${H}++)`+super.render(k)}get names(){const k=U(super.names,this.from);return U(k,this.to)}}class w extends b{constructor(k,P,H,J){super(),this.loop=k,this.varKind=P,this.name=H,this.iterable=J}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,P){if(!!super.optimizeNames(k,P))return this.iterable=q(this.iterable,k,P),this}get names(){return D(super.names,this.iterable.names)}}class $ extends p{constructor(k,P,H){super(),this.name=k,this.args=P,this.async=H}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}$.kind="func";class S extends h{render(k){return"return "+super.render(k)}}S.kind="return";class _ extends p{render(k){let P="try"+super.render(k);return this.catch&&(P+=this.catch.render(k)),this.finally&&(P+=this.finally.render(k)),P}optimizeNodes(){var k,P;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(k,P){var H,J;return super.optimizeNames(k,P),(H=this.catch)===null||H===void 0||H.optimizeNames(k,P),(J=this.finally)===null||J===void 0||J.optimizeNames(k,P),this}get names(){const k=super.names;return this.catch&&D(k,this.catch.names),this.finally&&D(k,this.finally.names),k}}class F extends p{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}F.kind="catch";class I extends p{render(k){return"finally"+super.render(k)}}I.kind="finally";class W{constructor(k,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts=gs(Tr({},P),{_n:P.lines?` -`:""}),this._extScope=k,this._scope=new t.Scope({parent:k}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,P){const H=this._extScope.value(k,P);return(this._values[H.prefix]||(this._values[H.prefix]=new Set)).add(H),H}getScopeValue(k,P){return this._extScope.getValue(k,P)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,P,H,J){const he=this._scope.toName(P);return H!==void 0&&J&&(this._constants[he.str]=H),this._leafNode(new s(k,he,H)),he}const(k,P,H){return this._def(t.varKinds.const,k,P,H)}let(k,P,H){return this._def(t.varKinds.let,k,P,H)}var(k,P,H){return this._def(t.varKinds.var,k,P,H)}assign(k,P,H){return this._leafNode(new a(k,P,H))}add(k,P){return this._leafNode(new l(k,n.operators.ADD,P))}code(k){return typeof k=="function"?k():k!==e.nil&&this._leafNode(new d(k)),this}object(...k){const P=["{"];for(const[H,J]of k)P.length>1&&P.push(","),P.push(H),(H!==J||this.opts.es5)&&(P.push(":"),(0,e.addCodeArg)(P,J));return P.push("}"),new e._Code(P)}if(k,P,H){if(this._blockNode(new g(k)),P&&H)this.code(P).else().code(H).endIf();else if(P)this.code(P).endIf();else if(H)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new g(k))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(g,v)}_for(k,P){return this._blockNode(k),P&&this.code(P).endFor(),this}for(k,P){return this._for(new y(k),P)}forRange(k,P,H,J,he=this.opts.es5?t.varKinds.var:t.varKinds.let){const Se=this._scope.toName(k);return this._for(new x(he,Se,P,H),()=>J(Se))}forOf(k,P,H,J=t.varKinds.const){const he=this._scope.toName(k);if(this.opts.es5){const Se=P instanceof e.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,e._)`${Se}.length`,pe=>{this.var(he,(0,e._)`${Se}[${pe}]`),H(he)})}return this._for(new w("of",J,he,P),()=>H(he))}forIn(k,P,H,J=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,e._)`Object.keys(${P})`,H);const he=this._scope.toName(k);return this._for(new w("in",J,he,P),()=>H(he))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new c(k))}break(k){return this._leafNode(new u(k))}return(k){const P=new S;if(this._blockNode(P),this.code(k),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(k,P,H){if(!P&&!H)throw new Error('CodeGen: "try" without "catch" and "finally"');const J=new _;if(this._blockNode(J),this.code(k),P){const he=this.name("e");this._currNode=J.catch=new F(he),P(he)}return H&&(this._currNode=J.finally=new I,this.code(H)),this._endBlockNode(F,I)}throw(k){return this._leafNode(new f(k))}block(k,P){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock(P),this}endBlock(k){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const H=this._nodes.length-P;if(H<0||k!==void 0&&H!==k)throw new Error(`CodeGen: wrong number of nodes: ${H} vs ${k} expected`);return this._nodes.length=P,this}func(k,P=e.nil,H,J){return this._blockNode(new $(k,P,H)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,P){const H=this._currNode;if(H instanceof k||P&&H instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${k.kind}/${P.kind}`:k.kind}"`)}_elseNode(k){const P=this._currNode;if(!(P instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const P=this._nodes;P[P.length-1]=k}}n.CodeGen=W;function D(R,k){for(const P in k)R[P]=(R[P]||0)+(k[P]||0);return R}function U(R,k){return k instanceof e._CodeOrName?D(R,k.names):R}function q(R,k,P){if(R instanceof e.Name)return H(R);if(!J(R))return R;return new e._Code(R._items.reduce((he,Se)=>(Se instanceof e.Name&&(Se=H(Se)),Se instanceof e._Code?he.push(...Se._items):he.push(Se),he),[]));function H(he){const Se=P[he.str];return Se===void 0||k[he.str]!==1?he:(delete k[he.str],Se)}function J(he){return he instanceof e._Code&&he._items.some(Se=>Se instanceof e.Name&&k[Se.str]===1&&P[Se.str]!==void 0)}}function X(R,k){for(const P in k)R[P]=(R[P]||0)-(k[P]||0)}function K(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,e._)`!${te(R)}`}n.not=K;const Y=A(n.operators.AND);function T(...R){return R.reduce(Y)}n.and=T;const B=A(n.operators.OR);function O(...R){return R.reduce(B)}n.or=O;function A(R){return(k,P)=>k===e.nil?P:P===e.nil?k:(0,e._)`${te(k)} ${R} ${te(P)}`}function te(R){return R instanceof e.Name?R:(0,e._)`(${R})`}})(gn);var $n={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.checkStrictMode=n.getErrorPath=n.Type=n.useFunc=n.setEvaluated=n.evaluatedPropsToName=n.mergeEvaluated=n.eachItem=n.unescapeJsonPointer=n.escapeJsonPointer=n.escapeFragment=n.unescapeFragment=n.schemaRefOrVal=n.schemaHasRulesButRef=n.schemaHasRules=n.checkUnknownRules=n.alwaysValidSchema=n.toHash=void 0;const e=gn,t=su;function r($){const S={};for(const _ of $)S[_]=!0;return S}n.toHash=r;function i($,S){return typeof S=="boolean"?S:Object.keys(S).length===0?!0:(o($,S),!s(S,$.self.RULES.all))}n.alwaysValidSchema=i;function o($,S=$.schema){const{opts:_,self:F}=$;if(!_.strictSchema||typeof S=="boolean")return;const I=F.RULES.keywords;for(const W in S)I[W]||w($,`unknown keyword: "${W}"`)}n.checkUnknownRules=o;function s($,S){if(typeof $=="boolean")return!$;for(const _ in $)if(S[_])return!0;return!1}n.schemaHasRules=s;function a($,S){if(typeof $=="boolean")return!$;for(const _ in $)if(_!=="$ref"&&S.all[_])return!0;return!1}n.schemaHasRulesButRef=a;function l({topSchemaRef:$,schemaPath:S},_,F,I){if(!I){if(typeof _=="number"||typeof _=="boolean")return _;if(typeof _=="string")return(0,e._)`${_}`}return(0,e._)`${$}${S}${(0,e.getProperty)(F)}`}n.schemaRefOrVal=l;function c($){return d(decodeURIComponent($))}n.unescapeFragment=c;function u($){return encodeURIComponent(f($))}n.escapeFragment=u;function f($){return typeof $=="number"?`${$}`:$.replace(/~/g,"~0").replace(/\//g,"~1")}n.escapeJsonPointer=f;function d($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}n.unescapeJsonPointer=d;function h($,S){if(Array.isArray($))for(const _ of $)S(_);else S($)}n.eachItem=h;function p({mergeNames:$,mergeToName:S,mergeValues:_,resultToName:F}){return(I,W,D,U)=>{const q=D===void 0?W:D instanceof e.Name?(W instanceof e.Name?$(I,W,D):S(I,W,D),D):W instanceof e.Name?(S(I,D,W),W):_(W,D);return U===e.Name&&!(q instanceof e.Name)?F(I,q):q}}n.mergeEvaluated={props:p({mergeNames:($,S,_)=>$.if((0,e._)`${_} !== true && ${S} !== undefined`,()=>{$.if((0,e._)`${S} === true`,()=>$.assign(_,!0),()=>$.assign(_,(0,e._)`${_} || {}`).code((0,e._)`Object.assign(${_}, ${S})`))}),mergeToName:($,S,_)=>$.if((0,e._)`${_} !== true`,()=>{S===!0?$.assign(_,!0):($.assign(_,(0,e._)`${_} || {}`),v($,_,S))}),mergeValues:($,S)=>$===!0?!0:Tr(Tr({},$),S),resultToName:m}),items:p({mergeNames:($,S,_)=>$.if((0,e._)`${_} !== true && ${S} !== undefined`,()=>$.assign(_,(0,e._)`${S} === true ? true : ${_} > ${S} ? ${_} : ${S}`)),mergeToName:($,S,_)=>$.if((0,e._)`${_} !== true`,()=>$.assign(_,S===!0?!0:(0,e._)`${_} > ${S} ? ${_} : ${S}`)),mergeValues:($,S)=>$===!0?!0:Math.max($,S),resultToName:($,S)=>$.var("items",S)})};function m($,S){if(S===!0)return $.var("props",!0);const _=$.var("props",(0,e._)`{}`);return S!==void 0&&v($,_,S),_}n.evaluatedPropsToName=m;function v($,S,_){Object.keys(_).forEach(F=>$.assign((0,e._)`${S}${(0,e.getProperty)(F)}`,!0))}n.setEvaluated=v;const g={};function b($,S){return $.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new t._Code(S.code))})}n.useFunc=b;var y;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(y=n.Type||(n.Type={}));function x($,S,_){if($ instanceof e.Name){const F=S===y.Num;return _?F?(0,e._)`"[" + ${$} + "]"`:(0,e._)`"['" + ${$} + "']"`:F?(0,e._)`"/" + ${$}`:(0,e._)`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return _?(0,e.getProperty)($).toString():"/"+f($)}n.getErrorPath=x;function w($,S,_=$.opts.strictSchema){if(!!_){if(S=`strict mode: ${S}`,_===!0)throw new Error(S);$.self.logger.warn(S)}}n.checkStrictMode=w})($n);var qo={};Object.defineProperty(qo,"__esModule",{value:!0});const Vr=gn,HD={data:new Vr.Name("data"),valCxt:new Vr.Name("valCxt"),instancePath:new Vr.Name("instancePath"),parentData:new Vr.Name("parentData"),parentDataProperty:new Vr.Name("parentDataProperty"),rootData:new Vr.Name("rootData"),dynamicAnchors:new Vr.Name("dynamicAnchors"),vErrors:new Vr.Name("vErrors"),errors:new Vr.Name("errors"),this:new Vr.Name("this"),self:new Vr.Name("self"),scope:new Vr.Name("scope"),json:new Vr.Name("json"),jsonPos:new Vr.Name("jsonPos"),jsonLen:new Vr.Name("jsonLen"),jsonPart:new Vr.Name("jsonPart")};qo.default=HD;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.extendErrors=n.resetErrorsCount=n.reportExtraError=n.reportError=n.keyword$DataError=n.keywordError=void 0;const e=gn,t=$n,r=qo;n.keywordError={message:({keyword:v})=>(0,e.str)`must pass "${v}" keyword validation`},n.keyword$DataError={message:({keyword:v,schemaType:g})=>g?(0,e.str)`"${v}" keyword must be ${g} ($data)`:(0,e.str)`"${v}" keyword is invalid ($data)`};function i(v,g=n.keywordError,b,y){const{it:x}=v,{gen:w,compositeRule:$,allErrors:S}=x,_=f(v,g,b);(y!=null?y:$||S)?l(w,_):c(x,(0,e._)`[${_}]`)}n.reportError=i;function o(v,g=n.keywordError,b){const{it:y}=v,{gen:x,compositeRule:w,allErrors:$}=y,S=f(v,g,b);l(x,S),w||$||c(y,r.default.vErrors)}n.reportExtraError=o;function s(v,g){v.assign(r.default.errors,g),v.if((0,e._)`${r.default.vErrors} !== null`,()=>v.if(g,()=>v.assign((0,e._)`${r.default.vErrors}.length`,g),()=>v.assign(r.default.vErrors,null)))}n.resetErrorsCount=s;function a({gen:v,keyword:g,schemaValue:b,data:y,errsCount:x,it:w}){if(x===void 0)throw new Error("ajv implementation error");const $=v.name("err");v.forRange("i",x,r.default.errors,S=>{v.const($,(0,e._)`${r.default.vErrors}[${S}]`),v.if((0,e._)`${$}.instancePath === undefined`,()=>v.assign((0,e._)`${$}.instancePath`,(0,e.strConcat)(r.default.instancePath,w.errorPath))),v.assign((0,e._)`${$}.schemaPath`,(0,e.str)`${w.errSchemaPath}/${g}`),w.opts.verbose&&(v.assign((0,e._)`${$}.schema`,b),v.assign((0,e._)`${$}.data`,y))})}n.extendErrors=a;function l(v,g){const b=v.const("err",g);v.if((0,e._)`${r.default.vErrors} === null`,()=>v.assign(r.default.vErrors,(0,e._)`[${b}]`),(0,e._)`${r.default.vErrors}.push(${b})`),v.code((0,e._)`${r.default.errors}++`)}function c(v,g){const{gen:b,validateName:y,schemaEnv:x}=v;x.$async?b.throw((0,e._)`new ${v.ValidationError}(${g})`):(b.assign((0,e._)`${y}.errors`,g),b.return(!1))}const u={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function f(v,g,b){const{createErrors:y}=v.it;return y===!1?(0,e._)`{}`:d(v,g,b)}function d(v,g,b={}){const{gen:y,it:x}=v,w=[h(x,b),p(v,b)];return m(v,g,w),y.object(...w)}function h({errorPath:v},{instancePath:g}){const b=g?(0,e.str)`${v}${(0,t.getErrorPath)(g,t.Type.Str)}`:v;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,b)]}function p({keyword:v,it:{errSchemaPath:g}},{schemaPath:b,parentSchema:y}){let x=y?g:(0,e.str)`${g}/${v}`;return b&&(x=(0,e.str)`${x}${(0,t.getErrorPath)(b,t.Type.Str)}`),[u.schemaPath,x]}function m(v,{params:g,message:b},y){const{keyword:x,data:w,schemaValue:$,it:S}=v,{opts:_,propertyName:F,topSchemaRef:I,schemaPath:W}=S;y.push([u.keyword,x],[u.params,typeof g=="function"?g(v):g||(0,e._)`{}`]),_.messages&&y.push([u.message,typeof b=="function"?b(v):b]),_.verbose&&y.push([u.schema,$],[u.parentSchema,(0,e._)`${I}${W}`],[r.default.data,w]),F&&y.push([u.propertyName,F])}})(Mu);Object.defineProperty(Pl,"__esModule",{value:!0});Pl.boolOrEmptySchema=Pl.topBoolOrEmptySchema=void 0;const UD=Mu,WD=gn,JD=qo,KD={message:"boolean schema is false"};function GD(n){const{gen:e,schema:t,validateName:r}=n;t===!1?iC(n,!1):typeof t=="object"&&t.$async===!0?e.return(JD.default.data):(e.assign((0,WD._)`${r}.errors`,null),e.return(!0))}Pl.topBoolOrEmptySchema=GD;function QD(n,e){const{gen:t,schema:r}=n;r===!1?(t.var(e,!1),iC(n)):t.var(e,!0)}Pl.boolOrEmptySchema=QD;function iC(n,e){const{gen:t,data:r}=n,i={gen:t,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,UD.reportError)(i,KD,void 0,e)}var Eu={},Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.getRules=Sa.isJSONType=void 0;const YD=["string","number","integer","boolean","null","object","array"],XD=new Set(YD);function ZD(n){return typeof n=="string"&&XD.has(n)}Sa.isJSONType=ZD;function eL(){const n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:gs(Tr({},n),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}Sa.getRules=eL;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.shouldUseRule=Yo.shouldUseGroup=Yo.schemaHasRulesForType=void 0;function tL({schema:n,self:e},t){const r=e.RULES.types[t];return r&&r!==!0&&oC(n,r)}Yo.schemaHasRulesForType=tL;function oC(n,e){return e.rules.some(t=>sC(n,t))}Yo.shouldUseGroup=oC;function sC(n,e){var t;return n[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(r=>n[r]!==void 0))}Yo.shouldUseRule=sC;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.reportTypeError=n.checkDataTypes=n.checkDataType=n.coerceAndCheckDataType=n.getJSONTypes=n.getSchemaTypes=n.DataType=void 0;const e=Sa,t=Yo,r=Mu,i=gn,o=$n;var s;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(s=n.DataType||(n.DataType={}));function a(y){const x=l(y.type);if(x.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!x.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&x.push("null")}return x}n.getSchemaTypes=a;function l(y){const x=Array.isArray(y)?y:y?[y]:[];if(x.every(e.isJSONType))return x;throw new Error("type must be JSONType or JSONType[]: "+x.join(","))}n.getJSONTypes=l;function c(y,x){const{gen:w,data:$,opts:S}=y,_=f(x,S.coerceTypes),F=x.length>0&&!(_.length===0&&x.length===1&&(0,t.schemaHasRulesForType)(y,x[0]));if(F){const I=m(x,$,S.strictNumbers,s.Wrong);w.if(I,()=>{_.length?d(y,x,_):g(y)})}return F}n.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function f(y,x){return x?y.filter(w=>u.has(w)||x==="array"&&w==="array"):[]}function d(y,x,w){const{gen:$,data:S,opts:_}=y,F=$.let("dataType",(0,i._)`typeof ${S}`),I=$.let("coerced",(0,i._)`undefined`);_.coerceTypes==="array"&&$.if((0,i._)`${F} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>$.assign(S,(0,i._)`${S}[0]`).assign(F,(0,i._)`typeof ${S}`).if(m(x,S,_.strictNumbers),()=>$.assign(I,S))),$.if((0,i._)`${I} !== undefined`);for(const D of w)(u.has(D)||D==="array"&&_.coerceTypes==="array")&&W(D);$.else(),g(y),$.endIf(),$.if((0,i._)`${I} !== undefined`,()=>{$.assign(S,I),h(y,I)});function W(D){switch(D){case"string":$.elseIf((0,i._)`${F} == "number" || ${F} == "boolean"`).assign(I,(0,i._)`"" + ${S}`).elseIf((0,i._)`${S} === null`).assign(I,(0,i._)`""`);return;case"number":$.elseIf((0,i._)`${F} == "boolean" || ${S} === null + */var Y1=function(n,e){var t,r,i=1,o=0,s=0,a=String.alphabet;function l(c,u,f){if(f){for(t=u;f=l(c,t),f<76&&f>65;)++t;return+c.slice(u-1,t)}return f=a&&a.indexOf(c.charAt(u)),f>-1?f+76:(f=c.charCodeAt(u)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((n+="")!=(e+="")){for(;i;)if(r=l(n,o++),i=l(e,s++),r<76&&i<76&&r>66&&i>66&&(r=l(n,o,o),i=l(e,s,o=t),s=t),r!=i)return rthis.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=Ol(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),xo.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ol(this,e,t);let r=[];return this.decompose(e,t,r,0),xo.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Oc(this),o=new Oc(e);for(let s=t,a=t;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Oc(this,e)}iterRange(e,t=this.length){return new ik(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ok(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Pn.empty:e.length<=32?new pr(e):xo.from(pr.split(e,[]))}}class pr extends Pn{constructor(e,t=_T(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((t?r:a)>=e)return new RT(i,a,r,s);i=a+1,r++}}decompose(e,t,r,i){let o=e<=0&&t>=this.length?this:new pr(Z1(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=Vf(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new pr(a,s.length+o.length));else{let l=a.length>>1;r.push(new pr(a.slice(0,l)),new pr(a.slice(l)))}}else r.push(o)}replace(e,t,r){if(!(r instanceof pr))return super.replace(e,t,r);[e,t]=Ol(this,e,t);let i=Vf(this.text,Vf(r.text,Z1(this.text,0,e)),t),o=this.length+r.length-(t-e);return i.length<=32?new pr(i,o):xo.from(pr.split(i,[]),o)}sliceString(e,t=this.length,r=` +`){[e,t]=Ol(this,e,t);let i="";for(let o=0,s=0;o<=t&&se&&s&&(i+=r),eo&&(i+=a.slice(Math.max(0,e-o),t-o)),o=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(t.push(new pr(r,i)),r=[],i=-1);return i>-1&&t.push(new pr(r,i)),t}}class xo extends Pn{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((t?l:a)>=e)return s.lineInner(e,t,r,i);i=a+1,r=l+1}}decompose(e,t,r,i){for(let o=0,s=0;s<=t&&o=s){let c=i&((s<=e?1:0)|(l>=t?2:0));s>=e&&l<=t&&!c?r.push(a):a.decompose(e-s,t-s,r,c)}s=l+1}}replace(e,t,r){if([e,t]=Ol(this,e,t),r.lines=o&&t<=a){let l=s.replace(e-o,t-o,r),c=this.lines-s.lines+l.lines;if(l.lines>5-1&&l.lines>c>>5+1){let u=this.children.slice();return u[i]=l,new xo(u,this.length-(t-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` +`){[e,t]=Ol(this,e,t);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,t-s,r)),s=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof xo))return 0;let r=0,[i,o,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,o+=t){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new pr(h,t)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof xo)for(let m of h.children)f(m);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof pr&&l&&(p=u[u.length-1])instanceof pr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new pr(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:xo.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new xo(a,t)}}Pn.empty=new pr([""],0);function _T(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Vf(n,e,t=0,r=1e9){for(let i=0,o=0,s=!0;o=t&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof pr?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof pr?i.text.length:i.children.length;if(s==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof pr){let l=i.text[s+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof pr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ik{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Oc(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(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);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=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)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ok{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol!="undefined"&&(Pn.prototype[Symbol.iterator]=function(){return this.iter()},Oc.prototype[Symbol.iterator]=ik.prototype[Symbol.iterator]=ok.prototype[Symbol.iterator]=function(){return this});class RT{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function Ol(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}let fl="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(n=>n?parseInt(n,36):1);for(let n=1;nn)return fl[e-1]<=n;return!1}function ey(n){return n>=127462&&n<=127487}const ty=8205;function Br(n,e,t=!0,r=!0){return(t?sk:IT)(n,e,r)}function sk(n,e,t){if(e==n.length)return e;e&&ak(n.charCodeAt(e))&&lk(n.charCodeAt(e-1))&&e--;let r=Rr(n,e);for(e+=Pi(r);e=0&&ey(Rr(n,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function IT(n,e,t){for(;e>0;){let r=sk(n,e-2,t);if(r=56320&&n<57344}function lk(n){return n>=55296&&n<56320}function Rr(n,e){let t=n.charCodeAt(e);if(!lk(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return ak(r)?(t-55296<<10)+(r-56320)+65536:t}function pv(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Pi(n){return n<65536?1:2}const wm=/\r\n?|\n/;var ri=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ri||(ri={}));class Po{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return o+(e-i);o+=a}else{if(r!=ri.Simple&&c>=e&&(r==ri.TrackDel&&ie||r==ri.TrackBefore&&ie))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let r=0,i=0;r=0&&i<=t&&a>=e)return it?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Po(e)}static create(e){return new Po(e)}}class xr extends Po{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return jm(this,(t,r,i,o,s)=>e=e.replace(i,i+(r-t),s),!1),e}mapDesc(e,t=!1){return xm(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,o=0;i=0){t[i]=a,t[i+1]=s;let l=i>>1;for(;r.length0&&ks(r,t,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,t,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let p=h?typeof h=="string"?Pn.of(h.split(r||wm)):h:Pn.empty,m=p.length;if(f==d&&m==0)return;fs&&Ur(i,f-s,-1),Ur(i,d-f,m),ks(o,i,p),s=d}}return c(e),l(!a),a}static empty(e){return new xr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;r.length=0&&t<=0&&t==n[i+1]?n[i]+=e:e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function ks(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||s==n.sections.length||n.sections[s+1]<0);)a=n.sections[s++],l=n.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function xm(n,e,t,r=!1){let i=[],o=r?[]:null,s=new Wc(n),a=new Wc(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Ur(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class Wc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Pn.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?Pn.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ca{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new ca(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return _e.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return _e.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return _e.range(e.anchor,e.head)}static create(e,t,r){return new ca(e,t,r)}}class _e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:_e.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _e(e.ranges.map(t=>ca.fromJSON(t)),e.main)}static single(e,t=e){return new _e([_e.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,t=0){let r=e[t];e.sort((i,o)=>i.from-o.from),t=e.indexOf(r);for(let i=1;io.head?_e.range(l,a):_e.range(a,l))}}return new _e(e,t)}}function uk(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let mv=0;class ot{constructor(e,t,r,i,o){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=mv++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ot(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:gv),!!e.static,e.enables)}of(e){return new Hf([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hf(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hf(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function gv(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Hf{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=mv++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||$m(f,u)){let h=r(f);if(a?!ny(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let m=dd(d,p);if(this.dependencies.every(v=>v instanceof ot?d.facet(v)===f.facet(v):v instanceof kr?d.field(v,!1)==f.field(v,!1):!0)||(a?ny(h=r(f),m,i):i(h=r(f),m)))return f.values[s]=m,0}else h=r(f);return f.values[s]=h,1}}}}function ny(n,e,t){if(n.length!=e.length)return!1;for(let r=0;rn[l.id]),i=t.map(l=>l.type),o=r.filter(l=>!(l&1)),s=n[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ry).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let o=r.values[t],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[t]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}init(e){return[this,ry.of({field:this,create:e})]}get extension(){return this}}const ra={lowest:4,low:3,default:2,high:1,highest:0};function oc(n){return e=>new fk(e,n)}const Ba={highest:oc(ra.highest),high:oc(ra.high),default:oc(ra.default),low:oc(ra.low),lowest:oc(ra.lowest)};class fk{constructor(e,t){this.inner=e,this.prec=t}}class Uo{of(e){return new km(this,e)}reconfigure(e){return Uo.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class km{constructor(e,t){this.compartment=e,this.inner=t}}class fd{constructor(e,t,r,i,o,s){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let i=[],o=Object.create(null),s=new Map;for(let d of LT(e,t,s))d instanceof kr?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,m=u&&u[d]||[];if(h.every(v=>v.type==0))if(a[p.id]=l.length<<1|1,gv(m,h))l.push(r.facet(p));else{let v=p.combine(h.map(g=>g.value));l.push(r&&p.compare(v,r.facet(p))?r.facet(p):v)}else{for(let v of h)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(g=>v.dynamicSlot(g)));a[p.id]=c.length<<1,c.push(v=>DT(v,p,h))}}let f=c.map(d=>d(a));return new fd(e,s,f,a,l,o)}}function LT(n,e,t){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof km&&t.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof km){if(t.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;t.set(s.compartment,c),o(c,a)}else if(s instanceof fk)o(s.inner,s.prec);else if(s instanceof kr)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof Hf)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,ra.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(n,ra.default),r.reduce((s,a)=>s.concat(a))}function Mc(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function dd(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const dk=ot.define(),Sm=ot.define({combine:n=>n.some(e=>e),static:!0}),hk=ot.define({combine:n=>n.length?n[0]:void 0,static:!0}),pk=ot.define(),mk=ot.define(),gk=ot.define(),vk=ot.define({combine:n=>n.length?n[0]:!1});class hs{constructor(e,t){this.type=e,this.value=t}static define(){return new BT}}class BT{of(e){return new hs(this,e)}}class zT{constructor(e){this.map=e}of(e){return new cn(this,e)}}class cn{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new cn(this.type,t)}is(e){return this.type==e}static define(e={}){return new zT(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(t);o&&r.push(o)}return r}}cn.reconfigure=cn.define();cn.appendConfig=cn.define();class $r{constructor(e,t,r,i,o,s){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&uk(r,t.newLength),o.some(a=>a.type==$r.time)||(this.annotations=o.concat($r.time.of(Date.now())))}static create(e,t,r,i,o,s){return new $r(e,t,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation($r.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}$r.time=hs.define();$r.userEvent=hs.define();$r.addToHistory=hs.define();$r.remote=hs.define();function FT(n,e){let t=[];for(let r=0,i=0;;){let o,s;if(r=n[r]))o=n[r++],s=n[r++];else if(i=0;i--){let o=r[i](n);o instanceof $r?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof $r?n=o[0]:n=bk(e,dl(o),!1)}return n}function VT(n){let e=n.startState,t=e.facet(gk),r=n;for(let i=t.length-1;i>=0;i--){let o=t[i](n);o&&Object.keys(o).length&&(r=yk(r,Cm(e,o,n.changes.newLength),!0))}return r==n?n:$r.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const HT=[];function dl(n){return n==null?HT:Array.isArray(n)?n:[n]}var rr=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(rr||(rr={}));const UT=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Om;try{Om=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function WT(n){if(Om)return Om.test(n);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||UT.test(t)))return!0}return!1}function JT(n){return e=>{if(!/\S/.test(e))return rr.Space;if(WT(e))return rr.Word;for(let t=0;t-1)return rr.Word;return rr.Other}}class vn{constructor(e,t,r,i,o,s){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(cn.reconfigure)?(t=null,r=a.value):a.is(cn.appendConfig)&&(t=null,r=dl(r).concat(a.value));let o;t?o=e.startState.values.slice():(t=fd.resolve(r,i,this),o=new vn(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(Sm)?e.newSelection:e.newSelection.asSingle();new vn(t,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:_e.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),o=[r.range],s=dl(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return vn.create({doc:e.doc,selection:_e.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=fd.resolve(e.extensions||[],new Map),r=e.doc instanceof Pn?e.doc:Pn.of((e.doc||"").split(t.staticFacet(vn.lineSeparator)||wm)),i=e.selection?e.selection instanceof _e?e.selection:_e.single(e.selection.anchor,e.selection.head):_e.single(0);return uk(i,r.length),t.staticFacet(Sm)||(i=i.asSingle()),new vn(t,r,i,t.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(vn.tabSize)}get lineBreak(){return this.facet(vn.lineSeparator)||` +`}get readOnly(){return this.facet(vk)}phrase(e,...t){for(let r of this.facet(vn.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>t.length?r:t[o-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let o of this.facet(dk))for(let s of o(this,t,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return JT(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=Br(t,s,!1);if(o(t.slice(l,s))!=rr.Word)break;s=l}for(;an.length?n[0]:4});vn.lineSeparator=hk;vn.readOnly=vk;vn.phrases=ot.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});vn.languageData=dk;vn.changeFilter=pk;vn.transactionFilter=mk;vn.transactionExtender=gk;Uo.reconfigure=cn.define();function Wi(n,e,t={}){let r={};for(let i of n)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(t,o))r[o]=t[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ba{eq(e){return this==e}range(e,t=e){return Jc.create(e,t,this)}}ba.prototype.startSide=ba.prototype.endSide=0;ba.prototype.point=!1;ba.prototype.mapMode=ri.TrackDel;class Jc{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new Jc(e,t,r)}}function Mm(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class vv{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,t,r,i){for(let o=this.findIndex(t,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new vv(i,o,r,a):null,pos:s}}}class wn{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new wn(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(t.length==0&&!s)return this;if(r&&(t=t.slice().sort(Mm)),this.isEmpty)return t.length?wn.of(t):this;let a=new wk(this,null,-1).goto(0),l=0,c=[],u=new Ro;for(;a.value||l=0){let f=t[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,t-o,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return Kc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Kc.from(e).goto(t)}static compare(e,t,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=iy(s,a,r),c=new sc(s,l,o),u=new sc(a,l,o);r.iterGaps((f,d,h)=>oy(c,f,u,d,h,i)),r.empty&&r.length==0&&oy(c,0,u,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=1e9-1);let o=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),s=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=iy(o,s),l=new sc(o,a,0).goto(r),c=new sc(s,a,0).goto(r);for(;;){if(l.to!=c.to||!Em(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,t,r,i,o=-1){let s=new sc(e,null,o).goto(t),a=t,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,t=!1){let r=new Ro;for(let i of e instanceof Jc?[e]:t?KT(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return wn.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=wn.empty;i=i.nextLayer)t=new wn(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}wn.empty=new wn([],[],null,-1);function KT(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(Mm);e=r}return n}wn.empty.nextLayer=wn.empty;class Ro{finishChunk(e){this.chunks.push(new vv(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=[])}constructor(){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}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Ro)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(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);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(wn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=wn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function iy(n,e,t){let r=new Map;for(let o of n)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new wk(s,t,r,o));return i.length==1?i[0]:new Kc(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)hp(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)hp(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),hp(this.heap,0)}}}function hp(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class sc{constructor(e,t,r){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=Kc.from(e,t,r)}goto(e,t=-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}forward(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)}removeActive(e){Zu(this.active,e),Zu(this.activeTo,e),Zu(this.activeRank,e),this.minActive=sy(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:o}=this.cursor;for(;t0;)t++;ef(this.active,t,r),ef(this.activeTo,t,i),ef(this.activeRank,t,o),e&&ef(e,t,this.cursor.from),this.minActive=sy(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-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),r&&Zu(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function oy(n,e,t,r,i,o){n.goto(e),t.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=n.to+l-t.to||n.endSide-t.endSide,u=c<0?n.to+l:t.to,f=Math.min(u,s);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Em(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(a,f,n.point,t.point):f>a&&!Em(n.active,t.active)&&o.compareRange(a,f,n.active,t.active),u>s)break;a=u,c<=0&&n.next(),c>=0&&t.next()}}function Em(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;r--)n[r+1]=n[r];n[e]=t}function sy(n,e){let t=-1,r=1e9;for(let i=0;i=e)return i;if(i==n.length)break;o+=n.charCodeAt(i)==9?t-o%t:1,i=Br(n,i)}return r===!0?-1:n.length}const Tm="\u037C",ay=typeof Symbol=="undefined"?"__"+Tm:Symbol.for(Tm),Pm=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ly=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{};class Bs{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(m=>s.map(v=>m.replace(/&/,v))).reduce((m,v)=>m.concat(v)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=ly[ay]||1;return ly[ay]=e+1,Tm+e.toString(36)}static mount(e,t,r){let i=e[Pm],o=r&&r.nonce;i?o&&i.setNonce(o):i=new GT(e,o),i.mount(Array.isArray(t)?t:[t],e)}}let cy=new Map;class GT{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=cy.get(r);if(o)return e[Pm]=o;this.sheet=new i.CSSStyleSheet,cy.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Pm]=this}mount(e,t){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},QT=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),YT=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Nr=0;Nr<10;Nr++)zs[48+Nr]=zs[96+Nr]=String(Nr);for(var Nr=1;Nr<=24;Nr++)zs[Nr+111]="F"+Nr;for(var Nr=65;Nr<=90;Nr++)zs[Nr]=String.fromCharCode(Nr+32),Gc[Nr]=String.fromCharCode(Nr);for(var pp in zs)Gc.hasOwnProperty(pp)||(Gc[pp]=zs[pp]);function XT(n){var e=QT&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||YT&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Gc:zs)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function hd(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function _m(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ZT(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Uf(n,e){if(!e.anchorNode)return!1;try{return _m(n,e.anchorNode)}catch{return!1}}function Qc(n){return n.nodeType==3?ja(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Ec(n,e,t,r){return t?uy(n,e,t,r,-1)||uy(n,e,t,r,1):!1}function wa(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function pd(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function uy(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:rs(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=wa(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?rs(n):0}else return!1}}function rs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function yv(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function eP(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function jk(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function tP(n,e,t,r,i,o,s,a){let l=n.ownerDocument,c=l.defaultView||window;for(let u=n,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,m=1;if(h)d=eP(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let b=u.getBoundingClientRect();({scaleX:p,scaleY:m}=jk(u,b)),d={left:b.left,right:b.left+u.clientWidth*p,top:b.top,bottom:b.top+u.clientHeight*m}}let v=0,g=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+g&&(g=e.bottom-d.bottom+g+s)):e.bottom>d.bottom&&(g=e.bottom-d.bottom+s,t<0&&e.top-g0&&e.right>d.right+v&&(v=e.right-d.right+v+o)):e.right>d.right&&(v=e.right-d.right+o,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class rP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?rs(t):0),r,Math.min(e.focusOffset,r?rs(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let Va=null;function xk(n){if(n.setActive)return n.setActive();if(Va)return n.focus(Va);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Va==null?{get preventScroll(){return Va={preventScroll:!0},!0}}:void 0),!Va){Va=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}function Sk(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=rs(t)}else if(t.parentNode&&!pd(t))r=wa(t),t=t.parentNode;else return null}}function Ck(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&rt)return f.domBoundsAround(e,t,c);if(d>=e&&i==-1&&(i=l,o=c),c>t&&f.dom.parentNode==this.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=bv){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Mk(n,e,t,r,i,o,s,a,l){let{children:c}=n,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(e==r&&u&&!s&&!d&&o.length<2&&u.merge(t,i,o.length?f:null,t==0,a,l))){if(r0&&(!s&&o.length&&u.merge(t,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(t2);var ft={mac:my||/Mac/.test(xi.platform),windows:/Win/.test(xi.platform),linux:/Linux|X11/.test(xi.platform),ie:Sh,ie_version:Ak?Rm.documentMode||6:Im?+Im[1]:Nm?+Nm[1]:0,gecko:hy,gecko_version:hy?+(/Firefox\/(\d+)/.exec(xi.userAgent)||[0,0])[1]:0,chrome:!!mp,chrome_version:mp?+mp[1]:0,ios:my,android:/Android\b/.test(xi.userAgent),webkit:py,safari:Tk,webkit_version:py?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Rm.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sP=256;class lo extends Bn{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof lo)||this.length-(t-e)+r.length>sP||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new lo(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Jr(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return aP(this.dom,e,t)}}class is extends Bn{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if($k(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,o,s){return r&&(!(r instanceof is&&r.mark.eq(this.mark))||e&&o<=0||te&&t.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new is(this.mark,t,s)}domAtPos(e){return Pk(this,e)}coordsAt(e,t){return Rk(this,e,t)}}function aP(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&t<0||e==r&&t>=0?ft.chrome||ft.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return ft.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?yv(l,s<0):l||null}class Ss extends Bn{static create(e,t,r){return new Ss(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=Ss.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,o,s){return r&&(!(r instanceof Ss)||!this.widget.compare(r.widget)||e>0&&o<=0||t0)?Jr.before(this.dom):Jr.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?Jr.before(this.dom):Jr.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Pn.empty}get isHidden(){return!0}}lo.prototype.children=Ss.prototype.children=Ml.prototype.children=bv;function Pk(n,e){let t=n.dom,{children:r}=n,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==t)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof is&&i.length&&(r=i[i.length-1])instanceof is&&r.mark.eq(e.mark)?_k(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function Rk(n,e,t){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&t>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=u-d):(d-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let o of r)if(o!=t&&(i.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function Lm(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function cP(n){let e=Object.create(null);for(let t=0;t0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){wv(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){_k(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=Dm(t,this.attrs||{})),r&&(this.attrs=Dm({class:r},this.attrs||{}))}domAtPos(e){return Pk(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&($k(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),this.prevAttrs!==void 0&&(Lm(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&Bn.get(i)instanceof is;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Bn.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ft.ios||!this.children.some(o=>o instanceof lo))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof lo)||/[^ -~]/.test(r.text))return null;let i=Qc(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=Rk(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=t){if(o instanceof jr)return o;if(s>t)break}i=s+o.breakAfter}return null}}class As extends Bn{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,o,s){return r&&(!(r instanceof As)||!this.widget.compare(r.widget)||e>0&&o<=0||t0}}class Js{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ai=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(ai||(ai={}));class Ct extends ba{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new ju(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Fs(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=Nk(e,t);r=(o?t?-3e8:-1:5e8)-1,i=(s?t?2e8:1:-6e8)+1}return new Fs(e,r,i,t,e.widget||null,!0)}static line(e){return new xu(e)}static set(e,t=!1){return wn.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ct.none=wn.empty;class ju extends Ct{constructor(e){let{start:t,end:r}=Nk(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof ju&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&wv(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}ju.prototype.point=!1;class xu extends Ct{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof xu&&this.spec.class==e.spec.class&&wv(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}xu.prototype.mapMode=ri.TrackBefore;xu.prototype.point=!0;class Fs extends Ct{constructor(e,t,r,i,o,s){super(t,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?t<=0?ri.TrackBefore:ri.TrackAfter:ri.TrackDel}get type(){return this.startSide!=this.endSide?ai.WidgetRange:this.startSide<=0?ai.WidgetBefore:ai.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Fs&&uP(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=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 super.range(e,t)}}Fs.prototype.point=!0;function Nk(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t!=null?t:e,end:r!=null?r:e}}function uP(n,e){return n==e||!!(n&&e&&n.compare(e))}function Bm(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class Ac{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof As&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new jr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(tf(new Ml(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof As)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(tf(new lo(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Fs){if(r.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")}let a=t-e;if(r instanceof Fs)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new As(r.widget||xa.block,a,r));else{let l=Ss.create(r.widget||xa.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(tf(new Ml(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(tf(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,r,i,o){let s=new Ac(e,t,r,o);return s.openEnd=wn.spans(i,t,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function tf(n,e){for(let t of e)n=new is(t,[n],n.length);return n}class xa extends Js{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}xa.inline=new xa("span");xa.block=new xa("div");var Kn=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Kn||(Kn={}));const $a=Kn.LTR,jv=Kn.RTL;function Ik(n){let e=[];for(let t=0;t=t){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromt:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function Lk(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(vo[m+1]==-h){let v=vo[m+2],g=v&2?i:v&4?v&1?o:i:0;g&&(Ln[f]=Ln[vo[m]]=g),a=m;break}}else{if(vo.length==189)break;vo[a++]=f,vo[a++]=d,vo[a++]=l}else if((p=Ln[f])==2||p==1){let m=p==i;l=m?0:1;for(let v=a-3;v>=0;v-=3){let g=vo[v+2];if(g&2)break;if(m)vo[v+2]|=2;else{if(g&4)break;vo[v+2]|=4}}}}}function gP(n,e,t,r){for(let i=0,o=r;i<=t.length;i++){let s=i?t[i-1].to:n,a=il;)p==v&&(p=t[--m].from,v=m?t[m-1].to:n),Ln[--p]=h;l=u}else o=c,l++}}}function Fm(n,e,t,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new Cs(l,m.from,h));let v=m.direction==$a!=!(h%2);qm(n,v?r+1:r,i,m.inner,m.from,m.to,s),l=m.to}p=m.to}else{if(p==t||(u?Ln[p]!=a:Ln[p]==a))break;p++}d?Fm(n,l,p,r+1,i,d,s):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=Ln[l-1];m!=a&&(u=!1,f=m==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let m=o[--c];if(!u)for(let v=m.from,g=c;;){if(v==e)break e;if(g&&o[g-1].to==v)v=o[--g].from;else{if(Ln[v-1]==a)break e;break}}if(d)d.push(m);else{m.toLn.length;)Ln[Ln.length]=256;let r=[],i=e==$a?0:1;return qm(n,i,i,t,0,n.length,r),r}function Bk(n){return[new Cs(0,n,0)]}let zk="";function yP(n,e,t,r,i){var o;let s=r.head-n.from,a=Cs.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,t);if(s==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],s=l.side(!i,t),c=l.side(i,t)}let u=Br(n.text,s,l.forward(i,t));(ul.to)&&(u=c),zk=n.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)n.some(e=>e)}),Kk=ot.define({combine:n=>n.some(e=>e)}),Gk=ot.define();class pl{constructor(e,t="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new pl(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new pl(_e.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const nf=cn.define({map:(n,e)=>n.map(e)});function si(n,e,t){let r=n.facet(Hk);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Ch=ot.define({combine:n=>n.length?n[0]:!0});let wP=0;const mc=ot.define();class ar{constructor(e,t,r,i,o){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=t||{};return new ar(wP++,e,r,i,a=>{let l=[mc.of(a)];return s&&l.push(Yc.of(c=>{let u=c.plugin(a);return u?s(u):Ct.none})),o&&l.push(o(a)),l})}static fromClass(e,t){return ar.define(r=>new e(r),t)}}class gp{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(si(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){si(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){si(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Qk=ot.define(),xv=ot.define(),Yc=ot.define(),Yk=ot.define(),$v=ot.define(),Xk=ot.define();function vy(n,e){let t=n.state.facet(Xk);if(!t.length)return t;let r=t.map(o=>o instanceof Function?o(n):o),i=[];return wn.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=bP(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const Zk=ot.define();function eS(n){let e=0,t=0,r=0,i=0;for(let o of n.state.facet(Zk)){let s=o(n);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(t=Math.max(t,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:t,top:r,bottom:i}}const gc=ot.define();class Di{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new Di(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new Di(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class md{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=xr.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new Di(o,s,a,l))),this.changedRanges=i}static create(e,t,r){return new md(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class yy extends Bn{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.compositionBarrier=Ct.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new jr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Di(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!MP(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?$P(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new Di(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ft.ie||ft.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=CP(s,a,e.changes);return r=Di.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=ft.chrome||ft.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,m;if(r&&r.range.fromBu){let j=Ac.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Ac.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=j.breakAtStart,p=j.openStart,m=w.openEnd;let $=this.compositionView(r);w.breakAtStart?$.breakAfter=1:w.content.length&&$.merge($.length,$.length,w.content[0],!1,w.openStart,0)&&($.breakAfter=w.content[0].breakAfter,w.content.shift()),j.content.length&&$.merge(0,0,j.content[j.content.length-1],!0,0,j.openEnd)&&j.content.pop(),d=j.content.concat($).concat(w.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=Ac.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:v,off:g}=o.findPos(c,1),{i:b,off:y}=o.findPos(l,-1);Mk(this,b,y,v,g,d,h,p,m)}r&&this.fixCompositionDOM(r)}compositionView(e){let t=new lo(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new is(i,[t],t.length);let r=new jr;return r.append(t,0),r}fixCompositionDOM(e){let t=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Bn.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],t(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&Uf(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(ft.gecko&&a.empty&&!this.hasComposition&&xP(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Jr(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!Ec(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ec(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{ft.android&&ft.chrome&&this.dom.contains(u.focusNode)&&OP(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=hd(this.view.root);if(f)if(a.empty){if(ft.gecko){let d=kP(l.node,l.offset);if(d&&d!=3){let h=(d==1?Sk:Ck)(l.node,l.offset);h&&(l=new Jr(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Jr(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Jr(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&!this.compositionBarrier.size&&Ec(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=hd(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let s=jr.find(this,t.head);if(!s)return;let a=s.posAtStart;if(t.head==a||t.head==a+s.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc);r.collapse(u.node,u.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&r.collapse(i,o)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i=0;i--){let o=Bn.get(t.childNodes[i]);o instanceof jr&&(r=o.domAtPos(o.length))}return r?new Jr(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=Bn.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof jr&&!(r instanceof jr&&t>=0))&&(r=a,i=c),o=c}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof jr))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof lo))return null;let o=Br(i.text,r);if(o==r)return null;let s=ja(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Kn.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(t.push(h.height),s){let p=f.dom.lastChild,m=p?Qc(p):[];if(m.length){let v=m[m.length-1],g=l?v.right-h.left:h.right-v.left;g>a&&(a=g,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Kn.RTL:Kn.LTR}measureTextSize(){for(let o of this.children)if(o instanceof jr){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=Qc(e.firstChild)[0];t=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ok(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let o=i==t.viewports.length?null:t.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(t.lineBlockAt(s).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Ct.replace({widget:new by(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Ct.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Yc).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(Yk).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(wn.join(i))),this.decorations=[this.compositionBarrier,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e{a.point?r=!1:a.endSide<0&&ot.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=eS(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;tP(this.view.scrollDOM,s,t.head{re.from&&(t=!0)}),t}function EP(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),o=e-i.from;if(i.length==0)return _e.cursor(e);o==0?t=1:o==i.length&&(t=-1);let s=o,a=o;t<0?s=Br(i.text,o,!1):a=Br(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=Br(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;an?e.left-n:Math.max(0,n-e.right)}function TP(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function vp(n,e){return n.tope.top+1}function wy(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Hm(n,e,t){let r,i,o,s,a=!1,l,c,u,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Qc(p);for(let v=0;vy||s==y&&o>b){r=p,i=g,o=b,s=y;let j=y?t0?v0)}b==0?t>g.bottom&&(!u||u.bottomg.top)&&(c=p,f=g):u&&vp(u,g)?u=jy(u,g.bottom):f&&vp(f,g)&&(f=wy(f,g.top))}}if(u&&u.bottom>=t?(r=l,i=u):f&&f.top<=t&&(r=c,i=f),!r)return{node:n,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return xy(r,d,t);if(a&&r.contentEditable!="false")return Hm(r,d,t);let h=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:h}}function xy(n,e,t){let r=n.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;at?u.top-t:t-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,h=d;if((ft.chrome||ft.gecko)&&ja(n,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:n,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:n,offset:i>-1?i:s>0?n.nodeValue.length:0}}function nS(n,e,t,r=-1){var i,o;let s=n.contentDOM.getBoundingClientRect(),a=s.top+n.viewState.paddingTop,l,{docHeight:c}=n.viewState,{x:u,y:f}=e,d=f-a;if(d<0)return 0;if(d>c)return n.state.doc.length;for(let j=n.viewState.heightOracle.textHeight/2,w=!1;l=n.elementAtHeight(d),l.type!=ai.Text;)for(;d=r>0?l.bottom+j:l.top-j,!(d>=0&&d<=c);){if(w)return t?null:0;w=!0,r=-r}f=a+d;let h=l.from;if(hn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:$y(n,s,l,u,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,v=m.elementFromPoint(u,f);v&&!n.contentDOM.contains(v)&&(v=null),v||(u=Math.max(s.left+1,Math.min(s.right-1,u)),v=m.elementFromPoint(u,f),v&&!n.contentDOM.contains(v)&&(v=null));let g,b=-1;if(v&&((i=n.docView.nearest(v))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let j=p.caretPositionFromPoint(u,f);j&&({offsetNode:g,offset:b}=j)}else if(p.caretRangeFromPoint){let j=p.caretRangeFromPoint(u,f);j&&({startContainer:g,startOffset:b}=j,(!n.contentDOM.contains(g)||ft.safari&&PP(g,b,u)||ft.chrome&&_P(g,b,u))&&(g=void 0))}}if(!g||!n.docView.dom.contains(g)){let j=jr.find(n.docView,h);if(!j)return d>l.top+l.height/2?l.to:l.from;({node:g,offset:b}=Hm(j.dom,u,f))}let y=n.docView.nearest(g);if(!y)return null;if(y.isWidget&&((o=y.dom)===null||o===void 0?void 0:o.nodeType)==1){let j=y.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight;o+=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a)*n.viewState.heightOracle.lineLength}let s=n.state.sliceDoc(t.from,t.to);return t.from+Am(s,o,n.state.tabSize)}function PP(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return ja(n,r-1,r).getBoundingClientRect().left>t}function _P(n,e,t){if(e!=0)return!1;for(let i=n;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=n.nodeType==1?n.getBoundingClientRect():ja(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function Um(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let r of t.type)if(r.to>e||r.to==e&&(r.to==t.to||r.type==ai.Text))return r}return t}function RP(n,e,t,r){let i=Um(n,e.head),o=!r||i.type!=ai.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),l=n.posAtCoords({x:t==(a==Kn.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return _e.cursor(l,t?-1:1)}return _e.cursor(t?i.to:i.from,t?-1:1)}function ky(n,e,t,r){let i=n.state.doc.lineAt(e.head),o=n.bidiSpans(i),s=n.textDirectionAt(i.from);for(let a=e,l=null;;){let c=yP(i,o,s,a,t),u=zk;if(!c){if(i.number==(t?n.state.doc.lines:1))return a;u=` +`,i=n.state.doc.line(i.number+(t?1:-1)),o=n.bidiSpans(i),c=n.visualLineSide(i,!t)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function NP(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return o=>{let s=r(o);return i==rr.Space&&(i=s),i==s}}function IP(n,e,t,r){let i=e.head,o=t?1:-1;if(i==(t?n.state.doc.length:0))return _e.cursor(i,e.assoc);let s=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(i,e.assoc||-1),u=n.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=n.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,n.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r!=null?r:n.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,m=nS(n,{x:f,y:p},!1,o);if(pl.bottom||(o<0?mi)){let v=n.docView.coordsForChar(m),g=!v||p{if(e>o&&ei(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:_e.cursor(r,rnull),ft.gecko&&ZP(e.contentDOM.ownerDocument)}handleEvent(e){!UP(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=LP(e),r=this.handlers,i=this.view.contentDOM;for(let o in t)if(o!="scroll"){let s=!t[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!t[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()r.keyCode==e.keyCode))&&!e.ctrlKey||BP.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:ft.safari&&!ft.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Sy(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){si(t.state,i)}}}function LP(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&t(o).handlers.push(Sy(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&t(o).observers.push(Sy(r.value,s))}}for(let r in co)t(r).handlers.push(co[r]);for(let r in Vi)t(r).observers.push(Vi[r]);return e}const rS=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],BP="dthko",iS=[16,17,18,20,91,92,224,225],rf=6;function of(n){return Math.max(0,n)*.7+8}function zP(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class FP{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=nP(e.contentDOM),this.atoms=e.state.facet($v).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(vn.allowMultipleSelections)&&qP(e,t),this.dragging=HP(e,t)&&lS(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&zP(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,i=0,o=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},s=eS(this.view);e.clientX-s.left<=o.left+rf?r=-of(o.left-e.clientX):e.clientX+s.right>=o.right-rf&&(r=of(e.clientX-o.right)),e.clientY-s.top<=o.top+rf?i=-of(o.top-e.clientY):e.clientY+s.bottom>=o.bottom-rf&&(i=of(e.clientY-o.bottom)),this.setScrollSpeed(r,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;rthis.select(this.lastEvent),20)}}function qP(n,e){let t=n.state.facet(Fk);return t.length?t[0](e):ft.mac?e.metaKey:e.ctrlKey}function VP(n,e){let t=n.state.facet(qk);return t.length?t[0](e):ft.mac?!e.altKey:!e.ctrlKey}function HP(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=hd(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function UP(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=Bn.get(t))&&r.ignoreEvent(e))return!1;return!0}const co=Object.create(null),Vi=Object.create(null),oS=ft.ie&&ft.ie_version<15||ft.ios&&ft.webkit_version<604;function WP(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),sS(n,t.value)},50)}function sS(n,e){let{state:t}=n,r,i=1,o=t.toText(e),s=o.lines==t.selection.ranges.length;if(Wm!=null&&t.selection.ranges.every(l=>l.empty)&&Wm==o.toString()){let l=-1;r=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=t.toText((s?o.line(i++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:f},range:_e.cursor(c.from+f.length)}})}else s?r=t.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:_e.cursor(l.from+c.length)}}):r=t.replaceSelection(o);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Vi.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};co.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Vi.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Vi.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};co.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(Vk))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=GP(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new FP(n,e,t,r)),r&&n.observer.ignore(()=>xk(n.contentDOM));let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function Cy(n,e,t,r){if(r==1)return _e.cursor(e,t);if(r==2)return EP(n.state,e,t);{let i=jr.find(n.docView,e),o=n.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return an>=e.top&&n<=e.bottom,Oy=(n,e,t)=>aS(e,t)&&n>=t.left&&n<=t.right;function JP(n,e,t,r){let i=jr.find(n.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&Oy(t,r,s))return-1;let a=i.coordsAt(o,1);return a&&Oy(t,r,a)?1:s&&aS(r,s)?-1:1}function My(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:JP(n,t,e.clientX,e.clientY)}}const KP=ft.ie&&ft.ie_version<=11;let Ey=null,Ay=0,Ty=0;function lS(n){if(!KP)return n.detail;let e=Ey,t=Ty;return Ey=n,Ty=Date.now(),Ay=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Ay+1)%3:1}function GP(n,e){let t=My(n,e),r=lS(e),i=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),i=i.map(o.changes))},get(o,s,a){let l=My(n,o),c,u=Cy(n,l.pos,l.bias,r);if(t.pos!=l.pos&&!s){let f=Cy(n,t.pos,t.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=QP(i,l.pos))?c:a?i.addRange(u):_e.create([u])}}}function QP(n,e){for(let t=0;t=e)return _e.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}co.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=t.to||s<=t.from)&&(t=_e.range(o,s))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};co.dragend=n=>(n.inputState.draggedContent=null,!1);function Py(n,e,t,r){if(!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,s=r&&o&&VP(n,e)?{from:o.from,to:o.to}:null,a={from:i,insert:t},l=n.state.changes(s?[s,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),n.inputState.draggedContent=null}co.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,o=()=>{++i==t.length&&Py(n,e,r.filter(s=>s!=null).join(n.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(t[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Py(n,e,r,!0),!0}return!1};co.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=oS?null:e.clipboardData;return t?(sS(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(WP(n),!1)};function YP(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function XP(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:o}of n.selection.ranges){let s=n.doc.lineAt(o);s.number>i&&(e.push(s.text),t.push({from:s.from,to:Math.min(n.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:r}}let Wm=null;co.copy=co.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=XP(n.state);if(!t&&!i)return!1;Wm=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=oS?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(YP(n,t),!1)};const cS=hs.define();function uS(n,e){let t=[];for(let r of n.facet(Wk)){let i=r(n,e);i&&t.push(i)}return t?n.update({effects:t,annotations:cS.of(!0)}):null}function fS(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=uS(n.state,e);t?n.dispatch(t):n.update([])}},10)}Vi.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),fS(n)};Vi.blur=n=>{n.observer.clearSelectionRange(),fS(n)};Vi.compositionstart=Vi.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0,n.docView.maybeCreateCompositionBarrier()&&(n.update([]),n.docView.clearCompositionBarrier()))};Vi.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,ft.chrome&&ft.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Vi.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};co.beforeinput=(n,e)=>{var t;let r;if(ft.chrome&&ft.android&&(r=rS.find(i=>i.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return ft.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),ft.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>Vi.compositionend(n,e),20),!1};const _y=new Set;function ZP(n){_y.has(n)||(_y.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Ry=["pre-wrap","normal","pre-line","break-spaces"];class e_{constructor(e){this.lineWrapping=e,this.doc=Pn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ry.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Jf&&(e.heightChanged=!0),this.height=t)}replace(e,t,r){return li.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Un.ByPosNoHeight,r.setDoc(t),0,0),h=d.to>=c?d:o.lineAt(c,Un.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ji extends dS{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new $o(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof ji||i instanceof _r&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _r?i=new ji(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):li.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(e,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class _r extends li{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,t,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof _r?r[r.length-1]=new _r(o.length+i):r.push(null,new _r(i-1))}if(e>0){let o=r[0];o instanceof _r?r[0]=new _r(e+o.length):r.unshift(new _r(e-1),null)}return li.of(r)}decomposeLeft(e,t){t.push(new _r(e-1),null)}decomposeRight(e,t){t.push(null,new _r(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let o=t+this.length;if(i&&i.from<=t+this.length&&i.more){let s=[],a=Math.max(t,i.from),l=-1;for(i.from>t&&s.push(new _r(i.from-t-1).updateHeight(e,t));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=Jf&&(l=-2);let d=new ji(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new _r(o-a).updateHeight(e,a));let c=li.of(s);return(l<0||Math.abs(c.height-this.height)>=Jf||Math.abs(l-this.heightMetrics(e,t).perLine)>=Jf)&&(e.heightChanged=!0),c}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class n_ extends li{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let o=r+this.left.height;return ea))return c;let u=t==Un.ByPosNoHeight?Un.ByPosNoHeight:Un.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,t,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,t,r,a,l,s);else{let c=this.lineAt(l,Un.ByPos,r,i,o);e=e&&c.from<=t&&s(c),t>c.to&&this.right.forEachLine(c.to+1,t,r,a,l,s)}}replace(e,t,r){let i=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&Ny(o,s-1),t=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e2*t.size||t.size>2*e.size?li.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)}updateHeight(e,t=0,r=!1,i){let{left:o,right:s}=this,a=t+o.length+this.break,l=null;return i&&i.from<=t+o.length&&i.more?l=o=o.updateHeight(e,t,r,i):o.updateHeight(e,t,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ny(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof _r&&(r=n[e+1])instanceof _r&&n.splice(e-1,3,new _r(t.length+1+r.length))}const r_=5;class kv{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ji?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ji(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e=r_)&&this.addLineDeco(i,o,s)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new ji(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new _r(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ji)return e;let t=new ji(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ji)&&!this.isCovered?this.nodes.push(new ji(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=c==n.parentNode?d.bottom:Math.min(l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-t.left,right:Math.max(o,s)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function a_(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class bp{constructor(e,t,r){this.from=e,this.to=t,this.size=r}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new e_(t),this.stateDeco=e.facet(Yc).filter(r=>typeof r!="function"),this.heightMap=li.empty().applyChanges(this.stateDeco,Pn.empty,this.heightOracle.setDoc(e.doc),[new Di(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ct.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new sf(o,s))}}this.viewports=e.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?Dy:new f_(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:vc(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Yc).filter(u=>typeof u!="function");let i=e.changedRanges,o=Di.extendWithRanges(i,i_(r,this.stateDeco,e?e.changes:xr.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&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&&!e.state.facet(Kk)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Kn.RTL:Kn.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=t.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:j,scaleY:w}=jk(t,a);(j>.005&&Math.abs(this.scaleX-j)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=j,this.scaleY=w,c|=8,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=kk(e.scrollDOM);let p=(this.printing?a_:s_)(t,this.paddingTop),m=p.top-this.pixelViewport.top,v=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let j=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(j)&&(s=!0),s||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:$,textHeight:S}=e.docView.measureTextSize();s=w>0&&i.refresh(o,w,$,S,b/$,j),s&&(e.docView.minWidth=0,c|=8)}m>0&&v>0?u=Math.max(m,v):m<0&&v<0&&(u=Math.min(m,v)),i.heightChanged=!1;for(let w of this.viewports){let $=w.from==this.viewport.from?j:e.docView.measureVisibleLineHeights(w);this.heightMap=(s?li.empty().applyChanges(this.stateDeco,Pn.empty,this.heightOracle,[new Di(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new t_(w.from,$))}i.heightChanged&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return y&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new sf(i.lineAt(s-r*1e3,Un.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Un.ByHeight,o,0,0).to);if(t){let{head:c}=t.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Un.ByPos,o,0,0),d;t.y=="center"?d=(f.top+f.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=Kn.LTR&&!r)return[];let a=[],l=(c,u,f,d)=>{if(u-cc&&vv.from>=f.from&&v.to<=f.to&&Math.abs(v.from-c)v.fromg));if(!m){if(uv.from<=u&&v.to>=u)){let v=t.moveToLineBoundary(_e.cursor(u),!1,!0).head;v>c&&(u=v)}m=new bp(c,u,this.gapSize(f,c,u,d))}a.push(m)};for(let c of this.viewportLines){if(c.lengthc.from&&l(c.from,d,c,u),ht.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];wn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){t.push({from:i,to:o})},point(){}},20);let r=t.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=t[o].from||i.to!=t[o].to);return this.visibleRanges=t,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||vc(this.heightMap.lineAt(e,Un.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return vc(this.heightMap.lineAt(this.scaler.fromDOM(e),Un.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return vc(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class sf{constructor(e,t){this.from=e,this.to=t}}function c_(n,e,t){let r=[],i=n,o=0;return wn.spans(t,n,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function lf(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function u_(n,e){for(let t of n)if(e(t))return t}const Dy={toDOM(n){return n},fromDOM(n){return n},scale:1};class f_{constructor(e,t,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=t.lineAt(a,Un.ByPos,e,0,0).top,u=t.lineAt(l,Un.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let o=tvc(i,e)):n._content)}const cf=ot.define({combine:n=>n.join(" ")}),Jm=ot.define({combine:n=>n.indexOf(!0)>-1}),Km=Bs.newName(),hS=Bs.newName(),pS=Bs.newName(),mS={"&light":"."+hS,"&dark":"."+pS};function Gm(n,e,t){return new Bs(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const d_=Gm("."+Km,{"&":{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,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",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 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .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":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&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",insetInlineStart: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-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".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"}},mS),yc="\uFFFF";class h_{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(vn.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=yc}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=i.nextSibling;if(s==t)break;let a=Bn.get(i),l=Bn.get(s);(a&&l?a.breakAfter:(a?a.breakAfter:pd(i))||pd(s)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=s}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(t))&&(o=a.index,s=a[0].length),this.append(t.slice(r,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let t=Bn.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(p_(e,r.node,r.offset)?t:0))}}function p_(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let a=o||s?[]:y_(e),l=new h_(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=b_(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!_m(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!_m(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((ft.ios||ft.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||ft.android&&e.text.length=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:(ft.mac||ft.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=_e.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Pn.of([" "])}):ft.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==` + `&&n.lineWrapping&&(r&&(r=_e.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Pn.of([" "])}),t){if(ft.ios&&n.inputState.flushIOSKey(t)||ft.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&n.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&hl(n.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||o==8&&t.insert.lengthi.head)&&hl(n.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&hl(n.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let a,l=()=>a||(a=g_(n,t,r));return n.state.facet(Uk).some(c=>c(n,t.from,t.to,s,l))||n.dispatch(l()),!0}else if(r&&!r.main.eq(i)){let s=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(s=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function g_(n,e,t){let r,i=n.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+l))}else{let a=i.changes(e),l=t&&t.main.to<=a.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=n.state.sliceDoc(e.from,e.to),u,f=t&&tS(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=n.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:l||p.map(a)};let m=p.to-d,v=m-c.length;if(p.to-p.from!=h||n.state.sliceDoc(v,m)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let g=i.changes({from:v,to:m,insert:e.insert}),b=p.to-o.to;return{changes:g,range:l?_e.range(Math.max(0,l.anchor+b),Math.max(0,l.head+b)):p.map(g)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,s+=".compose",n.inputState.compositionFirstChange&&(s+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function v_(n,e,t,r){let i=Math.min(n.length,e.length),o=0;for(;o0&&a>0&&n.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));t-=s+l-o}return s=s?o-t:0,a=o+(a-s),s=o):a=a?o-t:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}function y_(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new Ly(t,r)),(i!=t||o!=r)&&e.push(new Ly(i,o))),e}function b_(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?_e.single(t+e,r+e):null}const w_={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},wp=ft.ie&&ft.ie_version<=11;class j_{constructor(e){this.view=e,this.active=!1,this.selectionRange=new rP,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.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(ft.ie&&ft.ie_version<=11||ft.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),wp&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.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),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){e.type=="change"&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ch)?r.root.activeElement!=this.dom:!Uf(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ft.ie&&ft.ie_version<=11||ft.android&&ft.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Ec(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ft.safari&&e.root.nodeType==11&&ZT(this.dom.ownerDocument)==this.dom&&x_(this.view)||hd(e.root);if(!t||this.selectionRange.eq(t))return!1;let r=Uf(this.dom,t);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&hl(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);!s||(s.typeOver&&(i=!0),t==-1?{from:t,to:r}=s:(t=Math.min(s.from,t),r=Math.max(s.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Uf(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new m_(this.view,e,t,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=gS(this.view,t);return this.view.state==r&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=By(t,e.previousSibling||e.target.previousSibling,-1),i=By(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function By(n,e,t){for(;e;){let r=Bn.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function x_(n){let e=null;function t(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,a=n.docView.domAtPos(n.state.selection.main.anchor);return Ec(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}class Ze{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(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.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(r=>r.forEach(i=>t(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||iP(e.parent)||document,this.viewState=new Iy(e.state||vn.create(e)),e.scrollTo&&e.scrollTo.is(nf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(mc).map(r=>new gp(r));for(let r of this.plugins)r.update(this);this.observer=new j_(this),this.inputState=new DP(this),this.inputState.ensureHandlers(this.plugins),this.docView=new yy(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=e.length==1&&e[0]instanceof $r?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(cS))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=uS(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(vn.phrases)!=this.state.facet(vn.phrases))return this.setState(o);i=md.create(this,o,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new pl(h.empty?h:_e.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(nf)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=gd.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(gc)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(cf)!=i.state.facet(cf)&&(this.viewState.mustMeasureContent=!0),(t||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Vm))try{d(i)}catch(h){si(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!gS(this,u)&&c.force&&hl(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Iy(e),this.plugins=e.facet(mc).map(r=>new gp(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new yy(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(mc),r=e.state.facet(mc);if(t!=r){let i=[];for(let o of r){let s=t.indexOf(o);if(s<0)i.push(new gp(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(kk(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return si(this.state,p),zy}}),f=md.create(this,this.state,[]),d=!1;f.flags|=l,t?t.flags|=l:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Vm))a(t)}get themeClasses(){return Km+" "+(this.state.facet(Jm)?pS:hS)+" "+this.state.facet(cf)}updateAttrs(){let e=Fy(this,Qk,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ch)?"true":"false",class:"cm-content",style:`${ft.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Fy(this,xv,t);let r=this.observer.ignore(()=>{let i=Lm(this.contentDOM,this.contentAttrs,t),o=Lm(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(Ze.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(gc);let e=this.state.facet(Ze.cspNonce);Bs.mount(this.root,this.styleModules.concat(d_).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tr.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return yp(this,e,ky(this,e,t,r))}moveByGroup(e,t){return yp(this,e,ky(this,e,t,r=>NP(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[t?r.length-1:0];return _e.cursor(o.side(t,i)+e.from,o.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return RP(this,e,t,r)}moveVertically(e,t,r){return yp(this,e,IP(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),nS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Cs.find(o,e-i.from,-1,t)];return yv(r,s.dir==Kn.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Jk)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>$_)return Bk(e.length);let t=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||Lk(o.isolates,r=vy(this,e))))return o.order;r||(r=vy(this,e));let i=vP(e.text,t,r);return this.bidiCache.push(new gd(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ft.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{xk(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return nf.of(new pl(typeof e=="number"?_e.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return nf.of(new pl(_e.cursor(r.from),"start","start",r.top-e,t,!0))}static domEventHandlers(e){return ar.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ar.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Bs.newName(),i=[cf.of(r),gc.of(Gm(`.${r}`,e))];return t&&t.dark&&i.push(Jm.of(!0)),i}static baseTheme(e){return Ba.lowest(gc.of(Gm("."+Km,e,mS)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&Bn.get(r)||Bn.get(e);return((t=i==null?void 0:i.rootView)===null||t===void 0?void 0:t.view)||null}}Ze.styleModule=gc;Ze.inputHandler=Uk;Ze.scrollHandler=Gk;Ze.focusChangeEffect=Wk;Ze.perLineTextDirection=Jk;Ze.exceptionSink=Hk;Ze.updateListener=Vm;Ze.editable=Ch;Ze.mouseSelectionStyle=Vk;Ze.dragMovesSelection=qk;Ze.clickAddsSelectionRange=Fk;Ze.decorations=Yc;Ze.outerDecorations=Yk;Ze.atomicRanges=$v;Ze.bidiIsolatedRanges=Xk;Ze.scrollMargins=Zk;Ze.darkTheme=Jm;Ze.cspNonce=ot.define({combine:n=>n.length?n[0]:""});Ze.contentAttributes=xv;Ze.editorAttributes=Qk;Ze.lineWrapping=Ze.contentAttributes.of({class:"cm-lineWrapping"});Ze.announce=cn.define();const $_=4096,zy={};class gd{constructor(e,t,r,i,o,s){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Kn.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(n):o;s&&Dm(s,t)}return t}const k_=ft.mac?"mac":ft.windows?"win":ft.linux?"linux":"key";function S_(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),t}function O_(n,e,t){return yS(vS(n.state),e,n,t)}let js=null;const M_=4e3;function E_(n,e=k_){let t=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=t[s]||(t[s]=Object.create(null)),p=a.split(/ (?!$)/).map(g=>S_(g,e));for(let g=1;g{let j=js={view:y,prefix:b,scope:s};return setTimeout(()=>{js==j&&(js=null)},M_),!0}]})}let m=p.join(" ");i(m,!1);let v=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),u&&(v.stopPropagation=!0)};for(let s of n){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in u)u[f].run.push(s.any)}let l=s[e]||s.key;if(!!l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return t}function yS(n,e,t,r){let i=XT(e),o=Rr(i,0),s=Pi(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;js&&js.view==t&&js.scope==r&&(a=js.prefix+" ",iS.indexOf(e.keyCode)<0&&(c=!0,js=null));let f=new Set,d=v=>{if(v){for(let g of v.run)if(!f.has(g)&&(f.add(g),g(t,e)))return v.stopPropagation&&(u=!0),!0;v.preventDefault&&(v.stopPropagation&&(u=!0),c=!0)}return!1},h=n[r],p,m;return h&&(d(h[a+uf(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ft.windows&&e.ctrlKey&&e.altKey)&&(p=zs[e.keyCode])&&p!=i?(d(h[a+uf(p,e,!0)])||e.shiftKey&&(m=Gc[e.keyCode])!=i&&m!=p&&d(h[a+uf(m,e,!1)]))&&(l=!0):s&&e.shiftKey&&d(h[a+uf(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),l}class $u{constructor(e,t,r,i,o){this.className=e,this.left=t,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=bS(e);return[new $u(t,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return A_(e,t,r)}}function bS(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Kn.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Vy(n,e,t){let r=_e.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(r,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(r,!0,!0).from),type:ai.Text}}function A_(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),o=n.textDirection==Kn.LTR,s=n.contentDOM,a=s.getBoundingClientRect(),l=bS(n),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=Um(n,r),p=Um(n,i),m=h.type==ai.Text?h:null,v=p.type==ai.Text?p:null;if(m&&(n.lineWrapping||h.widgetLineBreaks)&&(m=Vy(n,r,m)),v&&(n.lineWrapping||p.widgetLineBreaks)&&(v=Vy(n,i,v)),m&&v&&m.from==v.from)return b(y(t.from,t.to,m));{let w=m?y(t.from,null,m):j(h,!1),$=v?y(null,t.to,v):j(p,!0),S=[];return(m||h).to<(v||p).from-(m&&v?1:0)||h.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2<$.top?S.push(g(f,w.bottom,d,$.top)):w.bottom<$.top&&n.elementAtHeight((w.bottom+$.top)/2).type==ai.Text&&(w.bottom=$.top=(w.bottom+$.top)/2),b(w).concat(S).concat(b($))}function g(w,$,S,_){return new $u(e,w-l.left,$-l.top-.01,S-w,_-$+.01)}function b({top:w,bottom:$,horizontal:S}){let _=[];for(let F=0;FD&&q.from=K)break;O>X&&W(Math.max(B,X),w==null&&B<=D,Math.min(O,K),$==null&&O>=U,T.dir)}if(X=Y.to+1,X>=K)break}return I.length==0&&W(D,w==null,U,$==null,n.textDirection),{top:_,bottom:F,horizontal:I}}function j(w,$){let S=a.top+($?w.top:w.bottom);return{top:S,bottom:S,horizontal:[]}}}function T_(n,e){return n.constructor==e.constructor&&n.eq(e)}class P_{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Kf)!=e.state.facet(Kf)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(Kf);for(;t!T_(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Kf=ot.define();function wS(n){return[ar.define(e=>new P_(e,n)),Kf.of(n)]}const jS=!ft.ios,Xc=ot.define({combine(n){return Wi(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function __(n={}){return[Xc.of(n),R_,N_,I_,Kk.of(!0)]}function xS(n){return n.startState.facet(Xc)!=n.state.facet(Xc)}const R_=wS({above:!0,markers(n){let{state:e}=n,t=e.facet(Xc),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||jS:t.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:_e.cursor(i.head,i.head>i.anchor?-1:1);for(let l of $u.forRange(n,s,a))r.push(l)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=xS(n);return t&&Hy(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Hy(e.state,n)},class:"cm-cursorLayer"});function Hy(n,e){e.style.animationDuration=n.facet(Xc).cursorBlinkRate+"ms"}const N_=wS({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:$u.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||xS(n)},class:"cm-selectionLayer"}),Qm={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};jS&&(Qm[".cm-line"].caretColor="transparent !important",Qm[".cm-content"]={caretColor:"transparent !important"});const I_=Ba.highest(Ze.theme(Qm)),$S=cn.define({map(n,e){return n==null?null:e.mapPos(n)}}),bc=kr.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is($S)?r.value:t,n)}}),D_=ar.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(bc);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(bc)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(bc),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(bc)!=n&&this.view.dispatch({effects:$S.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function L_(){return[bc,D_]}function Uy(n,e,t,r,i){e.lastIndex=0;for(let o=n.iterRange(t,r),s=t,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function B_(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:o}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),o=Math.min(n.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class z_{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let t=new Ro,r=t.add.bind(t);for(let{from:i,to:o}of B_(e,this.maxLength))Uy(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(g.range(m,v));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(v,e,m,p));t=t.update({filterFrom:u,filterTo:f,filter:(m,v)=>mf,add:d})}}return t}}const Ym=/x/.unicode!=null?"gu":"g",F_=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Ym),q_={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"};let jp=null;function V_(){var n;if(jp==null&&typeof document!="undefined"&&document.body){let e=document.body.style;jp=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return jp||!1}const Gf=ot.define({combine(n){let e=Wi(n,{render:null,specialChars:F_,addSpecialChars:null});return(e.replaceTabs=!V_())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ym)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ym)),e}});function H_(n={}){return[Gf.of(n),U_()]}let Wy=null;function U_(){return Wy||(Wy=ar.fromClass(class{constructor(n){this.view=n,this.decorations=Ct.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Gf)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new z_({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,o=Rr(e[0],0);if(o==9){let s=i.lineAt(r),a=t.state.tabSize,l=Hl(s.text,a,r-s.from);return Ct.replace({widget:new G_((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Ct.replace({widget:new K_(n,o)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Gf);n.startState.facet(Gf)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const W_="\u2022";function J_(n){return n>=32?W_:n==10?"\u2424":String.fromCharCode(9216+n)}class K_ extends Js{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=J_(this.code),r=e.state.phrase("Control character")+" "+(q_[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let o=document.createElement("span");return o.textContent=t,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class G_ extends Js{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Q_(){return X_}const Y_=Ct.line({class:"cm-activeLine"}),X_=ar.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(Y_.range(i.from)),e=i.from)}return Ct.set(t)}},{decorations:n=>n.decorations}),Xm=2e3;function Z_(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),o=[];if(e.off>Xm||t.off>Xm||e.col<0||t.col<0){let s=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=i;l++){let c=n.doc.line(l);c.length<=a&&o.push(_e.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=i;l++){let c=n.doc.line(l),u=Am(c.text,s,n.tabSize,!0);if(u<0)o.push(_e.cursor(c.to));else{let f=Am(c.text,a,n.tabSize);o.push(_e.range(c.from+u,c.from+f))}}}return o}function eR(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Jy(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,o=i>Xm?-1:i==r.length?eR(n,e.clientX):Hl(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:o,off:i}}function tR(n,e){let t=Jy(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(t.line).from),s=i.state.doc.lineAt(o);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=Jy(n,i);if(!a)return r;let l=Z_(n.state,t,a);return l.length?s?_e.create(l.concat(r.ranges)):_e.create(l):r}}:null}function nR(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return Ze.mouseSelectionStyle.of((t,r)=>e(r)?tR(t,r):null)}const rR={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},iR={style:"cursor: crosshair"};function oR(n={}){let[e,t]=rR[n.key||"Alt"],r=ar.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,Ze.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?iR:null})]}const ac="-10000px";class kS{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,t){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=t?[]:null;for(let l=0;lt[c]=l),t.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function sR(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const xp=ot.define({combine:n=>{var e,t,r;return{position:ft.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||sR}}}),Ky=new WeakMap,Sv=ar.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(xp);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new kS(n,Oh,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){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}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(xp);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.insertBefore(i,r)}return t.dom.style.position=this.position,t.dom.style.top=ac,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ft.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==ac&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,t=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(xp).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:r}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:t,space:r,scaleX:i,scaleY:o}=n,s=[];for(let a=0;a=Math.min(t.bottom,r.bottom)||f.rightMath.min(t.right,r.right)+.1){u.style.top=ac;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,v=(e=Ky.get(c))!==null&&e!==void 0?e:d.bottom-d.top,g=c.offset||lR,b=this.view.textDirection==Kn.LTR,y=d.width>r.right-r.left?b?r.left:r.right-d.width:b?Math.min(f.left-(h?14:0)+g.x,r.right-m):Math.max(r.left,f.left-m+(h?14:0)-g.x),j=this.above[a];!l.strictSide&&(j?f.top-(d.bottom-d.top)-g.yr.bottom)&&j==r.bottom-f.bottom>f.top-r.top&&(j=this.above[a]=!j);let w=(j?f.top-r.top:r.bottom-f.bottom)-p;if(wy&&_.top<$+v&&_.bottom>$&&($=j?_.top-v-2-p:_.bottom+p+2);if(this.position=="absolute"?(u.style.top=($-n.parent.top)/o+"px",u.style.left=(y-n.parent.left)/i+"px"):(u.style.top=$/o+"px",u.style.left=y/i+"px"),h){let _=f.left+(b?g.x:-g.x)-(y+14-7);h.style.left=_/i+"px"}c.overlap!==!0&&s.push({left:y,top:$,right:S,bottom:$+v}),u.classList.toggle("cm-tooltip-above",j),u.classList.toggle("cm-tooltip-below",!j),c.positioned&&c.positioned(n.space)}}maybeMeasure(){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)))for(let n of this.manager.tooltipViews)n.dom.style.top=ac}},{eventObservers:{scroll(){this.maybeMeasure()}}}),aR=Ze.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&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:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),lR={x:0,y:0},Oh=ot.define({enables:[Sv,aR]}),yd=ot.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Mh{static create(e){return new Mh(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new kS(e,yd,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const cR=Oh.compute([yd],n=>{let e=n.facet(yd);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:Mh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class uR{constructor(e,t,r,i,o){this.view=e,this.source=t,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:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||t.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==Kn.RTL?-1:1;o=t.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>si(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Sv),t=e?e.manager.tooltips.findIndex(r=>r.create==Mh.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!fR(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!dR(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const ff=4;function fR(n,e){let t=n.getBoundingClientRect();return e.clientX>=t.left-ff&&e.clientX<=t.right+ff&&e.clientY>=t.top-ff&&e.clientY<=t.bottom+ff}function dR(n,e,t,r,i,o){let s=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=e&&l<=t}function hR(n,e={}){let t=cn.define(),r=kr.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,ri.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(t)&&(i=s.value),s.is(pR)&&(i=[]);return i},provide:i=>yd.from(i)});return[r,ar.define(i=>new uR(i,n,r,t,e.hoverTime||300)),cR]}function SS(n,e){let t=n.plugin(Sv);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const pR=cn.define(),Gy=ot.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Zc(n,e){let t=n.plugin(CS),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const CS=ar.fromClass(class{constructor(n){this.input=n.state.facet(eu),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Gy);this.top=new df(n,!0,e.topContainer),this.bottom=new df(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Gy);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new df(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new df(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(eu);if(t!=this.input){let r=t.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(n.view),a.push(u)):(u=this.panels[c],u.update&&u.update(n)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Ze.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class df{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Qy(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Qy(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Qy(n){let e=n.nextSibling;return n.remove(),e}const eu=ot.define({enables:CS});class No extends ba{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}No.prototype.elementClass="";No.prototype.toDOM=void 0;No.prototype.mapMode=ri.TrackBefore;No.prototype.startSide=No.prototype.endSide=-1;No.prototype.point=!0;const Qf=ot.define(),mR={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>wn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Tc=ot.define();function OS(n){return[MS(),Tc.of(Object.assign(Object.assign({},mR),n))]}const Zm=ot.define({combine:n=>n.some(e=>e)});function MS(n){let e=[gR];return n&&n.fixed===!1&&e.push(Zm.of(!0)),e}const gR=ar.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Tc).map(e=>new Xy(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Zm),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Zm)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=wn.iter(this.view.state.facet(Qf),this.view.viewport.from),r=[],i=this.gutters.map(o=>new vR(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ai.Text&&s){eg(t,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ai.Text){eg(t,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(Tc),t=n.state.facet(Tc),r=n.docChanged||n.heightChanged||n.viewportChanged||!wn.eq(n.startState.facet(Qf),n.state.facet(Qf),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let o of t){let s=e.indexOf(o);s<0?i.push(new Xy(this.view,o)):(this.gutters[s].update(n),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Ze.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Kn.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function Yy(n){return Array.isArray(n)?n:[n]}function eg(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class vR{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=wn.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,o=(t.top-this.height)/e.scaleY,s=t.height/e.scaleY;if(this.i==i.elements.length){let a=new ES(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];eg(this.cursor,i,t.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,t,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t);r&&this.addElement(e,t,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Xy{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Yy(t.markers(e)),t.initialSpacer&&(this.spacer=new ES(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Yy(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!wn.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class ES{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),yR(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class $p extends No{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function kp(n,e){return n.state.facet(nl).formatNumber(e,n.state)}const wR=Tc.compute([nl],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(bR)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new $p(kp(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(nl)!=e.state.facet(nl),initialSpacer(e){return new $p(kp(e,Zy(e.state.doc.lines)))},updateSpacer(e,t){let r=kp(t.view,Zy(t.view.state.doc.lines));return r==e.number?e:new $p(r)},domEventHandlers:n.facet(nl).domEventHandlers}));function jR(n={}){return[nl.of(n),MS(),wR]}function Zy(n){let e=9;for(;e{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(xR.range(i)))}return wn.of(e)});function kR(){return $R}const AS=1024;let SR=0;class Sp{constructor(e,t){this.from=e,this.to=t}}class mn{constructor(e={}){this.id=SR++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=pi.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}mn.closedBy=new mn({deserialize:n=>n.split(" ")});mn.openedBy=new mn({deserialize:n=>n.split(" ")});mn.group=new mn({deserialize:n=>n.split(" ")});mn.isolate=new mn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});mn.contextHash=new mn({perNode:!0});mn.lookAhead=new mn({perNode:!0});mn.mounted=new mn({perNode:!0});class bd{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[mn.mounted.id]}}const CR=Object.create(null);class pi{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):CR,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new pi(e.name||"",t,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(mn.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(mn.group),o=-1;o<(i?i.length:0);o++){let s=t[o<0?r.name:i[o]];if(s)return s}}}}pi.none=new pi("",Object.create(null),0,8);class Cv{constructor(e){this.types=e;for(let t=0;t0;for(let l=this.cursor(s|Or.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ev(pi.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new vr(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new vr(pi.none,t,r,i)))}static build(e){return AR(e)}}vr.empty=new vr(pi.none,[],[],0);class Ov{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ov(this.buffer,this.index)}}class qs{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return pi.none}toString(){let e=[];for(let t=0;t0));l=s[l+3]);return a}slice(e,t,r){let i=this.buffer,o=new Uint16Array(t-e),s=0;for(let a=e,l=0;a=e&&te;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function tu(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?a.length:-1;e!=c;e+=t){let u=a[e],f=l[e]+s.from;if(!!TS(i,r,f,f+u.length)){if(u instanceof qs){if(o&Or.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,t,r-f,i);if(d>-1)return new Os(new OR(s,u,e,f),null,d)}else if(o&Or.IncludeAnonymous||!u.type.isAnonymous||Mv(u)){let d;if(!(o&Or.IgnoreMounts)&&(d=bd.get(u))&&!d.overlay)return new Li(d.tree,f,e,s);let h=new Li(u,f,e,s);return o&Or.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(t<0?u.children.length-1:0,t,r,i)}}}if(o&Or.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,r=0){let i;if(!(r&Or.IgnoreOverlays)&&(i=bd.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((t>0?s<=o:s=o:a>o))return new Li(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function tb(n,e,t,r){let i=n.cursor(),o=[];if(!i.firstChild())return o;if(t!=null){for(let s=!1;!s;)if(s=i.type.is(t),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function tg(n,e,t=e.length-1){for(let r=n.parent;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class OR{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class Os extends PS{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return o<0?null:new Os(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,r=0){if(r&Or.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new Os(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Os(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Os(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),t.push(0)}return new vr(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function _S(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;ot.from||s.to=e){let a=new Li(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(tu(a,e,t,!1))}}return i?_S(i):r}class ng{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Li)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.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}yield(e){return e?e instanceof Li?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&Or.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Or.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Or.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(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)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=t+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&Or.IncludeAnonymous||a instanceof qs||!a.type.isAnonymous||Mv(a))return!1}return!0}move(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}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,r=o+1;break e}i=this.stack[--o]}}for(let i=r;i=0;o--){if(o<0)return tg(this.node,e,i);let s=r[t.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function Mv(n){return n.children.some(e=>e instanceof qs||!e.type.isAnonymous||Mv(e))}function AR(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=AS,reused:o=[],minRepeatType:s=r.types.length}=n,a=Array.isArray(t)?new Ov(t,t.length):t,l=r.types,c=0,u=0;function f(w,$,S,_,F,I){let{id:W,start:D,end:U,size:q}=a,X=u;for(;q<0;)if(a.next(),q==-1){let O=o[W];S.push(O),_.push(D-w);return}else if(q==-3){c=W;return}else if(q==-4){u=W;return}else throw new RangeError(`Unrecognized record size: ${q}`);let K=l[W],Y,T,B=D-w;if(U-D<=i&&(T=v(a.pos-$,F))){let O=new Uint16Array(T.size-T.skip),A=a.pos-T.size,te=O.length;for(;a.pos>A;)te=g(T.start,O,te);Y=new qs(O,U-T.start,r),B=T.start-w}else{let O=a.pos-q;a.next();let A=[],te=[],R=W>=s?W:-1,k=0,P=U;for(;a.pos>O;)R>=0&&a.id==R&&a.size>=0?(a.end<=P-i&&(p(A,te,D,k,a.end,P,R,X),k=A.length,P=a.end),a.next()):I>2500?d(D,O,A,te):f(D,O,A,te,R,I+1);if(R>=0&&k>0&&k-1&&k>0){let H=h(K);Y=Ev(K,A,te,0,A.length,0,U-D,H,H)}else Y=m(K,A,te,U-D,X-U)}S.push(Y),_.push(B)}function d(w,$,S,_){let F=[],I=0,W=-1;for(;a.pos>$;){let{id:D,start:U,end:q,size:X}=a;if(X>4)a.next();else{if(W>-1&&U=0;q-=3)D[X++]=F[q],D[X++]=F[q+1]-U,D[X++]=F[q+2]-U,D[X++]=X;S.push(new qs(D,F[2]-U,r)),_.push(U-w)}}function h(w){return($,S,_)=>{let F=0,I=$.length-1,W,D;if(I>=0&&(W=$[I])instanceof vr){if(!I&&W.type==w&&W.length==_)return W;(D=W.prop(mn.lookAhead))&&(F=S[I]+W.length+D)}return m(w,$,S,_,F)}}function p(w,$,S,_,F,I,W,D){let U=[],q=[];for(;w.length>_;)U.push(w.pop()),q.push($.pop()+S-F);w.push(m(r.types[W],U,q,I-F,D-I)),$.push(F-S)}function m(w,$,S,_,F=0,I){if(c){let W=[mn.contextHash,c];I=I?[W].concat(I):[W]}if(F>25){let W=[mn.lookAhead,F];I=I?[W].concat(I):[W]}return new vr(w,$,S,_,I)}function v(w,$){let S=a.fork(),_=0,F=0,I=0,W=S.end-i,D={size:0,start:0,skip:0};e:for(let U=S.pos-w;S.pos>U;){let q=S.size;if(S.id==$&&q>=0){D.size=_,D.start=F,D.skip=I,I+=4,_+=4,S.next();continue}let X=S.pos-q;if(q<0||X=s?4:0,Y=S.start;for(S.next();S.pos>X;){if(S.size<0)if(S.size==-3)K+=4;else break e;else S.id>=s&&(K+=4);S.next()}F=Y,_+=q,I+=K}return($<0||_==w)&&(D.size=_,D.start=F,D.skip=I),D.size>4?D:void 0}function g(w,$,S){let{id:_,start:F,end:I,size:W}=a;if(a.next(),W>=0&&_4){let U=a.pos-(W-4);for(;a.pos>U;)S=g(w,$,S)}$[--S]=D,$[--S]=I-w,$[--S]=F-w,$[--S]=_}else W==-3?c=_:W==-4&&(u=_);return S}let b=[],y=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,b,y,-1,0);let j=(e=n.length)!==null&&e!==void 0?e:b.length?y[0]+b[0].length:0;return new vr(l[n.topID],b.reverse(),y.reverse(),j)}const nb=new WeakMap;function Yf(n,e){if(!n.isAnonymous||e instanceof qs||e.type!=n)return 1;let t=nb.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof vr)){t=1;break}t+=Yf(n,r)}nb.set(e,t)}return t}function Ev(n,e,t,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;$+=S}if(y==j+1){if($>u){let S=p[j];h(S.children,S.positions,0,S.children.length,m[j]+b);continue}f.push(p[j])}else{let S=m[y-1]+p[y-1].length-w;f.push(Ev(n,p,m,j,y,w,S,null,l))}d.push(w+b-o)}}return h(e,t,r,i,0),(a||l)(f,d,s)}class pa{constructor(e,t,r,i,o=!1,s=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new pa(0,e.length,e,0,!1,r)];for(let o of t)o.to>e.length&&i.push(o);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new pa(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew Sp(i.from,i.to)):[new Sp(0,0)]:[new Sp(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let o=i.advance();if(o)return o}}}class TR{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new mn({perNode:!0});let PR=0;class jo{constructor(e,t,r){this.set=e,this.base=t,this.modified=r,this.id=PR++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new jo([],null,[]);if(t.set.push(t),e)for(let r of e.set)t.set.push(r);return t}static defineModifier(){let e=new wd;return t=>t.modified.indexOf(e)>-1?t:wd.get(t.base||t,t.modified.concat(e).sort((r,i)=>r.id-i.id))}}let _R=0;class wd{constructor(){this.instances=[],this.id=_R++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&RR(t,a.modified));if(r)return r;let i=[],o=new jo(i,e,t);for(let a of t)a.instances.push(o);let s=NR(t);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(wd.get(a,l));return o}}function RR(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function NR(n){let e=[[]];for(let t=0;tr.length-t.length)}function NS(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new jd(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return IS.add(e)}const IS=new mn;class jd{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let a of o)for(let l of a.set){let c=t[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function IR(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function DR(n,e,t,r=0,i=n.length){let o=new LR(r,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),r,i,"",o.highlighters),o.flush(i)}class LR{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=t)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=BR(e)||jd.empty,f=IR(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(mn.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(v=>!v.scope||v.scope(d.tree.type)),m=e.firstChild();for(let v=0,g=a;;v++){let b=v=y||!e.nextSibling())););if(!b||y>r)break;g=b.to+a,g>t&&(this.highlightRange(h.cursor(),Math.max(t,b.from+a),Math.min(r,g),"",p),this.startSpan(Math.min(r,g),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function BR(n){let e=n.type.prop(IS);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Ke=jo.define,pf=Ke(),bs=Ke(),rb=Ke(bs),ib=Ke(bs),ws=Ke(),mf=Ke(ws),Cp=Ke(ws),wo=Ke(),Zs=Ke(wo),yo=Ke(),bo=Ke(),rg=Ke(),lc=Ke(rg),gf=Ke(),Ve={comment:pf,lineComment:Ke(pf),blockComment:Ke(pf),docComment:Ke(pf),name:bs,variableName:Ke(bs),typeName:rb,tagName:Ke(rb),propertyName:ib,attributeName:Ke(ib),className:Ke(bs),labelName:Ke(bs),namespace:Ke(bs),macroName:Ke(bs),literal:ws,string:mf,docString:Ke(mf),character:Ke(mf),attributeValue:Ke(mf),number:Cp,integer:Ke(Cp),float:Ke(Cp),bool:Ke(ws),regexp:Ke(ws),escape:Ke(ws),color:Ke(ws),url:Ke(ws),keyword:yo,self:Ke(yo),null:Ke(yo),atom:Ke(yo),unit:Ke(yo),modifier:Ke(yo),operatorKeyword:Ke(yo),controlKeyword:Ke(yo),definitionKeyword:Ke(yo),moduleKeyword:Ke(yo),operator:bo,derefOperator:Ke(bo),arithmeticOperator:Ke(bo),logicOperator:Ke(bo),bitwiseOperator:Ke(bo),compareOperator:Ke(bo),updateOperator:Ke(bo),definitionOperator:Ke(bo),typeOperator:Ke(bo),controlOperator:Ke(bo),punctuation:rg,separator:Ke(rg),bracket:lc,angleBracket:Ke(lc),squareBracket:Ke(lc),paren:Ke(lc),brace:Ke(lc),content:wo,heading:Zs,heading1:Ke(Zs),heading2:Ke(Zs),heading3:Ke(Zs),heading4:Ke(Zs),heading5:Ke(Zs),heading6:Ke(Zs),contentSeparator:Ke(wo),list:Ke(wo),quote:Ke(wo),emphasis:Ke(wo),strong:Ke(wo),link:Ke(wo),monospace:Ke(wo),strikethrough:Ke(wo),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:gf,documentMeta:Ke(gf),annotation:Ke(gf),processingInstruction:Ke(gf),definition:jo.defineModifier(),constant:jo.defineModifier(),function:jo.defineModifier(),standard:jo.defineModifier(),local:jo.defineModifier(),special:jo.defineModifier()};DS([{tag:Ve.link,class:"tok-link"},{tag:Ve.heading,class:"tok-heading"},{tag:Ve.emphasis,class:"tok-emphasis"},{tag:Ve.strong,class:"tok-strong"},{tag:Ve.keyword,class:"tok-keyword"},{tag:Ve.atom,class:"tok-atom"},{tag:Ve.bool,class:"tok-bool"},{tag:Ve.url,class:"tok-url"},{tag:Ve.labelName,class:"tok-labelName"},{tag:Ve.inserted,class:"tok-inserted"},{tag:Ve.deleted,class:"tok-deleted"},{tag:Ve.literal,class:"tok-literal"},{tag:Ve.string,class:"tok-string"},{tag:Ve.number,class:"tok-number"},{tag:[Ve.regexp,Ve.escape,Ve.special(Ve.string)],class:"tok-string2"},{tag:Ve.variableName,class:"tok-variableName"},{tag:Ve.local(Ve.variableName),class:"tok-variableName tok-local"},{tag:Ve.definition(Ve.variableName),class:"tok-variableName tok-definition"},{tag:Ve.special(Ve.variableName),class:"tok-variableName2"},{tag:Ve.definition(Ve.propertyName),class:"tok-propertyName tok-definition"},{tag:Ve.typeName,class:"tok-typeName"},{tag:Ve.namespace,class:"tok-namespace"},{tag:Ve.className,class:"tok-className"},{tag:Ve.macroName,class:"tok-macroName"},{tag:Ve.propertyName,class:"tok-propertyName"},{tag:Ve.operator,class:"tok-operator"},{tag:Ve.comment,class:"tok-comment"},{tag:Ve.meta,class:"tok-meta"},{tag:Ve.invalid,class:"tok-invalid"},{tag:Ve.punctuation,class:"tok-punctuation"}]);var Op;const rl=new mn;function zR(n){return ot.define({combine:n?e=>e.concat(n):void 0})}const FR=new mn;class no{constructor(e,t,r=[],i=""){this.data=e,this.name=i,vn.prototype.hasOwnProperty("tree")||Object.defineProperty(vn.prototype,"tree",{get(){return Yr(this)}}),this.parser=t,this.extension=[Vs.of(this),vn.languageData.of((o,s,a)=>{let l=ob(o,s,a),c=l.type.prop(rl);if(!c)return[];let u=o.facet(c),f=l.type.prop(FR);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,t,r=-1){return ob(e,t,r).type.prop(rl)==this.data}findRegions(e){let t=e.facet(Vs);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(rl)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(mn.mounted);if(a){if(a.tree.prop(rl)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?t:void 0)]}),e.name)}configure(e,t){return new xd(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Yr(n){let e=n.field(no.state,!1);return e?e.tree:vr.empty}class qR{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let cc=null;class $d{constructor(e,t,r=[],i,o,s,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new $d(e,t,[],vr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new qR(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=vr.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(pa.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=cc;cc=this;try{return e()}finally{cc=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sb(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=pa.applyChanges(r,l),i=vr.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=sb(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends RS{createParse(t,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=cc;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new vr(pi.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return cc}}function sb(n,e,t){return pa.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class El{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new El(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=$d.create(e.facet(Vs).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new El(r)}}no.state=kr.define({create:El.init,update(n,e){for(let t of e.effects)if(t.is(no.setState))return t.value;return e.startState.facet(Vs)!=e.state.facet(Vs)?El.init(e.state):n.apply(e)}});let LS=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback!="undefined"&&(LS=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Mp=typeof navigator!="undefined"&&((Op=navigator.scheduling)===null||Op===void 0?void 0:Op.isInputPending)?()=>navigator.scheduling.isInputPending():null,VR=ar.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(no.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(no.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=LS(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>Mp&&Mp()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:no.setState.of(new El(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>si(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Vs=ot.define({combine(n){return n.length?n[0]:null},enables:n=>[no.state,VR,Ze.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class HR{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const UR=ot.define(),Eh=ot.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Hs(n){let e=n.facet(Eh);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function nu(n,e){let t="",r=n.tabSize,i=n.facet(Eh)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let o=0;o=e?WR(n,t,e):null}class Ah{constructor(e,t={}){this.state=e,this.options=t,this.unit=Hs(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(t<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,t=e.length){return Hl(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const BS=new mn;function WR(n,e,t){let r=e.resolveStack(t),i=r.node.enterUnfinishedNodesBefore(t);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return zS(r,n,t)}function zS(n,e,t){for(let r=n;r;r=r.next){let i=KR(r.node);if(i)return i(Tv.create(e,t,r))}return 0}function JR(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function KR(n){let e=n.type.prop(BS);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(mn.closedBy))){let i=n.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>XR(s,!0,1,void 0,o&&!JR(s)?i.from:void 0)}return n.parent==null?GR:null}function GR(){return 0}class Tv extends Ah{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Tv(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(QR(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return zS(this.context.next,this.base,this.pos)}}function QR(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function YR(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const ZR=200;function e9(){return vn.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+ZR)return n;let o=t.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return n;let{state:s}=n,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=Av(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=nu(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[n,{changes:l,sequential:!0}]:n})}const t9=ot.define(),FS=new mn;function n9(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(o&&a.from=e&&c.to>t&&(o=c)}}return o}function i9(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function kd(n,e,t){for(let r of n.facet(t9)){let i=r(n,e,t);if(i)return i}return r9(n,e,t)}function qS(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const Th=cn.define({map:qS}),ku=cn.define({map:qS});function VS(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const ka=kr.define({create(){return Ct.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(Th)&&!o9(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(Pv),i=r?Ct.replace({widget:new d9(r(e.state,t.value))}):lb;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(ku)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,o)=>{ir&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return n},provide:n=>Ze.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!i||i.from>o)&&(i={from:o,to:s})}),i}function o9(n,e,t){let r=!1;return n.between(e,e,(i,o)=>{i==e&&o==t&&(r=!0)}),r}function HS(n,e){return n.field(ka,!1)?e:e.concat(cn.appendConfig.of(WS()))}const s9=n=>{for(let e of VS(n)){let t=kd(n.state,e.from,e.to);if(t)return n.dispatch({effects:HS(n.state,[Th.of(t),US(n,t)])}),!0}return!1},a9=n=>{if(!n.state.field(ka,!1))return!1;let e=[];for(let t of VS(n)){let r=Sd(n.state,t.from,t.to);r&&e.push(ku.of(r),US(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function US(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return Ze.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const l9=n=>{let{state:e}=n,t=[];for(let r=0;r{let e=n.state.field(ka,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(ku.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},u9=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:s9},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:a9},{key:"Ctrl-Alt-[",run:l9},{key:"Ctrl-Alt-]",run:c9}],f9={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Pv=ot.define({combine(n){return Wi(n,f9)}});function WS(n){let e=[ka,m9];return n&&e.push(Pv.of(n)),e}function JS(n,e){let{state:t}=n,r=t.facet(Pv),i=s=>{let a=n.lineBlockAt(n.posAtDOM(s.target)),l=Sd(n.state,a.from,a.to);l&&n.dispatch({effects:ku.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",t.phrase("folded code")),o.title=t.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const lb=Ct.replace({widget:new class extends Js{toDOM(n){return JS(n,null)}}});class d9 extends Js{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return JS(e,this.value)}}const h9={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Ep extends No{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function p9(n={}){let e=Object.assign(Object.assign({},h9),n),t=new Ep(e,!0),r=new Ep(e,!1),i=ar.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Vs)!=s.state.facet(Vs)||s.startState.field(ka,!1)!=s.state.field(ka,!1)||Yr(s.startState)!=Yr(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new Ro;for(let l of s.viewportLineBlocks){let c=Sd(s.state,l.from,l.to)?r:kd(s.state,l.from,l.to)?t:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,OS({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||wn.empty},initialSpacer(){return new Ep(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=Sd(s.state,a.from,a.to);if(c)return s.dispatch({effects:ku.of(c)}),!0;let u=kd(s.state,a.from,a.to);return u?(s.dispatch({effects:Th.of(u)}),!0):!1}})}),WS()]}const m9=Ze.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"}});class Su{constructor(e,t){this.specs=e;let r;function i(a){let l=Bs.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof no?a=>a.prop(rl)==s.data:s?a=>a==s:void 0,this.style=DS(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Bs(r):null,this.themeType=t.themeType}static define(e,t){return new Su(e,t||{})}}const ig=ot.define(),KS=ot.define({combine(n){return n.length?[n[0]]:null}});function Ap(n){let e=n.facet(ig);return e.length?e:n.facet(KS)}function GS(n,e){let t=[v9],r;return n instanceof Su&&(n.module&&t.push(Ze.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(KS.of(n)):r?t.push(ig.computeN([Ze.darkTheme],i=>i.facet(Ze.darkTheme)==(r=="dark")?[n]:[])):t.push(ig.of(n)),t}class g9{constructor(e){this.markCache=Object.create(null),this.tree=Yr(e.state),this.decorations=this.buildDeco(e,Ap(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Yr(e.state),r=Ap(e.state),i=r!=Ap(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return Ct.none;let r=new Ro;for(let{from:i,to:o}of e.visibleRanges)DR(this.tree,t,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=Ct.mark({class:l})))},i,o);return r.finish()}}const v9=Ba.high(ar.fromClass(g9,{decorations:n=>n.decorations})),y9=Su.define([{tag:Ve.meta,color:"#404740"},{tag:Ve.link,textDecoration:"underline"},{tag:Ve.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ve.emphasis,fontStyle:"italic"},{tag:Ve.strong,fontWeight:"bold"},{tag:Ve.strikethrough,textDecoration:"line-through"},{tag:Ve.keyword,color:"#708"},{tag:[Ve.atom,Ve.bool,Ve.url,Ve.contentSeparator,Ve.labelName],color:"#219"},{tag:[Ve.literal,Ve.inserted],color:"#164"},{tag:[Ve.string,Ve.deleted],color:"#a11"},{tag:[Ve.regexp,Ve.escape,Ve.special(Ve.string)],color:"#e40"},{tag:Ve.definition(Ve.variableName),color:"#00f"},{tag:Ve.local(Ve.variableName),color:"#30a"},{tag:[Ve.typeName,Ve.namespace],color:"#085"},{tag:Ve.className,color:"#167"},{tag:[Ve.special(Ve.variableName),Ve.macroName],color:"#256"},{tag:Ve.definition(Ve.propertyName),color:"#00c"},{tag:Ve.comment,color:"#940"},{tag:Ve.invalid,color:"#f00"}]),b9=Ze.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),QS=1e4,YS="()[]{}",XS=ot.define({combine(n){return Wi(n,{afterCursor:!0,brackets:YS,maxScanDistance:QS,renderMatch:x9})}}),w9=Ct.mark({class:"cm-matchingBracket"}),j9=Ct.mark({class:"cm-nonmatchingBracket"});function x9(n){let e=[],t=n.matched?w9:j9;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const $9=kr.define({create(){return Ct.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(XS);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Co(e.state,i.head,-1,r)||i.head>0&&Co(e.state,i.head-1,1,r)||r.afterCursor&&(Co(e.state,i.head,1,r)||i.headZe.decorations.from(n)}),k9=[$9,b9];function S9(n={}){return[XS.of(n),k9]}const C9=new mn;function og(n,e,t){let r=n.prop(e<0?mn.openedBy:mn.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function sg(n){let e=n.type.prop(C9);return e?e(n.node):n}function Co(n,e,t,r={}){let i=r.maxScanDistance||QS,o=r.brackets||YS,s=Yr(n),a=s.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=og(l.type,t,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return O9(n,e,t,l,u,c,o)}}return M9(n,e,t,s,a.type,i,o)}function O9(n,e,t,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(t<0?u.childBefore(r.from):u.childAfter(r.to)))do if(t<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;t<0&&(d+=h.length);let p=e+d*t;for(let m=t>0?0:h.length-1,v=t>0?h.length:-1;m!=v;m+=t){let g=s.indexOf(h[m]);if(!(g<0||r.resolveInner(p+m,1).type!=i))if(g%2==0==t>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:g>>1==l>>1};f--}}t>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const E9=Object.create(null),cb=[pi.none],ub=[],fb=Object.create(null),A9=Object.create(null);for(let[n,e]of[["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"]])A9[n]=T9(E9,e);function Tp(n,e){ub.indexOf(n)>-1||(ub.push(n),console.warn(e))}function T9(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||Ve[c];u?typeof u=="function"?l.length?l=l.map(u):Tp(c,`Modifier ${c} used at start of tag`):l.length?Tp(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Tp(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),o=fb[i];if(o)return o.id;let s=fb[i]=pi.define({id:cb.length,name:r,props:[NS({[r]:t})]});return cb.push(s),s.id}Kn.RTL,Kn.LTR;const P9=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=Rv(n.state,t.from);return r.line?_9(n):r.block?N9(n):!1};function _v(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const _9=_v(L9,0),R9=_v(ZS,0),N9=_v((n,e)=>ZS(n,e,D9(e)),0);function Rv(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const uc=50;function I9(n,{open:e,close:t},r,i){let o=n.sliceDoc(r-uc,r),s=n.sliceDoc(i,i+uc),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*uc?u=f=n.sliceDoc(r,i):(u=n.sliceDoc(r,r+uc),f=n.sliceDoc(i-uc,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-t.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function D9(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function ZS(n,e,t=e.selection.ranges){let r=t.map(o=>Rv(e,o.from).block);if(!r.every(o=>o))return null;let i=t.map((o,s)=>I9(e,r[s],o.from,o.to));if(n!=2&&!i.every(o=>o))return{changes:e.changes(t.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(n!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(n!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const ag=hs.define(),B9=hs.define(),z9=ot.define(),e3=ot.define({combine(n){return Wi(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),Nv=kr.define({create(){return Oo.empty},update(n,e){let t=e.state.facet(e3),r=e.annotation(ag);if(r){let l=di.fromTransaction(e,r.selection),c=r.side,u=c==0?n.undone:n.done;return l?u=Od(u,u.length,t.minDepth,l):u=r3(u,e.startState.selection),new Oo(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(B9);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation($r.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let o=di.fromTransaction(e),s=e.annotation($r.time),a=e.annotation($r.userEvent);return o?n=n.addChanges(o,s,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,s,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Oo(n.done.map(di.fromJSON),n.undone.map(di.fromJSON))}});function F9(n={}){return[Nv,e3.of(n),Ze.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?Iv:e.inputType=="historyRedo"?Cd:null;return r?(e.preventDefault(),r(t)):!1}})]}function Ph(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(Nv,!1);if(!i)return!1;let o=i.pop(n,t,e);return o?(r(o),!0):!1}}const Iv=Ph(0,!1),Cd=Ph(1,!1),q9=Ph(0,!0),V9=Ph(1,!0);function t3(n){return function(e){let t=e.field(Nv,!1);if(!t)return 0;let r=n==0?t.done:t.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const H9=t3(0),U9=t3(1);class di{constructor(e,t,r,i,o){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new di(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new di(e.changes&&xr.fromJSON(e.changes),[],e.mapped&&Po.fromJSON(e.mapped),e.startSelection&&_e.fromJSON(e.startSelection),e.selectionsAfter.map(_e.fromJSON))}static fromTransaction(e,t){let r=Ni;for(let i of e.startState.facet(z9)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new di(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Ni)}static selection(e){return new di(void 0,Ni,void 0,void 0,e)}}function Od(n,e,t,r){let i=e+1>t+20?e-t-1:0,o=n.slice(i,e);return o.push(r),o}function W9(n,e){let t=[],r=!1;return n.iterChangedRanges((i,o)=>t.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function J9(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function n3(n,e){return n.length?e.length?n.concat(e):n:e}const Ni=[],K9=200;function r3(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-K9));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),Od(n,n.length-1,1e9,t.setSelAfter(r)))}else return[di.selection([e])]}function G9(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Pp(n,e){if(!n.length)return n;let t=n.length,r=Ni;for(;t;){let i=Q9(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=n.slice(0,t);return o[t-1]=i,o}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[di.selection(r)]:Ni}function Q9(n,e,t){let r=n3(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Ni,t);if(!n.changes)return di.selection(r);let i=n.changes.map(e),o=e.mapDesc(n.changes,!0),s=n.mapped?n.mapped.composeDesc(o):o;return new di(i,cn.mapEffects(n.effects,e),s,n.startSelection.map(o),r)}const Y9=/^(input\.type|delete)($|\.)/;class Oo{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Oo(this.done,this.undone):this}addChanges(e,t,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||Y9.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):_h(t,e))}function Zr(n){return n.textDirectionAt(n.state.selection.main.head)==Kn.LTR}const o3=n=>i3(n,!Zr(n)),s3=n=>i3(n,Zr(n));function a3(n,e){return ho(n,t=>t.empty?n.moveByGroup(t,e):_h(t,e))}const Z9=n=>a3(n,!Zr(n)),eN=n=>a3(n,Zr(n));function tN(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Rh(n,e,t){let r=Yr(n).resolveInner(e.head),i=t?mn.closedBy:mn.openedBy;for(let l=e.head;;){let c=t?r.childAfter(l):r.childBefore(l);if(!c)break;tN(n,c,i)?r=c:l=t?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=t?Co(n,r.from,1):Co(n,r.to,-1))&&s.matched?a=t?s.end.to:s.end.from:a=t?r.to:r.from,_e.cursor(a,t?-1:1)}const nN=n=>ho(n,e=>Rh(n.state,e,!Zr(n))),rN=n=>ho(n,e=>Rh(n.state,e,Zr(n)));function l3(n,e){return ho(n,t=>{if(!t.empty)return _h(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const c3=n=>l3(n,!1),u3=n=>l3(n,!0);function f3(n){let e=n.scrollDOM.clientHeights.empty?n.moveVertically(s,e,t.height):_h(s,e));if(i.eq(r.selection))return!1;let o;if(t.selfScroll){let s=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;s&&s.top>l&&s.bottomd3(n,!1),lg=n=>d3(n,!0);function Ks(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let o=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=_e.cursor(r.from+o))}return i}const iN=n=>ho(n,e=>Ks(n,e,!0)),oN=n=>ho(n,e=>Ks(n,e,!1)),sN=n=>ho(n,e=>Ks(n,e,!Zr(n))),aN=n=>ho(n,e=>Ks(n,e,Zr(n))),lN=n=>ho(n,e=>_e.cursor(n.lineBlockAt(e.head).from,1)),cN=n=>ho(n,e=>_e.cursor(n.lineBlockAt(e.head).to,-1));function uN(n,e,t){let r=!1,i=Ul(n.selection,o=>{let s=Co(n,o.head,-1)||Co(n,o.head,1)||o.head>0&&Co(n,o.head-1,1)||o.headuN(n,e,!1);function Ji(n,e){let t=Ul(n.state.selection,r=>{let i=e(r);return _e.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Fo(n.state,t)),!0)}function h3(n,e){return Ji(n,t=>n.moveByChar(t,e))}const p3=n=>h3(n,!Zr(n)),m3=n=>h3(n,Zr(n));function g3(n,e){return Ji(n,t=>n.moveByGroup(t,e))}const dN=n=>g3(n,!Zr(n)),hN=n=>g3(n,Zr(n)),pN=n=>Ji(n,e=>Rh(n.state,e,!Zr(n))),mN=n=>Ji(n,e=>Rh(n.state,e,Zr(n)));function v3(n,e){return Ji(n,t=>n.moveVertically(t,e))}const y3=n=>v3(n,!1),b3=n=>v3(n,!0);function w3(n,e){return Ji(n,t=>n.moveVertically(t,e,f3(n).height))}const hb=n=>w3(n,!1),pb=n=>w3(n,!0),gN=n=>Ji(n,e=>Ks(n,e,!0)),vN=n=>Ji(n,e=>Ks(n,e,!1)),yN=n=>Ji(n,e=>Ks(n,e,!Zr(n))),bN=n=>Ji(n,e=>Ks(n,e,Zr(n))),wN=n=>Ji(n,e=>_e.cursor(n.lineBlockAt(e.head).from)),jN=n=>Ji(n,e=>_e.cursor(n.lineBlockAt(e.head).to)),mb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:0})),!0),gb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:n.doc.length})),!0),vb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:n.selection.main.anchor,head:0})),!0),yb=({state:n,dispatch:e})=>(e(Fo(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),xN=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),$N=({state:n,dispatch:e})=>{let t=Nh(n).map(({from:r,to:i})=>_e.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:_e.create(t),userEvent:"select"})),!0},kN=({state:n,dispatch:e})=>{let t=Ul(n.selection,r=>{var i;let o=Yr(n).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&((i=a.parent)===null||i===void 0?void 0:i.parent))return _e.range(a.to,a.from)}return r});return e(Fo(n,t)),!0},SN=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=_e.create([t.main]):t.main.empty||(r=_e.create([_e.cursor(t.main.head)])),r?(e(Fo(n,r)),!0):!1};function Cu(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(t="delete.forward",l=vf(n,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=vf(n,s,!1),a=vf(n,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:_e.cursor(s,si(n)))r.between(e,e,(i,o)=>{ie&&(e=t?o:i)});return e}const j3=(n,e)=>Cu(n,t=>{let r=t.from,{state:i}=n,o=i.doc.lineAt(r),s,a;if(!e&&r>o.from&&rj3(n,!1),x3=n=>j3(n,!0),$3=(n,e)=>Cu(n,t=>{let r=t.head,{state:i}=n,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==t.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=Br(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=t.head)&&(a=u),r=l}return r}),k3=n=>$3(n,!1),CN=n=>$3(n,!0),ON=n=>Cu(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headCu(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),EN=n=>Cu(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Pn.of(["",""])},range:_e.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},TN=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,o=n.doc.lineAt(i),s=i==o.from?i-1:Br(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:Br(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(s,i))},range:_e.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nh(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),o=n.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=n.doc.lineAt(r.to-1)),t>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});t=o.number+1}return e}function S3(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let o of Nh(n)){if(t?o.to==n.doc.length:o.from==0)continue;let s=n.doc.lineAt(t?o.to+1:o.from-1),a=s.length+1;if(t){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+n.lineBreak});for(let l of o.ranges)i.push(_e.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:n.lineBreak+s.text});for(let l of o.ranges)i.push(_e.range(l.anchor-a,l.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:_e.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const PN=({state:n,dispatch:e})=>S3(n,e,!1),_N=({state:n,dispatch:e})=>S3(n,e,!0);function C3(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of Nh(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const RN=({state:n,dispatch:e})=>C3(n,e,!1),NN=({state:n,dispatch:e})=>C3(n,e,!0),IN=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Nh(e).map(({from:i,to:o})=>(i>0?i--:on.moveVertically(i,!0)).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function DN(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Yr(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(mn.closedBy))&&o.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const LN=O3(!1),BN=O3(!0);function O3(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!n&&o==s&&DN(e,o);n&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new Ah(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=Av(c,o);for(u==null&&(u=Hl(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=n.doc.lineAt(s);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),s=a.to+1}let o=n.changes(i);return{changes:i,range:_e.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const zN=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new Ah(n,{overrideIndentation:o=>{let s=t[o];return s==null?-1:s}}),i=Dv(n,(o,s,a)=>{let l=Av(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=nu(n,l);(c!=u||a.fromn.readOnly?!1:(e(n.update(Dv(n,(t,r)=>{r.push({from:t.from,insert:n.facet(Eh)})}),{userEvent:"input.indent"})),!0),E3=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Dv(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let o=Hl(i,n.tabSize),s=0,a=nu(n,Math.max(0,o-Hs(n)));for(;s({mac:n.key,run:n.run,shift:n.shift}))),VN=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nN,shift:pN},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:rN,shift:mN},{key:"Alt-ArrowUp",run:PN},{key:"Shift-Alt-ArrowUp",run:RN},{key:"Alt-ArrowDown",run:_N},{key:"Shift-Alt-ArrowDown",run:NN},{key:"Escape",run:SN},{key:"Mod-Enter",run:BN},{key:"Alt-l",mac:"Ctrl-l",run:$N},{key:"Mod-i",run:kN,preventDefault:!0},{key:"Mod-[",run:E3},{key:"Mod-]",run:M3},{key:"Mod-Alt-\\",run:zN},{key:"Shift-Mod-k",run:IN},{key:"Shift-Mod-\\",run:fN},{key:"Mod-/",run:P9},{key:"Alt-A",run:R9}].concat(qN),HN={key:"Tab",run:M3,shift:E3};function qn(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;ea.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?Ct.widget({widget:new eI(a),diagnostic:a}).range(a.from):Ct.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a,inclusive:!0}).range(a.from,a.to)),!0);return new ia(s,t,Al(s))}}function Al(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new UN(i,o,s.diagnostic),!1}),r}function T3(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(r=>r.is(Ih))||n.changes.touchesRange(t.from,t.to))}function P3(n,e){return n.field($i,!1)?e:e.concat(cn.appendConfig.of(B3))}function WN(n,e){return{effects:P3(n,[Ih.of(e)])}}const Ih=cn.define(),Lv=cn.define(),_3=cn.define(),$i=kr.define({create(){return new ia(Ct.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),r=null;if(n.selected){let i=e.changes.mapPos(n.selected.from,1);r=Al(t,n.selected.diagnostic,i)||Al(t,null,i)}n=new ia(t,n.panel,r)}for(let t of e.effects)t.is(Ih)?n=ia.init(t.value,n.panel,e.state):t.is(Lv)?n=new ia(n.diagnostics,t.value?Dh.open:null,n.selected):t.is(_3)&&(n=new ia(n.diagnostics,n.panel,t.value));return n},provide:n=>[eu.from(n,e=>e.panel),Ze.decorations.from(n,e=>e.diagnostics)]}),JN=Ct.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function KN(n,e,t){let{diagnostics:r}=n.state.field($i),i=[],o=2e8,s=0;r.between(e-(t<0?1:0),e+(t>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||t>0)&&(eI3(n,t,!1)))}const GN=n=>{let e=n.state.field($i,!1);(!e||!e.panel)&&n.dispatch({effects:P3(n.state,[Lv.of(!0)])});let t=Zc(n,Dh.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},bb=n=>{let e=n.state.field($i,!1);return!e||!e.panel?!1:(n.dispatch({effects:Lv.of(!1)}),!0)},QN=n=>{let e=n.state.field($i,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},YN=[{key:"Mod-Shift-m",run:GN,preventDefault:!0},{key:"F8",run:QN}],XN=ar.fromClass(class{constructor(n){this.view=n,this.timeout=-1,this.set=!0;let{delay:e}=n.state.facet(ua);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let n=Date.now();if(nPromise.resolve(r(this.view)))).then(r=>{let i=r.reduce((o,s)=>o.concat(s));this.view.state.doc==e.doc&&this.view.dispatch(WN(this.view.state,i))},r=>{si(this.view.state,r)})}}update(n){let e=n.state.facet(ua);(n.docChanged||e!=n.startState.facet(ua)||e.needsRefresh&&e.needsRefresh(n))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),ua=ot.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},Wi(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function ZN(n,e={}){return[ua.of({source:n,config:e}),XN,B3]}function N3(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function I3(n,e,t){var r;let i=t?N3(e.actions):[];return qn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},qn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=Al(n.state.field($i).diagnostics,e);h&&o.apply(n,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),qn("u",c.slice(u,u+1)),c.slice(u+1)];return qn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&qn("div",{class:"cm-diagnosticSource"},e.source))}class eI extends Js{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return qn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class wb{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=I3(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Dh{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)bb(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=N3(o.actions);for(let a=0;a{for(let o=0;obb(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field($i).selected;if(!e)return-1;for(let t=0;t{let c=-1,u;for(let f=r;fr&&(this.items.splice(r,c-r),i=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.topa.bottom&&(this.list.scrollTop+=(s.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field($i),r=Al(t.diagnostics,this.items[e].diagnostic);!r||this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:_3.of(r)})}static open(e){return new Dh(e)}}function Xf(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function yf(n){return Xf(``,'width="6" height="3"')}const tI=Ze.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-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:yf("#d11")},".cm-lintRange-warning":{backgroundImage:yf("orange")},".cm-lintRange-info":{backgroundImage:yf("#999")},".cm-lintRange-hint":{backgroundImage:yf("#66d")},".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-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function jb(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}class nI extends No{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,r)=>jb(t)iI(e,t,r)),t}}function rI(n,e){let t=r=>{let i=e.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,rI(n,e)}let{hoverTime:i}=n.state.facet(Lh),o=setTimeout(r,i);e.onmouseout=()=>{clearTimeout(o),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}}function oI(n,e){let t=Object.create(null);for(let i of e){let o=n.lineAt(i.from);(t[o.from]||(t[o.from]=[])).push(i)}let r=[];for(let i in t)r.push(new nI(t[i]).range(+i));return wn.of(r,!0)}const sI=OS({class:"cm-gutter-lint",markers:n=>n.state.field(D3)}),D3=kr.define({create(){return wn.empty},update(n,e){n=n.map(e.changes);let t=e.state.facet(Lh).markerFilter;for(let r of e.effects)if(r.is(Ih)){let i=r.value;t&&(i=t(i||[],e.state)),n=oI(e.state.doc,i.slice(0))}return n}}),Bv=cn.define(),L3=kr.define({create(){return null},update(n,e){return n&&e.docChanged&&(n=T3(e,n)?null:Object.assign(Object.assign({},n),{pos:e.changes.mapPos(n.pos)})),e.effects.reduce((t,r)=>r.is(Bv)?r.value:t,n)},provide:n=>Oh.from(n)}),aI=Ze.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Xf('')},".cm-lint-marker-warning":{content:Xf('')},".cm-lint-marker-error":{content:Xf('')}}),B3=[$i,Ze.decorations.compute([$i],n=>{let{selected:e,panel:t}=n.field($i);return!e||!t||e.from==e.to?Ct.none:Ct.set([JN.range(e.from,e.to)])}),hR(KN,{hideOn:T3}),tI],Lh=ot.define({combine(n){return Wi(n,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function lI(n={}){return[Lh.of(n),D3,sI,aI,L3]}class Md{constructor(e,t,r,i,o,s,a,l,c,u=0,f){this.p=e,this.stack=t,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let i=e.parser.context;return new Md(e,[],t,r,r,0,[],0,i?new xb(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,i=e&65535,{parser:o}=this.p,s=o.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(t==r)return;if(s.buffer[a-2]>=t){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,t,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>r;)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,i>4&&(i-=4);this.buffer[s]=e,this.buffer[s+1]=t,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,t,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(t,r),t<=s.maxNode&&this.buffer.push(t,r,i,4)}else this.pos=i,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,i,4)}apply(e,t,r,i){e&65536?this.reduce(e):this.shift(e,t,r,i)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Md(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new cI(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>4<<1||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(t[o],s)}t=i}let r=[];for(let i=0;i>19,i=t&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;t=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(i,o)=>{if(!t.includes(i))return t.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class xb{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class cI{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class Ed{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Ed(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Ed(this.stack,this.pos,this.index)}}function bf(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}t?t[i++]=o:t=new e(o)}return t}class Zf{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const $b=new Zf;class uI{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=$b,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,i;if(t>=0&&t=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=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()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=$b,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);let r="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return r}}class ml{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;fI(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}ml.prototype.contextual=ml.prototype.fallback=ml.prototype.extend=!1;ml.prototype.fallback=ml.prototype.extend=!1;function fI(n,e,t,r,i,o){let s=0,a=1<0){let p=n[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||dI(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=n[s+2];if(e.next<0&&d>f&&n[c+d*3-3]==65535){s=n[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),m=n[p],v=n[p+1]||65536;if(u=v)f=h+1;else{s=n[p+2],e.advance();continue e}}break}}function kb(n,e,t){for(let r=e,i;(i=n[r])!=65535;r++)if(i==t)return r-e;return-1}function dI(n,e,t,r){let i=kb(t,r,e);return i<0||kb(t,r,n)e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class hI{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Sb(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Sb(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}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof vr){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+o.length}}}class pI{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Zf)}getActions(e){let t=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!u.extend&&(r=f,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Zf,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Zf,{pos:r,p:i}=e;return t.start=r,t.end=Math.min(r+1,i.stream.end),t.value=r==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,r){let i=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,r,i){for(let o=0;oe.bufferLength*4?new hI(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;st)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&vI(i);if(s)return bi&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw bi&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return bi&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(mn.contextHash)||0)==u))return e.useNode(f,d),bi&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof vr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof vr&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),bi&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?t.push(p):r.push(p)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Cb(e,t),!0}}runRecovery(e,t,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),bi&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(bi&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)bi&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))bi&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),bi&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Cb(a,r)):(!i||i.scoree.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new Cv(t.map((a,l)=>pi.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=AS;let s=bf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new ml(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let i=new mI(this,e,t,r);for(let o of this.wrappers)i=o(i,e,t,r);return i}getGoto(e,t,r=!1){let i=this.goto;if(t>=i[0])return-1;for(let o=i[t+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),i=r?t(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Ho(this.data,o+2);else break;i=t(Ho(this.data,o+1))}return i}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ho(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];t.some((o,s)=>s&1&&o==i)||t.push(this.data[r],i)}}return t}configure(e){let t=Object.assign(Object.create(Ad.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return t.specializers[i]=Ob(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let o of e.split(" ")){let s=t.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,r)<<1|e}return n.get}const yI=NS({String:Ve.string,Number:Ve.number,"True False":Ve.bool,PropertyName:Ve.propertyName,Null:Ve.null,",":Ve.separator,"[ ]":Ve.squareBracket,"{ }":Ve.brace}),bI=Ad.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[yI],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),wI=xd.define({name:"json",parser:bI.configure({props:[BS.add({Object:ab({except:/^\s*\}/}),Array:ab({except:/^\s*\]/})}),FS.add({"Object Array":n9})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function jI(){return new HR(wI)}const Mb=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Tl{constructor(e,t,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(Mb(a)):Mb,this.query=this.normalize(t)}peek(){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 Rr(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=pv(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Pi(e);let i=this.normalize(t);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Td(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=t){let a=new gl(t,e.sliceString(t,r));return Rp.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:o,from:s}=i;return s>t&&(o=e.sliceString(t,s)+o,s=t),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let 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){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Td(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=gl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol!="undefined"&&(F3.prototype[Symbol.iterator]=q3.prototype[Symbol.iterator]=function(){return this});function xI(n){try{return new RegExp(n,zv),!0}catch{return!1}}function Td(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function ug(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=qn("input",{class:"cm-textfield",name:"line",value:e}),r=qn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),n.dispatch({effects:Pd.of(!1)}),n.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},qn("label",n.state.phrase("Go to line"),": ",t)," ",qn("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!o)return;let{state:s}=n,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let v=h/100;l&&(v=v*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*v)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),m=_e.cursor(p.from+Math.max(0,Math.min(d,p.length)));n.dispatch({effects:[Pd.of(!1),Ze.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:r}}const Pd=cn.define(),Eb=kr.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Pd)&&(n=t.value);return n},provide:n=>eu.from(n,e=>e?ug:null)}),$I=n=>{let e=Zc(n,ug);if(!e){let t=[Pd.of(!0)];n.state.field(Eb,!1)==null&&t.push(cn.appendConfig.of([Eb,kI])),n.dispatch({effects:t}),e=Zc(n,ug)}return e&&e.dom.querySelector("input").select(),!0},kI=Ze.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),SI={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},V3=ot.define({combine(n){return Wi(n,SI,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function CI(n){let e=[TI,AI];return n&&e.push(V3.of(n)),e}const OI=Ct.mark({class:"cm-selectionMatch"}),MI=Ct.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ab(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=rr.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=rr.Word)}function EI(n,e,t,r){return n(e.sliceDoc(t,t+1))==rr.Word&&n(e.sliceDoc(r-1,r))==rr.Word}const AI=ar.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(V3),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Ct.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ct.none;let l=t.wordAt(i.head);if(!l)return Ct.none;s=t.charCategorizer(i.head),o=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return Ct.none;if(e.wholeWords){if(o=t.sliceDoc(i.from,i.to),s=t.charCategorizer(i.head),!(Ab(s,t,i.from,i.to)&&EI(s,t,i.from,i.to)))return Ct.none}else if(o=t.sliceDoc(i.from,i.to),!o)return Ct.none}let a=[];for(let l of n.visibleRanges){let c=new Tl(t.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||Ab(s,t,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(MI.range(u,f)):(u>=i.to||f<=i.from)&&a.push(OI.range(u,f)),a.length>e.maxMatches))return Ct.none}}return Ct.set(a)}},{decorations:n=>n.decorations}),TI=Ze.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),PI=({state:n,dispatch:e})=>{let{selection:t}=n,r=_e.create(t.ranges.map(i=>n.wordAt(i.head)||_e.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function _I(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),o=i&&i.from==t.from&&i.to==t.to;for(let s=!1,a=new Tl(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new Tl(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const RI=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(o=>o.from===o.to))return PI({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(o=>n.sliceDoc(o.from,o.to)!=r))return!1;let i=_I(n,r);return i?(e(n.update({selection:n.selection.addRange(_e.range(i.from,i.to),!1),effects:Ze.scrollIntoView(i.to)})),!0):!1},za=ot.define({combine(n){return Wi(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new JI(e),scrollToMatch:e=>Ze.scrollIntoView(e)})}});function NI(n){return n?[za.of(n),dg]:dg}class H3{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||xI(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?` +`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new BI(this):new DI(this)}getCursor(e,t=0,r){let i=e.doc?e:vn.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Qa(this,i,t,r):Ga(this,i,t,r)}}class U3{constructor(e){this.spec=e}}function Ga(n,e,t,r){return new Tl(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?II(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function II(n,e){return(t,r,i,o)=>((o>t||o+i.length=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Ga(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Qa(n,e,t,r){return new F3(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?LI(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function _d(n,e){return n.slice(Br(n,e,!1),e)}function Rd(n,e){return n.slice(e,Br(n,e))}function LI(n){return(e,t,r)=>!r[0].length||(n(_d(r.input,r.index))!=rr.Word||n(Rd(r.input,r.index))!=rr.Word)&&(n(Rd(r.input,r.index+r[0].length))!=rr.Word||n(_d(r.input,r.index+r[0].length))!=rr.Word)}class BI extends U3{nextMatch(e,t,r){let i=Qa(this.spec,e,r,e.doc.length).next();return i.done&&(i=Qa(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let o=Math.max(t,r-i*1e4),s=Qa(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let o=Qa(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const ru=cn.define(),Fv=cn.define(),Ts=kr.define({create(n){return new Np(fg(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ru)?n=new Np(t.value.create(),n.panel):t.is(Fv)&&(n=new Np(n.query,t.value?qv:null));return n},provide:n=>eu.from(n,e=>e.panel)});class Np{constructor(e,t){this.query=e,this.panel=t}}const zI=Ct.mark({class:"cm-searchMatch"}),FI=Ct.mark({class:"cm-searchMatch cm-searchMatch-selected"}),qI=ar.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Ts))}update(n){let e=n.state.field(Ts);(e!=n.startState.field(Ts)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ct.none;let{view:t}=this,r=new Ro;for(let i=0,o=t.visibleRanges,s=o.length;io[i+1].from-2*250;)l=o[++i].to;n.highlight(t.state,a,l,(c,u)=>{let f=t.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?FI:zI)})}return r.finish()}},{decorations:n=>n.decorations});function Ou(n){return e=>{let t=e.state.field(Ts,!1);return t&&t.query.spec.valid?n(e,t):Vv(e)}}const Nd=Ou((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=_e.single(r.from,r.to),o=n.state.facet(za);return n.dispatch({selection:i,effects:[Uv(n,r),o.scrollToMatch(i.main,n)],userEvent:"select.search"}),J3(n),!0}),Id=Ou((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let o=_e.single(i.from,i.to),s=n.state.facet(za);return n.dispatch({selection:o,effects:[Uv(n,i),s.scrollToMatch(o.main,n)],userEvent:"select.search"}),J3(n),!0}),VI=Ou((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:_e.create(t.map(r=>_e.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),HI=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,o=[],s=0;for(let a=new Tl(n.doc,n.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(_e.range(a.value.from,a.value.to))}return e(n.update({selection:_e.create(o,s),userEvent:"select.search.matches"})),!0},Tb=Ou((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let o=e.nextMatch(t,r,r);if(!o)return!1;let s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=t.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(t,o.from,o.to),c.push(Ze.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=_e.single(o.from-u,o.to-u),c.push(Uv(n,o)),c.push(t.facet(za).scrollToMatch(a.main,n))}return n.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),UI=Ou((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Ze.announce.of(r),userEvent:"input.replace.all"}),!0});function qv(n){return n.state.facet(za).createPanel(n)}function fg(n,e){var t,r,i,o,s;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(za);return new H3({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function W3(n){let e=Zc(n,qv);return e&&e.dom.querySelector("[main-field]")}function J3(n){let e=W3(n);e&&e==n.root.activeElement&&e.select()}const Vv=n=>{let e=n.state.field(Ts,!1);if(e&&e.panel){let t=W3(n);if(t&&t!=n.root.activeElement){let r=fg(n.state,e.query.spec);r.valid&&n.dispatch({effects:ru.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[Fv.of(!0),e?ru.of(fg(n.state,e.query.spec)):cn.appendConfig.of(dg)]});return!0},Hv=n=>{let e=n.state.field(Ts,!1);if(!e||!e.panel)return!1;let t=Zc(n,qv);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Fv.of(!1)}),!0},WI=[{key:"Mod-f",run:Vv,scope:"editor search-panel"},{key:"F3",run:Nd,shift:Id,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Nd,shift:Id,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Hv,scope:"editor search-panel"},{key:"Mod-Shift-l",run:HI},{key:"Mod-Alt-g",run:$I},{key:"Mod-d",run:RI,preventDefault:!0}];class JI{constructor(e){this.view=e;let t=this.query=e.state.field(Ts).query.spec;this.commit=this.commit.bind(this),this.searchField=qn("input",{value:t.search,placeholder:wi(e,"Find"),"aria-label":wi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=qn("input",{value:t.replace,placeholder:wi(e,"Replace"),"aria-label":wi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=qn("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=qn("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=qn("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,o,s){return qn("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=qn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Nd(e),[wi(e,"next")]),r("prev",()=>Id(e),[wi(e,"previous")]),r("select",()=>VI(e),[wi(e,"all")]),qn("label",null,[this.caseField,wi(e,"match case")]),qn("label",null,[this.reField,wi(e,"regexp")]),qn("label",null,[this.wordField,wi(e,"by word")]),...e.state.readOnly?[]:[qn("br"),this.replaceField,r("replace",()=>Tb(e),[wi(e,"replace")]),r("replaceAll",()=>UI(e),[wi(e,"replace all")])],qn("button",{name:"close",onclick:()=>Hv(e),"aria-label":wi(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new H3({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:ru.of(e)}))}keydown(e){O_(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Id:Nd)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Tb(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(ru)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(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}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(za).top}}function wi(n,e){return n.state.phrase(e)}const wf=30,jf=/[\s\.,:;?!]/;function Uv(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,o=Math.max(r.from,e-wf),s=Math.min(i,t+wf),a=n.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-wf;l--)if(!jf.test(a[l-1])&&jf.test(a[l])){a=a.slice(0,l);break}}return Ze.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const KI=Ze.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"}}),dg=[Ts,Ba.low(qI),KI];class K3{constructor(e,t,r){this.state=e,this.pos=t,this.explicit=r,this.abortListeners=[]}tokenBefore(e){let t=Yr(this.state).resolveInner(this.pos,-1);for(;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}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),o=i.search(G3(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Pb(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function GI(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:GI(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:t}:null}}class _b{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function Ps(n){return n.selection.main.from}function G3(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?n:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const YI=hs.define();function XI(n,e,t,r){let{main:i}=n.selection,o=t-i.from,s=r-i.from;return Object.assign(Object.assign({},n.changeByRange(a=>a!=i&&t!=r&&n.sliceDoc(a.from+o,a.from+s)!=n.sliceDoc(t,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:_e.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Rb=new WeakMap;function ZI(n){if(!Array.isArray(n))return n;let e=Rb.get(n);return e||Rb.set(n,e=QI(n)),e}const Dd=cn.define(),iu=cn.define();class eD{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:($=pv(w))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!b||S==1&&v||j==0&&S!=0)&&(t[f]==w||r[f]==w&&(d=!0)?s[f++]=b:s.length&&(g=!1)),j=S,b+=Pi(w)}return f==l&&s[0]==0&&g?this.result(-100+(d?-200:0),s,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-200+-700-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(g?0:-1100),s,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],o=0;for(let s of t){let a=s+(this.astral?Pi(Rr(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class tD{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:nD,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>Nb(e(r),t(r)),optionClass:(e,t)=>r=>Nb(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Nb(n,e){return n?e?n+" "+e:n:e}function nD(n,e,t,r,i,o){let s=n.textDirection==Kn.RTL,a=s,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&d=m||b>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let v=(e.bottom-e.top)/o.offsetHeight,g=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/v}px; max-width: ${f/g}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function rD(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return lt.position-r.position).map(t=>t.render)}function Ip(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class iD{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:o,selected:s}=i.open,a=e.state.facet(Lr);this.optionContent=rD(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Ip(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Lr).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:iu.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=Ip(o.length,s,e.state.facet(Lr).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Ip(t.options.length,t.selected,this.view.state.facet(Lr).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>si(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&sD(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,t.bottom)-10||i.bottomr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=t+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew iD(t,n,e)}function sD(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.topt.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function Ib(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function aD(n,e){let t=[],r=null,i=c=>{t.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(Lr);for(let c of n)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new _b(f,c.source,u?u(f):[],1e9-t.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new tD(f):new eD(f);for(let p of c.result.options)if(d=h.match(p.label)){let m=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new _b(p,c.source,m,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,m;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((m=h.rank)!==null&&m!==void 0?m:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):Ib(c.completion)>Ib(a)&&(s[s.length-1]=c),a=c.completion}return s}class il{constructor(e,t,r,i,o,s){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new il(this.options,Db(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,o){let s=aD(e,t);if(!s.length)return i&&e.some(l=>l.state==1)?new il(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=t.facet(Lr).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:dD,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new il(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Ld{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Ld(uD,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Lr),o=(r.override||t.languageDataAt("autocomplete",Ps(t)).map(ZI)).map(a=>(this.active.find(c=>c.source==a)||new ni(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!lD(o,this.active)?s=il.build(o,t,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new ni(a.source,0):a));for(let a of e.effects)a.is(Y3)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new Ld(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:cD}}function lD(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const uD=[];function hg(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ni{constructor(e,t,r=-1){this.source=e,this.state=t,this.explicitPos=r}hasResult(){return!1}update(e,t){let r=hg(e),i=this;r?i=i.handleUserEvent(e,r,t):e.docChanged?i=i.handleChange(e):e.selection&&i.state!=0&&(i=new ni(i.source,0));for(let o of e.effects)if(o.is(Dd))i=new ni(i.source,1,o.value?Ps(e.state):-1);else if(o.is(iu))i=new ni(i.source,0);else if(o.is(Q3))for(let s of o.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,t,r){return t=="delete"||!r.activateOnTyping?this.map(e.changes):new ni(this.source,1)}handleChange(e){return e.changes.touchesRange(Ps(e.startState))?new ni(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ni(this.source,this.state,e.mapPos(this.explicitPos))}}class vl extends ni{constructor(e,t,r,i,o){super(e,2,t),this.result=r,this.from=i,this.to=o}hasResult(){return!0}handleUserEvent(e,t,r){var i;let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let s=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),l=Ps(e.state);if((this.explicitPos<0?l<=s:la||!o||t=="delete"&&Ps(e.startState)==this.from)return new ni(this.source,t=="input"&&r.activateOnTyping?1:0);let c=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return fD(o.validFor,e.state,s,a)?new vl(this.source,c,o,s,a):o.update&&(o=o.update(o,s,a,new K3(e.state,l,c>=0)))?new vl(this.source,c,o,o.from,(i=o.to)!==null&&i!==void 0?i:Ps(e.state)):new ni(this.source,1,c)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ni(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new vl(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ni(this.source,0)}}function fD(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):G3(n,!0).test(i)}const Q3=cn.define({map(n,e){return n.map(t=>t.map(e))}}),Y3=cn.define(),ui=kr.define({create(){return Ld.start()},update(n,e){return n.update(e)},provide:n=>[Oh.from(n,e=>e.tooltip),Ze.contentAttributes.from(n,e=>e.attrs)]});function Wv(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(ui).active.find(i=>i.source==e.source);return r instanceof vl?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},XI(n.state,t,r.from,r.to)),{annotations:YI.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const dD=oD(ui,Wv);function xf(n,e="option"){return t=>{let r=t.state.field(ui,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(n?1:-1):n?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),t.dispatch({effects:Y3.of(a)}),!0}}const hD=n=>{let e=n.state.field(ui,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(ui,!1)?(n.dispatch({effects:Dd.of(!0)}),!0):!1,mD=n=>{let e=n.state.field(ui,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:iu.of(null)}),!0)};class gD{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const vD=50,yD=1e3,bD=ar.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(ui).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(ui);if(!n.selectionSet&&!n.docChanged&&n.startState.field(ui)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!hg(i));for(let i=0;ivD&&Date.now()-o.time>yD){for(let s of o.context.abortListeners)try{s()}catch(a){si(this.view.state,a)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(i=>i.effects.some(o=>o.is(Dd)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.state.facet(Lr).activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let i of n.transactions)hg(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(ui);for(let t of e.active)t.state==1&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=Ps(e),r=new K3(e,t,n.explicitPos==t),i=new gD(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:iu.of(null)}),si(this.view.state,o)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Lr).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Lr);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new ni(i.active.source,0);for(let a of i.updates)s=s.update(a,t);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:Q3.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(ui,!1);if(e&&e.tooltip&&this.view.state.facet(Lr).closeOnBlur){let t=e.open&&SS(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:iu.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Dd.of(!1)}),20),this.composing=0}}}),wD=typeof navigator=="object"&&/Win/.test(navigator.platform),jD=Ba.highest(Ze.domEventHandlers({keydown(n,e){let t=e.state.field(ui,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(wD&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(n.key)>-1&&Wv(e,r),!1}})),xD=Ze.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",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",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),ou={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},fa=cn.define({map(n,e){let t=e.mapPos(n,-1,ri.TrackAfter);return t==null?void 0:t}}),Jv=new class extends ba{};Jv.startSide=1;Jv.endSide=-1;const X3=kr.define({create(){return wn.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(fa)&&(n=n.update({add:[Jv.range(t.value,t.value+1)]}));return n}});function $D(){return[SD,X3]}const Dp="()[]{}<>";function Z3(n){for(let e=0;e{if((kD?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&Pi(Rr(r,0))==1||e!=i.from||t!=i.to)return!1;let o=MD(n.state,r);return o?(n.dispatch(o),!0):!1}),CD=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=eC(n,n.selection.main.head).brackets||ou.brackets,i=null,o=n.changeByRange(s=>{if(s.empty){let a=ED(n.doc,s.head);for(let l of r)if(l==a&&Bh(n.doc,s.head)==Z3(Rr(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:_e.cursor(s.head-l.length)}}return{range:i=s}});return i||e(n.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},OD=[{key:"Backspace",run:CD}];function MD(n,e){let t=eC(n,n.selection.main.head),r=t.brackets||ou.brackets;for(let i of r){let o=Z3(Rr(i,0));if(e==i)return o==i?PD(n,i,r.indexOf(i+i+i)>-1,t):AD(n,i,o,t.before||ou.before);if(e==o&&tC(n,n.selection.main.from))return TD(n,i,o)}return null}function tC(n,e){let t=!1;return n.field(X3).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function Bh(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Pi(Rr(t,0)))}function ED(n,e){let t=n.sliceString(e-2,e);return Pi(Rr(t,0))==t.length?t:t.slice(1)}function AD(n,e,t,r){let i=null,o=n.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:t,from:s.to}],effects:fa.of(s.to+e.length),range:_e.range(s.anchor+e.length,s.head+e.length)};let a=Bh(n.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:s.head},effects:fa.of(s.head+e.length),range:_e.cursor(s.head+e.length)}:{range:i=s}});return i?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function TD(n,e,t){let r=null,i=n.changeByRange(o=>o.empty&&Bh(n.doc,o.head)==t?{changes:{from:o.head,to:o.head+t.length,insert:t},range:_e.cursor(o.head+t.length)}:r={range:o});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function PD(n,e,t,r){let i=r.stringPrefixes||ou.stringPrefixes,o=null,s=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:fa.of(a.to+e.length),range:_e.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=Bh(n.doc,l),u;if(c==e){if(Lb(n,l))return{changes:{insert:e+e,from:l},effects:fa.of(l+e.length),range:_e.cursor(l+e.length)};if(tC(n,l)){let d=t&&n.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:_e.cursor(l+d.length)}}}else{if(t&&n.sliceDoc(l-2*e.length,l)==e+e&&(u=Bb(n,l-2*e.length,i))>-1&&Lb(n,u))return{changes:{insert:e+e+e+e,from:l},effects:fa.of(l+e.length),range:_e.cursor(l+e.length)};if(n.charCategorizer(l)(c)!=rr.Word&&Bb(n,l,i)>-1&&!_D(n,l,e,i))return{changes:{insert:e+e,from:l},effects:fa.of(l+e.length),range:_e.cursor(l+e.length)}}return{range:o=a}});return o?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Lb(n,e){let t=Yr(n).resolveInner(e+1);return t.parent&&t.from==e}function _D(n,e,t,r){let i=Yr(n).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+o)),l=a.indexOf(t);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>t.length+l;){if(n.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Bb(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=rr.Word)return e;for(let i of t){let o=e-i.length;if(n.sliceDoc(o,e)==i&&r(n.sliceDoc(o-1,o))!=rr.Word)return o}return-1}function RD(n={}){return[jD,ui,Lr.of(n),bD,ND,xD]}const nC=[{key:"Ctrl-Space",run:pD},{key:"Escape",run:mD},{key:"ArrowDown",run:xf(!0)},{key:"ArrowUp",run:xf(!1)},{key:"PageDown",run:xf(!0,"page")},{key:"PageUp",run:xf(!1,"page")},{key:"Enter",run:hD}],ND=Ba.highest(vd.computeN([Lr],n=>n.facet(Lr).defaultKeymap?[nC]:[]));function ID(n,e=n.state){const t=new Set;for(const{from:r,to:i}of n.visibleRanges){let o=r;for(;o<=i;){const s=e.doc.lineAt(o);t.has(s)||t.add(s),o=s.to+1}}return t}function pg(n){const e=n.selection.main.head;return n.doc.lineAt(e)}function zb(n,e){let t=0;e:for(let r=0;r=o.level&&this.markerType!=="codeOnly"?this.set(e,0,i.level):i.empty&&i.level===0&&o.level!==0?this.set(e,0,0):o.level>i.level?this.set(e,0,i.level+1):this.set(e,0,o.level)}const t=zb(e.text,this.state.tabSize),r=Math.floor(t/this.unitWidth);return this.set(e,t,r)}closestNonEmpty(e,t){let r=e.number+t;for(;t===-1?r>=1:r<=this.state.doc.lines;){if(this.has(r)){const s=this.get(r);if(!s.empty)return s}const o=this.state.doc.line(r);if(o.text.trim().length){const s=zb(o.text,this.state.tabSize),a=Math.floor(s/this.unitWidth);return this.set(o,s,a)}r+=t}const i=this.state.doc.line(t===-1?1:this.state.doc.lines);return this.set(i,0,0)}findAndSetActiveLines(){const e=pg(this.state);if(!this.has(e))return;let t=this.get(e);if(this.has(t.line.number+1)){const o=this.get(t.line.number+1);o.level>t.level&&(t=o)}if(this.has(t.line.number-1)){const o=this.get(t.line.number-1);o.level>t.level&&(t=o)}if(t.level===0)return;t.active=t.level;let r,i;for(r=t.line.number;r>1;r--){if(!this.has(r-1))continue;const o=this.get(r-1);if(o.level0&&a.push($f("--indent-marker-bg-color",r,e,s,l)),a.push($f("--indent-marker-active-bg-color",r,e,o-1,1)),o!==i&&a.push($f("--indent-marker-bg-color",r,e,o,i-o))}else a.push($f("--indent-marker-bg-color",r,e,s,i-s));return a.join(",")}class zD{constructor(e){this.view=e,this.unitWidth=Hs(e.state),this.currentLineNumber=pg(e.state).number,this.generate(e.state)}update(e){const t=Hs(e.state),r=t!==this.unitWidth;r&&(this.unitWidth=t);const i=pg(e.state).number,o=i!==this.currentLineNumber;this.currentLineNumber=i;const s=e.state.facet(Bd).highlightActiveBlock&&o;(e.docChanged||e.viewportChanged||r||s)&&this.generate(e.state)}generate(e){const t=new Ro,r=ID(this.view,e),{hideFirstIndent:i,markerType:o,thickness:s}=e.facet(Bd),a=new DD(r,e,this.unitWidth,o);for(const l of r){const c=a.get(l.number);if(!(c!=null&&c.level))continue;const u=BD(c,this.unitWidth,i,s);t.add(l.from,l.from,Ct.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${u}`}}))}this.decorations=t.finish()}}function FD(n={}){return[Bd.of(n),LD(n.colors),ar.fromClass(zD,{decorations:e=>e.decorations})]}class qD{constructor(e){this.view=e,this.indentUnit=Hs(e.state),this.initialPaddingLeft=null,this.isChrome=window==null?void 0:window.navigator.userAgent.includes("Chrome"),this.generate(e.state)}update(e){const t=Hs(e.state);(t!==this.indentUnit||e.docChanged||e.viewportChanged)&&(this.indentUnit=t,this.generate(e.state))}generate(e){const t=new Ro;this.initialPaddingLeft?this.addStyleToBuilder(t,e,this.initialPaddingLeft):this.view.requestMeasure({read:r=>{const i=r.contentDOM.querySelector(".cm-line");i&&(this.initialPaddingLeft=window.getComputedStyle(i).getPropertyValue("padding-left"),this.addStyleToBuilder(t,r.state,this.initialPaddingLeft)),this.decorations=t.finish()}}),this.decorations=t.finish()}addStyleToBuilder(e,t,r){const i=this.getVisibleLines(t);for(const o of i){const{numColumns:s,containsTab:a}=this.numColumns(o.text,t.tabSize),l=`calc(${s+this.indentUnit}ch + ${r})`,c=this.isChrome?`calc(-${s+this.indentUnit}ch - ${a?1:0}px)`:`-${s+this.indentUnit}ch`;e.add(o.from,o.from,Ct.line({attributes:{style:`padding-left: ${l}; text-indent: ${c};`}}))}}getVisibleLines(e){const t=new Set;let r=null;for(const{from:i,to:o}of this.view.visibleRanges){let s=i;for(;s<=o;){const a=e.doc.lineAt(s);r!==a&&(t.add(a),r=a),s=a.to+1}}return t}numColumns(e,t){let r=0,i=!1;e:for(let o=0;on.decorations})];var Fb={exports:{}},rC={},io={},Pl={},Mu={},gn={},su={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.regexpCode=n.getEsmExportName=n.getProperty=n.safeStringify=n.stringify=n.strConcat=n.addCodeArg=n.str=n._=n.nil=n._Code=n.Name=n.IDENTIFIER=n._CodeOrName=void 0;class e{}n._CodeOrName=e,n.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class t extends e{constructor(b){if(super(),!n.IDENTIFIER.test(b))throw new Error("CodeGen: name must be a valid identifier");this.str=b}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}n.Name=t;class r extends e{constructor(b){super(),this._items=typeof b=="string"?[b]:b}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const b=this._items[0];return b===""||b==='""'}get str(){var b;return(b=this._str)!==null&&b!==void 0?b:this._str=this._items.reduce((y,j)=>`${y}${j}`,"")}get names(){var b;return(b=this._names)!==null&&b!==void 0?b:this._names=this._items.reduce((y,j)=>(j instanceof t&&(y[j.str]=(y[j.str]||0)+1),y),{})}}n._Code=r,n.nil=new r("");function i(g,...b){const y=[g[0]];let j=0;for(;j{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,e._)`${c}${f.scopePath}`})}scopeCode(c=this._values,u,f){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,f)}_reduceValues(c,u,f={},d){let h=e.nil;for(const p in c){const m=c[p];if(!m)continue;const v=f[p]=f[p]||new Map;m.forEach(g=>{if(v.has(g))return;v.set(g,r.Started);let b=u(g);if(b){const y=this.opts.es5?n.varKinds.var:n.varKinds.const;h=(0,e._)`${h}${y} ${g} = ${b};${this.opts._n}`}else if(b=d==null?void 0:d(g))h=(0,e._)`${h}${b}${this.opts._n}`;else throw new t(g);v.set(g,r.Completed)})}return h}}n.ValueScope=a})(mg);(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.or=n.and=n.not=n.CodeGen=n.operators=n.varKinds=n.ValueScopeName=n.ValueScope=n.Scope=n.Name=n.regexpCode=n.stringify=n.getProperty=n.nil=n.strConcat=n.str=n._=void 0;const e=su,t=mg;var r=su;Object.defineProperty(n,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(n,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(n,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(n,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(n,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(n,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(n,"Name",{enumerable:!0,get:function(){return r.Name}});var i=mg;Object.defineProperty(n,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(n,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(n,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(n,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),n.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class o{optimizeNodes(){return this}optimizeNames(k,P){return this}}class s extends o{constructor(k,P,H){super(),this.varKind=k,this.name=P,this.rhs=H}render({es5:k,_n:P}){const H=k?t.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${H} ${this.name}${J};`+P}optimizeNames(k,P){if(!!k[this.name.str])return this.rhs&&(this.rhs=q(this.rhs,k,P)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(k,P,H){super(),this.lhs=k,this.rhs=P,this.sideEffects=H}render({_n:k}){return`${this.lhs} = ${this.rhs};`+k}optimizeNames(k,P){if(!(this.lhs instanceof e.Name&&!k[this.lhs.str]&&!this.sideEffects))return this.rhs=q(this.rhs,k,P),this}get names(){const k=this.lhs instanceof e.Name?{}:Tr({},this.lhs.names);return U(k,this.rhs)}}class l extends a{constructor(k,P,H,J){super(k,H,J),this.op=P}render({_n:k}){return`${this.lhs} ${this.op}= ${this.rhs};`+k}}class c extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`${this.label}:`+k}}class u extends o{constructor(k){super(),this.label=k,this.names={}}render({_n:k}){return`break${this.label?` ${this.label}`:""};`+k}}class f extends o{constructor(k){super(),this.error=k}render({_n:k}){return`throw ${this.error};`+k}get names(){return this.error.names}}class d extends o{constructor(k){super(),this.code=k}render({_n:k}){return`${this.code};`+k}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(k,P){return this.code=q(this.code,k,P),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class h extends o{constructor(k=[]){super(),this.nodes=k}render(k){return this.nodes.reduce((P,H)=>P+H.render(k),"")}optimizeNodes(){const{nodes:k}=this;let P=k.length;for(;P--;){const H=k[P].optimizeNodes();Array.isArray(H)?k.splice(P,1,...H):H?k[P]=H:k.splice(P,1)}return k.length>0?this:void 0}optimizeNames(k,P){const{nodes:H}=this;let J=H.length;for(;J--;){const he=H[J];he.optimizeNames(k,P)||(X(k,he.names),H.splice(J,1))}return H.length>0?this:void 0}get names(){return this.nodes.reduce((k,P)=>D(k,P.names),{})}}class p extends h{render(k){return"{"+k._n+super.render(k)+"}"+k._n}}class m extends h{}class v extends p{}v.kind="else";class g extends p{constructor(k,P){super(P),this.condition=k}render(k){let P=`if(${this.condition})`+super.render(k);return this.else&&(P+="else "+this.else.render(k)),P}optimizeNodes(){super.optimizeNodes();const k=this.condition;if(k===!0)return this.nodes;let P=this.else;if(P){const H=P.optimizeNodes();P=this.else=Array.isArray(H)?new v(H):H}if(P)return k===!1?P instanceof g?P:P.nodes:this.nodes.length?this:new g(K(k),P instanceof g?[P]:P.nodes);if(!(k===!1||!this.nodes.length))return this}optimizeNames(k,P){var H;if(this.else=(H=this.else)===null||H===void 0?void 0:H.optimizeNames(k,P),!!(super.optimizeNames(k,P)||this.else))return this.condition=q(this.condition,k,P),this}get names(){const k=super.names;return U(k,this.condition),this.else&&D(k,this.else.names),k}}g.kind="if";class b extends p{}b.kind="for";class y extends b{constructor(k){super(),this.iteration=k}render(k){return`for(${this.iteration})`+super.render(k)}optimizeNames(k,P){if(!!super.optimizeNames(k,P))return this.iteration=q(this.iteration,k,P),this}get names(){return D(super.names,this.iteration.names)}}class j extends b{constructor(k,P,H,J){super(),this.varKind=k,this.name=P,this.from=H,this.to=J}render(k){const P=k.es5?t.varKinds.var:this.varKind,{name:H,from:J,to:he}=this;return`for(${P} ${H}=${J}; ${H}<${he}; ${H}++)`+super.render(k)}get names(){const k=U(super.names,this.from);return U(k,this.to)}}class w extends b{constructor(k,P,H,J){super(),this.loop=k,this.varKind=P,this.name=H,this.iterable=J}render(k){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(k)}optimizeNames(k,P){if(!!super.optimizeNames(k,P))return this.iterable=q(this.iterable,k,P),this}get names(){return D(super.names,this.iterable.names)}}class $ extends p{constructor(k,P,H){super(),this.name=k,this.args=P,this.async=H}render(k){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(k)}}$.kind="func";class S extends h{render(k){return"return "+super.render(k)}}S.kind="return";class _ extends p{render(k){let P="try"+super.render(k);return this.catch&&(P+=this.catch.render(k)),this.finally&&(P+=this.finally.render(k)),P}optimizeNodes(){var k,P;return super.optimizeNodes(),(k=this.catch)===null||k===void 0||k.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(k,P){var H,J;return super.optimizeNames(k,P),(H=this.catch)===null||H===void 0||H.optimizeNames(k,P),(J=this.finally)===null||J===void 0||J.optimizeNames(k,P),this}get names(){const k=super.names;return this.catch&&D(k,this.catch.names),this.finally&&D(k,this.finally.names),k}}class F extends p{constructor(k){super(),this.error=k}render(k){return`catch(${this.error})`+super.render(k)}}F.kind="catch";class I extends p{render(k){return"finally"+super.render(k)}}I.kind="finally";class W{constructor(k,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts=gs(Tr({},P),{_n:P.lines?` +`:""}),this._extScope=k,this._scope=new t.Scope({parent:k}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(k){return this._scope.name(k)}scopeName(k){return this._extScope.name(k)}scopeValue(k,P){const H=this._extScope.value(k,P);return(this._values[H.prefix]||(this._values[H.prefix]=new Set)).add(H),H}getScopeValue(k,P){return this._extScope.getValue(k,P)}scopeRefs(k){return this._extScope.scopeRefs(k,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(k,P,H,J){const he=this._scope.toName(P);return H!==void 0&&J&&(this._constants[he.str]=H),this._leafNode(new s(k,he,H)),he}const(k,P,H){return this._def(t.varKinds.const,k,P,H)}let(k,P,H){return this._def(t.varKinds.let,k,P,H)}var(k,P,H){return this._def(t.varKinds.var,k,P,H)}assign(k,P,H){return this._leafNode(new a(k,P,H))}add(k,P){return this._leafNode(new l(k,n.operators.ADD,P))}code(k){return typeof k=="function"?k():k!==e.nil&&this._leafNode(new d(k)),this}object(...k){const P=["{"];for(const[H,J]of k)P.length>1&&P.push(","),P.push(H),(H!==J||this.opts.es5)&&(P.push(":"),(0,e.addCodeArg)(P,J));return P.push("}"),new e._Code(P)}if(k,P,H){if(this._blockNode(new g(k)),P&&H)this.code(P).else().code(H).endIf();else if(P)this.code(P).endIf();else if(H)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(k){return this._elseNode(new g(k))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(g,v)}_for(k,P){return this._blockNode(k),P&&this.code(P).endFor(),this}for(k,P){return this._for(new y(k),P)}forRange(k,P,H,J,he=this.opts.es5?t.varKinds.var:t.varKinds.let){const Se=this._scope.toName(k);return this._for(new j(he,Se,P,H),()=>J(Se))}forOf(k,P,H,J=t.varKinds.const){const he=this._scope.toName(k);if(this.opts.es5){const Se=P instanceof e.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,e._)`${Se}.length`,pe=>{this.var(he,(0,e._)`${Se}[${pe}]`),H(he)})}return this._for(new w("of",J,he,P),()=>H(he))}forIn(k,P,H,J=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(k,(0,e._)`Object.keys(${P})`,H);const he=this._scope.toName(k);return this._for(new w("in",J,he,P),()=>H(he))}endFor(){return this._endBlockNode(b)}label(k){return this._leafNode(new c(k))}break(k){return this._leafNode(new u(k))}return(k){const P=new S;if(this._blockNode(P),this.code(k),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(k,P,H){if(!P&&!H)throw new Error('CodeGen: "try" without "catch" and "finally"');const J=new _;if(this._blockNode(J),this.code(k),P){const he=this.name("e");this._currNode=J.catch=new F(he),P(he)}return H&&(this._currNode=J.finally=new I,this.code(H)),this._endBlockNode(F,I)}throw(k){return this._leafNode(new f(k))}block(k,P){return this._blockStarts.push(this._nodes.length),k&&this.code(k).endBlock(P),this}endBlock(k){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const H=this._nodes.length-P;if(H<0||k!==void 0&&H!==k)throw new Error(`CodeGen: wrong number of nodes: ${H} vs ${k} expected`);return this._nodes.length=P,this}func(k,P=e.nil,H,J){return this._blockNode(new $(k,P,H)),J&&this.code(J).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(k=1){for(;k-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(k){return this._currNode.nodes.push(k),this}_blockNode(k){this._currNode.nodes.push(k),this._nodes.push(k)}_endBlockNode(k,P){const H=this._currNode;if(H instanceof k||P&&H instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${k.kind}/${P.kind}`:k.kind}"`)}_elseNode(k){const P=this._currNode;if(!(P instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=k,this}get _root(){return this._nodes[0]}get _currNode(){const k=this._nodes;return k[k.length-1]}set _currNode(k){const P=this._nodes;P[P.length-1]=k}}n.CodeGen=W;function D(R,k){for(const P in k)R[P]=(R[P]||0)+(k[P]||0);return R}function U(R,k){return k instanceof e._CodeOrName?D(R,k.names):R}function q(R,k,P){if(R instanceof e.Name)return H(R);if(!J(R))return R;return new e._Code(R._items.reduce((he,Se)=>(Se instanceof e.Name&&(Se=H(Se)),Se instanceof e._Code?he.push(...Se._items):he.push(Se),he),[]));function H(he){const Se=P[he.str];return Se===void 0||k[he.str]!==1?he:(delete k[he.str],Se)}function J(he){return he instanceof e._Code&&he._items.some(Se=>Se instanceof e.Name&&k[Se.str]===1&&P[Se.str]!==void 0)}}function X(R,k){for(const P in k)R[P]=(R[P]||0)-(k[P]||0)}function K(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,e._)`!${te(R)}`}n.not=K;const Y=A(n.operators.AND);function T(...R){return R.reduce(Y)}n.and=T;const B=A(n.operators.OR);function O(...R){return R.reduce(B)}n.or=O;function A(R){return(k,P)=>k===e.nil?P:P===e.nil?k:(0,e._)`${te(k)} ${R} ${te(P)}`}function te(R){return R instanceof e.Name?R:(0,e._)`(${R})`}})(gn);var $n={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.checkStrictMode=n.getErrorPath=n.Type=n.useFunc=n.setEvaluated=n.evaluatedPropsToName=n.mergeEvaluated=n.eachItem=n.unescapeJsonPointer=n.escapeJsonPointer=n.escapeFragment=n.unescapeFragment=n.schemaRefOrVal=n.schemaHasRulesButRef=n.schemaHasRules=n.checkUnknownRules=n.alwaysValidSchema=n.toHash=void 0;const e=gn,t=su;function r($){const S={};for(const _ of $)S[_]=!0;return S}n.toHash=r;function i($,S){return typeof S=="boolean"?S:Object.keys(S).length===0?!0:(o($,S),!s(S,$.self.RULES.all))}n.alwaysValidSchema=i;function o($,S=$.schema){const{opts:_,self:F}=$;if(!_.strictSchema||typeof S=="boolean")return;const I=F.RULES.keywords;for(const W in S)I[W]||w($,`unknown keyword: "${W}"`)}n.checkUnknownRules=o;function s($,S){if(typeof $=="boolean")return!$;for(const _ in $)if(S[_])return!0;return!1}n.schemaHasRules=s;function a($,S){if(typeof $=="boolean")return!$;for(const _ in $)if(_!=="$ref"&&S.all[_])return!0;return!1}n.schemaHasRulesButRef=a;function l({topSchemaRef:$,schemaPath:S},_,F,I){if(!I){if(typeof _=="number"||typeof _=="boolean")return _;if(typeof _=="string")return(0,e._)`${_}`}return(0,e._)`${$}${S}${(0,e.getProperty)(F)}`}n.schemaRefOrVal=l;function c($){return d(decodeURIComponent($))}n.unescapeFragment=c;function u($){return encodeURIComponent(f($))}n.escapeFragment=u;function f($){return typeof $=="number"?`${$}`:$.replace(/~/g,"~0").replace(/\//g,"~1")}n.escapeJsonPointer=f;function d($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}n.unescapeJsonPointer=d;function h($,S){if(Array.isArray($))for(const _ of $)S(_);else S($)}n.eachItem=h;function p({mergeNames:$,mergeToName:S,mergeValues:_,resultToName:F}){return(I,W,D,U)=>{const q=D===void 0?W:D instanceof e.Name?(W instanceof e.Name?$(I,W,D):S(I,W,D),D):W instanceof e.Name?(S(I,D,W),W):_(W,D);return U===e.Name&&!(q instanceof e.Name)?F(I,q):q}}n.mergeEvaluated={props:p({mergeNames:($,S,_)=>$.if((0,e._)`${_} !== true && ${S} !== undefined`,()=>{$.if((0,e._)`${S} === true`,()=>$.assign(_,!0),()=>$.assign(_,(0,e._)`${_} || {}`).code((0,e._)`Object.assign(${_}, ${S})`))}),mergeToName:($,S,_)=>$.if((0,e._)`${_} !== true`,()=>{S===!0?$.assign(_,!0):($.assign(_,(0,e._)`${_} || {}`),v($,_,S))}),mergeValues:($,S)=>$===!0?!0:Tr(Tr({},$),S),resultToName:m}),items:p({mergeNames:($,S,_)=>$.if((0,e._)`${_} !== true && ${S} !== undefined`,()=>$.assign(_,(0,e._)`${S} === true ? true : ${_} > ${S} ? ${_} : ${S}`)),mergeToName:($,S,_)=>$.if((0,e._)`${_} !== true`,()=>$.assign(_,S===!0?!0:(0,e._)`${_} > ${S} ? ${_} : ${S}`)),mergeValues:($,S)=>$===!0?!0:Math.max($,S),resultToName:($,S)=>$.var("items",S)})};function m($,S){if(S===!0)return $.var("props",!0);const _=$.var("props",(0,e._)`{}`);return S!==void 0&&v($,_,S),_}n.evaluatedPropsToName=m;function v($,S,_){Object.keys(_).forEach(F=>$.assign((0,e._)`${S}${(0,e.getProperty)(F)}`,!0))}n.setEvaluated=v;const g={};function b($,S){return $.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new t._Code(S.code))})}n.useFunc=b;var y;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(y=n.Type||(n.Type={}));function j($,S,_){if($ instanceof e.Name){const F=S===y.Num;return _?F?(0,e._)`"[" + ${$} + "]"`:(0,e._)`"['" + ${$} + "']"`:F?(0,e._)`"/" + ${$}`:(0,e._)`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return _?(0,e.getProperty)($).toString():"/"+f($)}n.getErrorPath=j;function w($,S,_=$.opts.strictSchema){if(!!_){if(S=`strict mode: ${S}`,_===!0)throw new Error(S);$.self.logger.warn(S)}}n.checkStrictMode=w})($n);var qo={};Object.defineProperty(qo,"__esModule",{value:!0});const Vr=gn,HD={data:new Vr.Name("data"),valCxt:new Vr.Name("valCxt"),instancePath:new Vr.Name("instancePath"),parentData:new Vr.Name("parentData"),parentDataProperty:new Vr.Name("parentDataProperty"),rootData:new Vr.Name("rootData"),dynamicAnchors:new Vr.Name("dynamicAnchors"),vErrors:new Vr.Name("vErrors"),errors:new Vr.Name("errors"),this:new Vr.Name("this"),self:new Vr.Name("self"),scope:new Vr.Name("scope"),json:new Vr.Name("json"),jsonPos:new Vr.Name("jsonPos"),jsonLen:new Vr.Name("jsonLen"),jsonPart:new Vr.Name("jsonPart")};qo.default=HD;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.extendErrors=n.resetErrorsCount=n.reportExtraError=n.reportError=n.keyword$DataError=n.keywordError=void 0;const e=gn,t=$n,r=qo;n.keywordError={message:({keyword:v})=>(0,e.str)`must pass "${v}" keyword validation`},n.keyword$DataError={message:({keyword:v,schemaType:g})=>g?(0,e.str)`"${v}" keyword must be ${g} ($data)`:(0,e.str)`"${v}" keyword is invalid ($data)`};function i(v,g=n.keywordError,b,y){const{it:j}=v,{gen:w,compositeRule:$,allErrors:S}=j,_=f(v,g,b);(y!=null?y:$||S)?l(w,_):c(j,(0,e._)`[${_}]`)}n.reportError=i;function o(v,g=n.keywordError,b){const{it:y}=v,{gen:j,compositeRule:w,allErrors:$}=y,S=f(v,g,b);l(j,S),w||$||c(y,r.default.vErrors)}n.reportExtraError=o;function s(v,g){v.assign(r.default.errors,g),v.if((0,e._)`${r.default.vErrors} !== null`,()=>v.if(g,()=>v.assign((0,e._)`${r.default.vErrors}.length`,g),()=>v.assign(r.default.vErrors,null)))}n.resetErrorsCount=s;function a({gen:v,keyword:g,schemaValue:b,data:y,errsCount:j,it:w}){if(j===void 0)throw new Error("ajv implementation error");const $=v.name("err");v.forRange("i",j,r.default.errors,S=>{v.const($,(0,e._)`${r.default.vErrors}[${S}]`),v.if((0,e._)`${$}.instancePath === undefined`,()=>v.assign((0,e._)`${$}.instancePath`,(0,e.strConcat)(r.default.instancePath,w.errorPath))),v.assign((0,e._)`${$}.schemaPath`,(0,e.str)`${w.errSchemaPath}/${g}`),w.opts.verbose&&(v.assign((0,e._)`${$}.schema`,b),v.assign((0,e._)`${$}.data`,y))})}n.extendErrors=a;function l(v,g){const b=v.const("err",g);v.if((0,e._)`${r.default.vErrors} === null`,()=>v.assign(r.default.vErrors,(0,e._)`[${b}]`),(0,e._)`${r.default.vErrors}.push(${b})`),v.code((0,e._)`${r.default.errors}++`)}function c(v,g){const{gen:b,validateName:y,schemaEnv:j}=v;j.$async?b.throw((0,e._)`new ${v.ValidationError}(${g})`):(b.assign((0,e._)`${y}.errors`,g),b.return(!1))}const u={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function f(v,g,b){const{createErrors:y}=v.it;return y===!1?(0,e._)`{}`:d(v,g,b)}function d(v,g,b={}){const{gen:y,it:j}=v,w=[h(j,b),p(v,b)];return m(v,g,w),y.object(...w)}function h({errorPath:v},{instancePath:g}){const b=g?(0,e.str)`${v}${(0,t.getErrorPath)(g,t.Type.Str)}`:v;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,b)]}function p({keyword:v,it:{errSchemaPath:g}},{schemaPath:b,parentSchema:y}){let j=y?g:(0,e.str)`${g}/${v}`;return b&&(j=(0,e.str)`${j}${(0,t.getErrorPath)(b,t.Type.Str)}`),[u.schemaPath,j]}function m(v,{params:g,message:b},y){const{keyword:j,data:w,schemaValue:$,it:S}=v,{opts:_,propertyName:F,topSchemaRef:I,schemaPath:W}=S;y.push([u.keyword,j],[u.params,typeof g=="function"?g(v):g||(0,e._)`{}`]),_.messages&&y.push([u.message,typeof b=="function"?b(v):b]),_.verbose&&y.push([u.schema,$],[u.parentSchema,(0,e._)`${I}${W}`],[r.default.data,w]),F&&y.push([u.propertyName,F])}})(Mu);Object.defineProperty(Pl,"__esModule",{value:!0});Pl.boolOrEmptySchema=Pl.topBoolOrEmptySchema=void 0;const UD=Mu,WD=gn,JD=qo,KD={message:"boolean schema is false"};function GD(n){const{gen:e,schema:t,validateName:r}=n;t===!1?iC(n,!1):typeof t=="object"&&t.$async===!0?e.return(JD.default.data):(e.assign((0,WD._)`${r}.errors`,null),e.return(!0))}Pl.topBoolOrEmptySchema=GD;function QD(n,e){const{gen:t,schema:r}=n;r===!1?(t.var(e,!1),iC(n)):t.var(e,!0)}Pl.boolOrEmptySchema=QD;function iC(n,e){const{gen:t,data:r}=n,i={gen:t,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:n};(0,UD.reportError)(i,KD,void 0,e)}var Eu={},Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.getRules=Sa.isJSONType=void 0;const YD=["string","number","integer","boolean","null","object","array"],XD=new Set(YD);function ZD(n){return typeof n=="string"&&XD.has(n)}Sa.isJSONType=ZD;function eL(){const n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:gs(Tr({},n),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}Sa.getRules=eL;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.shouldUseRule=Yo.shouldUseGroup=Yo.schemaHasRulesForType=void 0;function tL({schema:n,self:e},t){const r=e.RULES.types[t];return r&&r!==!0&&oC(n,r)}Yo.schemaHasRulesForType=tL;function oC(n,e){return e.rules.some(t=>sC(n,t))}Yo.shouldUseGroup=oC;function sC(n,e){var t;return n[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(r=>n[r]!==void 0))}Yo.shouldUseRule=sC;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.reportTypeError=n.checkDataTypes=n.checkDataType=n.coerceAndCheckDataType=n.getJSONTypes=n.getSchemaTypes=n.DataType=void 0;const e=Sa,t=Yo,r=Mu,i=gn,o=$n;var s;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(s=n.DataType||(n.DataType={}));function a(y){const j=l(y.type);if(j.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&j.push("null")}return j}n.getSchemaTypes=a;function l(y){const j=Array.isArray(y)?y:y?[y]:[];if(j.every(e.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}n.getJSONTypes=l;function c(y,j){const{gen:w,data:$,opts:S}=y,_=f(j,S.coerceTypes),F=j.length>0&&!(_.length===0&&j.length===1&&(0,t.schemaHasRulesForType)(y,j[0]));if(F){const I=m(j,$,S.strictNumbers,s.Wrong);w.if(I,()=>{_.length?d(y,j,_):g(y)})}return F}n.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function f(y,j){return j?y.filter(w=>u.has(w)||j==="array"&&w==="array"):[]}function d(y,j,w){const{gen:$,data:S,opts:_}=y,F=$.let("dataType",(0,i._)`typeof ${S}`),I=$.let("coerced",(0,i._)`undefined`);_.coerceTypes==="array"&&$.if((0,i._)`${F} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>$.assign(S,(0,i._)`${S}[0]`).assign(F,(0,i._)`typeof ${S}`).if(m(j,S,_.strictNumbers),()=>$.assign(I,S))),$.if((0,i._)`${I} !== undefined`);for(const D of w)(u.has(D)||D==="array"&&_.coerceTypes==="array")&&W(D);$.else(),g(y),$.endIf(),$.if((0,i._)`${I} !== undefined`,()=>{$.assign(S,I),h(y,I)});function W(D){switch(D){case"string":$.elseIf((0,i._)`${F} == "number" || ${F} == "boolean"`).assign(I,(0,i._)`"" + ${S}`).elseIf((0,i._)`${S} === null`).assign(I,(0,i._)`""`);return;case"number":$.elseIf((0,i._)`${F} == "boolean" || ${S} === null || (${F} == "string" && ${S} && ${S} == +${S})`).assign(I,(0,i._)`+${S}`);return;case"integer":$.elseIf((0,i._)`${F} === "boolean" || ${S} === null || (${F} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(I,(0,i._)`+${S}`);return;case"boolean":$.elseIf((0,i._)`${S} === "false" || ${S} === 0 || ${S} === null`).assign(I,!1).elseIf((0,i._)`${S} === "true" || ${S} === 1`).assign(I,!0);return;case"null":$.elseIf((0,i._)`${S} === "" || ${S} === 0 || ${S} === false`),$.assign(I,null);return;case"array":$.elseIf((0,i._)`${F} === "string" || ${F} === "number" - || ${F} === "boolean" || ${S} === null`).assign(I,(0,i._)`[${S}]`)}}}function h({gen:y,parentData:x,parentDataProperty:w},$){y.if((0,i._)`${x} !== undefined`,()=>y.assign((0,i._)`${x}[${w}]`,$))}function p(y,x,w,$=s.Correct){const S=$===s.Correct?i.operators.EQ:i.operators.NEQ;let _;switch(y){case"null":return(0,i._)`${x} ${S} null`;case"array":_=(0,i._)`Array.isArray(${x})`;break;case"object":_=(0,i._)`${x} && typeof ${x} == "object" && !Array.isArray(${x})`;break;case"integer":_=F((0,i._)`!(${x} % 1) && !isNaN(${x})`);break;case"number":_=F();break;default:return(0,i._)`typeof ${x} ${S} ${y}`}return $===s.Correct?_:(0,i.not)(_);function F(I=i.nil){return(0,i.and)((0,i._)`typeof ${x} == "number"`,I,w?(0,i._)`isFinite(${x})`:i.nil)}}n.checkDataType=p;function m(y,x,w,$){if(y.length===1)return p(y[0],x,w,$);let S;const _=(0,o.toHash)(y);if(_.array&&_.object){const F=(0,i._)`typeof ${x} != "object"`;S=_.null?F:(0,i._)`!${x} || ${F}`,delete _.null,delete _.array,delete _.object}else S=i.nil;_.number&&delete _.integer;for(const F in _)S=(0,i.and)(S,p(F,x,w,$));return S}n.checkDataTypes=m;const v={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:x})=>typeof y=="string"?(0,i._)`{type: ${y}}`:(0,i._)`{type: ${x}}`};function g(y){const x=b(y);(0,r.reportError)(x,v)}n.reportTypeError=g;function b(y){const{gen:x,data:w,schema:$}=y,S=(0,o.schemaRefOrVal)(y,$,"type");return{gen:x,keyword:"type",data:w,schema:$.type,schemaCode:S,schemaValue:S,parentSchema:$,params:{},it:y}}})(Eu);var zh={};Object.defineProperty(zh,"__esModule",{value:!0});zh.assignDefaults=void 0;const Ha=gn,nL=$n;function rL(n,e){const{properties:t,items:r}=n.schema;if(e==="object"&&t)for(const i in t)Fb(n,i,t[i].default);else e==="array"&&Array.isArray(r)&&r.forEach((i,o)=>Fb(n,o,i.default))}zh.assignDefaults=rL;function Fb(n,e,t){const{gen:r,compositeRule:i,data:o,opts:s}=n;if(t===void 0)return;const a=(0,Ha._)`${o}${(0,Ha.getProperty)(e)}`;if(i){(0,nL.checkStrictMode)(n,`default is ignored for: ${a}`);return}let l=(0,Ha._)`${a} === undefined`;s.useDefaults==="empty"&&(l=(0,Ha._)`${l} || ${a} === null || ${a} === ""`),r.if(l,(0,Ha._)`${a} = ${(0,Ha.stringify)(t)}`)}var Mo={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.validateUnion=pn.validateArray=pn.usePattern=pn.callValidateCode=pn.schemaProperties=pn.allSchemaProperties=pn.noPropertyInData=pn.propertyInData=pn.isOwnProperty=pn.hasPropFunc=pn.reportMissingProp=pn.checkMissingProp=pn.checkReportMissingProp=void 0;const Jn=gn,Jv=$n,vs=qo,iL=$n;function oL(n,e){const{gen:t,data:r,it:i}=n;t.if(Gv(t,r,e,i.opts.ownProperties),()=>{n.setParams({missingProperty:(0,Jn._)`${e}`},!0),n.error()})}pn.checkReportMissingProp=oL;function sL({gen:n,data:e,it:{opts:t}},r,i){return(0,Jn.or)(...r.map(o=>(0,Jn.and)(Gv(n,e,o,t.ownProperties),(0,Jn._)`${i} = ${o}`)))}pn.checkMissingProp=sL;function aL(n,e){n.setParams({missingProperty:e},!0),n.error()}pn.reportMissingProp=aL;function aC(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Jn._)`Object.prototype.hasOwnProperty`})}pn.hasPropFunc=aC;function Kv(n,e,t){return(0,Jn._)`${aC(n)}.call(${e}, ${t})`}pn.isOwnProperty=Kv;function lL(n,e,t,r){const i=(0,Jn._)`${e}${(0,Jn.getProperty)(t)} !== undefined`;return r?(0,Jn._)`${i} && ${Kv(n,e,t)}`:i}pn.propertyInData=lL;function Gv(n,e,t,r){const i=(0,Jn._)`${e}${(0,Jn.getProperty)(t)} === undefined`;return r?(0,Jn.or)(i,(0,Jn.not)(Kv(n,e,t))):i}pn.noPropertyInData=Gv;function lC(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}pn.allSchemaProperties=lC;function cL(n,e){return lC(e).filter(t=>!(0,Jv.alwaysValidSchema)(n,e[t]))}pn.schemaProperties=cL;function uL({schemaCode:n,data:e,it:{gen:t,topSchemaRef:r,schemaPath:i,errorPath:o},it:s},a,l,c){const u=c?(0,Jn._)`${n}, ${e}, ${r}${i}`:e,f=[[vs.default.instancePath,(0,Jn.strConcat)(vs.default.instancePath,o)],[vs.default.parentData,s.parentData],[vs.default.parentDataProperty,s.parentDataProperty],[vs.default.rootData,vs.default.rootData]];s.opts.dynamicRef&&f.push([vs.default.dynamicAnchors,vs.default.dynamicAnchors]);const d=(0,Jn._)`${u}, ${t.object(...f)}`;return l!==Jn.nil?(0,Jn._)`${a}.call(${l}, ${d})`:(0,Jn._)`${a}(${d})`}pn.callValidateCode=uL;const fL=(0,Jn._)`new RegExp`;function dL({gen:n,it:{opts:e}},t){const r=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(t,r);return n.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Jn._)`${i.code==="new RegExp"?fL:(0,iL.useFunc)(n,i)}(${t}, ${r})`})}pn.usePattern=dL;function hL(n){const{gen:e,data:t,keyword:r,it:i}=n,o=e.name("valid");if(i.allErrors){const a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){const l=e.const("len",(0,Jn._)`${t}.length`);e.forRange("i",0,l,c=>{n.subschema({keyword:r,dataProp:c,dataPropType:Jv.Type.Num},o),e.if((0,Jn.not)(o),a)})}}pn.validateArray=hL;function pL(n){const{gen:e,schema:t,keyword:r,it:i}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(l=>(0,Jv.alwaysValidSchema)(i,l))&&!i.opts.unevaluated)return;const s=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((l,c)=>{const u=n.subschema({keyword:r,schemaProp:c,compositeRule:!0},a);e.assign(s,(0,Jn._)`${s} || ${a}`),n.mergeValidEvaluated(u,a)||e.if((0,Jn.not)(s))})),n.result(s,()=>n.reset(),()=>n.error(!0))}pn.validateUnion=pL;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.validateKeywordUsage=Mo.validSchemaType=Mo.funcKeywordCode=Mo.macroKeywordCode=void 0;const ti=gn,oa=qo,mL=pn,gL=Mu;function vL(n,e){const{gen:t,keyword:r,schema:i,parentSchema:o,it:s}=n,a=e.macro.call(s.self,i,o,s),l=cC(t,r,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const c=t.name("valid");n.subschema({schema:a,schemaPath:ti.nil,errSchemaPath:`${s.errSchemaPath}/${r}`,topSchemaRef:l,compositeRule:!0},c),n.pass(c,()=>n.error(!0))}Mo.macroKeywordCode=vL;function yL(n,e){var t;const{gen:r,keyword:i,schema:o,parentSchema:s,$data:a,it:l}=n;wL(l,e);const c=!a&&e.compile?e.compile.call(l.self,o,s,l):e.validate,u=cC(r,i,c),f=r.let("valid");n.block$data(f,d),n.ok((t=e.valid)!==null&&t!==void 0?t:f);function d(){if(e.errors===!1)m(),e.modifying&&qb(n),v(()=>n.error());else{const g=e.async?h():p();e.modifying&&qb(n),v(()=>bL(n,g))}}function h(){const g=r.let("ruleErrs",null);return r.try(()=>m((0,ti._)`await `),b=>r.assign(f,!1).if((0,ti._)`${b} instanceof ${l.ValidationError}`,()=>r.assign(g,(0,ti._)`${b}.errors`),()=>r.throw(b))),g}function p(){const g=(0,ti._)`${u}.errors`;return r.assign(g,null),m(ti.nil),g}function m(g=e.async?(0,ti._)`await `:ti.nil){const b=l.opts.passContext?oa.default.this:oa.default.self,y=!("compile"in e&&!a||e.schema===!1);r.assign(f,(0,ti._)`${g}${(0,mL.callValidateCode)(n,u,b,y)}`,e.modifying)}function v(g){var b;r.if((0,ti.not)((b=e.valid)!==null&&b!==void 0?b:f),g)}}Mo.funcKeywordCode=yL;function qb(n){const{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,ti._)`${r.parentData}[${r.parentDataProperty}]`))}function bL(n,e){const{gen:t}=n;t.if((0,ti._)`Array.isArray(${e})`,()=>{t.assign(oa.default.vErrors,(0,ti._)`${oa.default.vErrors} === null ? ${e} : ${oa.default.vErrors}.concat(${e})`).assign(oa.default.errors,(0,ti._)`${oa.default.vErrors}.length`),(0,gL.extendErrors)(n)},()=>n.error())}function wL({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function cC(n,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return n.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,ti.stringify)(t)})}function xL(n,e,t=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(n):r==="object"?n&&typeof n=="object"&&!Array.isArray(n):typeof n==r||t&&typeof n=="undefined")}Mo.validSchemaType=xL;function jL({schema:n,opts:e,self:t,errSchemaPath:r},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(n,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(n[o])){const l=`keyword "${o}" value is invalid at path "${r}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(l);else throw new Error(l)}}Mo.validateKeywordUsage=jL;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.extendSubschemaMode=_s.extendSubschemaData=_s.getSubschema=void 0;const ko=gn,uC=$n;function $L(n,{keyword:e,schemaProp:t,schema:r,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const a=n.schema[e];return t===void 0?{schema:a,schemaPath:(0,ko._)`${n.schemaPath}${(0,ko.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,ko._)`${n.schemaPath}${(0,ko.getProperty)(e)}${(0,ko.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,uC.escapeFragment)(t)}`}}if(r!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}_s.getSubschema=$L;function kL(n,e,{dataProp:t,dataPropType:r,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=e;if(t!==void 0){const{errorPath:c,dataPathArr:u,opts:f}=e,d=a.let("data",(0,ko._)`${e.data}${(0,ko.getProperty)(t)}`,!0);l(d),n.errorPath=(0,ko.str)`${c}${(0,uC.getErrorPath)(t,r,f.jsPropertySyntax)}`,n.parentDataProperty=(0,ko._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(i!==void 0){const c=i instanceof ko.Name?i:a.let("data",i,!0);l(c),s!==void 0&&(n.propertyName=s)}o&&(n.dataTypes=o);function l(c){n.data=c,n.dataLevel=e.dataLevel+1,n.dataTypes=[],e.definedProperties=new Set,n.parentData=e.data,n.dataNames=[...e.dataNames,c]}}_s.extendSubschemaData=kL;function SL(n,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:r,createErrors:i,allErrors:o}){r!==void 0&&(n.compositeRule=r),i!==void 0&&(n.createErrors=i),o!==void 0&&(n.allErrors=o),n.jtdDiscriminator=e,n.jtdMetadata=t}_s.extendSubschemaMode=SL;var Ir={},fC=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(i=r;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!n(e[s],t[s]))return!1}return!0}return e!==e&&t!==t},dC={exports:{}},Ms=dC.exports=function(n,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var r=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};ed(e,r,i,n,"",n)};Ms.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ms.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ms.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ms.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ed(n,e,t,r,i,o,s,a,l,c){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,o,s,a,l,c);for(var u in r){var f=r[u];if(Array.isArray(f)){if(u in Ms.arrayKeywords)for(var d=0;de+=hC(r)),e===1/0))return 1/0}return e}function pC(n,e="",t){t!==!1&&(e=yl(e));const r=n.parse(e);return mC(n,r)}Ir.getFullPath=pC;function mC(n,e){return n.serialize(e).split("#")[0]+"#"}Ir._getFullPath=mC;const _L=/#\/?$/;function yl(n){return n?n.replace(_L,""):""}Ir.normalizeId=yl;function RL(n,e,t){return t=yl(t),n.resolve(e,t)}Ir.resolveUrl=RL;const NL=/^[a-z_][-a-z0-9._]*$/i;function IL(n,e){if(typeof n=="boolean")return{};const{schemaId:t,uriResolver:r}=this.opts,i=yl(n[t]||e),o={"":i},s=pC(r,i,!1),a={},l=new Set;return EL(n,{allKeys:!0},(f,d,h,p)=>{if(p===void 0)return;const m=s+d;let v=o[p];typeof f[t]=="string"&&(v=g.call(this,f[t])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[d]=v;function g(y){const x=this.opts.uriResolver.resolve;if(y=yl(v?x(v,y):y),l.has(y))throw u(y);l.add(y);let w=this.refs[y];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?c(f,w.schema,y):y!==yl(m)&&(y[0]==="#"?(c(f,a[y],y),a[y]=f):this.refs[y]=m),y}function b(y){if(typeof y=="string"){if(!NL.test(y))throw new Error(`invalid anchor "${y}"`);g.call(this,`#${y}`)}}}),a;function c(f,d,h){if(d!==void 0&&!ML(f,d))throw u(h)}function u(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Ir.getSchemaRefs=IL;Object.defineProperty(io,"__esModule",{value:!0});io.getData=io.KeywordCxt=io.validateFunctionCode=void 0;const gC=Pl,Vb=Eu,Qv=Yo,zd=Eu,DL=zh,Pc=Mo,Lp=_s,jt=gn,qt=qo,LL=Ir,Xo=$n,fc=Mu;function BL(n){if(bC(n)&&(wC(n),yC(n))){qL(n);return}vC(n,()=>(0,gC.topBoolOrEmptySchema)(n))}io.validateFunctionCode=BL;function vC({gen:n,validateName:e,schema:t,schemaEnv:r,opts:i},o){i.code.es5?n.func(e,(0,jt._)`${qt.default.data}, ${qt.default.valCxt}`,r.$async,()=>{n.code((0,jt._)`"use strict"; ${Hb(t,i)}`),FL(n,i),n.code(o)}):n.func(e,(0,jt._)`${qt.default.data}, ${zL(i)}`,r.$async,()=>n.code(Hb(t,i)).code(o))}function zL(n){return(0,jt._)`{${qt.default.instancePath}="", ${qt.default.parentData}, ${qt.default.parentDataProperty}, ${qt.default.rootData}=${qt.default.data}${n.dynamicRef?(0,jt._)`, ${qt.default.dynamicAnchors}={}`:jt.nil}}={}`}function FL(n,e){n.if(qt.default.valCxt,()=>{n.var(qt.default.instancePath,(0,jt._)`${qt.default.valCxt}.${qt.default.instancePath}`),n.var(qt.default.parentData,(0,jt._)`${qt.default.valCxt}.${qt.default.parentData}`),n.var(qt.default.parentDataProperty,(0,jt._)`${qt.default.valCxt}.${qt.default.parentDataProperty}`),n.var(qt.default.rootData,(0,jt._)`${qt.default.valCxt}.${qt.default.rootData}`),e.dynamicRef&&n.var(qt.default.dynamicAnchors,(0,jt._)`${qt.default.valCxt}.${qt.default.dynamicAnchors}`)},()=>{n.var(qt.default.instancePath,(0,jt._)`""`),n.var(qt.default.parentData,(0,jt._)`undefined`),n.var(qt.default.parentDataProperty,(0,jt._)`undefined`),n.var(qt.default.rootData,qt.default.data),e.dynamicRef&&n.var(qt.default.dynamicAnchors,(0,jt._)`{}`)})}function qL(n){const{schema:e,opts:t,gen:r}=n;vC(n,()=>{t.$comment&&e.$comment&&jC(n),JL(n),r.let(qt.default.vErrors,null),r.let(qt.default.errors,0),t.unevaluated&&VL(n),xC(n),QL(n)})}function VL(n){const{gen:e,validateName:t}=n;n.evaluated=e.const("evaluated",(0,jt._)`${t}.evaluated`),e.if((0,jt._)`${n.evaluated}.dynamicProps`,()=>e.assign((0,jt._)`${n.evaluated}.props`,(0,jt._)`undefined`)),e.if((0,jt._)`${n.evaluated}.dynamicItems`,()=>e.assign((0,jt._)`${n.evaluated}.items`,(0,jt._)`undefined`))}function Hb(n,e){const t=typeof n=="object"&&n[e.schemaId];return t&&(e.code.source||e.code.process)?(0,jt._)`/*# sourceURL=${t} */`:jt.nil}function HL(n,e){if(bC(n)&&(wC(n),yC(n))){UL(n,e);return}(0,gC.boolOrEmptySchema)(n,e)}function yC({schema:n,self:e}){if(typeof n=="boolean")return!n;for(const t in n)if(e.RULES.all[t])return!0;return!1}function bC(n){return typeof n.schema!="boolean"}function UL(n,e){const{schema:t,gen:r,opts:i}=n;i.$comment&&t.$comment&&jC(n),KL(n),GL(n);const o=r.const("_errs",qt.default.errors);xC(n,o),r.var(e,(0,jt._)`${o} === ${qt.default.errors}`)}function wC(n){(0,Xo.checkUnknownRules)(n),WL(n)}function xC(n,e){if(n.opts.jtd)return Ub(n,[],!1,e);const t=(0,Vb.getSchemaTypes)(n.schema),r=(0,Vb.coerceAndCheckDataType)(n,t);Ub(n,t,!r,e)}function WL(n){const{schema:e,errSchemaPath:t,opts:r,self:i}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,Xo.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function JL(n){const{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Xo.checkStrictMode)(n,"default is ignored in the schema root")}function KL(n){const e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,LL.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function GL(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function jC({gen:n,schemaEnv:e,schema:t,errSchemaPath:r,opts:i}){const o=t.$comment;if(i.$comment===!0)n.code((0,jt._)`${qt.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){const s=(0,jt.str)`${r}/$comment`,a=n.scopeValue("root",{ref:e.root});n.code((0,jt._)`${qt.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function QL(n){const{gen:e,schemaEnv:t,validateName:r,ValidationError:i,opts:o}=n;t.$async?e.if((0,jt._)`${qt.default.errors} === 0`,()=>e.return(qt.default.data),()=>e.throw((0,jt._)`new ${i}(${qt.default.vErrors})`)):(e.assign((0,jt._)`${r}.errors`,qt.default.vErrors),o.unevaluated&&YL(n),e.return((0,jt._)`${qt.default.errors} === 0`))}function YL({gen:n,evaluated:e,props:t,items:r}){t instanceof jt.Name&&n.assign((0,jt._)`${e}.props`,t),r instanceof jt.Name&&n.assign((0,jt._)`${e}.items`,r)}function Ub(n,e,t,r){const{gen:i,schema:o,data:s,allErrors:a,opts:l,self:c}=n,{RULES:u}=c;if(o.$ref&&(l.ignoreKeywordsWithRef||!(0,Xo.schemaHasRulesButRef)(o,u))){i.block(()=>SC(n,"$ref",u.all.$ref.definition));return}l.jtd||XL(n,e),i.block(()=>{for(const d of u.rules)f(d);f(u.post)});function f(d){!(0,Qv.shouldUseGroup)(o,d)||(d.type?(i.if((0,zd.checkDataType)(d.type,s,l.strictNumbers)),Wb(n,d),e.length===1&&e[0]===d.type&&t&&(i.else(),(0,zd.reportTypeError)(n)),i.endIf()):Wb(n,d),a||i.if((0,jt._)`${qt.default.errors} === ${r||0}`))}}function Wb(n,e){const{gen:t,schema:r,opts:{useDefaults:i}}=n;i&&(0,DL.assignDefaults)(n,e.type),t.block(()=>{for(const o of e.rules)(0,Qv.shouldUseRule)(r,o)&&SC(n,o.keyword,o.definition,e.type)})}function XL(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(ZL(n,e),n.opts.allowUnionTypes||eB(n,e),tB(n,n.dataTypes))}function ZL(n,e){if(!!e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{$C(n.dataTypes,t)||Yv(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),rB(n,e)}}function eB(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Yv(n,"use allowUnionTypes to allow union type keyword")}function tB(n,e){const t=n.self.RULES.all;for(const r in t){const i=t[r];if(typeof i=="object"&&(0,Qv.shouldUseRule)(n.schema,i)){const{type:o}=i.definition;o.length&&!o.some(s=>nB(e,s))&&Yv(n,`missing type "${o.join(",")}" for keyword "${r}"`)}}}function nB(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function $C(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function rB(n,e){const t=[];for(const r of n.dataTypes)$C(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function Yv(n,e){e+=` at "${n.schemaEnv.baseId+n.errSchemaPath}" (strictTypes)`,(0,Xo.checkStrictMode)(n,e,n.opts.strictTypes)}class kC{constructor(e,t,r){if((0,Pc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Xo.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",CC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Pc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",qt.default.errors))}result(e,t,r){this.failResult((0,jt.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,jt.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail((0,jt._)`${t} !== undefined && (${(0,jt.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?fc.reportExtraError:fc.reportError)(this,this.def.error,t)}$dataError(){(0,fc.reportError)(this,this.def.$dataError||fc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,fc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=jt.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=jt.nil,t=jt.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:o,def:s}=this;r.if((0,jt.or)((0,jt._)`${i} === undefined`,t)),e!==jt.nil&&r.assign(e,!0),(o.length||s.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==jt.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:i,it:o}=this;return(0,jt.or)(s(),a());function s(){if(r.length){if(!(t instanceof jt.Name))throw new Error("ajv implementation error");const l=Array.isArray(r)?r:[r];return(0,jt._)`${(0,zd.checkDataTypes)(l,t,o.opts.strictNumbers,zd.DataType.Wrong)}`}return jt.nil}function a(){if(i.validateSchema){const l=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,jt._)`!${l}(${t})`}return jt.nil}}subschema(e,t){const r=(0,Lp.getSubschema)(this.it,e);(0,Lp.extendSubschemaData)(r,this.it,e),(0,Lp.extendSubschemaMode)(r,e);const i=gs(Tr(Tr({},this.it),r),{items:void 0,props:void 0});return HL(i,t),i}mergeEvaluated(e,t){const{it:r,gen:i}=this;!r.opts.unevaluated||(r.props!==!0&&e.props!==void 0&&(r.props=Xo.mergeEvaluated.props(i,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=Xo.mergeEvaluated.items(i,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,jt.Name)),!0}}io.KeywordCxt=kC;function SC(n,e,t,r){const i=new kC(n,t,e);"code"in t?t.code(i,r):i.$data&&t.validate?(0,Pc.funcKeywordCode)(i,t):"macro"in t?(0,Pc.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,Pc.funcKeywordCode)(i,t)}const iB=/^\/(?:[^~]|~0|~1)*$/,oB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function CC(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let i,o;if(n==="")return qt.default.rootData;if(n[0]==="/"){if(!iB.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);i=n,o=qt.default.rootData}else{const c=oB.exec(n);if(!c)throw new Error(`Invalid JSON-pointer: ${n}`);const u=+c[1];if(i=c[2],i==="#"){if(u>=e)throw new Error(l("property/index",u));return r[e-u]}if(u>e)throw new Error(l("data",u));if(o=t[e-u],!i)return o}let s=o;const a=i.split("/");for(const c of a)c&&(o=(0,jt._)`${o}${(0,jt.getProperty)((0,Xo.unescapeJsonPointer)(c))}`,s=(0,jt._)`${s} && ${o}`);return s;function l(c,u){return`Cannot access ${c} ${u} levels up, current level is ${e}`}}io.getData=CC;var Au={};Object.defineProperty(Au,"__esModule",{value:!0});class sB extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Au.default=sB;var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0});const Bp=Ir;class aB extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Bp.resolveUrl)(e,t,r),this.missingSchema=(0,Bp.normalizeId)((0,Bp.getFullPath)(e,this.missingRef))}}Tu.default=aB;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.resolveSchema=fi.getCompilingSchema=fi.resolveRef=fi.compileSchema=fi.SchemaEnv=void 0;const Qi=gn,lB=Au,ea=qo,eo=Ir,Jb=$n,cB=io;class Fh{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,eo.normalizeId)(r==null?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}fi.SchemaEnv=Fh;function Xv(n){const e=OC.call(this,n);if(e)return e;const t=(0,eo.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Qi.CodeGen(this.scope,{es5:r,lines:i,ownProperties:o});let a;n.$async&&(a=s.scopeValue("Error",{ref:lB.default,code:(0,Qi._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");n.validateName=l;const c={gen:s,allErrors:this.opts.allErrors,data:ea.default.data,parentData:ea.default.parentData,parentDataProperty:ea.default.parentDataProperty,dataNames:[ea.default.data],dataPathArr:[Qi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,Qi.stringify)(n.schema)}:{ref:n.schema}),validateName:l,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:Qi.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Qi._)`""`,opts:this.opts,self:this};let u;try{this._compilations.add(n),(0,cB.validateFunctionCode)(c),s.optimize(this.opts.code.optimize);const f=s.toString();u=`${s.scopeRefs(ea.default.scope)}return ${f}`,this.opts.code.process&&(u=this.opts.code.process(u,n));const h=new Function(`${ea.default.self}`,`${ea.default.scope}`,u)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=n.schema,h.schemaEnv=n,n.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){const{props:p,items:m}=c;h.evaluated={props:p instanceof Qi.Name?void 0:p,items:m instanceof Qi.Name?void 0:m,dynamicProps:p instanceof Qi.Name,dynamicItems:m instanceof Qi.Name},h.source&&(h.source.evaluated=(0,Qi.stringify)(h.evaluated))}return n.validate=h,n}catch(f){throw delete n.validate,delete n.validateName,u&&this.logger.error("Error compiling schema, function code:",u),f}finally{this._compilations.delete(n)}}fi.compileSchema=Xv;function uB(n,e,t){var r;t=(0,eo.resolveUrl)(this.opts.uriResolver,e,t);const i=n.refs[t];if(i)return i;let o=hB.call(this,n,t);if(o===void 0){const s=(r=n.localRefs)===null||r===void 0?void 0:r[t],{schemaId:a}=this.opts;s&&(o=new Fh({schema:s,schemaId:a,root:n,baseId:e}))}if(o!==void 0)return n.refs[t]=fB.call(this,o)}fi.resolveRef=uB;function fB(n){return(0,eo.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:Xv.call(this,n)}function OC(n){for(const e of this._compilations)if(dB(e,n))return e}fi.getCompilingSchema=OC;function dB(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function hB(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||qh.call(this,n,e)}function qh(n,e){const t=this.opts.uriResolver.parse(e),r=(0,eo._getFullPath)(this.opts.uriResolver,t);let i=(0,eo.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===i)return zp.call(this,t,n);const o=(0,eo.normalizeId)(r),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){const a=qh.call(this,n,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:zp.call(this,t,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||Xv.call(this,s),o===(0,eo.normalizeId)(e)){const{schema:a}=s,{schemaId:l}=this.opts,c=a[l];return c&&(i=(0,eo.resolveUrl)(this.opts.uriResolver,i,c)),new Fh({schema:a,schemaId:l,root:n,baseId:i})}return zp.call(this,t,s)}}fi.resolveSchema=qh;const pB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zp(n,{baseId:e,schema:t,root:r}){var i;if(((i=n.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const a of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const l=t[(0,Jb.unescapeFragment)(a)];if(l===void 0)return;t=l;const c=typeof t=="object"&&t[this.opts.schemaId];!pB.has(a)&&c&&(e=(0,eo.resolveUrl)(this.opts.uriResolver,e,c))}let o;if(typeof t!="boolean"&&t.$ref&&!(0,Jb.schemaHasRulesButRef)(t,this.RULES)){const a=(0,eo.resolveUrl)(this.opts.uriResolver,e,t.$ref);o=qh.call(this,r,a)}const{schemaId:s}=this.opts;if(o=o||new Fh({schema:t,schemaId:s,root:r,baseId:e}),o.schema!==o.root.schema)return o}const mB="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",gB="Meta-schema for $data reference (JSON AnySchema extension proposal)",vB="object",yB=["$data"],bB={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},wB=!1;var xB={$id:mB,description:gB,type:vB,required:yB,properties:bB,additionalProperties:wB},Zv={},vg={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(n,e){(function(t,r){r(e)})(J6,function(t){function r(){for(var N=arguments.length,G=Array(N),ie=0;ie1){G[0]=G[0].slice(0,-1);for(var ue=G.length-1,ye=1;ye= 0x80 (not a basic code point)","invalid-input":"Invalid input"},W=m-v,D=Math.floor,U=String.fromCharCode;function q(N){throw new RangeError(I[N])}function X(N,G){for(var ie=[],ue=N.length;ue--;)ie[ue]=G(N[ue]);return ie}function K(N,G){var ie=N.split("@"),ue="";ie.length>1&&(ue=ie[0]+"@",N=ie[1]),N=N.replace(F,".");var ye=N.split("."),it=X(ye,G).join(".");return ue+it}function Y(N){for(var G=[],ie=0,ue=N.length;ie=55296&&ye<=56319&&ie>1,G+=D(G/ie);G>W*g>>1;ye+=m)G=D(G/W);return D(ye+(W+1)*G/(G+b))},te=function(G){var ie=[],ue=G.length,ye=0,it=w,vt=x,Nt=G.lastIndexOf($);Nt<0&&(Nt=0);for(var bn=0;bn=128&&q("not-basic"),ie.push(G.charCodeAt(bn));for(var En=Nt>0?Nt+1:0;En=ue&&q("invalid-input");var Ot=B(G.charCodeAt(En++));(Ot>=m||Ot>D((p-ye)/ln))&&q("overflow"),ye+=Ot*ln;var Sn=Jt<=vt?v:Jt>=vt+g?g:Jt-vt;if(OtD(p/An)&&q("overflow"),ln*=An}var xn=ie.length+1;vt=A(ye-Bt,xn,Bt==0),D(ye/xn)>p-it&&q("overflow"),it+=D(ye/xn),ye%=xn,ie.splice(ye++,0,it)}return String.fromCodePoint.apply(String,ie)},R=function(G){var ie=[];G=Y(G);var ue=G.length,ye=w,it=0,vt=x,Nt=!0,bn=!1,En=void 0;try{for(var Bt=G[Symbol.iterator](),ln;!(Nt=(ln=Bt.next()).done);Nt=!0){var Jt=ln.value;Jt<128&&ie.push(U(Jt))}}catch(yt){bn=!0,En=yt}finally{try{!Nt&&Bt.return&&Bt.return()}finally{if(bn)throw En}}var Ot=ie.length,Sn=Ot;for(Ot&&ie.push($);Sn=ye&&zeD((p-it)/Fe)&&q("overflow"),it+=(An-ye)*Fe,ye=An;var kt=!0,zt=!1,Kt=void 0;try{for(var z=G[Symbol.iterator](),le;!(kt=(le=z.next()).done);kt=!0){var xe=le.value;if(xep&&q("overflow"),xe==ye){for(var Me=it,Ne=m;;Ne+=m){var Le=Ne<=vt?v:Ne>=vt+g?g:Ne-vt;if(Me>6|192).toString(16).toUpperCase()+"%"+(G&63|128).toString(16).toUpperCase():ie="%"+(G>>12|224).toString(16).toUpperCase()+"%"+(G>>6&63|128).toString(16).toUpperCase()+"%"+(G&63|128).toString(16).toUpperCase(),ie}function Se(N){for(var G="",ie=0,ue=N.length;ie=194&&ye<224){if(ue-ie>=6){var it=parseInt(N.substr(ie+4,2),16);G+=String.fromCharCode((ye&31)<<6|it&63)}else G+=N.substr(ie,6);ie+=6}else if(ye>=224){if(ue-ie>=9){var vt=parseInt(N.substr(ie+4,2),16),Nt=parseInt(N.substr(ie+7,2),16);G+=String.fromCharCode((ye&15)<<12|(vt&63)<<6|Nt&63)}else G+=N.substr(ie,9);ie+=9}else G+=N.substr(ie,3),ie+=3}return G}function pe(N,G){function ie(ue){var ye=Se(ue);return ye.match(G.UNRESERVED)?ye:ue}return N.scheme&&(N.scheme=String(N.scheme).replace(G.PCT_ENCODED,ie).toLowerCase().replace(G.NOT_SCHEME,"")),N.userinfo!==void 0&&(N.userinfo=String(N.userinfo).replace(G.PCT_ENCODED,ie).replace(G.NOT_USERINFO,he).replace(G.PCT_ENCODED,s)),N.host!==void 0&&(N.host=String(N.host).replace(G.PCT_ENCODED,ie).toLowerCase().replace(G.NOT_HOST,he).replace(G.PCT_ENCODED,s)),N.path!==void 0&&(N.path=String(N.path).replace(G.PCT_ENCODED,ie).replace(N.scheme?G.NOT_PATH:G.NOT_PATH_NOSCHEME,he).replace(G.PCT_ENCODED,s)),N.query!==void 0&&(N.query=String(N.query).replace(G.PCT_ENCODED,ie).replace(G.NOT_QUERY,he).replace(G.PCT_ENCODED,s)),N.fragment!==void 0&&(N.fragment=String(N.fragment).replace(G.PCT_ENCODED,ie).replace(G.NOT_FRAGMENT,he).replace(G.PCT_ENCODED,s)),N}function ae(N){return N.replace(/^0*(.*)/,"$1")||"0"}function Qe(N,G){var ie=N.match(G.IPV4ADDRESS)||[],ue=d(ie,2),ye=ue[1];return ye?ye.split(".").map(ae).join("."):N}function et(N,G){var ie=N.match(G.IPV6ADDRESS)||[],ue=d(ie,3),ye=ue[1],it=ue[2];if(ye){for(var vt=ye.toLowerCase().split("::").reverse(),Nt=d(vt,2),bn=Nt[0],En=Nt[1],Bt=En?En.split(":").map(ae):[],ln=bn.split(":").map(ae),Jt=G.IPV4ADDRESS.test(ln[ln.length-1]),Ot=Jt?7:8,Sn=ln.length-Ot,An=Array(Ot),xn=0;xn1){var Ie=An.slice(0,Q.index),ze=An.slice(Q.index+Q.length);ve=Ie.join(":")+"::"+ze.join(":")}else ve=An.join(":");return it&&(ve+="%"+it),ve}else return N}var tn=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Qt="".match(/(){0}/)[1]===void 0;function oe(N){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie={},ue=G.iri!==!1?f:u;G.reference==="suffix"&&(N=(G.scheme?G.scheme+":":"")+"//"+N);var ye=N.match(tn);if(ye){Qt?(ie.scheme=ye[1],ie.userinfo=ye[3],ie.host=ye[4],ie.port=parseInt(ye[5],10),ie.path=ye[6]||"",ie.query=ye[7],ie.fragment=ye[8],isNaN(ie.port)&&(ie.port=ye[5])):(ie.scheme=ye[1]||void 0,ie.userinfo=N.indexOf("@")!==-1?ye[3]:void 0,ie.host=N.indexOf("//")!==-1?ye[4]:void 0,ie.port=parseInt(ye[5],10),ie.path=ye[6]||"",ie.query=N.indexOf("?")!==-1?ye[7]:void 0,ie.fragment=N.indexOf("#")!==-1?ye[8]:void 0,isNaN(ie.port)&&(ie.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?ye[4]:void 0)),ie.host&&(ie.host=et(Qe(ie.host,ue),ue)),ie.scheme===void 0&&ie.userinfo===void 0&&ie.host===void 0&&ie.port===void 0&&!ie.path&&ie.query===void 0?ie.reference="same-document":ie.scheme===void 0?ie.reference="relative":ie.fragment===void 0?ie.reference="absolute":ie.reference="uri",G.reference&&G.reference!=="suffix"&&G.reference!==ie.reference&&(ie.error=ie.error||"URI is not a "+G.reference+" reference.");var it=J[(G.scheme||ie.scheme||"").toLowerCase()];if(!G.unicodeSupport&&(!it||!it.unicodeSupport)){if(ie.host&&(G.domainHost||it&&it.domainHost))try{ie.host=H.toASCII(ie.host.replace(ue.PCT_ENCODED,Se).toLowerCase())}catch(vt){ie.error=ie.error||"Host's domain name can not be converted to ASCII via punycode: "+vt}pe(ie,u)}else pe(ie,ue);it&&it.parse&&it.parse(ie,G)}else ie.error=ie.error||"URI can not be parsed.";return ie}function st(N,G){var ie=G.iri!==!1?f:u,ue=[];return N.userinfo!==void 0&&(ue.push(N.userinfo),ue.push("@")),N.host!==void 0&&ue.push(et(Qe(String(N.host),ie),ie).replace(ie.IPV6ADDRESS,function(ye,it,vt){return"["+it+(vt?"%25"+vt:"")+"]"})),(typeof N.port=="number"||typeof N.port=="string")&&(ue.push(":"),ue.push(String(N.port))),ue.length?ue.join(""):void 0}var Ht=/^\.\.?\//,qe=/^\/\.(\/|$)/,Dt=/^\/\.\.(\/|$)/,He=/^\/?(?:.|\n)*?(?=\/|$)/;function wt(N){for(var G=[];N.length;)if(N.match(Ht))N=N.replace(Ht,"");else if(N.match(qe))N=N.replace(qe,"/");else if(N.match(Dt))N=N.replace(Dt,"/"),G.pop();else if(N==="."||N==="..")N="";else{var ie=N.match(He);if(ie){var ue=ie[0];N=N.slice(ue.length),G.push(ue)}else throw new Error("Unexpected dot segment condition")}return G.join("")}function Oe(N){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=G.iri?f:u,ue=[],ye=J[(G.scheme||N.scheme||"").toLowerCase()];if(ye&&ye.serialize&&ye.serialize(N,G),N.host&&!ie.IPV6ADDRESS.test(N.host)){if(G.domainHost||ye&&ye.domainHost)try{N.host=G.iri?H.toUnicode(N.host):H.toASCII(N.host.replace(ie.PCT_ENCODED,Se).toLowerCase())}catch(Nt){N.error=N.error||"Host's domain name can not be converted to "+(G.iri?"Unicode":"ASCII")+" via punycode: "+Nt}}pe(N,ie),G.reference!=="suffix"&&N.scheme&&(ue.push(N.scheme),ue.push(":"));var it=st(N,G);if(it!==void 0&&(G.reference!=="suffix"&&ue.push("//"),ue.push(it),N.path&&N.path.charAt(0)!=="/"&&ue.push("/")),N.path!==void 0){var vt=N.path;!G.absolutePath&&(!ye||!ye.absolutePath)&&(vt=wt(vt)),it===void 0&&(vt=vt.replace(/^\/\//,"/%2F")),ue.push(vt)}return N.query!==void 0&&(ue.push("?"),ue.push(N.query)),N.fragment!==void 0&&(ue.push("#"),ue.push(N.fragment)),ue.join("")}function Xe(N,G){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ue=arguments[3],ye={};return ue||(N=oe(Oe(N,ie),ie),G=oe(Oe(G,ie),ie)),ie=ie||{},!ie.tolerant&&G.scheme?(ye.scheme=G.scheme,ye.userinfo=G.userinfo,ye.host=G.host,ye.port=G.port,ye.path=wt(G.path||""),ye.query=G.query):(G.userinfo!==void 0||G.host!==void 0||G.port!==void 0?(ye.userinfo=G.userinfo,ye.host=G.host,ye.port=G.port,ye.path=wt(G.path||""),ye.query=G.query):(G.path?(G.path.charAt(0)==="/"?ye.path=wt(G.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?ye.path="/"+G.path:N.path?ye.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+G.path:ye.path=G.path,ye.path=wt(ye.path)),ye.query=G.query):(ye.path=N.path,G.query!==void 0?ye.query=G.query:ye.query=N.query),ye.userinfo=N.userinfo,ye.host=N.host,ye.port=N.port),ye.scheme=N.scheme),ye.fragment=G.fragment,ye}function nn(N,G,ie){var ue=l({scheme:"null"},ie);return Oe(Xe(oe(N,ue),oe(G,ue),ue,!0),ue)}function L(N,G){return typeof N=="string"?N=Oe(oe(N,G),G):o(N)==="object"&&(N=oe(Oe(N,G),G)),N}function ne(N,G,ie){return typeof N=="string"?N=Oe(oe(N,ie),ie):o(N)==="object"&&(N=Oe(N,ie)),typeof G=="string"?G=Oe(oe(G,ie),ie):o(G)==="object"&&(G=Oe(G,ie)),N===G}function se(N,G){return N&&N.toString().replace(!G||!G.iri?u.ESCAPE:f.ESCAPE,he)}function ge(N,G){return N&&N.toString().replace(!G||!G.iri?u.PCT_ENCODED:f.PCT_ENCODED,Se)}var ke={scheme:"http",domainHost:!0,parse:function(G,ie){return G.host||(G.error=G.error||"HTTP URIs must have a host."),G},serialize:function(G,ie){var ue=String(G.scheme).toLowerCase()==="https";return(G.port===(ue?443:80)||G.port==="")&&(G.port=void 0),G.path||(G.path="/"),G}},Re={scheme:"https",domainHost:ke.domainHost,parse:ke.parse,serialize:ke.serialize};function at(N){return typeof N.secure=="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var rt={scheme:"ws",domainHost:!0,parse:function(G,ie){var ue=G;return ue.secure=at(ue),ue.resourceName=(ue.path||"/")+(ue.query?"?"+ue.query:""),ue.path=void 0,ue.query=void 0,ue},serialize:function(G,ie){if((G.port===(at(G)?443:80)||G.port==="")&&(G.port=void 0),typeof G.secure=="boolean"&&(G.scheme=G.secure?"wss":"ws",G.secure=void 0),G.resourceName){var ue=G.resourceName.split("?"),ye=d(ue,2),it=ye[0],vt=ye[1];G.path=it&&it!=="/"?it:void 0,G.query=vt,G.resourceName=void 0}return G.fragment=void 0,G}},Xt={scheme:"wss",domainHost:rt.domainHost,parse:rt.parse,serialize:rt.serialize},Zt={},Wt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ge="[0-9A-Fa-f]",On=i(i("%[EFef]"+Ge+"%"+Ge+Ge+"%"+Ge+Ge)+"|"+i("%[89A-Fa-f]"+Ge+"%"+Ge+Ge)+"|"+i("%"+Ge+Ge)),zn="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Pt="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Mn=r(Pt,'[\\"\\\\]'),Dn="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",er=new RegExp(Wt,"g"),fn=new RegExp(On,"g"),me=new RegExp(r("[^]",zn,"[\\.]",'[\\"]',Mn),"g"),Be=new RegExp(r("[^]",Wt,Dn),"g"),St=Be;function Lt(N){var G=Se(N);return G.match(er)?G:N}var _t={scheme:"mailto",parse:function(G,ie){var ue=G,ye=ue.to=ue.path?ue.path.split(","):[];if(ue.path=void 0,ue.query){for(var it=!1,vt={},Nt=ue.query.split("&"),bn=0,En=Nt.length;bnnew RegExp(O,A);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function y(O){var A,te,R,k,P,H,J,he,Se,pe,ae,Qe,et,tn,Qt,oe,st,Ht,qe,Dt,He,wt,Oe,Xe,nn;const L=O.strict,ne=(A=O.code)===null||A===void 0?void 0:A.optimize,se=ne===!0||ne===void 0?1:ne||0,ge=(R=(te=O.code)===null||te===void 0?void 0:te.regExp)!==null&&R!==void 0?R:h,ke=(k=O.uriResolver)!==null&&k!==void 0?k:d.default;return{strictSchema:(H=(P=O.strictSchema)!==null&&P!==void 0?P:L)!==null&&H!==void 0?H:!0,strictNumbers:(he=(J=O.strictNumbers)!==null&&J!==void 0?J:L)!==null&&he!==void 0?he:!0,strictTypes:(pe=(Se=O.strictTypes)!==null&&Se!==void 0?Se:L)!==null&&pe!==void 0?pe:"log",strictTuples:(Qe=(ae=O.strictTuples)!==null&&ae!==void 0?ae:L)!==null&&Qe!==void 0?Qe:"log",strictRequired:(tn=(et=O.strictRequired)!==null&&et!==void 0?et:L)!==null&&tn!==void 0?tn:!1,code:O.code?gs(Tr({},O.code),{optimize:se,regExp:ge}):{optimize:se,regExp:ge},loopRequired:(Qt=O.loopRequired)!==null&&Qt!==void 0?Qt:b,loopEnum:(oe=O.loopEnum)!==null&&oe!==void 0?oe:b,meta:(st=O.meta)!==null&&st!==void 0?st:!0,messages:(Ht=O.messages)!==null&&Ht!==void 0?Ht:!0,inlineRefs:(qe=O.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(Dt=O.schemaId)!==null&&Dt!==void 0?Dt:"$id",addUsedSchema:(He=O.addUsedSchema)!==null&&He!==void 0?He:!0,validateSchema:(wt=O.validateSchema)!==null&&wt!==void 0?wt:!0,validateFormats:(Oe=O.validateFormats)!==null&&Oe!==void 0?Oe:!0,unicodeRegExp:(Xe=O.unicodeRegExp)!==null&&Xe!==void 0?Xe:!0,int32range:(nn=O.int32range)!==null&&nn!==void 0?nn:!0,uriResolver:ke}}class x{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts=Tr(Tr({},A),y(A));const{es5:te,lines:R}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:te,lines:R}),this.logger=D(A.logger);const k=A.validateFormats;A.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,v,A,"NOT SUPPORTED"),w.call(this,g,A,"DEPRECATED","warn"),this._metaOpts=I.call(this),A.formats&&_.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&F.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),S.call(this),A.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:te,schemaId:R}=this.opts;let k=f;R==="id"&&(k=Tr({},f),k.id=k.$id,delete k.$id),te&&A&&this.addMetaSchema(k,k[R],!1)}defaultMeta(){const{meta:A,schemaId:te}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[te]||A:void 0}validate(A,te){let R;if(typeof A=="string"){if(R=this.getSchema(A),!R)throw new Error(`no schema with key or ref "${A}"`)}else R=this.compile(A);const k=R(te);return"$async"in R||(this.errors=R.errors),k}compile(A,te){const R=this._addSchema(A,te);return R.validate||this._compileSchemaEnv(R)}compileAsync(A,te){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return k.call(this,A,te);async function k(pe,ae){await P.call(this,pe.$schema);const Qe=this._addSchema(pe,ae);return Qe.validate||H.call(this,Qe)}async function P(pe){pe&&!this.getSchema(pe)&&await k.call(this,{$ref:pe},!0)}async function H(pe){try{return this._compileSchemaEnv(pe)}catch(ae){if(!(ae instanceof i.default))throw ae;return J.call(this,ae),await he.call(this,ae.missingSchema),H.call(this,pe)}}function J({missingSchema:pe,missingRef:ae}){if(this.refs[pe])throw new Error(`AnySchema ${pe} is loaded but ${ae} cannot be resolved`)}async function he(pe){const ae=await Se.call(this,pe);this.refs[pe]||await P.call(this,ae.$schema),this.refs[pe]||this.addSchema(ae,pe,te)}async function Se(pe){const ae=this._loading[pe];if(ae)return ae;try{return await(this._loading[pe]=R(pe))}finally{delete this._loading[pe]}}}addSchema(A,te,R,k=this.opts.validateSchema){if(Array.isArray(A)){for(const H of A)this.addSchema(H,void 0,R,k);return this}let P;if(typeof A=="object"){const{schemaId:H}=this.opts;if(P=A[H],P!==void 0&&typeof P!="string")throw new Error(`schema ${H} must be string`)}return te=(0,l.normalizeId)(te||P),this._checkUnique(te),this.schemas[te]=this._addSchema(A,R,te,k,!0),this}addMetaSchema(A,te,R=this.opts.validateSchema){return this.addSchema(A,te,!0,R),this}validateSchema(A,te){if(typeof A=="boolean")return!0;let R;if(R=A.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(R,A);if(!k&&te){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return k}getSchema(A){let te;for(;typeof(te=$.call(this,A))=="string";)A=te;if(te===void 0){const{schemaId:R}=this.opts,k=new s.SchemaEnv({schema:{},schemaId:R});if(te=s.resolveSchema.call(this,k,A),!te)return;this.refs[A]=te}return te.validate||this._compileSchemaEnv(te)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const te=$.call(this,A);return typeof te=="object"&&this._cache.delete(te.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const te=A;this._cache.delete(te);let R=A[this.opts.schemaId];return R&&(R=(0,l.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const te of A)this.addKeyword(te);return this}addKeyword(A,te){let R;if(typeof A=="string")R=A,typeof te=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),te.keyword=R);else if(typeof A=="object"&&te===void 0){if(te=A,R=te.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(q.call(this,R,te),!te)return(0,u.eachItem)(R,P=>X.call(this,P)),this;Y.call(this,te);const k=gs(Tr({},te),{type:(0,c.getJSONTypes)(te.type),schemaType:(0,c.getJSONTypes)(te.schemaType)});return(0,u.eachItem)(R,k.type.length===0?P=>X.call(this,P,k):P=>k.type.forEach(H=>X.call(this,P,k,H))),this}getKeyword(A){const te=this.RULES.all[A];return typeof te=="object"?te.definition:!!te}removeKeyword(A){const{RULES:te}=this;delete te.keywords[A],delete te.all[A];for(const R of te.rules){const k=R.rules.findIndex(P=>P.keyword===A);k>=0&&R.rules.splice(k,1)}return this}addFormat(A,te){return typeof te=="string"&&(te=new RegExp(te)),this.formats[A]=te,this}errorsText(A=this.errors,{separator:te=", ",dataVar:R="data"}={}){return!A||A.length===0?"No errors":A.map(k=>`${R}${k.instancePath} ${k.message}`).reduce((k,P)=>k+te+P)}$dataMetaSchema(A,te){const R=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const k of te){const P=k.split("/").slice(1);let H=A;for(const J of P)H=H[J];for(const J in R){const he=R[J];if(typeof he!="object")continue;const{$data:Se}=he.definition,pe=H[J];Se&&pe&&(H[J]=B(pe))}}return A}_removeAllSchemas(A,te){for(const R in A){const k=A[R];(!te||te.test(R))&&(typeof k=="string"?delete A[R]:k&&!k.meta&&(this._cache.delete(k.schema),delete A[R]))}}_addSchema(A,te,R,k=this.opts.validateSchema,P=this.opts.addUsedSchema){let H;const{schemaId:J}=this.opts;if(typeof A=="object")H=A[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let he=this._cache.get(A);if(he!==void 0)return he;R=(0,l.normalizeId)(H||R);const Se=l.getSchemaRefs.call(this,A,R);return he=new s.SchemaEnv({schema:A,schemaId:J,meta:te,baseId:R,localRefs:Se}),this._cache.set(he.schema,he),P&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=he),k&&this.validateSchema(A,!0),he}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):s.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const te=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,A)}finally{this.opts=te}}}n.default=x,x.ValidationError=r.default,x.MissingRefError=i.default;function w(O,A,te,R="error"){for(const k in O){const P=k;P in A&&this.logger[R](`${te}: option ${k}. ${O[P]}`)}}function $(O){return O=(0,l.normalizeId)(O),this.schemas[O]||this.refs[O]}function S(){const O=this.opts.schemas;if(!!O)if(Array.isArray(O))this.addSchema(O);else for(const A in O)this.addSchema(O[A],A)}function _(){for(const O in this.opts.formats){const A=this.opts.formats[O];A&&this.addFormat(O,A)}}function F(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in O){const te=O[A];te.keyword||(te.keyword=A),this.addKeyword(te)}}function I(){const O=Tr({},this.opts);for(const A of p)delete O[A];return O}const W={log(){},warn(){},error(){}};function D(O){if(O===!1)return W;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function q(O,A){const{RULES:te}=this;if((0,u.eachItem)(O,R=>{if(te.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!U.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function X(O,A,te){var R;const k=A==null?void 0:A.post;if(te&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let H=k?P.post:P.rules.find(({type:he})=>he===te);if(H||(H={type:te,rules:[]},P.rules.push(H)),P.keywords[O]=!0,!A)return;const J={keyword:O,definition:gs(Tr({},A),{type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)})};A.before?K.call(this,H,J,A.before):H.rules.push(J),P.all[O]=J,(R=A.implements)===null||R===void 0||R.forEach(he=>this.addKeyword(he))}function K(O,A,te){const R=O.rules.findIndex(k=>k.keyword===te);R>=0?O.rules.splice(R,0,A):(O.rules.push(A),this.logger.warn(`rule ${te} is not defined`))}function Y(O){let{metaSchema:A}=O;A!==void 0&&(O.$data&&this.opts.$data&&(A=B(A)),O.validateSchema=this.compile(A,!0))}const T={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function B(O){return{anyOf:[O,T]}}})(rC);var e0={},t0={},n0={};Object.defineProperty(n0,"__esModule",{value:!0});const jB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};n0.default=jB;var Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.callRef=Ca.getValidate=void 0;const $B=Tu,Kb=pn,ci=gn,Ua=qo,Gb=fi,kf=$n,kB={keyword:"$ref",schemaType:"string",code(n){const{gen:e,schema:t,it:r}=n,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:l}=r,{root:c}=o;if((t==="#"||t==="#/")&&i===c.baseId)return f();const u=Gb.resolveRef.call(l,c,i,t);if(u===void 0)throw new $B.default(r.opts.uriResolver,i,t);if(u instanceof Gb.SchemaEnv)return d(u);return h(u);function f(){if(o===c)return td(n,s,o,o.$async);const p=e.scopeValue("root",{ref:c});return td(n,(0,ci._)`${p}.validate`,c,c.$async)}function d(p){const m=EC(n,p);td(n,m,p,p.$async)}function h(p){const m=e.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,ci.stringify)(p)}:{ref:p}),v=e.name("valid"),g=n.subschema({schema:p,dataTypes:[],schemaPath:ci.nil,topSchemaRef:m,errSchemaPath:t},v);n.mergeEvaluated(g),n.ok(v)}}};function EC(n,e){const{gen:t}=n;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,ci._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ca.getValidate=EC;function td(n,e,t,r){const{gen:i,it:o}=n,{allErrors:s,schemaEnv:a,opts:l}=o,c=l.passContext?Ua.default.this:ci.nil;r?u():f();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");const p=i.let("valid");i.try(()=>{i.code((0,ci._)`await ${(0,Kb.callValidateCode)(n,e,c)}`),h(e),s||i.assign(p,!0)},m=>{i.if((0,ci._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),d(m),s||i.assign(p,!1)}),n.ok(p)}function f(){n.result((0,Kb.callValidateCode)(n,e,c),()=>h(e),()=>d(e))}function d(p){const m=(0,ci._)`${p}.errors`;i.assign(Ua.default.vErrors,(0,ci._)`${Ua.default.vErrors} === null ? ${m} : ${Ua.default.vErrors}.concat(${m})`),i.assign(Ua.default.errors,(0,ci._)`${Ua.default.vErrors}.length`)}function h(p){var m;if(!o.opts.unevaluated)return;const v=(m=t==null?void 0:t.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=kf.mergeEvaluated.props(i,v.props,o.props));else{const g=i.var("props",(0,ci._)`${p}.evaluated.props`);o.props=kf.mergeEvaluated.props(i,g,o.props,ci.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=kf.mergeEvaluated.items(i,v.items,o.items));else{const g=i.var("items",(0,ci._)`${p}.evaluated.items`);o.items=kf.mergeEvaluated.items(i,g,o.items,ci.Name)}}}Ca.callRef=td;Ca.default=kB;Object.defineProperty(t0,"__esModule",{value:!0});const SB=n0,CB=Ca,OB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",SB.default,CB.default];t0.default=OB;var r0={},i0={};Object.defineProperty(i0,"__esModule",{value:!0});const Fd=gn,ys=Fd.operators,qd={maximum:{okStr:"<=",ok:ys.LTE,fail:ys.GT},minimum:{okStr:">=",ok:ys.GTE,fail:ys.LT},exclusiveMaximum:{okStr:"<",ok:ys.LT,fail:ys.GTE},exclusiveMinimum:{okStr:">",ok:ys.GT,fail:ys.LTE}},MB={message:({keyword:n,schemaCode:e})=>(0,Fd.str)`must be ${qd[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,Fd._)`{comparison: ${qd[n].okStr}, limit: ${e}}`},EB={keyword:Object.keys(qd),type:"number",schemaType:"number",$data:!0,error:MB,code(n){const{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,Fd._)`${t} ${qd[e].fail} ${r} || isNaN(${t})`)}};i0.default=EB;var o0={};Object.defineProperty(o0,"__esModule",{value:!0});const _c=gn,AB={message:({schemaCode:n})=>(0,_c.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,_c._)`{multipleOf: ${n}}`},TB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:AB,code(n){const{gen:e,data:t,schemaCode:r,it:i}=n,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,_c._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,_c._)`${s} !== parseInt(${s})`;n.fail$data((0,_c._)`(${r} === 0 || (${s} = ${t}/${r}, ${a}))`)}};o0.default=TB;var s0={},a0={};Object.defineProperty(a0,"__esModule",{value:!0});function AC(n){const e=n.length;let t=0,r=0,i;for(;r=55296&&i<=56319&&r(0,sa._)`{limit: ${n}}`},NB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:RB,code(n){const{keyword:e,data:t,schemaCode:r,it:i}=n,o=e==="maxLength"?sa.operators.GT:sa.operators.LT,s=i.opts.unicode===!1?(0,sa._)`${t}.length`:(0,sa._)`${(0,PB.useFunc)(n.gen,_B.default)}(${t})`;n.fail$data((0,sa._)`${s} ${o} ${r}`)}};s0.default=NB;var l0={};Object.defineProperty(l0,"__esModule",{value:!0});const IB=pn,Vd=gn,DB={message:({schemaCode:n})=>(0,Vd.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,Vd._)`{pattern: ${n}}`},LB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:DB,code(n){const{data:e,$data:t,schema:r,schemaCode:i,it:o}=n,s=o.opts.unicodeRegExp?"u":"",a=t?(0,Vd._)`(new RegExp(${i}, ${s}))`:(0,IB.usePattern)(n,r);n.fail$data((0,Vd._)`!${a}.test(${e})`)}};l0.default=LB;var c0={};Object.defineProperty(c0,"__esModule",{value:!0});const Rc=gn,BB={message({keyword:n,schemaCode:e}){const t=n==="maxProperties"?"more":"fewer";return(0,Rc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,Rc._)`{limit: ${n}}`},zB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:BB,code(n){const{keyword:e,data:t,schemaCode:r}=n,i=e==="maxProperties"?Rc.operators.GT:Rc.operators.LT;n.fail$data((0,Rc._)`Object.keys(${t}).length ${i} ${r}`)}};c0.default=zB;var u0={};Object.defineProperty(u0,"__esModule",{value:!0});const dc=pn,Nc=gn,FB=$n,qB={message:({params:{missingProperty:n}})=>(0,Nc.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,Nc._)`{missingProperty: ${n}}`},VB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qB,code(n){const{gen:e,schema:t,schemaCode:r,data:i,$data:o,it:s}=n,{opts:a}=s;if(!o&&t.length===0)return;const l=t.length>=a.loopRequired;if(s.allErrors?c():u(),a.strictRequired){const h=n.parentSchema.properties,{definedProperties:p}=n.it;for(const m of t)if((h==null?void 0:h[m])===void 0&&!p.has(m)){const v=s.schemaEnv.baseId+s.errSchemaPath,g=`required property "${m}" is not defined at "${v}" (strictRequired)`;(0,FB.checkStrictMode)(s,g,s.opts.strictRequired)}}function c(){if(l||o)n.block$data(Nc.nil,f);else for(const h of t)(0,dc.checkReportMissingProp)(n,h)}function u(){const h=e.let("missing");if(l||o){const p=e.let("valid",!0);n.block$data(p,()=>d(h,p)),n.ok(p)}else e.if((0,dc.checkMissingProp)(n,t,h)),(0,dc.reportMissingProp)(n,h),e.else()}function f(){e.forOf("prop",r,h=>{n.setParams({missingProperty:h}),e.if((0,dc.noPropertyInData)(e,i,h,a.ownProperties),()=>n.error())})}function d(h,p){n.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(p,(0,dc.propertyInData)(e,i,h,a.ownProperties)),e.if((0,Nc.not)(p),()=>{n.error(),e.break()})},Nc.nil)}}};u0.default=VB;var f0={};Object.defineProperty(f0,"__esModule",{value:!0});const Ic=gn,HB={message({keyword:n,schemaCode:e}){const t=n==="maxItems"?"more":"fewer";return(0,Ic.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:n})=>(0,Ic._)`{limit: ${n}}`},UB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:HB,code(n){const{keyword:e,data:t,schemaCode:r}=n,i=e==="maxItems"?Ic.operators.GT:Ic.operators.LT;n.fail$data((0,Ic._)`${t}.length ${i} ${r}`)}};f0.default=UB;var d0={},Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});const TC=fC;TC.code='require("ajv/dist/runtime/equal").default';Pu.default=TC;Object.defineProperty(d0,"__esModule",{value:!0});const Fp=Eu,Pr=gn,WB=$n,JB=Pu,KB={message:({params:{i:n,j:e}})=>(0,Pr.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,Pr._)`{i: ${n}, j: ${e}}`},GB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:KB,code(n){const{gen:e,data:t,$data:r,schema:i,parentSchema:o,schemaCode:s,it:a}=n;if(!r&&!i)return;const l=e.let("valid"),c=o.items?(0,Fp.getSchemaTypes)(o.items):[];n.block$data(l,u,(0,Pr._)`${s} === false`),n.ok(l);function u(){const p=e.let("i",(0,Pr._)`${t}.length`),m=e.let("j");n.setParams({i:p,j:m}),e.assign(l,!0),e.if((0,Pr._)`${p} > 1`,()=>(f()?d:h)(p,m))}function f(){return c.length>0&&!c.some(p=>p==="object"||p==="array")}function d(p,m){const v=e.name("item"),g=(0,Fp.checkDataTypes)(c,v,a.opts.strictNumbers,Fp.DataType.Wrong),b=e.const("indices",(0,Pr._)`{}`);e.for((0,Pr._)`;${p}--;`,()=>{e.let(v,(0,Pr._)`${t}[${p}]`),e.if(g,(0,Pr._)`continue`),c.length>1&&e.if((0,Pr._)`typeof ${v} == "string"`,(0,Pr._)`${v} += "_"`),e.if((0,Pr._)`typeof ${b}[${v}] == "number"`,()=>{e.assign(m,(0,Pr._)`${b}[${v}]`),n.error(),e.assign(l,!1).break()}).code((0,Pr._)`${b}[${v}] = ${p}`)})}function h(p,m){const v=(0,WB.useFunc)(e,JB.default),g=e.name("outer");e.label(g).for((0,Pr._)`;${p}--;`,()=>e.for((0,Pr._)`${m} = ${p}; ${m}--;`,()=>e.if((0,Pr._)`${v}(${t}[${p}], ${t}[${m}])`,()=>{n.error(),e.assign(l,!1).break(g)})))}}};d0.default=GB;var h0={};Object.defineProperty(h0,"__esModule",{value:!0});const yg=gn,QB=$n,YB=Pu,XB={message:"must be equal to constant",params:({schemaCode:n})=>(0,yg._)`{allowedValue: ${n}}`},ZB={keyword:"const",$data:!0,error:XB,code(n){const{gen:e,data:t,$data:r,schemaCode:i,schema:o}=n;r||o&&typeof o=="object"?n.fail$data((0,yg._)`!${(0,QB.useFunc)(e,YB.default)}(${t}, ${i})`):n.fail((0,yg._)`${o} !== ${t}`)}};h0.default=ZB;var p0={};Object.defineProperty(p0,"__esModule",{value:!0});const wc=gn,ez=$n,tz=Pu,nz={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,wc._)`{allowedValues: ${n}}`},rz={keyword:"enum",schemaType:"array",$data:!0,error:nz,code(n){const{gen:e,data:t,$data:r,schema:i,schemaCode:o,it:s}=n;if(!r&&i.length===0)throw new Error("enum must have non-empty array");const a=i.length>=s.opts.loopEnum;let l;const c=()=>l!=null?l:l=(0,ez.useFunc)(e,tz.default);let u;if(a||r)u=e.let("valid"),n.block$data(u,f);else{if(!Array.isArray(i))throw new Error("ajv implementation error");const h=e.const("vSchema",o);u=(0,wc.or)(...i.map((p,m)=>d(h,m)))}n.pass(u);function f(){e.assign(u,!1),e.forOf("v",o,h=>e.if((0,wc._)`${c()}(${t}, ${h})`,()=>e.assign(u,!0).break()))}function d(h,p){const m=i[p];return typeof m=="object"&&m!==null?(0,wc._)`${c()}(${t}, ${h}[${p}])`:(0,wc._)`${t} === ${m}`}}};p0.default=rz;Object.defineProperty(r0,"__esModule",{value:!0});const iz=i0,oz=o0,sz=s0,az=l0,lz=c0,cz=u0,uz=f0,fz=d0,dz=h0,hz=p0,pz=[iz.default,oz.default,sz.default,az.default,lz.default,cz.default,uz.default,fz.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},dz.default,hz.default];r0.default=pz;var m0={},Wl={};Object.defineProperty(Wl,"__esModule",{value:!0});Wl.validateAdditionalItems=void 0;const aa=gn,bg=$n,mz={message:({params:{len:n}})=>(0,aa.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,aa._)`{limit: ${n}}`},gz={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:mz,code(n){const{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,bg.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}PC(n,r)}};function PC(n,e){const{gen:t,schema:r,data:i,keyword:o,it:s}=n;s.items=!0;const a=t.const("len",(0,aa._)`${i}.length`);if(r===!1)n.setParams({len:e.length}),n.pass((0,aa._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,bg.alwaysValidSchema)(s,r)){const c=t.var("valid",(0,aa._)`${a} <= ${e.length}`);t.if((0,aa.not)(c),()=>l(c)),n.ok(c)}function l(c){t.forRange("i",e.length,a,u=>{n.subschema({keyword:o,dataProp:u,dataPropType:bg.Type.Num},c),s.allErrors||t.if((0,aa.not)(c),()=>t.break())})}}Wl.validateAdditionalItems=PC;Wl.default=gz;var g0={},Jl={};Object.defineProperty(Jl,"__esModule",{value:!0});Jl.validateTuple=void 0;const Qb=gn,nd=$n,vz=pn,yz={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:e,it:t}=n;if(Array.isArray(e))return _C(n,"additionalItems",e);t.items=!0,!(0,nd.alwaysValidSchema)(t,e)&&n.ok((0,vz.validateArray)(n))}};function _C(n,e,t=n.schema){const{gen:r,parentSchema:i,data:o,keyword:s,it:a}=n;u(i),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=nd.mergeEvaluated.items(r,t.length,a.items));const l=r.name("valid"),c=r.const("len",(0,Qb._)`${o}.length`);t.forEach((f,d)=>{(0,nd.alwaysValidSchema)(a,f)||(r.if((0,Qb._)`${c} > ${d}`,()=>n.subschema({keyword:s,schemaProp:d,dataProp:d},l)),n.ok(l))});function u(f){const{opts:d,errSchemaPath:h}=a,p=t.length,m=p===f.minItems&&(p===f.maxItems||f[e]===!1);if(d.strictTuples&&!m){const v=`"${s}" is ${p}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,nd.checkStrictMode)(a,v,d.strictTuples)}}}Jl.validateTuple=_C;Jl.default=yz;Object.defineProperty(g0,"__esModule",{value:!0});const bz=Jl,wz={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,bz.validateTuple)(n,"items")};g0.default=wz;var v0={};Object.defineProperty(v0,"__esModule",{value:!0});const Yb=gn,xz=$n,jz=pn,$z=Wl,kz={message:({params:{len:n}})=>(0,Yb.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,Yb._)`{limit: ${n}}`},Sz={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:kz,code(n){const{schema:e,parentSchema:t,it:r}=n,{prefixItems:i}=t;r.items=!0,!(0,xz.alwaysValidSchema)(r,e)&&(i?(0,$z.validateAdditionalItems)(n,i):n.ok((0,jz.validateArray)(n)))}};v0.default=Sz;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});const Ai=gn,Sf=$n,Cz={message:({params:{min:n,max:e}})=>e===void 0?(0,Ai.str)`must contain at least ${n} valid item(s)`:(0,Ai.str)`must contain at least ${n} and no more than ${e} valid item(s)`,params:({params:{min:n,max:e}})=>e===void 0?(0,Ai._)`{minContains: ${n}}`:(0,Ai._)`{minContains: ${n}, maxContains: ${e}}`},Oz={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Cz,code(n){const{gen:e,schema:t,parentSchema:r,data:i,it:o}=n;let s,a;const{minContains:l,maxContains:c}=r;o.opts.next?(s=l===void 0?1:l,a=c):s=1;const u=e.const("len",(0,Ai._)`${i}.length`);if(n.setParams({min:s,max:a}),a===void 0&&s===0){(0,Sf.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Sf.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,Sf.alwaysValidSchema)(o,t)){let m=(0,Ai._)`${u} >= ${s}`;a!==void 0&&(m=(0,Ai._)`${m} && ${u} <= ${a}`),n.pass(m);return}o.items=!0;const f=e.name("valid");a===void 0&&s===1?h(f,()=>e.if(f,()=>e.break())):s===0?(e.let(f,!0),a!==void 0&&e.if((0,Ai._)`${i}.length > 0`,d)):(e.let(f,!1),d()),n.result(f,()=>n.reset());function d(){const m=e.name("_valid"),v=e.let("count",0);h(m,()=>e.if(m,()=>p(v)))}function h(m,v){e.forRange("i",0,u,g=>{n.subschema({keyword:"contains",dataProp:g,dataPropType:Sf.Type.Num,compositeRule:!0},m),v()})}function p(m){e.code((0,Ai._)`${m}++`),a===void 0?e.if((0,Ai._)`${m} >= ${s}`,()=>e.assign(f,!0).break()):(e.if((0,Ai._)`${m} > ${a}`,()=>e.assign(f,!1).break()),s===1?e.assign(f,!0):e.if((0,Ai._)`${m} >= ${s}`,()=>e.assign(f,!0)))}}};y0.default=Oz;var RC={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.validateSchemaDeps=n.validatePropertyDeps=n.error=void 0;const e=gn,t=$n,r=pn;n.error={message:({params:{property:l,depsCount:c,deps:u}})=>{const f=c===1?"property":"properties";return(0,e.str)`must have ${f} ${u} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:u,missingProperty:f}})=>(0,e._)`{property: ${l}, + || ${F} === "boolean" || ${S} === null`).assign(I,(0,i._)`[${S}]`)}}}function h({gen:y,parentData:j,parentDataProperty:w},$){y.if((0,i._)`${j} !== undefined`,()=>y.assign((0,i._)`${j}[${w}]`,$))}function p(y,j,w,$=s.Correct){const S=$===s.Correct?i.operators.EQ:i.operators.NEQ;let _;switch(y){case"null":return(0,i._)`${j} ${S} null`;case"array":_=(0,i._)`Array.isArray(${j})`;break;case"object":_=(0,i._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":_=F((0,i._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":_=F();break;default:return(0,i._)`typeof ${j} ${S} ${y}`}return $===s.Correct?_:(0,i.not)(_);function F(I=i.nil){return(0,i.and)((0,i._)`typeof ${j} == "number"`,I,w?(0,i._)`isFinite(${j})`:i.nil)}}n.checkDataType=p;function m(y,j,w,$){if(y.length===1)return p(y[0],j,w,$);let S;const _=(0,o.toHash)(y);if(_.array&&_.object){const F=(0,i._)`typeof ${j} != "object"`;S=_.null?F:(0,i._)`!${j} || ${F}`,delete _.null,delete _.array,delete _.object}else S=i.nil;_.number&&delete _.integer;for(const F in _)S=(0,i.and)(S,p(F,j,w,$));return S}n.checkDataTypes=m;const v={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:j})=>typeof y=="string"?(0,i._)`{type: ${y}}`:(0,i._)`{type: ${j}}`};function g(y){const j=b(y);(0,r.reportError)(j,v)}n.reportTypeError=g;function b(y){const{gen:j,data:w,schema:$}=y,S=(0,o.schemaRefOrVal)(y,$,"type");return{gen:j,keyword:"type",data:w,schema:$.type,schemaCode:S,schemaValue:S,parentSchema:$,params:{},it:y}}})(Eu);var zh={};Object.defineProperty(zh,"__esModule",{value:!0});zh.assignDefaults=void 0;const Ha=gn,nL=$n;function rL(n,e){const{properties:t,items:r}=n.schema;if(e==="object"&&t)for(const i in t)qb(n,i,t[i].default);else e==="array"&&Array.isArray(r)&&r.forEach((i,o)=>qb(n,o,i.default))}zh.assignDefaults=rL;function qb(n,e,t){const{gen:r,compositeRule:i,data:o,opts:s}=n;if(t===void 0)return;const a=(0,Ha._)`${o}${(0,Ha.getProperty)(e)}`;if(i){(0,nL.checkStrictMode)(n,`default is ignored for: ${a}`);return}let l=(0,Ha._)`${a} === undefined`;s.useDefaults==="empty"&&(l=(0,Ha._)`${l} || ${a} === null || ${a} === ""`),r.if(l,(0,Ha._)`${a} = ${(0,Ha.stringify)(t)}`)}var Mo={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.validateUnion=pn.validateArray=pn.usePattern=pn.callValidateCode=pn.schemaProperties=pn.allSchemaProperties=pn.noPropertyInData=pn.propertyInData=pn.isOwnProperty=pn.hasPropFunc=pn.reportMissingProp=pn.checkMissingProp=pn.checkReportMissingProp=void 0;const Jn=gn,Kv=$n,vs=qo,iL=$n;function oL(n,e){const{gen:t,data:r,it:i}=n;t.if(Qv(t,r,e,i.opts.ownProperties),()=>{n.setParams({missingProperty:(0,Jn._)`${e}`},!0),n.error()})}pn.checkReportMissingProp=oL;function sL({gen:n,data:e,it:{opts:t}},r,i){return(0,Jn.or)(...r.map(o=>(0,Jn.and)(Qv(n,e,o,t.ownProperties),(0,Jn._)`${i} = ${o}`)))}pn.checkMissingProp=sL;function aL(n,e){n.setParams({missingProperty:e},!0),n.error()}pn.reportMissingProp=aL;function aC(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Jn._)`Object.prototype.hasOwnProperty`})}pn.hasPropFunc=aC;function Gv(n,e,t){return(0,Jn._)`${aC(n)}.call(${e}, ${t})`}pn.isOwnProperty=Gv;function lL(n,e,t,r){const i=(0,Jn._)`${e}${(0,Jn.getProperty)(t)} !== undefined`;return r?(0,Jn._)`${i} && ${Gv(n,e,t)}`:i}pn.propertyInData=lL;function Qv(n,e,t,r){const i=(0,Jn._)`${e}${(0,Jn.getProperty)(t)} === undefined`;return r?(0,Jn.or)(i,(0,Jn.not)(Gv(n,e,t))):i}pn.noPropertyInData=Qv;function lC(n){return n?Object.keys(n).filter(e=>e!=="__proto__"):[]}pn.allSchemaProperties=lC;function cL(n,e){return lC(e).filter(t=>!(0,Kv.alwaysValidSchema)(n,e[t]))}pn.schemaProperties=cL;function uL({schemaCode:n,data:e,it:{gen:t,topSchemaRef:r,schemaPath:i,errorPath:o},it:s},a,l,c){const u=c?(0,Jn._)`${n}, ${e}, ${r}${i}`:e,f=[[vs.default.instancePath,(0,Jn.strConcat)(vs.default.instancePath,o)],[vs.default.parentData,s.parentData],[vs.default.parentDataProperty,s.parentDataProperty],[vs.default.rootData,vs.default.rootData]];s.opts.dynamicRef&&f.push([vs.default.dynamicAnchors,vs.default.dynamicAnchors]);const d=(0,Jn._)`${u}, ${t.object(...f)}`;return l!==Jn.nil?(0,Jn._)`${a}.call(${l}, ${d})`:(0,Jn._)`${a}(${d})`}pn.callValidateCode=uL;const fL=(0,Jn._)`new RegExp`;function dL({gen:n,it:{opts:e}},t){const r=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(t,r);return n.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Jn._)`${i.code==="new RegExp"?fL:(0,iL.useFunc)(n,i)}(${t}, ${r})`})}pn.usePattern=dL;function hL(n){const{gen:e,data:t,keyword:r,it:i}=n,o=e.name("valid");if(i.allErrors){const a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){const l=e.const("len",(0,Jn._)`${t}.length`);e.forRange("i",0,l,c=>{n.subschema({keyword:r,dataProp:c,dataPropType:Kv.Type.Num},o),e.if((0,Jn.not)(o),a)})}}pn.validateArray=hL;function pL(n){const{gen:e,schema:t,keyword:r,it:i}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(l=>(0,Kv.alwaysValidSchema)(i,l))&&!i.opts.unevaluated)return;const s=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((l,c)=>{const u=n.subschema({keyword:r,schemaProp:c,compositeRule:!0},a);e.assign(s,(0,Jn._)`${s} || ${a}`),n.mergeValidEvaluated(u,a)||e.if((0,Jn.not)(s))})),n.result(s,()=>n.reset(),()=>n.error(!0))}pn.validateUnion=pL;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.validateKeywordUsage=Mo.validSchemaType=Mo.funcKeywordCode=Mo.macroKeywordCode=void 0;const ti=gn,oa=qo,mL=pn,gL=Mu;function vL(n,e){const{gen:t,keyword:r,schema:i,parentSchema:o,it:s}=n,a=e.macro.call(s.self,i,o,s),l=cC(t,r,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);const c=t.name("valid");n.subschema({schema:a,schemaPath:ti.nil,errSchemaPath:`${s.errSchemaPath}/${r}`,topSchemaRef:l,compositeRule:!0},c),n.pass(c,()=>n.error(!0))}Mo.macroKeywordCode=vL;function yL(n,e){var t;const{gen:r,keyword:i,schema:o,parentSchema:s,$data:a,it:l}=n;wL(l,e);const c=!a&&e.compile?e.compile.call(l.self,o,s,l):e.validate,u=cC(r,i,c),f=r.let("valid");n.block$data(f,d),n.ok((t=e.valid)!==null&&t!==void 0?t:f);function d(){if(e.errors===!1)m(),e.modifying&&Vb(n),v(()=>n.error());else{const g=e.async?h():p();e.modifying&&Vb(n),v(()=>bL(n,g))}}function h(){const g=r.let("ruleErrs",null);return r.try(()=>m((0,ti._)`await `),b=>r.assign(f,!1).if((0,ti._)`${b} instanceof ${l.ValidationError}`,()=>r.assign(g,(0,ti._)`${b}.errors`),()=>r.throw(b))),g}function p(){const g=(0,ti._)`${u}.errors`;return r.assign(g,null),m(ti.nil),g}function m(g=e.async?(0,ti._)`await `:ti.nil){const b=l.opts.passContext?oa.default.this:oa.default.self,y=!("compile"in e&&!a||e.schema===!1);r.assign(f,(0,ti._)`${g}${(0,mL.callValidateCode)(n,u,b,y)}`,e.modifying)}function v(g){var b;r.if((0,ti.not)((b=e.valid)!==null&&b!==void 0?b:f),g)}}Mo.funcKeywordCode=yL;function Vb(n){const{gen:e,data:t,it:r}=n;e.if(r.parentData,()=>e.assign(t,(0,ti._)`${r.parentData}[${r.parentDataProperty}]`))}function bL(n,e){const{gen:t}=n;t.if((0,ti._)`Array.isArray(${e})`,()=>{t.assign(oa.default.vErrors,(0,ti._)`${oa.default.vErrors} === null ? ${e} : ${oa.default.vErrors}.concat(${e})`).assign(oa.default.errors,(0,ti._)`${oa.default.vErrors}.length`),(0,gL.extendErrors)(n)},()=>n.error())}function wL({schemaEnv:n},e){if(e.async&&!n.$async)throw new Error("async keyword in sync schema")}function cC(n,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return n.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,ti.stringify)(t)})}function jL(n,e,t=!1){return!e.length||e.some(r=>r==="array"?Array.isArray(n):r==="object"?n&&typeof n=="object"&&!Array.isArray(n):typeof n==r||t&&typeof n=="undefined")}Mo.validSchemaType=jL;function xL({schema:n,opts:e,self:t,errSchemaPath:r},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(s!=null&&s.some(a=>!Object.prototype.hasOwnProperty.call(n,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(n[o])){const l=`keyword "${o}" value is invalid at path "${r}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(l);else throw new Error(l)}}Mo.validateKeywordUsage=xL;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.extendSubschemaMode=_s.extendSubschemaData=_s.getSubschema=void 0;const ko=gn,uC=$n;function $L(n,{keyword:e,schemaProp:t,schema:r,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&r!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const a=n.schema[e];return t===void 0?{schema:a,schemaPath:(0,ko._)`${n.schemaPath}${(0,ko.getProperty)(e)}`,errSchemaPath:`${n.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,ko._)`${n.schemaPath}${(0,ko.getProperty)(e)}${(0,ko.getProperty)(t)}`,errSchemaPath:`${n.errSchemaPath}/${e}/${(0,uC.escapeFragment)(t)}`}}if(r!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}_s.getSubschema=$L;function kL(n,e,{dataProp:t,dataPropType:r,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=e;if(t!==void 0){const{errorPath:c,dataPathArr:u,opts:f}=e,d=a.let("data",(0,ko._)`${e.data}${(0,ko.getProperty)(t)}`,!0);l(d),n.errorPath=(0,ko.str)`${c}${(0,uC.getErrorPath)(t,r,f.jsPropertySyntax)}`,n.parentDataProperty=(0,ko._)`${t}`,n.dataPathArr=[...u,n.parentDataProperty]}if(i!==void 0){const c=i instanceof ko.Name?i:a.let("data",i,!0);l(c),s!==void 0&&(n.propertyName=s)}o&&(n.dataTypes=o);function l(c){n.data=c,n.dataLevel=e.dataLevel+1,n.dataTypes=[],e.definedProperties=new Set,n.parentData=e.data,n.dataNames=[...e.dataNames,c]}}_s.extendSubschemaData=kL;function SL(n,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:r,createErrors:i,allErrors:o}){r!==void 0&&(n.compositeRule=r),i!==void 0&&(n.createErrors=i),o!==void 0&&(n.allErrors=o),n.jtdDiscriminator=e,n.jtdMetadata=t}_s.extendSubschemaMode=SL;var Ir={},fC=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(i=r;i--!==0;)if(!n(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!n(e[s],t[s]))return!1}return!0}return e!==e&&t!==t},dC={exports:{}},Ms=dC.exports=function(n,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var r=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};ed(e,r,i,n,"",n)};Ms.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ms.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ms.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ms.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ed(n,e,t,r,i,o,s,a,l,c){if(r&&typeof r=="object"&&!Array.isArray(r)){e(r,i,o,s,a,l,c);for(var u in r){var f=r[u];if(Array.isArray(f)){if(u in Ms.arrayKeywords)for(var d=0;de+=hC(r)),e===1/0))return 1/0}return e}function pC(n,e="",t){t!==!1&&(e=yl(e));const r=n.parse(e);return mC(n,r)}Ir.getFullPath=pC;function mC(n,e){return n.serialize(e).split("#")[0]+"#"}Ir._getFullPath=mC;const _L=/#\/?$/;function yl(n){return n?n.replace(_L,""):""}Ir.normalizeId=yl;function RL(n,e,t){return t=yl(t),n.resolve(e,t)}Ir.resolveUrl=RL;const NL=/^[a-z_][-a-z0-9._]*$/i;function IL(n,e){if(typeof n=="boolean")return{};const{schemaId:t,uriResolver:r}=this.opts,i=yl(n[t]||e),o={"":i},s=pC(r,i,!1),a={},l=new Set;return EL(n,{allKeys:!0},(f,d,h,p)=>{if(p===void 0)return;const m=s+d;let v=o[p];typeof f[t]=="string"&&(v=g.call(this,f[t])),b.call(this,f.$anchor),b.call(this,f.$dynamicAnchor),o[d]=v;function g(y){const j=this.opts.uriResolver.resolve;if(y=yl(v?j(v,y):y),l.has(y))throw u(y);l.add(y);let w=this.refs[y];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?c(f,w.schema,y):y!==yl(m)&&(y[0]==="#"?(c(f,a[y],y),a[y]=f):this.refs[y]=m),y}function b(y){if(typeof y=="string"){if(!NL.test(y))throw new Error(`invalid anchor "${y}"`);g.call(this,`#${y}`)}}}),a;function c(f,d,h){if(d!==void 0&&!ML(f,d))throw u(h)}function u(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Ir.getSchemaRefs=IL;Object.defineProperty(io,"__esModule",{value:!0});io.getData=io.KeywordCxt=io.validateFunctionCode=void 0;const gC=Pl,Hb=Eu,Yv=Yo,zd=Eu,DL=zh,Pc=Mo,Lp=_s,xt=gn,qt=qo,LL=Ir,Xo=$n,fc=Mu;function BL(n){if(bC(n)&&(wC(n),yC(n))){qL(n);return}vC(n,()=>(0,gC.topBoolOrEmptySchema)(n))}io.validateFunctionCode=BL;function vC({gen:n,validateName:e,schema:t,schemaEnv:r,opts:i},o){i.code.es5?n.func(e,(0,xt._)`${qt.default.data}, ${qt.default.valCxt}`,r.$async,()=>{n.code((0,xt._)`"use strict"; ${Ub(t,i)}`),FL(n,i),n.code(o)}):n.func(e,(0,xt._)`${qt.default.data}, ${zL(i)}`,r.$async,()=>n.code(Ub(t,i)).code(o))}function zL(n){return(0,xt._)`{${qt.default.instancePath}="", ${qt.default.parentData}, ${qt.default.parentDataProperty}, ${qt.default.rootData}=${qt.default.data}${n.dynamicRef?(0,xt._)`, ${qt.default.dynamicAnchors}={}`:xt.nil}}={}`}function FL(n,e){n.if(qt.default.valCxt,()=>{n.var(qt.default.instancePath,(0,xt._)`${qt.default.valCxt}.${qt.default.instancePath}`),n.var(qt.default.parentData,(0,xt._)`${qt.default.valCxt}.${qt.default.parentData}`),n.var(qt.default.parentDataProperty,(0,xt._)`${qt.default.valCxt}.${qt.default.parentDataProperty}`),n.var(qt.default.rootData,(0,xt._)`${qt.default.valCxt}.${qt.default.rootData}`),e.dynamicRef&&n.var(qt.default.dynamicAnchors,(0,xt._)`${qt.default.valCxt}.${qt.default.dynamicAnchors}`)},()=>{n.var(qt.default.instancePath,(0,xt._)`""`),n.var(qt.default.parentData,(0,xt._)`undefined`),n.var(qt.default.parentDataProperty,(0,xt._)`undefined`),n.var(qt.default.rootData,qt.default.data),e.dynamicRef&&n.var(qt.default.dynamicAnchors,(0,xt._)`{}`)})}function qL(n){const{schema:e,opts:t,gen:r}=n;vC(n,()=>{t.$comment&&e.$comment&&xC(n),JL(n),r.let(qt.default.vErrors,null),r.let(qt.default.errors,0),t.unevaluated&&VL(n),jC(n),QL(n)})}function VL(n){const{gen:e,validateName:t}=n;n.evaluated=e.const("evaluated",(0,xt._)`${t}.evaluated`),e.if((0,xt._)`${n.evaluated}.dynamicProps`,()=>e.assign((0,xt._)`${n.evaluated}.props`,(0,xt._)`undefined`)),e.if((0,xt._)`${n.evaluated}.dynamicItems`,()=>e.assign((0,xt._)`${n.evaluated}.items`,(0,xt._)`undefined`))}function Ub(n,e){const t=typeof n=="object"&&n[e.schemaId];return t&&(e.code.source||e.code.process)?(0,xt._)`/*# sourceURL=${t} */`:xt.nil}function HL(n,e){if(bC(n)&&(wC(n),yC(n))){UL(n,e);return}(0,gC.boolOrEmptySchema)(n,e)}function yC({schema:n,self:e}){if(typeof n=="boolean")return!n;for(const t in n)if(e.RULES.all[t])return!0;return!1}function bC(n){return typeof n.schema!="boolean"}function UL(n,e){const{schema:t,gen:r,opts:i}=n;i.$comment&&t.$comment&&xC(n),KL(n),GL(n);const o=r.const("_errs",qt.default.errors);jC(n,o),r.var(e,(0,xt._)`${o} === ${qt.default.errors}`)}function wC(n){(0,Xo.checkUnknownRules)(n),WL(n)}function jC(n,e){if(n.opts.jtd)return Wb(n,[],!1,e);const t=(0,Hb.getSchemaTypes)(n.schema),r=(0,Hb.coerceAndCheckDataType)(n,t);Wb(n,t,!r,e)}function WL(n){const{schema:e,errSchemaPath:t,opts:r,self:i}=n;e.$ref&&r.ignoreKeywordsWithRef&&(0,Xo.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function JL(n){const{schema:e,opts:t}=n;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Xo.checkStrictMode)(n,"default is ignored in the schema root")}function KL(n){const e=n.schema[n.opts.schemaId];e&&(n.baseId=(0,LL.resolveUrl)(n.opts.uriResolver,n.baseId,e))}function GL(n){if(n.schema.$async&&!n.schemaEnv.$async)throw new Error("async schema in sync schema")}function xC({gen:n,schemaEnv:e,schema:t,errSchemaPath:r,opts:i}){const o=t.$comment;if(i.$comment===!0)n.code((0,xt._)`${qt.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){const s=(0,xt.str)`${r}/$comment`,a=n.scopeValue("root",{ref:e.root});n.code((0,xt._)`${qt.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function QL(n){const{gen:e,schemaEnv:t,validateName:r,ValidationError:i,opts:o}=n;t.$async?e.if((0,xt._)`${qt.default.errors} === 0`,()=>e.return(qt.default.data),()=>e.throw((0,xt._)`new ${i}(${qt.default.vErrors})`)):(e.assign((0,xt._)`${r}.errors`,qt.default.vErrors),o.unevaluated&&YL(n),e.return((0,xt._)`${qt.default.errors} === 0`))}function YL({gen:n,evaluated:e,props:t,items:r}){t instanceof xt.Name&&n.assign((0,xt._)`${e}.props`,t),r instanceof xt.Name&&n.assign((0,xt._)`${e}.items`,r)}function Wb(n,e,t,r){const{gen:i,schema:o,data:s,allErrors:a,opts:l,self:c}=n,{RULES:u}=c;if(o.$ref&&(l.ignoreKeywordsWithRef||!(0,Xo.schemaHasRulesButRef)(o,u))){i.block(()=>SC(n,"$ref",u.all.$ref.definition));return}l.jtd||XL(n,e),i.block(()=>{for(const d of u.rules)f(d);f(u.post)});function f(d){!(0,Yv.shouldUseGroup)(o,d)||(d.type?(i.if((0,zd.checkDataType)(d.type,s,l.strictNumbers)),Jb(n,d),e.length===1&&e[0]===d.type&&t&&(i.else(),(0,zd.reportTypeError)(n)),i.endIf()):Jb(n,d),a||i.if((0,xt._)`${qt.default.errors} === ${r||0}`))}}function Jb(n,e){const{gen:t,schema:r,opts:{useDefaults:i}}=n;i&&(0,DL.assignDefaults)(n,e.type),t.block(()=>{for(const o of e.rules)(0,Yv.shouldUseRule)(r,o)&&SC(n,o.keyword,o.definition,e.type)})}function XL(n,e){n.schemaEnv.meta||!n.opts.strictTypes||(ZL(n,e),n.opts.allowUnionTypes||eB(n,e),tB(n,n.dataTypes))}function ZL(n,e){if(!!e.length){if(!n.dataTypes.length){n.dataTypes=e;return}e.forEach(t=>{$C(n.dataTypes,t)||Xv(n,`type "${t}" not allowed by context "${n.dataTypes.join(",")}"`)}),rB(n,e)}}function eB(n,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Xv(n,"use allowUnionTypes to allow union type keyword")}function tB(n,e){const t=n.self.RULES.all;for(const r in t){const i=t[r];if(typeof i=="object"&&(0,Yv.shouldUseRule)(n.schema,i)){const{type:o}=i.definition;o.length&&!o.some(s=>nB(e,s))&&Xv(n,`missing type "${o.join(",")}" for keyword "${r}"`)}}}function nB(n,e){return n.includes(e)||e==="number"&&n.includes("integer")}function $C(n,e){return n.includes(e)||e==="integer"&&n.includes("number")}function rB(n,e){const t=[];for(const r of n.dataTypes)$C(e,r)?t.push(r):e.includes("integer")&&r==="number"&&t.push("integer");n.dataTypes=t}function Xv(n,e){e+=` at "${n.schemaEnv.baseId+n.errSchemaPath}" (strictTypes)`,(0,Xo.checkStrictMode)(n,e,n.opts.strictTypes)}class kC{constructor(e,t,r){if((0,Pc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Xo.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",CC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Pc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",qt.default.errors))}result(e,t,r){this.failResult((0,xt.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,xt.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail((0,xt._)`${t} !== undefined && (${(0,xt.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?fc.reportExtraError:fc.reportError)(this,this.def.error,t)}$dataError(){(0,fc.reportError)(this,this.def.$dataError||fc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,fc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=xt.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=xt.nil,t=xt.nil){if(!this.$data)return;const{gen:r,schemaCode:i,schemaType:o,def:s}=this;r.if((0,xt.or)((0,xt._)`${i} === undefined`,t)),e!==xt.nil&&r.assign(e,!0),(o.length||s.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==xt.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:i,it:o}=this;return(0,xt.or)(s(),a());function s(){if(r.length){if(!(t instanceof xt.Name))throw new Error("ajv implementation error");const l=Array.isArray(r)?r:[r];return(0,xt._)`${(0,zd.checkDataTypes)(l,t,o.opts.strictNumbers,zd.DataType.Wrong)}`}return xt.nil}function a(){if(i.validateSchema){const l=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,xt._)`!${l}(${t})`}return xt.nil}}subschema(e,t){const r=(0,Lp.getSubschema)(this.it,e);(0,Lp.extendSubschemaData)(r,this.it,e),(0,Lp.extendSubschemaMode)(r,e);const i=gs(Tr(Tr({},this.it),r),{items:void 0,props:void 0});return HL(i,t),i}mergeEvaluated(e,t){const{it:r,gen:i}=this;!r.opts.unevaluated||(r.props!==!0&&e.props!==void 0&&(r.props=Xo.mergeEvaluated.props(i,e.props,r.props,t)),r.items!==!0&&e.items!==void 0&&(r.items=Xo.mergeEvaluated.items(i,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,xt.Name)),!0}}io.KeywordCxt=kC;function SC(n,e,t,r){const i=new kC(n,t,e);"code"in t?t.code(i,r):i.$data&&t.validate?(0,Pc.funcKeywordCode)(i,t):"macro"in t?(0,Pc.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,Pc.funcKeywordCode)(i,t)}const iB=/^\/(?:[^~]|~0|~1)*$/,oB=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function CC(n,{dataLevel:e,dataNames:t,dataPathArr:r}){let i,o;if(n==="")return qt.default.rootData;if(n[0]==="/"){if(!iB.test(n))throw new Error(`Invalid JSON-pointer: ${n}`);i=n,o=qt.default.rootData}else{const c=oB.exec(n);if(!c)throw new Error(`Invalid JSON-pointer: ${n}`);const u=+c[1];if(i=c[2],i==="#"){if(u>=e)throw new Error(l("property/index",u));return r[e-u]}if(u>e)throw new Error(l("data",u));if(o=t[e-u],!i)return o}let s=o;const a=i.split("/");for(const c of a)c&&(o=(0,xt._)`${o}${(0,xt.getProperty)((0,Xo.unescapeJsonPointer)(c))}`,s=(0,xt._)`${s} && ${o}`);return s;function l(c,u){return`Cannot access ${c} ${u} levels up, current level is ${e}`}}io.getData=CC;var Au={};Object.defineProperty(Au,"__esModule",{value:!0});class sB extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Au.default=sB;var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0});const Bp=Ir;class aB extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Bp.resolveUrl)(e,t,r),this.missingSchema=(0,Bp.normalizeId)((0,Bp.getFullPath)(e,this.missingRef))}}Tu.default=aB;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.resolveSchema=fi.getCompilingSchema=fi.resolveRef=fi.compileSchema=fi.SchemaEnv=void 0;const Qi=gn,lB=Au,ea=qo,eo=Ir,Kb=$n,cB=io;class Fh{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;typeof e.schema=="object"&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,eo.normalizeId)(r==null?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}fi.SchemaEnv=Fh;function Zv(n){const e=OC.call(this,n);if(e)return e;const t=(0,eo.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:r,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Qi.CodeGen(this.scope,{es5:r,lines:i,ownProperties:o});let a;n.$async&&(a=s.scopeValue("Error",{ref:lB.default,code:(0,Qi._)`require("ajv/dist/runtime/validation_error").default`}));const l=s.scopeName("validate");n.validateName=l;const c={gen:s,allErrors:this.opts.allErrors,data:ea.default.data,parentData:ea.default.parentData,parentDataProperty:ea.default.parentDataProperty,dataNames:[ea.default.data],dataPathArr:[Qi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,Qi.stringify)(n.schema)}:{ref:n.schema}),validateName:l,ValidationError:a,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:Qi.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Qi._)`""`,opts:this.opts,self:this};let u;try{this._compilations.add(n),(0,cB.validateFunctionCode)(c),s.optimize(this.opts.code.optimize);const f=s.toString();u=`${s.scopeRefs(ea.default.scope)}return ${f}`,this.opts.code.process&&(u=this.opts.code.process(u,n));const h=new Function(`${ea.default.self}`,`${ea.default.scope}`,u)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=n.schema,h.schemaEnv=n,n.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:f,scopeValues:s._values}),this.opts.unevaluated){const{props:p,items:m}=c;h.evaluated={props:p instanceof Qi.Name?void 0:p,items:m instanceof Qi.Name?void 0:m,dynamicProps:p instanceof Qi.Name,dynamicItems:m instanceof Qi.Name},h.source&&(h.source.evaluated=(0,Qi.stringify)(h.evaluated))}return n.validate=h,n}catch(f){throw delete n.validate,delete n.validateName,u&&this.logger.error("Error compiling schema, function code:",u),f}finally{this._compilations.delete(n)}}fi.compileSchema=Zv;function uB(n,e,t){var r;t=(0,eo.resolveUrl)(this.opts.uriResolver,e,t);const i=n.refs[t];if(i)return i;let o=hB.call(this,n,t);if(o===void 0){const s=(r=n.localRefs)===null||r===void 0?void 0:r[t],{schemaId:a}=this.opts;s&&(o=new Fh({schema:s,schemaId:a,root:n,baseId:e}))}if(o!==void 0)return n.refs[t]=fB.call(this,o)}fi.resolveRef=uB;function fB(n){return(0,eo.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:Zv.call(this,n)}function OC(n){for(const e of this._compilations)if(dB(e,n))return e}fi.getCompilingSchema=OC;function dB(n,e){return n.schema===e.schema&&n.root===e.root&&n.baseId===e.baseId}function hB(n,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||qh.call(this,n,e)}function qh(n,e){const t=this.opts.uriResolver.parse(e),r=(0,eo._getFullPath)(this.opts.uriResolver,t);let i=(0,eo.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&r===i)return zp.call(this,t,n);const o=(0,eo.normalizeId)(r),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){const a=qh.call(this,n,s);return typeof(a==null?void 0:a.schema)!="object"?void 0:zp.call(this,t,a)}if(typeof(s==null?void 0:s.schema)=="object"){if(s.validate||Zv.call(this,s),o===(0,eo.normalizeId)(e)){const{schema:a}=s,{schemaId:l}=this.opts,c=a[l];return c&&(i=(0,eo.resolveUrl)(this.opts.uriResolver,i,c)),new Fh({schema:a,schemaId:l,root:n,baseId:i})}return zp.call(this,t,s)}}fi.resolveSchema=qh;const pB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zp(n,{baseId:e,schema:t,root:r}){var i;if(((i=n.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const a of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const l=t[(0,Kb.unescapeFragment)(a)];if(l===void 0)return;t=l;const c=typeof t=="object"&&t[this.opts.schemaId];!pB.has(a)&&c&&(e=(0,eo.resolveUrl)(this.opts.uriResolver,e,c))}let o;if(typeof t!="boolean"&&t.$ref&&!(0,Kb.schemaHasRulesButRef)(t,this.RULES)){const a=(0,eo.resolveUrl)(this.opts.uriResolver,e,t.$ref);o=qh.call(this,r,a)}const{schemaId:s}=this.opts;if(o=o||new Fh({schema:t,schemaId:s,root:r,baseId:e}),o.schema!==o.root.schema)return o}const mB="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",gB="Meta-schema for $data reference (JSON AnySchema extension proposal)",vB="object",yB=["$data"],bB={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},wB=!1;var jB={$id:mB,description:gB,type:vB,required:yB,properties:bB,additionalProperties:wB},e0={},vg={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(n,e){(function(t,r){r(e)})(J6,function(t){function r(){for(var N=arguments.length,G=Array(N),ie=0;ie1){G[0]=G[0].slice(0,-1);for(var ue=G.length-1,ye=1;ye= 0x80 (not a basic code point)","invalid-input":"Invalid input"},W=m-v,D=Math.floor,U=String.fromCharCode;function q(N){throw new RangeError(I[N])}function X(N,G){for(var ie=[],ue=N.length;ue--;)ie[ue]=G(N[ue]);return ie}function K(N,G){var ie=N.split("@"),ue="";ie.length>1&&(ue=ie[0]+"@",N=ie[1]),N=N.replace(F,".");var ye=N.split("."),it=X(ye,G).join(".");return ue+it}function Y(N){for(var G=[],ie=0,ue=N.length;ie=55296&&ye<=56319&&ie>1,G+=D(G/ie);G>W*g>>1;ye+=m)G=D(G/W);return D(ye+(W+1)*G/(G+b))},te=function(G){var ie=[],ue=G.length,ye=0,it=w,vt=j,Nt=G.lastIndexOf($);Nt<0&&(Nt=0);for(var bn=0;bn=128&&q("not-basic"),ie.push(G.charCodeAt(bn));for(var En=Nt>0?Nt+1:0;En=ue&&q("invalid-input");var Ot=B(G.charCodeAt(En++));(Ot>=m||Ot>D((p-ye)/ln))&&q("overflow"),ye+=Ot*ln;var Sn=Jt<=vt?v:Jt>=vt+g?g:Jt-vt;if(OtD(p/An)&&q("overflow"),ln*=An}var jn=ie.length+1;vt=A(ye-Bt,jn,Bt==0),D(ye/jn)>p-it&&q("overflow"),it+=D(ye/jn),ye%=jn,ie.splice(ye++,0,it)}return String.fromCodePoint.apply(String,ie)},R=function(G){var ie=[];G=Y(G);var ue=G.length,ye=w,it=0,vt=j,Nt=!0,bn=!1,En=void 0;try{for(var Bt=G[Symbol.iterator](),ln;!(Nt=(ln=Bt.next()).done);Nt=!0){var Jt=ln.value;Jt<128&&ie.push(U(Jt))}}catch(yt){bn=!0,En=yt}finally{try{!Nt&&Bt.return&&Bt.return()}finally{if(bn)throw En}}var Ot=ie.length,Sn=Ot;for(Ot&&ie.push($);Sn=ye&&zeD((p-it)/Fe)&&q("overflow"),it+=(An-ye)*Fe,ye=An;var kt=!0,zt=!1,Kt=void 0;try{for(var z=G[Symbol.iterator](),le;!(kt=(le=z.next()).done);kt=!0){var je=le.value;if(jep&&q("overflow"),je==ye){for(var Me=it,Ne=m;;Ne+=m){var Le=Ne<=vt?v:Ne>=vt+g?g:Ne-vt;if(Me>6|192).toString(16).toUpperCase()+"%"+(G&63|128).toString(16).toUpperCase():ie="%"+(G>>12|224).toString(16).toUpperCase()+"%"+(G>>6&63|128).toString(16).toUpperCase()+"%"+(G&63|128).toString(16).toUpperCase(),ie}function Se(N){for(var G="",ie=0,ue=N.length;ie=194&&ye<224){if(ue-ie>=6){var it=parseInt(N.substr(ie+4,2),16);G+=String.fromCharCode((ye&31)<<6|it&63)}else G+=N.substr(ie,6);ie+=6}else if(ye>=224){if(ue-ie>=9){var vt=parseInt(N.substr(ie+4,2),16),Nt=parseInt(N.substr(ie+7,2),16);G+=String.fromCharCode((ye&15)<<12|(vt&63)<<6|Nt&63)}else G+=N.substr(ie,9);ie+=9}else G+=N.substr(ie,3),ie+=3}return G}function pe(N,G){function ie(ue){var ye=Se(ue);return ye.match(G.UNRESERVED)?ye:ue}return N.scheme&&(N.scheme=String(N.scheme).replace(G.PCT_ENCODED,ie).toLowerCase().replace(G.NOT_SCHEME,"")),N.userinfo!==void 0&&(N.userinfo=String(N.userinfo).replace(G.PCT_ENCODED,ie).replace(G.NOT_USERINFO,he).replace(G.PCT_ENCODED,s)),N.host!==void 0&&(N.host=String(N.host).replace(G.PCT_ENCODED,ie).toLowerCase().replace(G.NOT_HOST,he).replace(G.PCT_ENCODED,s)),N.path!==void 0&&(N.path=String(N.path).replace(G.PCT_ENCODED,ie).replace(N.scheme?G.NOT_PATH:G.NOT_PATH_NOSCHEME,he).replace(G.PCT_ENCODED,s)),N.query!==void 0&&(N.query=String(N.query).replace(G.PCT_ENCODED,ie).replace(G.NOT_QUERY,he).replace(G.PCT_ENCODED,s)),N.fragment!==void 0&&(N.fragment=String(N.fragment).replace(G.PCT_ENCODED,ie).replace(G.NOT_FRAGMENT,he).replace(G.PCT_ENCODED,s)),N}function ae(N){return N.replace(/^0*(.*)/,"$1")||"0"}function Qe(N,G){var ie=N.match(G.IPV4ADDRESS)||[],ue=d(ie,2),ye=ue[1];return ye?ye.split(".").map(ae).join("."):N}function et(N,G){var ie=N.match(G.IPV6ADDRESS)||[],ue=d(ie,3),ye=ue[1],it=ue[2];if(ye){for(var vt=ye.toLowerCase().split("::").reverse(),Nt=d(vt,2),bn=Nt[0],En=Nt[1],Bt=En?En.split(":").map(ae):[],ln=bn.split(":").map(ae),Jt=G.IPV4ADDRESS.test(ln[ln.length-1]),Ot=Jt?7:8,Sn=ln.length-Ot,An=Array(Ot),jn=0;jn1){var Ie=An.slice(0,Q.index),ze=An.slice(Q.index+Q.length);ve=Ie.join(":")+"::"+ze.join(":")}else ve=An.join(":");return it&&(ve+="%"+it),ve}else return N}var tn=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Qt="".match(/(){0}/)[1]===void 0;function oe(N){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie={},ue=G.iri!==!1?f:u;G.reference==="suffix"&&(N=(G.scheme?G.scheme+":":"")+"//"+N);var ye=N.match(tn);if(ye){Qt?(ie.scheme=ye[1],ie.userinfo=ye[3],ie.host=ye[4],ie.port=parseInt(ye[5],10),ie.path=ye[6]||"",ie.query=ye[7],ie.fragment=ye[8],isNaN(ie.port)&&(ie.port=ye[5])):(ie.scheme=ye[1]||void 0,ie.userinfo=N.indexOf("@")!==-1?ye[3]:void 0,ie.host=N.indexOf("//")!==-1?ye[4]:void 0,ie.port=parseInt(ye[5],10),ie.path=ye[6]||"",ie.query=N.indexOf("?")!==-1?ye[7]:void 0,ie.fragment=N.indexOf("#")!==-1?ye[8]:void 0,isNaN(ie.port)&&(ie.port=N.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?ye[4]:void 0)),ie.host&&(ie.host=et(Qe(ie.host,ue),ue)),ie.scheme===void 0&&ie.userinfo===void 0&&ie.host===void 0&&ie.port===void 0&&!ie.path&&ie.query===void 0?ie.reference="same-document":ie.scheme===void 0?ie.reference="relative":ie.fragment===void 0?ie.reference="absolute":ie.reference="uri",G.reference&&G.reference!=="suffix"&&G.reference!==ie.reference&&(ie.error=ie.error||"URI is not a "+G.reference+" reference.");var it=J[(G.scheme||ie.scheme||"").toLowerCase()];if(!G.unicodeSupport&&(!it||!it.unicodeSupport)){if(ie.host&&(G.domainHost||it&&it.domainHost))try{ie.host=H.toASCII(ie.host.replace(ue.PCT_ENCODED,Se).toLowerCase())}catch(vt){ie.error=ie.error||"Host's domain name can not be converted to ASCII via punycode: "+vt}pe(ie,u)}else pe(ie,ue);it&&it.parse&&it.parse(ie,G)}else ie.error=ie.error||"URI can not be parsed.";return ie}function st(N,G){var ie=G.iri!==!1?f:u,ue=[];return N.userinfo!==void 0&&(ue.push(N.userinfo),ue.push("@")),N.host!==void 0&&ue.push(et(Qe(String(N.host),ie),ie).replace(ie.IPV6ADDRESS,function(ye,it,vt){return"["+it+(vt?"%25"+vt:"")+"]"})),(typeof N.port=="number"||typeof N.port=="string")&&(ue.push(":"),ue.push(String(N.port))),ue.length?ue.join(""):void 0}var Ht=/^\.\.?\//,qe=/^\/\.(\/|$)/,Dt=/^\/\.\.(\/|$)/,He=/^\/?(?:.|\n)*?(?=\/|$)/;function wt(N){for(var G=[];N.length;)if(N.match(Ht))N=N.replace(Ht,"");else if(N.match(qe))N=N.replace(qe,"/");else if(N.match(Dt))N=N.replace(Dt,"/"),G.pop();else if(N==="."||N==="..")N="";else{var ie=N.match(He);if(ie){var ue=ie[0];N=N.slice(ue.length),G.push(ue)}else throw new Error("Unexpected dot segment condition")}return G.join("")}function Oe(N){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=G.iri?f:u,ue=[],ye=J[(G.scheme||N.scheme||"").toLowerCase()];if(ye&&ye.serialize&&ye.serialize(N,G),N.host&&!ie.IPV6ADDRESS.test(N.host)){if(G.domainHost||ye&&ye.domainHost)try{N.host=G.iri?H.toUnicode(N.host):H.toASCII(N.host.replace(ie.PCT_ENCODED,Se).toLowerCase())}catch(Nt){N.error=N.error||"Host's domain name can not be converted to "+(G.iri?"Unicode":"ASCII")+" via punycode: "+Nt}}pe(N,ie),G.reference!=="suffix"&&N.scheme&&(ue.push(N.scheme),ue.push(":"));var it=st(N,G);if(it!==void 0&&(G.reference!=="suffix"&&ue.push("//"),ue.push(it),N.path&&N.path.charAt(0)!=="/"&&ue.push("/")),N.path!==void 0){var vt=N.path;!G.absolutePath&&(!ye||!ye.absolutePath)&&(vt=wt(vt)),it===void 0&&(vt=vt.replace(/^\/\//,"/%2F")),ue.push(vt)}return N.query!==void 0&&(ue.push("?"),ue.push(N.query)),N.fragment!==void 0&&(ue.push("#"),ue.push(N.fragment)),ue.join("")}function Xe(N,G){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ue=arguments[3],ye={};return ue||(N=oe(Oe(N,ie),ie),G=oe(Oe(G,ie),ie)),ie=ie||{},!ie.tolerant&&G.scheme?(ye.scheme=G.scheme,ye.userinfo=G.userinfo,ye.host=G.host,ye.port=G.port,ye.path=wt(G.path||""),ye.query=G.query):(G.userinfo!==void 0||G.host!==void 0||G.port!==void 0?(ye.userinfo=G.userinfo,ye.host=G.host,ye.port=G.port,ye.path=wt(G.path||""),ye.query=G.query):(G.path?(G.path.charAt(0)==="/"?ye.path=wt(G.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?ye.path="/"+G.path:N.path?ye.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+G.path:ye.path=G.path,ye.path=wt(ye.path)),ye.query=G.query):(ye.path=N.path,G.query!==void 0?ye.query=G.query:ye.query=N.query),ye.userinfo=N.userinfo,ye.host=N.host,ye.port=N.port),ye.scheme=N.scheme),ye.fragment=G.fragment,ye}function nn(N,G,ie){var ue=l({scheme:"null"},ie);return Oe(Xe(oe(N,ue),oe(G,ue),ue,!0),ue)}function L(N,G){return typeof N=="string"?N=Oe(oe(N,G),G):o(N)==="object"&&(N=oe(Oe(N,G),G)),N}function ne(N,G,ie){return typeof N=="string"?N=Oe(oe(N,ie),ie):o(N)==="object"&&(N=Oe(N,ie)),typeof G=="string"?G=Oe(oe(G,ie),ie):o(G)==="object"&&(G=Oe(G,ie)),N===G}function se(N,G){return N&&N.toString().replace(!G||!G.iri?u.ESCAPE:f.ESCAPE,he)}function ge(N,G){return N&&N.toString().replace(!G||!G.iri?u.PCT_ENCODED:f.PCT_ENCODED,Se)}var ke={scheme:"http",domainHost:!0,parse:function(G,ie){return G.host||(G.error=G.error||"HTTP URIs must have a host."),G},serialize:function(G,ie){var ue=String(G.scheme).toLowerCase()==="https";return(G.port===(ue?443:80)||G.port==="")&&(G.port=void 0),G.path||(G.path="/"),G}},Re={scheme:"https",domainHost:ke.domainHost,parse:ke.parse,serialize:ke.serialize};function at(N){return typeof N.secure=="boolean"?N.secure:String(N.scheme).toLowerCase()==="wss"}var rt={scheme:"ws",domainHost:!0,parse:function(G,ie){var ue=G;return ue.secure=at(ue),ue.resourceName=(ue.path||"/")+(ue.query?"?"+ue.query:""),ue.path=void 0,ue.query=void 0,ue},serialize:function(G,ie){if((G.port===(at(G)?443:80)||G.port==="")&&(G.port=void 0),typeof G.secure=="boolean"&&(G.scheme=G.secure?"wss":"ws",G.secure=void 0),G.resourceName){var ue=G.resourceName.split("?"),ye=d(ue,2),it=ye[0],vt=ye[1];G.path=it&&it!=="/"?it:void 0,G.query=vt,G.resourceName=void 0}return G.fragment=void 0,G}},Xt={scheme:"wss",domainHost:rt.domainHost,parse:rt.parse,serialize:rt.serialize},Zt={},Wt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ge="[0-9A-Fa-f]",On=i(i("%[EFef]"+Ge+"%"+Ge+Ge+"%"+Ge+Ge)+"|"+i("%[89A-Fa-f]"+Ge+"%"+Ge+Ge)+"|"+i("%"+Ge+Ge)),zn="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Pt="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Mn=r(Pt,'[\\"\\\\]'),Dn="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",er=new RegExp(Wt,"g"),fn=new RegExp(On,"g"),me=new RegExp(r("[^]",zn,"[\\.]",'[\\"]',Mn),"g"),Be=new RegExp(r("[^]",Wt,Dn),"g"),St=Be;function Lt(N){var G=Se(N);return G.match(er)?G:N}var _t={scheme:"mailto",parse:function(G,ie){var ue=G,ye=ue.to=ue.path?ue.path.split(","):[];if(ue.path=void 0,ue.query){for(var it=!1,vt={},Nt=ue.query.split("&"),bn=0,En=Nt.length;bnnew RegExp(O,A);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},b=200;function y(O){var A,te,R,k,P,H,J,he,Se,pe,ae,Qe,et,tn,Qt,oe,st,Ht,qe,Dt,He,wt,Oe,Xe,nn;const L=O.strict,ne=(A=O.code)===null||A===void 0?void 0:A.optimize,se=ne===!0||ne===void 0?1:ne||0,ge=(R=(te=O.code)===null||te===void 0?void 0:te.regExp)!==null&&R!==void 0?R:h,ke=(k=O.uriResolver)!==null&&k!==void 0?k:d.default;return{strictSchema:(H=(P=O.strictSchema)!==null&&P!==void 0?P:L)!==null&&H!==void 0?H:!0,strictNumbers:(he=(J=O.strictNumbers)!==null&&J!==void 0?J:L)!==null&&he!==void 0?he:!0,strictTypes:(pe=(Se=O.strictTypes)!==null&&Se!==void 0?Se:L)!==null&&pe!==void 0?pe:"log",strictTuples:(Qe=(ae=O.strictTuples)!==null&&ae!==void 0?ae:L)!==null&&Qe!==void 0?Qe:"log",strictRequired:(tn=(et=O.strictRequired)!==null&&et!==void 0?et:L)!==null&&tn!==void 0?tn:!1,code:O.code?gs(Tr({},O.code),{optimize:se,regExp:ge}):{optimize:se,regExp:ge},loopRequired:(Qt=O.loopRequired)!==null&&Qt!==void 0?Qt:b,loopEnum:(oe=O.loopEnum)!==null&&oe!==void 0?oe:b,meta:(st=O.meta)!==null&&st!==void 0?st:!0,messages:(Ht=O.messages)!==null&&Ht!==void 0?Ht:!0,inlineRefs:(qe=O.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(Dt=O.schemaId)!==null&&Dt!==void 0?Dt:"$id",addUsedSchema:(He=O.addUsedSchema)!==null&&He!==void 0?He:!0,validateSchema:(wt=O.validateSchema)!==null&&wt!==void 0?wt:!0,validateFormats:(Oe=O.validateFormats)!==null&&Oe!==void 0?Oe:!0,unicodeRegExp:(Xe=O.unicodeRegExp)!==null&&Xe!==void 0?Xe:!0,int32range:(nn=O.int32range)!==null&&nn!==void 0?nn:!0,uriResolver:ke}}class j{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts=Tr(Tr({},A),y(A));const{es5:te,lines:R}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:te,lines:R}),this.logger=D(A.logger);const k=A.validateFormats;A.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,v,A,"NOT SUPPORTED"),w.call(this,g,A,"DEPRECATED","warn"),this._metaOpts=I.call(this),A.formats&&_.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&F.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),S.call(this),A.validateFormats=k}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:te,schemaId:R}=this.opts;let k=f;R==="id"&&(k=Tr({},f),k.id=k.$id,delete k.$id),te&&A&&this.addMetaSchema(k,k[R],!1)}defaultMeta(){const{meta:A,schemaId:te}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[te]||A:void 0}validate(A,te){let R;if(typeof A=="string"){if(R=this.getSchema(A),!R)throw new Error(`no schema with key or ref "${A}"`)}else R=this.compile(A);const k=R(te);return"$async"in R||(this.errors=R.errors),k}compile(A,te){const R=this._addSchema(A,te);return R.validate||this._compileSchemaEnv(R)}compileAsync(A,te){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return k.call(this,A,te);async function k(pe,ae){await P.call(this,pe.$schema);const Qe=this._addSchema(pe,ae);return Qe.validate||H.call(this,Qe)}async function P(pe){pe&&!this.getSchema(pe)&&await k.call(this,{$ref:pe},!0)}async function H(pe){try{return this._compileSchemaEnv(pe)}catch(ae){if(!(ae instanceof i.default))throw ae;return J.call(this,ae),await he.call(this,ae.missingSchema),H.call(this,pe)}}function J({missingSchema:pe,missingRef:ae}){if(this.refs[pe])throw new Error(`AnySchema ${pe} is loaded but ${ae} cannot be resolved`)}async function he(pe){const ae=await Se.call(this,pe);this.refs[pe]||await P.call(this,ae.$schema),this.refs[pe]||this.addSchema(ae,pe,te)}async function Se(pe){const ae=this._loading[pe];if(ae)return ae;try{return await(this._loading[pe]=R(pe))}finally{delete this._loading[pe]}}}addSchema(A,te,R,k=this.opts.validateSchema){if(Array.isArray(A)){for(const H of A)this.addSchema(H,void 0,R,k);return this}let P;if(typeof A=="object"){const{schemaId:H}=this.opts;if(P=A[H],P!==void 0&&typeof P!="string")throw new Error(`schema ${H} must be string`)}return te=(0,l.normalizeId)(te||P),this._checkUnique(te),this.schemas[te]=this._addSchema(A,R,te,k,!0),this}addMetaSchema(A,te,R=this.opts.validateSchema){return this.addSchema(A,te,!0,R),this}validateSchema(A,te){if(typeof A=="boolean")return!0;let R;if(R=A.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const k=this.validate(R,A);if(!k&&te){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return k}getSchema(A){let te;for(;typeof(te=$.call(this,A))=="string";)A=te;if(te===void 0){const{schemaId:R}=this.opts,k=new s.SchemaEnv({schema:{},schemaId:R});if(te=s.resolveSchema.call(this,k,A),!te)return;this.refs[A]=te}return te.validate||this._compileSchemaEnv(te)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const te=$.call(this,A);return typeof te=="object"&&this._cache.delete(te.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const te=A;this._cache.delete(te);let R=A[this.opts.schemaId];return R&&(R=(0,l.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const te of A)this.addKeyword(te);return this}addKeyword(A,te){let R;if(typeof A=="string")R=A,typeof te=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),te.keyword=R);else if(typeof A=="object"&&te===void 0){if(te=A,R=te.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(q.call(this,R,te),!te)return(0,u.eachItem)(R,P=>X.call(this,P)),this;Y.call(this,te);const k=gs(Tr({},te),{type:(0,c.getJSONTypes)(te.type),schemaType:(0,c.getJSONTypes)(te.schemaType)});return(0,u.eachItem)(R,k.type.length===0?P=>X.call(this,P,k):P=>k.type.forEach(H=>X.call(this,P,k,H))),this}getKeyword(A){const te=this.RULES.all[A];return typeof te=="object"?te.definition:!!te}removeKeyword(A){const{RULES:te}=this;delete te.keywords[A],delete te.all[A];for(const R of te.rules){const k=R.rules.findIndex(P=>P.keyword===A);k>=0&&R.rules.splice(k,1)}return this}addFormat(A,te){return typeof te=="string"&&(te=new RegExp(te)),this.formats[A]=te,this}errorsText(A=this.errors,{separator:te=", ",dataVar:R="data"}={}){return!A||A.length===0?"No errors":A.map(k=>`${R}${k.instancePath} ${k.message}`).reduce((k,P)=>k+te+P)}$dataMetaSchema(A,te){const R=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const k of te){const P=k.split("/").slice(1);let H=A;for(const J of P)H=H[J];for(const J in R){const he=R[J];if(typeof he!="object")continue;const{$data:Se}=he.definition,pe=H[J];Se&&pe&&(H[J]=B(pe))}}return A}_removeAllSchemas(A,te){for(const R in A){const k=A[R];(!te||te.test(R))&&(typeof k=="string"?delete A[R]:k&&!k.meta&&(this._cache.delete(k.schema),delete A[R]))}}_addSchema(A,te,R,k=this.opts.validateSchema,P=this.opts.addUsedSchema){let H;const{schemaId:J}=this.opts;if(typeof A=="object")H=A[J];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let he=this._cache.get(A);if(he!==void 0)return he;R=(0,l.normalizeId)(H||R);const Se=l.getSchemaRefs.call(this,A,R);return he=new s.SchemaEnv({schema:A,schemaId:J,meta:te,baseId:R,localRefs:Se}),this._cache.set(he.schema,he),P&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=he),k&&this.validateSchema(A,!0),he}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):s.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const te=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,A)}finally{this.opts=te}}}n.default=j,j.ValidationError=r.default,j.MissingRefError=i.default;function w(O,A,te,R="error"){for(const k in O){const P=k;P in A&&this.logger[R](`${te}: option ${k}. ${O[P]}`)}}function $(O){return O=(0,l.normalizeId)(O),this.schemas[O]||this.refs[O]}function S(){const O=this.opts.schemas;if(!!O)if(Array.isArray(O))this.addSchema(O);else for(const A in O)this.addSchema(O[A],A)}function _(){for(const O in this.opts.formats){const A=this.opts.formats[O];A&&this.addFormat(O,A)}}function F(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in O){const te=O[A];te.keyword||(te.keyword=A),this.addKeyword(te)}}function I(){const O=Tr({},this.opts);for(const A of p)delete O[A];return O}const W={log(){},warn(){},error(){}};function D(O){if(O===!1)return W;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function q(O,A){const{RULES:te}=this;if((0,u.eachItem)(O,R=>{if(te.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!U.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function X(O,A,te){var R;const k=A==null?void 0:A.post;if(te&&k)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let H=k?P.post:P.rules.find(({type:he})=>he===te);if(H||(H={type:te,rules:[]},P.rules.push(H)),P.keywords[O]=!0,!A)return;const J={keyword:O,definition:gs(Tr({},A),{type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)})};A.before?K.call(this,H,J,A.before):H.rules.push(J),P.all[O]=J,(R=A.implements)===null||R===void 0||R.forEach(he=>this.addKeyword(he))}function K(O,A,te){const R=O.rules.findIndex(k=>k.keyword===te);R>=0?O.rules.splice(R,0,A):(O.rules.push(A),this.logger.warn(`rule ${te} is not defined`))}function Y(O){let{metaSchema:A}=O;A!==void 0&&(O.$data&&this.opts.$data&&(A=B(A)),O.validateSchema=this.compile(A,!0))}const T={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function B(O){return{anyOf:[O,T]}}})(rC);var t0={},n0={},r0={};Object.defineProperty(r0,"__esModule",{value:!0});const xB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};r0.default=xB;var Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.callRef=Ca.getValidate=void 0;const $B=Tu,Gb=pn,ci=gn,Ua=qo,Qb=fi,kf=$n,kB={keyword:"$ref",schemaType:"string",code(n){const{gen:e,schema:t,it:r}=n,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:l}=r,{root:c}=o;if((t==="#"||t==="#/")&&i===c.baseId)return f();const u=Qb.resolveRef.call(l,c,i,t);if(u===void 0)throw new $B.default(r.opts.uriResolver,i,t);if(u instanceof Qb.SchemaEnv)return d(u);return h(u);function f(){if(o===c)return td(n,s,o,o.$async);const p=e.scopeValue("root",{ref:c});return td(n,(0,ci._)`${p}.validate`,c,c.$async)}function d(p){const m=EC(n,p);td(n,m,p,p.$async)}function h(p){const m=e.scopeValue("schema",a.code.source===!0?{ref:p,code:(0,ci.stringify)(p)}:{ref:p}),v=e.name("valid"),g=n.subschema({schema:p,dataTypes:[],schemaPath:ci.nil,topSchemaRef:m,errSchemaPath:t},v);n.mergeEvaluated(g),n.ok(v)}}};function EC(n,e){const{gen:t}=n;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,ci._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ca.getValidate=EC;function td(n,e,t,r){const{gen:i,it:o}=n,{allErrors:s,schemaEnv:a,opts:l}=o,c=l.passContext?Ua.default.this:ci.nil;r?u():f();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");const p=i.let("valid");i.try(()=>{i.code((0,ci._)`await ${(0,Gb.callValidateCode)(n,e,c)}`),h(e),s||i.assign(p,!0)},m=>{i.if((0,ci._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),d(m),s||i.assign(p,!1)}),n.ok(p)}function f(){n.result((0,Gb.callValidateCode)(n,e,c),()=>h(e),()=>d(e))}function d(p){const m=(0,ci._)`${p}.errors`;i.assign(Ua.default.vErrors,(0,ci._)`${Ua.default.vErrors} === null ? ${m} : ${Ua.default.vErrors}.concat(${m})`),i.assign(Ua.default.errors,(0,ci._)`${Ua.default.vErrors}.length`)}function h(p){var m;if(!o.opts.unevaluated)return;const v=(m=t==null?void 0:t.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=kf.mergeEvaluated.props(i,v.props,o.props));else{const g=i.var("props",(0,ci._)`${p}.evaluated.props`);o.props=kf.mergeEvaluated.props(i,g,o.props,ci.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=kf.mergeEvaluated.items(i,v.items,o.items));else{const g=i.var("items",(0,ci._)`${p}.evaluated.items`);o.items=kf.mergeEvaluated.items(i,g,o.items,ci.Name)}}}Ca.callRef=td;Ca.default=kB;Object.defineProperty(n0,"__esModule",{value:!0});const SB=r0,CB=Ca,OB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",SB.default,CB.default];n0.default=OB;var i0={},o0={};Object.defineProperty(o0,"__esModule",{value:!0});const Fd=gn,ys=Fd.operators,qd={maximum:{okStr:"<=",ok:ys.LTE,fail:ys.GT},minimum:{okStr:">=",ok:ys.GTE,fail:ys.LT},exclusiveMaximum:{okStr:"<",ok:ys.LT,fail:ys.GTE},exclusiveMinimum:{okStr:">",ok:ys.GT,fail:ys.LTE}},MB={message:({keyword:n,schemaCode:e})=>(0,Fd.str)`must be ${qd[n].okStr} ${e}`,params:({keyword:n,schemaCode:e})=>(0,Fd._)`{comparison: ${qd[n].okStr}, limit: ${e}}`},EB={keyword:Object.keys(qd),type:"number",schemaType:"number",$data:!0,error:MB,code(n){const{keyword:e,data:t,schemaCode:r}=n;n.fail$data((0,Fd._)`${t} ${qd[e].fail} ${r} || isNaN(${t})`)}};o0.default=EB;var s0={};Object.defineProperty(s0,"__esModule",{value:!0});const _c=gn,AB={message:({schemaCode:n})=>(0,_c.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,_c._)`{multipleOf: ${n}}`},TB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:AB,code(n){const{gen:e,data:t,schemaCode:r,it:i}=n,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,_c._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,_c._)`${s} !== parseInt(${s})`;n.fail$data((0,_c._)`(${r} === 0 || (${s} = ${t}/${r}, ${a}))`)}};s0.default=TB;var a0={},l0={};Object.defineProperty(l0,"__esModule",{value:!0});function AC(n){const e=n.length;let t=0,r=0,i;for(;r=55296&&i<=56319&&r(0,sa._)`{limit: ${n}}`},NB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:RB,code(n){const{keyword:e,data:t,schemaCode:r,it:i}=n,o=e==="maxLength"?sa.operators.GT:sa.operators.LT,s=i.opts.unicode===!1?(0,sa._)`${t}.length`:(0,sa._)`${(0,PB.useFunc)(n.gen,_B.default)}(${t})`;n.fail$data((0,sa._)`${s} ${o} ${r}`)}};a0.default=NB;var c0={};Object.defineProperty(c0,"__esModule",{value:!0});const IB=pn,Vd=gn,DB={message:({schemaCode:n})=>(0,Vd.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,Vd._)`{pattern: ${n}}`},LB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:DB,code(n){const{data:e,$data:t,schema:r,schemaCode:i,it:o}=n,s=o.opts.unicodeRegExp?"u":"",a=t?(0,Vd._)`(new RegExp(${i}, ${s}))`:(0,IB.usePattern)(n,r);n.fail$data((0,Vd._)`!${a}.test(${e})`)}};c0.default=LB;var u0={};Object.defineProperty(u0,"__esModule",{value:!0});const Rc=gn,BB={message({keyword:n,schemaCode:e}){const t=n==="maxProperties"?"more":"fewer";return(0,Rc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:n})=>(0,Rc._)`{limit: ${n}}`},zB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:BB,code(n){const{keyword:e,data:t,schemaCode:r}=n,i=e==="maxProperties"?Rc.operators.GT:Rc.operators.LT;n.fail$data((0,Rc._)`Object.keys(${t}).length ${i} ${r}`)}};u0.default=zB;var f0={};Object.defineProperty(f0,"__esModule",{value:!0});const dc=pn,Nc=gn,FB=$n,qB={message:({params:{missingProperty:n}})=>(0,Nc.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,Nc._)`{missingProperty: ${n}}`},VB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qB,code(n){const{gen:e,schema:t,schemaCode:r,data:i,$data:o,it:s}=n,{opts:a}=s;if(!o&&t.length===0)return;const l=t.length>=a.loopRequired;if(s.allErrors?c():u(),a.strictRequired){const h=n.parentSchema.properties,{definedProperties:p}=n.it;for(const m of t)if((h==null?void 0:h[m])===void 0&&!p.has(m)){const v=s.schemaEnv.baseId+s.errSchemaPath,g=`required property "${m}" is not defined at "${v}" (strictRequired)`;(0,FB.checkStrictMode)(s,g,s.opts.strictRequired)}}function c(){if(l||o)n.block$data(Nc.nil,f);else for(const h of t)(0,dc.checkReportMissingProp)(n,h)}function u(){const h=e.let("missing");if(l||o){const p=e.let("valid",!0);n.block$data(p,()=>d(h,p)),n.ok(p)}else e.if((0,dc.checkMissingProp)(n,t,h)),(0,dc.reportMissingProp)(n,h),e.else()}function f(){e.forOf("prop",r,h=>{n.setParams({missingProperty:h}),e.if((0,dc.noPropertyInData)(e,i,h,a.ownProperties),()=>n.error())})}function d(h,p){n.setParams({missingProperty:h}),e.forOf(h,r,()=>{e.assign(p,(0,dc.propertyInData)(e,i,h,a.ownProperties)),e.if((0,Nc.not)(p),()=>{n.error(),e.break()})},Nc.nil)}}};f0.default=VB;var d0={};Object.defineProperty(d0,"__esModule",{value:!0});const Ic=gn,HB={message({keyword:n,schemaCode:e}){const t=n==="maxItems"?"more":"fewer";return(0,Ic.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:n})=>(0,Ic._)`{limit: ${n}}`},UB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:HB,code(n){const{keyword:e,data:t,schemaCode:r}=n,i=e==="maxItems"?Ic.operators.GT:Ic.operators.LT;n.fail$data((0,Ic._)`${t}.length ${i} ${r}`)}};d0.default=UB;var h0={},Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});const TC=fC;TC.code='require("ajv/dist/runtime/equal").default';Pu.default=TC;Object.defineProperty(h0,"__esModule",{value:!0});const Fp=Eu,Pr=gn,WB=$n,JB=Pu,KB={message:({params:{i:n,j:e}})=>(0,Pr.str)`must NOT have duplicate items (items ## ${e} and ${n} are identical)`,params:({params:{i:n,j:e}})=>(0,Pr._)`{i: ${n}, j: ${e}}`},GB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:KB,code(n){const{gen:e,data:t,$data:r,schema:i,parentSchema:o,schemaCode:s,it:a}=n;if(!r&&!i)return;const l=e.let("valid"),c=o.items?(0,Fp.getSchemaTypes)(o.items):[];n.block$data(l,u,(0,Pr._)`${s} === false`),n.ok(l);function u(){const p=e.let("i",(0,Pr._)`${t}.length`),m=e.let("j");n.setParams({i:p,j:m}),e.assign(l,!0),e.if((0,Pr._)`${p} > 1`,()=>(f()?d:h)(p,m))}function f(){return c.length>0&&!c.some(p=>p==="object"||p==="array")}function d(p,m){const v=e.name("item"),g=(0,Fp.checkDataTypes)(c,v,a.opts.strictNumbers,Fp.DataType.Wrong),b=e.const("indices",(0,Pr._)`{}`);e.for((0,Pr._)`;${p}--;`,()=>{e.let(v,(0,Pr._)`${t}[${p}]`),e.if(g,(0,Pr._)`continue`),c.length>1&&e.if((0,Pr._)`typeof ${v} == "string"`,(0,Pr._)`${v} += "_"`),e.if((0,Pr._)`typeof ${b}[${v}] == "number"`,()=>{e.assign(m,(0,Pr._)`${b}[${v}]`),n.error(),e.assign(l,!1).break()}).code((0,Pr._)`${b}[${v}] = ${p}`)})}function h(p,m){const v=(0,WB.useFunc)(e,JB.default),g=e.name("outer");e.label(g).for((0,Pr._)`;${p}--;`,()=>e.for((0,Pr._)`${m} = ${p}; ${m}--;`,()=>e.if((0,Pr._)`${v}(${t}[${p}], ${t}[${m}])`,()=>{n.error(),e.assign(l,!1).break(g)})))}}};h0.default=GB;var p0={};Object.defineProperty(p0,"__esModule",{value:!0});const yg=gn,QB=$n,YB=Pu,XB={message:"must be equal to constant",params:({schemaCode:n})=>(0,yg._)`{allowedValue: ${n}}`},ZB={keyword:"const",$data:!0,error:XB,code(n){const{gen:e,data:t,$data:r,schemaCode:i,schema:o}=n;r||o&&typeof o=="object"?n.fail$data((0,yg._)`!${(0,QB.useFunc)(e,YB.default)}(${t}, ${i})`):n.fail((0,yg._)`${o} !== ${t}`)}};p0.default=ZB;var m0={};Object.defineProperty(m0,"__esModule",{value:!0});const wc=gn,ez=$n,tz=Pu,nz={message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,wc._)`{allowedValues: ${n}}`},rz={keyword:"enum",schemaType:"array",$data:!0,error:nz,code(n){const{gen:e,data:t,$data:r,schema:i,schemaCode:o,it:s}=n;if(!r&&i.length===0)throw new Error("enum must have non-empty array");const a=i.length>=s.opts.loopEnum;let l;const c=()=>l!=null?l:l=(0,ez.useFunc)(e,tz.default);let u;if(a||r)u=e.let("valid"),n.block$data(u,f);else{if(!Array.isArray(i))throw new Error("ajv implementation error");const h=e.const("vSchema",o);u=(0,wc.or)(...i.map((p,m)=>d(h,m)))}n.pass(u);function f(){e.assign(u,!1),e.forOf("v",o,h=>e.if((0,wc._)`${c()}(${t}, ${h})`,()=>e.assign(u,!0).break()))}function d(h,p){const m=i[p];return typeof m=="object"&&m!==null?(0,wc._)`${c()}(${t}, ${h}[${p}])`:(0,wc._)`${t} === ${m}`}}};m0.default=rz;Object.defineProperty(i0,"__esModule",{value:!0});const iz=o0,oz=s0,sz=a0,az=c0,lz=u0,cz=f0,uz=d0,fz=h0,dz=p0,hz=m0,pz=[iz.default,oz.default,sz.default,az.default,lz.default,cz.default,uz.default,fz.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},dz.default,hz.default];i0.default=pz;var g0={},Wl={};Object.defineProperty(Wl,"__esModule",{value:!0});Wl.validateAdditionalItems=void 0;const aa=gn,bg=$n,mz={message:({params:{len:n}})=>(0,aa.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,aa._)`{limit: ${n}}`},gz={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:mz,code(n){const{parentSchema:e,it:t}=n,{items:r}=e;if(!Array.isArray(r)){(0,bg.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}PC(n,r)}};function PC(n,e){const{gen:t,schema:r,data:i,keyword:o,it:s}=n;s.items=!0;const a=t.const("len",(0,aa._)`${i}.length`);if(r===!1)n.setParams({len:e.length}),n.pass((0,aa._)`${a} <= ${e.length}`);else if(typeof r=="object"&&!(0,bg.alwaysValidSchema)(s,r)){const c=t.var("valid",(0,aa._)`${a} <= ${e.length}`);t.if((0,aa.not)(c),()=>l(c)),n.ok(c)}function l(c){t.forRange("i",e.length,a,u=>{n.subschema({keyword:o,dataProp:u,dataPropType:bg.Type.Num},c),s.allErrors||t.if((0,aa.not)(c),()=>t.break())})}}Wl.validateAdditionalItems=PC;Wl.default=gz;var v0={},Jl={};Object.defineProperty(Jl,"__esModule",{value:!0});Jl.validateTuple=void 0;const Yb=gn,nd=$n,vz=pn,yz={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:e,it:t}=n;if(Array.isArray(e))return _C(n,"additionalItems",e);t.items=!0,!(0,nd.alwaysValidSchema)(t,e)&&n.ok((0,vz.validateArray)(n))}};function _C(n,e,t=n.schema){const{gen:r,parentSchema:i,data:o,keyword:s,it:a}=n;u(i),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=nd.mergeEvaluated.items(r,t.length,a.items));const l=r.name("valid"),c=r.const("len",(0,Yb._)`${o}.length`);t.forEach((f,d)=>{(0,nd.alwaysValidSchema)(a,f)||(r.if((0,Yb._)`${c} > ${d}`,()=>n.subschema({keyword:s,schemaProp:d,dataProp:d},l)),n.ok(l))});function u(f){const{opts:d,errSchemaPath:h}=a,p=t.length,m=p===f.minItems&&(p===f.maxItems||f[e]===!1);if(d.strictTuples&&!m){const v=`"${s}" is ${p}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,nd.checkStrictMode)(a,v,d.strictTuples)}}}Jl.validateTuple=_C;Jl.default=yz;Object.defineProperty(v0,"__esModule",{value:!0});const bz=Jl,wz={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,bz.validateTuple)(n,"items")};v0.default=wz;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});const Xb=gn,jz=$n,xz=pn,$z=Wl,kz={message:({params:{len:n}})=>(0,Xb.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,Xb._)`{limit: ${n}}`},Sz={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:kz,code(n){const{schema:e,parentSchema:t,it:r}=n,{prefixItems:i}=t;r.items=!0,!(0,jz.alwaysValidSchema)(r,e)&&(i?(0,$z.validateAdditionalItems)(n,i):n.ok((0,xz.validateArray)(n)))}};y0.default=Sz;var b0={};Object.defineProperty(b0,"__esModule",{value:!0});const Ai=gn,Sf=$n,Cz={message:({params:{min:n,max:e}})=>e===void 0?(0,Ai.str)`must contain at least ${n} valid item(s)`:(0,Ai.str)`must contain at least ${n} and no more than ${e} valid item(s)`,params:({params:{min:n,max:e}})=>e===void 0?(0,Ai._)`{minContains: ${n}}`:(0,Ai._)`{minContains: ${n}, maxContains: ${e}}`},Oz={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Cz,code(n){const{gen:e,schema:t,parentSchema:r,data:i,it:o}=n;let s,a;const{minContains:l,maxContains:c}=r;o.opts.next?(s=l===void 0?1:l,a=c):s=1;const u=e.const("len",(0,Ai._)`${i}.length`);if(n.setParams({min:s,max:a}),a===void 0&&s===0){(0,Sf.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,Sf.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,Sf.alwaysValidSchema)(o,t)){let m=(0,Ai._)`${u} >= ${s}`;a!==void 0&&(m=(0,Ai._)`${m} && ${u} <= ${a}`),n.pass(m);return}o.items=!0;const f=e.name("valid");a===void 0&&s===1?h(f,()=>e.if(f,()=>e.break())):s===0?(e.let(f,!0),a!==void 0&&e.if((0,Ai._)`${i}.length > 0`,d)):(e.let(f,!1),d()),n.result(f,()=>n.reset());function d(){const m=e.name("_valid"),v=e.let("count",0);h(m,()=>e.if(m,()=>p(v)))}function h(m,v){e.forRange("i",0,u,g=>{n.subschema({keyword:"contains",dataProp:g,dataPropType:Sf.Type.Num,compositeRule:!0},m),v()})}function p(m){e.code((0,Ai._)`${m}++`),a===void 0?e.if((0,Ai._)`${m} >= ${s}`,()=>e.assign(f,!0).break()):(e.if((0,Ai._)`${m} > ${a}`,()=>e.assign(f,!1).break()),s===1?e.assign(f,!0):e.if((0,Ai._)`${m} >= ${s}`,()=>e.assign(f,!0)))}}};b0.default=Oz;var RC={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.validateSchemaDeps=n.validatePropertyDeps=n.error=void 0;const e=gn,t=$n,r=pn;n.error={message:({params:{property:l,depsCount:c,deps:u}})=>{const f=c===1?"property":"properties";return(0,e.str)`must have ${f} ${u} when property ${l} is present`},params:({params:{property:l,depsCount:c,deps:u,missingProperty:f}})=>(0,e._)`{property: ${l}, missingProperty: ${f}, depsCount: ${c}, - deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:n.error,code(l){const[c,u]=o(l);s(l,c),a(l,u)}};function o({schema:l}){const c={},u={};for(const f in l){if(f==="__proto__")continue;const d=Array.isArray(l[f])?c:u;d[f]=l[f]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:f,it:d}=l;if(Object.keys(c).length===0)return;const h=u.let("missing");for(const p in c){const m=c[p];if(m.length===0)continue;const v=(0,r.propertyInData)(u,f,p,d.opts.ownProperties);l.setParams({property:p,depsCount:m.length,deps:m.join(", ")}),d.allErrors?u.if(v,()=>{for(const g of m)(0,r.checkReportMissingProp)(l,g)}):(u.if((0,e._)`${v} && (${(0,r.checkMissingProp)(l,m,h)})`),(0,r.reportMissingProp)(l,h),u.else())}}n.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:u,data:f,keyword:d,it:h}=l,p=u.name("valid");for(const m in c)(0,t.alwaysValidSchema)(h,c[m])||(u.if((0,r.propertyInData)(u,f,m,h.opts.ownProperties),()=>{const v=l.subschema({keyword:d,schemaProp:m},p);l.mergeValidEvaluated(v,p)},()=>u.var(p,!0)),l.ok(p))}n.validateSchemaDeps=a,n.default=i})(RC);var b0={};Object.defineProperty(b0,"__esModule",{value:!0});const NC=gn,Mz=$n,Ez={message:"property name must be valid",params:({params:n})=>(0,NC._)`{propertyName: ${n.propertyName}}`},Az={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Ez,code(n){const{gen:e,schema:t,data:r,it:i}=n;if((0,Mz.alwaysValidSchema)(i,t))return;const o=e.name("valid");e.forIn("key",r,s=>{n.setParams({propertyName:s}),n.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,NC.not)(o),()=>{n.error(!0),i.allErrors||e.break()})}),n.ok(o)}};b0.default=Az;var Vh={};Object.defineProperty(Vh,"__esModule",{value:!0});const Cf=pn,Yi=gn,Tz=qo,Of=$n,Pz={message:"must NOT have additional properties",params:({params:n})=>(0,Yi._)`{additionalProperty: ${n.additionalProperty}}`},_z={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Pz,code(n){const{gen:e,schema:t,parentSchema:r,data:i,errsCount:o,it:s}=n;if(!o)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,Of.alwaysValidSchema)(s,t))return;const c=(0,Cf.allSchemaProperties)(r.properties),u=(0,Cf.allSchemaProperties)(r.patternProperties);f(),n.ok((0,Yi._)`${o} === ${Tz.default.errors}`);function f(){e.forIn("key",i,v=>{!c.length&&!u.length?p(v):e.if(d(v),()=>p(v))})}function d(v){let g;if(c.length>8){const b=(0,Of.schemaRefOrVal)(s,r.properties,"properties");g=(0,Cf.isOwnProperty)(e,b,v)}else c.length?g=(0,Yi.or)(...c.map(b=>(0,Yi._)`${v} === ${b}`)):g=Yi.nil;return u.length&&(g=(0,Yi.or)(g,...u.map(b=>(0,Yi._)`${(0,Cf.usePattern)(n,b)}.test(${v})`))),(0,Yi.not)(g)}function h(v){e.code((0,Yi._)`delete ${i}[${v}]`)}function p(v){if(l.removeAdditional==="all"||l.removeAdditional&&t===!1){h(v);return}if(t===!1){n.setParams({additionalProperty:v}),n.error(),a||e.break();return}if(typeof t=="object"&&!(0,Of.alwaysValidSchema)(s,t)){const g=e.name("valid");l.removeAdditional==="failing"?(m(v,g,!1),e.if((0,Yi.not)(g),()=>{n.reset(),h(v)})):(m(v,g),a||e.if((0,Yi.not)(g),()=>e.break()))}}function m(v,g,b){const y={keyword:"additionalProperties",dataProp:v,dataPropType:Of.Type.Str};b===!1&&Object.assign(y,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(y,g)}}};Vh.default=_z;var w0={};Object.defineProperty(w0,"__esModule",{value:!0});const Rz=io,Xb=pn,qp=$n,Zb=Vh,Nz={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:e,schema:t,parentSchema:r,data:i,it:o}=n;o.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&Zb.default.code(new Rz.KeywordCxt(o,Zb.default,"additionalProperties"));const s=(0,Xb.allSchemaProperties)(t);for(const f of s)o.definedProperties.add(f);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=qp.mergeEvaluated.props(e,(0,qp.toHash)(s),o.props));const a=s.filter(f=>!(0,qp.alwaysValidSchema)(o,t[f]));if(a.length===0)return;const l=e.name("valid");for(const f of a)c(f)?u(f):(e.if((0,Xb.propertyInData)(e,i,f,o.opts.ownProperties)),u(f),o.allErrors||e.else().var(l,!0),e.endIf()),n.it.definedProperties.add(f),n.ok(l);function c(f){return o.opts.useDefaults&&!o.compositeRule&&t[f].default!==void 0}function u(f){n.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};w0.default=Nz;var x0={};Object.defineProperty(x0,"__esModule",{value:!0});const e2=pn,Mf=gn,t2=$n,n2=$n,Iz={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:e,schema:t,data:r,parentSchema:i,it:o}=n,{opts:s}=o,a=(0,e2.allSchemaProperties)(t),l=a.filter(m=>(0,t2.alwaysValidSchema)(o,t[m]));if(a.length===0||l.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;const c=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Mf.Name)&&(o.props=(0,n2.evaluatedPropsToName)(e,o.props));const{props:f}=o;d();function d(){for(const m of a)c&&h(m),o.allErrors?p(m):(e.var(u,!0),p(m),e.if(u))}function h(m){for(const v in c)new RegExp(m).test(v)&&(0,t2.checkStrictMode)(o,`property ${v} matches pattern ${m} (use allowMatchingProperties)`)}function p(m){e.forIn("key",r,v=>{e.if((0,Mf._)`${(0,e2.usePattern)(n,m)}.test(${v})`,()=>{const g=l.includes(m);g||n.subschema({keyword:"patternProperties",schemaProp:m,dataProp:v,dataPropType:n2.Type.Str},u),o.opts.unevaluated&&f!==!0?e.assign((0,Mf._)`${f}[${v}]`,!0):!g&&!o.allErrors&&e.if((0,Mf.not)(u),()=>e.break())})})}}};x0.default=Iz;var j0={};Object.defineProperty(j0,"__esModule",{value:!0});const Dz=$n,Lz={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:e,schema:t,it:r}=n;if((0,Dz.alwaysValidSchema)(r,t)){n.fail();return}const i=e.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),n.failResult(i,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};j0.default=Lz;var $0={};Object.defineProperty($0,"__esModule",{value:!0});const Bz=pn,zz={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Bz.validateUnion,error:{message:"must match a schema in anyOf"}};$0.default=zz;var k0={};Object.defineProperty(k0,"__esModule",{value:!0});const rd=gn,Fz=$n,qz={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,rd._)`{passingSchemas: ${n.passing}}`},Vz={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:qz,code(n){const{gen:e,schema:t,parentSchema:r,it:i}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;const o=t,s=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");n.setParams({passing:a}),e.block(c),n.result(s,()=>n.reset(),()=>n.error(!0));function c(){o.forEach((u,f)=>{let d;(0,Fz.alwaysValidSchema)(i,u)?e.var(l,!0):d=n.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&e.if((0,rd._)`${l} && ${s}`).assign(s,!1).assign(a,(0,rd._)`[${a}, ${f}]`).else(),e.if(l,()=>{e.assign(s,!0),e.assign(a,f),d&&n.mergeEvaluated(d,rd.Name)})})}}};k0.default=Vz;var S0={};Object.defineProperty(S0,"__esModule",{value:!0});const Hz=$n,Uz={keyword:"allOf",schemaType:"array",code(n){const{gen:e,schema:t,it:r}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");const i=e.name("valid");t.forEach((o,s)=>{if((0,Hz.alwaysValidSchema)(r,o))return;const a=n.subschema({keyword:"allOf",schemaProp:s},i);n.ok(i),n.mergeEvaluated(a)})}};S0.default=Uz;var C0={};Object.defineProperty(C0,"__esModule",{value:!0});const Hd=gn,IC=$n,Wz={message:({params:n})=>(0,Hd.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,Hd._)`{failingKeyword: ${n.ifClause}}`},Jz={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Wz,code(n){const{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,IC.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const i=r2(r,"then"),o=r2(r,"else");if(!i&&!o)return;const s=e.let("valid",!0),a=e.name("_valid");if(l(),n.reset(),i&&o){const u=e.let("ifClause");n.setParams({ifClause:u}),e.if(a,c("then",u),c("else",u))}else i?e.if(a,c("then")):e.if((0,Hd.not)(a),c("else"));n.pass(s,()=>n.error(!0));function l(){const u=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);n.mergeEvaluated(u)}function c(u,f){return()=>{const d=n.subschema({keyword:u},a);e.assign(s,a),n.mergeValidEvaluated(d,s),f?e.assign(f,(0,Hd._)`${u}`):n.setParams({ifClause:u})}}}};function r2(n,e){const t=n.schema[e];return t!==void 0&&!(0,IC.alwaysValidSchema)(n,t)}C0.default=Jz;var O0={};Object.defineProperty(O0,"__esModule",{value:!0});const Kz=$n,Gz={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,Kz.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};O0.default=Gz;Object.defineProperty(m0,"__esModule",{value:!0});const Qz=Wl,Yz=g0,Xz=Jl,Zz=v0,eF=y0,tF=RC,nF=b0,rF=Vh,iF=w0,oF=x0,sF=j0,aF=$0,lF=k0,cF=S0,uF=C0,fF=O0;function dF(n=!1){const e=[sF.default,aF.default,lF.default,cF.default,uF.default,fF.default,nF.default,rF.default,tF.default,iF.default,oF.default];return n?e.push(Yz.default,Zz.default):e.push(Qz.default,Xz.default),e.push(eF.default),e}m0.default=dF;var M0={},E0={};Object.defineProperty(E0,"__esModule",{value:!0});const hr=gn,hF={message:({schemaCode:n})=>(0,hr.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,hr._)`{format: ${n}}`},pF={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hF,code(n,e){const{gen:t,data:r,$data:i,schema:o,schemaCode:s,it:a}=n,{opts:l,errSchemaPath:c,schemaEnv:u,self:f}=a;if(!l.validateFormats)return;i?d():h();function d(){const p=t.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=t.const("fDef",(0,hr._)`${p}[${s}]`),v=t.let("fType"),g=t.let("format");t.if((0,hr._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>t.assign(v,(0,hr._)`${m}.type || "string"`).assign(g,(0,hr._)`${m}.validate`),()=>t.assign(v,(0,hr._)`"string"`).assign(g,m)),n.fail$data((0,hr.or)(b(),y()));function b(){return l.strictSchema===!1?hr.nil:(0,hr._)`${s} && !${g}`}function y(){const x=u.$async?(0,hr._)`(${m}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,hr._)`${g}(${r})`,w=(0,hr._)`(typeof ${g} == "function" ? ${x} : ${g}.test(${r}))`;return(0,hr._)`${g} && ${g} !== true && ${v} === ${e} && !${w}`}}function h(){const p=f.formats[o];if(!p){b();return}if(p===!0)return;const[m,v,g]=y(p);m===e&&n.pass(x());function b(){if(l.strictSchema===!1){f.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${o}" ignored in schema at path "${c}"`}}function y(w){const $=w instanceof RegExp?(0,hr.regexpCode)(w):l.code.formats?(0,hr._)`${l.code.formats}${(0,hr.getProperty)(o)}`:void 0,S=t.scopeValue("formats",{key:o,ref:w,code:$});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,hr._)`${S}.validate`]:["string",w,S]}function x(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!u.$async)throw new Error("async format in sync schema");return(0,hr._)`await ${g}(${r})`}return typeof v=="function"?(0,hr._)`${g}(${r})`:(0,hr._)`${g}.test(${r})`}}}};E0.default=pF;Object.defineProperty(M0,"__esModule",{value:!0});const mF=E0,gF=[mF.default];M0.default=gF;var _l={};Object.defineProperty(_l,"__esModule",{value:!0});_l.contentVocabulary=_l.metadataVocabulary=void 0;_l.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];_l.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(e0,"__esModule",{value:!0});const vF=t0,yF=r0,bF=m0,wF=M0,i2=_l,xF=[vF.default,yF.default,(0,bF.default)(),wF.default,i2.metadataVocabulary,i2.contentVocabulary];e0.default=xF;var A0={},DC={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(n.DiscrError||(n.DiscrError={}))})(DC);Object.defineProperty(A0,"__esModule",{value:!0});const Ya=gn,wg=DC,o2=fi,jF=$n,$F={message:({params:{discrError:n,tagName:e}})=>n===wg.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,Ya._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},kF={keyword:"discriminator",type:"object",schemaType:"object",error:$F,code(n){const{gen:e,data:t,schema:r,parentSchema:i,it:o}=n,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=e.let("valid",!1),c=e.const("tag",(0,Ya._)`${t}${(0,Ya.getProperty)(a)}`);e.if((0,Ya._)`typeof ${c} == "string"`,()=>u(),()=>n.error(!1,{discrError:wg.DiscrError.Tag,tag:c,tagName:a})),n.ok(l);function u(){const h=d();e.if(!1);for(const p in h)e.elseIf((0,Ya._)`${c} === ${p}`),e.assign(l,f(h[p]));e.else(),n.error(!1,{discrError:wg.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function f(h){const p=e.name("valid"),m=n.subschema({keyword:"oneOf",schemaProp:h},p);return n.mergeEvaluated(m,Ya.Name),p}function d(){var h;const p={},m=g(i);let v=!0;for(let x=0;xthis.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const p=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(p,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}n.exports=e=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=io;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=gn;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=Au;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var d=Tu;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(zb,zb.exports);var PF={};(function(n){(function(e){function t(L){return L!==null?Object.prototype.toString.call(L)==="[object Array]":!1}function r(L){return L!==null?Object.prototype.toString.call(L)==="[object Object]":!1}function i(L,ne){if(L===ne)return!0;var se=Object.prototype.toString.call(L);if(se!==Object.prototype.toString.call(ne))return!1;if(t(L)===!0){if(L.length!==ne.length)return!1;for(var ge=0;ge",9:"Array"},y="EOF",x="UnquotedIdentifier",w="QuotedIdentifier",$="Rbracket",S="Rparen",_="Comma",F="Colon",I="Rbrace",W="Number",D="Current",U="Expref",q="Pipe",X="Or",K="And",Y="EQ",T="GT",B="LT",O="GTE",A="LTE",te="NE",R="Flatten",k="Star",P="Filter",H="Dot",J="Not",he="Lbrace",Se="Lbracket",pe="Lparen",ae="Literal",Qe={".":H,"*":k,",":_,":":F,"{":he,"}":I,"]":$,"(":pe,")":S,"@":D},et={"<":!0,">":!0,"=":!0,"!":!0},tn={" ":!0," ":!0,"\n":!0};function Qt(L){return L>="a"&&L<="z"||L>="A"&&L<="Z"||L==="_"}function oe(L){return L>="0"&&L<="9"||L==="-"}function st(L){return L>="a"&&L<="z"||L>="A"&&L<="Z"||L>="0"&&L<="9"||L==="_"}function Ht(){}Ht.prototype={tokenize:function(L){var ne=[];this._current=0;for(var se,ge,ke;this._current")return L[this._current]==="="?(this._current++,{type:O,value:">=",start:ne}):{type:T,value:">",start:ne};if(se==="="&&L[this._current]==="=")return this._current++,{type:Y,value:"==",start:ne}},_consumeLiteral:function(L){this._current++;for(var ne=this._current,se=L.length,ge;L[this._current]!=="`"&&this._current=0)return!0;if(se.indexOf(L)>=0)return!0;if(ge.indexOf(L[0])>=0)try{return JSON.parse(L),!0}catch{return!1}else return!1}};var qe={};qe[y]=0,qe[x]=0,qe[w]=0,qe[$]=0,qe[S]=0,qe[_]=0,qe[I]=0,qe[W]=0,qe[D]=0,qe[U]=0,qe[q]=1,qe[X]=2,qe[K]=3,qe[Y]=5,qe[T]=5,qe[B]=5,qe[O]=5,qe[A]=5,qe[te]=5,qe[R]=9,qe[k]=20,qe[P]=21,qe[H]=40,qe[J]=45,qe[he]=50,qe[Se]=55,qe[pe]=60;function Dt(){}Dt.prototype={parse:function(L){this._loadTokens(L),this.index=0;var ne=this.expression(0);if(this._lookahead(0)!==y){var se=this._lookaheadToken(0),ge=new Error("Unexpected token type: "+se.type+", value: "+se.value);throw ge.name="ParserError",ge}return ne},_loadTokens:function(L){var ne=new Ht,se=ne.tokenize(L);se.push({type:y,value:"",start:L.length}),this.tokens=se},expression:function(L){var ne=this._lookaheadToken(0);this._advance();for(var se=this.nud(ne),ge=this._lookahead(0);L=0)return this.expression(L);if(ne===Se)return this._match(Se),this._parseMultiselectList();if(ne===he)return this._match(he),this._parseMultiselectHash()},_parseProjectionRHS:function(L){var ne;if(qe[this._lookahead(0)]<10)ne={type:"Identity"};else if(this._lookahead(0)===Se)ne=this.expression(L);else if(this._lookahead(0)===P)ne=this.expression(L);else if(this._lookahead(0)===H)this._match(H),ne=this._parseDotRHS(L);else{var se=this._lookaheadToken(0),ge=new Error("Sytanx error, unexpected token: "+se.value+"("+se.type+")");throw ge.name="ParserError",ge}return ne},_parseMultiselectList:function(){for(var L=[];this._lookahead(0)!==$;){var ne=this.expression(0);if(L.push(ne),this._lookahead(0)===_&&(this._match(_),this._lookahead(0)===$))throw new Error("Unexpected token Rbracket")}return this._match($),{type:"MultiSelectList",children:L}},_parseMultiselectHash:function(){for(var L=[],ne=[x,w],se,ge,ke,Re;;){if(se=this._lookaheadToken(0),ne.indexOf(se.type)<0)throw new Error("Expecting an identifier token, got: "+se.type);if(ge=se.value,this._advance(),this._match(F),ke=this.expression(0),Re={type:"KeyValuePair",name:ge,value:ke},L.push(Re),this._lookahead(0)===_)this._match(_);else if(this._lookahead(0)===I){this._match(I);break}}return{type:"MultiSelectHash",children:L}}};function He(L){this.runtime=L}He.prototype={search:function(L,ne){return this.visit(L,ne)},visit:function(L,ne){var se,ge,ke,Re,at,rt,Xt,Zt,Wt,Ge;switch(L.type){case"Field":return ne!==null&&r(ne)?(rt=ne[L.name],rt===void 0?null:rt):null;case"Subexpression":for(ke=this.visit(L.children[0],ne),Ge=1;Ge0)for(Ge=Mn;GeDn;Ge+=er)ke.push(ne[Ge]);return ke;case"Projection":var fn=this.visit(L.children[0],ne);if(!t(fn))return null;for(Wt=[],Ge=0;Geat;break;case O:ke=Re>=at;break;case B:ke=Re=L&&(ne=se<0?L-1:L),ne}};function wt(L){this._interpreter=L,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[v]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[u,f]},{types:[c]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[u]},{types:[u]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[u,f,d]}]},map:{_func:this._functionMap,_signature:[{types:[p]},{types:[f]}]},max:{_func:this._functionMax,_signature:[{types:[v,g]}]},merge:{_func:this._functionMerge,_signature:[{types:[d],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[f]},{types:[p]}]},sum:{_func:this._functionSum,_signature:[{types:[v]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[u]},{types:[u]}]},min:{_func:this._functionMin,_signature:[{types:[v,g]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[f]},{types:[p]}]},type:{_func:this._functionType,_signature:[{types:[c]}]},keys:{_func:this._functionKeys,_signature:[{types:[d]}]},values:{_func:this._functionValues,_signature:[{types:[d]}]},sort:{_func:this._functionSort,_signature:[{types:[g,v]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[f]},{types:[p]}]},join:{_func:this._functionJoin,_signature:[{types:[u]},{types:[g]}]},reverse:{_func:this._functionReverse,_signature:[{types:[u,f]}]},to_array:{_func:this._functionToArray,_signature:[{types:[c]}]},to_string:{_func:this._functionToString,_signature:[{types:[c]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[c]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[c],variadic:!0}]}}}wt.prototype={callFunction:function(L,ne){var se=this.functionTable[L];if(se===void 0)throw new Error("Unknown function: "+L+"()");return this._validateArgs(L,ne,se._signature),se._func.call(this,ne)},_validateArgs:function(L,ne,se){var ge;if(se[se.length-1].variadic){if(ne.length=0;ke--)ge+=se[ke];return ge}else{var Re=L[0].slice(0);return Re.reverse(),Re}},_functionAbs:function(L){return Math.abs(L[0])},_functionCeil:function(L){return Math.ceil(L[0])},_functionAvg:function(L){for(var ne=0,se=L[0],ge=0;ge=0},_functionFloor:function(L){return Math.floor(L[0])},_functionLength:function(L){return r(L[0])?Object.keys(L[0]).length:L[0].length},_functionMap:function(L){for(var ne=[],se=this._interpreter,ge=L[0],ke=L[1],Re=0;Re0){var ne=this._getTypeName(L[0][0]);if(ne===l)return Math.max.apply(Math,L[0]);for(var se=L[0],ge=se[0],ke=1;ke0){var ne=this._getTypeName(L[0][0]);if(ne===l)return Math.min.apply(Math,L[0]);for(var se=L[0],ge=se[0],ke=1;keOn?1:Geke&&(ke=at,Re=se[rt]);return Re},_functionMinBy:function(L){for(var ne=L[1],se=L[0],ge=this.createKeyFunction(ne,[l,u]),ke=1/0,Re,at,rt=0;rt=0||(u[l]=s[l]);return u}(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function au(n,e){var t=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Hh(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return s=l.done,l},e:function(l){a=!0,o=l},f:function(){try{s||t.return==null||t.return()}finally{if(a)throw o}}}}function Pe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Pe=function(){return e};var n,e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(K,Y,T){K[Y]=T.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(K,Y,T){return Object.defineProperty(K,Y,{value:T,enumerable:!0,configurable:!0,writable:!0}),K[Y]}try{c({},"")}catch{c=function(Y,T,B){return Y[T]=B}}function u(K,Y,T,B){var O=Y&&Y.prototype instanceof g?Y:g,A=Object.create(O.prototype),te=new q(B||[]);return i(A,"_invoke",{value:I(K,T,te)}),A}function f(K,Y,T){try{return{type:"normal",arg:K.call(Y,T)}}catch(B){return{type:"throw",arg:B}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function g(){}function b(){}function y(){}var x={};c(x,s,function(){return this});var w=Object.getPrototypeOf,$=w&&w(w(X([])));$&&$!==t&&r.call($,s)&&(x=$);var S=y.prototype=g.prototype=Object.create(x);function _(K){["next","throw","return"].forEach(function(Y){c(K,Y,function(T){return this._invoke(Y,T)})})}function F(K,Y){function T(O,A,te,R){var k=f(K[O],K,A);if(k.type!=="throw"){var P=k.arg,H=P.value;return H&&sr(H)=="object"&&r.call(H,"__await")?Y.resolve(H.__await).then(function(J){T("next",J,te,R)},function(J){T("throw",J,te,R)}):Y.resolve(H).then(function(J){P.value=J,te(P)},function(J){return T("throw",J,te,R)})}R(k.arg)}var B;i(this,"_invoke",{value:function(O,A){function te(){return new Y(function(R,k){T(O,A,R,k)})}return B=B?B.then(te,te):te()}})}function I(K,Y,T){var B=d;return function(O,A){if(B===p)throw Error("Generator is already running");if(B===m){if(O==="throw")throw A;return{value:n,done:!0}}for(T.method=O,T.arg=A;;){var te=T.delegate;if(te){var R=W(te,T);if(R){if(R===v)continue;return R}}if(T.method==="next")T.sent=T._sent=T.arg;else if(T.method==="throw"){if(B===d)throw B=m,T.arg;T.dispatchException(T.arg)}else T.method==="return"&&T.abrupt("return",T.arg);B=p;var k=f(K,Y,T);if(k.type==="normal"){if(B=T.done?m:h,k.arg===v)continue;return{value:k.arg,done:T.done}}k.type==="throw"&&(B=m,T.method="throw",T.arg=k.arg)}}}function W(K,Y){var T=Y.method,B=K.iterator[T];if(B===n)return Y.delegate=null,T==="throw"&&K.iterator.return&&(Y.method="return",Y.arg=n,W(K,Y),Y.method==="throw")||T!=="return"&&(Y.method="throw",Y.arg=new TypeError("The iterator does not provide a '"+T+"' method")),v;var O=f(B,K.iterator,Y.arg);if(O.type==="throw")return Y.method="throw",Y.arg=O.arg,Y.delegate=null,v;var A=O.arg;return A?A.done?(Y[K.resultName]=A.value,Y.next=K.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=n),Y.delegate=null,v):A:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,v)}function D(K){var Y={tryLoc:K[0]};1 in K&&(Y.catchLoc=K[1]),2 in K&&(Y.finallyLoc=K[2],Y.afterLoc=K[3]),this.tryEntries.push(Y)}function U(K){var Y=K.completion||{};Y.type="normal",delete Y.arg,K.completion=Y}function q(K){this.tryEntries=[{tryLoc:"root"}],K.forEach(D,this),this.reset(!0)}function X(K){if(K||K===""){var Y=K[s];if(Y)return Y.call(K);if(typeof K.next=="function")return K;if(!isNaN(K.length)){var T=-1,B=function O(){for(;++T=0;--B){var O=this.tryEntries[B],A=O.completion;if(O.tryLoc==="root")return T("end");if(O.tryLoc<=this.prev){var te=r.call(O,"catchLoc"),R=r.call(O,"finallyLoc");if(te&&R){if(this.prev=0;--T){var B=this.tryEntries[T];if(B.tryLoc<=this.prev&&r.call(B,"finallyLoc")&&this.prev=0;--Y){var T=this.tryEntries[Y];if(T.finallyLoc===K)return this.complete(T.completion,T.afterLoc),U(T),v}},catch:function(K){for(var Y=this.tryEntries.length-1;Y>=0;--Y){var T=this.tryEntries[Y];if(T.tryLoc===K){var B=T.completion;if(B.type==="throw"){var O=B.arg;U(T)}return O}}throw Error("illegal catch attempt")},delegateYield:function(K,Y,T){return this.delegate={iterator:X(K),resultName:Y,nextLoc:T},this.method==="next"&&(this.arg=n),v}},e}function s2(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function $t(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){s2(o,r,i,s,a,"next",l)}function a(l){s2(o,r,i,s,a,"throw",l)}s(void 0)})}}function At(n,e){return zC(n)||function(t,r){var i=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var o,s,a,l,c=[],u=!0,f=!1;try{if(a=(i=i.call(t)).next,r===0){if(Object(i)!==i)return;u=!1}else for(;!(u=(o=a.call(i)).done)&&(c.push(o.value),c.length!==r);u=!0);}catch(d){f=!0,s=d}finally{try{if(!u&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(f)throw s}}return c}}(n,e)||Hh(n,e)||BC()}function BC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zC(n){if(Array.isArray(n))return n}function dt(n,e,t){return e=Ud(e),function(r,i){if(i&&(sr(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,FC()?Reflect.construct(e,t||[],Ud(n).constructor):e.apply(n,t))}function FC(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FC=function(){return!!n})()}function Ud(n){return Ud=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ud(n)}function ht(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&xg(n,e)}function xg(n,e){return xg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},xg(n,e)}function a2(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fe(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t32){for(var e=[],t=n.ctx.length/32,r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.bubbles,i=r!==void 0&&r,o=t.cancelable;return new CustomEvent(n,{detail:e,bubbles:i,cancelable:o!==void 0&&o})}function Lo(n,e){return new n(e)}var lu,Jd=new Map,$g=0;function d2(n,e,t,r,i,o,s){for(var a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,l=16.666/r,c=`{ + deps: ${u}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:n.error,code(l){const[c,u]=o(l);s(l,c),a(l,u)}};function o({schema:l}){const c={},u={};for(const f in l){if(f==="__proto__")continue;const d=Array.isArray(l[f])?c:u;d[f]=l[f]}return[c,u]}function s(l,c=l.schema){const{gen:u,data:f,it:d}=l;if(Object.keys(c).length===0)return;const h=u.let("missing");for(const p in c){const m=c[p];if(m.length===0)continue;const v=(0,r.propertyInData)(u,f,p,d.opts.ownProperties);l.setParams({property:p,depsCount:m.length,deps:m.join(", ")}),d.allErrors?u.if(v,()=>{for(const g of m)(0,r.checkReportMissingProp)(l,g)}):(u.if((0,e._)`${v} && (${(0,r.checkMissingProp)(l,m,h)})`),(0,r.reportMissingProp)(l,h),u.else())}}n.validatePropertyDeps=s;function a(l,c=l.schema){const{gen:u,data:f,keyword:d,it:h}=l,p=u.name("valid");for(const m in c)(0,t.alwaysValidSchema)(h,c[m])||(u.if((0,r.propertyInData)(u,f,m,h.opts.ownProperties),()=>{const v=l.subschema({keyword:d,schemaProp:m},p);l.mergeValidEvaluated(v,p)},()=>u.var(p,!0)),l.ok(p))}n.validateSchemaDeps=a,n.default=i})(RC);var w0={};Object.defineProperty(w0,"__esModule",{value:!0});const NC=gn,Mz=$n,Ez={message:"property name must be valid",params:({params:n})=>(0,NC._)`{propertyName: ${n.propertyName}}`},Az={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Ez,code(n){const{gen:e,schema:t,data:r,it:i}=n;if((0,Mz.alwaysValidSchema)(i,t))return;const o=e.name("valid");e.forIn("key",r,s=>{n.setParams({propertyName:s}),n.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,NC.not)(o),()=>{n.error(!0),i.allErrors||e.break()})}),n.ok(o)}};w0.default=Az;var Vh={};Object.defineProperty(Vh,"__esModule",{value:!0});const Cf=pn,Yi=gn,Tz=qo,Of=$n,Pz={message:"must NOT have additional properties",params:({params:n})=>(0,Yi._)`{additionalProperty: ${n.additionalProperty}}`},_z={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Pz,code(n){const{gen:e,schema:t,parentSchema:r,data:i,errsCount:o,it:s}=n;if(!o)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=s;if(s.props=!0,l.removeAdditional!=="all"&&(0,Of.alwaysValidSchema)(s,t))return;const c=(0,Cf.allSchemaProperties)(r.properties),u=(0,Cf.allSchemaProperties)(r.patternProperties);f(),n.ok((0,Yi._)`${o} === ${Tz.default.errors}`);function f(){e.forIn("key",i,v=>{!c.length&&!u.length?p(v):e.if(d(v),()=>p(v))})}function d(v){let g;if(c.length>8){const b=(0,Of.schemaRefOrVal)(s,r.properties,"properties");g=(0,Cf.isOwnProperty)(e,b,v)}else c.length?g=(0,Yi.or)(...c.map(b=>(0,Yi._)`${v} === ${b}`)):g=Yi.nil;return u.length&&(g=(0,Yi.or)(g,...u.map(b=>(0,Yi._)`${(0,Cf.usePattern)(n,b)}.test(${v})`))),(0,Yi.not)(g)}function h(v){e.code((0,Yi._)`delete ${i}[${v}]`)}function p(v){if(l.removeAdditional==="all"||l.removeAdditional&&t===!1){h(v);return}if(t===!1){n.setParams({additionalProperty:v}),n.error(),a||e.break();return}if(typeof t=="object"&&!(0,Of.alwaysValidSchema)(s,t)){const g=e.name("valid");l.removeAdditional==="failing"?(m(v,g,!1),e.if((0,Yi.not)(g),()=>{n.reset(),h(v)})):(m(v,g),a||e.if((0,Yi.not)(g),()=>e.break()))}}function m(v,g,b){const y={keyword:"additionalProperties",dataProp:v,dataPropType:Of.Type.Str};b===!1&&Object.assign(y,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(y,g)}}};Vh.default=_z;var j0={};Object.defineProperty(j0,"__esModule",{value:!0});const Rz=io,Zb=pn,qp=$n,e2=Vh,Nz={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:e,schema:t,parentSchema:r,data:i,it:o}=n;o.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&e2.default.code(new Rz.KeywordCxt(o,e2.default,"additionalProperties"));const s=(0,Zb.allSchemaProperties)(t);for(const f of s)o.definedProperties.add(f);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=qp.mergeEvaluated.props(e,(0,qp.toHash)(s),o.props));const a=s.filter(f=>!(0,qp.alwaysValidSchema)(o,t[f]));if(a.length===0)return;const l=e.name("valid");for(const f of a)c(f)?u(f):(e.if((0,Zb.propertyInData)(e,i,f,o.opts.ownProperties)),u(f),o.allErrors||e.else().var(l,!0),e.endIf()),n.it.definedProperties.add(f),n.ok(l);function c(f){return o.opts.useDefaults&&!o.compositeRule&&t[f].default!==void 0}function u(f){n.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};j0.default=Nz;var x0={};Object.defineProperty(x0,"__esModule",{value:!0});const t2=pn,Mf=gn,n2=$n,r2=$n,Iz={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:e,schema:t,data:r,parentSchema:i,it:o}=n,{opts:s}=o,a=(0,t2.allSchemaProperties)(t),l=a.filter(m=>(0,n2.alwaysValidSchema)(o,t[m]));if(a.length===0||l.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;const c=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof Mf.Name)&&(o.props=(0,r2.evaluatedPropsToName)(e,o.props));const{props:f}=o;d();function d(){for(const m of a)c&&h(m),o.allErrors?p(m):(e.var(u,!0),p(m),e.if(u))}function h(m){for(const v in c)new RegExp(m).test(v)&&(0,n2.checkStrictMode)(o,`property ${v} matches pattern ${m} (use allowMatchingProperties)`)}function p(m){e.forIn("key",r,v=>{e.if((0,Mf._)`${(0,t2.usePattern)(n,m)}.test(${v})`,()=>{const g=l.includes(m);g||n.subschema({keyword:"patternProperties",schemaProp:m,dataProp:v,dataPropType:r2.Type.Str},u),o.opts.unevaluated&&f!==!0?e.assign((0,Mf._)`${f}[${v}]`,!0):!g&&!o.allErrors&&e.if((0,Mf.not)(u),()=>e.break())})})}}};x0.default=Iz;var $0={};Object.defineProperty($0,"__esModule",{value:!0});const Dz=$n,Lz={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:e,schema:t,it:r}=n;if((0,Dz.alwaysValidSchema)(r,t)){n.fail();return}const i=e.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),n.failResult(i,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};$0.default=Lz;var k0={};Object.defineProperty(k0,"__esModule",{value:!0});const Bz=pn,zz={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Bz.validateUnion,error:{message:"must match a schema in anyOf"}};k0.default=zz;var S0={};Object.defineProperty(S0,"__esModule",{value:!0});const rd=gn,Fz=$n,qz={message:"must match exactly one schema in oneOf",params:({params:n})=>(0,rd._)`{passingSchemas: ${n.passing}}`},Vz={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:qz,code(n){const{gen:e,schema:t,parentSchema:r,it:i}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&r.discriminator)return;const o=t,s=e.let("valid",!1),a=e.let("passing",null),l=e.name("_valid");n.setParams({passing:a}),e.block(c),n.result(s,()=>n.reset(),()=>n.error(!0));function c(){o.forEach((u,f)=>{let d;(0,Fz.alwaysValidSchema)(i,u)?e.var(l,!0):d=n.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&e.if((0,rd._)`${l} && ${s}`).assign(s,!1).assign(a,(0,rd._)`[${a}, ${f}]`).else(),e.if(l,()=>{e.assign(s,!0),e.assign(a,f),d&&n.mergeEvaluated(d,rd.Name)})})}}};S0.default=Vz;var C0={};Object.defineProperty(C0,"__esModule",{value:!0});const Hz=$n,Uz={keyword:"allOf",schemaType:"array",code(n){const{gen:e,schema:t,it:r}=n;if(!Array.isArray(t))throw new Error("ajv implementation error");const i=e.name("valid");t.forEach((o,s)=>{if((0,Hz.alwaysValidSchema)(r,o))return;const a=n.subschema({keyword:"allOf",schemaProp:s},i);n.ok(i),n.mergeEvaluated(a)})}};C0.default=Uz;var O0={};Object.defineProperty(O0,"__esModule",{value:!0});const Hd=gn,IC=$n,Wz={message:({params:n})=>(0,Hd.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,Hd._)`{failingKeyword: ${n.ifClause}}`},Jz={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Wz,code(n){const{gen:e,parentSchema:t,it:r}=n;t.then===void 0&&t.else===void 0&&(0,IC.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const i=i2(r,"then"),o=i2(r,"else");if(!i&&!o)return;const s=e.let("valid",!0),a=e.name("_valid");if(l(),n.reset(),i&&o){const u=e.let("ifClause");n.setParams({ifClause:u}),e.if(a,c("then",u),c("else",u))}else i?e.if(a,c("then")):e.if((0,Hd.not)(a),c("else"));n.pass(s,()=>n.error(!0));function l(){const u=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);n.mergeEvaluated(u)}function c(u,f){return()=>{const d=n.subschema({keyword:u},a);e.assign(s,a),n.mergeValidEvaluated(d,s),f?e.assign(f,(0,Hd._)`${u}`):n.setParams({ifClause:u})}}}};function i2(n,e){const t=n.schema[e];return t!==void 0&&!(0,IC.alwaysValidSchema)(n,t)}O0.default=Jz;var M0={};Object.defineProperty(M0,"__esModule",{value:!0});const Kz=$n,Gz={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:e,it:t}){e.if===void 0&&(0,Kz.checkStrictMode)(t,`"${n}" without "if" is ignored`)}};M0.default=Gz;Object.defineProperty(g0,"__esModule",{value:!0});const Qz=Wl,Yz=v0,Xz=Jl,Zz=y0,eF=b0,tF=RC,nF=w0,rF=Vh,iF=j0,oF=x0,sF=$0,aF=k0,lF=S0,cF=C0,uF=O0,fF=M0;function dF(n=!1){const e=[sF.default,aF.default,lF.default,cF.default,uF.default,fF.default,nF.default,rF.default,tF.default,iF.default,oF.default];return n?e.push(Yz.default,Zz.default):e.push(Qz.default,Xz.default),e.push(eF.default),e}g0.default=dF;var E0={},A0={};Object.defineProperty(A0,"__esModule",{value:!0});const hr=gn,hF={message:({schemaCode:n})=>(0,hr.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,hr._)`{format: ${n}}`},pF={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:hF,code(n,e){const{gen:t,data:r,$data:i,schema:o,schemaCode:s,it:a}=n,{opts:l,errSchemaPath:c,schemaEnv:u,self:f}=a;if(!l.validateFormats)return;i?d():h();function d(){const p=t.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=t.const("fDef",(0,hr._)`${p}[${s}]`),v=t.let("fType"),g=t.let("format");t.if((0,hr._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>t.assign(v,(0,hr._)`${m}.type || "string"`).assign(g,(0,hr._)`${m}.validate`),()=>t.assign(v,(0,hr._)`"string"`).assign(g,m)),n.fail$data((0,hr.or)(b(),y()));function b(){return l.strictSchema===!1?hr.nil:(0,hr._)`${s} && !${g}`}function y(){const j=u.$async?(0,hr._)`(${m}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,hr._)`${g}(${r})`,w=(0,hr._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${r}))`;return(0,hr._)`${g} && ${g} !== true && ${v} === ${e} && !${w}`}}function h(){const p=f.formats[o];if(!p){b();return}if(p===!0)return;const[m,v,g]=y(p);m===e&&n.pass(j());function b(){if(l.strictSchema===!1){f.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${o}" ignored in schema at path "${c}"`}}function y(w){const $=w instanceof RegExp?(0,hr.regexpCode)(w):l.code.formats?(0,hr._)`${l.code.formats}${(0,hr.getProperty)(o)}`:void 0,S=t.scopeValue("formats",{key:o,ref:w,code:$});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,hr._)`${S}.validate`]:["string",w,S]}function j(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!u.$async)throw new Error("async format in sync schema");return(0,hr._)`await ${g}(${r})`}return typeof v=="function"?(0,hr._)`${g}(${r})`:(0,hr._)`${g}.test(${r})`}}}};A0.default=pF;Object.defineProperty(E0,"__esModule",{value:!0});const mF=A0,gF=[mF.default];E0.default=gF;var _l={};Object.defineProperty(_l,"__esModule",{value:!0});_l.contentVocabulary=_l.metadataVocabulary=void 0;_l.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];_l.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(t0,"__esModule",{value:!0});const vF=n0,yF=i0,bF=g0,wF=E0,o2=_l,jF=[vF.default,yF.default,(0,bF.default)(),wF.default,o2.metadataVocabulary,o2.contentVocabulary];t0.default=jF;var T0={},DC={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(n.DiscrError||(n.DiscrError={}))})(DC);Object.defineProperty(T0,"__esModule",{value:!0});const Ya=gn,wg=DC,s2=fi,xF=$n,$F={message:({params:{discrError:n,tagName:e}})=>n===wg.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:n,tag:e,tagName:t}})=>(0,Ya._)`{error: ${n}, tag: ${t}, tagValue: ${e}}`},kF={keyword:"discriminator",type:"object",schemaType:"object",error:$F,code(n){const{gen:e,data:t,schema:r,parentSchema:i,it:o}=n,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const l=e.let("valid",!1),c=e.const("tag",(0,Ya._)`${t}${(0,Ya.getProperty)(a)}`);e.if((0,Ya._)`typeof ${c} == "string"`,()=>u(),()=>n.error(!1,{discrError:wg.DiscrError.Tag,tag:c,tagName:a})),n.ok(l);function u(){const h=d();e.if(!1);for(const p in h)e.elseIf((0,Ya._)`${c} === ${p}`),e.assign(l,f(h[p]));e.else(),n.error(!1,{discrError:wg.DiscrError.Mapping,tag:c,tagName:a}),e.endIf()}function f(h){const p=e.name("valid"),m=n.subschema({keyword:"oneOf",schemaProp:h},p);return n.mergeEvaluated(m,Ya.Name),p}function d(){var h;const p={},m=g(i);let v=!0;for(let j=0;jthis.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const p=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(p,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}n.exports=e=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=io;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=gn;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=Au;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var d=Tu;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(Fb,Fb.exports);var PF={};(function(n){(function(e){function t(L){return L!==null?Object.prototype.toString.call(L)==="[object Array]":!1}function r(L){return L!==null?Object.prototype.toString.call(L)==="[object Object]":!1}function i(L,ne){if(L===ne)return!0;var se=Object.prototype.toString.call(L);if(se!==Object.prototype.toString.call(ne))return!1;if(t(L)===!0){if(L.length!==ne.length)return!1;for(var ge=0;ge",9:"Array"},y="EOF",j="UnquotedIdentifier",w="QuotedIdentifier",$="Rbracket",S="Rparen",_="Comma",F="Colon",I="Rbrace",W="Number",D="Current",U="Expref",q="Pipe",X="Or",K="And",Y="EQ",T="GT",B="LT",O="GTE",A="LTE",te="NE",R="Flatten",k="Star",P="Filter",H="Dot",J="Not",he="Lbrace",Se="Lbracket",pe="Lparen",ae="Literal",Qe={".":H,"*":k,",":_,":":F,"{":he,"}":I,"]":$,"(":pe,")":S,"@":D},et={"<":!0,">":!0,"=":!0,"!":!0},tn={" ":!0," ":!0,"\n":!0};function Qt(L){return L>="a"&&L<="z"||L>="A"&&L<="Z"||L==="_"}function oe(L){return L>="0"&&L<="9"||L==="-"}function st(L){return L>="a"&&L<="z"||L>="A"&&L<="Z"||L>="0"&&L<="9"||L==="_"}function Ht(){}Ht.prototype={tokenize:function(L){var ne=[];this._current=0;for(var se,ge,ke;this._current")return L[this._current]==="="?(this._current++,{type:O,value:">=",start:ne}):{type:T,value:">",start:ne};if(se==="="&&L[this._current]==="=")return this._current++,{type:Y,value:"==",start:ne}},_consumeLiteral:function(L){this._current++;for(var ne=this._current,se=L.length,ge;L[this._current]!=="`"&&this._current=0)return!0;if(se.indexOf(L)>=0)return!0;if(ge.indexOf(L[0])>=0)try{return JSON.parse(L),!0}catch{return!1}else return!1}};var qe={};qe[y]=0,qe[j]=0,qe[w]=0,qe[$]=0,qe[S]=0,qe[_]=0,qe[I]=0,qe[W]=0,qe[D]=0,qe[U]=0,qe[q]=1,qe[X]=2,qe[K]=3,qe[Y]=5,qe[T]=5,qe[B]=5,qe[O]=5,qe[A]=5,qe[te]=5,qe[R]=9,qe[k]=20,qe[P]=21,qe[H]=40,qe[J]=45,qe[he]=50,qe[Se]=55,qe[pe]=60;function Dt(){}Dt.prototype={parse:function(L){this._loadTokens(L),this.index=0;var ne=this.expression(0);if(this._lookahead(0)!==y){var se=this._lookaheadToken(0),ge=new Error("Unexpected token type: "+se.type+", value: "+se.value);throw ge.name="ParserError",ge}return ne},_loadTokens:function(L){var ne=new Ht,se=ne.tokenize(L);se.push({type:y,value:"",start:L.length}),this.tokens=se},expression:function(L){var ne=this._lookaheadToken(0);this._advance();for(var se=this.nud(ne),ge=this._lookahead(0);L=0)return this.expression(L);if(ne===Se)return this._match(Se),this._parseMultiselectList();if(ne===he)return this._match(he),this._parseMultiselectHash()},_parseProjectionRHS:function(L){var ne;if(qe[this._lookahead(0)]<10)ne={type:"Identity"};else if(this._lookahead(0)===Se)ne=this.expression(L);else if(this._lookahead(0)===P)ne=this.expression(L);else if(this._lookahead(0)===H)this._match(H),ne=this._parseDotRHS(L);else{var se=this._lookaheadToken(0),ge=new Error("Sytanx error, unexpected token: "+se.value+"("+se.type+")");throw ge.name="ParserError",ge}return ne},_parseMultiselectList:function(){for(var L=[];this._lookahead(0)!==$;){var ne=this.expression(0);if(L.push(ne),this._lookahead(0)===_&&(this._match(_),this._lookahead(0)===$))throw new Error("Unexpected token Rbracket")}return this._match($),{type:"MultiSelectList",children:L}},_parseMultiselectHash:function(){for(var L=[],ne=[j,w],se,ge,ke,Re;;){if(se=this._lookaheadToken(0),ne.indexOf(se.type)<0)throw new Error("Expecting an identifier token, got: "+se.type);if(ge=se.value,this._advance(),this._match(F),ke=this.expression(0),Re={type:"KeyValuePair",name:ge,value:ke},L.push(Re),this._lookahead(0)===_)this._match(_);else if(this._lookahead(0)===I){this._match(I);break}}return{type:"MultiSelectHash",children:L}}};function He(L){this.runtime=L}He.prototype={search:function(L,ne){return this.visit(L,ne)},visit:function(L,ne){var se,ge,ke,Re,at,rt,Xt,Zt,Wt,Ge;switch(L.type){case"Field":return ne!==null&&r(ne)?(rt=ne[L.name],rt===void 0?null:rt):null;case"Subexpression":for(ke=this.visit(L.children[0],ne),Ge=1;Ge0)for(Ge=Mn;GeDn;Ge+=er)ke.push(ne[Ge]);return ke;case"Projection":var fn=this.visit(L.children[0],ne);if(!t(fn))return null;for(Wt=[],Ge=0;Geat;break;case O:ke=Re>=at;break;case B:ke=Re=L&&(ne=se<0?L-1:L),ne}};function wt(L){this._interpreter=L,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[l]}]},avg:{_func:this._functionAvg,_signature:[{types:[v]}]},ceil:{_func:this._functionCeil,_signature:[{types:[l]}]},contains:{_func:this._functionContains,_signature:[{types:[u,f]},{types:[c]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[u]},{types:[u]}]},floor:{_func:this._functionFloor,_signature:[{types:[l]}]},length:{_func:this._functionLength,_signature:[{types:[u,f,d]}]},map:{_func:this._functionMap,_signature:[{types:[p]},{types:[f]}]},max:{_func:this._functionMax,_signature:[{types:[v,g]}]},merge:{_func:this._functionMerge,_signature:[{types:[d],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[f]},{types:[p]}]},sum:{_func:this._functionSum,_signature:[{types:[v]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[u]},{types:[u]}]},min:{_func:this._functionMin,_signature:[{types:[v,g]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[f]},{types:[p]}]},type:{_func:this._functionType,_signature:[{types:[c]}]},keys:{_func:this._functionKeys,_signature:[{types:[d]}]},values:{_func:this._functionValues,_signature:[{types:[d]}]},sort:{_func:this._functionSort,_signature:[{types:[g,v]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[f]},{types:[p]}]},join:{_func:this._functionJoin,_signature:[{types:[u]},{types:[g]}]},reverse:{_func:this._functionReverse,_signature:[{types:[u,f]}]},to_array:{_func:this._functionToArray,_signature:[{types:[c]}]},to_string:{_func:this._functionToString,_signature:[{types:[c]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[c]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[c],variadic:!0}]}}}wt.prototype={callFunction:function(L,ne){var se=this.functionTable[L];if(se===void 0)throw new Error("Unknown function: "+L+"()");return this._validateArgs(L,ne,se._signature),se._func.call(this,ne)},_validateArgs:function(L,ne,se){var ge;if(se[se.length-1].variadic){if(ne.length=0;ke--)ge+=se[ke];return ge}else{var Re=L[0].slice(0);return Re.reverse(),Re}},_functionAbs:function(L){return Math.abs(L[0])},_functionCeil:function(L){return Math.ceil(L[0])},_functionAvg:function(L){for(var ne=0,se=L[0],ge=0;ge=0},_functionFloor:function(L){return Math.floor(L[0])},_functionLength:function(L){return r(L[0])?Object.keys(L[0]).length:L[0].length},_functionMap:function(L){for(var ne=[],se=this._interpreter,ge=L[0],ke=L[1],Re=0;Re0){var ne=this._getTypeName(L[0][0]);if(ne===l)return Math.max.apply(Math,L[0]);for(var se=L[0],ge=se[0],ke=1;ke0){var ne=this._getTypeName(L[0][0]);if(ne===l)return Math.min.apply(Math,L[0]);for(var se=L[0],ge=se[0],ke=1;keOn?1:Geke&&(ke=at,Re=se[rt]);return Re},_functionMinBy:function(L){for(var ne=L[1],se=L[0],ge=this.createKeyFunction(ne,[l,u]),ke=1/0,Re,at,rt=0;rt=0||(u[l]=s[l]);return u}(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function au(n,e){var t=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Hh(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return s=l.done,l},e:function(l){a=!0,o=l},f:function(){try{s||t.return==null||t.return()}finally{if(a)throw o}}}}function Pe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Pe=function(){return e};var n,e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(K,Y,T){K[Y]=T.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(K,Y,T){return Object.defineProperty(K,Y,{value:T,enumerable:!0,configurable:!0,writable:!0}),K[Y]}try{c({},"")}catch{c=function(Y,T,B){return Y[T]=B}}function u(K,Y,T,B){var O=Y&&Y.prototype instanceof g?Y:g,A=Object.create(O.prototype),te=new q(B||[]);return i(A,"_invoke",{value:I(K,T,te)}),A}function f(K,Y,T){try{return{type:"normal",arg:K.call(Y,T)}}catch(B){return{type:"throw",arg:B}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",v={};function g(){}function b(){}function y(){}var j={};c(j,s,function(){return this});var w=Object.getPrototypeOf,$=w&&w(w(X([])));$&&$!==t&&r.call($,s)&&(j=$);var S=y.prototype=g.prototype=Object.create(j);function _(K){["next","throw","return"].forEach(function(Y){c(K,Y,function(T){return this._invoke(Y,T)})})}function F(K,Y){function T(O,A,te,R){var k=f(K[O],K,A);if(k.type!=="throw"){var P=k.arg,H=P.value;return H&&sr(H)=="object"&&r.call(H,"__await")?Y.resolve(H.__await).then(function(J){T("next",J,te,R)},function(J){T("throw",J,te,R)}):Y.resolve(H).then(function(J){P.value=J,te(P)},function(J){return T("throw",J,te,R)})}R(k.arg)}var B;i(this,"_invoke",{value:function(O,A){function te(){return new Y(function(R,k){T(O,A,R,k)})}return B=B?B.then(te,te):te()}})}function I(K,Y,T){var B=d;return function(O,A){if(B===p)throw Error("Generator is already running");if(B===m){if(O==="throw")throw A;return{value:n,done:!0}}for(T.method=O,T.arg=A;;){var te=T.delegate;if(te){var R=W(te,T);if(R){if(R===v)continue;return R}}if(T.method==="next")T.sent=T._sent=T.arg;else if(T.method==="throw"){if(B===d)throw B=m,T.arg;T.dispatchException(T.arg)}else T.method==="return"&&T.abrupt("return",T.arg);B=p;var k=f(K,Y,T);if(k.type==="normal"){if(B=T.done?m:h,k.arg===v)continue;return{value:k.arg,done:T.done}}k.type==="throw"&&(B=m,T.method="throw",T.arg=k.arg)}}}function W(K,Y){var T=Y.method,B=K.iterator[T];if(B===n)return Y.delegate=null,T==="throw"&&K.iterator.return&&(Y.method="return",Y.arg=n,W(K,Y),Y.method==="throw")||T!=="return"&&(Y.method="throw",Y.arg=new TypeError("The iterator does not provide a '"+T+"' method")),v;var O=f(B,K.iterator,Y.arg);if(O.type==="throw")return Y.method="throw",Y.arg=O.arg,Y.delegate=null,v;var A=O.arg;return A?A.done?(Y[K.resultName]=A.value,Y.next=K.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=n),Y.delegate=null,v):A:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,v)}function D(K){var Y={tryLoc:K[0]};1 in K&&(Y.catchLoc=K[1]),2 in K&&(Y.finallyLoc=K[2],Y.afterLoc=K[3]),this.tryEntries.push(Y)}function U(K){var Y=K.completion||{};Y.type="normal",delete Y.arg,K.completion=Y}function q(K){this.tryEntries=[{tryLoc:"root"}],K.forEach(D,this),this.reset(!0)}function X(K){if(K||K===""){var Y=K[s];if(Y)return Y.call(K);if(typeof K.next=="function")return K;if(!isNaN(K.length)){var T=-1,B=function O(){for(;++T=0;--B){var O=this.tryEntries[B],A=O.completion;if(O.tryLoc==="root")return T("end");if(O.tryLoc<=this.prev){var te=r.call(O,"catchLoc"),R=r.call(O,"finallyLoc");if(te&&R){if(this.prev=0;--T){var B=this.tryEntries[T];if(B.tryLoc<=this.prev&&r.call(B,"finallyLoc")&&this.prev=0;--Y){var T=this.tryEntries[Y];if(T.finallyLoc===K)return this.complete(T.completion,T.afterLoc),U(T),v}},catch:function(K){for(var Y=this.tryEntries.length-1;Y>=0;--Y){var T=this.tryEntries[Y];if(T.tryLoc===K){var B=T.completion;if(B.type==="throw"){var O=B.arg;U(T)}return O}}throw Error("illegal catch attempt")},delegateYield:function(K,Y,T){return this.delegate={iterator:X(K),resultName:Y,nextLoc:T},this.method==="next"&&(this.arg=n),v}},e}function a2(n,e,t,r,i,o,s){try{var a=n[o](s),l=a.value}catch(c){return void t(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function $t(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function s(l){a2(o,r,i,s,a,"next",l)}function a(l){a2(o,r,i,s,a,"throw",l)}s(void 0)})}}function At(n,e){return zC(n)||function(t,r){var i=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var o,s,a,l,c=[],u=!0,f=!1;try{if(a=(i=i.call(t)).next,r===0){if(Object(i)!==i)return;u=!1}else for(;!(u=(o=a.call(i)).done)&&(c.push(o.value),c.length!==r);u=!0);}catch(d){f=!0,s=d}finally{try{if(!u&&i.return!=null&&(l=i.return(),Object(l)!==l))return}finally{if(f)throw s}}return c}}(n,e)||Hh(n,e)||BC()}function BC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zC(n){if(Array.isArray(n))return n}function dt(n,e,t){return e=Ud(e),function(r,i){if(i&&(sr(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,FC()?Reflect.construct(e,t||[],Ud(n).constructor):e.apply(n,t))}function FC(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FC=function(){return!!n})()}function Ud(n){return Ud=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ud(n)}function ht(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&jg(n,e)}function jg(n,e){return jg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},jg(n,e)}function l2(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function fe(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,r=new Array(e);t32){for(var e=[],t=n.ctx.length/32,r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.bubbles,i=r!==void 0&&r,o=t.cancelable;return new CustomEvent(n,{detail:e,bubbles:i,cancelable:o!==void 0&&o})}function Lo(n,e){return new n(e)}var lu,Jd=new Map,$g=0;function h2(n,e,t,r,i,o,s){for(var a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:0,l=16.666/r,c=`{ `,u=0;u<=1;u+=l){var f=e+(t-e)*o(u);c+=100*u+"%{".concat(s(f,1-f),`} `)}var d=c+"100% {".concat(s(t,1-t),`} -}`),h="__svelte_".concat(function(y){for(var x=5381,w=y.length;w--;)x=(x<<5)-x^y.charCodeAt(w);return x>>>0}(d),"_").concat(a),p=_0(n),m=Jd.get(p)||function(y,x){var w={stylesheet:IF(x),rules:{}};return Jd.set(y,w),w}(p,n),v=m.stylesheet,g=m.rules;g[h]||(g[h]=!0,v.insertRule("@keyframes ".concat(h," ").concat(d),v.cssRules.length));var b=n.style.animation||"";return n.style.animation="".concat(b?"".concat(b,", "):"").concat(h," ").concat(r,"ms linear ").concat(i,"ms 1 both"),$g+=1,h}function LF(n,e){var t=(n.style.animation||"").split(", "),r=t.filter(e?function(o){return o.indexOf(e)<0}:function(o){return o.indexOf("__svelte")===-1}),i=t.length-r.length;i&&(n.style.animation=r.join(", "),($g-=i)||T0(function(){$g||(Jd.forEach(function(o){var s=o.stylesheet.ownerNode;s&&Z(s)}),Jd.clear())}))}function Lc(n){lu=n}function Kl(){if(!lu)throw new Error("Function called outside component initialization");return lu}function Hi(n){Kl().$$.on_mount.push(n)}function Mi(n){Kl().$$.on_destroy.push(n)}function XC(){var n=Kl();return function(e,t){var r=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).cancelable,i=r!==void 0&&r,o=n.$$.callbacks[e];if(o){var s=YC(e,t,{cancelable:i});return o.slice().forEach(function(a){a.call(n,s)}),!s.defaultPrevented}return!0}}function ZC(n,e){return Kl().$$.context.set(n,e),e}function Er(n){return Kl().$$.context.get(n)}function Ef(n,e){var t=this,r=n.$$.callbacks[e.type];r&&r.slice().forEach(function(i){return i.call(t,e)})}var Xa=[],It=[],bl=[],kg=[],e4=Promise.resolve(),Sg=!1;function t4(){Sg||(Sg=!0,e4.then(n4))}function fr(){return t4(),e4}function Ma(n){bl.push(n)}function ii(n){kg.push(n)}var Af,Vp=new Set,Wa=0;function n4(){if(Wa===0){var n=lu;do{try{for(;Wal.start&&(a=f(l,y),l=null,Hp(n,a.b,"start"),_&&(u(),c=d2(n,s,a.b,a.duration,0,w,o.css))),a){if(I>=a.end)S(s=a.b,1-s),Hp(n,a.b,"end"),l||(a.b?u():--a.group.r||kn(a.group.c)),a=null;else if(I>=a.start){var W=I-a.start;s=a.a+a.d*w(W/a.duration),S(s,1-s)}}return!(!a&&!l)},Dc.size===0&&T0(GC),new Promise(function(I){Dc.add({c:p,f:I})}))}return{run:function(h){Mr(o)?(Af||(Af=Promise.resolve()).then(function(){Af=null}),Af).then(function(){o=o({direction:h?"in":"out"}),d(h)}):d(h)},end:function(){u(),a=l=null}}}function Mt(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function FF(n,e){n.d(1),e.delete(n.key)}function R0(n,e){M(n,1,1,function(){e.delete(n.key)})}function Uh(n,e,t,r,i,o,s,a,l,c,u,f){for(var d=n.length,h=o.length,p=d,m={};p--;)m[n[p].key]=p;var v=[],g=new Map,b=new Map,y=[];p=h;for(var x=function(){var U=f(i,o,p),q=t(U),X=s.get(q);X?r&&y.push(function(){return X.p(U,e)}):(X=c(q,U)).c(),g.set(q,v[p]=X),q in m&&b.set(q,Math.abs(p-m[q]))};p--;)x();var w=new Set,$=new Set;function S(U){C(U,1),U.m(a,u),s.set(U.key,U),u=U.first,h--}for(;d&&h;){var _=v[h-1],F=n[d-1],I=_.key,W=F.key;_===F?(u=_.first,d--,h--):g.has(W)?!s.has(I)||w.has(I)?S(_):$.has(W)?d--:b.get(I)>b.get(W)?($.add(I),S(_)):(w.add(W),d--):(l(F,s),d--)}for(;d--;){var D=n[d];g.has(D.key)||l(D,s)}for(;h;)S(v[h-1]);return kn(y),v}function Ui(n,e){for(var t={},r={},i={$$scope:1},o=n.length;o--;){var s=n[o],a=e[o];if(a){for(var l in s)l in a||(r[l]=1);for(var c in a)i[c]||(t[c]=a[c],i[c]=1);n[o]=a}else for(var u in s)i[u]=1}for(var f in r)f in t||(t[f]=void 0);return t}function Ea(n){return sr(n)==="object"&&n!==null?n:{}}function oi(n,e,t){var r=n.$$.props[e];r!==void 0&&(n.$$.bound[r]=t,t(n.$$.ctx[r]))}function je(n){n&&n.c()}function be(n,e,t){var r=n.$$,i=r.fragment,o=r.after_update;i&&i.m(e,t),Ma(function(){var s,a=n.$$.on_mount.map(UC).filter(Mr);n.$$.on_destroy?(s=n.$$.on_destroy).push.apply(s,Vt(a)):kn(a),n.$$.on_mount=[]}),o.forEach(Ma)}function we(n,e){var t,r,i,o=n.$$;o.fragment!==null&&(t=o.after_update,r=[],i=[],bl.forEach(function(s){return t.indexOf(s)===-1?r.push(s):i.push(s)}),i.forEach(function(s){return s()}),bl=r,kn(o.on_destroy),o.fragment&&o.fragment.d(e),o.on_destroy=o.fragment=null,o.ctx=[])}function pt(n,e,t,r,i,o){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[-1],l=lu;Lc(n);var c=n.$$={fragment:null,ctx:[],props:o,update:Te,not_equal:i,bound:c2(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:c2(),dirty:a,skip_bound:!1,root:e.target||l.$$.root};s&&s(c.root);var u=!1;if(c.ctx=t?t(n,e.props||{},function(d,h){var p=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:h;return c.ctx&&i(c.ctx[d],c.ctx[d]=p)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](p),u&&function(m,v){m.$$.dirty[0]===-1&&(Xa.push(m),t4(),m.$$.dirty.fill(0)),m.$$.dirty[v/31|0]|=1<1&&arguments[1]!==void 0?arguments[1]:function(r){var i=function(o){try{if(typeof window!="undefined"&&window.localStorage!==void 0)return window.localStorage[o]}catch{}}("debug");return i!=null&&i.endsWith("*")?r.startsWith(i.slice(0,-1)):r===i}(n);if(!e)return qF;var t=function(r){for(var i=0,o=0;o1&&arguments[1]!==void 0?arguments[1]:{},t=e.delay,r=t===void 0?0:t,i=e.duration,o=i===void 0?400:i,s=e.easing,a=s===void 0?HC:s,l=+getComputedStyle(n).opacity;return{delay:r,duration:o,easing:a,css:function(c){return"opacity: ".concat(c*l)}}}var HF=P0.window;function UF(n){Et(n,"svelte-n7cvum",`.svelte-n7cvum{box-sizing:border-box}.bg.svelte-n7cvum{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)}@supports (-webkit-touch-callout: none){}.wrap.svelte-n7cvum{position:relative;margin:2rem;max-height:100%}.window.svelte-n7cvum{position:relative;width:40rem;max-width:100%;max-height:100%;margin:2rem auto;color:black;border-radius:0.5rem;background:white}.content.svelte-n7cvum{position:relative;padding:1rem;max-height:calc(100vh - 4rem);overflow:auto}.close.svelte-n7cvum{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), +}`),h="__svelte_".concat(function(y){for(var j=5381,w=y.length;w--;)j=(j<<5)-j^y.charCodeAt(w);return j>>>0}(d),"_").concat(a),p=R0(n),m=Jd.get(p)||function(y,j){var w={stylesheet:IF(j),rules:{}};return Jd.set(y,w),w}(p,n),v=m.stylesheet,g=m.rules;g[h]||(g[h]=!0,v.insertRule("@keyframes ".concat(h," ").concat(d),v.cssRules.length));var b=n.style.animation||"";return n.style.animation="".concat(b?"".concat(b,", "):"").concat(h," ").concat(r,"ms linear ").concat(i,"ms 1 both"),$g+=1,h}function LF(n,e){var t=(n.style.animation||"").split(", "),r=t.filter(e?function(o){return o.indexOf(e)<0}:function(o){return o.indexOf("__svelte")===-1}),i=t.length-r.length;i&&(n.style.animation=r.join(", "),($g-=i)||P0(function(){$g||(Jd.forEach(function(o){var s=o.stylesheet.ownerNode;s&&Z(s)}),Jd.clear())}))}function Lc(n){lu=n}function Kl(){if(!lu)throw new Error("Function called outside component initialization");return lu}function Hi(n){Kl().$$.on_mount.push(n)}function Mi(n){Kl().$$.on_destroy.push(n)}function XC(){var n=Kl();return function(e,t){var r=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).cancelable,i=r!==void 0&&r,o=n.$$.callbacks[e];if(o){var s=YC(e,t,{cancelable:i});return o.slice().forEach(function(a){a.call(n,s)}),!s.defaultPrevented}return!0}}function ZC(n,e){return Kl().$$.context.set(n,e),e}function Er(n){return Kl().$$.context.get(n)}function Ef(n,e){var t=this,r=n.$$.callbacks[e.type];r&&r.slice().forEach(function(i){return i.call(t,e)})}var Xa=[],It=[],bl=[],kg=[],e4=Promise.resolve(),Sg=!1;function t4(){Sg||(Sg=!0,e4.then(n4))}function fr(){return t4(),e4}function Ma(n){bl.push(n)}function ii(n){kg.push(n)}var Af,Vp=new Set,Wa=0;function n4(){if(Wa===0){var n=lu;do{try{for(;Wal.start&&(a=f(l,y),l=null,Hp(n,a.b,"start"),_&&(u(),c=h2(n,s,a.b,a.duration,0,w,o.css))),a){if(I>=a.end)S(s=a.b,1-s),Hp(n,a.b,"end"),l||(a.b?u():--a.group.r||kn(a.group.c)),a=null;else if(I>=a.start){var W=I-a.start;s=a.a+a.d*w(W/a.duration),S(s,1-s)}}return!(!a&&!l)},Dc.size===0&&P0(GC),new Promise(function(I){Dc.add({c:p,f:I})}))}return{run:function(h){Mr(o)?(Af||(Af=Promise.resolve()).then(function(){Af=null}),Af).then(function(){o=o({direction:h?"in":"out"}),d(h)}):d(h)},end:function(){u(),a=l=null}}}function Mt(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function FF(n,e){n.d(1),e.delete(n.key)}function N0(n,e){M(n,1,1,function(){e.delete(n.key)})}function Uh(n,e,t,r,i,o,s,a,l,c,u,f){for(var d=n.length,h=o.length,p=d,m={};p--;)m[n[p].key]=p;var v=[],g=new Map,b=new Map,y=[];p=h;for(var j=function(){var U=f(i,o,p),q=t(U),X=s.get(q);X?r&&y.push(function(){return X.p(U,e)}):(X=c(q,U)).c(),g.set(q,v[p]=X),q in m&&b.set(q,Math.abs(p-m[q]))};p--;)j();var w=new Set,$=new Set;function S(U){C(U,1),U.m(a,u),s.set(U.key,U),u=U.first,h--}for(;d&&h;){var _=v[h-1],F=n[d-1],I=_.key,W=F.key;_===F?(u=_.first,d--,h--):g.has(W)?!s.has(I)||w.has(I)?S(_):$.has(W)?d--:b.get(I)>b.get(W)?($.add(I),S(_)):(w.add(W),d--):(l(F,s),d--)}for(;d--;){var D=n[d];g.has(D.key)||l(D,s)}for(;h;)S(v[h-1]);return kn(y),v}function Ui(n,e){for(var t={},r={},i={$$scope:1},o=n.length;o--;){var s=n[o],a=e[o];if(a){for(var l in s)l in a||(r[l]=1);for(var c in a)i[c]||(t[c]=a[c],i[c]=1);n[o]=a}else for(var u in s)i[u]=1}for(var f in r)f in t||(t[f]=void 0);return t}function Ea(n){return sr(n)==="object"&&n!==null?n:{}}function oi(n,e,t){var r=n.$$.props[e];r!==void 0&&(n.$$.bound[r]=t,t(n.$$.ctx[r]))}function xe(n){n&&n.c()}function be(n,e,t){var r=n.$$,i=r.fragment,o=r.after_update;i&&i.m(e,t),Ma(function(){var s,a=n.$$.on_mount.map(UC).filter(Mr);n.$$.on_destroy?(s=n.$$.on_destroy).push.apply(s,Vt(a)):kn(a),n.$$.on_mount=[]}),o.forEach(Ma)}function we(n,e){var t,r,i,o=n.$$;o.fragment!==null&&(t=o.after_update,r=[],i=[],bl.forEach(function(s){return t.indexOf(s)===-1?r.push(s):i.push(s)}),i.forEach(function(s){return s()}),bl=r,kn(o.on_destroy),o.fragment&&o.fragment.d(e),o.on_destroy=o.fragment=null,o.ctx=[])}function pt(n,e,t,r,i,o){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null,a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[-1],l=lu;Lc(n);var c=n.$$={fragment:null,ctx:[],props:o,update:Te,not_equal:i,bound:u2(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:u2(),dirty:a,skip_bound:!1,root:e.target||l.$$.root};s&&s(c.root);var u=!1;if(c.ctx=t?t(n,e.props||{},function(d,h){var p=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:h;return c.ctx&&i(c.ctx[d],c.ctx[d]=p)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](p),u&&function(m,v){m.$$.dirty[0]===-1&&(Xa.push(m),t4(),m.$$.dirty.fill(0)),m.$$.dirty[v/31|0]|=1<1&&arguments[1]!==void 0?arguments[1]:function(r){var i=function(o){try{if(typeof window!="undefined"&&window.localStorage!==void 0)return window.localStorage[o]}catch{}}("debug");return i!=null&&i.endsWith("*")?r.startsWith(i.slice(0,-1)):r===i}(n);if(!e)return qF;var t=function(r){for(var i=0,o=0;o1&&arguments[1]!==void 0?arguments[1]:{},t=e.delay,r=t===void 0?0:t,i=e.duration,o=i===void 0?400:i,s=e.easing,a=s===void 0?HC:s,l=+getComputedStyle(n).opacity;return{delay:r,duration:o,easing:a,css:function(c){return"opacity: ".concat(c*l)}}}var HF=_0.window;function UF(n){Et(n,"svelte-n7cvum",`.svelte-n7cvum{box-sizing:border-box}.bg.svelte-n7cvum{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)}@supports (-webkit-touch-callout: none){}.wrap.svelte-n7cvum{position:relative;margin:2rem;max-height:100%}.window.svelte-n7cvum{position:relative;width:40rem;max-width:100%;max-height:100%;margin:2rem auto;color:black;border-radius:0.5rem;background:white}.content.svelte-n7cvum{position:relative;padding:1rem;max-height:calc(100vh - 4rem);overflow:auto}.close.svelte-n7cvum{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), background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);-webkit-appearance:none}.close.svelte-n7cvum:before,.close.svelte-n7cvum: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), - background 0.2s cubic-bezier(0.25, 0.1, 0.25, 1)}.close.svelte-n7cvum: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-n7cvum: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-n7cvum:hover{background:black}.close.svelte-n7cvum:hover:before,.close.svelte-n7cvum:hover:after{height:2px;background:white}.close.svelte-n7cvum:focus{border-color:#3399ff;box-shadow:0 0 0 2px #3399ff}.close.svelte-n7cvum:active{transform:scale(0.9)}.close.svelte-n7cvum:hover,.close.svelte-n7cvum:focus,.close.svelte-n7cvum:active{outline:none}`)}function p2(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y=n[1].closeButton&&m2(n),x=n[2];return x&&(s=Lo(x,{})),{c:function(){e=V("div"),t=V("div"),r=V("div"),y&&y.c(),i=ce(),o=V("div"),s&&je(s.$$.fragment),j(o,"class",a=Vn(n[1].classContent)+" svelte-n7cvum"),j(o,"style",n[9]),$e(o,"content",!n[0]),j(r,"class",l=Vn(n[1].classWindow)+" svelte-n7cvum"),j(r,"role","dialog"),j(r,"aria-modal","true"),j(r,"aria-label",c=n[1].ariaLabelledBy?null:n[1].ariaLabel||null),j(r,"aria-labelledby",u=n[1].ariaLabelledBy||null),j(r,"style",n[8]),$e(r,"window",!n[0]),j(t,"class",d=Vn(n[1].classWindowWrap)+" svelte-n7cvum"),j(t,"style",n[7]),$e(t,"wrap",!n[0]),j(e,"aria-hidden","true"),j(e,"id",h=n[1].id),j(e,"class",p=Vn(n[1].classBg)+" svelte-n7cvum"),j(e,"style",n[6]),$e(e,"bg",!n[0])},m:function(w,$){ee(w,e,$),E(e,t),E(t,r),y&&y.m(r,null),E(r,i),E(r,o),s&&be(s,o,null),n[50](r),n[51](t),n[52](e),v=!0,g||(b=[Ce(r,"introstart",function(){Mr(n[13])&&n[13].apply(this,arguments)}),Ce(r,"outrostart",function(){Mr(n[14])&&n[14].apply(this,arguments)}),Ce(r,"introend",function(){Mr(n[15])&&n[15].apply(this,arguments)}),Ce(r,"outroend",function(){Mr(n[16])&&n[16].apply(this,arguments)}),Ce(e,"mousedown",n[20]),Ce(e,"mouseup",n[21])],g=!0)},p:function(w,$){if((n=w)[1].closeButton?y?(y.p(n,$),2&$[0]&&C(y,1)):((y=m2(n)).c(),C(y,1),y.m(r,i)):y&&(Ee(),M(y,1,1,function(){y=null}),Ae()),4&$[0]&&x!==(x=n[2])){if(s){Ee();var S=s;M(S.$$.fragment,1,0,function(){we(S,1)}),Ae()}x?(je((s=Lo(x,{})).$$.fragment),C(s.$$.fragment,1),be(s,o,null)):s=null}(!v||2&$[0]&&a!==(a=Vn(n[1].classContent)+" svelte-n7cvum"))&&j(o,"class",a),(!v||512&$[0])&&j(o,"style",n[9]),(!v||3&$[0])&&$e(o,"content",!n[0]),(!v||2&$[0]&&l!==(l=Vn(n[1].classWindow)+" svelte-n7cvum"))&&j(r,"class",l),(!v||2&$[0]&&c!==(c=n[1].ariaLabelledBy?null:n[1].ariaLabel||null))&&j(r,"aria-label",c),(!v||2&$[0]&&u!==(u=n[1].ariaLabelledBy||null))&&j(r,"aria-labelledby",u),(!v||256&$[0])&&j(r,"style",n[8]),(!v||3&$[0])&&$e(r,"window",!n[0]),(!v||2&$[0]&&d!==(d=Vn(n[1].classWindowWrap)+" svelte-n7cvum"))&&j(t,"class",d),(!v||128&$[0])&&j(t,"style",n[7]),(!v||3&$[0])&&$e(t,"wrap",!n[0]),(!v||2&$[0]&&h!==(h=n[1].id))&&j(e,"id",h),(!v||2&$[0]&&p!==(p=Vn(n[1].classBg)+" svelte-n7cvum"))&&j(e,"class",p),(!v||64&$[0])&&j(e,"style",n[6]),(!v||3&$[0])&&$e(e,"bg",!n[0])},i:function(w){v||(C(y),s&&C(s.$$.fragment,w),w&&Ma(function(){v&&(f||(f=Tf(r,n[12],n[1].transitionWindowProps,!0)),f.run(1))}),w&&Ma(function(){v&&(m||(m=Tf(e,n[11],n[1].transitionBgProps,!0)),m.run(1))}),v=!0)},o:function(w){M(y),s&&M(s.$$.fragment,w),w&&(f||(f=Tf(r,n[12],n[1].transitionWindowProps,!1)),f.run(0)),w&&(m||(m=Tf(e,n[11],n[1].transitionBgProps,!1)),m.run(0)),v=!1},d:function(w){w&&Z(e),y&&y.d(),s&&we(s),n[50](null),w&&f&&f.end(),n[51](null),n[52](null),w&&m&&m.end(),g=!1,kn(b)}}}function m2(n){var e,t,r,i,o,s=[JF,WF],a=[];function l(c,u){return 2&u[0]&&(e=null),e==null&&(e=!!c[17](c[1].closeButton)),e?0:1}return t=l(n,[-1,-1,-1]),r=a[t]=s[t](n),{c:function(){r.c(),i=an()},m:function(c,u){a[t].m(c,u),ee(c,i,u),o=!0},p:function(c,u){var f=t;(t=l(c,u))===f?a[t].p(c,u):(Ee(),M(a[f],1,1,function(){a[f]=null}),Ae(),(r=a[t])?r.p(c,u):(r=a[t]=s[t](c)).c(),C(r,1),r.m(i.parentNode,i))},i:function(c){o||(C(r),o=!0)},o:function(c){M(r),o=!1},d:function(c){c&&Z(i),a[t].d(c)}}}function WF(n){var e,t,r,i;return{c:function(){j(e=V("button"),"class",t=Vn(n[1].classCloseButton)+" svelte-n7cvum"),j(e,"aria-label","Close modal"),j(e,"style",n[10]),j(e,"type","button"),$e(e,"close",!n[0])},m:function(o,s){ee(o,e,s),r||(i=Ce(e,"click",n[18]),r=!0)},p:function(o,s){2&s[0]&&t!==(t=Vn(o[1].classCloseButton)+" svelte-n7cvum")&&j(e,"class",t),1024&s[0]&&j(e,"style",o[10]),3&s[0]&&$e(e,"close",!o[0])},i:Te,o:Te,d:function(o){o&&Z(e),r=!1,i()}}}function JF(n){var e,t,r,i=n[1].closeButton;function o(s,a){return{props:{onClose:s[18]}}}return i&&(e=Lo(i,o(n))),{c:function(){e&&je(e.$$.fragment),t=an()},m:function(s,a){e&&be(e,s,a),ee(s,t,a),r=!0},p:function(s,a){if(2&a[0]&&i!==(i=s[1].closeButton)){if(e){Ee();var l=e;M(l.$$.fragment,1,0,function(){we(l,1)}),Ae()}i?(je((e=Lo(i,o(s))).$$.fragment),C(e.$$.fragment,1),be(e,t.parentNode,t)):e=null}},i:function(s){r||(e&&C(e.$$.fragment,s),r=!0)},o:function(s){e&&M(e.$$.fragment,s),r=!1},d:function(s){s&&Z(t),e&&we(e,s)}}}function KF(n){var e,t,r,i,o=n[2]&&p2(n),s=n[49].default,a=Qn(s,n,n[48],null);return{c:function(){o&&o.c(),e=ce(),a&&a.c()},m:function(l,c){o&&o.m(l,c),ee(l,e,c),a&&a.m(l,c),t=!0,r||(i=Ce(HF,"keydown",n[19]),r=!0)},p:function(l,c){l[2]?o?(o.p(l,c),4&c[0]&&C(o,1)):((o=p2(l)).c(),C(o,1),o.m(e.parentNode,e)):o&&(Ee(),M(o,1,1,function(){o=null}),Ae()),a&&a.p&&(!t||131072&c[1])&&Xn(a,s,l,l[48],t?Yn(s,l[48],c,null):Zn(l[48]),null)},i:function(l){t||(C(o),C(a,l),t=!0)},o:function(l){M(o),M(a,l),t=!1},d:function(l){l&&Z(e),o&&o.d(l),a&&a.d(l),r=!1,i()}}}function r4(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(t){return new n(fe(fe({},t),{},{props:fe(fe({},e),t.props)}))}}function GF(n,e,t){var r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b=e.$$slots,y=b===void 0?{}:b,x=e.$$scope,w=XC(),$=ZC,S=e.isTabbable,_=S===void 0?function(N){return N.tabIndex>=0&&!N.hidden&&!N.disabled&&N.style.display!=="none"&&N.type!=="hidden"&&Boolean(N.offsetWidth||N.offsetHeight||N.getClientRects().length)}:S,F=e.show,I=F===void 0?null:F,W=e.id,D=W===void 0?null:W,U=e.key,q=U===void 0?"simple-modal":U,X=e.ariaLabel,K=X===void 0?null:X,Y=e.ariaLabelledBy,T=Y===void 0?null:Y,B=e.closeButton,O=B===void 0||B,A=e.closeOnEsc,te=A===void 0||A,R=e.closeOnOuterClick,k=R===void 0||R,P=e.styleBg,H=P===void 0?{}:P,J=e.styleWindowWrap,he=J===void 0?{}:J,Se=e.styleWindow,pe=Se===void 0?{}:Se,ae=e.styleContent,Qe=ae===void 0?{}:ae,et=e.styleCloseButton,tn=et===void 0?{}:et,Qt=e.classBg,oe=Qt===void 0?null:Qt,st=e.classWindowWrap,Ht=st===void 0?null:st,qe=e.classWindow,Dt=qe===void 0?null:qe,He=e.classContent,wt=He===void 0?null:He,Oe=e.classCloseButton,Xe=Oe===void 0?null:Oe,nn=e.unstyled,L=nn!==void 0&&nn,ne=e.setContext,se=ne===void 0?$:ne,ge=e.transitionBg,ke=ge===void 0?VF:ge,Re=e.transitionBgProps,at=Re===void 0?{duration:250}:Re,rt=e.transitionWindow,Xt=rt===void 0?ke:rt,Zt=e.transitionWindowProps,Wt=Zt===void 0?at:Zt,Ge=e.disableFocusTrap,On=Ge!==void 0&&Ge,zn={id:D,ariaLabel:K,ariaLabelledBy:T,closeButton:O,closeOnEsc:te,closeOnOuterClick:k,styleBg:H,styleWindowWrap:he,styleWindow:pe,styleContent:Qe,styleCloseButton:tn,classBg:oe,classWindowWrap:Ht,classWindow:Dt,classContent:wt,classCloseButton:Xe,transitionBg:ke,transitionBgProps:at,transitionWindow:Xt,transitionWindowProps:Wt,disableFocusTrap:On,isTabbable:_,unstyled:L},Pt=fe({},zn),Mn=null,Dn=function(N){return N?Object.keys(N).reduce(function(G,ie){return"".concat(G,"; ").concat(function(ue){return ue.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}(ie),": ").concat(N[ie])},""):""},er=function(N){return!!(N&&N.constructor&&N.call&&N.apply)},fn=function(){},me=fn,Be=fn,St=fn,Lt=fn,_t=function(N){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};t(2,Mn=r4(N,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{})),t(1,Pt=fe(fe({},zn),G)),t(6,a=Dn(Object.assign({},{width:window.innerWidth,height:window.innerHeight},Pt.styleBg))),t(7,l=Dn(Pt.styleWindowWrap)),t(8,c=Dn(Pt.styleWindow)),t(9,u=Dn(Pt.styleContent)),t(10,f=Dn(Pt.styleCloseButton)),t(11,d=Pt.transitionBg),t(12,h=Pt.transitionWindow),de(),t(13,me=function(ue){ie.onOpen&&ie.onOpen(ue),w("open"),w("opening")}),t(14,Be=function(ue){ie.onClose&&ie.onClose(ue),w("close"),w("closing")}),t(15,St=function(ue){ie.onOpened&&ie.onOpened(ue),w("opened")}),t(16,Lt=function(ue){ie.onClosed&&ie.onClosed(ue),w("closed")})},Yt=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mn&&(t(14,Be=N.onClose||Be),t(16,Lt=N.onClosed||Lt),t(2,Mn=null),tt())},de=function(){s=window.scrollY,p=document.body.style.position,m=document.body.style.overflow,v=document.body.style.width,document.body.style.position="fixed",document.body.style.top="-".concat(s,"px"),document.body.style.overflow="hidden",document.body.style.width="100%"},tt=function(){document.body.style.position=p||"",document.body.style.top="",document.body.style.overflow=m||"",document.body.style.width=v||"",window.scrollTo({top:s,left:0,behavior:"instant"})};se(q,{open:_t,close:Yt});var We=!1;return Mi(function(){We&&Yt()}),Hi(function(){t(47,We=!0)}),n.$$set=function(N){"isTabbable"in N&&t(22,_=N.isTabbable),"show"in N&&t(23,I=N.show),"id"in N&&t(24,D=N.id),"key"in N&&t(25,q=N.key),"ariaLabel"in N&&t(26,K=N.ariaLabel),"ariaLabelledBy"in N&&t(27,T=N.ariaLabelledBy),"closeButton"in N&&t(28,O=N.closeButton),"closeOnEsc"in N&&t(29,te=N.closeOnEsc),"closeOnOuterClick"in N&&t(30,k=N.closeOnOuterClick),"styleBg"in N&&t(31,H=N.styleBg),"styleWindowWrap"in N&&t(32,he=N.styleWindowWrap),"styleWindow"in N&&t(33,pe=N.styleWindow),"styleContent"in N&&t(34,Qe=N.styleContent),"styleCloseButton"in N&&t(35,tn=N.styleCloseButton),"classBg"in N&&t(36,oe=N.classBg),"classWindowWrap"in N&&t(37,Ht=N.classWindowWrap),"classWindow"in N&&t(38,Dt=N.classWindow),"classContent"in N&&t(39,wt=N.classContent),"classCloseButton"in N&&t(40,Xe=N.classCloseButton),"unstyled"in N&&t(0,L=N.unstyled),"setContext"in N&&t(41,se=N.setContext),"transitionBg"in N&&t(42,ke=N.transitionBg),"transitionBgProps"in N&&t(43,at=N.transitionBgProps),"transitionWindow"in N&&t(44,Xt=N.transitionWindow),"transitionWindowProps"in N&&t(45,Wt=N.transitionWindowProps),"disableFocusTrap"in N&&t(46,On=N.disableFocusTrap),"$$scope"in N&&t(48,x=N.$$scope)},n.$$.update=function(){8388608&n.$$.dirty[0]|65536&n.$$.dirty[1]&&We&&(er(I)?_t(I):Yt())},[L,Pt,Mn,r,i,o,a,l,c,u,f,d,h,me,Be,St,Lt,er,Yt,function(N){if(Pt.closeOnEsc&&Mn&&N.key==="Escape"&&(N.preventDefault(),Yt()),Mn&&N.key==="Tab"&&!Pt.disableFocusTrap){var G=o.querySelectorAll("*"),ie=Array.from(G).filter(Pt.isTabbable).sort(function(ye,it){return ye.tabIndex-it.tabIndex}),ue=ie.indexOf(document.activeElement);ue===-1&&N.shiftKey&&(ue=0),ue+=ie.length+(N.shiftKey?-1:1),ie[ue%=ie.length].focus(),N.preventDefault()}},function(N){!Pt.closeOnOuterClick||N.target!==r&&N.target!==i||(g=N.target)},function(N){Pt.closeOnOuterClick&&N.target===g&&(N.preventDefault(),Yt())},_,I,D,q,K,T,O,te,k,H,he,pe,Qe,tn,oe,Ht,Dt,wt,Xe,se,ke,at,Xt,Wt,On,We,x,y,function(N){It[N?"unshift":"push"](function(){t(5,o=N)})},function(N){It[N?"unshift":"push"](function(){t(4,i=N)})},function(N){It[N?"unshift":"push"](function(){t(3,r=N)})}]}var Dr,_n,to,oo,so,Bi,Rs,i4=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,GF,KF,yr,{isTabbable:22,show:23,id:24,key:25,ariaLabel:26,ariaLabelledBy:27,closeButton:28,closeOnEsc:29,closeOnOuterClick:30,styleBg:31,styleWindowWrap:32,styleWindow:33,styleContent:34,styleCloseButton:35,classBg:36,classWindowWrap:37,classWindow:38,classContent:39,classCloseButton:40,unstyled:0,setContext:41,transitionBg:42,transitionBgProps:43,transitionWindow:44,transitionWindowProps:45,disableFocusTrap:46},UF,[-1,-1,-1]),r}return ht(e,mt),ut(e)}();(function(n){n.text="text",n.tree="tree",n.table="table"})(Dr||(Dr={})),function(n){n.after="after",n.inside="inside",n.key="key",n.value="value",n.multi="multi",n.text="text"}(_n||(_n={})),function(n){n.after="after",n.key="key",n.value="value",n.inside="inside"}(to||(to={})),function(n){n.info="info",n.warning="warning",n.error="error"}(oo||(oo={})),function(n){n.key="key",n.value="value"}(so||(so={})),function(n){n.asc="asc",n.desc="desc"}(Bi||(Bi={})),function(n){n.no="no",n.self="self",n.nextInside="nextInside"}(Rs||(Rs={}));var g2=50,QF=200,YF=400,XF=1200,v2=1e3,cu=100,ol=100,Cg=2e4,Aa=[{start:0,end:cu}],ZF=104857600,eq=1048576,Og=10485760,o4=10240,Ta={closeButton:!1,classBg:"jse-modal-bg",classWindow:"jse-modal-window",classWindowWrap:"jse-modal-window-wrap",classContent:"jse-modal-container"},tq=fe(fe({},Ta),{},{classWindow:"jse-modal-window jse-modal-window-sort"}),nq=fe(fe({},Ta),{},{classWindow:"jse-modal-window jse-modal-window-transform"}),rq=fe(fe({},Ta),{},{classWindow:"jse-modal-window jse-modal-window-jsoneditor"}),N0="Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value",I0="Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)",os="hover-insert-inside",uu="hover-insert-after",Mg="hover-collection",Up="valid",y2="repairable",Jo=336,Ko=260,wl=100,iq=Oi(Oi({},Bi.asc,"ascending"),Bi.desc,"descending"),oq=0;function Bc(){return++oq}function zr(n){return parseInt(n,10)}function D0(n){return sq.test(n)}var sq=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Rn(n){return sr(n)==="object"&&n!==null&&(n.constructor===void 0||n.constructor.name==="Object")}function Wn(n){return sr(n)==="object"&&n!==null&&(n.constructor===void 0||n.constructor.name==="Object"||n.constructor.name==="Array")}function Eg(n){if(typeof n=="number")return n>9466848e5&&isFinite(n)&&Math.floor(n)===n&&!isNaN(new Date(n).valueOf());if(typeof n=="bigint")return Eg(Number(n));try{var e=n&&n.valueOf();if(e!==n)return Eg(e)}catch{return!1}return!1}function s4(n){(Pf=Pf||window.document.createElement("div")).style.color="",Pf.style.color=n;var e=Pf.style.color;return e!==""?e.replace(/\s+/g,"").toLowerCase():null}var Pf=null;function L0(n,e){if(typeof n=="number"||typeof n=="string"||typeof n=="boolean"||n===void 0)return sr(n);if(typeof n=="bigint")return"number";if(n===null)return"null";if(Array.isArray(n))return"array";if(Rn(n))return"object";var t=e.stringify(n);return t&&D0(t)?"number":t==="true"||t==="false"?"boolean":t==="null"?"null":"unknown"}var aq=/^https?:\/\/\S+$/;function Wh(n){return typeof n=="string"&&aq.test(n)}function Gl(n,e){if(n==="")return"";var t=n.trim();return t==="null"?null:t==="true"||t!=="false"&&(D0(t)?e.parse(t):n)}function lq(n){return cq.test(n)}var cq=/^-?[0-9]+$/,uq=1e4,fq=[];function Ag(n){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],t={};if(!Array.isArray(n))throw new TypeError("Array expected");function r(s,a){(!Array.isArray(s)&&!Rn(s)||e&&a.length>0)&&(t[Ue(a)]=!0),Rn(s)&&Object.keys(s).forEach(function(l){r(s[l],a.concat(l))})}for(var i=Math.min(n.length,uq),o=0;oe?n.slice(0,e):n}function b2(n){return fe({},n)}function w2(n){return Object.values(n)}function x2(n,e,t,r){var i=n.slice(0),o=i.splice(e,t);return i.splice.apply(i,[e+r,0].concat(Vt(o))),i}function _u(n,e){try{return e.parse(n)}catch{return e.parse(Ao(n))}}function l4(n,e){try{return _u(n,e)}catch{return}}function Jh(n,e){n=n.replace(u4,"");try{return e(n)}catch{}try{return e("["+n+"]")}catch{}try{return e("{"+n+"}")}catch{}throw new Error("Failed to parse partial JSON")}function c4(n){n=n.replace(u4,"");try{return Ao(n)}catch{}try{var e=Ao("["+n+"]");return e.substring(1,e.length-1)}catch{}try{var t=Ao("{"+n+"}");return t.substring(1,t.length-1)}catch{}throw new Error("Failed to repair partial JSON")}var u4=/,\s*$/;function Nl(n,e){var t=$2.exec(e);if(t){var r=zr(t[2]),i=function(h,p){for(var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h.length,g=0,b=m;b1&&arguments[1]!==void 0?arguments[1]:{};return function(t){return new n(fe(fe({},t),{},{props:fe(fe({},e),t.props)}))}}function GF(n,e,t){var r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b=e.$$slots,y=b===void 0?{}:b,j=e.$$scope,w=XC(),$=ZC,S=e.isTabbable,_=S===void 0?function(N){return N.tabIndex>=0&&!N.hidden&&!N.disabled&&N.style.display!=="none"&&N.type!=="hidden"&&Boolean(N.offsetWidth||N.offsetHeight||N.getClientRects().length)}:S,F=e.show,I=F===void 0?null:F,W=e.id,D=W===void 0?null:W,U=e.key,q=U===void 0?"simple-modal":U,X=e.ariaLabel,K=X===void 0?null:X,Y=e.ariaLabelledBy,T=Y===void 0?null:Y,B=e.closeButton,O=B===void 0||B,A=e.closeOnEsc,te=A===void 0||A,R=e.closeOnOuterClick,k=R===void 0||R,P=e.styleBg,H=P===void 0?{}:P,J=e.styleWindowWrap,he=J===void 0?{}:J,Se=e.styleWindow,pe=Se===void 0?{}:Se,ae=e.styleContent,Qe=ae===void 0?{}:ae,et=e.styleCloseButton,tn=et===void 0?{}:et,Qt=e.classBg,oe=Qt===void 0?null:Qt,st=e.classWindowWrap,Ht=st===void 0?null:st,qe=e.classWindow,Dt=qe===void 0?null:qe,He=e.classContent,wt=He===void 0?null:He,Oe=e.classCloseButton,Xe=Oe===void 0?null:Oe,nn=e.unstyled,L=nn!==void 0&&nn,ne=e.setContext,se=ne===void 0?$:ne,ge=e.transitionBg,ke=ge===void 0?VF:ge,Re=e.transitionBgProps,at=Re===void 0?{duration:250}:Re,rt=e.transitionWindow,Xt=rt===void 0?ke:rt,Zt=e.transitionWindowProps,Wt=Zt===void 0?at:Zt,Ge=e.disableFocusTrap,On=Ge!==void 0&&Ge,zn={id:D,ariaLabel:K,ariaLabelledBy:T,closeButton:O,closeOnEsc:te,closeOnOuterClick:k,styleBg:H,styleWindowWrap:he,styleWindow:pe,styleContent:Qe,styleCloseButton:tn,classBg:oe,classWindowWrap:Ht,classWindow:Dt,classContent:wt,classCloseButton:Xe,transitionBg:ke,transitionBgProps:at,transitionWindow:Xt,transitionWindowProps:Wt,disableFocusTrap:On,isTabbable:_,unstyled:L},Pt=fe({},zn),Mn=null,Dn=function(N){return N?Object.keys(N).reduce(function(G,ie){return"".concat(G,"; ").concat(function(ue){return ue.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}(ie),": ").concat(N[ie])},""):""},er=function(N){return!!(N&&N.constructor&&N.call&&N.apply)},fn=function(){},me=fn,Be=fn,St=fn,Lt=fn,_t=function(N){var G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};t(2,Mn=r4(N,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{})),t(1,Pt=fe(fe({},zn),G)),t(6,a=Dn(Object.assign({},{width:window.innerWidth,height:window.innerHeight},Pt.styleBg))),t(7,l=Dn(Pt.styleWindowWrap)),t(8,c=Dn(Pt.styleWindow)),t(9,u=Dn(Pt.styleContent)),t(10,f=Dn(Pt.styleCloseButton)),t(11,d=Pt.transitionBg),t(12,h=Pt.transitionWindow),de(),t(13,me=function(ue){ie.onOpen&&ie.onOpen(ue),w("open"),w("opening")}),t(14,Be=function(ue){ie.onClose&&ie.onClose(ue),w("close"),w("closing")}),t(15,St=function(ue){ie.onOpened&&ie.onOpened(ue),w("opened")}),t(16,Lt=function(ue){ie.onClosed&&ie.onClosed(ue),w("closed")})},Yt=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mn&&(t(14,Be=N.onClose||Be),t(16,Lt=N.onClosed||Lt),t(2,Mn=null),tt())},de=function(){s=window.scrollY,p=document.body.style.position,m=document.body.style.overflow,v=document.body.style.width,document.body.style.position="fixed",document.body.style.top="-".concat(s,"px"),document.body.style.overflow="hidden",document.body.style.width="100%"},tt=function(){document.body.style.position=p||"",document.body.style.top="",document.body.style.overflow=m||"",document.body.style.width=v||"",window.scrollTo({top:s,left:0,behavior:"instant"})};se(q,{open:_t,close:Yt});var We=!1;return Mi(function(){We&&Yt()}),Hi(function(){t(47,We=!0)}),n.$$set=function(N){"isTabbable"in N&&t(22,_=N.isTabbable),"show"in N&&t(23,I=N.show),"id"in N&&t(24,D=N.id),"key"in N&&t(25,q=N.key),"ariaLabel"in N&&t(26,K=N.ariaLabel),"ariaLabelledBy"in N&&t(27,T=N.ariaLabelledBy),"closeButton"in N&&t(28,O=N.closeButton),"closeOnEsc"in N&&t(29,te=N.closeOnEsc),"closeOnOuterClick"in N&&t(30,k=N.closeOnOuterClick),"styleBg"in N&&t(31,H=N.styleBg),"styleWindowWrap"in N&&t(32,he=N.styleWindowWrap),"styleWindow"in N&&t(33,pe=N.styleWindow),"styleContent"in N&&t(34,Qe=N.styleContent),"styleCloseButton"in N&&t(35,tn=N.styleCloseButton),"classBg"in N&&t(36,oe=N.classBg),"classWindowWrap"in N&&t(37,Ht=N.classWindowWrap),"classWindow"in N&&t(38,Dt=N.classWindow),"classContent"in N&&t(39,wt=N.classContent),"classCloseButton"in N&&t(40,Xe=N.classCloseButton),"unstyled"in N&&t(0,L=N.unstyled),"setContext"in N&&t(41,se=N.setContext),"transitionBg"in N&&t(42,ke=N.transitionBg),"transitionBgProps"in N&&t(43,at=N.transitionBgProps),"transitionWindow"in N&&t(44,Xt=N.transitionWindow),"transitionWindowProps"in N&&t(45,Wt=N.transitionWindowProps),"disableFocusTrap"in N&&t(46,On=N.disableFocusTrap),"$$scope"in N&&t(48,j=N.$$scope)},n.$$.update=function(){8388608&n.$$.dirty[0]|65536&n.$$.dirty[1]&&We&&(er(I)?_t(I):Yt())},[L,Pt,Mn,r,i,o,a,l,c,u,f,d,h,me,Be,St,Lt,er,Yt,function(N){if(Pt.closeOnEsc&&Mn&&N.key==="Escape"&&(N.preventDefault(),Yt()),Mn&&N.key==="Tab"&&!Pt.disableFocusTrap){var G=o.querySelectorAll("*"),ie=Array.from(G).filter(Pt.isTabbable).sort(function(ye,it){return ye.tabIndex-it.tabIndex}),ue=ie.indexOf(document.activeElement);ue===-1&&N.shiftKey&&(ue=0),ue+=ie.length+(N.shiftKey?-1:1),ie[ue%=ie.length].focus(),N.preventDefault()}},function(N){!Pt.closeOnOuterClick||N.target!==r&&N.target!==i||(g=N.target)},function(N){Pt.closeOnOuterClick&&N.target===g&&(N.preventDefault(),Yt())},_,I,D,q,K,T,O,te,k,H,he,pe,Qe,tn,oe,Ht,Dt,wt,Xe,se,ke,at,Xt,Wt,On,We,j,y,function(N){It[N?"unshift":"push"](function(){t(5,o=N)})},function(N){It[N?"unshift":"push"](function(){t(4,i=N)})},function(N){It[N?"unshift":"push"](function(){t(3,r=N)})}]}var Dr,_n,to,oo,so,Bi,Rs,i4=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,GF,KF,yr,{isTabbable:22,show:23,id:24,key:25,ariaLabel:26,ariaLabelledBy:27,closeButton:28,closeOnEsc:29,closeOnOuterClick:30,styleBg:31,styleWindowWrap:32,styleWindow:33,styleContent:34,styleCloseButton:35,classBg:36,classWindowWrap:37,classWindow:38,classContent:39,classCloseButton:40,unstyled:0,setContext:41,transitionBg:42,transitionBgProps:43,transitionWindow:44,transitionWindowProps:45,disableFocusTrap:46},UF,[-1,-1,-1]),r}return ht(e,mt),ut(e)}();(function(n){n.text="text",n.tree="tree",n.table="table"})(Dr||(Dr={})),function(n){n.after="after",n.inside="inside",n.key="key",n.value="value",n.multi="multi",n.text="text"}(_n||(_n={})),function(n){n.after="after",n.key="key",n.value="value",n.inside="inside"}(to||(to={})),function(n){n.info="info",n.warning="warning",n.error="error"}(oo||(oo={})),function(n){n.key="key",n.value="value"}(so||(so={})),function(n){n.asc="asc",n.desc="desc"}(Bi||(Bi={})),function(n){n.no="no",n.self="self",n.nextInside="nextInside"}(Rs||(Rs={}));var v2=50,QF=200,YF=400,XF=1200,y2=1e3,cu=100,ol=100,Cg=2e4,Aa=[{start:0,end:cu}],ZF=104857600,eq=1048576,Og=10485760,o4=10240,Ta={closeButton:!1,classBg:"jse-modal-bg",classWindow:"jse-modal-window",classWindowWrap:"jse-modal-window-wrap",classContent:"jse-modal-container"},tq=fe(fe({},Ta),{},{classWindow:"jse-modal-window jse-modal-window-sort"}),nq=fe(fe({},Ta),{},{classWindow:"jse-modal-window jse-modal-window-transform"}),rq=fe(fe({},Ta),{},{classWindow:"jse-modal-window jse-modal-window-jsoneditor"}),I0="Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value",D0="Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)",os="hover-insert-inside",uu="hover-insert-after",Mg="hover-collection",Up="valid",b2="repairable",Jo=336,Ko=260,wl=100,iq=Oi(Oi({},Bi.asc,"ascending"),Bi.desc,"descending"),oq=0;function Bc(){return++oq}function zr(n){return parseInt(n,10)}function L0(n){return sq.test(n)}var sq=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Rn(n){return sr(n)==="object"&&n!==null&&(n.constructor===void 0||n.constructor.name==="Object")}function Wn(n){return sr(n)==="object"&&n!==null&&(n.constructor===void 0||n.constructor.name==="Object"||n.constructor.name==="Array")}function Eg(n){if(typeof n=="number")return n>9466848e5&&isFinite(n)&&Math.floor(n)===n&&!isNaN(new Date(n).valueOf());if(typeof n=="bigint")return Eg(Number(n));try{var e=n&&n.valueOf();if(e!==n)return Eg(e)}catch{return!1}return!1}function s4(n){(Pf=Pf||window.document.createElement("div")).style.color="",Pf.style.color=n;var e=Pf.style.color;return e!==""?e.replace(/\s+/g,"").toLowerCase():null}var Pf=null;function B0(n,e){if(typeof n=="number"||typeof n=="string"||typeof n=="boolean"||n===void 0)return sr(n);if(typeof n=="bigint")return"number";if(n===null)return"null";if(Array.isArray(n))return"array";if(Rn(n))return"object";var t=e.stringify(n);return t&&L0(t)?"number":t==="true"||t==="false"?"boolean":t==="null"?"null":"unknown"}var aq=/^https?:\/\/\S+$/;function Wh(n){return typeof n=="string"&&aq.test(n)}function Gl(n,e){if(n==="")return"";var t=n.trim();return t==="null"?null:t==="true"||t!=="false"&&(L0(t)?e.parse(t):n)}function lq(n){return cq.test(n)}var cq=/^-?[0-9]+$/,uq=1e4,fq=[];function Ag(n){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],t={};if(!Array.isArray(n))throw new TypeError("Array expected");function r(s,a){(!Array.isArray(s)&&!Rn(s)||e&&a.length>0)&&(t[Ue(a)]=!0),Rn(s)&&Object.keys(s).forEach(function(l){r(s[l],a.concat(l))})}for(var i=Math.min(n.length,uq),o=0;oe?n.slice(0,e):n}function w2(n){return fe({},n)}function j2(n){return Object.values(n)}function x2(n,e,t,r){var i=n.slice(0),o=i.splice(e,t);return i.splice.apply(i,[e+r,0].concat(Vt(o))),i}function _u(n,e){try{return e.parse(n)}catch{return e.parse(Ao(n))}}function l4(n,e){try{return _u(n,e)}catch{return}}function Jh(n,e){n=n.replace(u4,"");try{return e(n)}catch{}try{return e("["+n+"]")}catch{}try{return e("{"+n+"}")}catch{}throw new Error("Failed to parse partial JSON")}function c4(n){n=n.replace(u4,"");try{return Ao(n)}catch{}try{var e=Ao("["+n+"]");return e.substring(1,e.length-1)}catch{}try{var t=Ao("{"+n+"}");return t.substring(1,t.length-1)}catch{}throw new Error("Failed to repair partial JSON")}var u4=/,\s*$/;function Nl(n,e){var t=k2.exec(e);if(t){var r=zr(t[2]),i=function(h,p){for(var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h.length,g=0,b=m;b1&&arguments[1]!==void 0?arguments[1]:void 0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JSON;return Il(n)?n:{text:t.stringify(n.json,null,e)}}function j2(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JSON;return fu(n)?n:{json:e.parse(n.text)}}function Tg(n,e,t){return dq(n,e,t).text}function f4(n,e){return hq(n,e)>e}function hq(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;if(Il(n))return n.text.length;var t=n.json,r=0;return function i(o){if(Array.isArray(o)){if((r+=o.length-1+2)>e)return r;for(var s=0;se)return r}else if(Rn(o)){var a=Object.keys(o);r+=2+a.length+(a.length-1);for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:void 0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JSON;return Il(n)?n:{text:t.stringify(n.json,null,e)}}function $2(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JSON;return fu(n)?n:{json:e.parse(n.text)}}function Tg(n,e,t){return dq(n,e,t).text}function f4(n,e){return hq(n,e)>e}function hq(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;if(Il(n))return n.text.length;var t=n.json,r=0;return function i(o){if(Array.isArray(o)){if((r+=o.length-1+2)>e)return r;for(var s=0;se)return r}else if(Rn(o)){var a=Object.keys(o);r+=2+a.length+(a.length-1);for(var l=0;l0&&x.height>0}),u),c=u(t);function u(y){var x=y.getBoundingClientRect();return{x:x.left+x.width/2,y:x.top+x.height/2,rect:x,element:y}}function f(y,x){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,$=y.x-x.x,S=(y.y-x.y)*w;return Math.sqrt($*$+S*S)}var d=function(y){return f(y,c)};if(r==="Left"||r==="Right"){var h=r==="Left"?l.filter(function(y){return x=c,y.rect.left+ax.rect.right+a;var x}),p=h.filter(function(y){return x=y,w=c,Math.abs(x.y-w.y)x.y+a;var x}),g=v.filter(function(y){return o(y.element)}),b=Yu(g,d)||Yu(v,d);return b==null?void 0:b.element}}function x4(n){return!!n&&n.nodeName==="DIV"&&typeof n.refresh=="function"&&typeof n.cancel=="function"}function ss(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+",t=[];n.ctrlKey&&t.push("Ctrl"),n.metaKey&&t.push("Ctrl"),n.altKey&&t.push("Alt"),n.shiftKey&&t.push("Shift");var r=n.key.length===1?n.key.toUpperCase():n.key;return r in kq||t.push(r),t.join(e)}var kq={Ctrl:!0,Command:!0,Control:!0,Alt:!0,Option:!0,Shift:!0},Kp=P0.window;function Sq(n){Et(n,"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 S2(n){var e,t,r,i,o,s,a=[n[0].props],l=n[0].component;function c(u,f){for(var d={},h=0;hwindow.innerHeight&&x>d,_=g==="left"||y+u>window.innerWidth&&y>u;return{left:_?$-v:y+v,top:S?x-p:w+p,positionAbove:S,positionLeft:_}}if(typeof e.left=="number"&&typeof e.top=="number"){var F=e.left,I=e.top,W=e.width,D=W===void 0?0:W,U=e.height,q=U===void 0?0:U;return{left:F,top:I,positionAbove:I+q>window.innerHeight&&I>q,positionLeft:F+D>window.innerWidth&&F>D}}throw new Error('Invalid config: pass either "left" and "top", or pass "anchor"')}(),i=r.left,o=r.top,s=r.positionAbove,a=r.positionLeft;return(s?"bottom: ".concat(t.top-o,"px;"):"top: ".concat(o-t.top,"px;"))+(a?"right: ".concat(t.left-i,"px;"):"left: ".concat(i-t.left,"px;"))}function Mq(n,e,t){var r,i,o=e.popup,s=e.closeAbsolutePopup;function a(l){o.options&&o.options.closeOnOuterClick&&!Ru(l.target,function(c){return c===r})&&s(o.id)}return Hi(function(){i&&i.focus()}),n.$$set=function(l){"popup"in l&&t(0,o=l.popup),"closeAbsolutePopup"in l&&t(6,s=l.closeAbsolutePopup)},[o,r,i,function(l){a(l)},function(l){ss(l)==="Escape"&&s(o.id)},function(l){a(l)},s,function(l){It[l?"unshift":"push"](function(){t(2,i=l)})},function(l){It[l?"unshift":"push"](function(){t(1,r=l)})}]}var Eq=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,Mq,Cq,yr,{popup:0,closeAbsolutePopup:6},Sq),r}return ht(e,mt),ut(e)}();function O2(n,e,t){var r=n.slice();return r[6]=e[t],r}function M2(n){var e,t;return e=new Eq({props:{popup:n[6],closeAbsolutePopup:n[1]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.popup=r[6]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Aq(n){for(var e,t,r=Mt(n[0]),i=[],o=0;o0?".":"")+e}).join("")}function Pq(n){for(var e=[],t=0;t1&&arguments[1]!==void 0&&arguments[1],a="";t1?" "+o:"");i="".concat(r," (").concat(s,")"),o++}return i}function as(n,e){var t=e-3;return n.length>e?n.substring(0,t)+"...":n}function Rq(n){if(n==="")return"";var e=n.toLowerCase();if(e==="null")return null;if(e==="true")return!0;if(e==="false")return!1;if(e!=="undefined"){var t=Number(n),r=parseFloat(n);return isNaN(t)||isNaN(r)?n:t}}var Nq={id:"javascript",name:"JavaScript",description:` +`:n}function v4(n,e){return Ru(n,function(t){return t.nodeName.toUpperCase()===e.toUpperCase()})}function da(n,e,t){return Ru(n,function(r){return function(i,o,s){return typeof i.getAttribute=="function"&&i.getAttribute(o)===s}(r,e,t)})}function Ru(n,e){return!!F0(n,e)}function F0(n,e){for(var t=n;t&&!e(t);)t=t.parentNode;return t||void 0}function y4(n){if(n.firstChild!=null){var e=document.createRange(),t=window.getSelection();e.setStart(n,1),e.collapse(!0),t==null||t.removeAllRanges(),t==null||t.addRange(e)}else n.focus()}function Gd(n,e,t,r){var i=Ql(n);if(i){var o=i.document.activeElement?i.document.activeElement:null;o&&o.isContentEditable&&(o.textContent=t?e:o.textContent+e,y4(o),r&&r(o))}}function Ql(n){return n&&n.ownerDocument?n.ownerDocument.defaultView:null}function q0(n){var e=Ql(n),t=e==null?void 0:e.document.activeElement;return!!t&&Ru(t,function(r){return r===n})}function b4(n,e){return F0(n,function(t){return t.nodeName===e})}function Jp(n){return da(n,"data-type","selectable-key")?_n.key:da(n,"data-type","selectable-value")?_n.value:da(n,"data-type","insert-selection-area-inside")?_n.inside:da(n,"data-type","insert-selection-area-after")?_n.after:_n.multi}function Dl(n){return encodeURIComponent(Ue(n))}function w4(n){var e=F0(n,function(r){return!(r==null||!r.hasAttribute)&&r.hasAttribute("data-path")}),t=e==null?void 0:e.getAttribute("data-path");return t?ao(decodeURIComponent(t)):null}function $q(n){var e=n.allElements,t=n.currentElement,r=n.direction,i=n.hasPrio,o=i===void 0?function(){return!0}:i,s=n.margin,a=s===void 0?10:s,l=O7(e.filter(function(y){var j=y.getBoundingClientRect();return j.width>0&&j.height>0}),u),c=u(t);function u(y){var j=y.getBoundingClientRect();return{x:j.left+j.width/2,y:j.top+j.height/2,rect:j,element:y}}function f(y,j){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,$=y.x-j.x,S=(y.y-j.y)*w;return Math.sqrt($*$+S*S)}var d=function(y){return f(y,c)};if(r==="Left"||r==="Right"){var h=r==="Left"?l.filter(function(y){return j=c,y.rect.left+aj.rect.right+a;var j}),p=h.filter(function(y){return j=y,w=c,Math.abs(j.y-w.y)j.y+a;var j}),g=v.filter(function(y){return o(y.element)}),b=Yu(g,d)||Yu(v,d);return b==null?void 0:b.element}}function j4(n){return!!n&&n.nodeName==="DIV"&&typeof n.refresh=="function"&&typeof n.cancel=="function"}function ss(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"+",t=[];n.ctrlKey&&t.push("Ctrl"),n.metaKey&&t.push("Ctrl"),n.altKey&&t.push("Alt"),n.shiftKey&&t.push("Shift");var r=n.key.length===1?n.key.toUpperCase():n.key;return r in kq||t.push(r),t.join(e)}var kq={Ctrl:!0,Command:!0,Control:!0,Alt:!0,Option:!0,Shift:!0},Kp=_0.window;function Sq(n){Et(n,"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 C2(n){var e,t,r,i,o,s,a=[n[0].props],l=n[0].component;function c(u,f){for(var d={},h=0;hwindow.innerHeight&&j>d,_=g==="left"||y+u>window.innerWidth&&y>u;return{left:_?$-v:y+v,top:S?j-p:w+p,positionAbove:S,positionLeft:_}}if(typeof e.left=="number"&&typeof e.top=="number"){var F=e.left,I=e.top,W=e.width,D=W===void 0?0:W,U=e.height,q=U===void 0?0:U;return{left:F,top:I,positionAbove:I+q>window.innerHeight&&I>q,positionLeft:F+D>window.innerWidth&&F>D}}throw new Error('Invalid config: pass either "left" and "top", or pass "anchor"')}(),i=r.left,o=r.top,s=r.positionAbove,a=r.positionLeft;return(s?"bottom: ".concat(t.top-o,"px;"):"top: ".concat(o-t.top,"px;"))+(a?"right: ".concat(t.left-i,"px;"):"left: ".concat(i-t.left,"px;"))}function Mq(n,e,t){var r,i,o=e.popup,s=e.closeAbsolutePopup;function a(l){o.options&&o.options.closeOnOuterClick&&!Ru(l.target,function(c){return c===r})&&s(o.id)}return Hi(function(){i&&i.focus()}),n.$$set=function(l){"popup"in l&&t(0,o=l.popup),"closeAbsolutePopup"in l&&t(6,s=l.closeAbsolutePopup)},[o,r,i,function(l){a(l)},function(l){ss(l)==="Escape"&&s(o.id)},function(l){a(l)},s,function(l){It[l?"unshift":"push"](function(){t(2,i=l)})},function(l){It[l?"unshift":"push"](function(){t(1,r=l)})}]}var Eq=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,Mq,Cq,yr,{popup:0,closeAbsolutePopup:6},Sq),r}return ht(e,mt),ut(e)}();function M2(n,e,t){var r=n.slice();return r[6]=e[t],r}function E2(n){var e,t;return e=new Eq({props:{popup:n[6],closeAbsolutePopup:n[1]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.popup=r[6]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Aq(n){for(var e,t,r=Mt(n[0]),i=[],o=0;o0?".":"")+e}).join("")}function Pq(n){for(var e=[],t=0;t1&&arguments[1]!==void 0&&arguments[1],a="";t1?" "+o:"");i="".concat(r," (").concat(s,")"),o++}return i}function as(n,e){var t=e-3;return n.length>e?n.substring(0,t)+"...":n}function Rq(n){if(n==="")return"";var e=n.toLowerCase();if(e==="null")return null;if(e==="true")return!0;if(e==="false")return!1;if(e!=="undefined"){var t=Number(n),r=parseFloat(n);return isNaN(t)||isNaN(r)?n:t}}var Nq={id:"javascript",name:"JavaScript",description:`

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

@@ -80,20 +80,20 @@ if (typeof query !== "function") { } return query; -`)()(n);return t!==void 0?t:null}};function Iq(n){var e;return{c:function(){e=Io("g")},m:function(t,r){ee(t,e,r),e.innerHTML=n[0]},p:function(t,r){1&At(r,1)[0]&&(e.innerHTML=t[0])},i:Te,o:Te,d:function(t){t&&Z(e)}}}function Dq(n,e,t){var r=870711,i="",o=e.data;function s(a){if(!a||!a.raw)return"";var l=a.raw,c={};return l=l.replace(/\s(?:xml:)?id=["']?([^"')\s]+)/g,function(u,f){var d="fa-".concat((r+=1).toString(16));return c[f]=d,' id="'.concat(d,'"')}),l=l.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g,function(u,f,d,h){var p=f||h;return p&&c[p]?"#".concat(c[p]):u}),l}return n.$$set=function(a){"data"in a&&t(1,o=a.data)},n.$$.update=function(){2&n.$$.dirty&&t(0,i=s(o))},[i,o]}var Lq=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,Dq,Iq,yr,{data:1}),r}return ht(e,mt),ut(e)}();function Bq(n){Et(n,"svelte-1mc5hvj",".fa-icon.svelte-1mc5hvj{display:inline-block;fill:currentColor}.fa-flip-horizontal.svelte-1mc5hvj{transform:scale(-1, 1)}.fa-flip-vertical.svelte-1mc5hvj{transform:scale(1, -1)}.fa-spin.svelte-1mc5hvj{animation:svelte-1mc5hvj-fa-spin 1s 0s infinite linear}.fa-inverse.svelte-1mc5hvj{color:#fff}.fa-pulse.svelte-1mc5hvj{animation:svelte-1mc5hvj-fa-spin 1s infinite steps(8)}@keyframes svelte-1mc5hvj-fa-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}")}function zq(n){for(var e,t,r,i,o=n[12].default,s=Qn(o,n,n[11],null),a=[{version:"1.1"},{class:t="fa-icon "+n[0]},{width:n[1]},{height:n[2]},{"aria-label":n[9]},{role:r=n[9]?"img":"presentation"},{viewBox:n[3]},{style:n[8]},n[10]],l={},c=0;c300},{anchor:m,closeOnOuterClick:!0,onClose:f,offsetTop:18,offsetLeft:-8,height:300})}},o,l,c]}var rV=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,nV,tV,Tt,{path:4,value:0,readOnly:1,onPatch:5,focus:6},eV),r}return ht(e,mt),ut(e)}();function k4(n){for(var e=Y7(n,function(a){return a.start}),t=[e[0]],r=0;r=t.start&&e0){var f=Kh(e,u);q0(l,f,function(v){o[c]=String(v),a(l[v])}),o.pop()}}}else if(Rn(l)&&r(o)){i[Ue(o)]=!0;var d=Object.keys(l);if(d.length>0){var h,p=au(d);try{for(p.s();!(h=p.n()).done;){var m=h.value;o[c]=m,a(l[m])}}catch(v){p.e(v)}finally{p.f()}o.pop()}}}(s),fe(fe({},e),{},{expandedMap:i})}function R2(n,e){var t=xl(n.expandedMap,e),r=xl(n.enforceStringMap,e),i=xl(n.visibleSectionsMap,e);return fe(fe({},n),{},{expandedMap:t,enforceStringMap:r,visibleSectionsMap:i})}function S4(n,e,t){if(t){var r=fe({},n.enforceStringMap);return r[e]=t,fe(fe({},n),{},{enforceStringMap:r})}if(typeof n.enforceStringMap[e]=="boolean"){var i=fe({},n.enforceStringMap);return delete i[e],fe(fe({},n),{},{enforceStringMap:i})}return n}function C4(n,e,t){var r=ro(n,t),i=t.reduce(function(o,s){return n$(s)?N2(r,o,s):r$(s)?I2(r,o,s):Gg(s)?function(a,l,c){var u=c.path,f=Xp(a,l.expandedMap),d=Xp(a,l.enforceStringMap),h=Xp(a,l.visibleSectionsMap);return Gn(c.value)||Nn(c.value)||delete f[u],Nn(c.value)||delete h[u],(Gn(c.value)||Nn(c.value))&&delete d[u],fe(fe({},l),{},{expandedMap:f,enforceStringMap:d,visibleSectionsMap:h})}(r,o,s):om(s)||ll(s)?function(a,l,c){if(ll(c)&&c.from===c.path)return l;var u=function(b){return c.path+b.substring(c.from.length)},f=Yp(Gp(l.expandedMap,c.from),u),d=Yp(Gp(l.enforceStringMap,c.from),u),h=Yp(Gp(l.visibleSectionsMap,c.from),u),p=l;ll(c)&&(p=I2(a,p,{op:"remove",path:c.from})),p=N2(a,p,{op:"add",path:c.path,value:null});var m=Qp(p.expandedMap,f),v=Qp(p.enforceStringMap,d),g=Qp(p.visibleSectionsMap,h);return fe(fe({},l),{},{expandedMap:m,enforceStringMap:v,visibleSectionsMap:g})}(r,o,s):o},e);return{json:r,documentState:i}}function N2(n,e,t){var r=Eo(n,t.path),i=on(r),o=Ue(i),s=Ye(n,i);if(Nn(s)){var a=zr(en(r)),l=jl(e.expandedMap,i,a,1),c=jl(e.enforceStringMap,i,a,1),u=jl(e.visibleSectionsMap,i,a,1);return u=O4(u,o,function(f){return M4(f,a,1)}),fe(fe({},e),{},{expandedMap:l,enforceStringMap:c,visibleSectionsMap:u})}return e}function I2(n,e,t){var r=Eo(n,t.path),i=on(r),o=Ue(i),s=Ye(n,i),a=e.expandedMap,l=e.enforceStringMap,c=e.visibleSectionsMap;if(a=xl(a,r),l=xl(l,r),c=xl(c,r),Nn(s)){var u=zr(en(r));a=jl(a,i,u,-1),l=jl(l,i,u,-1),c=O4(c=jl(c,i,u,-1),o,function(f){return M4(f,u,-1)})}return fe(fe({},e),{},{expandedMap:a,enforceStringMap:l,visibleSectionsMap:c})}function xl(n,e){var t={},r=Ue(e);return Object.keys(n).forEach(function(i){lh(i,r)||(t[i]=n[i])}),t}function Gp(n,e){var t={};return Object.keys(n).forEach(function(r){lh(r,e)&&(t[r]=n[r])}),t}function Qp(n,e){return fe(fe({},n),e)}function Yp(n,e){var t={};return Object.keys(n).forEach(function(r){var i=e(r);t[i]=n[r]}),t}function jl(n,e,t,r){for(var i=e.length,o=Ue(e),s=[],a=0,l=Object.keys(n);a=t&&(u[i]=String(f+r),s.push({oldPointer:c,newPointer:Ue(u),value:n[c]}))}}if(s.length===0)return n;var d=fe({},n);return s.forEach(function(h){delete d[h.oldPointer]}),s.forEach(function(h){d[h.newPointer]=h.value}),d}function Xp(n,e){var t={};return Object.keys(e).filter(function(r){return Ii(n,Eo(n,r))}).forEach(function(r){t[r]=e[r]}),t}function O4(n,e,t){var r=n[e];if(e in n){var i=t(r);if(!sn(r,i)){var o=fe({},n);return i===void 0?delete o[e]:o[e]=i,o}}return n}function M4(n,e,t){return function(r){for(var i=r.slice(0),o=1;oe?r.start+t:r.start,end:r.end>e?r.end+t:r.end}}))}function ls(n,e,t,r){var i=e?e[t]:void 0;return typeof i=="boolean"?i:function(o,s){return typeof o=="string"&&typeof Gl(o,s)!="string"}(n,r)}function Iu(n,e){var t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=n.indexOf(e);return r!==-1?t?n.slice(r):n.slice(r+1):[]}function V0(n,e){var t=[];return function r(i,o){t.push(o);var s=Ue(o);if(i&&e.expandedMap[s]===!0){if(Nn(i)){var a=Kh(e,s);q0(i,a,function(l){r(i[l],o.concat(String(l)))})}Gn(i)&&Object.keys(i).forEach(function(l){r(i[l],o.concat(l))})}}(n,[]),t}function E4(n,e){var t=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=[];return function i(o,s){r.push({path:s,type:to.value});var a=Ue(s);if(o&&e.expandedMap[a]===!0){if(t&&r.push({path:s,type:to.inside}),Nn(o)){var l=Kh(e,a);q0(o,l,function(c){var u=s.concat(String(c));i(o[c],u),t&&r.push({path:u,type:to.after})})}Gn(o)&&Object.keys(o).forEach(function(c){var u=s.concat(c);r.push({path:u,type:to.key}),i(o[c],u),t&&r.push({path:u,type:to.after})})}}(n,[]),r}function Zp(n,e,t){var r=V0(n,e),i=r.map(Ue).indexOf(Ue(t));return i!==-1&&it?e.focusPath:e.anchorPath}function L2(n,e){var t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e.selection;if(!r)return null;var i=t?lt(r):Go(n,r),o=function(l,c,u){var f=V0(l,c),d=f.map(Ue),h=Ue(u),p=d.indexOf(h);return p!==-1&&p>0?f[p-1]:null}(n,e,i);if(t)return dr(r)||hi(r)?o!==null?Wr(i,i):null:o!==null?Wr(ma(r),o):null;if(hi(r)||dr(r))return Ut(i,!1);if(or(r)){if(o==null||o.length===0)return null;var s=on(o),a=Ye(n,s);return Array.isArray(a)||hn(o)?Ut(o,!1):zi(o,!1)}return rn(r),o!==null?Ut(o,!1):null}function B2(n,e,t){var r=e.selection;if(!r)return{caret:null,previous:null,next:null};var i=E4(n,e,t),o=i.findIndex(function(s){return sn(s.path,lt(r))&&String(s.type)===String(r.type)});return{caret:o!==-1?i[o]:null,previous:o!==-1&&o>0?i[o-1]:null,next:o!==-1&&ot[r].length;)r++;var i=t[r];return i===void 0||i.length===0||Array.isArray(Ye(n,on(i)))?Ut(i,!1):zi(i,!1)}function Ll(n,e){if(e.length===1){var t=Qo(e);if(t.op==="replace")return Ut(Eo(n,t.path),!1)}if(!hn(e)&&e.every(function(s){return s.op==="move"})){var r=Qo(e),i=e.slice(1);if((om(r)||ll(r))&&r.from!==r.path&&i.every(function(s){return(om(s)||ll(s))&&s.from===s.path}))return zi(Eo(n,r.path),!1)}var o=e.filter(function(s){return s.op!=="test"&&s.op!=="remove"&&(s.op!=="move"||s.from!==s.path)&&typeof s.path=="string"}).map(function(s){return Eo(n,s.path)});return hn(o)?null:{type:_n.multi,anchorPath:Qo(o),focusPath:en(o)}}function T4(n,e){for(var t=0;tt.length&&e.length>t.length;return{type:_n.multi,anchorPath:r?t.concat(n[t.length]):t,focusPath:r?t.concat(e[t.length]):t}}function P4(n,e,t,r){if(or(e))return String(en(e.path));if(rn(e)){var i,o=Ye(n,e.path);return typeof o=="string"?o:(i=r.stringify(o,null,t))!==null&&i!==void 0?i:null}if(Cn(e)){var s;if(hn(e.focusPath))return(s=r.stringify(n,null,t))!==null&&s!==void 0?s:null;var a=A4(e),l=Ye(n,a);if(Array.isArray(l)){if(Gh(e)){var c,u=Ye(n,e.focusPath);return(c=r.stringify(u,null,t))!==null&&c!==void 0?c:null}return Ns(n,e).map(function(f){var d=Ye(n,f);return"".concat(r.stringify(d,null,t),",")}).join(` +`)()(n);return t!==void 0?t:null}};function Iq(n){var e;return{c:function(){e=Io("g")},m:function(t,r){ee(t,e,r),e.innerHTML=n[0]},p:function(t,r){1&At(r,1)[0]&&(e.innerHTML=t[0])},i:Te,o:Te,d:function(t){t&&Z(e)}}}function Dq(n,e,t){var r=870711,i="",o=e.data;function s(a){if(!a||!a.raw)return"";var l=a.raw,c={};return l=l.replace(/\s(?:xml:)?id=["']?([^"')\s]+)/g,function(u,f){var d="fa-".concat((r+=1).toString(16));return c[f]=d,' id="'.concat(d,'"')}),l=l.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g,function(u,f,d,h){var p=f||h;return p&&c[p]?"#".concat(c[p]):u}),l}return n.$$set=function(a){"data"in a&&t(1,o=a.data)},n.$$.update=function(){2&n.$$.dirty&&t(0,i=s(o))},[i,o]}var Lq=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,Dq,Iq,yr,{data:1}),r}return ht(e,mt),ut(e)}();function Bq(n){Et(n,"svelte-1mc5hvj",".fa-icon.svelte-1mc5hvj{display:inline-block;fill:currentColor}.fa-flip-horizontal.svelte-1mc5hvj{transform:scale(-1, 1)}.fa-flip-vertical.svelte-1mc5hvj{transform:scale(1, -1)}.fa-spin.svelte-1mc5hvj{animation:svelte-1mc5hvj-fa-spin 1s 0s infinite linear}.fa-inverse.svelte-1mc5hvj{color:#fff}.fa-pulse.svelte-1mc5hvj{animation:svelte-1mc5hvj-fa-spin 1s infinite steps(8)}@keyframes svelte-1mc5hvj-fa-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}")}function zq(n){for(var e,t,r,i,o=n[12].default,s=Qn(o,n,n[11],null),a=[{version:"1.1"},{class:t="fa-icon "+n[0]},{width:n[1]},{height:n[2]},{"aria-label":n[9]},{role:r=n[9]?"img":"presentation"},{viewBox:n[3]},{style:n[8]},n[10]],l={},c=0;c300},{anchor:m,closeOnOuterClick:!0,onClose:f,offsetTop:18,offsetLeft:-8,height:300})}},o,l,c]}var rV=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,nV,tV,Tt,{path:4,value:0,readOnly:1,onPatch:5,focus:6},eV),r}return ht(e,mt),ut(e)}();function k4(n){for(var e=Y7(n,function(a){return a.start}),t=[e[0]],r=0;r=t.start&&e0){var f=Kh(e,u);V0(l,f,function(v){o[c]=String(v),a(l[v])}),o.pop()}}}else if(Rn(l)&&r(o)){i[Ue(o)]=!0;var d=Object.keys(l);if(d.length>0){var h,p=au(d);try{for(p.s();!(h=p.n()).done;){var m=h.value;o[c]=m,a(l[m])}}catch(v){p.e(v)}finally{p.f()}o.pop()}}}(s),fe(fe({},e),{},{expandedMap:i})}function N2(n,e){var t=jl(n.expandedMap,e),r=jl(n.enforceStringMap,e),i=jl(n.visibleSectionsMap,e);return fe(fe({},n),{},{expandedMap:t,enforceStringMap:r,visibleSectionsMap:i})}function S4(n,e,t){if(t){var r=fe({},n.enforceStringMap);return r[e]=t,fe(fe({},n),{},{enforceStringMap:r})}if(typeof n.enforceStringMap[e]=="boolean"){var i=fe({},n.enforceStringMap);return delete i[e],fe(fe({},n),{},{enforceStringMap:i})}return n}function C4(n,e,t){var r=ro(n,t),i=t.reduce(function(o,s){return n$(s)?I2(r,o,s):r$(s)?D2(r,o,s):Qg(s)?function(a,l,c){var u=c.path,f=Xp(a,l.expandedMap),d=Xp(a,l.enforceStringMap),h=Xp(a,l.visibleSectionsMap);return Gn(c.value)||Nn(c.value)||delete f[u],Nn(c.value)||delete h[u],(Gn(c.value)||Nn(c.value))&&delete d[u],fe(fe({},l),{},{expandedMap:f,enforceStringMap:d,visibleSectionsMap:h})}(r,o,s):om(s)||ll(s)?function(a,l,c){if(ll(c)&&c.from===c.path)return l;var u=function(b){return c.path+b.substring(c.from.length)},f=Yp(Gp(l.expandedMap,c.from),u),d=Yp(Gp(l.enforceStringMap,c.from),u),h=Yp(Gp(l.visibleSectionsMap,c.from),u),p=l;ll(c)&&(p=D2(a,p,{op:"remove",path:c.from})),p=I2(a,p,{op:"add",path:c.path,value:null});var m=Qp(p.expandedMap,f),v=Qp(p.enforceStringMap,d),g=Qp(p.visibleSectionsMap,h);return fe(fe({},l),{},{expandedMap:m,enforceStringMap:v,visibleSectionsMap:g})}(r,o,s):o},e);return{json:r,documentState:i}}function I2(n,e,t){var r=Eo(n,t.path),i=on(r),o=Ue(i),s=Ye(n,i);if(Nn(s)){var a=zr(en(r)),l=xl(e.expandedMap,i,a,1),c=xl(e.enforceStringMap,i,a,1),u=xl(e.visibleSectionsMap,i,a,1);return u=O4(u,o,function(f){return M4(f,a,1)}),fe(fe({},e),{},{expandedMap:l,enforceStringMap:c,visibleSectionsMap:u})}return e}function D2(n,e,t){var r=Eo(n,t.path),i=on(r),o=Ue(i),s=Ye(n,i),a=e.expandedMap,l=e.enforceStringMap,c=e.visibleSectionsMap;if(a=jl(a,r),l=jl(l,r),c=jl(c,r),Nn(s)){var u=zr(en(r));a=xl(a,i,u,-1),l=xl(l,i,u,-1),c=O4(c=xl(c,i,u,-1),o,function(f){return M4(f,u,-1)})}return fe(fe({},e),{},{expandedMap:a,enforceStringMap:l,visibleSectionsMap:c})}function jl(n,e){var t={},r=Ue(e);return Object.keys(n).forEach(function(i){lh(i,r)||(t[i]=n[i])}),t}function Gp(n,e){var t={};return Object.keys(n).forEach(function(r){lh(r,e)&&(t[r]=n[r])}),t}function Qp(n,e){return fe(fe({},n),e)}function Yp(n,e){var t={};return Object.keys(n).forEach(function(r){var i=e(r);t[i]=n[r]}),t}function xl(n,e,t,r){for(var i=e.length,o=Ue(e),s=[],a=0,l=Object.keys(n);a=t&&(u[i]=String(f+r),s.push({oldPointer:c,newPointer:Ue(u),value:n[c]}))}}if(s.length===0)return n;var d=fe({},n);return s.forEach(function(h){delete d[h.oldPointer]}),s.forEach(function(h){d[h.newPointer]=h.value}),d}function Xp(n,e){var t={};return Object.keys(e).filter(function(r){return Ii(n,Eo(n,r))}).forEach(function(r){t[r]=e[r]}),t}function O4(n,e,t){var r=n[e];if(e in n){var i=t(r);if(!sn(r,i)){var o=fe({},n);return i===void 0?delete o[e]:o[e]=i,o}}return n}function M4(n,e,t){return function(r){for(var i=r.slice(0),o=1;oe?r.start+t:r.start,end:r.end>e?r.end+t:r.end}}))}function ls(n,e,t,r){var i=e?e[t]:void 0;return typeof i=="boolean"?i:function(o,s){return typeof o=="string"&&typeof Gl(o,s)!="string"}(n,r)}function Iu(n,e){var t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=n.indexOf(e);return r!==-1?t?n.slice(r):n.slice(r+1):[]}function H0(n,e){var t=[];return function r(i,o){t.push(o);var s=Ue(o);if(i&&e.expandedMap[s]===!0){if(Nn(i)){var a=Kh(e,s);V0(i,a,function(l){r(i[l],o.concat(String(l)))})}Gn(i)&&Object.keys(i).forEach(function(l){r(i[l],o.concat(l))})}}(n,[]),t}function E4(n,e){var t=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=[];return function i(o,s){r.push({path:s,type:to.value});var a=Ue(s);if(o&&e.expandedMap[a]===!0){if(t&&r.push({path:s,type:to.inside}),Nn(o)){var l=Kh(e,a);V0(o,l,function(c){var u=s.concat(String(c));i(o[c],u),t&&r.push({path:u,type:to.after})})}Gn(o)&&Object.keys(o).forEach(function(c){var u=s.concat(c);r.push({path:u,type:to.key}),i(o[c],u),t&&r.push({path:u,type:to.after})})}}(n,[]),r}function Zp(n,e,t){var r=H0(n,e),i=r.map(Ue).indexOf(Ue(t));return i!==-1&&it?e.focusPath:e.anchorPath}function B2(n,e){var t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e.selection;if(!r)return null;var i=t?lt(r):Go(n,r),o=function(l,c,u){var f=H0(l,c),d=f.map(Ue),h=Ue(u),p=d.indexOf(h);return p!==-1&&p>0?f[p-1]:null}(n,e,i);if(t)return dr(r)||hi(r)?o!==null?Wr(i,i):null:o!==null?Wr(ma(r),o):null;if(hi(r)||dr(r))return Ut(i,!1);if(or(r)){if(o==null||o.length===0)return null;var s=on(o),a=Ye(n,s);return Array.isArray(a)||hn(o)?Ut(o,!1):zi(o,!1)}return rn(r),o!==null?Ut(o,!1):null}function z2(n,e,t){var r=e.selection;if(!r)return{caret:null,previous:null,next:null};var i=E4(n,e,t),o=i.findIndex(function(s){return sn(s.path,lt(r))&&String(s.type)===String(r.type)});return{caret:o!==-1?i[o]:null,previous:o!==-1&&o>0?i[o-1]:null,next:o!==-1&&ot[r].length;)r++;var i=t[r];return i===void 0||i.length===0||Array.isArray(Ye(n,on(i)))?Ut(i,!1):zi(i,!1)}function Ll(n,e){if(e.length===1){var t=Qo(e);if(t.op==="replace")return Ut(Eo(n,t.path),!1)}if(!hn(e)&&e.every(function(s){return s.op==="move"})){var r=Qo(e),i=e.slice(1);if((om(r)||ll(r))&&r.from!==r.path&&i.every(function(s){return(om(s)||ll(s))&&s.from===s.path}))return zi(Eo(n,r.path),!1)}var o=e.filter(function(s){return s.op!=="test"&&s.op!=="remove"&&(s.op!=="move"||s.from!==s.path)&&typeof s.path=="string"}).map(function(s){return Eo(n,s.path)});return hn(o)?null:{type:_n.multi,anchorPath:Qo(o),focusPath:en(o)}}function T4(n,e){for(var t=0;tt.length&&e.length>t.length;return{type:_n.multi,anchorPath:r?t.concat(n[t.length]):t,focusPath:r?t.concat(e[t.length]):t}}function P4(n,e,t,r){if(or(e))return String(en(e.path));if(rn(e)){var i,o=Ye(n,e.path);return typeof o=="string"?o:(i=r.stringify(o,null,t))!==null&&i!==void 0?i:null}if(Cn(e)){var s;if(hn(e.focusPath))return(s=r.stringify(n,null,t))!==null&&s!==void 0?s:null;var a=A4(e),l=Ye(n,a);if(Array.isArray(l)){if(Gh(e)){var c,u=Ye(n,e.focusPath);return(c=r.stringify(u,null,t))!==null&&c!==void 0?c:null}return Ns(n,e).map(function(f){var d=Ye(n,f);return"".concat(r.stringify(d,null,t),",")}).join(` `)}return Ns(n,e).map(function(f){var d=en(f),h=Ye(n,f);return"".concat(r.stringify(d),": ").concat(r.stringify(h,null,t),",")}).join(` -`)}return null}function Xr(n){return(or(n)||rn(n))&&n.edit===!0}function Yl(n){return or(n)||rn(n)||Cn(n)}function _f(n){return or(n)||rn(n)||Gh(n)}function Rg(n){switch(n.type){case to.key:return zi(n.path,!1);case to.value:return Ut(n.path,!1);case to.after:return Zo(n.path);case to.inside:return us(n.path)}}function F2(n,e,t){switch(e){case _n.key:return zi(t,!1);case _n.value:return Ut(t,!1);case _n.after:return Zo(t);case _n.inside:return us(t);case _n.multi:case _n.text:return Wr(t,t)}}function q2(n,e,t){return e&&(du(n,e,t)||cs(Cn(e)?on(e.focusPath):e.path,t))?e:null}function du(n,e,t){if(n===void 0||!e)return!1;if(or(e)||dr(e)||hi(e))return sn(e.path,t);if(rn(e))return cs(t,e.path);if(Cn(e)){var r=Go(n,e),i=Is(n,e),o=on(e.focusPath);if(!cs(t,o)||t.length<=o.length)return!1;var s=es(n,e,r),a=es(n,e,i),l=es(n,e,t);return l!==-1&&l>=s&&l<=a}return!1}function es(n,e,t){var r=on(e.focusPath);if(!cs(t,r)||t.length<=r.length)return-1;var i=t[r.length],o=Ye(n,r);if(Gn(o))return Object.keys(o).indexOf(i);if(Nn(o)){var s=zr(i);if(s0?0:-1,s=e.map(function(l,c){return fe(fe({},l),{},{active:c===o})}),a=s[o];return{items:s,itemsMap:wh(s,function(l){return Ue(l.path)}),activeItem:a,activeIndex:o}}function H2(n){var e=n.activeIndex0?0:-1,t=n.items[e],r=n.items.map(function(i,o){return fe(fe({},i),{},{active:o===e})});return fe(fe({},n),{},{items:r,itemsMap:wh(r,function(i){return Ue(i.path)}),activeItem:t,activeIndex:e})}function dV(n){var e=n.activeIndex>0?n.activeIndex-1:n.items.length-1,t=n.items[e],r=n.items.map(function(i,o){return fe(fe({},i),{},{active:o===e})});return fe(fe({},n),{},{items:r,itemsMap:wh(r,function(i){return Ue(i.path)}),activeItem:t,activeIndex:e})}function L4(n,e){var t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.toLowerCase(),o=(t=r==null?void 0:r.maxResults)!==null&&t!==void 0?t:1/0,s=r==null?void 0:r.columns,a=[],l=[];function c(v){a.length>=o||a.push(v)}function u(v,g){if(Nn(g)){var b=l.length;l.push("0");for(var y=0;y=o)return;l.pop()}else if(Gn(g)){var x=Object.keys(g),w=l.length;l.push("");for(var $=0,S=x;$=o)return}l.pop()}else U2(String(g),v,l,so.value,c)}if(n==="")return[];if(s){if(!Array.isArray(e))throw new Error("json must be an Array when option columns is defined");for(var f=0;fp.length+1;)l.pop();u(i,Ye(d,p))}if(a.length>=o)break}return a}return u(i,e),a}function U2(n,e,t,r,i){var o=n.toLowerCase(),s=0,a=-1,l=-1;do(l=o.indexOf(e,a))!==-1&&(a=l+e.length,i({path:t.slice(0),field:r,fieldIndex:s,start:l,end:a}),s++);while(l!==-1)}function Ig(n,e,t,r){return n.substring(0,t)+e+n.substring(r)}function W2(n,e,t){var r=n;return C7(t,function(i){r=Ig(r,e,i.start,i.end)}),r}function hV(n,e,t,r,i){var o=r.field,s=r.path,a=r.start,l=r.end;if(o===so.key){var c=on(s),u=Ye(n,c),f=en(s),d=Du(c,Object.keys(u),f,Ig(f,t,a,l));return{newSelection:Ll(n,d),operations:d}}if(o===so.value){var h=Ye(n,s);if(h===void 0)throw new Error("Cannot replace: path not found ".concat(Ue(s)));var p=typeof h=="string"?h:String(h),m=Ue(s),v=ls(h,e.enforceStringMap,m,i),g=Ig(p,t,a,l),b=[{op:"replace",path:Ue(s),value:v?g:Gl(g,i)}];return{newSelection:Ll(n,b),operations:b}}throw new Error("Cannot replace: unknown type of search result field ".concat(o))}function pV(n,e,t,r,i){for(var o=L4(t,n,{maxResults:1/0}),s=[],a=0;ae.floating[o]&&(s=nh(s)),[s,nh(s)]}function BV(n){var e=nh(n);return[Lg(n),e,Lg(e)]}function Lg(n){return n.replace(/start|end/g,function(e){return DV[e]})}function zV(n,e,t,r){var i=Yh(n),o=function(s,a,l){var c=["left","right"],u=["right","left"];switch(s){case"top":case"bottom":return l?a?u:c:a?c:u;case"left":case"right":return a?["top","bottom"]:["bottom","top"];default:return[]}}(Ra(n),t==="start",r);return i&&(o=o.map(function(s){return s+"-"+i}),e&&(o=o.concat(o.map(Lg)))),o}function nh(n){return n.replace(/left|right|bottom|top/g,function(e){return IV[e]})}function FV(n){return typeof n!="number"?function(e){return fe({top:0,right:0,bottom:0,left:0},e)}(n):{top:n,right:n,bottom:n,left:n}}function rh(n){return fe(fe({},n),{},{top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height})}function Y2(n,e,t){var r,i=n.reference,o=n.floating,s=Xh(e),a=q4(e),l=F4(a),c=Ra(e),u=s==="y",f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;switch(c){case"top":r={x:f,y:i.y-o.height};break;case"bottom":r={x:f,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:d};break;case"left":r={x:i.x-o.width,y:d};break;default:r={x:i.x,y:i.y}}switch(Yh(e)){case"start":r[a]-=h*(t&&u?-1:1);break;case"end":r[a]+=h*(t&&u?-1:1)}return r}var qV=function(){var n=$t(Pe().mark(function e(t,r,i){var o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D,U,q;return Pe().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return o=i.placement,s=o===void 0?"bottom":o,a=i.strategy,l=a===void 0?"absolute":a,c=i.middleware,u=c===void 0?[]:c,f=i.platform,d=u.filter(Boolean),X.next=4,f.isRTL==null?void 0:f.isRTL(r);case 4:return h=X.sent,X.next=7,f.getElementRects({reference:t,floating:r,strategy:l});case 7:p=X.sent,m=Y2(p,s,h),v=m.x,g=m.y,b=s,y={},x=0,w=0;case 13:if(!(w0}).reduce(function(H,J){return H+J},0)]}).sort(function(P,H){return P[1]-H[1]})[0])==null?void 0:te[0],R&&(A=R),k.abrupt("break",35);case 33:return A=l,k.abrupt("break",35);case 35:if(o===A){k.next=37;break}return k.abrupt("return",{reset:{placement:A}});case 37:return k.abrupt("return",{});case 38:case"end":return k.stop()}},t)}))()}}},YV=function(n,e,t){var r=new Map,i=fe({platform:JV},t),o=fe(fe({},i.platform),{},{_c:r});return qV(n,e,fe(fe({},i),{},{platform:o}))};function XV(n){var e=n.loadOptions,t=n.filterText,r=n.items,i=n.multiple,o=n.value,s=n.itemId,a=n.groupBy,l=n.filterSelectedItems,c=n.itemFilter,u=n.convertStringItemsToObjects,f=n.filterGroupedItems,d=n.label;if(r&&e)return r;if(!r)return[];r&&r.length>0&&sr(r[0])!=="object"&&(r=u(r));var h=r.filter(function(p){var m=c(p[d],t,p);return m&&i&&o!=null&&o.length&&(m=!o.some(function(v){return!!l&&v[s]===p[s]})),m});return a&&(h=f(h)),h}function ZV(n){return qg.apply(this,arguments)}function qg(){return qg=$t(Pe().mark(function n(e){var t,r,i,o,s;return Pe().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.dispatch,r=e.loadOptions,i=e.convertStringItemsToObjects,o=e.filterText,a.next=3,r(o).catch(function(l){console.warn("svelte-select loadOptions error :>> ",l),t("error",{type:"loadOptions",details:l})});case 3:if(!(s=a.sent)||s.cancelled){a.next=7;break}return s?(s&&s.length>0&&sr(s[0])!=="object"&&(s=i(s)),t("loaded",{items:s})):s=[],a.abrupt("return",{filteredItems:s,loading:!1,focused:!0,listOpen:!0});case 7:case"end":return a.stop()}},n)})),qg.apply(this,arguments)}function eH(n){Et(n,"svelte-qbd276","svg.svelte-qbd276{width:var(--chevron-icon-width, 20px);height:var(--chevron-icon-width, 20px);color:var(--chevron-icon-colour, currentColor)}")}function tH(n){var e,t;return{c:function(){e=Io("svg"),j(t=Io("path"),"fill","currentColor"),j(t,"d",`M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 +`)}return null}function Xr(n){return(or(n)||rn(n))&&n.edit===!0}function Yl(n){return or(n)||rn(n)||Cn(n)}function _f(n){return or(n)||rn(n)||Gh(n)}function Rg(n){switch(n.type){case to.key:return zi(n.path,!1);case to.value:return Ut(n.path,!1);case to.after:return Zo(n.path);case to.inside:return us(n.path)}}function q2(n,e,t){switch(e){case _n.key:return zi(t,!1);case _n.value:return Ut(t,!1);case _n.after:return Zo(t);case _n.inside:return us(t);case _n.multi:case _n.text:return Wr(t,t)}}function V2(n,e,t){return e&&(du(n,e,t)||cs(Cn(e)?on(e.focusPath):e.path,t))?e:null}function du(n,e,t){if(n===void 0||!e)return!1;if(or(e)||dr(e)||hi(e))return sn(e.path,t);if(rn(e))return cs(t,e.path);if(Cn(e)){var r=Go(n,e),i=Is(n,e),o=on(e.focusPath);if(!cs(t,o)||t.length<=o.length)return!1;var s=es(n,e,r),a=es(n,e,i),l=es(n,e,t);return l!==-1&&l>=s&&l<=a}return!1}function es(n,e,t){var r=on(e.focusPath);if(!cs(t,r)||t.length<=r.length)return-1;var i=t[r.length],o=Ye(n,r);if(Gn(o))return Object.keys(o).indexOf(i);if(Nn(o)){var s=zr(i);if(s0?0:-1,s=e.map(function(l,c){return fe(fe({},l),{},{active:c===o})}),a=s[o];return{items:s,itemsMap:wh(s,function(l){return Ue(l.path)}),activeItem:a,activeIndex:o}}function U2(n){var e=n.activeIndex0?0:-1,t=n.items[e],r=n.items.map(function(i,o){return fe(fe({},i),{},{active:o===e})});return fe(fe({},n),{},{items:r,itemsMap:wh(r,function(i){return Ue(i.path)}),activeItem:t,activeIndex:e})}function dV(n){var e=n.activeIndex>0?n.activeIndex-1:n.items.length-1,t=n.items[e],r=n.items.map(function(i,o){return fe(fe({},i),{},{active:o===e})});return fe(fe({},n),{},{items:r,itemsMap:wh(r,function(i){return Ue(i.path)}),activeItem:t,activeIndex:e})}function L4(n,e){var t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.toLowerCase(),o=(t=r==null?void 0:r.maxResults)!==null&&t!==void 0?t:1/0,s=r==null?void 0:r.columns,a=[],l=[];function c(v){a.length>=o||a.push(v)}function u(v,g){if(Nn(g)){var b=l.length;l.push("0");for(var y=0;y=o)return;l.pop()}else if(Gn(g)){var j=Object.keys(g),w=l.length;l.push("");for(var $=0,S=j;$=o)return}l.pop()}else W2(String(g),v,l,so.value,c)}if(n==="")return[];if(s){if(!Array.isArray(e))throw new Error("json must be an Array when option columns is defined");for(var f=0;fp.length+1;)l.pop();u(i,Ye(d,p))}if(a.length>=o)break}return a}return u(i,e),a}function W2(n,e,t,r,i){var o=n.toLowerCase(),s=0,a=-1,l=-1;do(l=o.indexOf(e,a))!==-1&&(a=l+e.length,i({path:t.slice(0),field:r,fieldIndex:s,start:l,end:a}),s++);while(l!==-1)}function Ig(n,e,t,r){return n.substring(0,t)+e+n.substring(r)}function J2(n,e,t){var r=n;return C7(t,function(i){r=Ig(r,e,i.start,i.end)}),r}function hV(n,e,t,r,i){var o=r.field,s=r.path,a=r.start,l=r.end;if(o===so.key){var c=on(s),u=Ye(n,c),f=en(s),d=Du(c,Object.keys(u),f,Ig(f,t,a,l));return{newSelection:Ll(n,d),operations:d}}if(o===so.value){var h=Ye(n,s);if(h===void 0)throw new Error("Cannot replace: path not found ".concat(Ue(s)));var p=typeof h=="string"?h:String(h),m=Ue(s),v=ls(h,e.enforceStringMap,m,i),g=Ig(p,t,a,l),b=[{op:"replace",path:Ue(s),value:v?g:Gl(g,i)}];return{newSelection:Ll(n,b),operations:b}}throw new Error("Cannot replace: unknown type of search result field ".concat(o))}function pV(n,e,t,r,i){for(var o=L4(t,n,{maxResults:1/0}),s=[],a=0;ae.floating[o]&&(s=nh(s)),[s,nh(s)]}function BV(n){var e=nh(n);return[Lg(n),e,Lg(e)]}function Lg(n){return n.replace(/start|end/g,function(e){return DV[e]})}function zV(n,e,t,r){var i=Yh(n),o=function(s,a,l){var c=["left","right"],u=["right","left"];switch(s){case"top":case"bottom":return l?a?u:c:a?c:u;case"left":case"right":return a?["top","bottom"]:["bottom","top"];default:return[]}}(Ra(n),t==="start",r);return i&&(o=o.map(function(s){return s+"-"+i}),e&&(o=o.concat(o.map(Lg)))),o}function nh(n){return n.replace(/left|right|bottom|top/g,function(e){return IV[e]})}function FV(n){return typeof n!="number"?function(e){return fe({top:0,right:0,bottom:0,left:0},e)}(n):{top:n,right:n,bottom:n,left:n}}function rh(n){return fe(fe({},n),{},{top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height})}function X2(n,e,t){var r,i=n.reference,o=n.floating,s=Xh(e),a=q4(e),l=F4(a),c=Ra(e),u=s==="y",f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;switch(c){case"top":r={x:f,y:i.y-o.height};break;case"bottom":r={x:f,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:d};break;case"left":r={x:i.x-o.width,y:d};break;default:r={x:i.x,y:i.y}}switch(Yh(e)){case"start":r[a]-=h*(t&&u?-1:1);break;case"end":r[a]+=h*(t&&u?-1:1)}return r}var qV=function(){var n=$t(Pe().mark(function e(t,r,i){var o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D,U,q;return Pe().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return o=i.placement,s=o===void 0?"bottom":o,a=i.strategy,l=a===void 0?"absolute":a,c=i.middleware,u=c===void 0?[]:c,f=i.platform,d=u.filter(Boolean),X.next=4,f.isRTL==null?void 0:f.isRTL(r);case 4:return h=X.sent,X.next=7,f.getElementRects({reference:t,floating:r,strategy:l});case 7:p=X.sent,m=X2(p,s,h),v=m.x,g=m.y,b=s,y={},j=0,w=0;case 13:if(!(w0}).reduce(function(H,J){return H+J},0)]}).sort(function(P,H){return P[1]-H[1]})[0])==null?void 0:te[0],R&&(A=R),k.abrupt("break",35);case 33:return A=l,k.abrupt("break",35);case 35:if(o===A){k.next=37;break}return k.abrupt("return",{reset:{placement:A}});case 37:return k.abrupt("return",{});case 38:case"end":return k.stop()}},t)}))()}}},YV=function(n,e,t){var r=new Map,i=fe({platform:JV},t),o=fe(fe({},i.platform),{},{_c:r});return qV(n,e,fe(fe({},i),{},{platform:o}))};function XV(n){var e=n.loadOptions,t=n.filterText,r=n.items,i=n.multiple,o=n.value,s=n.itemId,a=n.groupBy,l=n.filterSelectedItems,c=n.itemFilter,u=n.convertStringItemsToObjects,f=n.filterGroupedItems,d=n.label;if(r&&e)return r;if(!r)return[];r&&r.length>0&&sr(r[0])!=="object"&&(r=u(r));var h=r.filter(function(p){var m=c(p[d],t,p);return m&&i&&o!=null&&o.length&&(m=!o.some(function(v){return!!l&&v[s]===p[s]})),m});return a&&(h=f(h)),h}function ZV(n){return qg.apply(this,arguments)}function qg(){return qg=$t(Pe().mark(function n(e){var t,r,i,o,s;return Pe().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t=e.dispatch,r=e.loadOptions,i=e.convertStringItemsToObjects,o=e.filterText,a.next=3,r(o).catch(function(l){console.warn("svelte-select loadOptions error :>> ",l),t("error",{type:"loadOptions",details:l})});case 3:if(!(s=a.sent)||s.cancelled){a.next=7;break}return s?(s&&s.length>0&&sr(s[0])!=="object"&&(s=i(s)),t("loaded",{items:s})):s=[],a.abrupt("return",{filteredItems:s,loading:!1,focused:!0,listOpen:!0});case 7:case"end":return a.stop()}},n)})),qg.apply(this,arguments)}function eH(n){Et(n,"svelte-qbd276","svg.svelte-qbd276{width:var(--chevron-icon-width, 20px);height:var(--chevron-icon-width, 20px);color:var(--chevron-icon-colour, currentColor)}")}function tH(n){var e,t;return{c:function(){e=Io("svg"),x(t=Io("path"),"fill","currentColor"),x(t,"d",`M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 - 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z`),j(e,"width","100%"),j(e,"height","100%"),j(e,"viewBox","0 0 20 20"),j(e,"focusable","false"),j(e,"aria-hidden","true"),j(e,"class","svelte-qbd276")},m:function(r,i){ee(r,e,i),E(e,t)},p:Te,i:Te,o:Te,d:function(r){r&&Z(e)}}}var nH=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,null,tH,yr,{},eH),r}return ht(e,mt),ut(e)}();function rH(n){Et(n,"svelte-whdbu1","svg.svelte-whdbu1{width:var(--clear-icon-width, 20px);height:var(--clear-icon-width, 20px);color:var(--clear-icon-color, currentColor)}")}function iH(n){var e,t;return{c:function(){e=Io("svg"),j(t=Io("path"),"fill","currentColor"),j(t,"d",`M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124 - l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z`),j(e,"width","100%"),j(e,"height","100%"),j(e,"viewBox","-2 -2 50 50"),j(e,"focusable","false"),j(e,"aria-hidden","true"),j(e,"role","presentation"),j(e,"class","svelte-whdbu1")},m:function(r,i){ee(r,e,i),E(e,t)},p:Te,i:Te,o:Te,d:function(r){r&&Z(e)}}}var ih=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,null,iH,yr,{},rH),r}return ht(e,mt),ut(e)}();function oH(n){Et(n,"svelte-1p3nqvd",".loading.svelte-1p3nqvd{width:var(--spinner-width, 20px);height:var(--spinner-height, 20px);color:var(--spinner-color, var(--icons-color));animation:svelte-1p3nqvd-rotate 0.75s linear infinite;transform-origin:center center;transform:none}.circle_path.svelte-1p3nqvd{stroke-dasharray:90;stroke-linecap:round}@keyframes svelte-1p3nqvd-rotate{100%{transform:rotate(360deg)}}")}function sH(n){var e,t;return{c:function(){e=Io("svg"),j(t=Io("circle"),"class","circle_path svelte-1p3nqvd"),j(t,"cx","50"),j(t,"cy","50"),j(t,"r","20"),j(t,"fill","none"),j(t,"stroke","currentColor"),j(t,"stroke-width","5"),j(t,"stroke-miterlimit","10"),j(e,"class","loading svelte-1p3nqvd"),j(e,"viewBox","25 25 50 50")},m:function(r,i){ee(r,e,i),E(e,t)},p:Te,i:Te,o:Te,d:function(r){r&&Z(e)}}}var aH=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,null,sH,yr,{},oH),r}return ht(e,mt),ut(e)}();function lH(n){Et(n,"svelte-82qwg8",".svelte-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{--borderRadius:var(--border-radius);--clearSelectColor:var(--clear-select-color);--clearSelectWidth:var(--clear-select-width);--disabledBackground:var(--disabled-background);--disabledBorderColor:var(--disabled-border-color);--disabledColor:var(--disabled-color);--disabledPlaceholderColor:var(--disabled-placeholder-color);--disabledPlaceholderOpacity:var(--disabled-placeholder-opacity);--errorBackground:var(--error-background);--errorBorder:var(--error-border);--groupItemPaddingLeft:var(--group-item-padding-left);--groupTitleColor:var(--group-title-color);--groupTitleFontSize:var(--group-title-font-size);--groupTitleFontWeight:var(--group-title-font-weight);--groupTitlePadding:var(--group-title-padding);--groupTitleTextTransform:var(--group-title-text-transform);--groupTitleBorderColor:var(--group-title-border-color);--groupTitleBorderWidth:var(--group-title-border-width);--groupTitleBorderStyle:var(--group-title-border-style);--indicatorColor:var(--chevron-color);--indicatorHeight:var(--chevron-height);--indicatorWidth:var(--chevron-width);--inputColor:var(--input-color);--inputLeft:var(--input-left);--inputLetterSpacing:var(--input-letter-spacing);--inputMargin:var(--input-margin);--inputPadding:var(--input-padding);--itemActiveBackground:var(--item-active-background);--itemColor:var(--item-color);--itemFirstBorderRadius:var(--item-first-border-radius);--itemHoverBG:var(--item-hover-bg);--itemHoverColor:var(--item-hover-color);--itemIsActiveBG:var(--item-is-active-bg);--itemIsActiveColor:var(--item-is-active-color);--itemIsNotSelectableColor:var(--item-is-not-selectable-color);--itemPadding:var(--item-padding);--listBackground:var(--list-background);--listBorder:var(--list-border);--listBorderRadius:var(--list-border-radius);--listEmptyColor:var(--list-empty-color);--listEmptyPadding:var(--list-empty-padding);--listEmptyTextAlign:var(--list-empty-text-align);--listMaxHeight:var(--list-max-height);--listPosition:var(--list-position);--listShadow:var(--list-shadow);--listZIndex:var(--list-z-index);--multiItemBG:var(--multi-item-bg);--multiItemBorderRadius:var(--multi-item-border-radius);--multiItemDisabledHoverBg:var(--multi-item-disabled-hover-bg);--multiItemDisabledHoverColor:var(--multi-item-disabled-hover-color);--multiItemHeight:var(--multi-item-height);--multiItemMargin:var(--multi-item-margin);--multiItemPadding:var(--multi-item-padding);--multiSelectInputMargin:var(--multi-select-input-margin);--multiSelectInputPadding:var(--multi-select-input-padding);--multiSelectPadding:var(--multi-select-padding);--placeholderColor:var(--placeholder-color);--placeholderOpacity:var(--placeholder-opacity);--selectedItemPadding:var(--selected-item-padding);--spinnerColor:var(--spinner-color);--spinnerHeight:var(--spinner-height);--spinnerWidth:var(--spinner-width);--internal-padding:0 0 0 16px;border:var(--border, 1px solid #d8dbdf);border-radius:var(--border-radius, 6px);min-height:var(--height, 42px);position:relative;display:flex;align-items:stretch;padding:var(--padding, var(--internal-padding));background:var(--background, #fff);margin:var(--margin, 0);width:var(--width, 100%);font-size:var(--font-size, 16px);max-height:var(--max-height)}.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{box-sizing:var(--box-sizing, border-box)}.svelte-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:hover{border:var(--border-hover, 1px solid #b2b8bf)}.value-container.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;flex:1 1 0%;flex-wrap:wrap;align-items:center;gap:5px 10px;padding:var(--value-container-padding, 5px 0);position:relative;overflow:var(--value-container-overflow, hidden);align-self:stretch}.prepend.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.indicators.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;flex-shrink:0;align-items:center}.indicators.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:var(--indicators-position);top:var(--indicators-top);right:var(--indicators-right);bottom:var(--indicators-bottom)}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:absolute;cursor:default;border:none;color:var(--input-color, var(--item-color));padding:var(--input-padding, 0);letter-spacing:var(--input-letter-spacing, inherit);margin:var(--input-margin, 0);min-width:10px;top:0;right:0;bottom:0;left:0;background:transparent;font-size:var(--font-size, 16px)}.svelte-82qwg8:not(.multi)>.value-container.svelte-82qwg8>input.svelte-82qwg8{width:100%;height:100%}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8::placeholder{color:var(--placeholder-color, #78848f);opacity:var(--placeholder-opacity, 1)}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:none}.svelte-select.focused.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border:var(--border-focused, 1px solid #006fe8);border-radius:var(--border-radius-focused, var(--border-radius, 6px))}.disabled.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--disabled-background, #ebedef);border-color:var(--disabled-border-color, #ebedef);color:var(--disabled-color, #c1c6cc)}.disabled.svelte-82qwg8 input.svelte-82qwg8.svelte-82qwg8::placeholder{color:var(--disabled-placeholder-color, #c1c6cc);opacity:var(--disabled-placeholder-opacity, 1)}.selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:relative;overflow:var(--selected-item-overflow, hidden);padding:var(--selected-item-padding, 0 20px 0 0);text-overflow:ellipsis;white-space:nowrap;color:var(--selected-item-color, inherit);font-size:var(--font-size, 16px)}.multi.svelte-82qwg8 .selected-item.svelte-82qwg8.svelte-82qwg8{position:absolute;line-height:var(--height, 42px);height:var(--height, 42px)}.selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:none}.hide-selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0}.icon.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;align-items:center;justify-content:center}.clear-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{all:unset;display:flex;align-items:center;justify-content:center;width:var(--clear-select-width, 40px);height:var(--clear-select-height, 100%);color:var(--clear-select-color, var(--icons-color));margin:var(--clear-select-margin, 0);pointer-events:all;flex-shrink:0}.clear-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:var(--clear-select-focus-outline, 1px solid #006fe8)}.loading.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{width:var(--loading-width, 40px);height:var(--loading-height);color:var(--loading-color, var(--icons-color));margin:var(--loading--margin, 0);flex-shrink:0}.chevron.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{width:var(--chevron-width, 40px);height:var(--chevron-height, 40px);background:var(--chevron-background, transparent);pointer-events:var(--chevron-pointer-events, none);color:var(--chevron-color, var(--icons-color));border:var(--chevron-border, 0 0 0 1px solid #d8dbdf);flex-shrink:0}.multi.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{padding:var(--multi-select-padding, var(--internal-padding))}.multi.svelte-82qwg8 input.svelte-82qwg8.svelte-82qwg8{padding:var(--multi-select-input-padding, 0);position:relative;margin:var(--multi-select-input-margin, 5px 0);flex:1 1 40px}.svelte-select.error.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border:var(--error-border, 1px solid #ff2d55);background:var(--error-background, #fff)}.a11y-text.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{z-index:9999;border:0px;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0px;white-space:nowrap}.multi-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--multi-item-bg, #ebedef);margin:var(--multi-item-margin, 0);outline:var(--multi-item-outline, 1px solid #ddd);border-radius:var(--multi-item-border-radius, 4px);height:var(--multi-item-height, 25px);line-height:var(--multi-item-height, 25px);display:flex;cursor:default;padding:var(--multi-item-padding, 0 5px);overflow:hidden;gap:var(--multi-item-gap, 4px);outline-offset:-1px;max-width:var(--multi-max-width, none);color:var(--multi-item-color, var(--item-color))}.multi-item.disabled.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:hover{background:var(--multi-item-disabled-hover-bg, #ebedef);color:var(--multi-item-disabled-hover-color, #c1c6cc)}.multi-item-text.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multi-item-clear.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;align-items:center;justify-content:center;--clear-icon-color:var(--multi-item-clear-icon-color, #000)}.multi-item.active.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{outline:var(--multi-item-active-outline, 1px solid #006fe8)}.svelte-select-list.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{box-shadow:var(--list-shadow, 0 2px 3px 0 rgba(44, 62, 80, 0.24));border-radius:var(--list-border-radius, 4px);max-height:var(--list-max-height, 252px);overflow-y:auto;background:var(--list-background, #fff);position:var(--list-position, absolute);z-index:var(--list-z-index, 2);border:var(--list-border)}.prefloat.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0;pointer-events:none}.list-group-title.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{color:var(--group-title-color, #8f8f8f);cursor:default;font-size:var(--group-title-font-size, 16px);font-weight:var(--group-title-font-weight, 600);height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--group-title-padding, 0 20px);text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:var(--group-title-text-transform, uppercase);border-width:var(--group-title-border-width, medium);border-style:var(--group-title-border-style, none);border-color:var(--group-title-border-color, color)}.empty.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{text-align:var(--list-empty-text-align, center);padding:var(--list-empty-padding, 20px 0);color:var(--list-empty-color, #78848f)}.item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{cursor:default;height:var(--item-height, var(--height, 42px));line-height:var(--item-line-height, var(--height, 42px));padding:var(--item-padding, 0 20px);color:var(--item-color, inherit);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:var(--item-transition, all 0.2s);align-items:center;width:100%}.item.group-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{padding-left:var(--group-item-padding-left, 40px)}.item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:active{background:var(--item-active-background, #b9daff)}.item.active.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--item-is-active-bg, #007aff);color:var(--item-is-active-color, #fff)}.item.first.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border-radius:var(--item-first-border-radius, 4px 4px 0 0)}.item.hover.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:not(.active){background:var(--item-hover-bg, #e7f2ff);color:var(--item-hover-color, inherit)}.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.hover.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.active.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:active{color:var(--item-is-not-selectable-color, #999);background:transparent}.required.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0;z-index:-1;position:absolute;top:0;left:0;bottom:0;right:0}")}var cH=function(n){return{value:8&n[0]}},nw=function(n){return{value:n[3]}},uH=function(n){return{value:8&n[0]}},rw=function(n){return{value:n[3]}},fH=function(n){return{listOpen:64&n[0]}},iw=function(n){return{listOpen:n[6]}},dH=function(n){return{}},ow=function(n){return{}},hH=function(n){return{}},sw=function(n){return{}},pH=function(n){return{selection:8&n[0]}},aw=function(n){return{selection:n[3]}};function lw(n,e,t){var r=n.slice();return r[126]=e[t],r[128]=t,r}var mH=function(n){return{}},cw=function(n){return{}},gH=function(n){return{selection:8&n[0]}},uw=function(n){return{selection:n[126],index:n[128]}},vH=function(n){return{}},fw=function(n){return{}},yH=function(n){return{}},dw=function(n){return{}},bH=function(n){return{}},hw=function(n){return{}};function pw(n,e,t){var r=n.slice();return r[126]=e[t],r[128]=t,r}var wH=function(n){return{item:16777216&n[0]}},mw=function(n){return{item:n[126],index:n[128]}},xH=function(n){return{filteredItems:16777216&n[0]}},gw=function(n){return{filteredItems:n[24]}},jH=function(n){return{}},vw=function(n){return{}};function yw(n){var e,t,r,i,o,s,a,l,c=n[50]["list-prepend"]&&bw(n),u=[SH,kH,$H],f=[];function d(p,m){return p[50].list?0:p[24].length>0?1:p[19]?-1:2}~(r=d(n))&&(i=f[r]=u[r](n));var h=n[50]["list-append"]&&xw(n);return{c:function(){e=V("div"),c&&c.c(),t=ce(),i&&i.c(),o=ce(),h&&h.c(),j(e,"class","svelte-select-list svelte-82qwg8"),j(e,"role","none"),$e(e,"prefloat",n[28])},m:function(p,m){ee(p,e,m),c&&c.m(e,null),E(e,t),~r&&f[r].m(e,null),E(e,o),h&&h.m(e,null),n[91](e),s=!0,a||(l=[mr(n[49].call(null,e)),Ce(e,"scroll",n[41]),Ce(e,"pointerup",uo(Oa(n[85]))),Ce(e,"mousedown",uo(Oa(n[86])))],a=!0)},p:function(p,m){p[50]["list-prepend"]?c?(c.p(p,m),524288&m[1]&&C(c,1)):((c=bw(p)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae());var v=r;(r=d(p))===v?~r&&f[r].p(p,m):(i&&(Ee(),M(f[v],1,1,function(){f[v]=null}),Ae()),~r?((i=f[r])?i.p(p,m):(i=f[r]=u[r](p)).c(),C(i,1),i.m(e,o)):i=null),p[50]["list-append"]?h?(h.p(p,m),524288&m[1]&&C(h,1)):((h=xw(p)).c(),C(h,1),h.m(e,null)):h&&(Ee(),M(h,1,1,function(){h=null}),Ae()),(!s||268435456&m[0])&&$e(e,"prefloat",p[28])},i:function(p){s||(C(c),C(i),C(h),s=!0)},o:function(p){M(c),M(i),M(h),s=!1},d:function(p){p&&Z(e),c&&c.d(),~r&&f[r].d(),h&&h.d(),n[91](null),a=!1,kn(l)}}}function bw(n){var e,t=n[83]["list-prepend"],r=Qn(t,n,n[82],vw);return{c:function(){r&&r.c()},m:function(i,o){r&&r.m(i,o),e=!0},p:function(i,o){r&&r.p&&(!e||1048576&o[2])&&Xn(r,t,i,i[82],e?Yn(t,i[82],o,jH):Zn(i[82]),vw)},i:function(i){e||(C(r,i),e=!0)},o:function(i){M(r,i),e=!1},d:function(i){r&&r.d(i)}}}function $H(n){var e,t,r=n[83].empty,i=Qn(r,n,n[82],hw),o=i||{c:function(){(t=V("div")).textContent="No options",j(t,"class","empty svelte-82qwg8")},m:function(s,a){ee(s,t,a)},p:Te,d:function(s){s&&Z(t)}};return{c:function(){o&&o.c()},m:function(s,a){o&&o.m(s,a),e=!0},p:function(s,a){i&&i.p&&(!e||1048576&a[2])&&Xn(i,r,s,s[82],e?Yn(r,s[82],a,bH):Zn(s[82]),hw)},i:function(s){e||(C(o,s),e=!0)},o:function(s){M(o,s),e=!1},d:function(s){o&&o.d(s)}}}function kH(n){for(var e,t,r=Mt(n[24]),i=[],o=0;o1&&arguments[1]!==void 0?arguments[1]:1;clearTimeout(d),d=setTimeout(re,Je)}:ye,vt=e.debounceWait,Nt=vt===void 0?300:vt,bn=e.hideEmptyState,En=bn!==void 0&&bn,Bt=e.inputAttributes,ln=Bt===void 0?{}:Bt,Jt=e.listAutoWidth,Ot=Jt===void 0||Jt,Sn=e.showChevron,An=Sn!==void 0&&Sn,xn=e.listOffset,Ar=xn===void 0?5:xn,Q=e.hoverItemIndex,ve=Q===void 0?0:Q,Ie=e.floatingConfig,ze=Ie===void 0?{}:Ie,Fe=e.class,kt=Fe===void 0?"":Fe;function zt(re){var Je=[],xt={};re.forEach(function(Rt){var Gt=nn(Rt);Je.includes(Gt)||(Je.push(Gt),xt[Gt]=[],Gt&&xt[Gt].push(Object.assign(St(Gt,Rt),{id:Gt,groupHeader:!0,selectable:ge}))),xt[Gt].push(Object.assign({groupItem:!!Gt},Rt))});var yn=[];return ne(Je).forEach(function(Rt){xt[Rt]&&yn.push.apply(yn,Vt(xt[Rt]))}),yn}function Kt(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Je=arguments.length>1?arguments[1]:void 0;t(7,ve=re<0?0:re),!Je&&nn&&c[ve]&&!c[ve].selectable&&br(1)}function z(){var re=!0;if(ae){var Je=[],xt=[];ae.forEach(function(yn){Je.includes(yn[Re])?re=!1:(Je.push(yn[Re]),xt.push(yn))}),re||t(3,ae=xt)}return re}function le(re){var Je=re?re[Re]:ae[Re];return qe.find(function(xt){return xt[Re]===Je})}function xe(re){return Me.apply(this,arguments)}function Me(){return(Me=$t(Pe().mark(function re(Je){var xt;return Pe().wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:xt=ae[Je],ae.length===1?t(3,ae=void 0):t(3,ae=ae.filter(function(Rt){return Rt!==xt})),S("clear",xt);case 3:case"end":return yn.stop()}},re)}))).apply(this,arguments)}function Ne(re){var Je,xt;Se&&A===((Je=document)===null||Je===void 0?void 0:Je.activeElement)||(re&&S("focus",re),(xt=A)===null||xt===void 0||xt.focus(),t(2,Se=!0))}function Le(re){return bt.apply(this,arguments)}function bt(){return(bt=$t(Pe().mark(function re(Je){var xt;return Pe().wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:if(!ir){yn.next=2;break}return yn.abrupt("return");case 2:(ue||Se)&&(S("blur",Je),nt(),t(2,Se=!1),t(26,h=void 0),(xt=A)===null||xt===void 0||xt.blur());case 3:case"end":return yn.stop()}},re)}))).apply(this,arguments)}function nt(){me&&t(4,et=""),t(6,ue=!1)}b=$t(Pe().mark(function re(){return Pe().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:t(78,p=ae),t(79,m=et),t(80,v=R);case 3:case"end":return Je.stop()}},re)})),Kl().$$.before_update.push(b),Hi(function(){ue&&t(2,Se=!0),Se&&A&&A.focus()});var yt=e.ariaValues,tr=yt===void 0?function(re){return"Option ".concat(re,", selected.")}:yt,Tn=e.ariaListOpen,nr=Tn===void 0?function(re,Je){return"You are currently focused on option ".concat(re,". There are ").concat(Je," results available.")}:Tn,qr=e.ariaFocused,Ft=qr===void 0?function(){return"Select is focused, type to refine list, press down to open the menu."}:qr,jn,cr=null;function dn(){clearTimeout(jn),jn=setTimeout(function(){ir=!1},100)}Mi(function(){var re;(re=cr)===null||re===void 0||re.remove()});var ir=!1;function Ki(re){re&&re.selectable!==!1&&function(Je){if(Je){t(4,et="");var xt=Object.assign({},Je);if(xt.groupHeader&&!xt.selectable)return;t(3,ae=R?ae?ae.concat([xt]):[xt]:t(3,ae=xt)),setTimeout(function(){er&&nt(),t(26,h=void 0),S("change",ae),S("select",Je)})}}(re)}function gi(re){ir||t(7,ve=re)}function Fa(re){var Je=re.item,xt=re.i;if((Je==null?void 0:Je.selectable)!==!1)return ae&&!R&&ae[Re]===Je[Re]?nt():void(function(yn){return yn.groupHeader&&yn.selectable||yn.selectable||!yn.hasOwnProperty("selectable")}(Je)&&(t(7,ve=xt),Ki(Je)))}function br(re){if(c.filter(function(xt){return!Object.hasOwn(xt,"selectable")||xt.selectable===!0}).length===0)return t(7,ve=0);re>0&&ve===c.length-1?t(7,ve=0):t(7,re<0&&ve===0?ve=c.length-1:ve+=re);var Je=c[ve];Je&&Je.selectable===!1&&(re!==1&&re!==-1||br(re))}var vi=ps,mo=ps;function ps(re){return{update:function(Je){Je.scroll&&(dn(),re.scrollIntoView({behavior:"auto",block:"nearest"}))}}}var ei,Gi={strategy:"absolute",placement:"bottom-start",middleware:[(ei=Ar,ei===void 0&&(ei=0),{name:"offset",options:ei,fn:function(re){return $t(Pe().mark(function Je(){var xt,yn,Rt,Gt,In,Ys,gr;return Pe().wrap(function(ur){for(;;)switch(ur.prev=ur.next){case 0:return Rt=re.x,Gt=re.y,In=re.placement,Ys=re.middlewareData,ur.next=3,VV(re,ei);case 3:if(gr=ur.sent,In!==((xt=Ys.offset)==null?void 0:xt.placement)||(yn=Ys.arrow)==null||!yn.alignmentOffset){ur.next=6;break}return ur.abrupt("return",{});case 6:return ur.abrupt("return",{x:Rt+gr.x,y:Gt+gr.y,data:fe(fe({},gr),{},{placement:In})});case 7:case"end":return ur.stop()}},Je)}))()}}),QV(),GV()],autoUpdate:!1},Zl=function(re){var Je,xt,yn={autoUpdate:!0},Rt=re,Gt=function(gr){return fe(fe(fe({},yn),re||{}),gr||{})},In=function(gr){Je&&xt&&(Rt=Gt(gr),YV(Je,xt,Rt).then(function(ur){var yi;Object.assign(xt.style,{position:ur.strategy,left:"".concat(ur.x,"px"),top:"".concat(ur.y,"px")}),!((yi=Rt)===null||yi===void 0)&&yi.onComputed&&Rt.onComputed(ur)}))},Ys=function(gr){Mi(gr.subscribe(function(ur){Je===void 0?(Je=ur,In()):(Object.assign(Je,ur),In())}))};return[function(gr){if("subscribe"in gr)return Ys(gr),{};Je=gr,In()},function(gr,ur){var yi;xt=gr,Rt=Gt(ur),setTimeout(function(){return In(ur)},0),In(ur);var qa=function(){yi&&(yi(),yi=void 0)},zu=function(){var ms=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rt||{}).autoUpdate;qa(),ms!==!1&&fr().then(function(){return KV(Je,xt,function(){return In(Rt)},ms===!0?{}:ms)})};return yi=zu(),{update:function(ms){In(ms),yi=zu(ms)},destroy:function(){qa()}}},In]}(Gi),Qs=At(Zl,3),ec=Qs[0],ip=Qs[1],op=Qs[2],tc=!0;return n.$$set=function(re){"justValue"in re&&t(52,F=re.justValue),"filter"in re&&t(53,W=re.filter),"getItems"in re&&t(54,U=re.getItems),"id"in re&&t(55,X=re.id),"name"in re&&t(8,Y=re.name),"container"in re&&t(0,B=re.container),"input"in re&&t(1,A=re.input),"multiple"in re&&t(9,R=re.multiple),"multiFullItemClearable"in re&&t(10,P=re.multiFullItemClearable),"disabled"in re&&t(11,J=re.disabled),"focused"in re&&t(2,Se=re.focused),"value"in re&&t(3,ae=re.value),"filterText"in re&&t(4,et=re.filterText),"placeholder"in re&&t(56,Qt=re.placeholder),"placeholderAlwaysShow"in re&&t(57,st=re.placeholderAlwaysShow),"items"in re&&t(51,qe=re.items),"label"in re&&t(12,He=re.label),"itemFilter"in re&&t(58,Oe=re.itemFilter),"groupBy"in re&&t(59,nn=re.groupBy),"groupFilter"in re&&t(60,ne=re.groupFilter),"groupHeaderSelectable"in re&&t(61,ge=re.groupHeaderSelectable),"itemId"in re&&t(13,Re=re.itemId),"loadOptions"in re&&t(62,rt=re.loadOptions),"containerStyles"in re&&t(14,Zt=re.containerStyles),"hasError"in re&&t(15,Ge=re.hasError),"filterSelectedItems"in re&&t(63,zn=re.filterSelectedItems),"required"in re&&t(16,Mn=re.required),"closeListOnChange"in re&&t(64,er=re.closeListOnChange),"clearFilterTextOnBlur"in re&&t(65,me=re.clearFilterTextOnBlur),"createGroupHeaderItem"in re&&t(66,St=re.createGroupHeaderItem),"searchable"in re&&t(17,_t=re.searchable),"inputStyles"in re&&t(18,de=re.inputStyles),"clearable"in re&&t(68,We=re.clearable),"loading"in re&&t(5,G=re.loading),"listOpen"in re&&t(6,ue=re.listOpen),"debounce"in re&&t(69,it=re.debounce),"debounceWait"in re&&t(70,Nt=re.debounceWait),"hideEmptyState"in re&&t(19,En=re.hideEmptyState),"inputAttributes"in re&&t(71,ln=re.inputAttributes),"listAutoWidth"in re&&t(72,Ot=re.listAutoWidth),"showChevron"in re&&t(20,An=re.showChevron),"listOffset"in re&&t(73,Ar=re.listOffset),"hoverItemIndex"in re&&t(7,ve=re.hoverItemIndex),"floatingConfig"in re&&t(74,ze=re.floatingConfig),"class"in re&&t(21,kt=re.class),"ariaValues"in re&&t(75,tr=re.ariaValues),"ariaListOpen"in re&&t(76,nr=re.ariaListOpen),"ariaFocused"in re&&t(77,Ft=re.ariaFocused),"$$scope"in re&&t(82,w=re.$$scope)},n.$$.update=function(){var re,Je,xt,yn;8&n.$$.dirty[0]|1048576&n.$$.dirty[1]&&ae&&function(){if(typeof ae=="string"){var Rt=(qe||[]).find(function(Gt){return Gt[Re]===ae});t(3,ae=Rt||Oi(Oi({},Re,ae),"label",ae))}else R&&Array.isArray(ae)&&ae.length>0&&t(3,ae=ae.map(function(Gt){return typeof Gt=="string"?{value:Gt,label:Gt}:Gt}))}(),131072&n.$$.dirty[0]|512&n.$$.dirty[2]&&(!ln&&_t||(t(27,g=Object.assign({autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:!1,tabindex:0,type:"text","aria-autocomplete":"list"},ln)),X&&t(27,g.id=X,g),_t||t(27,g.readonly=!0,g))),512&n.$$.dirty[0]&&R&&ae&&(Array.isArray(ae)?t(3,ae=Vt(ae)):t(3,ae=[ae])),512&n.$$.dirty[0]|262144&n.$$.dirty[2]&&v&&!R&&ae&&t(3,ae=null),520&n.$$.dirty[0]&&R&&ae&&ae.length>1&&z(),8&n.$$.dirty[0]&&ae&&(R?JSON.stringify(ae)!==JSON.stringify(p)&&z()&&S("input",ae):p&&JSON.stringify(ae[Re])===JSON.stringify(p[Re])||S("input",ae)),520&n.$$.dirty[0]|65536&n.$$.dirty[2]&&!ae&&R&&p&&S("input",ae),6&n.$$.dirty[0]&&!Se&&A&&nt(),16&n.$$.dirty[0]|131072&n.$$.dirty[2]&&et!==m&&(rt||et.length!==0)&&(rt?it($t(Pe().mark(function Rt(){var Gt;return Pe().wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return t(5,G=!0),In.next=3,U({dispatch:S,loadOptions:rt,convertStringItemsToObjects:Aw,filterText:et});case 3:(Gt=In.sent)?(t(5,G=Gt.loading),t(6,ue=ue?Gt.listOpen:et.length>0),t(2,Se=ue&&Gt.focused),t(51,qe=nn?zt(Gt.filteredItems):Gt.filteredItems)):(t(5,G=!1),t(2,Se=!0),t(6,ue=!0));case 5:case"end":return In.stop()}},Rt)})),Nt):(t(6,ue=!0),R&&t(26,h=void 0))),12824&n.$$.dirty[0]|407896064&n.$$.dirty[1]|3&n.$$.dirty[2]&&t(24,c=W({loadOptions:rt,filterText:et,items:qe,multiple:R,value:ae,itemId:Re,groupBy:nn,label:He,filterSelectedItems:zn,itemFilter:Oe,convertStringItemsToObjects:Aw,filterGroupedItems:zt})),16777800&n.$$.dirty[0]&&!R&&ue&&ae&&c&&Kt(c.findIndex(function(Rt){return Rt[Re]===ae[Re]}),!0),576&n.$$.dirty[0]&&ue&&R&&t(7,ve=0),16&n.$$.dirty[0]&&et&&t(7,ve=0),128&n.$$.dirty[0]&&S("hoverItem",ve),520&n.$$.dirty[0]&&t(25,r=R?ae&&ae.length>0:ae),33554448&n.$$.dirty[0]&&t(35,i=r&&et.length>0),33556512&n.$$.dirty[0]|64&n.$$.dirty[2]&&t(34,o=r&&We&&!J&&!G),520&n.$$.dirty[0]|100663296&n.$$.dirty[1]&&t(33,s=st&&R||R&&((re=ae)===null||re===void 0?void 0:re.length)===0?Qt:ae?"":Qt),520&n.$$.dirty[0]&&t(32,a=ae?(Je=void 0,Je=R&&ae.length>0?ae.map(function(Rt){return Rt[He]}).join(", "):ae[He],tr(Je)):""),16777412&n.$$.dirty[0]&&t(31,l=function(){if(!c||c.length===0)return"";var Rt=c[ve];if(ue&&Rt){var Gt=c?c.length:0;return nr(Rt[He],Gt)}return Ft()}()),1048576&n.$$.dirty[1]&&function(Rt){Rt&&Rt.length!==0&&!Rt.some(function(Gt){return sr(Gt)!=="object"})&&ae&&(R?!ae.some(function(Gt){return!Gt||!Gt[Re]}):ae[Re])&&(Array.isArray(ae)?t(3,ae=ae.map(function(Gt){return le(Gt)||Gt})):t(3,ae=le()||ae))}(qe),8712&n.$$.dirty[0]&&t(52,F=R?ae?ae.map(function(Rt){return Rt[Re]}):null:ae&&ae[Re]),520&n.$$.dirty[0]|65536&n.$$.dirty[2]&&(R||!p||ae||S("input",ae)),16777800&n.$$.dirty[0]&&ue&&c&&!R&&!ae&&Kt(),16777216&n.$$.dirty[0]&&function(Rt){ue&&S("filter",Rt)}(c),1&n.$$.dirty[0]|4096&n.$$.dirty[2]&&B&&((xt=ze)===null||xt===void 0?void 0:xt.autoUpdate)===void 0&&t(81,Gi.autoUpdate=!0,Gi),1&n.$$.dirty[0]|528384&n.$$.dirty[2]&&B&&ze&&op(Object.assign(Gi,ze)),8388608&n.$$.dirty[0]&&t(30,u=!!cr),8388672&n.$$.dirty[0]&&function(Rt,Gt){if(!Rt||!Gt)return t(28,tc=!0);setTimeout(function(){t(28,tc=!1)},0)}(cr,ue),8388673&n.$$.dirty[0]&&ue&&B&&cr&&(yn=B.getBoundingClientRect().width,t(23,cr.style.width=Ot?yn+"px":"auto",cr)),128&n.$$.dirty[0]&&t(29,f=ve),70&n.$$.dirty[0]&&A&&ue&&!Se&&Ne()},[B,A,Se,ae,et,G,ue,ve,Y,R,P,J,He,Re,Zt,Ge,Mn,_t,de,En,An,kt,function(){S("clear",ae),t(3,ae=void 0),nt(),Ne()},cr,c,r,h,g,tc,f,u,l,a,s,o,i,xe,function(re){if(Se)switch(re.stopPropagation(),re.key){case"Escape":re.preventDefault(),nt();break;case"Enter":if(re.preventDefault(),ue){if(c.length===0)break;var Je=c[ve];if(ae&&!R&&ae[Re]===Je[Re]){nt();break}Ki(c[ve])}break;case"ArrowDown":re.preventDefault(),ue?br(1):(t(6,ue=!0),t(26,h=void 0));break;case"ArrowUp":re.preventDefault(),ue?br(-1):(t(6,ue=!0),t(26,h=void 0));break;case"Tab":if(ue&&Se){if(c.length===0||ae&&ae[Re]===c[ve][Re])return nt();re.preventDefault(),Ki(c[ve]),nt()}break;case"Backspace":if(!R||et.length>0)return;if(R&&ae&&ae.length>0){if(xe(h!==void 0?h:ae.length-1),h===0||h===void 0)break;t(26,h=ae.length>h?h-1:void 0)}break;case"ArrowLeft":if(!ae||!R||et.length>0)return;h===void 0?t(26,h=ae.length-1):ae.length>h&&h!==0&&t(26,h-=1);break;case"ArrowRight":if(!ae||!R||et.length>0||h===void 0)return;h===ae.length-1?t(26,h=void 0):h0?t(6,ue=!0):void t(6,ue=!ue)},dn,function(re){var Je;ue||Se||!B||B.contains(re.target)||(Je=cr)!==null&&Je!==void 0&&Je.contains(re.target)||Le()},gi,Fa,function(re,Je,xt){if(!R)return Je&&Je[xt]===re[xt]},vi,mo,ec,ip,$,qe,F,W,U,X,Qt,st,Oe,nn,ne,ge,rt,zn,er,me,St,function(){return c},We,it,Nt,ln,Ot,Ar,ze,tr,nr,Ft,p,m,v,Gi,w,x,function(re){Ef.call(this,n,re)},function(re){Ef.call(this,n,re)},function(re){Ef.call(this,n,re)},function(re){Ef.call(this,n,re)},function(re){return gi(re)},function(re){return gi(re)},function(re,Je){return Fa({item:re,i:Je})},function(re){It[re?"unshift":"push"](function(){t(23,cr=re)})},function(re){return xe(re)},function(re){return P?xe(re):{}},function(re){It[re?"unshift":"push"](function(){t(1,A=re)})},function(){et=this.value,t(4,et)},function(re){It[re?"unshift":"push"](function(){t(0,B=re)})}]}var la=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,EH,MH,yr,{justValue:52,filter:53,getItems:54,id:55,name:8,container:0,input:1,multiple:9,multiFullItemClearable:10,disabled:11,focused:2,value:3,filterText:4,placeholder:56,placeholderAlwaysShow:57,items:51,label:12,itemFilter:58,groupBy:59,groupFilter:60,groupHeaderSelectable:61,itemId:13,loadOptions:62,containerStyles:14,hasError:15,filterSelectedItems:63,required:16,closeListOnChange:64,clearFilterTextOnBlur:65,createGroupHeaderItem:66,getFilteredItems:67,searchable:17,inputStyles:18,clearable:68,loading:5,listOpen:6,debounce:69,debounceWait:70,hideEmptyState:19,inputAttributes:71,listAutoWidth:72,showChevron:20,listOffset:73,hoverItemIndex:7,floatingConfig:74,class:21,handleClear:22,ariaValues:75,ariaListOpen:76,ariaFocused:77},lH,[-1,-1,-1,-1,-1]),r}return ht(e,mt),ut(e,[{key:"getFilteredItems",get:function(){return this.$$.ctx[67]}},{key:"handleClear",get:function(){return this.$$.ctx[22]}}])}();function AH(n){Et(n,"svelte-ijtq0l","table.jse-transform-wizard.svelte-ijtq0l.svelte-ijtq0l{border-collapse:collapse;border-spacing:0;width:100%}table.jse-transform-wizard.svelte-ijtq0l input.svelte-ijtq0l{font-family:inherit;font-size:inherit}table.jse-transform-wizard.svelte-ijtq0l tr th.svelte-ijtq0l{font-weight:normal;text-align:left;width:60px}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l{width:100%;display:flex;flex-direction:row;margin-bottom:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select .multi-item{align-items:center}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select .value-container{gap:0 !important}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-filter-path{flex:4;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-filter-relation{flex:1.5;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-sort-path{flex:3;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-sort-direction{flex:1}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-projection-paths{flex:1}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select input{box-sizing:border-box}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal .jse-filter-value.svelte-ijtq0l{flex:4;padding:4px 8px;border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:var(--jse-input-radius, 3px);outline:none;background:var(--jse-input-background, var(--jse-background-color, #fff));color:inherit}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal .jse-filter-value.svelte-ijtq0l:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}")}function TH(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D,U,q,X,K,Y,T,B;function O(pe){n[16](pe)}var A={class:"jse-filter-path",showChevron:!0,items:n[7]};function te(pe){n[17](pe)}n[0]!==void 0&&(A.value=n[0]),a=new la({props:A}),It.push(function(){return oi(a,"value",O)});var R={class:"jse-filter-relation",showChevron:!0,items:n[8]};function k(pe){n[19](pe)}n[1]!==void 0&&(R.value=n[1]),u=new la({props:R}),It.push(function(){return oi(u,"value",te)});var P={class:"jse-sort-path",showChevron:!0,items:n[7]};function H(pe){n[20](pe)}n[3]!==void 0&&(P.value=n[3]),x=new la({props:P}),It.push(function(){return oi(x,"value",k)});var J={class:"jse-sort-direction",showChevron:!0,items:n[9]};function he(pe){n[21](pe)}n[4]!==void 0&&(J.value=n[4]),S=new la({props:J}),It.push(function(){return oi(S,"value",H)});var Se={class:"jse-projection-paths",multiple:!0,showChevron:!0,items:n[6]};return n[5]!==void 0&&(Se.value=n[5]),X=new la({props:Se}),It.push(function(){return oi(X,"value",he)}),{c:function(){e=V("table"),t=V("tr"),(r=V("th")).textContent="Filter",i=ce(),o=V("td"),s=V("div"),je(a.$$.fragment),c=ce(),je(u.$$.fragment),d=ce(),h=V("input"),p=ce(),m=V("tr"),(v=V("th")).textContent="Sort",g=ce(),b=V("td"),y=V("div"),je(x.$$.fragment),$=ce(),je(S.$$.fragment),F=ce(),I=V("tr"),(W=V("th")).textContent="Pick",D=ce(),U=V("td"),q=V("div"),je(X.$$.fragment),j(r,"class","svelte-ijtq0l"),j(h,"class","jse-filter-value svelte-ijtq0l"),j(s,"class","jse-horizontal svelte-ijtq0l"),j(v,"class","svelte-ijtq0l"),j(y,"class","jse-horizontal svelte-ijtq0l"),j(W,"class","svelte-ijtq0l"),j(q,"class","jse-horizontal svelte-ijtq0l"),j(e,"class","jse-transform-wizard svelte-ijtq0l")},m:function(pe,ae){ee(pe,e,ae),E(e,t),E(t,r),E(t,i),E(t,o),E(o,s),be(a,s,null),E(s,c),be(u,s,null),E(s,d),E(s,h),Do(h,n[2]),E(e,p),E(e,m),E(m,v),E(m,g),E(m,b),E(b,y),be(x,y,null),E(y,$),be(S,y,null),E(e,F),E(e,I),E(I,W),E(I,D),E(I,U),E(U,q),be(X,q,null),Y=!0,T||(B=Ce(h,"input",n[18]),T=!0)},p:function(pe,ae){var Qe=At(ae,1)[0],et={};128&Qe&&(et.items=pe[7]),!l&&1&Qe&&(l=!0,et.value=pe[0],ii(function(){return l=!1})),a.$set(et);var tn={};!f&&2&Qe&&(f=!0,tn.value=pe[1],ii(function(){return f=!1})),u.$set(tn),4&Qe&&h.value!==pe[2]&&Do(h,pe[2]);var Qt={};128&Qe&&(Qt.items=pe[7]),!w&&8&Qe&&(w=!0,Qt.value=pe[3],ii(function(){return w=!1})),x.$set(Qt);var oe={};!_&&16&Qe&&(_=!0,oe.value=pe[4],ii(function(){return _=!1})),S.$set(oe);var st={};64&Qe&&(st.items=pe[6]),!K&&32&Qe&&(K=!0,st.value=pe[5],ii(function(){return K=!1})),X.$set(st)},i:function(pe){Y||(C(a.$$.fragment,pe),C(u.$$.fragment,pe),C(x.$$.fragment,pe),C(S.$$.fragment,pe),C(X.$$.fragment,pe),Y=!0)},o:function(pe){M(a.$$.fragment,pe),M(u.$$.fragment,pe),M(x.$$.fragment,pe),M(S.$$.fragment,pe),M(X.$$.fragment,pe),Y=!1},d:function(pe){pe&&Z(e),we(a),we(u),we(x),we(S),we(X),T=!1,B()}}}function PH(n,e,t){var r,i,o,s,a,l,c,u,f,d,h,p=Sr("jsoneditor:TransformWizard"),m=e.json,v=e.queryOptions,g=v===void 0?{}:v,b=e.onChange,y=["==","!=","<","<=",">",">="].map(function(I){return{value:I,label:I}}),x=[{value:"asc",label:"ascending"},{value:"desc",label:"descending"}],w=(r=g)!==null&&r!==void 0&&(r=r.filter)!==null&&r!==void 0&&r.path?xc(g.filter.path):null,$=(i=g)!==null&&i!==void 0&&(i=i.filter)!==null&&i!==void 0&&i.relation?y.find(function(I){var W;return I.value===((W=g.filter)===null||W===void 0?void 0:W.relation)}):null,S=((o=g)===null||o===void 0||(o=o.filter)===null||o===void 0?void 0:o.value)||"",_=(s=g)!==null&&s!==void 0&&(s=s.sort)!==null&&s!==void 0&&s.path?xc(g.sort.path):null,F=(a=g)!==null&&a!==void 0&&(a=a.sort)!==null&&a!==void 0&&a.direction?x.find(function(I){var W;return I.value===((W=g.sort)===null||W===void 0?void 0:W.direction)}):null;return n.$$set=function(I){"json"in I&&t(11,m=I.json),"queryOptions"in I&&t(10,g=I.queryOptions),"onChange"in I&&t(12,b=I.onChange)},n.$$.update=function(){var I,W,D,U,q,X,K,Y,T,B,O,A,te;2048&n.$$.dirty&&t(15,l=Array.isArray(m)),34816&n.$$.dirty&&t(14,c=l?Ag(m):[]),34816&n.$$.dirty&&t(13,u=l?Ag(m,!0):[]),16384&n.$$.dirty&&t(7,f=c.map(xc)),8192&n.$$.dirty&&t(6,d=u?u.map(xc):[]),1088&n.$$.dirty&&t(5,h=(I=g)!==null&&I!==void 0&&(I=I.projection)!==null&&I!==void 0&&I.paths&&d?g.projection.paths.map(function(R){return d.find(function(k){return sn(k.value,R)})}).filter(function(R){return!!R}):null),1&n.$$.dirty&&(D=(W=w)===null||W===void 0?void 0:W.value,sn((U=g)===null||U===void 0||(U=U.filter)===null||U===void 0?void 0:U.path,D)||(p("changeFilterPath",D),t(10,g=Xi(g,["filter","path"],D,!0)),b(g))),2&n.$$.dirty&&(X=(q=$)===null||q===void 0?void 0:q.value,sn((K=g)===null||K===void 0||(K=K.filter)===null||K===void 0?void 0:K.relation,X)||(p("changeFilterRelation",X),t(10,g=Xi(g,["filter","relation"],X,!0)),b(g))),4&n.$$.dirty&&(Y=S,sn((T=g)===null||T===void 0||(T=T.filter)===null||T===void 0?void 0:T.value,Y)||(p("changeFilterValue",Y),t(10,g=Xi(g,["filter","value"],Y,!0)),b(g))),8&n.$$.dirty&&function(R){var k;sn((k=g)===null||k===void 0||(k=k.sort)===null||k===void 0?void 0:k.path,R)||(p("changeSortPath",R),t(10,g=Xi(g,["sort","path"],R,!0)),b(g))}((B=_)===null||B===void 0?void 0:B.value),16&n.$$.dirty&&(A=(O=F)===null||O===void 0?void 0:O.value,sn((te=g)===null||te===void 0||(te=te.sort)===null||te===void 0?void 0:te.direction,A)||(p("changeSortDirection",A),t(10,g=Xi(g,["sort","direction"],A,!0)),b(g))),32&n.$$.dirty&&function(R){var k;sn((k=g)===null||k===void 0||(k=k.projection)===null||k===void 0?void 0:k.paths,R)||(p("changeProjectionPaths",R),t(10,g=Xi(g,["projection","paths"],R,!0)),b(g))}(h?h.map(function(R){return R.value}):void 0)},[w,$,S,_,F,h,d,f,y,x,g,m,b,u,c,l,function(I){t(0,w=I)},function(I){t(1,$=I)},function(){S=this.value,t(2,S)},function(I){t(3,_=I)},function(I){t(4,F=I)},function(I){t(5,h=I),t(10,g),t(6,d),t(13,u),t(15,l),t(11,m)}]}var _H=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,PH,TH,Tt,{json:11,queryOptions:10,onChange:12},AH),r}return ht(e,mt),ut(e)}();function RH(n){Et(n,"svelte-1wg043c",'.jse-select-query-language.svelte-1wg043c.svelte-1wg043c{position:relative;width:32px}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container.svelte-1wg043c{position:absolute;top:0;right:0;display:flex;flex-direction:column;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container .jse-query-language.svelte-1wg043c{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;text-align:left;padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));white-space:nowrap;color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));background:var(--jse-context-menu-background, #656565)}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container .jse-query-language.svelte-1wg043c:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}')}function Tw(n,e,t){var r=n.slice();return r[5]=e[t],r}function NH(n){var e,t;return e=new un({props:{data:ym}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function IH(n){var e,t;return e=new un({props:{data:vm}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Pw(n){var e,t,r,i,o,s,a,l,c,u,f=n[5].name+"",d=[IH,NH],h=[];function p(v,g){return v[5].id===v[0]?0:1}function m(){return n[4](n[5])}return t=p(n),r=h[t]=d[t](n),{c:function(){e=V("button"),r.c(),i=ce(),o=De(f),s=ce(),j(e,"type","button"),j(e,"class","jse-query-language svelte-1wg043c"),j(e,"title",a="Select ".concat(n[5].name," as query language")),$e(e,"selected",n[5].id===n[0])},m:function(v,g){ee(v,e,g),h[t].m(e,null),E(e,i),E(e,o),E(e,s),l=!0,c||(u=Ce(e,"click",m),c=!0)},p:function(v,g){var b=t;(t=p(n=v))!==b&&(Ee(),M(h[b],1,1,function(){h[b]=null}),Ae(),(r=h[t])||(r=h[t]=d[t](n)).c(),C(r,1),r.m(e,i)),(!l||2&g)&&f!==(f=n[5].name+"")&>(o,f),(!l||2&g&&a!==(a="Select ".concat(n[5].name," as query language")))&&j(e,"title",a),(!l||3&g)&&$e(e,"selected",n[5].id===n[0])},i:function(v){l||(C(r),l=!0)},o:function(v){M(r),l=!1},d:function(v){v&&Z(e),h[t].d(),c=!1,u()}}}function DH(n){for(var e,t,r,i=Mt(n[1]),o=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{};switch(l=1e3,i=g.offset||0,f=g.callback,o=g.easing||GH,s=g.a11y||!1,sr(g.container)){case"object":n=g.container;break;case"string":n=document.querySelector(g.container);break;default:n=window.document.documentElement}switch(t=n.scrollTop,sr(v)){case"number":e=void 0,s=!1,r=t+v;break;case"object":r=h(e=v);break;case"string":e=document.querySelector(v),r=h(e)}switch(a=r-t+i,sr(g.duration)){case"number":l=g.duration;break;case"function":l=g.duration(a)}d?c=0:requestAnimationFrame(m)}},QH=1e3,If=Sr("jsoneditor:History");function Y4(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.maxItems||QH,t=[],r=0;function i(){return r0}function s(){return{canUndo:i(),canRedo:o(),length:t.length}}function a(){n.onChange&&n.onChange(s())}return{add:function(l){If("add",l),t=[l].concat(t.slice(r)).slice(0,e),r=0,a()},clear:function(){If("clear"),t=[],r=0,a()},getState:s,undo:function(){if(i()){var l=t[r];return r+=1,If("undo",l),a(),l}},redo:function(){if(o())return If("redo",t[r-=1]),a(),t[r]}}}function al(n,e){var t=Date.now(),r=n();return e(Date.now()-t),r}var Za=Sr("validation");function X4(n,e,t,r){if(Za("validateJSON"),!e)return[];if(t!==r){var i=t.stringify(n);return e(i!==void 0?r.parse(i):void 0)}return e(n)}function YH(n,e,t,r){if(Za("validateText"),n.length>ZF)return{validationErrors:[{path:[],message:"Validation turned off: the document is too large",severity:oo.info}]};if(n.length===0)return null;try{var i=al(function(){return t.parse(n)},function(l){return Za("validate: parsed json in ".concat(l," ms"))});if(!e)return null;var o=t===r?i:al(function(){return r.parse(n)},function(l){return Za("validate: parsed json with the validationParser in ".concat(l," ms"))}),s=al(function(){return e(o)},function(l){return Za("validate: validated json in ".concat(l," ms"))});return hn(s)?null:{validationErrors:s}}catch(l){var a=al(function(){return function(c,u){if(c.length>eq)return!1;try{return u.parse(Ao(c)),!0}catch{return!1}}(n,t)},function(c){return Za("validate: checked whether repairable in ".concat(c," ms"))});return{parseError:Nl(n,l.message||l.toString()),isRepairable:a}}}var Df=Sr("jsoneditor:FocusTracker");function K0(n){var e,t=n.onMount,r=n.onDestroy,i=n.getWindow,o=n.hasFocus,s=n.onFocus,a=n.onBlur,l=!1;function c(){var f=o();f&&(clearTimeout(e),l||(Df("focus"),s(),l=f))}function u(){l&&(clearTimeout(e),e=setTimeout(function(){o()||(Df("blur"),l=!1,a())}))}t(function(){Df("mount FocusTracker");var f=i();f&&(f.addEventListener("focusin",c,!0),f.addEventListener("focusout",u,!0))}),r(function(){Df("destroy FocusTracker");var f=i();f&&(f.removeEventListener("focusin",c,!0),f.removeEventListener("focusout",u,!0))})}function XH(n){Et(n,"svelte-p1zf9f",'.jse-message.svelte-p1zf9f.svelte-p1zf9f{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);padding:var(--jse-padding, 10px);display:flex;gap:var(--jse-padding, 10px);flex-wrap:wrap;align-items:stretch}.jse-message.jse-success.svelte-p1zf9f.svelte-p1zf9f{background:var(--message-success-background, #9ac45d);color:var(--jse-message-success-color, #fff)}.jse-message.svelte-p1zf9f .jse-text.svelte-p1zf9f{display:flex;flex:1;min-width:60%;align-items:center}.jse-message.svelte-p1zf9f .jse-text.jse-clickable.svelte-p1zf9f{cursor:pointer}.jse-message.svelte-p1zf9f .jse-text.jse-clickable.svelte-p1zf9f:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-message.jse-error.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-error-background, var(--jse-error-color, #ee5341));color:var(--jse-message-error-color, #fff)}.jse-message.jse-warning.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-warning-background, #ffde5c);color:var(--jse-message-warning-color, #4d4d4d)}.jse-message.jse-info.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-info-background, #4f91ff);color:var(--jse-message-info-color, #fff)}.jse-message.svelte-p1zf9f .jse-actions.svelte-p1zf9f{display:flex;gap:var(--jse-padding, 10px)}.jse-message.svelte-p1zf9f .jse-actions button.jse-action.svelte-p1zf9f{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-message-action-background, rgba(255, 255, 255, 0.2));color:inherit;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px)}.jse-message.svelte-p1zf9f .jse-actions button.jse-action.svelte-p1zf9f:hover{background:var(--jse-message-action-background-highlight, rgba(255, 255, 255, 0.3))}')}function Nw(n,e,t){var r=n.slice();return r[9]=e[t],r}function Iw(n){var e,t;return e=new un({props:{data:n[1]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};2&i&&(o.data=r[1]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Dw(n){var e,t;return e=new un({props:{data:n[9].icon}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};8&i&&(o.data=r[9].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Lw(n){var e,t,r,i,o,s,a,l,c,u=n[9].text+"",f=n[9].icon&&Dw(n);function d(){return n[7](n[9])}function h(){return n[8](n[9])}return{c:function(){e=V("button"),f&&f.c(),t=ce(),r=De(u),i=ce(),j(e,"type","button"),j(e,"class","jse-button jse-action jse-primary svelte-p1zf9f"),j(e,"title",o=n[9].title),e.disabled=s=n[9].disabled},m:function(p,m){ee(p,e,m),f&&f.m(e,null),E(e,t),E(e,r),E(e,i),a=!0,l||(c=[Ce(e,"click",d),Ce(e,"mousedown",h)],l=!0)},p:function(p,m){(n=p)[9].icon?f?(f.p(n,m),8&m&&C(f,1)):((f=Dw(n)).c(),C(f,1),f.m(e,t)):f&&(Ee(),M(f,1,1,function(){f=null}),Ae()),(!a||8&m)&&u!==(u=n[9].text+"")&>(r,u),(!a||8&m&&o!==(o=n[9].title))&&j(e,"title",o),(!a||8&m&&s!==(s=n[9].disabled))&&(e.disabled=s)},i:function(p){a||(C(f),a=!0)},o:function(p){M(f),a=!1},d:function(p){p&&Z(e),f&&f.d(),l=!1,kn(c)}}}function ZH(n){for(var e,t,r,i,o,s,a,l,c,u,f,d=n[1]&&Iw(n),h=Mt(n[3]),p=[],m=0;mol&&Vw(n);return{c:function(){e=V("table"),t=V("tbody");for(var u=0;uol?c?c.p(u,f):((c=Vw(u)).c(),c.m(t,null)):c&&(c.d(1),c=null)},i:function(u){if(!i){for(var f=0;f1&&Fw(n);function y(){return n[7](n[8])}return{c:function(){e=V("tr"),t=V("td"),je(r.$$.fragment),i=ce(),o=V("td"),s=De(v),a=ce(),l=V("td"),c=De(g),u=ce(),f=V("td"),b&&b.c(),j(t,"class","jse-validation-error-icon svelte-1gq3gfv"),j(o,"class","jse-validation-error-path svelte-1gq3gfv"),j(l,"class","jse-validation-error-message svelte-1gq3gfv"),j(f,"class","jse-validation-error-action svelte-1gq3gfv"),j(e,"class",d="jse-validation-"+n[8].severity+" svelte-1gq3gfv")},m:function(x,w){ee(x,e,w),E(e,t),be(r,t,null),E(e,i),E(e,o),E(o,s),E(e,a),E(e,l),E(l,c),E(e,u),E(e,f),b&&b.m(f,null),h=!0,p||(m=Ce(e,"click",y),p=!0)},p:function(x,w){n=x,(!h||1&w)&&v!==(v=mi(n[8].path)+"")&>(s,v),(!h||1&w)&&g!==(g=n[8].message+"")&>(c,g),n[10]===0&&n[0].length>1?b?(b.p(n,w),1&w&&C(b,1)):((b=Fw(n)).c(),C(b,1),b.m(f,null)):b&&(Ee(),M(b,1,1,function(){b=null}),Ae()),(!h||1&w&&d!==(d="jse-validation-"+n[8].severity+" svelte-1gq3gfv"))&&j(e,"class",d)},i:function(x){h||(C(r.$$.fragment,x),C(b),h=!0)},o:function(x){M(r.$$.fragment,x),M(b),h=!1},d:function(x){x&&Z(e),we(r),b&&b.d(),p=!1,m()}}}function Vw(n){var e,t,r,i,o,s,a,l,c,u,f,d=n[3]-ol+"";return{c:function(){e=V("tr"),t=V("td"),r=ce(),i=V("td"),o=ce(),s=V("td"),a=De("(and "),l=De(d),c=De(" more errors)"),u=ce(),f=V("td"),j(t,"class","svelte-1gq3gfv"),j(i,"class","svelte-1gq3gfv"),j(s,"class","svelte-1gq3gfv"),j(f,"class","svelte-1gq3gfv"),j(e,"class","jse-validation-error svelte-1gq3gfv")},m:function(h,p){ee(h,e,p),E(e,t),E(e,r),E(e,i),E(e,o),E(e,s),E(s,a),E(s,l),E(s,c),E(e,u),E(e,f)},p:function(h,p){8&p&&d!==(d=h[3]-ol+"")&>(l,d)},d:function(h){h&&Z(e)}}}function iU(n){var e,t,r=!hn(n[0]),i=r&&zw(n);return{c:function(){i&&i.c(),e=an()},m:function(o,s){i&&i.m(o,s),ee(o,e,s),t=!0},p:function(o,s){var a=At(s,1)[0];1&a&&(r=!hn(o[0])),r?i?(i.p(o,a),1&a&&C(i,1)):((i=zw(o)).c(),C(i,1),i.m(e.parentNode,e)):i&&(Ee(),M(i,1,1,function(){i=null}),Ae())},i:function(o){t||(C(i),t=!0)},o:function(o){M(i),t=!1},d:function(o){o&&Z(e),i&&i.d(o)}}}function oU(n,e,t){var r,i=e.validationErrors,o=e.selectError,s=!0;return n.$$set=function(a){"validationErrors"in a&&t(0,i=a.validationErrors),"selectError"in a&&t(1,o=a.selectError)},n.$$.update=function(){1&n.$$.dirty&&t(3,r=i.length)},[i,o,s,r,function(){t(2,s=!1)},function(){t(2,s=!0)},function(a){return[oo.error,oo.warning,oo.info].find(function(l){return a.some(function(c){return c.severity===l})})},function(a){setTimeout(function(){return o(a)})}]}var G0=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,oU,iU,Tt,{validationErrors:0,selectError:1},tU),r}return ht(e,mt),ut(e)}(),sU=typeof navigator!="undefined"&&navigator.platform.toUpperCase().indexOf("MAC")>=0,el=[];function Hw(n){if(n.key==="Escape"){var e=en(el);e&&e()}}function Lu(n,e){return hn(el)&&window.addEventListener("keydown",Hw),el.push(e),{destroy:function(){el=el.filter(function(t){return t!==e}),hn(el)&&window.removeEventListener("keydown",Hw)}}}function aU(n){Et(n,"svelte-1nm0t3v",'.jse-modal.svelte-1nm0t3v.svelte-1nm0t3v{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-1nm0t3v .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-1nm0t3v .jse-modal-contents.svelte-1nm0t3v{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions.svelte-1nm0t3v{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions button.jse-primary.svelte-1nm0t3v{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions button.jse-primary.svelte-1nm0t3v:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions button.jse-primary.svelte-1nm0t3v:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0;overflow:auto}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;max-height:500px;display:flex}.bg.jse-modal-bg .jse-modal-window:has(div.fullscreen){margin:var(--jse-padding, 10px);padding:0;width:calc(100vw - 2 * var(--jse-padding, 10px));height:calc(100vh - 2 * var(--jse-padding, 10px));max-width:none;max-height:none}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0;max-height:none}.jse-modal.jse-copy-paste.svelte-1nm0t3v .jse-shortcuts.svelte-1nm0t3v{display:flex;flex-wrap:wrap;justify-content:space-around;margin:calc(2 * var(--jse-padding, 10px)) 0}.jse-modal.jse-copy-paste.svelte-1nm0t3v .jse-shortcuts .jse-shortcut .jse-key.svelte-1nm0t3v{font-size:200%;color:var(--jse-theme-color, #3883fa)}')}function lU(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_;return t=new tp({props:{title:"Copying and pasting"}}),{c:function(){e=V("div"),je(t.$$.fragment),r=ce(),i=V("div"),(o=V("div")).textContent="These actions are unavailable via the menu. Please use:",s=ce(),a=V("div"),l=V("div"),(c=V("div")).textContent="".concat(n[1],"+C"),u=De(` + 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z`),x(e,"width","100%"),x(e,"height","100%"),x(e,"viewBox","0 0 20 20"),x(e,"focusable","false"),x(e,"aria-hidden","true"),x(e,"class","svelte-qbd276")},m:function(r,i){ee(r,e,i),E(e,t)},p:Te,i:Te,o:Te,d:function(r){r&&Z(e)}}}var nH=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,null,tH,yr,{},eH),r}return ht(e,mt),ut(e)}();function rH(n){Et(n,"svelte-whdbu1","svg.svelte-whdbu1{width:var(--clear-icon-width, 20px);height:var(--clear-icon-width, 20px);color:var(--clear-icon-color, currentColor)}")}function iH(n){var e,t;return{c:function(){e=Io("svg"),x(t=Io("path"),"fill","currentColor"),x(t,"d",`M34.923,37.251L24,26.328L13.077,37.251L9.436,33.61l10.923-10.923L9.436,11.765l3.641-3.641L24,19.047L34.923,8.124 + l3.641,3.641L27.641,22.688L38.564,33.61L34.923,37.251z`),x(e,"width","100%"),x(e,"height","100%"),x(e,"viewBox","-2 -2 50 50"),x(e,"focusable","false"),x(e,"aria-hidden","true"),x(e,"role","presentation"),x(e,"class","svelte-whdbu1")},m:function(r,i){ee(r,e,i),E(e,t)},p:Te,i:Te,o:Te,d:function(r){r&&Z(e)}}}var ih=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,null,iH,yr,{},rH),r}return ht(e,mt),ut(e)}();function oH(n){Et(n,"svelte-1p3nqvd",".loading.svelte-1p3nqvd{width:var(--spinner-width, 20px);height:var(--spinner-height, 20px);color:var(--spinner-color, var(--icons-color));animation:svelte-1p3nqvd-rotate 0.75s linear infinite;transform-origin:center center;transform:none}.circle_path.svelte-1p3nqvd{stroke-dasharray:90;stroke-linecap:round}@keyframes svelte-1p3nqvd-rotate{100%{transform:rotate(360deg)}}")}function sH(n){var e,t;return{c:function(){e=Io("svg"),x(t=Io("circle"),"class","circle_path svelte-1p3nqvd"),x(t,"cx","50"),x(t,"cy","50"),x(t,"r","20"),x(t,"fill","none"),x(t,"stroke","currentColor"),x(t,"stroke-width","5"),x(t,"stroke-miterlimit","10"),x(e,"class","loading svelte-1p3nqvd"),x(e,"viewBox","25 25 50 50")},m:function(r,i){ee(r,e,i),E(e,t)},p:Te,i:Te,o:Te,d:function(r){r&&Z(e)}}}var aH=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,null,sH,yr,{},oH),r}return ht(e,mt),ut(e)}();function lH(n){Et(n,"svelte-82qwg8",".svelte-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{--borderRadius:var(--border-radius);--clearSelectColor:var(--clear-select-color);--clearSelectWidth:var(--clear-select-width);--disabledBackground:var(--disabled-background);--disabledBorderColor:var(--disabled-border-color);--disabledColor:var(--disabled-color);--disabledPlaceholderColor:var(--disabled-placeholder-color);--disabledPlaceholderOpacity:var(--disabled-placeholder-opacity);--errorBackground:var(--error-background);--errorBorder:var(--error-border);--groupItemPaddingLeft:var(--group-item-padding-left);--groupTitleColor:var(--group-title-color);--groupTitleFontSize:var(--group-title-font-size);--groupTitleFontWeight:var(--group-title-font-weight);--groupTitlePadding:var(--group-title-padding);--groupTitleTextTransform:var(--group-title-text-transform);--groupTitleBorderColor:var(--group-title-border-color);--groupTitleBorderWidth:var(--group-title-border-width);--groupTitleBorderStyle:var(--group-title-border-style);--indicatorColor:var(--chevron-color);--indicatorHeight:var(--chevron-height);--indicatorWidth:var(--chevron-width);--inputColor:var(--input-color);--inputLeft:var(--input-left);--inputLetterSpacing:var(--input-letter-spacing);--inputMargin:var(--input-margin);--inputPadding:var(--input-padding);--itemActiveBackground:var(--item-active-background);--itemColor:var(--item-color);--itemFirstBorderRadius:var(--item-first-border-radius);--itemHoverBG:var(--item-hover-bg);--itemHoverColor:var(--item-hover-color);--itemIsActiveBG:var(--item-is-active-bg);--itemIsActiveColor:var(--item-is-active-color);--itemIsNotSelectableColor:var(--item-is-not-selectable-color);--itemPadding:var(--item-padding);--listBackground:var(--list-background);--listBorder:var(--list-border);--listBorderRadius:var(--list-border-radius);--listEmptyColor:var(--list-empty-color);--listEmptyPadding:var(--list-empty-padding);--listEmptyTextAlign:var(--list-empty-text-align);--listMaxHeight:var(--list-max-height);--listPosition:var(--list-position);--listShadow:var(--list-shadow);--listZIndex:var(--list-z-index);--multiItemBG:var(--multi-item-bg);--multiItemBorderRadius:var(--multi-item-border-radius);--multiItemDisabledHoverBg:var(--multi-item-disabled-hover-bg);--multiItemDisabledHoverColor:var(--multi-item-disabled-hover-color);--multiItemHeight:var(--multi-item-height);--multiItemMargin:var(--multi-item-margin);--multiItemPadding:var(--multi-item-padding);--multiSelectInputMargin:var(--multi-select-input-margin);--multiSelectInputPadding:var(--multi-select-input-padding);--multiSelectPadding:var(--multi-select-padding);--placeholderColor:var(--placeholder-color);--placeholderOpacity:var(--placeholder-opacity);--selectedItemPadding:var(--selected-item-padding);--spinnerColor:var(--spinner-color);--spinnerHeight:var(--spinner-height);--spinnerWidth:var(--spinner-width);--internal-padding:0 0 0 16px;border:var(--border, 1px solid #d8dbdf);border-radius:var(--border-radius, 6px);min-height:var(--height, 42px);position:relative;display:flex;align-items:stretch;padding:var(--padding, var(--internal-padding));background:var(--background, #fff);margin:var(--margin, 0);width:var(--width, 100%);font-size:var(--font-size, 16px);max-height:var(--max-height)}.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{box-sizing:var(--box-sizing, border-box)}.svelte-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:hover{border:var(--border-hover, 1px solid #b2b8bf)}.value-container.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;flex:1 1 0%;flex-wrap:wrap;align-items:center;gap:5px 10px;padding:var(--value-container-padding, 5px 0);position:relative;overflow:var(--value-container-overflow, hidden);align-self:stretch}.prepend.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.indicators.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;flex-shrink:0;align-items:center}.indicators.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:var(--indicators-position);top:var(--indicators-top);right:var(--indicators-right);bottom:var(--indicators-bottom)}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:absolute;cursor:default;border:none;color:var(--input-color, var(--item-color));padding:var(--input-padding, 0);letter-spacing:var(--input-letter-spacing, inherit);margin:var(--input-margin, 0);min-width:10px;top:0;right:0;bottom:0;left:0;background:transparent;font-size:var(--font-size, 16px)}.svelte-82qwg8:not(.multi)>.value-container.svelte-82qwg8>input.svelte-82qwg8{width:100%;height:100%}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8::placeholder{color:var(--placeholder-color, #78848f);opacity:var(--placeholder-opacity, 1)}input.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:none}.svelte-select.focused.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border:var(--border-focused, 1px solid #006fe8);border-radius:var(--border-radius-focused, var(--border-radius, 6px))}.disabled.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--disabled-background, #ebedef);border-color:var(--disabled-border-color, #ebedef);color:var(--disabled-color, #c1c6cc)}.disabled.svelte-82qwg8 input.svelte-82qwg8.svelte-82qwg8::placeholder{color:var(--disabled-placeholder-color, #c1c6cc);opacity:var(--disabled-placeholder-opacity, 1)}.selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{position:relative;overflow:var(--selected-item-overflow, hidden);padding:var(--selected-item-padding, 0 20px 0 0);text-overflow:ellipsis;white-space:nowrap;color:var(--selected-item-color, inherit);font-size:var(--font-size, 16px)}.multi.svelte-82qwg8 .selected-item.svelte-82qwg8.svelte-82qwg8{position:absolute;line-height:var(--height, 42px);height:var(--height, 42px)}.selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:none}.hide-selected-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0}.icon.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;align-items:center;justify-content:center}.clear-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{all:unset;display:flex;align-items:center;justify-content:center;width:var(--clear-select-width, 40px);height:var(--clear-select-height, 100%);color:var(--clear-select-color, var(--icons-color));margin:var(--clear-select-margin, 0);pointer-events:all;flex-shrink:0}.clear-select.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:focus{outline:var(--clear-select-focus-outline, 1px solid #006fe8)}.loading.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{width:var(--loading-width, 40px);height:var(--loading-height);color:var(--loading-color, var(--icons-color));margin:var(--loading--margin, 0);flex-shrink:0}.chevron.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{width:var(--chevron-width, 40px);height:var(--chevron-height, 40px);background:var(--chevron-background, transparent);pointer-events:var(--chevron-pointer-events, none);color:var(--chevron-color, var(--icons-color));border:var(--chevron-border, 0 0 0 1px solid #d8dbdf);flex-shrink:0}.multi.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{padding:var(--multi-select-padding, var(--internal-padding))}.multi.svelte-82qwg8 input.svelte-82qwg8.svelte-82qwg8{padding:var(--multi-select-input-padding, 0);position:relative;margin:var(--multi-select-input-margin, 5px 0);flex:1 1 40px}.svelte-select.error.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border:var(--error-border, 1px solid #ff2d55);background:var(--error-background, #fff)}.a11y-text.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{z-index:9999;border:0px;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0px;white-space:nowrap}.multi-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--multi-item-bg, #ebedef);margin:var(--multi-item-margin, 0);outline:var(--multi-item-outline, 1px solid #ddd);border-radius:var(--multi-item-border-radius, 4px);height:var(--multi-item-height, 25px);line-height:var(--multi-item-height, 25px);display:flex;cursor:default;padding:var(--multi-item-padding, 0 5px);overflow:hidden;gap:var(--multi-item-gap, 4px);outline-offset:-1px;max-width:var(--multi-max-width, none);color:var(--multi-item-color, var(--item-color))}.multi-item.disabled.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:hover{background:var(--multi-item-disabled-hover-bg, #ebedef);color:var(--multi-item-disabled-hover-color, #c1c6cc)}.multi-item-text.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.multi-item-clear.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{display:flex;align-items:center;justify-content:center;--clear-icon-color:var(--multi-item-clear-icon-color, #000)}.multi-item.active.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{outline:var(--multi-item-active-outline, 1px solid #006fe8)}.svelte-select-list.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{box-shadow:var(--list-shadow, 0 2px 3px 0 rgba(44, 62, 80, 0.24));border-radius:var(--list-border-radius, 4px);max-height:var(--list-max-height, 252px);overflow-y:auto;background:var(--list-background, #fff);position:var(--list-position, absolute);z-index:var(--list-z-index, 2);border:var(--list-border)}.prefloat.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0;pointer-events:none}.list-group-title.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{color:var(--group-title-color, #8f8f8f);cursor:default;font-size:var(--group-title-font-size, 16px);font-weight:var(--group-title-font-weight, 600);height:var(--height, 42px);line-height:var(--height, 42px);padding:var(--group-title-padding, 0 20px);text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;text-transform:var(--group-title-text-transform, uppercase);border-width:var(--group-title-border-width, medium);border-style:var(--group-title-border-style, none);border-color:var(--group-title-border-color, color)}.empty.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{text-align:var(--list-empty-text-align, center);padding:var(--list-empty-padding, 20px 0);color:var(--list-empty-color, #78848f)}.item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{cursor:default;height:var(--item-height, var(--height, 42px));line-height:var(--item-line-height, var(--height, 42px));padding:var(--item-padding, 0 20px);color:var(--item-color, inherit);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;transition:var(--item-transition, all 0.2s);align-items:center;width:100%}.item.group-item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{padding-left:var(--group-item-padding-left, 40px)}.item.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:active{background:var(--item-active-background, #b9daff)}.item.active.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{background:var(--item-is-active-bg, #007aff);color:var(--item-is-active-color, #fff)}.item.first.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{border-radius:var(--item-first-border-radius, 4px 4px 0 0)}.item.hover.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:not(.active){background:var(--item-hover-bg, #e7f2ff);color:var(--item-hover-color, inherit)}.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.hover.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.active.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8,.item.not-selectable.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8:active{color:var(--item-is-not-selectable-color, #999);background:transparent}.required.svelte-82qwg8.svelte-82qwg8.svelte-82qwg8{opacity:0;z-index:-1;position:absolute;top:0;left:0;bottom:0;right:0}")}var cH=function(n){return{value:8&n[0]}},rw=function(n){return{value:n[3]}},uH=function(n){return{value:8&n[0]}},iw=function(n){return{value:n[3]}},fH=function(n){return{listOpen:64&n[0]}},ow=function(n){return{listOpen:n[6]}},dH=function(n){return{}},sw=function(n){return{}},hH=function(n){return{}},aw=function(n){return{}},pH=function(n){return{selection:8&n[0]}},lw=function(n){return{selection:n[3]}};function cw(n,e,t){var r=n.slice();return r[126]=e[t],r[128]=t,r}var mH=function(n){return{}},uw=function(n){return{}},gH=function(n){return{selection:8&n[0]}},fw=function(n){return{selection:n[126],index:n[128]}},vH=function(n){return{}},dw=function(n){return{}},yH=function(n){return{}},hw=function(n){return{}},bH=function(n){return{}},pw=function(n){return{}};function mw(n,e,t){var r=n.slice();return r[126]=e[t],r[128]=t,r}var wH=function(n){return{item:16777216&n[0]}},gw=function(n){return{item:n[126],index:n[128]}},jH=function(n){return{filteredItems:16777216&n[0]}},vw=function(n){return{filteredItems:n[24]}},xH=function(n){return{}},yw=function(n){return{}};function bw(n){var e,t,r,i,o,s,a,l,c=n[50]["list-prepend"]&&ww(n),u=[SH,kH,$H],f=[];function d(p,m){return p[50].list?0:p[24].length>0?1:p[19]?-1:2}~(r=d(n))&&(i=f[r]=u[r](n));var h=n[50]["list-append"]&&xw(n);return{c:function(){e=V("div"),c&&c.c(),t=ce(),i&&i.c(),o=ce(),h&&h.c(),x(e,"class","svelte-select-list svelte-82qwg8"),x(e,"role","none"),$e(e,"prefloat",n[28])},m:function(p,m){ee(p,e,m),c&&c.m(e,null),E(e,t),~r&&f[r].m(e,null),E(e,o),h&&h.m(e,null),n[91](e),s=!0,a||(l=[mr(n[49].call(null,e)),Ce(e,"scroll",n[41]),Ce(e,"pointerup",uo(Oa(n[85]))),Ce(e,"mousedown",uo(Oa(n[86])))],a=!0)},p:function(p,m){p[50]["list-prepend"]?c?(c.p(p,m),524288&m[1]&&C(c,1)):((c=ww(p)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae());var v=r;(r=d(p))===v?~r&&f[r].p(p,m):(i&&(Ee(),M(f[v],1,1,function(){f[v]=null}),Ae()),~r?((i=f[r])?i.p(p,m):(i=f[r]=u[r](p)).c(),C(i,1),i.m(e,o)):i=null),p[50]["list-append"]?h?(h.p(p,m),524288&m[1]&&C(h,1)):((h=xw(p)).c(),C(h,1),h.m(e,null)):h&&(Ee(),M(h,1,1,function(){h=null}),Ae()),(!s||268435456&m[0])&&$e(e,"prefloat",p[28])},i:function(p){s||(C(c),C(i),C(h),s=!0)},o:function(p){M(c),M(i),M(h),s=!1},d:function(p){p&&Z(e),c&&c.d(),~r&&f[r].d(),h&&h.d(),n[91](null),a=!1,kn(l)}}}function ww(n){var e,t=n[83]["list-prepend"],r=Qn(t,n,n[82],yw);return{c:function(){r&&r.c()},m:function(i,o){r&&r.m(i,o),e=!0},p:function(i,o){r&&r.p&&(!e||1048576&o[2])&&Xn(r,t,i,i[82],e?Yn(t,i[82],o,xH):Zn(i[82]),yw)},i:function(i){e||(C(r,i),e=!0)},o:function(i){M(r,i),e=!1},d:function(i){r&&r.d(i)}}}function $H(n){var e,t,r=n[83].empty,i=Qn(r,n,n[82],pw),o=i||{c:function(){(t=V("div")).textContent="No options",x(t,"class","empty svelte-82qwg8")},m:function(s,a){ee(s,t,a)},p:Te,d:function(s){s&&Z(t)}};return{c:function(){o&&o.c()},m:function(s,a){o&&o.m(s,a),e=!0},p:function(s,a){i&&i.p&&(!e||1048576&a[2])&&Xn(i,r,s,s[82],e?Yn(r,s[82],a,bH):Zn(s[82]),pw)},i:function(s){e||(C(o,s),e=!0)},o:function(s){M(o,s),e=!1},d:function(s){o&&o.d(s)}}}function kH(n){for(var e,t,r=Mt(n[24]),i=[],o=0;o1&&arguments[1]!==void 0?arguments[1]:1;clearTimeout(d),d=setTimeout(re,Je)}:ye,vt=e.debounceWait,Nt=vt===void 0?300:vt,bn=e.hideEmptyState,En=bn!==void 0&&bn,Bt=e.inputAttributes,ln=Bt===void 0?{}:Bt,Jt=e.listAutoWidth,Ot=Jt===void 0||Jt,Sn=e.showChevron,An=Sn!==void 0&&Sn,jn=e.listOffset,Ar=jn===void 0?5:jn,Q=e.hoverItemIndex,ve=Q===void 0?0:Q,Ie=e.floatingConfig,ze=Ie===void 0?{}:Ie,Fe=e.class,kt=Fe===void 0?"":Fe;function zt(re){var Je=[],jt={};re.forEach(function(Rt){var Gt=nn(Rt);Je.includes(Gt)||(Je.push(Gt),jt[Gt]=[],Gt&&jt[Gt].push(Object.assign(St(Gt,Rt),{id:Gt,groupHeader:!0,selectable:ge}))),jt[Gt].push(Object.assign({groupItem:!!Gt},Rt))});var yn=[];return ne(Je).forEach(function(Rt){jt[Rt]&&yn.push.apply(yn,Vt(jt[Rt]))}),yn}function Kt(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Je=arguments.length>1?arguments[1]:void 0;t(7,ve=re<0?0:re),!Je&&nn&&c[ve]&&!c[ve].selectable&&br(1)}function z(){var re=!0;if(ae){var Je=[],jt=[];ae.forEach(function(yn){Je.includes(yn[Re])?re=!1:(Je.push(yn[Re]),jt.push(yn))}),re||t(3,ae=jt)}return re}function le(re){var Je=re?re[Re]:ae[Re];return qe.find(function(jt){return jt[Re]===Je})}function je(re){return Me.apply(this,arguments)}function Me(){return(Me=$t(Pe().mark(function re(Je){var jt;return Pe().wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:jt=ae[Je],ae.length===1?t(3,ae=void 0):t(3,ae=ae.filter(function(Rt){return Rt!==jt})),S("clear",jt);case 3:case"end":return yn.stop()}},re)}))).apply(this,arguments)}function Ne(re){var Je,jt;Se&&A===((Je=document)===null||Je===void 0?void 0:Je.activeElement)||(re&&S("focus",re),(jt=A)===null||jt===void 0||jt.focus(),t(2,Se=!0))}function Le(re){return bt.apply(this,arguments)}function bt(){return(bt=$t(Pe().mark(function re(Je){var jt;return Pe().wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:if(!ir){yn.next=2;break}return yn.abrupt("return");case 2:(ue||Se)&&(S("blur",Je),nt(),t(2,Se=!1),t(26,h=void 0),(jt=A)===null||jt===void 0||jt.blur());case 3:case"end":return yn.stop()}},re)}))).apply(this,arguments)}function nt(){me&&t(4,et=""),t(6,ue=!1)}b=$t(Pe().mark(function re(){return Pe().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:t(78,p=ae),t(79,m=et),t(80,v=R);case 3:case"end":return Je.stop()}},re)})),Kl().$$.before_update.push(b),Hi(function(){ue&&t(2,Se=!0),Se&&A&&A.focus()});var yt=e.ariaValues,tr=yt===void 0?function(re){return"Option ".concat(re,", selected.")}:yt,Tn=e.ariaListOpen,nr=Tn===void 0?function(re,Je){return"You are currently focused on option ".concat(re,". There are ").concat(Je," results available.")}:Tn,qr=e.ariaFocused,Ft=qr===void 0?function(){return"Select is focused, type to refine list, press down to open the menu."}:qr,xn,cr=null;function dn(){clearTimeout(xn),xn=setTimeout(function(){ir=!1},100)}Mi(function(){var re;(re=cr)===null||re===void 0||re.remove()});var ir=!1;function Ki(re){re&&re.selectable!==!1&&function(Je){if(Je){t(4,et="");var jt=Object.assign({},Je);if(jt.groupHeader&&!jt.selectable)return;t(3,ae=R?ae?ae.concat([jt]):[jt]:t(3,ae=jt)),setTimeout(function(){er&&nt(),t(26,h=void 0),S("change",ae),S("select",Je)})}}(re)}function gi(re){ir||t(7,ve=re)}function Fa(re){var Je=re.item,jt=re.i;if((Je==null?void 0:Je.selectable)!==!1)return ae&&!R&&ae[Re]===Je[Re]?nt():void(function(yn){return yn.groupHeader&&yn.selectable||yn.selectable||!yn.hasOwnProperty("selectable")}(Je)&&(t(7,ve=jt),Ki(Je)))}function br(re){if(c.filter(function(jt){return!Object.hasOwn(jt,"selectable")||jt.selectable===!0}).length===0)return t(7,ve=0);re>0&&ve===c.length-1?t(7,ve=0):t(7,re<0&&ve===0?ve=c.length-1:ve+=re);var Je=c[ve];Je&&Je.selectable===!1&&(re!==1&&re!==-1||br(re))}var vi=ps,mo=ps;function ps(re){return{update:function(Je){Je.scroll&&(dn(),re.scrollIntoView({behavior:"auto",block:"nearest"}))}}}var ei,Gi={strategy:"absolute",placement:"bottom-start",middleware:[(ei=Ar,ei===void 0&&(ei=0),{name:"offset",options:ei,fn:function(re){return $t(Pe().mark(function Je(){var jt,yn,Rt,Gt,In,Ys,gr;return Pe().wrap(function(ur){for(;;)switch(ur.prev=ur.next){case 0:return Rt=re.x,Gt=re.y,In=re.placement,Ys=re.middlewareData,ur.next=3,VV(re,ei);case 3:if(gr=ur.sent,In!==((jt=Ys.offset)==null?void 0:jt.placement)||(yn=Ys.arrow)==null||!yn.alignmentOffset){ur.next=6;break}return ur.abrupt("return",{});case 6:return ur.abrupt("return",{x:Rt+gr.x,y:Gt+gr.y,data:fe(fe({},gr),{},{placement:In})});case 7:case"end":return ur.stop()}},Je)}))()}}),QV(),GV()],autoUpdate:!1},Zl=function(re){var Je,jt,yn={autoUpdate:!0},Rt=re,Gt=function(gr){return fe(fe(fe({},yn),re||{}),gr||{})},In=function(gr){Je&&jt&&(Rt=Gt(gr),YV(Je,jt,Rt).then(function(ur){var yi;Object.assign(jt.style,{position:ur.strategy,left:"".concat(ur.x,"px"),top:"".concat(ur.y,"px")}),!((yi=Rt)===null||yi===void 0)&&yi.onComputed&&Rt.onComputed(ur)}))},Ys=function(gr){Mi(gr.subscribe(function(ur){Je===void 0?(Je=ur,In()):(Object.assign(Je,ur),In())}))};return[function(gr){if("subscribe"in gr)return Ys(gr),{};Je=gr,In()},function(gr,ur){var yi;jt=gr,Rt=Gt(ur),setTimeout(function(){return In(ur)},0),In(ur);var qa=function(){yi&&(yi(),yi=void 0)},zu=function(){var ms=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rt||{}).autoUpdate;qa(),ms!==!1&&fr().then(function(){return KV(Je,jt,function(){return In(Rt)},ms===!0?{}:ms)})};return yi=zu(),{update:function(ms){In(ms),yi=zu(ms)},destroy:function(){qa()}}},In]}(Gi),Qs=At(Zl,3),ec=Qs[0],ip=Qs[1],op=Qs[2],tc=!0;return n.$$set=function(re){"justValue"in re&&t(52,F=re.justValue),"filter"in re&&t(53,W=re.filter),"getItems"in re&&t(54,U=re.getItems),"id"in re&&t(55,X=re.id),"name"in re&&t(8,Y=re.name),"container"in re&&t(0,B=re.container),"input"in re&&t(1,A=re.input),"multiple"in re&&t(9,R=re.multiple),"multiFullItemClearable"in re&&t(10,P=re.multiFullItemClearable),"disabled"in re&&t(11,J=re.disabled),"focused"in re&&t(2,Se=re.focused),"value"in re&&t(3,ae=re.value),"filterText"in re&&t(4,et=re.filterText),"placeholder"in re&&t(56,Qt=re.placeholder),"placeholderAlwaysShow"in re&&t(57,st=re.placeholderAlwaysShow),"items"in re&&t(51,qe=re.items),"label"in re&&t(12,He=re.label),"itemFilter"in re&&t(58,Oe=re.itemFilter),"groupBy"in re&&t(59,nn=re.groupBy),"groupFilter"in re&&t(60,ne=re.groupFilter),"groupHeaderSelectable"in re&&t(61,ge=re.groupHeaderSelectable),"itemId"in re&&t(13,Re=re.itemId),"loadOptions"in re&&t(62,rt=re.loadOptions),"containerStyles"in re&&t(14,Zt=re.containerStyles),"hasError"in re&&t(15,Ge=re.hasError),"filterSelectedItems"in re&&t(63,zn=re.filterSelectedItems),"required"in re&&t(16,Mn=re.required),"closeListOnChange"in re&&t(64,er=re.closeListOnChange),"clearFilterTextOnBlur"in re&&t(65,me=re.clearFilterTextOnBlur),"createGroupHeaderItem"in re&&t(66,St=re.createGroupHeaderItem),"searchable"in re&&t(17,_t=re.searchable),"inputStyles"in re&&t(18,de=re.inputStyles),"clearable"in re&&t(68,We=re.clearable),"loading"in re&&t(5,G=re.loading),"listOpen"in re&&t(6,ue=re.listOpen),"debounce"in re&&t(69,it=re.debounce),"debounceWait"in re&&t(70,Nt=re.debounceWait),"hideEmptyState"in re&&t(19,En=re.hideEmptyState),"inputAttributes"in re&&t(71,ln=re.inputAttributes),"listAutoWidth"in re&&t(72,Ot=re.listAutoWidth),"showChevron"in re&&t(20,An=re.showChevron),"listOffset"in re&&t(73,Ar=re.listOffset),"hoverItemIndex"in re&&t(7,ve=re.hoverItemIndex),"floatingConfig"in re&&t(74,ze=re.floatingConfig),"class"in re&&t(21,kt=re.class),"ariaValues"in re&&t(75,tr=re.ariaValues),"ariaListOpen"in re&&t(76,nr=re.ariaListOpen),"ariaFocused"in re&&t(77,Ft=re.ariaFocused),"$$scope"in re&&t(82,w=re.$$scope)},n.$$.update=function(){var re,Je,jt,yn;8&n.$$.dirty[0]|1048576&n.$$.dirty[1]&&ae&&function(){if(typeof ae=="string"){var Rt=(qe||[]).find(function(Gt){return Gt[Re]===ae});t(3,ae=Rt||Oi(Oi({},Re,ae),"label",ae))}else R&&Array.isArray(ae)&&ae.length>0&&t(3,ae=ae.map(function(Gt){return typeof Gt=="string"?{value:Gt,label:Gt}:Gt}))}(),131072&n.$$.dirty[0]|512&n.$$.dirty[2]&&(!ln&&_t||(t(27,g=Object.assign({autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:!1,tabindex:0,type:"text","aria-autocomplete":"list"},ln)),X&&t(27,g.id=X,g),_t||t(27,g.readonly=!0,g))),512&n.$$.dirty[0]&&R&&ae&&(Array.isArray(ae)?t(3,ae=Vt(ae)):t(3,ae=[ae])),512&n.$$.dirty[0]|262144&n.$$.dirty[2]&&v&&!R&&ae&&t(3,ae=null),520&n.$$.dirty[0]&&R&&ae&&ae.length>1&&z(),8&n.$$.dirty[0]&&ae&&(R?JSON.stringify(ae)!==JSON.stringify(p)&&z()&&S("input",ae):p&&JSON.stringify(ae[Re])===JSON.stringify(p[Re])||S("input",ae)),520&n.$$.dirty[0]|65536&n.$$.dirty[2]&&!ae&&R&&p&&S("input",ae),6&n.$$.dirty[0]&&!Se&&A&&nt(),16&n.$$.dirty[0]|131072&n.$$.dirty[2]&&et!==m&&(rt||et.length!==0)&&(rt?it($t(Pe().mark(function Rt(){var Gt;return Pe().wrap(function(In){for(;;)switch(In.prev=In.next){case 0:return t(5,G=!0),In.next=3,U({dispatch:S,loadOptions:rt,convertStringItemsToObjects:Tw,filterText:et});case 3:(Gt=In.sent)?(t(5,G=Gt.loading),t(6,ue=ue?Gt.listOpen:et.length>0),t(2,Se=ue&&Gt.focused),t(51,qe=nn?zt(Gt.filteredItems):Gt.filteredItems)):(t(5,G=!1),t(2,Se=!0),t(6,ue=!0));case 5:case"end":return In.stop()}},Rt)})),Nt):(t(6,ue=!0),R&&t(26,h=void 0))),12824&n.$$.dirty[0]|407896064&n.$$.dirty[1]|3&n.$$.dirty[2]&&t(24,c=W({loadOptions:rt,filterText:et,items:qe,multiple:R,value:ae,itemId:Re,groupBy:nn,label:He,filterSelectedItems:zn,itemFilter:Oe,convertStringItemsToObjects:Tw,filterGroupedItems:zt})),16777800&n.$$.dirty[0]&&!R&&ue&&ae&&c&&Kt(c.findIndex(function(Rt){return Rt[Re]===ae[Re]}),!0),576&n.$$.dirty[0]&&ue&&R&&t(7,ve=0),16&n.$$.dirty[0]&&et&&t(7,ve=0),128&n.$$.dirty[0]&&S("hoverItem",ve),520&n.$$.dirty[0]&&t(25,r=R?ae&&ae.length>0:ae),33554448&n.$$.dirty[0]&&t(35,i=r&&et.length>0),33556512&n.$$.dirty[0]|64&n.$$.dirty[2]&&t(34,o=r&&We&&!J&&!G),520&n.$$.dirty[0]|100663296&n.$$.dirty[1]&&t(33,s=st&&R||R&&((re=ae)===null||re===void 0?void 0:re.length)===0?Qt:ae?"":Qt),520&n.$$.dirty[0]&&t(32,a=ae?(Je=void 0,Je=R&&ae.length>0?ae.map(function(Rt){return Rt[He]}).join(", "):ae[He],tr(Je)):""),16777412&n.$$.dirty[0]&&t(31,l=function(){if(!c||c.length===0)return"";var Rt=c[ve];if(ue&&Rt){var Gt=c?c.length:0;return nr(Rt[He],Gt)}return Ft()}()),1048576&n.$$.dirty[1]&&function(Rt){Rt&&Rt.length!==0&&!Rt.some(function(Gt){return sr(Gt)!=="object"})&&ae&&(R?!ae.some(function(Gt){return!Gt||!Gt[Re]}):ae[Re])&&(Array.isArray(ae)?t(3,ae=ae.map(function(Gt){return le(Gt)||Gt})):t(3,ae=le()||ae))}(qe),8712&n.$$.dirty[0]&&t(52,F=R?ae?ae.map(function(Rt){return Rt[Re]}):null:ae&&ae[Re]),520&n.$$.dirty[0]|65536&n.$$.dirty[2]&&(R||!p||ae||S("input",ae)),16777800&n.$$.dirty[0]&&ue&&c&&!R&&!ae&&Kt(),16777216&n.$$.dirty[0]&&function(Rt){ue&&S("filter",Rt)}(c),1&n.$$.dirty[0]|4096&n.$$.dirty[2]&&B&&((jt=ze)===null||jt===void 0?void 0:jt.autoUpdate)===void 0&&t(81,Gi.autoUpdate=!0,Gi),1&n.$$.dirty[0]|528384&n.$$.dirty[2]&&B&&ze&&op(Object.assign(Gi,ze)),8388608&n.$$.dirty[0]&&t(30,u=!!cr),8388672&n.$$.dirty[0]&&function(Rt,Gt){if(!Rt||!Gt)return t(28,tc=!0);setTimeout(function(){t(28,tc=!1)},0)}(cr,ue),8388673&n.$$.dirty[0]&&ue&&B&&cr&&(yn=B.getBoundingClientRect().width,t(23,cr.style.width=Ot?yn+"px":"auto",cr)),128&n.$$.dirty[0]&&t(29,f=ve),70&n.$$.dirty[0]&&A&&ue&&!Se&&Ne()},[B,A,Se,ae,et,G,ue,ve,Y,R,P,J,He,Re,Zt,Ge,Mn,_t,de,En,An,kt,function(){S("clear",ae),t(3,ae=void 0),nt(),Ne()},cr,c,r,h,g,tc,f,u,l,a,s,o,i,je,function(re){if(Se)switch(re.stopPropagation(),re.key){case"Escape":re.preventDefault(),nt();break;case"Enter":if(re.preventDefault(),ue){if(c.length===0)break;var Je=c[ve];if(ae&&!R&&ae[Re]===Je[Re]){nt();break}Ki(c[ve])}break;case"ArrowDown":re.preventDefault(),ue?br(1):(t(6,ue=!0),t(26,h=void 0));break;case"ArrowUp":re.preventDefault(),ue?br(-1):(t(6,ue=!0),t(26,h=void 0));break;case"Tab":if(ue&&Se){if(c.length===0||ae&&ae[Re]===c[ve][Re])return nt();re.preventDefault(),Ki(c[ve]),nt()}break;case"Backspace":if(!R||et.length>0)return;if(R&&ae&&ae.length>0){if(je(h!==void 0?h:ae.length-1),h===0||h===void 0)break;t(26,h=ae.length>h?h-1:void 0)}break;case"ArrowLeft":if(!ae||!R||et.length>0)return;h===void 0?t(26,h=ae.length-1):ae.length>h&&h!==0&&t(26,h-=1);break;case"ArrowRight":if(!ae||!R||et.length>0||h===void 0)return;h===ae.length-1?t(26,h=void 0):h0?t(6,ue=!0):void t(6,ue=!ue)},dn,function(re){var Je;ue||Se||!B||B.contains(re.target)||(Je=cr)!==null&&Je!==void 0&&Je.contains(re.target)||Le()},gi,Fa,function(re,Je,jt){if(!R)return Je&&Je[jt]===re[jt]},vi,mo,ec,ip,$,qe,F,W,U,X,Qt,st,Oe,nn,ne,ge,rt,zn,er,me,St,function(){return c},We,it,Nt,ln,Ot,Ar,ze,tr,nr,Ft,p,m,v,Gi,w,j,function(re){Ef.call(this,n,re)},function(re){Ef.call(this,n,re)},function(re){Ef.call(this,n,re)},function(re){Ef.call(this,n,re)},function(re){return gi(re)},function(re){return gi(re)},function(re,Je){return Fa({item:re,i:Je})},function(re){It[re?"unshift":"push"](function(){t(23,cr=re)})},function(re){return je(re)},function(re){return P?je(re):{}},function(re){It[re?"unshift":"push"](function(){t(1,A=re)})},function(){et=this.value,t(4,et)},function(re){It[re?"unshift":"push"](function(){t(0,B=re)})}]}var la=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,EH,MH,yr,{justValue:52,filter:53,getItems:54,id:55,name:8,container:0,input:1,multiple:9,multiFullItemClearable:10,disabled:11,focused:2,value:3,filterText:4,placeholder:56,placeholderAlwaysShow:57,items:51,label:12,itemFilter:58,groupBy:59,groupFilter:60,groupHeaderSelectable:61,itemId:13,loadOptions:62,containerStyles:14,hasError:15,filterSelectedItems:63,required:16,closeListOnChange:64,clearFilterTextOnBlur:65,createGroupHeaderItem:66,getFilteredItems:67,searchable:17,inputStyles:18,clearable:68,loading:5,listOpen:6,debounce:69,debounceWait:70,hideEmptyState:19,inputAttributes:71,listAutoWidth:72,showChevron:20,listOffset:73,hoverItemIndex:7,floatingConfig:74,class:21,handleClear:22,ariaValues:75,ariaListOpen:76,ariaFocused:77},lH,[-1,-1,-1,-1,-1]),r}return ht(e,mt),ut(e,[{key:"getFilteredItems",get:function(){return this.$$.ctx[67]}},{key:"handleClear",get:function(){return this.$$.ctx[22]}}])}();function AH(n){Et(n,"svelte-ijtq0l","table.jse-transform-wizard.svelte-ijtq0l.svelte-ijtq0l{border-collapse:collapse;border-spacing:0;width:100%}table.jse-transform-wizard.svelte-ijtq0l input.svelte-ijtq0l{font-family:inherit;font-size:inherit}table.jse-transform-wizard.svelte-ijtq0l tr th.svelte-ijtq0l{font-weight:normal;text-align:left;width:60px}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l{width:100%;display:flex;flex-direction:row;margin-bottom:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select .multi-item{align-items:center}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select .value-container{gap:0 !important}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-filter-path{flex:4;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-filter-relation{flex:1.5;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-sort-path{flex:3;margin-right:calc(0.5 * var(--jse-padding, 10px))}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-sort-direction{flex:1}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select.jse-projection-paths{flex:1}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal.svelte-ijtq0l .svelte-select input{box-sizing:border-box}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal .jse-filter-value.svelte-ijtq0l{flex:4;padding:4px 8px;border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:var(--jse-input-radius, 3px);outline:none;background:var(--jse-input-background, var(--jse-background-color, #fff));color:inherit}table.jse-transform-wizard.svelte-ijtq0l tr td .jse-horizontal .jse-filter-value.svelte-ijtq0l:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}")}function TH(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D,U,q,X,K,Y,T,B;function O(pe){n[16](pe)}var A={class:"jse-filter-path",showChevron:!0,items:n[7]};function te(pe){n[17](pe)}n[0]!==void 0&&(A.value=n[0]),a=new la({props:A}),It.push(function(){return oi(a,"value",O)});var R={class:"jse-filter-relation",showChevron:!0,items:n[8]};function k(pe){n[19](pe)}n[1]!==void 0&&(R.value=n[1]),u=new la({props:R}),It.push(function(){return oi(u,"value",te)});var P={class:"jse-sort-path",showChevron:!0,items:n[7]};function H(pe){n[20](pe)}n[3]!==void 0&&(P.value=n[3]),j=new la({props:P}),It.push(function(){return oi(j,"value",k)});var J={class:"jse-sort-direction",showChevron:!0,items:n[9]};function he(pe){n[21](pe)}n[4]!==void 0&&(J.value=n[4]),S=new la({props:J}),It.push(function(){return oi(S,"value",H)});var Se={class:"jse-projection-paths",multiple:!0,showChevron:!0,items:n[6]};return n[5]!==void 0&&(Se.value=n[5]),X=new la({props:Se}),It.push(function(){return oi(X,"value",he)}),{c:function(){e=V("table"),t=V("tr"),(r=V("th")).textContent="Filter",i=ce(),o=V("td"),s=V("div"),xe(a.$$.fragment),c=ce(),xe(u.$$.fragment),d=ce(),h=V("input"),p=ce(),m=V("tr"),(v=V("th")).textContent="Sort",g=ce(),b=V("td"),y=V("div"),xe(j.$$.fragment),$=ce(),xe(S.$$.fragment),F=ce(),I=V("tr"),(W=V("th")).textContent="Pick",D=ce(),U=V("td"),q=V("div"),xe(X.$$.fragment),x(r,"class","svelte-ijtq0l"),x(h,"class","jse-filter-value svelte-ijtq0l"),x(s,"class","jse-horizontal svelte-ijtq0l"),x(v,"class","svelte-ijtq0l"),x(y,"class","jse-horizontal svelte-ijtq0l"),x(W,"class","svelte-ijtq0l"),x(q,"class","jse-horizontal svelte-ijtq0l"),x(e,"class","jse-transform-wizard svelte-ijtq0l")},m:function(pe,ae){ee(pe,e,ae),E(e,t),E(t,r),E(t,i),E(t,o),E(o,s),be(a,s,null),E(s,c),be(u,s,null),E(s,d),E(s,h),Do(h,n[2]),E(e,p),E(e,m),E(m,v),E(m,g),E(m,b),E(b,y),be(j,y,null),E(y,$),be(S,y,null),E(e,F),E(e,I),E(I,W),E(I,D),E(I,U),E(U,q),be(X,q,null),Y=!0,T||(B=Ce(h,"input",n[18]),T=!0)},p:function(pe,ae){var Qe=At(ae,1)[0],et={};128&Qe&&(et.items=pe[7]),!l&&1&Qe&&(l=!0,et.value=pe[0],ii(function(){return l=!1})),a.$set(et);var tn={};!f&&2&Qe&&(f=!0,tn.value=pe[1],ii(function(){return f=!1})),u.$set(tn),4&Qe&&h.value!==pe[2]&&Do(h,pe[2]);var Qt={};128&Qe&&(Qt.items=pe[7]),!w&&8&Qe&&(w=!0,Qt.value=pe[3],ii(function(){return w=!1})),j.$set(Qt);var oe={};!_&&16&Qe&&(_=!0,oe.value=pe[4],ii(function(){return _=!1})),S.$set(oe);var st={};64&Qe&&(st.items=pe[6]),!K&&32&Qe&&(K=!0,st.value=pe[5],ii(function(){return K=!1})),X.$set(st)},i:function(pe){Y||(C(a.$$.fragment,pe),C(u.$$.fragment,pe),C(j.$$.fragment,pe),C(S.$$.fragment,pe),C(X.$$.fragment,pe),Y=!0)},o:function(pe){M(a.$$.fragment,pe),M(u.$$.fragment,pe),M(j.$$.fragment,pe),M(S.$$.fragment,pe),M(X.$$.fragment,pe),Y=!1},d:function(pe){pe&&Z(e),we(a),we(u),we(j),we(S),we(X),T=!1,B()}}}function PH(n,e,t){var r,i,o,s,a,l,c,u,f,d,h,p=Sr("jsoneditor:TransformWizard"),m=e.json,v=e.queryOptions,g=v===void 0?{}:v,b=e.onChange,y=["==","!=","<","<=",">",">="].map(function(I){return{value:I,label:I}}),j=[{value:"asc",label:"ascending"},{value:"desc",label:"descending"}],w=(r=g)!==null&&r!==void 0&&(r=r.filter)!==null&&r!==void 0&&r.path?jc(g.filter.path):null,$=(i=g)!==null&&i!==void 0&&(i=i.filter)!==null&&i!==void 0&&i.relation?y.find(function(I){var W;return I.value===((W=g.filter)===null||W===void 0?void 0:W.relation)}):null,S=((o=g)===null||o===void 0||(o=o.filter)===null||o===void 0?void 0:o.value)||"",_=(s=g)!==null&&s!==void 0&&(s=s.sort)!==null&&s!==void 0&&s.path?jc(g.sort.path):null,F=(a=g)!==null&&a!==void 0&&(a=a.sort)!==null&&a!==void 0&&a.direction?j.find(function(I){var W;return I.value===((W=g.sort)===null||W===void 0?void 0:W.direction)}):null;return n.$$set=function(I){"json"in I&&t(11,m=I.json),"queryOptions"in I&&t(10,g=I.queryOptions),"onChange"in I&&t(12,b=I.onChange)},n.$$.update=function(){var I,W,D,U,q,X,K,Y,T,B,O,A,te;2048&n.$$.dirty&&t(15,l=Array.isArray(m)),34816&n.$$.dirty&&t(14,c=l?Ag(m):[]),34816&n.$$.dirty&&t(13,u=l?Ag(m,!0):[]),16384&n.$$.dirty&&t(7,f=c.map(jc)),8192&n.$$.dirty&&t(6,d=u?u.map(jc):[]),1088&n.$$.dirty&&t(5,h=(I=g)!==null&&I!==void 0&&(I=I.projection)!==null&&I!==void 0&&I.paths&&d?g.projection.paths.map(function(R){return d.find(function(k){return sn(k.value,R)})}).filter(function(R){return!!R}):null),1&n.$$.dirty&&(D=(W=w)===null||W===void 0?void 0:W.value,sn((U=g)===null||U===void 0||(U=U.filter)===null||U===void 0?void 0:U.path,D)||(p("changeFilterPath",D),t(10,g=Xi(g,["filter","path"],D,!0)),b(g))),2&n.$$.dirty&&(X=(q=$)===null||q===void 0?void 0:q.value,sn((K=g)===null||K===void 0||(K=K.filter)===null||K===void 0?void 0:K.relation,X)||(p("changeFilterRelation",X),t(10,g=Xi(g,["filter","relation"],X,!0)),b(g))),4&n.$$.dirty&&(Y=S,sn((T=g)===null||T===void 0||(T=T.filter)===null||T===void 0?void 0:T.value,Y)||(p("changeFilterValue",Y),t(10,g=Xi(g,["filter","value"],Y,!0)),b(g))),8&n.$$.dirty&&function(R){var k;sn((k=g)===null||k===void 0||(k=k.sort)===null||k===void 0?void 0:k.path,R)||(p("changeSortPath",R),t(10,g=Xi(g,["sort","path"],R,!0)),b(g))}((B=_)===null||B===void 0?void 0:B.value),16&n.$$.dirty&&(A=(O=F)===null||O===void 0?void 0:O.value,sn((te=g)===null||te===void 0||(te=te.sort)===null||te===void 0?void 0:te.direction,A)||(p("changeSortDirection",A),t(10,g=Xi(g,["sort","direction"],A,!0)),b(g))),32&n.$$.dirty&&function(R){var k;sn((k=g)===null||k===void 0||(k=k.projection)===null||k===void 0?void 0:k.paths,R)||(p("changeProjectionPaths",R),t(10,g=Xi(g,["projection","paths"],R,!0)),b(g))}(h?h.map(function(R){return R.value}):void 0)},[w,$,S,_,F,h,d,f,y,j,g,m,b,u,c,l,function(I){t(0,w=I)},function(I){t(1,$=I)},function(){S=this.value,t(2,S)},function(I){t(3,_=I)},function(I){t(4,F=I)},function(I){t(5,h=I),t(10,g),t(6,d),t(13,u),t(15,l),t(11,m)}]}var _H=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,PH,TH,Tt,{json:11,queryOptions:10,onChange:12},AH),r}return ht(e,mt),ut(e)}();function RH(n){Et(n,"svelte-1wg043c",'.jse-select-query-language.svelte-1wg043c.svelte-1wg043c{position:relative;width:32px}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container.svelte-1wg043c{position:absolute;top:0;right:0;display:flex;flex-direction:column;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container .jse-query-language.svelte-1wg043c{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;text-align:left;padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));white-space:nowrap;color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));background:var(--jse-context-menu-background, #656565)}.jse-select-query-language.svelte-1wg043c .jse-select-query-language-container .jse-query-language.svelte-1wg043c:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}')}function Pw(n,e,t){var r=n.slice();return r[5]=e[t],r}function NH(n){var e,t;return e=new un({props:{data:ym}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function IH(n){var e,t;return e=new un({props:{data:vm}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function _w(n){var e,t,r,i,o,s,a,l,c,u,f=n[5].name+"",d=[IH,NH],h=[];function p(v,g){return v[5].id===v[0]?0:1}function m(){return n[4](n[5])}return t=p(n),r=h[t]=d[t](n),{c:function(){e=V("button"),r.c(),i=ce(),o=De(f),s=ce(),x(e,"type","button"),x(e,"class","jse-query-language svelte-1wg043c"),x(e,"title",a="Select ".concat(n[5].name," as query language")),$e(e,"selected",n[5].id===n[0])},m:function(v,g){ee(v,e,g),h[t].m(e,null),E(e,i),E(e,o),E(e,s),l=!0,c||(u=Ce(e,"click",m),c=!0)},p:function(v,g){var b=t;(t=p(n=v))!==b&&(Ee(),M(h[b],1,1,function(){h[b]=null}),Ae(),(r=h[t])||(r=h[t]=d[t](n)).c(),C(r,1),r.m(e,i)),(!l||2&g)&&f!==(f=n[5].name+"")&>(o,f),(!l||2&g&&a!==(a="Select ".concat(n[5].name," as query language")))&&x(e,"title",a),(!l||3&g)&&$e(e,"selected",n[5].id===n[0])},i:function(v){l||(C(r),l=!0)},o:function(v){M(r),l=!1},d:function(v){v&&Z(e),h[t].d(),c=!1,u()}}}function DH(n){for(var e,t,r,i=Mt(n[1]),o=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{};switch(l=1e3,i=g.offset||0,f=g.callback,o=g.easing||GH,s=g.a11y||!1,sr(g.container)){case"object":n=g.container;break;case"string":n=document.querySelector(g.container);break;default:n=window.document.documentElement}switch(t=n.scrollTop,sr(v)){case"number":e=void 0,s=!1,r=t+v;break;case"object":r=h(e=v);break;case"string":e=document.querySelector(v),r=h(e)}switch(a=r-t+i,sr(g.duration)){case"number":l=g.duration;break;case"function":l=g.duration(a)}d?c=0:requestAnimationFrame(m)}},QH=1e3,If=Sr("jsoneditor:History");function Y4(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.maxItems||QH,t=[],r=0;function i(){return r0}function s(){return{canUndo:i(),canRedo:o(),length:t.length}}function a(){n.onChange&&n.onChange(s())}return{add:function(l){If("add",l),t=[l].concat(t.slice(r)).slice(0,e),r=0,a()},clear:function(){If("clear"),t=[],r=0,a()},getState:s,undo:function(){if(i()){var l=t[r];return r+=1,If("undo",l),a(),l}},redo:function(){if(o())return If("redo",t[r-=1]),a(),t[r]}}}function al(n,e){var t=Date.now(),r=n();return e(Date.now()-t),r}var Za=Sr("validation");function X4(n,e,t,r){if(Za("validateJSON"),!e)return[];if(t!==r){var i=t.stringify(n);return e(i!==void 0?r.parse(i):void 0)}return e(n)}function YH(n,e,t,r){if(Za("validateText"),n.length>ZF)return{validationErrors:[{path:[],message:"Validation turned off: the document is too large",severity:oo.info}]};if(n.length===0)return null;try{var i=al(function(){return t.parse(n)},function(l){return Za("validate: parsed json in ".concat(l," ms"))});if(!e)return null;var o=t===r?i:al(function(){return r.parse(n)},function(l){return Za("validate: parsed json with the validationParser in ".concat(l," ms"))}),s=al(function(){return e(o)},function(l){return Za("validate: validated json in ".concat(l," ms"))});return hn(s)?null:{validationErrors:s}}catch(l){var a=al(function(){return function(c,u){if(c.length>eq)return!1;try{return u.parse(Ao(c)),!0}catch{return!1}}(n,t)},function(c){return Za("validate: checked whether repairable in ".concat(c," ms"))});return{parseError:Nl(n,l.message||l.toString()),isRepairable:a}}}var Df=Sr("jsoneditor:FocusTracker");function G0(n){var e,t=n.onMount,r=n.onDestroy,i=n.getWindow,o=n.hasFocus,s=n.onFocus,a=n.onBlur,l=!1;function c(){var f=o();f&&(clearTimeout(e),l||(Df("focus"),s(),l=f))}function u(){l&&(clearTimeout(e),e=setTimeout(function(){o()||(Df("blur"),l=!1,a())}))}t(function(){Df("mount FocusTracker");var f=i();f&&(f.addEventListener("focusin",c,!0),f.addEventListener("focusout",u,!0))}),r(function(){Df("destroy FocusTracker");var f=i();f&&(f.removeEventListener("focusin",c,!0),f.removeEventListener("focusout",u,!0))})}function XH(n){Et(n,"svelte-p1zf9f",'.jse-message.svelte-p1zf9f.svelte-p1zf9f{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);padding:var(--jse-padding, 10px);display:flex;gap:var(--jse-padding, 10px);flex-wrap:wrap;align-items:stretch}.jse-message.jse-success.svelte-p1zf9f.svelte-p1zf9f{background:var(--message-success-background, #9ac45d);color:var(--jse-message-success-color, #fff)}.jse-message.svelte-p1zf9f .jse-text.svelte-p1zf9f{display:flex;flex:1;min-width:60%;align-items:center}.jse-message.svelte-p1zf9f .jse-text.jse-clickable.svelte-p1zf9f{cursor:pointer}.jse-message.svelte-p1zf9f .jse-text.jse-clickable.svelte-p1zf9f:hover{background-color:rgba(255, 255, 255, 0.1)}.jse-message.jse-error.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-error-background, var(--jse-error-color, #ee5341));color:var(--jse-message-error-color, #fff)}.jse-message.jse-warning.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-warning-background, #ffde5c);color:var(--jse-message-warning-color, #4d4d4d)}.jse-message.jse-info.svelte-p1zf9f.svelte-p1zf9f{background:var(--jse-message-info-background, #4f91ff);color:var(--jse-message-info-color, #fff)}.jse-message.svelte-p1zf9f .jse-actions.svelte-p1zf9f{display:flex;gap:var(--jse-padding, 10px)}.jse-message.svelte-p1zf9f .jse-actions button.jse-action.svelte-p1zf9f{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-message-action-background, rgba(255, 255, 255, 0.2));color:inherit;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px)}.jse-message.svelte-p1zf9f .jse-actions button.jse-action.svelte-p1zf9f:hover{background:var(--jse-message-action-background-highlight, rgba(255, 255, 255, 0.3))}')}function Iw(n,e,t){var r=n.slice();return r[9]=e[t],r}function Dw(n){var e,t;return e=new un({props:{data:n[1]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};2&i&&(o.data=r[1]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Lw(n){var e,t;return e=new un({props:{data:n[9].icon}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};8&i&&(o.data=r[9].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Bw(n){var e,t,r,i,o,s,a,l,c,u=n[9].text+"",f=n[9].icon&&Lw(n);function d(){return n[7](n[9])}function h(){return n[8](n[9])}return{c:function(){e=V("button"),f&&f.c(),t=ce(),r=De(u),i=ce(),x(e,"type","button"),x(e,"class","jse-button jse-action jse-primary svelte-p1zf9f"),x(e,"title",o=n[9].title),e.disabled=s=n[9].disabled},m:function(p,m){ee(p,e,m),f&&f.m(e,null),E(e,t),E(e,r),E(e,i),a=!0,l||(c=[Ce(e,"click",d),Ce(e,"mousedown",h)],l=!0)},p:function(p,m){(n=p)[9].icon?f?(f.p(n,m),8&m&&C(f,1)):((f=Lw(n)).c(),C(f,1),f.m(e,t)):f&&(Ee(),M(f,1,1,function(){f=null}),Ae()),(!a||8&m)&&u!==(u=n[9].text+"")&>(r,u),(!a||8&m&&o!==(o=n[9].title))&&x(e,"title",o),(!a||8&m&&s!==(s=n[9].disabled))&&(e.disabled=s)},i:function(p){a||(C(f),a=!0)},o:function(p){M(f),a=!1},d:function(p){p&&Z(e),f&&f.d(),l=!1,kn(c)}}}function ZH(n){for(var e,t,r,i,o,s,a,l,c,u,f,d=n[1]&&Dw(n),h=Mt(n[3]),p=[],m=0;mol&&Hw(n);return{c:function(){e=V("table"),t=V("tbody");for(var u=0;uol?c?c.p(u,f):((c=Hw(u)).c(),c.m(t,null)):c&&(c.d(1),c=null)},i:function(u){if(!i){for(var f=0;f1&&qw(n);function y(){return n[7](n[8])}return{c:function(){e=V("tr"),t=V("td"),xe(r.$$.fragment),i=ce(),o=V("td"),s=De(v),a=ce(),l=V("td"),c=De(g),u=ce(),f=V("td"),b&&b.c(),x(t,"class","jse-validation-error-icon svelte-1gq3gfv"),x(o,"class","jse-validation-error-path svelte-1gq3gfv"),x(l,"class","jse-validation-error-message svelte-1gq3gfv"),x(f,"class","jse-validation-error-action svelte-1gq3gfv"),x(e,"class",d="jse-validation-"+n[8].severity+" svelte-1gq3gfv")},m:function(j,w){ee(j,e,w),E(e,t),be(r,t,null),E(e,i),E(e,o),E(o,s),E(e,a),E(e,l),E(l,c),E(e,u),E(e,f),b&&b.m(f,null),h=!0,p||(m=Ce(e,"click",y),p=!0)},p:function(j,w){n=j,(!h||1&w)&&v!==(v=mi(n[8].path)+"")&>(s,v),(!h||1&w)&&g!==(g=n[8].message+"")&>(c,g),n[10]===0&&n[0].length>1?b?(b.p(n,w),1&w&&C(b,1)):((b=qw(n)).c(),C(b,1),b.m(f,null)):b&&(Ee(),M(b,1,1,function(){b=null}),Ae()),(!h||1&w&&d!==(d="jse-validation-"+n[8].severity+" svelte-1gq3gfv"))&&x(e,"class",d)},i:function(j){h||(C(r.$$.fragment,j),C(b),h=!0)},o:function(j){M(r.$$.fragment,j),M(b),h=!1},d:function(j){j&&Z(e),we(r),b&&b.d(),p=!1,m()}}}function Hw(n){var e,t,r,i,o,s,a,l,c,u,f,d=n[3]-ol+"";return{c:function(){e=V("tr"),t=V("td"),r=ce(),i=V("td"),o=ce(),s=V("td"),a=De("(and "),l=De(d),c=De(" more errors)"),u=ce(),f=V("td"),x(t,"class","svelte-1gq3gfv"),x(i,"class","svelte-1gq3gfv"),x(s,"class","svelte-1gq3gfv"),x(f,"class","svelte-1gq3gfv"),x(e,"class","jse-validation-error svelte-1gq3gfv")},m:function(h,p){ee(h,e,p),E(e,t),E(e,r),E(e,i),E(e,o),E(e,s),E(s,a),E(s,l),E(s,c),E(e,u),E(e,f)},p:function(h,p){8&p&&d!==(d=h[3]-ol+"")&>(l,d)},d:function(h){h&&Z(e)}}}function iU(n){var e,t,r=!hn(n[0]),i=r&&Fw(n);return{c:function(){i&&i.c(),e=an()},m:function(o,s){i&&i.m(o,s),ee(o,e,s),t=!0},p:function(o,s){var a=At(s,1)[0];1&a&&(r=!hn(o[0])),r?i?(i.p(o,a),1&a&&C(i,1)):((i=Fw(o)).c(),C(i,1),i.m(e.parentNode,e)):i&&(Ee(),M(i,1,1,function(){i=null}),Ae())},i:function(o){t||(C(i),t=!0)},o:function(o){M(i),t=!1},d:function(o){o&&Z(e),i&&i.d(o)}}}function oU(n,e,t){var r,i=e.validationErrors,o=e.selectError,s=!0;return n.$$set=function(a){"validationErrors"in a&&t(0,i=a.validationErrors),"selectError"in a&&t(1,o=a.selectError)},n.$$.update=function(){1&n.$$.dirty&&t(3,r=i.length)},[i,o,s,r,function(){t(2,s=!1)},function(){t(2,s=!0)},function(a){return[oo.error,oo.warning,oo.info].find(function(l){return a.some(function(c){return c.severity===l})})},function(a){setTimeout(function(){return o(a)})}]}var Q0=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,oU,iU,Tt,{validationErrors:0,selectError:1},tU),r}return ht(e,mt),ut(e)}(),sU=typeof navigator!="undefined"&&navigator.platform.toUpperCase().indexOf("MAC")>=0,el=[];function Uw(n){if(n.key==="Escape"){var e=en(el);e&&e()}}function Lu(n,e){return hn(el)&&window.addEventListener("keydown",Uw),el.push(e),{destroy:function(){el=el.filter(function(t){return t!==e}),hn(el)&&window.removeEventListener("keydown",Uw)}}}function aU(n){Et(n,"svelte-1nm0t3v",'.jse-modal.svelte-1nm0t3v.svelte-1nm0t3v{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-1nm0t3v .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-1nm0t3v .jse-modal-contents.svelte-1nm0t3v{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions.svelte-1nm0t3v{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions button.jse-primary.svelte-1nm0t3v{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions button.jse-primary.svelte-1nm0t3v:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-1nm0t3v .jse-modal-contents .jse-actions button.jse-primary.svelte-1nm0t3v:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0;overflow:auto}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;max-height:500px;display:flex}.bg.jse-modal-bg .jse-modal-window:has(div.fullscreen){margin:var(--jse-padding, 10px);padding:0;width:calc(100vw - 2 * var(--jse-padding, 10px));height:calc(100vh - 2 * var(--jse-padding, 10px));max-width:none;max-height:none}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0;max-height:none}.jse-modal.jse-copy-paste.svelte-1nm0t3v .jse-shortcuts.svelte-1nm0t3v{display:flex;flex-wrap:wrap;justify-content:space-around;margin:calc(2 * var(--jse-padding, 10px)) 0}.jse-modal.jse-copy-paste.svelte-1nm0t3v .jse-shortcuts .jse-shortcut .jse-key.svelte-1nm0t3v{font-size:200%;color:var(--jse-theme-color, #3883fa)}')}function lU(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_;return t=new tp({props:{title:"Copying and pasting"}}),{c:function(){e=V("div"),xe(t.$$.fragment),r=ce(),i=V("div"),(o=V("div")).textContent="These actions are unavailable via the menu. Please use:",s=ce(),a=V("div"),l=V("div"),(c=V("div")).textContent="".concat(n[1],"+C"),u=De(` for copy`),f=ce(),d=V("div"),(h=V("div")).textContent="".concat(n[1],"+X"),p=De(` for cut`),m=ce(),v=V("div"),(g=V("div")).textContent="".concat(n[1],"+V"),b=De(` - for paste`),y=ce(),x=V("div"),(w=V("button")).textContent="Close",j(c,"class","jse-key svelte-1nm0t3v"),j(l,"class","jse-shortcut"),j(h,"class","jse-key svelte-1nm0t3v"),j(d,"class","jse-shortcut"),j(g,"class","jse-key svelte-1nm0t3v"),j(v,"class","jse-shortcut"),j(a,"class","jse-shortcuts svelte-1nm0t3v"),j(w,"type","button"),j(w,"class","jse-primary svelte-1nm0t3v"),j(x,"class","jse-actions svelte-1nm0t3v"),j(i,"class","jse-modal-contents svelte-1nm0t3v"),j(e,"class","jse-modal jse-copy-paste svelte-1nm0t3v")},m:function(F,I){ee(F,e,I),be(t,e,null),E(e,r),E(e,i),E(i,o),E(i,s),E(i,a),E(a,l),E(l,c),E(l,u),E(a,f),E(a,d),E(d,h),E(d,p),E(a,m),E(a,v),E(v,g),E(v,b),E(i,y),E(i,x),E(x,w),$=!0,S||(_=[Ce(w,"click",n[2]),mr(Lu.call(null,e,n[3]))],S=!0)},p:Te,i:function(F){$||(C(t.$$.fragment,F),$=!0)},o:function(F){M(t.$$.fragment,F),$=!1},d:function(F){F&&Z(e),we(t),S=!1,kn(_)}}}function cU(n){var e=Er("simple-modal").close;return[e,sU?"\u2318":"Ctrl",function(){return e()},function(){return e()}]}var Z4=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,cU,lU,Tt,{},aU),r}return ht(e,mt),ut(e)}();function e6(n){return!!n&&(n.type==="space"||n.space===!0)}function np(n){return!!n&&(n.type==="separator"||n.separator===!0)}function uU(n){return!!n&&n.type==="label"&&typeof n.text=="string"}function Bu(n){return!!n&&typeof n.onClick=="function"}function Q0(n){return!!n&&n.type==="dropdown-button"&&Bu(n.main)&&Array.isArray(n.items)}function fU(n){return!!n&&n.type==="row"&&Array.isArray(n.items)}function dU(n){return!!n&&n.type==="column"&&Array.isArray(n.items)}function Uw(n){return Rn(n)&&Rn(n.parseError)}function hU(n){return Rn(n)&&Array.isArray(n.validationErrors)}function pU(n){return Rn(n)&&Array.isArray(n.path)&&typeof n.message=="string"&&"severity"in n}function mU(n){return Rn(n)&&pU(n)&&typeof n.isChildError=="boolean"}function t6(n){return Rn(n)&&typeof n.action=="function"&&Rn(n.props)}function gU(n){Et(n,"svelte-7deygj",'.jse-menu.svelte-7deygj.svelte-7deygj{background:var(--jse-theme-color, #3883fa);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-main-menu, 14px);color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));display:flex;flex-wrap:wrap;align-items:stretch;position:relative}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj{font-family:inherit;font-size:inherit;line-height:1.5em;border:none;background:transparent;color:inherit;cursor:pointer;width:var(--jse-menu-button-size, 32px);height:var(--jse-menu-button-size, 32px);padding:calc(0.5 * var(--jse-padding, 10px));margin:0;border-radius:0;display:inline-flex;align-items:center;text-align:center;justify-content:center}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:hover,.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:focus{background:var(--jse-theme-color-highlight, #5f9dff)}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:disabled{color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));opacity:0.5;background:transparent}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj{width:auto;height:calc(var(--jse-menu-button-size, 32px) - var(--jse-padding, 10px));margin:calc(0.5 * var(--jse-padding, 10px)) 0;padding:0 calc(0.5 * var(--jse-padding, 10px)) 1px;border:1px solid var(--jse-menu-color, var(--jse-text-color-inverse, #fff))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:not(.jse-last){border-right:none}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-first.svelte-7deygj{margin-left:calc(0.5 * var(--jse-padding, 10px))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-last.svelte-7deygj{margin-right:calc(0.5 * var(--jse-padding, 10px))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:hover,.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:focus{background:var(--jse-theme-color-highlight, #5f9dff)}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-selected.svelte-7deygj{background:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));color:var(--jse-theme-color, #3883fa)}.jse-menu.svelte-7deygj .jse-space.svelte-7deygj{flex:1}.jse-menu.svelte-7deygj .jse-separator.svelte-7deygj{background:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));opacity:0.3;width:1px;margin:3px}')}var vU=function(n){return{}},Ww=function(n){return{}};function Jw(n,e,t){var r=n.slice();return r[3]=e[t],r}var yU=function(n){return{}},Kw=function(n){return{}};function bU(n){var e,t=Xw(n[3])+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){1&i&&t!==(t=Xw(r[3])+"")&>(e,t)},i:Te,o:Te,d:function(r){r&&Z(e)}}}function wU(n){var e,t,r,i,o,s,a,l,c=n[3].icon&&Gw(n),u=n[3].text&&Qw(n);return{c:function(){e=V("button"),c&&c.c(),t=ce(),u&&u.c(),j(e,"type","button"),j(e,"class",r="jse-button "+n[3].className+" svelte-7deygj"),j(e,"title",i=n[3].title),e.disabled=o=n[3].disabled||!1},m:function(f,d){ee(f,e,d),c&&c.m(e,null),E(e,t),u&&u.m(e,null),s=!0,a||(l=Ce(e,"click",function(){Mr(n[3].onClick)&&n[3].onClick.apply(this,arguments)}),a=!0)},p:function(f,d){(n=f)[3].icon?c?(c.p(n,d),1&d&&C(c,1)):((c=Gw(n)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae()),n[3].text?u?u.p(n,d):((u=Qw(n)).c(),u.m(e,null)):u&&(u.d(1),u=null),(!s||1&d&&r!==(r="jse-button "+n[3].className+" svelte-7deygj"))&&j(e,"class",r),(!s||1&d&&i!==(i=n[3].title))&&j(e,"title",i),(!s||1&d&&o!==(o=n[3].disabled||!1))&&(e.disabled=o)},i:function(f){s||(C(c),s=!0)},o:function(f){M(c),s=!1},d:function(f){f&&Z(e),c&&c.d(),u&&u.d(),a=!1,l()}}}function xU(n){var e;return{c:function(){j(e=V("div"),"class","jse-space svelte-7deygj")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function jU(n){var e;return{c:function(){j(e=V("div"),"class","jse-separator svelte-7deygj")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function Gw(n){var e,t;return e=new un({props:{data:n[3].icon}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.data=r[3].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Qw(n){var e,t=n[3].text+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){1&i&&t!==(t=r[3].text+"")&>(e,t)},d:function(r){r&&Z(e)}}}function Yw(n){var e,t,r,i,o,s,a,l=[jU,xU,wU,bU],c=[];function u(f,d){return 1&d&&(e=null),1&d&&(t=null),1&d&&(r=null),e==null&&(e=!!np(f[3])),e?0:(t==null&&(t=!!e6(f[3])),t?1:(r==null&&(r=!!Bu(f[3])),r?2:3))}return i=u(n,-1),o=c[i]=l[i](n),{c:function(){o.c(),s=an()},m:function(f,d){c[i].m(f,d),ee(f,s,d),a=!0},p:function(f,d){var h=i;(i=u(f,d))===h?c[i].p(f,d):(Ee(),M(c[h],1,1,function(){c[h]=null}),Ae(),(o=c[i])?o.p(f,d):(o=c[i]=l[i](f)).c(),C(o,1),o.m(s.parentNode,s))},i:function(f){a||(C(o),a=!0)},o:function(f){M(o),a=!1},d:function(f){f&&Z(s),c[i].d(f)}}}function $U(n){for(var e,t,r,i,o=n[2].left,s=Qn(o,n,n[1],Kw),a=Mt(n[0]),l=[],c=0;c=g.end&&y.end<=$.start;return _&&S.push(y),$.start>=(_?y.end:g.end)&&S.push($),S}(i,o))},[f,h,o,i,a,s,l,c,u,d,p,r,function(m){return h(f,m)}]}var BU=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,LU,IU,Tt,{visibleSections:6,sectionIndex:7,total:8,path:0,selection:9,onExpandSection:1,context:10},NU),r}return ht(e,mt),ut(e)}();function zU(n){Et(n,"svelte-6k6355",".jse-context-menu-pointer.svelte-6k6355{position:absolute;top:calc(-0.5 * var(--jse-context-menu-pointer-size, calc(1em + 4px)));right:calc(-0.5 * var(--jse-context-menu-pointer-size, calc(1em + 4px)));width:var(--jse-context-menu-pointer-size, calc(1em + 4px));height:var(--jse-context-menu-pointer-size, calc(1em + 4px));padding:0;margin:0;cursor:pointer;background:transparent;border-radius:2px;background:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565));color:var(--jse-context-menu-pointer-color, var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff)));border:none;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-context-menu-pointer.svelte-6k6355:hover{background:var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a))}")}function FU(n){var e,t,r,i,o;return t=new un({props:{data:Ri}}),{c:function(){e=V("button"),je(t.$$.fragment),j(e,"type","button"),j(e,"class","jse-context-menu-pointer svelte-6k6355"),j(e,"title",I0),$e(e,"jse-selected",n[0])},m:function(s,a){ee(s,e,a),be(t,e,null),r=!0,i||(o=Ce(e,"click",n[1]),i=!0)},p:function(s,a){var l=At(a,1)[0];(!r||1&l)&&$e(e,"jse-selected",s[0])},i:function(s){r||(C(t.$$.fragment,s),r=!0)},o:function(s){M(t.$$.fragment,s),r=!1},d:function(s){s&&Z(e),we(t),i=!1,o()}}}function qU(n,e,t){var r=e.selected,i=e.onContextMenu;return n.$$set=function(o){"selected"in o&&t(0,r=o.selected),"onContextMenu"in o&&t(2,i=o.onContextMenu)},[r,function(o){for(var s=o.target;s&&s.nodeName!=="BUTTON";)s=s.parentNode;s&&i({anchor:s,left:0,top:0,width:Ko,height:Jo,offsetTop:2,offsetLeft:0,showTip:!0})},i]}var Gs=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,qU,FU,Tt,{selected:0,onContextMenu:2},zU),r}return ht(e,mt),ut(e)}();function VU(n){Et(n,"svelte-10xe8tv",'.jse-key.svelte-10xe8tv{display:inline-block;min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;color:var(--jse-key-color, #1a1a1a);cursor:var(--jse-contents-cursor, pointer);word-break:normal;overflow-wrap:normal;white-space:pre-wrap}.jse-key.svelte-10xe8tv:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-key.svelte-10xe8tv:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-key.jse-empty.svelte-10xe8tv{min-width:3em;outline:1px dotted var(--jse-tag-background, rgba(0, 0, 0, 0.2));-moz-outline-radius:2px}.jse-key.jse-empty.svelte-10xe8tv::after{pointer-events:none;color:var(--jse-tag-background, rgba(0, 0, 0, 0.2));content:"key"}')}function HU(n){var e,t,r,i,o,s,a,l=[JU,WU],c=[];function u(f,d){return f[1]?0:1}return t=u(n),r=c[t]=l[t](n),{c:function(){e=V("div"),r.c(),j(e,"role","none"),j(e,"data-type","selectable-key"),j(e,"class",i=Vn(n[6](n[0]))+" svelte-10xe8tv")},m:function(f,d){ee(f,e,d),c[t].m(e,null),o=!0,s||(a=Ce(e,"dblclick",n[5]),s=!0)},p:function(f,d){var h=t;(t=u(f))===h?c[t].p(f,d):(Ee(),M(c[h],1,1,function(){c[h]=null}),Ae(),(r=c[t])?r.p(f,d):(r=c[t]=l[t](f)).c(),C(r,1),r.m(e,null)),(!o||1&d&&i!==(i=Vn(f[6](f[0]))+" svelte-10xe8tv"))&&j(e,"class",i)},i:function(f){o||(C(r),o=!0)},o:function(f){M(r),o=!1},d:function(f){f&&Z(e),c[t].d(),s=!1,a()}}}function UU(n){var e,t;return e=new _4({props:{value:n[2].normalization.escapeValue(n[0]),shortText:!0,onChange:n[7],onCancel:n[8],onFind:n[2].onFind}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};5&i&&(o.value=r[2].normalization.escapeValue(r[0])),4&i&&(o.onFind=r[2].onFind),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function WU(n){var e,t=Pa(n[2].normalization.escapeValue(n[0]))+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){5&i&&t!==(t=Pa(r[2].normalization.escapeValue(r[0]))+"")&>(e,t)},i:Te,o:Te,d:function(r){r&&Z(e)}}}function JU(n){var e,t;return e=new B4({props:{text:n[2].normalization.escapeValue(n[0]),searchResultItems:n[1]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};5&i&&(o.text=r[2].normalization.escapeValue(r[0])),2&i&&(o.searchResultItems=r[1]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function tx(n){var e,t;return e=new Gs({props:{selected:!0,onContextMenu:n[2].onContextMenu}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};4&i&&(o.onContextMenu=r[2].onContextMenu),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function KU(n){var e,t,r,i,o,s=[UU,HU],a=[];function l(u,f){return!u[2].readOnly&&u[4]?0:1}e=l(n),t=a[e]=s[e](n);var c=!n[2].readOnly&&n[3]&&!n[4]&&tx(n);return{c:function(){t.c(),r=ce(),c&&c.c(),i=an()},m:function(u,f){a[e].m(u,f),ee(u,r,f),c&&c.m(u,f),ee(u,i,f),o=!0},p:function(u,f){var d=At(f,1)[0],h=e;(e=l(u))===h?a[e].p(u,d):(Ee(),M(a[h],1,1,function(){a[h]=null}),Ae(),(t=a[e])?t.p(u,d):(t=a[e]=s[e](u)).c(),C(t,1),t.m(r.parentNode,r)),u[2].readOnly||!u[3]||u[4]?c&&(Ee(),M(c,1,1,function(){c=null}),Ae()):c?(c.p(u,d),28&d&&C(c,1)):((c=tx(u)).c(),C(c,1),c.m(i.parentNode,i))},i:function(u){o||(C(t),C(c),o=!0)},o:function(u){M(t),M(c),o=!1},d:function(u){u&&(Z(r),Z(i)),a[e].d(u),c&&c.d(u)}}}function GU(n,e,t){var r,i,o=e.path,s=e.key,a=e.selection,l=e.searchResultItems,c=e.onUpdateKey,u=e.context;return n.$$set=function(f){"path"in f&&t(9,o=f.path),"key"in f&&t(0,s=f.key),"selection"in f&&t(10,a=f.selection),"searchResultItems"in f&&t(1,l=f.searchResultItems),"onUpdateKey"in f&&t(11,c=f.onUpdateKey),"context"in f&&t(2,u=f.context)},n.$$.update=function(){1536&n.$$.dirty&&t(3,r=!!a&&or(a)&&sn(a.path,o)),1032&n.$$.dirty&&t(4,i=r&&Xr(a))},[s,l,u,r,i,function(f){i||u.readOnly||(f.preventDefault(),u.onSelect(zi(o,!0)))},function(f){return Bo("jse-key",{"jse-empty":f===""})},function(f,d){var h=c(s,u.normalization.unescapeValue(f)),p=on(o).concat(h);u.onSelect(d===Rs.nextInside?Ut(p,!1):zi(p,!1)),d!==Rs.self&&u.focus()},function(){u.onSelect(zi(o,!1)),u.focus()},o,a,c]}var QU=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,GU,KU,Tt,{path:9,key:0,selection:10,searchResultItems:1,onUpdateKey:11,context:2},VU),r}return ht(e,mt),ut(e)}();function nx(n,e,t){var r=n.slice();return r[8]=e[t],r}function YU(n){var e,t,r=n[8].component,i=rx(n);return{c:function(){i.c(),e=an()},m:function(o,s){i.m(o,s),ee(o,e,s),t=!0},p:function(o,s){1&s&&Tt(r,r=o[8].component)?(Ee(),M(i,1,1,Te),Ae(),(i=rx(o)).c(),C(i,1),i.m(e.parentNode,e)):i.p(o,s)},i:function(o){t||(C(i),t=!0)},o:function(o){M(i),t=!1},d:function(o){o&&Z(e),i.d(o)}}}function XU(n){var e,t=n[8].action,r=ix(n);return{c:function(){r.c(),e=an()},m:function(i,o){r.m(i,o),ee(i,e,o)},p:function(i,o){1&o&&Tt(t,t=i[8].action)?(r.d(1),(r=ix(i)).c(),r.m(e.parentNode,e)):r.p(i,o)},i:Te,o:Te,d:function(i){i&&Z(e),r.d(i)}}}function rx(n){var e,t,r,i=[n[8].props],o=n[8].component;function s(a,l){for(var c={},u=0;ux+b()/2;)x+=b(),y-=1;var w=h[y].path,$=y-g;return y!==g&&h[y]!==void 0?{beforePath:w,offset:$}:void 0}({json:e,selection:o,deltaY:r,items:i}):function(f){for(var d,h=f.json,p=f.items,m=f.selection,v=f.deltaY,g=Is(h,m),b=p.findIndex(function(W){return sn(W.path,g)}),y=0,x=b,w=function(){var W;return(W=p[x+1])===null||W===void 0?void 0:W.height};w()!==void 0&&Math.abs(v)>y+w()/2;)y+=w(),x+=1;var $=on(g),S=Ye(h,$),_=Array.isArray(S),F=(d=p[_?x:x+1])===null||d===void 0?void 0:d.path,I=x-b;return F?{beforePath:F,offset:I}:{append:!0,offset:I}}({json:e,selection:o,deltaY:r,items:i});if(!s||s.offset===0)return{operations:void 0,updatedSelection:null,offset:0};var a=function(f,d,h){if(!d)return[];var p="beforePath"in h?h.beforePath:void 0,m="append"in h?h.append:void 0,v=on(lt(d)),g=Ye(f,v);if(!(m||p&&cs(p,v)&&p.length>v.length))return[];var b=Go(f,d),y=Is(f,d),x=en(b),w=en(y),$=p?p[v.length]:void 0;if(!Gn(g)){if(Nn(g)){var S=zr(x),_=zr(w),F=$!==void 0?zr($):g.length;return eT(_-S+1,FW?[].concat(Vt(I.slice(W,D+1)),Vt(I.slice(U,I.length))).map(function(q){return _a(v,q)}):[].concat(Vt(I.slice(U,W)),Vt(I.slice(D+1,I.length))).map(function(q){return _a(v,q)}):[]}(e,o,s),l=on(Go(e,o)),c=Ye(e,l);if(Array.isArray(c)){var u=function(f){var d,h,p=f.items,m=f.json,v=f.selection,g=f.offset,b=Go(m,v),y=Is(m,v),x=p.findIndex(function(_){return sn(_.path,b)}),w=p.findIndex(function(_){return sn(_.path,y)}),$=(d=p[x+g])===null||d===void 0?void 0:d.path,S=(h=p[w+g])===null||h===void 0?void 0:h.path;return Wr($,S)}({items:i,json:e,selection:o,offset:s.offset});return{operations:a,updatedSelection:u,offset:s.offset}}return{operations:a,updatedSelection:null,offset:s.offset}}function Ei(n,e){return function(t,r){if(t){for(var i={},o=0,s=Object.keys(t);o0?i:void 0}}(n,function(t){return lh(t,e)})}function rW(n){Et(n,"svelte-1yy7qpj",'button.jse-validation-error.svelte-1yy7qpj{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-error-color, #ee5341)}button.jse-validation-info.svelte-1yy7qpj{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-info-color, #4f91ff)}button.jse-validation-warning.svelte-1yy7qpj{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-warning-color, #fdc539)}')}function iW(n){var e,t,r,i,o,s,a;return t=new un({props:{data:La}}),{c:function(){e=V("button"),je(t.$$.fragment),j(e,"type","button"),j(e,"class",r="jse-validation-"+n[0].severity+" svelte-1yy7qpj")},m:function(l,c){ee(l,e,c),be(t,e,null),o=!0,s||(a=[Ce(e,"click",function(){Mr(n[1])&&n[1].apply(this,arguments)}),mr(i=U0.call(null,e,fe({text:n[2]},n[3])))],s=!0)},p:function(l,c){var u=At(c,1)[0];n=l,(!o||1&u&&r!==(r="jse-validation-"+n[0].severity+" svelte-1yy7qpj"))&&j(e,"class",r),i&&Mr(i.update)&&4&u&&i.update.call(null,fe({text:n[2]},n[3]))},i:function(l){o||(C(t.$$.fragment,l),o=!0)},o:function(l){M(t.$$.fragment,l),o=!1},d:function(l){l&&Z(e),we(t),s=!1,kn(a)}}}function oW(n,e,t){var r,i=Er("absolute-popup"),o=e.validationError,s=e.onExpand;return n.$$set=function(a){"validationError"in a&&t(0,o=a.validationError),"onExpand"in a&&t(1,s=a.onExpand)},n.$$.update=function(){1&n.$$.dirty&&t(2,r=mU(o)&&o.isChildError?"Contains invalid data":o.message)},[o,s,r,i]}var Xl=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,oW,iW,yr,{validationError:0,onExpand:1},rW),r}return ht(e,mt),ut(e)}();function sW(n){Et(n,"svelte-6mjnsm",'.jse-json-node.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative;color:var(--jse-text-color, #4d4d4d)}.jse-json-node.jse-root.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{min-height:100%;padding-bottom:2px;box-sizing:border-box}.jse-json-node.jse-root.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm .jse-context-menu-pointer,.jse-json-node.jse-root.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm .jse-context-menu-pointer{top:0;right:calc(-2px - var(--jse-context-menu-pointer-size, calc(1em + 4px)))}.jse-json-node.jse-root.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm.svelte-6mjnsm{padding-left:0}.jse-json-node.svelte-6mjnsm .jse-props.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-items.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative}.jse-json-node.svelte-6mjnsm .jse-header-outer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-footer-outer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)))}.jse-json-node.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative}.jse-json-node.svelte-6mjnsm .jse-header .jse-meta.svelte-6mjnsm>.jse-meta-inner.svelte-6mjnsm.svelte-6mjnsm{display:flex;justify-content:center}.jse-json-node.svelte-6mjnsm .jse-contents-outer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)))}.jse-json-node.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;flex-direction:row;align-items:flex-start}.jse-json-node.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding-left:var(--jse-indent-size, calc(1em + 4px))}.jse-json-node.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:inline-flex;padding-left:calc(var(--jse-indent-size, calc(1em + 4px)) + 5px)}.jse-json-node.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-contents-background-color, transparent)}.jse-json-node.svelte-6mjnsm .jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{visibility:hidden;padding:0 calc(0.5 * var(--jse-padding, 10px));flex:1}.jse-json-node.svelte-6mjnsm .jse-insert-selection-area.jse-inside.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:inline-flex;align-items:center}.jse-json-node.svelte-6mjnsm .jse-insert-selection-area.jse-after.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;align-items:flex-end}.jse-json-node.svelte-6mjnsm .jse-context-menu-pointer-anchor.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative}.jse-json-node.svelte-6mjnsm .jse-insert-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;position:relative;z-index:1;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)));max-width:250px;min-width:100px;height:0;margin-right:calc(0.5 * var(--jse-padding, 10px));outline:1px solid}.jse-json-node.svelte-6mjnsm .jse-insert-area.svelte-6mjnsm .jse-context-menu-pointer{right:-1px;background:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-hovered.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{outline-color:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-json-node.svelte-6mjnsm:hover>.jse-contents-outer .jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:not(.jse-selected),.jse-json-node.svelte-6mjnsm .jse-header-outer.svelte-6mjnsm:hover>.jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm:not(.jse-selected),.jse-json-node.svelte-6mjnsm .jse-footer-outer:hover .jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:not(.jse-selected){visibility:visible}.jse-json-node.jse-hovered.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-json-node.jse-selected.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected.svelte-6mjnsm .jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-selected.svelte-6mjnsm .jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-selection-background-color, #d3d3d3)}.jse-json-node.jse-selected-key.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm>.jse-identifier>.jse-key,.jse-json-node.jse-selected-key.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-identifier>.jse-key{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm>.jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.svelte-6mjnsm .jse-collapsed-items.jse-selected,.jse-json-node.jse-selected.svelte-6mjnsm .jse-collapsed-items,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-collapsed-items{background-color:var(--jse-selection-background-color, #d3d3d3);--jse-collapsed-items-background-color:var(--jse-collapsed-items-selected-background-color, #c2c2c2)}.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-meta.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-footer-outer.svelte-6mjnsm>.jse-footer.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-selection-background-color, #d3d3d3)}.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-meta.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-meta.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-footer-outer.svelte-6mjnsm>.jse-footer.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-footer-outer.svelte-6mjnsm>.jse-footer.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-footer.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-footer.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-expand.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-expand.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-footer.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-footer.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-expand.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-expand.svelte-6mjnsm .jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-readonly.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{--jse-contents-selected-cursor:pointer}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-selected.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{outline-color:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565))}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-selected.svelte-6mjnsm .jse-context-menu-pointer{background:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565))}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-selected.svelte-6mjnsm .jse-context-menu-pointer:hover{background:var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a))}.jse-main:not(.jse-focus) .jse-json-node.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{--jse-selection-background-color:var(--jse-selection-background-inactive-color, #e8e8e8);--jse-context-menu-pointer-background:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{width:var(--jse-indent-size, calc(1em + 4px));padding:0;margin:0;border:none;cursor:pointer;background:transparent;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38));font-size:var(--jse-font-size-mono, 14px);height:var(--jse-line-height, calc(1em + 4px))}.jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:hover{opacity:0.8}.jse-meta.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-separator.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-index.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-bracket.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{vertical-align:top;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-index.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding:0 calc(0.5 * var(--jse-padding, 10px))}.jse-bracket.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding:0 2px}.jse-bracket.jse-expanded.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding-right:var(--jse-padding, 10px)}.jse-tag.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{border:none;font-size:80%;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);color:var(--jse-tag-color, var(--jse-text-color-inverse, #fff));background:var(--jse-tag-background, rgba(0, 0, 0, 0.2));border-radius:2px;cursor:pointer;display:inline-block;padding:0 4px;line-height:normal;margin:1px 0}.jse-tag.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:hover{opacity:0.8}.jse-tag.jse-expanded.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{opacity:0.7;cursor:inherit}.jse-identifier.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{vertical-align:top;position:relative}')}var aW=function(n){return{}},sx=function(n){return{}};function ax(n,e,t){var r=n.slice();return r[52]=e[t],r}var lW=function(n){return{}},lx=function(n){return{}};function cx(n,e,t){var r=n.slice();return r[46]=e[t],r[48]=t,r}function ux(n,e,t){var r=n.slice();return r[49]=e[t],r}var cW=function(n){return{}},fx=function(n){return{}};function uW(n){var e,t,r,i,o,s,a,l,c,u=!n[8].readOnly&&n[16]&&n[7]&&(rn(n[7])||Cn(n[7]))&&!Xr(n[7])&&sn(lt(n[7]),n[1]),f=n[33].identifier,d=Qn(f,n,n[34],sx),h=!n[17]&&dx();o=new nW({props:{path:n[1],value:n[0],enforceString:n[13]||!1,selection:n[16]?n[7]:null,searchResultItems:Dg(n[6],n[9]),context:n[8]}});var p=u&&hx(n),m=n[15]&&px(n),v=!n[17]&&mx(n);return{c:function(){e=V("div"),t=V("div"),d&&d.c(),r=ce(),h&&h.c(),i=ce(),je(o.$$.fragment),s=ce(),p&&p.c(),a=ce(),m&&m.c(),l=ce(),v&&v.c(),j(t,"class","jse-contents svelte-6mjnsm"),j(e,"class","jse-contents-outer svelte-6mjnsm")},m:function(g,b){ee(g,e,b),E(e,t),d&&d.m(t,null),E(t,r),h&&h.m(t,null),E(t,i),be(o,t,null),E(t,s),p&&p.m(t,null),E(e,a),m&&m.m(e,null),E(e,l),v&&v.m(e,null),c=!0},p:function(g,b){d&&d.p&&(!c||8&b[1])&&Xn(d,f,g,g[34],c?Yn(f,g[34],b,aW):Zn(g[34]),sx),g[17]?h&&(h.d(1),h=null):h||((h=dx()).c(),h.m(t,i));var y={};2&b[0]&&(y.path=g[1]),1&b[0]&&(y.value=g[0]),8192&b[0]&&(y.enforceString=g[13]||!1),65664&b[0]&&(y.selection=g[16]?g[7]:null),576&b[0]&&(y.searchResultItems=Dg(g[6],g[9])),256&b[0]&&(y.context=g[8]),o.$set(y),65922&b[0]&&(u=!g[8].readOnly&&g[16]&&g[7]&&(rn(g[7])||Cn(g[7]))&&!Xr(g[7])&&sn(lt(g[7]),g[1])),u?p?(p.p(g,b),65922&b[0]&&C(p,1)):((p=hx(g)).c(),C(p,1),p.m(t,null)):p&&(Ee(),M(p,1,1,function(){p=null}),Ae()),g[15]?m?(m.p(g,b),32768&b[0]&&C(m,1)):((m=px(g)).c(),C(m,1),m.m(e,l)):m&&(Ee(),M(m,1,1,function(){m=null}),Ae()),g[17]?v&&(v.d(1),v=null):v?v.p(g,b):((v=mx(g)).c(),v.m(e,null))},i:function(g){c||(C(d,g),C(o.$$.fragment,g),C(p),C(m),c=!0)},o:function(g){M(d,g),M(o.$$.fragment,g),M(p),M(m),c=!1},d:function(g){g&&Z(e),d&&d.d(g),h&&h.d(),we(o),p&&p.d(),m&&m.d(),v&&v.d()}}}function fW(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y=!n[8].readOnly&&n[16]&&n[7]&&(rn(n[7])||Cn(n[7]))&&!Xr(n[7])&&sn(lt(n[7]),n[1]),x=[pW,hW],w=[];function $(B,O){return B[12]?0:1}i=$(n),o=w[i]=x[i](n);var S=n[33].identifier,_=Qn(S,n,n[34],lx),F=!n[17]&&gx();function I(B,O){return B[12]?gW:mW}var W=I(n),D=W(n),U=y&&vx(n),q=n[15]&&(!n[12]||!n[15].isChildError)&&yx(n);function X(B,O){return B[12]?yW:B[17]?void 0:vW}var K=X(n),Y=K&&K(n),T=n[12]&&bx(n);return{c:function(){e=V("div"),t=V("div"),r=V("button"),o.c(),s=ce(),_&&_.c(),a=ce(),F&&F.c(),l=ce(),c=V("div"),u=V("div"),D.c(),f=ce(),U&&U.c(),d=ce(),q&&q.c(),h=ce(),Y&&Y.c(),p=ce(),T&&T.c(),m=an(),j(r,"type","button"),j(r,"class","jse-expand svelte-6mjnsm"),j(r,"title","Expand or collapse this object (Ctrl+Click to expand/collapse recursively)"),j(u,"class","jse-meta-inner svelte-6mjnsm"),j(c,"class","jse-meta svelte-6mjnsm"),j(c,"data-type","selectable-value"),j(t,"class","jse-header svelte-6mjnsm"),j(e,"class","jse-header-outer svelte-6mjnsm")},m:function(B,O){ee(B,e,O),E(e,t),E(t,r),w[i].m(r,null),E(t,s),_&&_.m(t,null),E(t,a),F&&F.m(t,null),E(t,l),E(t,c),E(c,u),D.m(u,null),E(t,f),U&&U.m(t,null),E(e,d),q&&q.m(e,null),E(e,h),Y&&Y.m(e,null),ee(B,p,O),T&&T.m(B,O),ee(B,m,O),v=!0,g||(b=Ce(r,"click",n[20]),g=!0)},p:function(B,O){var A=i;(i=$(B))!==A&&(Ee(),M(w[A],1,1,function(){w[A]=null}),Ae(),(o=w[i])||(o=w[i]=x[i](B)).c(),C(o,1),o.m(r,null)),_&&_.p&&(!v||8&O[1])&&Xn(_,S,B,B[34],v?Yn(S,B[34],O,lW):Zn(B[34]),lx),B[17]?F&&(F.d(1),F=null):F||((F=gx()).c(),F.m(t,l)),W===(W=I(B))&&D?D.p(B,O):(D.d(1),(D=W(B))&&(D.c(),D.m(u,null))),65922&O[0]&&(y=!B[8].readOnly&&B[16]&&B[7]&&(rn(B[7])||Cn(B[7]))&&!Xr(B[7])&&sn(lt(B[7]),B[1])),y?U?(U.p(B,O),65922&O[0]&&C(U,1)):((U=vx(B)).c(),C(U,1),U.m(t,null)):U&&(Ee(),M(U,1,1,function(){U=null}),Ae()),!B[15]||B[12]&&B[15].isChildError?q&&(Ee(),M(q,1,1,function(){q=null}),Ae()):q?(q.p(B,O),36864&O[0]&&C(q,1)):((q=yx(B)).c(),C(q,1),q.m(e,h)),K===(K=X(B))&&Y?Y.p(B,O):(Y&&Y.d(1),(Y=K&&K(B))&&(Y.c(),Y.m(e,null))),B[12]?T?(T.p(B,O),4096&O[0]&&C(T,1)):((T=bx(B)).c(),C(T,1),T.m(m.parentNode,m)):T&&(Ee(),M(T,1,1,function(){T=null}),Ae())},i:function(B){v||(C(o),C(_,B),C(U),C(q),C(T),v=!0)},o:function(B){M(o),M(_,B),M(U),M(q),M(T),v=!1},d:function(B){B&&(Z(e),Z(p),Z(m)),w[i].d(),_&&_.d(B),F&&F.d(),D.d(),U&&U.d(),q&&q.d(),Y&&Y.d(),T&&T.d(B),g=!1,b()}}}function dW(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y=!n[8].readOnly&&n[16]&&n[7]&&(rn(n[7])||Cn(n[7]))&&!Xr(n[7])&&sn(lt(n[7]),n[1]),x=[xW,wW],w=[];function $(B,O){return B[12]?0:1}i=$(n),o=w[i]=x[i](n);var S=n[33].identifier,_=Qn(S,n,n[34],fx),F=!n[17]&&$x();function I(B,O){return B[12]?$W:jW}var W=I(n),D=W(n),U=y&&kx(n),q=n[15]&&(!n[12]||!n[15].isChildError)&&Sx(n);function X(B,O){return B[12]?SW:kW}var K=X(n),Y=K(n),T=n[12]&&Cx(n);return{c:function(){e=V("div"),t=V("div"),r=V("button"),o.c(),s=ce(),_&&_.c(),a=ce(),F&&F.c(),l=ce(),c=V("div"),u=V("div"),D.c(),f=ce(),U&&U.c(),d=ce(),q&&q.c(),h=ce(),Y.c(),p=ce(),T&&T.c(),m=an(),j(r,"type","button"),j(r,"class","jse-expand svelte-6mjnsm"),j(r,"title","Expand or collapse this array (Ctrl+Click to expand/collapse recursively)"),j(u,"class","jse-meta-inner svelte-6mjnsm"),j(u,"data-type","selectable-value"),j(c,"class","jse-meta svelte-6mjnsm"),j(t,"class","jse-header svelte-6mjnsm"),j(e,"class","jse-header-outer svelte-6mjnsm")},m:function(B,O){ee(B,e,O),E(e,t),E(t,r),w[i].m(r,null),E(t,s),_&&_.m(t,null),E(t,a),F&&F.m(t,null),E(t,l),E(t,c),E(c,u),D.m(u,null),E(t,f),U&&U.m(t,null),E(e,d),q&&q.m(e,null),E(e,h),Y.m(e,null),ee(B,p,O),T&&T.m(B,O),ee(B,m,O),v=!0,g||(b=Ce(r,"click",n[20]),g=!0)},p:function(B,O){var A=i;(i=$(B))!==A&&(Ee(),M(w[A],1,1,function(){w[A]=null}),Ae(),(o=w[i])||(o=w[i]=x[i](B)).c(),C(o,1),o.m(r,null)),_&&_.p&&(!v||8&O[1])&&Xn(_,S,B,B[34],v?Yn(S,B[34],O,cW):Zn(B[34]),fx),B[17]?F&&(F.d(1),F=null):F||((F=$x()).c(),F.m(t,l)),W===(W=I(B))&&D?D.p(B,O):(D.d(1),(D=W(B))&&(D.c(),D.m(u,null))),65922&O[0]&&(y=!B[8].readOnly&&B[16]&&B[7]&&(rn(B[7])||Cn(B[7]))&&!Xr(B[7])&&sn(lt(B[7]),B[1])),y?U?(U.p(B,O),65922&O[0]&&C(U,1)):((U=kx(B)).c(),C(U,1),U.m(t,null)):U&&(Ee(),M(U,1,1,function(){U=null}),Ae()),!B[15]||B[12]&&B[15].isChildError?q&&(Ee(),M(q,1,1,function(){q=null}),Ae()):q?(q.p(B,O),36864&O[0]&&C(q,1)):((q=Sx(B)).c(),C(q,1),q.m(e,h)),K===(K=X(B))&&Y?Y.p(B,O):(Y.d(1),(Y=K(B))&&(Y.c(),Y.m(e,null))),B[12]?T?(T.p(B,O),4096&O[0]&&C(T,1)):((T=Cx(B)).c(),C(T,1),T.m(m.parentNode,m)):T&&(Ee(),M(T,1,1,function(){T=null}),Ae())},i:function(B){v||(C(o),C(_,B),C(U),C(q),C(T),v=!0)},o:function(B){M(o),M(_,B),M(U),M(q),M(T),v=!1},d:function(B){B&&(Z(e),Z(p),Z(m)),w[i].d(),_&&_.d(B),F&&F.d(),D.d(),U&&U.d(),q&&q.d(),Y.d(),T&&T.d(B),g=!1,b()}}}function dx(n){var e;return{c:function(){(e=V("div")).textContent=":",j(e,"class","jse-separator svelte-6mjnsm")},m:function(t,r){ee(t,e,r)},d:function(t){t&&Z(e)}}}function hx(n){var e,t,r;return t=new Gs({props:{selected:!0,onContextMenu:n[8].onContextMenu}}),{c:function(){e=V("div"),je(t.$$.fragment),j(e,"class","jse-context-menu-pointer-anchor svelte-6mjnsm")},m:function(i,o){ee(i,e,o),be(t,e,null),r=!0},p:function(i,o){var s={};256&o[0]&&(s.onContextMenu=i[8].onContextMenu),t.$set(s)},i:function(i){r||(C(t.$$.fragment,i),r=!0)},o:function(i){M(t.$$.fragment,i),r=!1},d:function(i){i&&Z(e),we(t)}}}function px(n){var e,t;return e=new Xl({props:{validationError:n[15],onExpand:n[21]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};32768&i[0]&&(o.validationError=r[15]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function mx(n){var e,t,r;return{c:function(){j(e=V("div"),"role","none"),j(e,"class","jse-insert-selection-area jse-after svelte-6mjnsm"),j(e,"data-type","insert-selection-area-after")},m:function(i,o){ee(i,e,o),t||(r=Ce(e,"click",n[29]),t=!0)},p:Te,d:function(i){i&&Z(e),t=!1,r()}}}function hW(n){var e,t;return e=new un({props:{data:$s}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function pW(n){var e,t;return e=new un({props:{data:Ri}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function gx(n){var e;return{c:function(){(e=V("div")).textContent=":",j(e,"class","jse-separator svelte-6mjnsm")},m:function(t,r){ee(t,e,r)},d:function(t){t&&Z(e)}}}function mW(n){var e,t,r,i,o,s,a,l,c,u,f=Object.keys(n[0]).length+"",d=Object.keys(n[0]).length===1?"prop":"props";return{c:function(){(e=V("div")).textContent="{",t=ce(),r=V("button"),i=De(f),o=ce(),s=De(d),a=ce(),(l=V("div")).textContent="}",j(e,"class","jse-bracket svelte-6mjnsm"),j(r,"type","button"),j(r,"class","jse-tag svelte-6mjnsm"),j(l,"class","jse-bracket svelte-6mjnsm")},m:function(h,p){ee(h,e,p),ee(h,t,p),ee(h,r,p),E(r,i),E(r,o),E(r,s),ee(h,a,p),ee(h,l,p),c||(u=Ce(r,"click",n[21]),c=!0)},p:function(h,p){1&p[0]&&f!==(f=Object.keys(h[0]).length+"")&>(i,f),1&p[0]&&d!==(d=Object.keys(h[0]).length===1?"prop":"props")&>(s,d)},d:function(h){h&&(Z(e),Z(t),Z(r),Z(a),Z(l)),c=!1,u()}}}function gW(n){var e;return{c:function(){(e=V("div")).textContent="{",j(e,"class","jse-bracket jse-expanded svelte-6mjnsm")},m:function(t,r){ee(t,e,r)},p:Te,d:function(t){t&&Z(e)}}}function vx(n){var e,t,r;return t=new Gs({props:{selected:!0,onContextMenu:n[8].onContextMenu}}),{c:function(){e=V("div"),je(t.$$.fragment),j(e,"class","jse-context-menu-pointer-anchor svelte-6mjnsm")},m:function(i,o){ee(i,e,o),be(t,e,null),r=!0},p:function(i,o){var s={};256&o[0]&&(s.onContextMenu=i[8].onContextMenu),t.$set(s)},i:function(i){r||(C(t.$$.fragment,i),r=!0)},o:function(i){M(t.$$.fragment,i),r=!1},d:function(i){i&&Z(e),we(t)}}}function yx(n){var e,t;return e=new Xl({props:{validationError:n[15],onExpand:n[21]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};32768&i[0]&&(o.validationError=r[15]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function vW(n){var e,t,r;return{c:function(){j(e=V("div"),"role","none"),j(e,"class","jse-insert-selection-area jse-after svelte-6mjnsm"),j(e,"data-type","insert-selection-area-after")},m:function(i,o){ee(i,e,o),t||(r=Ce(e,"click",n[29]),t=!0)},p:Te,d:function(i){i&&Z(e),t=!1,r()}}}function yW(n){var e,t,r;return{c:function(){j(e=V("div"),"role","none"),j(e,"class","jse-insert-selection-area jse-inside svelte-6mjnsm"),j(e,"data-type","insert-selection-area-inside")},m:function(i,o){ee(i,e,o),t||(r=Ce(e,"click",n[28]),t=!0)},p:Te,d:function(i){i&&Z(e),t=!1,r()}}}function bx(n){for(var e,t,r,i,o,s,a,l=!n[8].readOnly&&(n[10]===os||n[16]&&dr(n[7])),c=l&&wx(n),u=Mt(n[18](n[1],n[0],n[2],n[3],n[4],n[5],n[6],n[7],n[11])),f=[],d=0;d}',s=ce(),p&&p.c(),j(e,"class","jse-props svelte-6mjnsm"),j(o,"data-type","selectable-value"),j(o,"class","jse-footer svelte-6mjnsm"),j(i,"class","jse-footer-outer svelte-6mjnsm")},m:function(m,v){ee(m,e,v),c&&c.m(e,null),E(e,t);for(var g=0;g]',s=ce(),g&&g.c(),j(e,"class","jse-items svelte-6mjnsm"),j(o,"data-type","selectable-value"),j(o,"class","jse-footer svelte-6mjnsm"),j(i,"class","jse-footer-outer svelte-6mjnsm")},m:function(b,y){ee(b,e,y),f&&f.m(e,null),E(e,t);for(var x=0;x=st.start&&et<=st.end});if(!tn)return null;var Qt=tn.start,oe=tn.end;a4(Qt,Math.min(h.length,oe),function(st){return he(String(st))})}else Object.keys(h).forEach(he);return J}(x,a||Aa);if(S("dragSelectionStart",{selection:x,items:O}),O){var A=w.getJson();if(A!==void 0){var te=Go(A,x),R=O.findIndex(function(P){return sn(P.path,te)}),k=nm({json:A,documentState:w.getDocumentState(),deltaY:0,items:O}).offset;t(11,I={initialTarget:T.target,initialClientY:T.clientY,initialContentTop:q(),selectionStartIndex:R,selectionItemsCount:Ns(A,x).length,items:O,offset:k,didMoveItems:!1}),wr.dragging=!0,document.addEventListener("mousemove",K,!0),document.addEventListener("mouseup",Y)}}else S("Cannot drag the current selection (probably spread over multiple sections)")}else $(T)}},function(T){wr.selecting||wr.dragging||(T.stopPropagation(),da(T.target,"data-type","selectable-value")?t(10,_=Mg):da(T.target,"data-type","insert-selection-area-inside")?t(10,_=os):da(T.target,"data-type","insert-selection-area-after")&&t(10,_=uu),clearTimeout(F))},function(T){T.stopPropagation(),F=window.setTimeout(function(){return t(10,_=void 0)})},function(T){T.shiftKey||(T.stopPropagation(),T.preventDefault(),w.onSelect(us(p)))},function(T){T.shiftKey||(T.stopPropagation(),T.preventDefault(),w.onSelect(Zo(p)))},function(T){w.onSelect(us(p)),w.onContextMenu(T)},function(T){w.onSelect(Zo(p)),w.onContextMenu(T)},$,f,d]}var Y0=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,MW,OW,Tt,{value:0,path:1,expandedMap:2,enforceStringMap:3,visibleSectionsMap:4,validationErrorsMap:5,searchResultItemsMap:6,selection:7,context:8,onDragSelectionStart:32},sW,[-1,-1]),r}return ht(e,mt),ut(e)}(),EW=Y0,AW={prefix:"fas",iconName:"jsoneditor-expand",icon:[512,512,[],"","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"]},TW={prefix:"fas",iconName:"jsoneditor-collapse",icon:[512,512,[],"","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"]},Vg={prefix:"fas",iconName:"jsoneditor-format",icon:[512,512,[],"","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"]},PW={prefix:"fas",iconName:"jsoneditor-compact",icon:[512,512,[],"","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 _W(n){var e,t;return e=new rp({props:{items:n[0]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&At(i,1)[0]&&(o.items=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function RW(n,e,t){var r,i,o,s,a,l,c,u=e.json,f=e.selection,d=e.readOnly,h=e.showSearch,p=h!==void 0&&h,m=e.historyState,v=e.onExpandAll,g=e.onCollapseAll,b=e.onUndo,y=e.onRedo,x=e.onSort,w=e.onTransform,$=e.onContextMenu,S=e.onCopy,_=e.onRenderMenu;function F(){t(1,p=!p)}return n.$$set=function(I){"json"in I&&t(2,u=I.json),"selection"in I&&t(3,f=I.selection),"readOnly"in I&&t(4,d=I.readOnly),"showSearch"in I&&t(1,p=I.showSearch),"historyState"in I&&t(5,m=I.historyState),"onExpandAll"in I&&t(6,v=I.onExpandAll),"onCollapseAll"in I&&t(7,g=I.onCollapseAll),"onUndo"in I&&t(8,b=I.onUndo),"onRedo"in I&&t(9,y=I.onRedo),"onSort"in I&&t(10,x=I.onSort),"onTransform"in I&&t(11,w=I.onTransform),"onContextMenu"in I&&t(12,$=I.onContextMenu),"onCopy"in I&&t(13,S=I.onCopy),"onRenderMenu"in I&&t(14,_=I.onRenderMenu)},n.$$.update=function(){4&n.$$.dirty&&t(20,r=u!==void 0),1048584&n.$$.dirty&&t(19,i=r&&(Cn(f)||or(f)||rn(f))),68&n.$$.dirty&&t(15,s={type:"button",icon:AW,title:"Expand all",className:"jse-expand-all",onClick:v,disabled:!Wn(u)}),132&n.$$.dirty&&t(16,a={type:"button",icon:TW,title:"Collapse all",className:"jse-collapse-all",onClick:g,disabled:!Wn(u)}),4&n.$$.dirty&&t(17,l={type:"button",icon:kh,title:"Search (Ctrl+F)",className:"jse-search",onClick:F,disabled:u===void 0}),769844&n.$$.dirty&&t(18,c=d?[s,a,{type:"separator"},{type:"button",icon:Es,title:"Copy (Ctrl+C)",className:"jse-copy",onClick:S,disabled:!i},{type:"separator"},l,{type:"space"}]:[s,a,{type:"separator"},{type:"button",icon:$h,title:"Sort",className:"jse-sort",onClick:x,disabled:d||u===void 0},{type:"button",icon:xh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:w,disabled:d||u===void 0},l,{type:"button",icon:ek,title:I0,className:"jse-contextmenu",onClick:$},{type:"separator"},{type:"button",icon:dv,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:b,disabled:!m.canUndo},{type:"button",icon:fv,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:y,disabled:!m.canRedo},{type:"space"}]),278528&n.$$.dirty&&t(0,o=_(c))},[o,p,u,f,d,m,v,g,b,y,x,w,$,S,_,s,a,l,c,i,r]}var NW=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,RW,_W,Tt,{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 ht(e,mt),ut(e)}();function IW(n){Et(n,"svelte-s2toti",'.jse-welcome.svelte-s2toti.svelte-s2toti{flex:1;overflow:auto;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);display:flex;flex-direction:column;align-items:center;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-welcome.svelte-s2toti.svelte-s2toti:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-welcome.svelte-s2toti .jse-space.jse-before.svelte-s2toti{flex:1}.jse-welcome.svelte-s2toti .jse-space.jse-after.svelte-s2toti{flex:2}.jse-welcome.svelte-s2toti .jse-contents.svelte-s2toti{display:flex;flex-direction:column;max-width:300px;margin:2em var(--jse-padding, 10px);gap:var(--jse-padding, 10px)}.jse-welcome.svelte-s2toti .jse-contents .jse-welcome-info.svelte-s2toti{color:var(--jse-panel-color-readonly, #b2b2b2)}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}')}function _x(n){var e,t,r,i,o,s,a;return{c:function(){(e=V("div")).innerHTML="You can paste clipboard data using Ctrl+V, or use the following options:",t=ce(),(r=V("button")).textContent="Create object",i=ce(),(o=V("button")).textContent="Create array",j(e,"class","jse-welcome-info svelte-s2toti"),j(r,"title","Create an empty JSON object (press '{')"),j(r,"class","svelte-s2toti"),j(o,"title","Create an empty JSON array (press '[')"),j(o,"class","svelte-s2toti")},m:function(l,c){ee(l,e,c),ee(l,t,c),ee(l,r,c),ee(l,i,c),ee(l,o,c),s||(a=[Ce(r,"click",uo(n[4])),Ce(o,"click",uo(n[5]))],s=!0)},p:Te,d:function(l){l&&(Z(e),Z(t),Z(r),Z(i),Z(o)),s=!1,kn(a)}}}function DW(n){var e,t,r,i,o,s,a,l,c,u,f=!n[0]&&_x(n);return{c:function(){e=V("div"),t=V("div"),r=ce(),i=V("div"),(o=V("div")).textContent="Empty document",s=ce(),f&&f.c(),a=ce(),l=V("div"),j(t,"class","jse-space jse-before svelte-s2toti"),j(o,"class","jse-welcome-title"),j(i,"class","jse-contents svelte-s2toti"),j(l,"class","jse-space jse-after svelte-s2toti"),j(e,"class","jse-welcome svelte-s2toti"),j(e,"role","none")},m:function(d,h){ee(d,e,h),E(e,t),E(e,r),E(e,i),E(i,o),E(i,s),f&&f.m(i,null),E(e,a),E(e,l),c||(u=Ce(e,"click",n[6]),c=!0)},p:function(d,h){var p=At(h,1)[0];d[0]?f&&(f.d(1),f=null):f?f.p(d,p):((f=_x(d)).c(),f.m(i,null))},i:Te,o:Te,d:function(d){d&&Z(e),f&&f.d(),c=!1,u()}}}function LW(n,e,t){var r=e.readOnly,i=e.onCreateArray,o=e.onCreateObject,s=e.onClick;return n.$$set=function(a){"readOnly"in a&&t(0,r=a.readOnly),"onCreateArray"in a&&t(1,i=a.onCreateArray),"onCreateObject"in a&&t(2,o=a.onCreateObject),"onClick"in a&&t(3,s=a.onClick)},[r,i,o,s,function(){return o()},function(){return i()},function(){return s()}]}var BW=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,LW,DW,Tt,{readOnly:0,onCreateArray:1,onCreateObject:2,onClick:3},IW),r}return ht(e,mt),ut(e)}();function Hg(n,e){var t=typeof n=="string"?n.toLowerCase():n,r=typeof e=="string"?e.toLowerCase():e;return AT(t,r)}function r6(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(Nn(Ye(n,e))){if(t===void 0)throw new Error("Cannot sort: no property selected by which to sort the array");return function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,l=function(u,f){return function(d,h){var p=Ye(d,u),m=Ye(h,u);return p===void 0?f:m===void 0?-f:typeof p!="string"&&typeof m!="string"?p>m?f:p1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=Ye(i,o),l=Object.keys(a).slice();l.sort(function(h,p){return s*Hg(h,p)});for(var c=[],u=0;ujc&&Ix();return{c:function(){e=V("div");for(var f=0;fjc?u?u.p(f,h):((u=Ix()).c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Te,o:Te,d:function(f){f&&Z(e);for(var d=0;d0&&(s("scrollTo ",m),o.scrollTo({left:m,behavior:"smooth"}))}})},[a,u,f,r,o,d,i,function(m){s("get items for path",m);var v=Ye(a,m);if(Array.isArray(v))return G7(0,v.length).map(String);if(Rn(v)){var g=Object.keys(v).slice(0);return g.sort(Hg),g}return[]},function(m){return Ii(a,m)},h,function(){t(5,d=!d)},p,function(m){p(),h(m)},l,c,function(m){It[m?"unshift":"push"](function(){t(4,o=m)})}]}var nJ=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,tJ,eJ,Tt,{json:0,selection:13,onSelect:14,onError:1,pathParser:2},YW),r}return ht(e,mt),ut(e)}();function rJ(n){Et(n,"svelte-wnmp4a",'.jse-search-box.svelte-wnmp4a.svelte-wnmp4a{border:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7));border-radius:3px;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24));display:inline-block;width:400px;max-width:100%;overflow:auto}.jse-search-box.svelte-wnmp4a .jse-search-form.svelte-wnmp4a{display:flex;align-items:stretch}.jse-search-box.svelte-wnmp4a .jse-search-form button.svelte-wnmp4a,.jse-search-box.svelte-wnmp4a .jse-search-form input.svelte-wnmp4a{font-family:inherit;font-size:inherit}.jse-search-box.svelte-wnmp4a .jse-search-form button.svelte-wnmp4a{display:block;text-align:center;border:none;padding:0 5px;margin:0;cursor:pointer;color:var(--jse-panel-button-color, inherit);background:var(--jse-panel-button-background, transparent)}.jse-search-box.svelte-wnmp4a .jse-search-form button.svelte-wnmp4a:hover{color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-search-box.svelte-wnmp4a .jse-search-form input.svelte-wnmp4a{color:var(--jse-panel-color, var(--jse-text-color, #4d4d4d));border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:3px;background:var(--jse-input-background, var(--jse-background-color, #fff));height:28px;padding:0 5px;margin:0;flex:1;width:0;min-width:50px;outline:none}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-replace-toggle.svelte-wnmp4a{padding:var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px));min-width:20px;background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents.svelte-wnmp4a{flex:1;display:flex;flex-direction:column;padding:calc(0.5 * var(--jse-padding, 10px));gap:calc(0.5 * var(--jse-padding, 10px))}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section.svelte-wnmp4a{flex:1;display:flex;align-items:center;position:relative}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section .jse-search-icon.svelte-wnmp4a{color:inherit;cursor:inherit;background:inherit;width:32px;text-align:center}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section label.jse-search-input-label.svelte-wnmp4a{flex:1;display:flex}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.svelte-wnmp4a{color:inherit;font-size:80%;visibility:hidden;padding:0 5px;min-width:36px;text-align:center}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.jse-visible.svelte-wnmp4a{visibility:visible}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-replace-section.svelte-wnmp4a{padding-left:32px;flex:1;display:flex}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-replace-section button.svelte-wnmp4a{width:auto}')}function Hx(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D,U=(n[7]!==-1&&n[7]=v2?"".concat(999,"+"):String(r)),71303168&n.$$.dirty[0]&&m(s),2&n.$$.dirty[0]&&function(he){O.apply(this,arguments)}(f),8&n.$$.dirty[0]&&S(y),262144&n.$$.dirty[0]&&_(l)},[d,f,h,y,r,w,$,i,o,F,function(H){H.stopPropagation();var J=ss(H);J==="Enter"&&(H.preventDefault(),y!==x?(S.flush(),x=y):q()),J==="Shift+Enter"&&(H.preventDefault(),K()),J==="Ctrl+Enter"&&(H.preventDefault(),d?W():q()),J==="Ctrl+H"&&(H.preventDefault(),F()),J==="Escape"&&(H.preventDefault(),P())},function(H){ss(H)==="Enter"&&(H.preventDefault(),H.stopPropagation(),W())},function(){return I.apply(this,arguments)},W,function(){return U.apply(this,arguments)},q,K,P,l,c,u,p,m,v,g,b,s,function(){y=this.value,t(3,y)},function(){w=this.value,t(5,w)}]}var o6=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,lJ,sJ,Tt,{json:18,documentState:19,parser:20,showSearch:1,showReplace:0,readOnly:2,columns:21,onSearch:22,onFocus:23,onPatch:24,onClose:25},rJ,[-1,-1]),r}return ht(e,mt),ut(e)}(),gu=Symbol("path");function cJ(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,r={};Array.isArray(n)&&function(o,s,a){if(o.length1?(o.length-1)/(s-1):o.length,c=0;c6&&arguments[6]!==void 0?arguments[6]:80,a=Nn(t)?t.length:0,l=function(b,y){var x=Object.values(b);if(hn(x))return y;var w=function($,S){return $+S};return x.reduce(w)/x.length}(r,i),c=n-s,u=e+2*s,f=function(b){return r[b]||i},d=0,h=o;h0&&(h-=f(--d));for(var p=d,m=0;m0?a-1:void 0,d=f!==void 0?Ut(ha({rowIndex:f,columnIndex:l},r),!1):null;return Gr("remove row new selection",{rowIndex:a,newRowIndex:f,newSelection:d}),{state:fe(fe({},u),{},{selection:d})}})}}function oh(n){var e=n.insertType,t=n.selectInside,r=n.refJsonEditor,i=n.json,o=n.selection,s=n.readOnly,a=n.parser,l=n.onPatch,c=n.onReplaceJson;if(!s){var u=function(m,v,g){if(g==="object")return{};if(g==="array")return[];if(g==="structure"&&m!==void 0){var b=v?A4(v):[],y=Ye(m,b);if(Array.isArray(y)&&!hn(y)){var x=Qo(y);return Wn(x)?wA(x,function(w){return Array.isArray(w)?[]:Rn(w)?void 0:""}):""}}return""}(i,o,e);if(i!==void 0){var f=a.stringify(u),d=N4(i,o,f,a);Gr("onInsert",{insertType:e,operations:d,newValue:u,data:f});var h=en(d.filter(function(m){return m.op==="add"||m.op==="replace"}));l(d,function(m,v){if(h){var g=Eo(m,h.path);if(Wn(u))return{state:fe(fe({},Ti(m,v,g,zc)),{},{selection:t?us(g):v.selection})};if(u===""){var b=hn(g)?null:Ye(m,on(g));return{state:_g(m,fe(fe({},v),{},{selection:Rn(b)?zi(g,!0):Ut(g,!0)}),g)}}}}),Gr("after patch"),h&&u===""&&sh(function(){return Gd(r,"",!0,ah)})}else{Gr("onInsert",{insertType:e,newValue:u});var p=[];c(u,function(m,v){return{state:fe(fe({},js(m,v,p)),{},{selection:Wn(u)?us(p):Ut(p,!0)})}})}}}function d6(n){return Jg.apply(this,arguments)}function Jg(){return Jg=$t(Pe().mark(function n(e){var t,r,i,o,s,a,l,c,u,f,d,h;return Pe().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(t=e.char,r=e.selectInside,i=e.refJsonEditor,o=e.json,s=e.selection,a=e.readOnly,l=e.parser,c=e.onPatch,u=e.onReplaceJson,f=e.onSelect,!a){p.next=3;break}return p.abrupt("return");case 3:if(!or(s)){p.next=8;break}return d=!s.edit,f(fe(fe({},s),{},{edit:!0})),sh(function(){return Gd(i,t,d,ah)}),p.abrupt("return");case 8:if(t!=="{"){p.next=12;break}oh({insertType:"object",selectInside:r,refJsonEditor:i,json:o,selection:s,readOnly:a,parser:l,onPatch:c,onReplaceJson:u}),p.next=23;break;case 12:if(t!=="["){p.next=16;break}oh({insertType:"array",selectInside:r,refJsonEditor:i,json:o,selection:s,readOnly:a,parser:l,onPatch:c,onReplaceJson:u}),p.next=23;break;case 16:if(!rn(s)||o===void 0){p.next=20;break}Wn(Ye(o,s.path))||(h=!s.edit,f(fe(fe({},s),{},{edit:!0})),sh(function(){return Gd(i,t,h,ah)})),p.next=23;break;case 20:return Gr("onInsertValueWithCharacter",{char:t}),p.next=23,yJ({char:t,refJsonEditor:i,json:o,selection:s,readOnly:a,parser:l,onPatch:c,onReplaceJson:u});case 23:case"end":return p.stop()}},n)})),Jg.apply(this,arguments)}function yJ(n){return Kg.apply(this,arguments)}function Kg(){return Kg=$t(Pe().mark(function n(e){var t,r,i,o,s,a,l,c,u;return Pe().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(t=e.char,r=e.refJsonEditor,i=e.json,o=e.selection,s=e.readOnly,a=e.parser,l=e.onPatch,c=e.onReplaceJson,!s){f.next=3;break}return f.abrupt("return");case 3:oh({insertType:"value",selectInside:!1,refJsonEditor:r,json:i,selection:o,readOnly:s,parser:a,onPatch:l,onReplaceJson:c}),u=!Xr(o),sh(function(){return Gd(r,t,u,ah)});case 6:case"end":return f.stop()}},n)})),Kg.apply(this,arguments)}function sh(n){setTimeout(function(){return setTimeout(n)})}function ah(n){n==null||n.refresh()}function bJ(n){Et(n,"svelte-l2z0i3",'.jse-json-preview.svelte-l2z0i3{flex:1;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-panel-color-readonly, #b2b2b2);overflow:auto;white-space:pre-wrap;padding:2px;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}')}function wJ(n){var e,t;return{c:function(){e=V("div"),t=De(n[0]),j(e,"class","jse-json-preview svelte-l2z0i3")},m:function(r,i){ee(r,e,i),E(e,t)},p:function(r,i){1&At(i,1)[0]&>(t,r[0])},i:Te,o:Te,d:function(r){r&&Z(e)}}}function xJ(n,e,t){var r,i,o=e.text,s=e.json,a=e.indentation,l=e.parser;return n.$$set=function(c){"text"in c&&t(1,o=c.text),"json"in c&&t(2,s=c.json),"indentation"in c&&t(3,a=c.indentation),"parser"in c&&t(4,l=c.parser)},n.$$.update=function(){6&n.$$.dirty&&t(5,r=s!==void 0?{json:s}:{text:o||""}),56&n.$$.dirty&&t(0,i=as(Tg(r,a,l),Cg))},[i,o,s,a,l,r]}var h6=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,xJ,wJ,yr,{text:1,json:2,indentation:3,parser:4},bJ),r}return ht(e,mt),ut(e)}();function jJ(n){Et(n,"svelte-szeu2l",'button.jse-context-menu-button.svelte-szeu2l{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;flex:1;white-space:nowrap;padding:var(--jse-padding, 10px);color:inherit}button.jse-context-menu-button.svelte-szeu2l:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}button.jse-context-menu-button.svelte-szeu2l:focus{background:var(--jse-context-menu-background-highlight, #7a7a7a);z-index:1}button.jse-context-menu-button.svelte-szeu2l:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}button.jse-context-menu-button.left.svelte-szeu2l{text-align:left}button.jse-context-menu-button.svelte-szeu2l svg{width:16px}')}function Kx(n){var e,t;return e=new un({props:{data:n[0].icon}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.data=r[0].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Gx(n){var e,t=n[0].text+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){1&i&&t!==(t=r[0].text+"")&>(e,t)},d:function(r){r&&Z(e)}}}function $J(n){var e,t,r,i,o,s,a,l,c=n[0].icon&&Kx(n),u=n[0].text&&Gx(n);return{c:function(){e=V("button"),c&&c.c(),t=ce(),u&&u.c(),j(e,"type","button"),j(e,"class",r=Vn(Bo("jse-context-menu-button",n[1],n[0].className))+" svelte-szeu2l"),j(e,"title",i=n[0].title),e.disabled=o=n[0].disabled||!1},m:function(f,d){ee(f,e,d),c&&c.m(e,null),E(e,t),u&&u.m(e,null),s=!0,a||(l=Ce(e,"click",n[3]),a=!0)},p:function(f,d){var h=At(d,1)[0];f[0].icon?c?(c.p(f,h),1&h&&C(c,1)):((c=Kx(f)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae()),f[0].text?u?u.p(f,h):((u=Gx(f)).c(),u.m(e,null)):u&&(u.d(1),u=null),(!s||3&h&&r!==(r=Vn(Bo("jse-context-menu-button",f[1],f[0].className))+" svelte-szeu2l"))&&j(e,"class",r),(!s||1&h&&i!==(i=f[0].title))&&j(e,"title",i),(!s||1&h&&o!==(o=f[0].disabled||!1))&&(e.disabled=o)},i:function(f){s||(C(c),s=!0)},o:function(f){M(c),s=!1},d:function(f){f&&Z(e),c&&c.d(),u&&u.d(),a=!1,l()}}}function kJ(n,e,t){var r=e.item,i=e.className,o=i===void 0?void 0:i,s=e.onRequestClose;return n.$$set=function(a){"item"in a&&t(0,r=a.item),"className"in a&&t(1,o=a.className),"onRequestClose"in a&&t(2,s=a.onRequestClose)},[r,o,s,function(a){s(),r.onClick(a)}]}var e1=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,kJ,$J,yr,{item:0,className:1,onRequestClose:2},jJ),r}return ht(e,mt),ut(e)}();function SJ(n){Et(n,"svelte-9i012w",'.jse-dropdown-button.svelte-9i012w.svelte-9i012w{flex:1;line-height:normal;border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;position:relative;padding:0;display:flex}.jse-dropdown-button.svelte-9i012w ul.svelte-9i012w{margin:0;padding:0}.jse-dropdown-button.svelte-9i012w ul li.svelte-9i012w{margin:0;padding:0;list-style-type:none}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:2em;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));border-radius:0}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.jse-visible.svelte-9i012w{background:var(--jse-context-menu-background, #656565)}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:focus{z-index:1}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items.svelte-9i012w{display:none;position:absolute;top:100%;left:0;z-index:1;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items.jse-visible.svelte-9i012w{display:block}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:100%;text-align:left;padding:var(--jse-padding, 10px);margin:0}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}')}function Qx(n,e,t){var r=n.slice();return r[11]=e[t],r}var CJ=function(n){return{}},Yx=function(n){return{}};function Xx(n){var e,t;return e=new un({props:{data:n[11].icon}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.data=r[11].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Zx(n){var e,t,r,i,o,s,a,l,c,u,f,d=n[11].text+"",h=n[11].icon&&Xx(n);function p(){for(var m,v=arguments.length,g=new Array(v),b=0;b
loading...
',j(e,"class","jse-contents svelte-1ig7ktu")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function tK(n){var e,t,r,i,o,s,a,l,c,u=[rK,nK],f=[];function d(h,p){return h[11]===void 0?0:1}return i=d(n),o=f[i]=u[i](n),{c:function(){e=V("label"),t=V("input"),r=ce(),o.c(),s=an(),j(t,"type","text"),t.readOnly=!0,j(t,"tabindex","-1"),j(t,"class","jse-hidden-input svelte-1ig7ktu"),j(e,"class","jse-hidden-input-label")},m:function(h,p){ee(h,e,p),E(e,t),n[76](t),ee(h,r,p),f[i].m(h,p),ee(h,s,p),a=!0,l||(c=Ce(t,"paste",n[31]),l=!0)},p:function(h,p){var m=i;(i=d(h))===m?f[i].p(h,p):(Ee(),M(f[m],1,1,function(){f[m]=null}),Ae(),(o=f[i])?o.p(h,p):(o=f[i]=u[i](h)).c(),C(o,1),o.m(s.parentNode,s))},i:function(h){a||(C(o),a=!0)},o:function(h){M(o),a=!1},d:function(h){h&&(Z(e),Z(r),Z(s)),n[76](null),f[i].d(h),l=!1,c()}}}function nK(n){var e,t,r,i,o,s,a,l,c,u,f;r=new o6({props:{json:n[11],documentState:n[12],parser:n[3],showSearch:n[13],showReplace:n[21],readOnly:n[0],columns:void 0,onSearch:n[26],onFocus:n[27],onPatch:n[37],onClose:n[28]}}),s=new EW({props:{value:n[11],path:[],expandedMap:n[12].expandedMap,enforceStringMap:n[12].enforceStringMap,visibleSectionsMap:n[12].visibleSectionsMap,validationErrorsMap:n[24],searchResultItemsMap:(e=n[20])===null||e===void 0?void 0:e.itemsMap,selection:n[12].selection,context:n[15],onDragSelectionStart:Cr}});var d=n[19]&&uj(n),h=n[23]&&fj(n);return u=new G0({props:{validationErrors:n[14],selectError:n[29]}}),{c:function(){t=V("div"),je(r.$$.fragment),i=ce(),o=V("div"),je(s.$$.fragment),a=ce(),d&&d.c(),l=ce(),h&&h.c(),c=ce(),je(u.$$.fragment),j(t,"class","jse-search-box-container svelte-1ig7ktu"),j(o,"class","jse-contents svelte-1ig7ktu"),j(o,"data-jsoneditor-scrollable-contents",!0)},m:function(p,m){ee(p,t,m),be(r,t,null),ee(p,i,m),ee(p,o,m),be(s,o,null),n[80](o),ee(p,a,m),d&&d.m(p,m),ee(p,l,m),h&&h.m(p,m),ee(p,c,m),be(u,p,m),f=!0},p:function(p,m){var v,g={};2048&m[0]&&(g.json=p[11]),4096&m[0]&&(g.documentState=p[12]),8&m[0]&&(g.parser=p[3]),8192&m[0]&&(g.showSearch=p[13]),2097152&m[0]&&(g.showReplace=p[21]),1&m[0]&&(g.readOnly=p[0]),r.$set(g);var b={};2048&m[0]&&(b.value=p[11]),4096&m[0]&&(b.expandedMap=p[12].expandedMap),4096&m[0]&&(b.enforceStringMap=p[12].enforceStringMap),4096&m[0]&&(b.visibleSectionsMap=p[12].visibleSectionsMap),16777216&m[0]&&(b.validationErrorsMap=p[24]),1048576&m[0]&&(b.searchResultItemsMap=(v=p[20])===null||v===void 0?void 0:v.itemsMap),4096&m[0]&&(b.selection=p[12].selection),32768&m[0]&&(b.context=p[15]),s.$set(b),p[19]?d?(d.p(p,m),524288&m[0]&&C(d,1)):((d=uj(p)).c(),C(d,1),d.m(l.parentNode,l)):d&&(Ee(),M(d,1,1,function(){d=null}),Ae()),p[23]?h?(h.p(p,m),8388608&m[0]&&C(h,1)):((h=fj(p)).c(),C(h,1),h.m(c.parentNode,c)):h&&(Ee(),M(h,1,1,function(){h=null}),Ae());var y={};16384&m[0]&&(y.validationErrors=p[14]),u.$set(y)},i:function(p){f||(C(r.$$.fragment,p),C(s.$$.fragment,p),C(d),C(h),C(u.$$.fragment,p),f=!0)},o:function(p){M(r.$$.fragment,p),M(s.$$.fragment,p),M(d),M(h),M(u.$$.fragment,p),f=!1},d:function(p){p&&(Z(t),Z(i),Z(o),Z(a),Z(l),Z(c)),we(r),we(s),n[80](null),d&&d.d(p),h&&h.d(p),we(u,p)}}}function rK(n){var e,t,r,i,o=[oK,iK],s=[];function a(l,c){return l[18]===""||l[18]===void 0?0:1}return e=a(n),t=s[e]=o[e](n),{c:function(){t.c(),r=an()},m:function(l,c){s[e].m(l,c),ee(l,r,c),i=!0},p:function(l,c){var u=e;(e=a(l))===u?s[e].p(l,c):(Ee(),M(s[u],1,1,function(){s[u]=null}),Ae(),(t=s[e])?t.p(l,c):(t=s[e]=o[e](l)).c(),C(t,1),t.m(r.parentNode,r))},i:function(l){i||(C(t),i=!0)},o:function(l){M(t),i=!1},d:function(l){l&&Z(r),s[e].d(l)}}}function uj(n){var e,t;return e=new po({props:{type:"info",message:"You pasted a JSON ".concat(Array.isArray(n[19].contents)?"array":"object"," as text"),actions:[{icon:jh,text:"Paste as JSON instead",title:"Replace the value with the pasted JSON",onMouseDown:n[44]},{text:"Leave as is",title:"Keep the JSON embedded in the value",onClick:n[45]}]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};524288&i[0]&&(o.message="You pasted a JSON ".concat(Array.isArray(r[19].contents)?"array":"object"," as text")),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function fj(n){var e,t;return e=new po({props:{type:"success",message:"The loaded JSON document was invalid but is successfully repaired.",actions:n[0]?[]:[{icon:Uc,text:"Ok",title:"Accept the repaired document",onClick:n[8]},{icon:Ls,text:"Repair manually instead",title:"Leave the document unchanged and repair it manually instead",onClick:n[46]}],onClose:n[9]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i[0]&&(o.actions=r[0]?[]:[{icon:Uc,text:"Ok",title:"Accept the repaired document",onClick:r[8]},{icon:Ls,text:"Repair manually instead",title:"Leave the document unchanged and repair it manually instead",onClick:r[46]}]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function iK(n){var e,t,r,i;return e=new po({props:{type:"error",message:"The loaded JSON document is invalid and could not be repaired automatically.",actions:n[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:n[46]}]}}),r=new h6({props:{text:n[18],json:n[11],indentation:n[5],parser:n[3]}}),{c:function(){je(e.$$.fragment),t=ce(),je(r.$$.fragment)},m:function(o,s){be(e,o,s),ee(o,t,s),be(r,o,s),i=!0},p:function(o,s){var a={};1&s[0]&&(a.actions=o[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:o[46]}]),e.$set(a);var l={};262144&s[0]&&(l.text=o[18]),2048&s[0]&&(l.json=o[11]),32&s[0]&&(l.indentation=o[5]),8&s[0]&&(l.parser=o[3]),r.$set(l)},i:function(o){i||(C(e.$$.fragment,o),C(r.$$.fragment,o),i=!0)},o:function(o){M(e.$$.fragment,o),M(r.$$.fragment,o),i=!1},d:function(o){o&&Z(t),we(e,o),we(r,o)}}}function oK(n){var e,t;return e=new BW({props:{readOnly:n[0],onCreateObject:n[77],onCreateArray:n[78],onClick:n[79]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i[0]&&(o.readOnly=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function sK(n){var e,t,r,i,o,s,a,l,c=n[1]&&lj(n),u=n[2]&&cj(n),f=[tK,eK],d=[];return i=function(h,p){return h[25]?1:0}(n),o=d[i]=f[i](n),{c:function(){e=V("div"),c&&c.c(),t=ce(),u&&u.c(),r=ce(),o.c(),j(e,"role","tree"),j(e,"tabindex","-1"),j(e,"class","jse-tree-mode svelte-1ig7ktu"),$e(e,"no-main-menu",!n[1])},m:function(h,p){ee(h,e,p),c&&c.m(e,null),E(e,t),u&&u.m(e,null),E(e,r),d[i].m(e,null),n[81](e),s=!0,a||(l=[Ce(XJ,"mousedown",n[48]),Ce(e,"keydown",n[40]),Ce(e,"mousedown",n[41]),Ce(e,"contextmenu",n[42])],a=!0)},p:function(h,p){h[1]?c?(c.p(h,p),2&p[0]&&C(c,1)):((c=lj(h)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae()),h[2]?u?(u.p(h,p),4&p[0]&&C(u,1)):((u=cj(h)).c(),C(u,1),u.m(e,r)):u&&(Ee(),M(u,1,1,function(){u=null}),Ae()),o.p(h,p),(!s||2&p[0])&&$e(e,"no-main-menu",!h[1])},i:function(h){s||(C(c),C(u),C(o),s=!0)},o:function(h){M(c),M(u),M(o),s=!1},d:function(h){h&&Z(e),c&&c.d(),u&&u.d(),d[i].d(),n[81](null),a=!1,kn(l)}}}function aK(n,e,t){var r,i=Sr("jsoneditor:TreeMode"),o=typeof window=="undefined";i("isSSR:",o);var s,a,l,c,u,f=Er("simple-modal").open,d=Cl(),h=Cl(),p=Er("absolute-popup"),m=p.openAbsolutePopup,v=p.closeAbsolutePopup,g=!1,b=Q4(),y=e.readOnly,x=e.externalContent,w=e.externalSelection,$=e.mainMenuBar,S=e.navigationBar,_=e.escapeControlCharacters,F=e.escapeUnicodeCharacters,I=e.parser,W=e.parseMemoizeOne,D=e.validator,U=e.validationParser,q=e.pathParser,X=e.indentation,K=e.onError,Y=e.onChange,T=e.onChangeMode,B=e.onSelect,O=e.onRenderValue,A=e.onRenderMenu,te=e.onRenderContextMenu,R=e.onClassName,k=e.onFocus,P=e.onBlur,H=e.onSortModal,J=e.onTransformModal,he=e.onJSONEditorModal,Se=!1;K0({onMount:Hi,onDestroy:Mi,getWindow:function(){return Ql(l)},hasFocus:function(){return Se&&document.hasFocus()||F0(l)},onFocus:function(){g=!0,k&&k()},onBlur:function(){g=!1,P&&P()}});var pe=void 0;function ae(z){i("updateSelection",z);var le=typeof z=="function"?z(oe.selection)||null:z;sn(le,oe.selection)||(t(12,oe=fe(fe({},oe),{},{selection:le})),B(le))}var Qe,et,tn,Qt=!1,oe=Yd(),st=!1,Ht=!1;function qe(){return(qe=$t(Pe().mark(function z(le){return Pe().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return t(12,oe=fe(fe({},_g(c,oe,le)),{},{selection:null})),xe.next=3,Nt(le);case 3:case"end":return xe.stop()}},z)}))).apply(this,arguments)}var Dt=Y4({onChange:function(z){t(22,He=z)}}),He=Dt.getState(),wt,Oe,Xe=!1,nn=[],L=wu(X4);function ne(z,le,xe,Me){al(function(){var Ne;try{Ne=L(z,le,xe,Me)}catch(Le){Ne=[{path:[],message:"Failed to validate: "+Le.message,severity:oo.warning}]}sn(Ne,nn)||(i("validationErrors changed:",Ne),t(14,nn=Ne))},function(Ne){return i("validationErrors updated in ".concat(Ne," ms"))})}function se(){return i("validate"),pe?{parseError:pe,isRepairable:!1}:(ne(c,D,I,U),hn(nn)?null:{validationErrors:nn})}function ge(){return c}function ke(){return oe}function Re(z){fu(z)?function(le){if(le!==void 0){var xe=!sn(c,le);if(i("update external json",{isChanged:xe,currentlyText:c===void 0}),!!xe){var Me=oe,Ne=c,Le=u,bt=Xe;t(11,c=le),at(c),t(18,u=void 0),t(23,Xe=!1),pe=void 0,rt(c),Xt({previousJson:Ne,previousState:Me,previousText:Le,previousTextIsRepaired:bt})}}}(z.json):Il(z)&&function(le){if(!(le===void 0||fu(x))){var xe=le!==u;if(i("update external text",{isChanged:xe}),!!xe){var Me=c,Ne=oe,Le=u,bt=Xe;try{t(11,c=W(le)),at(c),t(18,u=le),t(23,Xe=!1),pe=void 0}catch(nt){try{t(11,c=W(Ao(le))),at(c),t(18,u=le),t(23,Xe=!0),pe=void 0,rt(c)}catch{t(11,c=void 0),t(18,u=x.text),t(23,Xe=!1),pe=u!==void 0&&u!==""?Nl(u,nt.message||String(nt)):void 0}}rt(c),Xt({previousJson:Me,previousState:Ne,previousText:Le,previousTextIsRepaired:bt})}}}(z.text)}function at(z){Qt||(Qt=!0,t(12,oe=Ti(z,oe,[],function(le){return f4({json:le},o4)?So:zc}(z))))}function rt(z){oe.selection&&(Ii(z,ma(oe.selection))&&Ii(z,lt(oe.selection))||(i("clearing selection: path does not exist anymore",oe.selection),t(12,oe=fe(fe({},oe),{},{selection:Ja(z,oe)}))))}function Xt(z){var le=z.previousJson,xe=z.previousState,Me=z.previousText,Ne=z.previousTextIsRepaired;le===void 0&&Me===void 0||(c!==void 0?le!==void 0?Dt.add({undo:{patch:[{op:"replace",path:"",value:le}],state:Hr(xe),json:void 0,text:Me,textIsRepaired:Ne},redo:{patch:[{op:"replace",path:"",value:c}],state:Hr(oe),json:void 0,text:u,textIsRepaired:Xe}}):Dt.add({undo:{patch:void 0,json:void 0,text:Me,state:Hr(xe),textIsRepaired:Ne},redo:{patch:void 0,json:c,state:Hr(oe),text:u,textIsRepaired:Xe}}):le!==void 0&&Dt.add({undo:{patch:void 0,json:le,state:Hr(xe),text:Me,textIsRepaired:Ne},redo:{patch:void 0,json:void 0,text:u,textIsRepaired:Xe,state:Hr(oe)}}))}function Zt(z,le){if(i("patch",z,le),c===void 0)throw new Error("Cannot apply patch: no JSON");var xe=c,Me=oe,Ne=u,Le=Xe,bt=D4(c,z),nt=C4(c,oe,z),yt=Ll(c,z),tr=function(qr,Ft){return Ft||!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?fe(fe({},qr),{},{selection:Ft}):qr}(nt.documentState,yt,!1);i("patch updatedSelection",yt);var Tn=typeof le=="function"?le(nt.json,tr):void 0;t(11,c=Tn&&Tn.json!==void 0?Tn.json:nt.json);var nr=Tn&&Tn.state!==void 0?Tn.state:tr;return t(12,oe=nr),t(18,u=void 0),t(23,Xe=!1),t(19,et=void 0),pe=void 0,rt(c),Dt.add({undo:{patch:bt,json:void 0,text:Ne,state:Hr(Me),textIsRepaired:Le},redo:{patch:z,json:void 0,state:Hr(nr),text:u,textIsRepaired:Xe}}),{json:c,previousJson:xe,undo:bt,redo:z}}function Wt(){!y&&oe.selection&&ae(zi(lt(oe.selection),!0))}function Ge(){if(!y&&oe.selection){var z=lt(oe.selection),le=Ye(c,z);Wn(le)?function(xe,Me){i("openJSONEditorModal",{path:xe,value:Me}),Se=!0,he({content:{json:Me},path:xe,onPatch:Oe.onPatch,onClose:function(){Se=!1,Fe()}})}(z,le):ae(Ut(z,!0))}}function On(){if(!y&&rn(oe.selection)){var z=lt(oe.selection),le=Ue(z),xe=Ye(c,z),Me=!ls(xe,oe.enforceStringMap,le,I),Ne=Me?String(xe):Gl(String(xe),I);i("handleToggleEnforceString",{enforceString:Me,value:xe,updatedValue:Ne}),Jt([{op:"replace",path:le,value:Ne}],function(Le,bt){return{state:S4(bt,le,Me)}})}}function zn(){return Pt.apply(this,arguments)}function Pt(){return Pt=$t(Pe().mark(function z(){var le,xe=arguments;return Pe().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return le=!(xe.length>0&&xe[0]!==void 0)||xe[0],Me.next=3,l6({json:c,documentState:oe,indentation:le?X:void 0,readOnly:y,parser:I,onPatch:Jt});case 3:case"end":return Me.stop()}},z)})),Pt.apply(this,arguments)}function Mn(){return Dn.apply(this,arguments)}function Dn(){return Dn=$t(Pe().mark(function z(){var le,xe=arguments;return Pe().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(le=!(xe.length>0&&xe[0]!==void 0)||xe[0],c!==void 0){Me.next=3;break}return Me.abrupt("return");case 3:return Me.next=5,c6({json:c,documentState:oe,indentation:le?X:void 0,parser:I});case 5:case"end":return Me.stop()}},z)})),Dn.apply(this,arguments)}function er(){f(Z4,{},fe(fe({},Ta),{},{styleWindow:{width:"450px"}}),{onClose:function(){return Fe()}})}function fn(z,le){f(n6,{text:z,onParse:function(xe){return Jh(xe,function(Me){return _u(Me,I)})},onRepair:c4,onApply:le},fe(fe({},Ta),{},{styleWindow:{width:"600px",height:"500px"},styleContent:{padding:0,height:"100%"}}),{onClose:function(){return Fe()}})}function me(){f6({json:c,text:u,documentState:oe,keepSelection:!1,readOnly:y,onChange:Y,onPatch:Jt})}function Be(){!y&&c!==void 0&&oe.selection&&Yl&&!hn(lt(oe.selection))&&(i("duplicate",{selection:oe.selection}),Jt(R4(c,Ns(c,oe.selection))))}function St(){if(!y&&oe.selection&&(Cn(oe.selection)||rn(oe.selection))&&!hn(lt(oe.selection))){i("extract",{selection:oe.selection});var z=function(le,xe){if(rn(xe))return[{op:"move",from:Ue(xe.path),path:""}];if(!Cn(xe))throw new Error("Cannot create extract operations: parent must be an Object or Array");var Me=on(xe.focusPath),Ne=Ye(le,Me);if(Nn(Ne))return[{op:"replace",path:"",value:Ns(le,xe).map(function(bt){var nt=zr(en(bt));return Ne[nt]})}];if(Gn(Ne)){var Le={};return Ns(le,xe).forEach(function(bt){var nt=String(en(bt));Le[nt]=Ne[nt]}),[{op:"replace",path:"",value:Le}]}throw new Error("Cannot extract: unsupported type of selection "+JSON.stringify(xe))}(c,oe.selection);Jt(z,function(le,xe){if(Wn(le))return{state:js(le,xe,[])}})}}function Lt(z){oh({insertType:z,selectInside:!0,refJsonEditor:l,json:c,selection:oe.selection,readOnly:y,parser:I,onPatch:Jt,onReplaceJson:Ot})}function _t(z){or(oe.selection)&&ae(Ut(oe.selection.path,!1)),oe.selection||ae(Ja(c,oe)),Lt(z)}function Yt(z){if(!y&&oe.selection)if(_f(oe.selection))try{var le=ma(oe.selection),xe=Ye(c,le),Me=function(Le,bt,nt){if(bt==="array"){if(Array.isArray(Le))return Le;if(Rn(Le))return w2(Le);if(typeof Le=="string")try{var yt=nt.parse(Le);if(Array.isArray(yt))return yt;if(Rn(yt))return w2(yt)}catch{return[Le]}return[Le]}if(bt==="object"){if(Array.isArray(Le))return b2(Le);if(Rn(Le))return Le;if(typeof Le=="string")try{var tr=nt.parse(Le);if(Rn(tr))return tr;if(Array.isArray(tr))return b2(tr)}catch{return{value:Le}}return{value:Le}}if(bt==="value")return Wn(Le)?nt.stringify(Le):Le;throw new Error("Cannot convert ".concat(L0(Le,nt)," to ").concat(bt))}(xe,z,I);if(Me===xe)return;var Ne=[{op:"replace",path:Ue(le),value:Me}];i("handleConvert",{selection:oe.selection,path:le,type:z,operations:Ne}),Jt(Ne,function(Le,bt){return{state:oe.selection?js(Le,bt,lt(oe.selection)):oe}})}catch(Le){K(Le)}else K(new Error("Cannot convert current selection to ".concat(z)))}function de(){if(oe.selection){var z=L2(c,oe,!1),le=on(lt(oe.selection));z&&!hn(lt(z))&&sn(le,on(lt(z)))?ae(Zo(lt(z))):ae(us(le)),i("insert before",{selection:oe.selection,selectionBefore:z,parentPath:le}),fr().then(function(){return Ie()})}}function tt(){if(oe.selection){var z=Is(c,oe.selection);i("insert after",z),ae(Zo(z)),fr().then(function(){return Ie()})}}function We(z){return N.apply(this,arguments)}function N(){return(N=$t(Pe().mark(function z(le){return Pe().wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return xe.next=2,d6({char:le,selectInside:!0,refJsonEditor:l,json:c,selection:oe.selection,readOnly:y,parser:I,onPatch:Jt,onReplaceJson:Ot,onSelect:ae});case 2:case"end":return xe.stop()}},z)}))).apply(this,arguments)}function G(){if(!y&&Dt.getState().canUndo){var z=Dt.undo();if(z){var le={json:c,text:u};t(11,c=z.undo.patch?ro(c,z.undo.patch):z.undo.json),t(12,oe=z.undo.state),t(18,u=z.undo.text),t(23,Xe=z.undo.textIsRepaired),pe=void 0,i("undo",{item:z,json:c,documentState:oe}),ln(le,z.undo.patch&&z.redo.patch?{json:c,previousJson:le.json,redo:z.undo.patch,undo:z.redo.patch}:null),Fe(),oe.selection&&Nt(lt(oe.selection),!1)}}}function ie(){if(!y&&Dt.getState().canRedo){var z=Dt.redo();if(z){var le={json:c,text:u};t(11,c=z.redo.patch?ro(c,z.redo.patch):z.redo.json),t(12,oe=z.redo.state),t(18,u=z.redo.text),t(23,Xe=z.redo.textIsRepaired),pe=void 0,i("redo",{item:z,json:c,documentState:oe}),ln(le,z.undo.patch&&z.redo.patch?{json:c,previousJson:le.json,redo:z.redo.patch,undo:z.undo.patch}:null),Fe(),oe.selection&&Nt(lt(oe.selection),!1)}}}function ue(z){var le;y||c===void 0||(Se=!0,H({id:d,json:c,rootPath:z,onSort:(le=$t(Pe().mark(function xe(Me){var Ne;return Pe().wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:Ne=Me.operations,i("onSort",z,Ne),Jt(Ne,function(bt,nt){return{state:fe(fe({},js(bt,nt,z)),{},{selection:Ut(z,!1)})}});case 3:case"end":return Le.stop()}},xe)})),function(xe){return le.apply(this,arguments)}),onClose:function(){Se=!1,Fe()}}))}function ye(){oe.selection&&ue(z2(c,oe.selection))}function it(z){if(c!==void 0){var le=z.id,xe=z.onTransform,Me=z.onClose,Ne=z.rootPath||[];Se=!0,J({id:le||h,json:c,rootPath:Ne,onTransform:function(Le){xe?xe({operations:Le,json:c,transformedJson:ro(c,Le)}):(i("onTransform",Ne,Le),Jt(Le,function(bt,nt){return{state:fe(fe({},js(bt,nt,Ne)),{},{selection:Ut(Ne,!1)})}}))},onClose:function(){Se=!1,Fe(),Me&&Me()}})}}function vt(){oe.selection&&it({rootPath:z2(c,oe.selection)})}function Nt(z){return bn.apply(this,arguments)}function bn(){return bn=$t(Pe().mark(function z(le){var xe,Me,Ne,Le,bt,nt=arguments;return Pe().wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return xe=!(nt.length>1&&nt[1]!==void 0)||nt[1],t(12,oe=_g(c,oe,le)),yt.next=4,fr();case 4:if(Me=En(le),i("scrollTo",{path:le,elem:Me,refContents:s}),Me&&s){yt.next=8;break}return yt.abrupt("return",Promise.resolve());case 8:if(Ne=s.getBoundingClientRect(),Le=Me.getBoundingClientRect(),xe){yt.next=13;break}if(!(Le.bottom>Ne.top&&Le.topxe.bottom-20&&b(le,{container:s,offset:-(xe.height-Ne-20),duration:0})}}function ln(z,le){var xe;if(z.json!==void 0||(z==null?void 0:z.text)!==void 0){if(u!==void 0)(xe=Y)===null||xe===void 0||xe({text:u,json:void 0},z,{contentErrors:se(),patchResult:le});else if(c!==void 0){var Me;(Me=Y)===null||Me===void 0||Me({text:void 0,json:c},z,{contentErrors:se(),patchResult:le})}}}function Jt(z,le){i("handlePatch",z,le);var xe={json:c,text:u},Me=Zt(z,le);return ln(xe,Me),Me}function Ot(z,le){var xe=oe,Me=c,Ne=u,Le={json:c,text:u},bt=Xe,nt=Ti(c,oe,[],So),yt=typeof le=="function"?le(z,nt):void 0;t(11,c=yt&&yt.json!==void 0?yt.json:z),t(12,oe=yt&&yt.state!==void 0?yt.state:nt),t(18,u=void 0),t(23,Xe=!1),pe=void 0,rt(c),Xt({previousJson:Me,previousState:xe,previousText:Ne,previousTextIsRepaired:bt}),ln(Le,null)}function Sn(z,le){i("handleChangeText");var xe=oe,Me=c,Ne=u,Le={json:c,text:u},bt=Xe;try{t(11,c=W(z)),t(12,oe=Ti(c,oe,[],So)),t(18,u=void 0),t(23,Xe=!1),pe=void 0}catch(yt){try{t(11,c=W(Ao(z))),t(12,oe=Ti(c,oe,[],So)),t(18,u=z),t(23,Xe=!0),pe=void 0}catch{t(11,c=void 0),t(12,oe=Yd({json:c,expand:So})),t(18,u=z),t(23,Xe=!1),pe=u!==""?Nl(u,yt.message||String(yt)):void 0}}if(typeof le=="function"){var nt=le(c,oe);t(11,c=nt&&nt.json?nt.json:c),t(12,oe=nt&&nt.state?nt.state:oe)}rt(c),Xt({previousJson:Me,previousState:xe,previousText:Ne,previousTextIsRepaired:bt}),ln(Le,null)}function An(z,le){var xe=arguments.length>2&&arguments[2]!==void 0&&arguments[2];i("expand",{path:z,expanded:le,recursive:xe}),t(12,oe=le?xe?Ti(c,oe,z,zc):function(Me,Ne){return fe(fe({},Me),{},{expandedMap:fe(fe({},Me.expandedMap),{},Oi({},Ue(Ne),!0))})}(oe,z):R2(oe,z)),oe.selection&&!le&&function(Me,Ne){return cs(lt(Me),Ne)&&(lt(Me).length>Ne.length||dr(Me))}(oe.selection,z)&&ae(null),Fe()}function xn(z){i("openFind",{findAndReplace:z}),t(13,st=!1),t(21,Ht=!1),fr().then(function(){t(13,st=!0),t(21,Ht=z)})}function Ar(z,le){i("handleExpandSection",z,le);var xe=Ue(z);t(12,oe=function(Me,Ne,Le,bt){return fe(fe({},Ne),{},{visibleSectionsMap:fe(fe({},Ne.visibleSectionsMap),{},Oi({},Le,k4(Kh(Ne,Le).concat(bt))))})}(0,oe,xe,le))}function Q(z){i("pasted json as text",z),t(19,et=z)}function ve(z){var le=z.anchor,xe=z.left,Me=z.top,Ne=z.width,Le=z.height,bt=z.offsetTop,nt=z.offsetLeft,yt=z.showTip,tr=function(Ft){var jn=Ft.json,cr=Ft.documentState,dn=Ft.readOnly,ir=Ft.parser,Ki=Ft.onEditKey,gi=Ft.onEditValue,Fa=Ft.onToggleEnforceString,br=Ft.onCut,vi=Ft.onCopy,mo=Ft.onPaste,ps=Ft.onRemove,ei=Ft.onDuplicate,Gi=Ft.onExtract,Zl=Ft.onInsertBefore,Qs=Ft.onInsert,ec=Ft.onConvert,ip=Ft.onInsertAfter,op=Ft.onSort,tc=Ft.onTransform,re=cr.selection,Je=jn!==void 0,xt=!!re,yn=!!re&&hn(lt(re)),Rt=re?Ye(jn,lt(re)):void 0,Gt=Array.isArray(Rt)?"Edit array":Rn(Rt)?"Edit object":"Edit value",In=Je&&(Cn(re)||or(re)||rn(re)),Ys=!dn&&Je&&re!=null&&Xd(re)&&!yn&&!Array.isArray(Ye(jn,on(lt(re)))),gr=!dn&&Je&&re!=null&&Xd(re),ur=gr&&!Wn(Rt),yi=!dn&&In,qa=In,zu=!dn&&xt,ms=!dn&&Je&&In&&!yn,b6=!dn&&Je&&re!=null&&(Cn(re)||rn(re))&&!yn,Vo=In,nc=Vo?"Convert to:":"Insert:",w6=!dn&&!Vo&&xt,x6=!dn&&(Vo?_f(re)&&!Rn(Rt):xt),j6=!dn&&(Vo?_f(re)&&!Array.isArray(Rt):xt),$6=!dn&&(Vo?_f(re)&&Wn(Rt):xt),k6=!(re==null||!Rt)&&ls(Rt,cr.enforceStringMap,Ue(lt(re)),ir);function Fu(sp){In?sp!=="structure"&&ec(sp):Qs(sp)}return[{type:"row",items:[{type:"button",onClick:function(){return Ki()},icon:ul,text:"Edit key",title:"Edit the key (Double-click on the key)",disabled:!Ys},{type:"dropdown-button",main:{type:"button",onClick:function(){return gi()},icon:ul,text:Gt,title:"Edit the value (Double-click on the value)",disabled:!gr},width:"11em",items:[{type:"button",icon:ul,text:Gt,title:"Edit the value (Double-click on the value)",onClick:function(){return gi()},disabled:!gr},{type:"button",icon:k6?Y$:Z$,text:"Enforce string",title:"Enforce keeping the value as string when it contains a numeric value",onClick:function(){return Fa()},disabled:!ur}]}]},{type:"separator"},{type:"row",items:[{type:"dropdown-button",main:{type:"button",onClick:function(){return br(!0)},icon:cl,text:"Cut",title:"Cut selected contents, formatted with indentation (Ctrl+X)",disabled:!yi},width:"10em",items:[{type:"button",icon:cl,text:"Cut formatted",title:"Cut selected contents, formatted with indentation (Ctrl+X)",onClick:function(){return br(!0)},disabled:!yi},{type:"button",icon:cl,text:"Cut compacted",title:"Cut selected contents, without indentation (Ctrl+Shift+X)",onClick:function(){return br(!1)},disabled:!yi}]},{type:"dropdown-button",main:{type:"button",onClick:function(){return vi(!0)},icon:Es,text:"Copy",title:"Copy selected contents, formatted with indentation (Ctrl+C)",disabled:!qa},width:"12em",items:[{type:"button",icon:Es,text:"Copy formatted",title:"Copy selected contents, formatted with indentation (Ctrl+C)",onClick:function(){return vi(!0)},disabled:!qa},{type:"button",icon:Es,text:"Copy compacted",title:"Copy selected contents, without indentation (Ctrl+Shift+C)",onClick:function(){return vi(!1)},disabled:!qa}]},{type:"button",onClick:function(){return mo()},icon:Q$,text:"Paste",title:"Paste clipboard contents (Ctrl+V)",disabled:!zu}]},{type:"separator"},{type:"row",items:[{type:"column",items:[{type:"button",onClick:function(){return ei()},icon:nk,text:"Duplicate",title:"Duplicate selected contents (Ctrl+D)",disabled:!ms},{type:"button",onClick:function(){return Gi()},icon:bT,text:"Extract",title:"Extract selected contents",disabled:!b6},{type:"button",onClick:function(){return op()},icon:$h,text:"Sort",title:"Sort array or object contents",disabled:dn||!In},{type:"button",onClick:function(){return tc()},icon:xh,text:"Transform",title:"Transform array or object contents (filter, sort, project)",disabled:dn||!In},{type:"button",onClick:function(){return ps()},icon:bm,text:"Remove",title:"Remove selected contents (Delete)",disabled:dn||!In}]},{type:"column",items:[{type:"label",text:nc},{type:"button",onClick:function(){return Fu("structure")},icon:Vo?Xu:tl,text:"Structure",title:nc+" structure",disabled:!w6},{type:"button",onClick:function(){return Fu("object")},icon:Vo?Xu:tl,text:"Object",title:nc+" structure",disabled:!x6},{type:"button",onClick:function(){return Fu("array")},icon:Vo?Xu:tl,text:"Array",title:nc+" array",disabled:!j6},{type:"button",onClick:function(){return Fu("value")},icon:Vo?Xu:tl,text:"Value",title:nc+" value",disabled:!$6}]}]},{type:"separator"},{type:"row",items:[{type:"button",onClick:function(){return Zl()},icon:pT,text:"Insert before",title:"Select area before current entry to insert or paste contents",disabled:dn||!In||yn},{type:"button",onClick:function(){return ip()},icon:lT,text:"Insert after",title:"Select area after current entry to insert or paste contents",disabled:dn||!In||yn}]}]}({json:c,documentState:oe,readOnly:y,parser:I,onEditKey:Wt,onEditValue:Ge,onToggleEnforceString:On,onCut:zn,onCopy:Mn,onPaste:er,onRemove:me,onDuplicate:Be,onExtract:St,onInsertBefore:de,onInsert:_t,onInsertAfter:tt,onConvert:Yt,onSort:ye,onTransform:vt}),Tn=te(tr);if(Tn!==!1){var nr={left:xe,top:Me,offsetTop:bt,offsetLeft:nt,width:Ne,height:Le,anchor:le,closeOnOuterClick:!0,onClose:function(){Se=!1,Fe()}};Se=!0;var qr=m(p6,{tip:yt?"Tip: you can open this context menu via right-click or with Ctrl+Q":void 0,items:Tn,onRequestClose:function(){return v(qr)}},nr)}}function Ie(z){if(!Xr(oe.selection)){if(z&&(z.stopPropagation(),z.preventDefault()),z&&z.type==="contextmenu"&&z.target!==a)ve({left:z.clientX,top:z.clientY,width:Ko,height:Jo,showTip:!1});else{var le,xe=(le=s)===null||le===void 0?void 0:le.querySelector(".jse-context-menu-pointer.jse-selected");if(xe)ve({anchor:xe,offsetTop:2,width:Ko,height:Jo,showTip:!1});else{var Me,Ne=(Me=s)===null||Me===void 0?void 0:Me.getBoundingClientRect();Ne&&ve({top:Ne.top+2,left:Ne.left+2,width:Ko,height:Jo,showTip:!1})}}return!1}}function ze(){return(ze=$t(Pe().mark(function z(){var le,xe,Me,Ne,Le;return Pe().wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:if(i("apply pasted json",et),et){bt.next=3;break}return bt.abrupt("return");case 3:Me=(xe=et).path,Ne=xe.contents,t(19,et=void 0),x4(Le=((le=s)===null||le===void 0?void 0:le.querySelector(".jse-editable-div"))||null)&&Le.cancel(),Jt([{op:"replace",path:Ue(Me),value:Ne}],function(nt,yt){return{state:js(nt,yt,Me)}}),setTimeout(Fe);case 10:case"end":return bt.stop()}},z)}))).apply(this,arguments)}function Fe(){i("focus"),a&&(a.focus(),a.select())}function kt(z){return function(le,xe,Me){var Ne=on(Me),Le=[en(Me)],bt=Ye(le,Ne),nt=bt?Zp(bt,xe,Le):void 0;return nt?Ut(Ne.concat(nt),!1):Zo(Me)}(c,oe,z)}function zt(z){r&&r.onDrag(z)}function Kt(){r&&r.onDragEnd()}return n.$$set=function(z){"readOnly"in z&&t(0,y=z.readOnly),"externalContent"in z&&t(49,x=z.externalContent),"externalSelection"in z&&t(50,w=z.externalSelection),"mainMenuBar"in z&&t(1,$=z.mainMenuBar),"navigationBar"in z&&t(2,S=z.navigationBar),"escapeControlCharacters"in z&&t(51,_=z.escapeControlCharacters),"escapeUnicodeCharacters"in z&&t(52,F=z.escapeUnicodeCharacters),"parser"in z&&t(3,I=z.parser),"parseMemoizeOne"in z&&t(53,W=z.parseMemoizeOne),"validator"in z&&t(54,D=z.validator),"validationParser"in z&&t(55,U=z.validationParser),"pathParser"in z&&t(4,q=z.pathParser),"indentation"in z&&t(5,X=z.indentation),"onError"in z&&t(6,K=z.onError),"onChange"in z&&t(56,Y=z.onChange),"onChangeMode"in z&&t(57,T=z.onChangeMode),"onSelect"in z&&t(58,B=z.onSelect),"onRenderValue"in z&&t(59,O=z.onRenderValue),"onRenderMenu"in z&&t(7,A=z.onRenderMenu),"onRenderContextMenu"in z&&t(60,te=z.onRenderContextMenu),"onClassName"in z&&t(61,R=z.onClassName),"onFocus"in z&&t(62,k=z.onFocus),"onBlur"in z&&t(63,P=z.onBlur),"onSortModal"in z&&t(64,H=z.onSortModal),"onTransformModal"in z&&t(65,J=z.onTransformModal),"onJSONEditorModal"in z&&t(66,he=z.onJSONEditorModal)},n.$$.update=function(){3145728&n.$$.dirty[1]&&t(74,Qe=B0({escapeControlCharacters:_,escapeUnicodeCharacters:F})),4096&n.$$.dirty[0]&&i("selection",oe.selection),8192&n.$$.dirty[0]&&function(z){if(s)if(z){var le,xe=(le=parseInt(getComputedStyle(s).padding))!==null&&le!==void 0?le:0;t(10,s.style.overflowAnchor="none",s),t(10,s.style.paddingTop=xe+wl+"px",s),t(10,s.scrollTop+=wl,s),t(10,s.style.overflowAnchor="",s)}else t(10,s.style.overflowAnchor="none",s),t(10,s.style.paddingTop="",s),t(10,s.scrollTop-=wl,s),t(10,s.style.overflowAnchor="",s)}(st),262144&n.$$.dirty[1]&&Re(x),524288&n.$$.dirty[1]&&function(z){sn(oe.selection,z)||(i("applyExternalSelection",z),(H0(z)||z===null)&&ae(z))}(w),2056&n.$$.dirty[0]|25165824&n.$$.dirty[1]&&ne(c,D,I,U),16384&n.$$.dirty[0]&&t(24,wt=function(z){var le={};return z.forEach(function(xe){le[Ue(xe.path)]=xe}),z.forEach(function(xe){for(var Me=xe.path;Me.length>0;){Me=on(Me);var Ne=Ue(Me);Ne in le||(le[Ne]={isChildError:!0,path:Me,message:"Contains invalid data",severity:oo.warning})}}),le}(nn)),1024&n.$$.dirty[0]&&(r=s?function(z){var le,xe;function Me(nt){return nt<20?QF:nt<50?YF:XF}function Ne(){if(z){var nt=(le||0)*(g2/1e3);z.scrollTop+=nt}}function Le(nt){xe&&nt===le||(bt(),tm("startAutoScroll",nt),le=nt,xe=setInterval(Ne,g2))}function bt(){xe&&(tm("stopAutoScroll"),clearInterval(xe),xe=void 0,le=void 0)}return tm("createAutoScrollHandler",z),{onDrag:function(nt){if(z){var yt=nt.clientY,tr=z.getBoundingClientRect(),Tn=tr.top,nr=tr.bottom;ytnr?Le(Me(yt-nr)):bt()}},onDragEnd:function(){bt()}}}(s):void 0),9&n.$$.dirty[0]|1342177280&n.$$.dirty[1]|4096&n.$$.dirty[2]&&t(15,Oe={readOnly:y,parser:I,normalization:Qe,getJson:ge,getDocumentState:ke,findElement:En,findNextInside:kt,focus:Fe,onPatch:Jt,onInsert:Lt,onExpand:An,onSelect:ae,onFind:xn,onExpandSection:Ar,onPasteJson:Q,onRenderValue:O,onContextMenu:ve,onClassName:R||function(){},onDrag:zt,onDragEnd:Kt}),32768&n.$$.dirty[0]&&i("context changed",Oe)},[y,$,S,I,q,X,K,A,function(){return Xe&&c!==void 0&&Ot(c),c!==void 0?{json:c}:{text:u||""}},Fe,s,c,oe,st,nn,Oe,a,l,u,et,tn,Ht,He,Xe,wt,o,function(z){t(20,tn=z)},function(z){return qe.apply(this,arguments)},function(){t(13,st=!1),t(21,Ht=!1),Fe()},function(z){i("select validation error",z),ae(Ut(z.path,!1)),Nt(z.path)},Mn,function(z){var le;z.preventDefault();var xe=(le=z.clipboardData)===null||le===void 0?void 0:le.getData("text/plain");xe!==void 0&&u6({clipboardText:xe,json:c,selection:oe.selection,readOnly:y,parser:I,onPatch:Jt,onChangeText:Sn,openRepairModal:fn})},We,G,ie,function(){ue([])},function(){it({rootPath:[]})},Jt,function(){An([],!0,!0)},function(){An([],!1,!0)},function(z){var le=ss(z),xe=z.shiftKey;if(i("keydown",{combo:le,key:z.key}),le==="Ctrl+X"&&(z.preventDefault(),zn(!0)),le==="Ctrl+Shift+X"&&(z.preventDefault(),zn(!1)),le==="Ctrl+C"&&(z.preventDefault(),Mn(!0)),le==="Ctrl+Shift+C"&&(z.preventDefault(),Mn(!1)),le==="Ctrl+D"&&(z.preventDefault(),Be()),le!=="Delete"&&le!=="Backspace"||(z.preventDefault(),me()),le==="Insert"&&(z.preventDefault(),Lt("structure")),le==="Ctrl+A"&&(z.preventDefault(),ae(Ut([],!1))),le==="Ctrl+Q"&&Ie(z),le==="ArrowUp"||le==="Shift+ArrowUp"){z.preventDefault();var Me=oe.selection?L2(c,oe,xe)||oe.selection:Ja(c,oe);ae(Me),Bt(lt(Me))}if(le==="ArrowDown"||le==="Shift+ArrowDown"){z.preventDefault();var Ne=oe.selection?function(Tn,nr){var qr=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Ft=nr.selection;if(!Ft)return null;var jn=qr?lt(Ft):Is(Tn,Ft),cr=Wn(Ye(Tn,jn))?R2(nr,jn):nr,dn=Zp(Tn,nr,jn),ir=Zp(Tn,cr,jn);if(qr)return dr(Ft)?dn!==null?Wr(dn,dn):null:hi(Ft)?ir!==null?Wr(ir,ir):null:ir!==null?Wr(ma(Ft),ir):null;if(hi(Ft))return ir!==null?Ut(ir,!1):null;if(dr(Ft)||rn(Ft))return dn!==null?Ut(dn,!1):null;if(or(Ft)){if(dn===null||dn.length===0)return null;var Ki=on(dn),gi=Ye(Tn,Ki);return Array.isArray(gi)?Ut(dn,!1):zi(dn,!1)}return Cn(Ft)?ir!==null?Ut(ir,!1):dn!==null?Ut(dn,!1):null:null}(c,oe,xe)||oe.selection:Ja(c,oe);ae(Ne),Bt(lt(Ne))}if(le==="ArrowLeft"||le==="Shift+ArrowLeft"){z.preventDefault();var Le=oe.selection?function(Tn,nr){var qr=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Ft=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],jn=nr.selection;if(!jn)return null;var cr=B2(Tn,nr,Ft),dn=cr.caret,ir=cr.previous;if(qr)return Cn(jn)?null:Wr(jn.path,jn.path);if(dn&&ir)return Rg(ir);var Ki=on(lt(jn)),gi=Ye(Tn,Ki);return rn(jn)&&Array.isArray(gi)?Wr(jn.path,jn.path):Cn(jn)&&!Array.isArray(gi)?zi(jn.focusPath,!1):null}(c,oe,xe,!y)||oe.selection:Ja(c,oe);ae(Le),Bt(lt(Le))}if(le==="ArrowRight"||le==="Shift+ArrowRight"){z.preventDefault();var bt=oe.selection&&c!==void 0?function(Tn,nr){var qr=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Ft=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],jn=nr.selection;if(!jn)return null;var cr=B2(Tn,nr,Ft),dn=cr.caret,ir=cr.next;return qr?Cn(jn)?null:Wr(jn.path,jn.path):dn&&ir?Rg(ir):Cn(jn)?Ut(jn.focusPath,!1):null}(c,oe,xe,!y)||oe.selection:Ja(c,oe);ae(bt),Bt(lt(bt))}if(le==="Enter"&&oe.selection){if(Gh(oe.selection)){var nt=oe.selection.focusPath,yt=Ye(c,on(nt));Array.isArray(yt)&&ae(Ut(nt,!1))}or(oe.selection)&&(z.preventDefault(),ae(fe(fe({},oe.selection),{},{edit:!0}))),rn(oe.selection)&&(z.preventDefault(),Wn(Ye(c,oe.selection.path))?An(oe.selection.path,!0):ae(fe(fe({},oe.selection),{},{edit:!0})))}if(le.replace(/^Shift\+/,"").length===1&&oe.selection)return z.preventDefault(),void We(z.key);if(le==="Enter"&&(hi(oe.selection)||dr(oe.selection)))return z.preventDefault(),void We("");if(le==="Ctrl+Enter"&&rn(oe.selection)){var tr=Ye(c,oe.selection.path);Wh(tr)&&window.open(String(tr),"_blank")}le==="Escape"&&oe.selection&&(z.preventDefault(),ae(null)),le==="Ctrl+F"&&(z.preventDefault(),xn(!1)),le==="Ctrl+H"&&(z.preventDefault(),xn(!0)),le==="Ctrl+Z"&&(z.preventDefault(),G()),le==="Ctrl+Shift+Z"&&(z.preventDefault(),ie())},function(z){i("handleMouseDown",z);var le=z.target;v4(le,"BUTTON")||le.isContentEditable||(Fe(),oe.selection||c!==void 0||u!==""&&u!==void 0||(i("createDefaultSelection"),t(12,oe=fe(fe({},oe),{},{selection:Ut([],!1)}))))},Ie,function(z){ve({anchor:b4(z.target,"BUTTON"),offsetTop:0,width:Ko,height:Jo,showTip:!0})},function(){return ze.apply(this,arguments)},function(){i("clear pasted json"),t(19,et=void 0),Fe()},function(){T(Dr.text)},function(z){ae(z),Fe(),Nt(lt(z))},function(z){var le=!Ru(z.target,function(xe){return xe===l});le&&Xr(oe.selection)&&(i("click outside the editor, stop edit mode"),ae(function(xe){return or(xe)||rn(xe)?fe(fe({},xe),{},{edit:!1}):xe}),g&&a&&(a.focus(),a.blur()),i("blur (outside editor)"),a&&a.blur())},x,w,_,F,W,D,U,Y,T,B,O,te,R,k,P,H,J,he,function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zc;i("expand");var le=fe(fe({},oe),{},{expandedMap:{},visibleSectionsMap:{}});t(12,oe=Ti(c,le,[],z))},se,ge,Zt,it,Nt,En,Qe,function(z){t(13,st=z)},function(z){It[z?"unshift":"push"](function(){t(16,a=z)})},function(){Fe(),We("{")},function(){Fe(),We("[")},function(){Fe()},function(z){It[z?"unshift":"push"](function(){t(10,s=z)})},function(z){It[z?"unshift":"push"](function(){t(17,l=z)})}]}var n1=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,aK,sK,Tt,{readOnly:0,externalContent:49,externalSelection:50,mainMenuBar:1,navigationBar:2,escapeControlCharacters:51,escapeUnicodeCharacters:52,parser:3,parseMemoizeOne:53,validator:54,validationParser:55,pathParser:4,indentation:5,onError:6,onChange:56,onChangeMode:57,onSelect:58,onRenderValue:59,onRenderMenu:7,onRenderContextMenu:60,onClassName:61,onFocus:62,onBlur:63,onSortModal:64,onTransformModal:65,onJSONEditorModal:66,expand:67,validate:68,getJson:69,patch:70,acceptAutoRepair:8,openTransformModal:71,scrollTo:72,findElement:73,focus:9},ZJ,[-1,-1,-1,-1,-1]),r}return ht(e,mt),ut(e,[{key:"expand",get:function(){return this.$$.ctx[67]}},{key:"validate",get:function(){return this.$$.ctx[68]}},{key:"getJson",get:function(){return this.$$.ctx[69]}},{key:"patch",get:function(){return this.$$.ctx[70]}},{key:"acceptAutoRepair",get:function(){return this.$$.ctx[8]}},{key:"openTransformModal",get:function(){return this.$$.ctx[71]}},{key:"scrollTo",get:function(){return this.$$.ctx[72]}},{key:"findElement",get:function(){return this.$$.ctx[73]}},{key:"focus",get:function(){return this.$$.ctx[9]}}])}();function m6(n){return sr(e=n)!=="object"||e===null?n:new Proxy(n,{get:function(t,r,i){return m6(Reflect.get(t,r,i))},set:function(){return!1},deleteProperty:function(){return!1}});var e}function lK(n){Et(n,"svelte-1mpf6w7",'.jse-modal.svelte-1mpf6w7.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-1mpf6w7 .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-1mpf6w7 .jse-modal-contents.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions.svelte-1mpf6w7{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions button.jse-primary.svelte-1mpf6w7{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions button.jse-primary.svelte-1mpf6w7:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions button.jse-primary.svelte-1mpf6w7:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0;overflow:auto}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;max-height:500px;display:flex}.bg.jse-modal-bg .jse-modal-window:has(div.fullscreen){margin:var(--jse-padding, 10px);padding:0;width:calc(100vw - 2 * var(--jse-padding, 10px));height:calc(100vh - 2 * var(--jse-padding, 10px));max-width:none;max-height:none}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0;max-height:none}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents.svelte-1mpf6w7{color:inherit;min-height:0;padding:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents.svelte-1mpf6w7{flex:1;display:flex;gap:calc(2 * var(--jse-padding, 10px));min-height:0;box-sizing:border-box;padding:0 calc(2 * var(--jse-padding, 10px)) var(--jse-padding, 10px)}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 p{margin:var(--jse-padding, 10px) 0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 p:first-child{margin-top:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 p:last-child{margin-bottom:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 code{background:var(--jse-modal-code-background, rgba(0, 0, 0, 0.05));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px)}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-1mpf6w7{flex:1;outline:none;resize:vertical}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;gap:calc(2 * var(--jse-padding, 10px))}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.jse-hide.svelte-1mpf6w7{flex:none}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents .jse-preview-data.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents.jse-hide-original-data.svelte-1mpf6w7{flex-direction:column;gap:0;margin-bottom:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-actions.svelte-1mpf6w7{padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px)) calc(2 * var(--jse-padding, 10px))}@media screen and (max-width: 1200px){.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents.svelte-1mpf6w7{flex-direction:column;overflow:auto}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-1mpf6w7{min-height:150px;flex:none}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-1mpf6w7 .jse-tree-mode{height:300px;flex:none}}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-label.svelte-1mpf6w7{font-weight:bold;display:block;box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-label .jse-label-inner.svelte-1mpf6w7{margin-top:calc(2 * var(--jse-padding, 10px));margin-bottom:calc(0.5 * var(--jse-padding, 10px));box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-label .jse-label-inner button.svelte-1mpf6w7{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;font-weight:bold;padding:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-tree-mode{flex:1;background:var(--jse-input-background-readonly, transparent);box-shadow:none;box-sizing:border-box;--jse-main-border:var(--jse-input-border, 1px solid #d8dbdf)}.jse-modal.jse-transform.svelte-1mpf6w7 input.svelte-1mpf6w7,.jse-modal.jse-transform.svelte-1mpf6w7 textarea.svelte-1mpf6w7{border:var(--jse-input-border, 1px solid #d8dbdf);outline:none;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding, 10px));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:inherit;background:var(--jse-input-background, var(--jse-background-color, #fff))}.jse-modal.jse-transform.svelte-1mpf6w7 input.svelte-1mpf6w7:focus,.jse-modal.jse-transform.svelte-1mpf6w7 textarea.svelte-1mpf6w7:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}.jse-modal.jse-transform.svelte-1mpf6w7 input.svelte-1mpf6w7:read-only,.jse-modal.jse-transform.svelte-1mpf6w7 textarea.svelte-1mpf6w7:read-only{background:var(--jse-input-background-readonly, transparent)}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-preview.jse-error.svelte-1mpf6w7{flex:1;background:var(--jse-input-background-readonly, transparent);border:var(--jse-input-border, 1px solid #d8dbdf);color:var(--jse-error-color, #ee5341);padding:calc(0.5 * var(--jse-padding, 10px))}.jse-modal.jse-transform.svelte-1mpf6w7 a{color:var(--jse-a-color, #156fc5)}.jse-modal.jse-transform.svelte-1mpf6w7 a:hover{color:var(--jse-a-color-highlight, #0f508d)}')}function dj(n){var e,t,r,i,o,s=[uK,cK],a=[];function l(c,u){return 16384&u[0]&&(e=null),e==null&&(e=!!Array.isArray(c[14])),e?0:1}return t=l(n,[-1,-1]),r=a[t]=s[t](n),{c:function(){r.c(),i=an()},m:function(c,u){a[t].m(c,u),ee(c,i,u),o=!0},p:function(c,u){var f=t;(t=l(c,u))===f?a[t].p(c,u):(Ee(),M(a[f],1,1,function(){a[f]=null}),Ae(),(r=a[t])?r.p(c,u):(r=a[t]=s[t](c)).c(),C(r,1),r.m(i.parentNode,i))},i:function(c){o||(C(r),o=!0)},o:function(c){M(r),o=!1},d:function(c){c&&Z(i),a[t].d(c)}}}function cK(n){var e;return{c:function(){e=De("(Only available for arrays, not for objects)")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function uK(n){var e,t;return e=new _H({props:{queryOptions:n[15],json:n[14],onChange:n[24]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};32768&i[0]&&(o.queryOptions=r[15]),16384&i[0]&&(o.json=r[14]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function hj(n){var e,t;return e=new n1({props:{externalContent:n[17],externalSelection:null,readOnly:!0,mainMenuBar:!1,navigationBar:!1,indentation:n[2],escapeControlCharacters:n[3],escapeUnicodeCharacters:n[4],parser:n[5],parseMemoizeOne:n[6],onRenderValue:n[10],onRenderMenu:n[11],onRenderContextMenu:n[12],onError:console.error,onChange:Cr,onChangeMode:Cr,onSelect:Cr,onFocus:Cr,onBlur:Cr,onSortModal:Cr,onTransformModal:Cr,onJSONEditorModal:Cr,onClassName:n[13],validator:null,validationParser:n[7],pathParser:n[8]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};131072&i[0]&&(o.externalContent=r[17]),4&i[0]&&(o.indentation=r[2]),8&i[0]&&(o.escapeControlCharacters=r[3]),16&i[0]&&(o.escapeUnicodeCharacters=r[4]),32&i[0]&&(o.parser=r[5]),64&i[0]&&(o.parseMemoizeOne=r[6]),1024&i[0]&&(o.onRenderValue=r[10]),2048&i[0]&&(o.onRenderMenu=r[11]),4096&i[0]&&(o.onRenderContextMenu=r[12]),8192&i[0]&&(o.onClassName=r[13]),128&i[0]&&(o.validationParser=r[7]),256&i[0]&&(o.pathParser=r[8]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function fK(n){var e,t;return{c:function(){e=V("div"),t=De(n[21]),j(e,"class","jse-preview jse-error svelte-1mpf6w7")},m:function(r,i){ee(r,e,i),E(e,t)},p:function(r,i){2097152&i[0]&>(t,r[21])},i:Te,o:Te,d:function(r){r&&Z(e)}}}function dK(n){var e,t;return e=new n1({props:{externalContent:n[22],externalSelection:null,readOnly:!0,mainMenuBar:!1,navigationBar:!1,indentation:n[2],escapeControlCharacters:n[3],escapeUnicodeCharacters:n[4],parser:n[5],parseMemoizeOne:n[6],onRenderValue:n[10],onRenderMenu:n[11],onRenderContextMenu:n[12],onError:console.error,onChange:Cr,onChangeMode:Cr,onSelect:Cr,onFocus:Cr,onBlur:Cr,onSortModal:Cr,onTransformModal:Cr,onJSONEditorModal:Cr,onClassName:n[13],validator:null,validationParser:n[7],pathParser:n[8]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};4194304&i[0]&&(o.externalContent=r[22]),4&i[0]&&(o.indentation=r[2]),8&i[0]&&(o.escapeControlCharacters=r[3]),16&i[0]&&(o.escapeUnicodeCharacters=r[4]),32&i[0]&&(o.parser=r[5]),64&i[0]&&(o.parseMemoizeOne=r[6]),1024&i[0]&&(o.onRenderValue=r[10]),2048&i[0]&&(o.onRenderMenu=r[11]),4096&i[0]&&(o.onRenderContextMenu=r[12]),8192&i[0]&&(o.onClassName=r[13]),128&i[0]&&(o.validationParser=r[7]),256&i[0]&&(o.pathParser=r[8]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function hK(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D,U,q,X,K,Y,T,B,O,A,te,R,k,P,H,J,he,Se,pe,ae,Qe,et=n[23](n[0]).description+"";function tn(He){n[37](He)}var Qt={queryLanguages:n[9],queryLanguageId:n[0],onChangeQueryLanguage:n[29]};n[18]!==void 0&&(Qt.fullscreen=n[18]),e=new KH({props:Qt}),It.push(function(){return oi(e,"fullscreen",tn)}),y=new un({props:{data:n[19]?Ri:$s}});var oe=n[19]&&dj(n);K=new un({props:{data:n[20]?Ri:$s}});var st=n[20]&&hj(n),Ht=[dK,fK],qe=[];function Dt(He,wt){return He[21]?1:0}return R=Dt(n),k=qe[R]=Ht[R](n),{c:function(){je(e.$$.fragment),r=ce(),i=V("div"),o=V("div"),s=V("div"),(a=V("div")).innerHTML='
Language
',l=ce(),c=V("div"),u=ce(),(f=V("div")).innerHTML='
Path
',d=ce(),h=V("input"),m=ce(),v=V("div"),g=V("div"),b=V("button"),je(y.$$.fragment),x=De(` - Wizard`),w=ce(),oe&&oe.c(),$=ce(),(S=V("div")).innerHTML='
Query
',_=ce(),F=V("textarea"),I=ce(),W=V("div"),D=V("div"),U=V("div"),q=V("div"),X=V("button"),je(K.$$.fragment),Y=De(` - Original`),T=ce(),st&&st.c(),B=ce(),O=V("div"),(A=V("div")).innerHTML='
Preview
',te=ce(),k.c(),P=ce(),H=V("div"),J=V("button"),he=De("Transform"),j(a,"class","jse-label svelte-1mpf6w7"),j(c,"class","jse-description svelte-1mpf6w7"),j(f,"class","jse-label svelte-1mpf6w7"),j(h,"class","jse-path svelte-1mpf6w7"),j(h,"type","text"),h.readOnly=!0,j(h,"title","Selected path"),h.value=p=hn(n[1])?"(document root)":mi(n[1]),j(b,"type","button"),j(b,"class","svelte-1mpf6w7"),j(g,"class","jse-label-inner svelte-1mpf6w7"),j(v,"class","jse-label svelte-1mpf6w7"),j(S,"class","jse-label svelte-1mpf6w7"),j(F,"class","jse-query svelte-1mpf6w7"),j(F,"spellcheck","false"),F.value=n[16],j(s,"class","jse-query-contents svelte-1mpf6w7"),j(X,"type","button"),j(X,"class","svelte-1mpf6w7"),j(q,"class","jse-label-inner svelte-1mpf6w7"),j(U,"class","jse-label svelte-1mpf6w7"),j(D,"class","jse-original-data svelte-1mpf6w7"),$e(D,"jse-hide",!n[20]),j(A,"class","jse-label svelte-1mpf6w7"),j(O,"class","jse-preview-data svelte-1mpf6w7"),j(W,"class","jse-data-contents svelte-1mpf6w7"),$e(W,"jse-hide-original-data",!n[20]),j(o,"class","jse-main-contents svelte-1mpf6w7"),j(J,"type","button"),j(J,"class","jse-primary svelte-1mpf6w7"),J.disabled=Se=!!n[21],j(H,"class","jse-actions svelte-1mpf6w7"),j(i,"class","jse-modal-contents svelte-1mpf6w7")},m:function(He,wt){be(e,He,wt),ee(He,r,wt),ee(He,i,wt),E(i,o),E(o,s),E(s,a),E(s,l),E(s,c),c.innerHTML=et,E(s,u),E(s,f),E(s,d),E(s,h),E(s,m),E(s,v),E(v,g),E(g,b),be(y,b,null),E(b,x),E(s,w),oe&&oe.m(s,null),E(s,$),E(s,S),E(s,_),E(s,F),E(o,I),E(o,W),E(W,D),E(D,U),E(U,q),E(q,X),be(K,X,null),E(X,Y),E(D,T),st&&st.m(D,null),E(W,B),E(W,O),E(O,A),E(O,te),qe[R].m(O,null),E(i,P),E(i,H),E(H,J),E(J,he),pe=!0,ae||(Qe=[Ce(b,"click",n[27]),Ce(F,"input",n[25]),Ce(X,"click",n[28]),Ce(J,"click",n[26]),mr(mK.call(null,J))],ae=!0)},p:function(He,wt){var Oe={};512&wt[0]&&(Oe.queryLanguages=He[9]),1&wt[0]&&(Oe.queryLanguageId=He[0]),!t&&262144&wt[0]&&(t=!0,Oe.fullscreen=He[18],ii(function(){return t=!1})),e.$set(Oe),(!pe||1&wt[0])&&et!==(et=He[23](He[0]).description+"")&&(c.innerHTML=et),(!pe||2&wt[0]&&p!==(p=hn(He[1])?"(document root)":mi(He[1]))&&h.value!==p)&&(h.value=p);var Xe={};524288&wt[0]&&(Xe.data=He[19]?Ri:$s),y.$set(Xe),He[19]?oe?(oe.p(He,wt),524288&wt[0]&&C(oe,1)):((oe=dj(He)).c(),C(oe,1),oe.m(s,$)):oe&&(Ee(),M(oe,1,1,function(){oe=null}),Ae()),(!pe||65536&wt[0])&&(F.value=He[16]);var nn={};1048576&wt[0]&&(nn.data=He[20]?Ri:$s),K.$set(nn),He[20]?st?(st.p(He,wt),1048576&wt[0]&&C(st,1)):((st=hj(He)).c(),C(st,1),st.m(D,null)):st&&(Ee(),M(st,1,1,function(){st=null}),Ae()),(!pe||1048576&wt[0])&&$e(D,"jse-hide",!He[20]);var L=R;(R=Dt(He))===L?qe[R].p(He,wt):(Ee(),M(qe[L],1,1,function(){qe[L]=null}),Ae(),(k=qe[R])?k.p(He,wt):(k=qe[R]=Ht[R](He)).c(),C(k,1),k.m(O,null)),(!pe||1048576&wt[0])&&$e(W,"jse-hide-original-data",!He[20]),(!pe||2097152&wt[0]&&Se!==(Se=!!He[21]))&&(J.disabled=Se)},i:function(He){pe||(C(e.$$.fragment,He),C(y.$$.fragment,He),C(oe),C(K.$$.fragment,He),C(st),C(k),pe=!0)},o:function(He){M(e.$$.fragment,He),M(y.$$.fragment,He),M(oe),M(K.$$.fragment,He),M(st),M(k),pe=!1},d:function(He){He&&(Z(r),Z(i)),we(e,He),we(y),oe&&oe.d(),we(K),st&&st.d(),qe[R].d(),ae=!1,kn(Qe)}}}function pK(n){var e,t,r,i,o;return t=new j4({props:{$$slots:{default:[hK]},$$scope:{ctx:n}}}),{c:function(){e=V("div"),je(t.$$.fragment),j(e,"class","jse-modal jse-transform svelte-1mpf6w7"),$e(e,"fullscreen",n[18])},m:function(s,a){ee(s,e,a),be(t,e,null),r=!0,i||(o=mr(Lu.call(null,e,n[30])),i=!0)},p:function(s,a){var l={};8388607&a[0]|16384&a[1]&&(l.$$scope={dirty:a,ctx:s}),t.$set(l),(!r||262144&a[0])&&$e(e,"fullscreen",s[18])},i:function(s){r||(C(t.$$.fragment,s),r=!0)},o:function(s){M(t.$$.fragment,s),r=!1},d:function(s){s&&Z(e),we(t),i=!1,o()}}}function mK(n){n.focus()}function gK(n,e,t){var r,i,o=Sr("jsoneditor:TransformModal"),s=e.id,a=s===void 0?"transform-modal-"+Bc():s,l=e.json,c=e.rootPath,u=c===void 0?[]:c,f=e.indentation,d=e.escapeControlCharacters,h=e.escapeUnicodeCharacters,p=e.parser,m=e.parseMemoizeOne,v=e.validationParser,g=e.pathParser,b=e.queryLanguages,y=e.queryLanguageId,x=e.onChangeQueryLanguage,w=e.onRenderValue,$=e.onRenderMenu,S=e.onRenderContextMenu,_=e.onClassName,F=e.onTransform,I=Er("simple-modal").close,W=!1,D="".concat(a,":").concat(Ue(u)),U=hc[D]||{},q=Rf.showWizard!==!1,X=Rf.showOriginal!==!1,K=U.queryOptions||{},Y=y===U.queryLanguageId&&U.query?U.query:A(y).createQuery(r,U.queryOptions||{}),T=U.isManual||!1,B=void 0,O={text:""};function A(R){return b.find(function(k){return k.id===R})||b[0]}var te=ud(function(R,k){if(R===void 0)return t(22,O={text:""}),void t(21,B="Error: No JSON");try{o("previewTransform",{query:k});var P=A(y).executeQuery(R,k,p);t(22,O={json:P}),t(21,B=void 0)}catch(H){t(22,O={text:""}),t(21,B=String(H))}},300);return n.$$set=function(R){"id"in R&&t(31,a=R.id),"json"in R&&t(32,l=R.json),"rootPath"in R&&t(1,u=R.rootPath),"indentation"in R&&t(2,f=R.indentation),"escapeControlCharacters"in R&&t(3,d=R.escapeControlCharacters),"escapeUnicodeCharacters"in R&&t(4,h=R.escapeUnicodeCharacters),"parser"in R&&t(5,p=R.parser),"parseMemoizeOne"in R&&t(6,m=R.parseMemoizeOne),"validationParser"in R&&t(7,v=R.validationParser),"pathParser"in R&&t(8,g=R.pathParser),"queryLanguages"in R&&t(9,b=R.queryLanguages),"queryLanguageId"in R&&t(0,y=R.queryLanguageId),"onChangeQueryLanguage"in R&&t(33,x=R.onChangeQueryLanguage),"onRenderValue"in R&&t(10,w=R.onRenderValue),"onRenderMenu"in R&&t(11,$=R.onRenderMenu),"onRenderContextMenu"in R&&t(12,S=R.onRenderContextMenu),"onClassName"in R&&t(13,_=R.onClassName),"onTransform"in R&&t(34,F=R.onTransform)},n.$$.update=function(){2&n.$$.dirty[0]|2&n.$$.dirty[1]&&t(14,r=m6(Ye(l,u))),16384&n.$$.dirty[0]&&t(17,i=r?{json:r}:{text:""}),81920&n.$$.dirty[0]&&te(r,Y),98305&n.$$.dirty[0]|48&n.$$.dirty[1]&&(t(35,hc[D]={queryOptions:K,query:Y,queryLanguageId:y,isManual:T},hc),o("store state in memory",D,hc[D]))},[y,u,f,d,h,p,m,v,g,b,w,$,S,_,r,K,Y,i,W,q,X,B,O,A,function(R){t(15,K=R),t(16,Y=A(y).createQuery(r,R)),t(36,T=!1),o("updateQueryByWizard",{queryOptions:K,query:Y,isManual:T})},function(R){t(16,Y=R.target.value),t(36,T=!0),o("handleChangeQuery",{query:Y,isManual:T})},function(){if(r===void 0)return t(22,O={text:""}),void t(21,B="Error: No JSON");try{o("handleTransform",{query:Y});var R=A(y).executeQuery(r,Y,p);F([{op:"replace",path:Ue(u),value:R}]),I()}catch(k){console.error(k),t(22,O={text:""}),t(21,B=String(k))}},function(){t(19,q=!q),Rf.showWizard=q},function(){t(20,X=!X),Rf.showOriginal=X},function(R){o("handleChangeQueryLanguage",R),t(0,y=R),x(R);var k=A(y);t(16,Y=k.createQuery(r,K)),t(36,T=!1)},function(){W?t(18,W=!W):I()},a,l,x,F,hc,T,function(R){t(18,W=R)}]}var vK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,gK,pK,Tt,{id:31,json:32,rootPath:1,indentation:2,escapeControlCharacters:3,escapeUnicodeCharacters:4,parser:5,parseMemoizeOne:6,validationParser:7,pathParser:8,queryLanguages:9,queryLanguageId:0,onChangeQueryLanguage:33,onRenderValue:10,onRenderMenu:11,onRenderContextMenu:12,onClassName:13,onTransform:34},lK,[-1,-1]),r}return ht(e,mt),ut(e)}(),Ka={};function yK(n){Et(n,"svelte-jdii8g",'.jse-modal.svelte-jdii8g.svelte-jdii8g{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-jdii8g .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-jdii8g .jse-modal-contents.svelte-jdii8g{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions.svelte-jdii8g{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions button.jse-primary.svelte-jdii8g{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions button.jse-primary.svelte-jdii8g:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions button.jse-primary.svelte-jdii8g:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0;overflow:auto}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;max-height:500px;display:flex}.bg.jse-modal-bg .jse-modal-window:has(div.fullscreen){margin:var(--jse-padding, 10px);padding:0;width:calc(100vw - 2 * var(--jse-padding, 10px));height:calc(100vh - 2 * var(--jse-padding, 10px));max-width:none;max-height:none}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0;max-height:none}.jse-modal.jse-sort.svelte-jdii8g table.svelte-jdii8g{width:100%;border-collapse:collapse;border-spacing:0}.jse-modal.jse-sort.svelte-jdii8g table th.svelte-jdii8g,.jse-modal.jse-sort.svelte-jdii8g table td.svelte-jdii8g{text-align:left;vertical-align:middle;font-weight:normal;padding-bottom:var(--jse-padding, 10px)}.jse-modal.jse-sort.svelte-jdii8g table th input.jse-path.svelte-jdii8g,.jse-modal.jse-sort.svelte-jdii8g table td input.jse-path.svelte-jdii8g{width:100%;box-sizing:border-box;padding:6px 16px;border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:var(--jse-input-radius, 3px);font-family:inherit;font-size:inherit;background:inherit;color:inherit;outline:none}.jse-modal.jse-sort.svelte-jdii8g table th input.jse-path.svelte-jdii8g:read-only,.jse-modal.jse-sort.svelte-jdii8g table td input.jse-path.svelte-jdii8g:read-only{background:var(--jse-input-background-readonly, transparent)}.jse-modal.jse-sort.svelte-jdii8g table th.svelte-jdii8g .svelte-select input,.jse-modal.jse-sort.svelte-jdii8g table td.svelte-jdii8g .svelte-select input{box-sizing:border-box}.jse-modal.jse-sort.svelte-jdii8g .jse-space.svelte-jdii8g{height:200px}.jse-modal.jse-sort.svelte-jdii8g .jse-space .jse-error.svelte-jdii8g{color:var(--jse-error-color, #ee5341)}')}function pj(n){var e,t,r,i,o,s,a;function l(u){n[14](u)}var c={showChevron:!0,items:n[5]};return n[1]!==void 0&&(c.value=n[1]),o=new la({props:c}),It.push(function(){return oi(o,"value",l)}),{c:function(){e=V("tr"),(t=V("th")).textContent="Property",r=ce(),i=V("td"),je(o.$$.fragment),j(t,"class","svelte-jdii8g"),j(i,"class","svelte-jdii8g")},m:function(u,f){ee(u,e,f),E(e,t),E(e,r),E(e,i),be(o,i,null),a=!0},p:function(u,f){var d={};32&f&&(d.items=u[5]),!s&&2&f&&(s=!0,d.value=u[1],ii(function(){return s=!1})),o.$set(d)},i:function(u){a||(C(o.$$.fragment,u),a=!0)},o:function(u){M(o.$$.fragment,u),a=!1},d:function(u){u&&Z(e),we(o)}}}function mj(n){var e,t;return{c:function(){e=V("div"),t=De(n[4]),j(e,"class","jse-error svelte-jdii8g")},m:function(r,i){ee(r,e,i),E(e,t)},p:function(r,i){16&i&>(t,r[4])},d:function(r){r&&Z(e)}}}function bK(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D,U,q,X,K,Y;r=new tp({props:{title:n[3]?"Sort array items":"Sort object keys"}});var T=n[3]&&(n[5]&&((e=n[5])===null||e===void 0?void 0:e.length)>1||n[1]===void 0)&&pj(n);function B(te){n[15](te)}var O={showChevron:!0,clearable:!1,items:n[7]};n[2]!==void 0&&(O.value=n[2]),$=new la({props:O}),It.push(function(){return oi($,"value",B)});var A=n[4]&&mj(n);return{c:function(){var te;t=V("div"),je(r.$$.fragment),i=ce(),o=V("div"),s=V("table"),(a=V("colgroup")).innerHTML=' ',l=ce(),c=V("tbody"),u=V("tr"),(f=V("th")).textContent="Path",d=ce(),h=V("td"),p=V("input"),v=ce(),T&&T.c(),g=ce(),b=V("tr"),(y=V("th")).textContent="Direction",x=ce(),w=V("td"),je($.$$.fragment),_=ce(),F=V("div"),A&&A.c(),I=ce(),W=V("div"),D=V("button"),U=De("Sort"),j(f,"class","svelte-jdii8g"),j(p,"class","jse-path svelte-jdii8g"),j(p,"type","text"),p.readOnly=!0,j(p,"title","Selected path"),p.value=m=hn(n[0])?"(document root)":mi(n[0]),j(h,"class","svelte-jdii8g"),j(y,"class","svelte-jdii8g"),j(w,"class","svelte-jdii8g"),j(s,"class","svelte-jdii8g"),j(F,"class","jse-space svelte-jdii8g"),j(D,"type","button"),j(D,"class","jse-primary svelte-jdii8g"),D.disabled=q=!!(n[3]&&n[5]&&((te=n[5])===null||te===void 0?void 0:te.length)>1)&&!n[1],j(W,"class","jse-actions svelte-jdii8g"),j(o,"class","jse-modal-contents svelte-jdii8g"),j(t,"class","jse-modal jse-sort svelte-jdii8g")},m:function(te,R){ee(te,t,R),be(r,t,null),E(t,i),E(t,o),E(o,s),E(s,a),E(s,l),E(s,c),E(c,u),E(u,f),E(u,d),E(u,h),E(h,p),E(c,v),T&&T.m(c,null),E(c,g),E(c,b),E(b,y),E(b,x),E(b,w),be($,w,null),E(o,_),E(o,F),A&&A.m(F,null),E(o,I),E(o,W),E(W,D),E(D,U),X=!0,K||(Y=[Ce(D,"click",n[8]),mr(wK.call(null,D)),mr(Lu.call(null,t,n[6]))],K=!0)},p:function(te,R){var k,P,H=At(R,1)[0],J={};8&H&&(J.title=te[3]?"Sort array items":"Sort object keys"),r.$set(J),(!X||1&H&&m!==(m=hn(te[0])?"(document root)":mi(te[0]))&&p.value!==m)&&(p.value=m),te[3]&&(te[5]&&((k=te[5])===null||k===void 0?void 0:k.length)>1||te[1]===void 0)?T?(T.p(te,H),42&H&&C(T,1)):((T=pj(te)).c(),C(T,1),T.m(c,g)):T&&(Ee(),M(T,1,1,function(){T=null}),Ae());var he={};!S&&4&H&&(S=!0,he.value=te[2],ii(function(){return S=!1})),$.$set(he),te[4]?A?A.p(te,H):((A=mj(te)).c(),A.m(F,null)):A&&(A.d(1),A=null),(!X||42&H&&q!==(q=!!(te[3]&&te[5]&&((P=te[5])===null||P===void 0?void 0:P.length)>1)&&!te[1]))&&(D.disabled=q)},i:function(te){X||(C(r.$$.fragment,te),C(T),C($.$$.fragment,te),X=!0)},o:function(te){M(r.$$.fragment,te),M(T),M($.$$.fragment,te),X=!1},d:function(te){te&&Z(t),we(r),T&&T.d(),we($),A&&A.d(),K=!1,kn(Y)}}}function wK(n){n.focus()}function xK(n,e,t){var r,i,o,s,a,l=Sr("jsoneditor:SortModal"),c=e.id,u=e.json,f=e.rootPath,d=e.onSort,h=Er("simple-modal").close,p="".concat(c,":").concat(Ue(f)),m=Ye(u,f),v={value:1,label:"ascending"},g=[v,{value:-1,label:"descending"}],b=(r=Ka[p])===null||r===void 0?void 0:r.selectedProperty,y=((i=Ka[p])===null||i===void 0?void 0:i.selectedDirection)||v,x=void 0;return n.$$set=function(w){"id"in w&&t(9,c=w.id),"json"in w&&t(10,u=w.json),"rootPath"in w&&t(0,f=w.rootPath),"onSort"in w&&t(11,d=w.onSort)},n.$$.update=function(){8&n.$$.dirty&&t(13,s=o&&m!==void 0?Ag(m):void 0),8192&n.$$.dirty&&t(5,a=s?s.map(xc):void 0),4102&n.$$.dirty&&(t(12,Ka[p]={selectedProperty:b,selectedDirection:y},Ka),l("store state in memory",p,Ka[p]))},t(3,o=Array.isArray(m)),[f,b,y,o,x,a,h,g,function(){try{var w,$,S;t(4,x=void 0);var _=((w=b)===null||w===void 0?void 0:w.value)||(($=a)===null||$===void 0||($=$[0])===null||$===void 0?void 0:$.value)||[],F=(S=y)===null||S===void 0?void 0:S.value,I=r6(u,f,_,F);d({operations:I,rootPath:f,itemPath:_,direction:F}),h()}catch(W){t(4,x=String(W))}},c,u,d,Ka,s,function(w){t(1,b=w)},function(w){t(2,y=w)}]}var jK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,xK,bK,Tt,{id:9,json:10,rootPath:0,onSort:11},yK),r}return ht(e,mt),ut(e)}();function Zi(){}function Lf(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(n<.9*e)return n.toFixed()+" B";var t=n/e;if(t<.9*e)return t.toFixed(1)+" KB";var r=t/e;if(r<.9*e)return r.toFixed(1)+" MB";var i=r/e;return i<.9*e?i.toFixed(1)+" GB":(i/e).toFixed(1)+" TB"}function $K(n){var e,t;return e=new rp({props:{items:n[0]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&At(i,1)[0]&&(o.items=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function kK(n,e,t){var r,i,o=e.readOnly,s=o!==void 0&&o,a=e.onFormat,l=e.onCompact,c=e.onSort,u=e.onTransform,f=e.onToggleSearch,d=e.onUndo,h=e.onRedo,p=e.canUndo,m=e.canRedo,v=e.canFormat,g=e.canCompact,b=e.canSort,y=e.canTransform,x=e.onRenderMenu,w={type:"button",icon:kh,title:"Search (Ctrl+F)",className:"jse-search",onClick:f};return n.$$set=function($){"readOnly"in $&&t(1,s=$.readOnly),"onFormat"in $&&t(2,a=$.onFormat),"onCompact"in $&&t(3,l=$.onCompact),"onSort"in $&&t(4,c=$.onSort),"onTransform"in $&&t(5,u=$.onTransform),"onToggleSearch"in $&&t(6,f=$.onToggleSearch),"onUndo"in $&&t(7,d=$.onUndo),"onRedo"in $&&t(8,h=$.onRedo),"canUndo"in $&&t(9,p=$.canUndo),"canRedo"in $&&t(10,m=$.canRedo),"canFormat"in $&&t(11,v=$.canFormat),"canCompact"in $&&t(12,g=$.canCompact),"canSort"in $&&t(13,b=$.canSort),"canTransform"in $&&t(14,y=$.canTransform),"onRenderMenu"in $&&t(15,x=$.onRenderMenu)},n.$$.update=function(){32702&n.$$.dirty&&t(16,i=s?[w,{type:"space"}]:[{type:"button",icon:Vg,title:"Format JSON: add proper indentation and new lines (Ctrl+I)",className:"jse-format",onClick:a,disabled:s||!v},{type:"button",icon:PW,title:"Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)",className:"jse-compact",onClick:l,disabled:s||!g},{type:"separator"},{type:"button",icon:$h,title:"Sort",className:"jse-sort",onClick:c,disabled:s||!b},{type:"button",icon:xh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:u,disabled:s||!y},w,{type:"separator"},{type:"button",icon:dv,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:d,disabled:!p},{type:"button",icon:fv,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:h,disabled:!m},{type:"space"}]),98304&n.$$.dirty&&t(0,r=x(i)||i)},[r,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,i]}var SK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,kK,$K,Tt,{readOnly:1,onFormat:2,onCompact:3,onSort:4,onTransform:5,onToggleSearch:6,onUndo:7,onRedo:8,canUndo:9,canRedo:10,canFormat:11,canCompact:12,canSort:13,canTransform:14,onRenderMenu:15}),r}return ht(e,mt),ut(e)}();function CK(n){Et(n,"svelte-hhcn0f",'.jse-status-bar.svelte-hhcn0f.svelte-hhcn0f{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);margin:0;border-top:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7));border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);display:flex;gap:var(--jse-padding, 10px)}.jse-status-bar.svelte-hhcn0f.svelte-hhcn0f:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-status-bar.svelte-hhcn0f .jse-status-bar-info.svelte-hhcn0f{padding:2px}')}function gj(n){var e,t,r;return{c:function(){e=V("div"),t=De("Line: "),r=De(n[0]),j(e,"class","jse-status-bar-info svelte-hhcn0f")},m:function(i,o){ee(i,e,o),E(e,t),E(e,r)},p:function(i,o){1&o&>(r,i[0])},d:function(i){i&&Z(e)}}}function vj(n){var e,t,r;return{c:function(){e=V("div"),t=De("Column: "),r=De(n[1]),j(e,"class","jse-status-bar-info svelte-hhcn0f")},m:function(i,o){ee(i,e,o),E(e,t),E(e,r)},p:function(i,o){2&o&>(r,i[1])},d:function(i){i&&Z(e)}}}function yj(n){var e,t,r,i;return{c:function(){e=V("div"),t=De("Selection: "),r=De(n[2]),i=De(" characters"),j(e,"class","jse-status-bar-info svelte-hhcn0f")},m:function(o,s){ee(o,e,s),E(e,t),E(e,r),E(e,i)},p:function(o,s){4&s&>(r,o[2])},d:function(o){o&&Z(e)}}}function OK(n){var e,t,r,i=n[0]!==void 0&&gj(n),o=n[1]!==void 0&&vj(n),s=n[2]!==void 0&&n[2]>0&&yj(n);return{c:function(){e=V("div"),i&&i.c(),t=ce(),o&&o.c(),r=ce(),s&&s.c(),j(e,"class","jse-status-bar svelte-hhcn0f")},m:function(a,l){ee(a,e,l),i&&i.m(e,null),E(e,t),o&&o.m(e,null),E(e,r),s&&s.m(e,null)},p:function(a,l){var c=At(l,1)[0];a[0]!==void 0?i?i.p(a,c):((i=gj(a)).c(),i.m(e,t)):i&&(i.d(1),i=null),a[1]!==void 0?o?o.p(a,c):((o=vj(a)).c(),o.m(e,r)):o&&(o.d(1),o=null),a[2]!==void 0&&a[2]>0?s?s.p(a,c):((s=yj(a)).c(),s.m(e,null)):s&&(s.d(1),s=null)},i:Te,o:Te,d:function(a){a&&Z(e),i&&i.d(),o&&o.d(),s&&s.d()}}}function MK(n,e,t){var r,i,o,s,a,l=e.editorState;return n.$$set=function(c){"editorState"in c&&t(3,l=c.editorState)},n.$$.update=function(){var c,u,f;8&n.$$.dirty&&t(4,r=(c=l)===null||c===void 0||(c=c.selection)===null||c===void 0||(c=c.main)===null||c===void 0?void 0:c.head),24&n.$$.dirty&&t(5,i=r!==void 0?(u=l)===null||u===void 0||(u=u.doc)===null||u===void 0?void 0:u.lineAt(r):void 0),32&n.$$.dirty&&t(0,o=i!==void 0?i.number:void 0),48&n.$$.dirty&&t(1,s=i!==void 0&&r!==void 0?r-i.from+1:void 0),8&n.$$.dirty&&t(2,a=(f=l)===null||f===void 0||(f=f.selection)===null||f===void 0||(f=f.ranges)===null||f===void 0?void 0:f.reduce(function(d,h){return d+h.to-h.from},0))},[o,s,a,l,r,i]}var EK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,MK,OK,yr,{editorState:3},CK),r}return ht(e,mt),ut(e)}(),r1=Su.define([{tag:Ve.propertyName,color:"var(--internal-key-color)"},{tag:Ve.number,color:"var(--internal-value-color-number)"},{tag:Ve.bool,color:"var(--internal-value-color-boolean)"},{tag:Ve.string,color:"var(--internal-value-color-string)"},{tag:Ve.keyword,color:"var(--internal-value-color-null)"}]),AK=GS(r1),TK=r1.style;function PK(n){Et(n,"svelte-a0poeb",'.jse-text-mode.svelte-a0poeb.svelte-a0poeb{--internal-key-color:var(--jse-key-color, #1a1a1a);--internal-value-color-number:var(--jse-value-color-number, #ee422e);--internal-value-color-boolean:var(--jse-value-color-boolean, #ff8c00);--internal-value-color-string:var(--jse-value-color-string, #008000);--internal-value-color-null:var(--jse-value-color-null, #004ed0);flex:1;box-sizing:border-box;display:flex;flex-direction:column;background:var(--jse-background-color, #fff)}.jse-text-mode.no-main-menu.svelte-a0poeb.svelte-a0poeb{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb{flex:1;display:flex;position:relative;flex-direction:column;overflow:hidden;min-width:0;min-height:0;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.jse-hidden.svelte-a0poeb{visibility:hidden;position:absolute;top:0;left:0}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor{flex:1;overflow:hidden}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-scroller{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);line-height:var(--jse-line-height, calc(1em + 4px));color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-gutters{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);border-right:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-activeLine,.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-activeLineGutter{background:var(--jse-active-line-background-color, rgba(0, 0, 0, 0.06))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-selectionBackground{background:var(--jse-selection-background-color, #d3d3d3)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-searchMatch{background-color:var(--jse-search-match-color, #ffe665);outline:var(--jse-search-match-outline, 1px solid #ffd700)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-searchMatch.cm-searchMatch-selected{background-color:var(--jse-search-match-active-color, #ffd700);outline:var(--jse-search-match-active-outline, 1px solid #e1be00)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-selectionMatch{background-color:var(--jse-search-match-background-color, rgba(153, 255, 119, 0.5019607843))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-foldPlaceholder{background:var(--jse-tag-background, rgba(0, 0, 0, 0.2));color:var(--jse-tag-color, var(--jse-text-color-inverse, #fff));border:none;padding:0 var(--jse-padding, 10px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-tooltip{font-size:var(--jse-font-size, 16px);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);color:var(--jse-tooltip-color, var(--jse-text-color, #4d4d4d));background:var(--jse-tooltip-background, var(--jse-modal-background, #f5f5f5));border:var(--jse-tooltip-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-diagnosticAction{background:var(--jse-tooltip-action-button-color, var(--jse-text-color-inverse, #fff));background:var(--jse-tooltip-action-button-background, #4d4d4d)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-panels{border-bottom:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color, var(--jse-text-color, #4d4d4d));font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search input{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);color:var(--jse-input-color, var(--jse-text-color, #4d4d4d));border:var(--jse-input-border, 1px solid #d8dbdf);background:var(--jse-input-background, var(--jse-background-color, #fff));margin-right:2px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);color:var(--jse-panel-button-color, inherit);background:var(--jse-panel-button-background, transparent);border:none;cursor:pointer;text-transform:capitalize;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px);margin:0}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button:hover{color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search label{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);padding-left:var(--jse-padding, 10px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search label input{margin-right:2px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .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-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-cursor-primary{border-color:var(--jse-text-color, #4d4d4d)}.jse-text-mode.svelte-a0poeb .jse-contents .jse-loading-space.svelte-a0poeb{flex:1}.jse-text-mode.svelte-a0poeb .jse-contents .jse-loading.svelte-a0poeb{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-text-mode.svelte-a0poeb .jse-contents.jse-preview.svelte-a0poeb{flex:1;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-panel-color-readonly, #b2b2b2);overflow:auto;white-space:pre-wrap;word-break:break-word;padding:2px}')}function rm(n){var e=n.slice(),t=e[11].length===0;return e[99]=t,e}function bj(n){var e,t;return e=new SK({props:{readOnly:n[1],onFormat:n[17],onCompact:n[18],onSort:n[19],onTransform:n[20],onToggleSearch:n[21],onUndo:n[22],onRedo:n[23],canFormat:!n[99],canCompact:!n[99],canSort:!n[99],canTransform:!n[99],canUndo:n[12],canRedo:n[13],onRenderMenu:n[4]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};2&i[0]&&(o.readOnly=r[1]),2048&i[0]&&(o.canFormat=!r[99]),2048&i[0]&&(o.canCompact=!r[99]),2048&i[0]&&(o.canSort=!r[99]),2048&i[0]&&(o.canTransform=!r[99]),4096&i[0]&&(o.canUndo=r[12]),8192&i[0]&&(o.canRedo=r[13]),16&i[0]&&(o.onRenderMenu=r[4]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function _K(n){var e;return{c:function(){(e=V("div")).innerHTML='
loading...
',j(e,"class","jse-contents svelte-a0poeb")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function RK(n){var e,t,r,i,o,s=n[98]&&wj(n),a=!n[98]&&xj(n);return{c:function(){e=V("div"),t=ce(),s&&s.c(),r=ce(),a&&a.c(),i=an(),j(e,"class","jse-contents svelte-a0poeb"),$e(e,"jse-hidden",n[98])},m:function(l,c){ee(l,e,c),n[53](e),ee(l,t,c),s&&s.m(l,c),ee(l,r,c),a&&a.m(l,c),ee(l,i,c),o=!0},p:function(l,c){(!o||268438016&c[0])&&$e(e,"jse-hidden",l[98]),l[98]?s?(s.p(l,c),2560&c[0]&&C(s,1)):((s=wj(l)).c(),C(s,1),s.m(r.parentNode,r)):s&&(Ee(),M(s,1,1,function(){s=null}),Ae()),l[98]?a&&(Ee(),M(a,1,1,function(){a=null}),Ae()):a?(a.p(l,c),2560&c[0]&&C(a,1)):((a=xj(l)).c(),C(a,1),a.m(i.parentNode,i))},i:function(l){o||(C(s),C(a),o=!0)},o:function(l){M(s),M(a),o=!1},d:function(l){l&&(Z(e),Z(t),Z(r),Z(i)),n[53](null),s&&s.d(l),a&&a.d(l)}}}function wj(n){var e,t,r,i,o,s=as(n[11]||"",Cg)+"";return e=new po({props:{icon:La,type:"error",message:"The JSON document is larger than ".concat(Lf(Og,1024),", ")+"and may crash your browser when loading it in text mode. Actual size: ".concat(Lf(n[11].length,1024),"."),actions:[{text:"Open anyway",title:"Open the document in text mode. This may freeze or crash your browser.",onClick:n[24]},{text:"Open in tree mode",title:"Open the document in tree mode. Tree mode can handle large documents.",onClick:n[25]},{text:"Cancel",title:"Cancel opening this large document.",onClick:n[26]}],onClose:n[5]}}),{c:function(){je(e.$$.fragment),t=ce(),r=V("div"),i=De(s),j(r,"class","jse-contents jse-preview svelte-a0poeb")},m:function(a,l){be(e,a,l),ee(a,t,l),ee(a,r,l),E(r,i),o=!0},p:function(a,l){var c={};2048&l[0]&&(c.message="The JSON document is larger than ".concat(Lf(Og,1024),", ")+"and may crash your browser when loading it in text mode. Actual size: ".concat(Lf(a[11].length,1024),".")),e.$set(c),(!o||2048&l[0])&&s!==(s=as(a[11]||"",Cg)+"")&>(i,s)},i:function(a){o||(C(e.$$.fragment,a),o=!0)},o:function(a){M(e.$$.fragment,a),o=!1},d:function(a){a&&(Z(t),Z(r)),we(e,a)}}}function xj(n){var e,t,r,i,o,s=!n[14]&&n[0]&&k2(n[11]),a=n[3]&&jj(n),l=n[14]&&$j(n),c=s&&kj(n);return i=new G0({props:{validationErrors:n[10],selectError:n[27]}}),{c:function(){a&&a.c(),e=ce(),l&&l.c(),t=ce(),c&&c.c(),r=ce(),je(i.$$.fragment)},m:function(u,f){a&&a.m(u,f),ee(u,e,f),l&&l.m(u,f),ee(u,t,f),c&&c.m(u,f),ee(u,r,f),be(i,u,f),o=!0},p:function(u,f){u[3]?a?(a.p(u,f),8&f[0]&&C(a,1)):((a=jj(u)).c(),C(a,1),a.m(e.parentNode,e)):a&&(Ee(),M(a,1,1,function(){a=null}),Ae()),u[14]?l?(l.p(u,f),16384&f[0]&&C(l,1)):((l=$j(u)).c(),C(l,1),l.m(t.parentNode,t)):l&&(Ee(),M(l,1,1,function(){l=null}),Ae()),18433&f[0]&&(s=!u[14]&&u[0]&&k2(u[11])),s?c?(c.p(u,f),18433&f[0]&&C(c,1)):((c=kj(u)).c(),C(c,1),c.m(r.parentNode,r)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae());var d={};1024&f[0]&&(d.validationErrors=u[10]),i.$set(d)},i:function(u){o||(C(a),C(l),C(c),C(i.$$.fragment,u),o=!0)},o:function(u){M(a),M(l),M(c),M(i.$$.fragment,u),o=!1},d:function(u){u&&(Z(e),Z(t),Z(r)),a&&a.d(u),l&&l.d(u),c&&c.d(u),we(i,u)}}}function jj(n){var e,t;return e=new EK({props:{editorState:n[8]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};256&i[0]&&(o.editorState=r[8]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function $j(n){var e,t;return e=new po({props:{type:"error",icon:La,message:n[14].message,actions:n[15],onClick:n[29],onClose:n[5]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};16384&i[0]&&(o.message=r[14].message),32768&i[0]&&(o.actions=r[15]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function kj(n){var e,t;return e=new po({props:{type:"success",message:"Do you want to format the JSON?",actions:[{icon:Vg,text:"Format",title:"Format JSON: add proper indentation and new lines (Ctrl+I)",onClick:n[17]},{icon:Hc,text:"No thanks",title:"Close this message",onClick:n[54]}],onClose:n[5]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i[0]&&(o.actions=[{icon:Vg,text:"Format",title:"Format JSON: add proper indentation and new lines (Ctrl+I)",onClick:r[17]},{icon:Hc,text:"No thanks",title:"Close this message",onClick:r[54]}]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function NK(n){var e,t,r,i,o,s=n[2]&&bj(rm(n)),a=[RK,_K],l=[];function c(u,f){return f===0?function(d){var h=d.slice(),p=h[28](h[11],h[9]);return h[98]=p,h}(u):u}return r=function(u,f){return u[16]?1:0}(n),i=l[r]=a[r](c(n,r)),{c:function(){e=V("div"),s&&s.c(),t=ce(),i.c(),j(e,"class","jse-text-mode svelte-a0poeb"),$e(e,"no-main-menu",!n[2])},m:function(u,f){ee(u,e,f),s&&s.m(e,null),E(e,t),l[r].m(e,null),n[55](e),o=!0},p:function(u,f){u[2]?s?(s.p(rm(u),f),4&f[0]&&C(s,1)):((s=bj(rm(u))).c(),C(s,1),s.m(e,t)):s&&(Ee(),M(s,1,1,function(){s=null}),Ae()),i.p(c(u,r),f),(!o||4&f[0])&&$e(e,"no-main-menu",!u[2])},i:function(u){o||(C(s),C(i),o=!0)},o:function(u){M(s),M(i),o=!1},d:function(u){u&&Z(e),s&&s.d(),l[r].d(),n[55](null)}}}function Sj(n){return{from:n.from||0,to:n.to||0,message:n.message||"",actions:n.actions,severity:n.severity}}function IK(n,e,t){var r,i,o,s,a,l,c=e.readOnly,u=e.mainMenuBar,f=e.statusBar,d=e.askToFormat,h=e.externalContent,p=e.externalSelection,m=e.indentation,v=e.tabSize,g=e.escapeUnicodeCharacters,b=e.parser,y=e.validator,x=e.validationParser,w=e.onChange,$=e.onChangeMode,S=e.onSelect,_=e.onError,F=e.onFocus,I=e.onBlur,W=e.onRenderMenu,D=e.onSortModal,U=e.onTransformModal,q=Sr("jsoneditor:TextMode"),X={key:"Mod-i",run:tn,shift:Qt,preventDefault:!0},K=typeof window=="undefined";q("isSSR:",K);var Y=!1,T=[],B=new Uo,O=new Uo,A=new Uo,te=new Uo,R=new Uo,k=h,P=Tg(k,m,b),H=g;Hi($t(Pe().mark(function me(){return Pe().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(!K){Be.next=2;break}return Be.abrupt("return");case 2:try{a=He({target:o,initialText:Ge(P,Y)?"":r.escapeValue(P),readOnly:c,indentation:m})}catch(St){console.error(St)}case 3:case"end":return Be.stop()}},me)}))),Mi(function(){a&&(q("Destroy CodeMirror editor"),a.destroy())});var J=!1,he=!1,Se=Cl(),pe=Cl();function ae(){a&&(q("focus"),a.focus())}var Qe=!1;function et(me,Be){q("handlePatch",me,Be);var St=b.parse(P),Lt=ro(St,me),_t=a$(St,me);return nn({text:b.stringify(Lt,null,m)},Be,!1),{json:Lt,previousJson:St,undo:_t,redo:me}}function tn(){if(q("format"),c)return!1;try{var me=b.parse(P);return nn({text:b.stringify(me,null,m)},!0,!1),!0}catch(Be){_(Be)}return!1}function Qt(){if(q("compact"),c)return!1;try{var me=b.parse(P);return nn({text:b.stringify(me)},!0,!1),!0}catch(Be){_(Be)}return!1}function oe(){if(q("repair"),!c)try{nn({text:Ao(P)},!0,!1),t(52,On=Up),t(14,zn=null)}catch(me){_(me)}}function st(me){var Be=me.id,St=me.rootPath,Lt=me.onTransform,_t=me.onClose;try{var Yt=b.parse(P);Qe=!0,U({id:Be||pe,json:Yt,rootPath:St||[],onTransform:function(de){Lt?Lt({operations:de,json:Yt,transformedJson:ro(Yt,de)}):(q("onTransform",de),et(de,!0))},onClose:function(){Qe=!1,ae(),_t&&_t()}})}catch(de){_(de)}}function Ht(me,Be){q("setSelection",{anchor:me,head:Be}),a&&a.dispatch(a.state.update({selection:{anchor:me,head:Be},scrollIntoView:!0}))}function qe(me,Be){if(Be.state.selection.ranges.length===1){var St=Be.state.selection.ranges[0],Lt=P.slice(St.from,St.to);if(Lt==="{"||Lt==="["){var _t=od.parse(P),Yt=Object.keys(_t.pointers).find(function(tt){var We;return((We=_t.pointers[tt].value)===null||We===void 0?void 0:We.pos)===St.from}),de=_t.pointers[Yt];Yt&&de&&de.value&&de.valueEnd&&(q("pointer found, selecting inner contents of path:",Yt,de),Ht(de.value.pos+1,de.valueEnd.pos-1))}}}function Dt(){return ZN(Pt,{delay:300})}function He(me){var Be=me.target,St=me.initialText,Lt=me.readOnly,_t=me.indentation;q("Create CodeMirror editor",{readOnly:Lt,indentation:_t});var Yt=vn.create({doc:St,selection:L(p),extensions:[vd.of([HN,X]),B.of(Dt()),lI(),xR(),kR(),H_(),F9(),p9(),__(),L_(),vn.allowMultipleSelections.of(!0),e9(),GS(y9,{fallback:!0}),S9(),$D(),RD(),nR(),oR(),Q_(),CI(),vd.of([].concat(Vt(OD),Vt(VN),Vt(WI),Vt(X9),Vt(u9),Vt(nC),Vt(YN))),AK,FD({hideFirstIndent:!0}),Ze.domEventHandlers({dblclick:qe}),Ze.updateListener.of(function(de){t(8,l=de.state),de.docChanged?rt():de.selectionSet&&Wt()}),xI(),NI({top:!0}),Ze.lineWrapping,O.of(vn.readOnly.of(Lt)),te.of(vn.tabSize.of(v)),A.of(Re(_t)),R.of(Ze.theme({},{dark:wt()}))]});return a=new Ze({state:Yt,parent:Be})}function wt(){return!!o&&getComputedStyle(o).getPropertyValue("--jse-theme").includes("dark")}function Oe(me){var Be=me.path,St=me.message,Lt=me.severity,_t=function(Yt,de){try{var tt=od.parse(Yt),We=Ue(de),N=tt.pointers[We];if(N)return{path:de,line:N.key?N.key.line:N.value?N.value.line:0,column:N.key?N.key.column:N.value?N.value.column:0,from:N.key?N.key.pos:N.value?N.value.pos:0,to:N.keyEnd?N.keyEnd.pos:N.valueEnd?N.valueEnd.pos:0}}catch(G){console.error(G)}return{path:de,line:0,column:0,from:0,to:0}}(r.escapeValue(P),Be);return{path:Be,line:_t.line,column:_t.column,from:_t.from,to:_t.to,message:St,severity:Lt,actions:[]}}function Xe(me,Be){var St=me.line,Lt=me.column,_t=me.position,Yt=me.message;return{path:[],line:St,column:Lt,from:_t,to:_t,severity:oo.error,message:Yt,actions:Be&&!c?[{name:"Auto repair",apply:function(){return oe()}}]:null}}function nn(me,Be,St){var Lt=Tg(me,m,b),_t=!sn(me,k),Yt=k;q("setCodeMirrorContent",{isChanged:_t,emitChange:Be,forceUpdate:St}),a&&(_t||St)&&(k=me,t(11,P=Lt),Ge(P,Y)||a.dispatch({changes:{from:0,to:a.state.doc.length,insert:r.escapeValue(P)}}),at(),_t&&Be&&Zt(k,Yt))}function L(me){return D2(me)?_e.fromJSON(me):void 0}function ne(){return(ne=$t(Pe().mark(function me(){return Pe().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return q("refresh"),Be.next=3,ge();case 3:case"end":return Be.stop()}},me)}))).apply(this,arguments)}function se(){if(a){var me=a?r.unescapeValue(a.state.doc.toString()):"",Be=me!==P;if(q("onChangeCodeMirrorValue",{isChanged:Be}),Be){var St=k;t(11,P=me),k={text:P},at(),Zt(k,St),fr().then(Wt)}}}function ge(){return ke.apply(this,arguments)}function ke(){return(ke=$t(Pe().mark(function me(){var Be;return Pe().wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,fr();case 2:a&&(Be=wt(),q("updateTheme",{dark:Be}),a.dispatch({effects:[R.reconfigure(Ze.theme({},{dark:Be}))]}));case 3:case"end":return St.stop()}},me)}))).apply(this,arguments)}function Re(me){var Be=Eh.of(typeof me=="number"?" ".repeat(me):me);return me===" "?[Be]:[Be,VD]}function at(){t(12,J=H9(a.state)>0),t(13,he=U9(a.state)>0),q({canUndo:J,canRedo:he})}Mi(function(){Xt()}),K0({onMount:Hi,onDestroy:Mi,getWindow:function(){return Ql(s)},hasFocus:function(){return Qe&&document.hasFocus()||F0(s)},onFocus:F,onBlur:function(){Xt(),I()}});var rt=ud(se,300);function Xt(){rt.flush()}function Zt(me,Be){w&&w(me,Be,{contentErrors:Mn(),patchResult:null})}function Wt(){S(fe({type:_n.text},l.selection.toJSON()))}function Ge(me,Be){return!!me&&me.length>Og&&!Be}var On=Up,zn=null;function Pt(){if(Ge(P,Y))return[];var me=Mn();return Uw(me)?[Sj(Xe(me.parseError,me.isRepairable))]:hU(me)?me.validationErrors.map(Oe).map(Sj):[]}function Mn(){q("validate:start"),Xt();var me=Dn(r.escapeValue(P),y,b,x);return Uw(me)?(t(52,On=me.isRepairable?y2:"invalid"),t(14,zn=me.parseError),t(10,T=[])):(t(52,On=Up),t(14,zn=null),t(10,T=(me==null?void 0:me.validationErrors)||[])),q("validate:end"),me}var Dn=wu(YH);function er(){zn&&function(me){q("select parse error",me);var Be=Xe(me,!1);Ht(Be.from!=null?Be.from:0,Be.to!=null?Be.to:0),ae()}(zn)}var fn={icon:mT,text:"Show me",title:"Move to the parse error location",onClick:er};return n.$$set=function(me){"readOnly"in me&&t(1,c=me.readOnly),"mainMenuBar"in me&&t(2,u=me.mainMenuBar),"statusBar"in me&&t(3,f=me.statusBar),"askToFormat"in me&&t(0,d=me.askToFormat),"externalContent"in me&&t(30,h=me.externalContent),"externalSelection"in me&&t(31,p=me.externalSelection),"indentation"in me&&t(32,m=me.indentation),"tabSize"in me&&t(33,v=me.tabSize),"escapeUnicodeCharacters"in me&&t(34,g=me.escapeUnicodeCharacters),"parser"in me&&t(35,b=me.parser),"validator"in me&&t(36,y=me.validator),"validationParser"in me&&t(37,x=me.validationParser),"onChange"in me&&t(38,w=me.onChange),"onChangeMode"in me&&t(39,$=me.onChangeMode),"onSelect"in me&&t(40,S=me.onSelect),"onError"in me&&t(41,_=me.onError),"onFocus"in me&&t(42,F=me.onFocus),"onBlur"in me&&t(43,I=me.onBlur),"onRenderMenu"in me&&t(4,W=me.onRenderMenu),"onSortModal"in me&&t(44,D=me.onSortModal),"onTransformModal"in me&&t(45,U=me.onTransformModal)},n.$$.update=function(){8&n.$$.dirty[1]&&(r=B0({escapeControlCharacters:!1,escapeUnicodeCharacters:g})),1073741824&n.$$.dirty[0]&&nn(h,!1,!1),1&n.$$.dirty[1]&&function(me){if(D2(me)){var Be=L(me);!a||!Be||l&&l.selection.eq(Be)||(q("applyExternalSelection",Be),a.dispatch({selection:Be}))}}(p),32&n.$$.dirty[1]&&function(me){q("updateLinter",me),a&&a.dispatch({effects:B.reconfigure(Dt())})}(y),2&n.$$.dirty[1]&&function(me){a&&(q("updateIndentation",me),a.dispatch({effects:A.reconfigure(Re(me))}))}(m),4&n.$$.dirty[1]&&function(me){a&&(q("updateTabSize",me),a.dispatch({effects:te.reconfigure(vn.tabSize.of(me))}))}(v),2&n.$$.dirty[0]&&function(me){a&&(q("updateReadOnly",me),a.dispatch({effects:[O.reconfigure(vn.readOnly.of(me))]}))}(c),1048584&n.$$.dirty[1]&&H!==g&&(t(51,H=g),q("forceUpdateText",{escapeUnicodeCharacters:g}),a&&a.dispatch({changes:{from:0,to:a.state.doc.length,insert:r.escapeValue(P)}})),2&n.$$.dirty[0]|2097152&n.$$.dirty[1]&&t(15,i=On!==y2||c?[fn]:[{icon:jh,text:"Auto repair",title:"Automatically repair JSON",onClick:oe},fn])},[d,c,u,f,W,ae,o,s,l,Y,T,P,J,he,zn,i,K,tn,Qt,function(){var me;if(!c)try{var Be=b.parse(P);Qe=!0,D({id:Se,json:Be,rootPath:[],onSort:(me=$t(Pe().mark(function St(Lt){var _t;return Pe().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:_t=Lt.operations,q("onSort",_t),et(_t,!0);case 3:case"end":return Yt.stop()}},St)})),function(St){return me.apply(this,arguments)}),onClose:function(){Qe=!1,ae()}})}catch(St){_(St)}},function(){c||st({rootPath:[]})},function(){a&&(o&&o.querySelector(".cm-search")?Vv(a):qv(a))},function(){c||a&&(Nv(a),ae())},function(){c||a&&(Cd(a),ae())},function(){t(9,Y=!0),nn(h,!0,!0)},function(){$(Dr.tree)},function(){se()},function(me){q("select validation error",me);var Be=Oe(me),St=Be.from,Lt=Be.to;St!==null&&Lt!==null&&(Ht(St,Lt),ae())},Ge,er,h,p,m,v,g,b,y,x,w,$,S,_,F,I,D,U,function(me){return et(me,!1)},et,st,function(){return ne.apply(this,arguments)},Mn,H,On,function(me){It[me?"unshift":"push"](function(){t(6,o=me)})},function(){return t(0,d=!1)},function(me){It[me?"unshift":"push"](function(){t(7,s=me)})}]}r1.style=function(n){return TK(n||[])};var DK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,IK,NK,Tt,{readOnly:1,mainMenuBar:2,statusBar:3,askToFormat:0,externalContent:30,externalSelection:31,indentation:32,tabSize:33,escapeUnicodeCharacters:34,parser:35,validator:36,validationParser:37,onChange:38,onChangeMode:39,onSelect:40,onError:41,onFocus:42,onBlur:43,onRenderMenu:4,onSortModal:44,onTransformModal:45,focus:5,patch:46,handlePatch:47,openTransformModal:48,refresh:49,validate:50},PK,[-1,-1,-1,-1]),r}return ht(e,mt),ut(e,[{key:"focus",get:function(){return this.$$.ctx[5]}},{key:"patch",get:function(){return this.$$.ctx[46]}},{key:"handlePatch",get:function(){return this.$$.ctx[47]}},{key:"openTransformModal",get:function(){return this.$$.ctx[48]}},{key:"refresh",get:function(){return this.$$.ctx[49]}},{key:"validate",get:function(){return this.$$.ctx[50]}}])}();function LK(n){var e,t;return e=new rp({props:{items:n[0]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&At(i,1)[0]&&(o.items=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function BK(n,e,t){var r,i,o=e.containsValidArray,s=e.readOnly,a=e.showSearch,l=a!==void 0&&a,c=e.historyState,u=e.onSort,f=e.onTransform,d=e.onContextMenu,h=e.onUndo,p=e.onRedo,m=e.onRenderMenu;function v(){t(1,l=!l)}return n.$$set=function(g){"containsValidArray"in g&&t(2,o=g.containsValidArray),"readOnly"in g&&t(3,s=g.readOnly),"showSearch"in g&&t(1,l=g.showSearch),"historyState"in g&&t(4,c=g.historyState),"onSort"in g&&t(5,u=g.onSort),"onTransform"in g&&t(6,f=g.onTransform),"onContextMenu"in g&&t(7,d=g.onContextMenu),"onUndo"in g&&t(8,h=g.onUndo),"onRedo"in g&&t(9,p=g.onRedo),"onRenderMenu"in g&&t(10,m=g.onRenderMenu)},n.$$.update=function(){1020&n.$$.dirty&&t(11,r=s?[{type:"space"}]:[{type:"button",icon:$h,title:"Sort",className:"jse-sort",onClick:u,disabled:s||!o},{type:"button",icon:xh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:f,disabled:s||!o},{type:"button",icon:kh,title:"Search (Ctrl+F)",className:"jse-search",onClick:v,disabled:!o},{type:"button",icon:ek,title:I0,className:"jse-contextmenu",onClick:d},{type:"separator"},{type:"button",icon:dv,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:h,disabled:!c.canUndo},{type:"button",icon:fv,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:p,disabled:!c.canRedo},{type:"space"}]),3072&n.$$.dirty&&t(0,i=m(r))},[i,l,o,s,c,u,f,d,h,p,m,r]}var zK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,BK,LK,Tt,{containsValidArray:2,readOnly:3,showSearch:1,historyState:4,onSort:5,onTransform:6,onContextMenu:7,onUndo:8,onRedo:9,onRenderMenu:10}),r}return ht(e,mt),ut(e)}();function Cj(n,e,t){var r=n.slice();return r[9]=e[t],r}function FK(n){var e,t,r=n[9].component,i=Oj(n);return{c:function(){i.c(),e=an()},m:function(o,s){i.m(o,s),ee(o,e,s),t=!0},p:function(o,s){1&s&&Tt(r,r=o[9].component)?(Ee(),M(i,1,1,Te),Ae(),(i=Oj(o)).c(),C(i,1),i.m(e.parentNode,e)):i.p(o,s)},i:function(o){t||(C(i),t=!0)},o:function(o){M(i),t=!1},d:function(o){o&&Z(e),i.d(o)}}}function qK(n){var e,t=n[9].action,r=Mj(n);return{c:function(){r.c(),e=an()},m:function(i,o){r.m(i,o),ee(i,e,o)},p:function(i,o){1&o&&Tt(t,t=i[9].action)?(r.d(1),(r=Mj(i)).c(),r.m(e.parentNode,e)):r.p(i,o)},i:Te,o:Te,d:function(i){i&&Z(e),r.d(i)}}}function Oj(n){var e,t,r,i=[n[9].props],o=n[9].component;function s(a,l){for(var c={},u=0;u0){for(var b=[v],y=on(g);y.length>0&&!Ii(m,y);)b.unshift({op:"add",path:Ue(y),value:{}}),y=on(y);return b}}return v})}(d,a.getJson()),h)}return n.$$set=function(d){"path"in d&&t(1,o=d.path),"value"in d&&t(2,s=d.value),"context"in d&&t(3,a=d.context),"enforceString"in d&&t(4,l=d.enforceString),"selection"in d&&t(5,c=d.selection),"searchResultItems"in d&&t(6,u=d.searchResultItems)},n.$$.update=function(){40&n.$$.dirty&&t(7,r=!a.readOnly&&rn(c)&&Xr(c)),254&n.$$.dirty&&t(0,i=a.onRenderValue({path:o,value:s,readOnly:a.readOnly,enforceString:l,isEditing:r,parser:a.parser,normalization:a.normalization,selection:c,searchResultItems:u,onPatch:f,onPasteJson:a.onPasteJson,onSelect:a.onSelect,onFind:a.onFind,findNextInside:a.findNextInside,focus:a.focus}))},[i,o,s,a,l,c,u,r]}var UK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,HK,VK,Tt,{path:1,value:2,context:3,enforceString:4,selection:5,searchResultItems:6}),r}return ht(e,mt),ut(e)}();function WK(n){Et(n,"svelte-1dhomzn",'.jse-inline-value.svelte-1dhomzn{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);line-height:var(--jse-line-height, calc(1em + 4px));border:none;padding:0 calc(0.5 * var(--jse-padding, 10px));background:transparent;color:inherit;cursor:pointer}.jse-inline-value.svelte-1dhomzn:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-inline-value.jse-selected.svelte-1dhomzn{background:var(--jse-selection-background-color, #d3d3d3)}.jse-inline-value.jse-highlight.svelte-1dhomzn{background-color:var(--jse-search-match-color, #ffe665);outline:var(--jse-search-match-outline, 1px solid #ffd700)}.jse-inline-value.jse-highlight.jse-active.svelte-1dhomzn{background-color:var(--jse-search-match-active-color, #ffd700);outline:var(--jse-search-match-active-outline, 1px solid #e1be00)}')}function JK(n){var e,t,r,i,o,s=as((e=n[2].stringify(n[1]))!==null&&e!==void 0?e:"",50)+"";return{c:function(){t=V("button"),r=De(s),j(t,"type","button"),j(t,"class","jse-inline-value svelte-1dhomzn"),$e(t,"jse-selected",n[3]),$e(t,"jse-highlight",n[4]),$e(t,"jse-active",n[5])},m:function(a,l){ee(a,t,l),E(t,r),i||(o=Ce(t,"dblclick",n[7]),i=!0)},p:function(a,l){var c,u=At(l,1)[0];6&u&&s!==(s=as((c=a[2].stringify(a[1]))!==null&&c!==void 0?c:"",50)+"")&>(r,s),8&u&&$e(t,"jse-selected",a[3]),16&u&&$e(t,"jse-highlight",a[4]),32&u&&$e(t,"jse-active",a[5])},i:Te,o:Te,d:function(a){a&&Z(t),i=!1,o()}}}function KK(n,e,t){var r=e.path,i=e.value,o=e.parser,s=e.isSelected,a=e.containsSearchResult,l=e.containsActiveSearchResult,c=e.onEdit;return n.$$set=function(u){"path"in u&&t(0,r=u.path),"value"in u&&t(1,i=u.value),"parser"in u&&t(2,o=u.parser),"isSelected"in u&&t(3,s=u.isSelected),"containsSearchResult"in u&&t(4,a=u.containsSearchResult),"containsActiveSearchResult"in u&&t(5,l=u.containsActiveSearchResult),"onEdit"in u&&t(6,c=u.onEdit)},[r,i,o,s,a,l,c,function(){return c(r)}]}var GK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,KK,JK,Tt,{path:0,value:1,parser:2,isSelected:3,containsSearchResult:4,containsActiveSearchResult:5,onEdit:6},WK),r}return ht(e,mt),ut(e)}();function QK(n){Et(n,"svelte-2v0aqj",".jse-column-header.svelte-2v0aqj.svelte-2v0aqj{background:none;border:none;font-family:inherit;font-size:inherit;color:inherit;display:flex;gap:var(--jse-padding, 10px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px));width:100%}.jse-column-header.svelte-2v0aqj.svelte-2v0aqj:hover{background:var(--jse-table-header-background-highlight, #e8e8e8)}.jse-column-header.svelte-2v0aqj.svelte-2v0aqj:not(.jse-column-header.jse-readonly){cursor:pointer}.jse-column-header.svelte-2v0aqj span.jse-column-sort-icon.svelte-2v0aqj{height:1em}")}function Aj(n){var e,t,r,i;return t=new un({props:{data:n[1]===Bi.asc?Ri:J1}}),{c:function(){e=V("span"),je(t.$$.fragment),j(e,"class","jse-column-sort-icon svelte-2v0aqj"),j(e,"title",r="Currently sorted in ".concat(n[2]," order"))},m:function(o,s){ee(o,e,s),be(t,e,null),i=!0},p:function(o,s){var a={};2&s&&(a.data=o[1]===Bi.asc?Ri:J1),t.$set(a),(!i||4&s&&r!==(r="Currently sorted in ".concat(o[2]," order")))&&j(e,"title",r)},i:function(o){i||(C(t.$$.fragment,o),i=!0)},o:function(o){M(t.$$.fragment,o),i=!1},d:function(o){o&&Z(e),we(t)}}}function YK(n){var e,t,r,i,o,s,a,l,c=as(n[3],50)+"",u=n[1]!==void 0&&Aj(n);return{c:function(){e=V("button"),t=V("span"),r=De(c),i=ce(),u&&u.c(),j(t,"class","jse-column-name"),j(e,"type","button"),j(e,"class","jse-column-header svelte-2v0aqj"),j(e,"title",o=n[0]?n[3]:n[3]+" (Click to sort the data by this column)"),$e(e,"jse-readonly",n[0])},m:function(f,d){ee(f,e,d),E(e,t),E(t,r),E(e,i),u&&u.m(e,null),s=!0,a||(l=Ce(e,"click",n[4]),a=!0)},p:function(f,d){var h=At(d,1)[0];(!s||8&h)&&c!==(c=as(f[3],50)+"")&>(r,c),f[1]!==void 0?u?(u.p(f,h),2&h&&C(u,1)):((u=Aj(f)).c(),C(u,1),u.m(e,null)):u&&(Ee(),M(u,1,1,function(){u=null}),Ae()),(!s||9&h&&o!==(o=f[0]?f[3]:f[3]+" (Click to sort the data by this column)"))&&j(e,"title",o),(!s||1&h)&&$e(e,"jse-readonly",f[0])},i:function(f){s||(C(u),s=!0)},o:function(f){M(u),s=!1},d:function(f){f&&Z(e),u&&u.d(),a=!1,l()}}}function XK(n,e,t){var r,i,o,s=e.path,a=e.sortedColumn,l=e.readOnly,c=e.onSort;return n.$$set=function(u){"path"in u&&t(5,s=u.path),"sortedColumn"in u&&t(6,a=u.sortedColumn),"readOnly"in u&&t(0,l=u.readOnly),"onSort"in u&&t(7,c=u.onSort)},n.$$.update=function(){var u;32&n.$$.dirty&&t(3,r=hn(s)?"values":mi(s)),96&n.$$.dirty&&t(1,i=a&&sn(s,(u=a)===null||u===void 0?void 0:u.path)?a.sortDirection:void 0),2&n.$$.dirty&&t(2,o=i?iq[i]:void 0)},[l,i,o,r,function(){l||c({path:s,sortDirection:i===Bi.asc?Bi.desc:Bi.asc})},s,a,c]}var Bf,zf,ZK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,XK,YK,Tt,{path:5,sortedColumn:6,readOnly:0,onSort:7},QK),r}return ht(e,mt),ut(e)}();function g6(n,e){return Bf||(zf=new WeakMap,Bf=new ResizeObserver(function(t){var r,i=au(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=zf.get(o.target);s&&s(o.target)}}catch(a){i.e(a)}finally{i.f()}})),zf.set(n,e),Bf.observe(n),{destroy:function(){zf.delete(n),Bf.unobserve(n)}}}function eG(n){Et(n,"svelte-fxr3ye",'.jse-table-mode-welcome.svelte-fxr3ye.svelte-fxr3ye{flex:1;display:flex;flex-direction:column;overflow:auto;align-items:center;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode-welcome.svelte-fxr3ye.svelte-fxr3ye:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode-welcome.svelte-fxr3ye .jse-space.jse-before.svelte-fxr3ye{flex:1}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays.svelte-fxr3ye{display:flex;flex-direction:column;gap:var(--jse-padding, 10px);max-width:300px;margin:2em var(--jse-padding, 10px);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays .jse-nested-arrays-info.svelte-fxr3ye{color:var(--jse-panel-color-readonly, #b2b2b2)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px;text-align:left}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action .jse-nested-array-count.svelte-fxr3ye{opacity:0.5;white-space:nowrap}.jse-table-mode-welcome.svelte-fxr3ye .jse-space.jse-after.svelte-fxr3ye{flex:2}')}function Tj(n,e,t){var r=n.slice();r[16]=e[t];var i=r[9](r[16]);return r[17]=i,r}function tG(n){var e,t;return{c:function(){e=De(n[7]),t=De(" cannot be opened in table mode.")},m:function(r,i){ee(r,e,i),ee(r,t,i)},p:function(r,i){128&i&>(e,r[7])},d:function(r){r&&(Z(e),Z(t))}}}function nG(n){var e;return{c:function(){e=De(`An object cannot be opened in table mode. You can open a nested array instead, or open the - document in tree mode.`)},m:function(t,r){ee(t,e,r)},p:Te,d:function(t){t&&Z(e)}}}function rG(n){var e;return{c:function(){e=De("You can open the document in tree mode instead.")},m:function(t,r){ee(t,e,r)},d:function(t){t&&Z(e)}}}function iG(n){var e,t,r;return{c:function(){e=De("You can open the document in tree mode instead, or paste a JSON Array using "),(t=V("b")).textContent="Ctrl+V",r=De(".")},m:function(i,o){ee(i,e,o),ee(i,t,o),ee(i,r,o)},d:function(i){i&&(Z(e),Z(t),Z(r))}}}function Pj(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p=mi(n[16])+"",m=n[17]+"",v=n[17]!==1?"items":"item";function g(){return n[13](n[16])}return{c:function(){e=V("button"),t=De(n[8]),r=De(' "'),i=De(p),o=De(`" - `),s=V("span"),a=De("("),l=De(m),c=ce(),u=De(v),f=De(")"),j(s,"class","jse-nested-array-count svelte-fxr3ye"),j(e,"type","button"),j(e,"class","jse-nested-array-action svelte-fxr3ye")},m:function(b,y){ee(b,e,y),E(e,t),E(e,r),E(e,i),E(e,o),E(e,s),E(s,a),E(s,l),E(s,c),E(s,u),E(s,f),d||(h=Ce(e,"click",g),d=!0)},p:function(b,y){n=b,256&y&>(t,n[8]),16&y&&p!==(p=mi(n[16])+"")&>(i,p),16&y&&m!==(m=n[17]+"")&>(l,m),16&y&&v!==(v=n[17]!==1?"items":"item")&>(u,v)},d:function(b){b&&Z(e),d=!1,h()}}}function oG(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b;function y(D,U){return D[6]?nG:tG}var x=y(n),w=x(n);function $(D,U){return D[5]&&!D[0]?iG:rG}for(var S=$(n),_=S(n),F=Mt(n[4]),I=[],W=0;W1&&arguments[1]!==void 0?arguments[1]:2,g=[];return function b(y,x){Gn(y)&&x.length0}):[]),16&n.$$.dirty&&t(6,i=!hn(a)),3072&n.$$.dirty&&t(5,o=c===void 0&&(l===""||l===void 0)),6240&n.$$.dirty&&t(7,s=i?"Object with nested arrays":o?"An empty document":Gn(c)?"An object":Nn(c)?"An empty array":"A ".concat(L0(c,f)))},[u,d,h,p,a,o,i,s,r,function(m){return Ye(c,m).length},l,c,f,function(m){return d(m)},function(){return h(Dr.tree)},function(){return p()}]}var aG=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,sG,oG,Tt,{text:10,json:11,readOnly:0,parser:12,openJSONEditorModal:1,onChangeMode:2,onClick:3},eG),r}return ht(e,mt),ut(e)}();function lG(n){Et(n,"svelte-1nml1r3",".jse-column-header.svelte-1nml1r3{background:none;border:none;font-family:inherit;font-size:inherit;color:inherit;display:flex;gap:var(--jse-padding, 10px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px));width:100%}.jse-column-header.svelte-1nml1r3:hover{background:var(--jse-table-header-background-highlight, #e8e8e8)}.jse-column-header.svelte-1nml1r3:not(.jse-column-header.jse-readonly){cursor:pointer}")}function cG(n){var e,t,r,i,o,s;return t=new un({props:{data:MT}}),{c:function(){e=V("button"),je(t.$$.fragment),j(e,"type","button"),j(e,"class","jse-column-header svelte-1nml1r3"),j(e,"title",r="The Columns are created by sampling ".concat(n[1]," items out of ").concat(n[0],". ")+"If you're missing a column, click here to sample all of the items instead of a subset. This is slower.")},m:function(a,l){ee(a,e,l),be(t,e,null),i=!0,o||(s=Ce(e,"click",n[3]),o=!0)},p:function(a,l){var c=At(l,1)[0];(!i||3&c&&r!==(r="The Columns are created by sampling ".concat(a[1]," items out of ").concat(a[0],". ")+"If you're missing a column, click here to sample all of the items instead of a subset. This is slower."))&&j(e,"title",r)},i:function(a){i||(C(t.$$.fragment,a),i=!0)},o:function(a){M(t.$$.fragment,a),i=!1},d:function(a){a&&Z(e),we(t),o=!1,s()}}}function uG(n,e,t){var r=e.count,i=e.maxSampleCount,o=e.onRefresh;return n.$$set=function(s){"count"in s&&t(0,r=s.count),"maxSampleCount"in s&&t(1,i=s.maxSampleCount),"onRefresh"in s&&t(2,o=s.onRefresh)},[r,i,o,function(){return o()}]}var fG=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,uG,cG,Tt,{count:0,maxSampleCount:1,onRefresh:2},lG),r}return ht(e,mt),ut(e)}();function dG(n){Et(n,"svelte-12ygzbc",'.jse-table-mode.svelte-12ygzbc.svelte-12ygzbc{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color, #fff);min-width:0;min-height:0;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-text-color, #4d4d4d);line-height:var(--jse-line-height, calc(1em + 4px))}.jse-table-mode.no-main-menu.svelte-12ygzbc.svelte-12ygzbc{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-12ygzbc .jse-search-box-container.svelte-12ygzbc{position:relative;height:0;top:calc(var(--jse-line-height, calc(1em + 4px)) + 2 * var(--jse-padding, 10px));margin-right:calc(var(--jse-padding, 10px) + 20px);margin-left:var(--jse-padding, 10px);text-align:right;z-index:3}.jse-table-mode.svelte-12ygzbc .jse-hidden-input-label.svelte-12ygzbc{position:fixed;right:0;top:0;width:0;height:0}.jse-table-mode.svelte-12ygzbc .jse-hidden-input-label .jse-hidden-input.svelte-12ygzbc{width:0;height:0;padding:0;border:0;outline:none}.jse-table-mode.svelte-12ygzbc .jse-contents.svelte-12ygzbc{flex:1;align-items:flex-start;flex-direction:column;display:flex;overflow:auto;overflow-anchor:none;scrollbar-gutter:stable;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-12ygzbc .jse-contents.svelte-12ygzbc:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main.svelte-12ygzbc{border-collapse:collapse;border-spacing:0}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-invisible-start-section td.svelte-12ygzbc,.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-invisible-end-section td.svelte-12ygzbc{margin:0;padding:0}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-invisible-end-section td.svelte-12ygzbc{padding-bottom:var(--jse-padding, 10px)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row.svelte-12ygzbc:hover{background-color:var(--jse-table-row-odd-background, rgba(0, 0, 0, 0.05))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-12ygzbc{padding:0 var(--jse-padding, 10px) 0 0;vertical-align:top;white-space:nowrap;height:var(--jse-line-height, calc(1em + 4px))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header.svelte-12ygzbc,.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-gutter.svelte-12ygzbc{font-weight:normal;text-align:left;color:var(--jse-text-readonly, #8d8d8d);background:var(--jse-table-header-background, #f5f5f5)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header.svelte-12ygzbc{padding:0;position:sticky;top:0}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header .jse-table-root-error.svelte-12ygzbc{padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-gutter.svelte-12ygzbc{padding:0 var(--jse-padding, 10px) 0 calc(0.5 * var(--jse-padding, 10px))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-selected-value.svelte-12ygzbc>.jse-value{background:var(--jse-selection-background-color, #d3d3d3)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-12ygzbc div.jse-value{overflow-wrap:normal;white-space:nowrap;vertical-align:top;display:inline-block}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell .jse-context-menu-anchor.svelte-12ygzbc{display:inline-flex;position:relative;vertical-align:top}.jse-table-mode.svelte-12ygzbc .jse-contents.jse-contents-loading.svelte-12ygzbc{align-items:unset}.jse-table-mode.svelte-12ygzbc .jse-contents.jse-contents-loading .jse-loading-space.svelte-12ygzbc{flex:1}.jse-table-mode.svelte-12ygzbc .jse-contents.jse-contents-loading .jse-loading.svelte-12ygzbc{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}')}function _j(n,e,t){var r,i,o,s=n.slice();s[132]=e[t],s[138]=t;var a=s[27].startIndex+s[138];s[133]=a;var l=s[26].rows[s[133]];s[134]=l;var c=Z0([String(s[133])],(r=s[134])===null||r===void 0?void 0:r.row);s[135]=c;var u=(i=s[20])!==null&&i!==void 0&&i.itemsMap?Ei((o=s[20])===null||o===void 0?void 0:o.itemsMap,ev(s[133])):void 0;return s[136]=u,s}function Rj(n,e,t){var r,i=n.slice();i[139]=e[t],i[146]=t;var o=[String(i[133])].concat(i[139]);i[140]=o;var s=Ue(i[140]);i[141]=s;var a=Ye(i[132],i[139]);i[142]=a;var l=rn(i[12].selection)&&cs(i[12].selection.path,i[140]);i[143]=l;var c=(r=i[134])===null||r===void 0?void 0:r.columns[i[146]];i[144]=c;var u=Z0(i[140],i[144]);return i[135]=u,i}function Nj(n,e,t){var r=n.slice();return r[139]=e[t],r}function im(n){var e,t=n.slice(),r=Z0([],(e=t[26])===null||e===void 0?void 0:e.root);return t[135]=r,t}function Ij(n){var e,t,r;function i(s){n[79](s)}var o={containsValidArray:n[22],readOnly:n[0],historyState:n[24],onSort:n[47],onTransform:n[48],onUndo:n[49],onRedo:n[50],onContextMenu:n[39],onRenderMenu:n[5]};return n[9]!==void 0&&(o.showSearch=n[9]),e=new zK({props:o}),It.push(function(){return oi(e,"showSearch",i)}),{c:function(){je(e.$$.fragment)},m:function(s,a){be(e,s,a),r=!0},p:function(s,a){var l={};4194304&a[0]&&(l.containsValidArray=s[22]),1&a[0]&&(l.readOnly=s[0]),16777216&a[0]&&(l.historyState=s[24]),32&a[0]&&(l.onRenderMenu=s[5]),!t&&512&a[0]&&(t=!0,l.showSearch=s[9],ii(function(){return t=!1})),e.$set(l)},i:function(s){r||(C(e.$$.fragment,s),r=!0)},o:function(s){M(e.$$.fragment,s),r=!1},d:function(s){we(e,s)}}}function hG(n){var e;return{c:function(){(e=V("div")).innerHTML='
loading...
',j(e,"class","jse-contents jse-contents-loading svelte-12ygzbc")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function pG(n){var e,t,r,i,o,s,a,l,c,u=[vG,gG,mG],f=[];function d(h,p){return h[22]?0:h[18]&&h[17]!==void 0&&h[17]!==""?1:2}return i=d(n),o=f[i]=u[i](n),{c:function(){e=V("label"),t=V("input"),r=ce(),o.c(),s=an(),j(t,"type","text"),t.readOnly=!0,j(t,"tabindex","-1"),j(t,"class","jse-hidden-input svelte-12ygzbc"),j(e,"class","jse-hidden-input-label svelte-12ygzbc")},m:function(h,p){ee(h,e,p),E(e,t),n[80](t),ee(h,r,p),f[i].m(h,p),ee(h,s,p),a=!0,l||(c=Ce(t,"paste",n[44]),l=!0)},p:function(h,p){var m=i;(i=d(h))===m?f[i].p(h,p):(Ee(),M(f[m],1,1,function(){f[m]=null}),Ae(),(o=f[i])?o.p(h,p):(o=f[i]=u[i](h)).c(),C(o,1),o.m(s.parentNode,s))},i:function(h){a||(C(o),a=!0)},o:function(h){M(o),a=!1},d:function(h){h&&(Z(e),Z(r),Z(s)),n[80](null),f[i].d(h),l=!1,c()}}}function mG(n){var e,t;return e=new aG({props:{text:n[17],json:n[8],readOnly:n[0],parser:n[2],openJSONEditorModal:n[46],onChangeMode:n[4],onClick:n[84]}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};131072&i[0]&&(o.text=r[17]),256&i[0]&&(o.json=r[8]),1&i[0]&&(o.readOnly=r[0]),4&i[0]&&(o.parser=r[2]),16&i[0]&&(o.onChangeMode=r[4]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function gG(n){var e,t,r,i;return e=new po({props:{type:"error",message:"The loaded JSON document is invalid and could not be repaired automatically.",actions:n[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:n[42]}]}}),r=new h6({props:{text:n[17],json:n[8],indentation:n[3],parser:n[2]}}),{c:function(){je(e.$$.fragment),t=ce(),je(r.$$.fragment)},m:function(o,s){be(e,o,s),ee(o,t,s),be(r,o,s),i=!0},p:function(o,s){var a={};1&s[0]&&(a.actions=o[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:o[42]}]),e.$set(a);var l={};131072&s[0]&&(l.text=o[17]),256&s[0]&&(l.json=o[8]),8&s[0]&&(l.indentation=o[3]),4&s[0]&&(l.parser=o[2]),r.$set(l)},i:function(o){i||(C(e.$$.fragment,o),C(r.$$.fragment,o),i=!0)},o:function(o){M(e.$$.fragment,o),M(r.$$.fragment,o),i=!1},d:function(o){o&&Z(t),we(e,o),we(r,o)}}}function vG(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D=!hn((e=n[26])===null||e===void 0?void 0:e.root);r=new o6({props:{json:n[8],documentState:n[12],parser:n[2],showSearch:n[9],showReplace:n[21],readOnly:n[0],columns:n[11],onSearch:n[30],onFocus:n[31],onPatch:n[34],onClose:n[32]}});for(var U=D&&Dj(im(n)),q=Mt(n[11]),X=[],K=0;K1&&arguments[1]!==void 0)||arguments[1],Ie=ae?wl:0,ze=Jx(Q,oe,Ht,pc),Fe=ze-Dt+Ie+pc,kt=me(Q);if(s("scrollTo",{path:Q,top:ze,scrollTop:Dt,elem:kt}),!g)return Promise.resolve();var zt=g.getBoundingClientRect();if(kt&&!ve){var Kt=kt.getBoundingClientRect();if(Kt.bottom>zt.top&&Kt.topIe.right){var Fe=ze.right-Ie.right;t(15,g.scrollLeft+=Fe,g)}if(ze.leftKt){var z=Fe-Kt;t(15,g.scrollTop+=z,g)}if(ze0&&Ie[0]!==void 0)||Ie[0],y!==void 0){ze.next=3;break}return ze.abrupt("return");case 3:return ze.next=5,c6({json:y,documentState:Oe,indentation:ve?K:void 0,parser:D});case 5:case"end":return ze.stop()}},Q)})),ie.apply(this,arguments)}function ue(){f6({json:y,text:x,documentState:Oe,keepSelection:!0,readOnly:w,onChange:Y,onPatch:Zt})}function ye(){pJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function it(){mJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function vt(){gJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function Nt(){vJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function bn(){return(bn=$t(Pe().mark(function Q(ve){return Pe().wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,d6({char:ve,selectInside:!1,refJsonEditor:v,json:y,selection:Oe.selection,readOnly:w,parser:D,onPatch:Zt,onReplaceJson:En,onSelect:He});case 2:case"end":return Ie.stop()}},Q)}))).apply(this,arguments)}function En(Q,ve){var Ie=Oe,ze=y,Fe=x,kt={json:y,text:x},zt=Xe,Kt=Ti(y,Oe,[],So),z=typeof ve=="function"?ve(Q,Kt):void 0;t(8,y=z&&z.json!==void 0?z.json:Q),t(12,Oe=z&&z.state!==void 0?z.state:Kt),t(17,x=void 0),t(23,Xe=!1),t(18,pe=void 0),wt(y),ge({previousJson:ze,previousState:Ie,previousText:Fe,previousTextIsRepaired:zt}),Wt(kt,null)}function Bt(Q,ve){s("handleChangeText");var Ie=Oe,ze=y,Fe=x,kt={json:y,text:x},zt=Xe;try{t(8,y=U(Q)),t(12,Oe=Ti(y,Oe,[],So)),t(17,x=void 0),t(23,Xe=!1),t(18,pe=void 0)}catch(z){try{t(8,y=U(Ao(Q))),t(12,Oe=Ti(y,Oe,[],So)),t(17,x=Q),t(23,Xe=!0),t(18,pe=void 0)}catch{t(8,y=void 0),t(12,Oe=Yd({json:y,expand:So})),t(17,x=Q),t(23,Xe=!1),t(18,pe=x!==""?Nl(x,z.message||String(z)):void 0)}}if(typeof ve=="function"){var Kt=ve(y,Oe);t(8,y=Kt&&Kt.json?Kt.json:y),t(12,Oe=Kt&&Kt.state?Kt.state:Oe)}wt(y),ge({previousJson:ze,previousState:Ie,previousText:Fe,previousTextIsRepaired:zt}),Wt(kt,null)}function ln(Q){if(y!==void 0){var ve=Q.id,Ie=Q.onTransform,ze=Q.onClose,Fe=Q.rootPath||[];st=!0,H({id:ve||h,json:y,rootPath:Fe||[],onTransform:function(kt){Ie?Ie({operations:kt,json:y,transformedJson:ro(y,kt)}):(s("onTransform",Fe,kt),Zt(kt))},onClose:function(){st=!1,Pt(),ze&&ze()}})}}function Jt(Q){s("openJSONEditorModal",{path:Q}),st=!0,J({content:{json:Ye(y,Q)},path:Q,onPatch:nn.onPatch,onClose:function(){st=!1,Pt()}})}function Ot(Q,ve){a(n6,{text:Q,onParse:function(Ie){return Jh(Ie,function(ze){return _u(ze,D)})},onRepair:c4,onApply:ve},fe(fe({},Ta),{},{styleWindow:{width:"600px",height:"500px"},styleContent:{padding:0,height:"100%"}}),{onClose:function(){return Pt()}})}function Sn(Q){s("openFind",{findAndReplace:Q}),t(9,ae=!1),t(21,Qe=!1),fr().then(function(){t(9,ae=!0),t(21,Qe=Q)})}function An(){if(!w&&L.getState().canUndo){var Q=L.undo();if(Q){var ve={json:y,text:x};t(8,y=Q.undo.patch?ro(y,Q.undo.patch):Q.undo.json),t(12,Oe=Q.undo.state),t(17,x=Q.undo.text),t(23,Xe=Q.undo.textIsRepaired),t(18,pe=void 0),s("undo",{item:Q,json:y}),Wt(ve,Q.undo.patch&&Q.redo.patch?{json:y,previousJson:ve.json,redo:Q.undo.patch,undo:Q.redo.patch}:null),Pt(),Oe.selection&&Dn(lt(Oe.selection),!1)}}}function xn(){if(!w&&L.getState().canRedo){var Q=L.redo();if(Q){var ve={json:y,text:x};t(8,y=Q.redo.patch?ro(y,Q.redo.patch):Q.redo.json),t(12,Oe=Q.redo.state),t(17,x=Q.redo.text),t(23,Xe=Q.redo.textIsRepaired),t(18,pe=void 0),s("redo",{item:Q,json:y}),Wt(ve,Q.undo.patch&&Q.redo.patch?{json:y,previousJson:ve.json,redo:Q.redo.patch,undo:Q.undo.patch}:null),Pt(),Oe.selection&&Dn(lt(Oe.selection),!1)}}}function Ar(Q,ve){t(76,Ht[ve]=Q.getBoundingClientRect().height,Ht)}return n.$$set=function(Q){"readOnly"in Q&&t(0,w=Q.readOnly),"externalContent"in Q&&t(53,$=Q.externalContent),"externalSelection"in Q&&t(54,S=Q.externalSelection),"mainMenuBar"in Q&&t(1,_=Q.mainMenuBar),"escapeControlCharacters"in Q&&t(55,F=Q.escapeControlCharacters),"escapeUnicodeCharacters"in Q&&t(56,I=Q.escapeUnicodeCharacters),"flattenColumns"in Q&&t(57,W=Q.flattenColumns),"parser"in Q&&t(2,D=Q.parser),"parseMemoizeOne"in Q&&t(58,U=Q.parseMemoizeOne),"validator"in Q&&t(59,q=Q.validator),"validationParser"in Q&&t(60,X=Q.validationParser),"indentation"in Q&&t(3,K=Q.indentation),"onChange"in Q&&t(61,Y=Q.onChange),"onChangeMode"in Q&&t(4,T=Q.onChangeMode),"onSelect"in Q&&t(62,B=Q.onSelect),"onRenderValue"in Q&&t(63,O=Q.onRenderValue),"onRenderMenu"in Q&&t(5,A=Q.onRenderMenu),"onRenderContextMenu"in Q&&t(64,te=Q.onRenderContextMenu),"onFocus"in Q&&t(65,R=Q.onFocus),"onBlur"in Q&&t(66,k=Q.onBlur),"onSortModal"in Q&&t(67,P=Q.onSortModal),"onTransformModal"in Q&&t(68,H=Q.onTransformModal),"onJSONEditorModal"in Q&&t(69,J=Q.onJSONEditorModal)},n.$$.update=function(){50331648&n.$$.dirty[1]&&t(75,m=B0({escapeControlCharacters:F,escapeUnicodeCharacters:I})),512&n.$$.dirty[0]&&function(Q){if(g){var ve=Q?wl:-100;g.scrollTo({top:t(15,g.scrollTop+=ve,g),left:g.scrollLeft})}}(ae),4194304&n.$$.dirty[1]&&se($),8388608&n.$$.dirty[1]&&function(Q){sn(Oe.selection,Q)||(s("applyExternalSelection",Q),(H0(Q)||Q===null)&&He(Q))}(S),3328&n.$$.dirty[0]|67108864&n.$$.dirty[1]&&t(11,oe=Nn(y)?function(Q,ve){var Ie,ze=new Set(ve.map(Ue)),Fe=new Set(Q.map(Ue)),kt=au(ze);try{for(kt.s();!(Ie=kt.n()).done;){var zt=Ie.value;Fe.has(zt)||ze.delete(zt)}}catch(xe){kt.e(xe)}finally{kt.f()}var Kt,z=au(Fe);try{for(z.s();!(Kt=z.n()).done;){var le=Kt.value;ze.has(le)||ze.add(le)}}catch(xe){z.e(xe)}finally{z.f()}return Vt(ze).map(ao)}(cJ(y,W,Qt),oe):[]),2304&n.$$.dirty[0]&&t(22,tn=!(!y||hn(oe))),1280&n.$$.dirty[0]&&t(28,r=Array.isArray(y)&&y.length>Qt),768&n.$$.dirty[0]|114688&n.$$.dirty[2]&&t(27,i=uJ(Dt,qe,y,Ht,pc,ae?wl:0)),256&n.$$.dirty[0]&&g&&g.scrollTo({top:g.scrollTop,left:g.scrollLeft}),4357&n.$$.dirty[0]|8194&n.$$.dirty[2]&&t(25,nn={readOnly:w,parser:D,normalization:m,getJson:function(){return y},getDocumentState:function(){return Oe},findElement:me,findNextInside:zn,focus:Pt,onPatch:Zt,onSelect:He,onFind:Ge,onPasteJson:On,onRenderValue:O}),260&n.$$.dirty[0]|805306368&n.$$.dirty[1]&&at(y,q,D,X),10240&n.$$.dirty[0]&&t(26,o=fJ(ke,oe))},[w,_,D,K,T,A,Pt,function(){if(Xe&&y!==void 0){var Q=Oe,ve=y,Ie=x,ze={json:y,text:x},Fe=Xe;t(17,x=void 0),t(23,Xe=!1),wt(y),ge({previousJson:ve,previousState:Q,previousText:Ie,previousTextIsRepaired:Fe}),Wt(ze,null)}return{json:y,text:x}},y,ae,Qt,oe,Oe,ke,v,g,b,x,pe,he,Se,Qe,tn,Xe,ne,nn,o,i,r,p,function(Q){t(20,Se=Q)},function(Q){return et.apply(this,arguments)},function(){t(9,ae=!1),t(21,Qe=!1),Pt()},function(Q){if(!w){s("onSortByHeader",Q);var ve=Q.sortDirection===Bi.desc?-1:1;Zt(r6(y,[],Q.path,ve),function(Ie,ze){return{state:fe(fe({},ze),{},{sortedColumn:Q})}})}},Zt,function(Q){t(78,Dt=Q.target.scrollTop)},function(Q){var ve=Q.target,Ie=w4(ve);if(Ie){if(Xr(Oe.selection)&&du(y,Oe.selection,Ie))return;He(Ut(Ie,!1)),Q.preventDefault()}ve.isContentEditable||Pt()},Be,St,function(Q){Be({anchor:b4(Q.target,"BUTTON"),offsetTop:0,width:Ko,height:Jo,showTip:!0})},function(){return de.apply(this,arguments)},function(){s("clear pasted json"),t(19,he=void 0),Pt()},function(){T(Dr.text)},function(Q){var ve=ss(Q);if(s("keydown",{combo:ve,key:Q.key}),ve==="Ctrl+X"&&(Q.preventDefault(),We(!0)),ve==="Ctrl+Shift+X"&&(Q.preventDefault(),We(!1)),ve==="Ctrl+C"&&(Q.preventDefault(),G(!0)),ve==="Ctrl+Shift+C"&&(Q.preventDefault(),G(!1)),ve==="Ctrl+D"&&Q.preventDefault(),ve!=="Delete"&&ve!=="Backspace"||(Q.preventDefault(),ue()),ve==="Insert"&&Q.preventDefault(),ve==="Ctrl+A"&&Q.preventDefault(),ve==="Ctrl+Q"&&St(Q),ve==="ArrowLeft"&&(Q.preventDefault(),Mn(),Oe.selection)){var Ie=function(z,le){var xe=_i(lt(le),z),Me=xe.rowIndex,Ne=xe.columnIndex;return Ne>0?Ut(ha({rowIndex:Me,columnIndex:Ne-1},z),!1):le}(oe,Oe.selection);He(Ie),fn(lt(Ie))}if(ve==="ArrowRight"&&(Q.preventDefault(),Mn(),Oe.selection)){var ze=function(z,le){var xe=_i(lt(le),z),Me=xe.rowIndex,Ne=xe.columnIndex;return Ne0?Ut(ha({rowIndex:Me-1,columnIndex:Ne},z),!1):le}(oe,Oe.selection);He(Fe),fn(lt(Fe))}if(ve==="ArrowDown"&&(Q.preventDefault(),Mn(),Oe.selection)){var kt=function(z,le,xe){var Me=_i(lt(xe),le),Ne=Me.rowIndex,Le=Me.columnIndex;return Ne1?" (".concat(n[20].length,")"):""),fullScreenButton:!0,onClose:n[28]};n[22]!==void 0&&($.fullscreen=n[22]),t=new tp({props:$}),It.push(function(){return oi(t,"fullscreen",w)});var S={mode:n[24].mode,content:n[24].content,selection:n[24].selection,readOnly:n[0],indentation:n[1],tabSize:n[2],statusBar:n[5],askToFormat:n[6],mainMenuBar:n[3],navigationBar:n[4],escapeControlCharacters:n[7],escapeUnicodeCharacters:n[8],flattenColumns:n[9],parser:n[10],parseMemoizeOne:n[25],validator:n[11],validationParser:n[12],pathParser:n[13],insideModal:!0,onError:n[33],onChange:n[30],onChangeMode:n[32],onSelect:n[31],onRenderValue:n[14],onClassName:n[15],onFocus:Zi,onBlur:Zi,onRenderMenu:n[16],onRenderContextMenu:n[17],onSortModal:n[18],onTransformModal:n[19],onJSONEditorModal:n[34]};h=new v6({props:S}),n[40](h);var _=n[23]&&Qj(n),F=n[20].length>1&&Yj(n);function I(U,q){return U[0]?EG:AG}var W=I(n),D=W(n);return{c:function(){e=V("div"),je(t.$$.fragment),i=ce(),o=V("div"),(s=V("div")).innerHTML='
Path
',a=ce(),l=V("input"),c=ce(),(u=V("div")).innerHTML='
Contents
',f=ce(),d=V("div"),je(h.$$.fragment),p=ce(),m=V("div"),_&&_.c(),v=ce(),F&&F.c(),g=ce(),D.c(),j(s,"class","jse-label svelte-1m281k0"),j(l,"class","jse-path svelte-1m281k0"),j(l,"type","text"),l.readOnly=!0,j(l,"title","Selected path"),l.value=n[26],j(u,"class","jse-label svelte-1m281k0"),j(d,"class","jse-modal-inline-editor svelte-1m281k0"),j(m,"class","jse-actions svelte-1m281k0"),j(o,"class","jse-modal-contents svelte-1m281k0"),j(e,"class","jse-modal jse-jsoneditor-modal svelte-1m281k0"),$e(e,"fullscreen",n[22])},m:function(U,q){ee(U,e,q),be(t,e,null),E(e,i),E(e,o),E(o,s),E(o,a),E(o,l),E(o,c),E(o,u),E(o,f),E(o,d),be(h,d,null),E(o,p),E(o,m),_&&_.m(m,null),E(m,v),F&&F.m(m,null),E(m,g),D.m(m,null),b=!0,y||(x=mr(Lu.call(null,e,n[29])),y=!0)},p:function(U,q){var X={};1048576&q[0]&&(X.title="Edit nested content "+(U[20].length>1?" (".concat(U[20].length,")"):"")),!r&&4194304&q[0]&&(r=!0,X.fullscreen=U[22],ii(function(){return r=!1})),t.$set(X),(!b||67108864&q[0]&&l.value!==U[26])&&(l.value=U[26]);var K={};16777216&q[0]&&(K.mode=U[24].mode),16777216&q[0]&&(K.content=U[24].content),16777216&q[0]&&(K.selection=U[24].selection),1&q[0]&&(K.readOnly=U[0]),2&q[0]&&(K.indentation=U[1]),4&q[0]&&(K.tabSize=U[2]),32&q[0]&&(K.statusBar=U[5]),64&q[0]&&(K.askToFormat=U[6]),8&q[0]&&(K.mainMenuBar=U[3]),16&q[0]&&(K.navigationBar=U[4]),128&q[0]&&(K.escapeControlCharacters=U[7]),256&q[0]&&(K.escapeUnicodeCharacters=U[8]),512&q[0]&&(K.flattenColumns=U[9]),1024&q[0]&&(K.parser=U[10]),33554432&q[0]&&(K.parseMemoizeOne=U[25]),2048&q[0]&&(K.validator=U[11]),4096&q[0]&&(K.validationParser=U[12]),8192&q[0]&&(K.pathParser=U[13]),16384&q[0]&&(K.onRenderValue=U[14]),32768&q[0]&&(K.onClassName=U[15]),65536&q[0]&&(K.onRenderMenu=U[16]),131072&q[0]&&(K.onRenderContextMenu=U[17]),262144&q[0]&&(K.onSortModal=U[18]),524288&q[0]&&(K.onTransformModal=U[19]),h.$set(K),U[23]?_?_.p(U,q):((_=Qj(U)).c(),_.m(m,v)):_&&(_.d(1),_=null),U[20].length>1?F?(F.p(U,q),1048576&q[0]&&C(F,1)):((F=Yj(U)).c(),C(F,1),F.m(m,g)):F&&(Ee(),M(F,1,1,function(){F=null}),Ae()),W===(W=I(U))&&D?D.p(U,q):(D.d(1),(D=W(U))&&(D.c(),D.m(m,null))),(!b||4194304&q[0])&&$e(e,"fullscreen",U[22])},i:function(U){b||(C(t.$$.fragment,U),C(h.$$.fragment,U),C(F),b=!0)},o:function(U){M(t.$$.fragment,U),M(h.$$.fragment,U),M(F),b=!1},d:function(U){U&&Z(e),we(t),n[40](null),we(h),_&&_.d(),F&&F.d(),D.d(),y=!1,x()}}}function y6(n){n.focus()}function PG(n,e,t){var r,i,o,s,a,l,c=Sr("jsoneditor:JSONEditorModal"),u=e.content,f=e.path,d=e.onPatch,h=e.readOnly,p=e.indentation,m=e.tabSize,v=e.mainMenuBar,g=e.navigationBar,b=e.statusBar,y=e.askToFormat,x=e.escapeControlCharacters,w=e.escapeUnicodeCharacters,$=e.flattenColumns,S=e.parser,_=e.validator,F=e.validationParser,I=e.pathParser,W=e.onRenderValue,D=e.onClassName,U=e.onRenderMenu,q=e.onRenderContextMenu,X=e.onSortModal,K=e.onTransformModal,Y=Er("simple-modal").close,T={mode:A(u),content:u,selection:null,relativePath:f},B=[T],O=void 0;function A(k){return fu(k)&&Nn(k.json)?Dr.table:Dr.tree}function te(){var k,P=((k=en(B))===null||k===void 0?void 0:k.selection)||null;H0(P)&&a.scrollTo(lt(P))}function R(){c("handleClose"),B.length>1?(t(20,B=on(B)),fr().then(te),t(23,O=void 0)):Y()}return n.$$set=function(k){"content"in k&&t(35,u=k.content),"path"in k&&t(36,f=k.path),"onPatch"in k&&t(37,d=k.onPatch),"readOnly"in k&&t(0,h=k.readOnly),"indentation"in k&&t(1,p=k.indentation),"tabSize"in k&&t(2,m=k.tabSize),"mainMenuBar"in k&&t(3,v=k.mainMenuBar),"navigationBar"in k&&t(4,g=k.navigationBar),"statusBar"in k&&t(5,b=k.statusBar),"askToFormat"in k&&t(6,y=k.askToFormat),"escapeControlCharacters"in k&&t(7,x=k.escapeControlCharacters),"escapeUnicodeCharacters"in k&&t(8,w=k.escapeUnicodeCharacters),"flattenColumns"in k&&t(9,$=k.flattenColumns),"parser"in k&&t(10,S=k.parser),"validator"in k&&t(11,_=k.validator),"validationParser"in k&&t(12,F=k.validationParser),"pathParser"in k&&t(13,I=k.pathParser),"onRenderValue"in k&&t(14,W=k.onRenderValue),"onClassName"in k&&t(15,D=k.onClassName),"onRenderMenu"in k&&t(16,U=k.onRenderMenu),"onRenderContextMenu"in k&&t(17,q=k.onRenderContextMenu),"onSortModal"in k&&t(18,X=k.onSortModal),"onTransformModal"in k&&t(19,K=k.onTransformModal)},n.$$.update=function(){1048576&n.$$.dirty[0]&&t(24,r=en(B)||T),1048576&n.$$.dirty[0]&&t(38,i=B.flatMap(function(k){return k.relativePath})),128&n.$$.dirty[1]&&t(26,o=hn(i)?"(document root)":mi(i)),1024&n.$$.dirty[0]&&t(25,s=wu(S.parse))},[h,p,m,v,g,b,y,x,w,$,S,_,F,I,W,D,U,q,X,K,B,a,l,O,r,s,o,function(){if(c("handleApply"),!h)try{t(23,O=void 0);var k=r.relativePath,P=r.content,H=[{op:"replace",path:Ue(k),value:j2(P,S).json}];if(B.length>1){var J=j2(B[B.length-2].content,S).json,he={json:ro(J,H)},Se=fe(fe({},B[B.length-2]||T),{},{content:he});t(20,B=[].concat(Vt(B.slice(0,B.length-2)),[Se])),fr().then(te)}else d(H),Y()}catch(pe){t(23,O=String(pe))}},R,function(){l?t(22,l=!1):R()},function(k){c("handleChange",k);var P=fe(fe({},r),{},{content:k});t(20,B=[].concat(Vt(on(B)),[P]))},function(k){c("handleChangeSelection",k);var P=fe(fe({},r),{},{selection:k});t(20,B=[].concat(Vt(on(B)),[P]))},function(k){c("handleChangeMode",k);var P=fe(fe({},r),{},{mode:k});t(20,B=[].concat(Vt(on(B)),[P]))},function(k){t(23,O=k.toString()),console.error(k)},function(k){var P=k.content,H=k.path;c("handleJSONEditorModal",{content:P,path:H});var J={mode:A(P),content:P,selection:null,relativePath:H};t(20,B=[].concat(Vt(B),[J]))},u,f,d,i,function(k){t(22,l=k)},function(k){It[k?"unshift":"push"](function(){t(21,a=k)})}]}var _G=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,PG,TG,Tt,{content:35,path:36,onPatch:37,readOnly:0,indentation:1,tabSize:2,mainMenuBar:3,navigationBar:4,statusBar:5,askToFormat:6,escapeControlCharacters:7,escapeUnicodeCharacters:8,flattenColumns:9,parser:10,validator:11,validationParser:12,pathParser:13,onRenderValue:14,onClassName:15,onRenderMenu:16,onRenderContextMenu:17,onSortModal:18,onTransformModal:19},MG,[-1,-1]),r}return ht(e,mt),ut(e)}();function RG(n,e,t){var r=Er("simple-modal");return[r.open,r.close]}var NG=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,RG,null,Tt,{open:0,close:1}),r}return ht(e,mt),ut(e,[{key:"open",get:function(){return this.$$.ctx[0]}},{key:"close",get:function(){return this.$$.ctx[1]}}])}();function IG(n){Et(n,"svelte-ybuk0j",'.jse-main.svelte-ybuk0j{width:100%;height:100%;min-width:0;min-height:150px;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;position:relative;display:flex;flex-direction:row}')}function Xj(n){var e,t,r={mode:n[1],content:n[0],selection:n[2],readOnly:n[3],indentation:n[4],tabSize:n[5],statusBar:n[8],askToFormat:n[9],mainMenuBar:n[6],navigationBar:n[7],escapeControlCharacters:n[10],escapeUnicodeCharacters:n[11],flattenColumns:n[12],parser:n[13],parseMemoizeOne:n[27],validator:n[14],validationParser:n[15],pathParser:n[16],insideModal:!1,onError:n[21],onChange:n[28],onChangeMode:n[32],onSelect:n[29],onRenderValue:n[17],onClassName:n[18],onFocus:n[30],onBlur:n[31],onRenderMenu:n[19],onRenderContextMenu:n[20],onSortModal:n[34],onTransformModal:n[33],onJSONEditorModal:n[35]};return e=new v6({props:r}),n[62](e),{c:function(){je(e.$$.fragment)},m:function(i,o){be(e,i,o),t=!0},p:function(i,o){var s={};2&o[0]&&(s.mode=i[1]),1&o[0]&&(s.content=i[0]),4&o[0]&&(s.selection=i[2]),8&o[0]&&(s.readOnly=i[3]),16&o[0]&&(s.indentation=i[4]),32&o[0]&&(s.tabSize=i[5]),256&o[0]&&(s.statusBar=i[8]),512&o[0]&&(s.askToFormat=i[9]),64&o[0]&&(s.mainMenuBar=i[6]),128&o[0]&&(s.navigationBar=i[7]),1024&o[0]&&(s.escapeControlCharacters=i[10]),2048&o[0]&&(s.escapeUnicodeCharacters=i[11]),4096&o[0]&&(s.flattenColumns=i[12]),8192&o[0]&&(s.parser=i[13]),134217728&o[0]&&(s.parseMemoizeOne=i[27]),16384&o[0]&&(s.validator=i[14]),32768&o[0]&&(s.validationParser=i[15]),65536&o[0]&&(s.pathParser=i[16]),2097152&o[0]&&(s.onError=i[21]),131072&o[0]&&(s.onRenderValue=i[17]),262144&o[0]&&(s.onClassName=i[18]),524288&o[0]&&(s.onRenderMenu=i[19]),1048576&o[0]&&(s.onRenderContextMenu=i[20]),e.$set(s)},i:function(i){t||(C(e.$$.fragment,i),t=!0)},o:function(i){M(e.$$.fragment,i),t=!1},d:function(i){n[62](null),we(e,i)}}}function DG(n){var e,t,r,i,o,s=n[22];function a(u){n[61](u)}var l={};n[25]!==void 0&&(l.open=n[25]),e=new NG({props:l}),It.push(function(){return oi(e,"open",a)});var c=Xj(n);return{c:function(){je(e.$$.fragment),r=ce(),i=V("div"),c.c(),j(i,"class","jse-main svelte-ybuk0j"),$e(i,"jse-focus",n[23])},m:function(u,f){be(e,u,f),ee(u,r,f),ee(u,i,f),c.m(i,null),o=!0},p:function(u,f){var d={};!t&&33554432&f[0]&&(t=!0,d.open=u[25],ii(function(){return t=!1})),e.$set(d),4194304&f[0]&&Tt(s,s=u[22])?(Ee(),M(c,1,1,Te),Ae(),(c=Xj(u)).c(),C(c,1),c.m(i,null)):c.p(u,f),(!o||8388608&f[0])&&$e(i,"jse-focus",u[23])},i:function(u){o||(C(e.$$.fragment,u),C(c),o=!0)},o:function(u){M(e.$$.fragment,u),M(c),o=!1},d:function(u){u&&(Z(r),Z(i)),we(e,u),c.d(u)}}}function LG(n){var e,t;return e=new i4({props:{closeOnEsc:!1,$$slots:{default:[DG]},$$scope:{ctx:n}}}),{c:function(){je(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};201326591&i[0]|8&i[2]&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function BG(n){for(var e,t,r,i=[{show:(e=n[26])===null||e===void 0?void 0:e.component},rq,{closeOnEsc:!1}],o={$$slots:{default:[LG]},$$scope:{ctx:n}},s=0;s{if(t)return!0});return n==null?void 0:n[0]}function GG(n){return`https://cdn.jsdelivr.net/npm/rrweb-player@${n}/dist/index.js`}function QG(n){return`https://cdn.jsdelivr.net/npm/rrweb-player@${n}/dist/style.css`}function YG(n){T6(n),document.getElementById("versions").addEventListener("change",e=>{const t=e.target.value,r=new URL(document.location);r.searchParams.set("version",t),document.location.href=r.href})}function XG(n,e){const t=new rrwebPlayer({target:document.getElementById("player"),data:{events:n,skipInactive:!0,showDebug:!0,showWarning:!0,autoPlay:e.autoPlay,useVirtualDom:e.useVirtualDom,UNSAFE_replayCanvas:e.canvas,mouseTail:{strokeStyle:"yellow"}}});window.$c=t,window.events=n,document.querySelector(".loading").style.display="none",t.addEventListener("finish",()=>console.log("finish"))}function ZG(n){const e=document.getElementById("jsoneditor");new qG({target:e,props:{content:{json:n},mode:"view"}}),window.events=events}function eQ(n){const e=/gist.github(?:usercontent)?.com\/[^/]+\/(\w+)/.exec(n);return(e==null?void 0:e[1])||!1}function tQ(n){const e=/https?:\/\/jsonblob.com\/([\w\-]+)/.exec(n);return(e==null?void 0:e[1])||!1}async function nQ(){const n=new URL(document.location),e=n.searchParams.get("url");let t=n.searchParams.get("version");JG(t)||(t=KG());const r=Boolean(n.searchParams.get("canvas")),i=Boolean(n.searchParams.get("play")),o=Boolean(n.searchParams.get("virtual-dom"));let s;const a=eQ(e),l=tQ(e);if(a)try{const d=await(await fetch(`https://api.github.com/gists/${a}`)).json(),h=Object.values(d.files);h[0].truncated?s=await(await fetch(h[0].raw_url)).json():s=JSON.parse(h[0].content)}catch(f){alert("something went wrong, please check the console"),console.error(f)}else if(l)try{s=await(await fetch(`https://jsonblob.com/api/v1/get/${l}`)).json()}catch(f){alert("something went wrong, please check the console"),console.error(f)}else try{s=await(await fetch(e)).json()}catch(f){alert("something went wrong, please check the console"),console.error(f)}const c=document.createElement("link");c.setAttribute("rel","stylesheet"),c.setAttribute("href",QG(t)),document.head.appendChild(c);const u=document.createElement("script");u.setAttribute("src",GG(t)),u.addEventListener("load",function(){XG(s,{canvas:r,autoPlay:i,useVirtualDom:o}),ZG(s)}),YG(t),document.head.appendChild(u),document.querySelector("a.json").setAttribute("href",e),document.querySelector("a.json").innerText=e}document.onload=nQ()});export default rQ(); + for paste`),y=ce(),j=V("div"),(w=V("button")).textContent="Close",x(c,"class","jse-key svelte-1nm0t3v"),x(l,"class","jse-shortcut"),x(h,"class","jse-key svelte-1nm0t3v"),x(d,"class","jse-shortcut"),x(g,"class","jse-key svelte-1nm0t3v"),x(v,"class","jse-shortcut"),x(a,"class","jse-shortcuts svelte-1nm0t3v"),x(w,"type","button"),x(w,"class","jse-primary svelte-1nm0t3v"),x(j,"class","jse-actions svelte-1nm0t3v"),x(i,"class","jse-modal-contents svelte-1nm0t3v"),x(e,"class","jse-modal jse-copy-paste svelte-1nm0t3v")},m:function(F,I){ee(F,e,I),be(t,e,null),E(e,r),E(e,i),E(i,o),E(i,s),E(i,a),E(a,l),E(l,c),E(l,u),E(a,f),E(a,d),E(d,h),E(d,p),E(a,m),E(a,v),E(v,g),E(v,b),E(i,y),E(i,j),E(j,w),$=!0,S||(_=[Ce(w,"click",n[2]),mr(Lu.call(null,e,n[3]))],S=!0)},p:Te,i:function(F){$||(C(t.$$.fragment,F),$=!0)},o:function(F){M(t.$$.fragment,F),$=!1},d:function(F){F&&Z(e),we(t),S=!1,kn(_)}}}function cU(n){var e=Er("simple-modal").close;return[e,sU?"\u2318":"Ctrl",function(){return e()},function(){return e()}]}var Z4=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,cU,lU,Tt,{},aU),r}return ht(e,mt),ut(e)}();function e6(n){return!!n&&(n.type==="space"||n.space===!0)}function np(n){return!!n&&(n.type==="separator"||n.separator===!0)}function uU(n){return!!n&&n.type==="label"&&typeof n.text=="string"}function Bu(n){return!!n&&typeof n.onClick=="function"}function Y0(n){return!!n&&n.type==="dropdown-button"&&Bu(n.main)&&Array.isArray(n.items)}function fU(n){return!!n&&n.type==="row"&&Array.isArray(n.items)}function dU(n){return!!n&&n.type==="column"&&Array.isArray(n.items)}function Ww(n){return Rn(n)&&Rn(n.parseError)}function hU(n){return Rn(n)&&Array.isArray(n.validationErrors)}function pU(n){return Rn(n)&&Array.isArray(n.path)&&typeof n.message=="string"&&"severity"in n}function mU(n){return Rn(n)&&pU(n)&&typeof n.isChildError=="boolean"}function t6(n){return Rn(n)&&typeof n.action=="function"&&Rn(n.props)}function gU(n){Et(n,"svelte-7deygj",'.jse-menu.svelte-7deygj.svelte-7deygj{background:var(--jse-theme-color, #3883fa);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-main-menu, 14px);color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));display:flex;flex-wrap:wrap;align-items:stretch;position:relative}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj{font-family:inherit;font-size:inherit;line-height:1.5em;border:none;background:transparent;color:inherit;cursor:pointer;width:var(--jse-menu-button-size, 32px);height:var(--jse-menu-button-size, 32px);padding:calc(0.5 * var(--jse-padding, 10px));margin:0;border-radius:0;display:inline-flex;align-items:center;text-align:center;justify-content:center}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:hover,.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:focus{background:var(--jse-theme-color-highlight, #5f9dff)}.jse-menu.svelte-7deygj .jse-button.svelte-7deygj:disabled{color:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));opacity:0.5;background:transparent}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj{width:auto;height:calc(var(--jse-menu-button-size, 32px) - var(--jse-padding, 10px));margin:calc(0.5 * var(--jse-padding, 10px)) 0;padding:0 calc(0.5 * var(--jse-padding, 10px)) 1px;border:1px solid var(--jse-menu-color, var(--jse-text-color-inverse, #fff))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:not(.jse-last){border-right:none}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-first.svelte-7deygj{margin-left:calc(0.5 * var(--jse-padding, 10px))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-last.svelte-7deygj{margin-right:calc(0.5 * var(--jse-padding, 10px))}.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:hover,.jse-menu.svelte-7deygj .jse-button.jse-group-button.svelte-7deygj:focus{background:var(--jse-theme-color-highlight, #5f9dff)}.jse-menu.svelte-7deygj .jse-button.jse-group-button.jse-selected.svelte-7deygj{background:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));color:var(--jse-theme-color, #3883fa)}.jse-menu.svelte-7deygj .jse-space.svelte-7deygj{flex:1}.jse-menu.svelte-7deygj .jse-separator.svelte-7deygj{background:var(--jse-menu-color, var(--jse-text-color-inverse, #fff));opacity:0.3;width:1px;margin:3px}')}var vU=function(n){return{}},Jw=function(n){return{}};function Kw(n,e,t){var r=n.slice();return r[3]=e[t],r}var yU=function(n){return{}},Gw=function(n){return{}};function bU(n){var e,t=Zw(n[3])+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){1&i&&t!==(t=Zw(r[3])+"")&>(e,t)},i:Te,o:Te,d:function(r){r&&Z(e)}}}function wU(n){var e,t,r,i,o,s,a,l,c=n[3].icon&&Qw(n),u=n[3].text&&Yw(n);return{c:function(){e=V("button"),c&&c.c(),t=ce(),u&&u.c(),x(e,"type","button"),x(e,"class",r="jse-button "+n[3].className+" svelte-7deygj"),x(e,"title",i=n[3].title),e.disabled=o=n[3].disabled||!1},m:function(f,d){ee(f,e,d),c&&c.m(e,null),E(e,t),u&&u.m(e,null),s=!0,a||(l=Ce(e,"click",function(){Mr(n[3].onClick)&&n[3].onClick.apply(this,arguments)}),a=!0)},p:function(f,d){(n=f)[3].icon?c?(c.p(n,d),1&d&&C(c,1)):((c=Qw(n)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae()),n[3].text?u?u.p(n,d):((u=Yw(n)).c(),u.m(e,null)):u&&(u.d(1),u=null),(!s||1&d&&r!==(r="jse-button "+n[3].className+" svelte-7deygj"))&&x(e,"class",r),(!s||1&d&&i!==(i=n[3].title))&&x(e,"title",i),(!s||1&d&&o!==(o=n[3].disabled||!1))&&(e.disabled=o)},i:function(f){s||(C(c),s=!0)},o:function(f){M(c),s=!1},d:function(f){f&&Z(e),c&&c.d(),u&&u.d(),a=!1,l()}}}function jU(n){var e;return{c:function(){x(e=V("div"),"class","jse-space svelte-7deygj")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function xU(n){var e;return{c:function(){x(e=V("div"),"class","jse-separator svelte-7deygj")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function Qw(n){var e,t;return e=new un({props:{data:n[3].icon}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.data=r[3].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Yw(n){var e,t=n[3].text+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){1&i&&t!==(t=r[3].text+"")&>(e,t)},d:function(r){r&&Z(e)}}}function Xw(n){var e,t,r,i,o,s,a,l=[xU,jU,wU,bU],c=[];function u(f,d){return 1&d&&(e=null),1&d&&(t=null),1&d&&(r=null),e==null&&(e=!!np(f[3])),e?0:(t==null&&(t=!!e6(f[3])),t?1:(r==null&&(r=!!Bu(f[3])),r?2:3))}return i=u(n,-1),o=c[i]=l[i](n),{c:function(){o.c(),s=an()},m:function(f,d){c[i].m(f,d),ee(f,s,d),a=!0},p:function(f,d){var h=i;(i=u(f,d))===h?c[i].p(f,d):(Ee(),M(c[h],1,1,function(){c[h]=null}),Ae(),(o=c[i])?o.p(f,d):(o=c[i]=l[i](f)).c(),C(o,1),o.m(s.parentNode,s))},i:function(f){a||(C(o),a=!0)},o:function(f){M(o),a=!1},d:function(f){f&&Z(s),c[i].d(f)}}}function $U(n){for(var e,t,r,i,o=n[2].left,s=Qn(o,n,n[1],Gw),a=Mt(n[0]),l=[],c=0;c=g.end&&y.end<=$.start;return _&&S.push(y),$.start>=(_?y.end:g.end)&&S.push($),S}(i,o))},[f,h,o,i,a,s,l,c,u,d,p,r,function(m){return h(f,m)}]}var BU=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,LU,IU,Tt,{visibleSections:6,sectionIndex:7,total:8,path:0,selection:9,onExpandSection:1,context:10},NU),r}return ht(e,mt),ut(e)}();function zU(n){Et(n,"svelte-6k6355",".jse-context-menu-pointer.svelte-6k6355{position:absolute;top:calc(-0.5 * var(--jse-context-menu-pointer-size, calc(1em + 4px)));right:calc(-0.5 * var(--jse-context-menu-pointer-size, calc(1em + 4px)));width:var(--jse-context-menu-pointer-size, calc(1em + 4px));height:var(--jse-context-menu-pointer-size, calc(1em + 4px));padding:0;margin:0;cursor:pointer;background:transparent;border-radius:2px;background:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565));color:var(--jse-context-menu-pointer-color, var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff)));border:none;box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-context-menu-pointer.svelte-6k6355:hover{background:var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a))}")}function FU(n){var e,t,r,i,o;return t=new un({props:{data:Ri}}),{c:function(){e=V("button"),xe(t.$$.fragment),x(e,"type","button"),x(e,"class","jse-context-menu-pointer svelte-6k6355"),x(e,"title",D0),$e(e,"jse-selected",n[0])},m:function(s,a){ee(s,e,a),be(t,e,null),r=!0,i||(o=Ce(e,"click",n[1]),i=!0)},p:function(s,a){var l=At(a,1)[0];(!r||1&l)&&$e(e,"jse-selected",s[0])},i:function(s){r||(C(t.$$.fragment,s),r=!0)},o:function(s){M(t.$$.fragment,s),r=!1},d:function(s){s&&Z(e),we(t),i=!1,o()}}}function qU(n,e,t){var r=e.selected,i=e.onContextMenu;return n.$$set=function(o){"selected"in o&&t(0,r=o.selected),"onContextMenu"in o&&t(2,i=o.onContextMenu)},[r,function(o){for(var s=o.target;s&&s.nodeName!=="BUTTON";)s=s.parentNode;s&&i({anchor:s,left:0,top:0,width:Ko,height:Jo,offsetTop:2,offsetLeft:0,showTip:!0})},i]}var Gs=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,qU,FU,Tt,{selected:0,onContextMenu:2},zU),r}return ht(e,mt),ut(e)}();function VU(n){Et(n,"svelte-10xe8tv",'.jse-key.svelte-10xe8tv{display:inline-block;min-width:2em;padding:0 5px;box-sizing:border-box;outline:none;border-radius:1px;vertical-align:top;color:var(--jse-key-color, #1a1a1a);cursor:var(--jse-contents-cursor, pointer);word-break:normal;overflow-wrap:normal;white-space:pre-wrap}.jse-key.svelte-10xe8tv:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-key.svelte-10xe8tv:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-key.jse-empty.svelte-10xe8tv{min-width:3em;outline:1px dotted var(--jse-tag-background, rgba(0, 0, 0, 0.2));-moz-outline-radius:2px}.jse-key.jse-empty.svelte-10xe8tv::after{pointer-events:none;color:var(--jse-tag-background, rgba(0, 0, 0, 0.2));content:"key"}')}function HU(n){var e,t,r,i,o,s,a,l=[JU,WU],c=[];function u(f,d){return f[1]?0:1}return t=u(n),r=c[t]=l[t](n),{c:function(){e=V("div"),r.c(),x(e,"role","none"),x(e,"data-type","selectable-key"),x(e,"class",i=Vn(n[6](n[0]))+" svelte-10xe8tv")},m:function(f,d){ee(f,e,d),c[t].m(e,null),o=!0,s||(a=Ce(e,"dblclick",n[5]),s=!0)},p:function(f,d){var h=t;(t=u(f))===h?c[t].p(f,d):(Ee(),M(c[h],1,1,function(){c[h]=null}),Ae(),(r=c[t])?r.p(f,d):(r=c[t]=l[t](f)).c(),C(r,1),r.m(e,null)),(!o||1&d&&i!==(i=Vn(f[6](f[0]))+" svelte-10xe8tv"))&&x(e,"class",i)},i:function(f){o||(C(r),o=!0)},o:function(f){M(r),o=!1},d:function(f){f&&Z(e),c[t].d(),s=!1,a()}}}function UU(n){var e,t;return e=new _4({props:{value:n[2].normalization.escapeValue(n[0]),shortText:!0,onChange:n[7],onCancel:n[8],onFind:n[2].onFind}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};5&i&&(o.value=r[2].normalization.escapeValue(r[0])),4&i&&(o.onFind=r[2].onFind),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function WU(n){var e,t=Pa(n[2].normalization.escapeValue(n[0]))+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){5&i&&t!==(t=Pa(r[2].normalization.escapeValue(r[0]))+"")&>(e,t)},i:Te,o:Te,d:function(r){r&&Z(e)}}}function JU(n){var e,t;return e=new B4({props:{text:n[2].normalization.escapeValue(n[0]),searchResultItems:n[1]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};5&i&&(o.text=r[2].normalization.escapeValue(r[0])),2&i&&(o.searchResultItems=r[1]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function nj(n){var e,t;return e=new Gs({props:{selected:!0,onContextMenu:n[2].onContextMenu}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};4&i&&(o.onContextMenu=r[2].onContextMenu),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function KU(n){var e,t,r,i,o,s=[UU,HU],a=[];function l(u,f){return!u[2].readOnly&&u[4]?0:1}e=l(n),t=a[e]=s[e](n);var c=!n[2].readOnly&&n[3]&&!n[4]&&nj(n);return{c:function(){t.c(),r=ce(),c&&c.c(),i=an()},m:function(u,f){a[e].m(u,f),ee(u,r,f),c&&c.m(u,f),ee(u,i,f),o=!0},p:function(u,f){var d=At(f,1)[0],h=e;(e=l(u))===h?a[e].p(u,d):(Ee(),M(a[h],1,1,function(){a[h]=null}),Ae(),(t=a[e])?t.p(u,d):(t=a[e]=s[e](u)).c(),C(t,1),t.m(r.parentNode,r)),u[2].readOnly||!u[3]||u[4]?c&&(Ee(),M(c,1,1,function(){c=null}),Ae()):c?(c.p(u,d),28&d&&C(c,1)):((c=nj(u)).c(),C(c,1),c.m(i.parentNode,i))},i:function(u){o||(C(t),C(c),o=!0)},o:function(u){M(t),M(c),o=!1},d:function(u){u&&(Z(r),Z(i)),a[e].d(u),c&&c.d(u)}}}function GU(n,e,t){var r,i,o=e.path,s=e.key,a=e.selection,l=e.searchResultItems,c=e.onUpdateKey,u=e.context;return n.$$set=function(f){"path"in f&&t(9,o=f.path),"key"in f&&t(0,s=f.key),"selection"in f&&t(10,a=f.selection),"searchResultItems"in f&&t(1,l=f.searchResultItems),"onUpdateKey"in f&&t(11,c=f.onUpdateKey),"context"in f&&t(2,u=f.context)},n.$$.update=function(){1536&n.$$.dirty&&t(3,r=!!a&&or(a)&&sn(a.path,o)),1032&n.$$.dirty&&t(4,i=r&&Xr(a))},[s,l,u,r,i,function(f){i||u.readOnly||(f.preventDefault(),u.onSelect(zi(o,!0)))},function(f){return Bo("jse-key",{"jse-empty":f===""})},function(f,d){var h=c(s,u.normalization.unescapeValue(f)),p=on(o).concat(h);u.onSelect(d===Rs.nextInside?Ut(p,!1):zi(p,!1)),d!==Rs.self&&u.focus()},function(){u.onSelect(zi(o,!1)),u.focus()},o,a,c]}var QU=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,GU,KU,Tt,{path:9,key:0,selection:10,searchResultItems:1,onUpdateKey:11,context:2},VU),r}return ht(e,mt),ut(e)}();function rj(n,e,t){var r=n.slice();return r[8]=e[t],r}function YU(n){var e,t,r=n[8].component,i=ij(n);return{c:function(){i.c(),e=an()},m:function(o,s){i.m(o,s),ee(o,e,s),t=!0},p:function(o,s){1&s&&Tt(r,r=o[8].component)?(Ee(),M(i,1,1,Te),Ae(),(i=ij(o)).c(),C(i,1),i.m(e.parentNode,e)):i.p(o,s)},i:function(o){t||(C(i),t=!0)},o:function(o){M(i),t=!1},d:function(o){o&&Z(e),i.d(o)}}}function XU(n){var e,t=n[8].action,r=oj(n);return{c:function(){r.c(),e=an()},m:function(i,o){r.m(i,o),ee(i,e,o)},p:function(i,o){1&o&&Tt(t,t=i[8].action)?(r.d(1),(r=oj(i)).c(),r.m(e.parentNode,e)):r.p(i,o)},i:Te,o:Te,d:function(i){i&&Z(e),r.d(i)}}}function ij(n){var e,t,r,i=[n[8].props],o=n[8].component;function s(a,l){for(var c={},u=0;uj+b()/2;)j+=b(),y-=1;var w=h[y].path,$=y-g;return y!==g&&h[y]!==void 0?{beforePath:w,offset:$}:void 0}({json:e,selection:o,deltaY:r,items:i}):function(f){for(var d,h=f.json,p=f.items,m=f.selection,v=f.deltaY,g=Is(h,m),b=p.findIndex(function(W){return sn(W.path,g)}),y=0,j=b,w=function(){var W;return(W=p[j+1])===null||W===void 0?void 0:W.height};w()!==void 0&&Math.abs(v)>y+w()/2;)y+=w(),j+=1;var $=on(g),S=Ye(h,$),_=Array.isArray(S),F=(d=p[_?j:j+1])===null||d===void 0?void 0:d.path,I=j-b;return F?{beforePath:F,offset:I}:{append:!0,offset:I}}({json:e,selection:o,deltaY:r,items:i});if(!s||s.offset===0)return{operations:void 0,updatedSelection:null,offset:0};var a=function(f,d,h){if(!d)return[];var p="beforePath"in h?h.beforePath:void 0,m="append"in h?h.append:void 0,v=on(lt(d)),g=Ye(f,v);if(!(m||p&&cs(p,v)&&p.length>v.length))return[];var b=Go(f,d),y=Is(f,d),j=en(b),w=en(y),$=p?p[v.length]:void 0;if(!Gn(g)){if(Nn(g)){var S=zr(j),_=zr(w),F=$!==void 0?zr($):g.length;return eT(_-S+1,FW?[].concat(Vt(I.slice(W,D+1)),Vt(I.slice(U,I.length))).map(function(q){return _a(v,q)}):[].concat(Vt(I.slice(U,W)),Vt(I.slice(D+1,I.length))).map(function(q){return _a(v,q)}):[]}(e,o,s),l=on(Go(e,o)),c=Ye(e,l);if(Array.isArray(c)){var u=function(f){var d,h,p=f.items,m=f.json,v=f.selection,g=f.offset,b=Go(m,v),y=Is(m,v),j=p.findIndex(function(_){return sn(_.path,b)}),w=p.findIndex(function(_){return sn(_.path,y)}),$=(d=p[j+g])===null||d===void 0?void 0:d.path,S=(h=p[w+g])===null||h===void 0?void 0:h.path;return Wr($,S)}({items:i,json:e,selection:o,offset:s.offset});return{operations:a,updatedSelection:u,offset:s.offset}}return{operations:a,updatedSelection:null,offset:s.offset}}function Ei(n,e){return function(t,r){if(t){for(var i={},o=0,s=Object.keys(t);o0?i:void 0}}(n,function(t){return lh(t,e)})}function rW(n){Et(n,"svelte-1yy7qpj",'button.jse-validation-error.svelte-1yy7qpj{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-error-color, #ee5341)}button.jse-validation-info.svelte-1yy7qpj{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-info-color, #4f91ff)}button.jse-validation-warning.svelte-1yy7qpj{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;padding:0;margin:0;vertical-align:top;display:inline-flex;color:var(--jse-warning-color, #fdc539)}')}function iW(n){var e,t,r,i,o,s,a;return t=new un({props:{data:La}}),{c:function(){e=V("button"),xe(t.$$.fragment),x(e,"type","button"),x(e,"class",r="jse-validation-"+n[0].severity+" svelte-1yy7qpj")},m:function(l,c){ee(l,e,c),be(t,e,null),o=!0,s||(a=[Ce(e,"click",function(){Mr(n[1])&&n[1].apply(this,arguments)}),mr(i=W0.call(null,e,fe({text:n[2]},n[3])))],s=!0)},p:function(l,c){var u=At(c,1)[0];n=l,(!o||1&u&&r!==(r="jse-validation-"+n[0].severity+" svelte-1yy7qpj"))&&x(e,"class",r),i&&Mr(i.update)&&4&u&&i.update.call(null,fe({text:n[2]},n[3]))},i:function(l){o||(C(t.$$.fragment,l),o=!0)},o:function(l){M(t.$$.fragment,l),o=!1},d:function(l){l&&Z(e),we(t),s=!1,kn(a)}}}function oW(n,e,t){var r,i=Er("absolute-popup"),o=e.validationError,s=e.onExpand;return n.$$set=function(a){"validationError"in a&&t(0,o=a.validationError),"onExpand"in a&&t(1,s=a.onExpand)},n.$$.update=function(){1&n.$$.dirty&&t(2,r=mU(o)&&o.isChildError?"Contains invalid data":o.message)},[o,s,r,i]}var Xl=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,oW,iW,yr,{validationError:0,onExpand:1},rW),r}return ht(e,mt),ut(e)}();function sW(n){Et(n,"svelte-6mjnsm",'.jse-json-node.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative;color:var(--jse-text-color, #4d4d4d)}.jse-json-node.jse-root.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{min-height:100%;padding-bottom:2px;box-sizing:border-box}.jse-json-node.jse-root.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm .jse-context-menu-pointer,.jse-json-node.jse-root.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm .jse-context-menu-pointer{top:0;right:calc(-2px - var(--jse-context-menu-pointer-size, calc(1em + 4px)))}.jse-json-node.jse-root.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm.svelte-6mjnsm{padding-left:0}.jse-json-node.svelte-6mjnsm .jse-props.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-items.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative}.jse-json-node.svelte-6mjnsm .jse-header-outer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-footer-outer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)))}.jse-json-node.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative}.jse-json-node.svelte-6mjnsm .jse-header .jse-meta.svelte-6mjnsm>.jse-meta-inner.svelte-6mjnsm.svelte-6mjnsm{display:flex;justify-content:center}.jse-json-node.svelte-6mjnsm .jse-contents-outer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)))}.jse-json-node.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;flex-direction:row;align-items:flex-start}.jse-json-node.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding-left:var(--jse-indent-size, calc(1em + 4px))}.jse-json-node.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:inline-flex;padding-left:calc(var(--jse-indent-size, calc(1em + 4px)) + 5px)}.jse-json-node.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-contents-background-color, transparent)}.jse-json-node.svelte-6mjnsm .jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{visibility:hidden;padding:0 calc(0.5 * var(--jse-padding, 10px));flex:1}.jse-json-node.svelte-6mjnsm .jse-insert-selection-area.jse-inside.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:inline-flex;align-items:center}.jse-json-node.svelte-6mjnsm .jse-insert-selection-area.jse-after.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;align-items:flex-end}.jse-json-node.svelte-6mjnsm .jse-context-menu-pointer-anchor.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{position:relative}.jse-json-node.svelte-6mjnsm .jse-insert-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{display:flex;position:relative;z-index:1;margin-left:calc(var(--level) * var(--jse-indent-size, calc(1em + 4px)));max-width:250px;min-width:100px;height:0;margin-right:calc(0.5 * var(--jse-padding, 10px));outline:1px solid}.jse-json-node.svelte-6mjnsm .jse-insert-area.svelte-6mjnsm .jse-context-menu-pointer{right:-1px;background:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-hovered.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{outline-color:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-json-node.svelte-6mjnsm:hover>.jse-contents-outer .jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:not(.jse-selected),.jse-json-node.svelte-6mjnsm .jse-header-outer.svelte-6mjnsm:hover>.jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm:not(.jse-selected),.jse-json-node.svelte-6mjnsm .jse-footer-outer:hover .jse-insert-selection-area.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:not(.jse-selected){visibility:visible}.jse-json-node.jse-hovered.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-hovered.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-json-node.jse-selected.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected.svelte-6mjnsm .jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-selected.svelte-6mjnsm .jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-selection-background-color, #d3d3d3)}.jse-json-node.jse-selected-key.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm>.jse-identifier>.jse-key,.jse-json-node.jse-selected-key.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-identifier>.jse-key{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-contents-outer.svelte-6mjnsm>.jse-contents.svelte-6mjnsm>.jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.svelte-6mjnsm .jse-collapsed-items.jse-selected,.jse-json-node.jse-selected.svelte-6mjnsm .jse-collapsed-items,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-collapsed-items{background-color:var(--jse-selection-background-color, #d3d3d3);--jse-collapsed-items-background-color:var(--jse-collapsed-items-selected-background-color, #c2c2c2)}.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-meta.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-footer-outer.svelte-6mjnsm>.jse-footer.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-footer.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{background:var(--jse-selection-background-color, #d3d3d3)}.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-meta.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-meta.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-header-outer.svelte-6mjnsm>.jse-header.svelte-6mjnsm>.jse-meta.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-footer-outer.svelte-6mjnsm>.jse-footer.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm>.jse-footer-outer.svelte-6mjnsm>.jse-footer.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-contents.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-header.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-footer.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-footer.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-expand.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-props .jse-expand.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-contents.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-header.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-footer.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-footer.svelte-6mjnsm .jse-value,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-expand.svelte-6mjnsm .jse-key,.jse-json-node.jse-selected-value.svelte-6mjnsm .jse-items .jse-expand.svelte-6mjnsm .jse-value{background:var(--jse-selection-background-color, #d3d3d3);cursor:var(--jse-contents-selected-cursor, grab)}.jse-json-node.jse-readonly.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{--jse-contents-selected-cursor:pointer}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-selected.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{outline-color:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565))}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-selected.svelte-6mjnsm .jse-context-menu-pointer{background:var(--jse-context-menu-pointer-background, var(--jse-context-menu-background, #656565))}.jse-json-node.svelte-6mjnsm .jse-insert-area.jse-selected.svelte-6mjnsm .jse-context-menu-pointer:hover{background:var(--jse-context-menu-pointer-background-highlight, var(--jse-context-menu-background-highlight, #7a7a7a))}.jse-main:not(.jse-focus) .jse-json-node.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{--jse-selection-background-color:var(--jse-selection-background-inactive-color, #e8e8e8);--jse-context-menu-pointer-background:var(--jse-context-menu-pointer-hover-background, #b2b2b2)}.jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{width:var(--jse-indent-size, calc(1em + 4px));padding:0;margin:0;border:none;cursor:pointer;background:transparent;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38));font-size:var(--jse-font-size-mono, 14px);height:var(--jse-line-height, calc(1em + 4px))}.jse-expand.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:hover{opacity:0.8}.jse-meta.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-separator.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-index.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm,.jse-bracket.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{vertical-align:top;color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-index.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding:0 calc(0.5 * var(--jse-padding, 10px))}.jse-bracket.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding:0 2px}.jse-bracket.jse-expanded.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{padding-right:var(--jse-padding, 10px)}.jse-tag.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{border:none;font-size:80%;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);color:var(--jse-tag-color, var(--jse-text-color-inverse, #fff));background:var(--jse-tag-background, rgba(0, 0, 0, 0.2));border-radius:2px;cursor:pointer;display:inline-block;padding:0 4px;line-height:normal;margin:1px 0}.jse-tag.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm:hover{opacity:0.8}.jse-tag.jse-expanded.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{opacity:0.7;cursor:inherit}.jse-identifier.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm.svelte-6mjnsm{vertical-align:top;position:relative}')}var aW=function(n){return{}},aj=function(n){return{}};function lj(n,e,t){var r=n.slice();return r[52]=e[t],r}var lW=function(n){return{}},cj=function(n){return{}};function uj(n,e,t){var r=n.slice();return r[46]=e[t],r[48]=t,r}function fj(n,e,t){var r=n.slice();return r[49]=e[t],r}var cW=function(n){return{}},dj=function(n){return{}};function uW(n){var e,t,r,i,o,s,a,l,c,u=!n[8].readOnly&&n[16]&&n[7]&&(rn(n[7])||Cn(n[7]))&&!Xr(n[7])&&sn(lt(n[7]),n[1]),f=n[33].identifier,d=Qn(f,n,n[34],aj),h=!n[17]&&hj();o=new nW({props:{path:n[1],value:n[0],enforceString:n[13]||!1,selection:n[16]?n[7]:null,searchResultItems:Dg(n[6],n[9]),context:n[8]}});var p=u&&pj(n),m=n[15]&&mj(n),v=!n[17]&&gj(n);return{c:function(){e=V("div"),t=V("div"),d&&d.c(),r=ce(),h&&h.c(),i=ce(),xe(o.$$.fragment),s=ce(),p&&p.c(),a=ce(),m&&m.c(),l=ce(),v&&v.c(),x(t,"class","jse-contents svelte-6mjnsm"),x(e,"class","jse-contents-outer svelte-6mjnsm")},m:function(g,b){ee(g,e,b),E(e,t),d&&d.m(t,null),E(t,r),h&&h.m(t,null),E(t,i),be(o,t,null),E(t,s),p&&p.m(t,null),E(e,a),m&&m.m(e,null),E(e,l),v&&v.m(e,null),c=!0},p:function(g,b){d&&d.p&&(!c||8&b[1])&&Xn(d,f,g,g[34],c?Yn(f,g[34],b,aW):Zn(g[34]),aj),g[17]?h&&(h.d(1),h=null):h||((h=hj()).c(),h.m(t,i));var y={};2&b[0]&&(y.path=g[1]),1&b[0]&&(y.value=g[0]),8192&b[0]&&(y.enforceString=g[13]||!1),65664&b[0]&&(y.selection=g[16]?g[7]:null),576&b[0]&&(y.searchResultItems=Dg(g[6],g[9])),256&b[0]&&(y.context=g[8]),o.$set(y),65922&b[0]&&(u=!g[8].readOnly&&g[16]&&g[7]&&(rn(g[7])||Cn(g[7]))&&!Xr(g[7])&&sn(lt(g[7]),g[1])),u?p?(p.p(g,b),65922&b[0]&&C(p,1)):((p=pj(g)).c(),C(p,1),p.m(t,null)):p&&(Ee(),M(p,1,1,function(){p=null}),Ae()),g[15]?m?(m.p(g,b),32768&b[0]&&C(m,1)):((m=mj(g)).c(),C(m,1),m.m(e,l)):m&&(Ee(),M(m,1,1,function(){m=null}),Ae()),g[17]?v&&(v.d(1),v=null):v?v.p(g,b):((v=gj(g)).c(),v.m(e,null))},i:function(g){c||(C(d,g),C(o.$$.fragment,g),C(p),C(m),c=!0)},o:function(g){M(d,g),M(o.$$.fragment,g),M(p),M(m),c=!1},d:function(g){g&&Z(e),d&&d.d(g),h&&h.d(),we(o),p&&p.d(),m&&m.d(),v&&v.d()}}}function fW(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y=!n[8].readOnly&&n[16]&&n[7]&&(rn(n[7])||Cn(n[7]))&&!Xr(n[7])&&sn(lt(n[7]),n[1]),j=[pW,hW],w=[];function $(B,O){return B[12]?0:1}i=$(n),o=w[i]=j[i](n);var S=n[33].identifier,_=Qn(S,n,n[34],cj),F=!n[17]&&vj();function I(B,O){return B[12]?gW:mW}var W=I(n),D=W(n),U=y&&yj(n),q=n[15]&&(!n[12]||!n[15].isChildError)&&bj(n);function X(B,O){return B[12]?yW:B[17]?void 0:vW}var K=X(n),Y=K&&K(n),T=n[12]&&wj(n);return{c:function(){e=V("div"),t=V("div"),r=V("button"),o.c(),s=ce(),_&&_.c(),a=ce(),F&&F.c(),l=ce(),c=V("div"),u=V("div"),D.c(),f=ce(),U&&U.c(),d=ce(),q&&q.c(),h=ce(),Y&&Y.c(),p=ce(),T&&T.c(),m=an(),x(r,"type","button"),x(r,"class","jse-expand svelte-6mjnsm"),x(r,"title","Expand or collapse this object (Ctrl+Click to expand/collapse recursively)"),x(u,"class","jse-meta-inner svelte-6mjnsm"),x(c,"class","jse-meta svelte-6mjnsm"),x(c,"data-type","selectable-value"),x(t,"class","jse-header svelte-6mjnsm"),x(e,"class","jse-header-outer svelte-6mjnsm")},m:function(B,O){ee(B,e,O),E(e,t),E(t,r),w[i].m(r,null),E(t,s),_&&_.m(t,null),E(t,a),F&&F.m(t,null),E(t,l),E(t,c),E(c,u),D.m(u,null),E(t,f),U&&U.m(t,null),E(e,d),q&&q.m(e,null),E(e,h),Y&&Y.m(e,null),ee(B,p,O),T&&T.m(B,O),ee(B,m,O),v=!0,g||(b=Ce(r,"click",n[20]),g=!0)},p:function(B,O){var A=i;(i=$(B))!==A&&(Ee(),M(w[A],1,1,function(){w[A]=null}),Ae(),(o=w[i])||(o=w[i]=j[i](B)).c(),C(o,1),o.m(r,null)),_&&_.p&&(!v||8&O[1])&&Xn(_,S,B,B[34],v?Yn(S,B[34],O,lW):Zn(B[34]),cj),B[17]?F&&(F.d(1),F=null):F||((F=vj()).c(),F.m(t,l)),W===(W=I(B))&&D?D.p(B,O):(D.d(1),(D=W(B))&&(D.c(),D.m(u,null))),65922&O[0]&&(y=!B[8].readOnly&&B[16]&&B[7]&&(rn(B[7])||Cn(B[7]))&&!Xr(B[7])&&sn(lt(B[7]),B[1])),y?U?(U.p(B,O),65922&O[0]&&C(U,1)):((U=yj(B)).c(),C(U,1),U.m(t,null)):U&&(Ee(),M(U,1,1,function(){U=null}),Ae()),!B[15]||B[12]&&B[15].isChildError?q&&(Ee(),M(q,1,1,function(){q=null}),Ae()):q?(q.p(B,O),36864&O[0]&&C(q,1)):((q=bj(B)).c(),C(q,1),q.m(e,h)),K===(K=X(B))&&Y?Y.p(B,O):(Y&&Y.d(1),(Y=K&&K(B))&&(Y.c(),Y.m(e,null))),B[12]?T?(T.p(B,O),4096&O[0]&&C(T,1)):((T=wj(B)).c(),C(T,1),T.m(m.parentNode,m)):T&&(Ee(),M(T,1,1,function(){T=null}),Ae())},i:function(B){v||(C(o),C(_,B),C(U),C(q),C(T),v=!0)},o:function(B){M(o),M(_,B),M(U),M(q),M(T),v=!1},d:function(B){B&&(Z(e),Z(p),Z(m)),w[i].d(),_&&_.d(B),F&&F.d(),D.d(),U&&U.d(),q&&q.d(),Y&&Y.d(),T&&T.d(B),g=!1,b()}}}function dW(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y=!n[8].readOnly&&n[16]&&n[7]&&(rn(n[7])||Cn(n[7]))&&!Xr(n[7])&&sn(lt(n[7]),n[1]),j=[jW,wW],w=[];function $(B,O){return B[12]?0:1}i=$(n),o=w[i]=j[i](n);var S=n[33].identifier,_=Qn(S,n,n[34],dj),F=!n[17]&&kj();function I(B,O){return B[12]?$W:xW}var W=I(n),D=W(n),U=y&&Sj(n),q=n[15]&&(!n[12]||!n[15].isChildError)&&Cj(n);function X(B,O){return B[12]?SW:kW}var K=X(n),Y=K(n),T=n[12]&&Oj(n);return{c:function(){e=V("div"),t=V("div"),r=V("button"),o.c(),s=ce(),_&&_.c(),a=ce(),F&&F.c(),l=ce(),c=V("div"),u=V("div"),D.c(),f=ce(),U&&U.c(),d=ce(),q&&q.c(),h=ce(),Y.c(),p=ce(),T&&T.c(),m=an(),x(r,"type","button"),x(r,"class","jse-expand svelte-6mjnsm"),x(r,"title","Expand or collapse this array (Ctrl+Click to expand/collapse recursively)"),x(u,"class","jse-meta-inner svelte-6mjnsm"),x(u,"data-type","selectable-value"),x(c,"class","jse-meta svelte-6mjnsm"),x(t,"class","jse-header svelte-6mjnsm"),x(e,"class","jse-header-outer svelte-6mjnsm")},m:function(B,O){ee(B,e,O),E(e,t),E(t,r),w[i].m(r,null),E(t,s),_&&_.m(t,null),E(t,a),F&&F.m(t,null),E(t,l),E(t,c),E(c,u),D.m(u,null),E(t,f),U&&U.m(t,null),E(e,d),q&&q.m(e,null),E(e,h),Y.m(e,null),ee(B,p,O),T&&T.m(B,O),ee(B,m,O),v=!0,g||(b=Ce(r,"click",n[20]),g=!0)},p:function(B,O){var A=i;(i=$(B))!==A&&(Ee(),M(w[A],1,1,function(){w[A]=null}),Ae(),(o=w[i])||(o=w[i]=j[i](B)).c(),C(o,1),o.m(r,null)),_&&_.p&&(!v||8&O[1])&&Xn(_,S,B,B[34],v?Yn(S,B[34],O,cW):Zn(B[34]),dj),B[17]?F&&(F.d(1),F=null):F||((F=kj()).c(),F.m(t,l)),W===(W=I(B))&&D?D.p(B,O):(D.d(1),(D=W(B))&&(D.c(),D.m(u,null))),65922&O[0]&&(y=!B[8].readOnly&&B[16]&&B[7]&&(rn(B[7])||Cn(B[7]))&&!Xr(B[7])&&sn(lt(B[7]),B[1])),y?U?(U.p(B,O),65922&O[0]&&C(U,1)):((U=Sj(B)).c(),C(U,1),U.m(t,null)):U&&(Ee(),M(U,1,1,function(){U=null}),Ae()),!B[15]||B[12]&&B[15].isChildError?q&&(Ee(),M(q,1,1,function(){q=null}),Ae()):q?(q.p(B,O),36864&O[0]&&C(q,1)):((q=Cj(B)).c(),C(q,1),q.m(e,h)),K===(K=X(B))&&Y?Y.p(B,O):(Y.d(1),(Y=K(B))&&(Y.c(),Y.m(e,null))),B[12]?T?(T.p(B,O),4096&O[0]&&C(T,1)):((T=Oj(B)).c(),C(T,1),T.m(m.parentNode,m)):T&&(Ee(),M(T,1,1,function(){T=null}),Ae())},i:function(B){v||(C(o),C(_,B),C(U),C(q),C(T),v=!0)},o:function(B){M(o),M(_,B),M(U),M(q),M(T),v=!1},d:function(B){B&&(Z(e),Z(p),Z(m)),w[i].d(),_&&_.d(B),F&&F.d(),D.d(),U&&U.d(),q&&q.d(),Y.d(),T&&T.d(B),g=!1,b()}}}function hj(n){var e;return{c:function(){(e=V("div")).textContent=":",x(e,"class","jse-separator svelte-6mjnsm")},m:function(t,r){ee(t,e,r)},d:function(t){t&&Z(e)}}}function pj(n){var e,t,r;return t=new Gs({props:{selected:!0,onContextMenu:n[8].onContextMenu}}),{c:function(){e=V("div"),xe(t.$$.fragment),x(e,"class","jse-context-menu-pointer-anchor svelte-6mjnsm")},m:function(i,o){ee(i,e,o),be(t,e,null),r=!0},p:function(i,o){var s={};256&o[0]&&(s.onContextMenu=i[8].onContextMenu),t.$set(s)},i:function(i){r||(C(t.$$.fragment,i),r=!0)},o:function(i){M(t.$$.fragment,i),r=!1},d:function(i){i&&Z(e),we(t)}}}function mj(n){var e,t;return e=new Xl({props:{validationError:n[15],onExpand:n[21]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};32768&i[0]&&(o.validationError=r[15]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function gj(n){var e,t,r;return{c:function(){x(e=V("div"),"role","none"),x(e,"class","jse-insert-selection-area jse-after svelte-6mjnsm"),x(e,"data-type","insert-selection-area-after")},m:function(i,o){ee(i,e,o),t||(r=Ce(e,"click",n[29]),t=!0)},p:Te,d:function(i){i&&Z(e),t=!1,r()}}}function hW(n){var e,t;return e=new un({props:{data:$s}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function pW(n){var e,t;return e=new un({props:{data:Ri}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function vj(n){var e;return{c:function(){(e=V("div")).textContent=":",x(e,"class","jse-separator svelte-6mjnsm")},m:function(t,r){ee(t,e,r)},d:function(t){t&&Z(e)}}}function mW(n){var e,t,r,i,o,s,a,l,c,u,f=Object.keys(n[0]).length+"",d=Object.keys(n[0]).length===1?"prop":"props";return{c:function(){(e=V("div")).textContent="{",t=ce(),r=V("button"),i=De(f),o=ce(),s=De(d),a=ce(),(l=V("div")).textContent="}",x(e,"class","jse-bracket svelte-6mjnsm"),x(r,"type","button"),x(r,"class","jse-tag svelte-6mjnsm"),x(l,"class","jse-bracket svelte-6mjnsm")},m:function(h,p){ee(h,e,p),ee(h,t,p),ee(h,r,p),E(r,i),E(r,o),E(r,s),ee(h,a,p),ee(h,l,p),c||(u=Ce(r,"click",n[21]),c=!0)},p:function(h,p){1&p[0]&&f!==(f=Object.keys(h[0]).length+"")&>(i,f),1&p[0]&&d!==(d=Object.keys(h[0]).length===1?"prop":"props")&>(s,d)},d:function(h){h&&(Z(e),Z(t),Z(r),Z(a),Z(l)),c=!1,u()}}}function gW(n){var e;return{c:function(){(e=V("div")).textContent="{",x(e,"class","jse-bracket jse-expanded svelte-6mjnsm")},m:function(t,r){ee(t,e,r)},p:Te,d:function(t){t&&Z(e)}}}function yj(n){var e,t,r;return t=new Gs({props:{selected:!0,onContextMenu:n[8].onContextMenu}}),{c:function(){e=V("div"),xe(t.$$.fragment),x(e,"class","jse-context-menu-pointer-anchor svelte-6mjnsm")},m:function(i,o){ee(i,e,o),be(t,e,null),r=!0},p:function(i,o){var s={};256&o[0]&&(s.onContextMenu=i[8].onContextMenu),t.$set(s)},i:function(i){r||(C(t.$$.fragment,i),r=!0)},o:function(i){M(t.$$.fragment,i),r=!1},d:function(i){i&&Z(e),we(t)}}}function bj(n){var e,t;return e=new Xl({props:{validationError:n[15],onExpand:n[21]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};32768&i[0]&&(o.validationError=r[15]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function vW(n){var e,t,r;return{c:function(){x(e=V("div"),"role","none"),x(e,"class","jse-insert-selection-area jse-after svelte-6mjnsm"),x(e,"data-type","insert-selection-area-after")},m:function(i,o){ee(i,e,o),t||(r=Ce(e,"click",n[29]),t=!0)},p:Te,d:function(i){i&&Z(e),t=!1,r()}}}function yW(n){var e,t,r;return{c:function(){x(e=V("div"),"role","none"),x(e,"class","jse-insert-selection-area jse-inside svelte-6mjnsm"),x(e,"data-type","insert-selection-area-inside")},m:function(i,o){ee(i,e,o),t||(r=Ce(e,"click",n[28]),t=!0)},p:Te,d:function(i){i&&Z(e),t=!1,r()}}}function wj(n){for(var e,t,r,i,o,s,a,l=!n[8].readOnly&&(n[10]===os||n[16]&&dr(n[7])),c=l&&jj(n),u=Mt(n[18](n[1],n[0],n[2],n[3],n[4],n[5],n[6],n[7],n[11])),f=[],d=0;d}',s=ce(),p&&p.c(),x(e,"class","jse-props svelte-6mjnsm"),x(o,"data-type","selectable-value"),x(o,"class","jse-footer svelte-6mjnsm"),x(i,"class","jse-footer-outer svelte-6mjnsm")},m:function(m,v){ee(m,e,v),c&&c.m(e,null),E(e,t);for(var g=0;g]',s=ce(),g&&g.c(),x(e,"class","jse-items svelte-6mjnsm"),x(o,"data-type","selectable-value"),x(o,"class","jse-footer svelte-6mjnsm"),x(i,"class","jse-footer-outer svelte-6mjnsm")},m:function(b,y){ee(b,e,y),f&&f.m(e,null),E(e,t);for(var j=0;j=st.start&&et<=st.end});if(!tn)return null;var Qt=tn.start,oe=tn.end;a4(Qt,Math.min(h.length,oe),function(st){return he(String(st))})}else Object.keys(h).forEach(he);return J}(j,a||Aa);if(S("dragSelectionStart",{selection:j,items:O}),O){var A=w.getJson();if(A!==void 0){var te=Go(A,j),R=O.findIndex(function(P){return sn(P.path,te)}),k=nm({json:A,documentState:w.getDocumentState(),deltaY:0,items:O}).offset;t(11,I={initialTarget:T.target,initialClientY:T.clientY,initialContentTop:q(),selectionStartIndex:R,selectionItemsCount:Ns(A,j).length,items:O,offset:k,didMoveItems:!1}),wr.dragging=!0,document.addEventListener("mousemove",K,!0),document.addEventListener("mouseup",Y)}}else S("Cannot drag the current selection (probably spread over multiple sections)")}else $(T)}},function(T){wr.selecting||wr.dragging||(T.stopPropagation(),da(T.target,"data-type","selectable-value")?t(10,_=Mg):da(T.target,"data-type","insert-selection-area-inside")?t(10,_=os):da(T.target,"data-type","insert-selection-area-after")&&t(10,_=uu),clearTimeout(F))},function(T){T.stopPropagation(),F=window.setTimeout(function(){return t(10,_=void 0)})},function(T){T.shiftKey||(T.stopPropagation(),T.preventDefault(),w.onSelect(us(p)))},function(T){T.shiftKey||(T.stopPropagation(),T.preventDefault(),w.onSelect(Zo(p)))},function(T){w.onSelect(us(p)),w.onContextMenu(T)},function(T){w.onSelect(Zo(p)),w.onContextMenu(T)},$,f,d]}var X0=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,MW,OW,Tt,{value:0,path:1,expandedMap:2,enforceStringMap:3,visibleSectionsMap:4,validationErrorsMap:5,searchResultItemsMap:6,selection:7,context:8,onDragSelectionStart:32},sW,[-1,-1]),r}return ht(e,mt),ut(e)}(),EW=X0,AW={prefix:"fas",iconName:"jsoneditor-expand",icon:[512,512,[],"","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"]},TW={prefix:"fas",iconName:"jsoneditor-collapse",icon:[512,512,[],"","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"]},Vg={prefix:"fas",iconName:"jsoneditor-format",icon:[512,512,[],"","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"]},PW={prefix:"fas",iconName:"jsoneditor-compact",icon:[512,512,[],"","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 _W(n){var e,t;return e=new rp({props:{items:n[0]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&At(i,1)[0]&&(o.items=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function RW(n,e,t){var r,i,o,s,a,l,c,u=e.json,f=e.selection,d=e.readOnly,h=e.showSearch,p=h!==void 0&&h,m=e.historyState,v=e.onExpandAll,g=e.onCollapseAll,b=e.onUndo,y=e.onRedo,j=e.onSort,w=e.onTransform,$=e.onContextMenu,S=e.onCopy,_=e.onRenderMenu;function F(){t(1,p=!p)}return n.$$set=function(I){"json"in I&&t(2,u=I.json),"selection"in I&&t(3,f=I.selection),"readOnly"in I&&t(4,d=I.readOnly),"showSearch"in I&&t(1,p=I.showSearch),"historyState"in I&&t(5,m=I.historyState),"onExpandAll"in I&&t(6,v=I.onExpandAll),"onCollapseAll"in I&&t(7,g=I.onCollapseAll),"onUndo"in I&&t(8,b=I.onUndo),"onRedo"in I&&t(9,y=I.onRedo),"onSort"in I&&t(10,j=I.onSort),"onTransform"in I&&t(11,w=I.onTransform),"onContextMenu"in I&&t(12,$=I.onContextMenu),"onCopy"in I&&t(13,S=I.onCopy),"onRenderMenu"in I&&t(14,_=I.onRenderMenu)},n.$$.update=function(){4&n.$$.dirty&&t(20,r=u!==void 0),1048584&n.$$.dirty&&t(19,i=r&&(Cn(f)||or(f)||rn(f))),68&n.$$.dirty&&t(15,s={type:"button",icon:AW,title:"Expand all",className:"jse-expand-all",onClick:v,disabled:!Wn(u)}),132&n.$$.dirty&&t(16,a={type:"button",icon:TW,title:"Collapse all",className:"jse-collapse-all",onClick:g,disabled:!Wn(u)}),4&n.$$.dirty&&t(17,l={type:"button",icon:kh,title:"Search (Ctrl+F)",className:"jse-search",onClick:F,disabled:u===void 0}),769844&n.$$.dirty&&t(18,c=d?[s,a,{type:"separator"},{type:"button",icon:Es,title:"Copy (Ctrl+C)",className:"jse-copy",onClick:S,disabled:!i},{type:"separator"},l,{type:"space"}]:[s,a,{type:"separator"},{type:"button",icon:$h,title:"Sort",className:"jse-sort",onClick:j,disabled:d||u===void 0},{type:"button",icon:jh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:w,disabled:d||u===void 0},l,{type:"button",icon:ek,title:D0,className:"jse-contextmenu",onClick:$},{type:"separator"},{type:"button",icon:hv,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:b,disabled:!m.canUndo},{type:"button",icon:dv,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:y,disabled:!m.canRedo},{type:"space"}]),278528&n.$$.dirty&&t(0,o=_(c))},[o,p,u,f,d,m,v,g,b,y,j,w,$,S,_,s,a,l,c,i,r]}var NW=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,RW,_W,Tt,{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 ht(e,mt),ut(e)}();function IW(n){Et(n,"svelte-s2toti",'.jse-welcome.svelte-s2toti.svelte-s2toti{flex:1;overflow:auto;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);display:flex;flex-direction:column;align-items:center;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-welcome.svelte-s2toti.svelte-s2toti:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-welcome.svelte-s2toti .jse-space.jse-before.svelte-s2toti{flex:1}.jse-welcome.svelte-s2toti .jse-space.jse-after.svelte-s2toti{flex:2}.jse-welcome.svelte-s2toti .jse-contents.svelte-s2toti{display:flex;flex-direction:column;max-width:300px;margin:2em var(--jse-padding, 10px);gap:var(--jse-padding, 10px)}.jse-welcome.svelte-s2toti .jse-contents .jse-welcome-info.svelte-s2toti{color:var(--jse-panel-color-readonly, #b2b2b2)}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-welcome.svelte-s2toti .jse-contents button.svelte-s2toti:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}')}function Rj(n){var e,t,r,i,o,s,a;return{c:function(){(e=V("div")).innerHTML="You can paste clipboard data using Ctrl+V, or use the following options:",t=ce(),(r=V("button")).textContent="Create object",i=ce(),(o=V("button")).textContent="Create array",x(e,"class","jse-welcome-info svelte-s2toti"),x(r,"title","Create an empty JSON object (press '{')"),x(r,"class","svelte-s2toti"),x(o,"title","Create an empty JSON array (press '[')"),x(o,"class","svelte-s2toti")},m:function(l,c){ee(l,e,c),ee(l,t,c),ee(l,r,c),ee(l,i,c),ee(l,o,c),s||(a=[Ce(r,"click",uo(n[4])),Ce(o,"click",uo(n[5]))],s=!0)},p:Te,d:function(l){l&&(Z(e),Z(t),Z(r),Z(i),Z(o)),s=!1,kn(a)}}}function DW(n){var e,t,r,i,o,s,a,l,c,u,f=!n[0]&&Rj(n);return{c:function(){e=V("div"),t=V("div"),r=ce(),i=V("div"),(o=V("div")).textContent="Empty document",s=ce(),f&&f.c(),a=ce(),l=V("div"),x(t,"class","jse-space jse-before svelte-s2toti"),x(o,"class","jse-welcome-title"),x(i,"class","jse-contents svelte-s2toti"),x(l,"class","jse-space jse-after svelte-s2toti"),x(e,"class","jse-welcome svelte-s2toti"),x(e,"role","none")},m:function(d,h){ee(d,e,h),E(e,t),E(e,r),E(e,i),E(i,o),E(i,s),f&&f.m(i,null),E(e,a),E(e,l),c||(u=Ce(e,"click",n[6]),c=!0)},p:function(d,h){var p=At(h,1)[0];d[0]?f&&(f.d(1),f=null):f?f.p(d,p):((f=Rj(d)).c(),f.m(i,null))},i:Te,o:Te,d:function(d){d&&Z(e),f&&f.d(),c=!1,u()}}}function LW(n,e,t){var r=e.readOnly,i=e.onCreateArray,o=e.onCreateObject,s=e.onClick;return n.$$set=function(a){"readOnly"in a&&t(0,r=a.readOnly),"onCreateArray"in a&&t(1,i=a.onCreateArray),"onCreateObject"in a&&t(2,o=a.onCreateObject),"onClick"in a&&t(3,s=a.onClick)},[r,i,o,s,function(){return o()},function(){return i()},function(){return s()}]}var BW=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,LW,DW,Tt,{readOnly:0,onCreateArray:1,onCreateObject:2,onClick:3},IW),r}return ht(e,mt),ut(e)}();function Hg(n,e){var t=typeof n=="string"?n.toLowerCase():n,r=typeof e=="string"?e.toLowerCase():e;return AT(t,r)}function r6(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(Nn(Ye(n,e))){if(t===void 0)throw new Error("Cannot sort: no property selected by which to sort the array");return function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,l=function(u,f){return function(d,h){var p=Ye(d,u),m=Ye(h,u);return p===void 0?f:m===void 0?-f:typeof p!="string"&&typeof m!="string"?p>m?f:p1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=Ye(i,o),l=Object.keys(a).slice();l.sort(function(h,p){return s*Hg(h,p)});for(var c=[],u=0;uxc&&Dj();return{c:function(){e=V("div");for(var f=0;fxc?u?u.p(f,h):((u=Dj()).c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Te,o:Te,d:function(f){f&&Z(e);for(var d=0;d0&&(s("scrollTo ",m),o.scrollTo({left:m,behavior:"smooth"}))}})},[a,u,f,r,o,d,i,function(m){s("get items for path",m);var v=Ye(a,m);if(Array.isArray(v))return G7(0,v.length).map(String);if(Rn(v)){var g=Object.keys(v).slice(0);return g.sort(Hg),g}return[]},function(m){return Ii(a,m)},h,function(){t(5,d=!d)},p,function(m){p(),h(m)},l,c,function(m){It[m?"unshift":"push"](function(){t(4,o=m)})}]}var nJ=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,tJ,eJ,Tt,{json:0,selection:13,onSelect:14,onError:1,pathParser:2},YW),r}return ht(e,mt),ut(e)}();function rJ(n){Et(n,"svelte-wnmp4a",'.jse-search-box.svelte-wnmp4a.svelte-wnmp4a{border:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7));border-radius:3px;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24));display:inline-block;width:400px;max-width:100%;overflow:auto}.jse-search-box.svelte-wnmp4a .jse-search-form.svelte-wnmp4a{display:flex;align-items:stretch}.jse-search-box.svelte-wnmp4a .jse-search-form button.svelte-wnmp4a,.jse-search-box.svelte-wnmp4a .jse-search-form input.svelte-wnmp4a{font-family:inherit;font-size:inherit}.jse-search-box.svelte-wnmp4a .jse-search-form button.svelte-wnmp4a{display:block;text-align:center;border:none;padding:0 5px;margin:0;cursor:pointer;color:var(--jse-panel-button-color, inherit);background:var(--jse-panel-button-background, transparent)}.jse-search-box.svelte-wnmp4a .jse-search-form button.svelte-wnmp4a:hover{color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-search-box.svelte-wnmp4a .jse-search-form input.svelte-wnmp4a{color:var(--jse-panel-color, var(--jse-text-color, #4d4d4d));border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:3px;background:var(--jse-input-background, var(--jse-background-color, #fff));height:28px;padding:0 5px;margin:0;flex:1;width:0;min-width:50px;outline:none}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-replace-toggle.svelte-wnmp4a{padding:var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px));min-width:20px;background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents.svelte-wnmp4a{flex:1;display:flex;flex-direction:column;padding:calc(0.5 * var(--jse-padding, 10px));gap:calc(0.5 * var(--jse-padding, 10px))}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section.svelte-wnmp4a{flex:1;display:flex;align-items:center;position:relative}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section .jse-search-icon.svelte-wnmp4a{color:inherit;cursor:inherit;background:inherit;width:32px;text-align:center}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section label.jse-search-input-label.svelte-wnmp4a{flex:1;display:flex}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.svelte-wnmp4a{color:inherit;font-size:80%;visibility:hidden;padding:0 5px;min-width:36px;text-align:center}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.jse-visible.svelte-wnmp4a{visibility:visible}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-replace-section.svelte-wnmp4a{padding-left:32px;flex:1;display:flex}.jse-search-box.svelte-wnmp4a .jse-search-form .jse-search-contents .jse-replace-section button.svelte-wnmp4a{width:auto}')}function Uj(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D,U=(n[7]!==-1&&n[7]=y2?"".concat(999,"+"):String(r)),71303168&n.$$.dirty[0]&&m(s),2&n.$$.dirty[0]&&function(he){O.apply(this,arguments)}(f),8&n.$$.dirty[0]&&S(y),262144&n.$$.dirty[0]&&_(l)},[d,f,h,y,r,w,$,i,o,F,function(H){H.stopPropagation();var J=ss(H);J==="Enter"&&(H.preventDefault(),y!==j?(S.flush(),j=y):q()),J==="Shift+Enter"&&(H.preventDefault(),K()),J==="Ctrl+Enter"&&(H.preventDefault(),d?W():q()),J==="Ctrl+H"&&(H.preventDefault(),F()),J==="Escape"&&(H.preventDefault(),P())},function(H){ss(H)==="Enter"&&(H.preventDefault(),H.stopPropagation(),W())},function(){return I.apply(this,arguments)},W,function(){return U.apply(this,arguments)},q,K,P,l,c,u,p,m,v,g,b,s,function(){y=this.value,t(3,y)},function(){w=this.value,t(5,w)}]}var o6=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,lJ,sJ,Tt,{json:18,documentState:19,parser:20,showSearch:1,showReplace:0,readOnly:2,columns:21,onSearch:22,onFocus:23,onPatch:24,onClose:25},rJ,[-1,-1]),r}return ht(e,mt),ut(e)}(),gu=Symbol("path");function cJ(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,r={};Array.isArray(n)&&function(o,s,a){if(o.length1?(o.length-1)/(s-1):o.length,c=0;c6&&arguments[6]!==void 0?arguments[6]:80,a=Nn(t)?t.length:0,l=function(b,y){var j=Object.values(b);if(hn(j))return y;var w=function($,S){return $+S};return j.reduce(w)/j.length}(r,i),c=n-s,u=e+2*s,f=function(b){return r[b]||i},d=0,h=o;h0&&(h-=f(--d));for(var p=d,m=0;m0?a-1:void 0,d=f!==void 0?Ut(ha({rowIndex:f,columnIndex:l},r),!1):null;return Gr("remove row new selection",{rowIndex:a,newRowIndex:f,newSelection:d}),{state:fe(fe({},u),{},{selection:d})}})}}function oh(n){var e=n.insertType,t=n.selectInside,r=n.refJsonEditor,i=n.json,o=n.selection,s=n.readOnly,a=n.parser,l=n.onPatch,c=n.onReplaceJson;if(!s){var u=function(m,v,g){if(g==="object")return{};if(g==="array")return[];if(g==="structure"&&m!==void 0){var b=v?A4(v):[],y=Ye(m,b);if(Array.isArray(y)&&!hn(y)){var j=Qo(y);return Wn(j)?wA(j,function(w){return Array.isArray(w)?[]:Rn(w)?void 0:""}):""}}return""}(i,o,e);if(i!==void 0){var f=a.stringify(u),d=N4(i,o,f,a);Gr("onInsert",{insertType:e,operations:d,newValue:u,data:f});var h=en(d.filter(function(m){return m.op==="add"||m.op==="replace"}));l(d,function(m,v){if(h){var g=Eo(m,h.path);if(Wn(u))return{state:fe(fe({},Ti(m,v,g,zc)),{},{selection:t?us(g):v.selection})};if(u===""){var b=hn(g)?null:Ye(m,on(g));return{state:_g(m,fe(fe({},v),{},{selection:Rn(b)?zi(g,!0):Ut(g,!0)}),g)}}}}),Gr("after patch"),h&&u===""&&sh(function(){return Gd(r,"",!0,ah)})}else{Gr("onInsert",{insertType:e,newValue:u});var p=[];c(u,function(m,v){return{state:fe(fe({},xs(m,v,p)),{},{selection:Wn(u)?us(p):Ut(p,!0)})}})}}}function d6(n){return Jg.apply(this,arguments)}function Jg(){return Jg=$t(Pe().mark(function n(e){var t,r,i,o,s,a,l,c,u,f,d,h;return Pe().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(t=e.char,r=e.selectInside,i=e.refJsonEditor,o=e.json,s=e.selection,a=e.readOnly,l=e.parser,c=e.onPatch,u=e.onReplaceJson,f=e.onSelect,!a){p.next=3;break}return p.abrupt("return");case 3:if(!or(s)){p.next=8;break}return d=!s.edit,f(fe(fe({},s),{},{edit:!0})),sh(function(){return Gd(i,t,d,ah)}),p.abrupt("return");case 8:if(t!=="{"){p.next=12;break}oh({insertType:"object",selectInside:r,refJsonEditor:i,json:o,selection:s,readOnly:a,parser:l,onPatch:c,onReplaceJson:u}),p.next=23;break;case 12:if(t!=="["){p.next=16;break}oh({insertType:"array",selectInside:r,refJsonEditor:i,json:o,selection:s,readOnly:a,parser:l,onPatch:c,onReplaceJson:u}),p.next=23;break;case 16:if(!rn(s)||o===void 0){p.next=20;break}Wn(Ye(o,s.path))||(h=!s.edit,f(fe(fe({},s),{},{edit:!0})),sh(function(){return Gd(i,t,h,ah)})),p.next=23;break;case 20:return Gr("onInsertValueWithCharacter",{char:t}),p.next=23,yJ({char:t,refJsonEditor:i,json:o,selection:s,readOnly:a,parser:l,onPatch:c,onReplaceJson:u});case 23:case"end":return p.stop()}},n)})),Jg.apply(this,arguments)}function yJ(n){return Kg.apply(this,arguments)}function Kg(){return Kg=$t(Pe().mark(function n(e){var t,r,i,o,s,a,l,c,u;return Pe().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(t=e.char,r=e.refJsonEditor,i=e.json,o=e.selection,s=e.readOnly,a=e.parser,l=e.onPatch,c=e.onReplaceJson,!s){f.next=3;break}return f.abrupt("return");case 3:oh({insertType:"value",selectInside:!1,refJsonEditor:r,json:i,selection:o,readOnly:s,parser:a,onPatch:l,onReplaceJson:c}),u=!Xr(o),sh(function(){return Gd(r,t,u,ah)});case 6:case"end":return f.stop()}},n)})),Kg.apply(this,arguments)}function sh(n){setTimeout(function(){return setTimeout(n)})}function ah(n){n==null||n.refresh()}function bJ(n){Et(n,"svelte-l2z0i3",'.jse-json-preview.svelte-l2z0i3{flex:1;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-panel-color-readonly, #b2b2b2);overflow:auto;white-space:pre-wrap;padding:2px;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}')}function wJ(n){var e,t;return{c:function(){e=V("div"),t=De(n[0]),x(e,"class","jse-json-preview svelte-l2z0i3")},m:function(r,i){ee(r,e,i),E(e,t)},p:function(r,i){1&At(i,1)[0]&>(t,r[0])},i:Te,o:Te,d:function(r){r&&Z(e)}}}function jJ(n,e,t){var r,i,o=e.text,s=e.json,a=e.indentation,l=e.parser;return n.$$set=function(c){"text"in c&&t(1,o=c.text),"json"in c&&t(2,s=c.json),"indentation"in c&&t(3,a=c.indentation),"parser"in c&&t(4,l=c.parser)},n.$$.update=function(){6&n.$$.dirty&&t(5,r=s!==void 0?{json:s}:{text:o||""}),56&n.$$.dirty&&t(0,i=as(Tg(r,a,l),Cg))},[i,o,s,a,l,r]}var h6=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,jJ,wJ,yr,{text:1,json:2,indentation:3,parser:4},bJ),r}return ht(e,mt),ut(e)}();function xJ(n){Et(n,"svelte-szeu2l",'button.jse-context-menu-button.svelte-szeu2l{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;flex:1;white-space:nowrap;padding:var(--jse-padding, 10px);color:inherit}button.jse-context-menu-button.svelte-szeu2l:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}button.jse-context-menu-button.svelte-szeu2l:focus{background:var(--jse-context-menu-background-highlight, #7a7a7a);z-index:1}button.jse-context-menu-button.svelte-szeu2l:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}button.jse-context-menu-button.left.svelte-szeu2l{text-align:left}button.jse-context-menu-button.svelte-szeu2l svg{width:16px}')}function Gj(n){var e,t;return e=new un({props:{data:n[0].icon}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.data=r[0].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Qj(n){var e,t=n[0].text+"";return{c:function(){e=De(t)},m:function(r,i){ee(r,e,i)},p:function(r,i){1&i&&t!==(t=r[0].text+"")&>(e,t)},d:function(r){r&&Z(e)}}}function $J(n){var e,t,r,i,o,s,a,l,c=n[0].icon&&Gj(n),u=n[0].text&&Qj(n);return{c:function(){e=V("button"),c&&c.c(),t=ce(),u&&u.c(),x(e,"type","button"),x(e,"class",r=Vn(Bo("jse-context-menu-button",n[1],n[0].className))+" svelte-szeu2l"),x(e,"title",i=n[0].title),e.disabled=o=n[0].disabled||!1},m:function(f,d){ee(f,e,d),c&&c.m(e,null),E(e,t),u&&u.m(e,null),s=!0,a||(l=Ce(e,"click",n[3]),a=!0)},p:function(f,d){var h=At(d,1)[0];f[0].icon?c?(c.p(f,h),1&h&&C(c,1)):((c=Gj(f)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae()),f[0].text?u?u.p(f,h):((u=Qj(f)).c(),u.m(e,null)):u&&(u.d(1),u=null),(!s||3&h&&r!==(r=Vn(Bo("jse-context-menu-button",f[1],f[0].className))+" svelte-szeu2l"))&&x(e,"class",r),(!s||1&h&&i!==(i=f[0].title))&&x(e,"title",i),(!s||1&h&&o!==(o=f[0].disabled||!1))&&(e.disabled=o)},i:function(f){s||(C(c),s=!0)},o:function(f){M(c),s=!1},d:function(f){f&&Z(e),c&&c.d(),u&&u.d(),a=!1,l()}}}function kJ(n,e,t){var r=e.item,i=e.className,o=i===void 0?void 0:i,s=e.onRequestClose;return n.$$set=function(a){"item"in a&&t(0,r=a.item),"className"in a&&t(1,o=a.className),"onRequestClose"in a&&t(2,s=a.onRequestClose)},[r,o,s,function(a){s(),r.onClick(a)}]}var t1=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,kJ,$J,yr,{item:0,className:1,onRequestClose:2},xJ),r}return ht(e,mt),ut(e)}();function SJ(n){Et(n,"svelte-9i012w",'.jse-dropdown-button.svelte-9i012w.svelte-9i012w{flex:1;line-height:normal;border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;position:relative;padding:0;display:flex}.jse-dropdown-button.svelte-9i012w ul.svelte-9i012w{margin:0;padding:0}.jse-dropdown-button.svelte-9i012w ul li.svelte-9i012w{margin:0;padding:0;list-style-type:none}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:2em;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));border-radius:0}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.jse-visible.svelte-9i012w{background:var(--jse-context-menu-background, #656565)}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:focus{z-index:1}.jse-dropdown-button.svelte-9i012w button.jse-open-dropdown.svelte-9i012w:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items.svelte-9i012w{display:none;position:absolute;top:100%;left:0;z-index:1;background:var(--jse-context-menu-background, #656565);color:var(--jse-context-menu-color, var(--jse-text-color-inverse, #fff));box-shadow:var(--jse-controls-box-shadow, 0 2px 6px 0 rgba(0, 0, 0, 0.24))}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items.jse-visible.svelte-9i012w{display:block}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;width:100%;text-align:left;padding:var(--jse-padding, 10px);margin:0}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w:hover{background:var(--jse-context-menu-background-highlight, #7a7a7a)}.jse-dropdown-button.svelte-9i012w .jse-dropdown-items button.svelte-9i012w:disabled{color:var(--jse-context-menu-color-disabled, #9d9d9d);background:unset}')}function Yj(n,e,t){var r=n.slice();return r[11]=e[t],r}var CJ=function(n){return{}},Xj=function(n){return{}};function Zj(n){var e,t;return e=new un({props:{data:n[11].icon}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i&&(o.data=r[11].icon),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function ex(n){var e,t,r,i,o,s,a,l,c,u,f,d=n[11].text+"",h=n[11].icon&&Zj(n);function p(){for(var m,v=arguments.length,g=new Array(v),b=0;b
loading...
',x(e,"class","jse-contents svelte-1ig7ktu")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function tK(n){var e,t,r,i,o,s,a,l,c,u=[rK,nK],f=[];function d(h,p){return h[11]===void 0?0:1}return i=d(n),o=f[i]=u[i](n),{c:function(){e=V("label"),t=V("input"),r=ce(),o.c(),s=an(),x(t,"type","text"),t.readOnly=!0,x(t,"tabindex","-1"),x(t,"class","jse-hidden-input svelte-1ig7ktu"),x(e,"class","jse-hidden-input-label")},m:function(h,p){ee(h,e,p),E(e,t),n[76](t),ee(h,r,p),f[i].m(h,p),ee(h,s,p),a=!0,l||(c=Ce(t,"paste",n[31]),l=!0)},p:function(h,p){var m=i;(i=d(h))===m?f[i].p(h,p):(Ee(),M(f[m],1,1,function(){f[m]=null}),Ae(),(o=f[i])?o.p(h,p):(o=f[i]=u[i](h)).c(),C(o,1),o.m(s.parentNode,s))},i:function(h){a||(C(o),a=!0)},o:function(h){M(o),a=!1},d:function(h){h&&(Z(e),Z(r),Z(s)),n[76](null),f[i].d(h),l=!1,c()}}}function nK(n){var e,t,r,i,o,s,a,l,c,u,f;r=new o6({props:{json:n[11],documentState:n[12],parser:n[3],showSearch:n[13],showReplace:n[21],readOnly:n[0],columns:void 0,onSearch:n[26],onFocus:n[27],onPatch:n[37],onClose:n[28]}}),s=new EW({props:{value:n[11],path:[],expandedMap:n[12].expandedMap,enforceStringMap:n[12].enforceStringMap,visibleSectionsMap:n[12].visibleSectionsMap,validationErrorsMap:n[24],searchResultItemsMap:(e=n[20])===null||e===void 0?void 0:e.itemsMap,selection:n[12].selection,context:n[15],onDragSelectionStart:Cr}});var d=n[19]&&fx(n),h=n[23]&&dx(n);return u=new Q0({props:{validationErrors:n[14],selectError:n[29]}}),{c:function(){t=V("div"),xe(r.$$.fragment),i=ce(),o=V("div"),xe(s.$$.fragment),a=ce(),d&&d.c(),l=ce(),h&&h.c(),c=ce(),xe(u.$$.fragment),x(t,"class","jse-search-box-container svelte-1ig7ktu"),x(o,"class","jse-contents svelte-1ig7ktu"),x(o,"data-jsoneditor-scrollable-contents",!0)},m:function(p,m){ee(p,t,m),be(r,t,null),ee(p,i,m),ee(p,o,m),be(s,o,null),n[80](o),ee(p,a,m),d&&d.m(p,m),ee(p,l,m),h&&h.m(p,m),ee(p,c,m),be(u,p,m),f=!0},p:function(p,m){var v,g={};2048&m[0]&&(g.json=p[11]),4096&m[0]&&(g.documentState=p[12]),8&m[0]&&(g.parser=p[3]),8192&m[0]&&(g.showSearch=p[13]),2097152&m[0]&&(g.showReplace=p[21]),1&m[0]&&(g.readOnly=p[0]),r.$set(g);var b={};2048&m[0]&&(b.value=p[11]),4096&m[0]&&(b.expandedMap=p[12].expandedMap),4096&m[0]&&(b.enforceStringMap=p[12].enforceStringMap),4096&m[0]&&(b.visibleSectionsMap=p[12].visibleSectionsMap),16777216&m[0]&&(b.validationErrorsMap=p[24]),1048576&m[0]&&(b.searchResultItemsMap=(v=p[20])===null||v===void 0?void 0:v.itemsMap),4096&m[0]&&(b.selection=p[12].selection),32768&m[0]&&(b.context=p[15]),s.$set(b),p[19]?d?(d.p(p,m),524288&m[0]&&C(d,1)):((d=fx(p)).c(),C(d,1),d.m(l.parentNode,l)):d&&(Ee(),M(d,1,1,function(){d=null}),Ae()),p[23]?h?(h.p(p,m),8388608&m[0]&&C(h,1)):((h=dx(p)).c(),C(h,1),h.m(c.parentNode,c)):h&&(Ee(),M(h,1,1,function(){h=null}),Ae());var y={};16384&m[0]&&(y.validationErrors=p[14]),u.$set(y)},i:function(p){f||(C(r.$$.fragment,p),C(s.$$.fragment,p),C(d),C(h),C(u.$$.fragment,p),f=!0)},o:function(p){M(r.$$.fragment,p),M(s.$$.fragment,p),M(d),M(h),M(u.$$.fragment,p),f=!1},d:function(p){p&&(Z(t),Z(i),Z(o),Z(a),Z(l),Z(c)),we(r),we(s),n[80](null),d&&d.d(p),h&&h.d(p),we(u,p)}}}function rK(n){var e,t,r,i,o=[oK,iK],s=[];function a(l,c){return l[18]===""||l[18]===void 0?0:1}return e=a(n),t=s[e]=o[e](n),{c:function(){t.c(),r=an()},m:function(l,c){s[e].m(l,c),ee(l,r,c),i=!0},p:function(l,c){var u=e;(e=a(l))===u?s[e].p(l,c):(Ee(),M(s[u],1,1,function(){s[u]=null}),Ae(),(t=s[e])?t.p(l,c):(t=s[e]=o[e](l)).c(),C(t,1),t.m(r.parentNode,r))},i:function(l){i||(C(t),i=!0)},o:function(l){M(t),i=!1},d:function(l){l&&Z(r),s[e].d(l)}}}function fx(n){var e,t;return e=new po({props:{type:"info",message:"You pasted a JSON ".concat(Array.isArray(n[19].contents)?"array":"object"," as text"),actions:[{icon:xh,text:"Paste as JSON instead",title:"Replace the value with the pasted JSON",onMouseDown:n[44]},{text:"Leave as is",title:"Keep the JSON embedded in the value",onClick:n[45]}]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};524288&i[0]&&(o.message="You pasted a JSON ".concat(Array.isArray(r[19].contents)?"array":"object"," as text")),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function dx(n){var e,t;return e=new po({props:{type:"success",message:"The loaded JSON document was invalid but is successfully repaired.",actions:n[0]?[]:[{icon:Uc,text:"Ok",title:"Accept the repaired document",onClick:n[8]},{icon:Ls,text:"Repair manually instead",title:"Leave the document unchanged and repair it manually instead",onClick:n[46]}],onClose:n[9]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i[0]&&(o.actions=r[0]?[]:[{icon:Uc,text:"Ok",title:"Accept the repaired document",onClick:r[8]},{icon:Ls,text:"Repair manually instead",title:"Leave the document unchanged and repair it manually instead",onClick:r[46]}]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function iK(n){var e,t,r,i;return e=new po({props:{type:"error",message:"The loaded JSON document is invalid and could not be repaired automatically.",actions:n[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:n[46]}]}}),r=new h6({props:{text:n[18],json:n[11],indentation:n[5],parser:n[3]}}),{c:function(){xe(e.$$.fragment),t=ce(),xe(r.$$.fragment)},m:function(o,s){be(e,o,s),ee(o,t,s),be(r,o,s),i=!0},p:function(o,s){var a={};1&s[0]&&(a.actions=o[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:o[46]}]),e.$set(a);var l={};262144&s[0]&&(l.text=o[18]),2048&s[0]&&(l.json=o[11]),32&s[0]&&(l.indentation=o[5]),8&s[0]&&(l.parser=o[3]),r.$set(l)},i:function(o){i||(C(e.$$.fragment,o),C(r.$$.fragment,o),i=!0)},o:function(o){M(e.$$.fragment,o),M(r.$$.fragment,o),i=!1},d:function(o){o&&Z(t),we(e,o),we(r,o)}}}function oK(n){var e,t;return e=new BW({props:{readOnly:n[0],onCreateObject:n[77],onCreateArray:n[78],onClick:n[79]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i[0]&&(o.readOnly=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function sK(n){var e,t,r,i,o,s,a,l,c=n[1]&&cx(n),u=n[2]&&ux(n),f=[tK,eK],d=[];return i=function(h,p){return h[25]?1:0}(n),o=d[i]=f[i](n),{c:function(){e=V("div"),c&&c.c(),t=ce(),u&&u.c(),r=ce(),o.c(),x(e,"role","tree"),x(e,"tabindex","-1"),x(e,"class","jse-tree-mode svelte-1ig7ktu"),$e(e,"no-main-menu",!n[1])},m:function(h,p){ee(h,e,p),c&&c.m(e,null),E(e,t),u&&u.m(e,null),E(e,r),d[i].m(e,null),n[81](e),s=!0,a||(l=[Ce(XJ,"mousedown",n[48]),Ce(e,"keydown",n[40]),Ce(e,"mousedown",n[41]),Ce(e,"contextmenu",n[42])],a=!0)},p:function(h,p){h[1]?c?(c.p(h,p),2&p[0]&&C(c,1)):((c=cx(h)).c(),C(c,1),c.m(e,t)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae()),h[2]?u?(u.p(h,p),4&p[0]&&C(u,1)):((u=ux(h)).c(),C(u,1),u.m(e,r)):u&&(Ee(),M(u,1,1,function(){u=null}),Ae()),o.p(h,p),(!s||2&p[0])&&$e(e,"no-main-menu",!h[1])},i:function(h){s||(C(c),C(u),C(o),s=!0)},o:function(h){M(c),M(u),M(o),s=!1},d:function(h){h&&Z(e),c&&c.d(),u&&u.d(),d[i].d(),n[81](null),a=!1,kn(l)}}}function aK(n,e,t){var r,i=Sr("jsoneditor:TreeMode"),o=typeof window=="undefined";i("isSSR:",o);var s,a,l,c,u,f=Er("simple-modal").open,d=Cl(),h=Cl(),p=Er("absolute-popup"),m=p.openAbsolutePopup,v=p.closeAbsolutePopup,g=!1,b=Q4(),y=e.readOnly,j=e.externalContent,w=e.externalSelection,$=e.mainMenuBar,S=e.navigationBar,_=e.escapeControlCharacters,F=e.escapeUnicodeCharacters,I=e.parser,W=e.parseMemoizeOne,D=e.validator,U=e.validationParser,q=e.pathParser,X=e.indentation,K=e.onError,Y=e.onChange,T=e.onChangeMode,B=e.onSelect,O=e.onRenderValue,A=e.onRenderMenu,te=e.onRenderContextMenu,R=e.onClassName,k=e.onFocus,P=e.onBlur,H=e.onSortModal,J=e.onTransformModal,he=e.onJSONEditorModal,Se=!1;G0({onMount:Hi,onDestroy:Mi,getWindow:function(){return Ql(l)},hasFocus:function(){return Se&&document.hasFocus()||q0(l)},onFocus:function(){g=!0,k&&k()},onBlur:function(){g=!1,P&&P()}});var pe=void 0;function ae(z){i("updateSelection",z);var le=typeof z=="function"?z(oe.selection)||null:z;sn(le,oe.selection)||(t(12,oe=fe(fe({},oe),{},{selection:le})),B(le))}var Qe,et,tn,Qt=!1,oe=Yd(),st=!1,Ht=!1;function qe(){return(qe=$t(Pe().mark(function z(le){return Pe().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return t(12,oe=fe(fe({},_g(c,oe,le)),{},{selection:null})),je.next=3,Nt(le);case 3:case"end":return je.stop()}},z)}))).apply(this,arguments)}var Dt=Y4({onChange:function(z){t(22,He=z)}}),He=Dt.getState(),wt,Oe,Xe=!1,nn=[],L=wu(X4);function ne(z,le,je,Me){al(function(){var Ne;try{Ne=L(z,le,je,Me)}catch(Le){Ne=[{path:[],message:"Failed to validate: "+Le.message,severity:oo.warning}]}sn(Ne,nn)||(i("validationErrors changed:",Ne),t(14,nn=Ne))},function(Ne){return i("validationErrors updated in ".concat(Ne," ms"))})}function se(){return i("validate"),pe?{parseError:pe,isRepairable:!1}:(ne(c,D,I,U),hn(nn)?null:{validationErrors:nn})}function ge(){return c}function ke(){return oe}function Re(z){fu(z)?function(le){if(le!==void 0){var je=!sn(c,le);if(i("update external json",{isChanged:je,currentlyText:c===void 0}),!!je){var Me=oe,Ne=c,Le=u,bt=Xe;t(11,c=le),at(c),t(18,u=void 0),t(23,Xe=!1),pe=void 0,rt(c),Xt({previousJson:Ne,previousState:Me,previousText:Le,previousTextIsRepaired:bt})}}}(z.json):Il(z)&&function(le){if(!(le===void 0||fu(j))){var je=le!==u;if(i("update external text",{isChanged:je}),!!je){var Me=c,Ne=oe,Le=u,bt=Xe;try{t(11,c=W(le)),at(c),t(18,u=le),t(23,Xe=!1),pe=void 0}catch(nt){try{t(11,c=W(Ao(le))),at(c),t(18,u=le),t(23,Xe=!0),pe=void 0,rt(c)}catch{t(11,c=void 0),t(18,u=j.text),t(23,Xe=!1),pe=u!==void 0&&u!==""?Nl(u,nt.message||String(nt)):void 0}}rt(c),Xt({previousJson:Me,previousState:Ne,previousText:Le,previousTextIsRepaired:bt})}}}(z.text)}function at(z){Qt||(Qt=!0,t(12,oe=Ti(z,oe,[],function(le){return f4({json:le},o4)?So:zc}(z))))}function rt(z){oe.selection&&(Ii(z,ma(oe.selection))&&Ii(z,lt(oe.selection))||(i("clearing selection: path does not exist anymore",oe.selection),t(12,oe=fe(fe({},oe),{},{selection:Ja(z,oe)}))))}function Xt(z){var le=z.previousJson,je=z.previousState,Me=z.previousText,Ne=z.previousTextIsRepaired;le===void 0&&Me===void 0||(c!==void 0?le!==void 0?Dt.add({undo:{patch:[{op:"replace",path:"",value:le}],state:Hr(je),json:void 0,text:Me,textIsRepaired:Ne},redo:{patch:[{op:"replace",path:"",value:c}],state:Hr(oe),json:void 0,text:u,textIsRepaired:Xe}}):Dt.add({undo:{patch:void 0,json:void 0,text:Me,state:Hr(je),textIsRepaired:Ne},redo:{patch:void 0,json:c,state:Hr(oe),text:u,textIsRepaired:Xe}}):le!==void 0&&Dt.add({undo:{patch:void 0,json:le,state:Hr(je),text:Me,textIsRepaired:Ne},redo:{patch:void 0,json:void 0,text:u,textIsRepaired:Xe,state:Hr(oe)}}))}function Zt(z,le){if(i("patch",z,le),c===void 0)throw new Error("Cannot apply patch: no JSON");var je=c,Me=oe,Ne=u,Le=Xe,bt=D4(c,z),nt=C4(c,oe,z),yt=Ll(c,z),tr=function(qr,Ft){return Ft||!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?fe(fe({},qr),{},{selection:Ft}):qr}(nt.documentState,yt,!1);i("patch updatedSelection",yt);var Tn=typeof le=="function"?le(nt.json,tr):void 0;t(11,c=Tn&&Tn.json!==void 0?Tn.json:nt.json);var nr=Tn&&Tn.state!==void 0?Tn.state:tr;return t(12,oe=nr),t(18,u=void 0),t(23,Xe=!1),t(19,et=void 0),pe=void 0,rt(c),Dt.add({undo:{patch:bt,json:void 0,text:Ne,state:Hr(Me),textIsRepaired:Le},redo:{patch:z,json:void 0,state:Hr(nr),text:u,textIsRepaired:Xe}}),{json:c,previousJson:je,undo:bt,redo:z}}function Wt(){!y&&oe.selection&&ae(zi(lt(oe.selection),!0))}function Ge(){if(!y&&oe.selection){var z=lt(oe.selection),le=Ye(c,z);Wn(le)?function(je,Me){i("openJSONEditorModal",{path:je,value:Me}),Se=!0,he({content:{json:Me},path:je,onPatch:Oe.onPatch,onClose:function(){Se=!1,Fe()}})}(z,le):ae(Ut(z,!0))}}function On(){if(!y&&rn(oe.selection)){var z=lt(oe.selection),le=Ue(z),je=Ye(c,z),Me=!ls(je,oe.enforceStringMap,le,I),Ne=Me?String(je):Gl(String(je),I);i("handleToggleEnforceString",{enforceString:Me,value:je,updatedValue:Ne}),Jt([{op:"replace",path:le,value:Ne}],function(Le,bt){return{state:S4(bt,le,Me)}})}}function zn(){return Pt.apply(this,arguments)}function Pt(){return Pt=$t(Pe().mark(function z(){var le,je=arguments;return Pe().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return le=!(je.length>0&&je[0]!==void 0)||je[0],Me.next=3,l6({json:c,documentState:oe,indentation:le?X:void 0,readOnly:y,parser:I,onPatch:Jt});case 3:case"end":return Me.stop()}},z)})),Pt.apply(this,arguments)}function Mn(){return Dn.apply(this,arguments)}function Dn(){return Dn=$t(Pe().mark(function z(){var le,je=arguments;return Pe().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(le=!(je.length>0&&je[0]!==void 0)||je[0],c!==void 0){Me.next=3;break}return Me.abrupt("return");case 3:return Me.next=5,c6({json:c,documentState:oe,indentation:le?X:void 0,parser:I});case 5:case"end":return Me.stop()}},z)})),Dn.apply(this,arguments)}function er(){f(Z4,{},fe(fe({},Ta),{},{styleWindow:{width:"450px"}}),{onClose:function(){return Fe()}})}function fn(z,le){f(n6,{text:z,onParse:function(je){return Jh(je,function(Me){return _u(Me,I)})},onRepair:c4,onApply:le},fe(fe({},Ta),{},{styleWindow:{width:"600px",height:"500px"},styleContent:{padding:0,height:"100%"}}),{onClose:function(){return Fe()}})}function me(){f6({json:c,text:u,documentState:oe,keepSelection:!1,readOnly:y,onChange:Y,onPatch:Jt})}function Be(){!y&&c!==void 0&&oe.selection&&Yl&&!hn(lt(oe.selection))&&(i("duplicate",{selection:oe.selection}),Jt(R4(c,Ns(c,oe.selection))))}function St(){if(!y&&oe.selection&&(Cn(oe.selection)||rn(oe.selection))&&!hn(lt(oe.selection))){i("extract",{selection:oe.selection});var z=function(le,je){if(rn(je))return[{op:"move",from:Ue(je.path),path:""}];if(!Cn(je))throw new Error("Cannot create extract operations: parent must be an Object or Array");var Me=on(je.focusPath),Ne=Ye(le,Me);if(Nn(Ne))return[{op:"replace",path:"",value:Ns(le,je).map(function(bt){var nt=zr(en(bt));return Ne[nt]})}];if(Gn(Ne)){var Le={};return Ns(le,je).forEach(function(bt){var nt=String(en(bt));Le[nt]=Ne[nt]}),[{op:"replace",path:"",value:Le}]}throw new Error("Cannot extract: unsupported type of selection "+JSON.stringify(je))}(c,oe.selection);Jt(z,function(le,je){if(Wn(le))return{state:xs(le,je,[])}})}}function Lt(z){oh({insertType:z,selectInside:!0,refJsonEditor:l,json:c,selection:oe.selection,readOnly:y,parser:I,onPatch:Jt,onReplaceJson:Ot})}function _t(z){or(oe.selection)&&ae(Ut(oe.selection.path,!1)),oe.selection||ae(Ja(c,oe)),Lt(z)}function Yt(z){if(!y&&oe.selection)if(_f(oe.selection))try{var le=ma(oe.selection),je=Ye(c,le),Me=function(Le,bt,nt){if(bt==="array"){if(Array.isArray(Le))return Le;if(Rn(Le))return j2(Le);if(typeof Le=="string")try{var yt=nt.parse(Le);if(Array.isArray(yt))return yt;if(Rn(yt))return j2(yt)}catch{return[Le]}return[Le]}if(bt==="object"){if(Array.isArray(Le))return w2(Le);if(Rn(Le))return Le;if(typeof Le=="string")try{var tr=nt.parse(Le);if(Rn(tr))return tr;if(Array.isArray(tr))return w2(tr)}catch{return{value:Le}}return{value:Le}}if(bt==="value")return Wn(Le)?nt.stringify(Le):Le;throw new Error("Cannot convert ".concat(B0(Le,nt)," to ").concat(bt))}(je,z,I);if(Me===je)return;var Ne=[{op:"replace",path:Ue(le),value:Me}];i("handleConvert",{selection:oe.selection,path:le,type:z,operations:Ne}),Jt(Ne,function(Le,bt){return{state:oe.selection?xs(Le,bt,lt(oe.selection)):oe}})}catch(Le){K(Le)}else K(new Error("Cannot convert current selection to ".concat(z)))}function de(){if(oe.selection){var z=B2(c,oe,!1),le=on(lt(oe.selection));z&&!hn(lt(z))&&sn(le,on(lt(z)))?ae(Zo(lt(z))):ae(us(le)),i("insert before",{selection:oe.selection,selectionBefore:z,parentPath:le}),fr().then(function(){return Ie()})}}function tt(){if(oe.selection){var z=Is(c,oe.selection);i("insert after",z),ae(Zo(z)),fr().then(function(){return Ie()})}}function We(z){return N.apply(this,arguments)}function N(){return(N=$t(Pe().mark(function z(le){return Pe().wrap(function(je){for(;;)switch(je.prev=je.next){case 0:return je.next=2,d6({char:le,selectInside:!0,refJsonEditor:l,json:c,selection:oe.selection,readOnly:y,parser:I,onPatch:Jt,onReplaceJson:Ot,onSelect:ae});case 2:case"end":return je.stop()}},z)}))).apply(this,arguments)}function G(){if(!y&&Dt.getState().canUndo){var z=Dt.undo();if(z){var le={json:c,text:u};t(11,c=z.undo.patch?ro(c,z.undo.patch):z.undo.json),t(12,oe=z.undo.state),t(18,u=z.undo.text),t(23,Xe=z.undo.textIsRepaired),pe=void 0,i("undo",{item:z,json:c,documentState:oe}),ln(le,z.undo.patch&&z.redo.patch?{json:c,previousJson:le.json,redo:z.undo.patch,undo:z.redo.patch}:null),Fe(),oe.selection&&Nt(lt(oe.selection),!1)}}}function ie(){if(!y&&Dt.getState().canRedo){var z=Dt.redo();if(z){var le={json:c,text:u};t(11,c=z.redo.patch?ro(c,z.redo.patch):z.redo.json),t(12,oe=z.redo.state),t(18,u=z.redo.text),t(23,Xe=z.redo.textIsRepaired),pe=void 0,i("redo",{item:z,json:c,documentState:oe}),ln(le,z.undo.patch&&z.redo.patch?{json:c,previousJson:le.json,redo:z.redo.patch,undo:z.undo.patch}:null),Fe(),oe.selection&&Nt(lt(oe.selection),!1)}}}function ue(z){var le;y||c===void 0||(Se=!0,H({id:d,json:c,rootPath:z,onSort:(le=$t(Pe().mark(function je(Me){var Ne;return Pe().wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:Ne=Me.operations,i("onSort",z,Ne),Jt(Ne,function(bt,nt){return{state:fe(fe({},xs(bt,nt,z)),{},{selection:Ut(z,!1)})}});case 3:case"end":return Le.stop()}},je)})),function(je){return le.apply(this,arguments)}),onClose:function(){Se=!1,Fe()}}))}function ye(){oe.selection&&ue(F2(c,oe.selection))}function it(z){if(c!==void 0){var le=z.id,je=z.onTransform,Me=z.onClose,Ne=z.rootPath||[];Se=!0,J({id:le||h,json:c,rootPath:Ne,onTransform:function(Le){je?je({operations:Le,json:c,transformedJson:ro(c,Le)}):(i("onTransform",Ne,Le),Jt(Le,function(bt,nt){return{state:fe(fe({},xs(bt,nt,Ne)),{},{selection:Ut(Ne,!1)})}}))},onClose:function(){Se=!1,Fe(),Me&&Me()}})}}function vt(){oe.selection&&it({rootPath:F2(c,oe.selection)})}function Nt(z){return bn.apply(this,arguments)}function bn(){return bn=$t(Pe().mark(function z(le){var je,Me,Ne,Le,bt,nt=arguments;return Pe().wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return je=!(nt.length>1&&nt[1]!==void 0)||nt[1],t(12,oe=_g(c,oe,le)),yt.next=4,fr();case 4:if(Me=En(le),i("scrollTo",{path:le,elem:Me,refContents:s}),Me&&s){yt.next=8;break}return yt.abrupt("return",Promise.resolve());case 8:if(Ne=s.getBoundingClientRect(),Le=Me.getBoundingClientRect(),je){yt.next=13;break}if(!(Le.bottom>Ne.top&&Le.topje.bottom-20&&b(le,{container:s,offset:-(je.height-Ne-20),duration:0})}}function ln(z,le){var je;if(z.json!==void 0||(z==null?void 0:z.text)!==void 0){if(u!==void 0)(je=Y)===null||je===void 0||je({text:u,json:void 0},z,{contentErrors:se(),patchResult:le});else if(c!==void 0){var Me;(Me=Y)===null||Me===void 0||Me({text:void 0,json:c},z,{contentErrors:se(),patchResult:le})}}}function Jt(z,le){i("handlePatch",z,le);var je={json:c,text:u},Me=Zt(z,le);return ln(je,Me),Me}function Ot(z,le){var je=oe,Me=c,Ne=u,Le={json:c,text:u},bt=Xe,nt=Ti(c,oe,[],So),yt=typeof le=="function"?le(z,nt):void 0;t(11,c=yt&&yt.json!==void 0?yt.json:z),t(12,oe=yt&&yt.state!==void 0?yt.state:nt),t(18,u=void 0),t(23,Xe=!1),pe=void 0,rt(c),Xt({previousJson:Me,previousState:je,previousText:Ne,previousTextIsRepaired:bt}),ln(Le,null)}function Sn(z,le){i("handleChangeText");var je=oe,Me=c,Ne=u,Le={json:c,text:u},bt=Xe;try{t(11,c=W(z)),t(12,oe=Ti(c,oe,[],So)),t(18,u=void 0),t(23,Xe=!1),pe=void 0}catch(yt){try{t(11,c=W(Ao(z))),t(12,oe=Ti(c,oe,[],So)),t(18,u=z),t(23,Xe=!0),pe=void 0}catch{t(11,c=void 0),t(12,oe=Yd({json:c,expand:So})),t(18,u=z),t(23,Xe=!1),pe=u!==""?Nl(u,yt.message||String(yt)):void 0}}if(typeof le=="function"){var nt=le(c,oe);t(11,c=nt&&nt.json?nt.json:c),t(12,oe=nt&&nt.state?nt.state:oe)}rt(c),Xt({previousJson:Me,previousState:je,previousText:Ne,previousTextIsRepaired:bt}),ln(Le,null)}function An(z,le){var je=arguments.length>2&&arguments[2]!==void 0&&arguments[2];i("expand",{path:z,expanded:le,recursive:je}),t(12,oe=le?je?Ti(c,oe,z,zc):function(Me,Ne){return fe(fe({},Me),{},{expandedMap:fe(fe({},Me.expandedMap),{},Oi({},Ue(Ne),!0))})}(oe,z):N2(oe,z)),oe.selection&&!le&&function(Me,Ne){return cs(lt(Me),Ne)&&(lt(Me).length>Ne.length||dr(Me))}(oe.selection,z)&&ae(null),Fe()}function jn(z){i("openFind",{findAndReplace:z}),t(13,st=!1),t(21,Ht=!1),fr().then(function(){t(13,st=!0),t(21,Ht=z)})}function Ar(z,le){i("handleExpandSection",z,le);var je=Ue(z);t(12,oe=function(Me,Ne,Le,bt){return fe(fe({},Ne),{},{visibleSectionsMap:fe(fe({},Ne.visibleSectionsMap),{},Oi({},Le,k4(Kh(Ne,Le).concat(bt))))})}(0,oe,je,le))}function Q(z){i("pasted json as text",z),t(19,et=z)}function ve(z){var le=z.anchor,je=z.left,Me=z.top,Ne=z.width,Le=z.height,bt=z.offsetTop,nt=z.offsetLeft,yt=z.showTip,tr=function(Ft){var xn=Ft.json,cr=Ft.documentState,dn=Ft.readOnly,ir=Ft.parser,Ki=Ft.onEditKey,gi=Ft.onEditValue,Fa=Ft.onToggleEnforceString,br=Ft.onCut,vi=Ft.onCopy,mo=Ft.onPaste,ps=Ft.onRemove,ei=Ft.onDuplicate,Gi=Ft.onExtract,Zl=Ft.onInsertBefore,Qs=Ft.onInsert,ec=Ft.onConvert,ip=Ft.onInsertAfter,op=Ft.onSort,tc=Ft.onTransform,re=cr.selection,Je=xn!==void 0,jt=!!re,yn=!!re&&hn(lt(re)),Rt=re?Ye(xn,lt(re)):void 0,Gt=Array.isArray(Rt)?"Edit array":Rn(Rt)?"Edit object":"Edit value",In=Je&&(Cn(re)||or(re)||rn(re)),Ys=!dn&&Je&&re!=null&&Xd(re)&&!yn&&!Array.isArray(Ye(xn,on(lt(re)))),gr=!dn&&Je&&re!=null&&Xd(re),ur=gr&&!Wn(Rt),yi=!dn&&In,qa=In,zu=!dn&&jt,ms=!dn&&Je&&In&&!yn,b6=!dn&&Je&&re!=null&&(Cn(re)||rn(re))&&!yn,Vo=In,nc=Vo?"Convert to:":"Insert:",w6=!dn&&!Vo&&jt,j6=!dn&&(Vo?_f(re)&&!Rn(Rt):jt),x6=!dn&&(Vo?_f(re)&&!Array.isArray(Rt):jt),$6=!dn&&(Vo?_f(re)&&Wn(Rt):jt),k6=!(re==null||!Rt)&&ls(Rt,cr.enforceStringMap,Ue(lt(re)),ir);function Fu(sp){In?sp!=="structure"&&ec(sp):Qs(sp)}return[{type:"row",items:[{type:"button",onClick:function(){return Ki()},icon:ul,text:"Edit key",title:"Edit the key (Double-click on the key)",disabled:!Ys},{type:"dropdown-button",main:{type:"button",onClick:function(){return gi()},icon:ul,text:Gt,title:"Edit the value (Double-click on the value)",disabled:!gr},width:"11em",items:[{type:"button",icon:ul,text:Gt,title:"Edit the value (Double-click on the value)",onClick:function(){return gi()},disabled:!gr},{type:"button",icon:k6?Y$:Z$,text:"Enforce string",title:"Enforce keeping the value as string when it contains a numeric value",onClick:function(){return Fa()},disabled:!ur}]}]},{type:"separator"},{type:"row",items:[{type:"dropdown-button",main:{type:"button",onClick:function(){return br(!0)},icon:cl,text:"Cut",title:"Cut selected contents, formatted with indentation (Ctrl+X)",disabled:!yi},width:"10em",items:[{type:"button",icon:cl,text:"Cut formatted",title:"Cut selected contents, formatted with indentation (Ctrl+X)",onClick:function(){return br(!0)},disabled:!yi},{type:"button",icon:cl,text:"Cut compacted",title:"Cut selected contents, without indentation (Ctrl+Shift+X)",onClick:function(){return br(!1)},disabled:!yi}]},{type:"dropdown-button",main:{type:"button",onClick:function(){return vi(!0)},icon:Es,text:"Copy",title:"Copy selected contents, formatted with indentation (Ctrl+C)",disabled:!qa},width:"12em",items:[{type:"button",icon:Es,text:"Copy formatted",title:"Copy selected contents, formatted with indentation (Ctrl+C)",onClick:function(){return vi(!0)},disabled:!qa},{type:"button",icon:Es,text:"Copy compacted",title:"Copy selected contents, without indentation (Ctrl+Shift+C)",onClick:function(){return vi(!1)},disabled:!qa}]},{type:"button",onClick:function(){return mo()},icon:Q$,text:"Paste",title:"Paste clipboard contents (Ctrl+V)",disabled:!zu}]},{type:"separator"},{type:"row",items:[{type:"column",items:[{type:"button",onClick:function(){return ei()},icon:nk,text:"Duplicate",title:"Duplicate selected contents (Ctrl+D)",disabled:!ms},{type:"button",onClick:function(){return Gi()},icon:bT,text:"Extract",title:"Extract selected contents",disabled:!b6},{type:"button",onClick:function(){return op()},icon:$h,text:"Sort",title:"Sort array or object contents",disabled:dn||!In},{type:"button",onClick:function(){return tc()},icon:jh,text:"Transform",title:"Transform array or object contents (filter, sort, project)",disabled:dn||!In},{type:"button",onClick:function(){return ps()},icon:bm,text:"Remove",title:"Remove selected contents (Delete)",disabled:dn||!In}]},{type:"column",items:[{type:"label",text:nc},{type:"button",onClick:function(){return Fu("structure")},icon:Vo?Xu:tl,text:"Structure",title:nc+" structure",disabled:!w6},{type:"button",onClick:function(){return Fu("object")},icon:Vo?Xu:tl,text:"Object",title:nc+" structure",disabled:!j6},{type:"button",onClick:function(){return Fu("array")},icon:Vo?Xu:tl,text:"Array",title:nc+" array",disabled:!x6},{type:"button",onClick:function(){return Fu("value")},icon:Vo?Xu:tl,text:"Value",title:nc+" value",disabled:!$6}]}]},{type:"separator"},{type:"row",items:[{type:"button",onClick:function(){return Zl()},icon:pT,text:"Insert before",title:"Select area before current entry to insert or paste contents",disabled:dn||!In||yn},{type:"button",onClick:function(){return ip()},icon:lT,text:"Insert after",title:"Select area after current entry to insert or paste contents",disabled:dn||!In||yn}]}]}({json:c,documentState:oe,readOnly:y,parser:I,onEditKey:Wt,onEditValue:Ge,onToggleEnforceString:On,onCut:zn,onCopy:Mn,onPaste:er,onRemove:me,onDuplicate:Be,onExtract:St,onInsertBefore:de,onInsert:_t,onInsertAfter:tt,onConvert:Yt,onSort:ye,onTransform:vt}),Tn=te(tr);if(Tn!==!1){var nr={left:je,top:Me,offsetTop:bt,offsetLeft:nt,width:Ne,height:Le,anchor:le,closeOnOuterClick:!0,onClose:function(){Se=!1,Fe()}};Se=!0;var qr=m(p6,{tip:yt?"Tip: you can open this context menu via right-click or with Ctrl+Q":void 0,items:Tn,onRequestClose:function(){return v(qr)}},nr)}}function Ie(z){if(!Xr(oe.selection)){if(z&&(z.stopPropagation(),z.preventDefault()),z&&z.type==="contextmenu"&&z.target!==a)ve({left:z.clientX,top:z.clientY,width:Ko,height:Jo,showTip:!1});else{var le,je=(le=s)===null||le===void 0?void 0:le.querySelector(".jse-context-menu-pointer.jse-selected");if(je)ve({anchor:je,offsetTop:2,width:Ko,height:Jo,showTip:!1});else{var Me,Ne=(Me=s)===null||Me===void 0?void 0:Me.getBoundingClientRect();Ne&&ve({top:Ne.top+2,left:Ne.left+2,width:Ko,height:Jo,showTip:!1})}}return!1}}function ze(){return(ze=$t(Pe().mark(function z(){var le,je,Me,Ne,Le;return Pe().wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:if(i("apply pasted json",et),et){bt.next=3;break}return bt.abrupt("return");case 3:Me=(je=et).path,Ne=je.contents,t(19,et=void 0),j4(Le=((le=s)===null||le===void 0?void 0:le.querySelector(".jse-editable-div"))||null)&&Le.cancel(),Jt([{op:"replace",path:Ue(Me),value:Ne}],function(nt,yt){return{state:xs(nt,yt,Me)}}),setTimeout(Fe);case 10:case"end":return bt.stop()}},z)}))).apply(this,arguments)}function Fe(){i("focus"),a&&(a.focus(),a.select())}function kt(z){return function(le,je,Me){var Ne=on(Me),Le=[en(Me)],bt=Ye(le,Ne),nt=bt?Zp(bt,je,Le):void 0;return nt?Ut(Ne.concat(nt),!1):Zo(Me)}(c,oe,z)}function zt(z){r&&r.onDrag(z)}function Kt(){r&&r.onDragEnd()}return n.$$set=function(z){"readOnly"in z&&t(0,y=z.readOnly),"externalContent"in z&&t(49,j=z.externalContent),"externalSelection"in z&&t(50,w=z.externalSelection),"mainMenuBar"in z&&t(1,$=z.mainMenuBar),"navigationBar"in z&&t(2,S=z.navigationBar),"escapeControlCharacters"in z&&t(51,_=z.escapeControlCharacters),"escapeUnicodeCharacters"in z&&t(52,F=z.escapeUnicodeCharacters),"parser"in z&&t(3,I=z.parser),"parseMemoizeOne"in z&&t(53,W=z.parseMemoizeOne),"validator"in z&&t(54,D=z.validator),"validationParser"in z&&t(55,U=z.validationParser),"pathParser"in z&&t(4,q=z.pathParser),"indentation"in z&&t(5,X=z.indentation),"onError"in z&&t(6,K=z.onError),"onChange"in z&&t(56,Y=z.onChange),"onChangeMode"in z&&t(57,T=z.onChangeMode),"onSelect"in z&&t(58,B=z.onSelect),"onRenderValue"in z&&t(59,O=z.onRenderValue),"onRenderMenu"in z&&t(7,A=z.onRenderMenu),"onRenderContextMenu"in z&&t(60,te=z.onRenderContextMenu),"onClassName"in z&&t(61,R=z.onClassName),"onFocus"in z&&t(62,k=z.onFocus),"onBlur"in z&&t(63,P=z.onBlur),"onSortModal"in z&&t(64,H=z.onSortModal),"onTransformModal"in z&&t(65,J=z.onTransformModal),"onJSONEditorModal"in z&&t(66,he=z.onJSONEditorModal)},n.$$.update=function(){3145728&n.$$.dirty[1]&&t(74,Qe=z0({escapeControlCharacters:_,escapeUnicodeCharacters:F})),4096&n.$$.dirty[0]&&i("selection",oe.selection),8192&n.$$.dirty[0]&&function(z){if(s)if(z){var le,je=(le=parseInt(getComputedStyle(s).padding))!==null&&le!==void 0?le:0;t(10,s.style.overflowAnchor="none",s),t(10,s.style.paddingTop=je+wl+"px",s),t(10,s.scrollTop+=wl,s),t(10,s.style.overflowAnchor="",s)}else t(10,s.style.overflowAnchor="none",s),t(10,s.style.paddingTop="",s),t(10,s.scrollTop-=wl,s),t(10,s.style.overflowAnchor="",s)}(st),262144&n.$$.dirty[1]&&Re(j),524288&n.$$.dirty[1]&&function(z){sn(oe.selection,z)||(i("applyExternalSelection",z),(U0(z)||z===null)&&ae(z))}(w),2056&n.$$.dirty[0]|25165824&n.$$.dirty[1]&&ne(c,D,I,U),16384&n.$$.dirty[0]&&t(24,wt=function(z){var le={};return z.forEach(function(je){le[Ue(je.path)]=je}),z.forEach(function(je){for(var Me=je.path;Me.length>0;){Me=on(Me);var Ne=Ue(Me);Ne in le||(le[Ne]={isChildError:!0,path:Me,message:"Contains invalid data",severity:oo.warning})}}),le}(nn)),1024&n.$$.dirty[0]&&(r=s?function(z){var le,je;function Me(nt){return nt<20?QF:nt<50?YF:XF}function Ne(){if(z){var nt=(le||0)*(v2/1e3);z.scrollTop+=nt}}function Le(nt){je&&nt===le||(bt(),tm("startAutoScroll",nt),le=nt,je=setInterval(Ne,v2))}function bt(){je&&(tm("stopAutoScroll"),clearInterval(je),je=void 0,le=void 0)}return tm("createAutoScrollHandler",z),{onDrag:function(nt){if(z){var yt=nt.clientY,tr=z.getBoundingClientRect(),Tn=tr.top,nr=tr.bottom;ytnr?Le(Me(yt-nr)):bt()}},onDragEnd:function(){bt()}}}(s):void 0),9&n.$$.dirty[0]|1342177280&n.$$.dirty[1]|4096&n.$$.dirty[2]&&t(15,Oe={readOnly:y,parser:I,normalization:Qe,getJson:ge,getDocumentState:ke,findElement:En,findNextInside:kt,focus:Fe,onPatch:Jt,onInsert:Lt,onExpand:An,onSelect:ae,onFind:jn,onExpandSection:Ar,onPasteJson:Q,onRenderValue:O,onContextMenu:ve,onClassName:R||function(){},onDrag:zt,onDragEnd:Kt}),32768&n.$$.dirty[0]&&i("context changed",Oe)},[y,$,S,I,q,X,K,A,function(){return Xe&&c!==void 0&&Ot(c),c!==void 0?{json:c}:{text:u||""}},Fe,s,c,oe,st,nn,Oe,a,l,u,et,tn,Ht,He,Xe,wt,o,function(z){t(20,tn=z)},function(z){return qe.apply(this,arguments)},function(){t(13,st=!1),t(21,Ht=!1),Fe()},function(z){i("select validation error",z),ae(Ut(z.path,!1)),Nt(z.path)},Mn,function(z){var le;z.preventDefault();var je=(le=z.clipboardData)===null||le===void 0?void 0:le.getData("text/plain");je!==void 0&&u6({clipboardText:je,json:c,selection:oe.selection,readOnly:y,parser:I,onPatch:Jt,onChangeText:Sn,openRepairModal:fn})},We,G,ie,function(){ue([])},function(){it({rootPath:[]})},Jt,function(){An([],!0,!0)},function(){An([],!1,!0)},function(z){var le=ss(z),je=z.shiftKey;if(i("keydown",{combo:le,key:z.key}),le==="Ctrl+X"&&(z.preventDefault(),zn(!0)),le==="Ctrl+Shift+X"&&(z.preventDefault(),zn(!1)),le==="Ctrl+C"&&(z.preventDefault(),Mn(!0)),le==="Ctrl+Shift+C"&&(z.preventDefault(),Mn(!1)),le==="Ctrl+D"&&(z.preventDefault(),Be()),le!=="Delete"&&le!=="Backspace"||(z.preventDefault(),me()),le==="Insert"&&(z.preventDefault(),Lt("structure")),le==="Ctrl+A"&&(z.preventDefault(),ae(Ut([],!1))),le==="Ctrl+Q"&&Ie(z),le==="ArrowUp"||le==="Shift+ArrowUp"){z.preventDefault();var Me=oe.selection?B2(c,oe,je)||oe.selection:Ja(c,oe);ae(Me),Bt(lt(Me))}if(le==="ArrowDown"||le==="Shift+ArrowDown"){z.preventDefault();var Ne=oe.selection?function(Tn,nr){var qr=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Ft=nr.selection;if(!Ft)return null;var xn=qr?lt(Ft):Is(Tn,Ft),cr=Wn(Ye(Tn,xn))?N2(nr,xn):nr,dn=Zp(Tn,nr,xn),ir=Zp(Tn,cr,xn);if(qr)return dr(Ft)?dn!==null?Wr(dn,dn):null:hi(Ft)?ir!==null?Wr(ir,ir):null:ir!==null?Wr(ma(Ft),ir):null;if(hi(Ft))return ir!==null?Ut(ir,!1):null;if(dr(Ft)||rn(Ft))return dn!==null?Ut(dn,!1):null;if(or(Ft)){if(dn===null||dn.length===0)return null;var Ki=on(dn),gi=Ye(Tn,Ki);return Array.isArray(gi)?Ut(dn,!1):zi(dn,!1)}return Cn(Ft)?ir!==null?Ut(ir,!1):dn!==null?Ut(dn,!1):null:null}(c,oe,je)||oe.selection:Ja(c,oe);ae(Ne),Bt(lt(Ne))}if(le==="ArrowLeft"||le==="Shift+ArrowLeft"){z.preventDefault();var Le=oe.selection?function(Tn,nr){var qr=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Ft=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],xn=nr.selection;if(!xn)return null;var cr=z2(Tn,nr,Ft),dn=cr.caret,ir=cr.previous;if(qr)return Cn(xn)?null:Wr(xn.path,xn.path);if(dn&&ir)return Rg(ir);var Ki=on(lt(xn)),gi=Ye(Tn,Ki);return rn(xn)&&Array.isArray(gi)?Wr(xn.path,xn.path):Cn(xn)&&!Array.isArray(gi)?zi(xn.focusPath,!1):null}(c,oe,je,!y)||oe.selection:Ja(c,oe);ae(Le),Bt(lt(Le))}if(le==="ArrowRight"||le==="Shift+ArrowRight"){z.preventDefault();var bt=oe.selection&&c!==void 0?function(Tn,nr){var qr=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Ft=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],xn=nr.selection;if(!xn)return null;var cr=z2(Tn,nr,Ft),dn=cr.caret,ir=cr.next;return qr?Cn(xn)?null:Wr(xn.path,xn.path):dn&&ir?Rg(ir):Cn(xn)?Ut(xn.focusPath,!1):null}(c,oe,je,!y)||oe.selection:Ja(c,oe);ae(bt),Bt(lt(bt))}if(le==="Enter"&&oe.selection){if(Gh(oe.selection)){var nt=oe.selection.focusPath,yt=Ye(c,on(nt));Array.isArray(yt)&&ae(Ut(nt,!1))}or(oe.selection)&&(z.preventDefault(),ae(fe(fe({},oe.selection),{},{edit:!0}))),rn(oe.selection)&&(z.preventDefault(),Wn(Ye(c,oe.selection.path))?An(oe.selection.path,!0):ae(fe(fe({},oe.selection),{},{edit:!0})))}if(le.replace(/^Shift\+/,"").length===1&&oe.selection)return z.preventDefault(),void We(z.key);if(le==="Enter"&&(hi(oe.selection)||dr(oe.selection)))return z.preventDefault(),void We("");if(le==="Ctrl+Enter"&&rn(oe.selection)){var tr=Ye(c,oe.selection.path);Wh(tr)&&window.open(String(tr),"_blank")}le==="Escape"&&oe.selection&&(z.preventDefault(),ae(null)),le==="Ctrl+F"&&(z.preventDefault(),jn(!1)),le==="Ctrl+H"&&(z.preventDefault(),jn(!0)),le==="Ctrl+Z"&&(z.preventDefault(),G()),le==="Ctrl+Shift+Z"&&(z.preventDefault(),ie())},function(z){i("handleMouseDown",z);var le=z.target;v4(le,"BUTTON")||le.isContentEditable||(Fe(),oe.selection||c!==void 0||u!==""&&u!==void 0||(i("createDefaultSelection"),t(12,oe=fe(fe({},oe),{},{selection:Ut([],!1)}))))},Ie,function(z){ve({anchor:b4(z.target,"BUTTON"),offsetTop:0,width:Ko,height:Jo,showTip:!0})},function(){return ze.apply(this,arguments)},function(){i("clear pasted json"),t(19,et=void 0),Fe()},function(){T(Dr.text)},function(z){ae(z),Fe(),Nt(lt(z))},function(z){var le=!Ru(z.target,function(je){return je===l});le&&Xr(oe.selection)&&(i("click outside the editor, stop edit mode"),ae(function(je){return or(je)||rn(je)?fe(fe({},je),{},{edit:!1}):je}),g&&a&&(a.focus(),a.blur()),i("blur (outside editor)"),a&&a.blur())},j,w,_,F,W,D,U,Y,T,B,O,te,R,k,P,H,J,he,function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zc;i("expand");var le=fe(fe({},oe),{},{expandedMap:{},visibleSectionsMap:{}});t(12,oe=Ti(c,le,[],z))},se,ge,Zt,it,Nt,En,Qe,function(z){t(13,st=z)},function(z){It[z?"unshift":"push"](function(){t(16,a=z)})},function(){Fe(),We("{")},function(){Fe(),We("[")},function(){Fe()},function(z){It[z?"unshift":"push"](function(){t(10,s=z)})},function(z){It[z?"unshift":"push"](function(){t(17,l=z)})}]}var r1=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,aK,sK,Tt,{readOnly:0,externalContent:49,externalSelection:50,mainMenuBar:1,navigationBar:2,escapeControlCharacters:51,escapeUnicodeCharacters:52,parser:3,parseMemoizeOne:53,validator:54,validationParser:55,pathParser:4,indentation:5,onError:6,onChange:56,onChangeMode:57,onSelect:58,onRenderValue:59,onRenderMenu:7,onRenderContextMenu:60,onClassName:61,onFocus:62,onBlur:63,onSortModal:64,onTransformModal:65,onJSONEditorModal:66,expand:67,validate:68,getJson:69,patch:70,acceptAutoRepair:8,openTransformModal:71,scrollTo:72,findElement:73,focus:9},ZJ,[-1,-1,-1,-1,-1]),r}return ht(e,mt),ut(e,[{key:"expand",get:function(){return this.$$.ctx[67]}},{key:"validate",get:function(){return this.$$.ctx[68]}},{key:"getJson",get:function(){return this.$$.ctx[69]}},{key:"patch",get:function(){return this.$$.ctx[70]}},{key:"acceptAutoRepair",get:function(){return this.$$.ctx[8]}},{key:"openTransformModal",get:function(){return this.$$.ctx[71]}},{key:"scrollTo",get:function(){return this.$$.ctx[72]}},{key:"findElement",get:function(){return this.$$.ctx[73]}},{key:"focus",get:function(){return this.$$.ctx[9]}}])}();function m6(n){return sr(e=n)!=="object"||e===null?n:new Proxy(n,{get:function(t,r,i){return m6(Reflect.get(t,r,i))},set:function(){return!1},deleteProperty:function(){return!1}});var e}function lK(n){Et(n,"svelte-1mpf6w7",'.jse-modal.svelte-1mpf6w7.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-1mpf6w7 .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-1mpf6w7 .jse-modal-contents.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions.svelte-1mpf6w7{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions button.jse-primary.svelte-1mpf6w7{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions button.jse-primary.svelte-1mpf6w7:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-1mpf6w7 .jse-modal-contents .jse-actions button.jse-primary.svelte-1mpf6w7:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0;overflow:auto}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;max-height:500px;display:flex}.bg.jse-modal-bg .jse-modal-window:has(div.fullscreen){margin:var(--jse-padding, 10px);padding:0;width:calc(100vw - 2 * var(--jse-padding, 10px));height:calc(100vh - 2 * var(--jse-padding, 10px));max-width:none;max-height:none}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0;max-height:none}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents.svelte-1mpf6w7{color:inherit;min-height:0;padding:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents.svelte-1mpf6w7{flex:1;display:flex;gap:calc(2 * var(--jse-padding, 10px));min-height:0;box-sizing:border-box;padding:0 calc(2 * var(--jse-padding, 10px)) var(--jse-padding, 10px)}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 p{margin:var(--jse-padding, 10px) 0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 p:first-child{margin-top:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 p:last-child{margin-bottom:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-1mpf6w7 code{background:var(--jse-modal-code-background, rgba(0, 0, 0, 0.05));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px)}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-1mpf6w7{flex:1;outline:none;resize:vertical}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;gap:calc(2 * var(--jse-padding, 10px))}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.jse-hide.svelte-1mpf6w7{flex:none}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents .jse-preview-data.svelte-1mpf6w7{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents.jse-hide-original-data.svelte-1mpf6w7{flex-direction:column;gap:0;margin-bottom:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-actions.svelte-1mpf6w7{padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px)) calc(2 * var(--jse-padding, 10px))}@media screen and (max-width: 1200px){.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents.svelte-1mpf6w7{flex-direction:column;overflow:auto}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-1mpf6w7{min-height:150px;flex:none}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-1mpf6w7 .jse-tree-mode{height:300px;flex:none}}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-label.svelte-1mpf6w7{font-weight:bold;display:block;box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-label .jse-label-inner.svelte-1mpf6w7{margin-top:calc(2 * var(--jse-padding, 10px));margin-bottom:calc(0.5 * var(--jse-padding, 10px));box-sizing:border-box}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-label .jse-label-inner button.svelte-1mpf6w7{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;font-weight:bold;padding:0}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-tree-mode{flex:1;background:var(--jse-input-background-readonly, transparent);box-shadow:none;box-sizing:border-box;--jse-main-border:var(--jse-input-border, 1px solid #d8dbdf)}.jse-modal.jse-transform.svelte-1mpf6w7 input.svelte-1mpf6w7,.jse-modal.jse-transform.svelte-1mpf6w7 textarea.svelte-1mpf6w7{border:var(--jse-input-border, 1px solid #d8dbdf);outline:none;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding, 10px));font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:inherit;background:var(--jse-input-background, var(--jse-background-color, #fff))}.jse-modal.jse-transform.svelte-1mpf6w7 input.svelte-1mpf6w7:focus,.jse-modal.jse-transform.svelte-1mpf6w7 textarea.svelte-1mpf6w7:focus{border:var(--jse-input-border-focus, 1px solid var(--jse-input-border-focus, var(--jse-theme-color, #3883fa)))}.jse-modal.jse-transform.svelte-1mpf6w7 input.svelte-1mpf6w7:read-only,.jse-modal.jse-transform.svelte-1mpf6w7 textarea.svelte-1mpf6w7:read-only{background:var(--jse-input-background-readonly, transparent)}.jse-modal.jse-transform.svelte-1mpf6w7 .jse-preview.jse-error.svelte-1mpf6w7{flex:1;background:var(--jse-input-background-readonly, transparent);border:var(--jse-input-border, 1px solid #d8dbdf);color:var(--jse-error-color, #ee5341);padding:calc(0.5 * var(--jse-padding, 10px))}.jse-modal.jse-transform.svelte-1mpf6w7 a{color:var(--jse-a-color, #156fc5)}.jse-modal.jse-transform.svelte-1mpf6w7 a:hover{color:var(--jse-a-color-highlight, #0f508d)}')}function hx(n){var e,t,r,i,o,s=[uK,cK],a=[];function l(c,u){return 16384&u[0]&&(e=null),e==null&&(e=!!Array.isArray(c[14])),e?0:1}return t=l(n,[-1,-1]),r=a[t]=s[t](n),{c:function(){r.c(),i=an()},m:function(c,u){a[t].m(c,u),ee(c,i,u),o=!0},p:function(c,u){var f=t;(t=l(c,u))===f?a[t].p(c,u):(Ee(),M(a[f],1,1,function(){a[f]=null}),Ae(),(r=a[t])?r.p(c,u):(r=a[t]=s[t](c)).c(),C(r,1),r.m(i.parentNode,i))},i:function(c){o||(C(r),o=!0)},o:function(c){M(r),o=!1},d:function(c){c&&Z(i),a[t].d(c)}}}function cK(n){var e;return{c:function(){e=De("(Only available for arrays, not for objects)")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function uK(n){var e,t;return e=new _H({props:{queryOptions:n[15],json:n[14],onChange:n[24]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};32768&i[0]&&(o.queryOptions=r[15]),16384&i[0]&&(o.json=r[14]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function px(n){var e,t;return e=new r1({props:{externalContent:n[17],externalSelection:null,readOnly:!0,mainMenuBar:!1,navigationBar:!1,indentation:n[2],escapeControlCharacters:n[3],escapeUnicodeCharacters:n[4],parser:n[5],parseMemoizeOne:n[6],onRenderValue:n[10],onRenderMenu:n[11],onRenderContextMenu:n[12],onError:console.error,onChange:Cr,onChangeMode:Cr,onSelect:Cr,onFocus:Cr,onBlur:Cr,onSortModal:Cr,onTransformModal:Cr,onJSONEditorModal:Cr,onClassName:n[13],validator:null,validationParser:n[7],pathParser:n[8]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};131072&i[0]&&(o.externalContent=r[17]),4&i[0]&&(o.indentation=r[2]),8&i[0]&&(o.escapeControlCharacters=r[3]),16&i[0]&&(o.escapeUnicodeCharacters=r[4]),32&i[0]&&(o.parser=r[5]),64&i[0]&&(o.parseMemoizeOne=r[6]),1024&i[0]&&(o.onRenderValue=r[10]),2048&i[0]&&(o.onRenderMenu=r[11]),4096&i[0]&&(o.onRenderContextMenu=r[12]),8192&i[0]&&(o.onClassName=r[13]),128&i[0]&&(o.validationParser=r[7]),256&i[0]&&(o.pathParser=r[8]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function fK(n){var e,t;return{c:function(){e=V("div"),t=De(n[21]),x(e,"class","jse-preview jse-error svelte-1mpf6w7")},m:function(r,i){ee(r,e,i),E(e,t)},p:function(r,i){2097152&i[0]&>(t,r[21])},i:Te,o:Te,d:function(r){r&&Z(e)}}}function dK(n){var e,t;return e=new r1({props:{externalContent:n[22],externalSelection:null,readOnly:!0,mainMenuBar:!1,navigationBar:!1,indentation:n[2],escapeControlCharacters:n[3],escapeUnicodeCharacters:n[4],parser:n[5],parseMemoizeOne:n[6],onRenderValue:n[10],onRenderMenu:n[11],onRenderContextMenu:n[12],onError:console.error,onChange:Cr,onChangeMode:Cr,onSelect:Cr,onFocus:Cr,onBlur:Cr,onSortModal:Cr,onTransformModal:Cr,onJSONEditorModal:Cr,onClassName:n[13],validator:null,validationParser:n[7],pathParser:n[8]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};4194304&i[0]&&(o.externalContent=r[22]),4&i[0]&&(o.indentation=r[2]),8&i[0]&&(o.escapeControlCharacters=r[3]),16&i[0]&&(o.escapeUnicodeCharacters=r[4]),32&i[0]&&(o.parser=r[5]),64&i[0]&&(o.parseMemoizeOne=r[6]),1024&i[0]&&(o.onRenderValue=r[10]),2048&i[0]&&(o.onRenderMenu=r[11]),4096&i[0]&&(o.onRenderContextMenu=r[12]),8192&i[0]&&(o.onClassName=r[13]),128&i[0]&&(o.validationParser=r[7]),256&i[0]&&(o.pathParser=r[8]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function hK(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D,U,q,X,K,Y,T,B,O,A,te,R,k,P,H,J,he,Se,pe,ae,Qe,et=n[23](n[0]).description+"";function tn(He){n[37](He)}var Qt={queryLanguages:n[9],queryLanguageId:n[0],onChangeQueryLanguage:n[29]};n[18]!==void 0&&(Qt.fullscreen=n[18]),e=new KH({props:Qt}),It.push(function(){return oi(e,"fullscreen",tn)}),y=new un({props:{data:n[19]?Ri:$s}});var oe=n[19]&&hx(n);K=new un({props:{data:n[20]?Ri:$s}});var st=n[20]&&px(n),Ht=[dK,fK],qe=[];function Dt(He,wt){return He[21]?1:0}return R=Dt(n),k=qe[R]=Ht[R](n),{c:function(){xe(e.$$.fragment),r=ce(),i=V("div"),o=V("div"),s=V("div"),(a=V("div")).innerHTML='
Language
',l=ce(),c=V("div"),u=ce(),(f=V("div")).innerHTML='
Path
',d=ce(),h=V("input"),m=ce(),v=V("div"),g=V("div"),b=V("button"),xe(y.$$.fragment),j=De(` + Wizard`),w=ce(),oe&&oe.c(),$=ce(),(S=V("div")).innerHTML='
Query
',_=ce(),F=V("textarea"),I=ce(),W=V("div"),D=V("div"),U=V("div"),q=V("div"),X=V("button"),xe(K.$$.fragment),Y=De(` + Original`),T=ce(),st&&st.c(),B=ce(),O=V("div"),(A=V("div")).innerHTML='
Preview
',te=ce(),k.c(),P=ce(),H=V("div"),J=V("button"),he=De("Transform"),x(a,"class","jse-label svelte-1mpf6w7"),x(c,"class","jse-description svelte-1mpf6w7"),x(f,"class","jse-label svelte-1mpf6w7"),x(h,"class","jse-path svelte-1mpf6w7"),x(h,"type","text"),h.readOnly=!0,x(h,"title","Selected path"),h.value=p=hn(n[1])?"(document root)":mi(n[1]),x(b,"type","button"),x(b,"class","svelte-1mpf6w7"),x(g,"class","jse-label-inner svelte-1mpf6w7"),x(v,"class","jse-label svelte-1mpf6w7"),x(S,"class","jse-label svelte-1mpf6w7"),x(F,"class","jse-query svelte-1mpf6w7"),x(F,"spellcheck","false"),F.value=n[16],x(s,"class","jse-query-contents svelte-1mpf6w7"),x(X,"type","button"),x(X,"class","svelte-1mpf6w7"),x(q,"class","jse-label-inner svelte-1mpf6w7"),x(U,"class","jse-label svelte-1mpf6w7"),x(D,"class","jse-original-data svelte-1mpf6w7"),$e(D,"jse-hide",!n[20]),x(A,"class","jse-label svelte-1mpf6w7"),x(O,"class","jse-preview-data svelte-1mpf6w7"),x(W,"class","jse-data-contents svelte-1mpf6w7"),$e(W,"jse-hide-original-data",!n[20]),x(o,"class","jse-main-contents svelte-1mpf6w7"),x(J,"type","button"),x(J,"class","jse-primary svelte-1mpf6w7"),J.disabled=Se=!!n[21],x(H,"class","jse-actions svelte-1mpf6w7"),x(i,"class","jse-modal-contents svelte-1mpf6w7")},m:function(He,wt){be(e,He,wt),ee(He,r,wt),ee(He,i,wt),E(i,o),E(o,s),E(s,a),E(s,l),E(s,c),c.innerHTML=et,E(s,u),E(s,f),E(s,d),E(s,h),E(s,m),E(s,v),E(v,g),E(g,b),be(y,b,null),E(b,j),E(s,w),oe&&oe.m(s,null),E(s,$),E(s,S),E(s,_),E(s,F),E(o,I),E(o,W),E(W,D),E(D,U),E(U,q),E(q,X),be(K,X,null),E(X,Y),E(D,T),st&&st.m(D,null),E(W,B),E(W,O),E(O,A),E(O,te),qe[R].m(O,null),E(i,P),E(i,H),E(H,J),E(J,he),pe=!0,ae||(Qe=[Ce(b,"click",n[27]),Ce(F,"input",n[25]),Ce(X,"click",n[28]),Ce(J,"click",n[26]),mr(mK.call(null,J))],ae=!0)},p:function(He,wt){var Oe={};512&wt[0]&&(Oe.queryLanguages=He[9]),1&wt[0]&&(Oe.queryLanguageId=He[0]),!t&&262144&wt[0]&&(t=!0,Oe.fullscreen=He[18],ii(function(){return t=!1})),e.$set(Oe),(!pe||1&wt[0])&&et!==(et=He[23](He[0]).description+"")&&(c.innerHTML=et),(!pe||2&wt[0]&&p!==(p=hn(He[1])?"(document root)":mi(He[1]))&&h.value!==p)&&(h.value=p);var Xe={};524288&wt[0]&&(Xe.data=He[19]?Ri:$s),y.$set(Xe),He[19]?oe?(oe.p(He,wt),524288&wt[0]&&C(oe,1)):((oe=hx(He)).c(),C(oe,1),oe.m(s,$)):oe&&(Ee(),M(oe,1,1,function(){oe=null}),Ae()),(!pe||65536&wt[0])&&(F.value=He[16]);var nn={};1048576&wt[0]&&(nn.data=He[20]?Ri:$s),K.$set(nn),He[20]?st?(st.p(He,wt),1048576&wt[0]&&C(st,1)):((st=px(He)).c(),C(st,1),st.m(D,null)):st&&(Ee(),M(st,1,1,function(){st=null}),Ae()),(!pe||1048576&wt[0])&&$e(D,"jse-hide",!He[20]);var L=R;(R=Dt(He))===L?qe[R].p(He,wt):(Ee(),M(qe[L],1,1,function(){qe[L]=null}),Ae(),(k=qe[R])?k.p(He,wt):(k=qe[R]=Ht[R](He)).c(),C(k,1),k.m(O,null)),(!pe||1048576&wt[0])&&$e(W,"jse-hide-original-data",!He[20]),(!pe||2097152&wt[0]&&Se!==(Se=!!He[21]))&&(J.disabled=Se)},i:function(He){pe||(C(e.$$.fragment,He),C(y.$$.fragment,He),C(oe),C(K.$$.fragment,He),C(st),C(k),pe=!0)},o:function(He){M(e.$$.fragment,He),M(y.$$.fragment,He),M(oe),M(K.$$.fragment,He),M(st),M(k),pe=!1},d:function(He){He&&(Z(r),Z(i)),we(e,He),we(y),oe&&oe.d(),we(K),st&&st.d(),qe[R].d(),ae=!1,kn(Qe)}}}function pK(n){var e,t,r,i,o;return t=new x4({props:{$$slots:{default:[hK]},$$scope:{ctx:n}}}),{c:function(){e=V("div"),xe(t.$$.fragment),x(e,"class","jse-modal jse-transform svelte-1mpf6w7"),$e(e,"fullscreen",n[18])},m:function(s,a){ee(s,e,a),be(t,e,null),r=!0,i||(o=mr(Lu.call(null,e,n[30])),i=!0)},p:function(s,a){var l={};8388607&a[0]|16384&a[1]&&(l.$$scope={dirty:a,ctx:s}),t.$set(l),(!r||262144&a[0])&&$e(e,"fullscreen",s[18])},i:function(s){r||(C(t.$$.fragment,s),r=!0)},o:function(s){M(t.$$.fragment,s),r=!1},d:function(s){s&&Z(e),we(t),i=!1,o()}}}function mK(n){n.focus()}function gK(n,e,t){var r,i,o=Sr("jsoneditor:TransformModal"),s=e.id,a=s===void 0?"transform-modal-"+Bc():s,l=e.json,c=e.rootPath,u=c===void 0?[]:c,f=e.indentation,d=e.escapeControlCharacters,h=e.escapeUnicodeCharacters,p=e.parser,m=e.parseMemoizeOne,v=e.validationParser,g=e.pathParser,b=e.queryLanguages,y=e.queryLanguageId,j=e.onChangeQueryLanguage,w=e.onRenderValue,$=e.onRenderMenu,S=e.onRenderContextMenu,_=e.onClassName,F=e.onTransform,I=Er("simple-modal").close,W=!1,D="".concat(a,":").concat(Ue(u)),U=hc[D]||{},q=Rf.showWizard!==!1,X=Rf.showOriginal!==!1,K=U.queryOptions||{},Y=y===U.queryLanguageId&&U.query?U.query:A(y).createQuery(r,U.queryOptions||{}),T=U.isManual||!1,B=void 0,O={text:""};function A(R){return b.find(function(k){return k.id===R})||b[0]}var te=ud(function(R,k){if(R===void 0)return t(22,O={text:""}),void t(21,B="Error: No JSON");try{o("previewTransform",{query:k});var P=A(y).executeQuery(R,k,p);t(22,O={json:P}),t(21,B=void 0)}catch(H){t(22,O={text:""}),t(21,B=String(H))}},300);return n.$$set=function(R){"id"in R&&t(31,a=R.id),"json"in R&&t(32,l=R.json),"rootPath"in R&&t(1,u=R.rootPath),"indentation"in R&&t(2,f=R.indentation),"escapeControlCharacters"in R&&t(3,d=R.escapeControlCharacters),"escapeUnicodeCharacters"in R&&t(4,h=R.escapeUnicodeCharacters),"parser"in R&&t(5,p=R.parser),"parseMemoizeOne"in R&&t(6,m=R.parseMemoizeOne),"validationParser"in R&&t(7,v=R.validationParser),"pathParser"in R&&t(8,g=R.pathParser),"queryLanguages"in R&&t(9,b=R.queryLanguages),"queryLanguageId"in R&&t(0,y=R.queryLanguageId),"onChangeQueryLanguage"in R&&t(33,j=R.onChangeQueryLanguage),"onRenderValue"in R&&t(10,w=R.onRenderValue),"onRenderMenu"in R&&t(11,$=R.onRenderMenu),"onRenderContextMenu"in R&&t(12,S=R.onRenderContextMenu),"onClassName"in R&&t(13,_=R.onClassName),"onTransform"in R&&t(34,F=R.onTransform)},n.$$.update=function(){2&n.$$.dirty[0]|2&n.$$.dirty[1]&&t(14,r=m6(Ye(l,u))),16384&n.$$.dirty[0]&&t(17,i=r?{json:r}:{text:""}),81920&n.$$.dirty[0]&&te(r,Y),98305&n.$$.dirty[0]|48&n.$$.dirty[1]&&(t(35,hc[D]={queryOptions:K,query:Y,queryLanguageId:y,isManual:T},hc),o("store state in memory",D,hc[D]))},[y,u,f,d,h,p,m,v,g,b,w,$,S,_,r,K,Y,i,W,q,X,B,O,A,function(R){t(15,K=R),t(16,Y=A(y).createQuery(r,R)),t(36,T=!1),o("updateQueryByWizard",{queryOptions:K,query:Y,isManual:T})},function(R){t(16,Y=R.target.value),t(36,T=!0),o("handleChangeQuery",{query:Y,isManual:T})},function(){if(r===void 0)return t(22,O={text:""}),void t(21,B="Error: No JSON");try{o("handleTransform",{query:Y});var R=A(y).executeQuery(r,Y,p);F([{op:"replace",path:Ue(u),value:R}]),I()}catch(k){console.error(k),t(22,O={text:""}),t(21,B=String(k))}},function(){t(19,q=!q),Rf.showWizard=q},function(){t(20,X=!X),Rf.showOriginal=X},function(R){o("handleChangeQueryLanguage",R),t(0,y=R),j(R);var k=A(y);t(16,Y=k.createQuery(r,K)),t(36,T=!1)},function(){W?t(18,W=!W):I()},a,l,j,F,hc,T,function(R){t(18,W=R)}]}var vK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,gK,pK,Tt,{id:31,json:32,rootPath:1,indentation:2,escapeControlCharacters:3,escapeUnicodeCharacters:4,parser:5,parseMemoizeOne:6,validationParser:7,pathParser:8,queryLanguages:9,queryLanguageId:0,onChangeQueryLanguage:33,onRenderValue:10,onRenderMenu:11,onRenderContextMenu:12,onClassName:13,onTransform:34},lK,[-1,-1]),r}return ht(e,mt),ut(e)}(),Ka={};function yK(n){Et(n,"svelte-jdii8g",'.jse-modal.svelte-jdii8g.svelte-jdii8g{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;background:var(--jse-modal-background, #f5f5f5);color:var(--jse-text-color, #4d4d4d)}.jse-modal.svelte-jdii8g .svelte-select{--border:var(--jse-svelte-select-border, 1px solid #d8dbdf);--item-is-active-bg:var(--jse-item-is-active-bg, #3883fa);--border-radius:var(--jse-svelte-select-border-radius, 3px);--background:var(--jse-svelte-select-background, #fff);--padding:var(--jse-svelte-select-padding, 0 10px);--multi-select-padding:var(--jse-svelte-select-multi-select-padding, 0 10px);--font-size:var(--jse-svelte-select-font-size, var(--jse-font-size, 16px));--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px}.jse-modal.svelte-jdii8g .jse-modal-contents.svelte-jdii8g{flex:1;display:flex;flex-direction:column;padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions.svelte-jdii8g{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding, 10px)}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions button.jse-primary.svelte-jdii8g{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions button.jse-primary.svelte-jdii8g:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-modal.svelte-jdii8g .jse-modal-contents .jse-actions button.jse-primary.svelte-jdii8g:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-overlay-background, rgba(0, 0, 0, 0.3))}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0;overflow:auto}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;max-height:500px;display:flex}.bg.jse-modal-bg .jse-modal-window:has(div.fullscreen){margin:var(--jse-padding, 10px);padding:0;width:calc(100vw - 2 * var(--jse-padding, 10px));height:calc(100vh - 2 * var(--jse-padding, 10px));max-width:none;max-height:none}.bg.jse-modal-bg .jse-modal-container{flex:1;display:flex;flex-direction:column;padding:0;max-height:none}.jse-modal.jse-sort.svelte-jdii8g table.svelte-jdii8g{width:100%;border-collapse:collapse;border-spacing:0}.jse-modal.jse-sort.svelte-jdii8g table th.svelte-jdii8g,.jse-modal.jse-sort.svelte-jdii8g table td.svelte-jdii8g{text-align:left;vertical-align:middle;font-weight:normal;padding-bottom:var(--jse-padding, 10px)}.jse-modal.jse-sort.svelte-jdii8g table th input.jse-path.svelte-jdii8g,.jse-modal.jse-sort.svelte-jdii8g table td input.jse-path.svelte-jdii8g{width:100%;box-sizing:border-box;padding:6px 16px;border:var(--jse-input-border, 1px solid #d8dbdf);border-radius:var(--jse-input-radius, 3px);font-family:inherit;font-size:inherit;background:inherit;color:inherit;outline:none}.jse-modal.jse-sort.svelte-jdii8g table th input.jse-path.svelte-jdii8g:read-only,.jse-modal.jse-sort.svelte-jdii8g table td input.jse-path.svelte-jdii8g:read-only{background:var(--jse-input-background-readonly, transparent)}.jse-modal.jse-sort.svelte-jdii8g table th.svelte-jdii8g .svelte-select input,.jse-modal.jse-sort.svelte-jdii8g table td.svelte-jdii8g .svelte-select input{box-sizing:border-box}.jse-modal.jse-sort.svelte-jdii8g .jse-space.svelte-jdii8g{height:200px}.jse-modal.jse-sort.svelte-jdii8g .jse-space .jse-error.svelte-jdii8g{color:var(--jse-error-color, #ee5341)}')}function mx(n){var e,t,r,i,o,s,a;function l(u){n[14](u)}var c={showChevron:!0,items:n[5]};return n[1]!==void 0&&(c.value=n[1]),o=new la({props:c}),It.push(function(){return oi(o,"value",l)}),{c:function(){e=V("tr"),(t=V("th")).textContent="Property",r=ce(),i=V("td"),xe(o.$$.fragment),x(t,"class","svelte-jdii8g"),x(i,"class","svelte-jdii8g")},m:function(u,f){ee(u,e,f),E(e,t),E(e,r),E(e,i),be(o,i,null),a=!0},p:function(u,f){var d={};32&f&&(d.items=u[5]),!s&&2&f&&(s=!0,d.value=u[1],ii(function(){return s=!1})),o.$set(d)},i:function(u){a||(C(o.$$.fragment,u),a=!0)},o:function(u){M(o.$$.fragment,u),a=!1},d:function(u){u&&Z(e),we(o)}}}function gx(n){var e,t;return{c:function(){e=V("div"),t=De(n[4]),x(e,"class","jse-error svelte-jdii8g")},m:function(r,i){ee(r,e,i),E(e,t)},p:function(r,i){16&i&>(t,r[4])},d:function(r){r&&Z(e)}}}function bK(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D,U,q,X,K,Y;r=new tp({props:{title:n[3]?"Sort array items":"Sort object keys"}});var T=n[3]&&(n[5]&&((e=n[5])===null||e===void 0?void 0:e.length)>1||n[1]===void 0)&&mx(n);function B(te){n[15](te)}var O={showChevron:!0,clearable:!1,items:n[7]};n[2]!==void 0&&(O.value=n[2]),$=new la({props:O}),It.push(function(){return oi($,"value",B)});var A=n[4]&&gx(n);return{c:function(){var te;t=V("div"),xe(r.$$.fragment),i=ce(),o=V("div"),s=V("table"),(a=V("colgroup")).innerHTML=' ',l=ce(),c=V("tbody"),u=V("tr"),(f=V("th")).textContent="Path",d=ce(),h=V("td"),p=V("input"),v=ce(),T&&T.c(),g=ce(),b=V("tr"),(y=V("th")).textContent="Direction",j=ce(),w=V("td"),xe($.$$.fragment),_=ce(),F=V("div"),A&&A.c(),I=ce(),W=V("div"),D=V("button"),U=De("Sort"),x(f,"class","svelte-jdii8g"),x(p,"class","jse-path svelte-jdii8g"),x(p,"type","text"),p.readOnly=!0,x(p,"title","Selected path"),p.value=m=hn(n[0])?"(document root)":mi(n[0]),x(h,"class","svelte-jdii8g"),x(y,"class","svelte-jdii8g"),x(w,"class","svelte-jdii8g"),x(s,"class","svelte-jdii8g"),x(F,"class","jse-space svelte-jdii8g"),x(D,"type","button"),x(D,"class","jse-primary svelte-jdii8g"),D.disabled=q=!!(n[3]&&n[5]&&((te=n[5])===null||te===void 0?void 0:te.length)>1)&&!n[1],x(W,"class","jse-actions svelte-jdii8g"),x(o,"class","jse-modal-contents svelte-jdii8g"),x(t,"class","jse-modal jse-sort svelte-jdii8g")},m:function(te,R){ee(te,t,R),be(r,t,null),E(t,i),E(t,o),E(o,s),E(s,a),E(s,l),E(s,c),E(c,u),E(u,f),E(u,d),E(u,h),E(h,p),E(c,v),T&&T.m(c,null),E(c,g),E(c,b),E(b,y),E(b,j),E(b,w),be($,w,null),E(o,_),E(o,F),A&&A.m(F,null),E(o,I),E(o,W),E(W,D),E(D,U),X=!0,K||(Y=[Ce(D,"click",n[8]),mr(wK.call(null,D)),mr(Lu.call(null,t,n[6]))],K=!0)},p:function(te,R){var k,P,H=At(R,1)[0],J={};8&H&&(J.title=te[3]?"Sort array items":"Sort object keys"),r.$set(J),(!X||1&H&&m!==(m=hn(te[0])?"(document root)":mi(te[0]))&&p.value!==m)&&(p.value=m),te[3]&&(te[5]&&((k=te[5])===null||k===void 0?void 0:k.length)>1||te[1]===void 0)?T?(T.p(te,H),42&H&&C(T,1)):((T=mx(te)).c(),C(T,1),T.m(c,g)):T&&(Ee(),M(T,1,1,function(){T=null}),Ae());var he={};!S&&4&H&&(S=!0,he.value=te[2],ii(function(){return S=!1})),$.$set(he),te[4]?A?A.p(te,H):((A=gx(te)).c(),A.m(F,null)):A&&(A.d(1),A=null),(!X||42&H&&q!==(q=!!(te[3]&&te[5]&&((P=te[5])===null||P===void 0?void 0:P.length)>1)&&!te[1]))&&(D.disabled=q)},i:function(te){X||(C(r.$$.fragment,te),C(T),C($.$$.fragment,te),X=!0)},o:function(te){M(r.$$.fragment,te),M(T),M($.$$.fragment,te),X=!1},d:function(te){te&&Z(t),we(r),T&&T.d(),we($),A&&A.d(),K=!1,kn(Y)}}}function wK(n){n.focus()}function jK(n,e,t){var r,i,o,s,a,l=Sr("jsoneditor:SortModal"),c=e.id,u=e.json,f=e.rootPath,d=e.onSort,h=Er("simple-modal").close,p="".concat(c,":").concat(Ue(f)),m=Ye(u,f),v={value:1,label:"ascending"},g=[v,{value:-1,label:"descending"}],b=(r=Ka[p])===null||r===void 0?void 0:r.selectedProperty,y=((i=Ka[p])===null||i===void 0?void 0:i.selectedDirection)||v,j=void 0;return n.$$set=function(w){"id"in w&&t(9,c=w.id),"json"in w&&t(10,u=w.json),"rootPath"in w&&t(0,f=w.rootPath),"onSort"in w&&t(11,d=w.onSort)},n.$$.update=function(){8&n.$$.dirty&&t(13,s=o&&m!==void 0?Ag(m):void 0),8192&n.$$.dirty&&t(5,a=s?s.map(jc):void 0),4102&n.$$.dirty&&(t(12,Ka[p]={selectedProperty:b,selectedDirection:y},Ka),l("store state in memory",p,Ka[p]))},t(3,o=Array.isArray(m)),[f,b,y,o,j,a,h,g,function(){try{var w,$,S;t(4,j=void 0);var _=((w=b)===null||w===void 0?void 0:w.value)||(($=a)===null||$===void 0||($=$[0])===null||$===void 0?void 0:$.value)||[],F=(S=y)===null||S===void 0?void 0:S.value,I=r6(u,f,_,F);d({operations:I,rootPath:f,itemPath:_,direction:F}),h()}catch(W){t(4,j=String(W))}},c,u,d,Ka,s,function(w){t(1,b=w)},function(w){t(2,y=w)}]}var xK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,jK,bK,Tt,{id:9,json:10,rootPath:0,onSort:11},yK),r}return ht(e,mt),ut(e)}();function Zi(){}function Lf(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(n<.9*e)return n.toFixed()+" B";var t=n/e;if(t<.9*e)return t.toFixed(1)+" KB";var r=t/e;if(r<.9*e)return r.toFixed(1)+" MB";var i=r/e;return i<.9*e?i.toFixed(1)+" GB":(i/e).toFixed(1)+" TB"}function $K(n){var e,t;return e=new rp({props:{items:n[0]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&At(i,1)[0]&&(o.items=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function kK(n,e,t){var r,i,o=e.readOnly,s=o!==void 0&&o,a=e.onFormat,l=e.onCompact,c=e.onSort,u=e.onTransform,f=e.onToggleSearch,d=e.onUndo,h=e.onRedo,p=e.canUndo,m=e.canRedo,v=e.canFormat,g=e.canCompact,b=e.canSort,y=e.canTransform,j=e.onRenderMenu,w={type:"button",icon:kh,title:"Search (Ctrl+F)",className:"jse-search",onClick:f};return n.$$set=function($){"readOnly"in $&&t(1,s=$.readOnly),"onFormat"in $&&t(2,a=$.onFormat),"onCompact"in $&&t(3,l=$.onCompact),"onSort"in $&&t(4,c=$.onSort),"onTransform"in $&&t(5,u=$.onTransform),"onToggleSearch"in $&&t(6,f=$.onToggleSearch),"onUndo"in $&&t(7,d=$.onUndo),"onRedo"in $&&t(8,h=$.onRedo),"canUndo"in $&&t(9,p=$.canUndo),"canRedo"in $&&t(10,m=$.canRedo),"canFormat"in $&&t(11,v=$.canFormat),"canCompact"in $&&t(12,g=$.canCompact),"canSort"in $&&t(13,b=$.canSort),"canTransform"in $&&t(14,y=$.canTransform),"onRenderMenu"in $&&t(15,j=$.onRenderMenu)},n.$$.update=function(){32702&n.$$.dirty&&t(16,i=s?[w,{type:"space"}]:[{type:"button",icon:Vg,title:"Format JSON: add proper indentation and new lines (Ctrl+I)",className:"jse-format",onClick:a,disabled:s||!v},{type:"button",icon:PW,title:"Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)",className:"jse-compact",onClick:l,disabled:s||!g},{type:"separator"},{type:"button",icon:$h,title:"Sort",className:"jse-sort",onClick:c,disabled:s||!b},{type:"button",icon:jh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:u,disabled:s||!y},w,{type:"separator"},{type:"button",icon:hv,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:d,disabled:!p},{type:"button",icon:dv,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:h,disabled:!m},{type:"space"}]),98304&n.$$.dirty&&t(0,r=j(i)||i)},[r,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,i]}var SK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,kK,$K,Tt,{readOnly:1,onFormat:2,onCompact:3,onSort:4,onTransform:5,onToggleSearch:6,onUndo:7,onRedo:8,canUndo:9,canRedo:10,canFormat:11,canCompact:12,canSort:13,canTransform:14,onRenderMenu:15}),r}return ht(e,mt),ut(e)}();function CK(n){Et(n,"svelte-hhcn0f",'.jse-status-bar.svelte-hhcn0f.svelte-hhcn0f{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);margin:0;border-top:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7));border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7);display:flex;gap:var(--jse-padding, 10px)}.jse-status-bar.svelte-hhcn0f.svelte-hhcn0f:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-status-bar.svelte-hhcn0f .jse-status-bar-info.svelte-hhcn0f{padding:2px}')}function vx(n){var e,t,r;return{c:function(){e=V("div"),t=De("Line: "),r=De(n[0]),x(e,"class","jse-status-bar-info svelte-hhcn0f")},m:function(i,o){ee(i,e,o),E(e,t),E(e,r)},p:function(i,o){1&o&>(r,i[0])},d:function(i){i&&Z(e)}}}function yx(n){var e,t,r;return{c:function(){e=V("div"),t=De("Column: "),r=De(n[1]),x(e,"class","jse-status-bar-info svelte-hhcn0f")},m:function(i,o){ee(i,e,o),E(e,t),E(e,r)},p:function(i,o){2&o&>(r,i[1])},d:function(i){i&&Z(e)}}}function bx(n){var e,t,r,i;return{c:function(){e=V("div"),t=De("Selection: "),r=De(n[2]),i=De(" characters"),x(e,"class","jse-status-bar-info svelte-hhcn0f")},m:function(o,s){ee(o,e,s),E(e,t),E(e,r),E(e,i)},p:function(o,s){4&s&>(r,o[2])},d:function(o){o&&Z(e)}}}function OK(n){var e,t,r,i=n[0]!==void 0&&vx(n),o=n[1]!==void 0&&yx(n),s=n[2]!==void 0&&n[2]>0&&bx(n);return{c:function(){e=V("div"),i&&i.c(),t=ce(),o&&o.c(),r=ce(),s&&s.c(),x(e,"class","jse-status-bar svelte-hhcn0f")},m:function(a,l){ee(a,e,l),i&&i.m(e,null),E(e,t),o&&o.m(e,null),E(e,r),s&&s.m(e,null)},p:function(a,l){var c=At(l,1)[0];a[0]!==void 0?i?i.p(a,c):((i=vx(a)).c(),i.m(e,t)):i&&(i.d(1),i=null),a[1]!==void 0?o?o.p(a,c):((o=yx(a)).c(),o.m(e,r)):o&&(o.d(1),o=null),a[2]!==void 0&&a[2]>0?s?s.p(a,c):((s=bx(a)).c(),s.m(e,null)):s&&(s.d(1),s=null)},i:Te,o:Te,d:function(a){a&&Z(e),i&&i.d(),o&&o.d(),s&&s.d()}}}function MK(n,e,t){var r,i,o,s,a,l=e.editorState;return n.$$set=function(c){"editorState"in c&&t(3,l=c.editorState)},n.$$.update=function(){var c,u,f;8&n.$$.dirty&&t(4,r=(c=l)===null||c===void 0||(c=c.selection)===null||c===void 0||(c=c.main)===null||c===void 0?void 0:c.head),24&n.$$.dirty&&t(5,i=r!==void 0?(u=l)===null||u===void 0||(u=u.doc)===null||u===void 0?void 0:u.lineAt(r):void 0),32&n.$$.dirty&&t(0,o=i!==void 0?i.number:void 0),48&n.$$.dirty&&t(1,s=i!==void 0&&r!==void 0?r-i.from+1:void 0),8&n.$$.dirty&&t(2,a=(f=l)===null||f===void 0||(f=f.selection)===null||f===void 0||(f=f.ranges)===null||f===void 0?void 0:f.reduce(function(d,h){return d+h.to-h.from},0))},[o,s,a,l,r,i]}var EK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,MK,OK,yr,{editorState:3},CK),r}return ht(e,mt),ut(e)}(),i1=Su.define([{tag:Ve.propertyName,color:"var(--internal-key-color)"},{tag:Ve.number,color:"var(--internal-value-color-number)"},{tag:Ve.bool,color:"var(--internal-value-color-boolean)"},{tag:Ve.string,color:"var(--internal-value-color-string)"},{tag:Ve.keyword,color:"var(--internal-value-color-null)"}]),AK=GS(i1),TK=i1.style;function PK(n){Et(n,"svelte-a0poeb",'.jse-text-mode.svelte-a0poeb.svelte-a0poeb{--internal-key-color:var(--jse-key-color, #1a1a1a);--internal-value-color-number:var(--jse-value-color-number, #ee422e);--internal-value-color-boolean:var(--jse-value-color-boolean, #ff8c00);--internal-value-color-string:var(--jse-value-color-string, #008000);--internal-value-color-null:var(--jse-value-color-null, #004ed0);flex:1;box-sizing:border-box;display:flex;flex-direction:column;background:var(--jse-background-color, #fff)}.jse-text-mode.no-main-menu.svelte-a0poeb.svelte-a0poeb{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb{flex:1;display:flex;position:relative;flex-direction:column;overflow:hidden;min-width:0;min-height:0;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-text-mode.svelte-a0poeb .jse-contents.jse-hidden.svelte-a0poeb{visibility:hidden;position:absolute;top:0;left:0}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor{flex:1;overflow:hidden}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-scroller{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);line-height:var(--jse-line-height, calc(1em + 4px));color:var(--jse-delimiter-color, rgba(0, 0, 0, 0.38))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-gutters{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color-readonly, #b2b2b2);border-right:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-activeLine,.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-activeLineGutter{background:var(--jse-active-line-background-color, rgba(0, 0, 0, 0.06))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-selectionBackground{background:var(--jse-selection-background-color, #d3d3d3)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-searchMatch{background-color:var(--jse-search-match-color, #ffe665);outline:var(--jse-search-match-outline, 1px solid #ffd700)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-searchMatch.cm-searchMatch-selected{background-color:var(--jse-search-match-active-color, #ffd700);outline:var(--jse-search-match-active-outline, 1px solid #e1be00)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-selectionMatch{background-color:var(--jse-search-match-background-color, rgba(153, 255, 119, 0.5019607843))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-foldPlaceholder{background:var(--jse-tag-background, rgba(0, 0, 0, 0.2));color:var(--jse-tag-color, var(--jse-text-color-inverse, #fff));border:none;padding:0 var(--jse-padding, 10px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-tooltip{font-size:var(--jse-font-size, 16px);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);color:var(--jse-tooltip-color, var(--jse-text-color, #4d4d4d));background:var(--jse-tooltip-background, var(--jse-modal-background, #f5f5f5));border:var(--jse-tooltip-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-diagnosticAction{background:var(--jse-tooltip-action-button-color, var(--jse-text-color-inverse, #fff));background:var(--jse-tooltip-action-button-background, #4d4d4d)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-panels{border-bottom:var(--jse-panel-border, var(--jse-main-border, 1px solid #d7d7d7))}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search{background:var(--jse-panel-background, #ebebeb);color:var(--jse-panel-color, var(--jse-text-color, #4d4d4d));font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search input{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);color:var(--jse-input-color, var(--jse-text-color, #4d4d4d));border:var(--jse-input-border, 1px solid #d8dbdf);background:var(--jse-input-background, var(--jse-background-color, #fff));margin-right:2px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);color:var(--jse-panel-button-color, inherit);background:var(--jse-panel-button-background, transparent);border:none;cursor:pointer;text-transform:capitalize;padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px);margin:0}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search button:hover{color:var(--panel-button-color-highlight, var(--jse-text-color, #4d4d4d));background:var(--jse-panel-button-background-highlight, #e0e0e0)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search label{font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size-text-mode-search, 80%);padding-left:var(--jse-padding, 10px)}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-search label input{margin-right:2px}.jse-text-mode.svelte-a0poeb .jse-contents.svelte-a0poeb .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-a0poeb .jse-contents.svelte-a0poeb .cm-editor .cm-cursor-primary{border-color:var(--jse-text-color, #4d4d4d)}.jse-text-mode.svelte-a0poeb .jse-contents .jse-loading-space.svelte-a0poeb{flex:1}.jse-text-mode.svelte-a0poeb .jse-contents .jse-loading.svelte-a0poeb{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-text-mode.svelte-a0poeb .jse-contents.jse-preview.svelte-a0poeb{flex:1;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-panel-color-readonly, #b2b2b2);overflow:auto;white-space:pre-wrap;word-break:break-word;padding:2px}')}function rm(n){var e=n.slice(),t=e[11].length===0;return e[99]=t,e}function wx(n){var e,t;return e=new SK({props:{readOnly:n[1],onFormat:n[17],onCompact:n[18],onSort:n[19],onTransform:n[20],onToggleSearch:n[21],onUndo:n[22],onRedo:n[23],canFormat:!n[99],canCompact:!n[99],canSort:!n[99],canTransform:!n[99],canUndo:n[12],canRedo:n[13],onRenderMenu:n[4]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};2&i[0]&&(o.readOnly=r[1]),2048&i[0]&&(o.canFormat=!r[99]),2048&i[0]&&(o.canCompact=!r[99]),2048&i[0]&&(o.canSort=!r[99]),2048&i[0]&&(o.canTransform=!r[99]),4096&i[0]&&(o.canUndo=r[12]),8192&i[0]&&(o.canRedo=r[13]),16&i[0]&&(o.onRenderMenu=r[4]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function _K(n){var e;return{c:function(){(e=V("div")).innerHTML='
loading...
',x(e,"class","jse-contents svelte-a0poeb")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function RK(n){var e,t,r,i,o,s=n[98]&&jx(n),a=!n[98]&&xx(n);return{c:function(){e=V("div"),t=ce(),s&&s.c(),r=ce(),a&&a.c(),i=an(),x(e,"class","jse-contents svelte-a0poeb"),$e(e,"jse-hidden",n[98])},m:function(l,c){ee(l,e,c),n[53](e),ee(l,t,c),s&&s.m(l,c),ee(l,r,c),a&&a.m(l,c),ee(l,i,c),o=!0},p:function(l,c){(!o||268438016&c[0])&&$e(e,"jse-hidden",l[98]),l[98]?s?(s.p(l,c),2560&c[0]&&C(s,1)):((s=jx(l)).c(),C(s,1),s.m(r.parentNode,r)):s&&(Ee(),M(s,1,1,function(){s=null}),Ae()),l[98]?a&&(Ee(),M(a,1,1,function(){a=null}),Ae()):a?(a.p(l,c),2560&c[0]&&C(a,1)):((a=xx(l)).c(),C(a,1),a.m(i.parentNode,i))},i:function(l){o||(C(s),C(a),o=!0)},o:function(l){M(s),M(a),o=!1},d:function(l){l&&(Z(e),Z(t),Z(r),Z(i)),n[53](null),s&&s.d(l),a&&a.d(l)}}}function jx(n){var e,t,r,i,o,s=as(n[11]||"",Cg)+"";return e=new po({props:{icon:La,type:"error",message:"The JSON document is larger than ".concat(Lf(Og,1024),", ")+"and may crash your browser when loading it in text mode. Actual size: ".concat(Lf(n[11].length,1024),"."),actions:[{text:"Open anyway",title:"Open the document in text mode. This may freeze or crash your browser.",onClick:n[24]},{text:"Open in tree mode",title:"Open the document in tree mode. Tree mode can handle large documents.",onClick:n[25]},{text:"Cancel",title:"Cancel opening this large document.",onClick:n[26]}],onClose:n[5]}}),{c:function(){xe(e.$$.fragment),t=ce(),r=V("div"),i=De(s),x(r,"class","jse-contents jse-preview svelte-a0poeb")},m:function(a,l){be(e,a,l),ee(a,t,l),ee(a,r,l),E(r,i),o=!0},p:function(a,l){var c={};2048&l[0]&&(c.message="The JSON document is larger than ".concat(Lf(Og,1024),", ")+"and may crash your browser when loading it in text mode. Actual size: ".concat(Lf(a[11].length,1024),".")),e.$set(c),(!o||2048&l[0])&&s!==(s=as(a[11]||"",Cg)+"")&>(i,s)},i:function(a){o||(C(e.$$.fragment,a),o=!0)},o:function(a){M(e.$$.fragment,a),o=!1},d:function(a){a&&(Z(t),Z(r)),we(e,a)}}}function xx(n){var e,t,r,i,o,s=!n[14]&&n[0]&&S2(n[11]),a=n[3]&&$x(n),l=n[14]&&kx(n),c=s&&Sx(n);return i=new Q0({props:{validationErrors:n[10],selectError:n[27]}}),{c:function(){a&&a.c(),e=ce(),l&&l.c(),t=ce(),c&&c.c(),r=ce(),xe(i.$$.fragment)},m:function(u,f){a&&a.m(u,f),ee(u,e,f),l&&l.m(u,f),ee(u,t,f),c&&c.m(u,f),ee(u,r,f),be(i,u,f),o=!0},p:function(u,f){u[3]?a?(a.p(u,f),8&f[0]&&C(a,1)):((a=$x(u)).c(),C(a,1),a.m(e.parentNode,e)):a&&(Ee(),M(a,1,1,function(){a=null}),Ae()),u[14]?l?(l.p(u,f),16384&f[0]&&C(l,1)):((l=kx(u)).c(),C(l,1),l.m(t.parentNode,t)):l&&(Ee(),M(l,1,1,function(){l=null}),Ae()),18433&f[0]&&(s=!u[14]&&u[0]&&S2(u[11])),s?c?(c.p(u,f),18433&f[0]&&C(c,1)):((c=Sx(u)).c(),C(c,1),c.m(r.parentNode,r)):c&&(Ee(),M(c,1,1,function(){c=null}),Ae());var d={};1024&f[0]&&(d.validationErrors=u[10]),i.$set(d)},i:function(u){o||(C(a),C(l),C(c),C(i.$$.fragment,u),o=!0)},o:function(u){M(a),M(l),M(c),M(i.$$.fragment,u),o=!1},d:function(u){u&&(Z(e),Z(t),Z(r)),a&&a.d(u),l&&l.d(u),c&&c.d(u),we(i,u)}}}function $x(n){var e,t;return e=new EK({props:{editorState:n[8]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};256&i[0]&&(o.editorState=r[8]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function kx(n){var e,t;return e=new po({props:{type:"error",icon:La,message:n[14].message,actions:n[15],onClick:n[29],onClose:n[5]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};16384&i[0]&&(o.message=r[14].message),32768&i[0]&&(o.actions=r[15]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function Sx(n){var e,t;return e=new po({props:{type:"success",message:"Do you want to format the JSON?",actions:[{icon:Vg,text:"Format",title:"Format JSON: add proper indentation and new lines (Ctrl+I)",onClick:n[17]},{icon:Hc,text:"No thanks",title:"Close this message",onClick:n[54]}],onClose:n[5]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&i[0]&&(o.actions=[{icon:Vg,text:"Format",title:"Format JSON: add proper indentation and new lines (Ctrl+I)",onClick:r[17]},{icon:Hc,text:"No thanks",title:"Close this message",onClick:r[54]}]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function NK(n){var e,t,r,i,o,s=n[2]&&wx(rm(n)),a=[RK,_K],l=[];function c(u,f){return f===0?function(d){var h=d.slice(),p=h[28](h[11],h[9]);return h[98]=p,h}(u):u}return r=function(u,f){return u[16]?1:0}(n),i=l[r]=a[r](c(n,r)),{c:function(){e=V("div"),s&&s.c(),t=ce(),i.c(),x(e,"class","jse-text-mode svelte-a0poeb"),$e(e,"no-main-menu",!n[2])},m:function(u,f){ee(u,e,f),s&&s.m(e,null),E(e,t),l[r].m(e,null),n[55](e),o=!0},p:function(u,f){u[2]?s?(s.p(rm(u),f),4&f[0]&&C(s,1)):((s=wx(rm(u))).c(),C(s,1),s.m(e,t)):s&&(Ee(),M(s,1,1,function(){s=null}),Ae()),i.p(c(u,r),f),(!o||4&f[0])&&$e(e,"no-main-menu",!u[2])},i:function(u){o||(C(s),C(i),o=!0)},o:function(u){M(s),M(i),o=!1},d:function(u){u&&Z(e),s&&s.d(),l[r].d(),n[55](null)}}}function Cx(n){return{from:n.from||0,to:n.to||0,message:n.message||"",actions:n.actions,severity:n.severity}}function IK(n,e,t){var r,i,o,s,a,l,c=e.readOnly,u=e.mainMenuBar,f=e.statusBar,d=e.askToFormat,h=e.externalContent,p=e.externalSelection,m=e.indentation,v=e.tabSize,g=e.escapeUnicodeCharacters,b=e.parser,y=e.validator,j=e.validationParser,w=e.onChange,$=e.onChangeMode,S=e.onSelect,_=e.onError,F=e.onFocus,I=e.onBlur,W=e.onRenderMenu,D=e.onSortModal,U=e.onTransformModal,q=Sr("jsoneditor:TextMode"),X={key:"Mod-i",run:tn,shift:Qt,preventDefault:!0},K=typeof window=="undefined";q("isSSR:",K);var Y=!1,T=[],B=new Uo,O=new Uo,A=new Uo,te=new Uo,R=new Uo,k=h,P=Tg(k,m,b),H=g;Hi($t(Pe().mark(function me(){return Pe().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(!K){Be.next=2;break}return Be.abrupt("return");case 2:try{a=He({target:o,initialText:Ge(P,Y)?"":r.escapeValue(P),readOnly:c,indentation:m})}catch(St){console.error(St)}case 3:case"end":return Be.stop()}},me)}))),Mi(function(){a&&(q("Destroy CodeMirror editor"),a.destroy())});var J=!1,he=!1,Se=Cl(),pe=Cl();function ae(){a&&(q("focus"),a.focus())}var Qe=!1;function et(me,Be){q("handlePatch",me,Be);var St=b.parse(P),Lt=ro(St,me),_t=a$(St,me);return nn({text:b.stringify(Lt,null,m)},Be,!1),{json:Lt,previousJson:St,undo:_t,redo:me}}function tn(){if(q("format"),c)return!1;try{var me=b.parse(P);return nn({text:b.stringify(me,null,m)},!0,!1),!0}catch(Be){_(Be)}return!1}function Qt(){if(q("compact"),c)return!1;try{var me=b.parse(P);return nn({text:b.stringify(me)},!0,!1),!0}catch(Be){_(Be)}return!1}function oe(){if(q("repair"),!c)try{nn({text:Ao(P)},!0,!1),t(52,On=Up),t(14,zn=null)}catch(me){_(me)}}function st(me){var Be=me.id,St=me.rootPath,Lt=me.onTransform,_t=me.onClose;try{var Yt=b.parse(P);Qe=!0,U({id:Be||pe,json:Yt,rootPath:St||[],onTransform:function(de){Lt?Lt({operations:de,json:Yt,transformedJson:ro(Yt,de)}):(q("onTransform",de),et(de,!0))},onClose:function(){Qe=!1,ae(),_t&&_t()}})}catch(de){_(de)}}function Ht(me,Be){q("setSelection",{anchor:me,head:Be}),a&&a.dispatch(a.state.update({selection:{anchor:me,head:Be},scrollIntoView:!0}))}function qe(me,Be){if(Be.state.selection.ranges.length===1){var St=Be.state.selection.ranges[0],Lt=P.slice(St.from,St.to);if(Lt==="{"||Lt==="["){var _t=od.parse(P),Yt=Object.keys(_t.pointers).find(function(tt){var We;return((We=_t.pointers[tt].value)===null||We===void 0?void 0:We.pos)===St.from}),de=_t.pointers[Yt];Yt&&de&&de.value&&de.valueEnd&&(q("pointer found, selecting inner contents of path:",Yt,de),Ht(de.value.pos+1,de.valueEnd.pos-1))}}}function Dt(){return ZN(Pt,{delay:300})}function He(me){var Be=me.target,St=me.initialText,Lt=me.readOnly,_t=me.indentation;q("Create CodeMirror editor",{readOnly:Lt,indentation:_t});var Yt=vn.create({doc:St,selection:L(p),extensions:[vd.of([HN,X]),B.of(Dt()),lI(),jR(),kR(),H_(),F9(),p9(),__(),L_(),vn.allowMultipleSelections.of(!0),e9(),GS(y9,{fallback:!0}),S9(),$D(),RD(),nR(),oR(),Q_(),CI(),vd.of([].concat(Vt(OD),Vt(VN),Vt(WI),Vt(X9),Vt(u9),Vt(nC),Vt(YN))),AK,FD({hideFirstIndent:!0}),Ze.domEventHandlers({dblclick:qe}),Ze.updateListener.of(function(de){t(8,l=de.state),de.docChanged?rt():de.selectionSet&&Wt()}),jI(),NI({top:!0}),Ze.lineWrapping,O.of(vn.readOnly.of(Lt)),te.of(vn.tabSize.of(v)),A.of(Re(_t)),R.of(Ze.theme({},{dark:wt()}))]});return a=new Ze({state:Yt,parent:Be})}function wt(){return!!o&&getComputedStyle(o).getPropertyValue("--jse-theme").includes("dark")}function Oe(me){var Be=me.path,St=me.message,Lt=me.severity,_t=function(Yt,de){try{var tt=od.parse(Yt),We=Ue(de),N=tt.pointers[We];if(N)return{path:de,line:N.key?N.key.line:N.value?N.value.line:0,column:N.key?N.key.column:N.value?N.value.column:0,from:N.key?N.key.pos:N.value?N.value.pos:0,to:N.keyEnd?N.keyEnd.pos:N.valueEnd?N.valueEnd.pos:0}}catch(G){console.error(G)}return{path:de,line:0,column:0,from:0,to:0}}(r.escapeValue(P),Be);return{path:Be,line:_t.line,column:_t.column,from:_t.from,to:_t.to,message:St,severity:Lt,actions:[]}}function Xe(me,Be){var St=me.line,Lt=me.column,_t=me.position,Yt=me.message;return{path:[],line:St,column:Lt,from:_t,to:_t,severity:oo.error,message:Yt,actions:Be&&!c?[{name:"Auto repair",apply:function(){return oe()}}]:null}}function nn(me,Be,St){var Lt=Tg(me,m,b),_t=!sn(me,k),Yt=k;q("setCodeMirrorContent",{isChanged:_t,emitChange:Be,forceUpdate:St}),a&&(_t||St)&&(k=me,t(11,P=Lt),Ge(P,Y)||a.dispatch({changes:{from:0,to:a.state.doc.length,insert:r.escapeValue(P)}}),at(),_t&&Be&&Zt(k,Yt))}function L(me){return L2(me)?_e.fromJSON(me):void 0}function ne(){return(ne=$t(Pe().mark(function me(){return Pe().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return q("refresh"),Be.next=3,ge();case 3:case"end":return Be.stop()}},me)}))).apply(this,arguments)}function se(){if(a){var me=a?r.unescapeValue(a.state.doc.toString()):"",Be=me!==P;if(q("onChangeCodeMirrorValue",{isChanged:Be}),Be){var St=k;t(11,P=me),k={text:P},at(),Zt(k,St),fr().then(Wt)}}}function ge(){return ke.apply(this,arguments)}function ke(){return(ke=$t(Pe().mark(function me(){var Be;return Pe().wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,fr();case 2:a&&(Be=wt(),q("updateTheme",{dark:Be}),a.dispatch({effects:[R.reconfigure(Ze.theme({},{dark:Be}))]}));case 3:case"end":return St.stop()}},me)}))).apply(this,arguments)}function Re(me){var Be=Eh.of(typeof me=="number"?" ".repeat(me):me);return me===" "?[Be]:[Be,VD]}function at(){t(12,J=H9(a.state)>0),t(13,he=U9(a.state)>0),q({canUndo:J,canRedo:he})}Mi(function(){Xt()}),G0({onMount:Hi,onDestroy:Mi,getWindow:function(){return Ql(s)},hasFocus:function(){return Qe&&document.hasFocus()||q0(s)},onFocus:F,onBlur:function(){Xt(),I()}});var rt=ud(se,300);function Xt(){rt.flush()}function Zt(me,Be){w&&w(me,Be,{contentErrors:Mn(),patchResult:null})}function Wt(){S(fe({type:_n.text},l.selection.toJSON()))}function Ge(me,Be){return!!me&&me.length>Og&&!Be}var On=Up,zn=null;function Pt(){if(Ge(P,Y))return[];var me=Mn();return Ww(me)?[Cx(Xe(me.parseError,me.isRepairable))]:hU(me)?me.validationErrors.map(Oe).map(Cx):[]}function Mn(){q("validate:start"),Xt();var me=Dn(r.escapeValue(P),y,b,j);return Ww(me)?(t(52,On=me.isRepairable?b2:"invalid"),t(14,zn=me.parseError),t(10,T=[])):(t(52,On=Up),t(14,zn=null),t(10,T=(me==null?void 0:me.validationErrors)||[])),q("validate:end"),me}var Dn=wu(YH);function er(){zn&&function(me){q("select parse error",me);var Be=Xe(me,!1);Ht(Be.from!=null?Be.from:0,Be.to!=null?Be.to:0),ae()}(zn)}var fn={icon:mT,text:"Show me",title:"Move to the parse error location",onClick:er};return n.$$set=function(me){"readOnly"in me&&t(1,c=me.readOnly),"mainMenuBar"in me&&t(2,u=me.mainMenuBar),"statusBar"in me&&t(3,f=me.statusBar),"askToFormat"in me&&t(0,d=me.askToFormat),"externalContent"in me&&t(30,h=me.externalContent),"externalSelection"in me&&t(31,p=me.externalSelection),"indentation"in me&&t(32,m=me.indentation),"tabSize"in me&&t(33,v=me.tabSize),"escapeUnicodeCharacters"in me&&t(34,g=me.escapeUnicodeCharacters),"parser"in me&&t(35,b=me.parser),"validator"in me&&t(36,y=me.validator),"validationParser"in me&&t(37,j=me.validationParser),"onChange"in me&&t(38,w=me.onChange),"onChangeMode"in me&&t(39,$=me.onChangeMode),"onSelect"in me&&t(40,S=me.onSelect),"onError"in me&&t(41,_=me.onError),"onFocus"in me&&t(42,F=me.onFocus),"onBlur"in me&&t(43,I=me.onBlur),"onRenderMenu"in me&&t(4,W=me.onRenderMenu),"onSortModal"in me&&t(44,D=me.onSortModal),"onTransformModal"in me&&t(45,U=me.onTransformModal)},n.$$.update=function(){8&n.$$.dirty[1]&&(r=z0({escapeControlCharacters:!1,escapeUnicodeCharacters:g})),1073741824&n.$$.dirty[0]&&nn(h,!1,!1),1&n.$$.dirty[1]&&function(me){if(L2(me)){var Be=L(me);!a||!Be||l&&l.selection.eq(Be)||(q("applyExternalSelection",Be),a.dispatch({selection:Be}))}}(p),32&n.$$.dirty[1]&&function(me){q("updateLinter",me),a&&a.dispatch({effects:B.reconfigure(Dt())})}(y),2&n.$$.dirty[1]&&function(me){a&&(q("updateIndentation",me),a.dispatch({effects:A.reconfigure(Re(me))}))}(m),4&n.$$.dirty[1]&&function(me){a&&(q("updateTabSize",me),a.dispatch({effects:te.reconfigure(vn.tabSize.of(me))}))}(v),2&n.$$.dirty[0]&&function(me){a&&(q("updateReadOnly",me),a.dispatch({effects:[O.reconfigure(vn.readOnly.of(me))]}))}(c),1048584&n.$$.dirty[1]&&H!==g&&(t(51,H=g),q("forceUpdateText",{escapeUnicodeCharacters:g}),a&&a.dispatch({changes:{from:0,to:a.state.doc.length,insert:r.escapeValue(P)}})),2&n.$$.dirty[0]|2097152&n.$$.dirty[1]&&t(15,i=On!==b2||c?[fn]:[{icon:xh,text:"Auto repair",title:"Automatically repair JSON",onClick:oe},fn])},[d,c,u,f,W,ae,o,s,l,Y,T,P,J,he,zn,i,K,tn,Qt,function(){var me;if(!c)try{var Be=b.parse(P);Qe=!0,D({id:Se,json:Be,rootPath:[],onSort:(me=$t(Pe().mark(function St(Lt){var _t;return Pe().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:_t=Lt.operations,q("onSort",_t),et(_t,!0);case 3:case"end":return Yt.stop()}},St)})),function(St){return me.apply(this,arguments)}),onClose:function(){Qe=!1,ae()}})}catch(St){_(St)}},function(){c||st({rootPath:[]})},function(){a&&(o&&o.querySelector(".cm-search")?Hv(a):Vv(a))},function(){c||a&&(Iv(a),ae())},function(){c||a&&(Cd(a),ae())},function(){t(9,Y=!0),nn(h,!0,!0)},function(){$(Dr.tree)},function(){se()},function(me){q("select validation error",me);var Be=Oe(me),St=Be.from,Lt=Be.to;St!==null&&Lt!==null&&(Ht(St,Lt),ae())},Ge,er,h,p,m,v,g,b,y,j,w,$,S,_,F,I,D,U,function(me){return et(me,!1)},et,st,function(){return ne.apply(this,arguments)},Mn,H,On,function(me){It[me?"unshift":"push"](function(){t(6,o=me)})},function(){return t(0,d=!1)},function(me){It[me?"unshift":"push"](function(){t(7,s=me)})}]}i1.style=function(n){return TK(n||[])};var DK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,IK,NK,Tt,{readOnly:1,mainMenuBar:2,statusBar:3,askToFormat:0,externalContent:30,externalSelection:31,indentation:32,tabSize:33,escapeUnicodeCharacters:34,parser:35,validator:36,validationParser:37,onChange:38,onChangeMode:39,onSelect:40,onError:41,onFocus:42,onBlur:43,onRenderMenu:4,onSortModal:44,onTransformModal:45,focus:5,patch:46,handlePatch:47,openTransformModal:48,refresh:49,validate:50},PK,[-1,-1,-1,-1]),r}return ht(e,mt),ut(e,[{key:"focus",get:function(){return this.$$.ctx[5]}},{key:"patch",get:function(){return this.$$.ctx[46]}},{key:"handlePatch",get:function(){return this.$$.ctx[47]}},{key:"openTransformModal",get:function(){return this.$$.ctx[48]}},{key:"refresh",get:function(){return this.$$.ctx[49]}},{key:"validate",get:function(){return this.$$.ctx[50]}}])}();function LK(n){var e,t;return e=new rp({props:{items:n[0]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};1&At(i,1)[0]&&(o.items=r[0]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function BK(n,e,t){var r,i,o=e.containsValidArray,s=e.readOnly,a=e.showSearch,l=a!==void 0&&a,c=e.historyState,u=e.onSort,f=e.onTransform,d=e.onContextMenu,h=e.onUndo,p=e.onRedo,m=e.onRenderMenu;function v(){t(1,l=!l)}return n.$$set=function(g){"containsValidArray"in g&&t(2,o=g.containsValidArray),"readOnly"in g&&t(3,s=g.readOnly),"showSearch"in g&&t(1,l=g.showSearch),"historyState"in g&&t(4,c=g.historyState),"onSort"in g&&t(5,u=g.onSort),"onTransform"in g&&t(6,f=g.onTransform),"onContextMenu"in g&&t(7,d=g.onContextMenu),"onUndo"in g&&t(8,h=g.onUndo),"onRedo"in g&&t(9,p=g.onRedo),"onRenderMenu"in g&&t(10,m=g.onRenderMenu)},n.$$.update=function(){1020&n.$$.dirty&&t(11,r=s?[{type:"space"}]:[{type:"button",icon:$h,title:"Sort",className:"jse-sort",onClick:u,disabled:s||!o},{type:"button",icon:jh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:f,disabled:s||!o},{type:"button",icon:kh,title:"Search (Ctrl+F)",className:"jse-search",onClick:v,disabled:!o},{type:"button",icon:ek,title:D0,className:"jse-contextmenu",onClick:d},{type:"separator"},{type:"button",icon:hv,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:h,disabled:!c.canUndo},{type:"button",icon:dv,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:p,disabled:!c.canRedo},{type:"space"}]),3072&n.$$.dirty&&t(0,i=m(r))},[i,l,o,s,c,u,f,d,h,p,m,r]}var zK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,BK,LK,Tt,{containsValidArray:2,readOnly:3,showSearch:1,historyState:4,onSort:5,onTransform:6,onContextMenu:7,onUndo:8,onRedo:9,onRenderMenu:10}),r}return ht(e,mt),ut(e)}();function Ox(n,e,t){var r=n.slice();return r[9]=e[t],r}function FK(n){var e,t,r=n[9].component,i=Mx(n);return{c:function(){i.c(),e=an()},m:function(o,s){i.m(o,s),ee(o,e,s),t=!0},p:function(o,s){1&s&&Tt(r,r=o[9].component)?(Ee(),M(i,1,1,Te),Ae(),(i=Mx(o)).c(),C(i,1),i.m(e.parentNode,e)):i.p(o,s)},i:function(o){t||(C(i),t=!0)},o:function(o){M(i),t=!1},d:function(o){o&&Z(e),i.d(o)}}}function qK(n){var e,t=n[9].action,r=Ex(n);return{c:function(){r.c(),e=an()},m:function(i,o){r.m(i,o),ee(i,e,o)},p:function(i,o){1&o&&Tt(t,t=i[9].action)?(r.d(1),(r=Ex(i)).c(),r.m(e.parentNode,e)):r.p(i,o)},i:Te,o:Te,d:function(i){i&&Z(e),r.d(i)}}}function Mx(n){var e,t,r,i=[n[9].props],o=n[9].component;function s(a,l){for(var c={},u=0;u0){for(var b=[v],y=on(g);y.length>0&&!Ii(m,y);)b.unshift({op:"add",path:Ue(y),value:{}}),y=on(y);return b}}return v})}(d,a.getJson()),h)}return n.$$set=function(d){"path"in d&&t(1,o=d.path),"value"in d&&t(2,s=d.value),"context"in d&&t(3,a=d.context),"enforceString"in d&&t(4,l=d.enforceString),"selection"in d&&t(5,c=d.selection),"searchResultItems"in d&&t(6,u=d.searchResultItems)},n.$$.update=function(){40&n.$$.dirty&&t(7,r=!a.readOnly&&rn(c)&&Xr(c)),254&n.$$.dirty&&t(0,i=a.onRenderValue({path:o,value:s,readOnly:a.readOnly,enforceString:l,isEditing:r,parser:a.parser,normalization:a.normalization,selection:c,searchResultItems:u,onPatch:f,onPasteJson:a.onPasteJson,onSelect:a.onSelect,onFind:a.onFind,findNextInside:a.findNextInside,focus:a.focus}))},[i,o,s,a,l,c,u,r]}var UK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,HK,VK,Tt,{path:1,value:2,context:3,enforceString:4,selection:5,searchResultItems:6}),r}return ht(e,mt),ut(e)}();function WK(n){Et(n,"svelte-1dhomzn",'.jse-inline-value.svelte-1dhomzn{font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);line-height:var(--jse-line-height, calc(1em + 4px));border:none;padding:0 calc(0.5 * var(--jse-padding, 10px));background:transparent;color:inherit;cursor:pointer}.jse-inline-value.svelte-1dhomzn:hover{background:var(--jse-hover-background-color, rgba(0, 0, 0, 0.06))}.jse-inline-value.jse-selected.svelte-1dhomzn{background:var(--jse-selection-background-color, #d3d3d3)}.jse-inline-value.jse-highlight.svelte-1dhomzn{background-color:var(--jse-search-match-color, #ffe665);outline:var(--jse-search-match-outline, 1px solid #ffd700)}.jse-inline-value.jse-highlight.jse-active.svelte-1dhomzn{background-color:var(--jse-search-match-active-color, #ffd700);outline:var(--jse-search-match-active-outline, 1px solid #e1be00)}')}function JK(n){var e,t,r,i,o,s=as((e=n[2].stringify(n[1]))!==null&&e!==void 0?e:"",50)+"";return{c:function(){t=V("button"),r=De(s),x(t,"type","button"),x(t,"class","jse-inline-value svelte-1dhomzn"),$e(t,"jse-selected",n[3]),$e(t,"jse-highlight",n[4]),$e(t,"jse-active",n[5])},m:function(a,l){ee(a,t,l),E(t,r),i||(o=Ce(t,"dblclick",n[7]),i=!0)},p:function(a,l){var c,u=At(l,1)[0];6&u&&s!==(s=as((c=a[2].stringify(a[1]))!==null&&c!==void 0?c:"",50)+"")&>(r,s),8&u&&$e(t,"jse-selected",a[3]),16&u&&$e(t,"jse-highlight",a[4]),32&u&&$e(t,"jse-active",a[5])},i:Te,o:Te,d:function(a){a&&Z(t),i=!1,o()}}}function KK(n,e,t){var r=e.path,i=e.value,o=e.parser,s=e.isSelected,a=e.containsSearchResult,l=e.containsActiveSearchResult,c=e.onEdit;return n.$$set=function(u){"path"in u&&t(0,r=u.path),"value"in u&&t(1,i=u.value),"parser"in u&&t(2,o=u.parser),"isSelected"in u&&t(3,s=u.isSelected),"containsSearchResult"in u&&t(4,a=u.containsSearchResult),"containsActiveSearchResult"in u&&t(5,l=u.containsActiveSearchResult),"onEdit"in u&&t(6,c=u.onEdit)},[r,i,o,s,a,l,c,function(){return c(r)}]}var GK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,KK,JK,Tt,{path:0,value:1,parser:2,isSelected:3,containsSearchResult:4,containsActiveSearchResult:5,onEdit:6},WK),r}return ht(e,mt),ut(e)}();function QK(n){Et(n,"svelte-2v0aqj",".jse-column-header.svelte-2v0aqj.svelte-2v0aqj{background:none;border:none;font-family:inherit;font-size:inherit;color:inherit;display:flex;gap:var(--jse-padding, 10px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px));width:100%}.jse-column-header.svelte-2v0aqj.svelte-2v0aqj:hover{background:var(--jse-table-header-background-highlight, #e8e8e8)}.jse-column-header.svelte-2v0aqj.svelte-2v0aqj:not(.jse-column-header.jse-readonly){cursor:pointer}.jse-column-header.svelte-2v0aqj span.jse-column-sort-icon.svelte-2v0aqj{height:1em}")}function Tx(n){var e,t,r,i;return t=new un({props:{data:n[1]===Bi.asc?Ri:K1}}),{c:function(){e=V("span"),xe(t.$$.fragment),x(e,"class","jse-column-sort-icon svelte-2v0aqj"),x(e,"title",r="Currently sorted in ".concat(n[2]," order"))},m:function(o,s){ee(o,e,s),be(t,e,null),i=!0},p:function(o,s){var a={};2&s&&(a.data=o[1]===Bi.asc?Ri:K1),t.$set(a),(!i||4&s&&r!==(r="Currently sorted in ".concat(o[2]," order")))&&x(e,"title",r)},i:function(o){i||(C(t.$$.fragment,o),i=!0)},o:function(o){M(t.$$.fragment,o),i=!1},d:function(o){o&&Z(e),we(t)}}}function YK(n){var e,t,r,i,o,s,a,l,c=as(n[3],50)+"",u=n[1]!==void 0&&Tx(n);return{c:function(){e=V("button"),t=V("span"),r=De(c),i=ce(),u&&u.c(),x(t,"class","jse-column-name"),x(e,"type","button"),x(e,"class","jse-column-header svelte-2v0aqj"),x(e,"title",o=n[0]?n[3]:n[3]+" (Click to sort the data by this column)"),$e(e,"jse-readonly",n[0])},m:function(f,d){ee(f,e,d),E(e,t),E(t,r),E(e,i),u&&u.m(e,null),s=!0,a||(l=Ce(e,"click",n[4]),a=!0)},p:function(f,d){var h=At(d,1)[0];(!s||8&h)&&c!==(c=as(f[3],50)+"")&>(r,c),f[1]!==void 0?u?(u.p(f,h),2&h&&C(u,1)):((u=Tx(f)).c(),C(u,1),u.m(e,null)):u&&(Ee(),M(u,1,1,function(){u=null}),Ae()),(!s||9&h&&o!==(o=f[0]?f[3]:f[3]+" (Click to sort the data by this column)"))&&x(e,"title",o),(!s||1&h)&&$e(e,"jse-readonly",f[0])},i:function(f){s||(C(u),s=!0)},o:function(f){M(u),s=!1},d:function(f){f&&Z(e),u&&u.d(),a=!1,l()}}}function XK(n,e,t){var r,i,o,s=e.path,a=e.sortedColumn,l=e.readOnly,c=e.onSort;return n.$$set=function(u){"path"in u&&t(5,s=u.path),"sortedColumn"in u&&t(6,a=u.sortedColumn),"readOnly"in u&&t(0,l=u.readOnly),"onSort"in u&&t(7,c=u.onSort)},n.$$.update=function(){var u;32&n.$$.dirty&&t(3,r=hn(s)?"values":mi(s)),96&n.$$.dirty&&t(1,i=a&&sn(s,(u=a)===null||u===void 0?void 0:u.path)?a.sortDirection:void 0),2&n.$$.dirty&&t(2,o=i?iq[i]:void 0)},[l,i,o,r,function(){l||c({path:s,sortDirection:i===Bi.asc?Bi.desc:Bi.asc})},s,a,c]}var Bf,zf,ZK=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,XK,YK,Tt,{path:5,sortedColumn:6,readOnly:0,onSort:7},QK),r}return ht(e,mt),ut(e)}();function g6(n,e){return Bf||(zf=new WeakMap,Bf=new ResizeObserver(function(t){var r,i=au(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=zf.get(o.target);s&&s(o.target)}}catch(a){i.e(a)}finally{i.f()}})),zf.set(n,e),Bf.observe(n),{destroy:function(){zf.delete(n),Bf.unobserve(n)}}}function eG(n){Et(n,"svelte-fxr3ye",'.jse-table-mode-welcome.svelte-fxr3ye.svelte-fxr3ye{flex:1;display:flex;flex-direction:column;overflow:auto;align-items:center;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode-welcome.svelte-fxr3ye.svelte-fxr3ye:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode-welcome.svelte-fxr3ye .jse-space.jse-before.svelte-fxr3ye{flex:1}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays.svelte-fxr3ye{display:flex;flex-direction:column;gap:var(--jse-padding, 10px);max-width:300px;margin:2em var(--jse-padding, 10px);font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays .jse-nested-arrays-info.svelte-fxr3ye{color:var(--jse-panel-color-readonly, #b2b2b2)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);padding:5px;margin:0;background:var(--jse-button-primary-background, var(--jse-theme-color, #3883fa));color:var(--jse-button-primary-color, #fff);padding:var(--jse-padding, 10px) calc(2 * var(--jse-padding, 10px));border-radius:3px;text-align:left}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye:hover{background:var(--jse-button-primary-background-highlight, var(--jse-theme-color-highlight, #5f9dff))}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action.svelte-fxr3ye:disabled{background:var(--jse-button-primary-background-disabled, #9d9d9d)}.jse-table-mode-welcome.svelte-fxr3ye .jse-nested-arrays button.jse-nested-array-action .jse-nested-array-count.svelte-fxr3ye{opacity:0.5;white-space:nowrap}.jse-table-mode-welcome.svelte-fxr3ye .jse-space.jse-after.svelte-fxr3ye{flex:2}')}function Px(n,e,t){var r=n.slice();r[16]=e[t];var i=r[9](r[16]);return r[17]=i,r}function tG(n){var e,t;return{c:function(){e=De(n[7]),t=De(" cannot be opened in table mode.")},m:function(r,i){ee(r,e,i),ee(r,t,i)},p:function(r,i){128&i&>(e,r[7])},d:function(r){r&&(Z(e),Z(t))}}}function nG(n){var e;return{c:function(){e=De(`An object cannot be opened in table mode. You can open a nested array instead, or open the + document in tree mode.`)},m:function(t,r){ee(t,e,r)},p:Te,d:function(t){t&&Z(e)}}}function rG(n){var e;return{c:function(){e=De("You can open the document in tree mode instead.")},m:function(t,r){ee(t,e,r)},d:function(t){t&&Z(e)}}}function iG(n){var e,t,r;return{c:function(){e=De("You can open the document in tree mode instead, or paste a JSON Array using "),(t=V("b")).textContent="Ctrl+V",r=De(".")},m:function(i,o){ee(i,e,o),ee(i,t,o),ee(i,r,o)},d:function(i){i&&(Z(e),Z(t),Z(r))}}}function _x(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p=mi(n[16])+"",m=n[17]+"",v=n[17]!==1?"items":"item";function g(){return n[13](n[16])}return{c:function(){e=V("button"),t=De(n[8]),r=De(' "'),i=De(p),o=De(`" + `),s=V("span"),a=De("("),l=De(m),c=ce(),u=De(v),f=De(")"),x(s,"class","jse-nested-array-count svelte-fxr3ye"),x(e,"type","button"),x(e,"class","jse-nested-array-action svelte-fxr3ye")},m:function(b,y){ee(b,e,y),E(e,t),E(e,r),E(e,i),E(e,o),E(e,s),E(s,a),E(s,l),E(s,c),E(s,u),E(s,f),d||(h=Ce(e,"click",g),d=!0)},p:function(b,y){n=b,256&y&>(t,n[8]),16&y&&p!==(p=mi(n[16])+"")&>(i,p),16&y&&m!==(m=n[17]+"")&>(l,m),16&y&&v!==(v=n[17]!==1?"items":"item")&>(u,v)},d:function(b){b&&Z(e),d=!1,h()}}}function oG(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b;function y(D,U){return D[6]?nG:tG}var j=y(n),w=j(n);function $(D,U){return D[5]&&!D[0]?iG:rG}for(var S=$(n),_=S(n),F=Mt(n[4]),I=[],W=0;W1&&arguments[1]!==void 0?arguments[1]:2,g=[];return function b(y,j){Gn(y)&&j.length0}):[]),16&n.$$.dirty&&t(6,i=!hn(a)),3072&n.$$.dirty&&t(5,o=c===void 0&&(l===""||l===void 0)),6240&n.$$.dirty&&t(7,s=i?"Object with nested arrays":o?"An empty document":Gn(c)?"An object":Nn(c)?"An empty array":"A ".concat(B0(c,f)))},[u,d,h,p,a,o,i,s,r,function(m){return Ye(c,m).length},l,c,f,function(m){return d(m)},function(){return h(Dr.tree)},function(){return p()}]}var aG=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,sG,oG,Tt,{text:10,json:11,readOnly:0,parser:12,openJSONEditorModal:1,onChangeMode:2,onClick:3},eG),r}return ht(e,mt),ut(e)}();function lG(n){Et(n,"svelte-1nml1r3",".jse-column-header.svelte-1nml1r3{background:none;border:none;font-family:inherit;font-size:inherit;color:inherit;display:flex;gap:var(--jse-padding, 10px);padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px));width:100%}.jse-column-header.svelte-1nml1r3:hover{background:var(--jse-table-header-background-highlight, #e8e8e8)}.jse-column-header.svelte-1nml1r3:not(.jse-column-header.jse-readonly){cursor:pointer}")}function cG(n){var e,t,r,i,o,s;return t=new un({props:{data:MT}}),{c:function(){e=V("button"),xe(t.$$.fragment),x(e,"type","button"),x(e,"class","jse-column-header svelte-1nml1r3"),x(e,"title",r="The Columns are created by sampling ".concat(n[1]," items out of ").concat(n[0],". ")+"If you're missing a column, click here to sample all of the items instead of a subset. This is slower.")},m:function(a,l){ee(a,e,l),be(t,e,null),i=!0,o||(s=Ce(e,"click",n[3]),o=!0)},p:function(a,l){var c=At(l,1)[0];(!i||3&c&&r!==(r="The Columns are created by sampling ".concat(a[1]," items out of ").concat(a[0],". ")+"If you're missing a column, click here to sample all of the items instead of a subset. This is slower."))&&x(e,"title",r)},i:function(a){i||(C(t.$$.fragment,a),i=!0)},o:function(a){M(t.$$.fragment,a),i=!1},d:function(a){a&&Z(e),we(t),o=!1,s()}}}function uG(n,e,t){var r=e.count,i=e.maxSampleCount,o=e.onRefresh;return n.$$set=function(s){"count"in s&&t(0,r=s.count),"maxSampleCount"in s&&t(1,i=s.maxSampleCount),"onRefresh"in s&&t(2,o=s.onRefresh)},[r,i,o,function(){return o()}]}var fG=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,uG,cG,Tt,{count:0,maxSampleCount:1,onRefresh:2},lG),r}return ht(e,mt),ut(e)}();function dG(n){Et(n,"svelte-12ygzbc",'.jse-table-mode.svelte-12ygzbc.svelte-12ygzbc{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color, #fff);min-width:0;min-height:0;font-family:var(--jse-font-family-mono, consolas, menlo, monaco, "Ubuntu Mono", "source-code-pro", monospace);font-size:var(--jse-font-size-mono, 14px);color:var(--jse-text-color, #4d4d4d);line-height:var(--jse-line-height, calc(1em + 4px))}.jse-table-mode.no-main-menu.svelte-12ygzbc.svelte-12ygzbc{border-top:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-12ygzbc .jse-search-box-container.svelte-12ygzbc{position:relative;height:0;top:calc(var(--jse-line-height, calc(1em + 4px)) + 2 * var(--jse-padding, 10px));margin-right:calc(var(--jse-padding, 10px) + 20px);margin-left:var(--jse-padding, 10px);text-align:right;z-index:3}.jse-table-mode.svelte-12ygzbc .jse-hidden-input-label.svelte-12ygzbc{position:fixed;right:0;top:0;width:0;height:0}.jse-table-mode.svelte-12ygzbc .jse-hidden-input-label .jse-hidden-input.svelte-12ygzbc{width:0;height:0;padding:0;border:0;outline:none}.jse-table-mode.svelte-12ygzbc .jse-contents.svelte-12ygzbc{flex:1;align-items:flex-start;flex-direction:column;display:flex;overflow:auto;overflow-anchor:none;scrollbar-gutter:stable;border-left:var(--jse-main-border, 1px solid #d7d7d7);border-right:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-12ygzbc .jse-contents.svelte-12ygzbc:last-child{border-bottom:var(--jse-main-border, 1px solid #d7d7d7)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main.svelte-12ygzbc{border-collapse:collapse;border-spacing:0}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-invisible-start-section td.svelte-12ygzbc,.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-invisible-end-section td.svelte-12ygzbc{margin:0;padding:0}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-invisible-end-section td.svelte-12ygzbc{padding-bottom:var(--jse-padding, 10px)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row.svelte-12ygzbc:hover{background-color:var(--jse-table-row-odd-background, rgba(0, 0, 0, 0.05))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-12ygzbc{padding:0 var(--jse-padding, 10px) 0 0;vertical-align:top;white-space:nowrap;height:var(--jse-line-height, calc(1em + 4px))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header.svelte-12ygzbc,.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-gutter.svelte-12ygzbc{font-weight:normal;text-align:left;color:var(--jse-text-readonly, #8d8d8d);background:var(--jse-table-header-background, #f5f5f5)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header.svelte-12ygzbc{padding:0;position:sticky;top:0}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-header .jse-table-root-error.svelte-12ygzbc{padding:calc(0.5 * var(--jse-padding, 10px)) var(--jse-padding, 10px) calc(0.5 * var(--jse-padding, 10px)) calc(0.5 * var(--jse-padding, 10px))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-table-cell-gutter.svelte-12ygzbc{padding:0 var(--jse-padding, 10px) 0 calc(0.5 * var(--jse-padding, 10px))}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.jse-selected-value.svelte-12ygzbc>.jse-value{background:var(--jse-selection-background-color, #d3d3d3)}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell.svelte-12ygzbc div.jse-value{overflow-wrap:normal;white-space:nowrap;vertical-align:top;display:inline-block}.jse-table-mode.svelte-12ygzbc .jse-contents table.jse-table-main .jse-table-row .jse-table-cell .jse-context-menu-anchor.svelte-12ygzbc{display:inline-flex;position:relative;vertical-align:top}.jse-table-mode.svelte-12ygzbc .jse-contents.jse-contents-loading.svelte-12ygzbc{align-items:unset}.jse-table-mode.svelte-12ygzbc .jse-contents.jse-contents-loading .jse-loading-space.svelte-12ygzbc{flex:1}.jse-table-mode.svelte-12ygzbc .jse-contents.jse-contents-loading .jse-loading.svelte-12ygzbc{flex:2;text-align:center;color:var(--jse-panel-color-readonly, #b2b2b2);box-sizing:border-box;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px)}')}function Rx(n,e,t){var r,i,o,s=n.slice();s[132]=e[t],s[138]=t;var a=s[27].startIndex+s[138];s[133]=a;var l=s[26].rows[s[133]];s[134]=l;var c=e1([String(s[133])],(r=s[134])===null||r===void 0?void 0:r.row);s[135]=c;var u=(i=s[20])!==null&&i!==void 0&&i.itemsMap?Ei((o=s[20])===null||o===void 0?void 0:o.itemsMap,tv(s[133])):void 0;return s[136]=u,s}function Nx(n,e,t){var r,i=n.slice();i[139]=e[t],i[146]=t;var o=[String(i[133])].concat(i[139]);i[140]=o;var s=Ue(i[140]);i[141]=s;var a=Ye(i[132],i[139]);i[142]=a;var l=rn(i[12].selection)&&cs(i[12].selection.path,i[140]);i[143]=l;var c=(r=i[134])===null||r===void 0?void 0:r.columns[i[146]];i[144]=c;var u=e1(i[140],i[144]);return i[135]=u,i}function Ix(n,e,t){var r=n.slice();return r[139]=e[t],r}function im(n){var e,t=n.slice(),r=e1([],(e=t[26])===null||e===void 0?void 0:e.root);return t[135]=r,t}function Dx(n){var e,t,r;function i(s){n[79](s)}var o={containsValidArray:n[22],readOnly:n[0],historyState:n[24],onSort:n[47],onTransform:n[48],onUndo:n[49],onRedo:n[50],onContextMenu:n[39],onRenderMenu:n[5]};return n[9]!==void 0&&(o.showSearch=n[9]),e=new zK({props:o}),It.push(function(){return oi(e,"showSearch",i)}),{c:function(){xe(e.$$.fragment)},m:function(s,a){be(e,s,a),r=!0},p:function(s,a){var l={};4194304&a[0]&&(l.containsValidArray=s[22]),1&a[0]&&(l.readOnly=s[0]),16777216&a[0]&&(l.historyState=s[24]),32&a[0]&&(l.onRenderMenu=s[5]),!t&&512&a[0]&&(t=!0,l.showSearch=s[9],ii(function(){return t=!1})),e.$set(l)},i:function(s){r||(C(e.$$.fragment,s),r=!0)},o:function(s){M(e.$$.fragment,s),r=!1},d:function(s){we(e,s)}}}function hG(n){var e;return{c:function(){(e=V("div")).innerHTML='
loading...
',x(e,"class","jse-contents jse-contents-loading svelte-12ygzbc")},m:function(t,r){ee(t,e,r)},p:Te,i:Te,o:Te,d:function(t){t&&Z(e)}}}function pG(n){var e,t,r,i,o,s,a,l,c,u=[vG,gG,mG],f=[];function d(h,p){return h[22]?0:h[18]&&h[17]!==void 0&&h[17]!==""?1:2}return i=d(n),o=f[i]=u[i](n),{c:function(){e=V("label"),t=V("input"),r=ce(),o.c(),s=an(),x(t,"type","text"),t.readOnly=!0,x(t,"tabindex","-1"),x(t,"class","jse-hidden-input svelte-12ygzbc"),x(e,"class","jse-hidden-input-label svelte-12ygzbc")},m:function(h,p){ee(h,e,p),E(e,t),n[80](t),ee(h,r,p),f[i].m(h,p),ee(h,s,p),a=!0,l||(c=Ce(t,"paste",n[44]),l=!0)},p:function(h,p){var m=i;(i=d(h))===m?f[i].p(h,p):(Ee(),M(f[m],1,1,function(){f[m]=null}),Ae(),(o=f[i])?o.p(h,p):(o=f[i]=u[i](h)).c(),C(o,1),o.m(s.parentNode,s))},i:function(h){a||(C(o),a=!0)},o:function(h){M(o),a=!1},d:function(h){h&&(Z(e),Z(r),Z(s)),n[80](null),f[i].d(h),l=!1,c()}}}function mG(n){var e,t;return e=new aG({props:{text:n[17],json:n[8],readOnly:n[0],parser:n[2],openJSONEditorModal:n[46],onChangeMode:n[4],onClick:n[84]}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};131072&i[0]&&(o.text=r[17]),256&i[0]&&(o.json=r[8]),1&i[0]&&(o.readOnly=r[0]),4&i[0]&&(o.parser=r[2]),16&i[0]&&(o.onChangeMode=r[4]),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function gG(n){var e,t,r,i;return e=new po({props:{type:"error",message:"The loaded JSON document is invalid and could not be repaired automatically.",actions:n[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:n[42]}]}}),r=new h6({props:{text:n[17],json:n[8],indentation:n[3],parser:n[2]}}),{c:function(){xe(e.$$.fragment),t=ce(),xe(r.$$.fragment)},m:function(o,s){be(e,o,s),ee(o,t,s),be(r,o,s),i=!0},p:function(o,s){var a={};1&s[0]&&(a.actions=o[0]?[]:[{icon:Ls,text:"Repair manually",title:'Open the document in "code" mode and repair it manually',onClick:o[42]}]),e.$set(a);var l={};131072&s[0]&&(l.text=o[17]),256&s[0]&&(l.json=o[8]),8&s[0]&&(l.indentation=o[3]),4&s[0]&&(l.parser=o[2]),r.$set(l)},i:function(o){i||(C(e.$$.fragment,o),C(r.$$.fragment,o),i=!0)},o:function(o){M(e.$$.fragment,o),M(r.$$.fragment,o),i=!1},d:function(o){o&&Z(t),we(e,o),we(r,o)}}}function vG(n){var e,t,r,i,o,s,a,l,c,u,f,d,h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D=!hn((e=n[26])===null||e===void 0?void 0:e.root);r=new o6({props:{json:n[8],documentState:n[12],parser:n[2],showSearch:n[9],showReplace:n[21],readOnly:n[0],columns:n[11],onSearch:n[30],onFocus:n[31],onPatch:n[34],onClose:n[32]}});for(var U=D&&Lx(im(n)),q=Mt(n[11]),X=[],K=0;K1&&arguments[1]!==void 0)||arguments[1],Ie=ae?wl:0,ze=Kj(Q,oe,Ht,pc),Fe=ze-Dt+Ie+pc,kt=me(Q);if(s("scrollTo",{path:Q,top:ze,scrollTop:Dt,elem:kt}),!g)return Promise.resolve();var zt=g.getBoundingClientRect();if(kt&&!ve){var Kt=kt.getBoundingClientRect();if(Kt.bottom>zt.top&&Kt.topIe.right){var Fe=ze.right-Ie.right;t(15,g.scrollLeft+=Fe,g)}if(ze.leftKt){var z=Fe-Kt;t(15,g.scrollTop+=z,g)}if(ze0&&Ie[0]!==void 0)||Ie[0],y!==void 0){ze.next=3;break}return ze.abrupt("return");case 3:return ze.next=5,c6({json:y,documentState:Oe,indentation:ve?K:void 0,parser:D});case 5:case"end":return ze.stop()}},Q)})),ie.apply(this,arguments)}function ue(){f6({json:y,text:j,documentState:Oe,keepSelection:!0,readOnly:w,onChange:Y,onPatch:Zt})}function ye(){pJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function it(){mJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function vt(){gJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function Nt(){vJ({json:y,documentState:Oe,columns:oe,readOnly:w,onPatch:Zt})}function bn(){return(bn=$t(Pe().mark(function Q(ve){return Pe().wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,d6({char:ve,selectInside:!1,refJsonEditor:v,json:y,selection:Oe.selection,readOnly:w,parser:D,onPatch:Zt,onReplaceJson:En,onSelect:He});case 2:case"end":return Ie.stop()}},Q)}))).apply(this,arguments)}function En(Q,ve){var Ie=Oe,ze=y,Fe=j,kt={json:y,text:j},zt=Xe,Kt=Ti(y,Oe,[],So),z=typeof ve=="function"?ve(Q,Kt):void 0;t(8,y=z&&z.json!==void 0?z.json:Q),t(12,Oe=z&&z.state!==void 0?z.state:Kt),t(17,j=void 0),t(23,Xe=!1),t(18,pe=void 0),wt(y),ge({previousJson:ze,previousState:Ie,previousText:Fe,previousTextIsRepaired:zt}),Wt(kt,null)}function Bt(Q,ve){s("handleChangeText");var Ie=Oe,ze=y,Fe=j,kt={json:y,text:j},zt=Xe;try{t(8,y=U(Q)),t(12,Oe=Ti(y,Oe,[],So)),t(17,j=void 0),t(23,Xe=!1),t(18,pe=void 0)}catch(z){try{t(8,y=U(Ao(Q))),t(12,Oe=Ti(y,Oe,[],So)),t(17,j=Q),t(23,Xe=!0),t(18,pe=void 0)}catch{t(8,y=void 0),t(12,Oe=Yd({json:y,expand:So})),t(17,j=Q),t(23,Xe=!1),t(18,pe=j!==""?Nl(j,z.message||String(z)):void 0)}}if(typeof ve=="function"){var Kt=ve(y,Oe);t(8,y=Kt&&Kt.json?Kt.json:y),t(12,Oe=Kt&&Kt.state?Kt.state:Oe)}wt(y),ge({previousJson:ze,previousState:Ie,previousText:Fe,previousTextIsRepaired:zt}),Wt(kt,null)}function ln(Q){if(y!==void 0){var ve=Q.id,Ie=Q.onTransform,ze=Q.onClose,Fe=Q.rootPath||[];st=!0,H({id:ve||h,json:y,rootPath:Fe||[],onTransform:function(kt){Ie?Ie({operations:kt,json:y,transformedJson:ro(y,kt)}):(s("onTransform",Fe,kt),Zt(kt))},onClose:function(){st=!1,Pt(),ze&&ze()}})}}function Jt(Q){s("openJSONEditorModal",{path:Q}),st=!0,J({content:{json:Ye(y,Q)},path:Q,onPatch:nn.onPatch,onClose:function(){st=!1,Pt()}})}function Ot(Q,ve){a(n6,{text:Q,onParse:function(Ie){return Jh(Ie,function(ze){return _u(ze,D)})},onRepair:c4,onApply:ve},fe(fe({},Ta),{},{styleWindow:{width:"600px",height:"500px"},styleContent:{padding:0,height:"100%"}}),{onClose:function(){return Pt()}})}function Sn(Q){s("openFind",{findAndReplace:Q}),t(9,ae=!1),t(21,Qe=!1),fr().then(function(){t(9,ae=!0),t(21,Qe=Q)})}function An(){if(!w&&L.getState().canUndo){var Q=L.undo();if(Q){var ve={json:y,text:j};t(8,y=Q.undo.patch?ro(y,Q.undo.patch):Q.undo.json),t(12,Oe=Q.undo.state),t(17,j=Q.undo.text),t(23,Xe=Q.undo.textIsRepaired),t(18,pe=void 0),s("undo",{item:Q,json:y}),Wt(ve,Q.undo.patch&&Q.redo.patch?{json:y,previousJson:ve.json,redo:Q.undo.patch,undo:Q.redo.patch}:null),Pt(),Oe.selection&&Dn(lt(Oe.selection),!1)}}}function jn(){if(!w&&L.getState().canRedo){var Q=L.redo();if(Q){var ve={json:y,text:j};t(8,y=Q.redo.patch?ro(y,Q.redo.patch):Q.redo.json),t(12,Oe=Q.redo.state),t(17,j=Q.redo.text),t(23,Xe=Q.redo.textIsRepaired),t(18,pe=void 0),s("redo",{item:Q,json:y}),Wt(ve,Q.undo.patch&&Q.redo.patch?{json:y,previousJson:ve.json,redo:Q.redo.patch,undo:Q.undo.patch}:null),Pt(),Oe.selection&&Dn(lt(Oe.selection),!1)}}}function Ar(Q,ve){t(76,Ht[ve]=Q.getBoundingClientRect().height,Ht)}return n.$$set=function(Q){"readOnly"in Q&&t(0,w=Q.readOnly),"externalContent"in Q&&t(53,$=Q.externalContent),"externalSelection"in Q&&t(54,S=Q.externalSelection),"mainMenuBar"in Q&&t(1,_=Q.mainMenuBar),"escapeControlCharacters"in Q&&t(55,F=Q.escapeControlCharacters),"escapeUnicodeCharacters"in Q&&t(56,I=Q.escapeUnicodeCharacters),"flattenColumns"in Q&&t(57,W=Q.flattenColumns),"parser"in Q&&t(2,D=Q.parser),"parseMemoizeOne"in Q&&t(58,U=Q.parseMemoizeOne),"validator"in Q&&t(59,q=Q.validator),"validationParser"in Q&&t(60,X=Q.validationParser),"indentation"in Q&&t(3,K=Q.indentation),"onChange"in Q&&t(61,Y=Q.onChange),"onChangeMode"in Q&&t(4,T=Q.onChangeMode),"onSelect"in Q&&t(62,B=Q.onSelect),"onRenderValue"in Q&&t(63,O=Q.onRenderValue),"onRenderMenu"in Q&&t(5,A=Q.onRenderMenu),"onRenderContextMenu"in Q&&t(64,te=Q.onRenderContextMenu),"onFocus"in Q&&t(65,R=Q.onFocus),"onBlur"in Q&&t(66,k=Q.onBlur),"onSortModal"in Q&&t(67,P=Q.onSortModal),"onTransformModal"in Q&&t(68,H=Q.onTransformModal),"onJSONEditorModal"in Q&&t(69,J=Q.onJSONEditorModal)},n.$$.update=function(){50331648&n.$$.dirty[1]&&t(75,m=z0({escapeControlCharacters:F,escapeUnicodeCharacters:I})),512&n.$$.dirty[0]&&function(Q){if(g){var ve=Q?wl:-100;g.scrollTo({top:t(15,g.scrollTop+=ve,g),left:g.scrollLeft})}}(ae),4194304&n.$$.dirty[1]&&se($),8388608&n.$$.dirty[1]&&function(Q){sn(Oe.selection,Q)||(s("applyExternalSelection",Q),(U0(Q)||Q===null)&&He(Q))}(S),3328&n.$$.dirty[0]|67108864&n.$$.dirty[1]&&t(11,oe=Nn(y)?function(Q,ve){var Ie,ze=new Set(ve.map(Ue)),Fe=new Set(Q.map(Ue)),kt=au(ze);try{for(kt.s();!(Ie=kt.n()).done;){var zt=Ie.value;Fe.has(zt)||ze.delete(zt)}}catch(je){kt.e(je)}finally{kt.f()}var Kt,z=au(Fe);try{for(z.s();!(Kt=z.n()).done;){var le=Kt.value;ze.has(le)||ze.add(le)}}catch(je){z.e(je)}finally{z.f()}return Vt(ze).map(ao)}(cJ(y,W,Qt),oe):[]),2304&n.$$.dirty[0]&&t(22,tn=!(!y||hn(oe))),1280&n.$$.dirty[0]&&t(28,r=Array.isArray(y)&&y.length>Qt),768&n.$$.dirty[0]|114688&n.$$.dirty[2]&&t(27,i=uJ(Dt,qe,y,Ht,pc,ae?wl:0)),256&n.$$.dirty[0]&&g&&g.scrollTo({top:g.scrollTop,left:g.scrollLeft}),4357&n.$$.dirty[0]|8194&n.$$.dirty[2]&&t(25,nn={readOnly:w,parser:D,normalization:m,getJson:function(){return y},getDocumentState:function(){return Oe},findElement:me,findNextInside:zn,focus:Pt,onPatch:Zt,onSelect:He,onFind:Ge,onPasteJson:On,onRenderValue:O}),260&n.$$.dirty[0]|805306368&n.$$.dirty[1]&&at(y,q,D,X),10240&n.$$.dirty[0]&&t(26,o=fJ(ke,oe))},[w,_,D,K,T,A,Pt,function(){if(Xe&&y!==void 0){var Q=Oe,ve=y,Ie=j,ze={json:y,text:j},Fe=Xe;t(17,j=void 0),t(23,Xe=!1),wt(y),ge({previousJson:ve,previousState:Q,previousText:Ie,previousTextIsRepaired:Fe}),Wt(ze,null)}return{json:y,text:j}},y,ae,Qt,oe,Oe,ke,v,g,b,j,pe,he,Se,Qe,tn,Xe,ne,nn,o,i,r,p,function(Q){t(20,Se=Q)},function(Q){return et.apply(this,arguments)},function(){t(9,ae=!1),t(21,Qe=!1),Pt()},function(Q){if(!w){s("onSortByHeader",Q);var ve=Q.sortDirection===Bi.desc?-1:1;Zt(r6(y,[],Q.path,ve),function(Ie,ze){return{state:fe(fe({},ze),{},{sortedColumn:Q})}})}},Zt,function(Q){t(78,Dt=Q.target.scrollTop)},function(Q){var ve=Q.target,Ie=w4(ve);if(Ie){if(Xr(Oe.selection)&&du(y,Oe.selection,Ie))return;He(Ut(Ie,!1)),Q.preventDefault()}ve.isContentEditable||Pt()},Be,St,function(Q){Be({anchor:b4(Q.target,"BUTTON"),offsetTop:0,width:Ko,height:Jo,showTip:!0})},function(){return de.apply(this,arguments)},function(){s("clear pasted json"),t(19,he=void 0),Pt()},function(){T(Dr.text)},function(Q){var ve=ss(Q);if(s("keydown",{combo:ve,key:Q.key}),ve==="Ctrl+X"&&(Q.preventDefault(),We(!0)),ve==="Ctrl+Shift+X"&&(Q.preventDefault(),We(!1)),ve==="Ctrl+C"&&(Q.preventDefault(),G(!0)),ve==="Ctrl+Shift+C"&&(Q.preventDefault(),G(!1)),ve==="Ctrl+D"&&Q.preventDefault(),ve!=="Delete"&&ve!=="Backspace"||(Q.preventDefault(),ue()),ve==="Insert"&&Q.preventDefault(),ve==="Ctrl+A"&&Q.preventDefault(),ve==="Ctrl+Q"&&St(Q),ve==="ArrowLeft"&&(Q.preventDefault(),Mn(),Oe.selection)){var Ie=function(z,le){var je=_i(lt(le),z),Me=je.rowIndex,Ne=je.columnIndex;return Ne>0?Ut(ha({rowIndex:Me,columnIndex:Ne-1},z),!1):le}(oe,Oe.selection);He(Ie),fn(lt(Ie))}if(ve==="ArrowRight"&&(Q.preventDefault(),Mn(),Oe.selection)){var ze=function(z,le){var je=_i(lt(le),z),Me=je.rowIndex,Ne=je.columnIndex;return Ne0?Ut(ha({rowIndex:Me-1,columnIndex:Ne},z),!1):le}(oe,Oe.selection);He(Fe),fn(lt(Fe))}if(ve==="ArrowDown"&&(Q.preventDefault(),Mn(),Oe.selection)){var kt=function(z,le,je){var Me=_i(lt(je),le),Ne=Me.rowIndex,Le=Me.columnIndex;return Ne1?" (".concat(n[20].length,")"):""),fullScreenButton:!0,onClose:n[28]};n[22]!==void 0&&($.fullscreen=n[22]),t=new tp({props:$}),It.push(function(){return oi(t,"fullscreen",w)});var S={mode:n[24].mode,content:n[24].content,selection:n[24].selection,readOnly:n[0],indentation:n[1],tabSize:n[2],statusBar:n[5],askToFormat:n[6],mainMenuBar:n[3],navigationBar:n[4],escapeControlCharacters:n[7],escapeUnicodeCharacters:n[8],flattenColumns:n[9],parser:n[10],parseMemoizeOne:n[25],validator:n[11],validationParser:n[12],pathParser:n[13],insideModal:!0,onError:n[33],onChange:n[30],onChangeMode:n[32],onSelect:n[31],onRenderValue:n[14],onClassName:n[15],onFocus:Zi,onBlur:Zi,onRenderMenu:n[16],onRenderContextMenu:n[17],onSortModal:n[18],onTransformModal:n[19],onJSONEditorModal:n[34]};h=new v6({props:S}),n[40](h);var _=n[23]&&Yx(n),F=n[20].length>1&&Xx(n);function I(U,q){return U[0]?EG:AG}var W=I(n),D=W(n);return{c:function(){e=V("div"),xe(t.$$.fragment),i=ce(),o=V("div"),(s=V("div")).innerHTML='
Path
',a=ce(),l=V("input"),c=ce(),(u=V("div")).innerHTML='
Contents
',f=ce(),d=V("div"),xe(h.$$.fragment),p=ce(),m=V("div"),_&&_.c(),v=ce(),F&&F.c(),g=ce(),D.c(),x(s,"class","jse-label svelte-1m281k0"),x(l,"class","jse-path svelte-1m281k0"),x(l,"type","text"),l.readOnly=!0,x(l,"title","Selected path"),l.value=n[26],x(u,"class","jse-label svelte-1m281k0"),x(d,"class","jse-modal-inline-editor svelte-1m281k0"),x(m,"class","jse-actions svelte-1m281k0"),x(o,"class","jse-modal-contents svelte-1m281k0"),x(e,"class","jse-modal jse-jsoneditor-modal svelte-1m281k0"),$e(e,"fullscreen",n[22])},m:function(U,q){ee(U,e,q),be(t,e,null),E(e,i),E(e,o),E(o,s),E(o,a),E(o,l),E(o,c),E(o,u),E(o,f),E(o,d),be(h,d,null),E(o,p),E(o,m),_&&_.m(m,null),E(m,v),F&&F.m(m,null),E(m,g),D.m(m,null),b=!0,y||(j=mr(Lu.call(null,e,n[29])),y=!0)},p:function(U,q){var X={};1048576&q[0]&&(X.title="Edit nested content "+(U[20].length>1?" (".concat(U[20].length,")"):"")),!r&&4194304&q[0]&&(r=!0,X.fullscreen=U[22],ii(function(){return r=!1})),t.$set(X),(!b||67108864&q[0]&&l.value!==U[26])&&(l.value=U[26]);var K={};16777216&q[0]&&(K.mode=U[24].mode),16777216&q[0]&&(K.content=U[24].content),16777216&q[0]&&(K.selection=U[24].selection),1&q[0]&&(K.readOnly=U[0]),2&q[0]&&(K.indentation=U[1]),4&q[0]&&(K.tabSize=U[2]),32&q[0]&&(K.statusBar=U[5]),64&q[0]&&(K.askToFormat=U[6]),8&q[0]&&(K.mainMenuBar=U[3]),16&q[0]&&(K.navigationBar=U[4]),128&q[0]&&(K.escapeControlCharacters=U[7]),256&q[0]&&(K.escapeUnicodeCharacters=U[8]),512&q[0]&&(K.flattenColumns=U[9]),1024&q[0]&&(K.parser=U[10]),33554432&q[0]&&(K.parseMemoizeOne=U[25]),2048&q[0]&&(K.validator=U[11]),4096&q[0]&&(K.validationParser=U[12]),8192&q[0]&&(K.pathParser=U[13]),16384&q[0]&&(K.onRenderValue=U[14]),32768&q[0]&&(K.onClassName=U[15]),65536&q[0]&&(K.onRenderMenu=U[16]),131072&q[0]&&(K.onRenderContextMenu=U[17]),262144&q[0]&&(K.onSortModal=U[18]),524288&q[0]&&(K.onTransformModal=U[19]),h.$set(K),U[23]?_?_.p(U,q):((_=Yx(U)).c(),_.m(m,v)):_&&(_.d(1),_=null),U[20].length>1?F?(F.p(U,q),1048576&q[0]&&C(F,1)):((F=Xx(U)).c(),C(F,1),F.m(m,g)):F&&(Ee(),M(F,1,1,function(){F=null}),Ae()),W===(W=I(U))&&D?D.p(U,q):(D.d(1),(D=W(U))&&(D.c(),D.m(m,null))),(!b||4194304&q[0])&&$e(e,"fullscreen",U[22])},i:function(U){b||(C(t.$$.fragment,U),C(h.$$.fragment,U),C(F),b=!0)},o:function(U){M(t.$$.fragment,U),M(h.$$.fragment,U),M(F),b=!1},d:function(U){U&&Z(e),we(t),n[40](null),we(h),_&&_.d(),F&&F.d(),D.d(),y=!1,j()}}}function y6(n){n.focus()}function PG(n,e,t){var r,i,o,s,a,l,c=Sr("jsoneditor:JSONEditorModal"),u=e.content,f=e.path,d=e.onPatch,h=e.readOnly,p=e.indentation,m=e.tabSize,v=e.mainMenuBar,g=e.navigationBar,b=e.statusBar,y=e.askToFormat,j=e.escapeControlCharacters,w=e.escapeUnicodeCharacters,$=e.flattenColumns,S=e.parser,_=e.validator,F=e.validationParser,I=e.pathParser,W=e.onRenderValue,D=e.onClassName,U=e.onRenderMenu,q=e.onRenderContextMenu,X=e.onSortModal,K=e.onTransformModal,Y=Er("simple-modal").close,T={mode:A(u),content:u,selection:null,relativePath:f},B=[T],O=void 0;function A(k){return fu(k)&&Nn(k.json)?Dr.table:Dr.tree}function te(){var k,P=((k=en(B))===null||k===void 0?void 0:k.selection)||null;U0(P)&&a.scrollTo(lt(P))}function R(){c("handleClose"),B.length>1?(t(20,B=on(B)),fr().then(te),t(23,O=void 0)):Y()}return n.$$set=function(k){"content"in k&&t(35,u=k.content),"path"in k&&t(36,f=k.path),"onPatch"in k&&t(37,d=k.onPatch),"readOnly"in k&&t(0,h=k.readOnly),"indentation"in k&&t(1,p=k.indentation),"tabSize"in k&&t(2,m=k.tabSize),"mainMenuBar"in k&&t(3,v=k.mainMenuBar),"navigationBar"in k&&t(4,g=k.navigationBar),"statusBar"in k&&t(5,b=k.statusBar),"askToFormat"in k&&t(6,y=k.askToFormat),"escapeControlCharacters"in k&&t(7,j=k.escapeControlCharacters),"escapeUnicodeCharacters"in k&&t(8,w=k.escapeUnicodeCharacters),"flattenColumns"in k&&t(9,$=k.flattenColumns),"parser"in k&&t(10,S=k.parser),"validator"in k&&t(11,_=k.validator),"validationParser"in k&&t(12,F=k.validationParser),"pathParser"in k&&t(13,I=k.pathParser),"onRenderValue"in k&&t(14,W=k.onRenderValue),"onClassName"in k&&t(15,D=k.onClassName),"onRenderMenu"in k&&t(16,U=k.onRenderMenu),"onRenderContextMenu"in k&&t(17,q=k.onRenderContextMenu),"onSortModal"in k&&t(18,X=k.onSortModal),"onTransformModal"in k&&t(19,K=k.onTransformModal)},n.$$.update=function(){1048576&n.$$.dirty[0]&&t(24,r=en(B)||T),1048576&n.$$.dirty[0]&&t(38,i=B.flatMap(function(k){return k.relativePath})),128&n.$$.dirty[1]&&t(26,o=hn(i)?"(document root)":mi(i)),1024&n.$$.dirty[0]&&t(25,s=wu(S.parse))},[h,p,m,v,g,b,y,j,w,$,S,_,F,I,W,D,U,q,X,K,B,a,l,O,r,s,o,function(){if(c("handleApply"),!h)try{t(23,O=void 0);var k=r.relativePath,P=r.content,H=[{op:"replace",path:Ue(k),value:$2(P,S).json}];if(B.length>1){var J=$2(B[B.length-2].content,S).json,he={json:ro(J,H)},Se=fe(fe({},B[B.length-2]||T),{},{content:he});t(20,B=[].concat(Vt(B.slice(0,B.length-2)),[Se])),fr().then(te)}else d(H),Y()}catch(pe){t(23,O=String(pe))}},R,function(){l?t(22,l=!1):R()},function(k){c("handleChange",k);var P=fe(fe({},r),{},{content:k});t(20,B=[].concat(Vt(on(B)),[P]))},function(k){c("handleChangeSelection",k);var P=fe(fe({},r),{},{selection:k});t(20,B=[].concat(Vt(on(B)),[P]))},function(k){c("handleChangeMode",k);var P=fe(fe({},r),{},{mode:k});t(20,B=[].concat(Vt(on(B)),[P]))},function(k){t(23,O=k.toString()),console.error(k)},function(k){var P=k.content,H=k.path;c("handleJSONEditorModal",{content:P,path:H});var J={mode:A(P),content:P,selection:null,relativePath:H};t(20,B=[].concat(Vt(B),[J]))},u,f,d,i,function(k){t(22,l=k)},function(k){It[k?"unshift":"push"](function(){t(21,a=k)})}]}var _G=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,PG,TG,Tt,{content:35,path:36,onPatch:37,readOnly:0,indentation:1,tabSize:2,mainMenuBar:3,navigationBar:4,statusBar:5,askToFormat:6,escapeControlCharacters:7,escapeUnicodeCharacters:8,flattenColumns:9,parser:10,validator:11,validationParser:12,pathParser:13,onRenderValue:14,onClassName:15,onRenderMenu:16,onRenderContextMenu:17,onSortModal:18,onTransformModal:19},MG,[-1,-1]),r}return ht(e,mt),ut(e)}();function RG(n,e,t){var r=Er("simple-modal");return[r.open,r.close]}var NG=function(n){function e(t){var r;return ct(this,e),pt(r=dt(this,e),t,RG,null,Tt,{open:0,close:1}),r}return ht(e,mt),ut(e,[{key:"open",get:function(){return this.$$.ctx[0]}},{key:"close",get:function(){return this.$$.ctx[1]}}])}();function IG(n){Et(n,"svelte-ybuk0j",'.jse-main.svelte-ybuk0j{width:100%;height:100%;min-width:0;min-height:150px;font-family:var(--jse-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);font-size:var(--jse-font-size, 16px);line-height:normal;position:relative;display:flex;flex-direction:row}')}function Zx(n){var e,t,r={mode:n[1],content:n[0],selection:n[2],readOnly:n[3],indentation:n[4],tabSize:n[5],statusBar:n[8],askToFormat:n[9],mainMenuBar:n[6],navigationBar:n[7],escapeControlCharacters:n[10],escapeUnicodeCharacters:n[11],flattenColumns:n[12],parser:n[13],parseMemoizeOne:n[27],validator:n[14],validationParser:n[15],pathParser:n[16],insideModal:!1,onError:n[21],onChange:n[28],onChangeMode:n[32],onSelect:n[29],onRenderValue:n[17],onClassName:n[18],onFocus:n[30],onBlur:n[31],onRenderMenu:n[19],onRenderContextMenu:n[20],onSortModal:n[34],onTransformModal:n[33],onJSONEditorModal:n[35]};return e=new v6({props:r}),n[62](e),{c:function(){xe(e.$$.fragment)},m:function(i,o){be(e,i,o),t=!0},p:function(i,o){var s={};2&o[0]&&(s.mode=i[1]),1&o[0]&&(s.content=i[0]),4&o[0]&&(s.selection=i[2]),8&o[0]&&(s.readOnly=i[3]),16&o[0]&&(s.indentation=i[4]),32&o[0]&&(s.tabSize=i[5]),256&o[0]&&(s.statusBar=i[8]),512&o[0]&&(s.askToFormat=i[9]),64&o[0]&&(s.mainMenuBar=i[6]),128&o[0]&&(s.navigationBar=i[7]),1024&o[0]&&(s.escapeControlCharacters=i[10]),2048&o[0]&&(s.escapeUnicodeCharacters=i[11]),4096&o[0]&&(s.flattenColumns=i[12]),8192&o[0]&&(s.parser=i[13]),134217728&o[0]&&(s.parseMemoizeOne=i[27]),16384&o[0]&&(s.validator=i[14]),32768&o[0]&&(s.validationParser=i[15]),65536&o[0]&&(s.pathParser=i[16]),2097152&o[0]&&(s.onError=i[21]),131072&o[0]&&(s.onRenderValue=i[17]),262144&o[0]&&(s.onClassName=i[18]),524288&o[0]&&(s.onRenderMenu=i[19]),1048576&o[0]&&(s.onRenderContextMenu=i[20]),e.$set(s)},i:function(i){t||(C(e.$$.fragment,i),t=!0)},o:function(i){M(e.$$.fragment,i),t=!1},d:function(i){n[62](null),we(e,i)}}}function DG(n){var e,t,r,i,o,s=n[22];function a(u){n[61](u)}var l={};n[25]!==void 0&&(l.open=n[25]),e=new NG({props:l}),It.push(function(){return oi(e,"open",a)});var c=Zx(n);return{c:function(){xe(e.$$.fragment),r=ce(),i=V("div"),c.c(),x(i,"class","jse-main svelte-ybuk0j"),$e(i,"jse-focus",n[23])},m:function(u,f){be(e,u,f),ee(u,r,f),ee(u,i,f),c.m(i,null),o=!0},p:function(u,f){var d={};!t&&33554432&f[0]&&(t=!0,d.open=u[25],ii(function(){return t=!1})),e.$set(d),4194304&f[0]&&Tt(s,s=u[22])?(Ee(),M(c,1,1,Te),Ae(),(c=Zx(u)).c(),C(c,1),c.m(i,null)):c.p(u,f),(!o||8388608&f[0])&&$e(i,"jse-focus",u[23])},i:function(u){o||(C(e.$$.fragment,u),C(c),o=!0)},o:function(u){M(e.$$.fragment,u),M(c),o=!1},d:function(u){u&&(Z(r),Z(i)),we(e,u),c.d(u)}}}function LG(n){var e,t;return e=new i4({props:{closeOnEsc:!1,$$slots:{default:[DG]},$$scope:{ctx:n}}}),{c:function(){xe(e.$$.fragment)},m:function(r,i){be(e,r,i),t=!0},p:function(r,i){var o={};201326591&i[0]|8&i[2]&&(o.$$scope={dirty:i,ctx:r}),e.$set(o)},i:function(r){t||(C(e.$$.fragment,r),t=!0)},o:function(r){M(e.$$.fragment,r),t=!1},d:function(r){we(e,r)}}}function BG(n){for(var e,t,r,i=[{show:(e=n[26])===null||e===void 0?void 0:e.component},rq,{closeOnEsc:!1}],o={$$slots:{default:[LG]},$$scope:{ctx:n}},s=0;s{if(t)return!0});return n==null?void 0:n[0]}function QG(n,e=!1){return e?`https://cdn.jsdelivr.net/npm/rrweb-player@${n}/dist/index.js`:`https://unpkg.dev/rrweb-player@${n}/dist/rrweb-player.umd.cjs`}function YG(n){return`https://cdn.jsdelivr.net/npm/rrweb-player@${n}/dist/style.css`}function XG(n){T6(n),document.getElementById("versions").addEventListener("change",e=>{const t=e.target.value,r=new URL(document.location);r.searchParams.set("version",t),document.location.href=r.href})}async function ZG(n,e){const t=window.rrwebPlayer.Player||window.rrwebPlayer,r=new t({target:document.getElementById("player"),data:{events:n,skipInactive:!0,showDebug:!0,showWarning:!0,autoPlay:e.autoPlay,useVirtualDom:e.useVirtualDom,UNSAFE_replayCanvas:e.canvas,mouseTail:{strokeStyle:"yellow"}}});window.$c=r,window.events=n,document.querySelector(".loading").style.display="none",r.addEventListener("finish",()=>console.log("finish"))}function eQ(n){const e=document.getElementById("jsoneditor");new qG({target:e,props:{content:{json:n},mode:"view"}}),window.events=events}function tQ(n){const e=/gist.github(?:usercontent)?.com\/[^/]+\/(\w+)/.exec(n);return(e==null?void 0:e[1])||!1}function nQ(n){const e=/https?:\/\/jsonblob.com\/([\w\-]+)/.exec(n);return(e==null?void 0:e[1])||!1}async function rQ(){const n=new URL(document.location),e=n.searchParams.get("url");let t=n.searchParams.get("version");JG(t)||(t=GG());const r=KG(t),i=Boolean(n.searchParams.get("canvas")),o=Boolean(n.searchParams.get("play")),s=Boolean(n.searchParams.get("virtual-dom"));let a;const l=tQ(e),c=nQ(e);if(l)try{const h=await(await fetch(`https://api.github.com/gists/${l}`)).json(),p=Object.values(h.files);p[0].truncated?a=await(await fetch(p[0].raw_url)).json():a=JSON.parse(p[0].content)}catch(d){alert("something went wrong, please check the console"),console.error(d)}else if(c)try{a=await(await fetch(`https://jsonblob.com/api/v1/get/${c}`)).json()}catch(d){alert("something went wrong, please check the console"),console.error(d)}else try{a=await(await fetch(e)).json()}catch(d){alert("something went wrong, please check the console"),console.error(d)}const u=document.createElement("link");u.setAttribute("rel","stylesheet"),u.setAttribute("href",YG(t)),document.head.appendChild(u);const f=document.createElement("script");f.setAttribute("src",QG(t,r)),f.setAttribute("type","application/javascript"),f.addEventListener("load",function(){ZG(a,{canvas:i,autoPlay:o,useVirtualDom:s}),eQ(a)}),XG(t),document.head.appendChild(f),document.querySelector("a.json").setAttribute("href",e),document.querySelector("a.json").innerText=e}document.onload=rQ()});export default iQ(); diff --git a/assets/populate-versions.01ca0e03.js b/assets/populate-versions.01ca0e03.js new file mode 100644 index 0000000..528e6f0 --- /dev/null +++ b/assets/populate-versions.01ca0e03.js @@ -0,0 +1 @@ +const i=function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))l(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const n of r.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&l(n)}).observe(document,{childList:!0,subtree:!0});function t(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(e){if(e.ep)return;e.ep=!0;const r=t(e);fetch(e.href,r)}};i();var s={"0.7.1":{rrwebVersion:"0.9.14",legacy:!0},"0.7.2":{rrwebVersion:"1.0.0",legacy:!0},"0.7.3":{rrwebVersion:"1.0.1",legacy:!0},"0.7.4":{rrwebVersion:"1.0.2",legacy:!0},"0.7.5":{rrwebVersion:"1.0.3",legacy:!0},"0.7.6":{rrwebVersion:"1.0.4",legacy:!0},"0.7.7":{rrwebVersion:"1.0.5",legacy:!0},"0.7.8":{rrwebVersion:"1.0.6",legacy:!0},"0.7.9":{rrwebVersion:"1.0.7",legacy:!0},"0.7.10":{rrwebVersion:"1.0.8",legacy:!0},"0.7.11":{rrwebVersion:"1.1.0",legacy:!0},"0.7.13":{rrwebVersion:"1.1.2",legacy:!0},"0.7.14":{rrwebVersion:"1.1.3",legacy:!0},"1.0.0-alpha.0":{rrwebVersion:"2.0.0-alpha.0",legacy:!0},"1.0.0-alpha.1":{rrwebVersion:"2.0.0-alpha.1",legacy:!0},"1.0.0-alpha.2":{rrwebVersion:"2.0.0-alpha.2",legacy:!0},"1.0.0-alpha.3":{rrwebVersion:"2.0.0-alpha.3",legacy:!0},"2.0.0-alpha.5":{rrwebVersion:"2.0.0-alpha.5",legacy:!0},"2.0.0-alpha.6":{rrwebVersion:"2.0.0-alpha.6",legacy:!0},"2.0.0-alpha.7":{rrwebVersion:"2.0.0-alpha.7",legacy:!0},"2.0.0-alpha.8":{rrwebVersion:"2.0.0-alpha.8",legacy:!0},"2.0.0-alpha.9":{rrwebVersion:"2.0.0-alpha.9",legacy:!0},"2.0.0-alpha.10":{rrwebVersion:"2.0.0-alpha.10",legacy:!0},"2.0.0-alpha.11":{rrwebVersion:"2.0.0-alpha.11",legacy:!0},"2.0.0-alpha.12":{rrwebVersion:"2.0.0-alpha.12",legacy:!0},"2.0.0-alpha.13":{rrwebVersion:"2.0.0-alpha.13",legacy:!0},"2.0.0-alpha.14":{rrwebVersion:"2.0.0-alpha.14",legacy:!0},"2.0.0-alpha.15":{rrwebVersion:"2.0.0-alpha.15",default:!0}};function u(o){document.getElementById("versions").innerHTML=Object.entries(s).map(([a,t])=>{const{rrwebVersion:l}=t,e="default"in t&&t.default;return``}).join(""),o&&(document.getElementById("versions").value=o)}export{u as p,s as v}; diff --git a/assets/populate-versions.b01ef36d.js b/assets/populate-versions.b01ef36d.js deleted file mode 100644 index 4320538..0000000 --- a/assets/populate-versions.b01ef36d.js +++ /dev/null @@ -1 +0,0 @@ -const t=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))a(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&a(s)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}};t();var l={"0.7.1":{rrwebVersion:"0.9.14"},"0.7.2":{rrwebVersion:"1.0.0"},"0.7.3":{rrwebVersion:"1.0.1"},"0.7.4":{rrwebVersion:"1.0.2"},"0.7.5":{rrwebVersion:"1.0.3"},"0.7.6":{rrwebVersion:"1.0.4"},"0.7.7":{rrwebVersion:"1.0.5"},"0.7.8":{rrwebVersion:"1.0.6"},"0.7.9":{rrwebVersion:"1.0.7"},"0.7.10":{rrwebVersion:"1.0.8"},"0.7.11":{rrwebVersion:"1.1.0"},"0.7.13":{rrwebVersion:"1.1.2"},"0.7.14":{rrwebVersion:"1.1.3"},"1.0.0-alpha.0":{rrwebVersion:"2.0.0-alpha.0"},"1.0.0-alpha.1":{rrwebVersion:"2.0.0-alpha.1"},"1.0.0-alpha.2":{rrwebVersion:"2.0.0-alpha.2"},"1.0.0-alpha.3":{rrwebVersion:"2.0.0-alpha.3"},"2.0.0-alpha.5":{rrwebVersion:"2.0.0-alpha.5"},"2.0.0-alpha.6":{rrwebVersion:"2.0.0-alpha.6"},"2.0.0-alpha.7":{rrwebVersion:"2.0.0-alpha.7"},"2.0.0-alpha.8":{rrwebVersion:"2.0.0-alpha.8"},"2.0.0-alpha.9":{rrwebVersion:"2.0.0-alpha.9"},"2.0.0-alpha.10":{rrwebVersion:"2.0.0-alpha.10"},"2.0.0-alpha.11":{rrwebVersion:"2.0.0-alpha.11"},"2.0.0-alpha.12":{rrwebVersion:"2.0.0-alpha.12"},"2.0.0-alpha.13":{rrwebVersion:"2.0.0-alpha.13",default:!0}};function p(i){document.getElementById("versions").innerHTML=Object.entries(l).map(([o,n])=>{const{rrwebVersion:a}=n,e="default"in n&&n.default;return``}).join(""),i&&(document.getElementById("versions").value=i)}export{p,l as v}; diff --git a/index.html b/index.html index c8a2baf..6a7f8d3 100644 --- a/index.html +++ b/index.html @@ -16,8 +16,8 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous" > - - + + diff --git a/play/index.html b/play/index.html index c2970b5..9b1f4ca 100644 --- a/play/index.html +++ b/play/index.html @@ -12,8 +12,8 @@ crossorigin="anonymous" /> - - + +

Events JSON: loading...