@redocly/reference-docs 2.11.10 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/bin/cli/commands/redocly-docs-cli.min.js +94 -87
  2. package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +1 -1
  3. package/dist/console.redocly-reference-docs.min.js +43 -43
  4. package/dist/oauth2-redirect.js +1 -1
  5. package/dist/redocly-reference-docs.min.js +578 -566
  6. package/lib/components/common/Dropdown/Dropdown.js +1 -1
  7. package/lib/components/common/Dropdown/styled.js +1 -1
  8. package/lib/components/console/AuthPanel.js +1 -1
  9. package/lib/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
  10. package/lib/services/code-samples/generator.js +1 -1
  11. package/lib/services/code-samples/httpsnippet/helpers/code-builder.js +1 -1
  12. package/lib/services/code-samples/httpsnippet/helpers/constants.d.ts +2 -1
  13. package/lib/services/code-samples/httpsnippet/helpers/constants.js +1 -1
  14. package/lib/services/code-samples/httpsnippet/targets/index.d.ts +9 -0
  15. package/lib/services/code-samples/httpsnippet/targets/index.js +1 -1
  16. package/lib/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
  17. package/lib/services/code-samples/httpsnippet/targets/r/httr.d.ts +4 -0
  18. package/lib/services/code-samples/httpsnippet/targets/r/httr.js +2 -0
  19. package/lib/services/code-samples/httpsnippet/targets/r/index.d.ts +10 -0
  20. package/lib/services/code-samples/httpsnippet/targets/r/index.js +2 -0
  21. package/lib/services/code-samples/httpsnippet/targets/r/utils.d.ts +5 -0
  22. package/lib/services/code-samples/httpsnippet/targets/r/utils.js +2 -0
  23. package/lib/services/code-samples/types.d.ts +5 -2
  24. package/lib-esm/components/common/Dropdown/Dropdown.js +1 -1
  25. package/lib-esm/components/common/Dropdown/styled.js +1 -1
  26. package/lib-esm/components/console/AuthPanel.js +1 -1
  27. package/lib-esm/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
  28. package/lib-esm/services/code-samples/generator.js +1 -1
  29. package/lib-esm/services/code-samples/httpsnippet/helpers/code-builder.js +1 -1
  30. package/lib-esm/services/code-samples/httpsnippet/helpers/constants.d.ts +2 -1
  31. package/lib-esm/services/code-samples/httpsnippet/helpers/constants.js +1 -1
  32. package/lib-esm/services/code-samples/httpsnippet/targets/index.d.ts +9 -0
  33. package/lib-esm/services/code-samples/httpsnippet/targets/index.js +1 -1
  34. package/lib-esm/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
  35. package/lib-esm/services/code-samples/httpsnippet/targets/r/httr.d.ts +4 -0
  36. package/lib-esm/services/code-samples/httpsnippet/targets/r/httr.js +2 -0
  37. package/lib-esm/services/code-samples/httpsnippet/targets/r/index.d.ts +10 -0
  38. package/lib-esm/services/code-samples/httpsnippet/targets/r/index.js +2 -0
  39. package/lib-esm/services/code-samples/httpsnippet/targets/r/utils.d.ts +5 -0
  40. package/lib-esm/services/code-samples/httpsnippet/targets/r/utils.js +2 -0
  41. package/lib-esm/services/code-samples/types.d.ts +5 -2
  42. package/package.json +2 -2
@@ -2,7 +2,7 @@ var yr=Math.pow;/*!
2
2
  * Redocly Reference Docs
3
3
  * (c) Copyright 2018 Redocly LLC, all rights reserved.
4
4
  * -------------------------------------------------------------
5
- * Version: "2.11.10"
5
+ * Version: "2.12.0"
6
6
  */(this.webpackChunkRedoclyReferenceDocs=this.webpackChunkRedoclyReferenceDocs||[]).push([[290],{66419:(h,I,o)=>{h.exports=o(27698)},77766:(h,I,o)=>{h.exports=o(8065)},72119:(h,I,o)=>{h.exports=o(57448)},20116:(h,I,o)=>{h.exports=o(11955)},94473:(h,I,o)=>{h.exports=o(61577)},78580:(h,I,o)=>{h.exports=o(33778)},2991:(h,I,o)=>{h.exports=o(61798)},3649:(h,I,o)=>{h.exports=o(82073)},92762:(h,I,o)=>{h.exports=o(2348)},59340:(h,I,o)=>{h.exports=o(8933)},51942:(h,I,o)=>{h.exports=o(63383)},26295:(h,I,o)=>{h.exports=o(86209)},86902:(h,I,o)=>{h.exports=o(23059)},93476:(h,I,o)=>{h.exports=o(27460)},52424:(h,I,o)=>{h.exports=o(72010)},53592:(h,I,o)=>{h.exports=o(27385)},78363:(h,I,o)=>{h.exports=o(81522)},19996:(h,I,o)=>{h.exports=o(32209)},30699:(h,I,o)=>{h.exports=o(44442)},28834:(h,I,o)=>{h.exports=o(57152)},95683:(h,I,o)=>{h.exports=o(69447)},95238:(h,I,o)=>{h.exports=o(81493)},189:(h,I,o)=>{h.exports=o(76094)},32752:(h,I,o)=>{h.exports=o(70573)},44341:(h,I,o)=>{h.exports=o(73685)},58377:(h,I,o)=>{h.exports=o(27533)},13038:(h,I,o)=>{h.exports=o(39057)},63263:(h,I,o)=>{h.exports=o(84710)},24889:(h,I,o)=>{h.exports=o(74303)},89356:(h,I,o)=>{h.exports=o(93799)},79542:(h,I,o)=>{h.exports=o(55122)},69798:(h,I,o)=>{h.exports=o(29531)},13535:(h,I,o)=>{h.exports=o(10856)},83863:(h,I,o)=>{h.exports=o(31524)},51446:(h,I,o)=>{h.exports=o(86600)},23882:(h,I,o)=>{h.exports=o(9759)},63109:(h,I,o)=>{h.exports=o(35666)},79742:(h,I)=>{"use strict";I.byteLength=g,I.toByteArray=N,I.fromByteArray=_;for(var o=[],c=[],v=typeof Uint8Array!="undefined"?Uint8Array:Array,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,b=x.length;d<b;++d)o[d]=x[d],c[x.charCodeAt(d)]=d;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function A(H){var R=H.length;if(R%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var X=H.indexOf("=");X===-1&&(X=R);var M=X===R?0:4-X%4;return[X,M]}function g(H){var R=A(H),X=R[0],M=R[1];return(X+M)*3/4-M}function L(H,R,X){return(R+X)*3/4-X}function N(H){var R,X=A(H),M=X[0],C=X[1],V=new v(L(H,M,C)),J=0,q=C>0?M-4:M,Q;for(Q=0;Q<q;Q+=4)R=c[H.charCodeAt(Q)]<<18|c[H.charCodeAt(Q+1)]<<12|c[H.charCodeAt(Q+2)]<<6|c[H.charCodeAt(Q+3)],V[J++]=R>>16&255,V[J++]=R>>8&255,V[J++]=R&255;return C===2&&(R=c[H.charCodeAt(Q)]<<2|c[H.charCodeAt(Q+1)]>>4,V[J++]=R&255),C===1&&(R=c[H.charCodeAt(Q)]<<10|c[H.charCodeAt(Q+1)]<<4|c[H.charCodeAt(Q+2)]>>2,V[J++]=R>>8&255,V[J++]=R&255),V}function B(H){return o[H>>18&63]+o[H>>12&63]+o[H>>6&63]+o[H&63]}function j(H,R,X){for(var M,C=[],V=R;V<X;V+=3)M=(H[V]<<16&16711680)+(H[V+1]<<8&65280)+(H[V+2]&255),C.push(B(M));return C.join("")}function _(H){for(var R,X=H.length,M=X%3,C=[],V=16383,J=0,q=X-M;J<q;J+=V)C.push(j(H,J,J+V>q?q:J+V));return M===1?(R=H[X-1],C.push(o[R>>2]+o[R<<4&63]+"==")):M===2&&(R=(H[X-2]<<8)+H[X-1],C.push(o[R>>10]+o[R>>4&63]+o[R<<2&63]+"=")),C.join("")}},50706:(h,I,o)=>{var c=o(48764).Buffer;(function(){"use strict";function v(x){var d;return x instanceof c?d=x:d=c.from(x.toString(),"binary"),d.toString("base64")}h.exports=v})()},48764:(h,I,o)=>{"use strict";/*!
7
7
  * The buffer module from node.js, for the browser.
8
8
  *
@@ -15,30 +15,30 @@ var yr=Math.pow;/*!
15
15
  `),ue=J.line+ve.length-1,oe=ve[ve.length-1].length;return{from:v(ue,oe),to:v(ue+de.length-1,de.length==1?oe+de[0].length:de[de.length-1].length),match:ye}}}}function L(C,V,J){for(var q,Q=0;Q<=C.length;){V.lastIndex=Q;var Y=V.exec(C);if(!Y)break;var fe=Y.index+Y[0].length;if(fe>C.length-J)break;(!q||fe>q.index+q[0].length)&&(q=Y),Q=Y.index+1}return q}function N(C,V,J){V=d(V,"g");for(var q=J.line,Q=J.ch,Y=C.firstLine();q>=Y;q--,Q=-1){var fe=C.getLine(q),te=L(fe,V,Q<0?0:fe.length-Q);if(te)return{from:v(q,te.index),to:v(q,te.index+te[0].length),match:te}}}function B(C,V,J){if(!b(V))return N(C,V,J);V=d(V,"gm");for(var q,Q=1,Y=C.getLine(J.line).length-J.ch,fe=J.line,te=C.firstLine();fe>=te;){for(var ne=0;ne<Q&&fe>=te;ne++){var ye=C.getLine(fe--);q=q==null?ye:ye+`
16
16
  `+q}Q*=2;var ve=L(q,V,Y);if(ve){var de=q.slice(0,ve.index).split(`
17
17
  `),ue=ve[0].split(`
18
- `),oe=fe+de.length,De=de[de.length-1].length;return{from:v(oe,De),to:v(oe+ue.length-1,ue.length==1?De+ue[0].length:ue[ue.length-1].length),match:ve}}}}var j,_;String.prototype.normalize?(j=function(C){return C.normalize("NFD").toLowerCase()},_=function(C){return C.normalize("NFD")}):(j=function(C){return C.toLowerCase()},_=function(C){return C});function H(C,V,J,q){if(C.length==V.length)return J;for(var Q=0,Y=J+Math.max(0,C.length-V.length);;){if(Q==Y)return Q;var fe=Q+Y>>1,te=q(C.slice(0,fe)).length;if(te==J)return fe;te>J?Y=fe:Q=fe+1}}function R(C,V,J,q){if(!V.length)return null;var Q=q?j:_,Y=Q(V).split(/\r|\n\r?/);e:for(var fe=J.line,te=J.ch,ne=C.lastLine()+1-Y.length;fe<=ne;fe++,te=0){var ye=C.getLine(fe).slice(te),ve=Q(ye);if(Y.length==1){var de=ve.indexOf(Y[0]);if(de==-1)continue e;var J=H(ye,ve,de,Q)+te;return{from:v(fe,H(ye,ve,de,Q)+te),to:v(fe,H(ye,ve,de+Y[0].length,Q)+te)}}else{var ue=ve.length-Y[0].length;if(ve.slice(ue)!=Y[0])continue e;for(var oe=1;oe<Y.length-1;oe++)if(Q(C.getLine(fe+oe))!=Y[oe])continue e;var De=C.getLine(fe+Y.length-1),Ve=Q(De),Le=Y[Y.length-1];if(Ve.slice(0,Le.length)!=Le)continue e;return{from:v(fe,H(ye,ve,ue,Q)+te),to:v(fe+Y.length-1,H(De,Ve,Le.length,Q))}}}}function X(C,V,J,q){if(!V.length)return null;var Q=q?j:_,Y=Q(V).split(/\r|\n\r?/);e:for(var fe=J.line,te=J.ch,ne=C.firstLine()-1+Y.length;fe>=ne;fe--,te=-1){var ye=C.getLine(fe);te>-1&&(ye=ye.slice(0,te));var ve=Q(ye);if(Y.length==1){var de=ve.lastIndexOf(Y[0]);if(de==-1)continue e;return{from:v(fe,H(ye,ve,de,Q)),to:v(fe,H(ye,ve,de+Y[0].length,Q))}}else{var ue=Y[Y.length-1];if(ve.slice(0,ue.length)!=ue)continue e;for(var oe=1,J=fe-Y.length+1;oe<Y.length-1;oe++)if(Q(C.getLine(J+oe))!=Y[oe])continue e;var De=C.getLine(fe+1-Y.length),Ve=Q(De);if(Ve.slice(Ve.length-Y[0].length)!=Y[0])continue e;return{from:v(fe+1-Y.length,H(De,Ve,De.length-Y[0].length,Q)),to:v(fe,H(ye,ve,ue.length,Q))}}}}function M(C,V,J,q){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=C,J=J?C.clipPos(J):v(0,0),this.pos={from:J,to:J};var Q;typeof q=="object"?Q=q.caseFold:(Q=q,q=null),typeof V=="string"?(Q==null&&(Q=!1),this.matches=function(Y,fe){return(Y?X:R)(C,V,fe,Q)}):(V=d(V,"gm"),!q||q.multiline!==!1?this.matches=function(Y,fe){return(Y?B:g)(C,V,fe)}:this.matches=function(Y,fe){return(Y?N:A)(C,V,fe)})}M.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(C){var V=this.doc.clipPos(C?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(V=v(V.line,V.ch),C?(V.ch--,V.ch<0&&(V.line--,V.ch=(this.doc.getLine(V.line)||"").length)):(V.ch++,V.ch>(this.doc.getLine(V.line)||"").length&&(V.ch=0,V.line++)),c.cmpPos(V,this.doc.clipPos(V))!=0))return this.atOccurrence=!1;var J=this.matches(C,V);if(this.afterEmptyMatch=J&&c.cmpPos(J.from,J.to)==0,J)return this.pos=J,this.atOccurrence=!0,this.pos.match||!0;var q=v(C?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:q,to:q},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(C,V){if(!!this.atOccurrence){var J=c.splitLines(C);this.doc.replaceRange(J,this.pos.from,this.pos.to,V),this.pos.to=v(this.pos.from.line+J.length-1,J[J.length-1].length+(J.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(C,V,J){return new M(this.doc,C,V,J)}),c.defineDocExtension("getSearchCursor",function(C,V,J){return new M(this,C,V,J)}),c.defineExtension("selectMatches",function(C,V){for(var J=[],q=this.getSearchCursor(C,this.getCursor("from"),V);q.findNext()&&!(c.cmpPos(q.to(),this.getCursor("to"))>0);)J.push({anchor:q.from(),head:q.to()});J.length&&this.setSelections(J,0)})})},4631:function(h){(function(I,o){h.exports=o()})(this,function(){"use strict";var I=navigator.userAgent,o=navigator.platform,c=/gecko\/\d/i.test(I),v=/MSIE \d/.test(I),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),d=/Edge\/(\d+)/.exec(I),b=v||x||d,A=b&&(v?document.documentMode||6:+(d||x)[1]),g=!d&&/WebKit\//.test(I),L=g&&/Qt\/\d+\.\d+/.test(I),N=!d&&/Chrome\//.test(I),B=/Opera\//.test(I),j=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),H=/PhantomJS/.test(I),R=j&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),X=/Android/.test(I),M=R||X||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),C=R||/Mac/.test(o),V=/\bCrOS\b/.test(I),J=/win/i.test(o),q=B&&I.match(/Version\/(\d*\.\d*)/);q&&(q=Number(q[1])),q&&q>=15&&(B=!1,g=!0);var Q=C&&(L||B&&(q==null||q<12.11)),Y=c||b&&A>=9;function fe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var te=function(e,n){var u=e.className,l=fe(n).exec(u);if(l){var f=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(f?l[1]+f:"")}};function ne(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function ye(e,n){return ne(e).appendChild(n)}function ve(e,n,u,l){var f=document.createElement(e);if(u&&(f.className=u),l&&(f.style.cssText=l),typeof n=="string")f.appendChild(document.createTextNode(n));else if(n)for(var m=0;m<n.length;++m)f.appendChild(n[m]);return f}function de(e,n,u,l){var f=ve(e,n,u,l);return f.setAttribute("role","presentation"),f}var ue;document.createRange?ue=function(e,n,u,l){var f=document.createRange();return f.setEnd(l||e,u),f.setStart(e,n),f}:ue=function(e,n,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(f){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",n),l};function oe(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function De(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Ve(e,n){var u=e.className;fe(n).test(u)||(e.className+=(u?" ":"")+n)}function Le(e,n){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!fe(u[l]).test(n)&&(n+=" "+u[l]);return n}var ke=function(e){e.select()};R?ke=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(ke=function(e){try{e.select()}catch(n){}});function rt(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function Qe(e,n,u){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function Xe(e,n,u,l,f){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var m=l||0,F=f||0;;){var U=e.indexOf(" ",m);if(U<0||U>=n)return F+(n-m);F+=U-m,F+=u-F%u,m=U+1}}var ut=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ut.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ut.prototype.set=function(e,n){this.f=n;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function pt(e,n){for(var u=0;u<e.length;++u)if(e[u]==n)return u;return-1}var yt=50,qe={toString:function(){return"CodeMirror.Pass"}},lt={scroll:!1},vt={origin:"*mouse"},mt={origin:"+move"};function dt(e,n,u){for(var l=0,f=0;;){var m=e.indexOf(" ",l);m==-1&&(m=e.length);var F=m-l;if(m==e.length||f+F>=n)return l+Math.min(F,n-f);if(f+=m-l,f+=u-f%u,l=m+1,f>=n)return l}}var kt=[""];function It(e){for(;kt.length<=e;)kt.push(At(kt)+" ");return kt[e]}function At(e){return e[e.length-1]}function jt(e,n){for(var u=[],l=0;l<e.length;l++)u[l]=n(e[l],l);return u}function Nt(e,n,u){for(var l=0,f=u(n);l<e.length&&u(e[l])<=f;)l++;e.splice(l,0,n)}function $t(){}function St(e,n){var u;return Object.create?u=Object.create(e):($t.prototype=e,u=new $t),n&&Qe(n,u),u}var Mt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Mt.test(e))}function G(e,n){return n?n.source.indexOf("\\w")>-1&&pe(e)?!0:n.test(e):pe(e)}function K(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Re(e){return e.charCodeAt(0)>=768&&we.test(e)}function be(e,n,u){for(;(u<0?n>0:n<e.length)&&Re(e.charAt(n));)n+=u;return n}function Ae(e,n,u){for(var l=n>u?-1:1;;){if(n==u)return n;var f=(n+u)/2,m=l<0?Math.ceil(f):Math.floor(f);if(m==n)return e(m)?n:u;e(m)?u=m:n=m+l}}function T(e,n,u,l){if(!e)return l(n,u,"ltr",0);for(var f=!1,m=0;m<e.length;++m){var F=e[m];(F.from<u&&F.to>n||n==u&&F.to==n)&&(l(Math.max(F.from,n),Math.min(F.to,u),F.level==1?"rtl":"ltr",m),f=!0)}f||l(n,u,"ltr")}var Ie=null;function W(e,n,u){var l;Ie=null;for(var f=0;f<e.length;++f){var m=e[f];if(m.from<n&&m.to>n)return f;m.to==n&&(m.from!=m.to&&u=="before"?l=f:Ie=f),m.from==n&&(m.from!=m.to&&u!="before"?l=f:Ie=f)}return l!=null?l:Ie}var O=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(Z){return Z<=247?e.charAt(Z):1424<=Z&&Z<=1524?"R":1536<=Z&&Z<=1785?n.charAt(Z-1536):1774<=Z&&Z<=2220?"r":8192<=Z&&Z<=8203?"w":Z==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,m=/[LRr]/,F=/[Lb1n]/,U=/[1n]/;function z(Z,xe,Ee){this.level=Z,this.from=xe,this.to=Ee}return function(Z,xe){var Ee=xe=="ltr"?"L":"R";if(Z.length==0||xe=="ltr"&&!l.test(Z))return!1;for(var Ne=Z.length,Me=[],Ye=0;Ye<Ne;++Ye)Me.push(u(Z.charCodeAt(Ye)));for(var tt=0,at=Ee;tt<Ne;++tt){var ft=Me[tt];ft=="m"?Me[tt]=at:at=ft}for(var ht=0,ct=Ee;ht<Ne;++ht){var bt=Me[ht];bt=="1"&&ct=="r"?Me[ht]="n":m.test(bt)&&(ct=bt,bt=="r"&&(Me[ht]="R"))}for(var Pt=1,Ot=Me[0];Pt<Ne-1;++Pt){var Ut=Me[Pt];Ut=="+"&&Ot=="1"&&Me[Pt+1]=="1"?Me[Pt]="1":Ut==","&&Ot==Me[Pt+1]&&(Ot=="1"||Ot=="n")&&(Me[Pt]=Ot),Ot=Ut}for(var ar=0;ar<Ne;++ar){var Hr=Me[ar];if(Hr==",")Me[ar]="N";else if(Hr=="%"){var vr=void 0;for(vr=ar+1;vr<Ne&&Me[vr]=="%";++vr);for(var xn=ar&&Me[ar-1]=="!"||vr<Ne&&Me[vr]=="1"?"1":"N",fn=ar;fn<vr;++fn)Me[fn]=xn;ar=vr-1}}for(var kr=0,rn=Ee;kr<Ne;++kr){var zr=Me[kr];rn=="L"&&zr=="1"?Me[kr]="L":m.test(zr)&&(rn=zr)}for(var Nr=0;Nr<Ne;++Nr)if(f.test(Me[Nr])){var Rr=void 0;for(Rr=Nr+1;Rr<Ne&&f.test(Me[Rr]);++Rr);for(var wr=(Nr?Me[Nr-1]:Ee)=="L",cn=(Rr<Ne?Me[Rr]:Ee)=="L",lo=wr==cn?wr?"L":"R":Ee,Ui=Nr;Ui<Rr;++Ui)Me[Ui]=lo;Nr=Rr-1}for(var Jr=[],zn,Er=0;Er<Ne;)if(F.test(Me[Er])){var wl=Er;for(++Er;Er<Ne&&F.test(Me[Er]);++Er);Jr.push(new z(0,wl,Er))}else{var Cn=Er,ji=Jr.length,Xr=xe=="rtl"?1:0;for(++Er;Er<Ne&&Me[Er]!="L";++Er);for(var dn=Cn;dn<Er;)if(U.test(Me[dn])){Cn<dn&&(Jr.splice(ji,0,new z(1,Cn,dn)),ji+=Xr);var uo=dn;for(++dn;dn<Er&&U.test(Me[dn]);++dn);Jr.splice(ji,0,new z(2,uo,dn)),ji+=Xr,Cn=dn}else++dn;Cn<Er&&Jr.splice(ji,0,new z(1,Cn,Er))}return xe=="ltr"&&(Jr[0].level==1&&(zn=Z.match(/^\s+/))&&(Jr[0].from=zn[0].length,Jr.unshift(new z(0,0,zn[0].length))),At(Jr).level==1&&(zn=Z.match(/\s+$/))&&(At(Jr).to-=zn[0].length,Jr.push(new z(0,Ne-zn[0].length,Ne)))),xe=="rtl"?Jr.reverse():Jr}}();function P(e,n){var u=e.order;return u==null&&(u=e.order=O(e.text,n)),u}var ie=[],D=function(e,n,u){if(e.addEventListener)e.addEventListener(n,u,!1);else if(e.attachEvent)e.attachEvent("on"+n,u);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||ie).concat(u)}};function ee(e,n){return e._handlers&&e._handlers[n]||ie}function ce(e,n,u){if(e.removeEventListener)e.removeEventListener(n,u,!1);else if(e.detachEvent)e.detachEvent("on"+n,u);else{var l=e._handlers,f=l&&l[n];if(f){var m=pt(f,u);m>-1&&(l[n]=f.slice(0,m).concat(f.slice(m+1)))}}}function Oe(e,n){var u=ee(e,n);if(!!u.length)for(var l=Array.prototype.slice.call(arguments,2),f=0;f<u.length;++f)u[f].apply(null,l)}function Pe(e,n,u){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,u||n.type,e,n),Ct(n)||n.codemirrorIgnore}function Te(e){var n=e._handlers&&e._handlers.cursorActivity;if(!!n)for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)pt(u,n[l])==-1&&u.push(n[l])}function Ge(e,n){return ee(e,n).length>0}function He(e){e.prototype.on=function(n,u){D(this,n,u)},e.prototype.off=function(n,u){ce(this,n,u)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function gt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ct(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Jt(e){it(e),gt(e)}function Ft(e){return e.target||e.srcElement}function wn(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),C&&e.ctrlKey&&n==1&&(n=3),n}var Zr=function(){if(b&&A<9)return!1;var e=ve("div");return"draggable"in e||"dragDrop"in e}(),On;function Gi(e){if(On==null){var n=ve("span","\u200B");ye(e,ve("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(On=n.offsetWidth<=1&&n.offsetHeight>2&&!(b&&A<8))}var u=On?ve("span","\u200B"):ve("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var jr;function Nn(e){if(jr!=null)return jr;var n=ye(e,document.createTextNode("A\u062EA")),u=ue(n,0,1).getBoundingClientRect(),l=ue(n,1,2).getBoundingClientRect();return ne(e),!u||u.left==u.right?!1:jr=l.right-u.right<3}var $n=`
18
+ `),oe=fe+de.length,De=de[de.length-1].length;return{from:v(oe,De),to:v(oe+ue.length-1,ue.length==1?De+ue[0].length:ue[ue.length-1].length),match:ve}}}}var j,_;String.prototype.normalize?(j=function(C){return C.normalize("NFD").toLowerCase()},_=function(C){return C.normalize("NFD")}):(j=function(C){return C.toLowerCase()},_=function(C){return C});function H(C,V,J,q){if(C.length==V.length)return J;for(var Q=0,Y=J+Math.max(0,C.length-V.length);;){if(Q==Y)return Q;var fe=Q+Y>>1,te=q(C.slice(0,fe)).length;if(te==J)return fe;te>J?Y=fe:Q=fe+1}}function R(C,V,J,q){if(!V.length)return null;var Q=q?j:_,Y=Q(V).split(/\r|\n\r?/);e:for(var fe=J.line,te=J.ch,ne=C.lastLine()+1-Y.length;fe<=ne;fe++,te=0){var ye=C.getLine(fe).slice(te),ve=Q(ye);if(Y.length==1){var de=ve.indexOf(Y[0]);if(de==-1)continue e;var J=H(ye,ve,de,Q)+te;return{from:v(fe,H(ye,ve,de,Q)+te),to:v(fe,H(ye,ve,de+Y[0].length,Q)+te)}}else{var ue=ve.length-Y[0].length;if(ve.slice(ue)!=Y[0])continue e;for(var oe=1;oe<Y.length-1;oe++)if(Q(C.getLine(fe+oe))!=Y[oe])continue e;var De=C.getLine(fe+Y.length-1),Ve=Q(De),Le=Y[Y.length-1];if(Ve.slice(0,Le.length)!=Le)continue e;return{from:v(fe,H(ye,ve,ue,Q)+te),to:v(fe+Y.length-1,H(De,Ve,Le.length,Q))}}}}function X(C,V,J,q){if(!V.length)return null;var Q=q?j:_,Y=Q(V).split(/\r|\n\r?/);e:for(var fe=J.line,te=J.ch,ne=C.firstLine()-1+Y.length;fe>=ne;fe--,te=-1){var ye=C.getLine(fe);te>-1&&(ye=ye.slice(0,te));var ve=Q(ye);if(Y.length==1){var de=ve.lastIndexOf(Y[0]);if(de==-1)continue e;return{from:v(fe,H(ye,ve,de,Q)),to:v(fe,H(ye,ve,de+Y[0].length,Q))}}else{var ue=Y[Y.length-1];if(ve.slice(0,ue.length)!=ue)continue e;for(var oe=1,J=fe-Y.length+1;oe<Y.length-1;oe++)if(Q(C.getLine(J+oe))!=Y[oe])continue e;var De=C.getLine(fe+1-Y.length),Ve=Q(De);if(Ve.slice(Ve.length-Y[0].length)!=Y[0])continue e;return{from:v(fe+1-Y.length,H(De,Ve,De.length-Y[0].length,Q)),to:v(fe,H(ye,ve,ue.length,Q))}}}}function M(C,V,J,q){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=C,J=J?C.clipPos(J):v(0,0),this.pos={from:J,to:J};var Q;typeof q=="object"?Q=q.caseFold:(Q=q,q=null),typeof V=="string"?(Q==null&&(Q=!1),this.matches=function(Y,fe){return(Y?X:R)(C,V,fe,Q)}):(V=d(V,"gm"),!q||q.multiline!==!1?this.matches=function(Y,fe){return(Y?B:g)(C,V,fe)}:this.matches=function(Y,fe){return(Y?N:A)(C,V,fe)})}M.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(C){var V=this.doc.clipPos(C?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(V=v(V.line,V.ch),C?(V.ch--,V.ch<0&&(V.line--,V.ch=(this.doc.getLine(V.line)||"").length)):(V.ch++,V.ch>(this.doc.getLine(V.line)||"").length&&(V.ch=0,V.line++)),c.cmpPos(V,this.doc.clipPos(V))!=0))return this.atOccurrence=!1;var J=this.matches(C,V);if(this.afterEmptyMatch=J&&c.cmpPos(J.from,J.to)==0,J)return this.pos=J,this.atOccurrence=!0,this.pos.match||!0;var q=v(C?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:q,to:q},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(C,V){if(!!this.atOccurrence){var J=c.splitLines(C);this.doc.replaceRange(J,this.pos.from,this.pos.to,V),this.pos.to=v(this.pos.from.line+J.length-1,J[J.length-1].length+(J.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(C,V,J){return new M(this.doc,C,V,J)}),c.defineDocExtension("getSearchCursor",function(C,V,J){return new M(this,C,V,J)}),c.defineExtension("selectMatches",function(C,V){for(var J=[],q=this.getSearchCursor(C,this.getCursor("from"),V);q.findNext()&&!(c.cmpPos(q.to(),this.getCursor("to"))>0);)J.push({anchor:q.from(),head:q.to()});J.length&&this.setSelections(J,0)})})},4631:function(h){(function(I,o){h.exports=o()})(this,function(){"use strict";var I=navigator.userAgent,o=navigator.platform,c=/gecko\/\d/i.test(I),v=/MSIE \d/.test(I),x=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(I),d=/Edge\/(\d+)/.exec(I),b=v||x||d,A=b&&(v?document.documentMode||6:+(d||x)[1]),g=!d&&/WebKit\//.test(I),L=g&&/Qt\/\d+\.\d+/.test(I),N=!d&&/Chrome\//.test(I),B=/Opera\//.test(I),j=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(I),H=/PhantomJS/.test(I),R=j&&(/Mobile\/\w+/.test(I)||navigator.maxTouchPoints>2),X=/Android/.test(I),M=R||X||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(I),C=R||/Mac/.test(o),V=/\bCrOS\b/.test(I),J=/win/i.test(o),q=B&&I.match(/Version\/(\d*\.\d*)/);q&&(q=Number(q[1])),q&&q>=15&&(B=!1,g=!0);var Q=C&&(L||B&&(q==null||q<12.11)),Y=c||b&&A>=9;function fe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var te=function(e,n){var u=e.className,l=fe(n).exec(u);if(l){var f=u.slice(l.index+l[0].length);e.className=u.slice(0,l.index)+(f?l[1]+f:"")}};function ne(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function ye(e,n){return ne(e).appendChild(n)}function ve(e,n,u,l){var f=document.createElement(e);if(u&&(f.className=u),l&&(f.style.cssText=l),typeof n=="string")f.appendChild(document.createTextNode(n));else if(n)for(var m=0;m<n.length;++m)f.appendChild(n[m]);return f}function de(e,n,u,l){var f=ve(e,n,u,l);return f.setAttribute("role","presentation"),f}var ue;document.createRange?ue=function(e,n,u,l){var f=document.createRange();return f.setEnd(l||e,u),f.setStart(e,n),f}:ue=function(e,n,u){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(f){return l}return l.collapse(!0),l.moveEnd("character",u),l.moveStart("character",n),l};function oe(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function De(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Ve(e,n){var u=e.className;fe(n).test(u)||(e.className+=(u?" ":"")+n)}function Le(e,n){for(var u=e.split(" "),l=0;l<u.length;l++)u[l]&&!fe(u[l]).test(n)&&(n+=" "+u[l]);return n}var ke=function(e){e.select()};R?ke=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(ke=function(e){try{e.select()}catch(n){}});function rt(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function Qe(e,n,u){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(u!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function Xe(e,n,u,l,f){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var m=l||0,F=f||0;;){var U=e.indexOf(" ",m);if(U<0||U>=n)return F+(n-m);F+=U-m,F+=u-F%u,m=U+1}}var ut=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ut.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ut.prototype.set=function(e,n){this.f=n;var u=+new Date+e;(!this.id||u<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=u)};function pt(e,n){for(var u=0;u<e.length;++u)if(e[u]==n)return u;return-1}var yt=50,qe={toString:function(){return"CodeMirror.Pass"}},lt={scroll:!1},vt={origin:"*mouse"},mt={origin:"+move"};function dt(e,n,u){for(var l=0,f=0;;){var m=e.indexOf(" ",l);m==-1&&(m=e.length);var F=m-l;if(m==e.length||f+F>=n)return l+Math.min(F,n-f);if(f+=m-l,f+=u-f%u,l=m+1,f>=n)return l}}var kt=[""];function It(e){for(;kt.length<=e;)kt.push(At(kt)+" ");return kt[e]}function At(e){return e[e.length-1]}function jt(e,n){for(var u=[],l=0;l<e.length;l++)u[l]=n(e[l],l);return u}function Nt(e,n,u){for(var l=0,f=u(n);l<e.length&&u(e[l])<=f;)l++;e.splice(l,0,n)}function $t(){}function St(e,n){var u;return Object.create?u=Object.create(e):($t.prototype=e,u=new $t),n&&Qe(n,u),u}var Mt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Mt.test(e))}function G(e,n){return n?n.source.indexOf("\\w")>-1&&pe(e)?!0:n.test(e):pe(e)}function K(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Re(e){return e.charCodeAt(0)>=768&&we.test(e)}function be(e,n,u){for(;(u<0?n>0:n<e.length)&&Re(e.charAt(n));)n+=u;return n}function Ae(e,n,u){for(var l=n>u?-1:1;;){if(n==u)return n;var f=(n+u)/2,m=l<0?Math.ceil(f):Math.floor(f);if(m==n)return e(m)?n:u;e(m)?u=m:n=m+l}}function T(e,n,u,l){if(!e)return l(n,u,"ltr",0);for(var f=!1,m=0;m<e.length;++m){var F=e[m];(F.from<u&&F.to>n||n==u&&F.to==n)&&(l(Math.max(F.from,n),Math.min(F.to,u),F.level==1?"rtl":"ltr",m),f=!0)}f||l(n,u,"ltr")}var Ie=null;function W(e,n,u){var l;Ie=null;for(var f=0;f<e.length;++f){var m=e[f];if(m.from<n&&m.to>n)return f;m.to==n&&(m.from!=m.to&&u=="before"?l=f:Ie=f),m.from==n&&(m.from!=m.to&&u!="before"?l=f:Ie=f)}return l!=null?l:Ie}var O=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(Z){return Z<=247?e.charAt(Z):1424<=Z&&Z<=1524?"R":1536<=Z&&Z<=1785?n.charAt(Z-1536):1774<=Z&&Z<=2220?"r":8192<=Z&&Z<=8203?"w":Z==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,m=/[LRr]/,F=/[Lb1n]/,U=/[1n]/;function z(Z,xe,Ee){this.level=Z,this.from=xe,this.to=Ee}return function(Z,xe){var Ee=xe=="ltr"?"L":"R";if(Z.length==0||xe=="ltr"&&!l.test(Z))return!1;for(var Ne=Z.length,Me=[],Ye=0;Ye<Ne;++Ye)Me.push(u(Z.charCodeAt(Ye)));for(var tt=0,at=Ee;tt<Ne;++tt){var ft=Me[tt];ft=="m"?Me[tt]=at:at=ft}for(var ht=0,ct=Ee;ht<Ne;++ht){var bt=Me[ht];bt=="1"&&ct=="r"?Me[ht]="n":m.test(bt)&&(ct=bt,bt=="r"&&(Me[ht]="R"))}for(var Pt=1,Ot=Me[0];Pt<Ne-1;++Pt){var Ut=Me[Pt];Ut=="+"&&Ot=="1"&&Me[Pt+1]=="1"?Me[Pt]="1":Ut==","&&Ot==Me[Pt+1]&&(Ot=="1"||Ot=="n")&&(Me[Pt]=Ot),Ot=Ut}for(var ar=0;ar<Ne;++ar){var Hr=Me[ar];if(Hr==",")Me[ar]="N";else if(Hr=="%"){var vr=void 0;for(vr=ar+1;vr<Ne&&Me[vr]=="%";++vr);for(var xn=ar&&Me[ar-1]=="!"||vr<Ne&&Me[vr]=="1"?"1":"N",fn=ar;fn<vr;++fn)Me[fn]=xn;ar=vr-1}}for(var kr=0,rn=Ee;kr<Ne;++kr){var zr=Me[kr];rn=="L"&&zr=="1"?Me[kr]="L":m.test(zr)&&(rn=zr)}for(var Nr=0;Nr<Ne;++Nr)if(f.test(Me[Nr])){var Rr=void 0;for(Rr=Nr+1;Rr<Ne&&f.test(Me[Rr]);++Rr);for(var wr=(Nr?Me[Nr-1]:Ee)=="L",cn=(Rr<Ne?Me[Rr]:Ee)=="L",lo=wr==cn?wr?"L":"R":Ee,Ui=Nr;Ui<Rr;++Ui)Me[Ui]=lo;Nr=Rr-1}for(var Jr=[],zn,Er=0;Er<Ne;)if(F.test(Me[Er])){var bl=Er;for(++Er;Er<Ne&&F.test(Me[Er]);++Er);Jr.push(new z(0,bl,Er))}else{var Cn=Er,ji=Jr.length,Xr=xe=="rtl"?1:0;for(++Er;Er<Ne&&Me[Er]!="L";++Er);for(var dn=Cn;dn<Er;)if(U.test(Me[dn])){Cn<dn&&(Jr.splice(ji,0,new z(1,Cn,dn)),ji+=Xr);var uo=dn;for(++dn;dn<Er&&U.test(Me[dn]);++dn);Jr.splice(ji,0,new z(2,uo,dn)),ji+=Xr,Cn=dn}else++dn;Cn<Er&&Jr.splice(ji,0,new z(1,Cn,Er))}return xe=="ltr"&&(Jr[0].level==1&&(zn=Z.match(/^\s+/))&&(Jr[0].from=zn[0].length,Jr.unshift(new z(0,0,zn[0].length))),At(Jr).level==1&&(zn=Z.match(/\s+$/))&&(At(Jr).to-=zn[0].length,Jr.push(new z(0,Ne-zn[0].length,Ne)))),xe=="rtl"?Jr.reverse():Jr}}();function P(e,n){var u=e.order;return u==null&&(u=e.order=O(e.text,n)),u}var ie=[],D=function(e,n,u){if(e.addEventListener)e.addEventListener(n,u,!1);else if(e.attachEvent)e.attachEvent("on"+n,u);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||ie).concat(u)}};function ee(e,n){return e._handlers&&e._handlers[n]||ie}function ce(e,n,u){if(e.removeEventListener)e.removeEventListener(n,u,!1);else if(e.detachEvent)e.detachEvent("on"+n,u);else{var l=e._handlers,f=l&&l[n];if(f){var m=pt(f,u);m>-1&&(l[n]=f.slice(0,m).concat(f.slice(m+1)))}}}function Oe(e,n){var u=ee(e,n);if(!!u.length)for(var l=Array.prototype.slice.call(arguments,2),f=0;f<u.length;++f)u[f].apply(null,l)}function Pe(e,n,u){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),Oe(e,u||n.type,e,n),Ct(n)||n.codemirrorIgnore}function Te(e){var n=e._handlers&&e._handlers.cursorActivity;if(!!n)for(var u=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)pt(u,n[l])==-1&&u.push(n[l])}function Ge(e,n){return ee(e,n).length>0}function He(e){e.prototype.on=function(n,u){D(this,n,u)},e.prototype.off=function(n,u){ce(this,n,u)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function gt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ct(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Jt(e){it(e),gt(e)}function Ft(e){return e.target||e.srcElement}function wn(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),C&&e.ctrlKey&&n==1&&(n=3),n}var Zr=function(){if(b&&A<9)return!1;var e=ve("div");return"draggable"in e||"dragDrop"in e}(),On;function Gi(e){if(On==null){var n=ve("span","\u200B");ye(e,ve("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(On=n.offsetWidth<=1&&n.offsetHeight>2&&!(b&&A<8))}var u=On?ve("span","\u200B"):ve("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return u.setAttribute("cm-text",""),u}var jr;function Nn(e){if(jr!=null)return jr;var n=ye(e,document.createTextNode("A\u062EA")),u=ue(n,0,1).getBoundingClientRect(),l=ue(n,1,2).getBoundingClientRect();return ne(e),!u||u.left==u.right?!1:jr=l.right-u.right<3}var $n=`
19
19
 
20
20
  b`.split(/\n/).length!=3?function(e){for(var n=0,u=[],l=e.length;n<=l;){var f=e.indexOf(`
21
- `,n);f==-1&&(f=e.length);var m=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),F=m.indexOf("\r");F!=-1?(u.push(m.slice(0,F)),n+=F+1):(u.push(m),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Tn=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(u){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},Kn=function(){var e=ve("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pn=null;function Oa(e){if(pn!=null)return pn;var n=ye(e,ve("span","x")),u=n.getBoundingClientRect(),l=ue(n,0,1).getBoundingClientRect();return pn=Math.abs(u.left-l.left)>1}var jo={},Sn={};function Yn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),jo[e]=n}function yi(e,n){Sn[e]=n}function $i(e){if(typeof e=="string"&&Sn.hasOwnProperty(e))e=Sn[e];else if(e&&typeof e.name=="string"&&Sn.hasOwnProperty(e.name)){var n=Sn[e.name];typeof n=="string"&&(n={name:n}),e=St(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $i("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $i("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Bn(e,n){n=$i(n);var u=jo[n.name];if(!u)return Bn(e,"text/plain");var l=u(e,n);if(mi.hasOwnProperty(n.name)){var f=mi[n.name];for(var m in f)!f.hasOwnProperty(m)||(l.hasOwnProperty(m)&&(l["_"+m]=l[m]),l[m]=f[m])}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var F in n.modeProps)l[F]=n.modeProps[F];return l}var mi={};function Ta(e,n){var u=mi.hasOwnProperty(e)?mi[e]:mi[e]={};Qe(n,u)}function Pn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var u={};for(var l in n){var f=n[l];f instanceof Array&&(f=f.concat([])),u[l]=f}return u}function An(e,n){for(var u;e.innerMode&&(u=e.innerMode(n),!(!u||u.mode==e));)n=u.state,e=u.mode;return u||{mode:e,state:n}}function xi(e,n,u){return e.startState?e.startState(n,u):!0}var mr=function(e,n,u){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};mr.prototype.eol=function(){return this.pos>=this.string.length},mr.prototype.sol=function(){return this.pos==this.lineStart},mr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mr.prototype.eat=function(e){var n=this.string.charAt(this.pos),u;if(typeof e=="string"?u=n==e:u=n&&(e.test?e.test(n):e(n)),u)return++this.pos,n},mr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},mr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mr.prototype.skipToEnd=function(){this.pos=this.string.length},mr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},mr.prototype.backUp=function(e){this.pos-=e},mr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},mr.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},mr.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(F){return u?F.toLowerCase():F},f=this.string.substr(this.pos,e.length);if(l(f)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var m=this.string.slice(this.pos).match(e);return m&&m.index>0?null:(m&&n!==!1&&(this.pos+=m[0].length),m)}},mr.prototype.current=function(){return this.string.slice(this.start,this.pos)},mr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},mr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},mr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Et(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var f=u.children[l],m=f.chunkSize();if(n<m){u=f;break}n-=m}return u.lines[n]}function qn(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(m){var F=m.text;f==u.line&&(F=F.slice(0,u.ch)),f==n.line&&(F=F.slice(n.ch)),l.push(F),++f}),l}function bi(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function En(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function qt(e){if(e.parent==null)return null;for(var n=e.parent,u=pt(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var f=0;l.children[f]!=n;++f)u+=l.children[f].chunkSize();return u+n.first}function Un(e,n){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var f=e.children[l],m=f.height;if(n<m){e=f;continue e}n-=m,u+=f.chunkSize()}return u}while(!e.lines);for(var F=0;F<e.lines.length;++F){var U=e.lines[F],z=U.height;if(n<z)break;n-=z}return u+F}function Jn(e,n){return n>=e.first&&n<e.first+e.size}function po(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function nt(e,n,u){if(u===void 0&&(u=null),!(this instanceof nt))return new nt(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Lt(e,n){return e.line-n.line||e.ch-n.ch}function ei(e,n){return e.sticky==n.sticky&&Lt(e,n)==0}function se(e){return nt(e.line,e.ch)}function Ce(e,n){return Lt(e,n)<0?n:e}function _e(e,n){return Lt(e,n)<0?e:n}function ot(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function st(e,n){if(n.line<e.first)return nt(e.first,0);var u=e.first+e.size-1;return n.line>u?nt(u,Et(e,u).text.length):Kt(n,Et(e,n.line).text.length)}function Kt(e,n){var u=e.ch;return u==null||u>n?nt(e.line,n):u<0?nt(e.line,0):e}function Zt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=st(e,n[l]);return u}var Tr=function(e,n){this.state=e,this.lookAhead=n},Pr=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Pr.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Pr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Pr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Pr.fromSaved=function(e,n,u){return n instanceof Tr?new Pr(e,Pn(e.mode,n.state),u,n.lookAhead):new Pr(e,Pn(e.mode,n),u)},Pr.prototype.save=function(e){var n=e!==!1?Pn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tr(n,this.maxLookAhead):n};function er(e,n,u,l){var f=[e.state.modeGen],m={};jl(e,n.text,e.doc.mode,u,function(Z,xe){return f.push(Z,xe)},m,l);for(var F=u.state,U=function(Z){u.baseTokens=f;var xe=e.state.overlays[Z],Ee=1,Ne=0;u.state=!0,jl(e,n.text,xe.mode,u,function(Me,Ye){for(var tt=Ee;Ne<Me;){var at=f[Ee];at>Me&&f.splice(Ee,1,Me,f[Ee+1],at),Ee+=2,Ne=Math.min(Me,at)}if(!!Ye)if(xe.opaque)f.splice(tt,Ee-tt,Me,"overlay "+Ye),Ee=tt+2;else for(;tt<Ee;tt+=2){var ft=f[tt+1];f[tt+1]=(ft?ft+" ":"")+"overlay "+Ye}},m),u.state=F,u.baseTokens=null,u.baseTokenPos=1},z=0;z<e.state.overlays.length;++z)U(z);return{styles:f,classes:m.bgClass||m.textClass?m:null}}function Bl(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=_r(e,qt(n)),f=n.text.length>e.options.maxHighlightLength&&Pn(e.doc.mode,l.state),m=er(e,n,l);f&&(l.state=f),n.stateAfter=l.save(!f),n.styles=m.styles,m.classes?n.styleClasses=m.classes:n.styleClasses&&(n.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function _r(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Pr(l,!0,n);var m=gf(e,n,u),F=m>l.first&&Et(l,m-1).stateAfter,U=F?Pr.fromSaved(l,F,m):new Pr(l,xi(l.mode),m);return l.iter(m,n,function(z){ms(e,z.text,U);var Z=U.line;z.stateAfter=Z==n-1||Z%5==0||Z>=f.viewFrom&&Z<f.viewTo?U.save():null,U.nextLine()}),u&&(l.modeFrontier=U.line),U}function ms(e,n,u,l){var f=e.doc.mode,m=new mr(n,e.options.tabSize,u);for(m.start=m.pos=l||0,n==""&&Pa(f,u.state);!m.eol();)xs(f,m,u.state),m.start=m.pos}function Pa(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=An(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function xs(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=An(e,u).mode);var m=e.token(n,u);if(n.pos>n.start)return m}throw new Error("Mode "+e.name+" failed to advance stream.")}var bs=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function ws(e,n,u,l){var f=e.doc,m=f.mode,F;n=st(f,n);var U=Et(f,n.line),z=_r(e,n.line,u),Z=new mr(U.text,e.options.tabSize,z),xe;for(l&&(xe=[]);(l||Z.pos<n.ch)&&!Z.eol();)Z.start=Z.pos,F=xs(m,Z,z.state),l&&xe.push(new bs(Z,F,Pn(f.mode,z.state)));return l?xe:new bs(Z,F,z.state)}function Ul(e,n){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";n[l]==null?n[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+u[2])}return e}function jl(e,n,u,l,f,m,F){var U=u.flattenSpans;U==null&&(U=e.options.flattenSpans);var z=0,Z=null,xe=new mr(n,e.options.tabSize,l),Ee,Ne=e.options.addModeClass&&[null];for(n==""&&Ul(Pa(u,l.state),m);!xe.eol();){if(xe.pos>e.options.maxHighlightLength?(U=!1,F&&ms(e,n,l,xe.pos),xe.pos=n.length,Ee=null):Ee=Ul(xs(u,xe,l.state,Ne),m),Ne){var Me=Ne[0].name;Me&&(Ee="m-"+(Ee?Me+" "+Ee:Me))}if(!U||Z!=Ee){for(;z<xe.start;)z=Math.min(xe.start,z+5e3),f(z,Z);Z=Ee}xe.start=xe.pos}for(;z<xe.pos;){var Ye=Math.min(xe.pos,z+5e3);f(Ye,Z),z=Ye}}function gf(e,n,u){for(var l,f,m=e.doc,F=u?-1:n-(e.doc.mode.innerMode?1e3:100),U=n;U>F;--U){if(U<=m.first)return m.first;var z=Et(m,U-1),Z=z.stateAfter;if(Z&&(!u||U+(Z instanceof Tr?Z.lookAhead:0)<=m.modeFrontier))return U;var xe=Xe(z.text,null,e.options.tabSize);(f==null||l>xe)&&(f=U-1,l=xe)}return f}function yf(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),!(e.highlightFrontier<n-10)){for(var u=e.first,l=n-1;l>u;l--){var f=Et(e,l).stateAfter;if(f&&(!(f instanceof Tr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var mf=!1,wi=!1;function xf(){mf=!0}function bf(){wi=!0}function Ia(e,n,u){this.marker=e,this.from=n,this.to=u}function Vo(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function wf(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function md(e,n,u){var l=u&&window.WeakSet&&(u.markedSpans||(u.markedSpans=new WeakSet));l&&l.has(e.markedSpans)?e.markedSpans.push(n):(e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],l&&l.add(e.markedSpans)),n.marker.attachLine(e)}function xd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);if(U||m.from==n&&F.type=="bookmark"&&(!u||!m.marker.insertLeft)){var z=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);(l||(l=[])).push(new Ia(F,m.from,z?null:m.to))}}return l}function bd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);if(U||m.from==n&&F.type=="bookmark"&&(!u||m.marker.insertLeft)){var z=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);(l||(l=[])).push(new Ia(F,z?null:m.from-n,m.to==null?null:m.to-n))}}return l}function Vl(e,n){if(n.full)return null;var u=Jn(e,n.from.line)&&Et(e,n.from.line).markedSpans,l=Jn(e,n.to.line)&&Et(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,m=n.to.ch,F=Lt(n.from,n.to)==0,U=xd(u,f,F),z=bd(l,m,F),Z=n.text.length==1,xe=At(n.text).length+(Z?f:0);if(U)for(var Ee=0;Ee<U.length;++Ee){var Ne=U[Ee];if(Ne.to==null){var Me=Vo(z,Ne.marker);Me?Z&&(Ne.to=Me.to==null?null:Me.to+xe):Ne.to=f}}if(z)for(var Ye=0;Ye<z.length;++Ye){var tt=z[Ye];if(tt.to!=null&&(tt.to+=xe),tt.from==null){var at=Vo(U,tt.marker);at||(tt.from=xe,Z&&(U||(U=[])).push(tt))}else tt.from+=xe,Z&&(U||(U=[])).push(tt)}U&&(U=Wl(U)),z&&z!=U&&(z=Wl(z));var ft=[U];if(!Z){var ht=n.text.length-2,ct;if(ht>0&&U)for(var bt=0;bt<U.length;++bt)U[bt].to==null&&(ct||(ct=[])).push(new Ia(U[bt].marker,null,null));for(var Pt=0;Pt<ht;++Pt)ft.push(ct);ft.push(z)}return ft}function Wl(e){for(var n=0;n<e.length;++n){var u=e[n];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Hl(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(Me){if(Me.markedSpans)for(var Ye=0;Ye<Me.markedSpans.length;++Ye){var tt=Me.markedSpans[Ye].marker;tt.readOnly&&(!l||pt(l,tt)==-1)&&(l||(l=[])).push(tt)}}),!l)return null;for(var f=[{from:n,to:u}],m=0;m<l.length;++m)for(var F=l[m],U=F.find(0),z=0;z<f.length;++z){var Z=f[z];if(!(Lt(Z.to,U.from)<0||Lt(Z.from,U.to)>0)){var xe=[z,1],Ee=Lt(Z.from,U.from),Ne=Lt(Z.to,U.to);(Ee<0||!F.inclusiveLeft&&!Ee)&&xe.push({from:Z.from,to:U.from}),(Ne>0||!F.inclusiveRight&&!Ne)&&xe.push({from:U.to,to:Z.to}),f.splice.apply(f,xe),z+=xe.length-3}}return f}function zl(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function Sf(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function Ss(e){return e.inclusiveLeft?-1:0}function As(e){return e.inclusiveRight?1:0}function Gl(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),m=Lt(l.from,f.from)||Ss(e)-Ss(n);if(m)return-m;var F=Lt(l.to,f.to)||As(e)-As(n);return F||n.id-e.id}function Wo(e,n){var u=wi&&e.markedSpans,l;if(u)for(var f=void 0,m=0;m<u.length;++m)f=u[m],f.marker.collapsed&&(n?f.from:f.to)==null&&(!l||Gl(l,f.marker)<0)&&(l=f.marker);return l}function zt(e){return Wo(e,!0)}function Ki(e){return Wo(e,!1)}function Gt(e,n){var u=wi&&e.markedSpans,l;if(u)for(var f=0;f<u.length;++f){var m=u[f];m.marker.collapsed&&(m.from==null||m.from<n)&&(m.to==null||m.to>n)&&(!l||Gl(l,m.marker)<0)&&(l=m.marker)}return l}function Yi(e,n,u,l,f){var m=Et(e,n),F=wi&&m.markedSpans;if(F)for(var U=0;U<F.length;++U){var z=F[U];if(!!z.marker.collapsed){var Z=z.marker.find(0),xe=Lt(Z.from,u)||Ss(z.marker)-Ss(f),Ee=Lt(Z.to,l)||As(z.marker)-As(f);if(!(xe>=0&&Ee<=0||xe<=0&&Ee>=0)&&(xe<=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.to,u)>=0:Lt(Z.to,u)>0)||xe>=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.from,l)<=0:Lt(Z.from,l)<0)))return!0}}}function xt(e){for(var n;n=zt(e);)e=n.find(-1,!0).line;return e}function In(e){for(var n;n=Ki(e);)e=n.find(1,!0).line;return e}function Af(e){for(var n,u;n=Ki(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function Es(e,n){var u=Et(e,n),l=xt(u);return u==l?n:qt(l)}function $l(e,n){if(n>e.lastLine())return n;var u=Et(e,n),l;if(!ti(e,u))return n;for(;l=Ki(u);)u=l.find(1,!0).line;return qt(u)+1}function ti(e,n){var u=wi&&n.markedSpans;if(u){for(var l=void 0,f=0;f<u.length;++f)if(l=u[f],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&Cs(e,n,l))return!0}}}function Cs(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return Cs(e,l.line,Vo(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==n.text.length)return!0;for(var f=void 0,m=0;m<n.markedSpans.length;++m)if(f=n.markedSpans[m],f.marker.collapsed&&!f.marker.widgetNode&&f.from==u.to&&(f.to==null||f.to!=u.from)&&(f.marker.inclusiveLeft||u.marker.inclusiveRight)&&Cs(e,n,f))return!0}function ri(e){e=xt(e);for(var n=0,u=e.parent,l=0;l<u.lines.length;++l){var f=u.lines[l];if(f==e)break;n+=f.height}for(var m=u.parent;m;u=m,m=u.parent)for(var F=0;F<m.children.length;++F){var U=m.children[F];if(U==u)break;n+=U.height}return n}function Ho(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=zt(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Ki(l);){var m=u.find(0,!0);n-=l.text.length-m.from.ch,l=m.to.line,n+=l.text.length-m.to.ch}return n}function ho(e){var n=e.display,u=e.doc;n.maxLine=Et(u,u.first),n.maxLineLength=Ho(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=Ho(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var Ji=function(e,n,u){this.text=e,Sf(this,n),this.height=u?u(this):1};Ji.prototype.lineNo=function(){return qt(this)},He(Ji);function Kl(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),zl(e),Sf(e,u);var f=l?l(e):1;f!=e.height&&En(e,f)}function Yl(e){e.parent=null,zl(e)}var Ef={},Cf={};function Os(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Cf:Ef;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Jl(e,n){var u=de("span",null,null,g?"padding-right: .1px":null),l={pre:de("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var f=0;f<=(n.rest?n.rest.length:0);f++){var m=f?n.rest[f-1]:n.line,F=void 0;l.pos=0,l.addToken=hn,Nn(e.display.measure)&&(F=P(m,e.doc.direction))&&(l.addToken=Go(l.addToken,F)),l.map=[];var U=n!=e.display.externalMeasured&&qt(m);Of(m,l,Bl(e,m,U)),m.styleClasses&&(m.styleClasses.bgClass&&(l.bgClass=Le(m.styleClasses.bgClass,l.bgClass||"")),m.styleClasses.textClass&&(l.textClass=Le(m.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Gi(e.display.measure))),f==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(g){var z=l.content.lastChild;(/\bcm-tab\b/.test(z.className)||z.querySelector&&z.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Le(l.pre.className,l.textClass||"")),l}function zo(e){var n=ve("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function hn(e,n,u,l,f,m,F){if(!!n){var U=e.splitSpaces?wd(n,e.trailingSpace):n,z=e.cm.state.specialChars,Z=!1,xe;if(!z.test(n))e.col+=n.length,xe=document.createTextNode(U),e.map.push(e.pos,e.pos+n.length,xe),b&&A<9&&(Z=!0),e.pos+=n.length;else{xe=document.createDocumentFragment();for(var Ee=0;;){z.lastIndex=Ee;var Ne=z.exec(n),Me=Ne?Ne.index-Ee:n.length-Ee;if(Me){var Ye=document.createTextNode(U.slice(Ee,Ee+Me));b&&A<9?xe.appendChild(ve("span",[Ye])):xe.appendChild(Ye),e.map.push(e.pos,e.pos+Me,Ye),e.col+=Me,e.pos+=Me}if(!Ne)break;Ee+=Me+1;var tt=void 0;if(Ne[0]==" "){var at=e.cm.options.tabSize,ft=at-e.col%at;tt=xe.appendChild(ve("span",It(ft),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=ft}else Ne[0]=="\r"||Ne[0]==`
22
- `?(tt=xe.appendChild(ve("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",Ne[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(Ne[0]),tt.setAttribute("cm-text",Ne[0]),b&&A<9?xe.appendChild(ve("span",[tt])):xe.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=U.charCodeAt(n.length-1)==32,u||l||f||Z||m||F){var ht=u||"";l&&(ht+=l),f&&(ht+=f);var ct=ve("span",[xe],ht,m);if(F)for(var bt in F)F.hasOwnProperty(bt)&&bt!="style"&&bt!="class"&&ct.setAttribute(bt,F[bt]);return e.content.appendChild(ct)}e.content.appendChild(xe)}}function wd(e,n){if(e.length>1&&!/ /.test(e))return e;for(var u=n,l="",f=0;f<e.length;f++){var m=e.charAt(f);m==" "&&u&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(m="\xA0"),l+=m,u=m==" "}return l}function Go(e,n){return function(u,l,f,m,F,U,z){f=f?f+" cm-force-border":"cm-force-border";for(var Z=u.pos,xe=Z+l.length;;){for(var Ee=void 0,Ne=0;Ne<n.length&&(Ee=n[Ne],!(Ee.to>Z&&Ee.from<=Z));Ne++);if(Ee.to>=xe)return e(u,l,f,m,F,U,z);e(u,l.slice(0,Ee.to-Z),f,m,null,U,z),m=null,l=l.slice(Ee.to-Z),Z=Ee.to}}}function Xl(e,n,u,l){var f=!l&&u.widgetNode;f&&e.map.push(e.pos,e.pos+n,f),!l&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",u.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=n,e.trailingSpace=!1}function Of(e,n,u){var l=e.markedSpans,f=e.text,m=0;if(!l){for(var F=1;F<u.length;F+=2)n.addToken(n,f.slice(m,m=u[F]),Os(u[F+1],n.cm.options));return}for(var U=f.length,z=0,Z=1,xe="",Ee,Ne,Me=0,Ye,tt,at,ft,ht;;){if(Me==z){Ye=tt=at=Ne="",ht=null,ft=null,Me=1/0;for(var ct=[],bt=void 0,Pt=0;Pt<l.length;++Pt){var Ot=l[Pt],Ut=Ot.marker;if(Ut.type=="bookmark"&&Ot.from==z&&Ut.widgetNode)ct.push(Ut);else if(Ot.from<=z&&(Ot.to==null||Ot.to>z||Ut.collapsed&&Ot.to==z&&Ot.from==z)){if(Ot.to!=null&&Ot.to!=z&&Me>Ot.to&&(Me=Ot.to,tt=""),Ut.className&&(Ye+=" "+Ut.className),Ut.css&&(Ne=(Ne?Ne+";":"")+Ut.css),Ut.startStyle&&Ot.from==z&&(at+=" "+Ut.startStyle),Ut.endStyle&&Ot.to==Me&&(bt||(bt=[])).push(Ut.endStyle,Ot.to),Ut.title&&((ht||(ht={})).title=Ut.title),Ut.attributes)for(var ar in Ut.attributes)(ht||(ht={}))[ar]=Ut.attributes[ar];Ut.collapsed&&(!ft||Gl(ft.marker,Ut)<0)&&(ft=Ot)}else Ot.from>z&&Me>Ot.from&&(Me=Ot.from)}if(bt)for(var Hr=0;Hr<bt.length;Hr+=2)bt[Hr+1]==Me&&(tt+=" "+bt[Hr]);if(!ft||ft.from==z)for(var vr=0;vr<ct.length;++vr)Xl(n,0,ct[vr]);if(ft&&(ft.from||0)==z){if(Xl(n,(ft.to==null?U+1:ft.to)-z,ft.marker,ft.from==null),ft.to==null)return;ft.to==z&&(ft=!1)}}if(z>=U)break;for(var xn=Math.min(U,Me);;){if(xe){var fn=z+xe.length;if(!ft){var kr=fn>xn?xe.slice(0,xn-z):xe;n.addToken(n,kr,Ee?Ee+Ye:Ye,at,z+kr.length==Me?tt:"",Ne,ht)}if(fn>=xn){xe=xe.slice(xn-z),z=xn;break}z=fn,at=""}xe=f.slice(m,m=u[Z++]),Ee=Os(u[Z++],n.cm.options)}}}function Vr(e,n,u){this.line=n,this.rest=Af(n),this.size=this.rest?qt(At(this.rest))-u+1:1,this.node=this.text=null,this.hidden=ti(e,n)}function $o(e,n,u){for(var l=[],f,m=n;m<u;m=f){var F=new Vr(e.doc,Et(e.doc,m),m);f=m+F.size,l.push(F)}return l}var vo=null;function Tf(e){vo?vo.ops.push(e):e.ownsGroup=vo={ops:[e],delayedCallbacks:[]}}function Pf(e){var n=e.delayedCallbacks,u=0;do{for(;u<n.length;u++)n[u].call(null);for(var l=0;l<e.ops.length;l++){var f=e.ops[l];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(u<n.length)}function Ql(e,n){var u=e.ownsGroup;if(!!u)try{Pf(u)}finally{vo=null,n(u)}}var Ko=null;function Wr(e,n){var u=ee(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;vo?f=vo.delayedCallbacks:Ko?f=Ko:(f=Ko=[],setTimeout(Ts,0));for(var m=function(U){f.push(function(){return u[U].apply(null,l)})},F=0;F<u.length;++F)m(F)}}function Ts(){var e=Ko;Ko=null;for(var n=0;n<e.length;++n)e[n]()}function Ps(e,n,u,l){for(var f=0;f<n.changes.length;f++){var m=n.changes[f];m=="text"?Is(e,n):m=="gutter"?Zl(e,n,u,l):m=="class"?Fs(e,n):m=="widget"&&Sd(e,n,l)}n.changes=null}function go(e){return e.node==e.text&&(e.node=ve("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&A<8&&(e.node.style.zIndex=2)),e.node}function If(e,n){var u=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),n.background)u?n.background.className=u:(n.background.parentNode.removeChild(n.background),n.background=null);else if(u){var l=go(n);n.background=l.insertBefore(ve("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function Fa(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):Jl(e,n)}function Is(e,n){var u=n.text.className,l=Fa(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Fs(e,n)):u&&(n.text.className=u)}function Fs(e,n){If(e,n),n.line.wrapClass?go(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var u=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=u||""}function Zl(e,n,u,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var f=go(n);n.gutterBackground=ve("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),f.insertBefore(n.gutterBackground,n.text)}var m=n.line.gutterMarkers;if(e.options.lineNumbers||m){var F=go(n),U=n.gutter=ve("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(U.setAttribute("aria-hidden","true"),e.display.input.setUneditable(U),F.insertBefore(U,n.text),n.line.gutterClass&&(U.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!m||!m["CodeMirror-linenumbers"])&&(n.lineNumber=U.appendChild(ve("div",po(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),m)for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=e.display.gutterSpecs[z].className,xe=m.hasOwnProperty(Z)&&m[Z];xe&&U.appendChild(ve("div",[xe],"CodeMirror-gutter-elt","left: "+l.gutterLeft[Z]+"px; width: "+l.gutterWidth[Z]+"px"))}}}function Sd(e,n,u){n.alignable&&(n.alignable=null);for(var l=fe("CodeMirror-linewidget"),f=n.node.firstChild,m=void 0;f;f=m)m=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);_l(e,n,u)}function Ad(e,n,u,l){var f=Fa(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Fs(e,n),Zl(e,n,u,l),_l(e,n,l),n.node}function _l(e,n,u){if(Si(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Si(e,n.rest[l],n,u,!1)}function Si(e,n,u,l,f){if(!!n.widgets)for(var m=go(u),F=0,U=n.widgets;F<U.length;++F){var z=U[F],Z=ve("div",[z.node],"CodeMirror-linewidget"+(z.className?" "+z.className:""));z.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),Ff(z,Z,u,l),e.display.input.setUneditable(Z),f&&z.above?m.insertBefore(Z,u.gutter||u.text):m.appendChild(Z),Wr(z,"redraw")}}function Ff(e,n,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(n);var f=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(f-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=f+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Yo(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!oe(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+n.display.wrapper.clientWidth+"px;"),ye(n.display.measure,ve("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function ni(e,n){for(var u=Ft(n);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function ka(e){return e.lineSpace.offsetTop}function ks(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ql(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=ye(e.measure,ve("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Xn(e){return yt-e.display.nativeBarWidth}function vn(e){return e.display.scroller.clientWidth-Xn(e)-e.display.barWidth}function Ra(e){return e.display.scroller.clientHeight-Xn(e)-e.display.barHeight}function Xi(e,n,u){var l=e.options.lineWrapping,f=l&&vn(e);if(!n.measure.heights||l&&n.measure.width!=f){var m=n.measure.heights=[];if(l){n.measure.width=f;for(var F=n.text.firstChild.getClientRects(),U=0;U<F.length-1;U++){var z=F[U],Z=F[U+1];Math.abs(z.bottom-Z.bottom)>2&&m.push((z.bottom+Z.top)/2-u.top)}}m.push(u.bottom-u.top)}}function eu(e,n,u){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var f=0;f<e.rest.length;f++)if(qt(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function kf(e,n){n=xt(n);var u=qt(n),l=e.display.externalMeasured=new Vr(e.doc,n,u);l.lineN=u;var f=l.built=Jl(e,l);return l.text=f.pre,ye(e.display.lineMeasure,f.pre),l}function tu(e,n,u,l){return gn(e,yo(e,n),u,l)}function Rs(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[Ai(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function yo(e,n){var u=qt(n),l=Rs(e,u);l&&!l.text?l=null:l&&l.changes&&(Ps(e,l,u,js(e)),e.curOp.forceUpdate=!0),l||(l=kf(e,n));var f=eu(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function gn(e,n,u,l,f){n.before&&(u=-1);var m=u+(l||""),F;return n.cache.hasOwnProperty(m)?F=n.cache[m]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Xi(e,n.view,n.rect),n.hasHeights=!0),F=Ms(e,n,u,l),F.bogus||(n.cache[m]=F)),{left:F.left,right:F.right,top:f?F.rtop:F.top,bottom:f?F.rbottom:F.bottom}}var ru={left:0,right:0,top:0,bottom:0};function nu(e,n,u){for(var l,f,m,F,U,z,Z=0;Z<e.length;Z+=3)if(U=e[Z],z=e[Z+1],n<U?(f=0,m=1,F="left"):n<z?(f=n-U,m=f+1):(Z==e.length-3||n==z&&e[Z+3]>n)&&(m=z-U,f=m-1,n>=z&&(F="right")),f!=null){if(l=e[Z+2],U==z&&u==(l.insertLeft?"left":"right")&&(F=u),u=="left"&&f==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)l=e[(Z-=3)+2],F="left";if(u=="right"&&f==z-U)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)l=e[(Z+=3)+2],F="right";break}return{node:l,start:f,end:m,collapse:F,coverStart:U,coverEnd:z}}function Rf(e,n){var u=ru;if(n=="left")for(var l=0;l<e.length&&(u=e[l]).left==u.right;l++);else for(var f=e.length-1;f>=0&&(u=e[f]).left==u.right;f--);return u}function Ms(e,n,u,l){var f=nu(n.map,u,l),m=f.node,F=f.start,U=f.end,z=f.collapse,Z;if(m.nodeType==3){for(var xe=0;xe<4;xe++){for(;F&&Re(n.line.text.charAt(f.coverStart+F));)--F;for(;f.coverStart+U<f.coverEnd&&Re(n.line.text.charAt(f.coverStart+U));)++U;if(b&&A<9&&F==0&&U==f.coverEnd-f.coverStart?Z=m.parentNode.getBoundingClientRect():Z=Rf(ue(m,F,U).getClientRects(),l),Z.left||Z.right||F==0)break;U=F,F=F-1,z="right"}b&&A<11&&(Z=Mf(e.display.measure,Z))}else{F>0&&(z=l="right");var Ee;e.options.lineWrapping&&(Ee=m.getClientRects()).length>1?Z=Ee[l=="right"?Ee.length-1:0]:Z=m.getBoundingClientRect()}if(b&&A<9&&!F&&(!Z||!Z.left&&!Z.right)){var Ne=m.parentNode.getClientRects()[0];Ne?Z={left:Ne.left,right:Ne.left+xo(e.display),top:Ne.top,bottom:Ne.bottom}:Z=ru}for(var Me=Z.top-n.rect.top,Ye=Z.bottom-n.rect.top,tt=(Me+Ye)/2,at=n.view.measure.heights,ft=0;ft<at.length-1&&!(tt<at[ft]);ft++);var ht=ft?at[ft-1]:0,ct=at[ft],bt={left:(z=="right"?Z.right:Z.left)-n.rect.left,right:(z=="left"?Z.left:Z.right)-n.rect.left,top:ht,bottom:ct};return!Z.left&&!Z.right&&(bt.bogus=!0),e.options.singleCursorHeightPerLine||(bt.rtop=Me,bt.rbottom=Ye),bt}function Mf(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Oa(e))return n;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*u,right:n.right*u,top:n.top*l,bottom:n.bottom*l}}function iu(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function Ls(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)iu(e.display.view[n])}function Jo(e){Ls(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ds(){return N&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ns(){return N&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Bs(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=Yo(e.widgets[u]));return n}function Ma(e,n,u,l,f){if(!f){var m=Bs(n);u.top+=m,u.bottom+=m}if(l=="line")return u;l||(l="local");var F=ri(n);if(l=="local"?F+=ka(e.display):F-=e.display.viewOffset,l=="page"||l=="window"){var U=e.display.lineSpace.getBoundingClientRect();F+=U.top+(l=="window"?0:Ns());var z=U.left+(l=="window"?0:Ds());u.left+=z,u.right+=z}return u.top+=F,u.bottom+=F,u}function Us(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Ds(),f-=Ns();else if(u=="local"||!u){var m=e.display.sizer.getBoundingClientRect();l+=m.left,f+=m.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:l-F.left,top:f-F.top}}function La(e,n,u,l,f){return l||(l=Et(e.doc,n.line)),Ma(e,l,tu(e,l,n.ch,f),u)}function qr(e,n,u,l,f,m){l=l||Et(e.doc,n.line),f||(f=yo(e,l));function F(Ye,tt){var at=gn(e,f,Ye,tt?"right":"left",m);return tt?at.left=at.right:at.right=at.left,Ma(e,l,at,u)}var U=P(l,e.doc.direction),z=n.ch,Z=n.sticky;if(z>=l.text.length?(z=l.text.length,Z="before"):z<=0&&(z=0,Z="after"),!U)return F(Z=="before"?z-1:z,Z=="before");function xe(Ye,tt,at){var ft=U[tt],ht=ft.level==1;return F(at?Ye-1:Ye,ht!=at)}var Ee=W(U,z,Z),Ne=Ie,Me=xe(z,Ee,Z=="before");return Ne!=null&&(Me.other=xe(z,Ne,Z!="before")),Me}function Xo(e,n){var u=0;n=st(e.doc,n),e.options.lineWrapping||(u=xo(e.display)*n.ch);var l=Et(e.doc,n.line),f=ri(l)+ka(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function Qo(e,n,u,l,f){var m=nt(e,n,u);return m.xRel=f,l&&(m.outside=l),m}function Qi(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Qo(l.first,0,null,-1,-1);var f=Un(l,u),m=l.first+l.size-1;if(f>m)return Qo(l.first+l.size-1,Et(l,m).text.length,null,1,1);n<0&&(n=0);for(var F=Et(l,f);;){var U=Lf(e,F,f,n,u),z=Gt(F,U.ch+(U.xRel>0||U.outside>0?1:0));if(!z)return U;var Z=z.find(1);if(Z.line==f)return Z;F=Et(l,f=Z.line)}}function Zi(e,n,u,l){l-=Bs(n);var f=n.text.length,m=Ae(function(F){return gn(e,u,F-1).bottom<=l},f,0);return f=Ae(function(F){return gn(e,u,F).top>l},m,f),{begin:m,end:f}}function ou(e,n,u,l){u||(u=yo(e,n));var f=Ma(e,n,gn(e,u,l),"line").top;return Zi(e,n,u,f)}function Zo(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function Lf(e,n,u,l,f){f-=ri(n);var m=yo(e,n),F=Bs(n),U=0,z=n.text.length,Z=!0,xe=P(n,e.doc.direction);if(xe){var Ee=(e.options.lineWrapping?au:Df)(e,n,u,m,xe,l,f);Z=Ee.level!=1,U=Z?Ee.from:Ee.to-1,z=Z?Ee.to:Ee.from-1}var Ne=null,Me=null,Ye=Ae(function(Pt){var Ot=gn(e,m,Pt);return Ot.top+=F,Ot.bottom+=F,Zo(Ot,l,f,!1)?(Ot.top<=f&&Ot.left<=l&&(Ne=Pt,Me=Ot),!0):!1},U,z),tt,at,ft=!1;if(Me){var ht=l-Me.left<Me.right-l,ct=ht==Z;Ye=Ne+(ct?0:1),at=ct?"after":"before",tt=ht?Me.left:Me.right}else{!Z&&(Ye==z||Ye==U)&&Ye++,at=Ye==0?"after":Ye==n.text.length?"before":gn(e,m,Ye-(Z?1:0)).bottom+F<=f==Z?"after":"before";var bt=qr(e,nt(u,Ye,at),"line",n,m);tt=bt.left,ft=f<bt.top?-1:f>=bt.bottom?1:0}return Ye=be(n.text,Ye,1),Qo(u,Ye,at,ft,l-tt)}function Df(e,n,u,l,f,m,F){var U=Ae(function(Ee){var Ne=f[Ee],Me=Ne.level!=1;return Zo(qr(e,nt(u,Me?Ne.to:Ne.from,Me?"before":"after"),"line",n,l),m,F,!0)},0,f.length-1),z=f[U];if(U>0){var Z=z.level!=1,xe=qr(e,nt(u,Z?z.from:z.to,Z?"after":"before"),"line",n,l);Zo(xe,m,F,!0)&&xe.top>F&&(z=f[U-1])}return z}function au(e,n,u,l,f,m,F){var U=Zi(e,n,l,F),z=U.begin,Z=U.end;/\s/.test(n.text.charAt(Z-1))&&Z--;for(var xe=null,Ee=null,Ne=0;Ne<f.length;Ne++){var Me=f[Ne];if(!(Me.from>=Z||Me.to<=z)){var Ye=Me.level!=1,tt=gn(e,l,Ye?Math.min(Z,Me.to)-1:Math.max(z,Me.from)).right,at=tt<m?m-tt+1e9:tt-m;(!xe||Ee>at)&&(xe=Me,Ee=at)}}return xe||(xe=f[f.length-1]),xe.from<z&&(xe={from:z,to:xe.to,level:xe.level}),xe.to>Z&&(xe={from:xe.from,to:Z,level:xe.level}),xe}var jn;function mo(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(jn==null){jn=ve("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)jn.appendChild(document.createTextNode("x")),jn.appendChild(ve("br"));jn.appendChild(document.createTextNode("x"))}ye(e.measure,jn);var u=jn.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ne(e.measure),u||1}function xo(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=ve("span","xxxxxxxxxx"),u=ve("pre",[n],"CodeMirror-line-like");ye(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function js(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,m=n.gutters.firstChild,F=0;m;m=m.nextSibling,++F){var U=e.display.gutterSpecs[F].className;u[U]=m.offsetLeft+m.clientLeft+f,l[U]=m.clientWidth}return{fixedPos:Vs(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function Vs(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ws(e){var n=mo(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/xo(e.display)-3);return function(f){if(ti(e.doc,f))return 0;var m=0;if(f.widgets)for(var F=0;F<f.widgets.length;F++)f.widgets[F].height&&(m+=f.widgets[F].height);return u?m+(Math.ceil(f.text.length/l)||1)*n:m+n}}function _o(e){var n=e.doc,u=Ws(e);n.iter(function(l){var f=u(l);f!=l.height&&En(l,f)})}function _i(e,n,u,l){var f=e.display;if(!u&&Ft(n).getAttribute("cm-not-content")=="true")return null;var m,F,U=f.lineSpace.getBoundingClientRect();try{m=n.clientX-U.left,F=n.clientY-U.top}catch(Ee){return null}var z=Qi(e,m,F),Z;if(l&&z.xRel>0&&(Z=Et(e.doc,z.line).text).length==z.ch){var xe=Xe(Z,Z.length,e.options.tabSize)-Z.length;z=nt(z.line,Math.max(0,Math.round((m-ql(e.display).left)/xo(e.display))-xe))}return z}function Ai(e,n){if(n>=e.display.viewTo||(n-=e.display.viewFrom,n<0))return null;for(var u=e.display.view,l=0;l<u.length;l++)if(n-=u[l].size,n<0)return l}function $r(e,n,u,l){n==null&&(n=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var f=e.display;if(l&&u<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>n)&&(f.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=f.viewTo)wi&&Es(e.doc,n)<f.viewTo&&ii(e);else if(u<=f.viewFrom)wi&&$l(e.doc,u+l)>f.viewFrom?ii(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)ii(e);else if(n<=f.viewFrom){var m=Hs(e,u,u+l,1);m?(f.view=f.view.slice(m.index),f.viewFrom=m.lineN,f.viewTo+=l):ii(e)}else if(u>=f.viewTo){var F=Hs(e,n,n,-1);F?(f.view=f.view.slice(0,F.index),f.viewTo=F.lineN):ii(e)}else{var U=Hs(e,n,n,-1),z=Hs(e,u,u+l,1);U&&z?(f.view=f.view.slice(0,U.index).concat($o(e,U.lineN,z.lineN)).concat(f.view.slice(z.index)),f.viewTo+=l):ii(e)}var Z=f.externalMeasured;Z&&(u<Z.lineN?Z.lineN+=l:n<Z.lineN+Z.size&&(f.externalMeasured=null))}function Ei(e,n,u){e.curOp.viewChanged=!0;var l=e.display,f=e.display.externalMeasured;if(f&&n>=f.lineN&&n<f.lineN+f.size&&(l.externalMeasured=null),!(n<l.viewFrom||n>=l.viewTo)){var m=l.view[Ai(e,n)];if(m.node!=null){var F=m.changes||(m.changes=[]);pt(F,u)==-1&&F.push(u)}}}function ii(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hs(e,n,u,l){var f=Ai(e,n),m,F=e.display.view;if(!wi||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var U=e.display.viewFrom,z=0;z<f;z++)U+=F[z].size;if(U!=n){if(l>0){if(f==F.length-1)return null;m=U+F[f].size-n,f++}else m=U-n;n+=m,u+=m}for(;Es(e.doc,u)!=u;){if(f==(l<0?0:F.length-1))return null;u+=l*F[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function Nf(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=$o(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=$o(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(Ai(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat($o(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,Ai(e,u)))),l.viewTo=u}function Ci(e){for(var n=e.display.view,u=0,l=0;l<n.length;l++){var f=n[l];!f.hidden&&(!f.node||f.changes)&&++u}return u}function bo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Bf(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),m=l.selection=document.createDocumentFragment(),F=e.options.$customCursor;F&&(n=!0);for(var U=0;U<u.sel.ranges.length;U++)if(!(!n&&U==u.sel.primIndex)){var z=u.sel.ranges[U];if(!(z.from().line>=e.display.viewTo||z.to().line<e.display.viewFrom)){var Z=z.empty();if(F){var xe=F(e,z);xe&&Oi(e,xe,f)}else(Z||e.options.showCursorWhenSelecting)&&Oi(e,z.head,f);Z||Uf(e,z,m)}}return l}function Oi(e,n,u){var l=qr(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(ve("div","\xA0","CodeMirror-cursor"));if(f.style.left=l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var m=La(e,n,"div",null,null),F=m.right-m.left;f.style.width=(F>0?F:e.defaultCharWidth())+"px"}if(l.other){var U=u.appendChild(ve("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));U.style.display="",U.style.left=l.other.left+"px",U.style.top=l.other.top+"px",U.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function zs(e,n){return e.top-n.top||e.left-n.left}function Uf(e,n,u){var l=e.display,f=e.doc,m=document.createDocumentFragment(),F=ql(e.display),U=F.left,z=Math.max(l.sizerWidth,vn(e)-l.sizer.offsetLeft)-F.right,Z=f.direction=="ltr";function xe(ct,bt,Pt,Ot){bt<0&&(bt=0),bt=Math.round(bt),Ot=Math.round(Ot),m.appendChild(ve("div",null,"CodeMirror-selected","position: absolute; left: "+ct+`px;
21
+ `,n);f==-1&&(f=e.length);var m=e.slice(n,e.charAt(f-1)=="\r"?f-1:f),F=m.indexOf("\r");F!=-1?(u.push(m.slice(0,F)),n+=F+1):(u.push(m),n=f+1)}return u}:function(e){return e.split(/\r\n?|\n/)},Tn=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(u){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},Kn=function(){var e=ve("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pn=null;function Oa(e){if(pn!=null)return pn;var n=ye(e,ve("span","x")),u=n.getBoundingClientRect(),l=ue(n,0,1).getBoundingClientRect();return pn=Math.abs(u.left-l.left)>1}var jo={},Sn={};function Yn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),jo[e]=n}function yi(e,n){Sn[e]=n}function $i(e){if(typeof e=="string"&&Sn.hasOwnProperty(e))e=Sn[e];else if(e&&typeof e.name=="string"&&Sn.hasOwnProperty(e.name)){var n=Sn[e.name];typeof n=="string"&&(n={name:n}),e=St(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return $i("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return $i("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Bn(e,n){n=$i(n);var u=jo[n.name];if(!u)return Bn(e,"text/plain");var l=u(e,n);if(mi.hasOwnProperty(n.name)){var f=mi[n.name];for(var m in f)!f.hasOwnProperty(m)||(l.hasOwnProperty(m)&&(l["_"+m]=l[m]),l[m]=f[m])}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var F in n.modeProps)l[F]=n.modeProps[F];return l}var mi={};function Ta(e,n){var u=mi.hasOwnProperty(e)?mi[e]:mi[e]={};Qe(n,u)}function Pn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var u={};for(var l in n){var f=n[l];f instanceof Array&&(f=f.concat([])),u[l]=f}return u}function An(e,n){for(var u;e.innerMode&&(u=e.innerMode(n),!(!u||u.mode==e));)n=u.state,e=u.mode;return u||{mode:e,state:n}}function xi(e,n,u){return e.startState?e.startState(n,u):!0}var mr=function(e,n,u){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=u};mr.prototype.eol=function(){return this.pos>=this.string.length},mr.prototype.sol=function(){return this.pos==this.lineStart},mr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mr.prototype.eat=function(e){var n=this.string.charAt(this.pos),u;if(typeof e=="string"?u=n==e:u=n&&(e.test?e.test(n):e(n)),u)return++this.pos,n},mr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},mr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mr.prototype.skipToEnd=function(){this.pos=this.string.length},mr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},mr.prototype.backUp=function(e){this.pos-=e},mr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},mr.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},mr.prototype.match=function(e,n,u){if(typeof e=="string"){var l=function(F){return u?F.toLowerCase():F},f=this.string.substr(this.pos,e.length);if(l(f)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var m=this.string.slice(this.pos).match(e);return m&&m.index>0?null:(m&&n!==!1&&(this.pos+=m[0].length),m)}},mr.prototype.current=function(){return this.string.slice(this.start,this.pos)},mr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},mr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},mr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Et(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var u=e;!u.lines;)for(var l=0;;++l){var f=u.children[l],m=f.chunkSize();if(n<m){u=f;break}n-=m}return u.lines[n]}function qn(e,n,u){var l=[],f=n.line;return e.iter(n.line,u.line+1,function(m){var F=m.text;f==u.line&&(F=F.slice(0,u.ch)),f==n.line&&(F=F.slice(n.ch)),l.push(F),++f}),l}function bi(e,n,u){var l=[];return e.iter(n,u,function(f){l.push(f.text)}),l}function En(e,n){var u=n-e.height;if(u)for(var l=e;l;l=l.parent)l.height+=u}function qt(e){if(e.parent==null)return null;for(var n=e.parent,u=pt(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var f=0;l.children[f]!=n;++f)u+=l.children[f].chunkSize();return u+n.first}function Un(e,n){var u=e.first;e:do{for(var l=0;l<e.children.length;++l){var f=e.children[l],m=f.height;if(n<m){e=f;continue e}n-=m,u+=f.chunkSize()}return u}while(!e.lines);for(var F=0;F<e.lines.length;++F){var U=e.lines[F],z=U.height;if(n<z)break;n-=z}return u+F}function Jn(e,n){return n>=e.first&&n<e.first+e.size}function po(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function nt(e,n,u){if(u===void 0&&(u=null),!(this instanceof nt))return new nt(e,n,u);this.line=e,this.ch=n,this.sticky=u}function Lt(e,n){return e.line-n.line||e.ch-n.ch}function ei(e,n){return e.sticky==n.sticky&&Lt(e,n)==0}function se(e){return nt(e.line,e.ch)}function Ce(e,n){return Lt(e,n)<0?n:e}function _e(e,n){return Lt(e,n)<0?e:n}function ot(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function st(e,n){if(n.line<e.first)return nt(e.first,0);var u=e.first+e.size-1;return n.line>u?nt(u,Et(e,u).text.length):Kt(n,Et(e,n.line).text.length)}function Kt(e,n){var u=e.ch;return u==null||u>n?nt(e.line,n):u<0?nt(e.line,0):e}function Zt(e,n){for(var u=[],l=0;l<n.length;l++)u[l]=st(e,n[l]);return u}var Tr=function(e,n){this.state=e,this.lookAhead=n},Pr=function(e,n,u,l){this.state=n,this.doc=e,this.line=u,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Pr.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Pr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Pr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Pr.fromSaved=function(e,n,u){return n instanceof Tr?new Pr(e,Pn(e.mode,n.state),u,n.lookAhead):new Pr(e,Pn(e.mode,n),u)},Pr.prototype.save=function(e){var n=e!==!1?Pn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tr(n,this.maxLookAhead):n};function er(e,n,u,l){var f=[e.state.modeGen],m={};jl(e,n.text,e.doc.mode,u,function(Z,xe){return f.push(Z,xe)},m,l);for(var F=u.state,U=function(Z){u.baseTokens=f;var xe=e.state.overlays[Z],Ee=1,Ne=0;u.state=!0,jl(e,n.text,xe.mode,u,function(Me,Ye){for(var tt=Ee;Ne<Me;){var at=f[Ee];at>Me&&f.splice(Ee,1,Me,f[Ee+1],at),Ee+=2,Ne=Math.min(Me,at)}if(!!Ye)if(xe.opaque)f.splice(tt,Ee-tt,Me,"overlay "+Ye),Ee=tt+2;else for(;tt<Ee;tt+=2){var ft=f[tt+1];f[tt+1]=(ft?ft+" ":"")+"overlay "+Ye}},m),u.state=F,u.baseTokens=null,u.baseTokenPos=1},z=0;z<e.state.overlays.length;++z)U(z);return{styles:f,classes:m.bgClass||m.textClass?m:null}}function Bl(e,n,u){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=_r(e,qt(n)),f=n.text.length>e.options.maxHighlightLength&&Pn(e.doc.mode,l.state),m=er(e,n,l);f&&(l.state=f),n.stateAfter=l.save(!f),n.styles=m.styles,m.classes?n.styleClasses=m.classes:n.styleClasses&&(n.styleClasses=null),u===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function _r(e,n,u){var l=e.doc,f=e.display;if(!l.mode.startState)return new Pr(l,!0,n);var m=gf(e,n,u),F=m>l.first&&Et(l,m-1).stateAfter,U=F?Pr.fromSaved(l,F,m):new Pr(l,xi(l.mode),m);return l.iter(m,n,function(z){ys(e,z.text,U);var Z=U.line;z.stateAfter=Z==n-1||Z%5==0||Z>=f.viewFrom&&Z<f.viewTo?U.save():null,U.nextLine()}),u&&(l.modeFrontier=U.line),U}function ys(e,n,u,l){var f=e.doc.mode,m=new mr(n,e.options.tabSize,u);for(m.start=m.pos=l||0,n==""&&Pa(f,u.state);!m.eol();)ms(f,m,u.state),m.start=m.pos}function Pa(e,n){if(e.blankLine)return e.blankLine(n);if(!!e.innerMode){var u=An(e,n);if(u.mode.blankLine)return u.mode.blankLine(u.state)}}function ms(e,n,u,l){for(var f=0;f<10;f++){l&&(l[0]=An(e,u).mode);var m=e.token(n,u);if(n.pos>n.start)return m}throw new Error("Mode "+e.name+" failed to advance stream.")}var xs=function(e,n,u){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=u};function bs(e,n,u,l){var f=e.doc,m=f.mode,F;n=st(f,n);var U=Et(f,n.line),z=_r(e,n.line,u),Z=new mr(U.text,e.options.tabSize,z),xe;for(l&&(xe=[]);(l||Z.pos<n.ch)&&!Z.eol();)Z.start=Z.pos,F=ms(m,Z,z.state),l&&xe.push(new xs(Z,F,Pn(f.mode,z.state)));return l?xe:new xs(Z,F,z.state)}function Ul(e,n){if(e)for(;;){var u=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!u)break;e=e.slice(0,u.index)+e.slice(u.index+u[0].length);var l=u[1]?"bgClass":"textClass";n[l]==null?n[l]=u[2]:new RegExp("(?:^|\\s)"+u[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+u[2])}return e}function jl(e,n,u,l,f,m,F){var U=u.flattenSpans;U==null&&(U=e.options.flattenSpans);var z=0,Z=null,xe=new mr(n,e.options.tabSize,l),Ee,Ne=e.options.addModeClass&&[null];for(n==""&&Ul(Pa(u,l.state),m);!xe.eol();){if(xe.pos>e.options.maxHighlightLength?(U=!1,F&&ys(e,n,l,xe.pos),xe.pos=n.length,Ee=null):Ee=Ul(ms(u,xe,l.state,Ne),m),Ne){var Me=Ne[0].name;Me&&(Ee="m-"+(Ee?Me+" "+Ee:Me))}if(!U||Z!=Ee){for(;z<xe.start;)z=Math.min(xe.start,z+5e3),f(z,Z);Z=Ee}xe.start=xe.pos}for(;z<xe.pos;){var Ye=Math.min(xe.pos,z+5e3);f(Ye,Z),z=Ye}}function gf(e,n,u){for(var l,f,m=e.doc,F=u?-1:n-(e.doc.mode.innerMode?1e3:100),U=n;U>F;--U){if(U<=m.first)return m.first;var z=Et(m,U-1),Z=z.stateAfter;if(Z&&(!u||U+(Z instanceof Tr?Z.lookAhead:0)<=m.modeFrontier))return U;var xe=Xe(z.text,null,e.options.tabSize);(f==null||l>xe)&&(f=U-1,l=xe)}return f}function yf(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),!(e.highlightFrontier<n-10)){for(var u=e.first,l=n-1;l>u;l--){var f=Et(e,l).stateAfter;if(f&&(!(f instanceof Tr)||l+f.lookAhead<n)){u=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,u)}}var mf=!1,wi=!1;function xf(){mf=!0}function bf(){wi=!0}function Ia(e,n,u){this.marker=e,this.from=n,this.to=u}function Vo(e,n){if(e)for(var u=0;u<e.length;++u){var l=e[u];if(l.marker==n)return l}}function wf(e,n){for(var u,l=0;l<e.length;++l)e[l]!=n&&(u||(u=[])).push(e[l]);return u}function md(e,n,u){var l=u&&window.WeakSet&&(u.markedSpans||(u.markedSpans=new WeakSet));l&&l.has(e.markedSpans)?e.markedSpans.push(n):(e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],l&&l.add(e.markedSpans)),n.marker.attachLine(e)}function xd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);if(U||m.from==n&&F.type=="bookmark"&&(!u||!m.marker.insertLeft)){var z=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);(l||(l=[])).push(new Ia(F,m.from,z?null:m.to))}}return l}function bd(e,n,u){var l;if(e)for(var f=0;f<e.length;++f){var m=e[f],F=m.marker,U=m.to==null||(F.inclusiveRight?m.to>=n:m.to>n);if(U||m.from==n&&F.type=="bookmark"&&(!u||m.marker.insertLeft)){var z=m.from==null||(F.inclusiveLeft?m.from<=n:m.from<n);(l||(l=[])).push(new Ia(F,z?null:m.from-n,m.to==null?null:m.to-n))}}return l}function Vl(e,n){if(n.full)return null;var u=Jn(e,n.from.line)&&Et(e,n.from.line).markedSpans,l=Jn(e,n.to.line)&&Et(e,n.to.line).markedSpans;if(!u&&!l)return null;var f=n.from.ch,m=n.to.ch,F=Lt(n.from,n.to)==0,U=xd(u,f,F),z=bd(l,m,F),Z=n.text.length==1,xe=At(n.text).length+(Z?f:0);if(U)for(var Ee=0;Ee<U.length;++Ee){var Ne=U[Ee];if(Ne.to==null){var Me=Vo(z,Ne.marker);Me?Z&&(Ne.to=Me.to==null?null:Me.to+xe):Ne.to=f}}if(z)for(var Ye=0;Ye<z.length;++Ye){var tt=z[Ye];if(tt.to!=null&&(tt.to+=xe),tt.from==null){var at=Vo(U,tt.marker);at||(tt.from=xe,Z&&(U||(U=[])).push(tt))}else tt.from+=xe,Z&&(U||(U=[])).push(tt)}U&&(U=Wl(U)),z&&z!=U&&(z=Wl(z));var ft=[U];if(!Z){var ht=n.text.length-2,ct;if(ht>0&&U)for(var bt=0;bt<U.length;++bt)U[bt].to==null&&(ct||(ct=[])).push(new Ia(U[bt].marker,null,null));for(var Pt=0;Pt<ht;++Pt)ft.push(ct);ft.push(z)}return ft}function Wl(e){for(var n=0;n<e.length;++n){var u=e[n];u.from!=null&&u.from==u.to&&u.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Hl(e,n,u){var l=null;if(e.iter(n.line,u.line+1,function(Me){if(Me.markedSpans)for(var Ye=0;Ye<Me.markedSpans.length;++Ye){var tt=Me.markedSpans[Ye].marker;tt.readOnly&&(!l||pt(l,tt)==-1)&&(l||(l=[])).push(tt)}}),!l)return null;for(var f=[{from:n,to:u}],m=0;m<l.length;++m)for(var F=l[m],U=F.find(0),z=0;z<f.length;++z){var Z=f[z];if(!(Lt(Z.to,U.from)<0||Lt(Z.from,U.to)>0)){var xe=[z,1],Ee=Lt(Z.from,U.from),Ne=Lt(Z.to,U.to);(Ee<0||!F.inclusiveLeft&&!Ee)&&xe.push({from:Z.from,to:U.from}),(Ne>0||!F.inclusiveRight&&!Ne)&&xe.push({from:U.to,to:Z.to}),f.splice.apply(f,xe),z+=xe.length-3}}return f}function zl(e){var n=e.markedSpans;if(!!n){for(var u=0;u<n.length;++u)n[u].marker.detachLine(e);e.markedSpans=null}}function Sf(e,n){if(!!n){for(var u=0;u<n.length;++u)n[u].marker.attachLine(e);e.markedSpans=n}}function ws(e){return e.inclusiveLeft?-1:0}function Ss(e){return e.inclusiveRight?1:0}function Gl(e,n){var u=e.lines.length-n.lines.length;if(u!=0)return u;var l=e.find(),f=n.find(),m=Lt(l.from,f.from)||ws(e)-ws(n);if(m)return-m;var F=Lt(l.to,f.to)||Ss(e)-Ss(n);return F||n.id-e.id}function Wo(e,n){var u=wi&&e.markedSpans,l;if(u)for(var f=void 0,m=0;m<u.length;++m)f=u[m],f.marker.collapsed&&(n?f.from:f.to)==null&&(!l||Gl(l,f.marker)<0)&&(l=f.marker);return l}function zt(e){return Wo(e,!0)}function Ki(e){return Wo(e,!1)}function Gt(e,n){var u=wi&&e.markedSpans,l;if(u)for(var f=0;f<u.length;++f){var m=u[f];m.marker.collapsed&&(m.from==null||m.from<n)&&(m.to==null||m.to>n)&&(!l||Gl(l,m.marker)<0)&&(l=m.marker)}return l}function Yi(e,n,u,l,f){var m=Et(e,n),F=wi&&m.markedSpans;if(F)for(var U=0;U<F.length;++U){var z=F[U];if(!!z.marker.collapsed){var Z=z.marker.find(0),xe=Lt(Z.from,u)||ws(z.marker)-ws(f),Ee=Lt(Z.to,l)||Ss(z.marker)-Ss(f);if(!(xe>=0&&Ee<=0||xe<=0&&Ee>=0)&&(xe<=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.to,u)>=0:Lt(Z.to,u)>0)||xe>=0&&(z.marker.inclusiveRight&&f.inclusiveLeft?Lt(Z.from,l)<=0:Lt(Z.from,l)<0)))return!0}}}function xt(e){for(var n;n=zt(e);)e=n.find(-1,!0).line;return e}function In(e){for(var n;n=Ki(e);)e=n.find(1,!0).line;return e}function Af(e){for(var n,u;n=Ki(e);)e=n.find(1,!0).line,(u||(u=[])).push(e);return u}function As(e,n){var u=Et(e,n),l=xt(u);return u==l?n:qt(l)}function $l(e,n){if(n>e.lastLine())return n;var u=Et(e,n),l;if(!ti(e,u))return n;for(;l=Ki(u);)u=l.find(1,!0).line;return qt(u)+1}function ti(e,n){var u=wi&&n.markedSpans;if(u){for(var l=void 0,f=0;f<u.length;++f)if(l=u[f],!!l.marker.collapsed){if(l.from==null)return!0;if(!l.marker.widgetNode&&l.from==0&&l.marker.inclusiveLeft&&Es(e,n,l))return!0}}}function Es(e,n,u){if(u.to==null){var l=u.marker.find(1,!0);return Es(e,l.line,Vo(l.line.markedSpans,u.marker))}if(u.marker.inclusiveRight&&u.to==n.text.length)return!0;for(var f=void 0,m=0;m<n.markedSpans.length;++m)if(f=n.markedSpans[m],f.marker.collapsed&&!f.marker.widgetNode&&f.from==u.to&&(f.to==null||f.to!=u.from)&&(f.marker.inclusiveLeft||u.marker.inclusiveRight)&&Es(e,n,f))return!0}function ri(e){e=xt(e);for(var n=0,u=e.parent,l=0;l<u.lines.length;++l){var f=u.lines[l];if(f==e)break;n+=f.height}for(var m=u.parent;m;u=m,m=u.parent)for(var F=0;F<m.children.length;++F){var U=m.children[F];if(U==u)break;n+=U.height}return n}function Ho(e){if(e.height==0)return 0;for(var n=e.text.length,u,l=e;u=zt(l);){var f=u.find(0,!0);l=f.from.line,n+=f.from.ch-f.to.ch}for(l=e;u=Ki(l);){var m=u.find(0,!0);n-=l.text.length-m.from.ch,l=m.to.line,n+=l.text.length-m.to.ch}return n}function ho(e){var n=e.display,u=e.doc;n.maxLine=Et(u,u.first),n.maxLineLength=Ho(n.maxLine),n.maxLineChanged=!0,u.iter(function(l){var f=Ho(l);f>n.maxLineLength&&(n.maxLineLength=f,n.maxLine=l)})}var Ji=function(e,n,u){this.text=e,Sf(this,n),this.height=u?u(this):1};Ji.prototype.lineNo=function(){return qt(this)},He(Ji);function Kl(e,n,u,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),zl(e),Sf(e,u);var f=l?l(e):1;f!=e.height&&En(e,f)}function Yl(e){e.parent=null,zl(e)}var Ef={},Cf={};function Cs(e,n){if(!e||/^\s*$/.test(e))return null;var u=n.addModeClass?Cf:Ef;return u[e]||(u[e]=e.replace(/\S+/g,"cm-$&"))}function Jl(e,n){var u=de("span",null,null,g?"padding-right: .1px":null),l={pre:de("pre",[u],"CodeMirror-line"),content:u,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var f=0;f<=(n.rest?n.rest.length:0);f++){var m=f?n.rest[f-1]:n.line,F=void 0;l.pos=0,l.addToken=hn,Nn(e.display.measure)&&(F=P(m,e.doc.direction))&&(l.addToken=Go(l.addToken,F)),l.map=[];var U=n!=e.display.externalMeasured&&qt(m);Of(m,l,Bl(e,m,U)),m.styleClasses&&(m.styleClasses.bgClass&&(l.bgClass=Le(m.styleClasses.bgClass,l.bgClass||"")),m.styleClasses.textClass&&(l.textClass=Le(m.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Gi(e.display.measure))),f==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(g){var z=l.content.lastChild;(/\bcm-tab\b/.test(z.className)||z.querySelector&&z.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return Oe(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=Le(l.pre.className,l.textClass||"")),l}function zo(e){var n=ve("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function hn(e,n,u,l,f,m,F){if(!!n){var U=e.splitSpaces?wd(n,e.trailingSpace):n,z=e.cm.state.specialChars,Z=!1,xe;if(!z.test(n))e.col+=n.length,xe=document.createTextNode(U),e.map.push(e.pos,e.pos+n.length,xe),b&&A<9&&(Z=!0),e.pos+=n.length;else{xe=document.createDocumentFragment();for(var Ee=0;;){z.lastIndex=Ee;var Ne=z.exec(n),Me=Ne?Ne.index-Ee:n.length-Ee;if(Me){var Ye=document.createTextNode(U.slice(Ee,Ee+Me));b&&A<9?xe.appendChild(ve("span",[Ye])):xe.appendChild(Ye),e.map.push(e.pos,e.pos+Me,Ye),e.col+=Me,e.pos+=Me}if(!Ne)break;Ee+=Me+1;var tt=void 0;if(Ne[0]==" "){var at=e.cm.options.tabSize,ft=at-e.col%at;tt=xe.appendChild(ve("span",It(ft),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=ft}else Ne[0]=="\r"||Ne[0]==`
22
+ `?(tt=xe.appendChild(ve("span",Ne[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",Ne[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(Ne[0]),tt.setAttribute("cm-text",Ne[0]),b&&A<9?xe.appendChild(ve("span",[tt])):xe.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=U.charCodeAt(n.length-1)==32,u||l||f||Z||m||F){var ht=u||"";l&&(ht+=l),f&&(ht+=f);var ct=ve("span",[xe],ht,m);if(F)for(var bt in F)F.hasOwnProperty(bt)&&bt!="style"&&bt!="class"&&ct.setAttribute(bt,F[bt]);return e.content.appendChild(ct)}e.content.appendChild(xe)}}function wd(e,n){if(e.length>1&&!/ /.test(e))return e;for(var u=n,l="",f=0;f<e.length;f++){var m=e.charAt(f);m==" "&&u&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(m="\xA0"),l+=m,u=m==" "}return l}function Go(e,n){return function(u,l,f,m,F,U,z){f=f?f+" cm-force-border":"cm-force-border";for(var Z=u.pos,xe=Z+l.length;;){for(var Ee=void 0,Ne=0;Ne<n.length&&(Ee=n[Ne],!(Ee.to>Z&&Ee.from<=Z));Ne++);if(Ee.to>=xe)return e(u,l,f,m,F,U,z);e(u,l.slice(0,Ee.to-Z),f,m,null,U,z),m=null,l=l.slice(Ee.to-Z),Z=Ee.to}}}function Xl(e,n,u,l){var f=!l&&u.widgetNode;f&&e.map.push(e.pos,e.pos+n,f),!l&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",u.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=n,e.trailingSpace=!1}function Of(e,n,u){var l=e.markedSpans,f=e.text,m=0;if(!l){for(var F=1;F<u.length;F+=2)n.addToken(n,f.slice(m,m=u[F]),Cs(u[F+1],n.cm.options));return}for(var U=f.length,z=0,Z=1,xe="",Ee,Ne,Me=0,Ye,tt,at,ft,ht;;){if(Me==z){Ye=tt=at=Ne="",ht=null,ft=null,Me=1/0;for(var ct=[],bt=void 0,Pt=0;Pt<l.length;++Pt){var Ot=l[Pt],Ut=Ot.marker;if(Ut.type=="bookmark"&&Ot.from==z&&Ut.widgetNode)ct.push(Ut);else if(Ot.from<=z&&(Ot.to==null||Ot.to>z||Ut.collapsed&&Ot.to==z&&Ot.from==z)){if(Ot.to!=null&&Ot.to!=z&&Me>Ot.to&&(Me=Ot.to,tt=""),Ut.className&&(Ye+=" "+Ut.className),Ut.css&&(Ne=(Ne?Ne+";":"")+Ut.css),Ut.startStyle&&Ot.from==z&&(at+=" "+Ut.startStyle),Ut.endStyle&&Ot.to==Me&&(bt||(bt=[])).push(Ut.endStyle,Ot.to),Ut.title&&((ht||(ht={})).title=Ut.title),Ut.attributes)for(var ar in Ut.attributes)(ht||(ht={}))[ar]=Ut.attributes[ar];Ut.collapsed&&(!ft||Gl(ft.marker,Ut)<0)&&(ft=Ot)}else Ot.from>z&&Me>Ot.from&&(Me=Ot.from)}if(bt)for(var Hr=0;Hr<bt.length;Hr+=2)bt[Hr+1]==Me&&(tt+=" "+bt[Hr]);if(!ft||ft.from==z)for(var vr=0;vr<ct.length;++vr)Xl(n,0,ct[vr]);if(ft&&(ft.from||0)==z){if(Xl(n,(ft.to==null?U+1:ft.to)-z,ft.marker,ft.from==null),ft.to==null)return;ft.to==z&&(ft=!1)}}if(z>=U)break;for(var xn=Math.min(U,Me);;){if(xe){var fn=z+xe.length;if(!ft){var kr=fn>xn?xe.slice(0,xn-z):xe;n.addToken(n,kr,Ee?Ee+Ye:Ye,at,z+kr.length==Me?tt:"",Ne,ht)}if(fn>=xn){xe=xe.slice(xn-z),z=xn;break}z=fn,at=""}xe=f.slice(m,m=u[Z++]),Ee=Cs(u[Z++],n.cm.options)}}}function Vr(e,n,u){this.line=n,this.rest=Af(n),this.size=this.rest?qt(At(this.rest))-u+1:1,this.node=this.text=null,this.hidden=ti(e,n)}function $o(e,n,u){for(var l=[],f,m=n;m<u;m=f){var F=new Vr(e.doc,Et(e.doc,m),m);f=m+F.size,l.push(F)}return l}var vo=null;function Tf(e){vo?vo.ops.push(e):e.ownsGroup=vo={ops:[e],delayedCallbacks:[]}}function Pf(e){var n=e.delayedCallbacks,u=0;do{for(;u<n.length;u++)n[u].call(null);for(var l=0;l<e.ops.length;l++){var f=e.ops[l];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(u<n.length)}function Ql(e,n){var u=e.ownsGroup;if(!!u)try{Pf(u)}finally{vo=null,n(u)}}var Ko=null;function Wr(e,n){var u=ee(e,n);if(!!u.length){var l=Array.prototype.slice.call(arguments,2),f;vo?f=vo.delayedCallbacks:Ko?f=Ko:(f=Ko=[],setTimeout(Os,0));for(var m=function(U){f.push(function(){return u[U].apply(null,l)})},F=0;F<u.length;++F)m(F)}}function Os(){var e=Ko;Ko=null;for(var n=0;n<e.length;++n)e[n]()}function Ts(e,n,u,l){for(var f=0;f<n.changes.length;f++){var m=n.changes[f];m=="text"?Ps(e,n):m=="gutter"?Zl(e,n,u,l):m=="class"?Is(e,n):m=="widget"&&Sd(e,n,l)}n.changes=null}function go(e){return e.node==e.text&&(e.node=ve("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&A<8&&(e.node.style.zIndex=2)),e.node}function If(e,n){var u=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(u&&(u+=" CodeMirror-linebackground"),n.background)u?n.background.className=u:(n.background.parentNode.removeChild(n.background),n.background=null);else if(u){var l=go(n);n.background=l.insertBefore(ve("div",null,u),l.firstChild),e.display.input.setUneditable(n.background)}}function Fa(e,n){var u=e.display.externalMeasured;return u&&u.line==n.line?(e.display.externalMeasured=null,n.measure=u.measure,u.built):Jl(e,n)}function Ps(e,n){var u=n.text.className,l=Fa(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,Is(e,n)):u&&(n.text.className=u)}function Is(e,n){If(e,n),n.line.wrapClass?go(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var u=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=u||""}function Zl(e,n,u,l){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var f=go(n);n.gutterBackground=ve("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),f.insertBefore(n.gutterBackground,n.text)}var m=n.line.gutterMarkers;if(e.options.lineNumbers||m){var F=go(n),U=n.gutter=ve("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(U.setAttribute("aria-hidden","true"),e.display.input.setUneditable(U),F.insertBefore(U,n.text),n.line.gutterClass&&(U.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!m||!m["CodeMirror-linenumbers"])&&(n.lineNumber=U.appendChild(ve("div",po(e.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),m)for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=e.display.gutterSpecs[z].className,xe=m.hasOwnProperty(Z)&&m[Z];xe&&U.appendChild(ve("div",[xe],"CodeMirror-gutter-elt","left: "+l.gutterLeft[Z]+"px; width: "+l.gutterWidth[Z]+"px"))}}}function Sd(e,n,u){n.alignable&&(n.alignable=null);for(var l=fe("CodeMirror-linewidget"),f=n.node.firstChild,m=void 0;f;f=m)m=f.nextSibling,l.test(f.className)&&n.node.removeChild(f);_l(e,n,u)}function Ad(e,n,u,l){var f=Fa(e,n);return n.text=n.node=f.pre,f.bgClass&&(n.bgClass=f.bgClass),f.textClass&&(n.textClass=f.textClass),Is(e,n),Zl(e,n,u,l),_l(e,n,l),n.node}function _l(e,n,u){if(Si(e,n.line,n,u,!0),n.rest)for(var l=0;l<n.rest.length;l++)Si(e,n.rest[l],n,u,!1)}function Si(e,n,u,l,f){if(!!n.widgets)for(var m=go(u),F=0,U=n.widgets;F<U.length;++F){var z=U[F],Z=ve("div",[z.node],"CodeMirror-linewidget"+(z.className?" "+z.className:""));z.handleMouseEvents||Z.setAttribute("cm-ignore-events","true"),Ff(z,Z,u,l),e.display.input.setUneditable(Z),f&&z.above?m.insertBefore(Z,u.gutter||u.text):m.appendChild(Z),Wr(z,"redraw")}}function Ff(e,n,u,l){if(e.noHScroll){(u.alignable||(u.alignable=[])).push(n);var f=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(f-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=f+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Yo(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!oe(document.body,e.node)){var u="position: relative;";e.coverGutter&&(u+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(u+="width: "+n.display.wrapper.clientWidth+"px;"),ye(n.display.measure,ve("div",[e.node],null,u))}return e.height=e.node.parentNode.offsetHeight}function ni(e,n){for(var u=Ft(n);u!=e.wrapper;u=u.parentNode)if(!u||u.nodeType==1&&u.getAttribute("cm-ignore-events")=="true"||u.parentNode==e.sizer&&u!=e.mover)return!0}function ka(e){return e.lineSpace.offsetTop}function Fs(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ql(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=ye(e.measure,ve("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Xn(e){return yt-e.display.nativeBarWidth}function vn(e){return e.display.scroller.clientWidth-Xn(e)-e.display.barWidth}function Ra(e){return e.display.scroller.clientHeight-Xn(e)-e.display.barHeight}function Xi(e,n,u){var l=e.options.lineWrapping,f=l&&vn(e);if(!n.measure.heights||l&&n.measure.width!=f){var m=n.measure.heights=[];if(l){n.measure.width=f;for(var F=n.text.firstChild.getClientRects(),U=0;U<F.length-1;U++){var z=F[U],Z=F[U+1];Math.abs(z.bottom-Z.bottom)>2&&m.push((z.bottom+Z.top)/2-u.top)}}m.push(u.bottom-u.top)}}function eu(e,n,u){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var f=0;f<e.rest.length;f++)if(qt(e.rest[f])>u)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}}function kf(e,n){n=xt(n);var u=qt(n),l=e.display.externalMeasured=new Vr(e.doc,n,u);l.lineN=u;var f=l.built=Jl(e,l);return l.text=f.pre,ye(e.display.lineMeasure,f.pre),l}function tu(e,n,u,l){return gn(e,yo(e,n),u,l)}function ks(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[Ai(e,n)];var u=e.display.externalMeasured;if(u&&n>=u.lineN&&n<u.lineN+u.size)return u}function yo(e,n){var u=qt(n),l=ks(e,u);l&&!l.text?l=null:l&&l.changes&&(Ts(e,l,u,Us(e)),e.curOp.forceUpdate=!0),l||(l=kf(e,n));var f=eu(l,n,u);return{line:n,view:l,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function gn(e,n,u,l,f){n.before&&(u=-1);var m=u+(l||""),F;return n.cache.hasOwnProperty(m)?F=n.cache[m]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Xi(e,n.view,n.rect),n.hasHeights=!0),F=Rs(e,n,u,l),F.bogus||(n.cache[m]=F)),{left:F.left,right:F.right,top:f?F.rtop:F.top,bottom:f?F.rbottom:F.bottom}}var ru={left:0,right:0,top:0,bottom:0};function nu(e,n,u){for(var l,f,m,F,U,z,Z=0;Z<e.length;Z+=3)if(U=e[Z],z=e[Z+1],n<U?(f=0,m=1,F="left"):n<z?(f=n-U,m=f+1):(Z==e.length-3||n==z&&e[Z+3]>n)&&(m=z-U,f=m-1,n>=z&&(F="right")),f!=null){if(l=e[Z+2],U==z&&u==(l.insertLeft?"left":"right")&&(F=u),u=="left"&&f==0)for(;Z&&e[Z-2]==e[Z-3]&&e[Z-1].insertLeft;)l=e[(Z-=3)+2],F="left";if(u=="right"&&f==z-U)for(;Z<e.length-3&&e[Z+3]==e[Z+4]&&!e[Z+5].insertLeft;)l=e[(Z+=3)+2],F="right";break}return{node:l,start:f,end:m,collapse:F,coverStart:U,coverEnd:z}}function Rf(e,n){var u=ru;if(n=="left")for(var l=0;l<e.length&&(u=e[l]).left==u.right;l++);else for(var f=e.length-1;f>=0&&(u=e[f]).left==u.right;f--);return u}function Rs(e,n,u,l){var f=nu(n.map,u,l),m=f.node,F=f.start,U=f.end,z=f.collapse,Z;if(m.nodeType==3){for(var xe=0;xe<4;xe++){for(;F&&Re(n.line.text.charAt(f.coverStart+F));)--F;for(;f.coverStart+U<f.coverEnd&&Re(n.line.text.charAt(f.coverStart+U));)++U;if(b&&A<9&&F==0&&U==f.coverEnd-f.coverStart?Z=m.parentNode.getBoundingClientRect():Z=Rf(ue(m,F,U).getClientRects(),l),Z.left||Z.right||F==0)break;U=F,F=F-1,z="right"}b&&A<11&&(Z=Mf(e.display.measure,Z))}else{F>0&&(z=l="right");var Ee;e.options.lineWrapping&&(Ee=m.getClientRects()).length>1?Z=Ee[l=="right"?Ee.length-1:0]:Z=m.getBoundingClientRect()}if(b&&A<9&&!F&&(!Z||!Z.left&&!Z.right)){var Ne=m.parentNode.getClientRects()[0];Ne?Z={left:Ne.left,right:Ne.left+xo(e.display),top:Ne.top,bottom:Ne.bottom}:Z=ru}for(var Me=Z.top-n.rect.top,Ye=Z.bottom-n.rect.top,tt=(Me+Ye)/2,at=n.view.measure.heights,ft=0;ft<at.length-1&&!(tt<at[ft]);ft++);var ht=ft?at[ft-1]:0,ct=at[ft],bt={left:(z=="right"?Z.right:Z.left)-n.rect.left,right:(z=="left"?Z.left:Z.right)-n.rect.left,top:ht,bottom:ct};return!Z.left&&!Z.right&&(bt.bogus=!0),e.options.singleCursorHeightPerLine||(bt.rtop=Me,bt.rbottom=Ye),bt}function Mf(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Oa(e))return n;var u=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*u,right:n.right*u,top:n.top*l,bottom:n.bottom*l}}function iu(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function Ms(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)iu(e.display.view[n])}function Jo(e){Ms(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ls(){return N&&X?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ds(){return N&&X?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ns(e){var n=0;if(e.widgets)for(var u=0;u<e.widgets.length;++u)e.widgets[u].above&&(n+=Yo(e.widgets[u]));return n}function Ma(e,n,u,l,f){if(!f){var m=Ns(n);u.top+=m,u.bottom+=m}if(l=="line")return u;l||(l="local");var F=ri(n);if(l=="local"?F+=ka(e.display):F-=e.display.viewOffset,l=="page"||l=="window"){var U=e.display.lineSpace.getBoundingClientRect();F+=U.top+(l=="window"?0:Ds());var z=U.left+(l=="window"?0:Ls());u.left+=z,u.right+=z}return u.top+=F,u.bottom+=F,u}function Bs(e,n,u){if(u=="div")return n;var l=n.left,f=n.top;if(u=="page")l-=Ls(),f-=Ds();else if(u=="local"||!u){var m=e.display.sizer.getBoundingClientRect();l+=m.left,f+=m.top}var F=e.display.lineSpace.getBoundingClientRect();return{left:l-F.left,top:f-F.top}}function La(e,n,u,l,f){return l||(l=Et(e.doc,n.line)),Ma(e,l,tu(e,l,n.ch,f),u)}function qr(e,n,u,l,f,m){l=l||Et(e.doc,n.line),f||(f=yo(e,l));function F(Ye,tt){var at=gn(e,f,Ye,tt?"right":"left",m);return tt?at.left=at.right:at.right=at.left,Ma(e,l,at,u)}var U=P(l,e.doc.direction),z=n.ch,Z=n.sticky;if(z>=l.text.length?(z=l.text.length,Z="before"):z<=0&&(z=0,Z="after"),!U)return F(Z=="before"?z-1:z,Z=="before");function xe(Ye,tt,at){var ft=U[tt],ht=ft.level==1;return F(at?Ye-1:Ye,ht!=at)}var Ee=W(U,z,Z),Ne=Ie,Me=xe(z,Ee,Z=="before");return Ne!=null&&(Me.other=xe(z,Ne,Z!="before")),Me}function Xo(e,n){var u=0;n=st(e.doc,n),e.options.lineWrapping||(u=xo(e.display)*n.ch);var l=Et(e.doc,n.line),f=ri(l)+ka(e.display);return{left:u,right:u,top:f,bottom:f+l.height}}function Qo(e,n,u,l,f){var m=nt(e,n,u);return m.xRel=f,l&&(m.outside=l),m}function Qi(e,n,u){var l=e.doc;if(u+=e.display.viewOffset,u<0)return Qo(l.first,0,null,-1,-1);var f=Un(l,u),m=l.first+l.size-1;if(f>m)return Qo(l.first+l.size-1,Et(l,m).text.length,null,1,1);n<0&&(n=0);for(var F=Et(l,f);;){var U=Lf(e,F,f,n,u),z=Gt(F,U.ch+(U.xRel>0||U.outside>0?1:0));if(!z)return U;var Z=z.find(1);if(Z.line==f)return Z;F=Et(l,f=Z.line)}}function Zi(e,n,u,l){l-=Ns(n);var f=n.text.length,m=Ae(function(F){return gn(e,u,F-1).bottom<=l},f,0);return f=Ae(function(F){return gn(e,u,F).top>l},m,f),{begin:m,end:f}}function ou(e,n,u,l){u||(u=yo(e,n));var f=Ma(e,n,gn(e,u,l),"line").top;return Zi(e,n,u,f)}function Zo(e,n,u,l){return e.bottom<=u?!1:e.top>u?!0:(l?e.left:e.right)>n}function Lf(e,n,u,l,f){f-=ri(n);var m=yo(e,n),F=Ns(n),U=0,z=n.text.length,Z=!0,xe=P(n,e.doc.direction);if(xe){var Ee=(e.options.lineWrapping?au:Df)(e,n,u,m,xe,l,f);Z=Ee.level!=1,U=Z?Ee.from:Ee.to-1,z=Z?Ee.to:Ee.from-1}var Ne=null,Me=null,Ye=Ae(function(Pt){var Ot=gn(e,m,Pt);return Ot.top+=F,Ot.bottom+=F,Zo(Ot,l,f,!1)?(Ot.top<=f&&Ot.left<=l&&(Ne=Pt,Me=Ot),!0):!1},U,z),tt,at,ft=!1;if(Me){var ht=l-Me.left<Me.right-l,ct=ht==Z;Ye=Ne+(ct?0:1),at=ct?"after":"before",tt=ht?Me.left:Me.right}else{!Z&&(Ye==z||Ye==U)&&Ye++,at=Ye==0?"after":Ye==n.text.length?"before":gn(e,m,Ye-(Z?1:0)).bottom+F<=f==Z?"after":"before";var bt=qr(e,nt(u,Ye,at),"line",n,m);tt=bt.left,ft=f<bt.top?-1:f>=bt.bottom?1:0}return Ye=be(n.text,Ye,1),Qo(u,Ye,at,ft,l-tt)}function Df(e,n,u,l,f,m,F){var U=Ae(function(Ee){var Ne=f[Ee],Me=Ne.level!=1;return Zo(qr(e,nt(u,Me?Ne.to:Ne.from,Me?"before":"after"),"line",n,l),m,F,!0)},0,f.length-1),z=f[U];if(U>0){var Z=z.level!=1,xe=qr(e,nt(u,Z?z.from:z.to,Z?"after":"before"),"line",n,l);Zo(xe,m,F,!0)&&xe.top>F&&(z=f[U-1])}return z}function au(e,n,u,l,f,m,F){var U=Zi(e,n,l,F),z=U.begin,Z=U.end;/\s/.test(n.text.charAt(Z-1))&&Z--;for(var xe=null,Ee=null,Ne=0;Ne<f.length;Ne++){var Me=f[Ne];if(!(Me.from>=Z||Me.to<=z)){var Ye=Me.level!=1,tt=gn(e,l,Ye?Math.min(Z,Me.to)-1:Math.max(z,Me.from)).right,at=tt<m?m-tt+1e9:tt-m;(!xe||Ee>at)&&(xe=Me,Ee=at)}}return xe||(xe=f[f.length-1]),xe.from<z&&(xe={from:z,to:xe.to,level:xe.level}),xe.to>Z&&(xe={from:xe.from,to:Z,level:xe.level}),xe}var jn;function mo(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(jn==null){jn=ve("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)jn.appendChild(document.createTextNode("x")),jn.appendChild(ve("br"));jn.appendChild(document.createTextNode("x"))}ye(e.measure,jn);var u=jn.offsetHeight/50;return u>3&&(e.cachedTextHeight=u),ne(e.measure),u||1}function xo(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=ve("span","xxxxxxxxxx"),u=ve("pre",[n],"CodeMirror-line-like");ye(e.measure,u);var l=n.getBoundingClientRect(),f=(l.right-l.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Us(e){for(var n=e.display,u={},l={},f=n.gutters.clientLeft,m=n.gutters.firstChild,F=0;m;m=m.nextSibling,++F){var U=e.display.gutterSpecs[F].className;u[U]=m.offsetLeft+m.clientLeft+f,l[U]=m.clientWidth}return{fixedPos:js(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:u,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function js(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Vs(e){var n=mo(e.display),u=e.options.lineWrapping,l=u&&Math.max(5,e.display.scroller.clientWidth/xo(e.display)-3);return function(f){if(ti(e.doc,f))return 0;var m=0;if(f.widgets)for(var F=0;F<f.widgets.length;F++)f.widgets[F].height&&(m+=f.widgets[F].height);return u?m+(Math.ceil(f.text.length/l)||1)*n:m+n}}function _o(e){var n=e.doc,u=Vs(e);n.iter(function(l){var f=u(l);f!=l.height&&En(l,f)})}function _i(e,n,u,l){var f=e.display;if(!u&&Ft(n).getAttribute("cm-not-content")=="true")return null;var m,F,U=f.lineSpace.getBoundingClientRect();try{m=n.clientX-U.left,F=n.clientY-U.top}catch(Ee){return null}var z=Qi(e,m,F),Z;if(l&&z.xRel>0&&(Z=Et(e.doc,z.line).text).length==z.ch){var xe=Xe(Z,Z.length,e.options.tabSize)-Z.length;z=nt(z.line,Math.max(0,Math.round((m-ql(e.display).left)/xo(e.display))-xe))}return z}function Ai(e,n){if(n>=e.display.viewTo||(n-=e.display.viewFrom,n<0))return null;for(var u=e.display.view,l=0;l<u.length;l++)if(n-=u[l].size,n<0)return l}function $r(e,n,u,l){n==null&&(n=e.doc.first),u==null&&(u=e.doc.first+e.doc.size),l||(l=0);var f=e.display;if(l&&u<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>n)&&(f.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=f.viewTo)wi&&As(e.doc,n)<f.viewTo&&ii(e);else if(u<=f.viewFrom)wi&&$l(e.doc,u+l)>f.viewFrom?ii(e):(f.viewFrom+=l,f.viewTo+=l);else if(n<=f.viewFrom&&u>=f.viewTo)ii(e);else if(n<=f.viewFrom){var m=Ws(e,u,u+l,1);m?(f.view=f.view.slice(m.index),f.viewFrom=m.lineN,f.viewTo+=l):ii(e)}else if(u>=f.viewTo){var F=Ws(e,n,n,-1);F?(f.view=f.view.slice(0,F.index),f.viewTo=F.lineN):ii(e)}else{var U=Ws(e,n,n,-1),z=Ws(e,u,u+l,1);U&&z?(f.view=f.view.slice(0,U.index).concat($o(e,U.lineN,z.lineN)).concat(f.view.slice(z.index)),f.viewTo+=l):ii(e)}var Z=f.externalMeasured;Z&&(u<Z.lineN?Z.lineN+=l:n<Z.lineN+Z.size&&(f.externalMeasured=null))}function Ei(e,n,u){e.curOp.viewChanged=!0;var l=e.display,f=e.display.externalMeasured;if(f&&n>=f.lineN&&n<f.lineN+f.size&&(l.externalMeasured=null),!(n<l.viewFrom||n>=l.viewTo)){var m=l.view[Ai(e,n)];if(m.node!=null){var F=m.changes||(m.changes=[]);pt(F,u)==-1&&F.push(u)}}}function ii(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ws(e,n,u,l){var f=Ai(e,n),m,F=e.display.view;if(!wi||u==e.doc.first+e.doc.size)return{index:f,lineN:u};for(var U=e.display.viewFrom,z=0;z<f;z++)U+=F[z].size;if(U!=n){if(l>0){if(f==F.length-1)return null;m=U+F[f].size-n,f++}else m=U-n;n+=m,u+=m}for(;As(e.doc,u)!=u;){if(f==(l<0?0:F.length-1))return null;u+=l*F[f-(l<0?1:0)].size,f+=l}return{index:f,lineN:u}}function Nf(e,n,u){var l=e.display,f=l.view;f.length==0||n>=l.viewTo||u<=l.viewFrom?(l.view=$o(e,n,u),l.viewFrom=n):(l.viewFrom>n?l.view=$o(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(Ai(e,n))),l.viewFrom=n,l.viewTo<u?l.view=l.view.concat($o(e,l.viewTo,u)):l.viewTo>u&&(l.view=l.view.slice(0,Ai(e,u)))),l.viewTo=u}function Ci(e){for(var n=e.display.view,u=0,l=0;l<n.length;l++){var f=n[l];!f.hidden&&(!f.node||f.changes)&&++u}return u}function bo(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Bf(e,n){n===void 0&&(n=!0);var u=e.doc,l={},f=l.cursors=document.createDocumentFragment(),m=l.selection=document.createDocumentFragment(),F=e.options.$customCursor;F&&(n=!0);for(var U=0;U<u.sel.ranges.length;U++)if(!(!n&&U==u.sel.primIndex)){var z=u.sel.ranges[U];if(!(z.from().line>=e.display.viewTo||z.to().line<e.display.viewFrom)){var Z=z.empty();if(F){var xe=F(e,z);xe&&Oi(e,xe,f)}else(Z||e.options.showCursorWhenSelecting)&&Oi(e,z.head,f);Z||Uf(e,z,m)}}return l}function Oi(e,n,u){var l=qr(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),f=u.appendChild(ve("div","\xA0","CodeMirror-cursor"));if(f.style.left=l.left+"px",f.style.top=l.top+"px",f.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var m=La(e,n,"div",null,null),F=m.right-m.left;f.style.width=(F>0?F:e.defaultCharWidth())+"px"}if(l.other){var U=u.appendChild(ve("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));U.style.display="",U.style.left=l.other.left+"px",U.style.top=l.other.top+"px",U.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Hs(e,n){return e.top-n.top||e.left-n.left}function Uf(e,n,u){var l=e.display,f=e.doc,m=document.createDocumentFragment(),F=ql(e.display),U=F.left,z=Math.max(l.sizerWidth,vn(e)-l.sizer.offsetLeft)-F.right,Z=f.direction=="ltr";function xe(ct,bt,Pt,Ot){bt<0&&(bt=0),bt=Math.round(bt),Ot=Math.round(Ot),m.appendChild(ve("div",null,"CodeMirror-selected","position: absolute; left: "+ct+`px;
23
23
  top: `+bt+"px; width: "+(Pt==null?z-ct:Pt)+`px;
24
- height: `+(Ot-bt)+"px"))}function Ee(ct,bt,Pt){var Ot=Et(f,ct),Ut=Ot.text.length,ar,Hr;function vr(kr,rn){return La(e,nt(ct,kr),"div",Ot,rn)}function xn(kr,rn,zr){var Nr=ou(e,Ot,null,kr),Rr=rn=="ltr"==(zr=="after")?"left":"right",wr=zr=="after"?Nr.begin:Nr.end-(/\s/.test(Ot.text.charAt(Nr.end-1))?2:1);return vr(wr,Rr)[Rr]}var fn=P(Ot,f.direction);return T(fn,bt||0,Pt==null?Ut:Pt,function(kr,rn,zr,Nr){var Rr=zr=="ltr",wr=vr(kr,Rr?"left":"right"),cn=vr(rn-1,Rr?"right":"left"),lo=bt==null&&kr==0,Ui=Pt==null&&rn==Ut,Jr=Nr==0,zn=!fn||Nr==fn.length-1;if(cn.top-wr.top<=3){var Er=(Z?lo:Ui)&&Jr,wl=(Z?Ui:lo)&&zn,Cn=Er?U:(Rr?wr:cn).left,ji=wl?z:(Rr?cn:wr).right;xe(Cn,wr.top,ji-Cn,wr.bottom)}else{var Xr,dn,uo,us;Rr?(Xr=Z&&lo&&Jr?U:wr.left,dn=Z?z:xn(kr,zr,"before"),uo=Z?U:xn(rn,zr,"after"),us=Z&&Ui&&zn?z:cn.right):(Xr=Z?xn(kr,zr,"before"):U,dn=!Z&&lo&&Jr?z:wr.right,uo=!Z&&Ui&&zn?U:cn.left,us=Z?xn(rn,zr,"after"):z),xe(Xr,wr.top,dn-Xr,wr.bottom),wr.bottom<cn.top&&xe(U,wr.bottom,null,cn.top),xe(uo,cn.top,us-uo,cn.bottom)}(!ar||zs(wr,ar)<0)&&(ar=wr),zs(cn,ar)<0&&(ar=cn),(!Hr||zs(wr,Hr)<0)&&(Hr=wr),zs(cn,Hr)<0&&(Hr=cn)}),{start:ar,end:Hr}}var Ne=n.from(),Me=n.to();if(Ne.line==Me.line)Ee(Ne.line,Ne.ch,Me.ch);else{var Ye=Et(f,Ne.line),tt=Et(f,Me.line),at=xt(Ye)==xt(tt),ft=Ee(Ne.line,Ne.ch,at?Ye.text.length+1:null).end,ht=Ee(Me.line,at?0:null,Me.ch).start;at&&(ft.top<ht.top-2?(xe(ft.right,ft.top,null,ft.bottom),xe(U,ht.top,ht.left,ht.bottom)):xe(ft.right,ft.top,ht.left-ft.right,ft.bottom)),ft.bottom<ht.top&&xe(U,ft.bottom,null,ht.top)}u.appendChild(m)}function su(e){if(!!e.state.focused){var n=e.display;clearInterval(n.blinker);var u=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||wo(e),n.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}}function jf(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||$s(e))}function Gs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&wo(e))},100)}function $s(e,n){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Oe(e,"focus",e,n),e.state.focused=!0,Ve(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),su(e))}function wo(e,n){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,n),e.state.focused=!1,te(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ks(e){for(var n=e.display,u=n.lineDiv.offsetTop,l=Math.max(0,n.scroller.getBoundingClientRect().top),f=n.lineDiv.getBoundingClientRect().top,m=0,F=0;F<n.view.length;F++){var U=n.view[F],z=e.options.lineWrapping,Z=void 0,xe=0;if(!U.hidden){if(f+=U.line.height,b&&A<8){var Ee=U.node.offsetTop+U.node.offsetHeight;Z=Ee-u,u=Ee}else{var Ne=U.node.getBoundingClientRect();Z=Ne.bottom-Ne.top,!z&&U.text.firstChild&&(xe=U.text.firstChild.getBoundingClientRect().right-Ne.left-1)}var Me=U.line.height-Z;if((Me>.005||Me<-.005)&&(f<l&&(m-=Me),En(U.line,Z),Vf(U.line),U.rest))for(var Ye=0;Ye<U.rest.length;Ye++)Vf(U.rest[Ye]);if(xe>e.display.sizerWidth){var tt=Math.ceil(xe/xo(e.display));tt>e.display.maxLineLength&&(e.display.maxLineLength=tt,e.display.maxLine=U.line,e.display.maxLineChanged=!0)}}}Math.abs(m)>2&&(n.scroller.scrollTop+=m)}function Vf(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var u=e.widgets[n],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function Ys(e,n,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-ka(e));var f=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,m=Un(n,l),F=Un(n,f);if(u&&u.ensure){var U=u.ensure.from.line,z=u.ensure.to.line;U<m?(m=U,F=Un(n,ri(Et(n,U))+e.wrapper.clientHeight)):Math.min(z,n.lastLine())>=F&&(m=Un(n,ri(Et(n,z))-e.wrapper.clientHeight),F=z)}return{from:m,to:Math.max(F,m+1)}}function Wf(e,n){if(!Pe(e,"scrollCursorIntoView")){var u=e.display,l=u.sizer.getBoundingClientRect(),f=null;if(n.top+l.top<0?f=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!H){var m=ve("div","\u200B",null,`position: absolute;
24
+ height: `+(Ot-bt)+"px"))}function Ee(ct,bt,Pt){var Ot=Et(f,ct),Ut=Ot.text.length,ar,Hr;function vr(kr,rn){return La(e,nt(ct,kr),"div",Ot,rn)}function xn(kr,rn,zr){var Nr=ou(e,Ot,null,kr),Rr=rn=="ltr"==(zr=="after")?"left":"right",wr=zr=="after"?Nr.begin:Nr.end-(/\s/.test(Ot.text.charAt(Nr.end-1))?2:1);return vr(wr,Rr)[Rr]}var fn=P(Ot,f.direction);return T(fn,bt||0,Pt==null?Ut:Pt,function(kr,rn,zr,Nr){var Rr=zr=="ltr",wr=vr(kr,Rr?"left":"right"),cn=vr(rn-1,Rr?"right":"left"),lo=bt==null&&kr==0,Ui=Pt==null&&rn==Ut,Jr=Nr==0,zn=!fn||Nr==fn.length-1;if(cn.top-wr.top<=3){var Er=(Z?lo:Ui)&&Jr,bl=(Z?Ui:lo)&&zn,Cn=Er?U:(Rr?wr:cn).left,ji=bl?z:(Rr?cn:wr).right;xe(Cn,wr.top,ji-Cn,wr.bottom)}else{var Xr,dn,uo,us;Rr?(Xr=Z&&lo&&Jr?U:wr.left,dn=Z?z:xn(kr,zr,"before"),uo=Z?U:xn(rn,zr,"after"),us=Z&&Ui&&zn?z:cn.right):(Xr=Z?xn(kr,zr,"before"):U,dn=!Z&&lo&&Jr?z:wr.right,uo=!Z&&Ui&&zn?U:cn.left,us=Z?xn(rn,zr,"after"):z),xe(Xr,wr.top,dn-Xr,wr.bottom),wr.bottom<cn.top&&xe(U,wr.bottom,null,cn.top),xe(uo,cn.top,us-uo,cn.bottom)}(!ar||Hs(wr,ar)<0)&&(ar=wr),Hs(cn,ar)<0&&(ar=cn),(!Hr||Hs(wr,Hr)<0)&&(Hr=wr),Hs(cn,Hr)<0&&(Hr=cn)}),{start:ar,end:Hr}}var Ne=n.from(),Me=n.to();if(Ne.line==Me.line)Ee(Ne.line,Ne.ch,Me.ch);else{var Ye=Et(f,Ne.line),tt=Et(f,Me.line),at=xt(Ye)==xt(tt),ft=Ee(Ne.line,Ne.ch,at?Ye.text.length+1:null).end,ht=Ee(Me.line,at?0:null,Me.ch).start;at&&(ft.top<ht.top-2?(xe(ft.right,ft.top,null,ft.bottom),xe(U,ht.top,ht.left,ht.bottom)):xe(ft.right,ft.top,ht.left-ft.right,ft.bottom)),ft.bottom<ht.top&&xe(U,ft.bottom,null,ht.top)}u.appendChild(m)}function su(e){if(!!e.state.focused){var n=e.display;clearInterval(n.blinker);var u=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||wo(e),n.cursorDiv.style.visibility=(u=!u)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}}function jf(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Gs(e))}function zs(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&wo(e))},100)}function Gs(e,n){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Oe(e,"focus",e,n),e.state.focused=!0,Ve(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),su(e))}function wo(e,n){e.state.delayingBlurEvent||(e.state.focused&&(Oe(e,"blur",e,n),e.state.focused=!1,te(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $s(e){for(var n=e.display,u=n.lineDiv.offsetTop,l=Math.max(0,n.scroller.getBoundingClientRect().top),f=n.lineDiv.getBoundingClientRect().top,m=0,F=0;F<n.view.length;F++){var U=n.view[F],z=e.options.lineWrapping,Z=void 0,xe=0;if(!U.hidden){if(f+=U.line.height,b&&A<8){var Ee=U.node.offsetTop+U.node.offsetHeight;Z=Ee-u,u=Ee}else{var Ne=U.node.getBoundingClientRect();Z=Ne.bottom-Ne.top,!z&&U.text.firstChild&&(xe=U.text.firstChild.getBoundingClientRect().right-Ne.left-1)}var Me=U.line.height-Z;if((Me>.005||Me<-.005)&&(f<l&&(m-=Me),En(U.line,Z),Vf(U.line),U.rest))for(var Ye=0;Ye<U.rest.length;Ye++)Vf(U.rest[Ye]);if(xe>e.display.sizerWidth){var tt=Math.ceil(xe/xo(e.display));tt>e.display.maxLineLength&&(e.display.maxLineLength=tt,e.display.maxLine=U.line,e.display.maxLineChanged=!0)}}}Math.abs(m)>2&&(n.scroller.scrollTop+=m)}function Vf(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var u=e.widgets[n],l=u.node.parentNode;l&&(u.height=l.offsetHeight)}}function Ks(e,n,u){var l=u&&u.top!=null?Math.max(0,u.top):e.scroller.scrollTop;l=Math.floor(l-ka(e));var f=u&&u.bottom!=null?u.bottom:l+e.wrapper.clientHeight,m=Un(n,l),F=Un(n,f);if(u&&u.ensure){var U=u.ensure.from.line,z=u.ensure.to.line;U<m?(m=U,F=Un(n,ri(Et(n,U))+e.wrapper.clientHeight)):Math.min(z,n.lastLine())>=F&&(m=Un(n,ri(Et(n,z))-e.wrapper.clientHeight),F=z)}return{from:m,to:Math.max(F,m+1)}}function Wf(e,n){if(!Pe(e,"scrollCursorIntoView")){var u=e.display,l=u.sizer.getBoundingClientRect(),f=null;if(n.top+l.top<0?f=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!H){var m=ve("div","\u200B",null,`position: absolute;
25
25
  top: `+(n.top-u.viewOffset-ka(e.display))+`px;
26
26
  height: `+(n.bottom-n.top+Xn(e)+u.barHeight)+`px;
27
- left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(m),m.scrollIntoView(f),e.display.lineSpace.removeChild(m)}}}function Ed(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?nt(n.line,n.ch+1,"before"):n,n=n.ch?nt(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var m=0;m<5;m++){var F=!1,U=qr(e,n),z=!u||u==n?U:qr(e,u);f={left:Math.min(U.left,z.left),top:Math.min(U.top,z.top)-l,right:Math.max(U.left,z.left),bottom:Math.max(U.bottom,z.bottom)+l};var Z=qi(e,f),xe=e.doc.scrollTop,Ee=e.doc.scrollLeft;if(Z.scrollTop!=null&&(ln(e,Z.scrollTop),Math.abs(e.doc.scrollTop-xe)>1&&(F=!0)),Z.scrollLeft!=null&&(Vn(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ee)>1&&(F=!0)),!F)break}return f}function Cd(e,n){var u=qi(e,n);u.scrollTop!=null&&ln(e,u.scrollTop),u.scrollLeft!=null&&Vn(e,u.scrollLeft)}function qi(e,n){var u=e.display,l=mo(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,m=Ra(e),F={};n.bottom-n.top>m&&(n.bottom=n.top+m);var U=e.doc.height+ks(u),z=n.top<l,Z=n.bottom>U-l;if(n.top<f)F.scrollTop=z?0:n.top;else if(n.bottom>f+m){var xe=Math.min(n.top,(Z?U:n.bottom)-m);xe!=f&&(F.scrollTop=xe)}var Ee=e.options.fixedGutter?0:u.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ee,Me=vn(e)-u.gutters.offsetWidth,Ye=n.right-n.left>Me;return Ye&&(n.right=n.left+Me),n.left<10?F.scrollLeft=0:n.left<Ne?F.scrollLeft=Math.max(0,n.left+Ee-(Ye?0:10)):n.right>Me+Ne-3&&(F.scrollLeft=n.right+(Ye?0:10)-Me),F}function sn(e,n){n!=null&&(qo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function yn(e){qo(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function mn(e,n,u){(n!=null||u!=null)&&qo(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function Hf(e,n){qo(e),e.curOp.scrollToPos=n}function qo(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=Xo(e,n.from),l=Xo(e,n.to);ea(e,u,l,n.margin)}}function ea(e,n,u,l){var f=qi(e,{left:Math.min(n.left,u.left),top:Math.min(n.top,u.top)-l,right:Math.max(n.right,u.right),bottom:Math.max(n.bottom,u.bottom)+l});mn(e,f.scrollLeft,f.scrollTop)}function ln(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||Hn(e,{top:n}),tr(e,n,!0),c&&Hn(e),to(e,100))}function tr(e,n,u){n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),!(e.display.scroller.scrollTop==n&&!u)&&(e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n))}function Vn(e,n,u,l){n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((u?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)&&(e.doc.scrollLeft=n,Zs(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function So(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+ks(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+Xn(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var oi=function(e,n,u){this.cm=u;var l=this.vert=ve("div",[ve("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=ve("div",[ve("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=f.tabIndex=-1,e(l),e(f),D(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),D(f,"scroll",function(){f.clientWidth&&n(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&A<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};oi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var f=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var m=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+m)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:n?l:0}},oi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},oi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},oi.prototype.zeroWidthHack=function(){var e=C&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ut,this.disableVert=new ut},oi.prototype.enableZeroWidthBar=function(e,n,u){e.style.pointerEvents="auto";function l(){var f=e.getBoundingClientRect(),m=u=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);m!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},oi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ao=function(){};Ao.prototype.update=function(){return{bottom:0,right:0}},Ao.prototype.setScrollLeft=function(){},Ao.prototype.setScrollTop=function(){},Ao.prototype.clear=function(){};function eo(e,n){n||(n=So(e));var u=e.display.barWidth,l=e.display.barHeight;Eo(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&Ks(e),Eo(e,So(e)),u=e.display.barWidth,l=e.display.barHeight}function Eo(e,n){var u=e.display,l=u.scrollbars.update(n);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=n.gutterWidth+"px"):u.gutterFiller.style.display=""}var Js={native:oi,null:Ao};function Da(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Js[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),D(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,u){u=="horizontal"?Vn(e,n):ln(e,n)},e),e.display.scrollbars.addClass&&Ve(e.display.wrapper,e.display.scrollbars.addClass)}var Ht=0;function Ti(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ht,markArrays:null},Tf(e.curOp)}function Pi(e){var n=e.curOp;n&&Ql(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;ai(u)})}function ai(e){for(var n=e.ops,u=0;u<n.length;u++)ta(n[u]);for(var l=0;l<n.length;l++)Wn(n[l]);for(var f=0;f<n.length;f++)Co(n[f]);for(var m=0;m<n.length;m++)en(n[m]);for(var F=0;F<n.length;F++)Ii(n[F])}function ta(e){var n=e.cm,u=n.display;Od(n),e.updateMaxLine&&ho(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ra(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Wn(e){e.updatedDisplay=e.mustUpdate&&Oo(e.cm,e.update)}function Co(e){var n=e.cm,u=n.display;e.updatedDisplay&&Ks(n),e.barMeasure=So(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=tu(n,u.maxLine,u.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+Xn(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-vn(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function en(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Vn(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==De();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&eo(n,e.barMeasure),e.updatedDisplay&&Ir(n,e.barMeasure),e.selectionChanged&&su(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&jf(e.cm)}function Ii(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&Xs(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&tr(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Vn(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=Ed(n,st(l,e.scrollToPos.from),st(l,e.scrollToPos.to),e.scrollToPos.margin);Wf(n,f)}var m=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(m)for(var U=0;U<m.length;++U)m[U].lines.length||Oe(m[U],"hide");if(F)for(var z=0;z<F.length;++z)F[z].lines.length&&Oe(F[z],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&Oe(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Yr(e,n){if(e.curOp)return n();Ti(e);try{return n()}finally{Pi(e)}}function xr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Ti(e);try{return n.apply(e,arguments)}finally{Pi(e)}}}function Lr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ti(this);try{return e.apply(this,arguments)}finally{Pi(this)}}}function br(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Ti(n);try{return e.apply(this,arguments)}finally{Pi(n)}}}function to(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,rt(Na,e))}function Na(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=_r(e,n.highlightFrontier),f=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(m){if(l.line>=e.display.viewFrom){var F=m.styles,U=m.text.length>e.options.maxHighlightLength?Pn(n.mode,l.state):null,z=er(e,m,l,!0);U&&(l.state=U),m.styles=z.styles;var Z=m.styleClasses,xe=z.classes;xe?m.styleClasses=xe:Z&&(m.styleClasses=null);for(var Ee=!F||F.length!=m.styles.length||Z!=xe&&(!Z||!xe||Z.bgClass!=xe.bgClass||Z.textClass!=xe.textClass),Ne=0;!Ee&&Ne<F.length;++Ne)Ee=F[Ne]!=m.styles[Ne];Ee&&f.push(l.line),m.stateAfter=l.save(),l.nextLine()}else m.text.length<=e.options.maxHighlightLength&&ms(e,m.text,l),m.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return to(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&Yr(e,function(){for(var m=0;m<f.length;m++)Ei(e,f[m],"text")})}}var ra=function(e,n,u){var l=e.display;this.viewport=n,this.visible=Ys(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=vn(e),this.force=u,this.dims=js(e),this.events=[]};ra.prototype.signal=function(e,n){Ge(e,n)&&this.events.push(arguments)},ra.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.apply(null,this.events[e])};function Od(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=Xn(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=Xn(e)+"px",n.scrollbarsClipped=!0)}function lu(e){if(e.hasFocus())return null;var n=De();if(!n||!oe(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&oe(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function uu(e){if(!(!e||!e.activeElt||e.activeElt==De())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&oe(document.body,e.anchorNode)&&oe(document.body,e.focusNode))){var n=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),n.removeAllRanges(),n.addRange(u),n.extend(e.focusNode,e.focusOffset)}}function Oo(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return ii(e),!1;if(!n.force&&n.visible.from>=u.viewFrom&&n.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Ci(e)==0)return!1;_s(e)&&(ii(e),n.dims=js(e));var f=l.first+l.size,m=Math.max(n.visible.from-e.options.viewportMargin,l.first),F=Math.min(f,n.visible.to+e.options.viewportMargin);u.viewFrom<m&&m-u.viewFrom<20&&(m=Math.max(l.first,u.viewFrom)),u.viewTo>F&&u.viewTo-F<20&&(F=Math.min(f,u.viewTo)),wi&&(m=Es(e.doc,m),F=$l(e.doc,F));var U=m!=u.viewFrom||F!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;Nf(e,m,F),u.viewOffset=ri(Et(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var z=Ci(e);if(!U&&z==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var Z=lu(e);return z>4&&(u.lineDiv.style.display="none"),Qs(e,u.updateLineNumbers,n.dims),z>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,uu(Z),ne(u.cursorDiv),ne(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,U&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,to(e,400)),u.updateLineNumbers=null,!0}function Xs(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==vn(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+ks(e.display)-Ra(e),u.top)}),n.visible=Ys(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Ys(e.display,e.doc,u));if(!Oo(e,n))break;Ks(e);var f=So(e);bo(e),eo(e,f),Ir(e,f),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Hn(e,n){var u=new ra(e,n);if(Oo(e,u)){Ks(e),Xs(e,u);var l=So(e);bo(e),eo(e,l),Ir(e,l),u.finish()}}function Qs(e,n,u){var l=e.display,f=e.options.lineNumbers,m=l.lineDiv,F=m.firstChild;function U(Ye){var tt=Ye.nextSibling;return g&&C&&e.display.currentWheelTarget==Ye?Ye.style.display="none":Ye.parentNode.removeChild(Ye),tt}for(var z=l.view,Z=l.viewFrom,xe=0;xe<z.length;xe++){var Ee=z[xe];if(!Ee.hidden)if(!Ee.node||Ee.node.parentNode!=m){var Ne=Ad(e,Ee,Z,u);m.insertBefore(Ne,F)}else{for(;F!=Ee.node;)F=U(F);var Me=f&&n!=null&&n<=Z&&Ee.lineNumber;Ee.changes&&(pt(Ee.changes,"gutter")>-1&&(Me=!1),Ps(e,Ee,Z,u)),Me&&(ne(Ee.lineNumber),Ee.lineNumber.appendChild(document.createTextNode(po(e.options,Z)))),F=Ee.node.nextSibling}Z+=Ee.size}for(;F;)F=U(F)}function un(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",Wr(e,"gutterChanged",e)}function Ir(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+Xn(e)+"px"}function Zs(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=Vs(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,m=l+"px",F=0;F<u.length;F++)if(!u[F].hidden){e.options.fixedGutter&&(u[F].gutter&&(u[F].gutter.style.left=m),u[F].gutterBackground&&(u[F].gutterBackground.style.left=m));var U=u[F].alignable;if(U)for(var z=0;z<U.length;z++)U[z].style.left=m}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function _s(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=po(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(ve("div",[ve("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),m=f.firstChild.offsetWidth,F=f.offsetWidth-m;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(m,l.lineGutter.offsetWidth-F)+1,l.lineNumWidth=l.lineNumInnerWidth+F,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",un(e.display),!0}return!1}function Ba(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var m=e[f],F=null;if(typeof m!="string"&&(F=m.style,m=m.className),m=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:m,style:F})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Ua(e){var n=e.gutters,u=e.gutterSpecs;ne(n),e.lineGutter=null;for(var l=0;l<u.length;++l){var f=u[l],m=f.className,F=f.style,U=n.appendChild(ve("div",null,"CodeMirror-gutter "+m));F&&(U.style.cssText=F),m=="CodeMirror-linenumbers"&&(e.lineGutter=U,U.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",un(e)}function To(e){Ua(e.display),$r(e),Zs(e)}function ja(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=ve("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=ve("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=de("div",null,"CodeMirror-code"),f.selectionDiv=ve("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=ve("div",null,"CodeMirror-cursors"),f.measure=ve("div",null,"CodeMirror-measure"),f.lineMeasure=ve("div",null,"CodeMirror-measure"),f.lineSpace=de("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var m=de("div",[f.lineSpace],"CodeMirror-lines");f.mover=ve("div",[m],null,"position: relative"),f.sizer=ve("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=ve("div",null,null,"position: absolute; height: "+yt+"px; width: 1px;"),f.gutters=ve("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=ve("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=ve("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&A<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!g&&!(c&&M)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=n.first,f.reportedViewFrom=f.reportedViewTo=n.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=Ba(l.gutters,l.lineNumbers),Ua(f),u.init(f)}var na=0,Qn=null;b?Qn=-.53:c?Qn=15:N?Qn=-.7:j&&(Qn=-1/3);function qs(e){var n=e.wheelDeltaX,u=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:n,y:u}}function fu(e){var n=qs(e);return n.x*=Qn,n.y*=Qn,n}function el(e,n){var u=qs(n),l=u.x,f=u.y,m=Qn;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,m=1);var F=e.display,U=F.scroller,z=U.scrollWidth>U.clientWidth,Z=U.scrollHeight>U.clientHeight;if(!!(l&&z||f&&Z)){if(f&&C&&g){e:for(var xe=n.target,Ee=F.view;xe!=U;xe=xe.parentNode)for(var Ne=0;Ne<Ee.length;Ne++)if(Ee[Ne].node==xe){e.display.currentWheelTarget=xe;break e}}if(l&&!c&&!B&&m!=null){f&&Z&&ln(e,Math.max(0,U.scrollTop+f*m)),Vn(e,Math.max(0,U.scrollLeft+l*m)),(!f||f&&Z)&&it(n),F.wheelStartX=null;return}if(f&&m!=null){var Me=f*m,Ye=e.doc.scrollTop,tt=Ye+F.wrapper.clientHeight;Me<0?Ye=Math.max(0,Ye+Me-50):tt=Math.min(e.doc.height,tt+Me+50),Hn(e,{top:Ye,bottom:tt})}na<20&&n.deltaMode!==0&&(F.wheelStartX==null?(F.wheelStartX=U.scrollLeft,F.wheelStartY=U.scrollTop,F.wheelDX=l,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX!=null){var at=U.scrollLeft-F.wheelStartX,ft=U.scrollTop-F.wheelStartY,ht=ft&&F.wheelDY&&ft/F.wheelDY||at&&F.wheelDX&&at/F.wheelDX;F.wheelStartX=F.wheelStartY=null,!!ht&&(Qn=(Qn*na+ht)/(na+1),++na)}},200)):(F.wheelDX+=l,F.wheelDY+=f))}}var Ar=function(e,n){this.ranges=e,this.primIndex=n};Ar.prototype.primary=function(){return this.ranges[this.primIndex]},Ar.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var u=this.ranges[n],l=e.ranges[n];if(!ei(u.anchor,l.anchor)||!ei(u.head,l.head))return!1}return!0},Ar.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new _t(se(this.ranges[n].anchor),se(this.ranges[n].head));return new Ar(e,this.primIndex)},Ar.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ar.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Lt(n,l.from())>=0&&Lt(e,l.to())<=0)return u}return-1};var _t=function(e,n){this.anchor=e,this.head=n};_t.prototype.from=function(){return _e(this.anchor,this.head)},_t.prototype.to=function(){return Ce(this.anchor,this.head)},_t.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Fn(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(Ne,Me){return Lt(Ne.from(),Me.from())}),u=pt(n,f);for(var m=1;m<n.length;m++){var F=n[m],U=n[m-1],z=Lt(U.to(),F.from());if(l&&!F.empty()?z>0:z>=0){var Z=_e(U.from(),F.from()),xe=Ce(U.to(),F.to()),Ee=U.empty()?F.from()==F.head:U.from()==U.head;m<=u&&--u,n.splice(--m,2,new _t(Ee?xe:Z,Ee?Z:xe))}}return new Ar(n,u)}function si(e,n){return new Ar([new _t(e,n||e)],0)}function li(e){return e.text?nt(e.from.line+e.text.length-1,At(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function tl(e,n){if(Lt(e,n.from)<0)return e;if(Lt(e,n.to)<=0)return li(n);var u=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=li(n).ch-n.to.ch),nt(u,l)}function Va(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new _t(tl(f.anchor,n),tl(f.head,n)))}return Fn(e.cm,u,e.sel.primIndex)}function rl(e,n,u){return e.line==n.line?nt(u.line,e.ch-n.ch+u.ch):nt(u.line+(e.line-n.line),e.ch)}function cu(e,n,u){for(var l=[],f=nt(e.first,0),m=f,F=0;F<n.length;F++){var U=n[F],z=rl(U.from,f,m),Z=rl(li(U),f,m);if(f=U.to,m=Z,u=="around"){var xe=e.sel.ranges[F],Ee=Lt(xe.head,xe.anchor)<0;l[F]=new _t(Ee?Z:z,Ee?z:Z)}else l[F]=new _t(z,z)}return new Ar(l,e.sel.primIndex)}function Wa(e){e.doc.mode=Bn(e.options,e.doc.modeOption),Fi(e)}function Fi(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,to(e,100),e.state.modeGen++,e.curOp&&$r(e)}function zf(e,n){return n.from.ch==0&&n.to.ch==0&&At(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ha(e,n,u,l){function f(ht){return u?u[ht]:null}function m(ht,ct,bt){Kl(ht,ct,bt,l),Wr(ht,"change",ht,n)}function F(ht,ct){for(var bt=[],Pt=ht;Pt<ct;++Pt)bt.push(new Ji(Z[Pt],f(Pt),l));return bt}var U=n.from,z=n.to,Z=n.text,xe=Et(e,U.line),Ee=Et(e,z.line),Ne=At(Z),Me=f(Z.length-1),Ye=z.line-U.line;if(n.full)e.insert(0,F(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(zf(e,n)){var tt=F(0,Z.length-1);m(Ee,Ee.text,Me),Ye&&e.remove(U.line,Ye),tt.length&&e.insert(U.line,tt)}else if(xe==Ee)if(Z.length==1)m(xe,xe.text.slice(0,U.ch)+Ne+xe.text.slice(z.ch),Me);else{var at=F(1,Z.length-1);at.push(new Ji(Ne+xe.text.slice(z.ch),Me,l)),m(xe,xe.text.slice(0,U.ch)+Z[0],f(0)),e.insert(U.line+1,at)}else if(Z.length==1)m(xe,xe.text.slice(0,U.ch)+Z[0]+Ee.text.slice(z.ch),f(0)),e.remove(U.line+1,Ye);else{m(xe,xe.text.slice(0,U.ch)+Z[0],f(0)),m(Ee,Ne+Ee.text.slice(z.ch),Me);var ft=F(1,Z.length-1);Ye>1&&e.remove(U.line+1,Ye-1),e.insert(U.line+1,ft)}Wr(e,"change",e,n)}function ki(e,n,u){function l(f,m,F){if(f.linked)for(var U=0;U<f.linked.length;++U){var z=f.linked[U];if(z.doc!=m){var Z=F&&z.sharedHist;u&&!Z||(n(z.doc,Z),l(z.doc,f,Z))}}}l(e,null,!0)}function Ze(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,_o(e),Wa(e),nl(e),e.options.direction=n.direction,e.options.lineWrapping||ho(e),e.options.mode=n.modeOption,$r(e)}function nl(e){(e.doc.direction=="rtl"?Ve:te)(e.display.lineDiv,"CodeMirror-rtl")}function za(e){Yr(e,function(){nl(e),$r(e)})}function Po(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ga(e,n){var u={from:se(n.from),to:li(n),text:qn(e,n.from,n.to)};return Ri(e,u,n.from.line,n.to.line+1),ki(e,function(l){return Ri(l,u,n.from.line,n.to.line+1)},!0),u}function il(e){for(;e.length;){var n=At(e);if(n.ranges)e.pop();else break}}function Gf(e,n){if(n)return il(e.done),At(e.done);if(e.done.length&&!At(e.done).ranges)return At(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),At(e.done)}function Yt(e,n,u,l){var f=e.history;f.undone.length=0;var m=+new Date,F,U;if((f.lastOp==l||f.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&f.lastModTime>m-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(F=Gf(f,f.lastOp==l)))U=At(F.changes),Lt(n.from,n.to)==0&&Lt(n.from,U.to)==0?U.to=li(n):F.changes.push(Ga(e,n));else{var z=At(f.done);for((!z||!z.ranges)&&$a(e.sel,f.done),F={changes:[Ga(e,n)],generation:f.generation},f.done.push(F);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(u),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=m,f.lastOp=f.lastSelOp=l,f.lastOrigin=f.lastSelOrigin=n.origin,U||Oe(e,"historyAdded")}function du(e,n,u,l){var f=n.charAt(0);return f=="*"||f=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ro(e,n,u,l){var f=e.history,m=l&&l.origin;u==f.lastSelOp||m&&f.lastSelOrigin==m&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==m||du(e,m,At(f.done),n))?f.done[f.done.length-1]=n:$a(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=m,f.lastSelOp=u,l&&l.clearRedo!==!1&&il(f.undone)}function $a(e,n){var u=At(n);u&&u.ranges&&u.equals(e)||n.push(e)}function Ri(e,n,u,l){var f=n["spans_"+e.id],m=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(F){F.markedSpans&&((f||(f=n["spans_"+e.id]={}))[m]=F.markedSpans),++m})}function $f(e){if(!e)return null;for(var n,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?n||(n=e.slice(0,u)):n&&n.push(e[u]);return n?n.length?n:null:e}function pu(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push($f(u[f]));return l}function hu(e,n){var u=pu(e,n),l=Vl(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var m=u[f],F=l[f];if(m&&F){e:for(var U=0;U<F.length;++U){for(var z=F[U],Z=0;Z<m.length;++Z)if(m[Z].marker==z.marker)continue e;m.push(z)}}else F&&(u[f]=F)}return u}function Io(e,n,u){for(var l=[],f=0;f<e.length;++f){var m=e[f];if(m.ranges){l.push(u?Ar.prototype.deepCopy.call(m):m);continue}var F=m.changes,U=[];l.push({changes:U});for(var z=0;z<F.length;++z){var Z=F[z],xe=void 0;if(U.push({from:Z.from,to:Z.to,text:Z.text}),n)for(var Ee in Z)(xe=Ee.match(/^spans_(\d+)$/))&&pt(n,Number(xe[1]))>-1&&(At(U)[Ee]=Z[Ee],delete Z[Ee])}}return l}function Ka(e,n,u,l){if(l){var f=e.anchor;if(u){var m=Lt(n,f)<0;m!=Lt(u,f)<0?(f=n,n=u):m!=Lt(n,u)<0&&(n=u)}return new _t(f,n)}else return new _t(u||n,n)}function Ya(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),rr(e,new Ar([Ka(e.sel.primary(),n,u,f)],0),l)}function vu(e,n,u){for(var l=[],f=e.cm&&(e.cm.display.shift||e.extend),m=0;m<e.sel.ranges.length;m++)l[m]=Ka(e.sel.ranges[m],n[m],null,f);var F=Fn(e.cm,l,e.sel.primIndex);rr(e,F,u)}function tn(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,rr(e,Fn(e.cm,f,e.sel.primIndex),l)}function ol(e,n,u,l){rr(e,si(n,u),l)}function Kf(e,n,u){var l={ranges:n.ranges,update:function(f){this.ranges=[];for(var m=0;m<f.length;m++)this.ranges[m]=new _t(st(e,f[m].anchor),st(e,f[m].head))},origin:u&&u.origin};return Oe(e,"beforeSelectionChange",e,l),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?Fn(e.cm,l.ranges,l.ranges.length-1):n}function Ja(e,n,u){var l=e.history.done,f=At(l);f&&f.ranges?(l[l.length-1]=n,Xa(e,n,u)):rr(e,n,u)}function rr(e,n,u){Xa(e,n,u),ro(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function Xa(e,n,u){(Ge(e,"beforeSelectionChange")||e.cm&&Ge(e.cm,"beforeSelectionChange"))&&(n=Kf(e,n,u));var l=u&&u.bias||(Lt(n.primary().head,e.sel.primary().head)<0?-1:1);ui(e,al(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&yn(e.cm)}function ui(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),Wr(e,"cursorActivity",e))}function Qa(e){ui(e,al(e,e.sel,null,!1))}function al(e,n,u,l){for(var f,m=0;m<n.ranges.length;m++){var F=n.ranges[m],U=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[m],z=Dr(e,F.anchor,U&&U.anchor,u,l),Z=Dr(e,F.head,U&&U.head,u,l);(f||z!=F.anchor||Z!=F.head)&&(f||(f=n.ranges.slice(0,m)),f[m]=new _t(z,Z))}return f?Fn(e.cm,f,n.primIndex):n}function no(e,n,u,l,f){var m=Et(e,n.line);if(m.markedSpans)for(var F=0;F<m.markedSpans.length;++F){var U=m.markedSpans[F],z=U.marker,Z="selectLeft"in z?!z.selectLeft:z.inclusiveLeft,xe="selectRight"in z?!z.selectRight:z.inclusiveRight;if((U.from==null||(Z?U.from<=n.ch:U.from<n.ch))&&(U.to==null||(xe?U.to>=n.ch:U.to>n.ch))){if(f&&(Oe(z,"beforeCursorEnter"),z.explicitlyCleared))if(m.markedSpans){--F;continue}else break;if(!z.atomic)continue;if(u){var Ee=z.find(l<0?1:-1),Ne=void 0;if((l<0?xe:Z)&&(Ee=gu(e,Ee,-l,Ee&&Ee.line==n.line?m:null)),Ee&&Ee.line==n.line&&(Ne=Lt(Ee,u))&&(l<0?Ne<0:Ne>0))return no(e,Ee,n,l,f)}var Me=z.find(l<0?-1:1);return(l<0?Z:xe)&&(Me=gu(e,Me,l,Me.line==n.line?m:null)),Me?no(e,Me,n,l,f):null}}return n}function Dr(e,n,u,l,f){var m=l||1,F=no(e,n,u,m,f)||!f&&no(e,n,u,m,!0)||no(e,n,u,-m,f)||!f&&no(e,n,u,-m,!0);return F||(e.cantEdit=!0,nt(e.first,0))}function gu(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?st(e,nt(n.line-1)):null:u>0&&n.ch==(l||Et(e,n.line)).text.length?n.line<e.first+e.size-1?nt(n.line+1,0):null:new nt(n.line,n.ch+u)}function Za(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),lt)}function yu(e,n,u){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(f,m,F,U){f&&(l.from=st(e,f)),m&&(l.to=st(e,m)),F&&(l.text=F),U!==void 0&&(l.origin=U)}),Oe(e,"beforeChange",e,l),e.cm&&Oe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Mi(e,n,u){if(e.cm){if(!e.cm.curOp)return xr(e.cm,Mi)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"))&&(n=yu(e,n,!0),!n))){var l=mf&&!u&&Hl(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)mu(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else mu(e,n)}}function mu(e,n){if(!(n.text.length==1&&n.text[0]==""&&Lt(n.from,n.to)==0)){var u=Va(e,n);Yt(e,n,u,e.cm?e.cm.curOp.id:NaN),ia(e,n,u,Vl(e,n));var l=[];ki(e,function(f,m){!m&&pt(l,f.history)==-1&&(wu(f.history,n),l.push(f.history)),ia(f,n,null,Vl(f,n))})}}function sl(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,m,F=e.sel,U=n=="undo"?f.done:f.undone,z=n=="undo"?f.undone:f.done,Z=0;Z<U.length&&(m=U[Z],!(u?m.ranges&&!m.equals(e.sel):!m.ranges));Z++);if(Z!=U.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(m=U.pop(),m.ranges){if($a(m,z),u&&!m.equals(e.sel)){rr(e,m,{clearRedo:!1});return}F=m}else if(l){U.push(m);return}else break;var xe=[];$a(F,z),z.push({changes:xe,generation:f.generation}),f.generation=m.generation||++f.maxGeneration;for(var Ee=Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"),Ne=function(tt){var at=m.changes[tt];if(at.origin=n,Ee&&!yu(e,at,!1))return U.length=0,{};xe.push(Ga(e,at));var ft=tt?Va(e,at):At(U);ia(e,at,ft,hu(e,at)),!tt&&e.cm&&e.cm.scrollIntoView({from:at.from,to:li(at)});var ht=[];ki(e,function(ct,bt){!bt&&pt(ht,ct.history)==-1&&(wu(ct.history,at),ht.push(ct.history)),ia(ct,at,null,hu(ct,at))})},Me=m.changes.length-1;Me>=0;--Me){var Ye=Ne(Me);if(Ye)return Ye.v}}}}function xu(e,n){if(n!=0&&(e.first+=n,e.sel=new Ar(jt(e.sel.ranges,function(f){return new _t(nt(f.anchor.line+n,f.anchor.ch),nt(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){$r(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)Ei(e.cm,l,"gutter")}}function ia(e,n,u,l){if(e.cm&&!e.cm.curOp)return xr(e.cm,ia)(e,n,u,l);if(n.to.line<e.first){xu(e,n.text.length-1-(n.to.line-n.from.line));return}if(!(n.from.line>e.lastLine())){if(n.from.line<e.first){var f=n.text.length-1-(e.first-n.from.line);xu(e,f),n={from:nt(e.first,0),to:nt(n.to.line+f,n.to.ch),text:[At(n.text)],origin:n.origin}}var m=e.lastLine();n.to.line>m&&(n={from:n.from,to:nt(m,Et(e,m).text.length),text:[n.text[0]],origin:n.origin}),n.removed=qn(e,n.from,n.to),u||(u=Va(e,n)),e.cm?Yf(e.cm,n,l):Ha(e,n,l),Xa(e,u,lt),e.cantEdit&&Dr(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}}function Yf(e,n,u){var l=e.doc,f=e.display,m=n.from,F=n.to,U=!1,z=m.line;e.options.lineWrapping||(z=qt(xt(Et(l,m.line))),l.iter(z,F.line+1,function(Me){if(Me==f.maxLine)return U=!0,!0})),l.sel.contains(n.from,n.to)>-1&&Te(e),Ha(l,n,u,Ws(e)),e.options.lineWrapping||(l.iter(z,m.line+n.text.length,function(Me){var Ye=Ho(Me);Ye>f.maxLineLength&&(f.maxLine=Me,f.maxLineLength=Ye,f.maxLineChanged=!0,U=!1)}),U&&(e.curOp.updateMaxLine=!0)),yf(l,m.line),to(e,400);var Z=n.text.length-(F.line-m.line)-1;n.full?$r(e):m.line==F.line&&n.text.length==1&&!zf(e.doc,n)?Ei(e,m.line,"text"):$r(e,m.line,F.line+1,Z);var xe=Ge(e,"changes"),Ee=Ge(e,"change");if(Ee||xe){var Ne={from:m,to:F,text:n.text,removed:n.removed,origin:n.origin};Ee&&Wr(e,"change",e,Ne),xe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function Fo(e,n,u,l,f){var m;l||(l=u),Lt(l,u)<0&&(m=[l,u],u=m[0],l=m[1]),typeof n=="string"&&(n=e.splitLines(n)),Mi(e,{from:u,to:l,text:n,origin:f})}function _a(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function bu(e,n,u,l){for(var f=0;f<e.length;++f){var m=e[f],F=!0;if(m.ranges){m.copied||(m=e[f]=m.deepCopy(),m.copied=!0);for(var U=0;U<m.ranges.length;U++)_a(m.ranges[U].anchor,n,u,l),_a(m.ranges[U].head,n,u,l);continue}for(var z=0;z<m.changes.length;++z){var Z=m.changes[z];if(u<Z.from.line)Z.from=nt(Z.from.line+l,Z.from.ch),Z.to=nt(Z.to.line+l,Z.to.ch);else if(n<=Z.to.line){F=!1;break}}F||(e.splice(0,f+1),f=0)}}function wu(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;bu(e.done,u,l,f),bu(e.undone,u,l,f)}function dr(e,n,u,l){var f=n,m=n;return typeof n=="number"?m=Et(e,ot(e,n)):f=qt(n),f==null?null:(l(m,f)&&e.cm&&Ei(e.cm,f,u),m)}function fi(e){this.lines=e,this.parent=null;for(var n=0,u=0;u<e.length;++u)e[u].parent=this,n+=e[u].height;this.height=n}fi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var u=e,l=e+n;u<l;++u){var f=this.lines[u];this.height-=f.height,Yl(f),Wr(f,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,u){for(var l=e+n;e<l;++e)if(u(this.lines[e]))return!0}};function oa(e){this.children=e;for(var n=0,u=0,l=0;l<e.length;++l){var f=e[l];n+=f.chunkSize(),u+=f.height,f.parent=this}this.size=n,this.height=u,this.parent=null}oa.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var u=0;u<this.children.length;++u){var l=this.children[u],f=l.chunkSize();if(e<f){var m=Math.min(n,f-e),F=l.height;if(l.removeInner(e,m),this.height-=F-l.height,f==m&&(this.children.splice(u--,1),l.parent=null),(n-=m)==0)break;e=0}else e-=f}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof fi))){var U=[];this.collapse(U),this.children=[new fi(U)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,u){this.size+=n.length,this.height+=u;for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<=m){if(f.insertInner(e,n,u),f.lines&&f.lines.length>50){for(var F=f.lines.length%25+25,U=F;U<f.lines.length;){var z=new fi(f.lines.slice(U,U+=25));f.height-=z.height,this.children.splice(++l,0,z),z.parent=this}f.lines=f.lines.slice(0,F),this.maybeSpill()}break}e-=m}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var n=e.children.splice(e.children.length-5,5),u=new oa(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=pt(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new oa(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,n,u){for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<m){var F=Math.min(n,m-e);if(f.iterN(e,F,u))return!0;if((n-=F)==0)break;e=0}else e-=m}}};var qa=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};qa.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=qt(u);if(!(l==null||!n)){for(var f=0;f<n.length;++f)n[f]==this&&n.splice(f--,1);n.length||(u.widgets=null);var m=Yo(this);En(u,Math.max(0,u.height-m)),e&&(Yr(e,function(){Jf(e,u,-m),Ei(e,l,"widget")}),Wr(e,"lineWidgetCleared",e,this,l))}},qa.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=Yo(this)-n;!f||(ti(this.doc,l)||En(l,l.height+f),u&&Yr(u,function(){u.curOp.forceUpdate=!0,Jf(u,l,f),Wr(u,"lineWidgetChanged",u,e,qt(l))}))},He(qa);function Jf(e,n,u){ri(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&sn(e,u)}function Td(e,n,u,l){var f=new qa(e,u,l),m=e.cm;return m&&f.noHScroll&&(m.display.alignWidgets=!0),dr(e,n,"widget",function(F){var U=F.widgets||(F.widgets=[]);if(f.insertAt==null?U.push(f):U.splice(Math.min(U.length,Math.max(0,f.insertAt)),0,f),f.line=F,m&&!ti(e,F)){var z=ri(F)<e.scrollTop;En(F,F.height+Yo(f)),z&&sn(m,f.height),m.curOp.forceUpdate=!0}return!0}),m&&Wr(m,"lineWidgetAdded",m,f,typeof n=="number"?n:qt(n)),f}var Su=0,Li=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Su};Li.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Ti(e),Ge(this,"clear")){var u=this.find();u&&Wr(this,"clear",u.from,u.to)}for(var l=null,f=null,m=0;m<this.lines.length;++m){var F=this.lines[m],U=Vo(F.markedSpans,this);e&&!this.collapsed?Ei(e,qt(F),"text"):e&&(U.to!=null&&(f=qt(F)),U.from!=null&&(l=qt(F))),F.markedSpans=wf(F.markedSpans,U),U.from==null&&this.collapsed&&!ti(this.doc,F)&&e&&En(F,mo(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var z=0;z<this.lines.length;++z){var Z=xt(this.lines[z]),xe=Ho(Z);xe>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=xe,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&$r(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Qa(e.doc)),e&&Wr(e,"markerCleared",e,this,l,f),n&&Pi(e),this.parent&&this.parent.clear()}},Li.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,f=0;f<this.lines.length;++f){var m=this.lines[f],F=Vo(m.markedSpans,this);if(F.from!=null&&(u=nt(n?m:qt(m),F.from),e==-1))return u;if(F.to!=null&&(l=nt(n?m:qt(m),F.to),e==1))return l}return u&&{from:u,to:l}},Li.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||Yr(l,function(){var f=n.line,m=qt(n.line),F=Rs(l,m);if(F&&(iu(F),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!ti(u.doc,f)&&u.height!=null){var U=u.height;u.height=null;var z=Yo(u)-U;z&&En(f,f.height+z)}Wr(l,"markerChanged",l,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||pt(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(pt(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},He(Li);function aa(e,n,u,l,f){if(l&&l.shared)return Xf(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return xr(e.cm,aa)(e,n,u,l,f);var m=new Li(e,f),F=Lt(n,u);if(l&&Qe(l,m,!1),F>0||F==0&&m.clearWhenEmpty!==!1)return m;if(m.replacedWith&&(m.collapsed=!0,m.widgetNode=de("span",[m.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||m.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(m.widgetNode.insertLeft=!0)),m.collapsed){if(Yi(e,n.line,n,u,m)||n.line!=u.line&&Yi(e,u.line,n,u,m))throw new Error("Inserting collapsed marker partially overlapping an existing one");bf()}m.addToHistory&&Yt(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var U=n.line,z=e.cm,Z;if(e.iter(U,u.line+1,function(Ee){z&&m.collapsed&&!z.options.lineWrapping&&xt(Ee)==z.display.maxLine&&(Z=!0),m.collapsed&&U!=n.line&&En(Ee,0),md(Ee,new Ia(m,U==n.line?n.ch:null,U==u.line?u.ch:null),e.cm&&e.cm.curOp),++U}),m.collapsed&&e.iter(n.line,u.line+1,function(Ee){ti(e,Ee)&&En(Ee,0)}),m.clearOnEnter&&D(m,"beforeCursorEnter",function(){return m.clear()}),m.readOnly&&(xf(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),m.collapsed&&(m.id=++Su,m.atomic=!0),z){if(Z&&(z.curOp.updateMaxLine=!0),m.collapsed)$r(z,n.line,u.line+1);else if(m.className||m.startStyle||m.endStyle||m.css||m.attributes||m.title)for(var xe=n.line;xe<=u.line;xe++)Ei(z,xe,"text");m.atomic&&Qa(z.doc),Wr(z,"markerAdded",z,m)}return m}var sa=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};sa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wr(this,"clear")}},sa.prototype.find=function(e,n){return this.primary.find(e,n)},He(sa);function Xf(e,n,u,l,f){l=Qe(l),l.shared=!1;var m=[aa(e,n,u,l,f)],F=m[0],U=l.widgetNode;return ki(e,function(z){U&&(l.widgetNode=U.cloneNode(!0)),m.push(aa(z,st(z,n),st(z,u),l,f));for(var Z=0;Z<z.linked.length;++Z)if(z.linked[Z].isParent)return;F=At(m)}),new sa(m,F)}function Au(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),function(n){return n.parent})}function Qf(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),m=e.clipPos(f.from),F=e.clipPos(f.to);if(Lt(m,F)){var U=aa(e,m,F,l.primary,l.primary.type);l.markers.push(U),U.parent=l}}}function Zf(e){for(var n=function(l){var f=e[l],m=[f.primary.doc];ki(f.primary.doc,function(z){return m.push(z)});for(var F=0;F<f.markers.length;F++){var U=f.markers[F];pt(m,U.doc)==-1&&(U.parent=null,f.markers.splice(F--,1))}},u=0;u<e.length;u++)n(u)}var _f=0,Vt=function(e,n,u,l,f){if(!(this instanceof Vt))return new Vt(e,n,u,l,f);u==null&&(u=0),oa.call(this,[new fi([new Ji("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var m=nt(u,0);this.sel=si(m),this.history=new Po(null),this.id=++_f,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ha(this,{from:m,to:m,text:e}),rr(this,si(m),lt)};Vt.prototype=St(oa.prototype,{constructor:Vt,iter:function(e,n,u){u?this.iterN(e-this.first,n-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var u=0,l=0;l<n.length;++l)u+=n[l].height;this.insertInner(e-this.first,n,u)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=bi(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:br(function(e){var n=nt(this.first,0),u=this.first+this.size-1;Mi(this,{from:n,to:nt(u,Et(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&mn(this.cm,0,0),rr(this,si(n),lt)}),replaceRange:function(e,n,u,l){n=st(this,n),u=u?st(this,u):n,Fo(this,e,n,u,l)},getRange:function(e,n,u){var l=qn(this,st(this,e),st(this,n));return u===!1?l:u===""?l.join(""):l.join(u||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Jn(this,e))return Et(this,e)},getLineNumber:function(e){return qt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Et(this,e)),xt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var n=this.sel.primary(),u;return e==null||e=="head"?u=n.head:e=="anchor"?u=n.anchor:e=="end"||e=="to"||e===!1?u=n.to():u=n.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:br(function(e,n,u){ol(this,st(this,typeof e=="number"?nt(e,n||0):e),null,u)}),setSelection:br(function(e,n,u){ol(this,st(this,e),st(this,n||e),u)}),extendSelection:br(function(e,n,u){Ya(this,st(this,e),n&&st(this,n),u)}),extendSelections:br(function(e,n){vu(this,Zt(this,e),n)}),extendSelectionsBy:br(function(e,n){var u=jt(this.sel.ranges,e);vu(this,Zt(this,u),n)}),setSelections:br(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new _t(st(this,e[f].anchor),st(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),rr(this,Fn(this.cm,l,n),u)}}),addSelection:br(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new _t(st(this,e),st(this,n||e))),rr(this,Fn(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var n=this.sel.ranges,u,l=0;l<n.length;l++){var f=qn(this,n[l].from(),n[l].to());u=u?u.concat(f):f}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],u=this.sel.ranges,l=0;l<u.length;l++){var f=qn(this,u[l].from(),u[l].to());e!==!1&&(f=f.join(e||this.lineSeparator())),n[l]=f}return n},replaceSelection:function(e,n,u){for(var l=[],f=0;f<this.sel.ranges.length;f++)l[f]=e;this.replaceSelections(l,n,u||"+input")},replaceSelections:br(function(e,n,u){for(var l=[],f=this.sel,m=0;m<f.ranges.length;m++){var F=f.ranges[m];l[m]={from:F.from(),to:F.to(),text:this.splitLines(e[m]),origin:u}}for(var U=n&&n!="end"&&cu(this,l,n),z=l.length-1;z>=0;z--)Mi(this,l[z]);U?Ja(this,U):this.cm&&yn(this.cm)}),undo:br(function(){sl(this,"undo")}),redo:br(function(){sl(this,"redo")}),undoSelection:br(function(){sl(this,"undo",!0)}),redoSelection:br(function(){sl(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++u;return{undo:n,redo:u}},clearHistory:function(){var e=this;this.history=new Po(this.history),ki(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Io(this.history.done),undone:Io(this.history.undone)}},setHistory:function(e){var n=this.history=new Po(this.history);n.done=Io(e.done.slice(0),null,!0),n.undone=Io(e.undone.slice(0),null,!0)},setGutterMarker:br(function(e,n,u){return dr(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&K(f)&&(l.gutterMarkers=null),!0})}),clearGutter:br(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&dr(n,u,"gutter",function(){return u.gutterMarkers[e]=null,K(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Jn(this,e)||(n=e,e=Et(this,e),!e))return null}else if(n=qt(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:br(function(e,n,u){return dr(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[f])l[f]=u;else{if(fe(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:br(function(e,n,u){return dr(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",m=l[f];if(m)if(u==null)l[f]=null;else{var F=m.match(fe(u));if(!F)return!1;var U=F.index+F[0].length;l[f]=m.slice(0,F.index)+(!F.index||U==m.length?"":" ")+m.slice(U)||null}else return!1;return!0})}),addLineWidget:br(function(e,n,u){return Td(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return aa(this,st(this,e),st(this,n),u,u&&u.type||"range")},setBookmark:function(e,n){var u={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=st(this,e),aa(this,e,e,u,"bookmark")},findMarksAt:function(e){e=st(this,e);var n=[],u=Et(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var f=u[l];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&n.push(f.marker.parent||f.marker)}return n},findMarks:function(e,n,u){e=st(this,e),n=st(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(m){var F=m.markedSpans;if(F)for(var U=0;U<F.length;U++){var z=F[U];!(z.to!=null&&f==e.line&&e.ch>=z.to||z.from==null&&f!=e.line||z.from!=null&&f==n.line&&z.from>=n.ch)&&(!u||u(z.marker))&&l.push(z.marker.parent||z.marker)}++f}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var u=n.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var n,u=this.first,l=this.lineSeparator().length;return this.iter(function(f){var m=f.text.length+l;if(m>e)return n=e,!0;e-=m,++u}),st(this,nt(u,n))},indexFromPos:function(e){e=st(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+u}),n},copy:function(e){var n=new Vt(bi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,u=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new Vt(bi(this,n,u),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Qf(l,Au(this)),l},unlinkDoc:function(e){if(e instanceof cr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var u=this.linked[n];if(u.doc==e){this.linked.splice(n,1),e.unlinkDoc(this),Zf(Au(this));break}}if(e.history==this.history){var l=[e.id];ki(e,function(f){return l.push(f.id)},!0),e.history=new Po(null),e.history.done=Io(this.history.done,l),e.history.undone=Io(this.history.undone,l)}},iterLinkedDocs:function(e){ki(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$n(e)},lineSeparator:function(){return this.lineSep||`
28
- `},setDirection:br(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&za(this.cm))})}),Vt.prototype.eachLine=Vt.prototype.iter;var kn=0;function qf(e){var n=this;if(io(n),!(Pe(n,e)||ni(n.display,e))){it(e),b&&(kn=+new Date);var u=_i(n,e,!0),l=e.dataTransfer.files;if(!(!u||n.isReadOnly()))if(l&&l.length&&window.FileReader&&window.File)for(var f=l.length,m=Array(f),F=0,U=function(){++F==f&&xr(n,function(){u=st(n.doc,u);var Me={from:u,to:u,text:n.doc.splitLines(m.filter(function(Ye){return Ye!=null}).join(n.doc.lineSeparator())),origin:"paste"};Mi(n.doc,Me),Ja(n.doc,si(st(n.doc,u),st(n.doc,li(Me))))})()},z=function(Me,Ye){if(n.options.allowDropFileTypes&&pt(n.options.allowDropFileTypes,Me.type)==-1){U();return}var tt=new FileReader;tt.onerror=function(){return U()},tt.onload=function(){var at=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){U();return}m[Ye]=at,U()},tt.readAsText(Me)},Z=0;Z<l.length;Z++)z(l[Z],Z);else{if(n.state.draggingText&&n.doc.sel.contains(u)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var xe=e.dataTransfer.getData("Text");if(xe){var Ee;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ee=n.listSelections()),Xa(n.doc,si(u,u)),Ee)for(var Ne=0;Ne<Ee.length;++Ne)Fo(n.doc,"",Ee[Ne].anchor,Ee[Ne].head,"drag");n.replaceSelection(xe,"around","paste"),n.display.input.focus()}}catch(Me){}}}}function ll(e,n){if(b&&(!e.state.draggingText||+new Date-kn<100)){Jt(n);return}if(!(Pe(e,n)||ni(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!j)){var u=ve("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),B&&u.parentNode.removeChild(u)}}function Eu(e,n){var u=_i(e,n);if(!!u){var l=document.createDocumentFragment();Oi(e,u,l),e.display.dragCursor||(e.display.dragCursor=ve("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ye(e.display.dragCursor,l)}}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ul(e){if(!!document.getElementsByClassName){for(var n=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<n.length;l++){var f=n[l].CodeMirror;f&&u.push(f)}u.length&&u[0].operation(function(){for(var m=0;m<u.length;m++)e(u[m])})}}var fl=!1;function ec(){fl||(Cu(),fl=!0)}function Cu(){var e;D(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ul(cl)},100))}),D(window,"blur",function(){return ul(wo)})}function cl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var ci={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ko=0;ko<10;ko++)ci[ko+48]=ci[ko+96]=String(ko);for(var oo=65;oo<=90;oo++)ci[oo]=String.fromCharCode(oo);for(var la=1;la<=12;la++)ci[la+111]=ci[la+63235]="F"+la;var di={};di.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},di.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},di.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},di.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},di.default=C?di.macDefault:di.pcDefault;function Ro(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,m,F=0;F<n.length-1;F++){var U=n[F];if(/^(cmd|meta|m)$/i.test(U))m=!0;else if(/^a(lt)?$/i.test(U))u=!0;else if(/^(c|ctrl|control)$/i.test(U))l=!0;else if(/^s(hift)?$/i.test(U))f=!0;else throw new Error("Unrecognized modifier name: "+U)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),m&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Ou(e){var n={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var f=jt(u.split(" "),Ro),m=0;m<f.length;m++){var F=void 0,U=void 0;m==f.length-1?(U=f.join(" "),F=l):(U=f.slice(0,m+1).join(" "),F="...");var z=n[U];if(!z)n[U]=F;else if(z!=F)throw new Error("Inconsistent bindings for "+U)}delete e[u]}for(var Z in n)e[Z]=n[Z];return e}function Mo(e,n,u,l){n=fa(n);var f=n.call?n.call(e,l):n[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&u(f))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Mo(e,n.fallthrough,u,l);for(var m=0;m<n.fallthrough.length;m++){var F=Mo(e,n.fallthrough[m],u,l);if(F)return F}}}function ua(e){var n=typeof e=="string"?e:ci[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Tu(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(Q?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(Q?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Pu(e,n){if(B&&e.keyCode==34&&e.char)return!1;var u=ci[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),Tu(u,e,n))}function fa(e){return typeof e=="string"?di[e]:e}function ao(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var m=n(u[f]);l.length&&Lt(m.from,At(l).to)<=0;){var F=l.pop();if(Lt(F.from,m.from)<0){m.from=F.from;break}}l.push(m)}Yr(e,function(){for(var U=l.length-1;U>=0;U--)Fo(e.doc,"",l[U].from,l[U].to,"+delete");yn(e)})}function es(e,n,u){var l=be(e.text,n+u,u);return l<0||l>e.text.length?null:l}function ts(e,n,u){var l=es(e,n.ch,u);return l==null?null:new nt(n.line,l,u<0?"after":"before")}function dl(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var m=P(u,n.doc.direction);if(m){var F=f<0?At(m):m[0],U=f<0==(F.level==1),z=U?"after":"before",Z;if(F.level>0||n.doc.direction=="rtl"){var xe=yo(n,u);Z=f<0?u.text.length-1:0;var Ee=gn(n,xe,Z).top;Z=Ae(function(Ne){return gn(n,xe,Ne).top==Ee},f<0==(F.level==1)?F.from:F.to-1,Z),z=="before"&&(Z=es(u,Z,1))}else Z=f<0?F.to:F.from;return new nt(l,Z,z)}}return new nt(l,f<0?u.text.length:0,f<0?"before":"after")}function tc(e,n,u,l){var f=P(n,e.doc.direction);if(!f)return ts(n,u,l);u.ch>=n.text.length?(u.ch=n.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var m=W(f,u.ch,u.sticky),F=f[m];if(e.doc.direction=="ltr"&&F.level%2==0&&(l>0?F.to>u.ch:F.from<u.ch))return ts(n,u,l);var U=function(ft,ht){return es(n,ft instanceof nt?ft.ch:ft,ht)},z,Z=function(ft){return e.options.lineWrapping?(z=z||yo(e,n),ou(e,n,z,ft)):{begin:0,end:n.text.length}},xe=Z(u.sticky=="before"?U(u,-1):u.ch);if(e.doc.direction=="rtl"||F.level==1){var Ee=F.level==1==l<0,Ne=U(u,Ee?1:-1);if(Ne!=null&&(Ee?Ne<=F.to&&Ne<=xe.end:Ne>=F.from&&Ne>=xe.begin)){var Me=Ee?"before":"after";return new nt(u.line,Ne,Me)}}var Ye=function(ft,ht,ct){for(var bt=function(ar,Hr){return Hr?new nt(u.line,U(ar,1),"before"):new nt(u.line,ar,"after")};ft>=0&&ft<f.length;ft+=ht){var Pt=f[ft],Ot=ht>0==(Pt.level!=1),Ut=Ot?ct.begin:U(ct.end,-1);if(Pt.from<=Ut&&Ut<Pt.to||(Ut=Ot?Pt.from:U(Pt.to,-1),ct.begin<=Ut&&Ut<ct.end))return bt(Ut,Ot)}},tt=Ye(m+l,l,xe);if(tt)return tt;var at=l>0?xe.end:U(xe.begin,-1);return at!=null&&!(l>0&&at==n.text.length)&&(tt=Ye(l>0?0:f.length-1,l,Z(at)),tt)?tt:null}var Di={selectAll:Za,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),lt)},killLine:function(e){return ao(e,function(n){if(n.empty()){var u=Et(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:nt(n.head.line+1,0)}:{from:n.head,to:nt(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ao(e,function(n){return{from:nt(n.from().line,0),to:st(e.doc,nt(n.to().line+1,0))}})},delLineLeft:function(e){return ao(e,function(n){return{from:nt(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ao(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ao(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Iu(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Fu(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Fr(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Fu(e,n.head):l},mt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],u=e.listSelections(),l=e.options.tabSize,f=0;f<u.length;f++){var m=u[f].from(),F=Xe(e.getLine(m.line),m.ch,l);n.push(It(l-F%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Yr(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,m=Et(e.doc,f.line).text;if(m){if(f.ch==m.length&&(f=new nt(f.line,f.ch-1)),f.ch>0)f=new nt(f.line,f.ch+1),e.replaceRange(m.charAt(f.ch-1)+m.charAt(f.ch-2),nt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var F=Et(e.doc,f.line-1).text;F&&(f=new nt(f.line,1),e.replaceRange(m.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),nt(f.line-1,F.length-1),f,"+transpose"))}}u.push(new _t(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return Yr(e,function(){for(var n=e.listSelections(),u=n.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),n[u].anchor,n[u].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);yn(e)})},openLine:function(e){return e.replaceSelection(`
29
- `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Iu(e,n){var u=Et(e.doc,n),l=xt(u);return l!=u&&(n=qt(l)),dl(!0,e,l,n,1)}function Fr(e,n){var u=Et(e.doc,n),l=In(u);return l!=u&&(n=qt(l)),dl(!0,e,u,n,-1)}function Fu(e,n){var u=Iu(e,n.line),l=Et(e.doc,u.line),f=P(l,e.doc.direction);if(!f||f[0].level==0){var m=Math.max(u.ch,l.text.search(/\S/)),F=n.line==u.line&&n.ch<=m&&n.ch;return nt(u.line,F?0:m,u.sticky)}return u}function pl(e,n,u){if(typeof n=="string"&&(n=Di[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),f=n(e)!=qe}finally{e.display.shift=l,e.state.suppressEdits=!1}return f}function rc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=Mo(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&Mo(n,e.options.extraKeys,u,e)||Mo(n,e.options.keyMap,u,e)}var Ni=new ut;function ca(e,n,u,l){var f=e.state.keySeq;if(f){if(ua(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Ni.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),ku(e,f+" "+n,u,l))return!0}return ku(e,n,u,l)}function ku(e,n,u,l){var f=rc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&Wr(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(it(u),su(e)),!!f}function Ru(e,n){var u=Pu(n,!0);return u?n.shiftKey&&!e.state.keySeq?ca(e,"Shift-"+u,n,function(l){return pl(e,l,!0)})||ca(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return pl(e,l)}):ca(e,u,n,function(l){return pl(e,l)}):!1}function nc(e,n,u){return ca(e,"'"+u+"'",n,function(l){return pl(e,l,!0)})}var Mu=null;function ic(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=De(),!Pe(n,e))){b&&A<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=Ru(n,e);B&&(Mu=l?u:null,!l&&u==88&&!Kn&&(C?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!C&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Pd(n)}}function Pd(e){var n=e.display.lineDiv;Ve(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(te(n,"CodeMirror-crosshair"),ce(document,"keyup",u),ce(document,"mouseover",u))}D(document,"keyup",u),D(document,"mouseover",u)}function oc(e){e.keyCode==16&&(this.doc.sel.shift=!1),Pe(this,e)}function ac(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(ni(n.display,e)||Pe(n,e)||e.ctrlKey&&!e.altKey||C&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(B&&u==Mu){Mu=null,it(e);return}if(!(B&&(!e.which||e.which<10)&&Ru(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(nc(n,e,f)||n.display.input.onKeyPress(e))}}}var Id=400,Lu=function(e,n,u){this.time=e,this.pos=n,this.button=u};Lu.prototype.compare=function(e,n,u){return this.time+Id>e&&Lt(n,this.pos)==0&&u==this.button};var rs,ns;function Fd(e,n){var u=+new Date;return ns&&ns.compare(u,e,n)?(rs=ns=null,"triple"):rs&&rs.compare(u,e,n)?(ns=new Lu(u,e,n),rs=null,"double"):(rs=new Lu(u,e,n),ns=null,"single")}function hl(e){var n=this,u=n.display;if(!(Pe(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,ni(u,e)){g||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!os(n,e)){var l=_i(n,e),f=wn(e),m=l?Fd(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&Lo(n,f,l,m,e))&&(f==1?l?lc(n,l,m,e):Ft(e)==u.scroller&&it(e):f==2?(l&&Ya(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(Y?n.display.input.onContextMenu(e):Gs(n)))}}}function Lo(e,n,u,l,f){var m="Click";return l=="double"?m="Double"+m:l=="triple"&&(m="Triple"+m),m=(n==1?"Left":n==2?"Middle":"Right")+m,ca(e,Tu(m,f),f,function(F){if(typeof F=="string"&&(F=Di[F]),!F)return!1;var U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),U=F(e,u)!=qe}finally{e.state.suppressEdits=!1}return U})}function sc(e,n,u){var l=e.getOption("configureMouse"),f=l?l(e,n,u):{};if(f.unit==null){var m=V?u.shiftKey&&u.metaKey:u.altKey;f.unit=m?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||u.shiftKey),f.addNew==null&&(f.addNew=C?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(C?u.altKey:u.ctrlKey)),f}function lc(e,n,u,l){b?setTimeout(rt(jf,e),0):e.curOp.focus=De();var f=sc(e,u,l),m=e.doc.sel,F;e.options.dragDrop&&Zr&&!e.isReadOnly()&&u=="single"&&(F=m.contains(n))>-1&&(Lt((F=m.ranges[F]).from(),n)<0||n.xRel>0)&&(Lt(F.to(),n)>0||n.xRel<0)?is(e,l,n,f):uc(e,l,n,f)}function is(e,n,u,l){var f=e.display,m=!1,F=xr(e,function(Z){g&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Gs(e)),ce(f.wrapper.ownerDocument,"mouseup",F),ce(f.wrapper.ownerDocument,"mousemove",U),ce(f.scroller,"dragstart",z),ce(f.scroller,"drop",F),m||(it(Z),l.addNew||Ya(e.doc,u,null,null,l.extend),g&&!j||b&&A==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),U=function(Z){m=m||Math.abs(n.clientX-Z.clientX)+Math.abs(n.clientY-Z.clientY)>=10},z=function(){return m=!0};g&&(f.scroller.draggable=!0),e.state.draggingText=F,F.copy=!l.moveOnDrag,D(f.wrapper.ownerDocument,"mouseup",F),D(f.wrapper.ownerDocument,"mousemove",U),D(f.scroller,"dragstart",z),D(f.scroller,"drop",F),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function Du(e,n,u){if(u=="char")return new _t(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new _t(nt(n.line,0),st(e.doc,nt(n.line+1,0)));var l=u(e,n);return new _t(l.from,l.to)}function uc(e,n,u,l){b&&Gs(e);var f=e.display,m=e.doc;it(n);var F,U,z=m.sel,Z=z.ranges;if(l.addNew&&!l.extend?(U=m.sel.contains(u),U>-1?F=Z[U]:F=new _t(u,u)):(F=m.sel.primary(),U=m.sel.primIndex),l.unit=="rectangle")l.addNew||(F=new _t(u,u)),u=_i(e,n,!0,!0),U=-1;else{var xe=Du(e,u,l.unit);l.extend?F=Ka(F,xe.anchor,xe.head,l.extend):F=xe}l.addNew?U==-1?(U=Z.length,rr(m,Fn(e,Z.concat([F]),U),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[U].empty()&&l.unit=="char"&&!l.extend?(rr(m,Fn(e,Z.slice(0,U).concat(Z.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),z=m.sel):tn(m,U,F,vt):(U=0,rr(m,new Ar([F],0),vt),z=m.sel);var Ee=u;function Ne(ct){if(Lt(Ee,ct)!=0)if(Ee=ct,l.unit=="rectangle"){for(var bt=[],Pt=e.options.tabSize,Ot=Xe(Et(m,u.line).text,u.ch,Pt),Ut=Xe(Et(m,ct.line).text,ct.ch,Pt),ar=Math.min(Ot,Ut),Hr=Math.max(Ot,Ut),vr=Math.min(u.line,ct.line),xn=Math.min(e.lastLine(),Math.max(u.line,ct.line));vr<=xn;vr++){var fn=Et(m,vr).text,kr=dt(fn,ar,Pt);ar==Hr?bt.push(new _t(nt(vr,kr),nt(vr,kr))):fn.length>kr&&bt.push(new _t(nt(vr,kr),nt(vr,dt(fn,Hr,Pt))))}bt.length||bt.push(new _t(u,u)),rr(m,Fn(e,z.ranges.slice(0,U).concat(bt),U),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ct)}else{var rn=F,zr=Du(e,ct,l.unit),Nr=rn.anchor,Rr;Lt(zr.anchor,Nr)>0?(Rr=zr.head,Nr=_e(rn.from(),zr.anchor)):(Rr=zr.anchor,Nr=Ce(rn.to(),zr.head));var wr=z.ranges.slice(0);wr[U]=fc(e,new _t(st(m,Nr),Rr)),rr(m,Fn(e,wr,U),vt)}}var Me=f.wrapper.getBoundingClientRect(),Ye=0;function tt(ct){var bt=++Ye,Pt=_i(e,ct,!0,l.unit=="rectangle");if(!!Pt)if(Lt(Pt,Ee)!=0){e.curOp.focus=De(),Ne(Pt);var Ot=Ys(f,m);(Pt.line>=Ot.to||Pt.line<Ot.from)&&setTimeout(xr(e,function(){Ye==bt&&tt(ct)}),150)}else{var Ut=ct.clientY<Me.top?-20:ct.clientY>Me.bottom?20:0;Ut&&setTimeout(xr(e,function(){Ye==bt&&(f.scroller.scrollTop+=Ut,tt(ct))}),50)}}function at(ct){e.state.selectingText=!1,Ye=1/0,ct&&(it(ct),f.input.focus()),ce(f.wrapper.ownerDocument,"mousemove",ft),ce(f.wrapper.ownerDocument,"mouseup",ht),m.history.lastSelOrigin=null}var ft=xr(e,function(ct){ct.buttons===0||!wn(ct)?at(ct):tt(ct)}),ht=xr(e,at);e.state.selectingText=ht,D(f.wrapper.ownerDocument,"mousemove",ft),D(f.wrapper.ownerDocument,"mouseup",ht)}function fc(e,n){var u=n.anchor,l=n.head,f=Et(e.doc,u.line);if(Lt(u,l)==0&&u.sticky==l.sticky)return n;var m=P(f);if(!m)return n;var F=W(m,u.ch,u.sticky),U=m[F];if(U.from!=u.ch&&U.to!=u.ch)return n;var z=F+(U.from==u.ch==(U.level!=1)?0:1);if(z==0||z==m.length)return n;var Z;if(l.line!=u.line)Z=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var xe=W(m,l.ch,l.sticky),Ee=xe-F||(l.ch-u.ch)*(U.level==1?-1:1);xe==z-1||xe==z?Z=Ee<0:Z=Ee>0}var Ne=m[z+(Z?-1:0)],Me=Z==(Ne.level==1),Ye=Me?Ne.from:Ne.to,tt=Me?"after":"before";return u.ch==Ye&&u.sticky==tt?n:new _t(new nt(u.line,Ye,tt),l)}function Nu(e,n,u,l){var f,m;if(n.touches)f=n.touches[0].clientX,m=n.touches[0].clientY;else try{f=n.clientX,m=n.clientY}catch(Ne){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&it(n);var F=e.display,U=F.lineDiv.getBoundingClientRect();if(m>U.bottom||!Ge(e,u))return Ct(n);m-=U.top-F.viewOffset;for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=F.gutters.childNodes[z];if(Z&&Z.getBoundingClientRect().right>=f){var xe=Un(e.doc,m),Ee=e.display.gutterSpecs[z];return Oe(e,u,e,xe,Ee.className,n),Ct(n)}}}function os(e,n){return Nu(e,n,"gutterClick",!0)}function da(e,n){ni(e.display,n)||kd(e,n)||Pe(e,n,"contextmenu")||Y||e.display.input.onContextMenu(n)}function kd(e,n){return Ge(e,"gutterContextMenu")?Nu(e,n,"gutterContextMenu",!1):!1}function Bi(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Jo(e)}var pi={toString:function(){return"CodeMirror.Init"}},Do={},pa={};function Bu(e){var n=e.optionHandlers;function u(l,f,m,F){e.defaults[l]=f,m&&(n[l]=F?function(U,z,Z){Z!=pi&&m(U,z,Z)}:m)}e.defineOption=u,e.Init=pi,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,Wa(l)},!0),u("indentUnit",2,Wa,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){Fi(l),Jo(l),$r(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var m=[],F=l.doc.first;l.doc.iter(function(z){for(var Z=0;;){var xe=z.text.indexOf(f,Z);if(xe==-1)break;Z=xe+f.length,m.push(nt(F,xe))}F++});for(var U=m.length-1;U>=0;U--)Fo(l.doc,f,m[U],nt(m[U].line,m[U].ch+f.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,f,m){l.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),m!=pi&&l.refresh()}),u("specialCharPlaceholder",zo,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,f){return l.getInputField().spellcheck=f},!0),u("autocorrect",!1,function(l,f){return l.getInputField().autocorrect=f},!0),u("autocapitalize",!1,function(l,f){return l.getInputField().autocapitalize=f},!0),u("rtlMoveVisually",!J),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Bi(l),To(l)},!0),u("keyMap","default",function(l,f,m){var F=fa(f),U=m!=pi&&fa(m);U&&U.detach&&U.detach(l,F),F.attach&&F.attach(l,U||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Uu,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=Ba(f,l.options.lineNumbers),To(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?Vs(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return eo(l)},!0),u("scrollbarStyle","native",function(l){Da(l),eo(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,f){l.display.gutterSpecs=Ba(l.options.gutters,f),To(l)},!0),u("firstLineNumber",1,To,!0),u("lineNumberFormatter",function(l){return l},To,!0),u("showCursorWhenSelecting",!1,bo,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(wo(l),l.display.input.blur()),l.display.input.readOnlyChanged(f)}),u("screenReaderLabel",null,function(l,f){f=f===""?null:f,l.display.input.screenReaderLabelChanged(f)}),u("disableInput",!1,function(l,f){f||l.display.input.reset()},!0),u("dragDrop",!0,cc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,bo,!0),u("singleCursorHeightPerLine",!0,bo,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Fi,!0),u("addModeClass",!1,Fi,!0),u("pollInterval",100),u("undoDepth",200,function(l,f){return l.doc.history.undoDepth=f}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,Fi,!0),u("moveInputWithCursor",!0,function(l,f){f||l.display.input.resetPosition()}),u("tabindex",null,function(l,f){return l.display.input.getField().tabIndex=f||""}),u("autofocus",null),u("direction","ltr",function(l,f){return l.doc.setDirection(f)},!0),u("phrases",null)}function cc(e,n,u){var l=u&&u!=pi;if(!n!=!l){var f=e.display.dragFunctions,m=n?D:ce;m(e.display.scroller,"dragstart",f.start),m(e.display.scroller,"dragenter",f.enter),m(e.display.scroller,"dragover",f.over),m(e.display.scroller,"dragleave",f.leave),m(e.display.scroller,"drop",f.drop)}}function Uu(e){e.options.lineWrapping?(Ve(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(te(e.display.wrapper,"CodeMirror-wrap"),ho(e)),_o(e),$r(e),Jo(e),setTimeout(function(){return eo(e)},100)}function cr(e,n){var u=this;if(!(this instanceof cr))return new cr(e,n);this.options=n=n?Qe(n):{},Qe(Do,n,!1);var l=n.value;typeof l=="string"?l=new Vt(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new cr.inputStyles[n.inputStyle](this),m=this.display=new ja(e,l,f,n);m.wrapper.CodeMirror=this,Bi(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Da(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ut,keySeq:null,specialChars:null},n.autofocus&&!M&&m.input.focus(),b&&A<11&&setTimeout(function(){return u.display.input.reset(!0)},20),as(this),ec(),Ti(this),this.curOp.forceUpdate=!0,Ze(this,l),n.autofocus&&!M||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&$s(u)},20):wo(this);for(var F in pa)pa.hasOwnProperty(F)&&pa[F](this,n[F],pi);_s(this),n.finishInit&&n.finishInit(this);for(var U=0;U<vl.length;++U)vl[U](this);Pi(this),g&&n.lineWrapping&&getComputedStyle(m.lineDiv).textRendering=="optimizelegibility"&&(m.lineDiv.style.textRendering="auto")}cr.defaults=Do,cr.optionHandlers=pa;function as(e){var n=e.display;D(n.scroller,"mousedown",xr(e,hl)),b&&A<11?D(n.scroller,"dblclick",xr(e,function(z){if(!Pe(e,z)){var Z=_i(e,z);if(!(!Z||os(e,z)||ni(e.display,z))){it(z);var xe=e.findWordAt(Z);Ya(e.doc,xe.anchor,xe.head)}}})):D(n.scroller,"dblclick",function(z){return Pe(e,z)||it(z)}),D(n.scroller,"contextmenu",function(z){return da(e,z)}),D(n.input.getField(),"contextmenu",function(z){n.scroller.contains(z.target)||da(e,z)});var u,l={end:0};function f(){n.activeTouch&&(u=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function m(z){if(z.touches.length!=1)return!1;var Z=z.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function F(z,Z){if(Z.left==null)return!0;var xe=Z.left-z.left,Ee=Z.top-z.top;return xe*xe+Ee*Ee>20*20}D(n.scroller,"touchstart",function(z){if(!Pe(e,z)&&!m(z)&&!os(e,z)){n.input.ensurePolled(),clearTimeout(u);var Z=+new Date;n.activeTouch={start:Z,moved:!1,prev:Z-l.end<=300?l:null},z.touches.length==1&&(n.activeTouch.left=z.touches[0].pageX,n.activeTouch.top=z.touches[0].pageY)}}),D(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),D(n.scroller,"touchend",function(z){var Z=n.activeTouch;if(Z&&!ni(n,z)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var xe=e.coordsChar(n.activeTouch,"page"),Ee;!Z.prev||F(Z,Z.prev)?Ee=new _t(xe,xe):!Z.prev.prev||F(Z,Z.prev.prev)?Ee=e.findWordAt(xe):Ee=new _t(nt(xe.line,0),st(e.doc,nt(xe.line+1,0))),e.setSelection(Ee.anchor,Ee.head),e.focus(),it(z)}f()}),D(n.scroller,"touchcancel",f),D(n.scroller,"scroll",function(){n.scroller.clientHeight&&(ln(e,n.scroller.scrollTop),Vn(e,n.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),D(n.scroller,"mousewheel",function(z){return el(e,z)}),D(n.scroller,"DOMMouseScroll",function(z){return el(e,z)}),D(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(z){Pe(e,z)||Jt(z)},over:function(z){Pe(e,z)||(Eu(e,z),Jt(z))},start:function(z){return ll(e,z)},drop:xr(e,qf),leave:function(z){Pe(e,z)||io(e)}};var U=n.input.getField();D(U,"keyup",function(z){return oc.call(e,z)}),D(U,"keydown",xr(e,ic)),D(U,"keypress",xr(e,ac)),D(U,"focus",function(z){return $s(e,z)}),D(U,"blur",function(z){return wo(e,z)})}var vl=[];cr.defineInitHook=function(e){return vl.push(e)};function No(e,n,u,l){var f=e.doc,m;u==null&&(u="add"),u=="smart"&&(f.mode.indent?m=_r(e,n).state:u="prev");var F=e.options.tabSize,U=Et(f,n),z=Xe(U.text,null,F);U.stateAfter&&(U.stateAfter=null);var Z=U.text.match(/^\s*/)[0],xe;if(!l&&!/\S/.test(U.text))xe=0,u="not";else if(u=="smart"&&(xe=f.mode.indent(m,U.text.slice(Z.length),U.text),xe==qe||xe>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?xe=Xe(Et(f,n-1).text,null,F):xe=0:u=="add"?xe=z+e.options.indentUnit:u=="subtract"?xe=z-e.options.indentUnit:typeof u=="number"&&(xe=z+u),xe=Math.max(0,xe);var Ee="",Ne=0;if(e.options.indentWithTabs)for(var Me=Math.floor(xe/F);Me;--Me)Ne+=F,Ee+=" ";if(Ne<xe&&(Ee+=It(xe-Ne)),Ee!=Z)return Fo(f,Ee,nt(n,0),nt(n,Z.length),"+input"),U.stateAfter=null,!0;for(var Ye=0;Ye<f.sel.ranges.length;Ye++){var tt=f.sel.ranges[Ye];if(tt.head.line==n&&tt.head.ch<Z.length){var at=nt(n,Z.length);tn(f,Ye,new _t(at,at));break}}}var Rn=null;function ha(e){Rn=e}function gl(e,n,u,l,f){var m=e.doc;e.display.shift=!1,l||(l=m.sel);var F=+new Date-200,U=f=="paste"||e.state.pasteIncoming>F,z=$n(n),Z=null;if(U&&l.ranges.length>1)if(Rn&&Rn.text.join(`
27
+ left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(m),m.scrollIntoView(f),e.display.lineSpace.removeChild(m)}}}function Ed(e,n,u,l){l==null&&(l=0);var f;!e.options.lineWrapping&&n==u&&(u=n.sticky=="before"?nt(n.line,n.ch+1,"before"):n,n=n.ch?nt(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n);for(var m=0;m<5;m++){var F=!1,U=qr(e,n),z=!u||u==n?U:qr(e,u);f={left:Math.min(U.left,z.left),top:Math.min(U.top,z.top)-l,right:Math.max(U.left,z.left),bottom:Math.max(U.bottom,z.bottom)+l};var Z=qi(e,f),xe=e.doc.scrollTop,Ee=e.doc.scrollLeft;if(Z.scrollTop!=null&&(ln(e,Z.scrollTop),Math.abs(e.doc.scrollTop-xe)>1&&(F=!0)),Z.scrollLeft!=null&&(Vn(e,Z.scrollLeft),Math.abs(e.doc.scrollLeft-Ee)>1&&(F=!0)),!F)break}return f}function Cd(e,n){var u=qi(e,n);u.scrollTop!=null&&ln(e,u.scrollTop),u.scrollLeft!=null&&Vn(e,u.scrollLeft)}function qi(e,n){var u=e.display,l=mo(e.display);n.top<0&&(n.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:u.scroller.scrollTop,m=Ra(e),F={};n.bottom-n.top>m&&(n.bottom=n.top+m);var U=e.doc.height+Fs(u),z=n.top<l,Z=n.bottom>U-l;if(n.top<f)F.scrollTop=z?0:n.top;else if(n.bottom>f+m){var xe=Math.min(n.top,(Z?U:n.bottom)-m);xe!=f&&(F.scrollTop=xe)}var Ee=e.options.fixedGutter?0:u.gutters.offsetWidth,Ne=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:u.scroller.scrollLeft-Ee,Me=vn(e)-u.gutters.offsetWidth,Ye=n.right-n.left>Me;return Ye&&(n.right=n.left+Me),n.left<10?F.scrollLeft=0:n.left<Ne?F.scrollLeft=Math.max(0,n.left+Ee-(Ye?0:10)):n.right>Me+Ne-3&&(F.scrollLeft=n.right+(Ye?0:10)-Me),F}function sn(e,n){n!=null&&(qo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function yn(e){qo(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function mn(e,n,u){(n!=null||u!=null)&&qo(e),n!=null&&(e.curOp.scrollLeft=n),u!=null&&(e.curOp.scrollTop=u)}function Hf(e,n){qo(e),e.curOp.scrollToPos=n}function qo(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var u=Xo(e,n.from),l=Xo(e,n.to);ea(e,u,l,n.margin)}}function ea(e,n,u,l){var f=qi(e,{left:Math.min(n.left,u.left),top:Math.min(n.top,u.top)-l,right:Math.max(n.right,u.right),bottom:Math.max(n.bottom,u.bottom)+l});mn(e,f.scrollLeft,f.scrollTop)}function ln(e,n){Math.abs(e.doc.scrollTop-n)<2||(c||Hn(e,{top:n}),tr(e,n,!0),c&&Hn(e),to(e,100))}function tr(e,n,u){n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),!(e.display.scroller.scrollTop==n&&!u)&&(e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n))}function Vn(e,n,u,l){n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((u?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)&&(e.doc.scrollLeft=n,Qs(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n))}function So(e){var n=e.display,u=n.gutters.offsetWidth,l=Math.round(e.doc.height+Fs(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?u:0,docHeight:l,scrollHeight:l+Xn(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:u}}var oi=function(e,n,u){this.cm=u;var l=this.vert=ve("div",[ve("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=ve("div",[ve("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=f.tabIndex=-1,e(l),e(f),D(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),D(f,"scroll",function(){f.clientWidth&&n(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&A<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};oi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,u=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(u){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var f=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=u?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var m=e.viewWidth-e.barLeft-(u?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+m)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:u?l:0,bottom:n?l:0}},oi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},oi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},oi.prototype.zeroWidthHack=function(){var e=C&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ut,this.disableVert=new ut},oi.prototype.enableZeroWidthBar=function(e,n,u){e.style.pointerEvents="auto";function l(){var f=e.getBoundingClientRect(),m=u=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);m!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},oi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ao=function(){};Ao.prototype.update=function(){return{bottom:0,right:0}},Ao.prototype.setScrollLeft=function(){},Ao.prototype.setScrollTop=function(){},Ao.prototype.clear=function(){};function eo(e,n){n||(n=So(e));var u=e.display.barWidth,l=e.display.barHeight;Eo(e,n);for(var f=0;f<4&&u!=e.display.barWidth||l!=e.display.barHeight;f++)u!=e.display.barWidth&&e.options.lineWrapping&&$s(e),Eo(e,So(e)),u=e.display.barWidth,l=e.display.barHeight}function Eo(e,n){var u=e.display,l=u.scrollbars.update(n);u.sizer.style.paddingRight=(u.barWidth=l.right)+"px",u.sizer.style.paddingBottom=(u.barHeight=l.bottom)+"px",u.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(u.scrollbarFiller.style.display="block",u.scrollbarFiller.style.height=l.bottom+"px",u.scrollbarFiller.style.width=l.right+"px"):u.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(u.gutterFiller.style.display="block",u.gutterFiller.style.height=l.bottom+"px",u.gutterFiller.style.width=n.gutterWidth+"px"):u.gutterFiller.style.display=""}var Ys={native:oi,null:Ao};function Da(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ys[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),D(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,u){u=="horizontal"?Vn(e,n):ln(e,n)},e),e.display.scrollbars.addClass&&Ve(e.display.wrapper,e.display.scrollbars.addClass)}var Ht=0;function Ti(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ht,markArrays:null},Tf(e.curOp)}function Pi(e){var n=e.curOp;n&&Ql(n,function(u){for(var l=0;l<u.ops.length;l++)u.ops[l].cm.curOp=null;ai(u)})}function ai(e){for(var n=e.ops,u=0;u<n.length;u++)ta(n[u]);for(var l=0;l<n.length;l++)Wn(n[l]);for(var f=0;f<n.length;f++)Co(n[f]);for(var m=0;m<n.length;m++)en(n[m]);for(var F=0;F<n.length;F++)Ii(n[F])}function ta(e){var n=e.cm,u=n.display;Od(n),e.updateMaxLine&&ho(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<u.viewFrom||e.scrollToPos.to.line>=u.viewTo)||u.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ra(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Wn(e){e.updatedDisplay=e.mustUpdate&&Oo(e.cm,e.update)}function Co(e){var n=e.cm,u=n.display;e.updatedDisplay&&$s(n),e.barMeasure=So(n),u.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=tu(n,u.maxLine,u.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(u.scroller.clientWidth,u.sizer.offsetLeft+e.adjustWidthTo+Xn(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,u.sizer.offsetLeft+e.adjustWidthTo-vn(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=u.input.prepareSelection())}function en(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Vn(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var u=e.focus&&e.focus==De();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,u),(e.updatedDisplay||e.startHeight!=n.doc.height)&&eo(n,e.barMeasure),e.updatedDisplay&&Ir(n,e.barMeasure),e.selectionChanged&&su(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),u&&jf(e.cm)}function Ii(e){var n=e.cm,u=n.display,l=n.doc;if(e.updatedDisplay&&Js(n,e.update),u.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(u.wheelStartX=u.wheelStartY=null),e.scrollTop!=null&&tr(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Vn(n,e.scrollLeft,!0,!0),e.scrollToPos){var f=Ed(n,st(l,e.scrollToPos.from),st(l,e.scrollToPos.to),e.scrollToPos.margin);Wf(n,f)}var m=e.maybeHiddenMarkers,F=e.maybeUnhiddenMarkers;if(m)for(var U=0;U<m.length;++U)m[U].lines.length||Oe(m[U],"hide");if(F)for(var z=0;z<F.length;++z)F[z].lines.length&&Oe(F[z],"unhide");u.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&Oe(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Yr(e,n){if(e.curOp)return n();Ti(e);try{return n()}finally{Pi(e)}}function xr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Ti(e);try{return n.apply(e,arguments)}finally{Pi(e)}}}function Lr(e){return function(){if(this.curOp)return e.apply(this,arguments);Ti(this);try{return e.apply(this,arguments)}finally{Pi(this)}}}function br(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Ti(n);try{return e.apply(this,arguments)}finally{Pi(n)}}}function to(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,rt(Na,e))}function Na(e){var n=e.doc;if(!(n.highlightFrontier>=e.display.viewTo)){var u=+new Date+e.options.workTime,l=_r(e,n.highlightFrontier),f=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(m){if(l.line>=e.display.viewFrom){var F=m.styles,U=m.text.length>e.options.maxHighlightLength?Pn(n.mode,l.state):null,z=er(e,m,l,!0);U&&(l.state=U),m.styles=z.styles;var Z=m.styleClasses,xe=z.classes;xe?m.styleClasses=xe:Z&&(m.styleClasses=null);for(var Ee=!F||F.length!=m.styles.length||Z!=xe&&(!Z||!xe||Z.bgClass!=xe.bgClass||Z.textClass!=xe.textClass),Ne=0;!Ee&&Ne<F.length;++Ne)Ee=F[Ne]!=m.styles[Ne];Ee&&f.push(l.line),m.stateAfter=l.save(),l.nextLine()}else m.text.length<=e.options.maxHighlightLength&&ys(e,m.text,l),m.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>u)return to(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),f.length&&Yr(e,function(){for(var m=0;m<f.length;m++)Ei(e,f[m],"text")})}}var ra=function(e,n,u){var l=e.display;this.viewport=n,this.visible=Ks(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=vn(e),this.force=u,this.dims=Us(e),this.events=[]};ra.prototype.signal=function(e,n){Ge(e,n)&&this.events.push(arguments)},ra.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Oe.apply(null,this.events[e])};function Od(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=Xn(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=Xn(e)+"px",n.scrollbarsClipped=!0)}function lu(e){if(e.hasFocus())return null;var n=De();if(!n||!oe(e.display.lineDiv,n))return null;var u={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&oe(e.display.lineDiv,l.anchorNode)&&(u.anchorNode=l.anchorNode,u.anchorOffset=l.anchorOffset,u.focusNode=l.focusNode,u.focusOffset=l.focusOffset)}return u}function uu(e){if(!(!e||!e.activeElt||e.activeElt==De())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&oe(document.body,e.anchorNode)&&oe(document.body,e.focusNode))){var n=window.getSelection(),u=document.createRange();u.setEnd(e.anchorNode,e.anchorOffset),u.collapse(!1),n.removeAllRanges(),n.addRange(u),n.extend(e.focusNode,e.focusOffset)}}function Oo(e,n){var u=e.display,l=e.doc;if(n.editorIsHidden)return ii(e),!1;if(!n.force&&n.visible.from>=u.viewFrom&&n.visible.to<=u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo)&&u.renderedView==u.view&&Ci(e)==0)return!1;Zs(e)&&(ii(e),n.dims=Us(e));var f=l.first+l.size,m=Math.max(n.visible.from-e.options.viewportMargin,l.first),F=Math.min(f,n.visible.to+e.options.viewportMargin);u.viewFrom<m&&m-u.viewFrom<20&&(m=Math.max(l.first,u.viewFrom)),u.viewTo>F&&u.viewTo-F<20&&(F=Math.min(f,u.viewTo)),wi&&(m=As(e.doc,m),F=$l(e.doc,F));var U=m!=u.viewFrom||F!=u.viewTo||u.lastWrapHeight!=n.wrapperHeight||u.lastWrapWidth!=n.wrapperWidth;Nf(e,m,F),u.viewOffset=ri(Et(e.doc,u.viewFrom)),e.display.mover.style.top=u.viewOffset+"px";var z=Ci(e);if(!U&&z==0&&!n.force&&u.renderedView==u.view&&(u.updateLineNumbers==null||u.updateLineNumbers>=u.viewTo))return!1;var Z=lu(e);return z>4&&(u.lineDiv.style.display="none"),Xs(e,u.updateLineNumbers,n.dims),z>4&&(u.lineDiv.style.display=""),u.renderedView=u.view,uu(Z),ne(u.cursorDiv),ne(u.selectionDiv),u.gutters.style.height=u.sizer.style.minHeight=0,U&&(u.lastWrapHeight=n.wrapperHeight,u.lastWrapWidth=n.wrapperWidth,to(e,400)),u.updateLineNumbers=null,!0}function Js(e,n){for(var u=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==vn(e)){if(u&&u.top!=null&&(u={top:Math.min(e.doc.height+Fs(e.display)-Ra(e),u.top)}),n.visible=Ks(e.display,e.doc,u),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Ks(e.display,e.doc,u));if(!Oo(e,n))break;$s(e);var f=So(e);bo(e),eo(e,f),Ir(e,f),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Hn(e,n){var u=new ra(e,n);if(Oo(e,u)){$s(e),Js(e,u);var l=So(e);bo(e),eo(e,l),Ir(e,l),u.finish()}}function Xs(e,n,u){var l=e.display,f=e.options.lineNumbers,m=l.lineDiv,F=m.firstChild;function U(Ye){var tt=Ye.nextSibling;return g&&C&&e.display.currentWheelTarget==Ye?Ye.style.display="none":Ye.parentNode.removeChild(Ye),tt}for(var z=l.view,Z=l.viewFrom,xe=0;xe<z.length;xe++){var Ee=z[xe];if(!Ee.hidden)if(!Ee.node||Ee.node.parentNode!=m){var Ne=Ad(e,Ee,Z,u);m.insertBefore(Ne,F)}else{for(;F!=Ee.node;)F=U(F);var Me=f&&n!=null&&n<=Z&&Ee.lineNumber;Ee.changes&&(pt(Ee.changes,"gutter")>-1&&(Me=!1),Ts(e,Ee,Z,u)),Me&&(ne(Ee.lineNumber),Ee.lineNumber.appendChild(document.createTextNode(po(e.options,Z)))),F=Ee.node.nextSibling}Z+=Ee.size}for(;F;)F=U(F)}function un(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px",Wr(e,"gutterChanged",e)}function Ir(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+Xn(e)+"px"}function Qs(e){var n=e.display,u=n.view;if(!(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))){for(var l=js(n)-n.scroller.scrollLeft+e.doc.scrollLeft,f=n.gutters.offsetWidth,m=l+"px",F=0;F<u.length;F++)if(!u[F].hidden){e.options.fixedGutter&&(u[F].gutter&&(u[F].gutter.style.left=m),u[F].gutterBackground&&(u[F].gutterBackground.style.left=m));var U=u[F].alignable;if(U)for(var z=0;z<U.length;z++)U[z].style.left=m}e.options.fixedGutter&&(n.gutters.style.left=l+f+"px")}}function Zs(e){if(!e.options.lineNumbers)return!1;var n=e.doc,u=po(e.options,n.first+n.size-1),l=e.display;if(u.length!=l.lineNumChars){var f=l.measure.appendChild(ve("div",[ve("div",u)],"CodeMirror-linenumber CodeMirror-gutter-elt")),m=f.firstChild.offsetWidth,F=f.offsetWidth-m;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(m,l.lineGutter.offsetWidth-F)+1,l.lineNumWidth=l.lineNumInnerWidth+F,l.lineNumChars=l.lineNumInnerWidth?u.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",un(e.display),!0}return!1}function Ba(e,n){for(var u=[],l=!1,f=0;f<e.length;f++){var m=e[f],F=null;if(typeof m!="string"&&(F=m.style,m=m.className),m=="CodeMirror-linenumbers")if(n)l=!0;else continue;u.push({className:m,style:F})}return n&&!l&&u.push({className:"CodeMirror-linenumbers",style:null}),u}function Ua(e){var n=e.gutters,u=e.gutterSpecs;ne(n),e.lineGutter=null;for(var l=0;l<u.length;++l){var f=u[l],m=f.className,F=f.style,U=n.appendChild(ve("div",null,"CodeMirror-gutter "+m));F&&(U.style.cssText=F),m=="CodeMirror-linenumbers"&&(e.lineGutter=U,U.style.width=(e.lineNumWidth||1)+"px")}n.style.display=u.length?"":"none",un(e)}function To(e){Ua(e.display),$r(e),Qs(e)}function ja(e,n,u,l){var f=this;this.input=u,f.scrollbarFiller=ve("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=ve("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=de("div",null,"CodeMirror-code"),f.selectionDiv=ve("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=ve("div",null,"CodeMirror-cursors"),f.measure=ve("div",null,"CodeMirror-measure"),f.lineMeasure=ve("div",null,"CodeMirror-measure"),f.lineSpace=de("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var m=de("div",[f.lineSpace],"CodeMirror-lines");f.mover=ve("div",[m],null,"position: relative"),f.sizer=ve("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=ve("div",null,null,"position: absolute; height: "+yt+"px; width: 1px;"),f.gutters=ve("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=ve("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=ve("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),f.wrapper.setAttribute("translate","no"),b&&A<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!g&&!(c&&M)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=n.first,f.reportedViewFrom=f.reportedViewTo=n.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=Ba(l.gutters,l.lineNumbers),Ua(f),u.init(f)}var na=0,Qn=null;b?Qn=-.53:c?Qn=15:N?Qn=-.7:j&&(Qn=-1/3);function _s(e){var n=e.wheelDeltaX,u=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),u==null&&e.detail&&e.axis==e.VERTICAL_AXIS?u=e.detail:u==null&&(u=e.wheelDelta),{x:n,y:u}}function fu(e){var n=_s(e);return n.x*=Qn,n.y*=Qn,n}function qs(e,n){var u=_s(n),l=u.x,f=u.y,m=Qn;n.deltaMode===0&&(l=n.deltaX,f=n.deltaY,m=1);var F=e.display,U=F.scroller,z=U.scrollWidth>U.clientWidth,Z=U.scrollHeight>U.clientHeight;if(!!(l&&z||f&&Z)){if(f&&C&&g){e:for(var xe=n.target,Ee=F.view;xe!=U;xe=xe.parentNode)for(var Ne=0;Ne<Ee.length;Ne++)if(Ee[Ne].node==xe){e.display.currentWheelTarget=xe;break e}}if(l&&!c&&!B&&m!=null){f&&Z&&ln(e,Math.max(0,U.scrollTop+f*m)),Vn(e,Math.max(0,U.scrollLeft+l*m)),(!f||f&&Z)&&it(n),F.wheelStartX=null;return}if(f&&m!=null){var Me=f*m,Ye=e.doc.scrollTop,tt=Ye+F.wrapper.clientHeight;Me<0?Ye=Math.max(0,Ye+Me-50):tt=Math.min(e.doc.height,tt+Me+50),Hn(e,{top:Ye,bottom:tt})}na<20&&n.deltaMode!==0&&(F.wheelStartX==null?(F.wheelStartX=U.scrollLeft,F.wheelStartY=U.scrollTop,F.wheelDX=l,F.wheelDY=f,setTimeout(function(){if(F.wheelStartX!=null){var at=U.scrollLeft-F.wheelStartX,ft=U.scrollTop-F.wheelStartY,ht=ft&&F.wheelDY&&ft/F.wheelDY||at&&F.wheelDX&&at/F.wheelDX;F.wheelStartX=F.wheelStartY=null,!!ht&&(Qn=(Qn*na+ht)/(na+1),++na)}},200)):(F.wheelDX+=l,F.wheelDY+=f))}}var Ar=function(e,n){this.ranges=e,this.primIndex=n};Ar.prototype.primary=function(){return this.ranges[this.primIndex]},Ar.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var u=this.ranges[n],l=e.ranges[n];if(!ei(u.anchor,l.anchor)||!ei(u.head,l.head))return!1}return!0},Ar.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new _t(se(this.ranges[n].anchor),se(this.ranges[n].head));return new Ar(e,this.primIndex)},Ar.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ar.prototype.contains=function(e,n){n||(n=e);for(var u=0;u<this.ranges.length;u++){var l=this.ranges[u];if(Lt(n,l.from())>=0&&Lt(e,l.to())<=0)return u}return-1};var _t=function(e,n){this.anchor=e,this.head=n};_t.prototype.from=function(){return _e(this.anchor,this.head)},_t.prototype.to=function(){return Ce(this.anchor,this.head)},_t.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Fn(e,n,u){var l=e&&e.options.selectionsMayTouch,f=n[u];n.sort(function(Ne,Me){return Lt(Ne.from(),Me.from())}),u=pt(n,f);for(var m=1;m<n.length;m++){var F=n[m],U=n[m-1],z=Lt(U.to(),F.from());if(l&&!F.empty()?z>0:z>=0){var Z=_e(U.from(),F.from()),xe=Ce(U.to(),F.to()),Ee=U.empty()?F.from()==F.head:U.from()==U.head;m<=u&&--u,n.splice(--m,2,new _t(Ee?xe:Z,Ee?Z:xe))}}return new Ar(n,u)}function si(e,n){return new Ar([new _t(e,n||e)],0)}function li(e){return e.text?nt(e.from.line+e.text.length-1,At(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function el(e,n){if(Lt(e,n.from)<0)return e;if(Lt(e,n.to)<=0)return li(n);var u=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=li(n).ch-n.to.ch),nt(u,l)}function Va(e,n){for(var u=[],l=0;l<e.sel.ranges.length;l++){var f=e.sel.ranges[l];u.push(new _t(el(f.anchor,n),el(f.head,n)))}return Fn(e.cm,u,e.sel.primIndex)}function tl(e,n,u){return e.line==n.line?nt(u.line,e.ch-n.ch+u.ch):nt(u.line+(e.line-n.line),e.ch)}function cu(e,n,u){for(var l=[],f=nt(e.first,0),m=f,F=0;F<n.length;F++){var U=n[F],z=tl(U.from,f,m),Z=tl(li(U),f,m);if(f=U.to,m=Z,u=="around"){var xe=e.sel.ranges[F],Ee=Lt(xe.head,xe.anchor)<0;l[F]=new _t(Ee?Z:z,Ee?z:Z)}else l[F]=new _t(z,z)}return new Ar(l,e.sel.primIndex)}function Wa(e){e.doc.mode=Bn(e.options,e.doc.modeOption),Fi(e)}function Fi(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,to(e,100),e.state.modeGen++,e.curOp&&$r(e)}function zf(e,n){return n.from.ch==0&&n.to.ch==0&&At(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ha(e,n,u,l){function f(ht){return u?u[ht]:null}function m(ht,ct,bt){Kl(ht,ct,bt,l),Wr(ht,"change",ht,n)}function F(ht,ct){for(var bt=[],Pt=ht;Pt<ct;++Pt)bt.push(new Ji(Z[Pt],f(Pt),l));return bt}var U=n.from,z=n.to,Z=n.text,xe=Et(e,U.line),Ee=Et(e,z.line),Ne=At(Z),Me=f(Z.length-1),Ye=z.line-U.line;if(n.full)e.insert(0,F(0,Z.length)),e.remove(Z.length,e.size-Z.length);else if(zf(e,n)){var tt=F(0,Z.length-1);m(Ee,Ee.text,Me),Ye&&e.remove(U.line,Ye),tt.length&&e.insert(U.line,tt)}else if(xe==Ee)if(Z.length==1)m(xe,xe.text.slice(0,U.ch)+Ne+xe.text.slice(z.ch),Me);else{var at=F(1,Z.length-1);at.push(new Ji(Ne+xe.text.slice(z.ch),Me,l)),m(xe,xe.text.slice(0,U.ch)+Z[0],f(0)),e.insert(U.line+1,at)}else if(Z.length==1)m(xe,xe.text.slice(0,U.ch)+Z[0]+Ee.text.slice(z.ch),f(0)),e.remove(U.line+1,Ye);else{m(xe,xe.text.slice(0,U.ch)+Z[0],f(0)),m(Ee,Ne+Ee.text.slice(z.ch),Me);var ft=F(1,Z.length-1);Ye>1&&e.remove(U.line+1,Ye-1),e.insert(U.line+1,ft)}Wr(e,"change",e,n)}function ki(e,n,u){function l(f,m,F){if(f.linked)for(var U=0;U<f.linked.length;++U){var z=f.linked[U];if(z.doc!=m){var Z=F&&z.sharedHist;u&&!Z||(n(z.doc,Z),l(z.doc,f,Z))}}}l(e,null,!0)}function Ze(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,_o(e),Wa(e),rl(e),e.options.direction=n.direction,e.options.lineWrapping||ho(e),e.options.mode=n.modeOption,$r(e)}function rl(e){(e.doc.direction=="rtl"?Ve:te)(e.display.lineDiv,"CodeMirror-rtl")}function za(e){Yr(e,function(){rl(e),$r(e)})}function Po(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ga(e,n){var u={from:se(n.from),to:li(n),text:qn(e,n.from,n.to)};return Ri(e,u,n.from.line,n.to.line+1),ki(e,function(l){return Ri(l,u,n.from.line,n.to.line+1)},!0),u}function nl(e){for(;e.length;){var n=At(e);if(n.ranges)e.pop();else break}}function Gf(e,n){if(n)return nl(e.done),At(e.done);if(e.done.length&&!At(e.done).ranges)return At(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),At(e.done)}function Yt(e,n,u,l){var f=e.history;f.undone.length=0;var m=+new Date,F,U;if((f.lastOp==l||f.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&f.lastModTime>m-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(F=Gf(f,f.lastOp==l)))U=At(F.changes),Lt(n.from,n.to)==0&&Lt(n.from,U.to)==0?U.to=li(n):F.changes.push(Ga(e,n));else{var z=At(f.done);for((!z||!z.ranges)&&$a(e.sel,f.done),F={changes:[Ga(e,n)],generation:f.generation},f.done.push(F);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(u),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=m,f.lastOp=f.lastSelOp=l,f.lastOrigin=f.lastSelOrigin=n.origin,U||Oe(e,"historyAdded")}function du(e,n,u,l){var f=n.charAt(0);return f=="*"||f=="+"&&u.ranges.length==l.ranges.length&&u.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ro(e,n,u,l){var f=e.history,m=l&&l.origin;u==f.lastSelOp||m&&f.lastSelOrigin==m&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==m||du(e,m,At(f.done),n))?f.done[f.done.length-1]=n:$a(n,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=m,f.lastSelOp=u,l&&l.clearRedo!==!1&&nl(f.undone)}function $a(e,n){var u=At(n);u&&u.ranges&&u.equals(e)||n.push(e)}function Ri(e,n,u,l){var f=n["spans_"+e.id],m=0;e.iter(Math.max(e.first,u),Math.min(e.first+e.size,l),function(F){F.markedSpans&&((f||(f=n["spans_"+e.id]={}))[m]=F.markedSpans),++m})}function $f(e){if(!e)return null;for(var n,u=0;u<e.length;++u)e[u].marker.explicitlyCleared?n||(n=e.slice(0,u)):n&&n.push(e[u]);return n?n.length?n:null:e}function pu(e,n){var u=n["spans_"+e.id];if(!u)return null;for(var l=[],f=0;f<n.text.length;++f)l.push($f(u[f]));return l}function hu(e,n){var u=pu(e,n),l=Vl(e,n);if(!u)return l;if(!l)return u;for(var f=0;f<u.length;++f){var m=u[f],F=l[f];if(m&&F){e:for(var U=0;U<F.length;++U){for(var z=F[U],Z=0;Z<m.length;++Z)if(m[Z].marker==z.marker)continue e;m.push(z)}}else F&&(u[f]=F)}return u}function Io(e,n,u){for(var l=[],f=0;f<e.length;++f){var m=e[f];if(m.ranges){l.push(u?Ar.prototype.deepCopy.call(m):m);continue}var F=m.changes,U=[];l.push({changes:U});for(var z=0;z<F.length;++z){var Z=F[z],xe=void 0;if(U.push({from:Z.from,to:Z.to,text:Z.text}),n)for(var Ee in Z)(xe=Ee.match(/^spans_(\d+)$/))&&pt(n,Number(xe[1]))>-1&&(At(U)[Ee]=Z[Ee],delete Z[Ee])}}return l}function Ka(e,n,u,l){if(l){var f=e.anchor;if(u){var m=Lt(n,f)<0;m!=Lt(u,f)<0?(f=n,n=u):m!=Lt(n,u)<0&&(n=u)}return new _t(f,n)}else return new _t(u||n,n)}function Ya(e,n,u,l,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),rr(e,new Ar([Ka(e.sel.primary(),n,u,f)],0),l)}function vu(e,n,u){for(var l=[],f=e.cm&&(e.cm.display.shift||e.extend),m=0;m<e.sel.ranges.length;m++)l[m]=Ka(e.sel.ranges[m],n[m],null,f);var F=Fn(e.cm,l,e.sel.primIndex);rr(e,F,u)}function tn(e,n,u,l){var f=e.sel.ranges.slice(0);f[n]=u,rr(e,Fn(e.cm,f,e.sel.primIndex),l)}function il(e,n,u,l){rr(e,si(n,u),l)}function Kf(e,n,u){var l={ranges:n.ranges,update:function(f){this.ranges=[];for(var m=0;m<f.length;m++)this.ranges[m]=new _t(st(e,f[m].anchor),st(e,f[m].head))},origin:u&&u.origin};return Oe(e,"beforeSelectionChange",e,l),e.cm&&Oe(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?Fn(e.cm,l.ranges,l.ranges.length-1):n}function Ja(e,n,u){var l=e.history.done,f=At(l);f&&f.ranges?(l[l.length-1]=n,Xa(e,n,u)):rr(e,n,u)}function rr(e,n,u){Xa(e,n,u),ro(e,e.sel,e.cm?e.cm.curOp.id:NaN,u)}function Xa(e,n,u){(Ge(e,"beforeSelectionChange")||e.cm&&Ge(e.cm,"beforeSelectionChange"))&&(n=Kf(e,n,u));var l=u&&u.bias||(Lt(n.primary().head,e.sel.primary().head)<0?-1:1);ui(e,ol(e,n,l,!0)),!(u&&u.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&yn(e.cm)}function ui(e,n){n.equals(e.sel)||(e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Te(e.cm)),Wr(e,"cursorActivity",e))}function Qa(e){ui(e,ol(e,e.sel,null,!1))}function ol(e,n,u,l){for(var f,m=0;m<n.ranges.length;m++){var F=n.ranges[m],U=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[m],z=Dr(e,F.anchor,U&&U.anchor,u,l),Z=Dr(e,F.head,U&&U.head,u,l);(f||z!=F.anchor||Z!=F.head)&&(f||(f=n.ranges.slice(0,m)),f[m]=new _t(z,Z))}return f?Fn(e.cm,f,n.primIndex):n}function no(e,n,u,l,f){var m=Et(e,n.line);if(m.markedSpans)for(var F=0;F<m.markedSpans.length;++F){var U=m.markedSpans[F],z=U.marker,Z="selectLeft"in z?!z.selectLeft:z.inclusiveLeft,xe="selectRight"in z?!z.selectRight:z.inclusiveRight;if((U.from==null||(Z?U.from<=n.ch:U.from<n.ch))&&(U.to==null||(xe?U.to>=n.ch:U.to>n.ch))){if(f&&(Oe(z,"beforeCursorEnter"),z.explicitlyCleared))if(m.markedSpans){--F;continue}else break;if(!z.atomic)continue;if(u){var Ee=z.find(l<0?1:-1),Ne=void 0;if((l<0?xe:Z)&&(Ee=gu(e,Ee,-l,Ee&&Ee.line==n.line?m:null)),Ee&&Ee.line==n.line&&(Ne=Lt(Ee,u))&&(l<0?Ne<0:Ne>0))return no(e,Ee,n,l,f)}var Me=z.find(l<0?-1:1);return(l<0?Z:xe)&&(Me=gu(e,Me,l,Me.line==n.line?m:null)),Me?no(e,Me,n,l,f):null}}return n}function Dr(e,n,u,l,f){var m=l||1,F=no(e,n,u,m,f)||!f&&no(e,n,u,m,!0)||no(e,n,u,-m,f)||!f&&no(e,n,u,-m,!0);return F||(e.cantEdit=!0,nt(e.first,0))}function gu(e,n,u,l){return u<0&&n.ch==0?n.line>e.first?st(e,nt(n.line-1)):null:u>0&&n.ch==(l||Et(e,n.line)).text.length?n.line<e.first+e.size-1?nt(n.line+1,0):null:new nt(n.line,n.ch+u)}function Za(e){e.setSelection(nt(e.firstLine(),0),nt(e.lastLine()),lt)}function yu(e,n,u){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return u&&(l.update=function(f,m,F,U){f&&(l.from=st(e,f)),m&&(l.to=st(e,m)),F&&(l.text=F),U!==void 0&&(l.origin=U)}),Oe(e,"beforeChange",e,l),e.cm&&Oe(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function Mi(e,n,u){if(e.cm){if(!e.cm.curOp)return xr(e.cm,Mi)(e,n,u);if(e.cm.state.suppressEdits)return}if(!((Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"))&&(n=yu(e,n,!0),!n))){var l=mf&&!u&&Hl(e,n.from,n.to);if(l)for(var f=l.length-1;f>=0;--f)mu(e,{from:l[f].from,to:l[f].to,text:f?[""]:n.text,origin:n.origin});else mu(e,n)}}function mu(e,n){if(!(n.text.length==1&&n.text[0]==""&&Lt(n.from,n.to)==0)){var u=Va(e,n);Yt(e,n,u,e.cm?e.cm.curOp.id:NaN),ia(e,n,u,Vl(e,n));var l=[];ki(e,function(f,m){!m&&pt(l,f.history)==-1&&(wu(f.history,n),l.push(f.history)),ia(f,n,null,Vl(f,n))})}}function al(e,n,u){var l=e.cm&&e.cm.state.suppressEdits;if(!(l&&!u)){for(var f=e.history,m,F=e.sel,U=n=="undo"?f.done:f.undone,z=n=="undo"?f.undone:f.done,Z=0;Z<U.length&&(m=U[Z],!(u?m.ranges&&!m.equals(e.sel):!m.ranges));Z++);if(Z!=U.length){for(f.lastOrigin=f.lastSelOrigin=null;;)if(m=U.pop(),m.ranges){if($a(m,z),u&&!m.equals(e.sel)){rr(e,m,{clearRedo:!1});return}F=m}else if(l){U.push(m);return}else break;var xe=[];$a(F,z),z.push({changes:xe,generation:f.generation}),f.generation=m.generation||++f.maxGeneration;for(var Ee=Ge(e,"beforeChange")||e.cm&&Ge(e.cm,"beforeChange"),Ne=function(tt){var at=m.changes[tt];if(at.origin=n,Ee&&!yu(e,at,!1))return U.length=0,{};xe.push(Ga(e,at));var ft=tt?Va(e,at):At(U);ia(e,at,ft,hu(e,at)),!tt&&e.cm&&e.cm.scrollIntoView({from:at.from,to:li(at)});var ht=[];ki(e,function(ct,bt){!bt&&pt(ht,ct.history)==-1&&(wu(ct.history,at),ht.push(ct.history)),ia(ct,at,null,hu(ct,at))})},Me=m.changes.length-1;Me>=0;--Me){var Ye=Ne(Me);if(Ye)return Ye.v}}}}function xu(e,n){if(n!=0&&(e.first+=n,e.sel=new Ar(jt(e.sel.ranges,function(f){return new _t(nt(f.anchor.line+n,f.anchor.ch),nt(f.head.line+n,f.head.ch))}),e.sel.primIndex),e.cm)){$r(e.cm,e.first,e.first-n,n);for(var u=e.cm.display,l=u.viewFrom;l<u.viewTo;l++)Ei(e.cm,l,"gutter")}}function ia(e,n,u,l){if(e.cm&&!e.cm.curOp)return xr(e.cm,ia)(e,n,u,l);if(n.to.line<e.first){xu(e,n.text.length-1-(n.to.line-n.from.line));return}if(!(n.from.line>e.lastLine())){if(n.from.line<e.first){var f=n.text.length-1-(e.first-n.from.line);xu(e,f),n={from:nt(e.first,0),to:nt(n.to.line+f,n.to.ch),text:[At(n.text)],origin:n.origin}}var m=e.lastLine();n.to.line>m&&(n={from:n.from,to:nt(m,Et(e,m).text.length),text:[n.text[0]],origin:n.origin}),n.removed=qn(e,n.from,n.to),u||(u=Va(e,n)),e.cm?Yf(e.cm,n,l):Ha(e,n,l),Xa(e,u,lt),e.cantEdit&&Dr(e,nt(e.firstLine(),0))&&(e.cantEdit=!1)}}function Yf(e,n,u){var l=e.doc,f=e.display,m=n.from,F=n.to,U=!1,z=m.line;e.options.lineWrapping||(z=qt(xt(Et(l,m.line))),l.iter(z,F.line+1,function(Me){if(Me==f.maxLine)return U=!0,!0})),l.sel.contains(n.from,n.to)>-1&&Te(e),Ha(l,n,u,Vs(e)),e.options.lineWrapping||(l.iter(z,m.line+n.text.length,function(Me){var Ye=Ho(Me);Ye>f.maxLineLength&&(f.maxLine=Me,f.maxLineLength=Ye,f.maxLineChanged=!0,U=!1)}),U&&(e.curOp.updateMaxLine=!0)),yf(l,m.line),to(e,400);var Z=n.text.length-(F.line-m.line)-1;n.full?$r(e):m.line==F.line&&n.text.length==1&&!zf(e.doc,n)?Ei(e,m.line,"text"):$r(e,m.line,F.line+1,Z);var xe=Ge(e,"changes"),Ee=Ge(e,"change");if(Ee||xe){var Ne={from:m,to:F,text:n.text,removed:n.removed,origin:n.origin};Ee&&Wr(e,"change",e,Ne),xe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ne)}e.display.selForContextMenu=null}function Fo(e,n,u,l,f){var m;l||(l=u),Lt(l,u)<0&&(m=[l,u],u=m[0],l=m[1]),typeof n=="string"&&(n=e.splitLines(n)),Mi(e,{from:u,to:l,text:n,origin:f})}function _a(e,n,u,l){u<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function bu(e,n,u,l){for(var f=0;f<e.length;++f){var m=e[f],F=!0;if(m.ranges){m.copied||(m=e[f]=m.deepCopy(),m.copied=!0);for(var U=0;U<m.ranges.length;U++)_a(m.ranges[U].anchor,n,u,l),_a(m.ranges[U].head,n,u,l);continue}for(var z=0;z<m.changes.length;++z){var Z=m.changes[z];if(u<Z.from.line)Z.from=nt(Z.from.line+l,Z.from.ch),Z.to=nt(Z.to.line+l,Z.to.ch);else if(n<=Z.to.line){F=!1;break}}F||(e.splice(0,f+1),f=0)}}function wu(e,n){var u=n.from.line,l=n.to.line,f=n.text.length-(l-u)-1;bu(e.done,u,l,f),bu(e.undone,u,l,f)}function dr(e,n,u,l){var f=n,m=n;return typeof n=="number"?m=Et(e,ot(e,n)):f=qt(n),f==null?null:(l(m,f)&&e.cm&&Ei(e.cm,f,u),m)}function fi(e){this.lines=e,this.parent=null;for(var n=0,u=0;u<e.length;++u)e[u].parent=this,n+=e[u].height;this.height=n}fi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var u=e,l=e+n;u<l;++u){var f=this.lines[u];this.height-=f.height,Yl(f),Wr(f,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,u){this.height+=u,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,u){for(var l=e+n;e<l;++e)if(u(this.lines[e]))return!0}};function oa(e){this.children=e;for(var n=0,u=0,l=0;l<e.length;++l){var f=e[l];n+=f.chunkSize(),u+=f.height,f.parent=this}this.size=n,this.height=u,this.parent=null}oa.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var u=0;u<this.children.length;++u){var l=this.children[u],f=l.chunkSize();if(e<f){var m=Math.min(n,f-e),F=l.height;if(l.removeInner(e,m),this.height-=F-l.height,f==m&&(this.children.splice(u--,1),l.parent=null),(n-=m)==0)break;e=0}else e-=f}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof fi))){var U=[];this.collapse(U),this.children=[new fi(U)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,u){this.size+=n.length,this.height+=u;for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<=m){if(f.insertInner(e,n,u),f.lines&&f.lines.length>50){for(var F=f.lines.length%25+25,U=F;U<f.lines.length;){var z=new fi(f.lines.slice(U,U+=25));f.height-=z.height,this.children.splice(++l,0,z),z.parent=this}f.lines=f.lines.slice(0,F),this.maybeSpill()}break}e-=m}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var n=e.children.splice(e.children.length-5,5),u=new oa(n);if(e.parent){e.size-=u.size,e.height-=u.height;var f=pt(e.parent.children,e);e.parent.children.splice(f+1,0,u)}else{var l=new oa(e.children);l.parent=e,e.children=[l,u],e=l}u.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,n,u){for(var l=0;l<this.children.length;++l){var f=this.children[l],m=f.chunkSize();if(e<m){var F=Math.min(n,m-e);if(f.iterN(e,F,u))return!0;if((n-=F)==0)break;e=0}else e-=m}}};var qa=function(e,n,u){if(u)for(var l in u)u.hasOwnProperty(l)&&(this[l]=u[l]);this.doc=e,this.node=n};qa.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,u=this.line,l=qt(u);if(!(l==null||!n)){for(var f=0;f<n.length;++f)n[f]==this&&n.splice(f--,1);n.length||(u.widgets=null);var m=Yo(this);En(u,Math.max(0,u.height-m)),e&&(Yr(e,function(){Jf(e,u,-m),Ei(e,l,"widget")}),Wr(e,"lineWidgetCleared",e,this,l))}},qa.prototype.changed=function(){var e=this,n=this.height,u=this.doc.cm,l=this.line;this.height=null;var f=Yo(this)-n;!f||(ti(this.doc,l)||En(l,l.height+f),u&&Yr(u,function(){u.curOp.forceUpdate=!0,Jf(u,l,f),Wr(u,"lineWidgetChanged",u,e,qt(l))}))},He(qa);function Jf(e,n,u){ri(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&sn(e,u)}function Td(e,n,u,l){var f=new qa(e,u,l),m=e.cm;return m&&f.noHScroll&&(m.display.alignWidgets=!0),dr(e,n,"widget",function(F){var U=F.widgets||(F.widgets=[]);if(f.insertAt==null?U.push(f):U.splice(Math.min(U.length,Math.max(0,f.insertAt)),0,f),f.line=F,m&&!ti(e,F)){var z=ri(F)<e.scrollTop;En(F,F.height+Yo(f)),z&&sn(m,f.height),m.curOp.forceUpdate=!0}return!0}),m&&Wr(m,"lineWidgetAdded",m,f,typeof n=="number"?n:qt(n)),f}var Su=0,Li=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Su};Li.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,n=e&&!e.curOp;if(n&&Ti(e),Ge(this,"clear")){var u=this.find();u&&Wr(this,"clear",u.from,u.to)}for(var l=null,f=null,m=0;m<this.lines.length;++m){var F=this.lines[m],U=Vo(F.markedSpans,this);e&&!this.collapsed?Ei(e,qt(F),"text"):e&&(U.to!=null&&(f=qt(F)),U.from!=null&&(l=qt(F))),F.markedSpans=wf(F.markedSpans,U),U.from==null&&this.collapsed&&!ti(this.doc,F)&&e&&En(F,mo(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var z=0;z<this.lines.length;++z){var Z=xt(this.lines[z]),xe=Ho(Z);xe>e.display.maxLineLength&&(e.display.maxLine=Z,e.display.maxLineLength=xe,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&$r(e,l,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Qa(e.doc)),e&&Wr(e,"markerCleared",e,this,l,f),n&&Pi(e),this.parent&&this.parent.clear()}},Li.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var u,l,f=0;f<this.lines.length;++f){var m=this.lines[f],F=Vo(m.markedSpans,this);if(F.from!=null&&(u=nt(n?m:qt(m),F.from),e==-1))return u;if(F.to!=null&&(l=nt(n?m:qt(m),F.to),e==1))return l}return u&&{from:u,to:l}},Li.prototype.changed=function(){var e=this,n=this.find(-1,!0),u=this,l=this.doc.cm;!n||!l||Yr(l,function(){var f=n.line,m=qt(n.line),F=ks(l,m);if(F&&(iu(F),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!ti(u.doc,f)&&u.height!=null){var U=u.height;u.height=null;var z=Yo(u)-U;z&&En(f,f.height+z)}Wr(l,"markerChanged",l,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||pt(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(pt(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},He(Li);function aa(e,n,u,l,f){if(l&&l.shared)return Xf(e,n,u,l,f);if(e.cm&&!e.cm.curOp)return xr(e.cm,aa)(e,n,u,l,f);var m=new Li(e,f),F=Lt(n,u);if(l&&Qe(l,m,!1),F>0||F==0&&m.clearWhenEmpty!==!1)return m;if(m.replacedWith&&(m.collapsed=!0,m.widgetNode=de("span",[m.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||m.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(m.widgetNode.insertLeft=!0)),m.collapsed){if(Yi(e,n.line,n,u,m)||n.line!=u.line&&Yi(e,u.line,n,u,m))throw new Error("Inserting collapsed marker partially overlapping an existing one");bf()}m.addToHistory&&Yt(e,{from:n,to:u,origin:"markText"},e.sel,NaN);var U=n.line,z=e.cm,Z;if(e.iter(U,u.line+1,function(Ee){z&&m.collapsed&&!z.options.lineWrapping&&xt(Ee)==z.display.maxLine&&(Z=!0),m.collapsed&&U!=n.line&&En(Ee,0),md(Ee,new Ia(m,U==n.line?n.ch:null,U==u.line?u.ch:null),e.cm&&e.cm.curOp),++U}),m.collapsed&&e.iter(n.line,u.line+1,function(Ee){ti(e,Ee)&&En(Ee,0)}),m.clearOnEnter&&D(m,"beforeCursorEnter",function(){return m.clear()}),m.readOnly&&(xf(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),m.collapsed&&(m.id=++Su,m.atomic=!0),z){if(Z&&(z.curOp.updateMaxLine=!0),m.collapsed)$r(z,n.line,u.line+1);else if(m.className||m.startStyle||m.endStyle||m.css||m.attributes||m.title)for(var xe=n.line;xe<=u.line;xe++)Ei(z,xe,"text");m.atomic&&Qa(z.doc),Wr(z,"markerAdded",z,m)}return m}var sa=function(e,n){this.markers=e,this.primary=n;for(var u=0;u<e.length;++u)e[u].parent=this};sa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wr(this,"clear")}},sa.prototype.find=function(e,n){return this.primary.find(e,n)},He(sa);function Xf(e,n,u,l,f){l=Qe(l),l.shared=!1;var m=[aa(e,n,u,l,f)],F=m[0],U=l.widgetNode;return ki(e,function(z){U&&(l.widgetNode=U.cloneNode(!0)),m.push(aa(z,st(z,n),st(z,u),l,f));for(var Z=0;Z<z.linked.length;++Z)if(z.linked[Z].isParent)return;F=At(m)}),new sa(m,F)}function Au(e){return e.findMarks(nt(e.first,0),e.clipPos(nt(e.lastLine())),function(n){return n.parent})}function Qf(e,n){for(var u=0;u<n.length;u++){var l=n[u],f=l.find(),m=e.clipPos(f.from),F=e.clipPos(f.to);if(Lt(m,F)){var U=aa(e,m,F,l.primary,l.primary.type);l.markers.push(U),U.parent=l}}}function Zf(e){for(var n=function(l){var f=e[l],m=[f.primary.doc];ki(f.primary.doc,function(z){return m.push(z)});for(var F=0;F<f.markers.length;F++){var U=f.markers[F];pt(m,U.doc)==-1&&(U.parent=null,f.markers.splice(F--,1))}},u=0;u<e.length;u++)n(u)}var _f=0,Vt=function(e,n,u,l,f){if(!(this instanceof Vt))return new Vt(e,n,u,l,f);u==null&&(u=0),oa.call(this,[new fi([new Ji("",null)])]),this.first=u,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=u;var m=nt(u,0);this.sel=si(m),this.history=new Po(null),this.id=++_f,this.modeOption=n,this.lineSep=l,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ha(this,{from:m,to:m,text:e}),rr(this,si(m),lt)};Vt.prototype=St(oa.prototype,{constructor:Vt,iter:function(e,n,u){u?this.iterN(e-this.first,n-e,u):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var u=0,l=0;l<n.length;++l)u+=n[l].height;this.insertInner(e-this.first,n,u)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=bi(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:br(function(e){var n=nt(this.first,0),u=this.first+this.size-1;Mi(this,{from:n,to:nt(u,Et(this,u).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&mn(this.cm,0,0),rr(this,si(n),lt)}),replaceRange:function(e,n,u,l){n=st(this,n),u=u?st(this,u):n,Fo(this,e,n,u,l)},getRange:function(e,n,u){var l=qn(this,st(this,e),st(this,n));return u===!1?l:u===""?l.join(""):l.join(u||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Jn(this,e))return Et(this,e)},getLineNumber:function(e){return qt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Et(this,e)),xt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var n=this.sel.primary(),u;return e==null||e=="head"?u=n.head:e=="anchor"?u=n.anchor:e=="end"||e=="to"||e===!1?u=n.to():u=n.from(),u},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:br(function(e,n,u){il(this,st(this,typeof e=="number"?nt(e,n||0):e),null,u)}),setSelection:br(function(e,n,u){il(this,st(this,e),st(this,n||e),u)}),extendSelection:br(function(e,n,u){Ya(this,st(this,e),n&&st(this,n),u)}),extendSelections:br(function(e,n){vu(this,Zt(this,e),n)}),extendSelectionsBy:br(function(e,n){var u=jt(this.sel.ranges,e);vu(this,Zt(this,u),n)}),setSelections:br(function(e,n,u){if(!!e.length){for(var l=[],f=0;f<e.length;f++)l[f]=new _t(st(this,e[f].anchor),st(this,e[f].head||e[f].anchor));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),rr(this,Fn(this.cm,l,n),u)}}),addSelection:br(function(e,n,u){var l=this.sel.ranges.slice(0);l.push(new _t(st(this,e),st(this,n||e))),rr(this,Fn(this.cm,l,l.length-1),u)}),getSelection:function(e){for(var n=this.sel.ranges,u,l=0;l<n.length;l++){var f=qn(this,n[l].from(),n[l].to());u=u?u.concat(f):f}return e===!1?u:u.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],u=this.sel.ranges,l=0;l<u.length;l++){var f=qn(this,u[l].from(),u[l].to());e!==!1&&(f=f.join(e||this.lineSeparator())),n[l]=f}return n},replaceSelection:function(e,n,u){for(var l=[],f=0;f<this.sel.ranges.length;f++)l[f]=e;this.replaceSelections(l,n,u||"+input")},replaceSelections:br(function(e,n,u){for(var l=[],f=this.sel,m=0;m<f.ranges.length;m++){var F=f.ranges[m];l[m]={from:F.from(),to:F.to(),text:this.splitLines(e[m]),origin:u}}for(var U=n&&n!="end"&&cu(this,l,n),z=l.length-1;z>=0;z--)Mi(this,l[z]);U?Ja(this,U):this.cm&&yn(this.cm)}),undo:br(function(){al(this,"undo")}),redo:br(function(){al(this,"redo")}),undoSelection:br(function(){al(this,"undo",!0)}),redoSelection:br(function(){al(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,u=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++u;return{undo:n,redo:u}},clearHistory:function(){var e=this;this.history=new Po(this.history),ki(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Io(this.history.done),undone:Io(this.history.undone)}},setHistory:function(e){var n=this.history=new Po(this.history);n.done=Io(e.done.slice(0),null,!0),n.undone=Io(e.undone.slice(0),null,!0)},setGutterMarker:br(function(e,n,u){return dr(this,e,"gutter",function(l){var f=l.gutterMarkers||(l.gutterMarkers={});return f[n]=u,!u&&K(f)&&(l.gutterMarkers=null),!0})}),clearGutter:br(function(e){var n=this;this.iter(function(u){u.gutterMarkers&&u.gutterMarkers[e]&&dr(n,u,"gutter",function(){return u.gutterMarkers[e]=null,K(u.gutterMarkers)&&(u.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Jn(this,e)||(n=e,e=Et(this,e),!e))return null}else if(n=qt(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:br(function(e,n,u){return dr(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[f])l[f]=u;else{if(fe(u).test(l[f]))return!1;l[f]+=" "+u}return!0})}),removeLineClass:br(function(e,n,u){return dr(this,e,n=="gutter"?"gutter":"class",function(l){var f=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",m=l[f];if(m)if(u==null)l[f]=null;else{var F=m.match(fe(u));if(!F)return!1;var U=F.index+F[0].length;l[f]=m.slice(0,F.index)+(!F.index||U==m.length?"":" ")+m.slice(U)||null}else return!1;return!0})}),addLineWidget:br(function(e,n,u){return Td(this,e,n,u)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,u){return aa(this,st(this,e),st(this,n),u,u&&u.type||"range")},setBookmark:function(e,n){var u={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=st(this,e),aa(this,e,e,u,"bookmark")},findMarksAt:function(e){e=st(this,e);var n=[],u=Et(this,e.line).markedSpans;if(u)for(var l=0;l<u.length;++l){var f=u[l];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&n.push(f.marker.parent||f.marker)}return n},findMarks:function(e,n,u){e=st(this,e),n=st(this,n);var l=[],f=e.line;return this.iter(e.line,n.line+1,function(m){var F=m.markedSpans;if(F)for(var U=0;U<F.length;U++){var z=F[U];!(z.to!=null&&f==e.line&&e.ch>=z.to||z.from==null&&f!=e.line||z.from!=null&&f==n.line&&z.from>=n.ch)&&(!u||u(z.marker))&&l.push(z.marker.parent||z.marker)}++f}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var u=n.markedSpans;if(u)for(var l=0;l<u.length;++l)u[l].from!=null&&e.push(u[l].marker)}),e},posFromIndex:function(e){var n,u=this.first,l=this.lineSeparator().length;return this.iter(function(f){var m=f.text.length+l;if(m>e)return n=e,!0;e-=m,++u}),st(this,nt(u,n))},indexFromPos:function(e){e=st(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var u=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+u}),n},copy:function(e){var n=new Vt(bi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,u=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<u&&(u=e.to);var l=new Vt(bi(this,n,u),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Qf(l,Au(this)),l},unlinkDoc:function(e){if(e instanceof cr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var u=this.linked[n];if(u.doc==e){this.linked.splice(n,1),e.unlinkDoc(this),Zf(Au(this));break}}if(e.history==this.history){var l=[e.id];ki(e,function(f){return l.push(f.id)},!0),e.history=new Po(null),e.history.done=Io(this.history.done,l),e.history.undone=Io(this.history.undone,l)}},iterLinkedDocs:function(e){ki(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$n(e)},lineSeparator:function(){return this.lineSep||`
28
+ `},setDirection:br(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&za(this.cm))})}),Vt.prototype.eachLine=Vt.prototype.iter;var kn=0;function qf(e){var n=this;if(io(n),!(Pe(n,e)||ni(n.display,e))){it(e),b&&(kn=+new Date);var u=_i(n,e,!0),l=e.dataTransfer.files;if(!(!u||n.isReadOnly()))if(l&&l.length&&window.FileReader&&window.File)for(var f=l.length,m=Array(f),F=0,U=function(){++F==f&&xr(n,function(){u=st(n.doc,u);var Me={from:u,to:u,text:n.doc.splitLines(m.filter(function(Ye){return Ye!=null}).join(n.doc.lineSeparator())),origin:"paste"};Mi(n.doc,Me),Ja(n.doc,si(st(n.doc,u),st(n.doc,li(Me))))})()},z=function(Me,Ye){if(n.options.allowDropFileTypes&&pt(n.options.allowDropFileTypes,Me.type)==-1){U();return}var tt=new FileReader;tt.onerror=function(){return U()},tt.onload=function(){var at=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){U();return}m[Ye]=at,U()},tt.readAsText(Me)},Z=0;Z<l.length;Z++)z(l[Z],Z);else{if(n.state.draggingText&&n.doc.sel.contains(u)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var xe=e.dataTransfer.getData("Text");if(xe){var Ee;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ee=n.listSelections()),Xa(n.doc,si(u,u)),Ee)for(var Ne=0;Ne<Ee.length;++Ne)Fo(n.doc,"",Ee[Ne].anchor,Ee[Ne].head,"drag");n.replaceSelection(xe,"around","paste"),n.display.input.focus()}}catch(Me){}}}}function sl(e,n){if(b&&(!e.state.draggingText||+new Date-kn<100)){Jt(n);return}if(!(Pe(e,n)||ni(e.display,n))&&(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!j)){var u=ve("img",null,null,"position: fixed; left: 0; top: 0;");u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(u.width=u.height=1,e.display.wrapper.appendChild(u),u._top=u.offsetTop),n.dataTransfer.setDragImage(u,0,0),B&&u.parentNode.removeChild(u)}}function Eu(e,n){var u=_i(e,n);if(!!u){var l=document.createDocumentFragment();Oi(e,u,l),e.display.dragCursor||(e.display.dragCursor=ve("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ye(e.display.dragCursor,l)}}function io(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ll(e){if(!!document.getElementsByClassName){for(var n=document.getElementsByClassName("CodeMirror"),u=[],l=0;l<n.length;l++){var f=n[l].CodeMirror;f&&u.push(f)}u.length&&u[0].operation(function(){for(var m=0;m<u.length;m++)e(u[m])})}}var ul=!1;function ec(){ul||(Cu(),ul=!0)}function Cu(){var e;D(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ll(fl)},100))}),D(window,"blur",function(){return ll(wo)})}function fl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var ci={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ko=0;ko<10;ko++)ci[ko+48]=ci[ko+96]=String(ko);for(var oo=65;oo<=90;oo++)ci[oo]=String.fromCharCode(oo);for(var la=1;la<=12;la++)ci[la+111]=ci[la+63235]="F"+la;var di={};di.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},di.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},di.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},di.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},di.default=C?di.macDefault:di.pcDefault;function Ro(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var u,l,f,m,F=0;F<n.length-1;F++){var U=n[F];if(/^(cmd|meta|m)$/i.test(U))m=!0;else if(/^a(lt)?$/i.test(U))u=!0;else if(/^(c|ctrl|control)$/i.test(U))l=!0;else if(/^s(hift)?$/i.test(U))f=!0;else throw new Error("Unrecognized modifier name: "+U)}return u&&(e="Alt-"+e),l&&(e="Ctrl-"+e),m&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Ou(e){var n={};for(var u in e)if(e.hasOwnProperty(u)){var l=e[u];if(/^(name|fallthrough|(de|at)tach)$/.test(u))continue;if(l=="..."){delete e[u];continue}for(var f=jt(u.split(" "),Ro),m=0;m<f.length;m++){var F=void 0,U=void 0;m==f.length-1?(U=f.join(" "),F=l):(U=f.slice(0,m+1).join(" "),F="...");var z=n[U];if(!z)n[U]=F;else if(z!=F)throw new Error("Inconsistent bindings for "+U)}delete e[u]}for(var Z in n)e[Z]=n[Z];return e}function Mo(e,n,u,l){n=fa(n);var f=n.call?n.call(e,l):n[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&u(f))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Mo(e,n.fallthrough,u,l);for(var m=0;m<n.fallthrough.length;m++){var F=Mo(e,n.fallthrough[m],u,l);if(F)return F}}}function ua(e){var n=typeof e=="string"?e:ci[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Tu(e,n,u){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(Q?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(Q?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!u&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Pu(e,n){if(B&&e.keyCode==34&&e.char)return!1;var u=ci[e.keyCode];return u==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(u=e.code),Tu(u,e,n))}function fa(e){return typeof e=="string"?di[e]:e}function ao(e,n){for(var u=e.doc.sel.ranges,l=[],f=0;f<u.length;f++){for(var m=n(u[f]);l.length&&Lt(m.from,At(l).to)<=0;){var F=l.pop();if(Lt(F.from,m.from)<0){m.from=F.from;break}}l.push(m)}Yr(e,function(){for(var U=l.length-1;U>=0;U--)Fo(e.doc,"",l[U].from,l[U].to,"+delete");yn(e)})}function es(e,n,u){var l=be(e.text,n+u,u);return l<0||l>e.text.length?null:l}function ts(e,n,u){var l=es(e,n.ch,u);return l==null?null:new nt(n.line,l,u<0?"after":"before")}function cl(e,n,u,l,f){if(e){n.doc.direction=="rtl"&&(f=-f);var m=P(u,n.doc.direction);if(m){var F=f<0?At(m):m[0],U=f<0==(F.level==1),z=U?"after":"before",Z;if(F.level>0||n.doc.direction=="rtl"){var xe=yo(n,u);Z=f<0?u.text.length-1:0;var Ee=gn(n,xe,Z).top;Z=Ae(function(Ne){return gn(n,xe,Ne).top==Ee},f<0==(F.level==1)?F.from:F.to-1,Z),z=="before"&&(Z=es(u,Z,1))}else Z=f<0?F.to:F.from;return new nt(l,Z,z)}}return new nt(l,f<0?u.text.length:0,f<0?"before":"after")}function tc(e,n,u,l){var f=P(n,e.doc.direction);if(!f)return ts(n,u,l);u.ch>=n.text.length?(u.ch=n.text.length,u.sticky="before"):u.ch<=0&&(u.ch=0,u.sticky="after");var m=W(f,u.ch,u.sticky),F=f[m];if(e.doc.direction=="ltr"&&F.level%2==0&&(l>0?F.to>u.ch:F.from<u.ch))return ts(n,u,l);var U=function(ft,ht){return es(n,ft instanceof nt?ft.ch:ft,ht)},z,Z=function(ft){return e.options.lineWrapping?(z=z||yo(e,n),ou(e,n,z,ft)):{begin:0,end:n.text.length}},xe=Z(u.sticky=="before"?U(u,-1):u.ch);if(e.doc.direction=="rtl"||F.level==1){var Ee=F.level==1==l<0,Ne=U(u,Ee?1:-1);if(Ne!=null&&(Ee?Ne<=F.to&&Ne<=xe.end:Ne>=F.from&&Ne>=xe.begin)){var Me=Ee?"before":"after";return new nt(u.line,Ne,Me)}}var Ye=function(ft,ht,ct){for(var bt=function(ar,Hr){return Hr?new nt(u.line,U(ar,1),"before"):new nt(u.line,ar,"after")};ft>=0&&ft<f.length;ft+=ht){var Pt=f[ft],Ot=ht>0==(Pt.level!=1),Ut=Ot?ct.begin:U(ct.end,-1);if(Pt.from<=Ut&&Ut<Pt.to||(Ut=Ot?Pt.from:U(Pt.to,-1),ct.begin<=Ut&&Ut<ct.end))return bt(Ut,Ot)}},tt=Ye(m+l,l,xe);if(tt)return tt;var at=l>0?xe.end:U(xe.begin,-1);return at!=null&&!(l>0&&at==n.text.length)&&(tt=Ye(l>0?0:f.length-1,l,Z(at)),tt)?tt:null}var Di={selectAll:Za,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),lt)},killLine:function(e){return ao(e,function(n){if(n.empty()){var u=Et(e.doc,n.head.line).text.length;return n.head.ch==u&&n.head.line<e.lastLine()?{from:n.head,to:nt(n.head.line+1,0)}:{from:n.head,to:nt(n.head.line,u)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ao(e,function(n){return{from:nt(n.from().line,0),to:st(e.doc,nt(n.to().line+1,0))}})},delLineLeft:function(e){return ao(e,function(n){return{from:nt(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ao(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ao(e,function(n){var u=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(nt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(nt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Iu(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Fu(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Fr(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:u},"div")},mt)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:u},"div")},mt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var u=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:u},"div");return l.ch<e.getLine(l.line).search(/\S/)?Fu(e,n.head):l},mt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],u=e.listSelections(),l=e.options.tabSize,f=0;f<u.length;f++){var m=u[f].from(),F=Xe(e.getLine(m.line),m.ch,l);n.push(It(l-F%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Yr(e,function(){for(var n=e.listSelections(),u=[],l=0;l<n.length;l++)if(!!n[l].empty()){var f=n[l].head,m=Et(e.doc,f.line).text;if(m){if(f.ch==m.length&&(f=new nt(f.line,f.ch-1)),f.ch>0)f=new nt(f.line,f.ch+1),e.replaceRange(m.charAt(f.ch-1)+m.charAt(f.ch-2),nt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var F=Et(e.doc,f.line-1).text;F&&(f=new nt(f.line,1),e.replaceRange(m.charAt(0)+e.doc.lineSeparator()+F.charAt(F.length-1),nt(f.line-1,F.length-1),f,"+transpose"))}}u.push(new _t(f,f))}e.setSelections(u)})},newlineAndIndent:function(e){return Yr(e,function(){for(var n=e.listSelections(),u=n.length-1;u>=0;u--)e.replaceRange(e.doc.lineSeparator(),n[u].anchor,n[u].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);yn(e)})},openLine:function(e){return e.replaceSelection(`
29
+ `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Iu(e,n){var u=Et(e.doc,n),l=xt(u);return l!=u&&(n=qt(l)),cl(!0,e,l,n,1)}function Fr(e,n){var u=Et(e.doc,n),l=In(u);return l!=u&&(n=qt(l)),cl(!0,e,u,n,-1)}function Fu(e,n){var u=Iu(e,n.line),l=Et(e.doc,u.line),f=P(l,e.doc.direction);if(!f||f[0].level==0){var m=Math.max(u.ch,l.text.search(/\S/)),F=n.line==u.line&&n.ch<=m&&n.ch;return nt(u.line,F?0:m,u.sticky)}return u}function dl(e,n,u){if(typeof n=="string"&&(n=Di[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u&&(e.display.shift=!1),f=n(e)!=qe}finally{e.display.shift=l,e.state.suppressEdits=!1}return f}function rc(e,n,u){for(var l=0;l<e.state.keyMaps.length;l++){var f=Mo(n,e.state.keyMaps[l],u,e);if(f)return f}return e.options.extraKeys&&Mo(n,e.options.extraKeys,u,e)||Mo(n,e.options.keyMap,u,e)}var Ni=new ut;function ca(e,n,u,l){var f=e.state.keySeq;if(f){if(ua(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Ni.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),ku(e,f+" "+n,u,l))return!0}return ku(e,n,u,l)}function ku(e,n,u,l){var f=rc(e,n,l);return f=="multi"&&(e.state.keySeq=n),f=="handled"&&Wr(e,"keyHandled",e,n,u),(f=="handled"||f=="multi")&&(it(u),su(e)),!!f}function Ru(e,n){var u=Pu(n,!0);return u?n.shiftKey&&!e.state.keySeq?ca(e,"Shift-"+u,n,function(l){return dl(e,l,!0)})||ca(e,u,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return dl(e,l)}):ca(e,u,n,function(l){return dl(e,l)}):!1}function nc(e,n,u){return ca(e,"'"+u+"'",n,function(l){return dl(e,l,!0)})}var Mu=null;function ic(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&(n.curOp.focus=De(),!Pe(n,e))){b&&A<11&&e.keyCode==27&&(e.returnValue=!1);var u=e.keyCode;n.display.shift=u==16||e.shiftKey;var l=Ru(n,e);B&&(Mu=l?u:null,!l&&u==88&&!Kn&&(C?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),c&&!C&&!l&&u==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),u==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Pd(n)}}function Pd(e){var n=e.display.lineDiv;Ve(n,"CodeMirror-crosshair");function u(l){(l.keyCode==18||!l.altKey)&&(te(n,"CodeMirror-crosshair"),ce(document,"keyup",u),ce(document,"mouseover",u))}D(document,"keyup",u),D(document,"mouseover",u)}function oc(e){e.keyCode==16&&(this.doc.sel.shift=!1),Pe(this,e)}function ac(e){var n=this;if(!(e.target&&e.target!=n.display.input.getField())&&!(ni(n.display,e)||Pe(n,e)||e.ctrlKey&&!e.altKey||C&&e.metaKey)){var u=e.keyCode,l=e.charCode;if(B&&u==Mu){Mu=null,it(e);return}if(!(B&&(!e.which||e.which<10)&&Ru(n,e))){var f=String.fromCharCode(l==null?u:l);f!="\b"&&(nc(n,e,f)||n.display.input.onKeyPress(e))}}}var Id=400,Lu=function(e,n,u){this.time=e,this.pos=n,this.button=u};Lu.prototype.compare=function(e,n,u){return this.time+Id>e&&Lt(n,this.pos)==0&&u==this.button};var rs,ns;function Fd(e,n){var u=+new Date;return ns&&ns.compare(u,e,n)?(rs=ns=null,"triple"):rs&&rs.compare(u,e,n)?(ns=new Lu(u,e,n),rs=null,"double"):(rs=new Lu(u,e,n),ns=null,"single")}function pl(e){var n=this,u=n.display;if(!(Pe(n,e)||u.activeTouch&&u.input.supportsTouch())){if(u.input.ensurePolled(),u.shift=e.shiftKey,ni(u,e)){g||(u.scroller.draggable=!1,setTimeout(function(){return u.scroller.draggable=!0},100));return}if(!os(n,e)){var l=_i(n,e),f=wn(e),m=l?Fd(l,f):"single";window.focus(),f==1&&n.state.selectingText&&n.state.selectingText(e),!(l&&Lo(n,f,l,m,e))&&(f==1?l?lc(n,l,m,e):Ft(e)==u.scroller&&it(e):f==2?(l&&Ya(n.doc,l),setTimeout(function(){return u.input.focus()},20)):f==3&&(Y?n.display.input.onContextMenu(e):zs(n)))}}}function Lo(e,n,u,l,f){var m="Click";return l=="double"?m="Double"+m:l=="triple"&&(m="Triple"+m),m=(n==1?"Left":n==2?"Middle":"Right")+m,ca(e,Tu(m,f),f,function(F){if(typeof F=="string"&&(F=Di[F]),!F)return!1;var U=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),U=F(e,u)!=qe}finally{e.state.suppressEdits=!1}return U})}function sc(e,n,u){var l=e.getOption("configureMouse"),f=l?l(e,n,u):{};if(f.unit==null){var m=V?u.shiftKey&&u.metaKey:u.altKey;f.unit=m?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||u.shiftKey),f.addNew==null&&(f.addNew=C?u.metaKey:u.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(C?u.altKey:u.ctrlKey)),f}function lc(e,n,u,l){b?setTimeout(rt(jf,e),0):e.curOp.focus=De();var f=sc(e,u,l),m=e.doc.sel,F;e.options.dragDrop&&Zr&&!e.isReadOnly()&&u=="single"&&(F=m.contains(n))>-1&&(Lt((F=m.ranges[F]).from(),n)<0||n.xRel>0)&&(Lt(F.to(),n)>0||n.xRel<0)?is(e,l,n,f):uc(e,l,n,f)}function is(e,n,u,l){var f=e.display,m=!1,F=xr(e,function(Z){g&&(f.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:zs(e)),ce(f.wrapper.ownerDocument,"mouseup",F),ce(f.wrapper.ownerDocument,"mousemove",U),ce(f.scroller,"dragstart",z),ce(f.scroller,"drop",F),m||(it(Z),l.addNew||Ya(e.doc,u,null,null,l.extend),g&&!j||b&&A==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),U=function(Z){m=m||Math.abs(n.clientX-Z.clientX)+Math.abs(n.clientY-Z.clientY)>=10},z=function(){return m=!0};g&&(f.scroller.draggable=!0),e.state.draggingText=F,F.copy=!l.moveOnDrag,D(f.wrapper.ownerDocument,"mouseup",F),D(f.wrapper.ownerDocument,"mousemove",U),D(f.scroller,"dragstart",z),D(f.scroller,"drop",F),e.state.delayingBlurEvent=!0,setTimeout(function(){return f.input.focus()},20),f.scroller.dragDrop&&f.scroller.dragDrop()}function Du(e,n,u){if(u=="char")return new _t(n,n);if(u=="word")return e.findWordAt(n);if(u=="line")return new _t(nt(n.line,0),st(e.doc,nt(n.line+1,0)));var l=u(e,n);return new _t(l.from,l.to)}function uc(e,n,u,l){b&&zs(e);var f=e.display,m=e.doc;it(n);var F,U,z=m.sel,Z=z.ranges;if(l.addNew&&!l.extend?(U=m.sel.contains(u),U>-1?F=Z[U]:F=new _t(u,u)):(F=m.sel.primary(),U=m.sel.primIndex),l.unit=="rectangle")l.addNew||(F=new _t(u,u)),u=_i(e,n,!0,!0),U=-1;else{var xe=Du(e,u,l.unit);l.extend?F=Ka(F,xe.anchor,xe.head,l.extend):F=xe}l.addNew?U==-1?(U=Z.length,rr(m,Fn(e,Z.concat([F]),U),{scroll:!1,origin:"*mouse"})):Z.length>1&&Z[U].empty()&&l.unit=="char"&&!l.extend?(rr(m,Fn(e,Z.slice(0,U).concat(Z.slice(U+1)),0),{scroll:!1,origin:"*mouse"}),z=m.sel):tn(m,U,F,vt):(U=0,rr(m,new Ar([F],0),vt),z=m.sel);var Ee=u;function Ne(ct){if(Lt(Ee,ct)!=0)if(Ee=ct,l.unit=="rectangle"){for(var bt=[],Pt=e.options.tabSize,Ot=Xe(Et(m,u.line).text,u.ch,Pt),Ut=Xe(Et(m,ct.line).text,ct.ch,Pt),ar=Math.min(Ot,Ut),Hr=Math.max(Ot,Ut),vr=Math.min(u.line,ct.line),xn=Math.min(e.lastLine(),Math.max(u.line,ct.line));vr<=xn;vr++){var fn=Et(m,vr).text,kr=dt(fn,ar,Pt);ar==Hr?bt.push(new _t(nt(vr,kr),nt(vr,kr))):fn.length>kr&&bt.push(new _t(nt(vr,kr),nt(vr,dt(fn,Hr,Pt))))}bt.length||bt.push(new _t(u,u)),rr(m,Fn(e,z.ranges.slice(0,U).concat(bt),U),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ct)}else{var rn=F,zr=Du(e,ct,l.unit),Nr=rn.anchor,Rr;Lt(zr.anchor,Nr)>0?(Rr=zr.head,Nr=_e(rn.from(),zr.anchor)):(Rr=zr.anchor,Nr=Ce(rn.to(),zr.head));var wr=z.ranges.slice(0);wr[U]=fc(e,new _t(st(m,Nr),Rr)),rr(m,Fn(e,wr,U),vt)}}var Me=f.wrapper.getBoundingClientRect(),Ye=0;function tt(ct){var bt=++Ye,Pt=_i(e,ct,!0,l.unit=="rectangle");if(!!Pt)if(Lt(Pt,Ee)!=0){e.curOp.focus=De(),Ne(Pt);var Ot=Ks(f,m);(Pt.line>=Ot.to||Pt.line<Ot.from)&&setTimeout(xr(e,function(){Ye==bt&&tt(ct)}),150)}else{var Ut=ct.clientY<Me.top?-20:ct.clientY>Me.bottom?20:0;Ut&&setTimeout(xr(e,function(){Ye==bt&&(f.scroller.scrollTop+=Ut,tt(ct))}),50)}}function at(ct){e.state.selectingText=!1,Ye=1/0,ct&&(it(ct),f.input.focus()),ce(f.wrapper.ownerDocument,"mousemove",ft),ce(f.wrapper.ownerDocument,"mouseup",ht),m.history.lastSelOrigin=null}var ft=xr(e,function(ct){ct.buttons===0||!wn(ct)?at(ct):tt(ct)}),ht=xr(e,at);e.state.selectingText=ht,D(f.wrapper.ownerDocument,"mousemove",ft),D(f.wrapper.ownerDocument,"mouseup",ht)}function fc(e,n){var u=n.anchor,l=n.head,f=Et(e.doc,u.line);if(Lt(u,l)==0&&u.sticky==l.sticky)return n;var m=P(f);if(!m)return n;var F=W(m,u.ch,u.sticky),U=m[F];if(U.from!=u.ch&&U.to!=u.ch)return n;var z=F+(U.from==u.ch==(U.level!=1)?0:1);if(z==0||z==m.length)return n;var Z;if(l.line!=u.line)Z=(l.line-u.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var xe=W(m,l.ch,l.sticky),Ee=xe-F||(l.ch-u.ch)*(U.level==1?-1:1);xe==z-1||xe==z?Z=Ee<0:Z=Ee>0}var Ne=m[z+(Z?-1:0)],Me=Z==(Ne.level==1),Ye=Me?Ne.from:Ne.to,tt=Me?"after":"before";return u.ch==Ye&&u.sticky==tt?n:new _t(new nt(u.line,Ye,tt),l)}function Nu(e,n,u,l){var f,m;if(n.touches)f=n.touches[0].clientX,m=n.touches[0].clientY;else try{f=n.clientX,m=n.clientY}catch(Ne){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&it(n);var F=e.display,U=F.lineDiv.getBoundingClientRect();if(m>U.bottom||!Ge(e,u))return Ct(n);m-=U.top-F.viewOffset;for(var z=0;z<e.display.gutterSpecs.length;++z){var Z=F.gutters.childNodes[z];if(Z&&Z.getBoundingClientRect().right>=f){var xe=Un(e.doc,m),Ee=e.display.gutterSpecs[z];return Oe(e,u,e,xe,Ee.className,n),Ct(n)}}}function os(e,n){return Nu(e,n,"gutterClick",!0)}function da(e,n){ni(e.display,n)||kd(e,n)||Pe(e,n,"contextmenu")||Y||e.display.input.onContextMenu(n)}function kd(e,n){return Ge(e,"gutterContextMenu")?Nu(e,n,"gutterContextMenu",!1):!1}function Bi(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Jo(e)}var pi={toString:function(){return"CodeMirror.Init"}},Do={},pa={};function Bu(e){var n=e.optionHandlers;function u(l,f,m,F){e.defaults[l]=f,m&&(n[l]=F?function(U,z,Z){Z!=pi&&m(U,z,Z)}:m)}e.defineOption=u,e.Init=pi,u("value","",function(l,f){return l.setValue(f)},!0),u("mode",null,function(l,f){l.doc.modeOption=f,Wa(l)},!0),u("indentUnit",2,Wa,!0),u("indentWithTabs",!1),u("smartIndent",!0),u("tabSize",4,function(l){Fi(l),Jo(l),$r(l)},!0),u("lineSeparator",null,function(l,f){if(l.doc.lineSep=f,!!f){var m=[],F=l.doc.first;l.doc.iter(function(z){for(var Z=0;;){var xe=z.text.indexOf(f,Z);if(xe==-1)break;Z=xe+f.length,m.push(nt(F,xe))}F++});for(var U=m.length-1;U>=0;U--)Fo(l.doc,f,m[U],nt(m[U].line,m[U].ch+f.length))}}),u("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,f,m){l.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),m!=pi&&l.refresh()}),u("specialCharPlaceholder",zo,function(l){return l.refresh()},!0),u("electricChars",!0),u("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),u("spellcheck",!1,function(l,f){return l.getInputField().spellcheck=f},!0),u("autocorrect",!1,function(l,f){return l.getInputField().autocorrect=f},!0),u("autocapitalize",!1,function(l,f){return l.getInputField().autocapitalize=f},!0),u("rtlMoveVisually",!J),u("wholeLineUpdateBefore",!0),u("theme","default",function(l){Bi(l),To(l)},!0),u("keyMap","default",function(l,f,m){var F=fa(f),U=m!=pi&&fa(m);U&&U.detach&&U.detach(l,F),F.attach&&F.attach(l,U||null)}),u("extraKeys",null),u("configureMouse",null),u("lineWrapping",!1,Uu,!0),u("gutters",[],function(l,f){l.display.gutterSpecs=Ba(f,l.options.lineNumbers),To(l)},!0),u("fixedGutter",!0,function(l,f){l.display.gutters.style.left=f?js(l.display)+"px":"0",l.refresh()},!0),u("coverGutterNextToScrollbar",!1,function(l){return eo(l)},!0),u("scrollbarStyle","native",function(l){Da(l),eo(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),u("lineNumbers",!1,function(l,f){l.display.gutterSpecs=Ba(l.options.gutters,f),To(l)},!0),u("firstLineNumber",1,To,!0),u("lineNumberFormatter",function(l){return l},To,!0),u("showCursorWhenSelecting",!1,bo,!0),u("resetSelectionOnContextMenu",!0),u("lineWiseCopyCut",!0),u("pasteLinesPerSelection",!0),u("selectionsMayTouch",!1),u("readOnly",!1,function(l,f){f=="nocursor"&&(wo(l),l.display.input.blur()),l.display.input.readOnlyChanged(f)}),u("screenReaderLabel",null,function(l,f){f=f===""?null:f,l.display.input.screenReaderLabelChanged(f)}),u("disableInput",!1,function(l,f){f||l.display.input.reset()},!0),u("dragDrop",!0,cc),u("allowDropFileTypes",null),u("cursorBlinkRate",530),u("cursorScrollMargin",0),u("cursorHeight",1,bo,!0),u("singleCursorHeightPerLine",!0,bo,!0),u("workTime",100),u("workDelay",100),u("flattenSpans",!0,Fi,!0),u("addModeClass",!1,Fi,!0),u("pollInterval",100),u("undoDepth",200,function(l,f){return l.doc.history.undoDepth=f}),u("historyEventDelay",1250),u("viewportMargin",10,function(l){return l.refresh()},!0),u("maxHighlightLength",1e4,Fi,!0),u("moveInputWithCursor",!0,function(l,f){f||l.display.input.resetPosition()}),u("tabindex",null,function(l,f){return l.display.input.getField().tabIndex=f||""}),u("autofocus",null),u("direction","ltr",function(l,f){return l.doc.setDirection(f)},!0),u("phrases",null)}function cc(e,n,u){var l=u&&u!=pi;if(!n!=!l){var f=e.display.dragFunctions,m=n?D:ce;m(e.display.scroller,"dragstart",f.start),m(e.display.scroller,"dragenter",f.enter),m(e.display.scroller,"dragover",f.over),m(e.display.scroller,"dragleave",f.leave),m(e.display.scroller,"drop",f.drop)}}function Uu(e){e.options.lineWrapping?(Ve(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(te(e.display.wrapper,"CodeMirror-wrap"),ho(e)),_o(e),$r(e),Jo(e),setTimeout(function(){return eo(e)},100)}function cr(e,n){var u=this;if(!(this instanceof cr))return new cr(e,n);this.options=n=n?Qe(n):{},Qe(Do,n,!1);var l=n.value;typeof l=="string"?l=new Vt(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var f=new cr.inputStyles[n.inputStyle](this),m=this.display=new ja(e,l,f,n);m.wrapper.CodeMirror=this,Bi(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Da(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ut,keySeq:null,specialChars:null},n.autofocus&&!M&&m.input.focus(),b&&A<11&&setTimeout(function(){return u.display.input.reset(!0)},20),as(this),ec(),Ti(this),this.curOp.forceUpdate=!0,Ze(this,l),n.autofocus&&!M||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&Gs(u)},20):wo(this);for(var F in pa)pa.hasOwnProperty(F)&&pa[F](this,n[F],pi);Zs(this),n.finishInit&&n.finishInit(this);for(var U=0;U<hl.length;++U)hl[U](this);Pi(this),g&&n.lineWrapping&&getComputedStyle(m.lineDiv).textRendering=="optimizelegibility"&&(m.lineDiv.style.textRendering="auto")}cr.defaults=Do,cr.optionHandlers=pa;function as(e){var n=e.display;D(n.scroller,"mousedown",xr(e,pl)),b&&A<11?D(n.scroller,"dblclick",xr(e,function(z){if(!Pe(e,z)){var Z=_i(e,z);if(!(!Z||os(e,z)||ni(e.display,z))){it(z);var xe=e.findWordAt(Z);Ya(e.doc,xe.anchor,xe.head)}}})):D(n.scroller,"dblclick",function(z){return Pe(e,z)||it(z)}),D(n.scroller,"contextmenu",function(z){return da(e,z)}),D(n.input.getField(),"contextmenu",function(z){n.scroller.contains(z.target)||da(e,z)});var u,l={end:0};function f(){n.activeTouch&&(u=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function m(z){if(z.touches.length!=1)return!1;var Z=z.touches[0];return Z.radiusX<=1&&Z.radiusY<=1}function F(z,Z){if(Z.left==null)return!0;var xe=Z.left-z.left,Ee=Z.top-z.top;return xe*xe+Ee*Ee>20*20}D(n.scroller,"touchstart",function(z){if(!Pe(e,z)&&!m(z)&&!os(e,z)){n.input.ensurePolled(),clearTimeout(u);var Z=+new Date;n.activeTouch={start:Z,moved:!1,prev:Z-l.end<=300?l:null},z.touches.length==1&&(n.activeTouch.left=z.touches[0].pageX,n.activeTouch.top=z.touches[0].pageY)}}),D(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),D(n.scroller,"touchend",function(z){var Z=n.activeTouch;if(Z&&!ni(n,z)&&Z.left!=null&&!Z.moved&&new Date-Z.start<300){var xe=e.coordsChar(n.activeTouch,"page"),Ee;!Z.prev||F(Z,Z.prev)?Ee=new _t(xe,xe):!Z.prev.prev||F(Z,Z.prev.prev)?Ee=e.findWordAt(xe):Ee=new _t(nt(xe.line,0),st(e.doc,nt(xe.line+1,0))),e.setSelection(Ee.anchor,Ee.head),e.focus(),it(z)}f()}),D(n.scroller,"touchcancel",f),D(n.scroller,"scroll",function(){n.scroller.clientHeight&&(ln(e,n.scroller.scrollTop),Vn(e,n.scroller.scrollLeft,!0),Oe(e,"scroll",e))}),D(n.scroller,"mousewheel",function(z){return qs(e,z)}),D(n.scroller,"DOMMouseScroll",function(z){return qs(e,z)}),D(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(z){Pe(e,z)||Jt(z)},over:function(z){Pe(e,z)||(Eu(e,z),Jt(z))},start:function(z){return sl(e,z)},drop:xr(e,qf),leave:function(z){Pe(e,z)||io(e)}};var U=n.input.getField();D(U,"keyup",function(z){return oc.call(e,z)}),D(U,"keydown",xr(e,ic)),D(U,"keypress",xr(e,ac)),D(U,"focus",function(z){return Gs(e,z)}),D(U,"blur",function(z){return wo(e,z)})}var hl=[];cr.defineInitHook=function(e){return hl.push(e)};function No(e,n,u,l){var f=e.doc,m;u==null&&(u="add"),u=="smart"&&(f.mode.indent?m=_r(e,n).state:u="prev");var F=e.options.tabSize,U=Et(f,n),z=Xe(U.text,null,F);U.stateAfter&&(U.stateAfter=null);var Z=U.text.match(/^\s*/)[0],xe;if(!l&&!/\S/.test(U.text))xe=0,u="not";else if(u=="smart"&&(xe=f.mode.indent(m,U.text.slice(Z.length),U.text),xe==qe||xe>150)){if(!l)return;u="prev"}u=="prev"?n>f.first?xe=Xe(Et(f,n-1).text,null,F):xe=0:u=="add"?xe=z+e.options.indentUnit:u=="subtract"?xe=z-e.options.indentUnit:typeof u=="number"&&(xe=z+u),xe=Math.max(0,xe);var Ee="",Ne=0;if(e.options.indentWithTabs)for(var Me=Math.floor(xe/F);Me;--Me)Ne+=F,Ee+=" ";if(Ne<xe&&(Ee+=It(xe-Ne)),Ee!=Z)return Fo(f,Ee,nt(n,0),nt(n,Z.length),"+input"),U.stateAfter=null,!0;for(var Ye=0;Ye<f.sel.ranges.length;Ye++){var tt=f.sel.ranges[Ye];if(tt.head.line==n&&tt.head.ch<Z.length){var at=nt(n,Z.length);tn(f,Ye,new _t(at,at));break}}}var Rn=null;function ha(e){Rn=e}function vl(e,n,u,l,f){var m=e.doc;e.display.shift=!1,l||(l=m.sel);var F=+new Date-200,U=f=="paste"||e.state.pasteIncoming>F,z=$n(n),Z=null;if(U&&l.ranges.length>1)if(Rn&&Rn.text.join(`
30
30
  `)==n){if(l.ranges.length%Rn.text.length==0){Z=[];for(var xe=0;xe<Rn.text.length;xe++)Z.push(m.splitLines(Rn.text[xe]))}}else z.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(Z=jt(z,function(ft){return[ft]}));for(var Ee=e.curOp.updateInput,Ne=l.ranges.length-1;Ne>=0;Ne--){var Me=l.ranges[Ne],Ye=Me.from(),tt=Me.to();Me.empty()&&(u&&u>0?Ye=nt(Ye.line,Ye.ch-u):e.state.overwrite&&!U?tt=nt(tt.line,Math.min(Et(m,tt.line).text.length,tt.ch+At(z).length)):U&&Rn&&Rn.lineWise&&Rn.text.join(`
31
31
  `)==z.join(`
32
- `)&&(Ye=tt=nt(Ye.line,0)));var at={from:Ye,to:tt,text:Z?Z[Ne%Z.length]:z,origin:f||(U?"paste":e.state.cutIncoming>F?"cut":"+input")};Mi(e.doc,at),Wr(e,"inputRead",e,at)}n&&!U&&va(e,n),yn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ee),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ju(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Yr(n,function(){return gl(n,u,0,null,"paste")}),!0}function va(e,n){if(!(!e.options.electricChars||!e.options.smartIndent))for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var f=u.ranges[l];if(!(f.head.ch>100||l&&u.ranges[l-1].head.line==f.head.line)){var m=e.getModeAt(f.head),F=!1;if(m.electricChars){for(var U=0;U<m.electricChars.length;U++)if(n.indexOf(m.electricChars.charAt(U))>-1){F=No(e,f.head.line,"smart");break}}else m.electricInput&&m.electricInput.test(Et(e.doc,f.head.line).text.slice(0,f.head.ch))&&(F=No(e,f.head.line,"smart"));F&&Wr(e,"electricInput",e,f.head.line)}}}function yl(e){for(var n=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var f=e.doc.sel.ranges[l].head.line,m={anchor:nt(f,0),head:nt(f+1,0)};u.push(m),n.push(e.getRange(m.anchor,m.head))}return{text:n,ranges:u}}function ml(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function xl(){var e=ve("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=ve("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),R&&(e.style.border="1px solid black"),ml(e),n}function dc(e){var n=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,f){var m=this.options,F=m[l];m[l]==f&&l!="mode"||(m[l]=f,n.hasOwnProperty(l)&&xr(this,n[l])(this,f,F),Oe(this,"optionChange",this,l))},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,f){this.state.keyMaps[f?"push":"unshift"](fa(l))},removeKeyMap:function(l){for(var f=this.state.keyMaps,m=0;m<f.length;++m)if(f[m]==l||f[m].name==l)return f.splice(m,1),!0},addOverlay:Lr(function(l,f){var m=l.token?l:e.getMode(this.options,l);if(m.startState)throw new Error("Overlays may not be stateful.");Nt(this.state.overlays,{mode:m,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(F){return F.priority}),this.state.modeGen++,$r(this)}),removeOverlay:Lr(function(l){for(var f=this.state.overlays,m=0;m<f.length;++m){var F=f[m].modeSpec;if(F==l||typeof l=="string"&&F.name==l){f.splice(m,1),this.state.modeGen++,$r(this);return}}}),indentLine:Lr(function(l,f,m){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Jn(this.doc,l)&&No(this,l,f,m)}),indentSelection:Lr(function(l){for(var f=this.doc.sel.ranges,m=-1,F=0;F<f.length;F++){var U=f[F];if(U.empty())U.head.line>m&&(No(this,U.head.line,l,!0),m=U.head.line,F==this.doc.sel.primIndex&&yn(this));else{var z=U.from(),Z=U.to(),xe=Math.max(m,z.line);m=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ee=xe;Ee<m;++Ee)No(this,Ee,l);var Ne=this.doc.sel.ranges;z.ch==0&&f.length==Ne.length&&Ne[F].from().ch>0&&tn(this.doc,F,new _t(z,Ne[F].to()),lt)}}}),getTokenAt:function(l,f){return ws(this,l,f)},getLineTokens:function(l,f){return ws(this,nt(l),f,!0)},getTokenTypeAt:function(l){l=st(this.doc,l);var f=Bl(this,Et(this.doc,l.line)),m=0,F=(f.length-1)/2,U=l.ch,z;if(U==0)z=f[2];else for(;;){var Z=m+F>>1;if((Z?f[Z*2-1]:0)>=U)F=Z;else if(f[Z*2+1]<U)m=Z+1;else{z=f[Z*2+2];break}}var xe=z?z.indexOf("overlay "):-1;return xe<0?z:xe==0?null:z.slice(0,xe-1)},getModeAt:function(l){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(l).state).mode:f},getHelper:function(l,f){return this.getHelpers(l,f)[0]},getHelpers:function(l,f){var m=[];if(!u.hasOwnProperty(f))return m;var F=u[f],U=this.getModeAt(l);if(typeof U[f]=="string")F[U[f]]&&m.push(F[U[f]]);else if(U[f])for(var z=0;z<U[f].length;z++){var Z=F[U[f][z]];Z&&m.push(Z)}else U.helperType&&F[U.helperType]?m.push(F[U.helperType]):F[U.name]&&m.push(F[U.name]);for(var xe=0;xe<F._global.length;xe++){var Ee=F._global[xe];Ee.pred(U,this)&&pt(m,Ee.val)==-1&&m.push(Ee.val)}return m},getStateAfter:function(l,f){var m=this.doc;return l=ot(m,l==null?m.first+m.size-1:l),_r(this,l+1,f).state},cursorCoords:function(l,f){var m,F=this.doc.sel.primary();return l==null?m=F.head:typeof l=="object"?m=st(this.doc,l):m=l?F.from():F.to(),qr(this,m,f||"page")},charCoords:function(l,f){return La(this,st(this.doc,l),f||"page")},coordsChar:function(l,f){return l=Us(this,l,f||"page"),Qi(this,l.left,l.top)},lineAtHeight:function(l,f){return l=Us(this,{top:l,left:0},f||"page").top,Un(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,m){var F=!1,U;if(typeof l=="number"){var z=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>z&&(l=z,F=!0),U=Et(this.doc,l)}else U=l;return Ma(this,U,{top:0,left:0},f||"page",m||F).top+(F?this.doc.height-ri(U):0)},defaultTextHeight:function(){return mo(this.display)},defaultCharWidth:function(){return xo(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,m,F,U){var z=this.display;l=qr(this,st(this.doc,l));var Z=l.bottom,xe=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),z.sizer.appendChild(f),F=="over")Z=l.top;else if(F=="above"||F=="near"){var Ee=Math.max(z.wrapper.clientHeight,this.doc.height),Ne=Math.max(z.sizer.clientWidth,z.lineSpace.clientWidth);(F=="above"||l.bottom+f.offsetHeight>Ee)&&l.top>f.offsetHeight?Z=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Ee&&(Z=l.bottom),xe+f.offsetWidth>Ne&&(xe=Ne-f.offsetWidth)}f.style.top=Z+"px",f.style.left=f.style.right="",U=="right"?(xe=z.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(U=="left"?xe=0:U=="middle"&&(xe=(z.sizer.clientWidth-f.offsetWidth)/2),f.style.left=xe+"px"),m&&Cd(this,{left:xe,top:Z,right:xe+f.offsetWidth,bottom:Z+f.offsetHeight})},triggerOnKeyDown:Lr(ic),triggerOnKeyPress:Lr(ac),triggerOnKeyUp:oc,triggerOnMouseDown:Lr(hl),execCommand:function(l){if(Di.hasOwnProperty(l))return Di[l].call(null,this)},triggerElectric:Lr(function(l){va(this,l)}),findPosH:function(l,f,m,F){var U=1;f<0&&(U=-1,f=-f);for(var z=st(this.doc,l),Z=0;Z<f&&(z=bl(this.doc,z,U,m,F),!z.hitSide);++Z);return z},moveH:Lr(function(l,f){var m=this;this.extendSelectionsBy(function(F){return m.display.shift||m.doc.extend||F.empty()?bl(m.doc,F.head,l,f,m.options.rtlMoveVisually):l<0?F.from():F.to()},mt)}),deleteH:Lr(function(l,f){var m=this.doc.sel,F=this.doc;m.somethingSelected()?F.replaceSelection("",null,"+delete"):ao(this,function(U){var z=bl(F,U.head,l,f,!1);return l<0?{from:z,to:U.head}:{from:U.head,to:z}})}),findPosV:function(l,f,m,F){var U=1,z=F;f<0&&(U=-1,f=-f);for(var Z=st(this.doc,l),xe=0;xe<f;++xe){var Ee=qr(this,Z,"div");if(z==null?z=Ee.left:Ee.left=z,Z=Vu(this,Ee,U,m),Z.hitSide)break}return Z},moveV:Lr(function(l,f){var m=this,F=this.doc,U=[],z=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(xe){if(z)return l<0?xe.from():xe.to();var Ee=qr(m,xe.head,"div");xe.goalColumn!=null&&(Ee.left=xe.goalColumn),U.push(Ee.left);var Ne=Vu(m,Ee,l,f);return f=="page"&&xe==F.sel.primary()&&sn(m,La(m,Ne,"div").top-Ee.top),Ne},mt),U.length)for(var Z=0;Z<F.sel.ranges.length;Z++)F.sel.ranges[Z].goalColumn=U[Z]}),findWordAt:function(l){var f=this.doc,m=Et(f,l.line).text,F=l.ch,U=l.ch;if(m){var z=this.getHelper(l,"wordChars");(l.sticky=="before"||U==m.length)&&F?--F:++U;for(var Z=m.charAt(F),xe=G(Z,z)?function(Ee){return G(Ee,z)}:/\s/.test(Z)?function(Ee){return/\s/.test(Ee)}:function(Ee){return!/\s/.test(Ee)&&!G(Ee)};F>0&&xe(m.charAt(F-1));)--F;for(;U<m.length&&xe(m.charAt(U));)++U}return new _t(nt(l.line,F),nt(l.line,U))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ve(this.display.cursorDiv,"CodeMirror-overwrite"):te(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==De()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Lr(function(l,f){mn(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Xn(this)-this.display.barHeight,width:l.scrollWidth-Xn(this)-this.display.barWidth,clientHeight:Ra(this),clientWidth:vn(this)}},scrollIntoView:Lr(function(l,f){l==null?(l={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof l=="number"?l={from:nt(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=f||0,l.from.line!=null?Hf(this,l):ea(this,l.from,l.to,l.margin)}),setSize:Lr(function(l,f){var m=this,F=function(z){return typeof z=="number"||/^\d+$/.test(String(z))?z+"px":z};l!=null&&(this.display.wrapper.style.width=F(l)),f!=null&&(this.display.wrapper.style.height=F(f)),this.options.lineWrapping&&Ls(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(z){if(z.widgets){for(var Z=0;Z<z.widgets.length;Z++)if(z.widgets[Z].noHScroll){Ei(m,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(l){return Yr(this,l)},startOperation:function(){return Ti(this)},endOperation:function(){return Pi(this)},refresh:Lr(function(){var l=this.display.cachedTextHeight;$r(this),this.curOp.forceUpdate=!0,Jo(this),mn(this,this.doc.scrollLeft,this.doc.scrollTop),un(this.display),(l==null||Math.abs(l-mo(this.display))>.5||this.options.lineWrapping)&&_o(this),Oe(this,"refresh",this)}),swapDoc:Lr(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Ze(this,l),Jo(this),this.display.input.reset(),mn(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Wr(this,"swapDoc",this,f),f}),phrase:function(l){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,l)?f[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},He(e),e.registerHelper=function(l,f,m){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][f]=m},e.registerGlobalHelper=function(l,f,m,F){e.registerHelper(l,f,F),u[l]._global.push({pred:m,val:F})}}function bl(e,n,u,l,f){var m=n,F=u,U=Et(e,n.line),z=f&&e.direction=="rtl"?-u:u;function Z(){var ht=n.line+z;return ht<e.first||ht>=e.first+e.size?!1:(n=new nt(ht,n.ch,n.sticky),U=Et(e,ht))}function xe(ht){var ct;if(l=="codepoint"){var bt=U.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(bt))ct=null;else{var Pt=u>0?bt>=55296&&bt<56320:bt>=56320&&bt<57343;ct=new nt(n.line,Math.max(0,Math.min(U.text.length,n.ch+u*(Pt?2:1))),-u)}}else f?ct=tc(e.cm,U,n,u):ct=ts(U,n,u);if(ct==null)if(!ht&&Z())n=dl(f,e.cm,U,n.line,z);else return!1;else n=ct;return!0}if(l=="char"||l=="codepoint")xe();else if(l=="column")xe(!0);else if(l=="word"||l=="group")for(var Ee=null,Ne=l=="group",Me=e.cm&&e.cm.getHelper(n,"wordChars"),Ye=!0;!(u<0&&!xe(!Ye));Ye=!1){var tt=U.text.charAt(n.ch)||`
32
+ `)&&(Ye=tt=nt(Ye.line,0)));var at={from:Ye,to:tt,text:Z?Z[Ne%Z.length]:z,origin:f||(U?"paste":e.state.cutIncoming>F?"cut":"+input")};Mi(e.doc,at),Wr(e,"inputRead",e,at)}n&&!U&&va(e,n),yn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ee),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ju(e,n){var u=e.clipboardData&&e.clipboardData.getData("Text");if(u)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Yr(n,function(){return vl(n,u,0,null,"paste")}),!0}function va(e,n){if(!(!e.options.electricChars||!e.options.smartIndent))for(var u=e.doc.sel,l=u.ranges.length-1;l>=0;l--){var f=u.ranges[l];if(!(f.head.ch>100||l&&u.ranges[l-1].head.line==f.head.line)){var m=e.getModeAt(f.head),F=!1;if(m.electricChars){for(var U=0;U<m.electricChars.length;U++)if(n.indexOf(m.electricChars.charAt(U))>-1){F=No(e,f.head.line,"smart");break}}else m.electricInput&&m.electricInput.test(Et(e.doc,f.head.line).text.slice(0,f.head.ch))&&(F=No(e,f.head.line,"smart"));F&&Wr(e,"electricInput",e,f.head.line)}}}function gl(e){for(var n=[],u=[],l=0;l<e.doc.sel.ranges.length;l++){var f=e.doc.sel.ranges[l].head.line,m={anchor:nt(f,0),head:nt(f+1,0)};u.push(m),n.push(e.getRange(m.anchor,m.head))}return{text:n,ranges:u}}function yl(e,n,u,l){e.setAttribute("autocorrect",u?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function ml(){var e=ve("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),n=ve("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),R&&(e.style.border="1px solid black"),yl(e),n}function dc(e){var n=e.optionHandlers,u=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,f){var m=this.options,F=m[l];m[l]==f&&l!="mode"||(m[l]=f,n.hasOwnProperty(l)&&xr(this,n[l])(this,f,F),Oe(this,"optionChange",this,l))},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,f){this.state.keyMaps[f?"push":"unshift"](fa(l))},removeKeyMap:function(l){for(var f=this.state.keyMaps,m=0;m<f.length;++m)if(f[m]==l||f[m].name==l)return f.splice(m,1),!0},addOverlay:Lr(function(l,f){var m=l.token?l:e.getMode(this.options,l);if(m.startState)throw new Error("Overlays may not be stateful.");Nt(this.state.overlays,{mode:m,modeSpec:l,opaque:f&&f.opaque,priority:f&&f.priority||0},function(F){return F.priority}),this.state.modeGen++,$r(this)}),removeOverlay:Lr(function(l){for(var f=this.state.overlays,m=0;m<f.length;++m){var F=f[m].modeSpec;if(F==l||typeof l=="string"&&F.name==l){f.splice(m,1),this.state.modeGen++,$r(this);return}}}),indentLine:Lr(function(l,f,m){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Jn(this.doc,l)&&No(this,l,f,m)}),indentSelection:Lr(function(l){for(var f=this.doc.sel.ranges,m=-1,F=0;F<f.length;F++){var U=f[F];if(U.empty())U.head.line>m&&(No(this,U.head.line,l,!0),m=U.head.line,F==this.doc.sel.primIndex&&yn(this));else{var z=U.from(),Z=U.to(),xe=Math.max(m,z.line);m=Math.min(this.lastLine(),Z.line-(Z.ch?0:1))+1;for(var Ee=xe;Ee<m;++Ee)No(this,Ee,l);var Ne=this.doc.sel.ranges;z.ch==0&&f.length==Ne.length&&Ne[F].from().ch>0&&tn(this.doc,F,new _t(z,Ne[F].to()),lt)}}}),getTokenAt:function(l,f){return bs(this,l,f)},getLineTokens:function(l,f){return bs(this,nt(l),f,!0)},getTokenTypeAt:function(l){l=st(this.doc,l);var f=Bl(this,Et(this.doc,l.line)),m=0,F=(f.length-1)/2,U=l.ch,z;if(U==0)z=f[2];else for(;;){var Z=m+F>>1;if((Z?f[Z*2-1]:0)>=U)F=Z;else if(f[Z*2+1]<U)m=Z+1;else{z=f[Z*2+2];break}}var xe=z?z.indexOf("overlay "):-1;return xe<0?z:xe==0?null:z.slice(0,xe-1)},getModeAt:function(l){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(l).state).mode:f},getHelper:function(l,f){return this.getHelpers(l,f)[0]},getHelpers:function(l,f){var m=[];if(!u.hasOwnProperty(f))return m;var F=u[f],U=this.getModeAt(l);if(typeof U[f]=="string")F[U[f]]&&m.push(F[U[f]]);else if(U[f])for(var z=0;z<U[f].length;z++){var Z=F[U[f][z]];Z&&m.push(Z)}else U.helperType&&F[U.helperType]?m.push(F[U.helperType]):F[U.name]&&m.push(F[U.name]);for(var xe=0;xe<F._global.length;xe++){var Ee=F._global[xe];Ee.pred(U,this)&&pt(m,Ee.val)==-1&&m.push(Ee.val)}return m},getStateAfter:function(l,f){var m=this.doc;return l=ot(m,l==null?m.first+m.size-1:l),_r(this,l+1,f).state},cursorCoords:function(l,f){var m,F=this.doc.sel.primary();return l==null?m=F.head:typeof l=="object"?m=st(this.doc,l):m=l?F.from():F.to(),qr(this,m,f||"page")},charCoords:function(l,f){return La(this,st(this.doc,l),f||"page")},coordsChar:function(l,f){return l=Bs(this,l,f||"page"),Qi(this,l.left,l.top)},lineAtHeight:function(l,f){return l=Bs(this,{top:l,left:0},f||"page").top,Un(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,f,m){var F=!1,U;if(typeof l=="number"){var z=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>z&&(l=z,F=!0),U=Et(this.doc,l)}else U=l;return Ma(this,U,{top:0,left:0},f||"page",m||F).top+(F?this.doc.height-ri(U):0)},defaultTextHeight:function(){return mo(this.display)},defaultCharWidth:function(){return xo(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,f,m,F,U){var z=this.display;l=qr(this,st(this.doc,l));var Z=l.bottom,xe=l.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),z.sizer.appendChild(f),F=="over")Z=l.top;else if(F=="above"||F=="near"){var Ee=Math.max(z.wrapper.clientHeight,this.doc.height),Ne=Math.max(z.sizer.clientWidth,z.lineSpace.clientWidth);(F=="above"||l.bottom+f.offsetHeight>Ee)&&l.top>f.offsetHeight?Z=l.top-f.offsetHeight:l.bottom+f.offsetHeight<=Ee&&(Z=l.bottom),xe+f.offsetWidth>Ne&&(xe=Ne-f.offsetWidth)}f.style.top=Z+"px",f.style.left=f.style.right="",U=="right"?(xe=z.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(U=="left"?xe=0:U=="middle"&&(xe=(z.sizer.clientWidth-f.offsetWidth)/2),f.style.left=xe+"px"),m&&Cd(this,{left:xe,top:Z,right:xe+f.offsetWidth,bottom:Z+f.offsetHeight})},triggerOnKeyDown:Lr(ic),triggerOnKeyPress:Lr(ac),triggerOnKeyUp:oc,triggerOnMouseDown:Lr(pl),execCommand:function(l){if(Di.hasOwnProperty(l))return Di[l].call(null,this)},triggerElectric:Lr(function(l){va(this,l)}),findPosH:function(l,f,m,F){var U=1;f<0&&(U=-1,f=-f);for(var z=st(this.doc,l),Z=0;Z<f&&(z=xl(this.doc,z,U,m,F),!z.hitSide);++Z);return z},moveH:Lr(function(l,f){var m=this;this.extendSelectionsBy(function(F){return m.display.shift||m.doc.extend||F.empty()?xl(m.doc,F.head,l,f,m.options.rtlMoveVisually):l<0?F.from():F.to()},mt)}),deleteH:Lr(function(l,f){var m=this.doc.sel,F=this.doc;m.somethingSelected()?F.replaceSelection("",null,"+delete"):ao(this,function(U){var z=xl(F,U.head,l,f,!1);return l<0?{from:z,to:U.head}:{from:U.head,to:z}})}),findPosV:function(l,f,m,F){var U=1,z=F;f<0&&(U=-1,f=-f);for(var Z=st(this.doc,l),xe=0;xe<f;++xe){var Ee=qr(this,Z,"div");if(z==null?z=Ee.left:Ee.left=z,Z=Vu(this,Ee,U,m),Z.hitSide)break}return Z},moveV:Lr(function(l,f){var m=this,F=this.doc,U=[],z=!this.display.shift&&!F.extend&&F.sel.somethingSelected();if(F.extendSelectionsBy(function(xe){if(z)return l<0?xe.from():xe.to();var Ee=qr(m,xe.head,"div");xe.goalColumn!=null&&(Ee.left=xe.goalColumn),U.push(Ee.left);var Ne=Vu(m,Ee,l,f);return f=="page"&&xe==F.sel.primary()&&sn(m,La(m,Ne,"div").top-Ee.top),Ne},mt),U.length)for(var Z=0;Z<F.sel.ranges.length;Z++)F.sel.ranges[Z].goalColumn=U[Z]}),findWordAt:function(l){var f=this.doc,m=Et(f,l.line).text,F=l.ch,U=l.ch;if(m){var z=this.getHelper(l,"wordChars");(l.sticky=="before"||U==m.length)&&F?--F:++U;for(var Z=m.charAt(F),xe=G(Z,z)?function(Ee){return G(Ee,z)}:/\s/.test(Z)?function(Ee){return/\s/.test(Ee)}:function(Ee){return!/\s/.test(Ee)&&!G(Ee)};F>0&&xe(m.charAt(F-1));)--F;for(;U<m.length&&xe(m.charAt(U));)++U}return new _t(nt(l.line,F),nt(l.line,U))},toggleOverwrite:function(l){l!=null&&l==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ve(this.display.cursorDiv,"CodeMirror-overwrite"):te(this.display.cursorDiv,"CodeMirror-overwrite"),Oe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==De()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Lr(function(l,f){mn(this,l,f)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Xn(this)-this.display.barHeight,width:l.scrollWidth-Xn(this)-this.display.barWidth,clientHeight:Ra(this),clientWidth:vn(this)}},scrollIntoView:Lr(function(l,f){l==null?(l={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof l=="number"?l={from:nt(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=f||0,l.from.line!=null?Hf(this,l):ea(this,l.from,l.to,l.margin)}),setSize:Lr(function(l,f){var m=this,F=function(z){return typeof z=="number"||/^\d+$/.test(String(z))?z+"px":z};l!=null&&(this.display.wrapper.style.width=F(l)),f!=null&&(this.display.wrapper.style.height=F(f)),this.options.lineWrapping&&Ms(this);var U=this.display.viewFrom;this.doc.iter(U,this.display.viewTo,function(z){if(z.widgets){for(var Z=0;Z<z.widgets.length;Z++)if(z.widgets[Z].noHScroll){Ei(m,U,"widget");break}}++U}),this.curOp.forceUpdate=!0,Oe(this,"refresh",this)}),operation:function(l){return Yr(this,l)},startOperation:function(){return Ti(this)},endOperation:function(){return Pi(this)},refresh:Lr(function(){var l=this.display.cachedTextHeight;$r(this),this.curOp.forceUpdate=!0,Jo(this),mn(this,this.doc.scrollLeft,this.doc.scrollTop),un(this.display),(l==null||Math.abs(l-mo(this.display))>.5||this.options.lineWrapping)&&_o(this),Oe(this,"refresh",this)}),swapDoc:Lr(function(l){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Ze(this,l),Jo(this),this.display.input.reset(),mn(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Wr(this,"swapDoc",this,f),f}),phrase:function(l){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,l)?f[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},He(e),e.registerHelper=function(l,f,m){u.hasOwnProperty(l)||(u[l]=e[l]={_global:[]}),u[l][f]=m},e.registerGlobalHelper=function(l,f,m,F){e.registerHelper(l,f,F),u[l]._global.push({pred:m,val:F})}}function xl(e,n,u,l,f){var m=n,F=u,U=Et(e,n.line),z=f&&e.direction=="rtl"?-u:u;function Z(){var ht=n.line+z;return ht<e.first||ht>=e.first+e.size?!1:(n=new nt(ht,n.ch,n.sticky),U=Et(e,ht))}function xe(ht){var ct;if(l=="codepoint"){var bt=U.text.charCodeAt(n.ch+(u>0?0:-1));if(isNaN(bt))ct=null;else{var Pt=u>0?bt>=55296&&bt<56320:bt>=56320&&bt<57343;ct=new nt(n.line,Math.max(0,Math.min(U.text.length,n.ch+u*(Pt?2:1))),-u)}}else f?ct=tc(e.cm,U,n,u):ct=ts(U,n,u);if(ct==null)if(!ht&&Z())n=cl(f,e.cm,U,n.line,z);else return!1;else n=ct;return!0}if(l=="char"||l=="codepoint")xe();else if(l=="column")xe(!0);else if(l=="word"||l=="group")for(var Ee=null,Ne=l=="group",Me=e.cm&&e.cm.getHelper(n,"wordChars"),Ye=!0;!(u<0&&!xe(!Ye));Ye=!1){var tt=U.text.charAt(n.ch)||`
33
33
  `,at=G(tt,Me)?"w":Ne&&tt==`
34
- `?"n":!Ne||/\s/.test(tt)?null:"p";if(Ne&&!Ye&&!at&&(at="s"),Ee&&Ee!=at){u<0&&(u=1,xe(),n.sticky="after");break}if(at&&(Ee=at),u>0&&!xe(!Ye))break}var ft=Dr(e,n,m,F,!0);return ei(m,ft)&&(ft.hitSide=!0),ft}function Vu(e,n,u,l){var f=e.doc,m=n.left,F;if(l=="page"){var U=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),z=Math.max(U-.5*mo(e.display),3);F=(u>0?n.bottom:n.top)+u*z}else l=="line"&&(F=u>0?n.bottom+3:n.top-3);for(var Z;Z=Qi(e,m,F),!!Z.outside;){if(u<0?F<=0:F>=f.height){Z.hitSide=!0;break}F+=u*5}return Z}var nr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ut,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};nr.prototype.init=function(e){var n=this,u=this,l=u.cm,f=u.div=e.lineDiv;f.contentEditable=!0,ml(f,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function m(U){for(var z=U.target;z;z=z.parentNode){if(z==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(z.className))break}return!1}D(f,"paste",function(U){!m(U)||Pe(l,U)||ju(U,l)||A<=11&&setTimeout(xr(l,function(){return n.updateFromDOM()}),20)}),D(f,"compositionstart",function(U){n.composing={data:U.data,done:!1}}),D(f,"compositionupdate",function(U){n.composing||(n.composing={data:U.data,done:!1})}),D(f,"compositionend",function(U){n.composing&&(U.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),D(f,"touchstart",function(){return u.forceCompositionEnd()}),D(f,"input",function(){n.composing||n.readFromDOMSoon()});function F(U){if(!(!m(U)||Pe(l,U))){if(l.somethingSelected())ha({lineWise:!1,text:l.getSelections()}),U.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var z=yl(l);ha({lineWise:!0,text:z.text}),U.type=="cut"&&l.operation(function(){l.setSelections(z.ranges,0,lt),l.replaceSelection("",null,"cut")})}else return;if(U.clipboardData){U.clipboardData.clearData();var Z=Rn.text.join(`
35
- `);if(U.clipboardData.setData("Text",Z),U.clipboardData.getData("Text")==Z){U.preventDefault();return}}var xe=xl(),Ee=xe.firstChild;l.display.lineSpace.insertBefore(xe,l.display.lineSpace.firstChild),Ee.value=Rn.text.join(`
36
- `);var Ne=De();ke(Ee),setTimeout(function(){l.display.lineSpace.removeChild(xe),Ne.focus(),Ne==f&&u.showPrimarySelection()},50)}}D(f,"copy",F),D(f,"cut",F)},nr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},nr.prototype.prepareSelection=function(){var e=Bf(this.cm,!1);return e.focus=De()==this.div,e},nr.prototype.showSelection=function(e,n){!e||!this.cm.display.view.length||((e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e))},nr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},nr.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,u=n.doc.sel.primary(),l=u.from(),f=u.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||f.line<n.display.viewFrom){e.removeAllRanges();return}var m=ss(n,e.anchorNode,e.anchorOffset),F=ss(n,e.focusNode,e.focusOffset);if(!(m&&!m.bad&&F&&!F.bad&&Lt(_e(m,F),l)==0&&Lt(Ce(m,F),f)==0)){var U=n.display.view,z=l.line>=n.display.viewFrom&&Wu(n,l)||{node:U[0].measure.map[2],offset:0},Z=f.line<n.display.viewTo&&Wu(n,f);if(!Z){var xe=U[U.length-1].measure,Ee=xe.maps?xe.maps[xe.maps.length-1]:xe.map;Z={node:Ee[Ee.length-1],offset:Ee[Ee.length-2]-Ee[Ee.length-3]}}if(!z||!Z){e.removeAllRanges();return}var Ne=e.rangeCount&&e.getRangeAt(0),Me;try{Me=ue(z.node,z.offset,Z.offset,Z.node)}catch(Ye){}Me&&(!c&&n.state.focused?(e.collapse(z.node,z.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Ne&&e.anchorNode==null?e.addRange(Ne):c&&this.startGracePeriod()),this.rememberSelection()}},nr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},nr.prototype.showMultipleSelections=function(e){ye(this.cm.display.cursorDiv,e.cursors),ye(this.cm.display.selectionDiv,e.selection)},nr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},nr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return oe(this.div,n)},nr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||De()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},nr.prototype.blur=function(){this.div.blur()},nr.prototype.getField=function(){return this.div},nr.prototype.supportsTouch=function(){return!0},nr.prototype.receivedFocus=function(){var e=this,n=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Yr(this.cm,function(){return n.cm.curOp.selectionChanged=!0});function u(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,u))}this.polling.set(this.cm.options.pollInterval,u)},nr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},nr.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),n=this.cm;if(X&&N&&this.cm.display.gutterSpecs.length&&Hu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var u=ss(n,e.anchorNode,e.anchorOffset),l=ss(n,e.focusNode,e.focusOffset);u&&l&&Yr(n,function(){rr(n.doc,si(u,l),lt),(u.bad||l.bad)&&(n.curOp.selectionChanged=!0)})}}},nr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,u=e.doc.sel.primary(),l=u.from(),f=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=nt(l.line-1,Et(e.doc,l.line-1).length)),f.ch==Et(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=nt(f.line+1,0)),l.line<n.viewFrom||f.line>n.viewTo-1)return!1;var m,F,U;l.line==n.viewFrom||(m=Ai(e,l.line))==0?(F=qt(n.view[0].line),U=n.view[0].node):(F=qt(n.view[m].line),U=n.view[m-1].node.nextSibling);var z=Ai(e,f.line),Z,xe;if(z==n.view.length-1?(Z=n.viewTo-1,xe=n.lineDiv.lastChild):(Z=qt(n.view[z+1].line)-1,xe=n.view[z+1].node.previousSibling),!U)return!1;for(var Ee=e.doc.splitLines(pc(e,U,xe,F,Z)),Ne=qn(e.doc,nt(F,0),nt(Z,Et(e.doc,Z).text.length));Ee.length>1&&Ne.length>1;)if(At(Ee)==At(Ne))Ee.pop(),Ne.pop(),Z--;else if(Ee[0]==Ne[0])Ee.shift(),Ne.shift(),F++;else break;for(var Me=0,Ye=0,tt=Ee[0],at=Ne[0],ft=Math.min(tt.length,at.length);Me<ft&&tt.charCodeAt(Me)==at.charCodeAt(Me);)++Me;for(var ht=At(Ee),ct=At(Ne),bt=Math.min(ht.length-(Ee.length==1?Me:0),ct.length-(Ne.length==1?Me:0));Ye<bt&&ht.charCodeAt(ht.length-Ye-1)==ct.charCodeAt(ct.length-Ye-1);)++Ye;if(Ee.length==1&&Ne.length==1&&F==l.line)for(;Me&&Me>l.ch&&ht.charCodeAt(ht.length-Ye-1)==ct.charCodeAt(ct.length-Ye-1);)Me--,Ye++;Ee[Ee.length-1]=ht.slice(0,ht.length-Ye).replace(/^\u200b+/,""),Ee[0]=Ee[0].slice(Me).replace(/\u200b+$/,"");var Pt=nt(F,Me),Ot=nt(Z,Ne.length?At(Ne).length-Ye:0);if(Ee.length>1||Ee[0]||Lt(Pt,Ot))return Fo(e.doc,Ee,Pt,Ot,"+input"),!0},nr.prototype.ensurePolled=function(){this.forceCompositionEnd()},nr.prototype.reset=function(){this.forceCompositionEnd()},nr.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},nr.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},nr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Yr(this.cm,function(){return $r(e.cm)})},nr.prototype.setUneditable=function(e){e.contentEditable="false"},nr.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||xr(this.cm,gl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},nr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},nr.prototype.onContextMenu=function(){},nr.prototype.resetPosition=function(){},nr.prototype.needsContentAttribute=!0;function Wu(e,n){var u=Rs(e,n.line);if(!u||u.hidden)return null;var l=Et(e.doc,n.line),f=eu(u,l,n.line),m=P(l,e.doc.direction),F="left";if(m){var U=W(m,n.ch);F=U%2?"right":"left"}var z=nu(f.map,n.ch,F);return z.offset=z.collapse=="right"?z.end:z.start,z}function Hu(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function so(e,n){return n&&(e.bad=!0),e}function pc(e,n,u,l,f){var m="",F=!1,U=e.doc.lineSeparator(),z=!1;function Z(Me){return function(Ye){return Ye.id==Me}}function xe(){F&&(m+=U,z&&(m+=U),F=z=!1)}function Ee(Me){Me&&(xe(),m+=Me)}function Ne(Me){if(Me.nodeType==1){var Ye=Me.getAttribute("cm-text");if(Ye){Ee(Ye);return}var tt=Me.getAttribute("cm-marker"),at;if(tt){var ft=e.findMarks(nt(l,0),nt(f+1,0),Z(+tt));ft.length&&(at=ft[0].find(0))&&Ee(qn(e.doc,at.from,at.to).join(U));return}if(Me.getAttribute("contenteditable")=="false")return;var ht=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;ht&&xe();for(var ct=0;ct<Me.childNodes.length;ct++)Ne(Me.childNodes[ct]);/^(pre|p)$/i.test(Me.nodeName)&&(z=!0),ht&&(F=!0)}else Me.nodeType==3&&Ee(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ne(n),n!=u;)n=n.nextSibling,z=!1;return m}function ss(e,n,u){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return so(e.clipPos(nt(e.display.viewTo-1)),!0);n=null,u=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var m=e.display.view[f];if(m.node==l)return hc(m,n,u)}}function hc(e,n,u){var l=e.text.firstChild,f=!1;if(!n||!oe(l,n))return so(nt(qt(e.line),0),!0);if(n==l&&(f=!0,n=l.childNodes[u],u=0,!n)){var m=e.rest?At(e.rest):e.line;return so(nt(qt(m),m.text.length),f)}var F=n.nodeType==3?n:null,U=n;for(!F&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(F=n.firstChild,u&&(u=F.nodeValue.length));U.parentNode!=l;)U=U.parentNode;var z=e.measure,Z=z.maps;function xe(at,ft,ht){for(var ct=-1;ct<(Z?Z.length:0);ct++)for(var bt=ct<0?z.map:Z[ct],Pt=0;Pt<bt.length;Pt+=3){var Ot=bt[Pt+2];if(Ot==at||Ot==ft){var Ut=qt(ct<0?e.line:e.rest[ct]),ar=bt[Pt]+ht;return(ht<0||Ot!=at)&&(ar=bt[Pt+(ht?1:0)]),nt(Ut,ar)}}}var Ee=xe(F,U,u);if(Ee)return so(Ee,f);for(var Ne=U.nextSibling,Me=F?F.nodeValue.length-u:0;Ne;Ne=Ne.nextSibling){if(Ee=xe(Ne,Ne.firstChild,0),Ee)return so(nt(Ee.line,Ee.ch-Me),f);Me+=Ne.textContent.length}for(var Ye=U.previousSibling,tt=u;Ye;Ye=Ye.previousSibling){if(Ee=xe(Ye,Ye.firstChild,-1),Ee)return so(nt(Ee.line,Ee.ch+tt),f);tt+=Ye.textContent.length}}var pr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ut,this.hasSelection=!1,this.composing=null};pr.prototype.init=function(e){var n=this,u=this,l=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),R&&(f.style.width="0px"),D(f,"input",function(){b&&A>=9&&n.hasSelection&&(n.hasSelection=null),u.poll()}),D(f,"paste",function(F){Pe(l,F)||ju(F,l)||(l.state.pasteIncoming=+new Date,u.fastPoll())});function m(F){if(!Pe(l,F)){if(l.somethingSelected())ha({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var U=yl(l);ha({lineWise:!0,text:U.text}),F.type=="cut"?l.setSelections(U.ranges,null,lt):(u.prevInput="",f.value=U.text.join(`
37
- `),ke(f))}else return;F.type=="cut"&&(l.state.cutIncoming=+new Date)}}D(f,"cut",m),D(f,"copy",m),D(e.scroller,"paste",function(F){if(!(ni(e,F)||Pe(l,F))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var U=new Event("paste");U.clipboardData=F.clipboardData,f.dispatchEvent(U)}}),D(e.lineSpace,"selectstart",function(F){ni(e,F)||it(F)}),D(f,"compositionstart",function(){var F=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:F,range:l.markText(F,l.getCursor("to"),{className:"CodeMirror-composing"})}}),D(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},pr.prototype.createField=function(e){this.wrapper=xl(),this.textarea=this.wrapper.firstChild},pr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},pr.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l=Bf(e);if(e.options.moveInputWithCursor){var f=qr(e,u.sel.primary().head,"div"),m=n.wrapper.getBoundingClientRect(),F=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,f.top+F.top-m.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,f.left+F.left-m.left))}return l},pr.prototype.showSelection=function(e){var n=this.cm,u=n.display;ye(u.cursorDiv,e.cursors),ye(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},pr.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var n=this.cm;if(n.somethingSelected()){this.prevInput="";var u=n.getSelection();this.textarea.value=u,n.state.focused&&ke(this.textarea),b&&A>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",b&&A>=9&&(this.hasSelection=null))}},pr.prototype.getField=function(){return this.textarea},pr.prototype.supportsTouch=function(){return!1},pr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||De()!=this.textarea))try{this.textarea.focus()}catch(e){}},pr.prototype.blur=function(){this.textarea.blur()},pr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},pr.prototype.receivedFocus=function(){this.slowPoll()},pr.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},pr.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function u(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,u)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,u)},pr.prototype.poll=function(){var e=this,n=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||Tn(u)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var f=u.value;if(f==l&&!n.somethingSelected())return!1;if(b&&A>=9&&this.hasSelection===f||C&&/[\uf700-\uf7ff]/.test(f))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var m=f.charCodeAt(0);if(m==8203&&!l&&(l="\u200B"),m==8666)return this.reset(),this.cm.execCommand("undo")}for(var F=0,U=Math.min(l.length,f.length);F<U&&l.charCodeAt(F)==f.charCodeAt(F);)++F;return Yr(n,function(){gl(n,f.slice(F),l.length-F,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
34
+ `?"n":!Ne||/\s/.test(tt)?null:"p";if(Ne&&!Ye&&!at&&(at="s"),Ee&&Ee!=at){u<0&&(u=1,xe(),n.sticky="after");break}if(at&&(Ee=at),u>0&&!xe(!Ye))break}var ft=Dr(e,n,m,F,!0);return ei(m,ft)&&(ft.hitSide=!0),ft}function Vu(e,n,u,l){var f=e.doc,m=n.left,F;if(l=="page"){var U=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),z=Math.max(U-.5*mo(e.display),3);F=(u>0?n.bottom:n.top)+u*z}else l=="line"&&(F=u>0?n.bottom+3:n.top-3);for(var Z;Z=Qi(e,m,F),!!Z.outside;){if(u<0?F<=0:F>=f.height){Z.hitSide=!0;break}F+=u*5}return Z}var nr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ut,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};nr.prototype.init=function(e){var n=this,u=this,l=u.cm,f=u.div=e.lineDiv;f.contentEditable=!0,yl(f,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function m(U){for(var z=U.target;z;z=z.parentNode){if(z==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(z.className))break}return!1}D(f,"paste",function(U){!m(U)||Pe(l,U)||ju(U,l)||A<=11&&setTimeout(xr(l,function(){return n.updateFromDOM()}),20)}),D(f,"compositionstart",function(U){n.composing={data:U.data,done:!1}}),D(f,"compositionupdate",function(U){n.composing||(n.composing={data:U.data,done:!1})}),D(f,"compositionend",function(U){n.composing&&(U.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),D(f,"touchstart",function(){return u.forceCompositionEnd()}),D(f,"input",function(){n.composing||n.readFromDOMSoon()});function F(U){if(!(!m(U)||Pe(l,U))){if(l.somethingSelected())ha({lineWise:!1,text:l.getSelections()}),U.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var z=gl(l);ha({lineWise:!0,text:z.text}),U.type=="cut"&&l.operation(function(){l.setSelections(z.ranges,0,lt),l.replaceSelection("",null,"cut")})}else return;if(U.clipboardData){U.clipboardData.clearData();var Z=Rn.text.join(`
35
+ `);if(U.clipboardData.setData("Text",Z),U.clipboardData.getData("Text")==Z){U.preventDefault();return}}var xe=ml(),Ee=xe.firstChild;l.display.lineSpace.insertBefore(xe,l.display.lineSpace.firstChild),Ee.value=Rn.text.join(`
36
+ `);var Ne=De();ke(Ee),setTimeout(function(){l.display.lineSpace.removeChild(xe),Ne.focus(),Ne==f&&u.showPrimarySelection()},50)}}D(f,"copy",F),D(f,"cut",F)},nr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},nr.prototype.prepareSelection=function(){var e=Bf(this.cm,!1);return e.focus=De()==this.div,e},nr.prototype.showSelection=function(e,n){!e||!this.cm.display.view.length||((e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e))},nr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},nr.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,u=n.doc.sel.primary(),l=u.from(),f=u.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||f.line<n.display.viewFrom){e.removeAllRanges();return}var m=ss(n,e.anchorNode,e.anchorOffset),F=ss(n,e.focusNode,e.focusOffset);if(!(m&&!m.bad&&F&&!F.bad&&Lt(_e(m,F),l)==0&&Lt(Ce(m,F),f)==0)){var U=n.display.view,z=l.line>=n.display.viewFrom&&Wu(n,l)||{node:U[0].measure.map[2],offset:0},Z=f.line<n.display.viewTo&&Wu(n,f);if(!Z){var xe=U[U.length-1].measure,Ee=xe.maps?xe.maps[xe.maps.length-1]:xe.map;Z={node:Ee[Ee.length-1],offset:Ee[Ee.length-2]-Ee[Ee.length-3]}}if(!z||!Z){e.removeAllRanges();return}var Ne=e.rangeCount&&e.getRangeAt(0),Me;try{Me=ue(z.node,z.offset,Z.offset,Z.node)}catch(Ye){}Me&&(!c&&n.state.focused?(e.collapse(z.node,z.offset),Me.collapsed||(e.removeAllRanges(),e.addRange(Me))):(e.removeAllRanges(),e.addRange(Me)),Ne&&e.anchorNode==null?e.addRange(Ne):c&&this.startGracePeriod()),this.rememberSelection()}},nr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},nr.prototype.showMultipleSelections=function(e){ye(this.cm.display.cursorDiv,e.cursors),ye(this.cm.display.selectionDiv,e.selection)},nr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},nr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return oe(this.div,n)},nr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||De()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},nr.prototype.blur=function(){this.div.blur()},nr.prototype.getField=function(){return this.div},nr.prototype.supportsTouch=function(){return!0},nr.prototype.receivedFocus=function(){var e=this,n=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Yr(this.cm,function(){return n.cm.curOp.selectionChanged=!0});function u(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,u))}this.polling.set(this.cm.options.pollInterval,u)},nr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},nr.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),n=this.cm;if(X&&N&&this.cm.display.gutterSpecs.length&&Hu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var u=ss(n,e.anchorNode,e.anchorOffset),l=ss(n,e.focusNode,e.focusOffset);u&&l&&Yr(n,function(){rr(n.doc,si(u,l),lt),(u.bad||l.bad)&&(n.curOp.selectionChanged=!0)})}}},nr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,u=e.doc.sel.primary(),l=u.from(),f=u.to();if(l.ch==0&&l.line>e.firstLine()&&(l=nt(l.line-1,Et(e.doc,l.line-1).length)),f.ch==Et(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=nt(f.line+1,0)),l.line<n.viewFrom||f.line>n.viewTo-1)return!1;var m,F,U;l.line==n.viewFrom||(m=Ai(e,l.line))==0?(F=qt(n.view[0].line),U=n.view[0].node):(F=qt(n.view[m].line),U=n.view[m-1].node.nextSibling);var z=Ai(e,f.line),Z,xe;if(z==n.view.length-1?(Z=n.viewTo-1,xe=n.lineDiv.lastChild):(Z=qt(n.view[z+1].line)-1,xe=n.view[z+1].node.previousSibling),!U)return!1;for(var Ee=e.doc.splitLines(pc(e,U,xe,F,Z)),Ne=qn(e.doc,nt(F,0),nt(Z,Et(e.doc,Z).text.length));Ee.length>1&&Ne.length>1;)if(At(Ee)==At(Ne))Ee.pop(),Ne.pop(),Z--;else if(Ee[0]==Ne[0])Ee.shift(),Ne.shift(),F++;else break;for(var Me=0,Ye=0,tt=Ee[0],at=Ne[0],ft=Math.min(tt.length,at.length);Me<ft&&tt.charCodeAt(Me)==at.charCodeAt(Me);)++Me;for(var ht=At(Ee),ct=At(Ne),bt=Math.min(ht.length-(Ee.length==1?Me:0),ct.length-(Ne.length==1?Me:0));Ye<bt&&ht.charCodeAt(ht.length-Ye-1)==ct.charCodeAt(ct.length-Ye-1);)++Ye;if(Ee.length==1&&Ne.length==1&&F==l.line)for(;Me&&Me>l.ch&&ht.charCodeAt(ht.length-Ye-1)==ct.charCodeAt(ct.length-Ye-1);)Me--,Ye++;Ee[Ee.length-1]=ht.slice(0,ht.length-Ye).replace(/^\u200b+/,""),Ee[0]=Ee[0].slice(Me).replace(/\u200b+$/,"");var Pt=nt(F,Me),Ot=nt(Z,Ne.length?At(Ne).length-Ye:0);if(Ee.length>1||Ee[0]||Lt(Pt,Ot))return Fo(e.doc,Ee,Pt,Ot,"+input"),!0},nr.prototype.ensurePolled=function(){this.forceCompositionEnd()},nr.prototype.reset=function(){this.forceCompositionEnd()},nr.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},nr.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},nr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Yr(this.cm,function(){return $r(e.cm)})},nr.prototype.setUneditable=function(e){e.contentEditable="false"},nr.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||xr(this.cm,vl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},nr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},nr.prototype.onContextMenu=function(){},nr.prototype.resetPosition=function(){},nr.prototype.needsContentAttribute=!0;function Wu(e,n){var u=ks(e,n.line);if(!u||u.hidden)return null;var l=Et(e.doc,n.line),f=eu(u,l,n.line),m=P(l,e.doc.direction),F="left";if(m){var U=W(m,n.ch);F=U%2?"right":"left"}var z=nu(f.map,n.ch,F);return z.offset=z.collapse=="right"?z.end:z.start,z}function Hu(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function so(e,n){return n&&(e.bad=!0),e}function pc(e,n,u,l,f){var m="",F=!1,U=e.doc.lineSeparator(),z=!1;function Z(Me){return function(Ye){return Ye.id==Me}}function xe(){F&&(m+=U,z&&(m+=U),F=z=!1)}function Ee(Me){Me&&(xe(),m+=Me)}function Ne(Me){if(Me.nodeType==1){var Ye=Me.getAttribute("cm-text");if(Ye){Ee(Ye);return}var tt=Me.getAttribute("cm-marker"),at;if(tt){var ft=e.findMarks(nt(l,0),nt(f+1,0),Z(+tt));ft.length&&(at=ft[0].find(0))&&Ee(qn(e.doc,at.from,at.to).join(U));return}if(Me.getAttribute("contenteditable")=="false")return;var ht=/^(pre|div|p|li|table|br)$/i.test(Me.nodeName);if(!/^br$/i.test(Me.nodeName)&&Me.textContent.length==0)return;ht&&xe();for(var ct=0;ct<Me.childNodes.length;ct++)Ne(Me.childNodes[ct]);/^(pre|p)$/i.test(Me.nodeName)&&(z=!0),ht&&(F=!0)}else Me.nodeType==3&&Ee(Me.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ne(n),n!=u;)n=n.nextSibling,z=!1;return m}function ss(e,n,u){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[u],!l)return so(e.clipPos(nt(e.display.viewTo-1)),!0);n=null,u=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var m=e.display.view[f];if(m.node==l)return hc(m,n,u)}}function hc(e,n,u){var l=e.text.firstChild,f=!1;if(!n||!oe(l,n))return so(nt(qt(e.line),0),!0);if(n==l&&(f=!0,n=l.childNodes[u],u=0,!n)){var m=e.rest?At(e.rest):e.line;return so(nt(qt(m),m.text.length),f)}var F=n.nodeType==3?n:null,U=n;for(!F&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(F=n.firstChild,u&&(u=F.nodeValue.length));U.parentNode!=l;)U=U.parentNode;var z=e.measure,Z=z.maps;function xe(at,ft,ht){for(var ct=-1;ct<(Z?Z.length:0);ct++)for(var bt=ct<0?z.map:Z[ct],Pt=0;Pt<bt.length;Pt+=3){var Ot=bt[Pt+2];if(Ot==at||Ot==ft){var Ut=qt(ct<0?e.line:e.rest[ct]),ar=bt[Pt]+ht;return(ht<0||Ot!=at)&&(ar=bt[Pt+(ht?1:0)]),nt(Ut,ar)}}}var Ee=xe(F,U,u);if(Ee)return so(Ee,f);for(var Ne=U.nextSibling,Me=F?F.nodeValue.length-u:0;Ne;Ne=Ne.nextSibling){if(Ee=xe(Ne,Ne.firstChild,0),Ee)return so(nt(Ee.line,Ee.ch-Me),f);Me+=Ne.textContent.length}for(var Ye=U.previousSibling,tt=u;Ye;Ye=Ye.previousSibling){if(Ee=xe(Ye,Ye.firstChild,-1),Ee)return so(nt(Ee.line,Ee.ch+tt),f);tt+=Ye.textContent.length}}var pr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ut,this.hasSelection=!1,this.composing=null};pr.prototype.init=function(e){var n=this,u=this,l=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),R&&(f.style.width="0px"),D(f,"input",function(){b&&A>=9&&n.hasSelection&&(n.hasSelection=null),u.poll()}),D(f,"paste",function(F){Pe(l,F)||ju(F,l)||(l.state.pasteIncoming=+new Date,u.fastPoll())});function m(F){if(!Pe(l,F)){if(l.somethingSelected())ha({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var U=gl(l);ha({lineWise:!0,text:U.text}),F.type=="cut"?l.setSelections(U.ranges,null,lt):(u.prevInput="",f.value=U.text.join(`
37
+ `),ke(f))}else return;F.type=="cut"&&(l.state.cutIncoming=+new Date)}}D(f,"cut",m),D(f,"copy",m),D(e.scroller,"paste",function(F){if(!(ni(e,F)||Pe(l,F))){if(!f.dispatchEvent){l.state.pasteIncoming=+new Date,u.focus();return}var U=new Event("paste");U.clipboardData=F.clipboardData,f.dispatchEvent(U)}}),D(e.lineSpace,"selectstart",function(F){ni(e,F)||it(F)}),D(f,"compositionstart",function(){var F=l.getCursor("from");u.composing&&u.composing.range.clear(),u.composing={start:F,range:l.markText(F,l.getCursor("to"),{className:"CodeMirror-composing"})}}),D(f,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})},pr.prototype.createField=function(e){this.wrapper=ml(),this.textarea=this.wrapper.firstChild},pr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},pr.prototype.prepareSelection=function(){var e=this.cm,n=e.display,u=e.doc,l=Bf(e);if(e.options.moveInputWithCursor){var f=qr(e,u.sel.primary().head,"div"),m=n.wrapper.getBoundingClientRect(),F=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,f.top+F.top-m.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,f.left+F.left-m.left))}return l},pr.prototype.showSelection=function(e){var n=this.cm,u=n.display;ye(u.cursorDiv,e.cursors),ye(u.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},pr.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var n=this.cm;if(n.somethingSelected()){this.prevInput="";var u=n.getSelection();this.textarea.value=u,n.state.focused&&ke(this.textarea),b&&A>=9&&(this.hasSelection=u)}else e||(this.prevInput=this.textarea.value="",b&&A>=9&&(this.hasSelection=null))}},pr.prototype.getField=function(){return this.textarea},pr.prototype.supportsTouch=function(){return!1},pr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||De()!=this.textarea))try{this.textarea.focus()}catch(e){}},pr.prototype.blur=function(){this.textarea.blur()},pr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},pr.prototype.receivedFocus=function(){this.slowPoll()},pr.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},pr.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function u(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,u)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,u)},pr.prototype.poll=function(){var e=this,n=this.cm,u=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||Tn(u)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var f=u.value;if(f==l&&!n.somethingSelected())return!1;if(b&&A>=9&&this.hasSelection===f||C&&/[\uf700-\uf7ff]/.test(f))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var m=f.charCodeAt(0);if(m==8203&&!l&&(l="\u200B"),m==8666)return this.reset(),this.cm.execCommand("undo")}for(var F=0,U=Math.min(l.length,f.length);F<U&&l.charCodeAt(F)==f.charCodeAt(F);)++F;return Yr(n,function(){vl(n,f.slice(F),l.length-F,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
38
38
  `)>-1?u.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},pr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},pr.prototype.onKeyPress=function(){b&&A>=9&&(this.hasSelection=null),this.fastPoll()},pr.prototype.onContextMenu=function(e){var n=this,u=n.cm,l=u.display,f=n.textarea;n.contextMenuPending&&n.contextMenuPending();var m=_i(u,e),F=l.scroller.scrollTop;if(!m||B)return;var U=u.options.resetSelectionOnContextMenu;U&&u.doc.sel.contains(m)==-1&&xr(u,rr)(u.doc,si(m),lt);var z=f.style.cssText,Z=n.wrapper.style.cssText,xe=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
39
39
  top: `+(e.clientY-xe.top-5)+"px; left: "+(e.clientX-xe.left-5)+`px;
40
40
  z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`;
41
- outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ee;g&&(Ee=window.scrollY),l.input.focus(),g&&window.scrollTo(null,Ee),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=Me,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ne(){if(f.selectionStart!=null){var tt=u.somethingSelected(),at="\u200B"+(tt?f.value:"");f.value="\u21DA",f.value=at,n.prevInput=tt?"":"\u200B",f.selectionStart=1,f.selectionEnd=at.length,l.selForContextMenu=u.doc.sel}}function Me(){if(n.contextMenuPending==Me&&(n.contextMenuPending=!1,n.wrapper.style.cssText=Z,f.style.cssText=z,b&&A<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=F),f.selectionStart!=null)){(!b||b&&A<9)&&Ne();var tt=0,at=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?xr(u,Za)(u):tt++<10?l.detectingSelectAll=setTimeout(at,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(at,200)}}if(b&&A>=9&&Ne(),Y){Jt(e);var Ye=function(){ce(window,"mouseup",Ye),setTimeout(Me,20)};D(window,"mouseup",Ye)}else setTimeout(Me,50)},pr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},pr.prototype.setUneditable=function(){},pr.prototype.needsContentAttribute=!1;function zu(e,n){if(n=n?Qe(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var u=De();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=U.getValue()}var f;if(e.form&&(D(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var m=e.form;f=m.submit;try{var F=m.submit=function(){l(),m.submit=f,m.submit(),m.submit=F}}catch(z){}}n.finishInit=function(z){z.save=l,z.getTextArea=function(){return e},z.toTextArea=function(){z.toTextArea=isNaN,l(),e.parentNode.removeChild(z.getWrapperElement()),e.style.display="",e.form&&(ce(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var U=cr(function(z){return e.parentNode.insertBefore(z,e.nextSibling)},n);return U}function Gu(e){e.off=ce,e.on=D,e.wheelEventPixels=fu,e.Doc=Vt,e.splitLines=$n,e.countColumn=Xe,e.findColumn=dt,e.isWordChar=pe,e.Pass=qe,e.signal=Oe,e.Line=Ji,e.changeEnd=li,e.scrollbarModel=Js,e.Pos=nt,e.cmpPos=Lt,e.modes=jo,e.mimeModes=Sn,e.resolveMode=$i,e.getMode=Bn,e.modeExtensions=mi,e.extendMode=Ta,e.copyState=Pn,e.startState=xi,e.innerMode=An,e.commands=Di,e.keyMap=di,e.keyName=Pu,e.isModifierKey=ua,e.lookupKey=Mo,e.normalizeKeyMap=Ou,e.StringStream=mr,e.SharedTextMarker=sa,e.TextMarker=Li,e.LineWidget=qa,e.e_preventDefault=it,e.e_stopPropagation=gt,e.e_stop=Jt,e.addClass=Ve,e.contains=oe,e.rmClass=te,e.keyNames=ci}Bu(cr),dc(cr);var $u="iter insert remove copy getEditor constructor".split(" ");for(var ls in Vt.prototype)Vt.prototype.hasOwnProperty(ls)&&pt($u,ls)<0&&(cr.prototype[ls]=function(e){return function(){return e.apply(this.doc,arguments)}}(Vt.prototype[ls]));return He(Vt),cr.inputStyles={textarea:pr,contenteditable:nr},cr.defineMode=function(e){!cr.defaults.mode&&e!="null"&&(cr.defaults.mode=e),Yn.apply(this,arguments)},cr.defineMIME=yi,cr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),cr.defineMIME("text/plain","null"),cr.defineExtension=function(e,n){cr.prototype[e]=n},cr.defineDocExtension=function(e,n){Vt.prototype[e]=n},cr.fromTextArea=zu,Gu(cr),cr.version="5.65.0",cr})},96876:(h,I,o)=>{(function(c){c(o(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,x){var d=v.indentUnit,b=x.statementIndent,A=x.jsonld,g=x.json||A,L=x.trackScope!==!1,N=x.typescript,B=x.wordCharacters||/[\w$\xa1-\uffff]/,j=function(){function se(Tr){return{type:Tr,style:"keyword"}}var Ce=se("keyword a"),_e=se("keyword b"),ot=se("keyword c"),st=se("keyword d"),Kt=se("operator"),Zt={type:"atom",style:"atom"};return{if:se("if"),while:Ce,with:Ce,else:_e,do:_e,try:_e,finally:_e,return:st,break:st,continue:st,new:se("new"),delete:ot,void:ot,throw:ot,debugger:se("debugger"),var:se("var"),const:se("var"),let:se("var"),function:se("function"),catch:se("catch"),for:se("for"),switch:se("switch"),case:se("case"),default:se("default"),in:Kt,typeof:Kt,instanceof:Kt,true:Zt,false:Zt,null:Zt,undefined:Zt,NaN:Zt,Infinity:Zt,this:se("this"),class:se("class"),super:se("atom"),yield:ot,export:se("export"),import:se("import"),extends:ot,await:ot}}(),_=/[+\-*&%=<>!?|~^@]/,H=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function R(se){for(var Ce=!1,_e,ot=!1;(_e=se.next())!=null;){if(!Ce){if(_e=="/"&&!ot)return;_e=="["?ot=!0:ot&&_e=="]"&&(ot=!1)}Ce=!Ce&&_e=="\\"}}var X,M;function C(se,Ce,_e){return X=se,M=_e,Ce}function V(se,Ce){var _e=se.next();if(_e=='"'||_e=="'")return Ce.tokenize=J(_e),Ce.tokenize(se,Ce);if(_e=="."&&se.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return C("number","number");if(_e=="."&&se.match(".."))return C("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(_e))return C(_e);if(_e=="="&&se.eat(">"))return C("=>","operator");if(_e=="0"&&se.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return C("number","number");if(/\d/.test(_e))return se.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),C("number","number");if(_e=="/")return se.eat("*")?(Ce.tokenize=q,q(se,Ce)):se.eat("/")?(se.skipToEnd(),C("comment","comment")):ei(se,Ce,1)?(R(se),se.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),C("regexp","string-2")):(se.eat("="),C("operator","operator",se.current()));if(_e=="`")return Ce.tokenize=Q,Q(se,Ce);if(_e=="#"&&se.peek()=="!")return se.skipToEnd(),C("meta","meta");if(_e=="#"&&se.eatWhile(B))return C("variable","property");if(_e=="<"&&se.match("!--")||_e=="-"&&se.match("->")&&!/\S/.test(se.string.slice(0,se.start)))return se.skipToEnd(),C("comment","comment");if(_.test(_e))return(_e!=">"||!Ce.lexical||Ce.lexical.type!=">")&&(se.eat("=")?(_e=="!"||_e=="=")&&se.eat("="):/[<>*+\-|&?]/.test(_e)&&(se.eat(_e),_e==">"&&se.eat(_e))),_e=="?"&&se.eat(".")?C("."):C("operator","operator",se.current());if(B.test(_e)){se.eatWhile(B);var ot=se.current();if(Ce.lastType!="."){if(j.propertyIsEnumerable(ot)){var st=j[ot];return C(st.type,st.style,ot)}if(ot=="async"&&se.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return C("async","keyword",ot)}return C("variable","variable",ot)}}function J(se){return function(Ce,_e){var ot=!1,st;if(A&&Ce.peek()=="@"&&Ce.match(H))return _e.tokenize=V,C("jsonld-keyword","meta");for(;(st=Ce.next())!=null&&!(st==se&&!ot);)ot=!ot&&st=="\\";return ot||(_e.tokenize=V),C("string","string")}}function q(se,Ce){for(var _e=!1,ot;ot=se.next();){if(ot=="/"&&_e){Ce.tokenize=V;break}_e=ot=="*"}return C("comment","comment")}function Q(se,Ce){for(var _e=!1,ot;(ot=se.next())!=null;){if(!_e&&(ot=="`"||ot=="$"&&se.eat("{"))){Ce.tokenize=V;break}_e=!_e&&ot=="\\"}return C("quasi","string-2",se.current())}var Y="([{}])";function fe(se,Ce){Ce.fatArrowAt&&(Ce.fatArrowAt=null);var _e=se.string.indexOf("=>",se.start);if(!(_e<0)){if(N){var ot=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(se.string.slice(se.start,_e));ot&&(_e=ot.index)}for(var st=0,Kt=!1,Zt=_e-1;Zt>=0;--Zt){var Tr=se.string.charAt(Zt),Pr=Y.indexOf(Tr);if(Pr>=0&&Pr<3){if(!st){++Zt;break}if(--st==0){Tr=="("&&(Kt=!0);break}}else if(Pr>=3&&Pr<6)++st;else if(B.test(Tr))Kt=!0;else if(/["'\/`]/.test(Tr))for(;;--Zt){if(Zt==0)return;var er=se.string.charAt(Zt-1);if(er==Tr&&se.string.charAt(Zt-2)!="\\"){Zt--;break}}else if(Kt&&!st){++Zt;break}}Kt&&!st&&(Ce.fatArrowAt=Zt)}}var te={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(se,Ce,_e,ot,st,Kt){this.indented=se,this.column=Ce,this.type=_e,this.prev=st,this.info=Kt,ot!=null&&(this.align=ot)}function ye(se,Ce){if(!L)return!1;for(var _e=se.localVars;_e;_e=_e.next)if(_e.name==Ce)return!0;for(var ot=se.context;ot;ot=ot.prev)for(var _e=ot.vars;_e;_e=_e.next)if(_e.name==Ce)return!0}function ve(se,Ce,_e,ot,st){var Kt=se.cc;for(de.state=se,de.stream=st,de.marked=null,de.cc=Kt,de.style=Ce,se.lexical.hasOwnProperty("align")||(se.lexical.align=!0);;){var Zt=Kt.length?Kt.pop():g?kt:mt;if(Zt(_e,ot)){for(;Kt.length&&Kt[Kt.length-1].lex;)Kt.pop()();return de.marked?de.marked:_e=="variable"&&ye(se,ot)?"variable-2":Ce}}}var de={state:null,column:null,marked:null,cc:null};function ue(){for(var se=arguments.length-1;se>=0;se--)de.cc.push(arguments[se])}function oe(){return ue.apply(null,arguments),!0}function De(se,Ce){for(var _e=Ce;_e;_e=_e.next)if(_e.name==se)return!0;return!1}function Ve(se){var Ce=de.state;if(de.marked="def",!!L){if(Ce.context){if(Ce.lexical.info=="var"&&Ce.context&&Ce.context.block){var _e=Le(se,Ce.context);if(_e!=null){Ce.context=_e;return}}else if(!De(se,Ce.localVars)){Ce.localVars=new Qe(se,Ce.localVars);return}}x.globalVars&&!De(se,Ce.globalVars)&&(Ce.globalVars=new Qe(se,Ce.globalVars))}}function Le(se,Ce){if(Ce)if(Ce.block){var _e=Le(se,Ce.prev);return _e?_e==Ce.prev?Ce:new rt(_e,Ce.vars,!0):null}else return De(se,Ce.vars)?Ce:new rt(Ce.prev,new Qe(se,Ce.vars),!1);else return null}function ke(se){return se=="public"||se=="private"||se=="protected"||se=="abstract"||se=="readonly"}function rt(se,Ce,_e){this.prev=se,this.vars=Ce,this.block=_e}function Qe(se,Ce){this.name=se,this.next=Ce}var Xe=new Qe("this",new Qe("arguments",null));function ut(){de.state.context=new rt(de.state.context,de.state.localVars,!1),de.state.localVars=Xe}function pt(){de.state.context=new rt(de.state.context,de.state.localVars,!0),de.state.localVars=null}function yt(){de.state.localVars=de.state.context.vars,de.state.context=de.state.context.prev}yt.lex=!0;function qe(se,Ce){var _e=function(){var ot=de.state,st=ot.indented;if(ot.lexical.type=="stat")st=ot.lexical.indented;else for(var Kt=ot.lexical;Kt&&Kt.type==")"&&Kt.align;Kt=Kt.prev)st=Kt.indented;ot.lexical=new ne(st,de.stream.column(),se,null,ot.lexical,Ce)};return _e.lex=!0,_e}function lt(){var se=de.state;se.lexical.prev&&(se.lexical.type==")"&&(se.indented=se.lexical.indented),se.lexical=se.lexical.prev)}lt.lex=!0;function vt(se){function Ce(_e){return _e==se?oe():se==";"||_e=="}"||_e==")"||_e=="]"?ue():oe(Ce)}return Ce}function mt(se,Ce){return se=="var"?oe(qe("vardef",Ce),Gi,vt(";"),lt):se=="keyword a"?oe(qe("form"),At,mt,lt):se=="keyword b"?oe(qe("form"),mt,lt):se=="keyword d"?de.stream.match(/^\s*$/,!1)?oe():oe(qe("stat"),Nt,vt(";"),lt):se=="debugger"?oe(vt(";")):se=="{"?oe(qe("}"),pt,D,lt,yt):se==";"?oe():se=="if"?(de.state.lexical.info=="else"&&de.state.cc[de.state.cc.length-1]==lt&&de.state.cc.pop()(),oe(qe("form"),At,mt,lt,pn)):se=="function"?oe(Yn):se=="for"?oe(qe("form"),pt,Oa,mt,yt,lt):se=="class"||N&&Ce=="interface"?(de.marked="keyword",oe(qe("form",se=="class"?se:Ce),Ta,lt)):se=="variable"?N&&Ce=="declare"?(de.marked="keyword",oe(mt)):N&&(Ce=="module"||Ce=="enum"||Ce=="type")&&de.stream.match(/^\s*\w/,!1)?(de.marked="keyword",Ce=="enum"?oe(po):Ce=="type"?oe($i,vt("operator"),Te,vt(";")):oe(qe("form"),jr,vt("{"),qe("}"),D,lt,lt)):N&&Ce=="namespace"?(de.marked="keyword",oe(qe("form"),kt,mt,lt)):N&&Ce=="abstract"?(de.marked="keyword",oe(mt)):oe(qe("stat"),Ae):se=="switch"?oe(qe("form"),At,vt("{"),qe("}","switch"),pt,D,lt,lt,yt):se=="case"?oe(kt,vt(":")):se=="default"?oe(vt(":")):se=="catch"?oe(qe("form"),ut,dt,mt,lt,yt):se=="export"?oe(qe("stat"),mr,lt):se=="import"?oe(qe("stat"),qn,lt):se=="async"?oe(mt):Ce=="@"?oe(kt,mt):ue(qe("stat"),kt,vt(";"),lt)}function dt(se){if(se=="(")return oe(Bn,vt(")"))}function kt(se,Ce){return jt(se,Ce,!1)}function It(se,Ce){return jt(se,Ce,!0)}function At(se){return se!="("?ue():oe(qe(")"),Nt,vt(")"),lt)}function jt(se,Ce,_e){if(de.state.fatArrowAt==de.stream.start){var ot=_e?K:G;if(se=="(")return oe(ut,qe(")"),P(Bn,")"),lt,vt("=>"),ot,yt);if(se=="variable")return ue(ut,jr,vt("=>"),ot,yt)}var st=_e?St:$t;return te.hasOwnProperty(se)?oe(st):se=="function"?oe(Yn,st):se=="class"||N&&Ce=="interface"?(de.marked="keyword",oe(qe("form"),mi,lt)):se=="keyword c"||se=="async"?oe(_e?It:kt):se=="("?oe(qe(")"),Nt,vt(")"),lt,st):se=="operator"||se=="spread"?oe(_e?It:kt):se=="["?oe(qe("]"),Jn,lt,st):se=="{"?ie(Ie,"}",null,st):se=="quasi"?ue(Mt,st):se=="new"?oe(we(_e)):oe()}function Nt(se){return se.match(/[;\}\)\],]/)?ue():ue(kt)}function $t(se,Ce){return se==","?oe(Nt):St(se,Ce,!1)}function St(se,Ce,_e){var ot=_e==!1?$t:St,st=_e==!1?kt:It;if(se=="=>")return oe(ut,_e?K:G,yt);if(se=="operator")return/\+\+|--/.test(Ce)||N&&Ce=="!"?oe(ot):N&&Ce=="<"&&de.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?oe(qe(">"),P(Te,">"),lt,ot):Ce=="?"?oe(kt,vt(":"),st):oe(st);if(se=="quasi")return ue(Mt,ot);if(se!=";"){if(se=="(")return ie(It,")","call",ot);if(se==".")return oe(T,ot);if(se=="[")return oe(qe("]"),Nt,vt("]"),lt,ot);if(N&&Ce=="as")return de.marked="keyword",oe(Te,ot);if(se=="regexp")return de.state.lastType=de.marked="operator",de.stream.backUp(de.stream.pos-de.stream.start-1),oe(st)}}function Mt(se,Ce){return se!="quasi"?ue():Ce.slice(Ce.length-2)!="${"?oe(Mt):oe(Nt,pe)}function pe(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(Mt)}function G(se){return fe(de.stream,de.state),ue(se=="{"?mt:kt)}function K(se){return fe(de.stream,de.state),ue(se=="{"?mt:It)}function we(se){return function(Ce){return Ce=="."?oe(se?be:Re):Ce=="variable"&&N?oe(wn,se?St:$t):ue(se?It:kt)}}function Re(se,Ce){if(Ce=="target")return de.marked="keyword",oe($t)}function be(se,Ce){if(Ce=="target")return de.marked="keyword",oe(St)}function Ae(se){return se==":"?oe(lt,mt):ue($t,vt(";"),lt)}function T(se){if(se=="variable")return de.marked="property",oe()}function Ie(se,Ce){if(se=="async")return de.marked="property",oe(Ie);if(se=="variable"||de.style=="keyword"){if(de.marked="property",Ce=="get"||Ce=="set")return oe(W);var _e;return N&&de.state.fatArrowAt==de.stream.start&&(_e=de.stream.match(/^\s*:\s*/,!1))&&(de.state.fatArrowAt=de.stream.pos+_e[0].length),oe(O)}else{if(se=="number"||se=="string")return de.marked=A?"property":de.style+" property",oe(O);if(se=="jsonld-keyword")return oe(O);if(N&&ke(Ce))return de.marked="keyword",oe(Ie);if(se=="[")return oe(kt,ee,vt("]"),O);if(se=="spread")return oe(It,O);if(Ce=="*")return de.marked="keyword",oe(Ie);if(se==":")return ue(O)}}function W(se){return se!="variable"?ue(O):(de.marked="property",oe(Yn))}function O(se){if(se==":")return oe(It);if(se=="(")return ue(Yn)}function P(se,Ce,_e){function ot(st,Kt){if(_e?_e.indexOf(st)>-1:st==","){var Zt=de.state.lexical;return Zt.info=="call"&&(Zt.pos=(Zt.pos||0)+1),oe(function(Tr,Pr){return Tr==Ce||Pr==Ce?ue():ue(se)},ot)}return st==Ce||Kt==Ce?oe():_e&&_e.indexOf(";")>-1?ue(se):oe(vt(Ce))}return function(st,Kt){return st==Ce||Kt==Ce?oe():ue(se,ot)}}function ie(se,Ce,_e){for(var ot=3;ot<arguments.length;ot++)de.cc.push(arguments[ot]);return oe(qe(Ce,_e),P(se,Ce),lt)}function D(se){return se=="}"?oe():ue(mt,D)}function ee(se,Ce){if(N){if(se==":")return oe(Te);if(Ce=="?")return oe(ee)}}function ce(se,Ce){if(N&&(se==":"||Ce=="in"))return oe(Te)}function Oe(se){if(N&&se==":")return de.stream.match(/^\s*\w+\s+is\b/,!1)?oe(kt,Pe,Te):oe(Te)}function Pe(se,Ce){if(Ce=="is")return de.marked="keyword",oe()}function Te(se,Ce){if(Ce=="keyof"||Ce=="typeof"||Ce=="infer"||Ce=="readonly")return de.marked="keyword",oe(Ce=="typeof"?It:Te);if(se=="variable"||Ce=="void")return de.marked="type",oe(Ft);if(Ce=="|"||Ce=="&")return oe(Te);if(se=="string"||se=="number"||se=="atom")return oe(Ft);if(se=="[")return oe(qe("]"),P(Te,"]",","),lt,Ft);if(se=="{")return oe(qe("}"),He,lt,Ft);if(se=="(")return oe(P(Jt,")"),Ge,Ft);if(se=="<")return oe(P(Te,">"),Te);if(se=="quasi")return ue(gt,Ft)}function Ge(se){if(se=="=>")return oe(Te)}function He(se){return se.match(/[\}\)\]]/)?oe():se==","||se==";"?oe(He):ue(it,He)}function it(se,Ce){if(se=="variable"||de.style=="keyword")return de.marked="property",oe(it);if(Ce=="?"||se=="number"||se=="string")return oe(it);if(se==":")return oe(Te);if(se=="[")return oe(vt("variable"),ce,vt("]"),it);if(se=="(")return ue(yi,it);if(!se.match(/[;\}\)\],]/))return oe()}function gt(se,Ce){return se!="quasi"?ue():Ce.slice(Ce.length-2)!="${"?oe(gt):oe(Te,Ct)}function Ct(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(gt)}function Jt(se,Ce){return se=="variable"&&de.stream.match(/^\s*[?:]/,!1)||Ce=="?"?oe(Jt):se==":"?oe(Te):se=="spread"?oe(Jt):ue(Te)}function Ft(se,Ce){if(Ce=="<")return oe(qe(">"),P(Te,">"),lt,Ft);if(Ce=="|"||se=="."||Ce=="&")return oe(Te);if(se=="[")return oe(Te,vt("]"),Ft);if(Ce=="extends"||Ce=="implements")return de.marked="keyword",oe(Te);if(Ce=="?")return oe(Te,vt(":"),Te)}function wn(se,Ce){if(Ce=="<")return oe(qe(">"),P(Te,">"),lt,Ft)}function Zr(){return ue(Te,On)}function On(se,Ce){if(Ce=="=")return oe(Te)}function Gi(se,Ce){return Ce=="enum"?(de.marked="keyword",oe(po)):ue(jr,ee,Tn,Kn)}function jr(se,Ce){if(N&&ke(Ce))return de.marked="keyword",oe(jr);if(se=="variable")return Ve(Ce),oe();if(se=="spread")return oe(jr);if(se=="[")return ie($n,"]");if(se=="{")return ie(Nn,"}")}function Nn(se,Ce){return se=="variable"&&!de.stream.match(/^\s*:/,!1)?(Ve(Ce),oe(Tn)):(se=="variable"&&(de.marked="property"),se=="spread"?oe(jr):se=="}"?ue():se=="["?oe(kt,vt("]"),vt(":"),Nn):oe(vt(":"),jr,Tn))}function $n(){return ue(jr,Tn)}function Tn(se,Ce){if(Ce=="=")return oe(It)}function Kn(se){if(se==",")return oe(Gi)}function pn(se,Ce){if(se=="keyword b"&&Ce=="else")return oe(qe("form","else"),mt,lt)}function Oa(se,Ce){if(Ce=="await")return oe(Oa);if(se=="(")return oe(qe(")"),jo,lt)}function jo(se){return se=="var"?oe(Gi,Sn):se=="variable"?oe(Sn):ue(Sn)}function Sn(se,Ce){return se==")"?oe():se==";"?oe(Sn):Ce=="in"||Ce=="of"?(de.marked="keyword",oe(kt,Sn)):ue(kt,Sn)}function Yn(se,Ce){if(Ce=="*")return de.marked="keyword",oe(Yn);if(se=="variable")return Ve(Ce),oe(Yn);if(se=="(")return oe(ut,qe(")"),P(Bn,")"),lt,Oe,mt,yt);if(N&&Ce=="<")return oe(qe(">"),P(Zr,">"),lt,Yn)}function yi(se,Ce){if(Ce=="*")return de.marked="keyword",oe(yi);if(se=="variable")return Ve(Ce),oe(yi);if(se=="(")return oe(ut,qe(")"),P(Bn,")"),lt,Oe,yt);if(N&&Ce=="<")return oe(qe(">"),P(Zr,">"),lt,yi)}function $i(se,Ce){if(se=="keyword"||se=="variable")return de.marked="type",oe($i);if(Ce=="<")return oe(qe(">"),P(Zr,">"),lt)}function Bn(se,Ce){return Ce=="@"&&oe(kt,Bn),se=="spread"?oe(Bn):N&&ke(Ce)?(de.marked="keyword",oe(Bn)):N&&se=="this"?oe(ee,Tn):ue(jr,ee,Tn)}function mi(se,Ce){return se=="variable"?Ta(se,Ce):Pn(se,Ce)}function Ta(se,Ce){if(se=="variable")return Ve(Ce),oe(Pn)}function Pn(se,Ce){if(Ce=="<")return oe(qe(">"),P(Zr,">"),lt,Pn);if(Ce=="extends"||Ce=="implements"||N&&se==",")return Ce=="implements"&&(de.marked="keyword"),oe(N?Te:kt,Pn);if(se=="{")return oe(qe("}"),An,lt)}function An(se,Ce){if(se=="async"||se=="variable"&&(Ce=="static"||Ce=="get"||Ce=="set"||N&&ke(Ce))&&de.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return de.marked="keyword",oe(An);if(se=="variable"||de.style=="keyword")return de.marked="property",oe(xi,An);if(se=="number"||se=="string")return oe(xi,An);if(se=="[")return oe(kt,ee,vt("]"),xi,An);if(Ce=="*")return de.marked="keyword",oe(An);if(N&&se=="(")return ue(yi,An);if(se==";"||se==",")return oe(An);if(se=="}")return oe();if(Ce=="@")return oe(kt,An)}function xi(se,Ce){if(Ce=="!"||Ce=="?")return oe(xi);if(se==":")return oe(Te,Tn);if(Ce=="=")return oe(It);var _e=de.state.lexical.prev,ot=_e&&_e.info=="interface";return ue(ot?yi:Yn)}function mr(se,Ce){return Ce=="*"?(de.marked="keyword",oe(Un,vt(";"))):Ce=="default"?(de.marked="keyword",oe(kt,vt(";"))):se=="{"?oe(P(Et,"}"),Un,vt(";")):ue(mt)}function Et(se,Ce){if(Ce=="as")return de.marked="keyword",oe(vt("variable"));if(se=="variable")return ue(It,Et)}function qn(se){return se=="string"?oe():se=="("?ue(kt):se=="."?ue($t):ue(bi,En,Un)}function bi(se,Ce){return se=="{"?ie(bi,"}"):(se=="variable"&&Ve(Ce),Ce=="*"&&(de.marked="keyword"),oe(qt))}function En(se){if(se==",")return oe(bi,En)}function qt(se,Ce){if(Ce=="as")return de.marked="keyword",oe(bi)}function Un(se,Ce){if(Ce=="from")return de.marked="keyword",oe(kt)}function Jn(se){return se=="]"?oe():ue(P(It,"]"))}function po(){return ue(qe("form"),jr,vt("{"),qe("}"),P(nt,"}"),lt,lt)}function nt(){return ue(jr,Tn)}function Lt(se,Ce){return se.lastType=="operator"||se.lastType==","||_.test(Ce.charAt(0))||/[,.]/.test(Ce.charAt(0))}function ei(se,Ce,_e){return Ce.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Ce.lastType)||Ce.lastType=="quasi"&&/\{\s*$/.test(se.string.slice(0,se.pos-(_e||0)))}return{startState:function(se){var Ce={tokenize:V,lastType:"sof",cc:[],lexical:new ne((se||0)-d,0,"block",!1),localVars:x.localVars,context:x.localVars&&new rt(null,null,!1),indented:se||0};return x.globalVars&&typeof x.globalVars=="object"&&(Ce.globalVars=x.globalVars),Ce},token:function(se,Ce){if(se.sol()&&(Ce.lexical.hasOwnProperty("align")||(Ce.lexical.align=!1),Ce.indented=se.indentation(),fe(se,Ce)),Ce.tokenize!=q&&se.eatSpace())return null;var _e=Ce.tokenize(se,Ce);return X=="comment"?_e:(Ce.lastType=X=="operator"&&(M=="++"||M=="--")?"incdec":X,ve(Ce,_e,X,M,se))},indent:function(se,Ce){if(se.tokenize==q||se.tokenize==Q)return c.Pass;if(se.tokenize!=V)return 0;var _e=Ce&&Ce.charAt(0),ot=se.lexical,st;if(!/^\s*else\b/.test(Ce))for(var Kt=se.cc.length-1;Kt>=0;--Kt){var Zt=se.cc[Kt];if(Zt==lt)ot=ot.prev;else if(Zt!=pn&&Zt!=yt)break}for(;(ot.type=="stat"||ot.type=="form")&&(_e=="}"||(st=se.cc[se.cc.length-1])&&(st==$t||st==St)&&!/^[,\.=+\-*:?[\(]/.test(Ce));)ot=ot.prev;b&&ot.type==")"&&ot.prev.type=="stat"&&(ot=ot.prev);var Tr=ot.type,Pr=_e==Tr;return Tr=="vardef"?ot.indented+(se.lastType=="operator"||se.lastType==","?ot.info.length+1:0):Tr=="form"&&_e=="{"?ot.indented:Tr=="form"?ot.indented+d:Tr=="stat"?ot.indented+(Lt(se,Ce)?b||d:0):ot.info=="switch"&&!Pr&&x.doubleIndentSwitch!=!1?ot.indented+(/^(?:case|default)\b/.test(Ce)?d:2*d):ot.align?ot.column+(Pr?0:1):ot.indented+(Pr?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:A,jsonMode:g,expressionAllowed:ei,skipExpression:function(se){ve(se,"atom","atom","true",new c.StringStream("",2,null))}}}),c.registerHelper("wordChars","javascript",/[\w$]/),c.defineMIME("text/javascript","javascript"),c.defineMIME("text/ecmascript","javascript"),c.defineMIME("application/javascript","javascript"),c.defineMIME("application/x-javascript","javascript"),c.defineMIME("application/ecmascript","javascript"),c.defineMIME("application/json",{name:"javascript",json:!0}),c.defineMIME("application/x-json",{name:"javascript",json:!0}),c.defineMIME("application/manifest+json",{name:"javascript",json:!0}),c.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),c.defineMIME("text/typescript",{name:"javascript",typescript:!0}),c.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},76489:(h,I)=>{"use strict";/*!
41
+ outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ee;g&&(Ee=window.scrollY),l.input.focus(),g&&window.scrollTo(null,Ee),l.input.reset(),u.somethingSelected()||(f.value=n.prevInput=" "),n.contextMenuPending=Me,l.selForContextMenu=u.doc.sel,clearTimeout(l.detectingSelectAll);function Ne(){if(f.selectionStart!=null){var tt=u.somethingSelected(),at="\u200B"+(tt?f.value:"");f.value="\u21DA",f.value=at,n.prevInput=tt?"":"\u200B",f.selectionStart=1,f.selectionEnd=at.length,l.selForContextMenu=u.doc.sel}}function Me(){if(n.contextMenuPending==Me&&(n.contextMenuPending=!1,n.wrapper.style.cssText=Z,f.style.cssText=z,b&&A<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=F),f.selectionStart!=null)){(!b||b&&A<9)&&Ne();var tt=0,at=function(){l.selForContextMenu==u.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&n.prevInput=="\u200B"?xr(u,Za)(u):tt++<10?l.detectingSelectAll=setTimeout(at,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(at,200)}}if(b&&A>=9&&Ne(),Y){Jt(e);var Ye=function(){ce(window,"mouseup",Ye),setTimeout(Me,20)};D(window,"mouseup",Ye)}else setTimeout(Me,50)},pr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},pr.prototype.setUneditable=function(){},pr.prototype.needsContentAttribute=!1;function zu(e,n){if(n=n?Qe(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var u=De();n.autofocus=u==e||e.getAttribute("autofocus")!=null&&u==document.body}function l(){e.value=U.getValue()}var f;if(e.form&&(D(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var m=e.form;f=m.submit;try{var F=m.submit=function(){l(),m.submit=f,m.submit(),m.submit=F}}catch(z){}}n.finishInit=function(z){z.save=l,z.getTextArea=function(){return e},z.toTextArea=function(){z.toTextArea=isNaN,l(),e.parentNode.removeChild(z.getWrapperElement()),e.style.display="",e.form&&(ce(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var U=cr(function(z){return e.parentNode.insertBefore(z,e.nextSibling)},n);return U}function Gu(e){e.off=ce,e.on=D,e.wheelEventPixels=fu,e.Doc=Vt,e.splitLines=$n,e.countColumn=Xe,e.findColumn=dt,e.isWordChar=pe,e.Pass=qe,e.signal=Oe,e.Line=Ji,e.changeEnd=li,e.scrollbarModel=Ys,e.Pos=nt,e.cmpPos=Lt,e.modes=jo,e.mimeModes=Sn,e.resolveMode=$i,e.getMode=Bn,e.modeExtensions=mi,e.extendMode=Ta,e.copyState=Pn,e.startState=xi,e.innerMode=An,e.commands=Di,e.keyMap=di,e.keyName=Pu,e.isModifierKey=ua,e.lookupKey=Mo,e.normalizeKeyMap=Ou,e.StringStream=mr,e.SharedTextMarker=sa,e.TextMarker=Li,e.LineWidget=qa,e.e_preventDefault=it,e.e_stopPropagation=gt,e.e_stop=Jt,e.addClass=Ve,e.contains=oe,e.rmClass=te,e.keyNames=ci}Bu(cr),dc(cr);var $u="iter insert remove copy getEditor constructor".split(" ");for(var ls in Vt.prototype)Vt.prototype.hasOwnProperty(ls)&&pt($u,ls)<0&&(cr.prototype[ls]=function(e){return function(){return e.apply(this.doc,arguments)}}(Vt.prototype[ls]));return He(Vt),cr.inputStyles={textarea:pr,contenteditable:nr},cr.defineMode=function(e){!cr.defaults.mode&&e!="null"&&(cr.defaults.mode=e),Yn.apply(this,arguments)},cr.defineMIME=yi,cr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),cr.defineMIME("text/plain","null"),cr.defineExtension=function(e,n){cr.prototype[e]=n},cr.defineDocExtension=function(e,n){Vt.prototype[e]=n},cr.fromTextArea=zu,Gu(cr),cr.version="5.65.0",cr})},96876:(h,I,o)=>{(function(c){c(o(4631))})(function(c){"use strict";c.defineMode("javascript",function(v,x){var d=v.indentUnit,b=x.statementIndent,A=x.jsonld,g=x.json||A,L=x.trackScope!==!1,N=x.typescript,B=x.wordCharacters||/[\w$\xa1-\uffff]/,j=function(){function se(Tr){return{type:Tr,style:"keyword"}}var Ce=se("keyword a"),_e=se("keyword b"),ot=se("keyword c"),st=se("keyword d"),Kt=se("operator"),Zt={type:"atom",style:"atom"};return{if:se("if"),while:Ce,with:Ce,else:_e,do:_e,try:_e,finally:_e,return:st,break:st,continue:st,new:se("new"),delete:ot,void:ot,throw:ot,debugger:se("debugger"),var:se("var"),const:se("var"),let:se("var"),function:se("function"),catch:se("catch"),for:se("for"),switch:se("switch"),case:se("case"),default:se("default"),in:Kt,typeof:Kt,instanceof:Kt,true:Zt,false:Zt,null:Zt,undefined:Zt,NaN:Zt,Infinity:Zt,this:se("this"),class:se("class"),super:se("atom"),yield:ot,export:se("export"),import:se("import"),extends:ot,await:ot}}(),_=/[+\-*&%=<>!?|~^@]/,H=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function R(se){for(var Ce=!1,_e,ot=!1;(_e=se.next())!=null;){if(!Ce){if(_e=="/"&&!ot)return;_e=="["?ot=!0:ot&&_e=="]"&&(ot=!1)}Ce=!Ce&&_e=="\\"}}var X,M;function C(se,Ce,_e){return X=se,M=_e,Ce}function V(se,Ce){var _e=se.next();if(_e=='"'||_e=="'")return Ce.tokenize=J(_e),Ce.tokenize(se,Ce);if(_e=="."&&se.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return C("number","number");if(_e=="."&&se.match(".."))return C("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(_e))return C(_e);if(_e=="="&&se.eat(">"))return C("=>","operator");if(_e=="0"&&se.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return C("number","number");if(/\d/.test(_e))return se.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),C("number","number");if(_e=="/")return se.eat("*")?(Ce.tokenize=q,q(se,Ce)):se.eat("/")?(se.skipToEnd(),C("comment","comment")):ei(se,Ce,1)?(R(se),se.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),C("regexp","string-2")):(se.eat("="),C("operator","operator",se.current()));if(_e=="`")return Ce.tokenize=Q,Q(se,Ce);if(_e=="#"&&se.peek()=="!")return se.skipToEnd(),C("meta","meta");if(_e=="#"&&se.eatWhile(B))return C("variable","property");if(_e=="<"&&se.match("!--")||_e=="-"&&se.match("->")&&!/\S/.test(se.string.slice(0,se.start)))return se.skipToEnd(),C("comment","comment");if(_.test(_e))return(_e!=">"||!Ce.lexical||Ce.lexical.type!=">")&&(se.eat("=")?(_e=="!"||_e=="=")&&se.eat("="):/[<>*+\-|&?]/.test(_e)&&(se.eat(_e),_e==">"&&se.eat(_e))),_e=="?"&&se.eat(".")?C("."):C("operator","operator",se.current());if(B.test(_e)){se.eatWhile(B);var ot=se.current();if(Ce.lastType!="."){if(j.propertyIsEnumerable(ot)){var st=j[ot];return C(st.type,st.style,ot)}if(ot=="async"&&se.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return C("async","keyword",ot)}return C("variable","variable",ot)}}function J(se){return function(Ce,_e){var ot=!1,st;if(A&&Ce.peek()=="@"&&Ce.match(H))return _e.tokenize=V,C("jsonld-keyword","meta");for(;(st=Ce.next())!=null&&!(st==se&&!ot);)ot=!ot&&st=="\\";return ot||(_e.tokenize=V),C("string","string")}}function q(se,Ce){for(var _e=!1,ot;ot=se.next();){if(ot=="/"&&_e){Ce.tokenize=V;break}_e=ot=="*"}return C("comment","comment")}function Q(se,Ce){for(var _e=!1,ot;(ot=se.next())!=null;){if(!_e&&(ot=="`"||ot=="$"&&se.eat("{"))){Ce.tokenize=V;break}_e=!_e&&ot=="\\"}return C("quasi","string-2",se.current())}var Y="([{}])";function fe(se,Ce){Ce.fatArrowAt&&(Ce.fatArrowAt=null);var _e=se.string.indexOf("=>",se.start);if(!(_e<0)){if(N){var ot=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(se.string.slice(se.start,_e));ot&&(_e=ot.index)}for(var st=0,Kt=!1,Zt=_e-1;Zt>=0;--Zt){var Tr=se.string.charAt(Zt),Pr=Y.indexOf(Tr);if(Pr>=0&&Pr<3){if(!st){++Zt;break}if(--st==0){Tr=="("&&(Kt=!0);break}}else if(Pr>=3&&Pr<6)++st;else if(B.test(Tr))Kt=!0;else if(/["'\/`]/.test(Tr))for(;;--Zt){if(Zt==0)return;var er=se.string.charAt(Zt-1);if(er==Tr&&se.string.charAt(Zt-2)!="\\"){Zt--;break}}else if(Kt&&!st){++Zt;break}}Kt&&!st&&(Ce.fatArrowAt=Zt)}}var te={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(se,Ce,_e,ot,st,Kt){this.indented=se,this.column=Ce,this.type=_e,this.prev=st,this.info=Kt,ot!=null&&(this.align=ot)}function ye(se,Ce){if(!L)return!1;for(var _e=se.localVars;_e;_e=_e.next)if(_e.name==Ce)return!0;for(var ot=se.context;ot;ot=ot.prev)for(var _e=ot.vars;_e;_e=_e.next)if(_e.name==Ce)return!0}function ve(se,Ce,_e,ot,st){var Kt=se.cc;for(de.state=se,de.stream=st,de.marked=null,de.cc=Kt,de.style=Ce,se.lexical.hasOwnProperty("align")||(se.lexical.align=!0);;){var Zt=Kt.length?Kt.pop():g?kt:mt;if(Zt(_e,ot)){for(;Kt.length&&Kt[Kt.length-1].lex;)Kt.pop()();return de.marked?de.marked:_e=="variable"&&ye(se,ot)?"variable-2":Ce}}}var de={state:null,column:null,marked:null,cc:null};function ue(){for(var se=arguments.length-1;se>=0;se--)de.cc.push(arguments[se])}function oe(){return ue.apply(null,arguments),!0}function De(se,Ce){for(var _e=Ce;_e;_e=_e.next)if(_e.name==se)return!0;return!1}function Ve(se){var Ce=de.state;if(de.marked="def",!!L){if(Ce.context){if(Ce.lexical.info=="var"&&Ce.context&&Ce.context.block){var _e=Le(se,Ce.context);if(_e!=null){Ce.context=_e;return}}else if(!De(se,Ce.localVars)){Ce.localVars=new Qe(se,Ce.localVars);return}}x.globalVars&&!De(se,Ce.globalVars)&&(Ce.globalVars=new Qe(se,Ce.globalVars))}}function Le(se,Ce){if(Ce)if(Ce.block){var _e=Le(se,Ce.prev);return _e?_e==Ce.prev?Ce:new rt(_e,Ce.vars,!0):null}else return De(se,Ce.vars)?Ce:new rt(Ce.prev,new Qe(se,Ce.vars),!1);else return null}function ke(se){return se=="public"||se=="private"||se=="protected"||se=="abstract"||se=="readonly"}function rt(se,Ce,_e){this.prev=se,this.vars=Ce,this.block=_e}function Qe(se,Ce){this.name=se,this.next=Ce}var Xe=new Qe("this",new Qe("arguments",null));function ut(){de.state.context=new rt(de.state.context,de.state.localVars,!1),de.state.localVars=Xe}function pt(){de.state.context=new rt(de.state.context,de.state.localVars,!0),de.state.localVars=null}function yt(){de.state.localVars=de.state.context.vars,de.state.context=de.state.context.prev}yt.lex=!0;function qe(se,Ce){var _e=function(){var ot=de.state,st=ot.indented;if(ot.lexical.type=="stat")st=ot.lexical.indented;else for(var Kt=ot.lexical;Kt&&Kt.type==")"&&Kt.align;Kt=Kt.prev)st=Kt.indented;ot.lexical=new ne(st,de.stream.column(),se,null,ot.lexical,Ce)};return _e.lex=!0,_e}function lt(){var se=de.state;se.lexical.prev&&(se.lexical.type==")"&&(se.indented=se.lexical.indented),se.lexical=se.lexical.prev)}lt.lex=!0;function vt(se){function Ce(_e){return _e==se?oe():se==";"||_e=="}"||_e==")"||_e=="]"?ue():oe(Ce)}return Ce}function mt(se,Ce){return se=="var"?oe(qe("vardef",Ce),Gi,vt(";"),lt):se=="keyword a"?oe(qe("form"),At,mt,lt):se=="keyword b"?oe(qe("form"),mt,lt):se=="keyword d"?de.stream.match(/^\s*$/,!1)?oe():oe(qe("stat"),Nt,vt(";"),lt):se=="debugger"?oe(vt(";")):se=="{"?oe(qe("}"),pt,D,lt,yt):se==";"?oe():se=="if"?(de.state.lexical.info=="else"&&de.state.cc[de.state.cc.length-1]==lt&&de.state.cc.pop()(),oe(qe("form"),At,mt,lt,pn)):se=="function"?oe(Yn):se=="for"?oe(qe("form"),pt,Oa,mt,yt,lt):se=="class"||N&&Ce=="interface"?(de.marked="keyword",oe(qe("form",se=="class"?se:Ce),Ta,lt)):se=="variable"?N&&Ce=="declare"?(de.marked="keyword",oe(mt)):N&&(Ce=="module"||Ce=="enum"||Ce=="type")&&de.stream.match(/^\s*\w/,!1)?(de.marked="keyword",Ce=="enum"?oe(po):Ce=="type"?oe($i,vt("operator"),Te,vt(";")):oe(qe("form"),jr,vt("{"),qe("}"),D,lt,lt)):N&&Ce=="namespace"?(de.marked="keyword",oe(qe("form"),kt,mt,lt)):N&&Ce=="abstract"?(de.marked="keyword",oe(mt)):oe(qe("stat"),Ae):se=="switch"?oe(qe("form"),At,vt("{"),qe("}","switch"),pt,D,lt,lt,yt):se=="case"?oe(kt,vt(":")):se=="default"?oe(vt(":")):se=="catch"?oe(qe("form"),ut,dt,mt,lt,yt):se=="export"?oe(qe("stat"),mr,lt):se=="import"?oe(qe("stat"),qn,lt):se=="async"?oe(mt):Ce=="@"?oe(kt,mt):ue(qe("stat"),kt,vt(";"),lt)}function dt(se){if(se=="(")return oe(Bn,vt(")"))}function kt(se,Ce){return jt(se,Ce,!1)}function It(se,Ce){return jt(se,Ce,!0)}function At(se){return se!="("?ue():oe(qe(")"),Nt,vt(")"),lt)}function jt(se,Ce,_e){if(de.state.fatArrowAt==de.stream.start){var ot=_e?K:G;if(se=="(")return oe(ut,qe(")"),P(Bn,")"),lt,vt("=>"),ot,yt);if(se=="variable")return ue(ut,jr,vt("=>"),ot,yt)}var st=_e?St:$t;return te.hasOwnProperty(se)?oe(st):se=="function"?oe(Yn,st):se=="class"||N&&Ce=="interface"?(de.marked="keyword",oe(qe("form"),mi,lt)):se=="keyword c"||se=="async"?oe(_e?It:kt):se=="("?oe(qe(")"),Nt,vt(")"),lt,st):se=="operator"||se=="spread"?oe(_e?It:kt):se=="["?oe(qe("]"),Jn,lt,st):se=="{"?ie(Ie,"}",null,st):se=="quasi"?ue(Mt,st):se=="new"?oe(we(_e)):oe()}function Nt(se){return se.match(/[;\}\)\],]/)?ue():ue(kt)}function $t(se,Ce){return se==","?oe(Nt):St(se,Ce,!1)}function St(se,Ce,_e){var ot=_e==!1?$t:St,st=_e==!1?kt:It;if(se=="=>")return oe(ut,_e?K:G,yt);if(se=="operator")return/\+\+|--/.test(Ce)||N&&Ce=="!"?oe(ot):N&&Ce=="<"&&de.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?oe(qe(">"),P(Te,">"),lt,ot):Ce=="?"?oe(kt,vt(":"),st):oe(st);if(se=="quasi")return ue(Mt,ot);if(se!=";"){if(se=="(")return ie(It,")","call",ot);if(se==".")return oe(T,ot);if(se=="[")return oe(qe("]"),Nt,vt("]"),lt,ot);if(N&&Ce=="as")return de.marked="keyword",oe(Te,ot);if(se=="regexp")return de.state.lastType=de.marked="operator",de.stream.backUp(de.stream.pos-de.stream.start-1),oe(st)}}function Mt(se,Ce){return se!="quasi"?ue():Ce.slice(Ce.length-2)!="${"?oe(Mt):oe(Nt,pe)}function pe(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(Mt)}function G(se){return fe(de.stream,de.state),ue(se=="{"?mt:kt)}function K(se){return fe(de.stream,de.state),ue(se=="{"?mt:It)}function we(se){return function(Ce){return Ce=="."?oe(se?be:Re):Ce=="variable"&&N?oe(wn,se?St:$t):ue(se?It:kt)}}function Re(se,Ce){if(Ce=="target")return de.marked="keyword",oe($t)}function be(se,Ce){if(Ce=="target")return de.marked="keyword",oe(St)}function Ae(se){return se==":"?oe(lt,mt):ue($t,vt(";"),lt)}function T(se){if(se=="variable")return de.marked="property",oe()}function Ie(se,Ce){if(se=="async")return de.marked="property",oe(Ie);if(se=="variable"||de.style=="keyword"){if(de.marked="property",Ce=="get"||Ce=="set")return oe(W);var _e;return N&&de.state.fatArrowAt==de.stream.start&&(_e=de.stream.match(/^\s*:\s*/,!1))&&(de.state.fatArrowAt=de.stream.pos+_e[0].length),oe(O)}else{if(se=="number"||se=="string")return de.marked=A?"property":de.style+" property",oe(O);if(se=="jsonld-keyword")return oe(O);if(N&&ke(Ce))return de.marked="keyword",oe(Ie);if(se=="[")return oe(kt,ee,vt("]"),O);if(se=="spread")return oe(It,O);if(Ce=="*")return de.marked="keyword",oe(Ie);if(se==":")return ue(O)}}function W(se){return se!="variable"?ue(O):(de.marked="property",oe(Yn))}function O(se){if(se==":")return oe(It);if(se=="(")return ue(Yn)}function P(se,Ce,_e){function ot(st,Kt){if(_e?_e.indexOf(st)>-1:st==","){var Zt=de.state.lexical;return Zt.info=="call"&&(Zt.pos=(Zt.pos||0)+1),oe(function(Tr,Pr){return Tr==Ce||Pr==Ce?ue():ue(se)},ot)}return st==Ce||Kt==Ce?oe():_e&&_e.indexOf(";")>-1?ue(se):oe(vt(Ce))}return function(st,Kt){return st==Ce||Kt==Ce?oe():ue(se,ot)}}function ie(se,Ce,_e){for(var ot=3;ot<arguments.length;ot++)de.cc.push(arguments[ot]);return oe(qe(Ce,_e),P(se,Ce),lt)}function D(se){return se=="}"?oe():ue(mt,D)}function ee(se,Ce){if(N){if(se==":")return oe(Te);if(Ce=="?")return oe(ee)}}function ce(se,Ce){if(N&&(se==":"||Ce=="in"))return oe(Te)}function Oe(se){if(N&&se==":")return de.stream.match(/^\s*\w+\s+is\b/,!1)?oe(kt,Pe,Te):oe(Te)}function Pe(se,Ce){if(Ce=="is")return de.marked="keyword",oe()}function Te(se,Ce){if(Ce=="keyof"||Ce=="typeof"||Ce=="infer"||Ce=="readonly")return de.marked="keyword",oe(Ce=="typeof"?It:Te);if(se=="variable"||Ce=="void")return de.marked="type",oe(Ft);if(Ce=="|"||Ce=="&")return oe(Te);if(se=="string"||se=="number"||se=="atom")return oe(Ft);if(se=="[")return oe(qe("]"),P(Te,"]",","),lt,Ft);if(se=="{")return oe(qe("}"),He,lt,Ft);if(se=="(")return oe(P(Jt,")"),Ge,Ft);if(se=="<")return oe(P(Te,">"),Te);if(se=="quasi")return ue(gt,Ft)}function Ge(se){if(se=="=>")return oe(Te)}function He(se){return se.match(/[\}\)\]]/)?oe():se==","||se==";"?oe(He):ue(it,He)}function it(se,Ce){if(se=="variable"||de.style=="keyword")return de.marked="property",oe(it);if(Ce=="?"||se=="number"||se=="string")return oe(it);if(se==":")return oe(Te);if(se=="[")return oe(vt("variable"),ce,vt("]"),it);if(se=="(")return ue(yi,it);if(!se.match(/[;\}\)\],]/))return oe()}function gt(se,Ce){return se!="quasi"?ue():Ce.slice(Ce.length-2)!="${"?oe(gt):oe(Te,Ct)}function Ct(se){if(se=="}")return de.marked="string-2",de.state.tokenize=Q,oe(gt)}function Jt(se,Ce){return se=="variable"&&de.stream.match(/^\s*[?:]/,!1)||Ce=="?"?oe(Jt):se==":"?oe(Te):se=="spread"?oe(Jt):ue(Te)}function Ft(se,Ce){if(Ce=="<")return oe(qe(">"),P(Te,">"),lt,Ft);if(Ce=="|"||se=="."||Ce=="&")return oe(Te);if(se=="[")return oe(Te,vt("]"),Ft);if(Ce=="extends"||Ce=="implements")return de.marked="keyword",oe(Te);if(Ce=="?")return oe(Te,vt(":"),Te)}function wn(se,Ce){if(Ce=="<")return oe(qe(">"),P(Te,">"),lt,Ft)}function Zr(){return ue(Te,On)}function On(se,Ce){if(Ce=="=")return oe(Te)}function Gi(se,Ce){return Ce=="enum"?(de.marked="keyword",oe(po)):ue(jr,ee,Tn,Kn)}function jr(se,Ce){if(N&&ke(Ce))return de.marked="keyword",oe(jr);if(se=="variable")return Ve(Ce),oe();if(se=="spread")return oe(jr);if(se=="[")return ie($n,"]");if(se=="{")return ie(Nn,"}")}function Nn(se,Ce){return se=="variable"&&!de.stream.match(/^\s*:/,!1)?(Ve(Ce),oe(Tn)):(se=="variable"&&(de.marked="property"),se=="spread"?oe(jr):se=="}"?ue():se=="["?oe(kt,vt("]"),vt(":"),Nn):oe(vt(":"),jr,Tn))}function $n(){return ue(jr,Tn)}function Tn(se,Ce){if(Ce=="=")return oe(It)}function Kn(se){if(se==",")return oe(Gi)}function pn(se,Ce){if(se=="keyword b"&&Ce=="else")return oe(qe("form","else"),mt,lt)}function Oa(se,Ce){if(Ce=="await")return oe(Oa);if(se=="(")return oe(qe(")"),jo,lt)}function jo(se){return se=="var"?oe(Gi,Sn):se=="variable"?oe(Sn):ue(Sn)}function Sn(se,Ce){return se==")"?oe():se==";"?oe(Sn):Ce=="in"||Ce=="of"?(de.marked="keyword",oe(kt,Sn)):ue(kt,Sn)}function Yn(se,Ce){if(Ce=="*")return de.marked="keyword",oe(Yn);if(se=="variable")return Ve(Ce),oe(Yn);if(se=="(")return oe(ut,qe(")"),P(Bn,")"),lt,Oe,mt,yt);if(N&&Ce=="<")return oe(qe(">"),P(Zr,">"),lt,Yn)}function yi(se,Ce){if(Ce=="*")return de.marked="keyword",oe(yi);if(se=="variable")return Ve(Ce),oe(yi);if(se=="(")return oe(ut,qe(")"),P(Bn,")"),lt,Oe,yt);if(N&&Ce=="<")return oe(qe(">"),P(Zr,">"),lt,yi)}function $i(se,Ce){if(se=="keyword"||se=="variable")return de.marked="type",oe($i);if(Ce=="<")return oe(qe(">"),P(Zr,">"),lt)}function Bn(se,Ce){return Ce=="@"&&oe(kt,Bn),se=="spread"?oe(Bn):N&&ke(Ce)?(de.marked="keyword",oe(Bn)):N&&se=="this"?oe(ee,Tn):ue(jr,ee,Tn)}function mi(se,Ce){return se=="variable"?Ta(se,Ce):Pn(se,Ce)}function Ta(se,Ce){if(se=="variable")return Ve(Ce),oe(Pn)}function Pn(se,Ce){if(Ce=="<")return oe(qe(">"),P(Zr,">"),lt,Pn);if(Ce=="extends"||Ce=="implements"||N&&se==",")return Ce=="implements"&&(de.marked="keyword"),oe(N?Te:kt,Pn);if(se=="{")return oe(qe("}"),An,lt)}function An(se,Ce){if(se=="async"||se=="variable"&&(Ce=="static"||Ce=="get"||Ce=="set"||N&&ke(Ce))&&de.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return de.marked="keyword",oe(An);if(se=="variable"||de.style=="keyword")return de.marked="property",oe(xi,An);if(se=="number"||se=="string")return oe(xi,An);if(se=="[")return oe(kt,ee,vt("]"),xi,An);if(Ce=="*")return de.marked="keyword",oe(An);if(N&&se=="(")return ue(yi,An);if(se==";"||se==",")return oe(An);if(se=="}")return oe();if(Ce=="@")return oe(kt,An)}function xi(se,Ce){if(Ce=="!"||Ce=="?")return oe(xi);if(se==":")return oe(Te,Tn);if(Ce=="=")return oe(It);var _e=de.state.lexical.prev,ot=_e&&_e.info=="interface";return ue(ot?yi:Yn)}function mr(se,Ce){return Ce=="*"?(de.marked="keyword",oe(Un,vt(";"))):Ce=="default"?(de.marked="keyword",oe(kt,vt(";"))):se=="{"?oe(P(Et,"}"),Un,vt(";")):ue(mt)}function Et(se,Ce){if(Ce=="as")return de.marked="keyword",oe(vt("variable"));if(se=="variable")return ue(It,Et)}function qn(se){return se=="string"?oe():se=="("?ue(kt):se=="."?ue($t):ue(bi,En,Un)}function bi(se,Ce){return se=="{"?ie(bi,"}"):(se=="variable"&&Ve(Ce),Ce=="*"&&(de.marked="keyword"),oe(qt))}function En(se){if(se==",")return oe(bi,En)}function qt(se,Ce){if(Ce=="as")return de.marked="keyword",oe(bi)}function Un(se,Ce){if(Ce=="from")return de.marked="keyword",oe(kt)}function Jn(se){return se=="]"?oe():ue(P(It,"]"))}function po(){return ue(qe("form"),jr,vt("{"),qe("}"),P(nt,"}"),lt,lt)}function nt(){return ue(jr,Tn)}function Lt(se,Ce){return se.lastType=="operator"||se.lastType==","||_.test(Ce.charAt(0))||/[,.]/.test(Ce.charAt(0))}function ei(se,Ce,_e){return Ce.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Ce.lastType)||Ce.lastType=="quasi"&&/\{\s*$/.test(se.string.slice(0,se.pos-(_e||0)))}return{startState:function(se){var Ce={tokenize:V,lastType:"sof",cc:[],lexical:new ne((se||0)-d,0,"block",!1),localVars:x.localVars,context:x.localVars&&new rt(null,null,!1),indented:se||0};return x.globalVars&&typeof x.globalVars=="object"&&(Ce.globalVars=x.globalVars),Ce},token:function(se,Ce){if(se.sol()&&(Ce.lexical.hasOwnProperty("align")||(Ce.lexical.align=!1),Ce.indented=se.indentation(),fe(se,Ce)),Ce.tokenize!=q&&se.eatSpace())return null;var _e=Ce.tokenize(se,Ce);return X=="comment"?_e:(Ce.lastType=X=="operator"&&(M=="++"||M=="--")?"incdec":X,ve(Ce,_e,X,M,se))},indent:function(se,Ce){if(se.tokenize==q||se.tokenize==Q)return c.Pass;if(se.tokenize!=V)return 0;var _e=Ce&&Ce.charAt(0),ot=se.lexical,st;if(!/^\s*else\b/.test(Ce))for(var Kt=se.cc.length-1;Kt>=0;--Kt){var Zt=se.cc[Kt];if(Zt==lt)ot=ot.prev;else if(Zt!=pn&&Zt!=yt)break}for(;(ot.type=="stat"||ot.type=="form")&&(_e=="}"||(st=se.cc[se.cc.length-1])&&(st==$t||st==St)&&!/^[,\.=+\-*:?[\(]/.test(Ce));)ot=ot.prev;b&&ot.type==")"&&ot.prev.type=="stat"&&(ot=ot.prev);var Tr=ot.type,Pr=_e==Tr;return Tr=="vardef"?ot.indented+(se.lastType=="operator"||se.lastType==","?ot.info.length+1:0):Tr=="form"&&_e=="{"?ot.indented:Tr=="form"?ot.indented+d:Tr=="stat"?ot.indented+(Lt(se,Ce)?b||d:0):ot.info=="switch"&&!Pr&&x.doubleIndentSwitch!=!1?ot.indented+(/^(?:case|default)\b/.test(Ce)?d:2*d):ot.align?ot.column+(Pr?0:1):ot.indented+(Pr?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",blockCommentContinue:g?null:" * ",lineComment:g?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:g?"json":"javascript",jsonldMode:A,jsonMode:g,expressionAllowed:ei,skipExpression:function(se){ve(se,"atom","atom","true",new c.StringStream("",2,null))}}}),c.registerHelper("wordChars","javascript",/[\w$]/),c.defineMIME("text/javascript","javascript"),c.defineMIME("text/ecmascript","javascript"),c.defineMIME("application/javascript","javascript"),c.defineMIME("application/x-javascript","javascript"),c.defineMIME("application/ecmascript","javascript"),c.defineMIME("application/json",{name:"javascript",json:!0}),c.defineMIME("application/x-json",{name:"javascript",json:!0}),c.defineMIME("application/manifest+json",{name:"javascript",json:!0}),c.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),c.defineMIME("text/typescript",{name:"javascript",typescript:!0}),c.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},76489:(h,I)=>{"use strict";/*!
42
42
  * cookie
43
43
  * Copyright(c) 2012-2014 Roman Shtylman
44
44
  * Copyright(c) 2015 Douglas Christopher Wilson
@@ -77,7 +77,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
77
77
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function De(t,r){var i;if(typeof Symbol=="undefined"||t[Symbol.iterator]==null){if(Array.isArray(t)||(i=ve(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(w){throw w},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
78
78
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,y=!1,S;return{s:function(){i=t[Symbol.iterator]()},n:function(){var w=i.next();return p=w.done,w},e:function(w){y=!0,S=w},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(y)throw S}}}}function Ve(t,r){return r={exports:{}},t(r,r.exports),r.exports}var Le=Ve(function(t){function r(k,$){for(var ae=0,re=0;re<k.length;re++)ae=(ae<<5)-ae+k.charCodeAt(re),ae|=0;return $[Math.abs(ae)%$.length]}function i(k,$){var ae=$.namespace;if($.useColors){var re=$.color,le="[3"+(re<8?re:"8;5;"+re),ge=" ".concat(le,";1m").concat(ae," ");k[0]=ge+k[0].split(`
79
79
  `).join(`
80
- `+ge)}else k[0]=ae+" "+k[0]}function a(k,$){if(k[0]=($.useColors?"%c":"")+$.namespace,!!$.useColors){var ae="color: "+$.color,re=0,le=0;k[0].replace(/%[a-zA-Z%]/g,function(ge){ge!=="%%"&&(re++,ge==="%c"&&(le=re))}),k.splice(le,0,ae)}}var s=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){var k;try{k=localStorage.getItem("debug")}catch($){}return!k&&typeof process!="undefined"&&"env"in process&&(k={}.DEBUG),{namespaces:k||"",colors:s,useColors:!0,formatArgs:a}}function y(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function S(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,$=arguments.length>1?arguments[1]:void 0;return function(){for(var ae=arguments.length,re=new Array(ae),le=0;le<ae;le++)re[le]=arguments[le];k&&re.unshift(k);var ge=$.namespaces.split(",").map(function(Fe){return Fe[Fe.length-1]==="*"?new RegExp("^"+Fe.slice(0,Fe.length-1)+".*$"):new RegExp("^"+Fe+"$")}),he=ge.some(function(Fe){return Fe.test(k)}),Se={color:r(k,$.colors),namespace:k,useColors:$.useColors};if(!1)var me}}function w(k){return S(k,y())}function E(k){return S(k,p())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=E:t.exports=w}),ke=Le("informed:ObjMap "),rt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},Qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(p,y){return p!=null?p[y]:p},r);return s===void 0||s===r?a:s},Xe=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ut=function(r){return r.replace(Xe(r),"").replace(/\./,"")},pt=function(r,i){var a=Xe(i),s=ut(i),p=a?Qe(r,a):r;return!!(p&&Object.hasOwnProperty.call(p,s.replace(/\[(.*)\]/,"$1")))},yt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,S){return y===S.length-1?(s[p]=a,s[p]):s[p]===void 0?(Number.isInteger(+S[y+1])?s[p]=[]:s[p]={},s[p]):(Number.isInteger(+S[y+1])&&!Array.isArray(s[p])&&(s[p]=[]),s[p])},r)},qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,S){return s===void 0?s:(y===S.length-1&&(delete s[p],a=!0),s[p])},r),a},lt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,S){return s===void 0?s:(y===S.length-1&&Array.isArray(s)&&(a=s.splice(p,1)),s[p])},r),a},vt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(a){return r[a]})},mt=function(r){var i=rt(r);return Number.isInteger(+i[i.length-1])},dt=function(){function t(){b(this,t)}return g(t,null,[{key:"empty",value:function(i){return vt(i).length===0}},{key:"get",value:function(i,a){var s=Qe(i,a);return s}},{key:"has",value:function(i,a){return pt(i,a)}},{key:"set",value:function(i,a,s){if(s!==void 0)ke("SETTING",a,s),yt(i,a,s);else if(mt(a)&&t.get(i,a)!==void 0){ke("Special case SETTING",a,"to undefined"),yt(i,a,void 0);var p=rt(a);p=p.slice(0,p.length-1),kt(i,p)}else!mt(a)&&t.get(i,a)!==void 0&&(ke("Special case REMOVING",a,"from object completley"),t.delete(i,a))}},{key:"delete",value:function(i,a){ke("DELETE",a),mt(a)?(ke("ARRAY",a),this.pullOut(i,a)):qe(i,a);var s=rt(a);s=s.slice(0,s.length-1),kt(i,s)}},{key:"pullOut",value:function(i,a){var s=rt(a),p=s[s.length-1];s=s.slice(0,s.length-1),ke("Pulling out:",s,"index",p);var y=Qe(i,s);ke("Array",y),Array.isArray(y)&&lt(y,p),kt(i,s)}}]),t}();function kt(t,r){if(r.length!==0){var i=Qe(t,r);(Array.isArray(i)?i.every(function(a){return a==null}):JSON.stringify(i)==="{}")&&qe(t,r),kt(t,r.slice(0,r.length-1))}}var It=d.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),At=d.createContext({}),jt=d.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),Nt=d.createContext(),$t=d.createContext(),St=d.createContext(),Mt=d.createContext(),pe=d.createContext(),G=d.createContext(),K=d.createContext(),we=d.createContext();function Re(){var t=(0,d.useContext)(jt);return t}function be(t){var r=(0,d.useRef)(),i=(0,d.useRef)(!0),a=(0,d.useState)(t),s=Q(a,2),p=s[0],y=s[1];r.current=p;var S=function(k){r.current=k,i.current&&y(k)},w=function(){return r.current};return(0,d.useEffect)(function(){return function(){i.current=!1}},[]),[p,S,w]}var Ae=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},T=function(r){var i={};if(r.inner){if(r.inner.length===0){dt.set(i,r.path,r.message);return}var a=De(r.inner),s;try{for(a.s();!(s=a.n()).done;){var p=s.value;dt.get(i,p.path)||dt.set(i,p.path,p.message)}}catch(y){a.e(y)}finally{a.f()}}return i},Ie=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var a=T(s);return a}},W=function(r){if(r.inner){if(r.inner.length===0)return;var i=r.inner[0];return i.message}},O=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(a){return W(a)}},P=function(r,i){r(i);var a={};return r.errors&&r.errors.forEach(function(s){var p=s.message,y=s.dataPath,S=s.keyword,w=s.params,E=y;S==="required"&&(E="".concat(E,".").concat(w.missingProperty)),E=E.replace(".",""),dt.set(a,E,p)}),a},ie=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,a=r=="x"?i:i&3|8;return a.toString(16)})},D=function(r,i){var a;return function(){for(var p=arguments.length,y=new Array(p),S=0;S<p;S++)y[S]=arguments[S];var w=function(){clearTimeout(a),r.apply(void 0,y)};clearTimeout(a),a=setTimeout(w,i)}},ee=function(r,i,a){var s=i["ui:control"],p=i["informed:props"],y=i["input:props"],S=i["ui:before"],w=i["ui:after"],E=i.oneOf,k=i.items,$=i.enum,ae=i.title,re=i.minimum,le=i.maximum,ge=i.minLength,he=i.maxLength,Se=i.pattern,me=i.type,Fe=i.properties,Ke=ie();y&&y.id&&(Ke=y.id);var Ue={componentType:s,field:a?"".concat(a,".").concat(r):r,type:me,uiBefore:S,uiAfter:w,properties:me==="object"?Fe:void 0,items:me==="array"?k:void 0,props:j(j({label:ae,id:Ke,min:re,max:le,minLength:ge,maxLength:he,pattern:Se},p),y)};if(E){var $e=i.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=$e}if($){var Be=i.enum.map(function(We){return{value:We,label:We}});Ue.props.options=Be}if(k&&k.oneOf){var je=k.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=je}return Ue},ce=function(r,i,a){if(!r||i)return[];var s=r.properties,p=s===void 0?{}:s,y=r.allOf,S=r.propertyOrder,w=S===void 0?[]:S;if(Object.keys(p).length>0){var E=Object.keys(p).sort(function(k,$){var ae=w.indexOf(k),re=w.indexOf($);return(ae>-1?ae:w.length+1)-(re>-1?re:w.length+1)}).map(function(k){var $=p[k],ae=ee(k,$,a);return ae});return y&&E.push({componentType:"conditionals",allOf:y}),E}return[]},Oe=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},Pe=function(r,i){if(typeof r=="string")return r.split("").map(function(a){return a==="#"?/\d/:a==="*"?/[\w]/:a});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},Te=function(r,i){for(var a=0,s=-1,p=!0;p&&a<r.length;)r[a]==i[a]?s=a:p=!1,a=a+1;return s},Ge=function(r,i){if(!r)return{val:r,offset:0};var a="".concat(r),s=Pe(i,a),p=s.findIndex(function(he){return typeof he!="string"}),y=s.length-Y(s).reverse().findIndex(function(he){return typeof he!="string"}),S=[],w=a.split(""),E=0,k=0,$=Te(s.slice(0,p),w.slice(0,p));$>-1&&(E=$+1,S=S.concat(s.slice(0,$+1)),k=$+1),$<0&&(S=S.concat(s.slice(0,p)),k=p);for(var ae=k;ae<s.length;ae++){var re=s[ae];if(E!=w.length){var le=w[E];if(typeof re=="function")S.push(re(le)),E=E+1;else{var ge=typeof re=="string"?re===le:re.test(le);ge&&typeof re=="string"?(S.push(re),E=E+1):!ge&&typeof re=="string"?E!=w.length&&S.push(re):ge&&typeof re!="string"?(S.push(le),E=E+1):!ge&&typeof re!="string"&&(E=E+1,ae=ae-1)}}else if(typeof re=="string"&&ae>=y)S.push(re);else break}return{value:S.join(""),offset:a?S.length-a.length:0}},He=function(r,i){var a,s,p=new Intl.NumberFormat(r,i),y=new Intl.NumberFormat(r),S=(a=(s=y.formatToParts(.1).find(function(he){var Se=he.type;return Se==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:".";function w(he,Se){return he instanceof RegExp&&Se instanceof RegExp&&he.source===Se.source&&he.global===Se.global&&he.ignoreCase===Se.ignoreCase&&he.multiline===Se.multiline}function E(he,Se){for(var me=he.length;me--;)if(Se(he[me]))return me;return-1}function k(he,Se,me){var Fe=Y(he);return Array.isArray(me)?Fe.splice.apply(Fe,[Se,0].concat(Y(me))):Fe.splice(Se,0,me),Fe}function $(he){return"".concat(he).replace(/\D/g,"")}function ae(he){return"".concat(he).split(S).map(function(Se){return $(Se)}).join(".")}function re(he){if(typeof he=="number")return he;var Se=parseFloat(ae(he));return Number.isNaN(Se)?void 0:Se}function le(he){var Se=ae(he),me="".concat(Se).split(".")[1],Fe=p.formatToParts(Number(Se));me==="0"&&Fe.push({type:"decimal",value:S},{type:"fraction",value:me});var Ke=Fe.reduce(function(Be,je){var We=je.type,Je=je.value;return["decimal","fraction"].includes(We)&&me==null?Be:["integer","fraction"].includes(We)?[].concat(Y(Be),Y(Je.split("").filter(function(ze,et){return We==="fraction"?et<me.length:!0}).map(function(){return/\d/}))):We==="currency"?[].concat(Y(Be),Y(Je.split(""))):[].concat(Y(Be),[Je])},[]),Ue=E(Ke,function(Be){return w(Be,/\d/)});Ke.indexOf(S)===-1&&"".concat(he).indexOf(S)!==-1&&(Ke=k(Ke,Ue+1,[S,"[]"]),Ue+=2);var $e=Ke.slice(Ue+1).join("");return Ke=[].concat(Y(Ke.slice(0,Ue+1)),[$e]),Ke}var ge=function(Se){if(Se!=null)return re(Se)};return{formatter:le,parser:ge}},it=Object.freeze({__proto__:null,getChildDisplayName:Ae,yupToFormErrors:T,validateYupSchema:Ie,yupToFormError:W,validateYupField:O,validateAjvSchema:P,uuidv4:ie,debounce:D,computeFieldFromProperty:ee,computeFieldsFromSchema:ce,getSchemaPathFromJsonPath:Oe,informedFormat:Ge,createIntlNumberFormatter:He}),gt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?d.useLayoutEffect:d.useEffect,Ct=function(r){var i=r.value,a=r.inputRef,s=r.maintainCursor,p=s===void 0?!0:s,y=be(0),S=Q(y,3),w=S[0],E=S[1],k=S[2],$=be(0),ae=Q($,3),re=ae[0],le=ae[1],ge=ae[2];return gt(function(){if(a.current!=null&&k()){var he=k()+ge();ge()!=0&&p?a.current.setSelectionRange(he+1,he+1):p&&a.current.setSelectionRange(he,he)}},[i]),{setCursorOffset:le,setCursor:E,cursor:w,getCursor:k,cursorOffset:re}},Jt=function(r,i){var a=(0,d.useRef)(!0),s=a.current;(0,d.useEffect)(function(){if(s)a.current=!1;else return r()},i)},Ft=Le("informed:useField "),wn=function(r,i,a,s,p){if(r!=null){if(p)return p(r);if(i)return i(r);if(a&&!s){var y=Ge(r,a);return y.value}return r}},Zr=function(r,i,a,s){if(i&&a)return i(r);if(s){var p=Ge(r,s);return p.value}return r},On=function(r,i,a){var s=a.required;if(r||i)return function(p,y){if(i)return O(i,p);if(r)return r(p,y)};if(s)return function(p){return Tn(p,s)}},Gi=function(r){var i=r.fieldType,a=r.setValue,s=r.onChange,p=r.multiple,y=r.ref,S=function(E){return a(E)};return(i==="text"||i==="textArea"||i==="number")&&(S=function(E){return a(E.target.value,E)}),i==="select"&&(S=function(){var E=Array.from(y.current).filter(function(k){return k.selected}).map(function(k){return k.value});a(p?E:E[0]||"")}),i==="checkbox"&&(S=function(E){a(E.target.checked),s&&s(E)}),function(w){S(w)}},jr=function(r){var i=r.setTouched,a=r.onBlur;return function(s){i(!0),a&&a(s)}},Nn=function(r){var i=r.fieldType,a=r.maskedValue,s=r.multiple,p=r.value;switch(i){case"text":case"number":return!a&&a!==0?"":a;case"textArea":return a||"";case"select":return p||(s?[]:"");case"checkbox":return!!p;default:return p}},$n=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},Tn=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function Kn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,a=t.validate,s=t.asyncValidate,p=t.validationSchema,y=t.mask,S=t.maskWithCursorOffset,w=t.format,E=t.parse,k=t.formatter,$=t.parser,ae=t.initialValue,re=t.validateOnChange,le=t.validateOnBlur,ge=t.validateOnMount,he=t.asyncValidateOnBlur,Se=t.maskOnBlur,me=t.allowEmptyString,Fe=t.onValueChange,Ke=t.notify,Ue=t.keepState,$e=t.maintainCursor,Be=t.debug,je=t.shadow,We=t.step,Je=t.fieldType,ze=t.multiple,et=t.onChange,wt=t.onBlur,Dt=t.formController,Wt=t.relevant,lr=t.required,Mr=t.keepStateIfRelevant,Or=t.initialize,Kr=t.formatterDependencies,Sr=Kr===void 0?[]:Kr,Ur=C(t,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),bn=(0,d.useState)(ie()),Xt=Q(bn,1),Rt=Xt[0],Bt=(0,d.useContext)(It),ur=(0,d.useContext)(we),on=ur||Mr,gr=Re(),ys=(0,d.useRef)(),Fl=(0,d.useRef)(!0),Aa=(0,d.useRef)(),Hi=(0,d.useRef)(!1),kl=function(){return!Hi.current},df=function(){return Hi.current};Dt&&(Bt=Dt.updater,gr=Dt.getFormApi());var gi=On(a,p,{required:lr}),Rl=(0,d.useState)(function(){return Bt.getInitialValue(i)}),gm=Q(Rl,1),ym=gm[0],pf=Bt.getSavedValue(i),hf,ah;(Ue||on)&&pf?(Ft("Setting field ".concat(yd,"'s kept state"),pf),hf=pf.value,ah=pf.touched,gr.removeSavedState(yd)):ae!=null?hf=ae:hf=ym;var mm=be(wn(hf,y,k,$,Or)),nd=Q(mm,3),Ml=nd[0],id=nd[1],xm=nd[2],bm=be(ge?gi(Ml):void 0),od=Q(bm,3),sh=od[0],lh=od[1],wm=od[2],Sm=be(ah),ad=Q(Sm,3),uh=ad[0],Am=ad[1],fh=ad[2],Em=(0,d.useState)(function(){return Zr(Ml,w,E,k)}),ch=Q(Em,2),sd=ch[0],ld=ch[1],dh=(0,d.useRef)();dh.current=sd;var ph=(0,d.useRef)(ae),Ea=(0,d.useRef)(i),hh=(0,d.useRef)();ph.current=ae,Ea.current=i;var Cm=(0,d.useRef)(null),zi=d.useMemo(function(){return r||Cm},[]),ud=Ct({value:Ml,inputRef:zi,maintainCursor:!!$e}),fd=ud.getCursor,Om=ud.setCursor,cd=ud.setCursorOffset,Tm=function(){return!0},dd=function(fr){var an=Wt||Tm,Ln=gr.getFullField(Ea.current)||Ea.current,Qt={path:Ln,parentPath:Ln.replace(/(.*)[.[].*/,"$1"),get:function(Dn,Nl){return dt.get(Dn,Nl)}};return ur&&ur.relevant?an(fr,Qt)&&ur.relevant(fr,Qt):an(fr,Qt)},Pm=be(dd(gr.getValues())),pd=Q(Pm,3),vf=pd[0],Im=pd[1],vh=pd[2],Fm=function(fr){return ur&&ur.relevant?ur.relevant(fr):!0},km=function(){var fr=dd(gr.getValues()),an=vh();return fr!=an&&Im(fr),fr};(0,d.useEffect)(function(){!vf&&!Ue&&ys.current.reset()},[vf]);var _n=function(){return je?gr.getDerrivedValue(i):xm()},Ll=function(fr){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ln=an.preventUpdate;We&&gr.getStep()<We?(Ft("Setting ".concat(i,"'s error to undefined as we are not at that step")),lh(void 0),Bt.setError(Rt,void 0,!Ln)):(Ft("Setting ".concat(i,"'s error to ").concat(fr)),lh(fr),Bt.setError(Rt,fr,!Ln))},hd=function(fr,an){var Ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Qt=fr;Hi.current=!0,Ft("Setting ".concat(i," to ").concat(Qt)),Or&&(Qt=Or(Qt));var Ca=gr.getOptions(),Dn=Qt;if(Qt===""&&!me&&!Ln.allowEmptyString&&!Ca.allowEmptyStrings&&(Qt=void 0),(t.type==="number"||Je==="number")&&Qt!==void 0&&(Qt=+Qt),an&&an.target&&an.target.selectionStart&&Om(an.target.selectionStart),y&&!Se&&(Dn=y(Qt,fd()),Qt=y(Qt,fd())),S&&!Se){var Nl=S(Qt,fd());Dn=Nl.value,Qt=Nl.value,cd(Nl.offset)}if(w&&E&&(Qt=E(Qt),Dn=w(Qt)),k){var gh=Ge(Qt,k);cd(gh.offset),Dn=gh.value,Qt=Dn}$&&(Qt=Qt!=null?$(Qt):Qt),gi&&re&&!Ln.initial&&(Ft("Validating after change ".concat(i," ").concat(Qt)),Ll(gi(Qt,gr.getValues()))),id(Qt),ld(Dn),Fe&&Fe(Qt),Bt.setValue(Rt,Qt,!Ln.preventUpdate)};Jt(function(){ys.current.setValue(dh.current)},Y(Sr));var vd=function(fr,an){var Ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Qt=Ln.preventUpdate;if(Ft("Field ".concat(i," has been touched")),gi&&le&&!an&&fr&&(Ft("Validating after blur ".concat(i," ").concat(_n())),Ll(gi(_n(),gr.getValues()))),s&&he&&!an&&fr&&(Ft("Validating async after blur ".concat(i," ").concat(_n())),s(_n(),gr.getValues())),y&&Se){var Ca=y(_n());id(Ca),ld(Ca),Fe&&Fe(Ca),Bt.setValue(Rt,Ca,!Qt)}if(S&&Se){var Dn=S(_n());cd(Dn.offset),id(Dn.value),ld(Dn.value),Fe&&Fe(Dn.value),Bt.setValue(Rt,Dn.value,!Qt)}Am(fr),Bt.setTouched(Rt,fr,!Qt)},Rm=function(){var fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},an=fr.preventUpdate,Ln=wn(ph.current||Bt.getInitialValue(Ea.current),y,k,$,Or);hd(Ln,null,{initial:!0,preventUpdate:an}),Ll(ge?gi(Ln):void 0,{preventUpdate:an}),vd(void 0,!0,{preventUpdate:an}),Hi.current=!1},Mm=function(fr){gi&&(Ft("Field validating ".concat(i," ").concat(_n())),Ll(gi(_n(),fr||gr.getValues())))},Lm=function(fr){s&&(Ft("Field async validating ".concat(i," ").concat(_n())),s(_n(),fr||gr.getValues()))},gd={setValue:hd,setTouched:vd,setError:Ll,reset:Rm,validate:Mm,asyncValidate:Lm,getValue:_n,getTouched:fh,getError:wm,getIsRelevant:vh,getDirty:df,getPristine:kl,getFieldState:function(){return{value:_n(),touched:fh(),dirty:df(),pristine:kl()}},relevant:dd,multistepRelevant:Fm,checkRelevant:km};ys.current=gd;var Dl={value:Ml,error:sh,touched:uh,maskedValue:sd,isRelevant:vf,dirty:Hi.current,pristine:!Hi.current};je&&(Dl={error:sh,touched:uh}),Ft("Render",gr.getFullField(i),Dl),gt(function(){var Qr=gr.getFullField(Ea.current);return Ft("Register",Rt,Ea.current),Aa.current={field:Qr,fieldId:Rt,fieldApi:gd,fieldState:Dl,notify:Ke,keepState:Ue,inMultistep:on,shadow:je},Bt.register(Rt,Aa.current),function(){var fr=gr.getFullField(Ea.current);Ft("Deregister",Rt,fr),Bt.deregister(Rt)}},[]),(0,d.useEffect)(function(){var Qr=gr.getFullField(i);return Fl.current?Fl.current=!1:(Ft("Update",i,on),Aa.current.field=Qr,Bt.update(Rt,Aa.current,hh.current)),function(){hh.current=Qr}},[i]),gt(function(){Be&&zi&&(zi.current.style.border="5px solid orange",setTimeout(function(){zi.current.style.borderWidth="2px",zi.current.style.borderStyle="inset",zi.current.style.borderColor="initial",zi.current.style.borderImage="initial"},500))});var Dm=[].concat(Y(Object.values(Dl)),Y(Object.values(t)),Y(Object.values(Ur))),Nm=function(fr){return(0,d.useMemo)(function(){return vf?fr:null},Y(Dm))},yd=i,Bm=Gi({fieldType:Je,setValue:hd,onChange:et,multiple:ze,ref:zi}),Um=jr({setTouched:vd,onBlur:wt}),jm=Nn({fieldType:Je,maskedValue:sd,multiple:ze,value:Ml}),Vm=$n(Je);return{fieldState:Dl,fieldApi:gd,render:Nm,ref:zi,userProps:j(j({},Ur),{},{multiple:ze,onChange:et,onBlur:wt,id:Ur.id||Rt}),informed:j({name:yd,multiple:ze,onChange:Bm,onBlur:Um,value:jm,ref:zi,type:Vm,id:Ur.id||Rt},Ur)}}var pn=function(r){var i=d.forwardRef(function(a,s){var p=Kn(a,s),y=p.fieldState,S=p.fieldApi,w=p.render,E=p.ref,k=p.userProps;return w(d.createElement(r,N({fieldApi:S,fieldState:y,field:a.field,forwardedRef:E,debug:a.debug,type:a.type},k)))});return i.displayName="asField(".concat(Ae(r),")"),i},Oa=Le("informed:Text "),jo=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,S=i.setTouched,w=s.onChange,E=s.onBlur,k=s.field,$=s.initialValue,ae=s.forwardedRef,re=s.debug,le=s.label,ge=s.title,he=s.id,Se=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return Oa("Render",k),gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,le?d.createElement("label",{htmlFor:he}," ",le," "):null,d.createElement("input",N({},Se,{id:he,name:k,ref:ae,value:!p&&p!==0?"":p,onChange:function(Fe){y(Fe.target.value,Fe),w&&w(Fe)},onBlur:function(Fe){S(!0),E&&E(Fe)}})))},Sn=pn(jo),Yn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,S=i.setTouched,w=s.onChange,E=s.onBlur,k=s.field,$=s.initialValue,ae=s.forwardedRef,re=s.debug,le=s.label,ge=s.id,he=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,le?d.createElement("label",{htmlFor:ge}," ",le," "):null,d.createElement("textarea",N({},he,{id:ge,name:k,ref:ae,value:p||"",onChange:function(me){y(me.target.value,me),w&&w(me)},onBlur:function(me){S(!0),E&&E(me)}})))},yi=pn(Yn),$i=Le("informed:Select "),Bn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setTouched,S=s.onChange,w=s.onBlur,E=s.field,k=s.initialValue,$=s.options,ae=s.children,re=s.forwardedRef,le=s.debug,ge=s.multiple,he=s.label,Se=s.id,me=C(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),Fe=(0,d.useRef)(),Ke=function($e){var Be=Array.from((re||Fe).current).filter(function(je){return je.selected}).map(function(je){return je.value});i.setValue(ge?Be:Be[0]||""),S&&$e&&S($e)};return gt(function(){le&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),$i("Render",E,p),d.createElement(d.Fragment,null,he?d.createElement("label",{htmlFor:Se}," ",he," "):null,d.createElement("select",N({},me,{id:Se,multiple:ge,name:E,ref:re||Fe,value:p||(ge?[]:""),onChange:Ke,onBlur:function($e){y(!0),w&&w($e)}}),$?$.map(function(Ue){return d.createElement("option",{key:Ue.value,value:Ue.value,disabled:Ue.disabled},Ue.label)}):ae))},mi=pn(Bn),Ta=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setValue,S=i.setTouched,w=s.onChange,E=s.onBlur,k=s.field,$=s.initialValue,ae=s.debug,re=s.forwardedRef,le=s.id,ge=s.label,he=C(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return d.createElement(d.Fragment,null,ge?d.createElement("label",{htmlFor:le}," ",ge," "):null,d.createElement("input",N({},he,{id:le,name:k,ref:re,checked:!!p,onChange:function(me){y(me.target.checked),w&&w(me)},onBlur:function(me){S(!0),E&&E(me)},type:"checkbox"})))},Pn=pn(Ta),An=function(r){return d.forwardRef(function(i,a){return d.createElement(Nt.Consumer,null,function(s){var p=s.radioGroupApi,y=s.radioGroupState;return d.createElement(r,N({radioGroupApi:p,radioGroupState:y,ref:a},i))})})},xi=function(r){var i=r.radioGroupApi,a=r.radioGroupState,s=C(r,["radioGroupApi","radioGroupState"]),p=a.value,y=i.setValue,S=i.setTouched,w=i.onChange,E=i.onBlur,k=s.value,$=s.onChange,ae=s.onBlur,re=s.field,le=s.initialValue,ge=s.forwardedRef,he=C(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return d.createElement("input",N({},he,{name:re,ref:ge,value:k,checked:p===k,onChange:function(me){!me.target.checked||(y(k),$&&$(me),w&&w(me))},onBlur:function(me){S(!0),ae&&ae(me),E&&E(me)},type:"radio"}))},mr=An(xi),Et=function(t){_(i,t);var r=q(i);function i(){return b(this,i),r.apply(this,arguments)}return g(i,[{key:"render",value:function(){var s=this.props,p=s.options,y=s.children;return d.createElement(Nt.Provider,{value:this.groupContext},p?p.map(function(S){return d.createElement("label",{key:S.value},S.label," ",d.createElement(mr,{value:S.value}))}):y)}},{key:"groupContext",get:function(){return{radioGroupApi:j(j({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(d.Component),qn=pn(Et);function bi(){return(0,d.useContext)(St)}var En=function(){var r=bi(),i=r.add;return d.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function qt(){return(0,d.useContext)(Mt)}var Un=function(){var r=qt(),i=r.remove;return d.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},Jn=Le("informed:useArrayField "),po=function(r){var i=r.field,a=r.initialValue,s=r.validate,p=r.arrayFieldApiRef,y=C(r,["field","initialValue","validate","arrayFieldApiRef"]),S=Re(),w=(0,d.useState)(new Map),E=Q(w,1),k=E[0],$=(0,d.useContext)(It),ae=S.getFullField(i),re=$.getInitialValue(i)||a||[],le=S.getSavedValue(ae)&&S.getSavedValue(ae).value,ge=be(le||re),he=Q(ge,3),Se=he[0],me=he[1],Fe=he[2],Ke=Se?Se.map(function(){return ie()}):[],Ue=be(Ke),$e=Q(Ue,3),Be=$e[0],je=$e[1],We=$e[2],Je=(0,d.useMemo)(function(){return function(Xt,Rt){var Bt=We()==null?0:We().length;return s?s(Xt,Bt,Rt):void 0}}),ze=Kn(j({field:i,validate:s?Je:void 0,shadow:!0},y)),et=ze.fieldApi;gt(function(){var Xt=function(Bt){Bt!==ae&&(Jn("".concat(ae," changed")),RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Bt)&&et.validate())};return S.emitter.on("value",Xt),function(){S.emitter.removeListener("value",Xt)}},[i]);var wt=function(Rt){Jn("EXPECTING REMOVAL OF","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Be.length-1,"]")),$.expectRemoval("".concat(i,"[").concat(Rt,"]")),$.expectRemoval("".concat(i,"[").concat(Be.length-1,"]"));var Bt=Be.slice(0,Rt).concat(Be.slice(Rt+1,Be.length));je(Bt);var ur=Fe(),on=ur.slice(0,Rt).concat(ur.slice(Rt+1,ur.length));me(on)},Dt=function(Rt,Bt){Jn("Swapping","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Bt,"]"));var ur=Y(Be);Be[Rt]&&Be[Bt]?(ur[Rt]=Be[Bt],ur[Bt]=Be[Rt]):console.warn("Attempted to swap ".concat(Rt," with ").concat(Bt," but one of them does not exist :(")),je(ur)},Wt=function(){Be.push(ie()),je(Y(Be))},lr=function(Rt){Be.push(ie()),je(Y(Be));var Bt=Y(Fe());Bt[Be.length-1]=Rt,me(Bt)},Mr=function(){var Rt=$.getInitialValue(i)||a||[];me(Rt);var Bt=Rt?Rt.map(function(){return ie()}):[];je(Bt)},Or=Be.map(function(Xt,Rt){var Bt={remove:function(){return wt(Rt)}},ur={initialValue:Se&&Se[Rt],key:Xt,field:"".concat(i,"[").concat(Rt,"]"),index:Rt};return j(j({arrayFieldItemApi:Bt,arrayFieldItemState:ur},Bt),ur)}),Kr={add:Wt,swap:Dt,addWithInitialValue:lr,reset:Mr};p&&(p.current=Kr);var Sr={fields:Or,field:i},Ur=j(j({},$),{},{register:function(Rt,Bt){k.set(Rt,Bt);for(var ur=arguments.length,on=new Array(ur>2?ur-2:0),gr=2;gr<ur;gr++)on[gr-2]=arguments[gr];$.register.apply($,[Rt,Bt].concat(on))},deregister:function(Rt){k.delete(Rt);for(var Bt=arguments.length,ur=new Array(Bt>1?Bt-1:0),on=1;on<Bt;on++)ur[on-1]=arguments[on];$.deregister.apply($,[Rt].concat(ur))},getInitialValue:function(Rt){if(RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Rt)){var Bt=Rt.replace(i,""),ur=dt.get(Fe(),Bt);return Jn("Resetting ".concat(Bt," to ").concat(ur)),ur}return $.getInitialValue(Rt)}}),bn=function(Rt){return d.createElement(It.Provider,{value:Ur},d.createElement(St.Provider,{value:Kr},d.createElement($t.Provider,{value:Sr},Rt)))};return{render:bn,add:Wt,swap:Dt,addWithInitialValue:lr,fields:Or,arrayFieldState:Sr,arrayFieldApi:Kr,field:i}},nt=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getSavedValue:function(s){return i.getSavedValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})};function Lt(t){var r=Re(),i=(0,d.useMemo)(function(){return nt(t,r)},[t]);return i}function ei(){var t=(0,d.useContext)(At);return t}var se=function(r){var i=r.when,a=r.children,s=ei(),p=i(s);return p?a:null},Ce=function(r){var i=r.relevant,a=r.field,s=C(r,["relevant","field"]),p=Re();if(i){var y=p.getFullField(a),S={path:y,parentPath:y.replace(/(.*)[.[].*/,"$1"),get:function(k,$){return dt.get(k,$)}},w=function(k){var $=k.values;return i($,S)};return d.createElement(se,{when:w},d.createElement(_e,N({field:a},s)))}else return d.createElement(_e,N({field:a},s))},_e=function(r){var i=r.children,a=C(r,["children"]),s=po(a),p=s.render,y=s.arrayFieldState,S=s.arrayFieldApi,w=s.field;return p(typeof i=="function"?i(j(j({field:w,arrayFieldApi:S,arrayFieldState:y},S),y)):i)},ot=function(r){var i=r.arrayFieldItemState,a=r.arrayFieldItemApi,s=r.children,p=(0,d.useContext)(It),y=Re(),S=(0,d.useState)(0),w=Q(S,2),E=w[0],k=w[1],$=(0,d.useState)(new Map),ae=Q($,1),re=ae[0],le=i.field,ge=Lt(le),he=function(){var Be=y.getState(),je=Be.values,We=Be.errors,Je=Be.touched,ze={values:dt.get(je,le),errors:dt.get(We,le),touched:dt.get(Je,le)};return ze};(0,d.useEffect)(function(){var $e=function(je){var We=je.slice(0,je.lastIndexOf("[")!=-1?je.lastIndexOf("]")+1:je.length);We===le&&k(Math.random())};return y.emitter.on("value",$e),function(){y.emitter.removeListener("value",$e)}},[le]);var Se=function(){re.forEach(function(Be){Be.fieldApi.reset()})},me=he(),Fe=j(j({},p),{},{register:function(Be,je,We){re.set(Be,je),p.register(Be,je,We)},deregister:function(Be){re.delete(Be);for(var je=arguments.length,We=new Array(je>1?je-1:0),Je=1;Je<je;Je++)We[Je-1]=arguments[Je];p.deregister.apply(p,[Be].concat(We))}}),Ke=j(j(j({},a),ge),{},{reset:Se}),Ue=j(j({},i),me);return typeof s=="function"?d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s(j(j({arrayFieldItemApi:Ke,arrayFieldItemState:Ue},Ke),Ue))))):d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s)))};Ce.Items=function(t){var r=t.children,i=(0,d.useContext)($t),a=i.fields;return a.map(function(s){var p=s.arrayFieldItemState,y=s.arrayFieldItemApi,S=p.key;return d.createElement(ot,{key:S,arrayFieldItemApi:y,arrayFieldItemState:p},r)})};var st=function(r){var i=r.components,a=(0,d.useContext)(It),s=a.fieldMap;return i?i.map(function(p,y){var S=p["ui:control"],w=s[S];return d.createElement(w,{key:"ui-comp-".concat(y)})}):null},Kt=Le("informed:FormFields "),Zt=function t(r){var i=r.schema,a=r.prefix,s=r.onlyValidateSchema,p=(0,d.useContext)(It),y=p.fieldMap,S=(0,d.useMemo)(function(){var w=ce(i,s,a),E=w.map(function(k,$){var ae=k.field,re=k.props,le=k.type,ge=k.properties,he=k.items,Se=k.componentType,me=k.uiBefore,Fe=k.uiAfter,Ke=k.allOf,Ue=y[Se];return Kt("Rendering Field",ae,k),!Ue&&le==="object"&&ge?d.createElement(t,{schema:k,prefix:ae,key:"ScheamField-".concat($)}):!Ue&&le==="array"&&he?d.createElement(Tr,N({key:"ScheamField-".concat($),field:ae,items:he,uiBefore:me,uiAfter:Fe},re)):Ue&&Se==="array"&&he&&le==="array"?d.createElement(Ue,N({key:"ScheamField-".concat($),field:ae,items:he,uiBefore:me,uiAfter:Fe},re)):Se==="conditionals"?Ke.map(function($e){var Be=$e.then,je=$e.if.properties,We=function(ze){var et=ze.values;return Object.keys(je).every(function(wt){var Dt=je[wt];return et[wt]===Dt.const})};return d.createElement(se,{key:"ScheamField-".concat($),when:We},d.createElement(t,{schema:Be}))}):Ue?d.createElement(Ue,N({key:"ScheamField-".concat($),field:ae},re)):null});return E},[i,a]);return S},Tr=function(r){var i=r.field,a=r.items,s=r.uiBefore,p=r.uiAfter,y=C(r,["field","items","uiBefore","uiAfter"]);return d.createElement(Ce,N({field:i},y),d.createElement(st,{components:s}),d.createElement(Ce.Items,null,function(S){var w=S.field;return d.createElement(d.Fragment,null,d.createElement(st,{components:a["ui:before"]}),d.createElement(Zt,{schema:a,prefix:w}),d.createElement(st,{components:a["ui:after"]}))}),d.createElement(st,{components:p}))},Pr={select:mi,input:Sn,textarea:yi,checkbox:Pn,radio:qn,add:En,remove:Un,array:Tr},er=Le("informed:Controller "),Bl=function(r,i){var a=Object.keys(i).find(function(p){return r.includes(p)});if(!!a){var s=r.slice(0,a.length);return s===a}},_r=function(){},ms=function(){function t(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b(this,t),this.options=i,this.subscriptions=new Map;var a=i.ajv,s=i.schema,p=i.fieldMap;this.ajv=a?new a({allErrors:!0}):null,this.ajvValidate=a?this.ajv.compile(s):null,this.fieldMap=p||Pr,this.fieldsById=new Map,this.fieldsByName={get:function(S){var w;return r.fieldsById.forEach(function(E){E&&E.field===S&&(w=E)}),w}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:_r,setTouched:_r,setError:_r,reset:_r,validate:_r,getValue:_r,getTouched:_r,getError:_r,getFieldState:_r,checkRelevant:_r,getPristine:_r,getDirty:_r}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(S,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(S);k.shadow||dt.set(r.state.values,k.field,k.fieldApi.getValue()),k.fieldApi.relevant(r.state.values)||dt.delete(r.state.values,k.field),r.fieldsById.forEach(function($){var ae=$.fieldApi.checkRelevant();(!$.fieldApi.multistepRelevant(r.state.values)||!ae&&!$.keepState)&&(dt.delete(r.state.values,$.field),dt.delete(r.state.touched,$.field),dt.delete(r.state.errors,$.field))}),E&&(r.emit("change"),r.emit("field",k.field),r.emit("value",k.field,w))},setTouched:function(S,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(S);!k.shadow&&k.fieldApi.getIsRelevant()&&dt.set(r.state.touched,k.field,k.fieldApi.getTouched()),k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)&&dt.set(r.state.touched,k.field,k.fieldApi.getTouched()),E&&(r.emit("change"),r.emit("field",k.field))},setError:function(S,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(S);!k.shadow&&k.fieldApi.getIsRelevant()&&dt.set(r.state.errors,k.field,k.fieldApi.getError());var $=dt.get(r.state.errors,k.field);(k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)||k.shadow&&k.fieldApi.getError()===void 0&&k.fieldApi.relevant(r.state.values)&&typeof $=="string")&&dt.set(r.state.errors,k.field,k.fieldApi.getError()),E&&(r.emit("change"),r.emit("field",k.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",function(y){delete r.state.error,r.notify(y)})}return g(t,[{key:"emit",value:function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),p=1;p<a;p++)s[p-1]=arguments[p];var y=this.subscriptions.get(i);y&&y.forEach(function(S){return S.apply(void 0,s)})}},{key:"on",value:function(i,a){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(a)}},{key:"removeListener",value:function(i,a){var s=this.subscriptions.get(i);s.delete(a)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,a,s){this.getField(i).fieldApi.setValue(a,null,j({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,a){this.getField(i).fieldApi.setTouched(a)}},{key:"setError",value:function(i,a){this.getField(i).fieldApi.setError(a)}},{key:"setFormError",value:function(i){this.state.error=i,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(i,a){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,a),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(er("Submit",this.state),this.emit("submit")):(er("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(i){this.state.step=i,this.emit("change")}},{key:"setCurrent",value:function(i){this.state.Current=i,this.emit("change")}},{key:"back",value:function(i){this.state.step=this.state.step-1,this.state.Current=i,this.emit("change")}},{key:"next",value:function(i){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=i),this.emit("change")}},{key:"setInitialValue",value:function(i,a){dt.set(this.options.initialValues,i,a)}},{key:"getFormState",value:function(){return er("Returning form state"),j(j({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var a=this.getValues();return dt.get(a,i)}},{key:"getValue",value:function(i){var a=this.getField(i).fieldApi.getValue();return er("Getting value for",i,a),a}},{key:"getTouched",value:function(i){var a=this.getField(i).fieldApi.getTouched();return er("Getting touched for",i,a),a}},{key:"getError",value:function(i){var a=this.getField(i).fieldApi.getError();return er("Getting error for",i,a),a}},{key:"getDirty",value:function(i){var a=this.getField(i).fieldApi.getDirty();return er("Getting dirty for",i,a),a}},{key:"getPristine",value:function(i){var a=this.getField(i).fieldApi.getPristine();return er("Getting pristine for",i,a),a}},{key:"getValues",value:function(){return er("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return er("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return er("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.get(this.savedValues,"shadow-".concat(i)):dt.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.delete(this.savedValues,"shadow-".concat(i)):dt.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return dt.get(this.options.initialValues,i)}},{key:"getField",value:function(i){er("Getting Field",i);var a=this.fieldsByName.get(i);return a||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var a=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(p){var y=".".concat(i),S="".concat(y.replace(/(.*)[.[].*/,"$1"),".").concat(p).slice(1),w=a.getField(S);w&&(er("Notifying",w.field),w.fieldApi.validate(),w.fieldApi.checkRelevant())})}},{key:"validateField",value:function(i){this.getField(i).fieldApi.validate()}},{key:"resetField",value:function(i){this.getField(i).fieldApi.reset()}},{key:"fieldExists",value:function(i){return this.fieldsByName.get(i)!=null}},{key:"valid",value:function(){var i=this.getErrors();return!!(dt.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(a){var s=Q(a,2),p=s[1];return p.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!dt.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(a){a.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){er("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){er("Setting values"),this.fieldsById.forEach(function(a){var s=dt.get(i,a.field);s!==void 0&&a.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;er("Validating all fields");var a=this.getValues();if(this.options.validationSchema){var s=Ie(this.options.validationSchema,a);this.fieldsById.forEach(function(w){if(dt.has(s,w.field)){var E=dt.get(s,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.options.schema&&this.options.ajv){var p=P(this.ajvValidate,a);this.fieldsById.forEach(function(w){if(dt.has(p,w.field)){var E=dt.get(p,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.fieldsById.forEach(function(w){w.fieldApi.validate(a),w.fieldApi.setTouched(!0,!0)}),this.options.validate){var y=this.options.validate(a);this.setFormError(y)}if(this.options.validateFields){var S=this.options.validateFields(a);this.fieldsById.forEach(function(w){if(dt.has(S,w.field)){var E=dt.get(S,w.field);i.setError(w.field,E)}})}}},{key:"asyncValidate",value:function(){er("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(a){a.fieldApi.asyncValidate(i)})}},{key:"keyDown",value:function(i){if(i.keyCode==13&&this.options.preventEnter)return i.preventDefault(i),!1}},{key:"submitForm",value:function(i){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&i&&i.preventDefault(i),this.validate(),this.emit("change"),this.asyncValidate(),!(this.state.validating>0)&&(this.valid()?(er("Submit",this.state),this.emit("submit")):(er("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(a){i.emit("field",a.field)})}},{key:"register",value:function(i,a,s){var p=a.field,y=a.state;er("Register ID:",i,"Name:",p,y,"Initial",s);var S=p.slice(0,p.lastIndexOf("[")!=-1?p.lastIndexOf("]")+1:p.length),w;this.fieldsById.forEach(function(E,k){E&&E.field===p&&(w=k)}),w&&(a.keepState||a.inMultistep)?(er("Already Registered",p),this.fieldsById.delete(w)):w&&(!a.keepState||!a.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",p),er("Fields Registered",this.fieldsById.size),this.onScreen[i]=a,this.fieldsById.set(i,a),er("clearing expected removal",S),delete this.expectedRemovals[S],delete this.pulledOut[S],!a.shadow&&(this.updater.setValue(i,a.fieldApi.getValue(),!1),this.updater.setError(i,a.fieldApi.getError(),!1),this.updater.setTouched(i,a.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",p))}},{key:"deregister",value:function(i){var a=this.fieldsById.get(i),s=a.field;er("Deregister",i,s),delete this.onScreen[i];var p=Bl(s,this.expectedRemovals),y=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(a.keepState||a.inMultistep)&&!p&&(er("Saving field ".concat(s,"'s value"),a.fieldApi.getFieldState()),a.shadow?dt.set(this.savedValues,"shadow-".concat(s),a.fieldApi.getFieldState()):dt.set(this.savedValues,s,a.fieldApi.getFieldState())),(p||!a.keepState&&!a.inMultistep||!a.fieldApi.getIsRelevant()&&!a.keepState)&&(er("Removing field",s),this.fieldsById.delete(i),p||(dt.delete(this.state.values,s),dt.delete(this.state.touched,s),dt.delete(this.state.errors,s),a.shadow?dt.delete(this.savedValues,"shadow-".concat(s)):dt.delete(this.savedValues,s)),p&&this.pulledOut[y]&&(er("Pulling out",s,"with magic value",y),dt.pullOut(this.state.values,y),dt.pullOut(this.state.touched,y),dt.pullOut(this.state.errors,y),dt.pullOut(this.savedValues,y),delete this.pulledOut[y])),this.emit("change")}},{key:"expectRemoval",value:function(i){er("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,a,s){er("Update",i,a.field,s,a.fieldState.value);var p=a.fieldApi.getValue(),y=a.fieldApi.getError(),S=a.fieldApi.getTouched(),w=this.fieldsByName.get(s);s&&!w&&(dt.set(this.state.values,s),dt.set(this.state.errors,s),dt.set(this.state.touched,s)),dt.set(this.state.values,a.field,p),dt.set(this.state.errors,a.field,y),dt.set(this.state.touched,a.field,S),this.emit("change")}}]),t}(),Pa=Le("informed:FormProvider "),xs=function(r){var i=r.children,a=r.formApi,s=r.formController,p=r.formState,y=C(r,["children","formApi","formController","formState"]);if(Pa("Render FormProvider"),a)return Pa("Render FormProvider with given values"),d.createElement(It.Provider,{value:s.updater},d.createElement(jt.Provider,{value:a},d.createElement(At.Provider,{value:p},i)));Pa("Render FormProvider with generated values");var S=ws(y);return d.createElement(It.Provider,{value:S.formController.updater},d.createElement(jt.Provider,{value:S.formApi},d.createElement(At.Provider,{value:S.formState},i)))},bs=Le("informed:useForm "),ws=function(r){var i=r.dontPreventDefault,a=r.initialValues,s=r.validate,p=r.validateFields,y=r.allowEmptyStrings,S=r.preventEnter,w=r.getApi,E=r.apiRef,k=r.onChange,$=r.onReset,ae=r.onSubmit,re=r.onValueChange,le=r.onSubmitFailure,ge=r.validationSchema,he=r.schema,Se=r.ajv,me=r.fieldMap,Fe=r.onlyValidateSchema,Ke=C(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);bs("Render useForm");var Ue=(0,d.useMemo)(function(){return{dontPreventDefault:i,initialValues:a,validate:s,validateFields:p,allowEmptyStrings:y,preventEnter:S,validationSchema:ge,schema:he,ajv:Se,fieldMap:me}},[i,a,s,p,y,S,ge,he,Se,me]),$e=(0,d.useState)(function(){return new ms(Ue)}),Be=Q($e,1),je=Be[0];(0,d.useEffect)(function(){je.setOptions(Ue)},[Ue]),gt(function(){je.mount()},[]);var We=(0,d.useState)(function(){return je.getFormState()}),Je=Q(We,2),ze=Je[0],et=Je[1];gt(function(){var Mr=function(){return k&&k(je.getFormState())},Or=function(){return $&&$()},Kr=function(){return ae&&ae(je.getFormState().values)},Sr=function(){return re&&re(je.getFormState().values)},Ur=function(){return le&&le(je.getFormState().errors)};return je.on("change",Mr),je.on("reset",Or),je.on("submit",Kr),je.on("value",Sr),je.on("failure",Ur),function(){je.removeListener("change",Mr),je.removeListener("reset",Or),je.removeListener("submit",Kr),je.removeListener("value",Sr),je.removeListener("failure",Ur)}},[k,$,ae,re,le]),(0,d.useState)(function(){var Mr=function(){bs("Setting form state"),et(je.getFormState())};je.on("change",Mr),w&&w(je.getFormApi()),E&&(E.current=je.getFormApi())});var wt=(0,d.useState)(function(){return je.getFormApi()}),Dt=Q(wt,1),Wt=Dt[0],lr=function(Or){return d.createElement(xs,{formApi:Wt,formState:ze,formController:je},d.createElement(d.Fragment,null,Or||d.createElement(Zt,{schema:he,onlyValidateSchema:Fe})))};return{formApi:Wt,formState:ze,formController:je,render:lr,userProps:Ke}},Ul=Le("informed:Form "),jl=function(r){var i=r.children,a=r.render,s=r.component,p=C(r,["children","render","component"]);Ul("Render FORM");var y=ws(p),S=y.formApi,w=y.formController,E=y.formState,k=y.render,$=y.userProps,ae=function(){var le={formState:E,formApi:S};return s?d.createElement(s,le,i):a?a(le):typeof i=="function"?i(le):i};return k(d.createElement("form",N({},$,{onReset:w.reset,onSubmit:w.submitForm,onKeyDown:w.keyDown}),ae()))},gf=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},yf=function(r,i){var a=i.register,s=i.deregister,p=i.setValue,y=i.setTouched,S=i.setError,w=i.update,E=i.getField,k=i.expectRemoval,$=i.getInitialValue,ae=i.fieldMap,re=i.getSavedValue;return{register:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return a.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},deregister:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return s.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},update:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return w.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setValue:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return p.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setTouched:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return y.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setError:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return S.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getField:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return E.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},expectRemoval:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return k.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getInitialValue:function(ge){return $("".concat(r,".").concat(ge))},getSavedValue:function(ge){return re("".concat(r,".").concat(ge))},fieldMap:ae}},mf=function(r){var i=r.scope,a=r.children,s=useContext(It),p=Re(),y=ei(),S=useMemo(function(){return gf(i,p)},[i]),w=useMemo(function(){return yf(i,s)},[i]);return React.createElement(It.Provider,{value:w},React.createElement(jt.Provider,{value:S},React.createElement(At.Provider,{value:y},a)))},wi=function(r){var i=ei(),a={};Object.keys(r).length>0?Object.keys(r).forEach(function(re){a[re]=i[re]}):a=i;var s=a,p=s.pristine,y=s.dirty,S=s.invalid,w=s.values,E=s.errors,k=s.touched,$=s.validating,ae=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:p,dirty:y,invalid:S,values:w,errors:E,touched:k,validating:$,submitting:ae},null,2)))},xf=function(r){var i=r.initialStep,a=r.multistepApiRef,s=Re(),p=s.getValues,y=s.validate,S=s.screenValid,w=(0,d.useState)(new Map),E=Q(w,1),k=E[0],$=(0,d.useRef)(0),ae=be({current:i,steps:[],goal:null}),re=Q(ae,3),le=re[0],ge=re[1],he=re[2],Se=(0,d.useState)(function(){var Ue=function(){var je=he(),We=je.current,Je=k.get(We);return Je},$e={getState:function(){return he()},getCurrentStep:Ue,getStep:function(je){return k.get(je)},getNumberOfSteps:function(){return k.size},next:function(){if(y(),S()){var je=Ue(),We=je.getNext,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})}},back:function(){var je=Ue(),We=je.getPrevious,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})},setCurrent:function(je){if(je){var We=k.get(je).index;We<Ue().index?ge(function(Je){return j(j({},Je),{},{current:je,goal:null})}):ge(function(Je){return j(j({},Je),{},{goal:je})})}},register:function(je,We,Je){Je?($.current=$.current+1,k.set(je,j(j({},We),{},{index:$.current}))):ge(function(ze){return j(j({},ze),{},{steps:Array.from(k.keys())})})},deregister:function(je){k.delete(je),$.current=$.current-1,ge(function(We){return j(j({},We),{},{steps:Array.from(k.keys())})})}};return a&&(a.current=$e),$e}),me=Q(Se,1),Fe=me[0],Ke=function($e){return d.createElement(K.Provider,{value:Fe},d.createElement(G.Provider,{value:le},$e))};return j(j(j({},Fe),le),{},{render:Ke})};function bf(){return(0,d.useContext)(G)}function Ia(){return(0,d.useContext)(K)}var Vo=function(r){var i=r.step,a=r.next,s=r.previous,p=r.relevant,y=ei(),S=y.values,w=bf(),E=w.current,k=w.goal,$=Ia(),ae=$.register,re=$.deregister,le=$.next,ge=i===E,he=p?p(S):!0,Se=(0,d.useRef)(a),me=(0,d.useRef)(s),Fe=(0,d.useRef)();Se.current=a,me.current=s,Fe.current=p,(0,d.useState)(function(){ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return me.current}},!0)}),(0,d.useEffect)(function(){return ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return me.current}}),function(){re(i)}},[i]),(0,d.useEffect)(function(){k&&ge&&k!==i&&le()},[k,ge]);var Ke=function($e){return d.createElement(we.Provider,{value:{relevant:function(je){return Fe.current?Fe.current(je):!0},multistep:!0}},ge&&he?$e:null)};return{isCurrent:ge,isRelevant:he,step:i,render:Ke}};function wf(t){var r=t.children,i=C(t,["children"]),a=xf(i),s=a.render,p=C(a,["render"]);return s(typeof r=="function"?r(p):r)}wf.Step=function(r){var i=r.children,a=C(r,["children"]),s=Vo(a),p=s.render;return p(i)};var md=function(r){var i=r.field,a=useContext(It),s=a.fieldMap,p=Re(),y=p.getFullField,S=p.getOptions,w=y(i),E=S(),k=E.schema,$=Oe(w),ae=dt.get(k,$);if(!ae)return null;var re=ee(i,ae),le=re.props,ge=re.componentType,he=s[ge];return React.createElement(he,N({field:i},le))},xd=function(){var r=Re(),i=r.getOptions,a=i(),s=a.schema;return React.createElement(Zt,{schema:s})},bd=function(r){return React.forwardRef(function(i,a){return React.createElement(jt.Consumer,null,function(s){return React.createElement(r,N({formApi:s,ref:a},i))})})},Vl=function(r){return React.forwardRef(function(i,a){return React.createElement(At.Consumer,null,function(s){return React.createElement(r,N({formState:s,ref:a},i))})})},Wl=function(r,i){return{getValue:function(){return r.getValue(i)},setValue:function(s){return r.setValue(i,s)},getTouched:function(){return r.getTouched(i)},setTouched:function(s){return r.setTouched(i,s)},getError:function(){return r.getError(i)},setError:function(s){return r.setError(i,s)},reset:function(){return r.resetField(i)},validate:function(){return r.validateField(i)},exists:function(){return r.fieldExists(i)},getDirty:function(){return r.getDirty(i)},getPristine:function(){return r.getPristine(i)},getFieldState:function(){return r.getField(i).fieldApi.getFieldState()}}};function Hl(t){var r=Re(),i=useMemo(function(){return Wl(r,t)},[t]);return i}function zl(t){var r=Hl(t),i=Re(),a=React.useState(),s=Q(a,2),p=s[1],y=React.useCallback(function(){return p({})},[]);return gt(function(){var S=function(E){E===t&&y()};return i.emitter.on("field",S),function(){i.emitter.removeListener("field",S)}},[]),gt(function(){y()},[]),r.getFieldState()||{}}var Sf=function(r){return function(i){return function(a){var s=zl(r);return React.createElement(i,N({fieldState:s},a))}}},Ss=function(r){return function(i){return function(a){var s=Hl(r);return React.createElement(i,N({fieldApi:s},a))}}},As=function(r){var i=r.value,a=r.forwardedRef,s=r.children,p=C(r,["value","forwardedRef","children"]);return React.createElement("option",N({ref:a,value:i,key:i},p),s)},Gl=null,Wo=o(80150),zt=o(25446),Ki=o(25805),Gt=o(76671),Yi=o(78005),xt=o(39713),In=o(23485),Af=Object.defineProperty,Es=Object.defineProperties,$l=Object.getOwnPropertyDescriptors,ti=Object.getOwnPropertySymbols,Cs=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable,Ho=(t,r,i)=>r in t?Af(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ho=(t,r)=>{for(var i in r||(r={}))Cs.call(r,i)&&Ho(t,i,r[i]);if(ti)for(var i of ti(r))ri.call(r,i)&&Ho(t,i,r[i]);return t},Ji=(t,r)=>Es(t,$l(r));const Kl=In.iv`
80
+ `+ge)}else k[0]=ae+" "+k[0]}function a(k,$){if(k[0]=($.useColors?"%c":"")+$.namespace,!!$.useColors){var ae="color: "+$.color,re=0,le=0;k[0].replace(/%[a-zA-Z%]/g,function(ge){ge!=="%%"&&(re++,ge==="%c"&&(le=re))}),k.splice(le,0,ae)}}var s=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function p(){var k;try{k=localStorage.getItem("debug")}catch($){}return!k&&typeof process!="undefined"&&"env"in process&&(k={}.DEBUG),{namespaces:k||"",colors:s,useColors:!0,formatArgs:a}}function y(){return{namespaces:{}.DEBUG||"",colors:[6,2,3,4,5,1],useColors:!0,formatArgs:i}}function S(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,$=arguments.length>1?arguments[1]:void 0;return function(){for(var ae=arguments.length,re=new Array(ae),le=0;le<ae;le++)re[le]=arguments[le];k&&re.unshift(k);var ge=$.namespaces.split(",").map(function(Fe){return Fe[Fe.length-1]==="*"?new RegExp("^"+Fe.slice(0,Fe.length-1)+".*$"):new RegExp("^"+Fe+"$")}),he=ge.some(function(Fe){return Fe.test(k)}),Se={color:r(k,$.colors),namespace:k,useColors:$.useColors};if(!1)var me}}function w(k){return S(k,y())}function E(k){return S(k,p())}typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=E:t.exports=w}),ke=Le("informed:ObjMap "),rt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return String.prototype.replace.call(r,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean)},Qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,s=String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(p,y){return p!=null?p[y]:p},r);return s===void 0||s===r?a:s},Xe=function(r){return".".concat(r).replace(/(.*)[.[].*/,"$1").replace(/\./,"")},ut=function(r){return r.replace(Xe(r),"").replace(/\./,"")},pt=function(r,i){var a=Xe(i),s=ut(i),p=a?Qe(r,a):r;return!!(p&&Object.hasOwnProperty.call(p,s.replace(/\[(.*)\]/,"$1")))},yt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,S){return y===S.length-1?(s[p]=a,s[p]):s[p]===void 0?(Number.isInteger(+S[y+1])?s[p]=[]:s[p]={},s[p]):(Number.isInteger(+S[y+1])&&!Array.isArray(s[p])&&(s[p]=[]),s[p])},r)},qe=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=!1;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,S){return s===void 0?s:(y===S.length-1&&(delete s[p],a=!0),s[p])},r),a},lt=function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a;return String.prototype.replace.call(i,/\['(.+?)'\]/g,".$1").split(/[,[\].]+?/).filter(Boolean).reduce(function(s,p,y,S){return s===void 0?s:(y===S.length-1&&Array.isArray(s)&&(a=s.splice(p,1)),s[p])},r),a},vt=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=Object.keys(r);return i.map(function(a){return r[a]})},mt=function(r){var i=rt(r);return Number.isInteger(+i[i.length-1])},dt=function(){function t(){b(this,t)}return g(t,null,[{key:"empty",value:function(i){return vt(i).length===0}},{key:"get",value:function(i,a){var s=Qe(i,a);return s}},{key:"has",value:function(i,a){return pt(i,a)}},{key:"set",value:function(i,a,s){if(s!==void 0)ke("SETTING",a,s),yt(i,a,s);else if(mt(a)&&t.get(i,a)!==void 0){ke("Special case SETTING",a,"to undefined"),yt(i,a,void 0);var p=rt(a);p=p.slice(0,p.length-1),kt(i,p)}else!mt(a)&&t.get(i,a)!==void 0&&(ke("Special case REMOVING",a,"from object completley"),t.delete(i,a))}},{key:"delete",value:function(i,a){ke("DELETE",a),mt(a)?(ke("ARRAY",a),this.pullOut(i,a)):qe(i,a);var s=rt(a);s=s.slice(0,s.length-1),kt(i,s)}},{key:"pullOut",value:function(i,a){var s=rt(a),p=s[s.length-1];s=s.slice(0,s.length-1),ke("Pulling out:",s,"index",p);var y=Qe(i,s);ke("Array",y),Array.isArray(y)&&lt(y,p),kt(i,s)}}]),t}();function kt(t,r){if(r.length!==0){var i=Qe(t,r);(Array.isArray(i)?i.every(function(a){return a==null}):JSON.stringify(i)==="{}")&&qe(t,r),kt(t,r.slice(0,r.length-1))}}var It=d.createContext({register:function(){},deregister:function(){},setValue:function(){},setTouched:function(){},setError:function(){},update:function(){},getField:function(){},expectRemoval:function(){},getInitialValue:function(){},getSavedValue:function(){}}),At=d.createContext({}),jt=d.createContext({getFullField:function(){},getValues:function(){},getOptions:function(){return{}},setInitialValue:function(){},getInitialValue:function(){},getDerrivedValue:function(){},getSavedValue:function(){},removeSavedState:function(){}}),Nt=d.createContext(),$t=d.createContext(),St=d.createContext(),Mt=d.createContext(),pe=d.createContext(),G=d.createContext(),K=d.createContext(),we=d.createContext();function Re(){var t=(0,d.useContext)(jt);return t}function be(t){var r=(0,d.useRef)(),i=(0,d.useRef)(!0),a=(0,d.useState)(t),s=Q(a,2),p=s[0],y=s[1];r.current=p;var S=function(k){r.current=k,i.current&&y(k)},w=function(){return r.current};return(0,d.useEffect)(function(){return function(){i.current=!1}},[]),[p,S,w]}var Ae=function(r){return r.type&&r.type.name?r.type.name:r.displayName||r.name||"Component"},T=function(r){var i={};if(r.inner){if(r.inner.length===0){dt.set(i,r.path,r.message);return}var a=De(r.inner),s;try{for(a.s();!(s=a.n()).done;){var p=s.value;dt.get(i,p.path)||dt.set(i,p.path,p.message)}}catch(y){a.e(y)}finally{a.f()}}return i},Ie=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(s){var a=T(s);return a}},W=function(r){if(r.inner){if(r.inner.length===0)return;var i=r.inner[0];return i.message}},O=function(r,i){try{r.validateSync(i,{abortEarly:!1})}catch(a){return W(a)}},P=function(r,i){r(i);var a={};return r.errors&&r.errors.forEach(function(s){var p=s.message,y=s.dataPath,S=s.keyword,w=s.params,E=y;S==="required"&&(E="".concat(E,".").concat(w.missingProperty)),E=E.replace(".",""),dt.set(a,E,p)}),a},ie=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var i=Math.random()*16|0,a=r=="x"?i:i&3|8;return a.toString(16)})},D=function(r,i){var a;return function(){for(var p=arguments.length,y=new Array(p),S=0;S<p;S++)y[S]=arguments[S];var w=function(){clearTimeout(a),r.apply(void 0,y)};clearTimeout(a),a=setTimeout(w,i)}},ee=function(r,i,a){var s=i["ui:control"],p=i["informed:props"],y=i["input:props"],S=i["ui:before"],w=i["ui:after"],E=i.oneOf,k=i.items,$=i.enum,ae=i.title,re=i.minimum,le=i.maximum,ge=i.minLength,he=i.maxLength,Se=i.pattern,me=i.type,Fe=i.properties,Ke=ie();y&&y.id&&(Ke=y.id);var Ue={componentType:s,field:a?"".concat(a,".").concat(r):r,type:me,uiBefore:S,uiAfter:w,properties:me==="object"?Fe:void 0,items:me==="array"?k:void 0,props:j(j({label:ae,id:Ke,min:re,max:le,minLength:ge,maxLength:he,pattern:Se},p),y)};if(E){var $e=i.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=$e}if($){var Be=i.enum.map(function(We){return{value:We,label:We}});Ue.props.options=Be}if(k&&k.oneOf){var je=k.oneOf.map(function(We){var Je=We["input:props"],ze=Je===void 0?{}:Je;return j({value:We.const,label:We.title},ze)});Ue.props.options=je}return Ue},ce=function(r,i,a){if(!r||i)return[];var s=r.properties,p=s===void 0?{}:s,y=r.allOf,S=r.propertyOrder,w=S===void 0?[]:S;if(Object.keys(p).length>0){var E=Object.keys(p).sort(function(k,$){var ae=w.indexOf(k),re=w.indexOf($);return(ae>-1?ae:w.length+1)-(re>-1?re:w.length+1)}).map(function(k){var $=p[k],ae=ee(k,$,a);return ae});return y&&E.push({componentType:"conditionals",allOf:y}),E}return[]},Oe=function(r){var i=r.replace(/\./g,".properties.").replace(/\[/g,".itmes[");return i="properties.".concat(i),i},Pe=function(r,i){if(typeof r=="string")return r.split("").map(function(a){return a==="#"?/\d/:a==="*"?/[\w]/:a});if(typeof r=="function")return r(i);if(Array.isArray(r))return r;throw new Error("Formatter must be string, array, or function")},Te=function(r,i){for(var a=0,s=-1,p=!0;p&&a<r.length;)r[a]==i[a]?s=a:p=!1,a=a+1;return s},Ge=function(r,i){if(!r)return{val:r,offset:0};var a="".concat(r),s=Pe(i,a),p=s.findIndex(function(he){return typeof he!="string"}),y=s.length-Y(s).reverse().findIndex(function(he){return typeof he!="string"}),S=[],w=a.split(""),E=0,k=0,$=Te(s.slice(0,p),w.slice(0,p));$>-1&&(E=$+1,S=S.concat(s.slice(0,$+1)),k=$+1),$<0&&(S=S.concat(s.slice(0,p)),k=p);for(var ae=k;ae<s.length;ae++){var re=s[ae];if(E!=w.length){var le=w[E];if(typeof re=="function")S.push(re(le)),E=E+1;else{var ge=typeof re=="string"?re===le:re.test(le);ge&&typeof re=="string"?(S.push(re),E=E+1):!ge&&typeof re=="string"?E!=w.length&&S.push(re):ge&&typeof re!="string"?(S.push(le),E=E+1):!ge&&typeof re!="string"&&(E=E+1,ae=ae-1)}}else if(typeof re=="string"&&ae>=y)S.push(re);else break}return{value:S.join(""),offset:a?S.length-a.length:0}},He=function(r,i){var a,s,p=new Intl.NumberFormat(r,i),y=new Intl.NumberFormat(r),S=(a=(s=y.formatToParts(.1).find(function(he){var Se=he.type;return Se==="decimal"}))===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:".";function w(he,Se){return he instanceof RegExp&&Se instanceof RegExp&&he.source===Se.source&&he.global===Se.global&&he.ignoreCase===Se.ignoreCase&&he.multiline===Se.multiline}function E(he,Se){for(var me=he.length;me--;)if(Se(he[me]))return me;return-1}function k(he,Se,me){var Fe=Y(he);return Array.isArray(me)?Fe.splice.apply(Fe,[Se,0].concat(Y(me))):Fe.splice(Se,0,me),Fe}function $(he){return"".concat(he).replace(/\D/g,"")}function ae(he){return"".concat(he).split(S).map(function(Se){return $(Se)}).join(".")}function re(he){if(typeof he=="number")return he;var Se=parseFloat(ae(he));return Number.isNaN(Se)?void 0:Se}function le(he){var Se=ae(he),me="".concat(Se).split(".")[1],Fe=p.formatToParts(Number(Se));me==="0"&&Fe.push({type:"decimal",value:S},{type:"fraction",value:me});var Ke=Fe.reduce(function(Be,je){var We=je.type,Je=je.value;return["decimal","fraction"].includes(We)&&me==null?Be:["integer","fraction"].includes(We)?[].concat(Y(Be),Y(Je.split("").filter(function(ze,et){return We==="fraction"?et<me.length:!0}).map(function(){return/\d/}))):We==="currency"?[].concat(Y(Be),Y(Je.split(""))):[].concat(Y(Be),[Je])},[]),Ue=E(Ke,function(Be){return w(Be,/\d/)});Ke.indexOf(S)===-1&&"".concat(he).indexOf(S)!==-1&&(Ke=k(Ke,Ue+1,[S,"[]"]),Ue+=2);var $e=Ke.slice(Ue+1).join("");return Ke=[].concat(Y(Ke.slice(0,Ue+1)),[$e]),Ke}var ge=function(Se){if(Se!=null)return re(Se)};return{formatter:le,parser:ge}},it=Object.freeze({__proto__:null,getChildDisplayName:Ae,yupToFormErrors:T,validateYupSchema:Ie,yupToFormError:W,validateYupField:O,validateAjvSchema:P,uuidv4:ie,debounce:D,computeFieldFromProperty:ee,computeFieldsFromSchema:ce,getSchemaPathFromJsonPath:Oe,informedFormat:Ge,createIntlNumberFormatter:He}),gt=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?d.useLayoutEffect:d.useEffect,Ct=function(r){var i=r.value,a=r.inputRef,s=r.maintainCursor,p=s===void 0?!0:s,y=be(0),S=Q(y,3),w=S[0],E=S[1],k=S[2],$=be(0),ae=Q($,3),re=ae[0],le=ae[1],ge=ae[2];return gt(function(){if(a.current!=null&&k()){var he=k()+ge();ge()!=0&&p?a.current.setSelectionRange(he+1,he+1):p&&a.current.setSelectionRange(he,he)}},[i]),{setCursorOffset:le,setCursor:E,cursor:w,getCursor:k,cursorOffset:re}},Jt=function(r,i){var a=(0,d.useRef)(!0),s=a.current;(0,d.useEffect)(function(){if(s)a.current=!1;else return r()},i)},Ft=Le("informed:useField "),wn=function(r,i,a,s,p){if(r!=null){if(p)return p(r);if(i)return i(r);if(a&&!s){var y=Ge(r,a);return y.value}return r}},Zr=function(r,i,a,s){if(i&&a)return i(r);if(s){var p=Ge(r,s);return p.value}return r},On=function(r,i,a){var s=a.required;if(r||i)return function(p,y){if(i)return O(i,p);if(r)return r(p,y)};if(s)return function(p){return Tn(p,s)}},Gi=function(r){var i=r.fieldType,a=r.setValue,s=r.onChange,p=r.multiple,y=r.ref,S=function(E){return a(E)};return(i==="text"||i==="textArea"||i==="number")&&(S=function(E){return a(E.target.value,E)}),i==="select"&&(S=function(){var E=Array.from(y.current).filter(function(k){return k.selected}).map(function(k){return k.value});a(p?E:E[0]||"")}),i==="checkbox"&&(S=function(E){a(E.target.checked),s&&s(E)}),function(w){S(w)}},jr=function(r){var i=r.setTouched,a=r.onBlur;return function(s){i(!0),a&&a(s)}},Nn=function(r){var i=r.fieldType,a=r.maskedValue,s=r.multiple,p=r.value;switch(i){case"text":case"number":return!a&&a!==0?"":a;case"textArea":return a||"";case"select":return p||(s?[]:"");case"checkbox":return!!p;default:return p}},$n=function(r){switch(r){case"text":return r;case"number":return r;case"checkbox":return r;default:return}},Tn=function(r,i){if(i&&(r==null||r===""))return typeof i=="string"?i:"This field is required"};function Kn(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=t.field,a=t.validate,s=t.asyncValidate,p=t.validationSchema,y=t.mask,S=t.maskWithCursorOffset,w=t.format,E=t.parse,k=t.formatter,$=t.parser,ae=t.initialValue,re=t.validateOnChange,le=t.validateOnBlur,ge=t.validateOnMount,he=t.asyncValidateOnBlur,Se=t.maskOnBlur,me=t.allowEmptyString,Fe=t.onValueChange,Ke=t.notify,Ue=t.keepState,$e=t.maintainCursor,Be=t.debug,je=t.shadow,We=t.step,Je=t.fieldType,ze=t.multiple,et=t.onChange,wt=t.onBlur,Dt=t.formController,Wt=t.relevant,lr=t.required,Mr=t.keepStateIfRelevant,Or=t.initialize,Kr=t.formatterDependencies,Sr=Kr===void 0?[]:Kr,Ur=C(t,["field","validate","asyncValidate","validationSchema","mask","maskWithCursorOffset","format","parse","formatter","parser","initialValue","validateOnChange","validateOnBlur","validateOnMount","asyncValidateOnBlur","maskOnBlur","allowEmptyString","onValueChange","notify","keepState","maintainCursor","debug","shadow","step","fieldType","multiple","onChange","onBlur","formController","relevant","required","keepStateIfRelevant","initialize","formatterDependencies"]),bn=(0,d.useState)(ie()),Xt=Q(bn,1),Rt=Xt[0],Bt=(0,d.useContext)(It),ur=(0,d.useContext)(we),on=ur||Mr,gr=Re(),gs=(0,d.useRef)(),Fl=(0,d.useRef)(!0),Aa=(0,d.useRef)(),Hi=(0,d.useRef)(!1),kl=function(){return!Hi.current},df=function(){return Hi.current};Dt&&(Bt=Dt.updater,gr=Dt.getFormApi());var gi=On(a,p,{required:lr}),Rl=(0,d.useState)(function(){return Bt.getInitialValue(i)}),gm=Q(Rl,1),ym=gm[0],pf=Bt.getSavedValue(i),hf,ah;(Ue||on)&&pf?(Ft("Setting field ".concat(yd,"'s kept state"),pf),hf=pf.value,ah=pf.touched,gr.removeSavedState(yd)):ae!=null?hf=ae:hf=ym;var mm=be(wn(hf,y,k,$,Or)),nd=Q(mm,3),Ml=nd[0],id=nd[1],xm=nd[2],bm=be(ge?gi(Ml):void 0),od=Q(bm,3),sh=od[0],lh=od[1],wm=od[2],Sm=be(ah),ad=Q(Sm,3),uh=ad[0],Am=ad[1],fh=ad[2],Em=(0,d.useState)(function(){return Zr(Ml,w,E,k)}),ch=Q(Em,2),sd=ch[0],ld=ch[1],dh=(0,d.useRef)();dh.current=sd;var ph=(0,d.useRef)(ae),Ea=(0,d.useRef)(i),hh=(0,d.useRef)();ph.current=ae,Ea.current=i;var Cm=(0,d.useRef)(null),zi=d.useMemo(function(){return r||Cm},[]),ud=Ct({value:Ml,inputRef:zi,maintainCursor:!!$e}),fd=ud.getCursor,Om=ud.setCursor,cd=ud.setCursorOffset,Tm=function(){return!0},dd=function(fr){var an=Wt||Tm,Ln=gr.getFullField(Ea.current)||Ea.current,Qt={path:Ln,parentPath:Ln.replace(/(.*)[.[].*/,"$1"),get:function(Dn,Nl){return dt.get(Dn,Nl)}};return ur&&ur.relevant?an(fr,Qt)&&ur.relevant(fr,Qt):an(fr,Qt)},Pm=be(dd(gr.getValues())),pd=Q(Pm,3),vf=pd[0],Im=pd[1],vh=pd[2],Fm=function(fr){return ur&&ur.relevant?ur.relevant(fr):!0},km=function(){var fr=dd(gr.getValues()),an=vh();return fr!=an&&Im(fr),fr};(0,d.useEffect)(function(){!vf&&!Ue&&gs.current.reset()},[vf]);var _n=function(){return je?gr.getDerrivedValue(i):xm()},Ll=function(fr){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ln=an.preventUpdate;We&&gr.getStep()<We?(Ft("Setting ".concat(i,"'s error to undefined as we are not at that step")),lh(void 0),Bt.setError(Rt,void 0,!Ln)):(Ft("Setting ".concat(i,"'s error to ").concat(fr)),lh(fr),Bt.setError(Rt,fr,!Ln))},hd=function(fr,an){var Ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Qt=fr;Hi.current=!0,Ft("Setting ".concat(i," to ").concat(Qt)),Or&&(Qt=Or(Qt));var Ca=gr.getOptions(),Dn=Qt;if(Qt===""&&!me&&!Ln.allowEmptyString&&!Ca.allowEmptyStrings&&(Qt=void 0),(t.type==="number"||Je==="number")&&Qt!==void 0&&(Qt=+Qt),an&&an.target&&an.target.selectionStart&&Om(an.target.selectionStart),y&&!Se&&(Dn=y(Qt,fd()),Qt=y(Qt,fd())),S&&!Se){var Nl=S(Qt,fd());Dn=Nl.value,Qt=Nl.value,cd(Nl.offset)}if(w&&E&&(Qt=E(Qt),Dn=w(Qt)),k){var gh=Ge(Qt,k);cd(gh.offset),Dn=gh.value,Qt=Dn}$&&(Qt=Qt!=null?$(Qt):Qt),gi&&re&&!Ln.initial&&(Ft("Validating after change ".concat(i," ").concat(Qt)),Ll(gi(Qt,gr.getValues()))),id(Qt),ld(Dn),Fe&&Fe(Qt),Bt.setValue(Rt,Qt,!Ln.preventUpdate)};Jt(function(){gs.current.setValue(dh.current)},Y(Sr));var vd=function(fr,an){var Ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Qt=Ln.preventUpdate;if(Ft("Field ".concat(i," has been touched")),gi&&le&&!an&&fr&&(Ft("Validating after blur ".concat(i," ").concat(_n())),Ll(gi(_n(),gr.getValues()))),s&&he&&!an&&fr&&(Ft("Validating async after blur ".concat(i," ").concat(_n())),s(_n(),gr.getValues())),y&&Se){var Ca=y(_n());id(Ca),ld(Ca),Fe&&Fe(Ca),Bt.setValue(Rt,Ca,!Qt)}if(S&&Se){var Dn=S(_n());cd(Dn.offset),id(Dn.value),ld(Dn.value),Fe&&Fe(Dn.value),Bt.setValue(Rt,Dn.value,!Qt)}Am(fr),Bt.setTouched(Rt,fr,!Qt)},Rm=function(){var fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},an=fr.preventUpdate,Ln=wn(ph.current||Bt.getInitialValue(Ea.current),y,k,$,Or);hd(Ln,null,{initial:!0,preventUpdate:an}),Ll(ge?gi(Ln):void 0,{preventUpdate:an}),vd(void 0,!0,{preventUpdate:an}),Hi.current=!1},Mm=function(fr){gi&&(Ft("Field validating ".concat(i," ").concat(_n())),Ll(gi(_n(),fr||gr.getValues())))},Lm=function(fr){s&&(Ft("Field async validating ".concat(i," ").concat(_n())),s(_n(),fr||gr.getValues()))},gd={setValue:hd,setTouched:vd,setError:Ll,reset:Rm,validate:Mm,asyncValidate:Lm,getValue:_n,getTouched:fh,getError:wm,getIsRelevant:vh,getDirty:df,getPristine:kl,getFieldState:function(){return{value:_n(),touched:fh(),dirty:df(),pristine:kl()}},relevant:dd,multistepRelevant:Fm,checkRelevant:km};gs.current=gd;var Dl={value:Ml,error:sh,touched:uh,maskedValue:sd,isRelevant:vf,dirty:Hi.current,pristine:!Hi.current};je&&(Dl={error:sh,touched:uh}),Ft("Render",gr.getFullField(i),Dl),gt(function(){var Qr=gr.getFullField(Ea.current);return Ft("Register",Rt,Ea.current),Aa.current={field:Qr,fieldId:Rt,fieldApi:gd,fieldState:Dl,notify:Ke,keepState:Ue,inMultistep:on,shadow:je},Bt.register(Rt,Aa.current),function(){var fr=gr.getFullField(Ea.current);Ft("Deregister",Rt,fr),Bt.deregister(Rt)}},[]),(0,d.useEffect)(function(){var Qr=gr.getFullField(i);return Fl.current?Fl.current=!1:(Ft("Update",i,on),Aa.current.field=Qr,Bt.update(Rt,Aa.current,hh.current)),function(){hh.current=Qr}},[i]),gt(function(){Be&&zi&&(zi.current.style.border="5px solid orange",setTimeout(function(){zi.current.style.borderWidth="2px",zi.current.style.borderStyle="inset",zi.current.style.borderColor="initial",zi.current.style.borderImage="initial"},500))});var Dm=[].concat(Y(Object.values(Dl)),Y(Object.values(t)),Y(Object.values(Ur))),Nm=function(fr){return(0,d.useMemo)(function(){return vf?fr:null},Y(Dm))},yd=i,Bm=Gi({fieldType:Je,setValue:hd,onChange:et,multiple:ze,ref:zi}),Um=jr({setTouched:vd,onBlur:wt}),jm=Nn({fieldType:Je,maskedValue:sd,multiple:ze,value:Ml}),Vm=$n(Je);return{fieldState:Dl,fieldApi:gd,render:Nm,ref:zi,userProps:j(j({},Ur),{},{multiple:ze,onChange:et,onBlur:wt,id:Ur.id||Rt}),informed:j({name:yd,multiple:ze,onChange:Bm,onBlur:Um,value:jm,ref:zi,type:Vm,id:Ur.id||Rt},Ur)}}var pn=function(r){var i=d.forwardRef(function(a,s){var p=Kn(a,s),y=p.fieldState,S=p.fieldApi,w=p.render,E=p.ref,k=p.userProps;return w(d.createElement(r,N({fieldApi:S,fieldState:y,field:a.field,forwardedRef:E,debug:a.debug,type:a.type},k)))});return i.displayName="asField(".concat(Ae(r),")"),i},Oa=Le("informed:Text "),jo=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,S=i.setTouched,w=s.onChange,E=s.onBlur,k=s.field,$=s.initialValue,ae=s.forwardedRef,re=s.debug,le=s.label,ge=s.title,he=s.id,Se=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","title","id"]);return Oa("Render",k),gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,le?d.createElement("label",{htmlFor:he}," ",le," "):null,d.createElement("input",N({},Se,{id:he,name:k,ref:ae,value:!p&&p!==0?"":p,onChange:function(Fe){y(Fe.target.value,Fe),w&&w(Fe)},onBlur:function(Fe){S(!0),E&&E(Fe)}})))},Sn=pn(jo),Yn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.maskedValue,y=i.setValue,S=i.setTouched,w=s.onChange,E=s.onBlur,k=s.field,$=s.initialValue,ae=s.forwardedRef,re=s.debug,le=s.label,ge=s.id,he=C(s,["onChange","onBlur","field","initialValue","forwardedRef","debug","label","id"]);return gt(function(){re&&ae&&(ae.current.style.background="red",setTimeout(function(){ae.current.style.background="white"},500))}),d.createElement(d.Fragment,null,le?d.createElement("label",{htmlFor:ge}," ",le," "):null,d.createElement("textarea",N({},he,{id:ge,name:k,ref:ae,value:p||"",onChange:function(me){y(me.target.value,me),w&&w(me)},onBlur:function(me){S(!0),E&&E(me)}})))},yi=pn(Yn),$i=Le("informed:Select "),Bn=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setTouched,S=s.onChange,w=s.onBlur,E=s.field,k=s.initialValue,$=s.options,ae=s.children,re=s.forwardedRef,le=s.debug,ge=s.multiple,he=s.label,Se=s.id,me=C(s,["onChange","onBlur","field","initialValue","options","children","forwardedRef","debug","multiple","label","id"]),Fe=(0,d.useRef)(),Ke=function($e){var Be=Array.from((re||Fe).current).filter(function(je){return je.selected}).map(function(je){return je.value});i.setValue(ge?Be:Be[0]||""),S&&$e&&S($e)};return gt(function(){le&&re&&(re.current.style.background="red",setTimeout(function(){re.current.style.background="white"},500))}),$i("Render",E,p),d.createElement(d.Fragment,null,he?d.createElement("label",{htmlFor:Se}," ",he," "):null,d.createElement("select",N({},me,{id:Se,multiple:ge,name:E,ref:re||Fe,value:p||(ge?[]:""),onChange:Ke,onBlur:function($e){y(!0),w&&w($e)}}),$?$.map(function(Ue){return d.createElement("option",{key:Ue.value,value:Ue.value,disabled:Ue.disabled},Ue.label)}):ae))},mi=pn(Bn),Ta=function(r){var i=r.fieldApi,a=r.fieldState,s=C(r,["fieldApi","fieldState"]),p=a.value,y=i.setValue,S=i.setTouched,w=s.onChange,E=s.onBlur,k=s.field,$=s.initialValue,ae=s.debug,re=s.forwardedRef,le=s.id,ge=s.label,he=C(s,["onChange","onBlur","field","initialValue","debug","forwardedRef","id","label"]);return d.createElement(d.Fragment,null,ge?d.createElement("label",{htmlFor:le}," ",ge," "):null,d.createElement("input",N({},he,{id:le,name:k,ref:re,checked:!!p,onChange:function(me){y(me.target.checked),w&&w(me)},onBlur:function(me){S(!0),E&&E(me)},type:"checkbox"})))},Pn=pn(Ta),An=function(r){return d.forwardRef(function(i,a){return d.createElement(Nt.Consumer,null,function(s){var p=s.radioGroupApi,y=s.radioGroupState;return d.createElement(r,N({radioGroupApi:p,radioGroupState:y,ref:a},i))})})},xi=function(r){var i=r.radioGroupApi,a=r.radioGroupState,s=C(r,["radioGroupApi","radioGroupState"]),p=a.value,y=i.setValue,S=i.setTouched,w=i.onChange,E=i.onBlur,k=s.value,$=s.onChange,ae=s.onBlur,re=s.field,le=s.initialValue,ge=s.forwardedRef,he=C(s,["value","onChange","onBlur","field","initialValue","forwardedRef"]);return d.createElement("input",N({},he,{name:re,ref:ge,value:k,checked:p===k,onChange:function(me){!me.target.checked||(y(k),$&&$(me),w&&w(me))},onBlur:function(me){S(!0),ae&&ae(me),E&&E(me)},type:"radio"}))},mr=An(xi),Et=function(t){_(i,t);var r=q(i);function i(){return b(this,i),r.apply(this,arguments)}return g(i,[{key:"render",value:function(){var s=this.props,p=s.options,y=s.children;return d.createElement(Nt.Provider,{value:this.groupContext},p?p.map(function(S){return d.createElement("label",{key:S.value},S.label," ",d.createElement(mr,{value:S.value}))}):y)}},{key:"groupContext",get:function(){return{radioGroupApi:j(j({},this.props.fieldApi),{},{onChange:this.props.onChange,onBlur:this.props.onBlur}),radioGroupState:this.props.fieldState}}}]),i}(d.Component),qn=pn(Et);function bi(){return(0,d.useContext)(St)}var En=function(){var r=bi(),i=r.add;return d.createElement("button",{onClick:function(){i()},type:"button"},"Add")};function qt(){return(0,d.useContext)(Mt)}var Un=function(){var r=qt(),i=r.remove;return d.createElement("button",{onClick:function(){i()},type:"button"},"Remove")},Jn=Le("informed:useArrayField "),po=function(r){var i=r.field,a=r.initialValue,s=r.validate,p=r.arrayFieldApiRef,y=C(r,["field","initialValue","validate","arrayFieldApiRef"]),S=Re(),w=(0,d.useState)(new Map),E=Q(w,1),k=E[0],$=(0,d.useContext)(It),ae=S.getFullField(i),re=$.getInitialValue(i)||a||[],le=S.getSavedValue(ae)&&S.getSavedValue(ae).value,ge=be(le||re),he=Q(ge,3),Se=he[0],me=he[1],Fe=he[2],Ke=Se?Se.map(function(){return ie()}):[],Ue=be(Ke),$e=Q(Ue,3),Be=$e[0],je=$e[1],We=$e[2],Je=(0,d.useMemo)(function(){return function(Xt,Rt){var Bt=We()==null?0:We().length;return s?s(Xt,Bt,Rt):void 0}}),ze=Kn(j({field:i,validate:s?Je:void 0,shadow:!0},y)),et=ze.fieldApi;gt(function(){var Xt=function(Bt){Bt!==ae&&(Jn("".concat(ae," changed")),RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Bt)&&et.validate())};return S.emitter.on("value",Xt),function(){S.emitter.removeListener("value",Xt)}},[i]);var wt=function(Rt){Jn("EXPECTING REMOVAL OF","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Be.length-1,"]")),$.expectRemoval("".concat(i,"[").concat(Rt,"]")),$.expectRemoval("".concat(i,"[").concat(Be.length-1,"]"));var Bt=Be.slice(0,Rt).concat(Be.slice(Rt+1,Be.length));je(Bt);var ur=Fe(),on=ur.slice(0,Rt).concat(ur.slice(Rt+1,ur.length));me(on)},Dt=function(Rt,Bt){Jn("Swapping","".concat(i,"[").concat(Rt,"] and ").concat(i,"[").concat(Bt,"]"));var ur=Y(Be);Be[Rt]&&Be[Bt]?(ur[Rt]=Be[Bt],ur[Bt]=Be[Rt]):console.warn("Attempted to swap ".concat(Rt," with ").concat(Bt," but one of them does not exist :(")),je(ur)},Wt=function(){Be.push(ie()),je(Y(Be))},lr=function(Rt){Be.push(ie()),je(Y(Be));var Bt=Y(Fe());Bt[Be.length-1]=Rt,me(Bt)},Mr=function(){var Rt=$.getInitialValue(i)||a||[];me(Rt);var Bt=Rt?Rt.map(function(){return ie()}):[];je(Bt)},Or=Be.map(function(Xt,Rt){var Bt={remove:function(){return wt(Rt)}},ur={initialValue:Se&&Se[Rt],key:Xt,field:"".concat(i,"[").concat(Rt,"]"),index:Rt};return j(j({arrayFieldItemApi:Bt,arrayFieldItemState:ur},Bt),ur)}),Kr={add:Wt,swap:Dt,addWithInitialValue:lr,reset:Mr};p&&(p.current=Kr);var Sr={fields:Or,field:i},Ur=j(j({},$),{},{register:function(Rt,Bt){k.set(Rt,Bt);for(var ur=arguments.length,on=new Array(ur>2?ur-2:0),gr=2;gr<ur;gr++)on[gr-2]=arguments[gr];$.register.apply($,[Rt,Bt].concat(on))},deregister:function(Rt){k.delete(Rt);for(var Bt=arguments.length,ur=new Array(Bt>1?Bt-1:0),on=1;on<Bt;on++)ur[on-1]=arguments[on];$.deregister.apply($,[Rt].concat(ur))},getInitialValue:function(Rt){if(RegExp("".concat(ae,"\\[[0-9]+\\]")).test(Rt)){var Bt=Rt.replace(i,""),ur=dt.get(Fe(),Bt);return Jn("Resetting ".concat(Bt," to ").concat(ur)),ur}return $.getInitialValue(Rt)}}),bn=function(Rt){return d.createElement(It.Provider,{value:Ur},d.createElement(St.Provider,{value:Kr},d.createElement($t.Provider,{value:Sr},Rt)))};return{render:bn,add:Wt,swap:Dt,addWithInitialValue:lr,fields:Or,arrayFieldState:Sr,arrayFieldApi:Kr,field:i}},nt=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getSavedValue:function(s){return i.getSavedValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})};function Lt(t){var r=Re(),i=(0,d.useMemo)(function(){return nt(t,r)},[t]);return i}function ei(){var t=(0,d.useContext)(At);return t}var se=function(r){var i=r.when,a=r.children,s=ei(),p=i(s);return p?a:null},Ce=function(r){var i=r.relevant,a=r.field,s=C(r,["relevant","field"]),p=Re();if(i){var y=p.getFullField(a),S={path:y,parentPath:y.replace(/(.*)[.[].*/,"$1"),get:function(k,$){return dt.get(k,$)}},w=function(k){var $=k.values;return i($,S)};return d.createElement(se,{when:w},d.createElement(_e,N({field:a},s)))}else return d.createElement(_e,N({field:a},s))},_e=function(r){var i=r.children,a=C(r,["children"]),s=po(a),p=s.render,y=s.arrayFieldState,S=s.arrayFieldApi,w=s.field;return p(typeof i=="function"?i(j(j({field:w,arrayFieldApi:S,arrayFieldState:y},S),y)):i)},ot=function(r){var i=r.arrayFieldItemState,a=r.arrayFieldItemApi,s=r.children,p=(0,d.useContext)(It),y=Re(),S=(0,d.useState)(0),w=Q(S,2),E=w[0],k=w[1],$=(0,d.useState)(new Map),ae=Q($,1),re=ae[0],le=i.field,ge=Lt(le),he=function(){var Be=y.getState(),je=Be.values,We=Be.errors,Je=Be.touched,ze={values:dt.get(je,le),errors:dt.get(We,le),touched:dt.get(Je,le)};return ze};(0,d.useEffect)(function(){var $e=function(je){var We=je.slice(0,je.lastIndexOf("[")!=-1?je.lastIndexOf("]")+1:je.length);We===le&&k(Math.random())};return y.emitter.on("value",$e),function(){y.emitter.removeListener("value",$e)}},[le]);var Se=function(){re.forEach(function(Be){Be.fieldApi.reset()})},me=he(),Fe=j(j({},p),{},{register:function(Be,je,We){re.set(Be,je),p.register(Be,je,We)},deregister:function(Be){re.delete(Be);for(var je=arguments.length,We=new Array(je>1?je-1:0),Je=1;Je<je;Je++)We[Je-1]=arguments[Je];p.deregister.apply(p,[Be].concat(We))}}),Ke=j(j(j({},a),ge),{},{reset:Se}),Ue=j(j({},i),me);return typeof s=="function"?d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s(j(j({arrayFieldItemApi:Ke,arrayFieldItemState:Ue},Ke),Ue))))):d.createElement(It.Provider,{value:Fe},d.createElement(Mt.Provider,{value:Ke},d.createElement(pe.Provider,{value:Ue},s)))};Ce.Items=function(t){var r=t.children,i=(0,d.useContext)($t),a=i.fields;return a.map(function(s){var p=s.arrayFieldItemState,y=s.arrayFieldItemApi,S=p.key;return d.createElement(ot,{key:S,arrayFieldItemApi:y,arrayFieldItemState:p},r)})};var st=function(r){var i=r.components,a=(0,d.useContext)(It),s=a.fieldMap;return i?i.map(function(p,y){var S=p["ui:control"],w=s[S];return d.createElement(w,{key:"ui-comp-".concat(y)})}):null},Kt=Le("informed:FormFields "),Zt=function t(r){var i=r.schema,a=r.prefix,s=r.onlyValidateSchema,p=(0,d.useContext)(It),y=p.fieldMap,S=(0,d.useMemo)(function(){var w=ce(i,s,a),E=w.map(function(k,$){var ae=k.field,re=k.props,le=k.type,ge=k.properties,he=k.items,Se=k.componentType,me=k.uiBefore,Fe=k.uiAfter,Ke=k.allOf,Ue=y[Se];return Kt("Rendering Field",ae,k),!Ue&&le==="object"&&ge?d.createElement(t,{schema:k,prefix:ae,key:"ScheamField-".concat($)}):!Ue&&le==="array"&&he?d.createElement(Tr,N({key:"ScheamField-".concat($),field:ae,items:he,uiBefore:me,uiAfter:Fe},re)):Ue&&Se==="array"&&he&&le==="array"?d.createElement(Ue,N({key:"ScheamField-".concat($),field:ae,items:he,uiBefore:me,uiAfter:Fe},re)):Se==="conditionals"?Ke.map(function($e){var Be=$e.then,je=$e.if.properties,We=function(ze){var et=ze.values;return Object.keys(je).every(function(wt){var Dt=je[wt];return et[wt]===Dt.const})};return d.createElement(se,{key:"ScheamField-".concat($),when:We},d.createElement(t,{schema:Be}))}):Ue?d.createElement(Ue,N({key:"ScheamField-".concat($),field:ae},re)):null});return E},[i,a]);return S},Tr=function(r){var i=r.field,a=r.items,s=r.uiBefore,p=r.uiAfter,y=C(r,["field","items","uiBefore","uiAfter"]);return d.createElement(Ce,N({field:i},y),d.createElement(st,{components:s}),d.createElement(Ce.Items,null,function(S){var w=S.field;return d.createElement(d.Fragment,null,d.createElement(st,{components:a["ui:before"]}),d.createElement(Zt,{schema:a,prefix:w}),d.createElement(st,{components:a["ui:after"]}))}),d.createElement(st,{components:p}))},Pr={select:mi,input:Sn,textarea:yi,checkbox:Pn,radio:qn,add:En,remove:Un,array:Tr},er=Le("informed:Controller "),Bl=function(r,i){var a=Object.keys(i).find(function(p){return r.includes(p)});if(!!a){var s=r.slice(0,a.length);return s===a}},_r=function(){},ys=function(){function t(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};b(this,t),this.options=i,this.subscriptions=new Map;var a=i.ajv,s=i.schema,p=i.fieldMap;this.ajv=a?new a({allErrors:!0}):null,this.ajvValidate=a?this.ajv.compile(s):null,this.fieldMap=p||Pr,this.fieldsById=new Map,this.fieldsByName={get:function(S){var w;return r.fieldsById.forEach(function(E){E&&E.field===S&&(w=E)}),w}},this.onScreen={},this.expectedRemovals={},this.pulledOut={},this.savedValues={},this.state={pristine:!0,dirty:!1,invalid:!1,submits:0,step:0,validating:0,submitting:!1,values:{},errors:{},touched:{}},this.dummyField={fieldApi:{setValue:_r,setTouched:_r,setError:_r,reset:_r,validate:_r,getValue:_r,getTouched:_r,getError:_r,getFieldState:_r,checkRelevant:_r,getPristine:_r,getDirty:_r}},this.deregister=this.deregister.bind(this),this.register=this.register.bind(this),this.getValue=this.getValue.bind(this),this.getTouched=this.getTouched.bind(this),this.getError=this.getError.bind(this),this.getErrors=this.getErrors.bind(this),this.setValue=this.setValue.bind(this),this.getValues=this.getValues.bind(this),this.getStep=this.getStep.bind(this),this.setStep=this.setStep.bind(this),this.back=this.back.bind(this),this.next=this.next.bind(this),this.setCurrent=this.setCurrent.bind(this),this.setTouched=this.setTouched.bind(this),this.setError=this.setError.bind(this),this.setFormError=this.setFormError.bind(this),this.submitForm=this.submitForm.bind(this),this.reset=this.reset.bind(this),this.update=this.update.bind(this),this.validate=this.validate.bind(this),this.screenValid=this.screenValid.bind(this),this.keyDown=this.keyDown.bind(this),this.getField=this.getField.bind(this),this.getInitialValue=this.getInitialValue.bind(this),this.setInitialValue=this.setInitialValue.bind(this),this.getOptions=this.getOptions.bind(this),this.getFormState=this.getFormState.bind(this),this.expectRemoval=this.expectRemoval.bind(this),this.getSavedValue=this.getSavedValue.bind(this),this.removeSavedState=this.removeSavedState.bind(this),this.getDerrivedValue=this.getDerrivedValue.bind(this),this.setValues=this.setValues.bind(this),this.resetField=this.resetField.bind(this),this.fieldExists=this.fieldExists.bind(this),this.validateField=this.validateField.bind(this),this.notify=this.notify.bind(this),this.validating=this.validating.bind(this),this.validated=this.validated.bind(this),this.getDirty=this.getDirty.bind(this),this.getPristine=this.getPristine.bind(this),this.on=this.on.bind(this),this.emit=this.emit.bind(this),this.removeListener=this.removeListener.bind(this),this.updater={register:this.register,deregister:this.deregister,getField:this.getField,update:this.update,fieldMap:this.fieldMap,setValue:function(S,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(S);k.shadow||dt.set(r.state.values,k.field,k.fieldApi.getValue()),k.fieldApi.relevant(r.state.values)||dt.delete(r.state.values,k.field),r.fieldsById.forEach(function($){var ae=$.fieldApi.checkRelevant();(!$.fieldApi.multistepRelevant(r.state.values)||!ae&&!$.keepState)&&(dt.delete(r.state.values,$.field),dt.delete(r.state.touched,$.field),dt.delete(r.state.errors,$.field))}),E&&(r.emit("change"),r.emit("field",k.field),r.emit("value",k.field,w))},setTouched:function(S,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(S);!k.shadow&&k.fieldApi.getIsRelevant()&&dt.set(r.state.touched,k.field,k.fieldApi.getTouched()),k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)&&dt.set(r.state.touched,k.field,k.fieldApi.getTouched()),E&&(r.emit("change"),r.emit("field",k.field))},setError:function(S,w){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,k=r.fieldsById.get(S);!k.shadow&&k.fieldApi.getIsRelevant()&&dt.set(r.state.errors,k.field,k.fieldApi.getError());var $=dt.get(r.state.errors,k.field);(k.shadow&&k.fieldApi.getError()!=null&&k.fieldApi.relevant(r.state.values)||k.shadow&&k.fieldApi.getError()===void 0&&k.fieldApi.relevant(r.state.values)&&typeof $=="string")&&dt.set(r.state.errors,k.field,k.fieldApi.getError()),E&&(r.emit("change"),r.emit("field",k.field))},expectRemoval:this.expectRemoval,getInitialValue:this.getInitialValue,getSavedValue:this.getSavedValue},this.formApi={setValue:this.setValue,setTouched:this.setTouched,setError:this.setError,setFormError:this.setFormError,setValues:this.setValues,setInitialValue:this.setInitialValue,getValue:this.getValue,getTouched:this.getTouched,getError:this.getError,reset:this.reset,submitForm:this.submitForm,getState:this.getFormState,getValues:this.getValues,getFullField:this.getFullField,fieldExists:this.fieldExists,getInitialValue:this.getInitialValue,validate:this.validate,validateField:this.validateField,screenValid:this.screenValid,resetField:this.resetField,getOptions:this.getOptions,emitter:this,getSavedValue:this.getSavedValue,removeSavedState:this.removeSavedState,getDerrivedValue:this.getDerrivedValue,getStep:this.getStep,setStep:this.setStep,next:this.next,back:this.back,setCurrent:this.setCurrent,validated:this.validated,validating:this.validating,getDirty:this.getDirty,getPristine:this.getPristine,getField:this.getField},this.on("value",function(y){delete r.state.error,r.notify(y)})}return g(t,[{key:"emit",value:function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),p=1;p<a;p++)s[p-1]=arguments[p];var y=this.subscriptions.get(i);y&&y.forEach(function(S){return S.apply(void 0,s)})}},{key:"on",value:function(i,a){this.subscriptions.get(i)||this.subscriptions.set(i,new Set);var s=this.subscriptions.get(i);s.add(a)}},{key:"removeListener",value:function(i,a){var s=this.subscriptions.get(i);s.delete(a)}},{key:"setOptions",value:function(i){this.options=i}},{key:"setValue",value:function(i,a,s){this.getField(i).fieldApi.setValue(a,null,j({allowEmptyString:this.options.allowEmptyStrings},s))}},{key:"setTouched",value:function(i,a){this.getField(i).fieldApi.setTouched(a)}},{key:"setError",value:function(i,a){this.getField(i).fieldApi.setError(a)}},{key:"setFormError",value:function(i){this.state.error=i,this.emit("change")}},{key:"validating",value:function(){this.state.validating=this.state.validating+1,this.emit("change")}},{key:"validated",value:function(i,a){if(this.state.validating=this.state.validating-1,this.getError(i)||this.setError(i,a),this.state.validating>0){this.emit("change");return}this.state.submitting&&(this.valid()?(er("Submit",this.state),this.emit("submit")):(er("Submit",this.state),this.emit("failure")),this.state.submitting=!1),this.emit("change")}},{key:"setStep",value:function(i){this.state.step=i,this.emit("change")}},{key:"setCurrent",value:function(i){this.state.Current=i,this.emit("change")}},{key:"back",value:function(i){this.state.step=this.state.step-1,this.state.Current=i,this.emit("change")}},{key:"next",value:function(i){this.validate(),this.screenValid()&&(this.state.step=this.state.step+1,this.state.Current=i),this.emit("change")}},{key:"setInitialValue",value:function(i,a){dt.set(this.options.initialValues,i,a)}},{key:"getFormState",value:function(){return er("Returning form state"),j(j({},this.state),{},{pristine:this.pristine(),dirty:this.dirty(),invalid:this.invalid()})}},{key:"getFormApi",value:function(){return this.formApi}},{key:"getDerrivedValue",value:function(i){var a=this.getValues();return dt.get(a,i)}},{key:"getValue",value:function(i){var a=this.getField(i).fieldApi.getValue();return er("Getting value for",i,a),a}},{key:"getTouched",value:function(i){var a=this.getField(i).fieldApi.getTouched();return er("Getting touched for",i,a),a}},{key:"getError",value:function(i){var a=this.getField(i).fieldApi.getError();return er("Getting error for",i,a),a}},{key:"getDirty",value:function(i){var a=this.getField(i).fieldApi.getDirty();return er("Getting dirty for",i,a),a}},{key:"getPristine",value:function(i){var a=this.getField(i).fieldApi.getPristine();return er("Getting pristine for",i,a),a}},{key:"getValues",value:function(){return er("Gettings values"),this.state.values}},{key:"getAllTouched",value:function(){return er("Gettings touched"),this.state.touched}},{key:"getErrors",value:function(){return er("Gettings errors"),this.state.errors}},{key:"getOptions",value:function(){return this.options}},{key:"getStep",value:function(){return this.state.step}},{key:"getSavedValue",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.get(this.savedValues,"shadow-".concat(i)):dt.get(this.savedValues,i)}},{key:"removeSavedState",value:function(i){var a=this.fieldsByName.get(i);return a&&a.shadow?dt.delete(this.savedValues,"shadow-".concat(i)):dt.delete(this.savedValues,i)}},{key:"getFullField",value:function(i){return i}},{key:"getInitialValue",value:function(i){return dt.get(this.options.initialValues,i)}},{key:"getField",value:function(i){er("Getting Field",i);var a=this.fieldsByName.get(i);return a||(console.warn("Attempting to get field ".concat(i," but it does not exist")),this.dummyField)}},{key:"notify",value:function(i){var a=this,s=this.getField(i);s&&s.notify&&s.notify.forEach(function(p){var y=".".concat(i),S="".concat(y.replace(/(.*)[.[].*/,"$1"),".").concat(p).slice(1),w=a.getField(S);w&&(er("Notifying",w.field),w.fieldApi.validate(),w.fieldApi.checkRelevant())})}},{key:"validateField",value:function(i){this.getField(i).fieldApi.validate()}},{key:"resetField",value:function(i){this.getField(i).fieldApi.reset()}},{key:"fieldExists",value:function(i){return this.fieldsByName.get(i)!=null}},{key:"valid",value:function(){var i=this.getErrors();return!!(dt.empty(i)&&!this.state.error)}},{key:"screenValid",value:function(){var i=Object.entries(this.onScreen).some(function(a){var s=Q(a,2),p=s[1];return p.fieldApi.getError()});return!i}},{key:"invalid",value:function(){var i=this.getErrors();return!!(!dt.empty(i)||this.state.error)}},{key:"pristine",value:function(){var i=!0;return this.fieldsById.forEach(function(a){a.fieldApi.getPristine()||(i=!1)}),i}},{key:"dirty",value:function(){return!this.pristine()}},{key:"reset",value:function(){er("Resetting"),this.fieldsById.forEach(function(i){i.fieldApi.reset({preventUpdate:!0})}),this.emit("reset"),this.emit("change")}},{key:"setValues",value:function(i){er("Setting values"),this.fieldsById.forEach(function(a){var s=dt.get(i,a.field);s!==void 0&&a.fieldApi.setValue(s,null,{preventUpdate:!0})}),this.emit("change")}},{key:"validate",value:function(){var i=this;er("Validating all fields");var a=this.getValues();if(this.options.validationSchema){var s=Ie(this.options.validationSchema,a);this.fieldsById.forEach(function(w){if(dt.has(s,w.field)){var E=dt.get(s,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.options.schema&&this.options.ajv){var p=P(this.ajvValidate,a);this.fieldsById.forEach(function(w){if(dt.has(p,w.field)){var E=dt.get(p,w.field);i.setError(w.field,E)}else i.setError(w.field,void 0)})}if(this.fieldsById.forEach(function(w){w.fieldApi.validate(a),w.fieldApi.setTouched(!0,!0)}),this.options.validate){var y=this.options.validate(a);this.setFormError(y)}if(this.options.validateFields){var S=this.options.validateFields(a);this.fieldsById.forEach(function(w){if(dt.has(S,w.field)){var E=dt.get(S,w.field);i.setError(w.field,E)}})}}},{key:"asyncValidate",value:function(){er("Async Validating all fields");var i=this.getValues();this.fieldsById.forEach(function(a){a.fieldApi.asyncValidate(i)})}},{key:"keyDown",value:function(i){if(i.keyCode==13&&this.options.preventEnter)return i.preventDefault(i),!1}},{key:"submitForm",value:function(i){this.state.submits=this.state.submits+1,this.state.submitting=!0,!this.options.dontPreventDefault&&i&&i.preventDefault(i),this.validate(),this.emit("change"),this.asyncValidate(),!(this.state.validating>0)&&(this.valid()?(er("Submit",this.state),this.emit("submit")):(er("Submit",this.state),this.emit("failure")),this.state.submitting=!1,this.emit("change"))}},{key:"mount",value:function(){var i=this;this.fieldsById.forEach(function(a){i.emit("field",a.field)})}},{key:"register",value:function(i,a,s){var p=a.field,y=a.state;er("Register ID:",i,"Name:",p,y,"Initial",s);var S=p.slice(0,p.lastIndexOf("[")!=-1?p.lastIndexOf("]")+1:p.length),w;this.fieldsById.forEach(function(E,k){E&&E.field===p&&(w=k)}),w&&(a.keepState||a.inMultistep)?(er("Already Registered",p),this.fieldsById.delete(w)):w&&(!a.keepState||!a.inMultistep)&&console.warn("Check to make sure you have not registered two fields with the fieldName",p),er("Fields Registered",this.fieldsById.size),this.onScreen[i]=a,this.fieldsById.set(i,a),er("clearing expected removal",S),delete this.expectedRemovals[S],delete this.pulledOut[S],!a.shadow&&(this.updater.setValue(i,a.fieldApi.getValue(),!1),this.updater.setError(i,a.fieldApi.getError(),!1),this.updater.setTouched(i,a.fieldApi.getTouched(),!1),s||this.emit("change"),this.emit("field",p))}},{key:"deregister",value:function(i){var a=this.fieldsById.get(i),s=a.field;er("Deregister",i,s),delete this.onScreen[i];var p=Bl(s,this.expectedRemovals),y=s.slice(0,s.lastIndexOf("[")!=-1?s.lastIndexOf("]")+1:s.length);(a.keepState||a.inMultistep)&&!p&&(er("Saving field ".concat(s,"'s value"),a.fieldApi.getFieldState()),a.shadow?dt.set(this.savedValues,"shadow-".concat(s),a.fieldApi.getFieldState()):dt.set(this.savedValues,s,a.fieldApi.getFieldState())),(p||!a.keepState&&!a.inMultistep||!a.fieldApi.getIsRelevant()&&!a.keepState)&&(er("Removing field",s),this.fieldsById.delete(i),p||(dt.delete(this.state.values,s),dt.delete(this.state.touched,s),dt.delete(this.state.errors,s),a.shadow?dt.delete(this.savedValues,"shadow-".concat(s)):dt.delete(this.savedValues,s)),p&&this.pulledOut[y]&&(er("Pulling out",s,"with magic value",y),dt.pullOut(this.state.values,y),dt.pullOut(this.state.touched,y),dt.pullOut(this.state.errors,y),dt.pullOut(this.savedValues,y),delete this.pulledOut[y])),this.emit("change")}},{key:"expectRemoval",value:function(i){er("Expecting removal of",i),this.expectedRemovals[i]=!0,this.pulledOut[i]=!0}},{key:"update",value:function(i,a,s){er("Update",i,a.field,s,a.fieldState.value);var p=a.fieldApi.getValue(),y=a.fieldApi.getError(),S=a.fieldApi.getTouched(),w=this.fieldsByName.get(s);s&&!w&&(dt.set(this.state.values,s),dt.set(this.state.errors,s),dt.set(this.state.touched,s)),dt.set(this.state.values,a.field,p),dt.set(this.state.errors,a.field,y),dt.set(this.state.touched,a.field,S),this.emit("change")}}]),t}(),Pa=Le("informed:FormProvider "),ms=function(r){var i=r.children,a=r.formApi,s=r.formController,p=r.formState,y=C(r,["children","formApi","formController","formState"]);if(Pa("Render FormProvider"),a)return Pa("Render FormProvider with given values"),d.createElement(It.Provider,{value:s.updater},d.createElement(jt.Provider,{value:a},d.createElement(At.Provider,{value:p},i)));Pa("Render FormProvider with generated values");var S=bs(y);return d.createElement(It.Provider,{value:S.formController.updater},d.createElement(jt.Provider,{value:S.formApi},d.createElement(At.Provider,{value:S.formState},i)))},xs=Le("informed:useForm "),bs=function(r){var i=r.dontPreventDefault,a=r.initialValues,s=r.validate,p=r.validateFields,y=r.allowEmptyStrings,S=r.preventEnter,w=r.getApi,E=r.apiRef,k=r.onChange,$=r.onReset,ae=r.onSubmit,re=r.onValueChange,le=r.onSubmitFailure,ge=r.validationSchema,he=r.schema,Se=r.ajv,me=r.fieldMap,Fe=r.onlyValidateSchema,Ke=C(r,["dontPreventDefault","initialValues","validate","validateFields","allowEmptyStrings","preventEnter","getApi","apiRef","onChange","onReset","onSubmit","onValueChange","onSubmitFailure","validationSchema","schema","ajv","fieldMap","onlyValidateSchema"]);xs("Render useForm");var Ue=(0,d.useMemo)(function(){return{dontPreventDefault:i,initialValues:a,validate:s,validateFields:p,allowEmptyStrings:y,preventEnter:S,validationSchema:ge,schema:he,ajv:Se,fieldMap:me}},[i,a,s,p,y,S,ge,he,Se,me]),$e=(0,d.useState)(function(){return new ys(Ue)}),Be=Q($e,1),je=Be[0];(0,d.useEffect)(function(){je.setOptions(Ue)},[Ue]),gt(function(){je.mount()},[]);var We=(0,d.useState)(function(){return je.getFormState()}),Je=Q(We,2),ze=Je[0],et=Je[1];gt(function(){var Mr=function(){return k&&k(je.getFormState())},Or=function(){return $&&$()},Kr=function(){return ae&&ae(je.getFormState().values)},Sr=function(){return re&&re(je.getFormState().values)},Ur=function(){return le&&le(je.getFormState().errors)};return je.on("change",Mr),je.on("reset",Or),je.on("submit",Kr),je.on("value",Sr),je.on("failure",Ur),function(){je.removeListener("change",Mr),je.removeListener("reset",Or),je.removeListener("submit",Kr),je.removeListener("value",Sr),je.removeListener("failure",Ur)}},[k,$,ae,re,le]),(0,d.useState)(function(){var Mr=function(){xs("Setting form state"),et(je.getFormState())};je.on("change",Mr),w&&w(je.getFormApi()),E&&(E.current=je.getFormApi())});var wt=(0,d.useState)(function(){return je.getFormApi()}),Dt=Q(wt,1),Wt=Dt[0],lr=function(Or){return d.createElement(ms,{formApi:Wt,formState:ze,formController:je},d.createElement(d.Fragment,null,Or||d.createElement(Zt,{schema:he,onlyValidateSchema:Fe})))};return{formApi:Wt,formState:ze,formController:je,render:lr,userProps:Ke}},Ul=Le("informed:Form "),jl=function(r){var i=r.children,a=r.render,s=r.component,p=C(r,["children","render","component"]);Ul("Render FORM");var y=bs(p),S=y.formApi,w=y.formController,E=y.formState,k=y.render,$=y.userProps,ae=function(){var le={formState:E,formApi:S};return s?d.createElement(s,le,i):a?a(le):typeof i=="function"?i(le):i};return k(d.createElement("form",N({},$,{onReset:w.reset,onSubmit:w.submitForm,onKeyDown:w.keyDown}),ae()))},gf=function(r,i){return j(j({},i),{},{getValue:function(s){return i.getValue("".concat(r,".").concat(s))},getTouched:function(s){return i.getTouched("".concat(r,".").concat(s))},getError:function(s){return i.getError("".concat(r,".").concat(s))},setValue:function(s,p){return i.setValue("".concat(r,".").concat(s),p)},setTouched:function(s,p){return i.setTouched("".concat(r,".").concat(s),p)},setError:function(s,p){return i.setError("".concat(r,".").concat(s),p)},getInitialValue:function(s){return i.getInitialValue("".concat(r,".").concat(s))},getFullField:function(s){return"".concat(i.getFullField(r),".").concat(s)}})},yf=function(r,i){var a=i.register,s=i.deregister,p=i.setValue,y=i.setTouched,S=i.setError,w=i.update,E=i.getField,k=i.expectRemoval,$=i.getInitialValue,ae=i.fieldMap,re=i.getSavedValue;return{register:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return a.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},deregister:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return s.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},update:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return w.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setValue:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return p.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setTouched:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return y.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},setError:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return S.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getField:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return E.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},expectRemoval:function(ge){for(var he=arguments.length,Se=new Array(he>1?he-1:0),me=1;me<he;me++)Se[me-1]=arguments[me];return k.apply(void 0,["".concat(r,".").concat(ge)].concat(Se))},getInitialValue:function(ge){return $("".concat(r,".").concat(ge))},getSavedValue:function(ge){return re("".concat(r,".").concat(ge))},fieldMap:ae}},mf=function(r){var i=r.scope,a=r.children,s=useContext(It),p=Re(),y=ei(),S=useMemo(function(){return gf(i,p)},[i]),w=useMemo(function(){return yf(i,s)},[i]);return React.createElement(It.Provider,{value:w},React.createElement(jt.Provider,{value:S},React.createElement(At.Provider,{value:y},a)))},wi=function(r){var i=ei(),a={};Object.keys(r).length>0?Object.keys(r).forEach(function(re){a[re]=i[re]}):a=i;var s=a,p=s.pristine,y=s.dirty,S=s.invalid,w=s.values,E=s.errors,k=s.touched,$=s.validating,ae=s.submitting;return React.createElement("pre",null,React.createElement("code",null,JSON.stringify({pristine:p,dirty:y,invalid:S,values:w,errors:E,touched:k,validating:$,submitting:ae},null,2)))},xf=function(r){var i=r.initialStep,a=r.multistepApiRef,s=Re(),p=s.getValues,y=s.validate,S=s.screenValid,w=(0,d.useState)(new Map),E=Q(w,1),k=E[0],$=(0,d.useRef)(0),ae=be({current:i,steps:[],goal:null}),re=Q(ae,3),le=re[0],ge=re[1],he=re[2],Se=(0,d.useState)(function(){var Ue=function(){var je=he(),We=je.current,Je=k.get(We);return Je},$e={getState:function(){return he()},getCurrentStep:Ue,getStep:function(je){return k.get(je)},getNumberOfSteps:function(){return k.size},next:function(){if(y(),S()){var je=Ue(),We=je.getNext,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})}},back:function(){var je=Ue(),We=je.getPrevious,Je=We(),ze=typeof Je=="function"?Je(p()):Je;ze&&ge(function(et){return j(j({},et),{},{current:ze})})},setCurrent:function(je){if(je){var We=k.get(je).index;We<Ue().index?ge(function(Je){return j(j({},Je),{},{current:je,goal:null})}):ge(function(Je){return j(j({},Je),{},{goal:je})})}},register:function(je,We,Je){Je?($.current=$.current+1,k.set(je,j(j({},We),{},{index:$.current}))):ge(function(ze){return j(j({},ze),{},{steps:Array.from(k.keys())})})},deregister:function(je){k.delete(je),$.current=$.current-1,ge(function(We){return j(j({},We),{},{steps:Array.from(k.keys())})})}};return a&&(a.current=$e),$e}),me=Q(Se,1),Fe=me[0],Ke=function($e){return d.createElement(K.Provider,{value:Fe},d.createElement(G.Provider,{value:le},$e))};return j(j(j({},Fe),le),{},{render:Ke})};function bf(){return(0,d.useContext)(G)}function Ia(){return(0,d.useContext)(K)}var Vo=function(r){var i=r.step,a=r.next,s=r.previous,p=r.relevant,y=ei(),S=y.values,w=bf(),E=w.current,k=w.goal,$=Ia(),ae=$.register,re=$.deregister,le=$.next,ge=i===E,he=p?p(S):!0,Se=(0,d.useRef)(a),me=(0,d.useRef)(s),Fe=(0,d.useRef)();Se.current=a,me.current=s,Fe.current=p,(0,d.useState)(function(){ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return me.current}},!0)}),(0,d.useEffect)(function(){return ae(i,{name:i,getNext:function(){return Se.current},getPrevious:function(){return me.current}}),function(){re(i)}},[i]),(0,d.useEffect)(function(){k&&ge&&k!==i&&le()},[k,ge]);var Ke=function($e){return d.createElement(we.Provider,{value:{relevant:function(je){return Fe.current?Fe.current(je):!0},multistep:!0}},ge&&he?$e:null)};return{isCurrent:ge,isRelevant:he,step:i,render:Ke}};function wf(t){var r=t.children,i=C(t,["children"]),a=xf(i),s=a.render,p=C(a,["render"]);return s(typeof r=="function"?r(p):r)}wf.Step=function(r){var i=r.children,a=C(r,["children"]),s=Vo(a),p=s.render;return p(i)};var md=function(r){var i=r.field,a=useContext(It),s=a.fieldMap,p=Re(),y=p.getFullField,S=p.getOptions,w=y(i),E=S(),k=E.schema,$=Oe(w),ae=dt.get(k,$);if(!ae)return null;var re=ee(i,ae),le=re.props,ge=re.componentType,he=s[ge];return React.createElement(he,N({field:i},le))},xd=function(){var r=Re(),i=r.getOptions,a=i(),s=a.schema;return React.createElement(Zt,{schema:s})},bd=function(r){return React.forwardRef(function(i,a){return React.createElement(jt.Consumer,null,function(s){return React.createElement(r,N({formApi:s,ref:a},i))})})},Vl=function(r){return React.forwardRef(function(i,a){return React.createElement(At.Consumer,null,function(s){return React.createElement(r,N({formState:s,ref:a},i))})})},Wl=function(r,i){return{getValue:function(){return r.getValue(i)},setValue:function(s){return r.setValue(i,s)},getTouched:function(){return r.getTouched(i)},setTouched:function(s){return r.setTouched(i,s)},getError:function(){return r.getError(i)},setError:function(s){return r.setError(i,s)},reset:function(){return r.resetField(i)},validate:function(){return r.validateField(i)},exists:function(){return r.fieldExists(i)},getDirty:function(){return r.getDirty(i)},getPristine:function(){return r.getPristine(i)},getFieldState:function(){return r.getField(i).fieldApi.getFieldState()}}};function Hl(t){var r=Re(),i=useMemo(function(){return Wl(r,t)},[t]);return i}function zl(t){var r=Hl(t),i=Re(),a=React.useState(),s=Q(a,2),p=s[1],y=React.useCallback(function(){return p({})},[]);return gt(function(){var S=function(E){E===t&&y()};return i.emitter.on("field",S),function(){i.emitter.removeListener("field",S)}},[]),gt(function(){y()},[]),r.getFieldState()||{}}var Sf=function(r){return function(i){return function(a){var s=zl(r);return React.createElement(i,N({fieldState:s},a))}}},ws=function(r){return function(i){return function(a){var s=Hl(r);return React.createElement(i,N({fieldApi:s},a))}}},Ss=function(r){var i=r.value,a=r.forwardedRef,s=r.children,p=C(r,["value","forwardedRef","children"]);return React.createElement("option",N({ref:a,value:i,key:i},p),s)},Gl=null,Wo=o(80150),zt=o(25446),Ki=o(25805),Gt=o(76671),Yi=o(78005),xt=o(39713),In=o(23485),Af=Object.defineProperty,As=Object.defineProperties,$l=Object.getOwnPropertyDescriptors,ti=Object.getOwnPropertySymbols,Es=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable,Ho=(t,r,i)=>r in t?Af(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ho=(t,r)=>{for(var i in r||(r={}))Es.call(r,i)&&Ho(t,i,r[i]);if(ti)for(var i of ti(r))ri.call(r,i)&&Ho(t,i,r[i]);return t},Ji=(t,r)=>As(t,$l(r));const Kl=In.iv`
81
81
  border: none;
82
82
  outline: none;
83
83
  padding: 8px;
@@ -102,7 +102,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
102
102
  ${Kl}
103
103
  ${({inputType:t,inputActionButton:r})=>t==="password"||r?"padding-right: 40px;":""};
104
104
  ${({fullWidth:t})=>t?"width: 100%;":""}
105
- `,Os=In.ZP.span`
105
+ `,Cs=In.ZP.span`
106
106
  position: absolute;
107
107
  right: 0;
108
108
  line-height: normal;
@@ -112,51 +112,51 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
112
112
  cursor: pointer;
113
113
  text-align: center;
114
114
  ${({theme:t})=>(0,In.QG)({color:t.rightPanel.textColor})}
115
- `;function Jl(t,r){const{fullWidth:i,errorMessage:a,type:s}=t,[p,y]=d.useState(s==="password"),S=d.useCallback(()=>{y(!p)},[p]);return d.createElement(Yl,{fullWidth:i,type:s},d.createElement(Ef,null,d.createElement(Cf,Ji(ho({},t),{type:p?"password":"text",inputType:s,ref:r})),t.inputActionButton?d.createElement(Os,{onClick:t.inputActionButton.onClick},t.inputActionButton.label):s==="password"?d.createElement(Os,{onClick:S},p?"show":"hide"):null),a?d.createElement(xt.Xq,null,a):null)}const zo=d.forwardRef(Jl);function hn(t){const r=Kn(ho({fieldType:"text"},t)),{userProps:i,render:a,fieldState:s}=r,p=r.informed;return a(d.createElement(zo,Ji(ho(ho({},i),p),{errorMessage:s.error})))}const Go=pn(({initValue:t,options:r,fieldApi:i,fieldState:a})=>{const s=r.map((E,k)=>({value:E.title||E.value,idx:k,origValue:E.value})),p=s.find(E=>E.origValue===t),[y,S]=d.useState(p==null?void 0:p.value);d.useEffect(()=>{t&&i.setValue(t)},[]);const w=d.useCallback(E=>{i.setValue(s[E.idx].origValue),S(s[E.idx].value)},[s]);return d.createElement(Yl,{fullWidth:!0},d.createElement(Yi.Dropdown,{fullWidth:!0,variant:"dark",value:y,options:s,onChange:w}),a.error?d.createElement(xt.Xq,null,a.error):null)});function Xl(t){const{name:r,value:i,description:a,variableEnum:s,onChange:p,defaultValue:y}=t,S=k=>p(k.target.value),w=k=>p(k.value),E=s?s.map((k,$)=>({value:k,idx:$})):[];return d.createElement(xt.NI,null,d.createElement(xt.lX,null,r,":"),E&&E.length?d.createElement(Yi.Dropdown,{fullWidth:!0,variant:"dark",value:i,options:E,onChange:w}):d.createElement(zo,{fullWidth:!0,value:i,onChange:S,placeholder:y}),a&&d.createElement(Of,null,a))}const Of=Gt.styled.small`
115
+ `;function Jl(t,r){const{fullWidth:i,errorMessage:a,type:s}=t,[p,y]=d.useState(s==="password"),S=d.useCallback(()=>{y(!p)},[p]);return d.createElement(Yl,{fullWidth:i,type:s},d.createElement(Ef,null,d.createElement(Cf,Ji(ho({},t),{type:p?"password":"text",inputType:s,ref:r})),t.inputActionButton?d.createElement(Cs,{onClick:t.inputActionButton.onClick},t.inputActionButton.label):s==="password"?d.createElement(Cs,{onClick:S},p?"show":"hide"):null),a?d.createElement(xt.Xq,null,a):null)}const zo=d.forwardRef(Jl);function hn(t){const r=Kn(ho({fieldType:"text"},t)),{userProps:i,render:a,fieldState:s}=r,p=r.informed;return a(d.createElement(zo,Ji(ho(ho({},i),p),{errorMessage:s.error})))}const Go=pn(({initValue:t,options:r,fieldApi:i,fieldState:a})=>{const s=r.map((E,k)=>({value:E.title||E.value,idx:k,origValue:E.value})),p=s.find(E=>E.origValue===t),[y,S]=d.useState(p==null?void 0:p.value);d.useEffect(()=>{t&&i.setValue(t)},[]);const w=d.useCallback(E=>{i.setValue(s[E.idx].origValue),S(s[E.idx].value)},[s]);return d.createElement(Yl,{fullWidth:!0},d.createElement(Yi.Dropdown,{fullWidth:!0,variant:"dark",value:y,options:s,onChange:w}),a.error?d.createElement(xt.Xq,null,a.error):null)});function Xl(t){const{name:r,value:i,description:a,variableEnum:s,onChange:p,defaultValue:y}=t,S=k=>p(k.target.value),w=k=>p(k.value),E=s?s.map((k,$)=>({value:k,idx:$})):[];return d.createElement(xt.NI,null,d.createElement(xt.lX,null,r,":"),E&&E.length?d.createElement(Yi.Dropdown,{fullWidth:!0,variant:"dark",value:i,options:E,onChange:w}):d.createElement(zo,{fullWidth:!0,value:i,onChange:S,placeholder:y}),a&&d.createElement(Of,null,a))}const Of=Gt.styled.small`
116
116
  display: inline-block;
117
117
  margin-top: 5px;
118
118
  color: #d0d0d0;
119
- `;var Vr=o(7241),$o=Object.defineProperty,vo=Object.defineProperties,Tf=Object.getOwnPropertyDescriptor,Pf=Object.getOwnPropertyDescriptors,Ql=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable,Ts=(t,r,i)=>r in t?$o(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Ps=(t,r)=>{for(var i in r||(r={}))Ko.call(r,i)&&Ts(t,i,r[i]);if(Ql)for(var i of Ql(r))Wr.call(r,i)&&Ts(t,i,r[i]);return t},go=(t,r)=>vo(t,Pf(r)),If=(t,r,i,a)=>{for(var s=a>1?void 0:a?Tf(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&$o(r,i,s),s},Fa=(t,r,i)=>(Ts(t,typeof r!="symbol"?r+"":r,i),i);let Is=class extends d.Component{constructor(){super(...arguments);Fa(this,"state",{activeIdx:0,variables:{}}),Fa(this,"handleServerChange",t=>{const r=this.props.operation.servers.find(a=>a.url===t.serverUrl),i=(0,Vr.mj)(r);this.props.onChange({url:t.serverUrl||"",variables:i}),(0,zt.WW)("serverUrl",t.serverUrl||""),this.setState({variables:i})}),Fa(this,"handleVariableChange",(t,r)=>{const i=this.props.operation.servers[this.state.activeIdx],a=go(Ps({},this.state.variables),{[t]:r||(0,Vr.mj)(i)[t]});this.setState({variables:a}),(0,Vr.UY)(t,r),this.props.onChange(go(Ps({},i),{variables:a}))})}static getDerivedStateFromProps(t){const r=t.operation,i=(0,zt.YQ)("serverUrl"),a=r.servers.findIndex(s=>s.url===i);return{activeIdx:a<0?0:a}}componentDidMount(){const t=(0,Vr.fz)(this.props.operation.servers,this.state.activeIdx);this.props.onChange(t),this.setState({variables:t.variables})}render(){const{activeIdx:t}=this.state,i=this.props.operation.servers.map((s,p)=>({idx:p,serverUrl:s.url,value:`
119
+ `;var Vr=o(7241),$o=Object.defineProperty,vo=Object.defineProperties,Tf=Object.getOwnPropertyDescriptor,Pf=Object.getOwnPropertyDescriptors,Ql=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,Wr=Object.prototype.propertyIsEnumerable,Os=(t,r,i)=>r in t?$o(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Ts=(t,r)=>{for(var i in r||(r={}))Ko.call(r,i)&&Os(t,i,r[i]);if(Ql)for(var i of Ql(r))Wr.call(r,i)&&Os(t,i,r[i]);return t},go=(t,r)=>vo(t,Pf(r)),If=(t,r,i,a)=>{for(var s=a>1?void 0:a?Tf(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&$o(r,i,s),s},Fa=(t,r,i)=>(Os(t,typeof r!="symbol"?r+"":r,i),i);let Ps=class extends d.Component{constructor(){super(...arguments);Fa(this,"state",{activeIdx:0,variables:{}}),Fa(this,"handleServerChange",t=>{const r=this.props.operation.servers.find(a=>a.url===t.serverUrl),i=(0,Vr.mj)(r);this.props.onChange({url:t.serverUrl||"",variables:i}),(0,zt.WW)("serverUrl",t.serverUrl||""),this.setState({variables:i})}),Fa(this,"handleVariableChange",(t,r)=>{const i=this.props.operation.servers[this.state.activeIdx],a=go(Ts({},this.state.variables),{[t]:r||(0,Vr.mj)(i)[t]});this.setState({variables:a}),(0,Vr.UY)(t,r),this.props.onChange(go(Ts({},i),{variables:a}))})}static getDerivedStateFromProps(t){const r=t.operation,i=(0,zt.YQ)("serverUrl"),a=r.servers.findIndex(s=>s.url===i);return{activeIdx:a<0?0:a}}componentDidMount(){const t=(0,Vr.fz)(this.props.operation.servers,this.state.activeIdx);this.props.onChange(t),this.setState({variables:t.variables})}render(){const{activeIdx:t}=this.state,i=this.props.operation.servers.map((s,p)=>({idx:p,serverUrl:s.url,value:`
120
120
  ${(0,Vr.nq)((0,Vr.v5)(s.url,this.state.variables),s.variables)}
121
121
  - ${s.description||"Default"}
122
- `})),a=Object.keys(this.state.variables);return d.createElement(Fs,null,d.createElement(xt.lX,{htmlFor:"server"},"Target server: "),d.createElement(xt.NI,null,d.createElement(Yi.Dropdown,{variant:"dark",value:i[t].value,options:i,fullWidth:!0,onChange:this.handleServerChange})),a.length?a.map(s=>{var p;const y=(p=this.props.operation.servers[this.state.activeIdx].variables)==null?void 0:p[s];if(y)return d.createElement(Xl,{key:s,name:s,value:this.state.variables[s],defaultValue:y.default,onChange:S=>this.handleVariableChange(s,S),variableEnum:y.enum,description:y.description})}):null)}};Is=If([Wo.Pi],Is);const Fs=Gt.styled.div`
122
+ `})),a=Object.keys(this.state.variables);return d.createElement(Is,null,d.createElement(xt.lX,{htmlFor:"server"},"Target server: "),d.createElement(xt.NI,null,d.createElement(Yi.Dropdown,{variant:"dark",value:i[t].value,options:i,fullWidth:!0,onChange:this.handleServerChange})),a.length?a.map(s=>{var p;const y=(p=this.props.operation.servers[this.state.activeIdx].variables)==null?void 0:p[s];if(y)return d.createElement(Xl,{key:s,name:s,value:this.state.variables[s],defaultValue:y.default,onChange:S=>this.handleVariableChange(s,S),variableEnum:y.enum,description:y.description})}):null)}};Ps=If([Wo.Pi],Ps);const Is=Gt.styled.div`
123
123
  margin-top: 20px;
124
- `,Zl=t=>{(0,d.useEffect)(()=>{t()},[])},Sd=t=>{useEffect(()=>()=>{t()},[])},_l=pn(({initValue:t,paramEnum:r,fieldApi:i})=>{const[a,s]=d.useState(t),p=r.map((S,w)=>({idx:w,value:S})),y=S=>{i.setValue(S.value),s(S.value)};return Zl(()=>{t&&i.setValue(t)}),d.createElement(Yi.Dropdown,{fullWidth:!0,variant:"dark",value:a,options:p,onChange:y})});var Si;(function(t){t.ARRAY="array",t.OBJECT="object"})(Si||(Si={}));const Ff=t=>`(${t.schema.type})`+(t.example?` ${t.example}`:"");function Yo(t,r,i){t[r]||(t[r]=[]),t[r].push(i)}function ni(t){const r={};return t.forEach(i=>{Yo(r,i.in,i)}),r}const ka=["path","query","cookie","header"];function ks(t){return r=>{if(t.required&&!r)return"Field is required";if(t.required&&t.schema.type===Si.ARRAY&&Array.isArray(r)){if(r.length>(t.schema.rawSchema&&t.schema.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${t.schema.rawSchema.maxItems}`;if(r.length<(t.schema.rawSchema&&t.schema.rawSchema.minItems||0)){const i=t.schema.rawSchema.minItems;return`You should select at least ${i===1?`${i} item`:`${i} items`}`}}}}function ql(t){if(t.schema.type===Si.ARRAY){const r=t.schema.default||t.schema.example;if(!r&&t.schema.rawSchema.items){if(t.schema.rawSchema.items.default)return[t.schema.rawSchema.items.default];if(t.schema.rawSchema.items.example)return[t.schema.rawSchema.items.example]}return r||[]}else return t.schema.default||t.schema.example}function Xn({values:t,operation:r}){function i(S,w){const E=d.useMemo(()=>ks(w),[w]),k=Array.isArray(w.schema.enum)&&w.schema.enum.length?w.schema.enum:void 0,$=ql(w),ae=S.split(".").map(re=>(0,zt.dw)(re));return k?d.createElement(xt.NI,null,d.createElement(_l,{initValue:$,paramEnum:k,field:S})):d.createElement(hn,{fullWidth:!0,"data-cy":"parameter-input",id:S,field:S,placeholder:Ff(w),validate:E,initialValue:$||(0,zt.U2)(t,ae),validateOnBlur:!0,validateOnChange:!0})}function a({oneOfType:S,type:w,items:E}){return S||w===Si.ARRAY&&(E==null?void 0:E.type)===Si.OBJECT&&"Array of objects"}function s(S,w,E){var k;const $=E?(0,zt.s1)(E,S.name):S.name,ae=a(S.schema);if(ae&&console.warn(`Unsupported parameter definition: "${ae}"`),S.schema.type===Si.OBJECT)return(k=S.schema.fields)==null?void 0:k.map(ge=>s(ge,w,$));const re=E?[w,E]:[S.in],le=(0,zt.s1)(...re,(0,zt.A8)(S.name));return d.createElement(xt.NI,{key:le},d.createElement(xt.lX,{required:S.required},$,":"),ae?d.createElement(xt.GE,null,"Unsupported field schema definition"):i(le,S))}function p(S,w){return!w||!w.length?null:d.createElement(d.Fragment,{key:S},d.createElement(xt.NI,null,d.createElement(xt.iG,null," # ",S," parameters "),d.createElement("span",null,"\xA0")),w.map(E=>s(E,S)))}const y=ni(r.parameters||[]);return d.createElement(xt.iA,null,ka.map(S=>p(S,y[S])))}var vn=o(78722),Ra=o(55346),Xi=o(59219);function eu(t,r,i){const a=r.path||{},s=r.query||{},p=Object.keys(s);let y=(0,Vr.v5)(t,a);const S=w=>i.find(E=>E.name===w&&E.in==="query");return p.length&&(y+="?"+p.map(w=>{if(!s[w])return"";const E=S(w);return E?(0,Gt.serializeParameterValue)(E,s[w]):`${w}=${encodeURIComponent(s[w])}`}).filter(Boolean).join("&")),y}const kf=({loading:t,operation:r,hasResponse:i,execute:a,params:s={}})=>d.createElement(Rs,null,d.createElement(Ra._,null,d.createElement(Xi.FH,{type:r.httpVerb},r.httpVerb),d.createElement(Ra.y,{wrap:"true"},eu(r.path,s,r.parameters))),d.createElement(tu,{"data-cy":"send-button",color:"primary",blinking:t,onClick:()=>!t&&a()},t?"Sending...":i?"Resend":"Send")),tu=(0,Gt.styled)(Xi.zx)`
124
+ `,Zl=t=>{(0,d.useEffect)(()=>{t()},[])},Sd=t=>{useEffect(()=>()=>{t()},[])},_l=pn(({initValue:t,paramEnum:r,fieldApi:i})=>{const[a,s]=d.useState(t),p=r.map((S,w)=>({idx:w,value:S})),y=S=>{i.setValue(S.value),s(S.value)};return Zl(()=>{t&&i.setValue(t)}),d.createElement(Yi.Dropdown,{fullWidth:!0,variant:"dark",value:a,options:p,onChange:y})});var Si;(function(t){t.ARRAY="array",t.OBJECT="object"})(Si||(Si={}));const Ff=t=>`(${t.schema.type})`+(t.example?` ${t.example}`:"");function Yo(t,r,i){t[r]||(t[r]=[]),t[r].push(i)}function ni(t){const r={};return t.forEach(i=>{Yo(r,i.in,i)}),r}const ka=["path","query","cookie","header"];function Fs(t){return r=>{if(t.required&&!r)return"Field is required";if(t.required&&t.schema.type===Si.ARRAY&&Array.isArray(r)){if(r.length>(t.schema.rawSchema&&t.schema.rawSchema.maxItems||1/0))return`Too many items selected, maximum ${t.schema.rawSchema.maxItems}`;if(r.length<(t.schema.rawSchema&&t.schema.rawSchema.minItems||0)){const i=t.schema.rawSchema.minItems;return`You should select at least ${i===1?`${i} item`:`${i} items`}`}}}}function ql(t){if(t.schema.type===Si.ARRAY){const r=t.schema.default||t.schema.example;if(!r&&t.schema.rawSchema.items){if(t.schema.rawSchema.items.default)return[t.schema.rawSchema.items.default];if(t.schema.rawSchema.items.example)return[t.schema.rawSchema.items.example]}return r||[]}else return t.schema.default||t.schema.example}function Xn({values:t,operation:r}){function i(S,w){const E=d.useMemo(()=>Fs(w),[w]),k=Array.isArray(w.schema.enum)&&w.schema.enum.length?w.schema.enum:void 0,$=ql(w),ae=S.split(".").map(re=>(0,zt.dw)(re));return k?d.createElement(xt.NI,null,d.createElement(_l,{initValue:$,paramEnum:k,field:S})):d.createElement(hn,{fullWidth:!0,"data-cy":"parameter-input",id:S,field:S,placeholder:Ff(w),validate:E,initialValue:$||(0,zt.U2)(t,ae),validateOnBlur:!0,validateOnChange:!0})}function a({oneOfType:S,type:w,items:E}){return S||w===Si.ARRAY&&(E==null?void 0:E.type)===Si.OBJECT&&"Array of objects"}function s(S,w,E){var k;const $=E?(0,zt.s1)(E,S.name):S.name,ae=a(S.schema);if(ae&&console.warn(`Unsupported parameter definition: "${ae}"`),S.schema.type===Si.OBJECT)return(k=S.schema.fields)==null?void 0:k.map(ge=>s(ge,w,$));const re=E?[w,E]:[S.in],le=(0,zt.s1)(...re,(0,zt.A8)(S.name));return d.createElement(xt.NI,{key:le},d.createElement(xt.lX,{required:S.required},$,":"),ae?d.createElement(xt.GE,null,"Unsupported field schema definition"):i(le,S))}function p(S,w){return!w||!w.length?null:d.createElement(d.Fragment,{key:S},d.createElement(xt.NI,null,d.createElement(xt.iG,null," # ",S," parameters "),d.createElement("span",null,"\xA0")),w.map(E=>s(E,S)))}const y=ni(r.parameters||[]);return d.createElement(xt.iA,null,ka.map(S=>p(S,y[S])))}var vn=o(78722),Ra=o(55346),Xi=o(59219);function eu(t,r,i){const a=r.path||{},s=r.query||{},p=Object.keys(s);let y=(0,Vr.v5)(t,a);const S=w=>i.find(E=>E.name===w&&E.in==="query");return p.length&&(y+="?"+p.map(w=>{if(!s[w])return"";const E=S(w);return E?(0,Gt.serializeParameterValue)(E,s[w]):`${w}=${encodeURIComponent(s[w])}`}).filter(Boolean).join("&")),y}const kf=({loading:t,operation:r,hasResponse:i,execute:a,params:s={}})=>d.createElement(ks,null,d.createElement(Ra._,null,d.createElement(Xi.FH,{type:r.httpVerb},r.httpVerb),d.createElement(Ra.y,{wrap:"true"},eu(r.path,s,r.parameters))),d.createElement(tu,{"data-cy":"send-button",color:"primary",blinking:t,onClick:()=>!t&&a()},t?"Sending...":i?"Resend":"Send")),tu=(0,Gt.styled)(Xi.zx)`
125
125
  width: ${({theme:t})=>t.components.tryItSendButton.fullWidth?"100%":"auto"};
126
- `,Rs=(0,Gt.styled)(vn.k1)`
126
+ `,ks=(0,Gt.styled)(vn.k1)`
127
127
  ${({theme:t})=>t.components.tryItSendButton.fullWidth?`
128
128
  flex-direction: column;
129
129
  align-items: flex-start;`:""};
130
- `,yo=d.memo(kf);var gn=o(55366);function ru({response:t}){return d.createElement(d.Fragment,null,d.createElement(Ds,null," Body: "),nu(t))}function nu(t){return t.body?d.createElement(Gt.JsonViewer,{data:t.body}):t.fileInfo?d.createElement(Gt.SourceCodeWithFile,{fileInfo:t.fileInfo}):t.data!==null?t.data?d.createElement(Gt.SourceCodeWithText,{lang:(0,Gt.langFromMime)(t.headers["Content-Type"]||"text/plain"),source:t.data}):d.createElement(Ns,null,d.createElement("i",null,"(no content)")):null}const Rf=Gt.styled.div`
130
+ `,yo=d.memo(kf);var gn=o(55366);function ru({response:t}){return d.createElement(d.Fragment,null,d.createElement(Ls,null," Body: "),nu(t))}function nu(t){return t.body?d.createElement(Gt.JsonViewer,{data:t.body}):t.fileInfo?d.createElement(Gt.SourceCodeWithFile,{fileInfo:t.fileInfo}):t.data!==null?t.data?d.createElement(Gt.SourceCodeWithText,{lang:(0,Gt.langFromMime)(t.headers["Content-Type"]||"text/plain"),source:t.data}):d.createElement(Ds,null,d.createElement("i",null,"(no content)")):null}const Rf=Gt.styled.div`
131
131
  margin-bottom: 10px;
132
- `,Ms=Gt.styled.div`
132
+ `,Rs=Gt.styled.div`
133
133
  display: inline-block;
134
134
  margin-right: 20px;
135
135
  padding: 2px 0;
136
136
  text-align: center;
137
137
  color: ${({theme:t})=>t.colors.text.light};
138
- `,Mf=(0,Gt.styled)(Ms)`
138
+ `,Mf=(0,Gt.styled)(Rs)`
139
139
  color: ${({theme:t,code:r})=>r>=200&&r<300?t.colors.responses.success.tabTextColor:r>=300&&r<400?t.colors.responses.redirect.tabTextColor:r>400?t.colors.responses.error.tabTextColor:t.colors.responses.info.tabTextColor};
140
140
  `,iu=Gt.styled.strong`
141
141
  text-transform: capitalize;
142
142
  display: inline-block;
143
143
  padding-right: 5px;
144
- `,Ls=Gt.styled.header`
144
+ `,Ms=Gt.styled.header`
145
145
  font-weight: bold;
146
146
  margin-bottom: 10px;
147
147
  `,Jo=Gt.styled.code`
148
148
  border-left: 3px solid #ff4040;
149
149
  padding-left: 5px;
150
- `,Ds=Gt.styled.div`
150
+ `,Ls=Gt.styled.div`
151
151
  margin-bottom: 10px;
152
152
 
153
153
  &:not(:first-child) {
154
154
  margin-top: 10px;
155
155
  }
156
- `,Ns=(0,Gt.styled)(gn.nr)`
156
+ `,Ds=(0,Gt.styled)(gn.nr)`
157
157
  border-top-left-radius: 0;
158
158
  border-top-right-radius: 0;
159
- `;class Bs extends d.PureComponent{render(){const{error:r,response:i,time:a}=this.props,s=i||r&&r.response,p=s&&s.data&&s.data.length||0;let y;if(p>1e6?y=(p/1e6).toFixed(2)+" MB":p>1e3?y=(p/1e3).toFixed(2)+" KB":y=p+" B",r&&!r.response||!s)return d.createElement(d.Fragment,null,d.createElement(Ls,null," Could not get any response "),d.createElement(Jo,null,r&&r.message||"Unknown error"),d.createElement("br",null),d.createElement(Ls,null," Why this might have happened:"),d.createElement("div",null," - CORS is misconfigured on the server"),d.createElement("div",null," - ","The server couldn't sent a response"),d.createElement("div",null," - No internet access"),d.createElement("div",null," - Documentation issue - contact API owner"),d.createElement("div",null," - Misconfigured security definition"));if(!s)return d.createElement(d.Fragment,null,"Something went wrong");const S=Object.keys(s.headers);return d.createElement(d.Fragment,null,d.createElement(Rf,null,d.createElement(Mf,{code:s.status},d.createElement("span",null," Status: "),s.status," ",s.statusText),d.createElement(Ms,null,d.createElement("span",null," Time: "),a,"ms"),d.createElement(Ms,null,d.createElement("span",null," Size: "),y)),d.createElement("div",null,d.createElement(Ds,null," Headers: "),d.createElement(Ns,null,S.map(w=>d.createElement("div",{key:w},d.createElement(iu,null,w,":"),d.createElement("code",null," ",s.headers[w])))),d.createElement(ru,{response:s})))}}var Ma=o(9996),Us=o.n(Ma),La=o(29656),qr=o(4631);function Xo(t,r){r===void 0&&(r=!1);var i=t.length,a=0,s="",p=0,y=16,S=0,w=0,E=0,k=0,$=0;function ae(Fe,Ke){for(var Ue=0,$e=0;Ue<Fe||!Ke;){var Be=t.charCodeAt(a);if(Be>=48&&Be<=57)$e=$e*16+Be-48;else if(Be>=65&&Be<=70)$e=$e*16+Be-65+10;else if(Be>=97&&Be<=102)$e=$e*16+Be-97+10;else break;a++,Ue++}return Ue<Fe&&($e=-1),$e}function re(Fe){a=Fe,s="",p=0,y=16,$=0}function le(){var Fe=a;if(t.charCodeAt(a)===48)a++;else for(a++;a<t.length&&Zi(t.charCodeAt(a));)a++;if(a<t.length&&t.charCodeAt(a)===46)if(a++,a<t.length&&Zi(t.charCodeAt(a)))for(a++;a<t.length&&Zi(t.charCodeAt(a));)a++;else return $=3,t.substring(Fe,a);var Ke=a;if(a<t.length&&(t.charCodeAt(a)===69||t.charCodeAt(a)===101))if(a++,(a<t.length&&t.charCodeAt(a)===43||t.charCodeAt(a)===45)&&a++,a<t.length&&Zi(t.charCodeAt(a))){for(a++;a<t.length&&Zi(t.charCodeAt(a));)a++;Ke=a}else $=3;return t.substring(Fe,Ke)}function ge(){for(var Fe="",Ke=a;;){if(a>=i){Fe+=t.substring(Ke,a),$=2;break}var Ue=t.charCodeAt(a);if(Ue===34){Fe+=t.substring(Ke,a),a++;break}if(Ue===92){if(Fe+=t.substring(Ke,a),a++,a>=i){$=2;break}var $e=t.charCodeAt(a++);switch($e){case 34:Fe+='"';break;case 92:Fe+="\\";break;case 47:Fe+="/";break;case 98:Fe+="\b";break;case 102:Fe+="\f";break;case 110:Fe+=`
159
+ `;class Ns extends d.PureComponent{render(){const{error:r,response:i,time:a}=this.props,s=i||r&&r.response,p=s&&s.data&&s.data.length||0;let y;if(p>1e6?y=(p/1e6).toFixed(2)+" MB":p>1e3?y=(p/1e3).toFixed(2)+" KB":y=p+" B",r&&!r.response||!s)return d.createElement(d.Fragment,null,d.createElement(Ms,null," Could not get any response "),d.createElement(Jo,null,r&&r.message||"Unknown error"),d.createElement("br",null),d.createElement(Ms,null," Why this might have happened:"),d.createElement("div",null," - CORS is misconfigured on the server"),d.createElement("div",null," - ","The server couldn't sent a response"),d.createElement("div",null," - No internet access"),d.createElement("div",null," - Documentation issue - contact API owner"),d.createElement("div",null," - Misconfigured security definition"));if(!s)return d.createElement(d.Fragment,null,"Something went wrong");const S=Object.keys(s.headers);return d.createElement(d.Fragment,null,d.createElement(Rf,null,d.createElement(Mf,{code:s.status},d.createElement("span",null," Status: "),s.status," ",s.statusText),d.createElement(Rs,null,d.createElement("span",null," Time: "),a,"ms"),d.createElement(Rs,null,d.createElement("span",null," Size: "),y)),d.createElement("div",null,d.createElement(Ls,null," Headers: "),d.createElement(Ds,null,S.map(w=>d.createElement("div",{key:w},d.createElement(iu,null,w,":"),d.createElement("code",null," ",s.headers[w])))),d.createElement(ru,{response:s})))}}var Ma=o(9996),Bs=o.n(Ma),La=o(29656),qr=o(4631);function Xo(t,r){r===void 0&&(r=!1);var i=t.length,a=0,s="",p=0,y=16,S=0,w=0,E=0,k=0,$=0;function ae(Fe,Ke){for(var Ue=0,$e=0;Ue<Fe||!Ke;){var Be=t.charCodeAt(a);if(Be>=48&&Be<=57)$e=$e*16+Be-48;else if(Be>=65&&Be<=70)$e=$e*16+Be-65+10;else if(Be>=97&&Be<=102)$e=$e*16+Be-97+10;else break;a++,Ue++}return Ue<Fe&&($e=-1),$e}function re(Fe){a=Fe,s="",p=0,y=16,$=0}function le(){var Fe=a;if(t.charCodeAt(a)===48)a++;else for(a++;a<t.length&&Zi(t.charCodeAt(a));)a++;if(a<t.length&&t.charCodeAt(a)===46)if(a++,a<t.length&&Zi(t.charCodeAt(a)))for(a++;a<t.length&&Zi(t.charCodeAt(a));)a++;else return $=3,t.substring(Fe,a);var Ke=a;if(a<t.length&&(t.charCodeAt(a)===69||t.charCodeAt(a)===101))if(a++,(a<t.length&&t.charCodeAt(a)===43||t.charCodeAt(a)===45)&&a++,a<t.length&&Zi(t.charCodeAt(a))){for(a++;a<t.length&&Zi(t.charCodeAt(a));)a++;Ke=a}else $=3;return t.substring(Fe,Ke)}function ge(){for(var Fe="",Ke=a;;){if(a>=i){Fe+=t.substring(Ke,a),$=2;break}var Ue=t.charCodeAt(a);if(Ue===34){Fe+=t.substring(Ke,a),a++;break}if(Ue===92){if(Fe+=t.substring(Ke,a),a++,a>=i){$=2;break}var $e=t.charCodeAt(a++);switch($e){case 34:Fe+='"';break;case 92:Fe+="\\";break;case 47:Fe+="/";break;case 98:Fe+="\b";break;case 102:Fe+="\f";break;case 110:Fe+=`
160
160
  `;break;case 114:Fe+="\r";break;case 116:Fe+=" ";break;case 117:var Be=ae(4,!0);Be>=0?Fe+=String.fromCharCode(Be):$=4;break;default:$=5}Ke=a;continue}if(Ue>=0&&Ue<=31)if(Qi(Ue)){Fe+=t.substring(Ke,a),$=2;break}else $=6;a++}return Fe}function he(){if(s="",$=0,p=a,w=S,k=E,a>=i)return p=i,y=17;var Fe=t.charCodeAt(a);if(Qo(Fe)){do a++,s+=String.fromCharCode(Fe),Fe=t.charCodeAt(a);while(Qo(Fe));return y=15}if(Qi(Fe))return a++,s+=String.fromCharCode(Fe),Fe===13&&t.charCodeAt(a)===10&&(a++,s+=`
161
161
  `),S++,E=a,y=14;switch(Fe){case 123:return a++,y=1;case 125:return a++,y=2;case 91:return a++,y=3;case 93:return a++,y=4;case 58:return a++,y=6;case 44:return a++,y=5;case 34:return a++,s=ge(),y=10;case 47:var Ke=a-1;if(t.charCodeAt(a+1)===47){for(a+=2;a<i&&!Qi(t.charCodeAt(a));)a++;return s=t.substring(Ke,a),y=12}if(t.charCodeAt(a+1)===42){a+=2;for(var Ue=i-1,$e=!1;a<Ue;){var Be=t.charCodeAt(a);if(Be===42&&t.charCodeAt(a+1)===47){a+=2,$e=!0;break}a++,Qi(Be)&&(Be===13&&t.charCodeAt(a)===10&&a++,S++,E=a)}return $e||(a++,$=1),s=t.substring(Ke,a),y=13}return s+=String.fromCharCode(Fe),a++,y=16;case 45:if(s+=String.fromCharCode(Fe),a++,a===i||!Zi(t.charCodeAt(a)))return y=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return s+=le(),y=11;default:for(;a<i&&Se(Fe);)a++,Fe=t.charCodeAt(a);if(p!==a){switch(s=t.substring(p,a),s){case"true":return y=8;case"false":return y=9;case"null":return y=7}return y=16}return s+=String.fromCharCode(Fe),a++,y=16}}function Se(Fe){if(Qo(Fe)||Qi(Fe))return!1;switch(Fe){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function me(){var Fe;do Fe=he();while(Fe>=12&&Fe<=15);return Fe}return{setPosition:re,getPosition:function(){return a},scan:r?me:he,getToken:function(){return y},getTokenValue:function(){return s},getTokenOffset:function(){return p},getTokenLength:function(){return a-p},getTokenStartLine:function(){return w},getTokenStartCharacter:function(){return p-k},getTokenError:function(){return $}}}function Qo(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Qi(t){return t===10||t===13||t===8232||t===8233}function Zi(t){return t>=48&&t<=57}function ou(t,r,i){var a,s,p,y,S;if(r){for(y=r.offset,S=y+r.length,p=y;p>0&&!au(t,p-1);)p--;for(var w=S;w<t.length&&!au(t,w);)w++;s=t.substring(p,w),a=Lf(s,i)}else s=t,a=0,p=0,y=0,S=t.length;var E=Df(i,t),k=!1,$=0,ae;i.insertSpaces?ae=Zo(" ",i.tabSize||4):ae=" ";var re=Xo(s,!1),le=!1;function ge(){return E+Zo(ae,a+$)}function he(){var ze=re.scan();for(k=!1;ze===15||ze===14;)k=k||ze===14,ze=re.scan();return le=ze===16||re.getTokenError()!==0,ze}var Se=[];function me(ze,et,wt){!le&&et<S&&wt>y&&t.substring(et,wt)!==ze&&Se.push({offset:et,length:wt-et,content:ze})}var Fe=he();if(Fe!==17){var Ke=re.getTokenOffset()+p,Ue=Zo(ae,a);me(Ue,p,Ke)}for(;Fe!==17;){for(var $e=re.getTokenOffset()+re.getTokenLength()+p,Be=he(),je="";!k&&(Be===12||Be===13);){var We=re.getTokenOffset()+p;me(" ",$e,We),$e=re.getTokenOffset()+re.getTokenLength()+p,je=Be===12?ge():"",Be=he()}if(Be===2)Fe!==1&&($--,je=ge());else if(Be===4)Fe!==3&&($--,je=ge());else{switch(Fe){case 3:case 1:$++,je=ge();break;case 5:case 12:je=ge();break;case 13:k?je=ge():je=" ";break;case 6:je=" ";break;case 10:if(Be===6){je="";break}case 7:case 8:case 9:case 11:case 2:case 4:Be===12||Be===13?je=" ":Be!==5&&Be!==17&&(le=!0);break;case 16:le=!0;break}k&&(Be===12||Be===13)&&(je=ge())}var Je=re.getTokenOffset()+p;me(je,$e,Je),Fe=Be}return Se}function Zo(t,r){for(var i="",a=0;a<r;a++)i+=t;return i}function Lf(t,r){for(var i=0,a=0,s=r.tabSize||4;i<t.length;){var p=t.charAt(i);if(p===" ")a++;else if(p===" ")a+=s;else break;i++}return Math.floor(a/s)}function Df(t,r){for(var i=0;i<r.length;i++){var a=r.charAt(i);if(a==="\r")return i+1<r.length&&r.charAt(i+1)===`
162
162
  `?`\r
@@ -164,14 +164,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
164
164
  `)return`
165
165
  `}return t&&t.eol||`
166
166
  `}function au(t,r){return`\r
167
- `.indexOf(t.charAt(r))!==-1}var jn;(function(t){t.DEFAULT={allowTrailingComma:!1}})(jn||(jn={}));function mo(t,r){var i=[],a=new Object,s=void 0,p={value:{},offset:0,length:0,type:"object",parent:void 0},y=!1;function S(w,E,k,$){p.value=w,p.offset=E,p.length=k,p.type=$,p.colonOffset=void 0,s=p}try{$r(t,{onObjectBegin:function(w,E){if(r<=w)throw a;s=void 0,y=r>w,i.push("")},onObjectProperty:function(w,E,k){if(r<E||(S(w,E,k,"property"),i[i.length-1]=w,r<=E+k))throw a},onObjectEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onArrayBegin:function(w,E){if(r<=w)throw a;s=void 0,i.push(0)},onArrayEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onLiteralValue:function(w,E,k){if(r<E||(S(w,E,k,ii(w)),r<=E+k))throw a},onSeparator:function(w,E,k){if(r<=E)throw a;if(w===":"&&s&&s.type==="property")s.colonOffset=E,y=!1,s=void 0;else if(w===","){var $=i[i.length-1];typeof $=="number"?i[i.length-1]=$+1:(y=!0,i[i.length-1]=""),s=void 0}}})}catch(w){if(w!==a)throw w}return{path:i,previousNode:s,isAtPropertyKey:y,matches:function(w){for(var E=0,k=0;E<w.length&&k<i.length;k++)if(w[E]===i[k]||w[E]==="*")E++;else if(w[E]!=="**")return!1;return E===w.length}}}function xo(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=jn.DEFAULT);var a=null,s=[],p=[];function y(w){Array.isArray(s)?s.push(w):a!==null&&(s[a]=w)}var S={onObjectBegin:function(){var w={};y(w),p.push(s),s=w,a=null},onObjectProperty:function(w){a=w},onObjectEnd:function(){s=p.pop()},onArrayBegin:function(){var w=[];y(w),p.push(s),s=w,a=null},onArrayEnd:function(){s=p.pop()},onLiteralValue:y,onError:function(w,E,k){r.push({error:w,offset:E,length:k})}};return $r(t,S,i),s[0]}function js(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=jn.DEFAULT);var a={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(w){a.type==="property"&&(a.length=w-a.offset,a=a.parent)}function p(w){return a.children.push(w),w}var y={onObjectBegin:function(w){a=p({type:"object",offset:w,length:-1,parent:a,children:[]})},onObjectProperty:function(w,E,k){a=p({type:"property",offset:E,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:w,offset:E,length:k,parent:a})},onObjectEnd:function(w,E){s(w+E),a.length=w+E-a.offset,a=a.parent,s(w+E)},onArrayBegin:function(w,E){a=p({type:"array",offset:w,length:-1,parent:a,children:[]})},onArrayEnd:function(w,E){a.length=w+E-a.offset,a=a.parent,s(w+E)},onLiteralValue:function(w,E,k){p({type:ii(w),offset:E,length:k,parent:a,value:w}),s(E+k)},onSeparator:function(w,E,k){a.type==="property"&&(w===":"?a.colonOffset=E:w===","&&s(E))},onError:function(w,E,k){r.push({error:w,offset:E,length:k})}};$r(t,y,i);var S=a.children[0];return S&&delete S.parent,S}function Vs(t,r){if(!!t){for(var i=t,a=0,s=r;a<s.length;a++){var p=s[a];if(typeof p=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var y=!1,S=0,w=i.children;S<w.length;S++){var E=w[S];if(Array.isArray(E.children)&&E.children[0].value===p){i=E.children[1],y=!0;break}}if(!y)return}else{var k=p;if(i.type!=="array"||k<0||!Array.isArray(i.children)||k>=i.children.length)return;i=i.children[k]}}return i}}function Ws(t){if(!t.parent||!t.parent.children)return[];var r=Ws(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var a=t.parent.children.indexOf(t);a!==-1&&r.push(a)}return r}function _o(t){switch(t.type){case"array":return t.children.map(_o);case"object":for(var r=Object.create(null),i=0,a=t.children;i<a.length;i++){var s=a[i],p=s.children[1];p&&(r[s.children[0].value]=_o(p))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function _i(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function Ai(t,r,i){if(i===void 0&&(i=!1),_i(t,r,i)){var a=t.children;if(Array.isArray(a))for(var s=0;s<a.length&&a[s].offset<=r;s++){var p=Ai(a[s],r,i);if(p)return p}return t}}function $r(t,r,i){i===void 0&&(i=jn.DEFAULT);var a=Xo(t,!1);function s(We){return We?function(){return We(a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}function p(We){return We?function(Je){return We(Je,a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}var y=s(r.onObjectBegin),S=p(r.onObjectProperty),w=s(r.onObjectEnd),E=s(r.onArrayBegin),k=s(r.onArrayEnd),$=p(r.onLiteralValue),ae=p(r.onSeparator),re=s(r.onComment),le=p(r.onError),ge=i&&i.disallowComments,he=i&&i.allowTrailingComma;function Se(){for(;;){var We=a.scan();switch(a.getTokenError()){case 4:me(14);break;case 5:me(15);break;case 3:me(13);break;case 1:ge||me(11);break;case 2:me(12);break;case 6:me(16);break}switch(We){case 12:case 13:ge?me(10):re();break;case 16:me(1);break;case 15:case 14:break;default:return We}}}function me(We,Je,ze){if(Je===void 0&&(Je=[]),ze===void 0&&(ze=[]),le(We),Je.length+ze.length>0)for(var et=a.getToken();et!==17;){if(Je.indexOf(et)!==-1){Se();break}else if(ze.indexOf(et)!==-1)break;et=Se()}}function Fe(We){var Je=a.getTokenValue();return We?$(Je):S(Je),Se(),!0}function Ke(){switch(a.getToken()){case 11:var We=a.getTokenValue(),Je=Number(We);isNaN(Je)&&(me(2),Je=0),$(Je);break;case 7:$(null);break;case 8:$(!0);break;case 9:$(!1);break;default:return!1}return Se(),!0}function Ue(){return a.getToken()!==10?(me(3,[],[2,5]),!1):(Fe(!1),a.getToken()===6?(ae(":"),Se(),je()||me(4,[],[2,5])):me(5,[],[2,5]),!0)}function $e(){y(),Se();for(var We=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ae(","),Se(),a.getToken()===2&&he)break}else We&&me(6,[],[]);Ue()||me(4,[],[2,5]),We=!0}return w(),a.getToken()!==2?me(7,[2],[]):Se(),!0}function Be(){E(),Se();for(var We=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ae(","),Se(),a.getToken()===4&&he)break}else We&&me(6,[],[]);je()||me(4,[],[4,5]),We=!0}return k(),a.getToken()!==4?me(8,[4],[]):Se(),!0}function je(){switch(a.getToken()){case 3:return Be();case 1:return $e();case 10:return Fe(!0);default:return Ke()}}return Se(),a.getToken()===17?i.allowEmptyContent?!0:(me(4,[],[]),!1):je()?(a.getToken()!==17&&me(9,[],[]),!0):(me(4,[],[]),!1)}function Ei(t,r){var i=Xo(t),a=[],s,p=0,y;do switch(y=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:p!==y&&a.push(t.substring(p,y)),r!==void 0&&a.push(i.getTokenValue().replace(/[^\r\n]/g,r)),p=i.getPosition();break}while(s!==17);return a.join("")}function ii(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function Hs(t,r,i){return Nf(t,r,void 0,i)}function Nf(t,r,i,a){for(var s,p=r.slice(),y=[],S=parseTree(t,y),w=void 0,E=void 0;p.length>0&&(E=p.pop(),w=findNodeAtLocation(S,p),w===void 0&&i!==void 0);)typeof E=="string"?i=(s={},s[E]=i,s):i=[i];if(w)if(w.type==="object"&&typeof E=="string"&&Array.isArray(w.children)){var k=findNodeAtLocation(w,[E]);if(k!==void 0)if(i===void 0){if(!k.parent)throw new Error("Malformed AST");var $=w.children.indexOf(k.parent),ae=void 0,re=k.parent.offset+k.parent.length;if($>0){var le=w.children[$-1];ae=le.offset+le.length}else if(ae=w.offset+1,w.children.length>1){var ge=w.children[1];re=ge.offset}return Ci(t,{offset:ae,length:re-ae,content:""},a)}else return Ci(t,{offset:k.offset,length:k.length,content:JSON.stringify(i)},a);else{if(i===void 0)return[];var he=JSON.stringify(E)+": "+JSON.stringify(i),Se=a.getInsertionIndex?a.getInsertionIndex(w.children.map(function(We){return We.children[0].value})):w.children.length,me=void 0;if(Se>0){var le=w.children[Se-1];me={offset:le.offset+le.length,length:0,content:","+he}}else w.children.length===0?me={offset:w.offset+1,length:0,content:he}:me={offset:w.offset+1,length:0,content:he+","};return Ci(t,me,a)}}else if(w.type==="array"&&typeof E=="number"&&Array.isArray(w.children)){var Fe=E;if(Fe===-1){var he=""+JSON.stringify(i),me=void 0;if(w.children.length===0)me={offset:w.offset+1,length:0,content:he};else{var le=w.children[w.children.length-1];me={offset:le.offset+le.length,length:0,content:","+he}}return Ci(t,me,a)}else if(i===void 0&&w.children.length>=0){var Ke=E,Ue=w.children[Ke],me=void 0;if(w.children.length===1)me={offset:w.offset+1,length:w.length-2,content:""};else if(w.children.length-1===Ke){var le=w.children[Ke-1],$e=le.offset+le.length,Be=w.offset+w.length;me={offset:$e,length:Be-2-$e,content:""}}else me={offset:Ue.offset,length:w.children[Ke+1].offset-Ue.offset,content:""};return Ci(t,me,a)}else if(i!==void 0){var me=void 0,he=""+JSON.stringify(i);if(!a.isArrayInsertion&&w.children.length>E){var je=w.children[E];me={offset:je.offset,length:je.length,content:he}}else if(w.children.length===0||E===0)me={offset:w.offset+1,length:0,content:w.children.length===0?he:he+","};else{var Se=E>w.children.length?w.children.length:E,le=w.children[Se-1];me={offset:le.offset+le.length,length:0,content:","+he}}return Ci(t,me,a)}else throw new Error("Can not "+(i===void 0?"remove":a.isArrayInsertion?"insert":"modify")+" Array index "+Fe+" as length is not sufficient")}else throw new Error("Can not add "+(typeof E!="number"?"index":"property")+" to parent of type "+w.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return Ci(t,{offset:S?S.offset:0,length:S?S.length:0,content:JSON.stringify(i)},a)}}function Ci(t,r,i){if(!i.formattingOptions)return[r];var a=bo(t,r),s=r.offset,p=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(a,s-1);)s--;for(;p<a.length&&!isEOL(a,p);)p++}for(var y=format(a,{offset:s,length:p-s},i.formattingOptions),S=y.length-1;S>=0;S--){var w=y[S];a=bo(a,w),s=Math.min(s,w.offset),p=Math.max(p,w.offset+w.length),p+=w.content.length-w.length}var E=t.length-(a.length-p)-s;return[{offset:s,length:E,content:a.substring(s,p)}]}function bo(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function Bf(t,r){return`\r
168
- `.indexOf(t.charAt(r))!==-1}var Oi=Xo,zs=mo,Uf=xo,su=js,jf=Vs,Gs=Ai,$s=Ws,wo=_o,Ks=$r,Vf=Ei;function Ys(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function Wf(t,r,i){return ou(t,r,i)}function Ed(t,r,i,a){return edit.setProperty(t,r,i,a)}function Cd(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function qi(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,a;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!qi(t[i],r[i]))return!1}else{var s=[];for(a in t)s.push(a);s.sort();var p=[];for(a in r)p.push(a);if(p.sort(),!qi(s,p))return!1;for(i=0;i<s.length;i++)if(!qi(t[s[i]],r[s[i]]))return!1}return!0}function sn(t){return typeof t=="number"}function yn(t){return typeof t!="undefined"}function mn(t){return typeof t=="boolean"}function Hf(t){return typeof t=="string"}var qo;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(qo||(qo={}));var ea;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(ea||(ea={}));var ln;(function(t){function r(a,s){return a===Number.MAX_VALUE&&(a=ea.MAX_VALUE),s===Number.MAX_VALUE&&(s=ea.MAX_VALUE),{line:a,character:s}}t.create=r;function i(a){var s=a;return Ze.objectLiteral(s)&&Ze.uinteger(s.line)&&Ze.uinteger(s.character)}t.is=i})(ln||(ln={}));var tr;(function(t){function r(a,s,p,y){if(Ze.uinteger(a)&&Ze.uinteger(s)&&Ze.uinteger(p)&&Ze.uinteger(y))return{start:ln.create(a,s),end:ln.create(p,y)};if(ln.is(a)&&ln.is(s))return{start:a,end:s};throw new Error("Range#create called with invalid arguments["+a+", "+s+", "+p+", "+y+"]")}t.create=r;function i(a){var s=a;return Ze.objectLiteral(s)&&ln.is(s.start)&&ln.is(s.end)}t.is=i})(tr||(tr={}));var Vn;(function(t){function r(a,s){return{uri:a,range:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.range)&&(Ze.string(s.uri)||Ze.undefined(s.uri))}t.is=i})(Vn||(Vn={}));var So;(function(t){function r(a,s,p,y){return{targetUri:a,targetRange:s,targetSelectionRange:p,originSelectionRange:y}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.targetRange)&&Ze.string(s.targetUri)&&(tr.is(s.targetSelectionRange)||Ze.undefined(s.targetSelectionRange))&&(tr.is(s.originSelectionRange)||Ze.undefined(s.originSelectionRange))}t.is=i})(So||(So={}));var oi;(function(t){function r(a,s,p,y){return{red:a,green:s,blue:p,alpha:y}}t.create=r;function i(a){var s=a;return Ze.numberRange(s.red,0,1)&&Ze.numberRange(s.green,0,1)&&Ze.numberRange(s.blue,0,1)&&Ze.numberRange(s.alpha,0,1)}t.is=i})(oi||(oi={}));var Ao;(function(t){function r(a,s){return{range:a,color:s}}t.create=r;function i(a){var s=a;return tr.is(s.range)&&oi.is(s.color)}t.is=i})(Ao||(Ao={}));var eo;(function(t){function r(a,s,p){return{label:a,textEdit:s,additionalTextEdits:p}}t.create=r;function i(a){var s=a;return Ze.string(s.label)&&(Ze.undefined(s.textEdit)||Wn.is(s))&&(Ze.undefined(s.additionalTextEdits)||Ze.typedArray(s.additionalTextEdits,Wn.is))}t.is=i})(eo||(eo={}));var Eo;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Eo||(Eo={}));var Js;(function(t){function r(a,s,p,y,S){var w={startLine:a,endLine:s};return Ze.defined(p)&&(w.startCharacter=p),Ze.defined(y)&&(w.endCharacter=y),Ze.defined(S)&&(w.kind=S),w}t.create=r;function i(a){var s=a;return Ze.uinteger(s.startLine)&&Ze.uinteger(s.startLine)&&(Ze.undefined(s.startCharacter)||Ze.uinteger(s.startCharacter))&&(Ze.undefined(s.endCharacter)||Ze.uinteger(s.endCharacter))&&(Ze.undefined(s.kind)||Ze.string(s.kind))}t.is=i})(Js||(Js={}));var Da;(function(t){function r(a,s){return{location:a,message:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Vn.is(s.location)&&Ze.string(s.message)}t.is=i})(Da||(Da={}));var Ht;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Ht||(Ht={}));var Ti;(function(t){t.Unnecessary=1,t.Deprecated=2})(Ti||(Ti={}));var Pi;(function(t){function r(i){var a=i;return a!=null&&Ze.string(a.href)}t.is=r})(Pi||(Pi={}));var ai;(function(t){function r(a,s,p,y,S,w){var E={range:a,message:s};return Ze.defined(p)&&(E.severity=p),Ze.defined(y)&&(E.code=y),Ze.defined(S)&&(E.source=S),Ze.defined(w)&&(E.relatedInformation=w),E}t.create=r;function i(a){var s,p=a;return Ze.defined(p)&&tr.is(p.range)&&Ze.string(p.message)&&(Ze.number(p.severity)||Ze.undefined(p.severity))&&(Ze.integer(p.code)||Ze.string(p.code)||Ze.undefined(p.code))&&(Ze.undefined(p.codeDescription)||Ze.string((s=p.codeDescription)===null||s===void 0?void 0:s.href))&&(Ze.string(p.source)||Ze.undefined(p.source))&&(Ze.undefined(p.relatedInformation)||Ze.typedArray(p.relatedInformation,Da.is))}t.is=i})(ai||(ai={}));var ta;(function(t){function r(a,s){for(var p=[],y=2;y<arguments.length;y++)p[y-2]=arguments[y];var S={title:a,command:s};return Ze.defined(p)&&p.length>0&&(S.arguments=p),S}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.title)&&Ze.string(s.command)}t.is=i})(ta||(ta={}));var Wn;(function(t){function r(p,y){return{range:p,newText:y}}t.replace=r;function i(p,y){return{range:{start:p,end:p},newText:y}}t.insert=i;function a(p){return{range:p,newText:""}}t.del=a;function s(p){var y=p;return Ze.objectLiteral(y)&&Ze.string(y.newText)&&tr.is(y.range)}t.is=s})(Wn||(Wn={}));var Co;(function(t){function r(a,s,p){var y={label:a};return s!==void 0&&(y.needsConfirmation=s),p!==void 0&&(y.description=p),y}t.create=r;function i(a){var s=a;return s!==void 0&&Ze.objectLiteral(s)&&Ze.string(s.label)&&(Ze.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(Ze.string(s.description)||s.description===void 0)}t.is=i})(Co||(Co={}));var en;(function(t){function r(i){var a=i;return typeof a=="string"}t.is=r})(en||(en={}));var Ii;(function(t){function r(p,y,S){return{range:p,newText:y,annotationId:S}}t.replace=r;function i(p,y,S){return{range:{start:p,end:p},newText:y,annotationId:S}}t.insert=i;function a(p,y){return{range:p,newText:"",annotationId:y}}t.del=a;function s(p){var y=p;return Wn.is(y)&&(Co.is(y.annotationId)||en.is(y.annotationId))}t.is=s})(Ii||(Ii={}));var Yr;(function(t){function r(a,s){return{textDocument:a,edits:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Oo.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(Yr||(Yr={}));var xr;(function(t){function r(a,s,p){var y={kind:"create",uri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="create"&&Ze.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||Ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||en.is(s.annotationId))}t.is=i})(xr||(xr={}));var Lr;(function(t){function r(a,s,p,y){var S={kind:"rename",oldUri:a,newUri:s};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(S.options=p),y!==void 0&&(S.annotationId=y),S}t.create=r;function i(a){var s=a;return s&&s.kind==="rename"&&Ze.string(s.oldUri)&&Ze.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||Ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||en.is(s.annotationId))}t.is=i})(Lr||(Lr={}));var br;(function(t){function r(a,s,p){var y={kind:"delete",uri:a};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="delete"&&Ze.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||Ze.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||Ze.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||en.is(s.annotationId))}t.is=i})(br||(br={}));var to;(function(t){function r(i){var a=i;return a&&(a.changes!==void 0||a.documentChanges!==void 0)&&(a.documentChanges===void 0||a.documentChanges.every(function(s){return Ze.string(s.kind)?xr.is(s)||Lr.is(s)||br.is(s):Yr.is(s)}))}t.is=r})(to||(to={}));var Na=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,a){var s,p;if(a===void 0?s=Wn.insert(r,i):en.is(a)?(p=a,s=Ii.insert(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Ii.insert(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.replace=function(r,i,a){var s,p;if(a===void 0?s=Wn.replace(r,i):en.is(a)?(p=a,s=Ii.replace(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Ii.replace(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.delete=function(r,i){var a,s;if(i===void 0?a=Wn.del(r):en.is(i)?(s=i,a=Ii.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),a=Ii.del(r,s)),this.edits.push(a),s!==void 0)return s},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),ra=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var a;if(en.is(r)?a=r:(a=this.nextId(),i=r),this._annotations[a]!==void 0)throw new Error("Id "+a+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+a);return this._annotations[a]=i,this._size++,a},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),Od=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new ra(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(a){if(Yr.is(a)){var s=new Na(a.edits,i._changeAnnotations);i._textEditChanges[a.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(a){var s=new Na(r.changes[a]);i._textEditChanges[a]=s})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(Oo.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},a=this._textEditChanges[i.uri];if(!a){var s=[],p={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(p),a=new Na(s,this._changeAnnotations),this._textEditChanges[i.uri]=a}return a}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var a=this._textEditChanges[r];if(!a){var s=[];this._workspaceEdit.changes[r]=s,a=new Na(s),this._textEditChanges[r]=a}return a}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ra,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Co.is(i)||en.is(i)?s=i:a=i;var p,y;if(s===void 0?p=xr.create(r,a):(y=en.is(s)?s:this._changeAnnotations.manage(s),p=xr.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t.prototype.renameFile=function(r,i,a,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;Co.is(a)||en.is(a)?p=a:s=a;var y,S;if(p===void 0?y=Lr.create(r,i,s):(S=en.is(p)?p:this._changeAnnotations.manage(p),y=Lr.create(r,i,s,S)),this._workspaceEdit.documentChanges.push(y),S!==void 0)return S},t.prototype.deleteFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Co.is(i)||en.is(i)?s=i:a=i;var p,y;if(s===void 0?p=br.create(r,a):(y=en.is(s)?s:this._changeAnnotations.manage(s),p=br.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t}(),lu;(function(t){function r(a){return{uri:a}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)}t.is=i})(lu||(lu={}));var uu;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)&&Ze.integer(s.version)}t.is=i})(uu||(uu={}));var Oo;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)&&(s.version===null||Ze.integer(s.version))}t.is=i})(Oo||(Oo={}));var Xs;(function(t){function r(a,s,p,y){return{uri:a,languageId:s,version:p,text:y}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)&&Ze.string(s.languageId)&&Ze.integer(s.version)&&Ze.string(s.text)}t.is=i})(Xs||(Xs={}));var Hn;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(Hn||(Hn={})),function(t){function r(i){var a=i;return a===t.PlainText||a===t.Markdown}t.is=r}(Hn||(Hn={}));var Qs;(function(t){function r(i){var a=i;return Ze.objectLiteral(i)&&Hn.is(a.kind)&&Ze.string(a.value)}t.is=r})(Qs||(Qs={}));var un;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(un||(un={}));var Ir;(function(t){t.PlainText=1,t.Snippet=2})(Ir||(Ir={}));var Zs;(function(t){t.Deprecated=1})(Zs||(Zs={}));var _s;(function(t){function r(a,s,p){return{newText:a,insert:s,replace:p}}t.create=r;function i(a){var s=a;return s&&Ze.string(s.newText)&&tr.is(s.insert)&&tr.is(s.replace)}t.is=i})(_s||(_s={}));var Ba;(function(t){t.asIs=1,t.adjustIndentation=2})(Ba||(Ba={}));var Ua;(function(t){function r(i){return{label:i}}t.create=r})(Ua||(Ua={}));var To;(function(t){function r(i,a){return{items:i||[],isIncomplete:!!a}}t.create=r})(To||(To={}));var ja;(function(t){function r(a){return a.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(a){var s=a;return Ze.string(s)||Ze.objectLiteral(s)&&Ze.string(s.language)&&Ze.string(s.value)}t.is=i})(ja||(ja={}));var na;(function(t){function r(i){var a=i;return!!a&&Ze.objectLiteral(a)&&(Qs.is(a.contents)||ja.is(a.contents)||Ze.typedArray(a.contents,ja.is))&&(i.range===void 0||tr.is(i.range))}t.is=r})(na||(na={}));var Qn;(function(t){function r(i,a){return a?{label:i,documentation:a}:{label:i}}t.create=r})(Qn||(Qn={}));var qs;(function(t){function r(i,a){for(var s=[],p=2;p<arguments.length;p++)s[p-2]=arguments[p];var y={label:i};return Ze.defined(a)&&(y.documentation=a),Ze.defined(s)?y.parameters=s:y.parameters=[],y}t.create=r})(qs||(qs={}));var fu;(function(t){t.Text=1,t.Read=2,t.Write=3})(fu||(fu={}));var el;(function(t){function r(i,a){var s={range:i};return Ze.number(a)&&(s.kind=a),s}t.create=r})(el||(el={}));var Ar;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Ar||(Ar={}));var _t;(function(t){t.Deprecated=1})(_t||(_t={}));var Fn;(function(t){function r(i,a,s,p,y){var S={name:i,kind:a,location:{uri:p,range:s}};return y&&(S.containerName=y),S}t.create=r})(Fn||(Fn={}));var si;(function(t){function r(a,s,p,y,S,w){var E={name:a,detail:s,kind:p,range:y,selectionRange:S};return w!==void 0&&(E.children=w),E}t.create=r;function i(a){var s=a;return s&&Ze.string(s.name)&&Ze.number(s.kind)&&tr.is(s.range)&&tr.is(s.selectionRange)&&(s.detail===void 0||Ze.string(s.detail))&&(s.deprecated===void 0||Ze.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(si||(si={}));var li;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(li||(li={}));var tl;(function(t){function r(a,s){var p={diagnostics:a};return s!=null&&(p.only=s),p}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.typedArray(s.diagnostics,ai.is)&&(s.only===void 0||Ze.typedArray(s.only,Ze.string))}t.is=i})(tl||(tl={}));var Va;(function(t){function r(a,s,p){var y={title:a},S=!0;return typeof s=="string"?(S=!1,y.kind=s):ta.is(s)?y.command=s:y.edit=s,S&&p!==void 0&&(y.kind=p),y}t.create=r;function i(a){var s=a;return s&&Ze.string(s.title)&&(s.diagnostics===void 0||Ze.typedArray(s.diagnostics,ai.is))&&(s.kind===void 0||Ze.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||ta.is(s.command))&&(s.isPreferred===void 0||Ze.boolean(s.isPreferred))&&(s.edit===void 0||to.is(s.edit))}t.is=i})(Va||(Va={}));var rl;(function(t){function r(a,s){var p={range:a};return Ze.defined(s)&&(p.data=s),p}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.range)&&(Ze.undefined(s.command)||ta.is(s.command))}t.is=i})(rl||(rl={}));var cu;(function(t){function r(a,s){return{tabSize:a,insertSpaces:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.uinteger(s.tabSize)&&Ze.boolean(s.insertSpaces)}t.is=i})(cu||(cu={}));var Wa;(function(t){function r(a,s,p){return{range:a,target:s,data:p}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.range)&&(Ze.undefined(s.target)||Ze.string(s.target))}t.is=i})(Wa||(Wa={}));var Fi;(function(t){function r(a,s){return{range:a,parent:s}}t.create=r;function i(a){var s=a;return s!==void 0&&tr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(Fi||(Fi={}));var zf=null,Ha;(function(t){function r(p,y,S,w){return new ki(p,y,S,w)}t.create=r;function i(p){var y=p;return!!(Ze.defined(y)&&Ze.string(y.uri)&&(Ze.undefined(y.languageId)||Ze.string(y.languageId))&&Ze.uinteger(y.lineCount)&&Ze.func(y.getText)&&Ze.func(y.positionAt)&&Ze.func(y.offsetAt))}t.is=i;function a(p,y){for(var S=p.getText(),w=s(y,function(le,ge){var he=le.range.start.line-ge.range.start.line;return he===0?le.range.start.character-ge.range.start.character:he}),E=S.length,k=w.length-1;k>=0;k--){var $=w[k],ae=p.offsetAt($.range.start),re=p.offsetAt($.range.end);if(re<=E)S=S.substring(0,ae)+$.newText+S.substring(re,S.length);else throw new Error("Overlapping edit");E=ae}return S}t.applyEdits=a;function s(p,y){if(p.length<=1)return p;var S=p.length/2|0,w=p.slice(0,S),E=p.slice(S);s(w,y),s(E,y);for(var k=0,$=0,ae=0;k<w.length&&$<E.length;){var re=y(w[k],E[$]);re<=0?p[ae++]=w[k++]:p[ae++]=E[$++]}for(;k<w.length;)p[ae++]=w[k++];for(;$<E.length;)p[ae++]=E[$++];return p}})(Ha||(Ha={}));var ki=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,a=!0,s=0;s<i.length;s++){a&&(r.push(s),a=!1);var p=i.charAt(s);a=p==="\r"||p===`
167
+ `.indexOf(t.charAt(r))!==-1}var jn;(function(t){t.DEFAULT={allowTrailingComma:!1}})(jn||(jn={}));function mo(t,r){var i=[],a=new Object,s=void 0,p={value:{},offset:0,length:0,type:"object",parent:void 0},y=!1;function S(w,E,k,$){p.value=w,p.offset=E,p.length=k,p.type=$,p.colonOffset=void 0,s=p}try{$r(t,{onObjectBegin:function(w,E){if(r<=w)throw a;s=void 0,y=r>w,i.push("")},onObjectProperty:function(w,E,k){if(r<E||(S(w,E,k,"property"),i[i.length-1]=w,r<=E+k))throw a},onObjectEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onArrayBegin:function(w,E){if(r<=w)throw a;s=void 0,i.push(0)},onArrayEnd:function(w,E){if(r<=w)throw a;s=void 0,i.pop()},onLiteralValue:function(w,E,k){if(r<E||(S(w,E,k,ii(w)),r<=E+k))throw a},onSeparator:function(w,E,k){if(r<=E)throw a;if(w===":"&&s&&s.type==="property")s.colonOffset=E,y=!1,s=void 0;else if(w===","){var $=i[i.length-1];typeof $=="number"?i[i.length-1]=$+1:(y=!0,i[i.length-1]=""),s=void 0}}})}catch(w){if(w!==a)throw w}return{path:i,previousNode:s,isAtPropertyKey:y,matches:function(w){for(var E=0,k=0;E<w.length&&k<i.length;k++)if(w[E]===i[k]||w[E]==="*")E++;else if(w[E]!=="**")return!1;return E===w.length}}}function xo(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=jn.DEFAULT);var a=null,s=[],p=[];function y(w){Array.isArray(s)?s.push(w):a!==null&&(s[a]=w)}var S={onObjectBegin:function(){var w={};y(w),p.push(s),s=w,a=null},onObjectProperty:function(w){a=w},onObjectEnd:function(){s=p.pop()},onArrayBegin:function(){var w=[];y(w),p.push(s),s=w,a=null},onArrayEnd:function(){s=p.pop()},onLiteralValue:y,onError:function(w,E,k){r.push({error:w,offset:E,length:k})}};return $r(t,S,i),s[0]}function Us(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=jn.DEFAULT);var a={type:"array",offset:-1,length:-1,children:[],parent:void 0};function s(w){a.type==="property"&&(a.length=w-a.offset,a=a.parent)}function p(w){return a.children.push(w),w}var y={onObjectBegin:function(w){a=p({type:"object",offset:w,length:-1,parent:a,children:[]})},onObjectProperty:function(w,E,k){a=p({type:"property",offset:E,length:-1,parent:a,children:[]}),a.children.push({type:"string",value:w,offset:E,length:k,parent:a})},onObjectEnd:function(w,E){s(w+E),a.length=w+E-a.offset,a=a.parent,s(w+E)},onArrayBegin:function(w,E){a=p({type:"array",offset:w,length:-1,parent:a,children:[]})},onArrayEnd:function(w,E){a.length=w+E-a.offset,a=a.parent,s(w+E)},onLiteralValue:function(w,E,k){p({type:ii(w),offset:E,length:k,parent:a,value:w}),s(E+k)},onSeparator:function(w,E,k){a.type==="property"&&(w===":"?a.colonOffset=E:w===","&&s(E))},onError:function(w,E,k){r.push({error:w,offset:E,length:k})}};$r(t,y,i);var S=a.children[0];return S&&delete S.parent,S}function js(t,r){if(!!t){for(var i=t,a=0,s=r;a<s.length;a++){var p=s[a];if(typeof p=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;for(var y=!1,S=0,w=i.children;S<w.length;S++){var E=w[S];if(Array.isArray(E.children)&&E.children[0].value===p){i=E.children[1],y=!0;break}}if(!y)return}else{var k=p;if(i.type!=="array"||k<0||!Array.isArray(i.children)||k>=i.children.length)return;i=i.children[k]}}return i}}function Vs(t){if(!t.parent||!t.parent.children)return[];var r=Vs(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var a=t.parent.children.indexOf(t);a!==-1&&r.push(a)}return r}function _o(t){switch(t.type){case"array":return t.children.map(_o);case"object":for(var r=Object.create(null),i=0,a=t.children;i<a.length;i++){var s=a[i],p=s.children[1];p&&(r[s.children[0].value]=_o(p))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function _i(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function Ai(t,r,i){if(i===void 0&&(i=!1),_i(t,r,i)){var a=t.children;if(Array.isArray(a))for(var s=0;s<a.length&&a[s].offset<=r;s++){var p=Ai(a[s],r,i);if(p)return p}return t}}function $r(t,r,i){i===void 0&&(i=jn.DEFAULT);var a=Xo(t,!1);function s(We){return We?function(){return We(a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}function p(We){return We?function(Je){return We(Je,a.getTokenOffset(),a.getTokenLength(),a.getTokenStartLine(),a.getTokenStartCharacter())}:function(){return!0}}var y=s(r.onObjectBegin),S=p(r.onObjectProperty),w=s(r.onObjectEnd),E=s(r.onArrayBegin),k=s(r.onArrayEnd),$=p(r.onLiteralValue),ae=p(r.onSeparator),re=s(r.onComment),le=p(r.onError),ge=i&&i.disallowComments,he=i&&i.allowTrailingComma;function Se(){for(;;){var We=a.scan();switch(a.getTokenError()){case 4:me(14);break;case 5:me(15);break;case 3:me(13);break;case 1:ge||me(11);break;case 2:me(12);break;case 6:me(16);break}switch(We){case 12:case 13:ge?me(10):re();break;case 16:me(1);break;case 15:case 14:break;default:return We}}}function me(We,Je,ze){if(Je===void 0&&(Je=[]),ze===void 0&&(ze=[]),le(We),Je.length+ze.length>0)for(var et=a.getToken();et!==17;){if(Je.indexOf(et)!==-1){Se();break}else if(ze.indexOf(et)!==-1)break;et=Se()}}function Fe(We){var Je=a.getTokenValue();return We?$(Je):S(Je),Se(),!0}function Ke(){switch(a.getToken()){case 11:var We=a.getTokenValue(),Je=Number(We);isNaN(Je)&&(me(2),Je=0),$(Je);break;case 7:$(null);break;case 8:$(!0);break;case 9:$(!1);break;default:return!1}return Se(),!0}function Ue(){return a.getToken()!==10?(me(3,[],[2,5]),!1):(Fe(!1),a.getToken()===6?(ae(":"),Se(),je()||me(4,[],[2,5])):me(5,[],[2,5]),!0)}function $e(){y(),Se();for(var We=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ae(","),Se(),a.getToken()===2&&he)break}else We&&me(6,[],[]);Ue()||me(4,[],[2,5]),We=!0}return w(),a.getToken()!==2?me(7,[2],[]):Se(),!0}function Be(){E(),Se();for(var We=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){if(We||me(4,[],[]),ae(","),Se(),a.getToken()===4&&he)break}else We&&me(6,[],[]);je()||me(4,[],[4,5]),We=!0}return k(),a.getToken()!==4?me(8,[4],[]):Se(),!0}function je(){switch(a.getToken()){case 3:return Be();case 1:return $e();case 10:return Fe(!0);default:return Ke()}}return Se(),a.getToken()===17?i.allowEmptyContent?!0:(me(4,[],[]),!1):je()?(a.getToken()!==17&&me(9,[],[]),!0):(me(4,[],[]),!1)}function Ei(t,r){var i=Xo(t),a=[],s,p=0,y;do switch(y=i.getPosition(),s=i.scan(),s){case 12:case 13:case 17:p!==y&&a.push(t.substring(p,y)),r!==void 0&&a.push(i.getTokenValue().replace(/[^\r\n]/g,r)),p=i.getPosition();break}while(s!==17);return a.join("")}function ii(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function Ws(t,r,i){return Nf(t,r,void 0,i)}function Nf(t,r,i,a){for(var s,p=r.slice(),y=[],S=parseTree(t,y),w=void 0,E=void 0;p.length>0&&(E=p.pop(),w=findNodeAtLocation(S,p),w===void 0&&i!==void 0);)typeof E=="string"?i=(s={},s[E]=i,s):i=[i];if(w)if(w.type==="object"&&typeof E=="string"&&Array.isArray(w.children)){var k=findNodeAtLocation(w,[E]);if(k!==void 0)if(i===void 0){if(!k.parent)throw new Error("Malformed AST");var $=w.children.indexOf(k.parent),ae=void 0,re=k.parent.offset+k.parent.length;if($>0){var le=w.children[$-1];ae=le.offset+le.length}else if(ae=w.offset+1,w.children.length>1){var ge=w.children[1];re=ge.offset}return Ci(t,{offset:ae,length:re-ae,content:""},a)}else return Ci(t,{offset:k.offset,length:k.length,content:JSON.stringify(i)},a);else{if(i===void 0)return[];var he=JSON.stringify(E)+": "+JSON.stringify(i),Se=a.getInsertionIndex?a.getInsertionIndex(w.children.map(function(We){return We.children[0].value})):w.children.length,me=void 0;if(Se>0){var le=w.children[Se-1];me={offset:le.offset+le.length,length:0,content:","+he}}else w.children.length===0?me={offset:w.offset+1,length:0,content:he}:me={offset:w.offset+1,length:0,content:he+","};return Ci(t,me,a)}}else if(w.type==="array"&&typeof E=="number"&&Array.isArray(w.children)){var Fe=E;if(Fe===-1){var he=""+JSON.stringify(i),me=void 0;if(w.children.length===0)me={offset:w.offset+1,length:0,content:he};else{var le=w.children[w.children.length-1];me={offset:le.offset+le.length,length:0,content:","+he}}return Ci(t,me,a)}else if(i===void 0&&w.children.length>=0){var Ke=E,Ue=w.children[Ke],me=void 0;if(w.children.length===1)me={offset:w.offset+1,length:w.length-2,content:""};else if(w.children.length-1===Ke){var le=w.children[Ke-1],$e=le.offset+le.length,Be=w.offset+w.length;me={offset:$e,length:Be-2-$e,content:""}}else me={offset:Ue.offset,length:w.children[Ke+1].offset-Ue.offset,content:""};return Ci(t,me,a)}else if(i!==void 0){var me=void 0,he=""+JSON.stringify(i);if(!a.isArrayInsertion&&w.children.length>E){var je=w.children[E];me={offset:je.offset,length:je.length,content:he}}else if(w.children.length===0||E===0)me={offset:w.offset+1,length:0,content:w.children.length===0?he:he+","};else{var Se=E>w.children.length?w.children.length:E,le=w.children[Se-1];me={offset:le.offset+le.length,length:0,content:","+he}}return Ci(t,me,a)}else throw new Error("Can not "+(i===void 0?"remove":a.isArrayInsertion?"insert":"modify")+" Array index "+Fe+" as length is not sufficient")}else throw new Error("Can not add "+(typeof E!="number"?"index":"property")+" to parent of type "+w.type);else{if(i===void 0)throw new Error("Can not delete in empty document");return Ci(t,{offset:S?S.offset:0,length:S?S.length:0,content:JSON.stringify(i)},a)}}function Ci(t,r,i){if(!i.formattingOptions)return[r];var a=bo(t,r),s=r.offset,p=r.offset+r.content.length;if(r.length===0||r.content.length===0){for(;s>0&&!isEOL(a,s-1);)s--;for(;p<a.length&&!isEOL(a,p);)p++}for(var y=format(a,{offset:s,length:p-s},i.formattingOptions),S=y.length-1;S>=0;S--){var w=y[S];a=bo(a,w),s=Math.min(s,w.offset),p=Math.max(p,w.offset+w.length),p+=w.content.length-w.length}var E=t.length-(a.length-p)-s;return[{offset:s,length:E,content:a.substring(s,p)}]}function bo(t,r){return t.substring(0,r.offset)+r.content+t.substring(r.offset+r.length)}function Bf(t,r){return`\r
168
+ `.indexOf(t.charAt(r))!==-1}var Oi=Xo,Hs=mo,Uf=xo,su=Us,jf=js,zs=Ai,Gs=Vs,wo=_o,$s=$r,Vf=Ei;function Ks(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function Wf(t,r,i){return ou(t,r,i)}function Ed(t,r,i,a){return edit.setProperty(t,r,i,a)}function Cd(t,r){for(var i=r.length-1;i>=0;i--)t=edit.applyEdit(t,r[i]);return t}function qi(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,a;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!qi(t[i],r[i]))return!1}else{var s=[];for(a in t)s.push(a);s.sort();var p=[];for(a in r)p.push(a);if(p.sort(),!qi(s,p))return!1;for(i=0;i<s.length;i++)if(!qi(t[s[i]],r[s[i]]))return!1}return!0}function sn(t){return typeof t=="number"}function yn(t){return typeof t!="undefined"}function mn(t){return typeof t=="boolean"}function Hf(t){return typeof t=="string"}var qo;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(qo||(qo={}));var ea;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(ea||(ea={}));var ln;(function(t){function r(a,s){return a===Number.MAX_VALUE&&(a=ea.MAX_VALUE),s===Number.MAX_VALUE&&(s=ea.MAX_VALUE),{line:a,character:s}}t.create=r;function i(a){var s=a;return Ze.objectLiteral(s)&&Ze.uinteger(s.line)&&Ze.uinteger(s.character)}t.is=i})(ln||(ln={}));var tr;(function(t){function r(a,s,p,y){if(Ze.uinteger(a)&&Ze.uinteger(s)&&Ze.uinteger(p)&&Ze.uinteger(y))return{start:ln.create(a,s),end:ln.create(p,y)};if(ln.is(a)&&ln.is(s))return{start:a,end:s};throw new Error("Range#create called with invalid arguments["+a+", "+s+", "+p+", "+y+"]")}t.create=r;function i(a){var s=a;return Ze.objectLiteral(s)&&ln.is(s.start)&&ln.is(s.end)}t.is=i})(tr||(tr={}));var Vn;(function(t){function r(a,s){return{uri:a,range:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.range)&&(Ze.string(s.uri)||Ze.undefined(s.uri))}t.is=i})(Vn||(Vn={}));var So;(function(t){function r(a,s,p,y){return{targetUri:a,targetRange:s,targetSelectionRange:p,originSelectionRange:y}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.targetRange)&&Ze.string(s.targetUri)&&(tr.is(s.targetSelectionRange)||Ze.undefined(s.targetSelectionRange))&&(tr.is(s.originSelectionRange)||Ze.undefined(s.originSelectionRange))}t.is=i})(So||(So={}));var oi;(function(t){function r(a,s,p,y){return{red:a,green:s,blue:p,alpha:y}}t.create=r;function i(a){var s=a;return Ze.numberRange(s.red,0,1)&&Ze.numberRange(s.green,0,1)&&Ze.numberRange(s.blue,0,1)&&Ze.numberRange(s.alpha,0,1)}t.is=i})(oi||(oi={}));var Ao;(function(t){function r(a,s){return{range:a,color:s}}t.create=r;function i(a){var s=a;return tr.is(s.range)&&oi.is(s.color)}t.is=i})(Ao||(Ao={}));var eo;(function(t){function r(a,s,p){return{label:a,textEdit:s,additionalTextEdits:p}}t.create=r;function i(a){var s=a;return Ze.string(s.label)&&(Ze.undefined(s.textEdit)||Wn.is(s))&&(Ze.undefined(s.additionalTextEdits)||Ze.typedArray(s.additionalTextEdits,Wn.is))}t.is=i})(eo||(eo={}));var Eo;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Eo||(Eo={}));var Ys;(function(t){function r(a,s,p,y,S){var w={startLine:a,endLine:s};return Ze.defined(p)&&(w.startCharacter=p),Ze.defined(y)&&(w.endCharacter=y),Ze.defined(S)&&(w.kind=S),w}t.create=r;function i(a){var s=a;return Ze.uinteger(s.startLine)&&Ze.uinteger(s.startLine)&&(Ze.undefined(s.startCharacter)||Ze.uinteger(s.startCharacter))&&(Ze.undefined(s.endCharacter)||Ze.uinteger(s.endCharacter))&&(Ze.undefined(s.kind)||Ze.string(s.kind))}t.is=i})(Ys||(Ys={}));var Da;(function(t){function r(a,s){return{location:a,message:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Vn.is(s.location)&&Ze.string(s.message)}t.is=i})(Da||(Da={}));var Ht;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Ht||(Ht={}));var Ti;(function(t){t.Unnecessary=1,t.Deprecated=2})(Ti||(Ti={}));var Pi;(function(t){function r(i){var a=i;return a!=null&&Ze.string(a.href)}t.is=r})(Pi||(Pi={}));var ai;(function(t){function r(a,s,p,y,S,w){var E={range:a,message:s};return Ze.defined(p)&&(E.severity=p),Ze.defined(y)&&(E.code=y),Ze.defined(S)&&(E.source=S),Ze.defined(w)&&(E.relatedInformation=w),E}t.create=r;function i(a){var s,p=a;return Ze.defined(p)&&tr.is(p.range)&&Ze.string(p.message)&&(Ze.number(p.severity)||Ze.undefined(p.severity))&&(Ze.integer(p.code)||Ze.string(p.code)||Ze.undefined(p.code))&&(Ze.undefined(p.codeDescription)||Ze.string((s=p.codeDescription)===null||s===void 0?void 0:s.href))&&(Ze.string(p.source)||Ze.undefined(p.source))&&(Ze.undefined(p.relatedInformation)||Ze.typedArray(p.relatedInformation,Da.is))}t.is=i})(ai||(ai={}));var ta;(function(t){function r(a,s){for(var p=[],y=2;y<arguments.length;y++)p[y-2]=arguments[y];var S={title:a,command:s};return Ze.defined(p)&&p.length>0&&(S.arguments=p),S}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.title)&&Ze.string(s.command)}t.is=i})(ta||(ta={}));var Wn;(function(t){function r(p,y){return{range:p,newText:y}}t.replace=r;function i(p,y){return{range:{start:p,end:p},newText:y}}t.insert=i;function a(p){return{range:p,newText:""}}t.del=a;function s(p){var y=p;return Ze.objectLiteral(y)&&Ze.string(y.newText)&&tr.is(y.range)}t.is=s})(Wn||(Wn={}));var Co;(function(t){function r(a,s,p){var y={label:a};return s!==void 0&&(y.needsConfirmation=s),p!==void 0&&(y.description=p),y}t.create=r;function i(a){var s=a;return s!==void 0&&Ze.objectLiteral(s)&&Ze.string(s.label)&&(Ze.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(Ze.string(s.description)||s.description===void 0)}t.is=i})(Co||(Co={}));var en;(function(t){function r(i){var a=i;return typeof a=="string"}t.is=r})(en||(en={}));var Ii;(function(t){function r(p,y,S){return{range:p,newText:y,annotationId:S}}t.replace=r;function i(p,y,S){return{range:{start:p,end:p},newText:y,annotationId:S}}t.insert=i;function a(p,y){return{range:p,newText:"",annotationId:y}}t.del=a;function s(p){var y=p;return Wn.is(y)&&(Co.is(y.annotationId)||en.is(y.annotationId))}t.is=s})(Ii||(Ii={}));var Yr;(function(t){function r(a,s){return{textDocument:a,edits:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Oo.is(s.textDocument)&&Array.isArray(s.edits)}t.is=i})(Yr||(Yr={}));var xr;(function(t){function r(a,s,p){var y={kind:"create",uri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="create"&&Ze.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||Ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||en.is(s.annotationId))}t.is=i})(xr||(xr={}));var Lr;(function(t){function r(a,s,p,y){var S={kind:"rename",oldUri:a,newUri:s};return p!==void 0&&(p.overwrite!==void 0||p.ignoreIfExists!==void 0)&&(S.options=p),y!==void 0&&(S.annotationId=y),S}t.create=r;function i(a){var s=a;return s&&s.kind==="rename"&&Ze.string(s.oldUri)&&Ze.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||Ze.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||Ze.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||en.is(s.annotationId))}t.is=i})(Lr||(Lr={}));var br;(function(t){function r(a,s,p){var y={kind:"delete",uri:a};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(y.options=s),p!==void 0&&(y.annotationId=p),y}t.create=r;function i(a){var s=a;return s&&s.kind==="delete"&&Ze.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||Ze.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||Ze.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||en.is(s.annotationId))}t.is=i})(br||(br={}));var to;(function(t){function r(i){var a=i;return a&&(a.changes!==void 0||a.documentChanges!==void 0)&&(a.documentChanges===void 0||a.documentChanges.every(function(s){return Ze.string(s.kind)?xr.is(s)||Lr.is(s)||br.is(s):Yr.is(s)}))}t.is=r})(to||(to={}));var Na=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,a){var s,p;if(a===void 0?s=Wn.insert(r,i):en.is(a)?(p=a,s=Ii.insert(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Ii.insert(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.replace=function(r,i,a){var s,p;if(a===void 0?s=Wn.replace(r,i):en.is(a)?(p=a,s=Ii.replace(r,i,a)):(this.assertChangeAnnotations(this.changeAnnotations),p=this.changeAnnotations.manage(a),s=Ii.replace(r,i,p)),this.edits.push(s),p!==void 0)return p},t.prototype.delete=function(r,i){var a,s;if(i===void 0?a=Wn.del(r):en.is(i)?(s=i,a=Ii.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(i),a=Ii.del(r,s)),this.edits.push(a),s!==void 0)return s},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),ra=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var a;if(en.is(r)?a=r:(a=this.nextId(),i=r),this._annotations[a]!==void 0)throw new Error("Id "+a+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+a);return this._annotations[a]=i,this._size++,a},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),Od=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new ra(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(a){if(Yr.is(a)){var s=new Na(a.edits,i._changeAnnotations);i._textEditChanges[a.textDocument.uri]=s}})):r.changes&&Object.keys(r.changes).forEach(function(a){var s=new Na(r.changes[a]);i._textEditChanges[a]=s})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(Oo.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},a=this._textEditChanges[i.uri];if(!a){var s=[],p={textDocument:i,edits:s};this._workspaceEdit.documentChanges.push(p),a=new Na(s,this._changeAnnotations),this._textEditChanges[i.uri]=a}return a}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var a=this._textEditChanges[r];if(!a){var s=[];this._workspaceEdit.changes[r]=s,a=new Na(s),this._textEditChanges[r]=a}return a}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ra,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Co.is(i)||en.is(i)?s=i:a=i;var p,y;if(s===void 0?p=xr.create(r,a):(y=en.is(s)?s:this._changeAnnotations.manage(s),p=xr.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t.prototype.renameFile=function(r,i,a,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var p;Co.is(a)||en.is(a)?p=a:s=a;var y,S;if(p===void 0?y=Lr.create(r,i,s):(S=en.is(p)?p:this._changeAnnotations.manage(p),y=Lr.create(r,i,s,S)),this._workspaceEdit.documentChanges.push(y),S!==void 0)return S},t.prototype.deleteFile=function(r,i,a){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var s;Co.is(i)||en.is(i)?s=i:a=i;var p,y;if(s===void 0?p=br.create(r,a):(y=en.is(s)?s:this._changeAnnotations.manage(s),p=br.create(r,a,y)),this._workspaceEdit.documentChanges.push(p),y!==void 0)return y},t}(),lu;(function(t){function r(a){return{uri:a}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)}t.is=i})(lu||(lu={}));var uu;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)&&Ze.integer(s.version)}t.is=i})(uu||(uu={}));var Oo;(function(t){function r(a,s){return{uri:a,version:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)&&(s.version===null||Ze.integer(s.version))}t.is=i})(Oo||(Oo={}));var Js;(function(t){function r(a,s,p,y){return{uri:a,languageId:s,version:p,text:y}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.string(s.uri)&&Ze.string(s.languageId)&&Ze.integer(s.version)&&Ze.string(s.text)}t.is=i})(Js||(Js={}));var Hn;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(Hn||(Hn={})),function(t){function r(i){var a=i;return a===t.PlainText||a===t.Markdown}t.is=r}(Hn||(Hn={}));var Xs;(function(t){function r(i){var a=i;return Ze.objectLiteral(i)&&Hn.is(a.kind)&&Ze.string(a.value)}t.is=r})(Xs||(Xs={}));var un;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(un||(un={}));var Ir;(function(t){t.PlainText=1,t.Snippet=2})(Ir||(Ir={}));var Qs;(function(t){t.Deprecated=1})(Qs||(Qs={}));var Zs;(function(t){function r(a,s,p){return{newText:a,insert:s,replace:p}}t.create=r;function i(a){var s=a;return s&&Ze.string(s.newText)&&tr.is(s.insert)&&tr.is(s.replace)}t.is=i})(Zs||(Zs={}));var Ba;(function(t){t.asIs=1,t.adjustIndentation=2})(Ba||(Ba={}));var Ua;(function(t){function r(i){return{label:i}}t.create=r})(Ua||(Ua={}));var To;(function(t){function r(i,a){return{items:i||[],isIncomplete:!!a}}t.create=r})(To||(To={}));var ja;(function(t){function r(a){return a.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(a){var s=a;return Ze.string(s)||Ze.objectLiteral(s)&&Ze.string(s.language)&&Ze.string(s.value)}t.is=i})(ja||(ja={}));var na;(function(t){function r(i){var a=i;return!!a&&Ze.objectLiteral(a)&&(Xs.is(a.contents)||ja.is(a.contents)||Ze.typedArray(a.contents,ja.is))&&(i.range===void 0||tr.is(i.range))}t.is=r})(na||(na={}));var Qn;(function(t){function r(i,a){return a?{label:i,documentation:a}:{label:i}}t.create=r})(Qn||(Qn={}));var _s;(function(t){function r(i,a){for(var s=[],p=2;p<arguments.length;p++)s[p-2]=arguments[p];var y={label:i};return Ze.defined(a)&&(y.documentation=a),Ze.defined(s)?y.parameters=s:y.parameters=[],y}t.create=r})(_s||(_s={}));var fu;(function(t){t.Text=1,t.Read=2,t.Write=3})(fu||(fu={}));var qs;(function(t){function r(i,a){var s={range:i};return Ze.number(a)&&(s.kind=a),s}t.create=r})(qs||(qs={}));var Ar;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Ar||(Ar={}));var _t;(function(t){t.Deprecated=1})(_t||(_t={}));var Fn;(function(t){function r(i,a,s,p,y){var S={name:i,kind:a,location:{uri:p,range:s}};return y&&(S.containerName=y),S}t.create=r})(Fn||(Fn={}));var si;(function(t){function r(a,s,p,y,S,w){var E={name:a,detail:s,kind:p,range:y,selectionRange:S};return w!==void 0&&(E.children=w),E}t.create=r;function i(a){var s=a;return s&&Ze.string(s.name)&&Ze.number(s.kind)&&tr.is(s.range)&&tr.is(s.selectionRange)&&(s.detail===void 0||Ze.string(s.detail))&&(s.deprecated===void 0||Ze.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}t.is=i})(si||(si={}));var li;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(li||(li={}));var el;(function(t){function r(a,s){var p={diagnostics:a};return s!=null&&(p.only=s),p}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.typedArray(s.diagnostics,ai.is)&&(s.only===void 0||Ze.typedArray(s.only,Ze.string))}t.is=i})(el||(el={}));var Va;(function(t){function r(a,s,p){var y={title:a},S=!0;return typeof s=="string"?(S=!1,y.kind=s):ta.is(s)?y.command=s:y.edit=s,S&&p!==void 0&&(y.kind=p),y}t.create=r;function i(a){var s=a;return s&&Ze.string(s.title)&&(s.diagnostics===void 0||Ze.typedArray(s.diagnostics,ai.is))&&(s.kind===void 0||Ze.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||ta.is(s.command))&&(s.isPreferred===void 0||Ze.boolean(s.isPreferred))&&(s.edit===void 0||to.is(s.edit))}t.is=i})(Va||(Va={}));var tl;(function(t){function r(a,s){var p={range:a};return Ze.defined(s)&&(p.data=s),p}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.range)&&(Ze.undefined(s.command)||ta.is(s.command))}t.is=i})(tl||(tl={}));var cu;(function(t){function r(a,s){return{tabSize:a,insertSpaces:s}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&Ze.uinteger(s.tabSize)&&Ze.boolean(s.insertSpaces)}t.is=i})(cu||(cu={}));var Wa;(function(t){function r(a,s,p){return{range:a,target:s,data:p}}t.create=r;function i(a){var s=a;return Ze.defined(s)&&tr.is(s.range)&&(Ze.undefined(s.target)||Ze.string(s.target))}t.is=i})(Wa||(Wa={}));var Fi;(function(t){function r(a,s){return{range:a,parent:s}}t.create=r;function i(a){var s=a;return s!==void 0&&tr.is(s.range)&&(s.parent===void 0||t.is(s.parent))}t.is=i})(Fi||(Fi={}));var zf=null,Ha;(function(t){function r(p,y,S,w){return new ki(p,y,S,w)}t.create=r;function i(p){var y=p;return!!(Ze.defined(y)&&Ze.string(y.uri)&&(Ze.undefined(y.languageId)||Ze.string(y.languageId))&&Ze.uinteger(y.lineCount)&&Ze.func(y.getText)&&Ze.func(y.positionAt)&&Ze.func(y.offsetAt))}t.is=i;function a(p,y){for(var S=p.getText(),w=s(y,function(le,ge){var he=le.range.start.line-ge.range.start.line;return he===0?le.range.start.character-ge.range.start.character:he}),E=S.length,k=w.length-1;k>=0;k--){var $=w[k],ae=p.offsetAt($.range.start),re=p.offsetAt($.range.end);if(re<=E)S=S.substring(0,ae)+$.newText+S.substring(re,S.length);else throw new Error("Overlapping edit");E=ae}return S}t.applyEdits=a;function s(p,y){if(p.length<=1)return p;var S=p.length/2|0,w=p.slice(0,S),E=p.slice(S);s(w,y),s(E,y);for(var k=0,$=0,ae=0;k<w.length&&$<E.length;){var re=y(w[k],E[$]);re<=0?p[ae++]=w[k++]:p[ae++]=E[$++]}for(;k<w.length;)p[ae++]=w[k++];for(;$<E.length;)p[ae++]=E[$++];return p}})(Ha||(Ha={}));var ki=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,a=!0,s=0;s<i.length;s++){a&&(r.push(s),a=!1);var p=i.charAt(s);a=p==="\r"||p===`
169
169
  `,p==="\r"&&s+1<i.length&&i.charAt(s+1)===`
170
- `&&s++}a&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return ln.create(0,r);for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return ln.create(y,r-i[y])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),Ze;(function(t){var r=Object.prototype.toString;function i(re){return typeof re!="undefined"}t.defined=i;function a(re){return typeof re=="undefined"}t.undefined=a;function s(re){return re===!0||re===!1}t.boolean=s;function p(re){return r.call(re)==="[object String]"}t.string=p;function y(re){return r.call(re)==="[object Number]"}t.number=y;function S(re,le,ge){return r.call(re)==="[object Number]"&&le<=re&&re<=ge}t.numberRange=S;function w(re){return r.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}t.integer=w;function E(re){return r.call(re)==="[object Number]"&&0<=re&&re<=2147483647}t.uinteger=E;function k(re){return r.call(re)==="[object Function]"}t.func=k;function $(re){return re!==null&&typeof re=="object"}t.objectLiteral=$;function ae(re,le){return Array.isArray(re)&&re.every(le)}t.typedArray=ae})(Ze||(Ze={}));var nl=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){for(var a=0,s=r;a<s.length;a++){var p=s[a];if(t.isIncremental(p)){var y=il(p.range),S=this.offsetAt(y.start),w=this.offsetAt(y.end);this._content=this._content.substring(0,S)+p.text+this._content.substring(w,this._content.length);var E=Math.max(y.start.line,0),k=Math.max(y.end.line,0),$=this._lineOffsets,ae=Ga(p.text,!1,S);if(k-E===ae.length)for(var re=0,le=ae.length;re<le;re++)$[re+E+1]=ae[re];else ae.length<1e4?$.splice.apply($,[E+1,k-E].concat(ae)):this._lineOffsets=$=$.slice(0,E+1).concat(ae,$.slice(k+1));var ge=p.text.length-(w-S);if(ge!==0)for(var re=E+1+ae.length,le=$.length;re<le;re++)$[re]=$[re]+ge}else if(t.isFull(p))this._content=p.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=i},t.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=Ga(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return{line:0,character:r};for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return{line:y,character:r-i[y]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),t.isIncremental=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),za;(function(t){function r(s,p,y,S){return new nl(s,p,y,S)}t.create=r;function i(s,p,y){if(s instanceof nl)return s.update(p,y),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function a(s,p){for(var y=s.getText(),S=Po(p.map(Gf),function(le,ge){var he=le.range.start.line-ge.range.start.line;return he===0?le.range.start.character-ge.range.start.character:he}),w=0,E=[],k=0,$=S;k<$.length;k++){var ae=$[k],re=s.offsetAt(ae.range.start);if(re<w)throw new Error("Overlapping edit");re>w&&E.push(y.substring(w,re)),ae.newText.length&&E.push(ae.newText),w=s.offsetAt(ae.range.end)}return E.push(y.substr(w)),E.join("")}t.applyEdits=a})(za||(za={}));function Po(t,r){if(t.length<=1)return t;var i=t.length/2|0,a=t.slice(0,i),s=t.slice(i);Po(a,r),Po(s,r);for(var p=0,y=0,S=0;p<a.length&&y<s.length;){var w=r(a[p],s[y]);w<=0?t[S++]=a[p++]:t[S++]=s[y++]}for(;p<a.length;)t[S++]=a[p++];for(;y<s.length;)t[S++]=s[y++];return t}function Ga(t,r,i){i===void 0&&(i=0);for(var a=r?[i]:[],s=0;s<t.length;s++){var p=t.charCodeAt(s);(p===13||p===10)&&(p===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,a.push(i+s+1))}return a}function il(t){var r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function Gf(t){var r=il(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var Yt;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(Yt||(Yt={}));var du;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Hn.Markdown,Hn.PlainText],commitCharactersSupport:!0}}}}})(du||(du={}));var ro=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),$a={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},Ri=function(){function t(r,i,a){this.offset=i,this.length=a,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}(),$f=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="null",s.value=null,s}return r}(Ri),pu=function(t){ro(r,t);function r(i,a,s){var p=t.call(this,i,s)||this;return p.type="boolean",p.value=a,p}return r}(Ri),hu=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(Ri),Io=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(Ri),Ka=function(t){ro(r,t);function r(i,a,s){var p=t.call(this,i,a,s)||this;return p.type="string",p.value="",p}return r}(Ri),Ya=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="property",s.colonOffset=-1,s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),r}(Ri),vu=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(Ri);function tn(t){return mn(t)?t?{}:{not:{}}:t}var ol;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(ol||(ol={}));var Kf=function(){function t(r,i){r===void 0&&(r=-1),i===void 0&&(i=null),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){var i;(i=this.schemas).push.apply(i,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||al(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),Ja=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),rr=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,a=r;i<a.length;i++){var s=a[i];this.merge(s)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,a=this.problems;i<a.length;i++){var s=a[i];s.code===Yt.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(p){return JSON.stringify(p)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function Xa(t,r){return r===void 0&&(r=[]),new no(t,r,[])}function ui(t){return wo(t)}function Qa(t){return $s(t)}function al(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var no=function(){function t(r,i,a){i===void 0&&(i=[]),a===void 0&&(a=[]),this.root=r,this.syntaxErrors=i,this.comments=a}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return Gs(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(a){var s=r(a),p=a.children;if(Array.isArray(p))for(var y=0;y<p.length&&s;y++)s=i(p[y]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var a=new rr;return Dr(this.root,i,a,Ja.instance),a.problems.map(function(s){var p=tr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return ai.create(p,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,a){i===void 0&&(i=-1),a===void 0&&(a=null);var s=new Kf(i,a);return this.root&&r&&Dr(this.root,r,new rr,s),s.schemas},t}();function Dr(t,r,i,a){if(!t||!a.include(t))return;switch(t.type){case"object":w(t,r,i,a);break;case"array":S(t,r,i,a);break;case"string":y(t,r,i,a);break;case"number":p(t,r,i,a);break;case"property":return Dr(t.valueNode,r,i,a)}s(),a.add({node:t,schema:r});function s(){function E(et){return t.type===et||et==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(E)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(E(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var k=0,$=r.allOf;k<$.length;k++){var ae=$[k];Dr(t,tn(ae),i,a)}var re=tn(r.not);if(re){var le=new rr,ge=a.newSub();Dr(t,re,le,ge),le.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:"Matches a schema that is not allowed."});for(var he=0,Se=ge.schemas;he<Se.length;he++){var me=Se[he];me.inverted=!me.inverted,a.add(me)}}var Fe=function(et,wt){for(var Dt=[],Wt=null,lr=0,Mr=et;lr<Mr.length;lr++){var Or=Mr[lr],Kr=tn(Or),Sr=new rr,Ur=a.newSub();if(Dr(t,Kr,Sr,Ur),Sr.hasProblems()||Dt.push(Kr),!Wt)Wt={schema:Kr,validationResult:Sr,matchingSchemas:Ur};else if(!wt&&!Sr.hasProblems()&&!Wt.validationResult.hasProblems())Wt.matchingSchemas.merge(Ur),Wt.validationResult.propertiesMatches+=Sr.propertiesMatches,Wt.validationResult.propertiesValueMatches+=Sr.propertiesValueMatches;else{var bn=Sr.compare(Wt.validationResult);bn>0?Wt={schema:Kr,validationResult:Sr,matchingSchemas:Ur}:bn===0&&(Wt.matchingSchemas.merge(Ur),Wt.validationResult.mergeEnumValues(Sr))}}return Dt.length>1&&wt&&i.problems.push({location:{offset:t.offset,length:1},severity:Ht.Warning,message:"Matches multiple schemas when only one must validate."}),Wt!==null&&(i.merge(Wt.validationResult),i.propertiesMatches+=Wt.validationResult.propertiesMatches,i.propertiesValueMatches+=Wt.validationResult.propertiesValueMatches,a.merge(Wt.matchingSchemas)),Dt.length};Array.isArray(r.anyOf)&&Fe(r.anyOf,!1),Array.isArray(r.oneOf)&&Fe(r.oneOf,!0);var Ke=function(et){var wt=new rr,Dt=a.newSub();Dr(t,tn(et),wt,Dt),i.merge(wt),i.propertiesMatches+=wt.propertiesMatches,i.propertiesValueMatches+=wt.propertiesValueMatches,a.merge(Dt)},Ue=function(et,wt,Dt){var Wt=tn(et),lr=new rr,Mr=a.newSub();Dr(t,Wt,lr,Mr),a.merge(Mr),lr.hasProblems()?Dt&&Ke(Dt):wt&&Ke(wt)},$e=tn(r.if);if($e&&Ue($e,tn(r.then),tn(r.else)),Array.isArray(r.enum)){for(var Be=ui(t),je=!1,We=0,Je=r.enum;We<Je.length;We++){var ze=Je[We];if(qi(Be,ze)){je=!0;break}}i.enumValues=r.enum,i.enumValueMatch=je,je||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:Yt.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(et){return JSON.stringify(et)}).join(", ")+"."})}if(yn(r.const)){var Be=ui(t);qi(Be,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:Yt.EnumValueMismatch,message:r.errorMessage||"Value must be "+JSON.stringify(r.const)+"."}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:Ht.Warning,message:r.deprecationMessage})}function p(E,k,$,ae){var re=E.value;sn(k.multipleOf)&&re%k.multipleOf!=0&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is not divisible by "+k.multipleOf+"."});function le(Ke,Ue){if(sn(Ue))return Ue;if(mn(Ue)&&Ue)return Ke}function ge(Ke,Ue){if(!mn(Ue)||!Ue)return Ke}var he=le(k.minimum,k.exclusiveMinimum);sn(he)&&re<=he&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is below the exclusive minimum of "+he+"."});var Se=le(k.maximum,k.exclusiveMaximum);sn(Se)&&re>=Se&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is above the exclusive maximum of "+Se+"."});var me=ge(k.minimum,k.exclusiveMinimum);sn(me)&&re<me&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is below the minimum of "+me+"."});var Fe=ge(k.maximum,k.exclusiveMaximum);sn(Fe)&&re>Fe&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is above the maximum of "+Fe+"."})}function y(E,k,$,ae){if(sn(k.minLength)&&E.value.length<k.minLength&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"String is shorter than the minimum length of "+k.minLength+"."}),sn(k.maxLength)&&E.value.length>k.maxLength&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"String is longer than the maximum length of "+k.maxLength+"."}),Hf(k.pattern)){var re=new RegExp(k.pattern);re.test(E.value)||$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.patternErrorMessage||k.errorMessage||'String does not match the pattern of "'+k.pattern+'".'})}if(k.format)switch(k.format){case"uri":case"uri-reference":{var le=void 0;if(!E.value)le="URI expected.";else{var ge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(E.value);ge?!ge[2]&&k.format==="uri"&&(le="URI with a scheme is expected."):le="URI is expected."}le&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.patternErrorMessage||k.errorMessage||"String is not a URI: "+le})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var he=$a[k.format];(!E.value||!he.pattern.exec(E.value))&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.patternErrorMessage||k.errorMessage||he.errorMessage});break;default:}}function S(E,k,$,ae){if(Array.isArray(k.items)){for(var re=k.items,le=0;le<re.length;le++){var ge=re[le],he=tn(ge),Se=new rr,me=E.items[le];me?(Dr(me,he,Se,ae),$.mergePropertyMatch(Se)):E.items.length>=re.length&&$.propertiesValueMatches++}if(E.items.length>re.length)if(typeof k.additionalItems=="object")for(var Fe=re.length;Fe<E.items.length;Fe++){var Se=new rr;Dr(E.items[Fe],k.additionalItems,Se,ae),$.mergePropertyMatch(Se)}else k.additionalItems===!1&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has too many items according to schema. Expected "+re.length+" or fewer."})}else{var Ke=tn(k.items);if(Ke)for(var Ue=0,$e=E.items;Ue<$e.length;Ue++){var me=$e[Ue],Se=new rr;Dr(me,Ke,Se,ae),$.mergePropertyMatch(Se)}}var Be=tn(k.contains);if(Be){var je=E.items.some(function(ze){var et=new rr;return Dr(ze,Be,et,Ja.instance),!et.hasProblems()});je||$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.errorMessage||"Array does not contain required item."})}if(sn(k.minItems)&&E.items.length<k.minItems&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has too few items. Expected "+k.minItems+" or more."}),sn(k.maxItems)&&E.items.length>k.maxItems&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has too many items. Expected "+k.maxItems+" or fewer."}),k.uniqueItems===!0){var We=ui(E),Je=We.some(function(ze,et){return et!==We.lastIndexOf(ze)});Je&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has duplicate items."})}}function w(E,k,$,ae){for(var re=Object.create(null),le=[],ge=0,he=E.properties;ge<he.length;ge++){var Se=he[ge],me=Se.keyNode.value;re[me]=Se.valueNode,le.push(me)}if(Array.isArray(k.required))for(var Fe=0,Ke=k.required;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(!re[Ue]){var $e=E.parent&&E.parent.type==="property"&&E.parent.keyNode,Be=$e?{offset:$e.offset,length:$e.length}:{offset:E.offset,length:1};$.problems.push({location:Be,severity:Ht.Warning,message:'Missing property "'+Ue+'".'})}}var je=function(gi){for(var Rl=le.indexOf(gi);Rl>=0;)le.splice(Rl,1),Rl=le.indexOf(gi)};if(k.properties)for(var We=0,Je=Object.keys(k.properties);We<Je.length;We++){var Ue=Je[We];je(Ue);var ze=k.properties[Ue],et=re[Ue];if(et)if(mn(ze))if(ze)$.propertiesMatches++,$.propertiesValueMatches++;else{var Se=et.parent;$.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Ht.Warning,message:k.errorMessage||"Property "+Ue+" is not allowed."})}else{var wt=new rr;Dr(et,ze,wt,ae),$.mergePropertyMatch(wt)}}if(k.patternProperties)for(var Dt=0,Wt=Object.keys(k.patternProperties);Dt<Wt.length;Dt++)for(var lr=Wt[Dt],Mr=new RegExp(lr),Or=0,Kr=le.slice(0);Or<Kr.length;Or++){var Ue=Kr[Or];if(Mr.test(Ue)){je(Ue);var et=re[Ue];if(et){var ze=k.patternProperties[lr];if(mn(ze))if(ze)$.propertiesMatches++,$.propertiesValueMatches++;else{var Se=et.parent;$.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Ht.Warning,message:k.errorMessage||"Property "+Ue+" is not allowed."})}else{var wt=new rr;Dr(et,ze,wt,ae),$.mergePropertyMatch(wt)}}}}if(typeof k.additionalProperties=="object")for(var Sr=0,Ur=le;Sr<Ur.length;Sr++){var Ue=Ur[Sr],et=re[Ue];if(et){var wt=new rr;Dr(et,k.additionalProperties,wt,ae),$.mergePropertyMatch(wt)}}else if(k.additionalProperties===!1&&le.length>0)for(var bn=0,Xt=le;bn<Xt.length;bn++){var Ue=Xt[bn],et=re[Ue];if(et){var Se=et.parent;$.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Ht.Warning,message:k.errorMessage||"Property "+Ue+" is not allowed."})}}if(sn(k.maxProperties)&&E.properties.length>k.maxProperties&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Object has more properties than limit of "+k.maxProperties+"."}),sn(k.minProperties)&&E.properties.length<k.minProperties&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Object has fewer properties than the required number of "+k.minProperties}),k.dependencies)for(var Rt=0,Bt=Object.keys(k.dependencies);Rt<Bt.length;Rt++){var me=Bt[Rt],ur=re[me];if(ur){var on=k.dependencies[me];if(Array.isArray(on))for(var gr=0,ys=on;gr<ys.length;gr++){var Fl=ys[gr];re[Fl]?$.propertiesValueMatches++:$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Object is missing property "+Fl+" required by property {$key}."})}else{var ze=tn(on);if(ze){var wt=new rr;Dr(E,ze,wt,ae),$.mergePropertyMatch(wt)}}}}var Aa=tn(k.propertyNames);if(Aa)for(var Hi=0,kl=E.properties;Hi<kl.length;Hi++){var df=kl[Hi],me=df.keyNode;me&&Dr(me,Aa,$,Ja.instance)}}}function gu(t,r){var i=[],a=-1,s=t.getText(),p=Oi(s,!1),y=r&&r.collectComments?[]:void 0;function S(){for(;;){var $e=p.scan();switch($(),$e){case 12:case 13:Array.isArray(y)&&y.push(tr.create(t.positionAt(p.getTokenOffset()),t.positionAt(p.getTokenOffset()+p.getTokenLength())));break;case 15:case 14:break;default:return $e}}}function w($e){return p.getToken()===$e?(S(),!0):!1}function E($e,Be,je,We,Je){if(Je===void 0&&(Je=Ht.Error),i.length===0||je!==a){var ze=tr.create(t.positionAt(je),t.positionAt(We));i.push(ai.create(ze,$e,Je,Be,t.languageId)),a=je}}function k($e,Be,je,We,Je){je===void 0&&(je=null),We===void 0&&(We=[]),Je===void 0&&(Je=[]);var ze=p.getTokenOffset(),et=p.getTokenOffset()+p.getTokenLength();if(ze===et&&ze>0){for(ze--;ze>0&&/\s/.test(s.charAt(ze));)ze--;et=ze+1}if(E($e,Be,ze,et),je&&ae(je,!1),We.length+Je.length>0)for(var wt=p.getToken();wt!==17;){if(We.indexOf(wt)!==-1){S();break}else if(Je.indexOf(wt)!==-1)break;wt=S()}return je}function $(){switch(p.getTokenError()){case 4:return k("Invalid unicode sequence in string.",Yt.InvalidUnicode),!0;case 5:return k("Invalid escape character in string.",Yt.InvalidEscapeCharacter),!0;case 3:return k("Unexpected end of number.",Yt.UnexpectedEndOfNumber),!0;case 1:return k("Unexpected end of comment.",Yt.UnexpectedEndOfComment),!0;case 2:return k("Unexpected end of string.",Yt.UnexpectedEndOfString),!0;case 6:return k("Invalid characters in string. Control characters must be escaped.",Yt.InvalidCharacter),!0}return!1}function ae($e,Be){return $e.length=p.getTokenOffset()+p.getTokenLength()-$e.offset,Be&&S(),$e}function re($e){if(p.getToken()!==3)return null;var Be=new hu($e,p.getTokenOffset());S();for(var je=0,We=!1;p.getToken()!==4&&p.getToken()!==17;){if(p.getToken()===5){We||k("Value expected",Yt.ValueExpected);var Je=p.getTokenOffset();if(S(),p.getToken()===4){We&&E("Trailing comma",Yt.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",Yt.CommaExpected);var ze=Fe(Be,je++);ze?Be.items.push(ze):k("Value expected",Yt.ValueExpected,null,[],[4,5]),We=!0}return p.getToken()!==4?k("Expected comma or closing bracket",Yt.CommaOrCloseBacketExpected,Be):ae(Be,!0)}function le($e,Be){var je=new Ya($e,p.getTokenOffset()),We=he(je);if(!We)if(p.getToken()===16){k("Property keys must be doublequoted",Yt.Undefined);var Je=new Ka(je,p.getTokenOffset(),p.getTokenLength());Je.value=p.getTokenValue(),We=Je,S()}else return null;je.keyNode=We;var ze=Be[We.value];if(ze?(E("Duplicate object key",Yt.DuplicateKey,je.keyNode.offset,je.keyNode.offset+je.keyNode.length,Ht.Warning),typeof ze=="object"&&E("DuplicateKeyWarning",Yt.DuplicateKey,ze.keyNode.offset,ze.keyNode.offset+ze.keyNode.length,Ht.Warning),Be[We.value]=!0):Be[We.value]=je,p.getToken()===6)je.colonOffset=p.getTokenOffset(),S();else if(k("Colon expected",Yt.ColonExpected),p.getToken()===10&&t.positionAt(We.offset+We.length).line<t.positionAt(p.getTokenOffset()).line)return je.length=We.length,je;var et=Fe(je,We.value);return et?(je.valueNode=et,je.length=et.offset+et.length-je.offset,je):k("Value expected",Yt.ValueExpected,je,[],[2,5])}function ge($e){if(p.getToken()!==1)return null;var Be=new vu($e,p.getTokenOffset()),je=Object.create(null);S();for(var We=!1;p.getToken()!==2&&p.getToken()!==17;){if(p.getToken()===5){We||k("Property expected",Yt.PropertyExpected);var Je=p.getTokenOffset();if(S(),p.getToken()===2){We&&E("Trailing comma",Yt.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",Yt.CommaExpected);var ze=le(Be,je);ze?Be.properties.push(ze):k("Property expected",Yt.PropertyExpected,null,[],[2,5]),We=!0}return p.getToken()!==2?k("Expected comma or closing brace",Yt.CommaOrCloseBraceExpected,Be):ae(Be,!0)}function he($e){if(p.getToken()!==10)return null;var Be=new Ka($e,p.getTokenOffset());return Be.value=p.getTokenValue(),ae(Be,!0)}function Se($e){if(p.getToken()!==11)return null;var Be=new Io($e,p.getTokenOffset());if(p.getTokenError()===0){var je=p.getTokenValue();try{var We=JSON.parse(je);if(!sn(We))return k("Invalid number format.",Yt.Undefined,Be);Be.value=We}catch(Je){return k("Invalid number format.",Yt.Undefined,Be)}Be.isInteger=je.indexOf(".")===-1}return ae(Be,!0)}function me($e){var Be;switch(p.getToken()){case 7:return ae(new $f($e,p.getTokenOffset()),!0);case 8:return ae(new pu($e,!0,p.getTokenOffset()),!0);case 9:return ae(new pu($e,!1,p.getTokenOffset()),!0);default:return null}}function Fe($e,Be){return re($e)||ge($e)||he($e)||Se($e)||me($e)}var Ke=null,Ue=S();return Ue!==17&&(Ke=Fe(null,null),Ke?p.getToken()!==17&&k("End of file expected.",Yt.Undefined):k("Expected a JSON object, array or literal.",Yt.Undefined)),new no(Ke,i,y)}function Za(t,r,i){if(t!==null&&typeof t=="object"){var a=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
170
+ `&&s++}a&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return ln.create(0,r);for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return ln.create(y,r-i[y])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),Ze;(function(t){var r=Object.prototype.toString;function i(re){return typeof re!="undefined"}t.defined=i;function a(re){return typeof re=="undefined"}t.undefined=a;function s(re){return re===!0||re===!1}t.boolean=s;function p(re){return r.call(re)==="[object String]"}t.string=p;function y(re){return r.call(re)==="[object Number]"}t.number=y;function S(re,le,ge){return r.call(re)==="[object Number]"&&le<=re&&re<=ge}t.numberRange=S;function w(re){return r.call(re)==="[object Number]"&&-2147483648<=re&&re<=2147483647}t.integer=w;function E(re){return r.call(re)==="[object Number]"&&0<=re&&re<=2147483647}t.uinteger=E;function k(re){return r.call(re)==="[object Function]"}t.func=k;function $(re){return re!==null&&typeof re=="object"}t.objectLiteral=$;function ae(re,le){return Array.isArray(re)&&re.every(le)}t.typedArray=ae})(Ze||(Ze={}));var rl=function(){function t(r,i,a,s){this._uri=r,this._languageId=i,this._version=a,this._content=s,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),a=this.offsetAt(r.end);return this._content.substring(i,a)}return this._content},t.prototype.update=function(r,i){for(var a=0,s=r;a<s.length;a++){var p=s[a];if(t.isIncremental(p)){var y=nl(p.range),S=this.offsetAt(y.start),w=this.offsetAt(y.end);this._content=this._content.substring(0,S)+p.text+this._content.substring(w,this._content.length);var E=Math.max(y.start.line,0),k=Math.max(y.end.line,0),$=this._lineOffsets,ae=Ga(p.text,!1,S);if(k-E===ae.length)for(var re=0,le=ae.length;re<le;re++)$[re+E+1]=ae[re];else ae.length<1e4?$.splice.apply($,[E+1,k-E].concat(ae)):this._lineOffsets=$=$.slice(0,E+1).concat(ae,$.slice(k+1));var ge=p.text.length-(w-S);if(ge!==0)for(var re=E+1+ae.length,le=$.length;re<le;re++)$[re]=$[re]+ge}else if(t.isFull(p))this._content=p.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=i},t.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=Ga(this._content,!0)),this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),a=0,s=i.length;if(s===0)return{line:0,character:r};for(;a<s;){var p=Math.floor((a+s)/2);i[p]>r?s=p:a=p+1}var y=a-1;return{line:y,character:r-i[y]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var a=i[r.line],s=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(a+r.character,s),a)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),t.isIncremental=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")},t.isFull=function(r){var i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0},t}(),za;(function(t){function r(s,p,y,S){return new rl(s,p,y,S)}t.create=r;function i(s,p,y){if(s instanceof rl)return s.update(p,y),s;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function a(s,p){for(var y=s.getText(),S=Po(p.map(Gf),function(le,ge){var he=le.range.start.line-ge.range.start.line;return he===0?le.range.start.character-ge.range.start.character:he}),w=0,E=[],k=0,$=S;k<$.length;k++){var ae=$[k],re=s.offsetAt(ae.range.start);if(re<w)throw new Error("Overlapping edit");re>w&&E.push(y.substring(w,re)),ae.newText.length&&E.push(ae.newText),w=s.offsetAt(ae.range.end)}return E.push(y.substr(w)),E.join("")}t.applyEdits=a})(za||(za={}));function Po(t,r){if(t.length<=1)return t;var i=t.length/2|0,a=t.slice(0,i),s=t.slice(i);Po(a,r),Po(s,r);for(var p=0,y=0,S=0;p<a.length&&y<s.length;){var w=r(a[p],s[y]);w<=0?t[S++]=a[p++]:t[S++]=s[y++]}for(;p<a.length;)t[S++]=a[p++];for(;y<s.length;)t[S++]=s[y++];return t}function Ga(t,r,i){i===void 0&&(i=0);for(var a=r?[i]:[],s=0;s<t.length;s++){var p=t.charCodeAt(s);(p===13||p===10)&&(p===13&&s+1<t.length&&t.charCodeAt(s+1)===10&&s++,a.push(i+s+1))}return a}function nl(t){var r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function Gf(t){var r=nl(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var Yt;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(Yt||(Yt={}));var du;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Hn.Markdown,Hn.PlainText],commitCharactersSupport:!0}}}}})(du||(du={}));var ro=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),$a={"color-hex":{errorMessage:"Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.",pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:"String is not a RFC3339 date-time.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:"String is not a RFC3339 date.",pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:"String is not a RFC3339 time.",pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:"String is not an e-mail address.",pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},Ri=function(){function t(r,i,a){this.offset=i,this.length=a,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}(),$f=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="null",s.value=null,s}return r}(Ri),pu=function(t){ro(r,t);function r(i,a,s){var p=t.call(this,i,s)||this;return p.type="boolean",p.value=a,p}return r}(Ri),hu=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="array",s.items=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),r}(Ri),Io=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="number",s.isInteger=!0,s.value=Number.NaN,s}return r}(Ri),Ka=function(t){ro(r,t);function r(i,a,s){var p=t.call(this,i,a,s)||this;return p.type="string",p.value="",p}return r}(Ri),Ya=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="property",s.colonOffset=-1,s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),r}(Ri),vu=function(t){ro(r,t);function r(i,a){var s=t.call(this,i,a)||this;return s.type="object",s.properties=[],s}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),r}(Ri);function tn(t){return mn(t)?t?{}:{not:{}}:t}var il;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(il||(il={}));var Kf=function(){function t(r,i){r===void 0&&(r=-1),i===void 0&&(i=null),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){var i;(i=this.schemas).push.apply(i,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||ol(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),Ja=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),rr=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,a=r;i<a.length;i++){var s=a[i];this.merge(s)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,a=this.problems;i<a.length;i++){var s=a[i];s.code===Yt.EnumValueMismatch&&(s.message="Value is not accepted. Valid values: "+this.enumValues.map(function(p){return JSON.stringify(p)}).join(", ")+".")}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function Xa(t,r){return r===void 0&&(r=[]),new no(t,r,[])}function ui(t){return wo(t)}function Qa(t){return Gs(t)}function ol(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var no=function(){function t(r,i,a){i===void 0&&(i=[]),a===void 0&&(a=[]),this.root=r,this.syntaxErrors=i,this.comments=a}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return zs(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(a){var s=r(a),p=a.children;if(Array.isArray(p))for(var y=0;y<p.length&&s;y++)s=i(p[y]);return s};i(this.root)}},t.prototype.validate=function(r,i){if(this.root&&i){var a=new rr;return Dr(this.root,i,a,Ja.instance),a.problems.map(function(s){var p=tr.create(r.positionAt(s.location.offset),r.positionAt(s.location.offset+s.location.length));return ai.create(p,s.message,s.severity,s.code)})}return null},t.prototype.getMatchingSchemas=function(r,i,a){i===void 0&&(i=-1),a===void 0&&(a=null);var s=new Kf(i,a);return this.root&&r&&Dr(this.root,r,new rr,s),s.schemas},t}();function Dr(t,r,i,a){if(!t||!a.include(t))return;switch(t.type){case"object":w(t,r,i,a);break;case"array":S(t,r,i,a);break;case"string":y(t,r,i,a);break;case"number":p(t,r,i,a);break;case"property":return Dr(t.valueNode,r,i,a)}s(),a.add({node:t,schema:r});function s(){function E(et){return t.type===et||et==="integer"&&t.type==="number"&&t.isInteger||r.nullable&&t.value===null}if(Array.isArray(r.type)?r.type.some(E)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||"Incorrect type. Expected one of "+r.type.join(", ")+"."}):r.type&&(E(r.type)||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:r.errorMessage||'Incorrect type. Expected "'+r.type+'".'})),Array.isArray(r.allOf))for(var k=0,$=r.allOf;k<$.length;k++){var ae=$[k];Dr(t,tn(ae),i,a)}var re=tn(r.not);if(re){var le=new rr,ge=a.newSub();Dr(t,re,le,ge),le.hasProblems()||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,message:"Matches a schema that is not allowed."});for(var he=0,Se=ge.schemas;he<Se.length;he++){var me=Se[he];me.inverted=!me.inverted,a.add(me)}}var Fe=function(et,wt){for(var Dt=[],Wt=null,lr=0,Mr=et;lr<Mr.length;lr++){var Or=Mr[lr],Kr=tn(Or),Sr=new rr,Ur=a.newSub();if(Dr(t,Kr,Sr,Ur),Sr.hasProblems()||Dt.push(Kr),!Wt)Wt={schema:Kr,validationResult:Sr,matchingSchemas:Ur};else if(!wt&&!Sr.hasProblems()&&!Wt.validationResult.hasProblems())Wt.matchingSchemas.merge(Ur),Wt.validationResult.propertiesMatches+=Sr.propertiesMatches,Wt.validationResult.propertiesValueMatches+=Sr.propertiesValueMatches;else{var bn=Sr.compare(Wt.validationResult);bn>0?Wt={schema:Kr,validationResult:Sr,matchingSchemas:Ur}:bn===0&&(Wt.matchingSchemas.merge(Ur),Wt.validationResult.mergeEnumValues(Sr))}}return Dt.length>1&&wt&&i.problems.push({location:{offset:t.offset,length:1},severity:Ht.Warning,message:"Matches multiple schemas when only one must validate."}),Wt!==null&&(i.merge(Wt.validationResult),i.propertiesMatches+=Wt.validationResult.propertiesMatches,i.propertiesValueMatches+=Wt.validationResult.propertiesValueMatches,a.merge(Wt.matchingSchemas)),Dt.length};Array.isArray(r.anyOf)&&Fe(r.anyOf,!1),Array.isArray(r.oneOf)&&Fe(r.oneOf,!0);var Ke=function(et){var wt=new rr,Dt=a.newSub();Dr(t,tn(et),wt,Dt),i.merge(wt),i.propertiesMatches+=wt.propertiesMatches,i.propertiesValueMatches+=wt.propertiesValueMatches,a.merge(Dt)},Ue=function(et,wt,Dt){var Wt=tn(et),lr=new rr,Mr=a.newSub();Dr(t,Wt,lr,Mr),a.merge(Mr),lr.hasProblems()?Dt&&Ke(Dt):wt&&Ke(wt)},$e=tn(r.if);if($e&&Ue($e,tn(r.then),tn(r.else)),Array.isArray(r.enum)){for(var Be=ui(t),je=!1,We=0,Je=r.enum;We<Je.length;We++){var ze=Je[We];if(qi(Be,ze)){je=!0;break}}i.enumValues=r.enum,i.enumValueMatch=je,je||i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:Yt.EnumValueMismatch,message:r.errorMessage||"Value is not accepted. Valid values: "+r.enum.map(function(et){return JSON.stringify(et)}).join(", ")+"."})}if(yn(r.const)){var Be=ui(t);qi(Be,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:t.offset,length:t.length},severity:Ht.Warning,code:Yt.EnumValueMismatch,message:r.errorMessage||"Value must be "+JSON.stringify(r.const)+"."}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&t.parent&&i.problems.push({location:{offset:t.parent.offset,length:t.parent.length},severity:Ht.Warning,message:r.deprecationMessage})}function p(E,k,$,ae){var re=E.value;sn(k.multipleOf)&&re%k.multipleOf!=0&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is not divisible by "+k.multipleOf+"."});function le(Ke,Ue){if(sn(Ue))return Ue;if(mn(Ue)&&Ue)return Ke}function ge(Ke,Ue){if(!mn(Ue)||!Ue)return Ke}var he=le(k.minimum,k.exclusiveMinimum);sn(he)&&re<=he&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is below the exclusive minimum of "+he+"."});var Se=le(k.maximum,k.exclusiveMaximum);sn(Se)&&re>=Se&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is above the exclusive maximum of "+Se+"."});var me=ge(k.minimum,k.exclusiveMinimum);sn(me)&&re<me&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is below the minimum of "+me+"."});var Fe=ge(k.maximum,k.exclusiveMaximum);sn(Fe)&&re>Fe&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Value is above the maximum of "+Fe+"."})}function y(E,k,$,ae){if(sn(k.minLength)&&E.value.length<k.minLength&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"String is shorter than the minimum length of "+k.minLength+"."}),sn(k.maxLength)&&E.value.length>k.maxLength&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"String is longer than the maximum length of "+k.maxLength+"."}),Hf(k.pattern)){var re=new RegExp(k.pattern);re.test(E.value)||$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.patternErrorMessage||k.errorMessage||'String does not match the pattern of "'+k.pattern+'".'})}if(k.format)switch(k.format){case"uri":case"uri-reference":{var le=void 0;if(!E.value)le="URI expected.";else{var ge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(E.value);ge?!ge[2]&&k.format==="uri"&&(le="URI with a scheme is expected."):le="URI is expected."}le&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.patternErrorMessage||k.errorMessage||"String is not a URI: "+le})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var he=$a[k.format];(!E.value||!he.pattern.exec(E.value))&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.patternErrorMessage||k.errorMessage||he.errorMessage});break;default:}}function S(E,k,$,ae){if(Array.isArray(k.items)){for(var re=k.items,le=0;le<re.length;le++){var ge=re[le],he=tn(ge),Se=new rr,me=E.items[le];me?(Dr(me,he,Se,ae),$.mergePropertyMatch(Se)):E.items.length>=re.length&&$.propertiesValueMatches++}if(E.items.length>re.length)if(typeof k.additionalItems=="object")for(var Fe=re.length;Fe<E.items.length;Fe++){var Se=new rr;Dr(E.items[Fe],k.additionalItems,Se,ae),$.mergePropertyMatch(Se)}else k.additionalItems===!1&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has too many items according to schema. Expected "+re.length+" or fewer."})}else{var Ke=tn(k.items);if(Ke)for(var Ue=0,$e=E.items;Ue<$e.length;Ue++){var me=$e[Ue],Se=new rr;Dr(me,Ke,Se,ae),$.mergePropertyMatch(Se)}}var Be=tn(k.contains);if(Be){var je=E.items.some(function(ze){var et=new rr;return Dr(ze,Be,et,Ja.instance),!et.hasProblems()});je||$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:k.errorMessage||"Array does not contain required item."})}if(sn(k.minItems)&&E.items.length<k.minItems&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has too few items. Expected "+k.minItems+" or more."}),sn(k.maxItems)&&E.items.length>k.maxItems&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has too many items. Expected "+k.maxItems+" or fewer."}),k.uniqueItems===!0){var We=ui(E),Je=We.some(function(ze,et){return et!==We.lastIndexOf(ze)});Je&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Array has duplicate items."})}}function w(E,k,$,ae){for(var re=Object.create(null),le=[],ge=0,he=E.properties;ge<he.length;ge++){var Se=he[ge],me=Se.keyNode.value;re[me]=Se.valueNode,le.push(me)}if(Array.isArray(k.required))for(var Fe=0,Ke=k.required;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(!re[Ue]){var $e=E.parent&&E.parent.type==="property"&&E.parent.keyNode,Be=$e?{offset:$e.offset,length:$e.length}:{offset:E.offset,length:1};$.problems.push({location:Be,severity:Ht.Warning,message:'Missing property "'+Ue+'".'})}}var je=function(gi){for(var Rl=le.indexOf(gi);Rl>=0;)le.splice(Rl,1),Rl=le.indexOf(gi)};if(k.properties)for(var We=0,Je=Object.keys(k.properties);We<Je.length;We++){var Ue=Je[We];je(Ue);var ze=k.properties[Ue],et=re[Ue];if(et)if(mn(ze))if(ze)$.propertiesMatches++,$.propertiesValueMatches++;else{var Se=et.parent;$.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Ht.Warning,message:k.errorMessage||"Property "+Ue+" is not allowed."})}else{var wt=new rr;Dr(et,ze,wt,ae),$.mergePropertyMatch(wt)}}if(k.patternProperties)for(var Dt=0,Wt=Object.keys(k.patternProperties);Dt<Wt.length;Dt++)for(var lr=Wt[Dt],Mr=new RegExp(lr),Or=0,Kr=le.slice(0);Or<Kr.length;Or++){var Ue=Kr[Or];if(Mr.test(Ue)){je(Ue);var et=re[Ue];if(et){var ze=k.patternProperties[lr];if(mn(ze))if(ze)$.propertiesMatches++,$.propertiesValueMatches++;else{var Se=et.parent;$.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Ht.Warning,message:k.errorMessage||"Property "+Ue+" is not allowed."})}else{var wt=new rr;Dr(et,ze,wt,ae),$.mergePropertyMatch(wt)}}}}if(typeof k.additionalProperties=="object")for(var Sr=0,Ur=le;Sr<Ur.length;Sr++){var Ue=Ur[Sr],et=re[Ue];if(et){var wt=new rr;Dr(et,k.additionalProperties,wt,ae),$.mergePropertyMatch(wt)}}else if(k.additionalProperties===!1&&le.length>0)for(var bn=0,Xt=le;bn<Xt.length;bn++){var Ue=Xt[bn],et=re[Ue];if(et){var Se=et.parent;$.problems.push({location:{offset:Se.keyNode.offset,length:Se.keyNode.length},severity:Ht.Warning,message:k.errorMessage||"Property "+Ue+" is not allowed."})}}if(sn(k.maxProperties)&&E.properties.length>k.maxProperties&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Object has more properties than limit of "+k.maxProperties+"."}),sn(k.minProperties)&&E.properties.length<k.minProperties&&$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Object has fewer properties than the required number of "+k.minProperties}),k.dependencies)for(var Rt=0,Bt=Object.keys(k.dependencies);Rt<Bt.length;Rt++){var me=Bt[Rt],ur=re[me];if(ur){var on=k.dependencies[me];if(Array.isArray(on))for(var gr=0,gs=on;gr<gs.length;gr++){var Fl=gs[gr];re[Fl]?$.propertiesValueMatches++:$.problems.push({location:{offset:E.offset,length:E.length},severity:Ht.Warning,message:"Object is missing property "+Fl+" required by property {$key}."})}else{var ze=tn(on);if(ze){var wt=new rr;Dr(E,ze,wt,ae),$.mergePropertyMatch(wt)}}}}var Aa=tn(k.propertyNames);if(Aa)for(var Hi=0,kl=E.properties;Hi<kl.length;Hi++){var df=kl[Hi],me=df.keyNode;me&&Dr(me,Aa,$,Ja.instance)}}}function gu(t,r){var i=[],a=-1,s=t.getText(),p=Oi(s,!1),y=r&&r.collectComments?[]:void 0;function S(){for(;;){var $e=p.scan();switch($(),$e){case 12:case 13:Array.isArray(y)&&y.push(tr.create(t.positionAt(p.getTokenOffset()),t.positionAt(p.getTokenOffset()+p.getTokenLength())));break;case 15:case 14:break;default:return $e}}}function w($e){return p.getToken()===$e?(S(),!0):!1}function E($e,Be,je,We,Je){if(Je===void 0&&(Je=Ht.Error),i.length===0||je!==a){var ze=tr.create(t.positionAt(je),t.positionAt(We));i.push(ai.create(ze,$e,Je,Be,t.languageId)),a=je}}function k($e,Be,je,We,Je){je===void 0&&(je=null),We===void 0&&(We=[]),Je===void 0&&(Je=[]);var ze=p.getTokenOffset(),et=p.getTokenOffset()+p.getTokenLength();if(ze===et&&ze>0){for(ze--;ze>0&&/\s/.test(s.charAt(ze));)ze--;et=ze+1}if(E($e,Be,ze,et),je&&ae(je,!1),We.length+Je.length>0)for(var wt=p.getToken();wt!==17;){if(We.indexOf(wt)!==-1){S();break}else if(Je.indexOf(wt)!==-1)break;wt=S()}return je}function $(){switch(p.getTokenError()){case 4:return k("Invalid unicode sequence in string.",Yt.InvalidUnicode),!0;case 5:return k("Invalid escape character in string.",Yt.InvalidEscapeCharacter),!0;case 3:return k("Unexpected end of number.",Yt.UnexpectedEndOfNumber),!0;case 1:return k("Unexpected end of comment.",Yt.UnexpectedEndOfComment),!0;case 2:return k("Unexpected end of string.",Yt.UnexpectedEndOfString),!0;case 6:return k("Invalid characters in string. Control characters must be escaped.",Yt.InvalidCharacter),!0}return!1}function ae($e,Be){return $e.length=p.getTokenOffset()+p.getTokenLength()-$e.offset,Be&&S(),$e}function re($e){if(p.getToken()!==3)return null;var Be=new hu($e,p.getTokenOffset());S();for(var je=0,We=!1;p.getToken()!==4&&p.getToken()!==17;){if(p.getToken()===5){We||k("Value expected",Yt.ValueExpected);var Je=p.getTokenOffset();if(S(),p.getToken()===4){We&&E("Trailing comma",Yt.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",Yt.CommaExpected);var ze=Fe(Be,je++);ze?Be.items.push(ze):k("Value expected",Yt.ValueExpected,null,[],[4,5]),We=!0}return p.getToken()!==4?k("Expected comma or closing bracket",Yt.CommaOrCloseBacketExpected,Be):ae(Be,!0)}function le($e,Be){var je=new Ya($e,p.getTokenOffset()),We=he(je);if(!We)if(p.getToken()===16){k("Property keys must be doublequoted",Yt.Undefined);var Je=new Ka(je,p.getTokenOffset(),p.getTokenLength());Je.value=p.getTokenValue(),We=Je,S()}else return null;je.keyNode=We;var ze=Be[We.value];if(ze?(E("Duplicate object key",Yt.DuplicateKey,je.keyNode.offset,je.keyNode.offset+je.keyNode.length,Ht.Warning),typeof ze=="object"&&E("DuplicateKeyWarning",Yt.DuplicateKey,ze.keyNode.offset,ze.keyNode.offset+ze.keyNode.length,Ht.Warning),Be[We.value]=!0):Be[We.value]=je,p.getToken()===6)je.colonOffset=p.getTokenOffset(),S();else if(k("Colon expected",Yt.ColonExpected),p.getToken()===10&&t.positionAt(We.offset+We.length).line<t.positionAt(p.getTokenOffset()).line)return je.length=We.length,je;var et=Fe(je,We.value);return et?(je.valueNode=et,je.length=et.offset+et.length-je.offset,je):k("Value expected",Yt.ValueExpected,je,[],[2,5])}function ge($e){if(p.getToken()!==1)return null;var Be=new vu($e,p.getTokenOffset()),je=Object.create(null);S();for(var We=!1;p.getToken()!==2&&p.getToken()!==17;){if(p.getToken()===5){We||k("Property expected",Yt.PropertyExpected);var Je=p.getTokenOffset();if(S(),p.getToken()===2){We&&E("Trailing comma",Yt.TrailingComma,Je,Je+1);continue}}else We&&k("Expected comma",Yt.CommaExpected);var ze=le(Be,je);ze?Be.properties.push(ze):k("Property expected",Yt.PropertyExpected,null,[],[2,5]),We=!0}return p.getToken()!==2?k("Expected comma or closing brace",Yt.CommaOrCloseBraceExpected,Be):ae(Be,!0)}function he($e){if(p.getToken()!==10)return null;var Be=new Ka($e,p.getTokenOffset());return Be.value=p.getTokenValue(),ae(Be,!0)}function Se($e){if(p.getToken()!==11)return null;var Be=new Io($e,p.getTokenOffset());if(p.getTokenError()===0){var je=p.getTokenValue();try{var We=JSON.parse(je);if(!sn(We))return k("Invalid number format.",Yt.Undefined,Be);Be.value=We}catch(Je){return k("Invalid number format.",Yt.Undefined,Be)}Be.isInteger=je.indexOf(".")===-1}return ae(Be,!0)}function me($e){var Be;switch(p.getToken()){case 7:return ae(new $f($e,p.getTokenOffset()),!0);case 8:return ae(new pu($e,!0,p.getTokenOffset()),!0);case 9:return ae(new pu($e,!1,p.getTokenOffset()),!0);default:return null}}function Fe($e,Be){return re($e)||ge($e)||he($e)||Se($e)||me($e)}var Ke=null,Ue=S();return Ue!==17&&(Ke=Fe(null,null),Ke?p.getToken()!==17&&k("End of file expected.",Yt.Undefined):k("Expected a JSON object, array or literal.",Yt.Undefined)),new no(Ke,i,y)}function Za(t,r,i){if(t!==null&&typeof t=="object"){var a=r+" ";if(Array.isArray(t)){if(t.length===0)return"[]";for(var s=`[
171
171
  `,p=0;p<t.length;p++)s+=a+Za(t[p],a,i),p<t.length-1&&(s+=","),s+=`
172
172
  `;return s+=r+"]",s}else{var y=Object.keys(t);if(y.length===0)return"{}";for(var s=`{
173
173
  `,p=0;p<y.length;p++){var S=y[p];s+=a+JSON.stringify(S)+": "+Za(t[S],a,i),p<y.length-1&&(s+=","),s+=`
174
- `}return s+=r+"}",s}}return i(t)}function yu(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function Mi(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function mu(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function sl(t,r){for(var i="";r>0;)(r&1)==1&&(i+=t),t+=t,r=r>>>1;return i}var xu=[",","}","]"],ia=[":"],Yf=function(){function t(r,i,a,s){i===void 0&&(i=[]),a===void 0&&(a=Promise),s===void 0&&(s={}),this.schemaService=r,this.contributions=i,this.promiseConstructor=a,this.clientCapabilities=s,this.templateVarIdCounter=0}return t.prototype.doResolve=function(r){for(var i=this.contributions.length-1;i>=0;i--)if(this.contributions[i].resolveCompletion){var a=this.contributions[i].resolveCompletion(r);if(a)return a}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,a){var s=this,p={items:[],isIncomplete:!1},y=r.getText(),S=r.offsetAt(i),w=a.getNodeFromOffset(S,!0);if(this.isInComment(r,w?w.offset:0,S))return Promise.resolve(p);if(w&&S===w.offset+w.length&&S>0){var E=y[S-1];(w.type==="object"&&E==="}"||w.type==="array"&&E==="]")&&(w=w.parent)}var k=this.getCurrentWord(r,S),$=null;if(w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null"))$=tr.create(r.positionAt(w.offset),r.positionAt(w.offset+w.length));else{var ae=S-k.length;ae>0&&y[ae-1]==='"'&&ae--,$=tr.create(r.positionAt(ae),i)}var re=this.doesSupportsCommitCharacters(),le={},ge={add:function(he){var Se=le[he.label];Se?Se.documentation||(Se.documentation=he.documentation):(le[he.label]=he,$&&(he.textEdit=Wn.replace($,he.insertText)),re&&(he.commitCharacters=he.kind===un.Property?ia:xu),p.items.push(he))},setAsIncomplete:function(){p.isIncomplete=!0},error:function(he){console.error(he)},log:function(he){console.log(he)},getNumberOfProposals:function(){return p.items.length}};return this.schemaService.getSchemaForResource(r.uri,a).then(function(he){var Se=[],me=!0,Fe="",Ke=null;if(w&&w.type==="string"){var Ue=w.parent;Ue&&Ue.type==="property"&&Ue.keyNode===w&&(me=!Ue.valueNode,Ke=Ue,Fe=y.substr(w.offset+1,w.length-2),Ue&&(w=Ue.parent))}if(w&&w.type==="object"){if(w.offset===S)return p;var $e=w.properties;$e.forEach(function(Je){(!Ke||Ke!==Je)&&(le[Je.keyNode.value]=Ua.create("__"))});var Be="";me&&(Be=s.evaluateSeparatorAfter(r,r.offsetAt($.end))),he?s.getPropertyCompletions(he,a,w,me,Be,ge):s.getSchemaLessPropertyCompletions(a,w,Fe,ge);var je=Qa(w);s.contributions.forEach(function(Je){var ze=Je.collectPropertyCompletions(r.uri,je,k,me,Be==="",ge);ze&&Se.push(ze)}),!he&&k.length>0&&y.charAt(S-k.length-1)!=='"'&&(ge.add({kind:un.Property,label:s.getLabelForValue(k),insertText:s.getInsertTextForProperty(k,null,!1,Be),insertTextFormat:Ir.Snippet,documentation:""}),ge.setAsIncomplete())}var We={};return he?s.getValueCompletions(he,a,w,S,r,ge,We):s.getSchemaLessValueCompletions(a,w,S,r,ge),s.contributions.length>0&&s.getContributedValueCompletions(a,w,S,r,ge,Se),s.promiseConstructor.all(Se).then(function(){if(ge.getNumberOfProposals()===0){var Je=S;w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null")&&(Je=w.offset+w.length);var ze=s.evaluateSeparatorAfter(r,Je);s.addFillerValueCompletions(We,ze,ge)}return p})})},t.prototype.getPropertyCompletions=function(r,i,a,s,p,y){var S=this,w=i.getMatchingSchemas(r.schema,a.offset);w.forEach(function(E){if(E.node===a&&!E.inverted){var k=E.schema.properties;k&&Object.keys(k).forEach(function($){var ae=k[$],re=!1;if(typeof ae=="object"&&ae.allOf)for(var le=0,ge=ae.allOf;le<ge.length;le++){var he=ge[le];if(he.readOnly){re=!0;break}}if(typeof ae=="object"&&!ae.deprecationMessage&&!ae.doNotSuggest&&!re){var Se={kind:un.Property,label:S.sanitizeLabel($),insertText:S.getInsertTextForProperty($,ae,s,p),insertTextFormat:Ir.Snippet,filterText:S.getFilterTextForValue($),documentation:S.fromMarkup(ae.markdownDescription)||ae.description||""};Mi(Se.insertText,"$1"+p)&&(Se.command={title:"Suggest",command:"editor.action.triggerSuggest"}),y.add(Se)}})}})},t.prototype.getSchemaLessPropertyCompletions=function(r,i,a,s){var p=this,y=function(w){w.properties.forEach(function(E){var k=E.keyNode.value;s.add({kind:un.Property,label:p.sanitizeLabel(k),insertText:p.getInsertTextForValue(k,""),insertTextFormat:Ir.Snippet,filterText:p.getFilterTextForValue(k),documentation:""})})};if(i.parent)if(i.parent.type==="property"){var S=i.parent.keyNode.value;r.visit(function(w){return w.type==="property"&&w!==i.parent&&w.keyNode.value===S&&w.valueNode&&w.valueNode.type==="object"&&y(w.valueNode),!0})}else i.parent.type==="array"&&i.parent.items.forEach(function(w){w.type==="object"&&w!==i&&y(w)});else i.type==="object"&&s.add({kind:un.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Ir.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},t.prototype.getSchemaLessValueCompletions=function(r,i,a,s,p){var y=this,S=a;if(i&&(i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(S=i.offset+i.length,i=i.parent),!i){p.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Ir.Snippet,documentation:""}),p.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Ir.Snippet,documentation:""});return}var w=this.evaluateSeparatorAfter(s,S),E=function(re){al(re.parent,a,!0)||p.add({kind:y.getSuggestionKind(re.type),label:y.getLabelTextForMatchingNode(re,s),insertText:y.getInsertTextForMatchingNode(re,s,w),insertTextFormat:Ir.Snippet,documentation:""}),re.type==="boolean"&&y.addBooleanValueCompletion(!re.value,w,p)};if(i.type==="property"&&a>i.colonOffset){var k=i.valueNode;if(k&&(a>k.offset+k.length||k.type==="object"||k.type==="array"))return;var $=i.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===$&&re.valueNode&&E(re.valueNode),!0}),$==="$schema"&&i.parent&&!i.parent.parent&&this.addDollarSchemaCompletions(w,p)}if(i.type==="array")if(i.parent&&i.parent.type==="property"){var ae=i.parent.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===ae&&re.valueNode&&re.valueNode.type==="array"&&re.valueNode.items.forEach(E),!0})}else i.items.forEach(E)},t.prototype.getValueCompletions=function(r,i,a,s,p,y,S){var w=this,E=s,k=null,$=null;if(a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null")&&(E=a.offset+a.length,$=a,a=a.parent),!a){this.addSchemaValueCompletions(r.schema,"",y,S);return}if(a.type==="property"&&s>a.colonOffset){var ae=a.valueNode;if(ae&&s>ae.offset+ae.length)return;k=a.keyNode.value,a=a.parent}if(a&&(k!==null||a.type==="array")){var re=this.evaluateSeparatorAfter(p,E),le=i.getMatchingSchemas(r.schema,a.offset,$);le.forEach(function(ge){if(ge.node===a&&!ge.inverted&&ge.schema){if(a.type==="array"&&ge.schema.items)if(Array.isArray(ge.schema.items)){var he=w.findItemAtOffset(a,p,s);he<ge.schema.items.length&&w.addSchemaValueCompletions(ge.schema.items[he],re,y,S)}else w.addSchemaValueCompletions(ge.schema.items,re,y,S);if(ge.schema.properties){var Se=ge.schema.properties[k];Se&&w.addSchemaValueCompletions(Se,re,y,S)}}}),k==="$schema"&&!a.parent&&this.addDollarSchemaCompletions(re,y),S.boolean&&(this.addBooleanValueCompletion(!0,re,y),this.addBooleanValueCompletion(!1,re,y)),S.null&&this.addNullValueCompletion(re,y)}},t.prototype.getContributedValueCompletions=function(r,i,a,s,p,y){if(!i)this.contributions.forEach(function(k){var $=k.collectDefaultCompletions(s.uri,p);$&&y.push($)});else if((i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(i=i.parent),i.type==="property"&&a>i.colonOffset){var S=i.keyNode.value,w=i.valueNode;if(!w||a<=w.offset+w.length){var E=Qa(i.parent);this.contributions.forEach(function(k){var $=k.collectValueCompletions(s.uri,E,S,p);$&&y.push($)})}}},t.prototype.addSchemaValueCompletions=function(r,i,a,s){var p=this;typeof r=="object"&&(this.addEnumValueCompletions(r,i,a),this.addDefaultValueCompletions(r,i,a),this.collectTypes(r,s),Array.isArray(r.allOf)&&r.allOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}),Array.isArray(r.anyOf)&&r.anyOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}),Array.isArray(r.oneOf)&&r.oneOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}))},t.prototype.addDefaultValueCompletions=function(r,i,a,s){var p=this;s===void 0&&(s=0);var y=!1;if(yn(r.default)){for(var S=r.type,w=r.default,E=s;E>0;E--)w=[w],S="array";a.add({kind:this.getSuggestionKind(S),label:this.getLabelForValue(w),insertText:this.getInsertTextForValue(w,i),insertTextFormat:Ir.Snippet}),y=!0}Array.isArray(r.examples)&&r.examples.forEach(function(k){for(var $=r.type,ae=k,re=s;re>0;re--)ae=[ae],$="array";a.add({kind:p.getSuggestionKind($),label:p.getLabelForValue(ae),insertText:p.getInsertTextForValue(ae,i),insertTextFormat:Ir.Snippet}),y=!0}),Array.isArray(r.defaultSnippets)&&r.defaultSnippets.forEach(function(k){var $=r.type,ae=k.body,re=k.label,le,ge;if(yn(ae)){for(var he=r.type,Se=s;Se>0;Se--)ae=[ae],he="array";le=p.getInsertTextForSnippetValue(ae,i),ge=p.getFilterTextForSnippetValue(ae),re=re||p.getLabelForSnippetValue(ae)}else if(typeof k.bodyText=="string"){for(var me="",Fe="",Ke="",Se=s;Se>0;Se--)me=me+Ke+`[
174
+ `}return s+=r+"}",s}}return i(t)}function yu(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function Mi(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function mu(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function al(t,r){for(var i="";r>0;)(r&1)==1&&(i+=t),t+=t,r=r>>>1;return i}var xu=[",","}","]"],ia=[":"],Yf=function(){function t(r,i,a,s){i===void 0&&(i=[]),a===void 0&&(a=Promise),s===void 0&&(s={}),this.schemaService=r,this.contributions=i,this.promiseConstructor=a,this.clientCapabilities=s,this.templateVarIdCounter=0}return t.prototype.doResolve=function(r){for(var i=this.contributions.length-1;i>=0;i--)if(this.contributions[i].resolveCompletion){var a=this.contributions[i].resolveCompletion(r);if(a)return a}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,a){var s=this,p={items:[],isIncomplete:!1},y=r.getText(),S=r.offsetAt(i),w=a.getNodeFromOffset(S,!0);if(this.isInComment(r,w?w.offset:0,S))return Promise.resolve(p);if(w&&S===w.offset+w.length&&S>0){var E=y[S-1];(w.type==="object"&&E==="}"||w.type==="array"&&E==="]")&&(w=w.parent)}var k=this.getCurrentWord(r,S),$=null;if(w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null"))$=tr.create(r.positionAt(w.offset),r.positionAt(w.offset+w.length));else{var ae=S-k.length;ae>0&&y[ae-1]==='"'&&ae--,$=tr.create(r.positionAt(ae),i)}var re=this.doesSupportsCommitCharacters(),le={},ge={add:function(he){var Se=le[he.label];Se?Se.documentation||(Se.documentation=he.documentation):(le[he.label]=he,$&&(he.textEdit=Wn.replace($,he.insertText)),re&&(he.commitCharacters=he.kind===un.Property?ia:xu),p.items.push(he))},setAsIncomplete:function(){p.isIncomplete=!0},error:function(he){console.error(he)},log:function(he){console.log(he)},getNumberOfProposals:function(){return p.items.length}};return this.schemaService.getSchemaForResource(r.uri,a).then(function(he){var Se=[],me=!0,Fe="",Ke=null;if(w&&w.type==="string"){var Ue=w.parent;Ue&&Ue.type==="property"&&Ue.keyNode===w&&(me=!Ue.valueNode,Ke=Ue,Fe=y.substr(w.offset+1,w.length-2),Ue&&(w=Ue.parent))}if(w&&w.type==="object"){if(w.offset===S)return p;var $e=w.properties;$e.forEach(function(Je){(!Ke||Ke!==Je)&&(le[Je.keyNode.value]=Ua.create("__"))});var Be="";me&&(Be=s.evaluateSeparatorAfter(r,r.offsetAt($.end))),he?s.getPropertyCompletions(he,a,w,me,Be,ge):s.getSchemaLessPropertyCompletions(a,w,Fe,ge);var je=Qa(w);s.contributions.forEach(function(Je){var ze=Je.collectPropertyCompletions(r.uri,je,k,me,Be==="",ge);ze&&Se.push(ze)}),!he&&k.length>0&&y.charAt(S-k.length-1)!=='"'&&(ge.add({kind:un.Property,label:s.getLabelForValue(k),insertText:s.getInsertTextForProperty(k,null,!1,Be),insertTextFormat:Ir.Snippet,documentation:""}),ge.setAsIncomplete())}var We={};return he?s.getValueCompletions(he,a,w,S,r,ge,We):s.getSchemaLessValueCompletions(a,w,S,r,ge),s.contributions.length>0&&s.getContributedValueCompletions(a,w,S,r,ge,Se),s.promiseConstructor.all(Se).then(function(){if(ge.getNumberOfProposals()===0){var Je=S;w&&(w.type==="string"||w.type==="number"||w.type==="boolean"||w.type==="null")&&(Je=w.offset+w.length);var ze=s.evaluateSeparatorAfter(r,Je);s.addFillerValueCompletions(We,ze,ge)}return p})})},t.prototype.getPropertyCompletions=function(r,i,a,s,p,y){var S=this,w=i.getMatchingSchemas(r.schema,a.offset);w.forEach(function(E){if(E.node===a&&!E.inverted){var k=E.schema.properties;k&&Object.keys(k).forEach(function($){var ae=k[$],re=!1;if(typeof ae=="object"&&ae.allOf)for(var le=0,ge=ae.allOf;le<ge.length;le++){var he=ge[le];if(he.readOnly){re=!0;break}}if(typeof ae=="object"&&!ae.deprecationMessage&&!ae.doNotSuggest&&!re){var Se={kind:un.Property,label:S.sanitizeLabel($),insertText:S.getInsertTextForProperty($,ae,s,p),insertTextFormat:Ir.Snippet,filterText:S.getFilterTextForValue($),documentation:S.fromMarkup(ae.markdownDescription)||ae.description||""};Mi(Se.insertText,"$1"+p)&&(Se.command={title:"Suggest",command:"editor.action.triggerSuggest"}),y.add(Se)}})}})},t.prototype.getSchemaLessPropertyCompletions=function(r,i,a,s){var p=this,y=function(w){w.properties.forEach(function(E){var k=E.keyNode.value;s.add({kind:un.Property,label:p.sanitizeLabel(k),insertText:p.getInsertTextForValue(k,""),insertTextFormat:Ir.Snippet,filterText:p.getFilterTextForValue(k),documentation:""})})};if(i.parent)if(i.parent.type==="property"){var S=i.parent.keyNode.value;r.visit(function(w){return w.type==="property"&&w!==i.parent&&w.keyNode.value===S&&w.valueNode&&w.valueNode.type==="object"&&y(w.valueNode),!0})}else i.parent.type==="array"&&i.parent.items.forEach(function(w){w.type==="object"&&w!==i&&y(w)});else i.type==="object"&&s.add({kind:un.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Ir.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},t.prototype.getSchemaLessValueCompletions=function(r,i,a,s,p){var y=this,S=a;if(i&&(i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(S=i.offset+i.length,i=i.parent),!i){p.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Ir.Snippet,documentation:""}),p.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Ir.Snippet,documentation:""});return}var w=this.evaluateSeparatorAfter(s,S),E=function(re){ol(re.parent,a,!0)||p.add({kind:y.getSuggestionKind(re.type),label:y.getLabelTextForMatchingNode(re,s),insertText:y.getInsertTextForMatchingNode(re,s,w),insertTextFormat:Ir.Snippet,documentation:""}),re.type==="boolean"&&y.addBooleanValueCompletion(!re.value,w,p)};if(i.type==="property"&&a>i.colonOffset){var k=i.valueNode;if(k&&(a>k.offset+k.length||k.type==="object"||k.type==="array"))return;var $=i.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===$&&re.valueNode&&E(re.valueNode),!0}),$==="$schema"&&i.parent&&!i.parent.parent&&this.addDollarSchemaCompletions(w,p)}if(i.type==="array")if(i.parent&&i.parent.type==="property"){var ae=i.parent.keyNode.value;r.visit(function(re){return re.type==="property"&&re.keyNode.value===ae&&re.valueNode&&re.valueNode.type==="array"&&re.valueNode.items.forEach(E),!0})}else i.items.forEach(E)},t.prototype.getValueCompletions=function(r,i,a,s,p,y,S){var w=this,E=s,k=null,$=null;if(a&&(a.type==="string"||a.type==="number"||a.type==="boolean"||a.type==="null")&&(E=a.offset+a.length,$=a,a=a.parent),!a){this.addSchemaValueCompletions(r.schema,"",y,S);return}if(a.type==="property"&&s>a.colonOffset){var ae=a.valueNode;if(ae&&s>ae.offset+ae.length)return;k=a.keyNode.value,a=a.parent}if(a&&(k!==null||a.type==="array")){var re=this.evaluateSeparatorAfter(p,E),le=i.getMatchingSchemas(r.schema,a.offset,$);le.forEach(function(ge){if(ge.node===a&&!ge.inverted&&ge.schema){if(a.type==="array"&&ge.schema.items)if(Array.isArray(ge.schema.items)){var he=w.findItemAtOffset(a,p,s);he<ge.schema.items.length&&w.addSchemaValueCompletions(ge.schema.items[he],re,y,S)}else w.addSchemaValueCompletions(ge.schema.items,re,y,S);if(ge.schema.properties){var Se=ge.schema.properties[k];Se&&w.addSchemaValueCompletions(Se,re,y,S)}}}),k==="$schema"&&!a.parent&&this.addDollarSchemaCompletions(re,y),S.boolean&&(this.addBooleanValueCompletion(!0,re,y),this.addBooleanValueCompletion(!1,re,y)),S.null&&this.addNullValueCompletion(re,y)}},t.prototype.getContributedValueCompletions=function(r,i,a,s,p,y){if(!i)this.contributions.forEach(function(k){var $=k.collectDefaultCompletions(s.uri,p);$&&y.push($)});else if((i.type==="string"||i.type==="number"||i.type==="boolean"||i.type==="null")&&(i=i.parent),i.type==="property"&&a>i.colonOffset){var S=i.keyNode.value,w=i.valueNode;if(!w||a<=w.offset+w.length){var E=Qa(i.parent);this.contributions.forEach(function(k){var $=k.collectValueCompletions(s.uri,E,S,p);$&&y.push($)})}}},t.prototype.addSchemaValueCompletions=function(r,i,a,s){var p=this;typeof r=="object"&&(this.addEnumValueCompletions(r,i,a),this.addDefaultValueCompletions(r,i,a),this.collectTypes(r,s),Array.isArray(r.allOf)&&r.allOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}),Array.isArray(r.anyOf)&&r.anyOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}),Array.isArray(r.oneOf)&&r.oneOf.forEach(function(y){return p.addSchemaValueCompletions(y,i,a,s)}))},t.prototype.addDefaultValueCompletions=function(r,i,a,s){var p=this;s===void 0&&(s=0);var y=!1;if(yn(r.default)){for(var S=r.type,w=r.default,E=s;E>0;E--)w=[w],S="array";a.add({kind:this.getSuggestionKind(S),label:this.getLabelForValue(w),insertText:this.getInsertTextForValue(w,i),insertTextFormat:Ir.Snippet}),y=!0}Array.isArray(r.examples)&&r.examples.forEach(function(k){for(var $=r.type,ae=k,re=s;re>0;re--)ae=[ae],$="array";a.add({kind:p.getSuggestionKind($),label:p.getLabelForValue(ae),insertText:p.getInsertTextForValue(ae,i),insertTextFormat:Ir.Snippet}),y=!0}),Array.isArray(r.defaultSnippets)&&r.defaultSnippets.forEach(function(k){var $=r.type,ae=k.body,re=k.label,le,ge;if(yn(ae)){for(var he=r.type,Se=s;Se>0;Se--)ae=[ae],he="array";le=p.getInsertTextForSnippetValue(ae,i),ge=p.getFilterTextForSnippetValue(ae),re=re||p.getLabelForSnippetValue(ae)}else if(typeof k.bodyText=="string"){for(var me="",Fe="",Ke="",Se=s;Se>0;Se--)me=me+Ke+`[
175
175
  `,Fe=Fe+`
176
176
  `+Ke+"]",Ke+=" ",$="array";le=me+Ke+k.bodyText.split(`
177
177
  `).join(`
@@ -182,8 +182,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
182
182
 
183
183
  `),Ke+="`"+bu(Fe)+"`: "+me),E([Ke])}return null})},t}();function _a(t){if(t){var r=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
184
184
 
185
- $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var wu=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),dr,fi;if(typeof process=="object")fi=!1;else if(typeof navigator=="object"){var oa=navigator.userAgent;fi=oa.indexOf("Windows")>=0}function qa(t){return 55296<=t&&t<=56319}function Jf(t){return 56320<=t&&t<=57343}function Td(t){return t>=97&&t<=102}function Su(t){return t>=97&&t<=122}function Li(t){return t>=65&&t<=90}function aa(t){return Su(t)||Li(t)}var sa=/^\w[\w\d+.-]*$/,Xf=/^\//,Au=/^\/\//;function Qf(t,r){if(!t.scheme&&r)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!sa.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Xf.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Au.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Zf(t,r){return!t&&!r?"file":t}function _f(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==kn&&(r=kn+r):r=kn;break}return r}var Vt="",kn="/",qf=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,ll=function(){function t(r,i,a,s,p,y){y===void 0&&(y=!1),typeof r=="object"?(this.scheme=r.scheme||Vt,this.authority=r.authority||Vt,this.path=r.path||Vt,this.query=r.query||Vt,this.fragment=r.fragment||Vt):(this.scheme=Zf(r,y),this.authority=i||Vt,this.path=_f(this.scheme,a||Vt),this.query=s||Vt,this.fragment=p||Vt,Qf(this,y))}return t.isUri=function(r){return r instanceof t?!0:r?typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="function"&&typeof r.with=="function"&&typeof r.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return Cu(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,a=r.authority,s=r.path,p=r.query,y=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=Vt),a===void 0?a=this.authority:a===null&&(a=Vt),s===void 0?s=this.path:s===null&&(s=Vt),p===void 0?p=this.query:p===null&&(p=Vt),y===void 0?y=this.fragment:y===null&&(y=Vt),i===this.scheme&&a===this.authority&&s===this.path&&p===this.query&&y===this.fragment?this:new io(i,a,s,p,y)},t.parse=function(r,i){i===void 0&&(i=!1);var a=qf.exec(r);return a?new io(a[2]||Vt,oo(a[4]||Vt),oo(a[5]||Vt),oo(a[7]||Vt),oo(a[9]||Vt),i):new io(Vt,Vt,Vt,Vt,Vt)},t.file=function(r){var i=Vt;if(fi&&(r=r.replace(/\\/g,kn)),r[0]===kn&&r[1]===kn){var a=r.indexOf(kn,2);a===-1?(i=r.substring(2),r=kn):(i=r.substring(2,a),r=r.substring(a)||kn)}return new io("file",i,r,Vt,Vt)},t.from=function(r){return new io(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),cl(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new io(r);return i._formatted=r.external,i._fsPath=r._sep===Eu?r.fsPath:null,i}else return r},t}(),Eu=fi?1:void 0,io=function(t){wu(r,t);function r(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(r.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=Cu(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?cl(this,!0):(this._formatted||(this._formatted=cl(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=Eu),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i},r}(ll),ul=(dr={},dr[58]="%3A",dr[47]="%2F",dr[63]="%3F",dr[35]="%23",dr[91]="%5B",dr[93]="%5D",dr[64]="%40",dr[33]="%21",dr[36]="%24",dr[38]="%26",dr[39]="%27",dr[40]="%28",dr[41]="%29",dr[42]="%2A",dr[43]="%2B",dr[44]="%2C",dr[59]="%3B",dr[61]="%3D",dr[32]="%20",dr);function fl(t,r){for(var i=void 0,a=-1,s=0;s<t.length;s++){var p=t.charCodeAt(s);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===46||p===95||p===126||r&&p===47)a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var y=ul[p];y!==void 0?(a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i+=y):a===-1&&(a=s)}}return a!==-1&&(i+=encodeURIComponent(t.substring(a))),i!==void 0?i:t}function ec(t){for(var r=void 0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a===35||a===63?(r===void 0&&(r=t.substr(0,i)),r+=ul[a]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function Cu(t,r){var i;return t.authority&&t.path.length>1&&t.scheme==="file"?i="//"+t.authority+t.path:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?r?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,fi&&(i=i.replace(/\//g,"\\")),i}function cl(t,r){var i=r?ec:fl,a="",s=t.scheme,p=t.authority,y=t.path,S=t.query,w=t.fragment;if(s&&(a+=s,a+=":"),(p||s==="file")&&(a+=kn,a+=kn),p){var E=p.indexOf("@");if(E!==-1){var k=p.substr(0,E);p=p.substr(E+1),E=k.indexOf(":"),E===-1?a+=i(k,!1):(a+=i(k.substr(0,E),!1),a+=":",a+=i(k.substr(E+1),!1)),a+="@"}p=p.toLowerCase(),E=p.indexOf(":"),E===-1?a+=i(p,!1):(a+=i(p.substr(0,E),!1),a+=p.substr(E))}if(y){if(y.length>=3&&y.charCodeAt(0)===47&&y.charCodeAt(2)===58){var $=y.charCodeAt(1);$>=65&&$<=90&&(y="/"+String.fromCharCode($+32)+":"+y.substr(3))}else if(y.length>=2&&y.charCodeAt(1)===58){var $=y.charCodeAt(0);$>=65&&$<=90&&(y=String.fromCharCode($+32)+":"+y.substr(2))}a+=i(y,!0)}return S&&(a+="?",a+=i(S,!1)),w&&(a+="#",a+=r?w:fl(w,!1)),a}function ci(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+ci(t.substr(3)):t}}var ko=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function oo(t){return t.match(ko)?t.replace(ko,function(r){return ci(r)}):t}var la=function(){function t(r){try{this.patternRegExp=new RegExp(mu(r)+"$")}catch(i){this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(r){this.schemas.push(r)},t.prototype.matchesPattern=function(r){return this.patternRegExp&&this.patternRegExp.test(r)},t.prototype.getSchemas=function(){return this.schemas},t}(),di=function(){function t(r,i,a){this.service=r,this.url=i,this.dependencies={},a&&(this.unresolvedSchema=this.service.promise.resolve(new Ro(a)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var r=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return r.service.resolveSchemaContent(i,r.url,r.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),Ro=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),Ou=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return tn(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var a=r.shift();if(i.properties&&typeof i.properties[a])return this.getSectionRecursive(r,i.properties[a]);if(i.patternProperties)for(var s=0,p=Object.keys(i.patternProperties);s<p.length;s++){var y=p[s],S=new RegExp(y);if(S.test(a))return this.getSectionRecursive(r,i.patternProperties[y])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(a.match("[0-9]+")){if(Array.isArray(i.items)){var w=parseInt(a,10);if(!isNaN(w)&&i.items[w])return this.getSectionRecursive(r,i.items[w])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),Mo=function(){function t(r,i,a){this.contextService=i,this.requestService=r,this.promiseConstructor=a||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(r){return Object.keys(this.registeredSchemasIds).filter(function(i){var a=ll.parse(i).scheme;return a!=="schemaservice"&&(!r||r(a))})},Object.defineProperty(t.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this,a=!1;r=this.normalizeId(r);for(var s=[r],p=Object.keys(this.schemasById).map(function(E){return i.schemasById[E]});s.length;)for(var y=s.pop(),S=0;S<p.length;S++){var w=p[S];w&&(w.url===y||w.dependencies[y])&&(w.url!==y&&s.push(w.url),w.clearSchema(),p[S]=void 0,a=!0)}return a},t.prototype.normalizeId=function(r){try{return ll.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var a in i){var s=this.normalizeId(a);this.contributionSchemas[s]=this.addSchemaHandle(s,i[a])}}if(r.schemaAssociations){var p=r.schemaAssociations;for(var y in p){var S=p[y];this.contributionAssociations[y]=S;for(var w=this.getOrAddFilePatternAssociation(y),E=0,k=S;E<k.length;E++){var $=k[E],a=this.normalizeId($);w.addSchema(a)}}}},t.prototype.addSchemaHandle=function(r,i){var a=new di(this,r,i);return this.schemasById[r]=a,a},t.prototype.getOrAddSchemaHandle=function(r,i){return this.schemasById[r]||this.addSchemaHandle(r,i)},t.prototype.getOrAddFilePatternAssociation=function(r){var i=this.filePatternAssociationById[r];return i||(i=new la(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,a){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var p=0,y=i;p<y.length;p++){var S=y[p];this.getOrAddFilePatternAssociation(S).addSchema(s)}return a?this.addSchemaHandle(s,a):this.getOrAddSchemaHandle(s)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var r in this.contributionSchemas)this.schemasById[r]=this.contributionSchemas[r],this.registeredSchemasIds[r]=!0;for(var i in this.contributionAssociations)for(var a=this.getOrAddFilePatternAssociation(i),s=0,p=this.contributionAssociations[i];s<p.length;s++){var y=p[s],r=this.normalizeId(y);a.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),a=this.schemasById[i];return a?a.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+ua(r)+"'. No schema request service available";return this.promise.resolve(new Ro({},[i]))}return this.requestService(r).then(function(a){if(!a){var s="Unable to load schema from '"+ua(r)+"': No content.";return new Ro({},[s])}var p={},y=[];p=Uf(a,y);var S=y.length?["Unable to parse content from '"+ua(r)+"': Parse error at offset "+y[0].offset]:[];return new Ro(p,S)},function(a){var s="Unable to load schema from '"+ua(r)+"': "+a.toString();return new Ro({},[s])})},t.prototype.resolveSchemaContent=function(r,i,a){var s=this,p=r.errors.slice(0),y=r.schema;if(y.$schema){var S=this.normalizeId(y.$schema);if(S==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new Ou({},["Draft-03 schemas are not supported."]));S==="https://json-schema.org/draft/2019-09/schema"&&r.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var w=this.contextService,E=function(re,le){if(!le)return re;var ge=re;return le[0]==="/"&&(le=le.substr(1)),le.split("/").some(function(he){return ge=ge[he],!ge}),ge},k=function(re,le,ge,he){var Se=E(le,he);if(Se)for(var me in Se)Se.hasOwnProperty(me)&&!re.hasOwnProperty(me)&&(re[me]=Se[me]);else p.push("$ref '"+he+"' in '"+ge+"' can not be resolved.")},$=function(re,le,ge,he,Se){w&&!/^\w+:\/\/.*/.test(le)&&(le=w.resolveRelativePath(le,he)),le=s.normalizeId(le);var me=s.getOrAddSchemaHandle(le);return me.getUnresolvedSchema().then(function(Fe){if(Se[le]=!0,Fe.errors.length){var Ke=ge?le+"#"+ge:le;p.push("Problems loading reference '"+Ke+"': "+Fe.errors[0]+".")}return k(re,Fe.schema,le,ge),ae(re,Fe.schema,le,me.dependencies)})},ae=function(re,le,ge,he){if(!re||typeof re!="object")return Promise.resolve(null);for(var Se=[re],me=[],Fe=[],Ke=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var wt=et[ze];typeof wt=="object"&&Se.push(wt)}},Ue=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var wt=et[ze];if(typeof wt=="object")for(var Dt in wt){var Wt=wt[Dt];typeof Wt=="object"&&Se.push(Wt)}}},$e=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var wt=et[ze];if(Array.isArray(wt))for(var Dt=0,Wt=wt;Dt<Wt.length;Dt++){var lr=Wt[Dt];typeof lr=="object"&&Se.push(lr)}}},Be=function(We){for(var Je=[];We.$ref;){var ze=We.$ref,et=ze.split("#",2);if(delete We.$ref,et[0].length>0){Fe.push($(We,et[0],et[1],ge,he));return}else Je.indexOf(ze)===-1&&(k(We,le,ge,et[1]),Je.push(ze))}Ke(We.items,We.additionalProperties,We.not,We.contains,We.propertyNames,We.if,We.then,We.else),Ue(We.definitions,We.properties,We.patternProperties,We.dependencies),$e(We.anyOf,We.allOf,We.oneOf,We.items)};Se.length;){var je=Se.pop();me.indexOf(je)>=0||(me.push(je),Be(je))}return s.promise.all(Fe)};return ae(y,y,i,a).then(function(re){return new Ou(y,p)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var a=i.root.properties.filter(function(le){return le.keyNode.value==="$schema"&&le.valueNode&&le.valueNode.type==="string"});if(a.length>0){var s=ui(a[0].valueNode);if(s&&yu(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var p=this.normalizeId(s);return this.getOrAddSchemaHandle(p).getResolvedSchema()}}}for(var y=Object.create(null),S=[],w=0,E=this.filePatternAssociations;w<E.length;w++){var k=E[w];if(k.matchesPattern(r))for(var $=0,ae=k.getSchemas();$<ae.length;$++){var re=ae[$];y[re]||(S.push(re),y[re]=!0)}}return S.length>0?this.createCombinedSchema(r,S).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var a="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(p){return{$ref:p}})};return this.addSchemaHandle(a,s)},t}();function ua(t){try{}catch(r){}return t}var Tu=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate,this.commentSeverity=r.allowComments?void 0:Ht.Error)},t.prototype.doValidation=function(r,i,a,s){var p=this;if(!this.validationEnabled)return this.promise.resolve([]);var y=[],S={},w=function($){var ae=$.range.start.line+" "+$.range.start.character+" "+$.message;S[ae]||(S[ae]=!0,y.push($))},E=function($){var ae=a?es(a.trailingCommas):Ht.Error,re=a?es(a.comments):p.commentSeverity;if($){if($.errors.length&&i.root){var le=i.root,ge=le.type==="object"?le.properties[0]:null;if(ge&&ge.keyNode.value==="$schema"){var he=ge.valueNode||ge,Se=tr.create(r.positionAt(he.offset),r.positionAt(he.offset+he.length));w(ai.create(Se,$.errors[0],Ht.Warning,Yt.SchemaResolveError))}else{var Se=tr.create(r.positionAt(le.offset),r.positionAt(le.offset+1));w(ai.create(Se,$.errors[0],Ht.Warning,Yt.SchemaResolveError))}}else{var me=i.validate(r,$.schema);me&&me.forEach(w)}fa($.schema)&&(re=void 0),ao($.schema)&&(ae=void 0)}for(var Fe=0,Ke=i.syntaxErrors;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(Ue.code===Yt.TrailingComma){if(typeof ae!="number")continue;Ue.severity=ae}w(Ue)}if(typeof re=="number"){var $e="Comments are not permitted in JSON.";i.comments.forEach(function(Be){w(ai.create(Be,$e,re,Yt.CommentNotPermitted))})}return y};if(s){var k=s.id||"schemaservice://untitled/"+Pu++;return this.jsonSchemaService.resolveSchemaContent(new Ro(s),k,{}).then(function($){return E($)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function($){return E($)})},t}(),Pu=0;function fa(t){if(t&&typeof t=="object"){if(mn(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=fa(a);if(mn(s))return s}}}function ao(t){if(t&&typeof t=="object"){if(mn(t.allowTrailingCommas))return t.allowTrailingCommas;if(mn(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=ao(a);if(mn(s))return s}}}function es(t){switch(t){case"error":return Ht.Error;case"warning":return Ht.Warning;case"ignore":return}}var ts=48,dl=57,tc=65,Di=97,Iu=102;function Fr(t){return t<ts?0:t<=dl?t-ts:(t<Di&&(t+=Di-tc),t>=Di&&t<=Iu?t-Di+10:0)}function Fu(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:Fr(t.charCodeAt(1))*17/255,green:Fr(t.charCodeAt(2))*17/255,blue:Fr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Fr(t.charCodeAt(1))*17/255,green:Fr(t.charCodeAt(2))*17/255,blue:Fr(t.charCodeAt(3))*17/255,alpha:Fr(t.charCodeAt(4))*17/255};case 7:return{red:(Fr(t.charCodeAt(1))*16+Fr(t.charCodeAt(2)))/255,green:(Fr(t.charCodeAt(3))*16+Fr(t.charCodeAt(4)))/255,blue:(Fr(t.charCodeAt(5))*16+Fr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Fr(t.charCodeAt(1))*16+Fr(t.charCodeAt(2)))/255,green:(Fr(t.charCodeAt(3))*16+Fr(t.charCodeAt(4)))/255,blue:(Fr(t.charCodeAt(5))*16+Fr(t.charCodeAt(6)))/255,alpha:(Fr(t.charCodeAt(7))*16+Fr(t.charCodeAt(8)))/255}}return null}function pl(t,r,i,a){return a===void 0&&(a=1),{red:t/255,green:r/255,blue:i/255,alpha:a}}var rc=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,S=r.uri;if((S==="vscode://defaultsettings/keybindings.json"||Mi(S.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,k=p.items;E<k.length;E++){var $=k[E];if($.type==="object")for(var ae=0,re=$.properties;ae<re.length;ae++){var le=re[ae];if(le.keyNode.value==="key"&&le.valueNode){var ge=Vn.create(r.uri,Ni(r,$));if(w.push({name:ui(le.valueNode),kind:Ar.Function,location:ge}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S),w}}}return w}var he=function(me,Fe,Ke){return y>=0&&(Fe.type==="array"?Fe.items.forEach(function(Ue){return he(me,Ue,Ke)}):Fe.type==="object"&&Fe.properties.forEach(function(Ue){if(y>=0){var $e=Ue.valueNode;if($e){y--;var Be=Vn.create(r.uri,Ni(r,Ue)),je=Ke?Ke+"."+Ue.keyNode.value:Ue.keyNode.value;me.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),location:Be,containerName:Ke}),he(me,$e,je)}}})),me},Se=he([],p,void 0);return y<0&&(Se.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S)),Se},t.prototype.findDocumentSymbols2=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,S=r.uri;if((S==="vscode://defaultsettings/keybindings.json"||Mi(S.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,k=p.items;E<k.length;E++){var $=k[E];if($.type==="object")for(var ae=0,re=$.properties;ae<re.length;ae++){var le=re[ae];if(le.keyNode.value==="key"&&le.valueNode){var ge=Ni(r,$),he=Ni(r,le.keyNode);if(w.push({name:ui(le.valueNode),kind:Ar.Function,range:ge,selectionRange:he}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S),w}}}return w}var Se=function(Fe,Ke){return y>=0&&(Ke.type==="array"?Ke.items.forEach(function(Ue,$e){if(Ue&&y>=0){y--;var Be=Ni(r,Ue),je=Be,We=String($e),Je=Se([],Ue);Fe.push({name:We,kind:s.getSymbolKind(Ue.type),range:Be,selectionRange:je,children:Je})}}):Ke.type==="object"&&Ke.properties.forEach(function(Ue){var $e=Ue.valueNode;if($e&&y>=0){y--;var Be=Ni(r,Ue),je=Ni(r,Ue.keyNode),We=Se([],$e);Fe.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),range:Be,selectionRange:je,children:We})}})),Fe},me=Se([],p);return y<0&&(me.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S)),me},t.prototype.getSymbolKind=function(r){switch(r){case"object":return Ar.Module;case"string":return Ar.String;case"number":return Ar.Number;case"array":return Ar.Array;case"boolean":return Ar.Boolean;default:return Ar.Variable}},t.prototype.getKeyLabel=function(r){var i=r.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(r,i,a){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var p=[];if(s)for(var y=a&&typeof a.resultLimit=="number"?a.resultLimit:Number.MAX_VALUE,S=i.getMatchingSchemas(s.schema),w={},E=0,k=S;E<k.length;E++){var $=k[E];if(!$.inverted&&$.schema&&($.schema.format==="color"||$.schema.format==="color-hex")&&$.node&&$.node.type==="string"){var ae=String($.node.offset);if(!w[ae]){var re=Fu(ui($.node));if(re){var le=Ni(r,$.node);p.push({color:re,range:le})}if(w[ae]=!0,y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(r.uri),p}}}return p})},t.prototype.getColorPresentations=function(r,i,a,s){var p=[],y=Math.round(a.red*255),S=Math.round(a.green*255),w=Math.round(a.blue*255);function E($){var ae=$.toString(16);return ae.length!==2?"0"+ae:ae}var k;return a.alpha===1?k="#"+E(y)+E(S)+E(w):k="#"+E(y)+E(S)+E(w)+E(Math.round(a.alpha*255)),p.push({label:k,textEdit:Wn.replace(s,JSON.stringify(k))}),p},t}();function Ni(t,r){return tr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var ca={schemaAssociations:{},schemas:{}};function ku(t,r){var i=[],a=[],s=[],p=-1,y=Oi(t.getText(),!1),S=y.scan();function w(Je){i.push(Je),a.push(s.length)}for(;S!==17;){switch(S){case 1:case 3:{var E=t.positionAt(y.getTokenOffset()).line,k={startLine:E,endLine:E,kind:S===1?"object":"array"};s.push(k);break}case 2:case 4:{var $=S===2?"object":"array";if(s.length>0&&s[s.length-1].kind===$){var k=s.pop(),ae=t.positionAt(y.getTokenOffset()).line;k&&ae>k.startLine+1&&p!==k.startLine&&(k.endLine=ae-1,w(k),p=k.startLine)}break}case 13:{var E=t.positionAt(y.getTokenOffset()).line,re=t.positionAt(y.getTokenOffset()+y.getTokenLength()).line;y.getTokenError()===1&&E+1<t.lineCount?y.setPosition(t.offsetAt(ln.create(E+1,0))):E<re&&(w({startLine:E,endLine:re,kind:Eo.Comment}),p=E);break}case 12:{var le=t.getText().substr(y.getTokenOffset(),y.getTokenLength()),ge=le.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(ge){var ae=t.positionAt(y.getTokenOffset()).line;if(ge[1]){var k={startLine:ae,endLine:ae,kind:Eo.Region};s.push(k)}else{for(var he=s.length-1;he>=0&&s[he].kind!==Eo.Region;)he--;if(he>=0){var k=s[he];s.length=he,ae>k.startLine&&p!==k.startLine&&(k.endLine=ae,w(k),p=k.startLine)}}}break}}S=y.scan()}var Se=r&&r.rangeLimit;if(typeof Se!="number"||i.length<=Se)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var me=[],Fe=0,Ke=a;Fe<Ke.length;Fe++){var Ue=Ke[Fe];Ue<30&&(me[Ue]=(me[Ue]||0)+1)}for(var $e=0,Be=0,he=0;he<me.length;he++){var je=me[he];if(je){if(je+$e>Se){Be=he;break}$e+=je}}for(var We=[],he=0;he<i.length;he++){var Ue=a[he];typeof Ue=="number"&&(Ue<Be||Ue===Be&&$e++<Se)&&We.push(i[he])}return We}function Ru(t,r,i){function a(S){for(var w=t.offsetAt(S),E=i.getNodeFromOffset(w,!0),k=[];E;){switch(E.type){case"string":case"object":case"array":var $=E.offset+1,ae=E.offset+E.length-1;$<ae&&w>=$&&w<=ae&&k.push(s($,ae)),k.push(s(E.offset,E.offset+E.length));break;case"number":case"boolean":case"null":case"property":k.push(s(E.offset,E.offset+E.length));break}if(E.type==="property"||E.parent&&E.parent.type==="array"){var re=y(E.offset+E.length,5);re!==-1&&k.push(s(E.offset,re))}E=E.parent}for(var le=void 0,ge=k.length-1;ge>=0;ge--)le=Fi.create(k[ge],le);return le||(le=Fi.create(tr.create(S,S))),le}function s(S,w){return tr.create(t.positionAt(S),t.positionAt(w))}var p=Oi(t.getText(),!0);function y(S,w){p.setPosition(S);var E=p.scan();return E===w?p.getTokenOffset()+p.getTokenLength():-1}return r.map(a)}function nc(t){var r=t.promiseConstructor||Promise,i=new Mo(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(ca);var a=new Yf(i,t.contributions,r,t.clientCapabilities),s=new Fo(i,t.contributions,r),p=new rc(i),y=new Tu(i,r);return{configure:function(S){i.clearExternalSchemas(),S.schemas&&S.schemas.forEach(function(w){i.registerExternalSchema(w.uri,w.fileMatch,w.schema)}),y.configure(S)},resetSchema:function(S){return i.onResourceChange(S)},doValidation:y.doValidation.bind(y),parseJSONDocument:function(S){return gu(S,{collectComments:!0})},newJSONDocument:function(S,w){return Xa(S,w)},doComplete:a.doComplete.bind(a),findDocumentSymbols:p.findDocumentSymbols.bind(p),findDocumentSymbols2:p.findDocumentSymbols2.bind(p),findColorSymbols:function(S,w){return p.findDocumentColors(S,w).then(function(E){return E.map(function(k){return k.range})})},findDocumentColors:p.findDocumentColors.bind(p),getColorPresentations:p.getColorPresentations.bind(p),doHover:s.doHover.bind(s),getFoldingRanges:ku,getSelectionRanges:Ru,format:function(S,w,E){var k=void 0;if(w){var $=S.offsetAt(w.start),ae=S.offsetAt(w.end)-$;k={offset:$,length:ae}}var re={tabSize:E?E.tabSize:4,insertSpaces:E?E.insertSpaces:!0,eol:`
186
- `};return Wf(S.getText(),k,re).map(function(le){return Wn.replace(tr.create(S.positionAt(le.offset),S.positionAt(le.offset+le.length)),le.content)})}}}var Mu=o(96876),ic=o(4328),Pd=o(3256),oc=o(71707),ac=o(82801),Id=o(32095),Lu=o(86081),rs=o(44254),ns=o(75019),Fd=o(13837),hl=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const Lo=nc({});qr.registerHelper("lint","json",function(t,r){return hl(this,null,function*(){const{schema:i,setError:a}=r;Lo.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const s=za.create(r.id+".json","json",0,t),p=Lo.parseJSONDocument(s),y=yield Lo.doValidation(s,p);return y.length?a&&a(y[0].message):a&&a(void 0),y.map(S=>({from:qr.Pos(S.range.start.line,S.range.start.character),to:qr.Pos(S.range.end.line,S.range.end.character),message:S.message}))})}),qr.registerHelper("hint","json",(t,r)=>hl(void 0,null,function*(){const i=r.schema;if(!i)return;Lo.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const a=t.getDoc().getCursor(),s=t.getTokenAt(a),p=za.create(r.id+".json","json",0,t.getValue()),y=Lo.parseJSONDocument(p),S=yield Lo.doComplete(p,{line:a.line,character:a.ch},y),w=k=>{let $="";for(;k--;)$+=" ";return $};let E=S?S.items.map(k=>({text:k.insertText,displayText:k.label,filter:k.filterText||k.label,from:{line:k.textEdit.range.start.line,ch:k.textEdit.range.start.character},to:{line:k.textEdit.range.end.line,ch:k.textEdit.range.end.character},hint:($,ae,re)=>{const le="_$__REDOC_CURSOR_HERE";let ge=re.text.replace(/(\$1|\${1:[^}]+})/,le)||"";if(ge=ge.replace(/(\$\d+|\${[^}]+})/g,"")||"",$.setSelection(re.from,re.to),ge.indexOf(`
185
+ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var wu=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),dr,fi;if(typeof process=="object")fi=!1;else if(typeof navigator=="object"){var oa=navigator.userAgent;fi=oa.indexOf("Windows")>=0}function qa(t){return 55296<=t&&t<=56319}function Jf(t){return 56320<=t&&t<=57343}function Td(t){return t>=97&&t<=102}function Su(t){return t>=97&&t<=122}function Li(t){return t>=65&&t<=90}function aa(t){return Su(t)||Li(t)}var sa=/^\w[\w\d+.-]*$/,Xf=/^\//,Au=/^\/\//;function Qf(t,r){if(!t.scheme&&r)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+t.authority+'", path: "'+t.path+'", query: "'+t.query+'", fragment: "'+t.fragment+'"}');if(t.scheme&&!sa.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!Xf.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Au.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Zf(t,r){return!t&&!r?"file":t}function _f(t,r){switch(t){case"https":case"http":case"file":r?r[0]!==kn&&(r=kn+r):r=kn;break}return r}var Vt="",kn="/",qf=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,sl=function(){function t(r,i,a,s,p,y){y===void 0&&(y=!1),typeof r=="object"?(this.scheme=r.scheme||Vt,this.authority=r.authority||Vt,this.path=r.path||Vt,this.query=r.query||Vt,this.fragment=r.fragment||Vt):(this.scheme=Zf(r,y),this.authority=i||Vt,this.path=_f(this.scheme,a||Vt),this.query=s||Vt,this.fragment=p||Vt,Qf(this,y))}return t.isUri=function(r){return r instanceof t?!0:r?typeof r.authority=="string"&&typeof r.fragment=="string"&&typeof r.path=="string"&&typeof r.query=="string"&&typeof r.scheme=="string"&&typeof r.fsPath=="function"&&typeof r.with=="function"&&typeof r.toString=="function":!1},Object.defineProperty(t.prototype,"fsPath",{get:function(){return Cu(this,!1)},enumerable:!0,configurable:!0}),t.prototype.with=function(r){if(!r)return this;var i=r.scheme,a=r.authority,s=r.path,p=r.query,y=r.fragment;return i===void 0?i=this.scheme:i===null&&(i=Vt),a===void 0?a=this.authority:a===null&&(a=Vt),s===void 0?s=this.path:s===null&&(s=Vt),p===void 0?p=this.query:p===null&&(p=Vt),y===void 0?y=this.fragment:y===null&&(y=Vt),i===this.scheme&&a===this.authority&&s===this.path&&p===this.query&&y===this.fragment?this:new io(i,a,s,p,y)},t.parse=function(r,i){i===void 0&&(i=!1);var a=qf.exec(r);return a?new io(a[2]||Vt,oo(a[4]||Vt),oo(a[5]||Vt),oo(a[7]||Vt),oo(a[9]||Vt),i):new io(Vt,Vt,Vt,Vt,Vt)},t.file=function(r){var i=Vt;if(fi&&(r=r.replace(/\\/g,kn)),r[0]===kn&&r[1]===kn){var a=r.indexOf(kn,2);a===-1?(i=r.substring(2),r=kn):(i=r.substring(2,a),r=r.substring(a)||kn)}return new io("file",i,r,Vt,Vt)},t.from=function(r){return new io(r.scheme,r.authority,r.path,r.query,r.fragment)},t.prototype.toString=function(r){return r===void 0&&(r=!1),fl(this,r)},t.prototype.toJSON=function(){return this},t.revive=function(r){if(r){if(r instanceof t)return r;var i=new io(r);return i._formatted=r.external,i._fsPath=r._sep===Eu?r.fsPath:null,i}else return r},t}(),Eu=fi?1:void 0,io=function(t){wu(r,t);function r(){var i=t!==null&&t.apply(this,arguments)||this;return i._formatted=null,i._fsPath=null,i}return Object.defineProperty(r.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=Cu(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),r.prototype.toString=function(i){return i===void 0&&(i=!1),i?fl(this,!0):(this._formatted||(this._formatted=fl(this,!1)),this._formatted)},r.prototype.toJSON=function(){var i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=Eu),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i},r}(sl),ll=(dr={},dr[58]="%3A",dr[47]="%2F",dr[63]="%3F",dr[35]="%23",dr[91]="%5B",dr[93]="%5D",dr[64]="%40",dr[33]="%21",dr[36]="%24",dr[38]="%26",dr[39]="%27",dr[40]="%28",dr[41]="%29",dr[42]="%2A",dr[43]="%2B",dr[44]="%2C",dr[59]="%3B",dr[61]="%3D",dr[32]="%20",dr);function ul(t,r){for(var i=void 0,a=-1,s=0;s<t.length;s++){var p=t.charCodeAt(s);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45||p===46||p===95||p===126||r&&p===47)a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i!==void 0&&(i+=t.charAt(s));else{i===void 0&&(i=t.substr(0,s));var y=ll[p];y!==void 0?(a!==-1&&(i+=encodeURIComponent(t.substring(a,s)),a=-1),i+=y):a===-1&&(a=s)}}return a!==-1&&(i+=encodeURIComponent(t.substring(a))),i!==void 0?i:t}function ec(t){for(var r=void 0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a===35||a===63?(r===void 0&&(r=t.substr(0,i)),r+=ll[a]):r!==void 0&&(r+=t[i])}return r!==void 0?r:t}function Cu(t,r){var i;return t.authority&&t.path.length>1&&t.scheme==="file"?i="//"+t.authority+t.path:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?r?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,fi&&(i=i.replace(/\//g,"\\")),i}function fl(t,r){var i=r?ec:ul,a="",s=t.scheme,p=t.authority,y=t.path,S=t.query,w=t.fragment;if(s&&(a+=s,a+=":"),(p||s==="file")&&(a+=kn,a+=kn),p){var E=p.indexOf("@");if(E!==-1){var k=p.substr(0,E);p=p.substr(E+1),E=k.indexOf(":"),E===-1?a+=i(k,!1):(a+=i(k.substr(0,E),!1),a+=":",a+=i(k.substr(E+1),!1)),a+="@"}p=p.toLowerCase(),E=p.indexOf(":"),E===-1?a+=i(p,!1):(a+=i(p.substr(0,E),!1),a+=p.substr(E))}if(y){if(y.length>=3&&y.charCodeAt(0)===47&&y.charCodeAt(2)===58){var $=y.charCodeAt(1);$>=65&&$<=90&&(y="/"+String.fromCharCode($+32)+":"+y.substr(3))}else if(y.length>=2&&y.charCodeAt(1)===58){var $=y.charCodeAt(0);$>=65&&$<=90&&(y=String.fromCharCode($+32)+":"+y.substr(2))}a+=i(y,!0)}return S&&(a+="?",a+=i(S,!1)),w&&(a+="#",a+=r?w:ul(w,!1)),a}function ci(t){try{return decodeURIComponent(t)}catch(r){return t.length>3?t.substr(0,3)+ci(t.substr(3)):t}}var ko=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function oo(t){return t.match(ko)?t.replace(ko,function(r){return ci(r)}):t}var la=function(){function t(r){try{this.patternRegExp=new RegExp(mu(r)+"$")}catch(i){this.patternRegExp=null}this.schemas=[]}return t.prototype.addSchema=function(r){this.schemas.push(r)},t.prototype.matchesPattern=function(r){return this.patternRegExp&&this.patternRegExp.test(r)},t.prototype.getSchemas=function(){return this.schemas},t}(),di=function(){function t(r,i,a){this.service=r,this.url=i,this.dependencies={},a&&(this.unresolvedSchema=this.service.promise.resolve(new Ro(a)))}return t.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},t.prototype.getResolvedSchema=function(){var r=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(i){return r.service.resolveSchemaContent(i,r.url,r.dependencies)})),this.resolvedSchema},t.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},t}(),Ro=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t}(),Ou=function(){function t(r,i){i===void 0&&(i=[]),this.schema=r,this.errors=i}return t.prototype.getSection=function(r){return tn(this.getSectionRecursive(r,this.schema))},t.prototype.getSectionRecursive=function(r,i){if(!i||typeof i=="boolean"||r.length===0)return i;var a=r.shift();if(i.properties&&typeof i.properties[a])return this.getSectionRecursive(r,i.properties[a]);if(i.patternProperties)for(var s=0,p=Object.keys(i.patternProperties);s<p.length;s++){var y=p[s],S=new RegExp(y);if(S.test(a))return this.getSectionRecursive(r,i.patternProperties[y])}else{if(typeof i.additionalProperties=="object")return this.getSectionRecursive(r,i.additionalProperties);if(a.match("[0-9]+")){if(Array.isArray(i.items)){var w=parseInt(a,10);if(!isNaN(w)&&i.items[w])return this.getSectionRecursive(r,i.items[w])}else if(i.items)return this.getSectionRecursive(r,i.items)}}return null},t}(),Mo=function(){function t(r,i,a){this.contextService=i,this.requestService=r,this.promiseConstructor=a||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return t.prototype.getRegisteredSchemaIds=function(r){return Object.keys(this.registeredSchemasIds).filter(function(i){var a=sl.parse(i).scheme;return a!=="schemaservice"&&(!r||r(a))})},Object.defineProperty(t.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this,a=!1;r=this.normalizeId(r);for(var s=[r],p=Object.keys(this.schemasById).map(function(E){return i.schemasById[E]});s.length;)for(var y=s.pop(),S=0;S<p.length;S++){var w=p[S];w&&(w.url===y||w.dependencies[y])&&(w.url!==y&&s.push(w.url),w.clearSchema(),p[S]=void 0,a=!0)}return a},t.prototype.normalizeId=function(r){try{return sl.parse(r).toString()}catch(i){return r}},t.prototype.setSchemaContributions=function(r){if(r.schemas){var i=r.schemas;for(var a in i){var s=this.normalizeId(a);this.contributionSchemas[s]=this.addSchemaHandle(s,i[a])}}if(r.schemaAssociations){var p=r.schemaAssociations;for(var y in p){var S=p[y];this.contributionAssociations[y]=S;for(var w=this.getOrAddFilePatternAssociation(y),E=0,k=S;E<k.length;E++){var $=k[E],a=this.normalizeId($);w.addSchema(a)}}}},t.prototype.addSchemaHandle=function(r,i){var a=new di(this,r,i);return this.schemasById[r]=a,a},t.prototype.getOrAddSchemaHandle=function(r,i){return this.schemasById[r]||this.addSchemaHandle(r,i)},t.prototype.getOrAddFilePatternAssociation=function(r){var i=this.filePatternAssociationById[r];return i||(i=new la(r),this.filePatternAssociationById[r]=i,this.filePatternAssociations.push(i)),i},t.prototype.registerExternalSchema=function(r,i,a){i===void 0&&(i=null);var s=this.normalizeId(r);if(this.registeredSchemasIds[s]=!0,i)for(var p=0,y=i;p<y.length;p++){var S=y[p];this.getOrAddFilePatternAssociation(S).addSchema(s)}return a?this.addSchemaHandle(s,a):this.getOrAddSchemaHandle(s)},t.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var r in this.contributionSchemas)this.schemasById[r]=this.contributionSchemas[r],this.registeredSchemasIds[r]=!0;for(var i in this.contributionAssociations)for(var a=this.getOrAddFilePatternAssociation(i),s=0,p=this.contributionAssociations[i];s<p.length;s++){var y=p[s],r=this.normalizeId(y);a.addSchema(r)}},t.prototype.getResolvedSchema=function(r){var i=this.normalizeId(r),a=this.schemasById[i];return a?a.getResolvedSchema():this.promise.resolve(null)},t.prototype.loadSchema=function(r){if(!this.requestService){var i="Unable to load schema from '"+ua(r)+"'. No schema request service available";return this.promise.resolve(new Ro({},[i]))}return this.requestService(r).then(function(a){if(!a){var s="Unable to load schema from '"+ua(r)+"': No content.";return new Ro({},[s])}var p={},y=[];p=Uf(a,y);var S=y.length?["Unable to parse content from '"+ua(r)+"': Parse error at offset "+y[0].offset]:[];return new Ro(p,S)},function(a){var s="Unable to load schema from '"+ua(r)+"': "+a.toString();return new Ro({},[s])})},t.prototype.resolveSchemaContent=function(r,i,a){var s=this,p=r.errors.slice(0),y=r.schema;if(y.$schema){var S=this.normalizeId(y.$schema);if(S==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new Ou({},["Draft-03 schemas are not supported."]));S==="https://json-schema.org/draft/2019-09/schema"&&r.errors.push("Draft 2019-09 schemas are not yet fully supported.")}var w=this.contextService,E=function(re,le){if(!le)return re;var ge=re;return le[0]==="/"&&(le=le.substr(1)),le.split("/").some(function(he){return ge=ge[he],!ge}),ge},k=function(re,le,ge,he){var Se=E(le,he);if(Se)for(var me in Se)Se.hasOwnProperty(me)&&!re.hasOwnProperty(me)&&(re[me]=Se[me]);else p.push("$ref '"+he+"' in '"+ge+"' can not be resolved.")},$=function(re,le,ge,he,Se){w&&!/^\w+:\/\/.*/.test(le)&&(le=w.resolveRelativePath(le,he)),le=s.normalizeId(le);var me=s.getOrAddSchemaHandle(le);return me.getUnresolvedSchema().then(function(Fe){if(Se[le]=!0,Fe.errors.length){var Ke=ge?le+"#"+ge:le;p.push("Problems loading reference '"+Ke+"': "+Fe.errors[0]+".")}return k(re,Fe.schema,le,ge),ae(re,Fe.schema,le,me.dependencies)})},ae=function(re,le,ge,he){if(!re||typeof re!="object")return Promise.resolve(null);for(var Se=[re],me=[],Fe=[],Ke=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var wt=et[ze];typeof wt=="object"&&Se.push(wt)}},Ue=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var wt=et[ze];if(typeof wt=="object")for(var Dt in wt){var Wt=wt[Dt];typeof Wt=="object"&&Se.push(Wt)}}},$e=function(){for(var We=[],Je=0;Je<arguments.length;Je++)We[Je]=arguments[Je];for(var ze=0,et=We;ze<et.length;ze++){var wt=et[ze];if(Array.isArray(wt))for(var Dt=0,Wt=wt;Dt<Wt.length;Dt++){var lr=Wt[Dt];typeof lr=="object"&&Se.push(lr)}}},Be=function(We){for(var Je=[];We.$ref;){var ze=We.$ref,et=ze.split("#",2);if(delete We.$ref,et[0].length>0){Fe.push($(We,et[0],et[1],ge,he));return}else Je.indexOf(ze)===-1&&(k(We,le,ge,et[1]),Je.push(ze))}Ke(We.items,We.additionalProperties,We.not,We.contains,We.propertyNames,We.if,We.then,We.else),Ue(We.definitions,We.properties,We.patternProperties,We.dependencies),$e(We.anyOf,We.allOf,We.oneOf,We.items)};Se.length;){var je=Se.pop();me.indexOf(je)>=0||(me.push(je),Be(je))}return s.promise.all(Fe)};return ae(y,y,i,a).then(function(re){return new Ou(y,p)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var a=i.root.properties.filter(function(le){return le.keyNode.value==="$schema"&&le.valueNode&&le.valueNode.type==="string"});if(a.length>0){var s=ui(a[0].valueNode);if(s&&yu(s,".")&&this.contextService&&(s=this.contextService.resolveRelativePath(s,r)),s){var p=this.normalizeId(s);return this.getOrAddSchemaHandle(p).getResolvedSchema()}}}for(var y=Object.create(null),S=[],w=0,E=this.filePatternAssociations;w<E.length;w++){var k=E[w];if(k.matchesPattern(r))for(var $=0,ae=k.getSchemas();$<ae.length;$++){var re=ae[$];y[re]||(S.push(re),y[re]=!0)}}return S.length>0?this.createCombinedSchema(r,S).getResolvedSchema():this.promise.resolve(null)},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var a="schemaservice://combinedSchema/"+encodeURIComponent(r),s={allOf:i.map(function(p){return{$ref:p}})};return this.addSchemaHandle(a,s)},t}();function ua(t){try{}catch(r){}return t}var Tu=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate,this.commentSeverity=r.allowComments?void 0:Ht.Error)},t.prototype.doValidation=function(r,i,a,s){var p=this;if(!this.validationEnabled)return this.promise.resolve([]);var y=[],S={},w=function($){var ae=$.range.start.line+" "+$.range.start.character+" "+$.message;S[ae]||(S[ae]=!0,y.push($))},E=function($){var ae=a?es(a.trailingCommas):Ht.Error,re=a?es(a.comments):p.commentSeverity;if($){if($.errors.length&&i.root){var le=i.root,ge=le.type==="object"?le.properties[0]:null;if(ge&&ge.keyNode.value==="$schema"){var he=ge.valueNode||ge,Se=tr.create(r.positionAt(he.offset),r.positionAt(he.offset+he.length));w(ai.create(Se,$.errors[0],Ht.Warning,Yt.SchemaResolveError))}else{var Se=tr.create(r.positionAt(le.offset),r.positionAt(le.offset+1));w(ai.create(Se,$.errors[0],Ht.Warning,Yt.SchemaResolveError))}}else{var me=i.validate(r,$.schema);me&&me.forEach(w)}fa($.schema)&&(re=void 0),ao($.schema)&&(ae=void 0)}for(var Fe=0,Ke=i.syntaxErrors;Fe<Ke.length;Fe++){var Ue=Ke[Fe];if(Ue.code===Yt.TrailingComma){if(typeof ae!="number")continue;Ue.severity=ae}w(Ue)}if(typeof re=="number"){var $e="Comments are not permitted in JSON.";i.comments.forEach(function(Be){w(ai.create(Be,$e,re,Yt.CommentNotPermitted))})}return y};if(s){var k=s.id||"schemaservice://untitled/"+Pu++;return this.jsonSchemaService.resolveSchemaContent(new Ro(s),k,{}).then(function($){return E($)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function($){return E($)})},t}(),Pu=0;function fa(t){if(t&&typeof t=="object"){if(mn(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=fa(a);if(mn(s))return s}}}function ao(t){if(t&&typeof t=="object"){if(mn(t.allowTrailingCommas))return t.allowTrailingCommas;if(mn(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var a=i[r],s=ao(a);if(mn(s))return s}}}function es(t){switch(t){case"error":return Ht.Error;case"warning":return Ht.Warning;case"ignore":return}}var ts=48,cl=57,tc=65,Di=97,Iu=102;function Fr(t){return t<ts?0:t<=cl?t-ts:(t<Di&&(t+=Di-tc),t>=Di&&t<=Iu?t-Di+10:0)}function Fu(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:Fr(t.charCodeAt(1))*17/255,green:Fr(t.charCodeAt(2))*17/255,blue:Fr(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Fr(t.charCodeAt(1))*17/255,green:Fr(t.charCodeAt(2))*17/255,blue:Fr(t.charCodeAt(3))*17/255,alpha:Fr(t.charCodeAt(4))*17/255};case 7:return{red:(Fr(t.charCodeAt(1))*16+Fr(t.charCodeAt(2)))/255,green:(Fr(t.charCodeAt(3))*16+Fr(t.charCodeAt(4)))/255,blue:(Fr(t.charCodeAt(5))*16+Fr(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Fr(t.charCodeAt(1))*16+Fr(t.charCodeAt(2)))/255,green:(Fr(t.charCodeAt(3))*16+Fr(t.charCodeAt(4)))/255,blue:(Fr(t.charCodeAt(5))*16+Fr(t.charCodeAt(6)))/255,alpha:(Fr(t.charCodeAt(7))*16+Fr(t.charCodeAt(8)))/255}}return null}function dl(t,r,i,a){return a===void 0&&(a=1),{red:t/255,green:r/255,blue:i/255,alpha:a}}var rc=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,S=r.uri;if((S==="vscode://defaultsettings/keybindings.json"||Mi(S.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,k=p.items;E<k.length;E++){var $=k[E];if($.type==="object")for(var ae=0,re=$.properties;ae<re.length;ae++){var le=re[ae];if(le.keyNode.value==="key"&&le.valueNode){var ge=Vn.create(r.uri,Ni(r,$));if(w.push({name:ui(le.valueNode),kind:Ar.Function,location:ge}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S),w}}}return w}var he=function(me,Fe,Ke){return y>=0&&(Fe.type==="array"?Fe.items.forEach(function(Ue){return he(me,Ue,Ke)}):Fe.type==="object"&&Fe.properties.forEach(function(Ue){if(y>=0){var $e=Ue.valueNode;if($e){y--;var Be=Vn.create(r.uri,Ni(r,Ue)),je=Ke?Ke+"."+Ue.keyNode.value:Ue.keyNode.value;me.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),location:Be,containerName:Ke}),he(me,$e,je)}}})),me},Se=he([],p,void 0);return y<0&&(Se.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S)),Se},t.prototype.findDocumentSymbols2=function(r,i,a){var s=this;a===void 0&&(a={resultLimit:Number.MAX_VALUE});var p=i.root;if(!p)return null;var y=a.resultLimit,S=r.uri;if((S==="vscode://defaultsettings/keybindings.json"||Mi(S.toLowerCase(),"/user/keybindings.json"))&&p.type==="array"){for(var w=[],E=0,k=p.items;E<k.length;E++){var $=k[E];if($.type==="object")for(var ae=0,re=$.properties;ae<re.length;ae++){var le=re[ae];if(le.keyNode.value==="key"&&le.valueNode){var ge=Ni(r,$),he=Ni(r,le.keyNode);if(w.push({name:ui(le.valueNode),kind:Ar.Function,range:ge,selectionRange:he}),y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S),w}}}return w}var Se=function(Fe,Ke){return y>=0&&(Ke.type==="array"?Ke.items.forEach(function(Ue,$e){if(Ue&&y>=0){y--;var Be=Ni(r,Ue),je=Be,We=String($e),Je=Se([],Ue);Fe.push({name:We,kind:s.getSymbolKind(Ue.type),range:Be,selectionRange:je,children:Je})}}):Ke.type==="object"&&Ke.properties.forEach(function(Ue){var $e=Ue.valueNode;if($e&&y>=0){y--;var Be=Ni(r,Ue),je=Ni(r,Ue.keyNode),We=Se([],$e);Fe.push({name:s.getKeyLabel(Ue),kind:s.getSymbolKind($e.type),range:Be,selectionRange:je,children:We})}})),Fe},me=Se([],p);return y<0&&(me.pop(),a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(S)),me},t.prototype.getSymbolKind=function(r){switch(r){case"object":return Ar.Module;case"string":return Ar.String;case"number":return Ar.Number;case"array":return Ar.Array;case"boolean":return Ar.Boolean;default:return Ar.Variable}},t.prototype.getKeyLabel=function(r){var i=r.keyNode.value;return i&&(i=i.replace(/[\n]/g,"\u21B5")),i&&i.trim()?i:'"'+i+'"'},t.prototype.findDocumentColors=function(r,i,a){return this.schemaService.getSchemaForResource(r.uri,i).then(function(s){var p=[];if(s)for(var y=a&&typeof a.resultLimit=="number"?a.resultLimit:Number.MAX_VALUE,S=i.getMatchingSchemas(s.schema),w={},E=0,k=S;E<k.length;E++){var $=k[E];if(!$.inverted&&$.schema&&($.schema.format==="color"||$.schema.format==="color-hex")&&$.node&&$.node.type==="string"){var ae=String($.node.offset);if(!w[ae]){var re=Fu(ui($.node));if(re){var le=Ni(r,$.node);p.push({color:re,range:le})}if(w[ae]=!0,y--,y<=0)return a&&a.onResultLimitExceeded&&a.onResultLimitExceeded(r.uri),p}}}return p})},t.prototype.getColorPresentations=function(r,i,a,s){var p=[],y=Math.round(a.red*255),S=Math.round(a.green*255),w=Math.round(a.blue*255);function E($){var ae=$.toString(16);return ae.length!==2?"0"+ae:ae}var k;return a.alpha===1?k="#"+E(y)+E(S)+E(w):k="#"+E(y)+E(S)+E(w)+E(Math.round(a.alpha*255)),p.push({label:k,textEdit:Wn.replace(s,JSON.stringify(k))}),p},t}();function Ni(t,r){return tr.create(t.positionAt(r.offset),t.positionAt(r.offset+r.length))}var ca={schemaAssociations:{},schemas:{}};function ku(t,r){var i=[],a=[],s=[],p=-1,y=Oi(t.getText(),!1),S=y.scan();function w(Je){i.push(Je),a.push(s.length)}for(;S!==17;){switch(S){case 1:case 3:{var E=t.positionAt(y.getTokenOffset()).line,k={startLine:E,endLine:E,kind:S===1?"object":"array"};s.push(k);break}case 2:case 4:{var $=S===2?"object":"array";if(s.length>0&&s[s.length-1].kind===$){var k=s.pop(),ae=t.positionAt(y.getTokenOffset()).line;k&&ae>k.startLine+1&&p!==k.startLine&&(k.endLine=ae-1,w(k),p=k.startLine)}break}case 13:{var E=t.positionAt(y.getTokenOffset()).line,re=t.positionAt(y.getTokenOffset()+y.getTokenLength()).line;y.getTokenError()===1&&E+1<t.lineCount?y.setPosition(t.offsetAt(ln.create(E+1,0))):E<re&&(w({startLine:E,endLine:re,kind:Eo.Comment}),p=E);break}case 12:{var le=t.getText().substr(y.getTokenOffset(),y.getTokenLength()),ge=le.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(ge){var ae=t.positionAt(y.getTokenOffset()).line;if(ge[1]){var k={startLine:ae,endLine:ae,kind:Eo.Region};s.push(k)}else{for(var he=s.length-1;he>=0&&s[he].kind!==Eo.Region;)he--;if(he>=0){var k=s[he];s.length=he,ae>k.startLine&&p!==k.startLine&&(k.endLine=ae,w(k),p=k.startLine)}}}break}}S=y.scan()}var Se=r&&r.rangeLimit;if(typeof Se!="number"||i.length<=Se)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var me=[],Fe=0,Ke=a;Fe<Ke.length;Fe++){var Ue=Ke[Fe];Ue<30&&(me[Ue]=(me[Ue]||0)+1)}for(var $e=0,Be=0,he=0;he<me.length;he++){var je=me[he];if(je){if(je+$e>Se){Be=he;break}$e+=je}}for(var We=[],he=0;he<i.length;he++){var Ue=a[he];typeof Ue=="number"&&(Ue<Be||Ue===Be&&$e++<Se)&&We.push(i[he])}return We}function Ru(t,r,i){function a(S){for(var w=t.offsetAt(S),E=i.getNodeFromOffset(w,!0),k=[];E;){switch(E.type){case"string":case"object":case"array":var $=E.offset+1,ae=E.offset+E.length-1;$<ae&&w>=$&&w<=ae&&k.push(s($,ae)),k.push(s(E.offset,E.offset+E.length));break;case"number":case"boolean":case"null":case"property":k.push(s(E.offset,E.offset+E.length));break}if(E.type==="property"||E.parent&&E.parent.type==="array"){var re=y(E.offset+E.length,5);re!==-1&&k.push(s(E.offset,re))}E=E.parent}for(var le=void 0,ge=k.length-1;ge>=0;ge--)le=Fi.create(k[ge],le);return le||(le=Fi.create(tr.create(S,S))),le}function s(S,w){return tr.create(t.positionAt(S),t.positionAt(w))}var p=Oi(t.getText(),!0);function y(S,w){p.setPosition(S);var E=p.scan();return E===w?p.getTokenOffset()+p.getTokenLength():-1}return r.map(a)}function nc(t){var r=t.promiseConstructor||Promise,i=new Mo(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(ca);var a=new Yf(i,t.contributions,r,t.clientCapabilities),s=new Fo(i,t.contributions,r),p=new rc(i),y=new Tu(i,r);return{configure:function(S){i.clearExternalSchemas(),S.schemas&&S.schemas.forEach(function(w){i.registerExternalSchema(w.uri,w.fileMatch,w.schema)}),y.configure(S)},resetSchema:function(S){return i.onResourceChange(S)},doValidation:y.doValidation.bind(y),parseJSONDocument:function(S){return gu(S,{collectComments:!0})},newJSONDocument:function(S,w){return Xa(S,w)},doComplete:a.doComplete.bind(a),findDocumentSymbols:p.findDocumentSymbols.bind(p),findDocumentSymbols2:p.findDocumentSymbols2.bind(p),findColorSymbols:function(S,w){return p.findDocumentColors(S,w).then(function(E){return E.map(function(k){return k.range})})},findDocumentColors:p.findDocumentColors.bind(p),getColorPresentations:p.getColorPresentations.bind(p),doHover:s.doHover.bind(s),getFoldingRanges:ku,getSelectionRanges:Ru,format:function(S,w,E){var k=void 0;if(w){var $=S.offsetAt(w.start),ae=S.offsetAt(w.end)-$;k={offset:$,length:ae}}var re={tabSize:E?E.tabSize:4,insertSpaces:E?E.insertSpaces:!0,eol:`
186
+ `};return Wf(S.getText(),k,re).map(function(le){return Wn.replace(tr.create(S.positionAt(le.offset),S.positionAt(le.offset+le.length)),le.content)})}}}var Mu=o(96876),ic=o(4328),Pd=o(3256),oc=o(71707),ac=o(82801),Id=o(32095),Lu=o(86081),rs=o(44254),ns=o(75019),Fd=o(13837),pl=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const Lo=nc({});qr.registerHelper("lint","json",function(t,r){return pl(this,null,function*(){const{schema:i,setError:a}=r;Lo.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const s=za.create(r.id+".json","json",0,t),p=Lo.parseJSONDocument(s),y=yield Lo.doValidation(s,p);return y.length?a&&a(y[0].message):a&&a(void 0),y.map(S=>({from:qr.Pos(S.range.start.line,S.range.start.character),to:qr.Pos(S.range.end.line,S.range.end.character),message:S.message}))})}),qr.registerHelper("hint","json",(t,r)=>pl(void 0,null,function*(){const i=r.schema;if(!i)return;Lo.configure({validate:!0,schemas:[{uri:"stub://"+r.id,fileMatch:["*"],schema:i}]});const a=t.getDoc().getCursor(),s=t.getTokenAt(a),p=za.create(r.id+".json","json",0,t.getValue()),y=Lo.parseJSONDocument(p),S=yield Lo.doComplete(p,{line:a.line,character:a.ch},y),w=k=>{let $="";for(;k--;)$+=" ";return $};let E=S?S.items.map(k=>({text:k.insertText,displayText:k.label,filter:k.filterText||k.label,from:{line:k.textEdit.range.start.line,ch:k.textEdit.range.start.character},to:{line:k.textEdit.range.end.line,ch:k.textEdit.range.end.character},hint:($,ae,re)=>{const le="_$__REDOC_CURSOR_HERE";let ge=re.text.replace(/(\$1|\${1:[^}]+})/,le)||"";if(ge=ge.replace(/(\$\d+|\${[^}]+})/g,"")||"",$.setSelection(re.from,re.to),ge.indexOf(`
187
187
  `)>-1){const Se=$.getLine($.getCursor().line).search(/(\S|$)/);ge=ge.replace(/\n/g,`
188
188
  `+w(Se))}$.replaceSelection(ge);const he=$.getSearchCursor(le,re.from);he.findNext()&&($.setCursor(he.from()),he.replace(""))}})):[];return/(property|string)/.test(s.type||"")&&(E=E.filter(k=>k.filter.replace(/(^"|"$)/g,"").startsWith(s.string.replace(/(^"|"$)/g,"")))),{from:qr.Pos(a.line,s.start),to:qr.Pos(a.line,a.ch),list:E}}));var sc=Object.defineProperty,lc=(t,r,i)=>r in t?sc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,is=(t,r,i)=>(lc(t,typeof r!="symbol"?r+"":r,i),i);const Du=Gt.createGlobalStyle`
189
189
  .cm-s-material.CodeMirror {
@@ -236,7 +236,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.i
236
236
  `;class uc extends d.Component{constructor(){super(...arguments);is(this,"editor"),is(this,"_onKeyUp",(r,i)=>{/^[a-zA-Z0-9_":]$/.test(i.key)&&this.editor.execCommand("autocomplete")}),is(this,"initEditor",r=>{this.editor=r,r.on("keyup",this._onKeyUp)}),is(this,"refreshEditor",()=>{this.editor.refresh()})}componentDidMount(){setTimeout(()=>{this.editor.refresh()},0),document.addEventListener("click",this.refreshEditor)}componentWillUnmount(){document.removeEventListener("click",this.refreshEditor)}render(){const{value:r}=this.props.fieldState,{setValue:i,setTouched:a,setError:s}=this.props.fieldApi,{onChange:p,onBlur:y,forwardedRef:S}=this.props;return d.createElement(d.Fragment,null,d.createElement(Du,null),d.createElement(La.fk,{editorDidMount:this.initEditor,value:r||"",ref:S||void 0,onBeforeChange:(w,E,k)=>{i(k),p&&p(k)},onBlur:w=>{a(),y&&y(w)},options:{mode:this.props.mode||"application/json",theme:"material",matchBrackets:!0,autoCloseBrackets:!0,tabSize:2,foldGutter:!0,extraKeys:{"Cmd-Space":()=>this.editor.showHint({completeSingle:!0}),"Ctrl-Space":()=>this.editor.showHint({completeSingle:!0})},hintOptions:{id:this.props.id,completeSingle:!1,schema:this.props.schema},lint:{id:this.props.id,schema:this.props.schema,setError:s}}}))}}const fc=pn(uc),Nu=(0,In.ZP)(Xi.A3)`
237
237
  border-radius: ${({theme:t})=>t.components.panels.borderRadius};
238
238
  margin-bottom: 10px;
239
- `;var os=o(67897),da=o(64776),kd=o(68929),Bi;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(Bi||(Bi={}));var pi;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(pi||(pi={}));var Do;(function(t){t.OCTET_STREAM="application/octet-stream",t.MULTIPART="multipart/form-data",t.URL_ENCODED="application/x-www-form-urlencoded"})(Do||(Do={}));var pa=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const Bu=Object.values(pi),cc=["application/octet-stream","application/pdf","application/gzip","application/zip"],Uu=["image/","audio/","video/"];function cr(t){if(Uu.some(r=>t.startsWith(r)))return t}function as(t){return cc.includes(t)?!0:Uu.some(r=>t.startsWith(r))}function vl(t){const r=t.type==="array"?t.items:t;if(!r||!r.type||(r==null?void 0:r.type)==="any")return!0;const i=r.contentMediaType||"",a=r.format||r.contentEncoding||(as(i)?"binary":"");return r.type===Bi.STRING&&Bu.includes(a)}function No(t,r){if(!t||!t.type||t.type==="any")return as(r);const i=t.format||t.contentEncoding||"";return t.type===Bi.STRING&&Bu.includes(i)}function Rn(t){return new Promise((r,i)=>{const a=new FileReader;a.onload=()=>{const p=a.result.replace(/data:.*\/.*;base64,/g,"");r(p)},a.onerror=()=>i(a.error),a.readAsDataURL(t)})}function ha({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(pi.BASE64)}function gl(t,r){return pa(this,null,function*(){const i=Object.values(t);let a=i.length===1?i[0]:i;return r.type===Bi.STRING&&ha(r)?a=yield Rn(i[0]):r.type===Bi.ARRAY&&r.items&&(ha(r.items)?a=yield Promise.all(i.map(p=>pa(this,null,function*(){return yield Rn(p)}))):a=i),a})}var ju=Object.defineProperty,va=Object.getOwnPropertySymbols,yl=Object.prototype.hasOwnProperty,ml=Object.prototype.propertyIsEnumerable,xl=(t,r,i)=>r in t?ju(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,dc=(t,r)=>{for(var i in r||(r={}))yl.call(r,i)&&xl(t,i,r[i]);if(va)for(var i of va(r))ml.call(r,i)&&xl(t,i,r[i]);return t},bl=(t,r)=>{var i={};for(var a in t)yl.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&va)for(var a of va(t))r.indexOf(a)<0&&ml.call(t,a)&&(i[a]=t[a]);return i},Vu=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const nr=d.forwardRef((t,r)=>{var i=bl(t,[]);const{schema:a,contentName:s,onChange:p,name:y}=i,{render:S}=Kn(dc({field:y},i)),w=E=>Vu(void 0,null,function*(){const k=yield gl(E.target.files,a);p(s,k)});return S(d.createElement("input",{"data-cy":"file-upload-input",type:"file",id:i.id,className:i.className,name:i.name,onChange:w,multiple:i.multiple,accept:i.accept,ref:r}))}),Wu=(0,Wo.Pi)(t=>{var r,i,a,s,p;const{mediaType:y,onChange:S}=t,w=(((i=(r=y.schema)==null?void 0:r.oneOf)==null?void 0:i.length)?((s=y.schema)==null?void 0:s.oneOf[(a=y.schema)==null?void 0:a.activeOneOf].fields)||[]:((p=y.schema)==null?void 0:p.fields)||[]).filter(k=>!k.schema.readOnly),E=y.schema||{};return No(E,y.name)?d.createElement(Hu,null,d.createElement(xt.NI,null,d.createElement(so,{fullWidth:!0,id:`body.${y.name}`,name:`body.${y.name}`,accept:cr(y.name),schema:E,contentName:y.name,onChange:S}))):E.type!==Bi.OBJECT&&!w?(console.warn(`Invalid schema for request body and mime type: "${y.name}"`,E),null):d.createElement(Hu,null,w.map(k=>{const $=k.schema||{},ae=y.name===Do.MULTIPART&&vl($),re=$.contentMediaType||"",le=ae?d.createElement(so,{fullWidth:!0,id:"body."+k.name,name:"body."+k.name,accept:cr(re),multiple:$.type==="array",schema:$,contentName:k.name,onChange:S}):d.createElement(hn,{fullWidth:!0,id:"body."+k.name,field:"body."+k.name,placeholder:$.description||k.name});return d.createElement(xt.NI,{key:k.name},d.createElement(xt.lX,null,k.name,":"),le)}))}),Hu=Gt.styled.div`
239
+ `;var os=o(67897),da=o(64776),kd=o(68929),Bi;(function(t){t.STRING="string",t.ARRAY="array",t.OBJECT="object"})(Bi||(Bi={}));var pi;(function(t){t.BYTE="byte",t.BASE64="base64",t.BINARY="binary"})(pi||(pi={}));var Do;(function(t){t.OCTET_STREAM="application/octet-stream",t.MULTIPART="multipart/form-data",t.URL_ENCODED="application/x-www-form-urlencoded"})(Do||(Do={}));var pa=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const Bu=Object.values(pi),cc=["application/octet-stream","application/pdf","application/gzip","application/zip"],Uu=["image/","audio/","video/"];function cr(t){if(Uu.some(r=>t.startsWith(r)))return t}function as(t){return cc.includes(t)?!0:Uu.some(r=>t.startsWith(r))}function hl(t){const r=t.type==="array"?t.items:t;if(!r||!r.type||(r==null?void 0:r.type)==="any")return!0;const i=r.contentMediaType||"",a=r.format||r.contentEncoding||(as(i)?"binary":"");return r.type===Bi.STRING&&Bu.includes(a)}function No(t,r){if(!t||!t.type||t.type==="any")return as(r);const i=t.format||t.contentEncoding||"";return t.type===Bi.STRING&&Bu.includes(i)}function Rn(t){return new Promise((r,i)=>{const a=new FileReader;a.onload=()=>{const p=a.result.replace(/data:.*\/.*;base64,/g,"");r(p)},a.onerror=()=>i(a.error),a.readAsDataURL(t)})}function ha({format:t,contentEncoding:r,contentMediaType:i}){return[t,r,i].includes(pi.BASE64)}function vl(t,r){return pa(this,null,function*(){const i=Object.values(t);let a=i.length===1?i[0]:i;return r.type===Bi.STRING&&ha(r)?a=yield Rn(i[0]):r.type===Bi.ARRAY&&r.items&&(ha(r.items)?a=yield Promise.all(i.map(p=>pa(this,null,function*(){return yield Rn(p)}))):a=i),a})}var ju=Object.defineProperty,va=Object.getOwnPropertySymbols,gl=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable,ml=(t,r,i)=>r in t?ju(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,dc=(t,r)=>{for(var i in r||(r={}))gl.call(r,i)&&ml(t,i,r[i]);if(va)for(var i of va(r))yl.call(r,i)&&ml(t,i,r[i]);return t},xl=(t,r)=>{var i={};for(var a in t)gl.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&va)for(var a of va(t))r.indexOf(a)<0&&yl.call(t,a)&&(i[a]=t[a]);return i},Vu=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const nr=d.forwardRef((t,r)=>{var i=xl(t,[]);const{schema:a,contentName:s,onChange:p,name:y}=i,{render:S}=Kn(dc({field:y},i)),w=E=>Vu(void 0,null,function*(){const k=yield vl(E.target.files,a);p(s,k)});return S(d.createElement("input",{"data-cy":"file-upload-input",type:"file",id:i.id,className:i.className,name:i.name,onChange:w,multiple:i.multiple,accept:i.accept,ref:r}))}),Wu=(0,Wo.Pi)(t=>{var r,i,a,s,p;const{mediaType:y,onChange:S}=t,w=(((i=(r=y.schema)==null?void 0:r.oneOf)==null?void 0:i.length)?((s=y.schema)==null?void 0:s.oneOf[(a=y.schema)==null?void 0:a.activeOneOf].fields)||[]:((p=y.schema)==null?void 0:p.fields)||[]).filter(k=>!k.schema.readOnly),E=y.schema||{};return No(E,y.name)?d.createElement(Hu,null,d.createElement(xt.NI,null,d.createElement(so,{fullWidth:!0,id:`body.${y.name}`,name:`body.${y.name}`,accept:cr(y.name),schema:E,contentName:y.name,onChange:S}))):E.type!==Bi.OBJECT&&!w?(console.warn(`Invalid schema for request body and mime type: "${y.name}"`,E),null):d.createElement(Hu,null,w.map(k=>{const $=k.schema||{},ae=y.name===Do.MULTIPART&&hl($),re=$.contentMediaType||"",le=ae?d.createElement(so,{fullWidth:!0,id:"body."+k.name,name:"body."+k.name,accept:cr(re),multiple:$.type==="array",schema:$,contentName:k.name,onChange:S}):d.createElement(hn,{fullWidth:!0,id:"body."+k.name,field:"body."+k.name,placeholder:$.description||k.name});return d.createElement(xt.NI,{key:k.name},d.createElement(xt.lX,null,k.name,":"),le)}))}),Hu=Gt.styled.div`
240
240
  > div {
241
241
  margin-top: 10px;
242
242
  }
@@ -244,7 +244,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.i
244
244
  ${Kl}
245
245
  ${({inputType:t})=>t==="password"?"padding-right: 40px;":""};
246
246
  ${({fullWidth:t})=>t?"width: 100%;":""}
247
- `;var pc=Object.defineProperty,ss=Object.defineProperties,hc=Object.getOwnPropertyDescriptors,pr=Object.getOwnPropertySymbols,zu=Object.prototype.hasOwnProperty,Gu=Object.prototype.propertyIsEnumerable,$u=(t,r,i)=>r in t?pc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ls=(t,r)=>{for(var i in r||(r={}))zu.call(r,i)&&$u(t,i,r[i]);if(pr)for(var i of pr(r))Gu.call(r,i)&&$u(t,i,r[i]);return t},e=(t,r)=>ss(t,hc(r)),n=(t,r)=>{var i={};for(var a in t)zu.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&pr)for(var a of pr(t))r.indexOf(a)<0&&Gu.call(t,a)&&(i[a]=t[a]);return i},u=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const l=(0,Wo.Pi)(t=>{var r=t,{properties:i={}}=r,a=n(r,["properties"]),s,p;const y=le=>{var ge;const he=a.body.content;if(!he||!he.hasSample)return"";const Se=(ge=he.active)==null?void 0:ge.examples;if(!(Se==null?void 0:Se[le]))return"";const me=Us()(Se==null?void 0:Se[le].value,i,{arrayMerge:da.QQ});return JSON.stringify(me,null,2)},S=(p=(s=a.body.content)==null?void 0:s.operation)==null?void 0:p.activeExampleName,w=le=>{var ge,he;(he=(ge=a.body.content)==null?void 0:ge.operation)==null||he.activateExampleName(le),a.console.formApi.setValue("body",y(le))},E=le=>{if(!le)return"";if(le.mime==="application/x-www-form-urlencoded")return le.value;const ge=Us()(le.value,i,{arrayMerge:da.QQ});return JSON.stringify(ge,null,2)},k=(le,ge)=>u(void 0,null,function*(){const he=a.console.formApi,{setValue:Se}=he;Se(`body.${le}`,ge)});(0,d.useEffect)(()=>{S!==!1?S&&a.console.formApi.setValue("body",y(S)):a.console.formApi.setValue("body",JSON.stringify(i,null,2))},[S]);const{validate:$,body:ae}=a,re=le=>d.createElement(Gt.DropdownOrLabel,e(ls({},le),{variant:"dark",fullWidth:!0,Label:Nu,Dropdown:Yi.Dropdown}));return d.createElement(d.Fragment,null,d.createElement(Gt.MediaTypesSwitch,{content:ae.content,renderDropdown:re},le=>{var ge;const he=le.examples||{},Se=Object.keys(he),me=le.schema,Fe=No(me||{},le.name)||le.name===Do.MULTIPART||le.name===Do.URL_ENCODED,{exampleKey:Ke}=(0,os.C6)(le.operation,he),Ue=he[Ke];return d.createElement(d.Fragment,null,Se.length&&Se.length!==1&&d.createElement(os.b_,{examples:he,onChange:w,exampleKey:Ke})||null,Fe?d.createElement(Wu,{mediaType:le,onChange:k.bind(void 0)}):d.createElement(fc,{id:"body"+a.id,field:"body",initialValue:E(Ue),schema:(((ge=a==null?void 0:a.resolvedBody)==null?void 0:ge.content[le.name])||{}).schema,mode:le.name,validate:$}))}))});var f=o(39895);const m=Gt.styled.div`
247
+ `;var pc=Object.defineProperty,ss=Object.defineProperties,hc=Object.getOwnPropertyDescriptors,pr=Object.getOwnPropertySymbols,zu=Object.prototype.hasOwnProperty,Gu=Object.prototype.propertyIsEnumerable,$u=(t,r,i)=>r in t?pc(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,ls=(t,r)=>{for(var i in r||(r={}))zu.call(r,i)&&$u(t,i,r[i]);if(pr)for(var i of pr(r))Gu.call(r,i)&&$u(t,i,r[i]);return t},e=(t,r)=>ss(t,hc(r)),n=(t,r)=>{var i={};for(var a in t)zu.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&pr)for(var a of pr(t))r.indexOf(a)<0&&Gu.call(t,a)&&(i[a]=t[a]);return i},u=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const l=(0,Wo.Pi)(t=>{var r=t,{properties:i={}}=r,a=n(r,["properties"]),s,p;const y=le=>{var ge;const he=a.body.content;if(!he||!he.hasSample)return"";const Se=(ge=he.active)==null?void 0:ge.examples;if(!(Se==null?void 0:Se[le]))return"";const me=Bs()(Se==null?void 0:Se[le].value,i,{arrayMerge:da.QQ});return JSON.stringify(me,null,2)},S=(p=(s=a.body.content)==null?void 0:s.operation)==null?void 0:p.activeExampleName,w=le=>{var ge,he;(he=(ge=a.body.content)==null?void 0:ge.operation)==null||he.activateExampleName(le),a.console.formApi.setValue("body",y(le))},E=le=>{if(!le)return"";if(le.mime==="application/x-www-form-urlencoded")return le.value;const ge=Bs()(le.value,i,{arrayMerge:da.QQ});return JSON.stringify(ge,null,2)},k=(le,ge)=>u(void 0,null,function*(){const he=a.console.formApi,{setValue:Se}=he;Se(`body.${le}`,ge)});(0,d.useEffect)(()=>{S!==!1?S&&a.console.formApi.setValue("body",y(S)):a.console.formApi.setValue("body",JSON.stringify(i,null,2))},[S]);const{validate:$,body:ae}=a,re=le=>d.createElement(Gt.DropdownOrLabel,e(ls({},le),{variant:"dark",fullWidth:!0,Label:Nu,Dropdown:Yi.Dropdown}));return d.createElement(d.Fragment,null,d.createElement(Gt.MediaTypesSwitch,{content:ae.content,renderDropdown:re},le=>{var ge;const he=le.examples||{},Se=Object.keys(he),me=le.schema,Fe=No(me||{},le.name)||le.name===Do.MULTIPART||le.name===Do.URL_ENCODED,{exampleKey:Ke}=(0,os.C6)(le.operation,he),Ue=he[Ke];return d.createElement(d.Fragment,null,Se.length&&Se.length!==1&&d.createElement(os.b_,{examples:he,onChange:w,exampleKey:Ke})||null,Fe?d.createElement(Wu,{mediaType:le,onChange:k.bind(void 0)}):d.createElement(fc,{id:"body"+a.id,field:"body",initialValue:E(Ue),schema:(((ge=a==null?void 0:a.resolvedBody)==null?void 0:ge.content[le.name])||{}).schema,mode:le.name,validate:$}))}))});var f=o(39895);const m=Gt.styled.div`
248
248
  display: flex;
249
249
  font-size: 12px;
250
250
  button {
@@ -319,7 +319,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.i
319
319
  text-align: left;
320
320
  `,kr=(0,Gt.styled)(gn.J4)`
321
321
  float: right;
322
- `;function rn(t){const{scopes:r,id:i}=t;let a=[];try{a=JSON.parse((0,zt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?d.createElement(d.Fragment,null):d.createElement(xt.NI,null,d.createElement(xt.lX,null," Scopes: "),d.createElement(xn,{field:`auth.${i}.scopes`,initialValue:a,items:r,showControls:!0,trimItemsLength:!0}))}var zr=o(17673),Nr=o(73555),Rr=Object.defineProperty,wr=Object.defineProperties,cn=Object.getOwnPropertyDescriptors,lo=Object.getOwnPropertySymbols,Ui=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,zn=(t,r,i)=>r in t?Rr(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Er=(t,r)=>{for(var i in r||(r={}))Ui.call(r,i)&&zn(t,i,r[i]);if(lo)for(var i of lo(r))Jr.call(r,i)&&zn(t,i,r[i]);return t},wl=(t,r)=>wr(t,cn(r)),Cn=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const ji="/oauth2-redirect.html";class Xr{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:a,extraParams:s={},routingBasePath:p,redirectUri:y,successCallback:S,errorCallback:w}){const E=Rd({date:new Date().toString()}),k=new URL(r),$=p==="/"?"":p,ae=`${window.location.origin}${$}${ji}`;k.searchParams.set("client_id",i),k.searchParams.set("redirect_uri",y||ae),k.searchParams.set("response_type","token"),k.searchParams.set("state",E),Array.isArray(a)&&k.searchParams.set("scope",a.join(" "));for(const re in s)k.searchParams.set(re,s[re]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:a},state:E,successCallback:re=>{S(re),Xr.clearRedirectData("implicit")},errorCallback:re=>{w(re),Xr.clearRedirectData("implicit")}},window.open(k.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:a,clientSecret:s,codeVerifier:p,codeChallenge:y,scopes:S,extraParams:w={},routingBasePath:E,redirectUri:k,successCallback:$,errorCallback:ae}){const re=new URL(r),le=E==="/"?"":E,ge=`${window.location.origin}${le}${ji}`,he=Rd({date:new Date().toString()});re.searchParams.set("client_id",a),re.searchParams.set("redirect_uri",k||ge),re.searchParams.set("response_type","code"),re.searchParams.set("state",he),Array.isArray(S)&&re.searchParams.set("scope",S.join(" ")),y&&(re.searchParams.set("code_challenge",y),re.searchParams.set("code_challenge_method","S256"));for(const Se in w)re.searchParams.set(Se,w[Se]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:a,scopes:S},state:he,successCallback:Se=>Cn(this,[Se],function*({auth_code:me}){try{const Fe=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:zr.stringify(Er(wl(Er({client_id:a,client_secret:s},p&&{code_verifier:p}),{code:me,grant_type:"authorization_code",redirect_uri:k||ge}),w))});yield uo(Fe,$,ae)}catch(Fe){ae(Fe)}Xr.clearRedirectData("authorizationCode")}),errorCallback:Se=>{ae(Se),Xr.clearRedirectData("authorizationCode")}},window.open(re.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return Cn(this,arguments,function*({tokenUrl:i,clientId:a,clientSecret:s,scopes:p=[],extraParams:y={},successCallback:S,errorCallback:w}){try{const E=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:zr.stringify(Er({client_id:a,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(p)?p.join(" "):void 0},y))});yield uo(E,S,w)}catch(E){w(E)}})}}const dn=new Xr;function uo(t,r,i){return Cn(this,null,function*(){if(t.ok){const a=yield t.json();r(a)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function us(t=32){let r="";for(;r.length<t;)r+=Math.random().toString(32).substring(2);return r.substring(0,t)}function Rd(t){const r=Er({randomStr:us()},t);return btoa(JSON.stringify(r))}function yh(t){return Cn(this,null,function*(){var r;const i=new TextEncoder().encode(t);return(r=Nr.EA)==null?void 0:r.subtle.digest("SHA-256",i)})}function mh(t){if(!!t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Md(t){return Cn(this,null,function*(){return mh(yield yh(t))})}var xh=Object.defineProperty,bh=Object.defineProperties,wh=Object.getOwnPropertyDescriptors,Ld=Object.getOwnPropertySymbols,Sh=Object.prototype.hasOwnProperty,Ah=Object.prototype.propertyIsEnumerable,vc=(t,r,i)=>r in t?xh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Dd=(t,r)=>{for(var i in r||(r={}))Sh.call(r,i)&&vc(t,i,r[i]);if(Ld)for(var i of Ld(r))Ah.call(r,i)&&vc(t,i,r[i]);return t},Nd=(t,r)=>bh(t,wh(r)),Ku=(t,r,i)=>(vc(t,typeof r!="symbol"?r+"":r,i),i),Eh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function Ch(t){if(!t)return"Token is required"}class Oh extends d.Component{constructor(){super(...arguments);Ku(this,"state",{error:"",loading:!1,tokenMasked:!0}),Ku(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,zt.WW)(`auth.${this.props.id}.token`,"")}),Ku(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),Ku(this,"requestToken",()=>Eh(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:a}=this.props,s=a&&i.tokenUrl?a+(0,Vr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const p=this.values.client_id,y=this.values.client_secret;if(!p||!y){console.log("Provide client_id and client_secret");return}this.setState({loading:!0}),yield Xr.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:p,clientSecret:y,scopes:this.values.scopes,successCallback:S=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,S),this.setState({loading:!1})},errorCallback:S=>{this.clearToken(),this.setState({error:S.message,loading:!1})}})}))}get values(){var r,i,a;return((a=(i=(r=this.props.form)==null?void 0:r.values)==null?void 0:i.auth)==null?void 0:a[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}render(){const{loading:r,error:i,tokenMasked:a}=this.state,{id:s,defaultValues:p}=this.props,y=Object.keys(this.props.flow.scopes);let S=(0,zt.YQ)(`auth.${s}.token`)||JSON.stringify(p==null?void 0:p.token);S=S?JSON.parse(S):"";const w=(0,zt.Al)(s,"client_id"),E={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),initValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),placeholder:"Your OAuth2 app Client ID"};return d.createElement(d.Fragment,null,d.createElement(xt.n5,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Client ID:"),w?d.createElement(Go,Nd(Dd({},E),{options:w})):d.createElement(hn,Nd(Dd({},E),{type:"password"}))),d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Client Secret:"),d.createElement(hn,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,zt.YQ)(`auth.${s}.client_secret`)||(p==null?void 0:p.client_secret)})),d.createElement(hn,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:S,validate:Ch}),d.createElement(rn,{id:s,scopes:y})),d.createElement(Xi.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),d.createElement(xt.ph,null," Access Token "),i?d.createElement(xt.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",d.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?d.createElement(xt.TR,null,d.createElement(xt.WA,{length:this.values.token.access_token.length,masked:a},this.values.token.access_token),d.createElement(xt.lf,{onClick:this.toggleTokenMask},a?"Show":"Hide"," "),d.createElement(xt.h,{onClick:this.clearToken}," Clear ")):d.createElement(xt.Xq,{style:{marginBottom:"1em"}},"No token"))}}const Th=Oh,Ph=Gt.styled.div`
322
+ `;function rn(t){const{scopes:r,id:i}=t;let a=[];try{a=JSON.parse((0,zt.YQ)(`auth.${i}.scopes`))}catch(s){}return!r||!r.length?d.createElement(d.Fragment,null):d.createElement(xt.NI,null,d.createElement(xt.lX,null," Scopes: "),d.createElement(xn,{field:`auth.${i}.scopes`,initialValue:a,items:r,showControls:!0,trimItemsLength:!0}))}var zr=o(17673),Nr=o(73555),Rr=Object.defineProperty,wr=Object.defineProperties,cn=Object.getOwnPropertyDescriptors,lo=Object.getOwnPropertySymbols,Ui=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,zn=(t,r,i)=>r in t?Rr(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Er=(t,r)=>{for(var i in r||(r={}))Ui.call(r,i)&&zn(t,i,r[i]);if(lo)for(var i of lo(r))Jr.call(r,i)&&zn(t,i,r[i]);return t},bl=(t,r)=>wr(t,cn(r)),Cn=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});const ji="/oauth2-redirect.html";class Xr{static authorizeImplicit({authorizationUrl:r,clientId:i,scopes:a,extraParams:s={},routingBasePath:p,redirectUri:y,successCallback:S,errorCallback:w}){const E=Rd({date:new Date().toString()}),k=new URL(r),$=p==="/"?"":p,ae=`${window.location.origin}${$}${ji}`;k.searchParams.set("client_id",i),k.searchParams.set("redirect_uri",y||ae),k.searchParams.set("response_type","token"),k.searchParams.set("state",E),Array.isArray(a)&&k.searchParams.set("scope",a.join(" "));for(const re in s)k.searchParams.set(re,s[re]);window.redirectOAuth2={flow:"implicit",data:{authorizationUrl:r,clientId:i,scopes:a},state:E,successCallback:re=>{S(re),Xr.clearRedirectData("implicit")},errorCallback:re=>{w(re),Xr.clearRedirectData("implicit")}},window.open(k.toString())}static authorizeAuthorizationCode({authorizationUrl:r,tokenUrl:i,clientId:a,clientSecret:s,codeVerifier:p,codeChallenge:y,scopes:S,extraParams:w={},routingBasePath:E,redirectUri:k,successCallback:$,errorCallback:ae}){const re=new URL(r),le=E==="/"?"":E,ge=`${window.location.origin}${le}${ji}`,he=Rd({date:new Date().toString()});re.searchParams.set("client_id",a),re.searchParams.set("redirect_uri",k||ge),re.searchParams.set("response_type","code"),re.searchParams.set("state",he),Array.isArray(S)&&re.searchParams.set("scope",S.join(" ")),y&&(re.searchParams.set("code_challenge",y),re.searchParams.set("code_challenge_method","S256"));for(const Se in w)re.searchParams.set(Se,w[Se]);window.redirectOAuth2={flow:"authorizationCode",data:{authorizationUrl:r,clientId:a,scopes:S},state:he,successCallback:Se=>Cn(this,[Se],function*({auth_code:me}){try{const Fe=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:zr.stringify(Er(bl(Er({client_id:a,client_secret:s},p&&{code_verifier:p}),{code:me,grant_type:"authorization_code",redirect_uri:k||ge}),w))});yield uo(Fe,$,ae)}catch(Fe){ae(Fe)}Xr.clearRedirectData("authorizationCode")}),errorCallback:Se=>{ae(Se),Xr.clearRedirectData("authorizationCode")}},window.open(re.toString())}static clearRedirectData(r){window.redirectOAuth2={flow:r,data:{authorizationUrl:"",clientId:"",scopes:[]},state:"",successCallback:()=>{},errorCallback:()=>{}}}static authorizeClientCredentials(r){return Cn(this,arguments,function*({tokenUrl:i,clientId:a,clientSecret:s,scopes:p=[],extraParams:y={},successCallback:S,errorCallback:w}){try{const E=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:zr.stringify(Er({client_id:a,client_secret:s,grant_type:"client_credentials",scope:Array.isArray(p)?p.join(" "):void 0},y))});yield uo(E,S,w)}catch(E){w(E)}})}}const dn=new Xr;function uo(t,r,i){return Cn(this,null,function*(){if(t.ok){const a=yield t.json();r(a)}else i(new Error((t.headers.get("Content-Type")||"").indexOf("json")>-1?JSON.stringify(yield t.json()):yield t.text()))})}function us(t=32){let r="";for(;r.length<t;)r+=Math.random().toString(32).substring(2);return r.substring(0,t)}function Rd(t){const r=Er({randomStr:us()},t);return btoa(JSON.stringify(r))}function yh(t){return Cn(this,null,function*(){var r;const i=new TextEncoder().encode(t);return(r=Nr.EA)==null?void 0:r.subtle.digest("SHA-256",i)})}function mh(t){if(!!t)return btoa(String.fromCharCode.apply(null,new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Md(t){return Cn(this,null,function*(){return mh(yield yh(t))})}var xh=Object.defineProperty,bh=Object.defineProperties,wh=Object.getOwnPropertyDescriptors,Ld=Object.getOwnPropertySymbols,Sh=Object.prototype.hasOwnProperty,Ah=Object.prototype.propertyIsEnumerable,vc=(t,r,i)=>r in t?xh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Dd=(t,r)=>{for(var i in r||(r={}))Sh.call(r,i)&&vc(t,i,r[i]);if(Ld)for(var i of Ld(r))Ah.call(r,i)&&vc(t,i,r[i]);return t},Nd=(t,r)=>bh(t,wh(r)),Ku=(t,r,i)=>(vc(t,typeof r!="symbol"?r+"":r,i),i),Eh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function Ch(t){if(!t)return"Token is required"}class Oh extends d.Component{constructor(){super(...arguments);Ku(this,"state",{error:"",loading:!1,tokenMasked:!0}),Ku(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,""),(0,zt.WW)(`auth.${this.props.id}.token`,"")}),Ku(this,"toggleTokenMask",()=>{this.setState({tokenMasked:!this.state.tokenMasked})}),Ku(this,"requestToken",()=>Eh(this,null,function*(){if(this.state.loading)return;const{server:r,flow:i,authCorsProxyUrl:a}=this.props,s=a&&i.tokenUrl?a+(0,Vr.jg)(i.tokenUrl):i.tokenUrl;if(this.errors.client_id||this.errors.client_secret){console.log("Provide client_id and client_secret");return}const p=this.values.client_id,y=this.values.client_secret;if(!p||!y){console.log("Provide client_id and client_secret");return}this.setState({loading:!0}),yield Xr.authorizeClientCredentials({tokenUrl:s.startsWith("http")?s:r+s,clientId:p,clientSecret:y,scopes:this.values.scopes,successCallback:S=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,S),this.setState({loading:!1})},errorCallback:S=>{this.clearToken(),this.setState({error:S.message,loading:!1})}})}))}get values(){var r,i,a;return((a=(i=(r=this.props.form)==null?void 0:r.values)==null?void 0:i.auth)==null?void 0:a[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}render(){const{loading:r,error:i,tokenMasked:a}=this.state,{id:s,defaultValues:p}=this.props,y=Object.keys(this.props.flow.scopes);let S=(0,zt.YQ)(`auth.${s}.token`)||JSON.stringify(p==null?void 0:p.token);S=S?JSON.parse(S):"";const w=(0,zt.Al)(s,"client_id"),E={field:`auth.${s}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),initValue:(0,zt.YQ)(`auth.${s}.client_id`)||this.props.clientId||(p==null?void 0:p.client_id),placeholder:"Your OAuth2 app Client ID"};return d.createElement(d.Fragment,null,d.createElement(xt.n5,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Client ID:"),w?d.createElement(Go,Nd(Dd({},E),{options:w})):d.createElement(hn,Nd(Dd({},E),{type:"password"}))),d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Client Secret:"),d.createElement(hn,{type:"password",fullWidth:!0,field:`auth.${s}.client_secret`,initialValue:(0,zt.YQ)(`auth.${s}.client_secret`)||(p==null?void 0:p.client_secret)})),d.createElement(hn,{fullWidth:!0,field:`auth.${s}.token`,type:"hidden",initialValue:S,validate:Ch}),d.createElement(rn,{id:s,scopes:y})),d.createElement(Xi.zx,{color:"primary",onClick:this.requestToken,blinking:r},r?"Loading...":"Request Token"),d.createElement(xt.ph,null," Access Token "),i?d.createElement(xt.Xq,{style:{marginBottom:"1em"}},"Failed to request token: ",d.createElement("pre",null,i)," "):this.values.token&&this.values.token.access_token?d.createElement(xt.TR,null,d.createElement(xt.WA,{length:this.values.token.access_token.length,masked:a},this.values.token.access_token),d.createElement(xt.lf,{onClick:this.toggleTokenMask},a?"Show":"Hide"," "),d.createElement(xt.h,{onClick:this.clearToken}," Clear ")):d.createElement(xt.Xq,{style:{marginBottom:"1em"}},"No token"))}}const Th=Oh,Ph=Gt.styled.div`
323
323
  position: relative;
324
324
  height: 4px;
325
325
  display: block;
@@ -421,7 +421,7 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.i
421
421
  right: -8%;
422
422
  }
423
423
  }
424
- `,Bd=()=>d.createElement(Ph,null,d.createElement("div",{className:"indeterminate"}));var Ih=Object.defineProperty,Fh=Object.defineProperties,kh=Object.getOwnPropertyDescriptors,Ud=Object.getOwnPropertySymbols,Rh=Object.prototype.hasOwnProperty,Mh=Object.prototype.propertyIsEnumerable,gc=(t,r,i)=>r in t?Ih(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Yu=(t,r)=>{for(var i in r||(r={}))Rh.call(r,i)&&gc(t,i,r[i]);if(Ud)for(var i of Ud(r))Mh.call(r,i)&&gc(t,i,r[i]);return t},yc=(t,r)=>Fh(t,kh(r)),Sl=(t,r,i)=>(gc(t,typeof r!="symbol"?r+"":r,i),i),Lh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function jd(t){if(!t)return"Field is required"}class Ju extends d.Component{constructor(){super(...arguments);Sl(this,"state",{error:null,loading:!1,showPkceOptions:!1}),Sl(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,"")}),Sl(this,"togglePkceOptions",()=>{this.setState(({showPkceOptions:r})=>({showPkceOptions:!r}))}),Sl(this,"handleCodeVerifierChange",r=>Lh(this,[r],function*({target:{value:i}}){const a=yield Md(i);this.setState({codeVerifier:i,validCodeChallenge:a})}))}get values(){var r,i;return((i=(r=this.props.form.values)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get pkceInputActionButtonProps(){if(this.state.codeVerifier!==void 0&&this.state.codeChallenge!==this.state.validCodeChallenge)return{label:"sync",onClick:()=>{this.state.codeVerifier&&this.setState({codeChallenge:this.state.validCodeChallenge})}}}componentDidMount(){if(this.props.usePkce){const r=us(43);Md(r).then(i=>{this.setState({codeVerifier:r,codeChallenge:i,validCodeChallenge:i})})}}handleAuthorize(r){if(!r)return;this.props.formApi.validate();const{flow:i,usePkce:a,id:s,tokenUrl:p,authCorsProxyUrl:y}=this.props;if(!(0,da.Qr)(this.errors))return;this.setState({loading:!0,error:null});const S=y?y+(0,Vr.jg)(r):r,w=y&&p?y+(0,Vr.jg)(p):p,E=this.props.formApi.getValue(`auth.${s}.scopes`),k={authorizationUrl:S.startsWith("http")?S:this.props.server+S,clientId:this.values.client_id,scopes:E,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:$=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,$),this.setState({loading:!1,error:null})},errorCallback:$=>{this.setState({loading:!1,error:($==null?void 0:$.message)||"Failed to retrieve the access token"})}};i==="implicit"&&Xr.authorizeImplicit(k),i==="authorizationCode"&&Xr.authorizeAuthorizationCode(Yu(yc(Yu({},k),{tokenUrl:(w==null?void 0:w.startsWith("http"))?w:this.props.server+w,clientSecret:this.values.client_secret}),a&&{codeVerifier:this.state.codeVerifier,codeChallenge:this.state.codeChallenge}))}handleLogout(){this.clearToken(),this.setState({error:null})}handleCancel(){this.setState({loading:!1,error:null}),Xr.clearRedirectData(this.props.flow)}render(){const{error:r,loading:i}=this.state,{id:a,scopes:s,authorizationUrl:p,flow:y,usePkce:S,defaultValues:w}=this.props;if(!p)return d.createElement(xt.Xq,null,"No flow info");let E=(0,zt.YQ)(`auth.${a}.token`)||JSON.stringify(w==null?void 0:w.token);E=E?JSON.parse(E):"";const k=(0,zt.Al)(a,"client_id"),$={field:`auth.${a}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),initValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),placeholder:"Your OAuth2 app Client ID",validate:jd,validateOnBlur:!0,validateOnChange:!0};return d.createElement("div",null,d.createElement(xt.n5,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null," Client ID: "),k?d.createElement(Go,yc(Yu({},$),{options:k})):d.createElement(hn,yc(Yu({},$),{"data-cy":"client-id-input"}))),y==="authorizationCode"&&d.createElement(d.Fragment,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Client Secret:"),d.createElement(hn,{type:"password",fullWidth:!0,field:`auth.${a}.client_secret`,initialValue:(0,zt.YQ)(`auth.${a}.client_secret`)||(w==null?void 0:w.client_secret),validate:jd,validateOnBlur:!0,validateOnChange:!0,"data-cy":"client-secret-input"})),S&&d.createElement(Bh,null,d.createElement(Pt,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:this.state.showPkceOptions,onChange:this.togglePkceOptions,"data-cy":"pkce-options-toggle"}),this.state.showPkceOptions&&d.createElement(Uh,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Code Verifier"),d.createElement(zo,{fullWidth:!0,value:this.state.codeVerifier,onChange:this.handleCodeVerifierChange,"data-cy":"code-verifier-input"})),d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Code Challenge"),d.createElement(zo,{fullWidth:!0,value:this.state.codeChallenge,onChange:({target:{value:ae}})=>{this.setState({codeChallenge:ae})},inputActionButton:this.pkceInputActionButtonProps,"data-cy":"code-challenge-input"}))))),d.createElement(hn,{fullWidth:!0,field:`auth.${a}.token`,type:"hidden",initialValue:E}),d.createElement(rn,{id:a,scopes:s}),this.values.token&&this.values.token.access_token?d.createElement(xt.NI,null,d.createElement(xt.lX,null," Access Token: "),d.createElement(zo,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),d.createElement(Nh,null,this.values.token&&this.values.token.access_token?d.createElement(Xi.zx,{fullWidth:!0,onClick:()=>{this.handleLogout()}},"Log out"):i?d.createElement(d.Fragment,null,d.createElement(Xi.zx,{fullWidth:!0,onClick:()=>{this.handleCancel()}},"Cancel"),d.createElement(Bd,null)):d.createElement(Xi.zx,{fullWidth:!0,disabled:!(0,da.Qr)(this.errors),onClick:()=>{this.handleAuthorize(p)}},"Authorize")),i||r||!this.values.token||!this.values.token.access_token&&d.createElement(xt.n5,null,d.createElement(xt.NI,null,i?d.createElement(xt.GE,null,"Please, finish your authorization flow or cancel authorization."):r?d.createElement(d.Fragment,null,d.createElement(Dh,null,d.createElement(xt.Xq,null,r))):!this.values.token||!this.values.token.access_token?d.createElement(xt.GE,null," No Access Token. Please, Authorize. "):null)))}}Sl(Ju,"contextType",Gt.OptionsContext);const Dh=Gt.styled.div`
424
+ `,Bd=()=>d.createElement(Ph,null,d.createElement("div",{className:"indeterminate"}));var Ih=Object.defineProperty,Fh=Object.defineProperties,kh=Object.getOwnPropertyDescriptors,Ud=Object.getOwnPropertySymbols,Rh=Object.prototype.hasOwnProperty,Mh=Object.prototype.propertyIsEnumerable,gc=(t,r,i)=>r in t?Ih(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,Yu=(t,r)=>{for(var i in r||(r={}))Rh.call(r,i)&&gc(t,i,r[i]);if(Ud)for(var i of Ud(r))Mh.call(r,i)&&gc(t,i,r[i]);return t},yc=(t,r)=>Fh(t,kh(r)),wl=(t,r,i)=>(gc(t,typeof r!="symbol"?r+"":r,i),i),Lh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function jd(t){if(!t)return"Field is required"}class Ju extends d.Component{constructor(){super(...arguments);wl(this,"state",{error:null,loading:!1,showPkceOptions:!1}),wl(this,"clearToken",()=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,"")}),wl(this,"togglePkceOptions",()=>{this.setState(({showPkceOptions:r})=>({showPkceOptions:!r}))}),wl(this,"handleCodeVerifierChange",r=>Lh(this,[r],function*({target:{value:i}}){const a=yield Md(i);this.setState({codeVerifier:i,validCodeChallenge:a})}))}get values(){var r,i;return((i=(r=this.props.form.values)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get errors(){var r,i;return((i=(r=this.props.form.errors)==null?void 0:r.auth)==null?void 0:i[this.props.id])||{}}get pkceInputActionButtonProps(){if(this.state.codeVerifier!==void 0&&this.state.codeChallenge!==this.state.validCodeChallenge)return{label:"sync",onClick:()=>{this.state.codeVerifier&&this.setState({codeChallenge:this.state.validCodeChallenge})}}}componentDidMount(){if(this.props.usePkce){const r=us(43);Md(r).then(i=>{this.setState({codeVerifier:r,codeChallenge:i,validCodeChallenge:i})})}}handleAuthorize(r){if(!r)return;this.props.formApi.validate();const{flow:i,usePkce:a,id:s,tokenUrl:p,authCorsProxyUrl:y}=this.props;if(!(0,da.Qr)(this.errors))return;this.setState({loading:!0,error:null});const S=y?y+(0,Vr.jg)(r):r,w=y&&p?y+(0,Vr.jg)(p):p,E=this.props.formApi.getValue(`auth.${s}.scopes`),k={authorizationUrl:S.startsWith("http")?S:this.props.server+S,clientId:this.values.client_id,scopes:E,redirectUri:this.context.oAuth2RedirectURI,routingBasePath:this.context.routingBasePath,successCallback:$=>{this.props.formApi.setValue(`auth.${this.props.id}.token`,$),this.setState({loading:!1,error:null})},errorCallback:$=>{this.setState({loading:!1,error:($==null?void 0:$.message)||"Failed to retrieve the access token"})}};i==="implicit"&&Xr.authorizeImplicit(k),i==="authorizationCode"&&Xr.authorizeAuthorizationCode(Yu(yc(Yu({},k),{tokenUrl:(w==null?void 0:w.startsWith("http"))?w:this.props.server+w,clientSecret:this.values.client_secret}),a&&{codeVerifier:this.state.codeVerifier,codeChallenge:this.state.codeChallenge}))}handleLogout(){this.clearToken(),this.setState({error:null})}handleCancel(){this.setState({loading:!1,error:null}),Xr.clearRedirectData(this.props.flow)}render(){const{error:r,loading:i}=this.state,{id:a,scopes:s,authorizationUrl:p,flow:y,usePkce:S,defaultValues:w}=this.props;if(!p)return d.createElement(xt.Xq,null,"No flow info");let E=(0,zt.YQ)(`auth.${a}.token`)||JSON.stringify(w==null?void 0:w.token);E=E?JSON.parse(E):"";const k=(0,zt.Al)(a,"client_id"),$={field:`auth.${a}.client_id`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),initValue:(0,zt.YQ)(`auth.${a}.client_id`)||this.props.clientId||(w==null?void 0:w.client_id),placeholder:"Your OAuth2 app Client ID",validate:jd,validateOnBlur:!0,validateOnChange:!0};return d.createElement("div",null,d.createElement(xt.n5,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null," Client ID: "),k?d.createElement(Go,yc(Yu({},$),{options:k})):d.createElement(hn,yc(Yu({},$),{"data-cy":"client-id-input"}))),y==="authorizationCode"&&d.createElement(d.Fragment,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Client Secret:"),d.createElement(hn,{type:"password",fullWidth:!0,field:`auth.${a}.client_secret`,initialValue:(0,zt.YQ)(`auth.${a}.client_secret`)||(w==null?void 0:w.client_secret),validate:jd,validateOnBlur:!0,validateOnChange:!0,"data-cy":"client-secret-input"})),S&&d.createElement(Bh,null,d.createElement(Pt,{id:"pkce-opitons-toggle",label:"Configure PKCE manually",checked:this.state.showPkceOptions,onChange:this.togglePkceOptions,"data-cy":"pkce-options-toggle"}),this.state.showPkceOptions&&d.createElement(Uh,null,d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Code Verifier"),d.createElement(zo,{fullWidth:!0,value:this.state.codeVerifier,onChange:this.handleCodeVerifierChange,"data-cy":"code-verifier-input"})),d.createElement(xt.NI,null,d.createElement(xt.lX,null,"Code Challenge"),d.createElement(zo,{fullWidth:!0,value:this.state.codeChallenge,onChange:({target:{value:ae}})=>{this.setState({codeChallenge:ae})},inputActionButton:this.pkceInputActionButtonProps,"data-cy":"code-challenge-input"}))))),d.createElement(hn,{fullWidth:!0,field:`auth.${a}.token`,type:"hidden",initialValue:E}),d.createElement(rn,{id:a,scopes:s}),this.values.token&&this.values.token.access_token?d.createElement(xt.NI,null,d.createElement(xt.lX,null," Access Token: "),d.createElement(zo,{disabled:!0,type:"password",fullWidth:!0,value:this.values.token.access_token})):null),d.createElement(Nh,null,this.values.token&&this.values.token.access_token?d.createElement(Xi.zx,{fullWidth:!0,onClick:()=>{this.handleLogout()}},"Log out"):i?d.createElement(d.Fragment,null,d.createElement(Xi.zx,{fullWidth:!0,onClick:()=>{this.handleCancel()}},"Cancel"),d.createElement(Bd,null)):d.createElement(Xi.zx,{fullWidth:!0,disabled:!(0,da.Qr)(this.errors),onClick:()=>{this.handleAuthorize(p)}},"Authorize")),i||r||!this.values.token||!this.values.token.access_token&&d.createElement(xt.n5,null,d.createElement(xt.NI,null,i?d.createElement(xt.GE,null,"Please, finish your authorization flow or cancel authorization."):r?d.createElement(d.Fragment,null,d.createElement(Dh,null,d.createElement(xt.Xq,null,r))):!this.values.token||!this.values.token.access_token?d.createElement(xt.GE,null," No Access Token. Please, Authorize. "):null)))}}wl(Ju,"contextType",Gt.OptionsContext);const Dh=Gt.styled.div`
425
425
  font-family: monospace;
426
426
  margin-top: 10px;
427
427
  line-height: 1;
@@ -436,19 +436,19 @@ $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bu(t){return t.i
436
436
  `;var jh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function Vh(t){return jh(this,null,function*(){return(yield fetch(t)).json()})}var Wh=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function Hh(t){var r;const{scheme:i,defaultValues:a}=t,[s,p]=d.useState({}),[y,S]=d.useState(),[w,E]=d.useState(!1);d.useEffect(()=>{k(i.openIdConnectUrl)},[i.openIdConnectUrl]);const k=$=>Wh(this,null,function*(){E(!0),S("");try{const ae=yield Vh($);p(ae)}catch(ae){S(ae.message)}E(!1)});return d.createElement("div",null,w?d.createElement("div",null,d.createElement("div",null,"Fetching OpenID Connect metadata..."),d.createElement(Bd,null)):d.createElement("div",null,y?d.createElement(xt.Xq,null,y):((r=s==null?void 0:s.response_types_supported)==null?void 0:r.includes("token"))?d.createElement(d.Fragment,null,d.createElement(zh,null,"OAuth2 Implicit Flow"),d.createElement(Ju,{key:t.id,authorizationUrl:s.authorization_endpoint,authCorsProxyUrl:t.authCorsProxyUrl,scopes:s.scopes_supported,server:t.server,id:t.id,form:t.form,formApi:t.formApi,clientId:t.clientId,flow:"implicit",defaultValues:a})):d.createElement("div",null,"Unsupported flow")))}const zh=Gt.styled.div`
437
437
  margin-top: 5px;
438
438
  margin-bottom: 10px;
439
- `;var Al=o(51027),Gh=Object.defineProperty,$h=Object.defineProperties,Kh=Object.getOwnPropertyDescriptors,Vd=Object.getOwnPropertySymbols,Yh=Object.prototype.hasOwnProperty,Jh=Object.prototype.propertyIsEnumerable,mc=(t,r,i)=>r in t?Gh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,fs=(t,r)=>{for(var i in r||(r={}))Yh.call(r,i)&&mc(t,i,r[i]);if(Vd)for(var i of Vd(r))Jh.call(r,i)&&mc(t,i,r[i]);return t},El=(t,r)=>$h(t,Kh(r)),Wd=(t,r,i)=>(mc(t,typeof r!="symbol"?r+"":r,i),i);function cs(t){if(!t)return"Field is required"}const Xh=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function Hd(t){if(t.in==="cookie")return Xh(t.name)}class Qh extends d.Component{constructor(){super(...arguments);Wd(this,"state",{activeScheme:0}),Wd(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,zt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const a=r.operation.security.map(y=>y.schemes.map(S=>S.id).join(" and ")),s=(0,zt.YQ)("securityRequirementName"),p=a.findIndex(y=>y===s);return{activeScheme:p<0?0:p}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,a=this.props.operation.security,p=a.map(y=>y.schemes.map(S=>S.id).join(" and ")).map((y,S)=>({value:y,idx:S}));return p.length===0?null:d.createElement(d.Fragment,null,d.createElement(xt.n5,null,p.length>1&&d.createElement(xt.NI,null,d.createElement(xt.lX,null," Security scheme: "),d.createElement(Yi.Dropdown,{variant:"dark",fullWidth:!0,options:p,value:p[i].value,onChange:this.handleSchemeChange}))||null,a[i].schemes.map(y=>{var S,w,E,k,$,ae,re;const le=(0,zt.A8)(y.id);if(y.type==="apiKey"){const ge=(0,zt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:Hd(y)||(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:Hd(y)||(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:cs,validateOnBlur:!0,validateOnChange:!0};return d.createElement(xt.NI,{key:le},d.createElement(xt.lX,null," ",y.name,": "),ge?d.createElement(Go,El(fs({},he),{options:ge})):d.createElement(hn,El(fs({},he),{type:"password","data-cy":"apiKey-auth-password"})))}else if(y.type==="http"){if(y.scheme==="basic"){const ge=(0,zt.Al)(le,"username"),he={field:`auth.${le}.username`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${le}.username`)||((S=r==null?void 0:r[le])==null?void 0:S.username),initValue:(0,zt.YQ)(`auth.${le}.username`)||((w=r==null?void 0:r[le])==null?void 0:w.username),validate:cs,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:le},d.createElement(xt.NI,null,d.createElement(xt.lX,null," ",(0,Al.l)("tryItAuthBasicUsername"),": "),ge?d.createElement(Go,El(fs({},he),{options:ge})):d.createElement(hn,fs({},he))),d.createElement(xt.NI,null,d.createElement(xt.lX,null," ",(0,Al.l)("tryItAuthBasicPassword"),": "),d.createElement(hn,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${le}.password`,validate:cs,initialValue:(0,zt.YQ)(`auth.${le}.password`)||((E=r==null?void 0:r[le])==null?void 0:E.password),validateOnBlur:!0,validateOnChange:!0})))}else if(y.scheme==="bearer"){const ge=(0,zt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:cs,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:le},d.createElement(xt.NI,null,d.createElement(xt.lX,null," Bearer Token: "),ge?d.createElement(Go,El(fs({},he),{options:ge})):d.createElement(hn,El(fs({},he),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(y.type==="oauth2"&&y.flows&&y.flows.clientCredentials)return d.createElement(Th,{key:le,flow:y.flows.clientCredentials,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.clientCredentials["x-defaultClientId"]||y["x-defaultClientId"],defaultValues:r==null?void 0:r[le]});if(y.type==="oauth2"&&y.flows&&y.flows.implicit)return d.createElement(Ju,{key:le,authorizationUrl:y.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys((($=(k=y==null?void 0:y.flows)==null?void 0:k.implicit)==null?void 0:$.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.implicit["x-defaultClientId"]||y["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[le]});if(y.type==="oauth2"&&y.flows&&y.flows.authorizationCode)return d.createElement(Ju,{key:le,authorizationUrl:y.flows.authorizationCode.authorizationUrl,tokenUrl:y.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((ae=y.flows.authorizationCode)==null?void 0:ae.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.authorizationCode["x-defaultClientId"]||y["x-defaultClientId"],flow:"authorizationCode",usePkce:y.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[le]});if(y.type==="oauth2"){let ge=(0,zt.YQ)(`auth.${le}.token`)||JSON.stringify((re=r==null?void 0:r[le])==null?void 0:re.token);return ge=ge?JSON.parse(ge):{},d.createElement(d.Fragment,{key:le},d.createElement(xt.NI,null,d.createElement(xt.lX,null," Access Token Type: "),d.createElement(hn,{fullWidth:!0,field:`auth.${le}.token.token_type`,initialValue:ge.token_type||"Bearer"})),d.createElement(xt.NI,null,d.createElement(xt.lX,null," Access Token: "),d.createElement(hn,{type:"password",fullWidth:!0,field:`auth.${le}.token.access_token`,validate:cs,initialValue:ge.access_token,validateOnBlur:!0,validateOnChange:!0})))}else if(y.type==="openIdConnect")return d.createElement(Hh,{key:le,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,scheme:y,clientId:y["x-defaultClientId"],defaultValues:r==null?void 0:r[le]})}})),d.createElement("small",null,d.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var zd=o(11429),Gd=o(89356),Xu=o(63263),Zh=o(30699),xc=o(58377),$d=o(28834),Kd=o(13038),_h=o(32752),bc=o(44341);function Yd(t,r,i){return r in t?bc(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function Jd(t,r){var i=Gd(t);if(Xu){var a=Xu(t);r&&(a=Zh(a).call(a,function(s){return xc(t,s).enumerable})),i.push.apply(i,a)}return i}function Cr(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var a;$d(a=Jd(Object(i),!0)).call(a,function(p){Yd(t,p,i[p])})}else if(Kd)_h(t,Kd(i));else{var s;$d(s=Jd(Object(i))).call(s,function(p){bc(t,p,xc(i,p))})}}return t}var qh=o(28583),Qu=o.n(qh),ev=o(10240),Xd=o.n(ev),Bo=o(8575),ga=o(51446),wc=o(19996),Sc=o(78363),tv=o(95238),Qd=o(53592);function Ac(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function Ec(t,r){var i;if(!!t){if(typeof t=="string")return Ac(t,r);var a=tv(i=Object.prototype.toString.call(t)).call(i,8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Qd(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ac(t,r)}}function ya(t,r){var i=typeof ga!="undefined"&&wc(t)||t["@@iterator"];if(!i){if(Sc(t)||(i=Ec(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(E){throw E},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
439
+ `;var Sl=o(51027),Gh=Object.defineProperty,$h=Object.defineProperties,Kh=Object.getOwnPropertyDescriptors,Vd=Object.getOwnPropertySymbols,Yh=Object.prototype.hasOwnProperty,Jh=Object.prototype.propertyIsEnumerable,mc=(t,r,i)=>r in t?Gh(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,fs=(t,r)=>{for(var i in r||(r={}))Yh.call(r,i)&&mc(t,i,r[i]);if(Vd)for(var i of Vd(r))Jh.call(r,i)&&mc(t,i,r[i]);return t},Al=(t,r)=>$h(t,Kh(r)),Wd=(t,r,i)=>(mc(t,typeof r!="symbol"?r+"":r,i),i);function El(t){if(!t)return"Field is required"}const Xh=function(t){const r=document.cookie.match("\\b"+t+"=([^;]*)\\b");return r?r[1]:void 0};function Hd(t){if(t.in==="cookie")return Xh(t.name)}class Qh extends d.Component{constructor(){super(...arguments);Wd(this,"state",{activeScheme:0}),Wd(this,"handleSchemeChange",r=>{this.setState({activeScheme:r.idx}),(0,zt.WW)("securityRequirementName",r.value)})}static getDerivedStateFromProps(r){const a=r.operation.security.map(y=>y.schemes.map(S=>S.id).join(" and ")),s=(0,zt.YQ)("securityRequirementName"),p=a.findIndex(y=>y===s);return{activeScheme:p<0?0:p}}render(){const{securityDefaults:r}=this.props,{activeScheme:i}=this.state,a=this.props.operation.security,p=a.map(y=>y.schemes.map(S=>S.id).join(" and ")).map((y,S)=>({value:y,idx:S}));return p.length===0?null:d.createElement(d.Fragment,null,d.createElement(xt.n5,null,p.length>1&&d.createElement(xt.NI,null,d.createElement(xt.lX,null," Security scheme: "),d.createElement(Yi.Dropdown,{variant:"dark",fullWidth:!0,options:p,value:p[i].value,onChange:this.handleSchemeChange}))||null,a[i].schemes.map(y=>{var S,w,E,k,$,ae,re;const le=(0,zt.A8)(y.id);if(y.type==="apiKey"){const ge=(0,zt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:Hd(y)||(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:Hd(y)||(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:El,validateOnBlur:!0,validateOnChange:!0};return d.createElement(xt.NI,{key:le},d.createElement(xt.lX,null," ",y.name,": "),ge?d.createElement(Go,Al(fs({},he),{options:ge})):d.createElement(hn,Al(fs({},he),{type:"password","data-cy":"apiKey-auth-password"})))}else if(y.type==="http"){if(y.scheme==="basic"){const ge=(0,zt.Al)(le,"username"),he={field:`auth.${le}.username`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${le}.username`)||((S=r==null?void 0:r[le])==null?void 0:S.username),initValue:(0,zt.YQ)(`auth.${le}.username`)||((w=r==null?void 0:r[le])==null?void 0:w.username),validate:El,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:le},d.createElement(xt.NI,null,d.createElement(xt.lX,null," ",(0,Sl.l)("tryItAuthBasicUsername"),": "),ge?d.createElement(Go,Al(fs({},he),{options:ge})):d.createElement(hn,fs({},he))),d.createElement(xt.NI,null,d.createElement(xt.lX,null," ",(0,Sl.l)("tryItAuthBasicPassword"),": "),d.createElement(hn,{type:"password","data-cy":"http-auth-password",fullWidth:!0,field:`auth.${le}.password`,initialValue:(0,zt.YQ)(`auth.${le}.password`)||((E=r==null?void 0:r[le])==null?void 0:E.password)||"",validateOnBlur:!0,validateOnChange:!0})))}else if(y.scheme==="bearer"){const ge=(0,zt.Al)(le,""),he={field:`auth.${le}`,fullWidth:!0,initialValue:(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),initValue:(0,zt.YQ)(`auth.${le}`)||(r==null?void 0:r[le]),validate:El,validateOnBlur:!0,validateOnChange:!0};return d.createElement(d.Fragment,{key:le},d.createElement(xt.NI,null,d.createElement(xt.lX,null," Bearer Token: "),ge?d.createElement(Go,Al(fs({},he),{options:ge})):d.createElement(hn,Al(fs({},he),{type:"password",placeholder:"(without 'Bearer')"}))))}}else{if(y.type==="oauth2"&&y.flows&&y.flows.clientCredentials)return d.createElement(Th,{key:le,flow:y.flows.clientCredentials,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.clientCredentials["x-defaultClientId"]||y["x-defaultClientId"],defaultValues:r==null?void 0:r[le]});if(y.type==="oauth2"&&y.flows&&y.flows.implicit)return d.createElement(Ju,{key:le,authorizationUrl:y.flows.implicit.authorizationUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys((($=(k=y==null?void 0:y.flows)==null?void 0:k.implicit)==null?void 0:$.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.implicit["x-defaultClientId"]||y["x-defaultClientId"],flow:"implicit",defaultValues:r==null?void 0:r[le]});if(y.type==="oauth2"&&y.flows&&y.flows.authorizationCode)return d.createElement(Ju,{key:le,authorizationUrl:y.flows.authorizationCode.authorizationUrl,tokenUrl:y.flows.authorizationCode.tokenUrl,authCorsProxyUrl:this.props.authCorsProxyUrl,scopes:Object.keys(((ae=y.flows.authorizationCode)==null?void 0:ae.scopes)||{}),server:this.props.activeServer,id:le,form:this.props.form,formApi:this.props.formApi,clientId:y.flows.authorizationCode["x-defaultClientId"]||y["x-defaultClientId"],flow:"authorizationCode",usePkce:y.flows.authorizationCode["x-usePkce"],defaultValues:r==null?void 0:r[le]});if(y.type==="oauth2"){let ge=(0,zt.YQ)(`auth.${le}.token`)||JSON.stringify((re=r==null?void 0:r[le])==null?void 0:re.token);return ge=ge?JSON.parse(ge):{},d.createElement(d.Fragment,{key:le},d.createElement(xt.NI,null,d.createElement(xt.lX,null," Access Token Type: "),d.createElement(hn,{fullWidth:!0,field:`auth.${le}.token.token_type`,initialValue:ge.token_type||"Bearer"})),d.createElement(xt.NI,null,d.createElement(xt.lX,null," Access Token: "),d.createElement(hn,{type:"password",fullWidth:!0,field:`auth.${le}.token.access_token`,validate:El,initialValue:ge.access_token,validateOnBlur:!0,validateOnChange:!0})))}else if(y.type==="openIdConnect")return d.createElement(Hh,{key:le,server:this.props.activeServer,authCorsProxyUrl:this.props.authCorsProxyUrl,id:le,form:this.props.form,formApi:this.props.formApi,scheme:y,clientId:y["x-defaultClientId"],defaultValues:r==null?void 0:r[le]})}})),d.createElement("small",null,d.createElement("strong",null,"Note"),": Your credentials will be saved until the end of the browser session"))}}var zd=o(11429),Gd=o(89356),Xu=o(63263),Zh=o(30699),xc=o(58377),$d=o(28834),Kd=o(13038),_h=o(32752),bc=o(44341);function Yd(t,r,i){return r in t?bc(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}function Jd(t,r){var i=Gd(t);if(Xu){var a=Xu(t);r&&(a=Zh(a).call(a,function(s){return xc(t,s).enumerable})),i.push.apply(i,a)}return i}function Cr(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){var a;$d(a=Jd(Object(i),!0)).call(a,function(p){Yd(t,p,i[p])})}else if(Kd)_h(t,Kd(i));else{var s;$d(s=Jd(Object(i))).call(s,function(p){bc(t,p,xc(i,p))})}}return t}var qh=o(28583),Qu=o.n(qh),ev=o(10240),Xd=o.n(ev),Bo=o(8575),ga=o(51446),wc=o(19996),Sc=o(78363),tv=o(95238),Qd=o(53592);function Ac(t,r){(r==null||r>t.length)&&(r=t.length);for(var i=0,a=new Array(r);i<r;i++)a[i]=t[i];return a}function Ec(t,r){var i;if(!!t){if(typeof t=="string")return Ac(t,r);var a=tv(i=Object.prototype.toString.call(t)).call(i,8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Qd(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ac(t,r)}}function ya(t,r){var i=typeof ga!="undefined"&&wc(t)||t["@@iterator"];if(!i){if(Sc(t)||(i=Ec(t))||r&&t&&typeof t.length=="number"){i&&(t=i);var a=0,s=function(){};return{s,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(E){throw E},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
440
440
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var p=!0,y=!1,S;return{s:function(){i=i.call(t)},n:function(){var E=i.next();return p=E.done,E},e:function(E){y=!0,S=E},f:function(){try{!p&&i.return!=null&&i.return()}finally{if(y)throw S}}}}var rv=o(23882);function hr(t){return typeof ga=="function"&&typeof rv=="symbol"?hr=function(i){return typeof i}:hr=function(i){return i&&typeof ga=="function"&&i.constructor===ga&&i!==ga.prototype?"symbol":typeof i},hr(t)}function nv(t){if(Sc(t))return t}function iv(t,r){var i=t&&(typeof ga!="undefined"&&wc(t)||t["@@iterator"]);if(i!=null){var a=[],s=!0,p=!1,y,S;try{for(i=i.call(t);!(s=(y=i.next()).done)&&(a.push(y.value),!(r&&a.length===r));s=!0);}catch(w){p=!0,S=w}finally{try{!s&&i.return!=null&&i.return()}finally{if(p)throw S}}return a}}function ov(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
441
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hi(t,r){return nv(t)||iv(t,r)||Ec(t,r)||ov()}var Zd=o(69798);function _d(t,r,i,a,s,p,y){try{var S=t[p](y),w=S.value}catch(E){i(E);return}S.done?r(w):Zd.resolve(w).then(a,s)}function Cc(t){return function(){var r=this,i=arguments;return new Zd(function(a,s){var p=t.apply(r,i);function y(w){_d(p,a,s,y,S,"next",w)}function S(w){_d(p,a,s,y,S,"throw",w)}y(void 0)})}}var av=o(63109),Vi=o.n(av),sv=o(78580),Oc=o.n(sv),lv=o(72119),qd=o.n(lv),uv=o(66419),fv=o.n(uv),cv=o(59340),Zu=o.n(cv),dv=o(2991),ir=o.n(dv),pv=o(86902),or=o.n(pv),hv=o(77766),Tt=o.n(hv),vv=o(26295),ep=o.n(vv),gv=o(20116),Mn=o.n(gv),Wm=o(31905),yv=o(92495),Tc=o.n(yv),mv=o(93320),tp=o.n(mv),xv=o(78718),Pc=o.n(xv),bv=o(23560),Cl=o.n(bv),rp=o(88996);function Ic(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function np(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),bc(t,a.key,a)}}function Fc(t,r,i){return r&&np(t.prototype,r),i&&np(t,i),t}var ip=o(83863),op=o(79542),ap=o(24889);function ds(t){return ds=op?ap:function(i){return i.__proto__||ap(i)},ds(t)}function wv(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=ds(t),t!==null););return t}function _u(t,r,i){return typeof Reflect!="undefined"&&ip?_u=ip:_u=function(s,p,y){var S=wv(s,p);if(!!S){var w=xc(S,p);return w.get?w.get.call(y):w.value}},_u(t,r,i||t)}var Sv=o(189);function kc(t,r){return kc=op||function(a,s){return a.__proto__=s,a},kc(t,r)}function Av(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Sv(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&kc(t,r)}var qu=o(13535);function Ev(){if(typeof Reflect=="undefined"||!qu||qu.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(qu(Boolean,[],function(){})),!0}catch(t){return!1}}function Cv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ov(t,r){return r&&(hr(r)==="object"||typeof r=="function")?r:Cv(t)}function Tv(t){var r=Ev();return function(){var a=ds(t),s;if(r){var p=ds(this).constructor;s=qu(a,arguments,p)}else s=a.apply(this,arguments);return Ov(this,s)}}var Pv=o(94473),Iv=o.n(Pv),Fv=o(57514),kv=o.n(Fv),Rv=function(r){var i=function(p,y){return{name:p,value:y}};if(Cl()(r.prototype.set)||Cl()(r.prototype.get)||Cl()(r.prototype.getAll)||Cl()(r.prototype.has))return r;var a=function(s){Av(y,s);var p=Tv(y);function y(S){var w;return Ic(this,y),w=p.call(this,S),w.entryList=[],w}return Fc(y,[{key:"append",value:function(w,E,k){return this.entryList.push(i(w,E)),_u(ds(y.prototype),"append",this).call(this,w,E,k)}},{key:"set",value:function(w,E){var k,$=i(w,E);this.entryList=Mn()(k=this.entryList).call(k,function(ae){return ae.name!==w}),this.entryList.push($)}},{key:"get",value:function(w){var E,k=Iv()(E=this.entryList).call(E,function($){return $.name===w});return k===void 0?null:k}},{key:"getAll",value:function(w){var E,k;return ir()(E=Mn()(k=this.entryList).call(k,function($){return $.name===w})).call(E,function($){return $.value})}},{key:"has",value:function(w){return this.entryList.some(function(E){return E.name===w})}}]),y}(r);return a};const Mv=Rv(kv());function Lv(t){if(Sc(t))return Ac(t)}function Dv(t){if(typeof ga!="undefined"&&wc(t)!=null||t["@@iterator"]!=null)return Qd(t)}function Nv(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
442
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ma(t){return Lv(t)||Dv(t)||Ec(t)||Nv()}var Bv=o(3649),Wi=o.n(Bv),Uv=o(88996),jv=Uv.Buffer,Vv=function(r){return":/?#[]@!$&'()*+,;=".indexOf(r)>-1},Wv=function(r){return/^[a-z0-9\-._~]+$/i.test(r)};function ps(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.escape,s=arguments.length>2?arguments[2]:void 0;return typeof t=="number"&&(t=t.toString()),typeof t!="string"||!t.length||!a?t:s?JSON.parse(t):ir()(r=ma(t)).call(r,function(p){var y,S;if(Wv(p)||Vv(p)&&a==="unsafe")return p;var w=ir()(y=ir()(S=jv.from(p).toJSON().data||[]).call(S,function(E){var k;return Wi()(k="0".concat(E.toString(16).toUpperCase())).call(k,-2)})).call(y,function(E){return"%".concat(E)}).join("");return w}).join("")}function Rc(t){var r=t.value;return Array.isArray(r)?Hv(t):hr(r)==="object"?zv(t):Gv(t)}function Hv(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,y=function($){return ps($,{escape:p})};if(a==="simple")return ir()(i).call(i,function(k){return y(k)}).join(",");if(a==="label")return".".concat(ir()(i).call(i,function(k){return y(k)}).join("."));if(a==="matrix")return ir()(i).call(i,function(k){return y(k)}).reduce(function(k,$){var ae;if(!k||s){var re,le;return Tt()(re=Tt()(le="".concat(k||"",";")).call(le,r,"=")).call(re,$)}return Tt()(ae="".concat(k,",")).call(ae,$)},"");if(a==="form"){var S=s?"&".concat(r,"="):",";return ir()(i).call(i,function(k){return y(k)}).join(S)}if(a==="spaceDelimited"){var w=s?"".concat(r,"="):"";return ir()(i).call(i,function(k){return y(k)}).join(" ".concat(w))}if(a==="pipeDelimited"){var E=s?"".concat(r,"="):"";return ir()(i).call(i,function(k){return y(k)}).join("|".concat(E))}}function zv(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,y=function(E){return ps(E,{escape:p})},S=or()(i);if(a==="simple")return S.reduce(function(w,E){var k,$,ae,re=y(i[E]),le=s?"=":",",ge=w?"".concat(w,","):"";return Tt()(k=Tt()($=Tt()(ae="".concat(ge)).call(ae,E)).call($,le)).call(k,re)},"");if(a==="label")return S.reduce(function(w,E){var k,$,ae,re=y(i[E]),le=s?"=":".",ge=w?"".concat(w,"."):".";return Tt()(k=Tt()($=Tt()(ae="".concat(ge)).call(ae,E)).call($,le)).call(k,re)},"");if(a==="matrix"&&s)return S.reduce(function(w,E){var k,$,ae=y(i[E]),re=w?"".concat(w,";"):";";return Tt()(k=Tt()($="".concat(re)).call($,E,"=")).call(k,ae)},"");if(a==="matrix")return S.reduce(function(w,E){var k,$,ae=y(i[E]),re=w?"".concat(w,","):";".concat(r,"=");return Tt()(k=Tt()($="".concat(re)).call($,E,",")).call(k,ae)},"");if(a==="form")return S.reduce(function(w,E){var k,$,ae,re,le=y(i[E]),ge=w?Tt()(k="".concat(w)).call(k,s?"&":","):"",he=s?"=":",";return Tt()($=Tt()(ae=Tt()(re="".concat(ge)).call(re,E)).call(ae,he)).call($,le)},"")}function Gv(t){var r=t.key,i=t.value,a=t.style,s=t.escape,p=function(w){return ps(w,{escape:s})};if(a==="simple")return p(i);if(a==="label")return".".concat(p(i));if(a==="matrix"){var y;return Tt()(y=";".concat(r,"=")).call(y,p(i))}if(a==="form")return p(i);if(a==="deepObject")return p(i,{},!0)}var Mc={serializeRes:sp,mergeInQueryOrForm:pp};function ef(t){return Lc.apply(this,arguments)}function Lc(){return Lc=Cc(Vi().mark(function t(r){var i,a,s,p,y,S=arguments;return Vi().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(i=S.length>1&&S[1]!==void 0?S[1]:{},hr(r)==="object"&&(i=r,r=i.url),i.headers=i.headers||{},Mc.mergeInQueryOrForm(i),i.headers&&or()(i.headers).forEach(function(k){var $=i.headers[k];typeof $=="string"&&(i.headers[k]=$.replace(/\n+/g," "))}),!i.requestInterceptor){E.next=12;break}return E.next=8,i.requestInterceptor(i);case 8:if(E.t0=E.sent,E.t0){E.next=11;break}E.t0=i;case 11:i=E.t0;case 12:return a=i.headers["content-type"]||i.headers["Content-Type"],/multipart\/form-data/i.test(a)&&(delete i.headers["content-type"],delete i.headers["Content-Type"]),E.prev=14,E.next=17,(i.userFetch||fetch)(i.url,i);case 17:return s=E.sent,E.next=20,Mc.serializeRes(s,r,i);case 20:if(s=E.sent,!i.responseInterceptor){E.next=28;break}return E.next=24,i.responseInterceptor(s);case 24:if(E.t1=E.sent,E.t1){E.next=27;break}E.t1=s;case 27:s=E.t1;case 28:E.next=39;break;case 30:if(E.prev=30,E.t2=E.catch(14),s){E.next=34;break}throw E.t2;case 34:throw p=new Error(s.statusText),p.status=s.status,p.statusCode=s.status,p.responseError=E.t2,p;case 39:if(s.ok){E.next=45;break}throw y=new Error(s.statusText),y.status=s.status,y.statusCode=s.status,y.response=s,y;case 45:return E.abrupt("return",s);case 46:case"end":return E.stop()}},t,null,[[14,30]])})),Lc.apply(this,arguments)}var $v=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(r)};function Kv(t,r){return r&&(r.indexOf("application/json")===0||r.indexOf("+json")>0)?JSON.parse(t):tp().safeLoad(t)}function sp(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.loadSpec,s=a===void 0?!1:a,p={ok:t.ok,url:t.url||r,status:t.status,statusText:t.statusText,headers:lp(t.headers)},y=p.headers["content-type"],S=s||$v(y),w=S?t.text:t.blob||t.buffer;return w.call(t).then(function(E){if(p.text=E,p.data=E,S)try{var k=Kv(E,y);p.body=k,p.obj=k}catch($){p.parseError=$}return p})}function Yv(t){var r=Oc()(t).call(t,", ");return r?t.split(", "):t}function lp(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Cl()(qd()(t))?fv()(qd()(t).call(t)).reduce(function(r,i){var a=hi(i,2),s=a[0],p=a[1];return r[s]=Yv(p),r},{}):{}}function Dc(t,r){return!r&&typeof navigator!="undefined"&&(r=navigator),r&&r.product==="ReactNative"?!!(t&&hr(t)==="object"&&typeof t.uri=="string"):typeof File!="undefined"&&t instanceof File||typeof Blob!="undefined"&&t instanceof Blob||typeof rp.Buffer!="undefined"&&t instanceof rp.Buffer?!0:t!==null&&hr(t)==="object"&&typeof t.pipe=="function"}function up(t,r){return Array.isArray(t)&&t.some(function(i){return Dc(i,r)})}var Jv={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Xv={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function fp(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=r.collectionFormat,s=r.allowEmptyValue,p=r.serializationOption,y=r.encoding,S=hr(r)==="object"&&!Array.isArray(r)?r.value:r,w=i?function($){return $.toString()}:function($){return encodeURIComponent($)},E=w(t);if(typeof S=="undefined"&&s)return[[E,""]];if(Dc(S)||up(S))return[[E,S]];if(p)return cp(t,S,i,p);if(y){if([hr(y.style),hr(y.explode),hr(y.allowReserved)].some(function($){return $!=="undefined"}))return cp(t,S,i,Pc()(y,["style","explode","allowReserved"]));if(y.contentType){if(y.contentType==="application/json"){var k=typeof S=="string"?S:Zu()(S);return[[E,w(k)]]}return[[E,w(S.toString())]]}return hr(S)!=="object"?[[E,w(S)]]:Array.isArray(S)&&S.every(function($){return hr($)!=="object"})?[[E,ir()(S).call(S,w).join(",")]]:[[E,w(Zu()(S))]]}return hr(S)!=="object"?[[E,w(S)]]:Array.isArray(S)?a==="multi"?[[E,ir()(S).call(S,w)]]:[[E,ir()(S).call(S,w).join(Xv[a||"csv"])]]:[[E,""]]}function cp(t,r,i,a){var s,p=a.style||"form",y=typeof a.explode=="undefined"?p==="form":a.explode,S=i?!1:a&&a.allowReserved?"unsafe":"reserved",w=function(re){return ps(re,{escape:S})},E=i?function(ae){return ae}:function(ae){return ps(ae,{escape:S})};if(hr(r)!=="object")return[[E(t),w(r)]];if(Array.isArray(r))return y?[[E(t),ir()(r).call(r,w)]]:[[E(t),ir()(r).call(r,w).join(Jv[p])]];if(p==="deepObject"){var k;return ir()(k=or()(r)).call(k,function(ae){var re;return[E(Tt()(re="".concat(t,"[")).call(re,ae,"]")),w(r[ae])]})}if(y){var $;return ir()($=or()(r)).call($,function(ae){return[E(ae),w(r[ae])]})}return[[E(t),ir()(s=or()(r)).call(s,function(ae){var re;return[Tt()(re="".concat(E(ae),",")).call(re,w(r[ae]))]}).join(",")]]}function Qv(t){return ep()(t).reduce(function(r,i){var a=hi(i,2),s=a[0],p=a[1],y=ya(fp(s,p,!0)),S;try{for(y.s();!(S=y.n()).done;){var w=hi(S.value,2),E=w[0],k=w[1];if(Array.isArray(k)){var $=ya(k),ae;try{for($.s();!(ae=$.n()).done;){var re=ae.value;r.append(E,re)}}catch(le){$.e(le)}finally{$.f()}}else r.append(E,k)}}catch(le){y.e(le)}finally{y.f()}return r},new Mv)}function dp(t){var r=or()(t).reduce(function(i,a){var s=ya(fp(a,t[a])),p;try{for(s.s();!(p=s.n()).done;){var y=hi(p.value,2),S=y[0],w=y[1];i[S]=w}}catch(E){s.e(E)}finally{s.f()}return i},{});return Tc().stringify(r,{encode:!1,indices:!1})||""}function pp(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.url,i=r===void 0?"":r,a=t.query,s=t.form,p=function(){for(var Se=arguments.length,me=new Array(Se),Fe=0;Fe<Se;Fe++)me[Fe]=arguments[Fe];var Ke=Mn()(me).call(me,function(Ue){return Ue}).join("&");return Ke?"?".concat(Ke):""};if(s){var y=or()(s).some(function(he){var Se=s[he].value;return Dc(Se)||up(Se)}),S=t.headers["content-type"]||t.headers["Content-Type"];y||/multipart\/form-data/i.test(S)?t.body=Qv(t.form):t.body=dp(s),delete t.form}if(a){var w=i.split("?"),E=hi(w,2),k=E[0],$=E[1],ae="";if($){var re=Tc().parse($),le=or()(a);le.forEach(function(he){return delete re[he]}),ae=Tc().stringify(re,{encode:!0})}var ge=p(ae,dp(a));t.url=k+ge,delete t.query}return t}function Zv(t,r,i){return i=i||function(a){return a},r=r||function(a){return a},function(a){return typeof a=="string"&&(a={url:a}),Mc.mergeInQueryOrForm(a),a=r(a),i(t(a))}}var _v=o(51942),vi=o.n(_v),qv=o(93476),xa=o.n(qv),eg=o(92762),tg=o.n(eg),rg=o(13311),ng=o.n(rg),ig=o(50308),hp=o.n(ig);/*!
441
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hi(t,r){return nv(t)||iv(t,r)||Ec(t,r)||ov()}var Zd=o(69798);function _d(t,r,i,a,s,p,y){try{var S=t[p](y),w=S.value}catch(E){i(E);return}S.done?r(w):Zd.resolve(w).then(a,s)}function Cc(t){return function(){var r=this,i=arguments;return new Zd(function(a,s){var p=t.apply(r,i);function y(w){_d(p,a,s,y,S,"next",w)}function S(w){_d(p,a,s,y,S,"throw",w)}y(void 0)})}}var av=o(63109),Vi=o.n(av),sv=o(78580),Oc=o.n(sv),lv=o(72119),qd=o.n(lv),uv=o(66419),fv=o.n(uv),cv=o(59340),Zu=o.n(cv),dv=o(2991),ir=o.n(dv),pv=o(86902),or=o.n(pv),hv=o(77766),Tt=o.n(hv),vv=o(26295),ep=o.n(vv),gv=o(20116),Mn=o.n(gv),Wm=o(31905),yv=o(92495),Tc=o.n(yv),mv=o(93320),tp=o.n(mv),xv=o(78718),Pc=o.n(xv),bv=o(23560),Cl=o.n(bv),rp=o(88996);function Ic(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function np(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),bc(t,a.key,a)}}function Fc(t,r,i){return r&&np(t.prototype,r),i&&np(t,i),t}var ip=o(83863),op=o(79542),ap=o(24889);function cs(t){return cs=op?ap:function(i){return i.__proto__||ap(i)},cs(t)}function wv(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=cs(t),t!==null););return t}function _u(t,r,i){return typeof Reflect!="undefined"&&ip?_u=ip:_u=function(s,p,y){var S=wv(s,p);if(!!S){var w=xc(S,p);return w.get?w.get.call(y):w.value}},_u(t,r,i||t)}var Sv=o(189);function kc(t,r){return kc=op||function(a,s){return a.__proto__=s,a},kc(t,r)}function Av(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Sv(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&kc(t,r)}var qu=o(13535);function Ev(){if(typeof Reflect=="undefined"||!qu||qu.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(qu(Boolean,[],function(){})),!0}catch(t){return!1}}function Cv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ov(t,r){return r&&(hr(r)==="object"||typeof r=="function")?r:Cv(t)}function Tv(t){var r=Ev();return function(){var a=cs(t),s;if(r){var p=cs(this).constructor;s=qu(a,arguments,p)}else s=a.apply(this,arguments);return Ov(this,s)}}var Pv=o(94473),Iv=o.n(Pv),Fv=o(57514),kv=o.n(Fv),Rv=function(r){var i=function(p,y){return{name:p,value:y}};if(Cl()(r.prototype.set)||Cl()(r.prototype.get)||Cl()(r.prototype.getAll)||Cl()(r.prototype.has))return r;var a=function(s){Av(y,s);var p=Tv(y);function y(S){var w;return Ic(this,y),w=p.call(this,S),w.entryList=[],w}return Fc(y,[{key:"append",value:function(w,E,k){return this.entryList.push(i(w,E)),_u(cs(y.prototype),"append",this).call(this,w,E,k)}},{key:"set",value:function(w,E){var k,$=i(w,E);this.entryList=Mn()(k=this.entryList).call(k,function(ae){return ae.name!==w}),this.entryList.push($)}},{key:"get",value:function(w){var E,k=Iv()(E=this.entryList).call(E,function($){return $.name===w});return k===void 0?null:k}},{key:"getAll",value:function(w){var E,k;return ir()(E=Mn()(k=this.entryList).call(k,function($){return $.name===w})).call(E,function($){return $.value})}},{key:"has",value:function(w){return this.entryList.some(function(E){return E.name===w})}}]),y}(r);return a};const Mv=Rv(kv());function Lv(t){if(Sc(t))return Ac(t)}function Dv(t){if(typeof ga!="undefined"&&wc(t)!=null||t["@@iterator"]!=null)return Qd(t)}function Nv(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
442
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ma(t){return Lv(t)||Dv(t)||Ec(t)||Nv()}var Bv=o(3649),Wi=o.n(Bv),Uv=o(88996),jv=Uv.Buffer,Vv=function(r){return":/?#[]@!$&'()*+,;=".indexOf(r)>-1},Wv=function(r){return/^[a-z0-9\-._~]+$/i.test(r)};function ds(t){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.escape,s=arguments.length>2?arguments[2]:void 0;return typeof t=="number"&&(t=t.toString()),typeof t!="string"||!t.length||!a?t:s?JSON.parse(t):ir()(r=ma(t)).call(r,function(p){var y,S;if(Wv(p)||Vv(p)&&a==="unsafe")return p;var w=ir()(y=ir()(S=jv.from(p).toJSON().data||[]).call(S,function(E){var k;return Wi()(k="0".concat(E.toString(16).toUpperCase())).call(k,-2)})).call(y,function(E){return"%".concat(E)}).join("");return w}).join("")}function Rc(t){var r=t.value;return Array.isArray(r)?Hv(t):hr(r)==="object"?zv(t):Gv(t)}function Hv(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,y=function($){return ds($,{escape:p})};if(a==="simple")return ir()(i).call(i,function(k){return y(k)}).join(",");if(a==="label")return".".concat(ir()(i).call(i,function(k){return y(k)}).join("."));if(a==="matrix")return ir()(i).call(i,function(k){return y(k)}).reduce(function(k,$){var ae;if(!k||s){var re,le;return Tt()(re=Tt()(le="".concat(k||"",";")).call(le,r,"=")).call(re,$)}return Tt()(ae="".concat(k,",")).call(ae,$)},"");if(a==="form"){var S=s?"&".concat(r,"="):",";return ir()(i).call(i,function(k){return y(k)}).join(S)}if(a==="spaceDelimited"){var w=s?"".concat(r,"="):"";return ir()(i).call(i,function(k){return y(k)}).join(" ".concat(w))}if(a==="pipeDelimited"){var E=s?"".concat(r,"="):"";return ir()(i).call(i,function(k){return y(k)}).join("|".concat(E))}}function zv(t){var r=t.key,i=t.value,a=t.style,s=t.explode,p=t.escape,y=function(E){return ds(E,{escape:p})},S=or()(i);if(a==="simple")return S.reduce(function(w,E){var k,$,ae,re=y(i[E]),le=s?"=":",",ge=w?"".concat(w,","):"";return Tt()(k=Tt()($=Tt()(ae="".concat(ge)).call(ae,E)).call($,le)).call(k,re)},"");if(a==="label")return S.reduce(function(w,E){var k,$,ae,re=y(i[E]),le=s?"=":".",ge=w?"".concat(w,"."):".";return Tt()(k=Tt()($=Tt()(ae="".concat(ge)).call(ae,E)).call($,le)).call(k,re)},"");if(a==="matrix"&&s)return S.reduce(function(w,E){var k,$,ae=y(i[E]),re=w?"".concat(w,";"):";";return Tt()(k=Tt()($="".concat(re)).call($,E,"=")).call(k,ae)},"");if(a==="matrix")return S.reduce(function(w,E){var k,$,ae=y(i[E]),re=w?"".concat(w,","):";".concat(r,"=");return Tt()(k=Tt()($="".concat(re)).call($,E,",")).call(k,ae)},"");if(a==="form")return S.reduce(function(w,E){var k,$,ae,re,le=y(i[E]),ge=w?Tt()(k="".concat(w)).call(k,s?"&":","):"",he=s?"=":",";return Tt()($=Tt()(ae=Tt()(re="".concat(ge)).call(re,E)).call(ae,he)).call($,le)},"")}function Gv(t){var r=t.key,i=t.value,a=t.style,s=t.escape,p=function(w){return ds(w,{escape:s})};if(a==="simple")return p(i);if(a==="label")return".".concat(p(i));if(a==="matrix"){var y;return Tt()(y=";".concat(r,"=")).call(y,p(i))}if(a==="form")return p(i);if(a==="deepObject")return p(i,{},!0)}var Mc={serializeRes:sp,mergeInQueryOrForm:pp};function ef(t){return Lc.apply(this,arguments)}function Lc(){return Lc=Cc(Vi().mark(function t(r){var i,a,s,p,y,S=arguments;return Vi().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(i=S.length>1&&S[1]!==void 0?S[1]:{},hr(r)==="object"&&(i=r,r=i.url),i.headers=i.headers||{},Mc.mergeInQueryOrForm(i),i.headers&&or()(i.headers).forEach(function(k){var $=i.headers[k];typeof $=="string"&&(i.headers[k]=$.replace(/\n+/g," "))}),!i.requestInterceptor){E.next=12;break}return E.next=8,i.requestInterceptor(i);case 8:if(E.t0=E.sent,E.t0){E.next=11;break}E.t0=i;case 11:i=E.t0;case 12:return a=i.headers["content-type"]||i.headers["Content-Type"],/multipart\/form-data/i.test(a)&&(delete i.headers["content-type"],delete i.headers["Content-Type"]),E.prev=14,E.next=17,(i.userFetch||fetch)(i.url,i);case 17:return s=E.sent,E.next=20,Mc.serializeRes(s,r,i);case 20:if(s=E.sent,!i.responseInterceptor){E.next=28;break}return E.next=24,i.responseInterceptor(s);case 24:if(E.t1=E.sent,E.t1){E.next=27;break}E.t1=s;case 27:s=E.t1;case 28:E.next=39;break;case 30:if(E.prev=30,E.t2=E.catch(14),s){E.next=34;break}throw E.t2;case 34:throw p=new Error(s.statusText),p.status=s.status,p.statusCode=s.status,p.responseError=E.t2,p;case 39:if(s.ok){E.next=45;break}throw y=new Error(s.statusText),y.status=s.status,y.statusCode=s.status,y.response=s,y;case 45:return E.abrupt("return",s);case 46:case"end":return E.stop()}},t,null,[[14,30]])})),Lc.apply(this,arguments)}var $v=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return/(json|xml|yaml|text)\b/.test(r)};function Kv(t,r){return r&&(r.indexOf("application/json")===0||r.indexOf("+json")>0)?JSON.parse(t):tp().safeLoad(t)}function sp(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.loadSpec,s=a===void 0?!1:a,p={ok:t.ok,url:t.url||r,status:t.status,statusText:t.statusText,headers:lp(t.headers)},y=p.headers["content-type"],S=s||$v(y),w=S?t.text:t.blob||t.buffer;return w.call(t).then(function(E){if(p.text=E,p.data=E,S)try{var k=Kv(E,y);p.body=k,p.obj=k}catch($){p.parseError=$}return p})}function Yv(t){var r=Oc()(t).call(t,", ");return r?t.split(", "):t}function lp(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Cl()(qd()(t))?fv()(qd()(t).call(t)).reduce(function(r,i){var a=hi(i,2),s=a[0],p=a[1];return r[s]=Yv(p),r},{}):{}}function Dc(t,r){return!r&&typeof navigator!="undefined"&&(r=navigator),r&&r.product==="ReactNative"?!!(t&&hr(t)==="object"&&typeof t.uri=="string"):typeof File!="undefined"&&t instanceof File||typeof Blob!="undefined"&&t instanceof Blob||typeof rp.Buffer!="undefined"&&t instanceof rp.Buffer?!0:t!==null&&hr(t)==="object"&&typeof t.pipe=="function"}function up(t,r){return Array.isArray(t)&&t.some(function(i){return Dc(i,r)})}var Jv={form:",",spaceDelimited:"%20",pipeDelimited:"|"},Xv={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function fp(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=r.collectionFormat,s=r.allowEmptyValue,p=r.serializationOption,y=r.encoding,S=hr(r)==="object"&&!Array.isArray(r)?r.value:r,w=i?function($){return $.toString()}:function($){return encodeURIComponent($)},E=w(t);if(typeof S=="undefined"&&s)return[[E,""]];if(Dc(S)||up(S))return[[E,S]];if(p)return cp(t,S,i,p);if(y){if([hr(y.style),hr(y.explode),hr(y.allowReserved)].some(function($){return $!=="undefined"}))return cp(t,S,i,Pc()(y,["style","explode","allowReserved"]));if(y.contentType){if(y.contentType==="application/json"){var k=typeof S=="string"?S:Zu()(S);return[[E,w(k)]]}return[[E,w(S.toString())]]}return hr(S)!=="object"?[[E,w(S)]]:Array.isArray(S)&&S.every(function($){return hr($)!=="object"})?[[E,ir()(S).call(S,w).join(",")]]:[[E,w(Zu()(S))]]}return hr(S)!=="object"?[[E,w(S)]]:Array.isArray(S)?a==="multi"?[[E,ir()(S).call(S,w)]]:[[E,ir()(S).call(S,w).join(Xv[a||"csv"])]]:[[E,""]]}function cp(t,r,i,a){var s,p=a.style||"form",y=typeof a.explode=="undefined"?p==="form":a.explode,S=i?!1:a&&a.allowReserved?"unsafe":"reserved",w=function(re){return ds(re,{escape:S})},E=i?function(ae){return ae}:function(ae){return ds(ae,{escape:S})};if(hr(r)!=="object")return[[E(t),w(r)]];if(Array.isArray(r))return y?[[E(t),ir()(r).call(r,w)]]:[[E(t),ir()(r).call(r,w).join(Jv[p])]];if(p==="deepObject"){var k;return ir()(k=or()(r)).call(k,function(ae){var re;return[E(Tt()(re="".concat(t,"[")).call(re,ae,"]")),w(r[ae])]})}if(y){var $;return ir()($=or()(r)).call($,function(ae){return[E(ae),w(r[ae])]})}return[[E(t),ir()(s=or()(r)).call(s,function(ae){var re;return[Tt()(re="".concat(E(ae),",")).call(re,w(r[ae]))]}).join(",")]]}function Qv(t){return ep()(t).reduce(function(r,i){var a=hi(i,2),s=a[0],p=a[1],y=ya(fp(s,p,!0)),S;try{for(y.s();!(S=y.n()).done;){var w=hi(S.value,2),E=w[0],k=w[1];if(Array.isArray(k)){var $=ya(k),ae;try{for($.s();!(ae=$.n()).done;){var re=ae.value;r.append(E,re)}}catch(le){$.e(le)}finally{$.f()}}else r.append(E,k)}}catch(le){y.e(le)}finally{y.f()}return r},new Mv)}function dp(t){var r=or()(t).reduce(function(i,a){var s=ya(fp(a,t[a])),p;try{for(s.s();!(p=s.n()).done;){var y=hi(p.value,2),S=y[0],w=y[1];i[S]=w}}catch(E){s.e(E)}finally{s.f()}return i},{});return Tc().stringify(r,{encode:!1,indices:!1})||""}function pp(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.url,i=r===void 0?"":r,a=t.query,s=t.form,p=function(){for(var Se=arguments.length,me=new Array(Se),Fe=0;Fe<Se;Fe++)me[Fe]=arguments[Fe];var Ke=Mn()(me).call(me,function(Ue){return Ue}).join("&");return Ke?"?".concat(Ke):""};if(s){var y=or()(s).some(function(he){var Se=s[he].value;return Dc(Se)||up(Se)}),S=t.headers["content-type"]||t.headers["Content-Type"];y||/multipart\/form-data/i.test(S)?t.body=Qv(t.form):t.body=dp(s),delete t.form}if(a){var w=i.split("?"),E=hi(w,2),k=E[0],$=E[1],ae="";if($){var re=Tc().parse($),le=or()(a);le.forEach(function(he){return delete re[he]}),ae=Tc().stringify(re,{encode:!0})}var ge=p(ae,dp(a));t.url=k+ge,delete t.query}return t}function Zv(t,r,i){return i=i||function(a){return a},r=r||function(a){return a},function(a){return typeof a=="string"&&(a={url:a}),Mc.mergeInQueryOrForm(a),a=r(a),i(t(a))}}var _v=o(51942),vi=o.n(_v),qv=o(93476),xa=o.n(qv),eg=o(92762),tg=o.n(eg),rg=o(13311),ng=o.n(rg),ig=o(50308),hp=o.n(ig);/*!
443
443
  * https://github.com/Starcounter-Jack/JSON-Patch
444
444
  * (c) 2017 Joachim Wester
445
445
  * MIT license
446
446
  */var og=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var p in s)s.hasOwnProperty(p)&&(a[p]=s[p])},t(r,i)};return function(r,i){t(r,i);function a(){this.constructor=r}r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}}(),ag=Object.prototype.hasOwnProperty;function tf(t,r){return ag.call(t,r)}function Nc(t){if(Array.isArray(t)){for(var i=new Array(t.length),r=0;r<i.length;r++)i[r]=""+r;return i}if(Object.keys)return Object.keys(t);var i=[];for(var a in t)tf(t,a)&&i.push(a);return i}function Gn(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function Bc(t){for(var r=0,i=t.length,a;r<i;){if(a=t.charCodeAt(r),a>=48&&a<=57){r++;continue}return!1}return!0}function fo(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function vp(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function gp(t,r){var i;for(var a in t)if(tf(t,a)){if(t[a]===r)return fo(a)+"/";if(typeof t[a]=="object"&&(i=gp(t[a],r),i!=""))return fo(a)+"/"+i}return""}function Hm(t,r){if(t===r)return"/";var i=gp(t,r);if(i==="")throw new Error("Object not found in root");return"/"+i}function Uc(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var r=0,i=t.length;r<i;r++)if(Uc(t[r]))return!0}else if(typeof t=="object"){for(var a=Nc(t),s=a.length,r=0;r<s;r++)if(Uc(t[a[r]]))return!0}}return!1}function yp(t,r){var i=[t];for(var a in r){var s=typeof r[a]=="object"?JSON.stringify(r[a],null,2):r[a];typeof s!="undefined"&&i.push(a+": "+s)}return i.join(`
447
- `)}var mp=function(t){og(r,t);function r(i,a,s,p,y){var S=this.constructor,w=t.call(this,yp(i,{name:a,index:s,operation:p,tree:y}))||this;return w.name=a,w.index=s,w.operation=p,w.tree=y,Object.setPrototypeOf(w,S.prototype),w.message=yp(i,{name:a,index:s,operation:p,tree:y}),w}return r}(Error),Gr=mp,sg=Gn,hs={add:function(t,r,i){return t[r]=this.value,{newDocument:i}},remove:function(t,r,i){var a=t[r];return delete t[r],{newDocument:i,removed:a}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:function(t,r,i){var a=Ol(i,this.path);a&&(a=Gn(a));var s=ba(i,{op:"remove",path:this.from}).removed;return ba(i,{op:"add",path:this.path,value:s}),{newDocument:i,removed:a}},copy:function(t,r,i){var a=Ol(i,this.from);return ba(i,{op:"add",path:this.path,value:Gn(a)}),{newDocument:i}},test:function(t,r,i){return{newDocument:i,test:Tl(t[r],this.value)}},_get:function(t,r,i){return this.value=t[r],{newDocument:i}}},lg={add:function(t,r,i){return Bc(r)?t.splice(r,0,this.value):t[r]=this.value,{newDocument:i,index:r}},remove:function(t,r,i){var a=t.splice(r,1);return{newDocument:i,removed:a[0]}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:hs.move,copy:hs.copy,test:hs.test,_get:hs._get};function Ol(t,r){if(r=="")return t;var i={op:"_get",path:r};return ba(t,i),i.value}function ba(t,r,i,a,s,p){if(i===void 0&&(i=!1),a===void 0&&(a=!0),s===void 0&&(s=!0),p===void 0&&(p=0),i&&(typeof i=="function"?i(r,0,t,r.path):rf(r,0)),r.path===""){var y={newDocument:t};if(r.op==="add")return y.newDocument=r.value,y;if(r.op==="replace")return y.newDocument=r.value,y.removed=t,y;if(r.op==="move"||r.op==="copy")return y.newDocument=Ol(t,r.from),r.op==="move"&&(y.removed=t),y;if(r.op==="test"){if(y.test=Tl(t,r.value),y.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y.newDocument=t,y}else{if(r.op==="remove")return y.removed=t,y.newDocument=null,y;if(r.op==="_get")return r.value=t,y;if(i)throw new Gr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,r,t);return y}}else{a||(t=Gn(t));var S=r.path||"",w=S.split("/"),E=t,k=1,$=w.length,ae=void 0,re=void 0,le=void 0;for(typeof i=="function"?le=i:le=rf;;){if(re=w[k],s&&re=="__proto__")throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&ae===void 0&&(E[re]===void 0?ae=w.slice(0,k).join("/"):k==$-1&&(ae=r.path),ae!==void 0&&le(r,0,t,ae)),k++,Array.isArray(E)){if(re==="-")re=E.length;else{if(i&&!Bc(re))throw new Gr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,r,t);Bc(re)&&(re=~~re)}if(k>=$){if(i&&r.op==="add"&&re>E.length)throw new Gr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,r,t);var y=lg[r.op].call(r,E,re,t);if(y.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y}}else if(re&&re.indexOf("~")!=-1&&(re=vp(re)),k>=$){var y=hs[r.op].call(r,E,re,t);if(y.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y}E=E[re]}}}function wa(t,r,i,a,s){if(a===void 0&&(a=!0),s===void 0&&(s=!0),i&&!Array.isArray(r))throw new Gr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");a||(t=Gn(t));for(var p=new Array(r.length),y=0,S=r.length;y<S;y++)p[y]=ba(t,r[y],i,!0,s,y),t=p[y].newDocument;return p.newDocument=t,p}function ug(t,r,i){var a=ba(t,r);if(a.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",i,r,t);return a.newDocument}function rf(t,r,i,a){if(typeof t!="object"||t===null||Array.isArray(t))throw new Gr("Operation is not an object","OPERATION_NOT_AN_OBJECT",r,t,i);if(hs[t.op]){if(typeof t.path!="string")throw new Gr("Operation `path` property is not a string","OPERATION_PATH_INVALID",r,t,i);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new Gr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",r,t,i);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Gr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Gr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Uc(t.value))throw new Gr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",r,t,i);if(i){if(t.op=="add"){var s=t.path.split("/").length,p=a.split("/").length;if(s!==p+1&&s!==p)throw new Gr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",r,t,i)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==a)throw new Gr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",r,t,i)}else if(t.op==="move"||t.op==="copy"){var y={op:"_get",path:t.from,value:void 0},S=xp([y],i);if(S&&S.name==="OPERATION_PATH_UNRESOLVABLE")throw new Gr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,t,i)}}}else throw new Gr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",r,t,i)}function xp(t,r,i){try{if(!Array.isArray(t))throw new Gr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)wa(Gn(r),Gn(t),i||!0);else{i=i||rf;for(var a=0;a<t.length;a++)i(t[a],a,r,void 0)}}catch(s){if(s instanceof Gr)return s;throw s}}function Tl(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){var i=Array.isArray(t),a=Array.isArray(r),s,p,y;if(i&&a){if(p=t.length,p!=r.length)return!1;for(s=p;s--!=0;)if(!Tl(t[s],r[s]))return!1;return!0}if(i!=a)return!1;var S=Object.keys(t);if(p=S.length,p!==Object.keys(r).length)return!1;for(s=p;s--!=0;)if(!r.hasOwnProperty(S[s]))return!1;for(s=p;s--!=0;)if(y=S[s],!Tl(t[y],r[y]))return!1;return!0}return t!==t&&r!==r}/*!
447
+ `)}var mp=function(t){og(r,t);function r(i,a,s,p,y){var S=this.constructor,w=t.call(this,yp(i,{name:a,index:s,operation:p,tree:y}))||this;return w.name=a,w.index=s,w.operation=p,w.tree=y,Object.setPrototypeOf(w,S.prototype),w.message=yp(i,{name:a,index:s,operation:p,tree:y}),w}return r}(Error),Gr=mp,sg=Gn,ps={add:function(t,r,i){return t[r]=this.value,{newDocument:i}},remove:function(t,r,i){var a=t[r];return delete t[r],{newDocument:i,removed:a}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:function(t,r,i){var a=Ol(i,this.path);a&&(a=Gn(a));var s=ba(i,{op:"remove",path:this.from}).removed;return ba(i,{op:"add",path:this.path,value:s}),{newDocument:i,removed:a}},copy:function(t,r,i){var a=Ol(i,this.from);return ba(i,{op:"add",path:this.path,value:Gn(a)}),{newDocument:i}},test:function(t,r,i){return{newDocument:i,test:Tl(t[r],this.value)}},_get:function(t,r,i){return this.value=t[r],{newDocument:i}}},lg={add:function(t,r,i){return Bc(r)?t.splice(r,0,this.value):t[r]=this.value,{newDocument:i,index:r}},remove:function(t,r,i){var a=t.splice(r,1);return{newDocument:i,removed:a[0]}},replace:function(t,r,i){var a=t[r];return t[r]=this.value,{newDocument:i,removed:a}},move:ps.move,copy:ps.copy,test:ps.test,_get:ps._get};function Ol(t,r){if(r=="")return t;var i={op:"_get",path:r};return ba(t,i),i.value}function ba(t,r,i,a,s,p){if(i===void 0&&(i=!1),a===void 0&&(a=!0),s===void 0&&(s=!0),p===void 0&&(p=0),i&&(typeof i=="function"?i(r,0,t,r.path):rf(r,0)),r.path===""){var y={newDocument:t};if(r.op==="add")return y.newDocument=r.value,y;if(r.op==="replace")return y.newDocument=r.value,y.removed=t,y;if(r.op==="move"||r.op==="copy")return y.newDocument=Ol(t,r.from),r.op==="move"&&(y.removed=t),y;if(r.op==="test"){if(y.test=Tl(t,r.value),y.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y.newDocument=t,y}else{if(r.op==="remove")return y.removed=t,y.newDocument=null,y;if(r.op==="_get")return r.value=t,y;if(i)throw new Gr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",p,r,t);return y}}else{a||(t=Gn(t));var S=r.path||"",w=S.split("/"),E=t,k=1,$=w.length,ae=void 0,re=void 0,le=void 0;for(typeof i=="function"?le=i:le=rf;;){if(re=w[k],s&&re=="__proto__")throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&ae===void 0&&(E[re]===void 0?ae=w.slice(0,k).join("/"):k==$-1&&(ae=r.path),ae!==void 0&&le(r,0,t,ae)),k++,Array.isArray(E)){if(re==="-")re=E.length;else{if(i&&!Bc(re))throw new Gr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",p,r,t);Bc(re)&&(re=~~re)}if(k>=$){if(i&&r.op==="add"&&re>E.length)throw new Gr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",p,r,t);var y=lg[r.op].call(r,E,re,t);if(y.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y}}else if(re&&re.indexOf("~")!=-1&&(re=vp(re)),k>=$){var y=ps[r.op].call(r,E,re,t);if(y.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",p,r,t);return y}E=E[re]}}}function wa(t,r,i,a,s){if(a===void 0&&(a=!0),s===void 0&&(s=!0),i&&!Array.isArray(r))throw new Gr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");a||(t=Gn(t));for(var p=new Array(r.length),y=0,S=r.length;y<S;y++)p[y]=ba(t,r[y],i,!0,s,y),t=p[y].newDocument;return p.newDocument=t,p}function ug(t,r,i){var a=ba(t,r);if(a.test===!1)throw new Gr("Test operation failed","TEST_OPERATION_FAILED",i,r,t);return a.newDocument}function rf(t,r,i,a){if(typeof t!="object"||t===null||Array.isArray(t))throw new Gr("Operation is not an object","OPERATION_NOT_AN_OBJECT",r,t,i);if(ps[t.op]){if(typeof t.path!="string")throw new Gr("Operation `path` property is not a string","OPERATION_PATH_INVALID",r,t,i);if(t.path.indexOf("/")!==0&&t.path.length>0)throw new Gr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",r,t,i);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Gr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Gr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",r,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Uc(t.value))throw new Gr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",r,t,i);if(i){if(t.op=="add"){var s=t.path.split("/").length,p=a.split("/").length;if(s!==p+1&&s!==p)throw new Gr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",r,t,i)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==a)throw new Gr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",r,t,i)}else if(t.op==="move"||t.op==="copy"){var y={op:"_get",path:t.from,value:void 0},S=xp([y],i);if(S&&S.name==="OPERATION_PATH_UNRESOLVABLE")throw new Gr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",r,t,i)}}}else throw new Gr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",r,t,i)}function xp(t,r,i){try{if(!Array.isArray(t))throw new Gr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(r)wa(Gn(r),Gn(t),i||!0);else{i=i||rf;for(var a=0;a<t.length;a++)i(t[a],a,r,void 0)}}catch(s){if(s instanceof Gr)return s;throw s}}function Tl(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){var i=Array.isArray(t),a=Array.isArray(r),s,p,y;if(i&&a){if(p=t.length,p!=r.length)return!1;for(s=p;s--!=0;)if(!Tl(t[s],r[s]))return!1;return!0}if(i!=a)return!1;var S=Object.keys(t);if(p=S.length,p!==Object.keys(r).length)return!1;for(s=p;s--!=0;)if(!r.hasOwnProperty(S[s]))return!1;for(s=p;s--!=0;)if(y=S[s],!Tl(t[y],r[y]))return!1;return!0}return t!==t&&r!==r}/*!
448
448
  * https://github.com/Starcounter-Jack/JSON-Patch
449
449
  * (c) 2017 Joachim Wester
450
450
  * MIT license
451
- */var jc=new WeakMap,fg=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),cg=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function dg(t){return jc.get(t)}function pg(t,r){return t.observers.get(r)}function hg(t,r){t.observers.delete(r.callback)}function vg(t,r){r.unobserve()}function gg(t,r){var i=[],a,s=dg(t);if(!s)s=new fg(t),jc.set(t,s);else{var p=pg(s,r);a=p&&p.observer}if(a)return a;if(a={},s.value=Gn(t),r){a.callback=r,a.next=null;var y=function(){Vc(a)},S=function(){clearTimeout(a.next),a.next=setTimeout(y)};typeof window!="undefined"&&(window.addEventListener("mouseup",S),window.addEventListener("keyup",S),window.addEventListener("mousedown",S),window.addEventListener("keydown",S),window.addEventListener("change",S))}return a.patches=i,a.object=t,a.unobserve=function(){Vc(a),clearTimeout(a.next),hg(s,a),typeof window!="undefined"&&(window.removeEventListener("mouseup",S),window.removeEventListener("keyup",S),window.removeEventListener("mousedown",S),window.removeEventListener("keydown",S),window.removeEventListener("change",S))},s.observers.set(r,new cg(r,a)),a}function Vc(t,r){r===void 0&&(r=!1);var i=jc.get(t.object);Wc(i.value,t.object,t.patches,"",r),t.patches.length&&wa(i.value,t.patches);var a=t.patches;return a.length>0&&(t.patches=[],t.callback&&t.callback(a)),a}function Wc(t,r,i,a,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var p=Nc(r),y=Nc(t),S=!1,w=!1,E=y.length-1;E>=0;E--){var k=y[E],$=t[k];if(tf(r,k)&&!(r[k]===void 0&&$!==void 0&&Array.isArray(r)===!1)){var ae=r[k];typeof $=="object"&&$!=null&&typeof ae=="object"&&ae!=null?Wc($,ae,i,a+"/"+fo(k),s):$!==ae&&(S=!0,s&&i.push({op:"test",path:a+"/"+fo(k),value:Gn($)}),i.push({op:"replace",path:a+"/"+fo(k),value:Gn(ae)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:a+"/"+fo(k),value:Gn($)}),i.push({op:"remove",path:a+"/"+fo(k)}),w=!0):(s&&i.push({op:"test",path:a,value:t}),i.push({op:"replace",path:a,value:r}),S=!0)}if(!(!w&&p.length==y.length))for(var E=0;E<p.length;E++){var k=p[E];!tf(t,k)&&r[k]!==void 0&&i.push({op:"add",path:a+"/"+fo(k),value:Gn(r[k])})}}}function yg(t,r,i){i===void 0&&(i=!1);var a=[];return Wc(t,r,a,"",i),a}const zm=Object.assign({},c,v,{JsonPatchError:mp,deepClone:Gn,escapePathComponent:fo,unescapePathComponent:vp});var mg=o(31312),xg=o.n(mg),bg=o(50361),wg=o.n(bg);const sr={add:Ag,replace:Hc,remove:Eg,merge:Cg,mergeDeep:Og,context:Tg,getIn:kg,applyPatch:Sg,parentPathMatch:Fg,flatten:Pl,fullyNormalizeArray:Rg,normalizeArray:Sp,isPromise:Mg,forEachNew:Pg,forEachNewPrimitive:Ig,isJsonPatch:Cp,isContextPatch:Ng,isPatch:of,isMutation:Op,isAdditiveMutation:nf,isGenerator:Dg,isFunction:Ep,isObject:Uo,isError:Lg};function Sg(t,r,i){if(i=i||{},r=Cr(Cr({},r),{},{path:r.path&&bp(r.path)}),r.op==="merge"){var a=$c(t,r.path);vi()(a,r.value),wa(t,[Hc(r.path,a)])}else if(r.op==="mergeDeep"){var s=$c(t,r.path);for(var p in r.value){var y=r.value[p],S=Array.isArray(y);if(S){var w=s[p]||[];s[p]=Tt()(w).call(w,y)}else if(Uo(y)&&!S){var E=Cr({},s[p]);for(var k in y)if(Object.prototype.hasOwnProperty.call(E,k)){E=xg()(wg()(E),y);break}else vi()(E,Yd({},k,y[k]));s[p]=E}else s[p]=y}}else if(r.op==="add"&&r.path===""&&Uo(r.value)){var $=or()(r.value).reduce(function(he,Se){return he.push({op:"add",path:"/".concat(bp(Se)),value:r.value[Se]}),he},[]);wa(t,$)}else if(r.op==="replace"&&r.path===""){var ae=r,re=ae.value;i.allowMetaPatches&&r.meta&&nf(r)&&(Array.isArray(r.value)||Uo(r.value))&&(re=Cr(Cr({},re),r.meta)),t=re}else if(wa(t,[r]),i.allowMetaPatches&&r.meta&&nf(r)&&(Array.isArray(r.value)||Uo(r.value))){var le=$c(t,r.path),ge=Cr(Cr({},le),r.meta);wa(t,[Hc(r.path,ge)])}return t}function bp(t){return Array.isArray(t)?t.length<1?"":"/".concat(ir()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function Ag(t,r){return{op:"add",path:t,value:r}}function Hc(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function Eg(t){return{op:"remove",path:t}}function Cg(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function Og(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function Tg(t,r){return{type:"context",path:t,value:r}}function Pg(t,r){try{return wp(t,Gc,r)}catch(i){return i}}function Ig(t,r){try{return wp(t,zc,r)}catch(i){return i}}function wp(t,r,i){var a,s=ir()(a=Mn()(t).call(t,nf)).call(a,function(S){return r(S.value,i,S.path)})||[],p=Pl(s),y=Ap(p);return y}function zc(t,r,i){if(i=i||[],Array.isArray(t))return ir()(t).call(t,function(s,p){return zc(s,r,Tt()(i).call(i,p))});if(Uo(t)){var a;return ir()(a=or()(t)).call(a,function(s){return zc(t[s],r,Tt()(i).call(i,s))})}return r(t,i[i.length-1],i)}function Gc(t,r,i){i=i||[];var a=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(a=Tt()(a).call(a,s))}if(Array.isArray(t)){var p=ir()(t).call(t,function(w,E){return Gc(w,r,Tt()(i).call(i,E))});p&&(a=Tt()(a).call(a,p))}else if(Uo(t)){var y,S=ir()(y=or()(t)).call(y,function(w){return Gc(t[w],r,Tt()(i).call(i,w))});S&&(a=Tt()(a).call(a,S))}return a=Pl(a),a}function Fg(t,r){if(!Array.isArray(r))return!1;for(var i=0,a=r.length;i<a;i+=1)if(r[i]!==t[i])return!1;return!0}function kg(t,r){return r.reduce(function(i,a){return typeof a!="undefined"&&i?i[a]:i},t)}function Rg(t){return Ap(Pl(Sp(t)))}function Sp(t){return Array.isArray(t)?t:[t]}function Pl(t){var r;return Tt()(r=[]).apply(r,ma(ir()(t).call(t,function(i){return Array.isArray(i)?Pl(i):i})))}function Ap(t){return Mn()(t).call(t,function(r){return typeof r!="undefined"})}function Uo(t){return t&&hr(t)==="object"}function Mg(t){return Uo(t)&&Ep(t.then)}function Ep(t){return t&&typeof t=="function"}function Lg(t){return t instanceof Error}function Cp(t){if(of(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function Dg(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function Op(t){return Cp(t)||of(t)&&t.type==="mutation"}function nf(t){return Op(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Ng(t){return of(t)&&t.type==="context"}function of(t){return t&&hr(t)==="object"}function $c(t,r){try{return Ol(t,r)}catch(i){return console.error(i),{}}}var Bg=o(52424),Ug=o.n(Bg),jg=o(54098),Vg=o(9779),Tp=o.n(Vg);function Pp(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var a=arguments.length,s=new Array(a),p=0;p<a;p++)s[p]=arguments[p];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var Wg=o(13692),Hg=o.n(Wg),zg=o(47037),Gg=o.n(zg),$g=["properties"],Kg=["properties"],Yg=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Jg=["schema/example","items/example"];function Ip(t){var r=t[t.length-1],i=t[t.length-2],a=t.join("/");return $g.indexOf(r)>-1&&Kg.indexOf(i)===-1||Yg.indexOf(a)>-1||Jg.some(function(s){return a.indexOf(s)>-1})}function Xg(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.specmap,s=i.getBaseUrlForNodePath,p=s===void 0?function(E){var k;return a.getContext(Tt()(k=[]).call(k,ma(r),ma(E))).baseDoc}:s,y=i.targetKeys,S=y===void 0?["$ref","$$ref"]:y,w=[];return Hg()(t).forEach(function(){if(Oc()(S).call(S,this.key)&&Gg()(this.node)){var k=this.path,$=Tt()(r).call(r,this.path),ae=Kc(this.node,p(k));w.push(a.replace($,ae))}}),w}function Kc(t,r){var i,a=t.split("#"),s=hi(a,2),p=s[0],y=s[1],S=Bo.resolve(p||"",r||"");return y?Tt()(i="".concat(S,"#")).call(i,y):S}var Fp="application/json, application/yaml",Qg=new RegExp("^([a-z]+://|//)","i"),vs=Pp("JSONRefError",function(r,i,a){this.originalError=a,vi()(this,i||{})}),co={},kp=new(Ug()),Zg=[function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="examples"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="examples"&&t[6]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="examples"&&t[7]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[4]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"}],_g=function(r){return Zg.some(function(i){return i(r)})},qg={key:"$ref",plugin:function(r,i,a,s){var p=s.getInstance(),y=Wi()(a).call(a,0,-1);if(!(Ip(y)||_g(y))){var S=s.getContext(a),w=S.baseDoc;if(typeof r!="string")return new vs("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:w,fullPath:a});var E=Lp(r),k=E[0],$=E[1]||"",ae;try{ae=w||k?Mp(k,w):null}catch(me){return Yc(me,{pointer:$,$ref:r,basePath:ae,fullPath:a})}var re,le;if(oy($,ae,y,s)&&!p.useCircularStructures){var ge=Kc(r,ae);return r===ge?null:sr.replace(a,ge)}if(ae==null?(le=Xc($),re=s.get(le),typeof re=="undefined"&&(re=new vs("Could not resolve reference: ".concat(r),{pointer:$,$ref:r,baseDoc:w,fullPath:a}))):(re=Dp(ae,$),re.__value!=null?re=re.__value:re=re.catch(function(me){throw Yc(me,{pointer:$,$ref:r,baseDoc:w,fullPath:a})})),re instanceof Error)return[sr.remove(a),re];var he=Kc(r,ae),Se=sr.replace(y,re,{$$ref:he});if(ae&&ae!==w)return[Se,sr.context(y,{baseDoc:ae})];try{if(!ay(s.state,Se)||p.useCircularStructures)return Se}catch(me){return null}}}},Rp=vi()(qg,{docCache:co,absoluteify:Mp,clearCache:ty,JSONRefError:vs,wrapError:Yc,getDoc:Np,split:Lp,extractFromDoc:Dp,fetchJSON:ry,extract:Jc,jsonPointerToArray:Xc,unescapeJsonPointerToken:Bp});const ey=Rp;function Mp(t,r){if(!Qg.test(t)){if(!r){var i;throw new vs(Tt()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Bo.resolve(r,t)}return t}function Yc(t,r){var i;if(t&&t.response&&t.response.body){var a;i=Tt()(a="".concat(t.response.body.code," ")).call(a,t.response.body.message)}else i=t.message;return new vs("Could not resolve reference: ".concat(i),r,t)}function Lp(t){return(t+"").split("#")}function Dp(t,r){var i=co[t];if(i&&!sr.isPromise(i))try{var a=Jc(r,i);return vi()(xa().resolve(a),{__value:a})}catch(s){return xa().reject(s)}return Np(t).then(function(s){return Jc(r,s)})}function ty(t){typeof t!="undefined"?delete co[t]:or()(co).forEach(function(r){delete co[r]})}function Np(t){var r=co[t];return r?sr.isPromise(r)?r:xa().resolve(r):(co[t]=Rp.fetchJSON(t).then(function(i){return co[t]=i,i}),co[t])}function ry(t){return(0,jg.fetch)(t,{headers:{Accept:Fp},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return tp().safeLoad(r)})}function Jc(t,r){var i=Xc(t);if(i.length<1)return r;var a=sr.getIn(r,i);if(typeof a=="undefined")throw new vs("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return a}function Xc(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(hr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:ir()(r=t.split("/")).call(r,Bp)}function Bp(t){return typeof t!="string"?t:Tp().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Up(t){return Tp().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function ny(t){return t.length===0?"":"/".concat(ir()(t).call(t,Up).join("/"))}var iy=function(r){return!r||r==="/"||r==="#"};function Qc(t,r){if(iy(r))return!0;var i=t.charAt(r.length),a=Wi()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&a!=="#"}function oy(t,r,i,a){var s,p,y=kp.get(a);y||(y={},kp.set(a,y));var S=ny(i),w=Tt()(s="".concat(r||"<specmap-base>","#")).call(s,t),E=S.replace(/allOf\/\d+\/?/g,""),k=a.contextTree.get([]).baseDoc;if(r==k&&Qc(E,t))return!0;var $="",ae=i.some(function(re){var le;return $=Tt()(le="".concat($,"/")).call(le,Up(re)),y[$]&&y[$].some(function(ge){return Qc(ge,w)||Qc(w,ge)})});if(ae)return!0;y[E]=Tt()(p=y[E]||[]).call(p,w)}function ay(t,r){var i=[t];return r.path.reduce(function(s,p){return i.push(s[p]),s[p]},t),a(r.value);function a(s){return sr.isObject(s)&&(i.indexOf(s)>=0||or()(s).some(function(p){return a(s[p])}))}}var sy=o(41609),ly=o.n(sy);const uy={key:"allOf",plugin:function(r,i,a,s,p){if(!(p.meta&&p.meta.$$ref)){var y=Wi()(a).call(a,0,-1);if(!Ip(y)){if(!Array.isArray(r)){var S=new TypeError("allOf must be an array");return S.fullPath=a,S}var w=!1,E=p.value;if(y.forEach(function(ae){!E||(E=E[ae])}),E=Cr({},E),!ly()(E)){delete E.allOf;var k=[];if(k.push(s.replace(y,{})),r.forEach(function(ae,re){if(!s.isObject(ae)){if(w)return null;w=!0;var le=new TypeError("Elements in allOf must be objects");return le.fullPath=a,k.push(le)}k.push(s.mergeDeep(y,ae));var ge=Wi()(a).call(a,0,-1),he=Xg(ae,ge,{getBaseUrlForNodePath:function(me){var Fe;return s.getContext(Tt()(Fe=[]).call(Fe,ma(a),[re],ma(me))).baseDoc},specmap:s});k.push.apply(k,ma(he))}),k.push(s.mergeDeep(y,E)),!E.$$ref){var $;k.push(s.remove(Tt()($=[]).call($,y,"$$ref")))}return k}}}}},fy={key:"parameters",plugin:function(r,i,a,s){if(Array.isArray(r)&&r.length){var p=vi()([],r),y=Wi()(a).call(a,0,-1),S=Cr({},sr.getIn(s.spec,y));return r.forEach(function(w,E){try{p[E].default=s.parameterMacro(S,w)}catch($){var k=new Error($);return k.fullPath=a,k}}),sr.replace(a,p)}return sr.replace(a,r)}},cy={key:"properties",plugin:function(r,i,a,s){var p=Cr({},r);for(var y in r)try{p[y].default=s.modelPropertyMacro(p[y])}catch(E){var S=new Error(E);return S.fullPath=a,S}var w=sr.replace(a,p);return w}};var dy=function(){function t(r){Ic(this,t),this.root=Zc(r||{})}return Fc(t,[{key:"set",value:function(i,a){var s=this.getParent(i,!0);if(!s){af(this.root,a,null);return}var p=i[i.length-1],y=s.children;if(y[p]){af(y[p],a,s);return}y[p]=Zc(a,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var a=this.root,s,p,y=0;y<i.length&&(p=i[y],s=a.children,!!s[p]);y+=1)a=s[p];return a&&a.protoValue}},{key:"getParent",value:function(i,a){return!i||i.length<1?null:i.length<2?this.root:Wi()(i).call(i,0,-1).reduce(function(s,p){if(!s)return s;var y=s.children;return!y[p]&&a&&(y[p]=Zc(null,s)),y[p]},this.root)}}]),t}();function Zc(t,r){return af({children:{}},t,r)}function af(t,r,i){return t.value=r||{},t.protoValue=i?Cr(Cr({},i.protoValue),t.value):t.value,or()(t.children).forEach(function(a){var s=t.children[a];t.children[a]=af(s,s.value,t)}),t}var jp=100,py=function(){function t(r){var i=this,a,s;Ic(this,t),vi()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new dy,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:vi()(Object.create(this),sr,{getInstance:function(){return i}}),allowMetaPatches:!1},r),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=Mn()(a=ir()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(a,sr.isFunction),this.patches.push(sr.add([],this.spec)),this.patches.push(sr.context([],this.context)),this.updatePatches(this.patches)}return Fc(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var a,s=arguments.length,p=new Array(s>1?s-1:0),y=1;y<s;y++)p[y-1]=arguments[y];(a=console).log.apply(a,p)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var a,s,p=arguments.length,y=new Array(p>1?p-1:0),S=1;S<p;S++)y[S-1]=arguments[S];(a=console).log.apply(a,Tt()(s=["[".concat(i,"] ")]).call(s,y))}}},{key:"wrapPlugin",value:function(i,a){var s=this.pathDiscriminator,p=null,y;return i[this.pluginProp]?(p=i,y=i[this.pluginProp]):sr.isFunction(i)?y=i:sr.isObject(i)&&(y=S(i)),vi()(y.bind(p),{pluginName:i.name||a,isGenerator:sr.isGenerator(y)});function S(w){var E=function($,ae){return Array.isArray($)?$.every(function(re,le){return re===ae[le]}):!0};return Vi().mark(function k($,ae){var re,le,ge,he,Se,me;return Vi().wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:me=function($e,Be,je){var We,Je,ze,et,wt,Dt,Wt,lr,Mr,Or,Kr,Sr,Ur;return Vi().wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(sr.isObject($e)){Xt.next=6;break}if(w.key!==Be[Be.length-1]){Xt.next=4;break}return Xt.next=4,w.plugin($e,w.key,Be,ae);case 4:Xt.next=30;break;case 6:We=Be.length-1,Je=Be[We],ze=Be.indexOf("properties"),et=Je==="properties"&&We===ze,wt=ae.allowMetaPatches&&le[$e.$$ref],Dt=0,Wt=or()($e);case 12:if(!(Dt<Wt.length)){Xt.next=30;break}if(lr=Wt[Dt],Mr=$e[lr],Or=Tt()(Be).call(Be,lr),Kr=sr.isObject(Mr),Sr=$e.$$ref,wt){Xt.next=22;break}if(!Kr){Xt.next=22;break}return ae.allowMetaPatches&&Sr&&(le[Sr]=!0),Xt.delegateYield(me(Mr,Or,je),"t0",22);case 22:if(!(!et&&lr===w.key)){Xt.next=27;break}if(Ur=E(s,Be),!(!s||Ur)){Xt.next=27;break}return Xt.next=27,w.plugin(Mr,lr,Or,ae,je);case 27:Dt++,Xt.next=12;break;case 30:case"end":return Xt.stop()}},re)},re=Vi().mark(me),le={},ge=ya(Mn()($).call($,sr.isAdditiveMutation)),Ke.prev=4,ge.s();case 6:if((he=ge.n()).done){Ke.next=11;break}return Se=he.value,Ke.delegateYield(me(Se.value,Se.path,Se),"t0",9);case 9:Ke.next=6;break;case 11:Ke.next=16;break;case 13:Ke.prev=13,Ke.t1=Ke.catch(4),ge.e(Ke.t1);case 16:return Ke.prev=16,ge.f(),Ke.finish(16);case 19:case"end":return Ke.stop()}},k,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return ng()(this.wrappedPlugins,function(a){var s=i.getMutationsForPlugin(a);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return xa().race(ir()(i=this.promisedPatches).call(i,function(a){return a.value}))}}},{key:"getPluginHistory",value:function(i){var a=this.constructor.getPluginName(i);return this.pluginHistory[a]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var a=this.getPluginHistory(i),s=a&&a[a.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var a=this.getPluginHistoryTip(i).mutationIndex;return typeof a!="number"?-1:a}},{key:"updatePluginHistory",value:function(i,a){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(a)}},{key:"updatePatches",value:function(i){var a=this;sr.normalizeArray(i).forEach(function(s){if(s instanceof Error){a.errors.push(s);return}try{if(!sr.isObject(s)){a.debug("updatePatches","Got a non-object patch",s);return}if(a.showDebug&&a.allPatches.push(s),sr.isPromise(s.value)){a.promisedPatches.push(s),a.promisedPatchThen(s);return}if(sr.isContextPatch(s)){a.setContext(s.path,s.value);return}if(sr.isMutation(s)){a.updateMutations(s);return}}catch(p){console.error(p),a.errors.push(p)}})}},{key:"updateMutations",value:function(i){hr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=Cr({},i.value));var a=sr.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});a&&(this.mutations.push(i),this.state=a)}},{key:"removePromisedPatch",value:function(i){var a,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}tg()(a=this.promisedPatches).call(a,s,1)}},{key:"promisedPatchThen",value:function(i){var a=this;return i.value=i.value.then(function(s){var p=Cr(Cr({},i),{},{value:s});a.removePromisedPatch(i),a.updatePatches(p)}).catch(function(s){a.removePromisedPatch(i),a.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,a){var s;return i=i||0,typeof a!="number"&&(a=this.mutations.length),Wi()(s=this.mutations).call(s,i,a)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var a=this.getPluginMutationIndex(i);return this.getMutations(a+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return sr.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,a){return this.contextTree.set(i,a)}},{key:"_hasRun",value:function(i){var a=this.getPluginRunCount(this.getCurrentPlugin());return a>(i||0)}},{key:"dispatch",value:function(){var i=this,a=this,s=this.nextPlugin();if(!s){var p=this.nextPromisedPatch();if(p)return p.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var y={spec:this.state,errors:this.errors};return this.showDebug&&(y.patches=this.allPatches),xa().resolve(y)}if(a.pluginCount=a.pluginCount||{},a.pluginCount[s]=(a.pluginCount[s]||0)+1,a.pluginCount[s]>jp){var S;return xa().resolve({spec:a.state,errors:Tt()(S=a.errors).call(S,new Error("We've reached a hard limit of ".concat(jp," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var w,E=ir()(w=this.promisedPatches).call(w,function(ae){return ae.value});return xa().all(ir()(E).call(E,function(ae){return ae.then(hp(),hp())})).then(function(){return i.dispatch()})}return k();function k(){a.currentPlugin=s;var ae=a.getCurrentMutations(),re=a.mutations.length-1;try{if(s.isGenerator){var le=ya(s(ae,a.getLib())),ge;try{for(le.s();!(ge=le.n()).done;){var he=ge.value;$(he)}}catch(me){le.e(me)}finally{le.f()}}else{var Se=s(ae,a.getLib());$(Se)}}catch(me){console.error(me),$([vi()(Object.create(me),{plugin:s})])}finally{a.updatePluginHistory(s,{mutationIndex:re})}return a.dispatch()}function $(ae){ae&&(ae=sr.fullyNormalizeArray(ae),a.updatePatches(ae,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,a){return Mn()(i).call(i,a)}}]),t}();function hy(t){return new py(t).dispatch()}var Sa={refs:ey,allOf:uy,parameters:fy,properties:cy},vy=o(13218),Vp=o.n(vy),Wp=function(r){return String.prototype.toLowerCase.call(r)},Hp=function(r){return r.replace(/[^\w]/gi,"_")};function zp(t){var r=t.openapi;return r?Xd()(r,"3"):!1}function Gm(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function sf(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.v2OperationIdCompatibilityMode;if(!t||hr(t)!=="object")return null;var p=(t.operationId||"").replace(/\s/g,"");return p.length?Hp(t.operationId):gy(r,i,{v2OperationIdCompatibilityMode:s})}function gy(t,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.v2OperationIdCompatibilityMode;if(s){var p,y,S=Tt()(p="".concat(r.toLowerCase(),"_")).call(p,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return S=S||Tt()(y="".concat(t.substring(1),"_")).call(y,r),S.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Tt()(i="".concat(Wp(r))).call(i,Hp(t))}function Gp(t,r){var i;return Tt()(i="".concat(Wp(r),"-")).call(i,t)}function yy(t,r){return!t||!t.paths?null:my(t,function(i){var a=i.pathName,s=i.method,p=i.operation;if(!p||hr(p)!=="object")return!1;var y=p.operationId,S=sf(p,a,s),w=Gp(a,s);return[S,w,y].some(function(E){return E&&E===r})})}function my(t,r){return $p(t,r,!0)||null}function $p(t,r,i){if(!t||hr(t)!=="object"||!t.paths||hr(t.paths)!=="object")return null;var a=t.paths;for(var s in a)for(var p in a[s])if(p.toUpperCase()!=="PARAMETERS"){var y=a[s][p];if(!(!y||hr(y)!=="object")){var S={spec:t,pathName:s,method:p.toUpperCase(),operation:y},w=r(S);if(i&&w)return S}}}function Kp(t){var r=t.spec,i=r.paths,a={};if(!i||r.$$normalized)return t;for(var s in i){var p=i[s];if(!!Vp()(p)){var y=p.parameters,S=function($){var ae=p[$];if(!Vp()(ae))return"continue";var re=sf(ae,s,$);if(re){a[re]?a[re].push(ae):a[re]=[ae];var le=a[re];if(le.length>1)le.forEach(function(Je,ze){var et;Je.__originalOperationId=Je.__originalOperationId||Je.operationId,Je.operationId=Tt()(et="".concat(re)).call(et,ze+1)});else if(typeof ae.operationId!="undefined"){var ge=le[0];ge.__originalOperationId=ge.__originalOperationId||ae.operationId,ge.operationId=re}}if($!=="parameters"){var he=[],Se={};for(var me in r)(me==="produces"||me==="consumes"||me==="security")&&(Se[me]=r[me],he.push(Se));if(y&&(Se.parameters=y,he.push(Se)),he.length){var Fe=ya(he),Ke;try{for(Fe.s();!(Ke=Fe.n()).done;){var Ue=Ke.value;for(var $e in Ue)if(!ae[$e])ae[$e]=Ue[$e];else if($e==="parameters"){var Be=ya(Ue[$e]),je;try{var We=function(){var ze=je.value,et=ae[$e].some(function(wt){return wt.name&&wt.name===ze.name||wt.$ref&&wt.$ref===ze.$ref||wt.$$ref&&wt.$$ref===ze.$$ref||wt===ze});et||ae[$e].push(ze)};for(Be.s();!(je=Be.n()).done;)We()}catch(Je){Be.e(Je)}finally{Be.f()}}}}catch(Je){Fe.e(Je)}finally{Fe.f()}}}};for(var w in p)var E=S(w)}}return r.$$normalized=!0,t}function Yp(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,a=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(p){return t({url:p,loadSpec:!0,requestInterceptor:i,responseInterceptor:a,headers:{Accept:Fp},credentials:s}).then(function(y){return y.body})}}function xy(){Sa.refs.clearCache()}function Jp(t){var r=t.fetch,i=t.spec,a=t.url,s=t.mode,p=t.allowMetaPatches,y=p===void 0?!0:p,S=t.pathDiscriminator,w=t.modelPropertyMacro,E=t.parameterMacro,k=t.requestInterceptor,$=t.responseInterceptor,ae=t.skipNormalization,re=t.useCircularStructures,le=t.http,ge=t.baseDoc;if(ge=ge||a,le=r||le||ef,!i)return Yp(le,{requestInterceptor:k,responseInterceptor:$})(ge).then(he);return he(i);function he(Se){ge&&(Sa.refs.docCache[ge]=Se),Sa.refs.fetchJSON=Yp(le,{requestInterceptor:k,responseInterceptor:$});var me=[Sa.refs];return typeof E=="function"&&me.push(Sa.parameters),typeof w=="function"&&me.push(Sa.properties),s!=="strict"&&me.push(Sa.allOf),hy({spec:Se,context:{baseDoc:ge},plugins:me,allowMetaPatches:y,pathDiscriminator:S,parameterMacro:E,modelPropertyMacro:w,useCircularStructures:re}).then(ae?function(){var Fe=Cc(Vi().mark(function Ke(Ue){return Vi().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.abrupt("return",Ue);case 1:case"end":return Be.stop()}},Ke)}));return function(Ke){return Fe.apply(this,arguments)}}():Kp)}}var by=o(27361),Il=o.n(by);function wy(t,r){return _c.apply(this,arguments)}function _c(){return _c=Cc(Vi().mark(function t(r,i){var a,s,p,y,S,w,E,k,$,ae,re,le,ge=arguments;return Vi().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return a=ge.length>2&&ge[2]!==void 0?ge[2]:{},s=a.returnEntireTree,p=a.baseDoc,y=a.requestInterceptor,S=a.responseInterceptor,w=a.parameterMacro,E=a.modelPropertyMacro,k=a.useCircularStructures,$={pathDiscriminator:i,baseDoc:p,requestInterceptor:y,responseInterceptor:S,parameterMacro:w,modelPropertyMacro:E,useCircularStructures:k},ae=Kp({spec:r}),re=ae.spec,Se.next=6,Jp(Cr(Cr({},$),{},{spec:re,allowMetaPatches:!0,skipNormalization:!0}));case 6:return le=Se.sent,!s&&Array.isArray(i)&&i.length&&(le.spec=Il()(le.spec,i)||null),Se.abrupt("return",le);case 9:case"end":return Se.stop()}},t)})),_c.apply(this,arguments)}var Sy=function(){return null},Ay=function(r){return Array.isArray(r)?r:[r]},lf={mapTagOperations:Oy,makeExecute:Ey};function Ey(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,a=r.method,s=r.operationId;return function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(Cr(Cr({spec:t.spec},Pc()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:a,parameters:p,operationId:s},y))}}}function $m(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=lf.makeExecute(t),i=lf.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),a={};for(var s in i){a[s]={operations:{}};for(var p in i[s])a[s].operations[p]={execute:i[s][p]}}return{apis:a}}function Cy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=lf.makeExecute(t);return{apis:lf.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Oy(t){var r=t.spec,i=t.cb,a=i===void 0?Sy:i,s=t.defaultTag,p=s===void 0?"default":s,y=t.v2OperationIdCompatibilityMode,S={},w={};return $p(r,function(E){var k=E.pathName,$=E.method,ae=E.operation,re=ae.tags?Ay(ae.tags):[p];re.forEach(function(le){if(typeof le=="string"){w[le]=w[le]||{};var ge=w[le],he=sf(ae,k,$,{v2OperationIdCompatibilityMode:y}),Se=a({spec:r,pathName:k,method:$,operation:ae,operationId:he});if(S[he]){var me;S[he]+=1,ge[Tt()(me="".concat(he)).call(me,S[he])]=Se}else if(typeof ge[he]!="undefined"){var Fe,Ke,Ue=S[he]||1;S[he]=Ue+1,ge[Tt()(Fe="".concat(he)).call(Fe,S[he])]=Se;var $e=ge[he];delete ge[he],ge[Tt()(Ke="".concat(he)).call(Ke,Ue)]=$e}else ge[he]=Se}})}),w}var Xp=o(95683);function Ty(t,r){if(t==null)return{};var i={},a=Gd(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(Xp(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function Py(t,r){if(t==null)return{};var i=Ty(t,r),a,s;if(Xu){var p=Xu(t);for(s=0;s<p.length;s++)a=p[s],!(Xp(r).call(r,a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}var Iy=o(68630),Qp=o.n(Iy),Fy=o(1469),ky=o.n(Fy),Ry=o(76489);const My={body:Ly,header:Ny,query:Uy,path:By,formData:Dy};function Ly(t){var r=t.req,i=t.value;r.body=i}function Dy(t){var r=t.req,i=t.value,a=t.parameter;(i||a.allowEmptyValue)&&(r.form=r.form||{},r.form[a.name]={value:i,allowEmptyValue:a.allowEmptyValue,collectionFormat:a.collectionFormat})}function Ny(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{},typeof a!="undefined"&&(r.headers[i.name]=a)}function By(t){var r=t.req,i=t.value,a=t.parameter;r.url=r.url.split("{".concat(a.name,"}")).join(encodeURIComponent(i))}function Uy(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},i===!1&&a.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(a.type)>-1&&(i="0"),i)r.query[a.name]={collectionFormat:a.collectionFormat,value:i};else if(a.allowEmptyValue&&i!==void 0){var s=a.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function uf(t,r){return Oc()(r).call(r,"application/json")?typeof t=="string"?t:Zu()(t):t.toString()}function jy(t){var r=t.req,i=t.value,a=t.parameter,s=a.name,p=a.style,y=a.explode,S=a.content;if(S){var w=or()(S)[0];r.url=r.url.split("{".concat(s,"}")).join(ps(uf(i,w),{escape:!0}));return}var E=Rc({key:a.name,value:i,style:p||"simple",explode:y||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(E)}function Vy(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},a.content){var s=or()(a.content)[0];r.query[a.name]=uf(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[a.name]={value:i,serializationOption:Pc()(a,["style","explode","allowReserved"])};else if(a.allowEmptyValue&&i!==void 0){var p=a.name;r.query[p]=r.query[p]||{},r.query[p].allowEmptyValue=!0}}var Wy=["accept","authorization","content-type"];function Hy(t){var r=t.req,i=t.parameter,a=t.value;if(r.headers=r.headers||{},!(Wy.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=or()(i.content)[0];r.headers[i.name]=uf(a,s);return}typeof a!="undefined"&&(r.headers[i.name]=Rc({key:i.name,value:a,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function zy(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{};var s=hr(a);if(i.content){var p,y=or()(i.content)[0];r.headers.Cookie=Tt()(p="".concat(i.name,"=")).call(p,uf(a,y));return}if(s!=="undefined"){var S=s==="object"&&!Array.isArray(a)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=S+Rc({key:i.name,value:a,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var Gy=o(50706),Zp=o.n(Gy);function $y(t,r){var i=t.operation,a=t.requestBody,s=t.securities,p=t.spec,y=t.attachContentTypeForEmptyPayload,S=t.requestContentType;r=Ky({request:r,securities:s,operation:i,spec:p});var w=i.requestBody||{},E=or()(w.content||{}),k=S&&E.indexOf(S)>-1;if(a||y){if(S&&k)r.headers["Content-Type"]=S;else if(!S){var $=E[0];$&&(r.headers["Content-Type"]=$,S=$)}}else S&&k&&(r.headers["Content-Type"]=S);if(!t.responseContentType&&i.responses){var ae,re=Mn()(ae=ep()(i.responses)).call(ae,function(ge){var he=hi(ge,2),Se=he[0],me=he[1],Fe=parseInt(Se,10);return Fe>=200&&Fe<300&&Qp()(me.content)}).reduce(function(ge,he){var Se=hi(he,2),me=Se[1];return Tt()(ge).call(ge,or()(me.content))},[]);re.length>0&&(r.headers.accept=re.join(", "))}if(a)if(S){if(E.indexOf(S)>-1)if(S==="application/x-www-form-urlencoded"||S==="multipart/form-data")if(hr(a)==="object"){var le=(w.content[S]||{}).encoding||{};r.form={},or()(a).forEach(function(ge){r.form[ge]={value:a[ge],encoding:le[ge]||{}}})}else r.form=a;else r.body=a}else r.body=a;return r}function Ky(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,S=Qu()({},r),w=a.authorized,E=w===void 0?{}:w,k=p.security||y.security||[],$=E&&!!or()(E).length,ae=Il()(y,["components","securitySchemes"])||{};return S.headers=S.headers||{},S.query=S.query||{},!or()(a).length||!$||!k||Array.isArray(p.security)&&!p.security.length?r:(k.forEach(function(re){or()(re).forEach(function(le){var ge=E[le],he=ae[le];if(!!ge){var Se=ge.value||ge,me=he.type;if(ge){if(me==="apiKey")he.in==="query"&&(S.query[he.name]=Se),he.in==="header"&&(S.headers[he.name]=Se),he.in==="cookie"&&(S.cookies[he.name]=Se);else if(me==="http"){if(/^basic$/i.test(he.scheme)){var Fe,Ke=Se.username||"",Ue=Se.password||"",$e=Zp()(Tt()(Fe="".concat(Ke,":")).call(Fe,Ue));S.headers.Authorization="Basic ".concat($e)}/^bearer$/i.test(he.scheme)&&(S.headers.Authorization="Bearer ".concat(Se))}else if(me==="oauth2"||me==="openIdConnect"){var Be,je=ge.token||{},We=he["x-tokenName"]||"access_token",Je=je[We],ze=je.token_type;(!ze||ze.toLowerCase()==="bearer")&&(ze="Bearer"),S.headers.Authorization=Tt()(Be="".concat(ze," ")).call(Be,Je)}}}})}),S)}function Yy(t,r){var i=t.spec,a=t.operation,s=t.securities,p=t.requestContentType,y=t.responseContentType,S=t.attachContentTypeForEmptyPayload;if(r=Jy({request:r,securities:s,operation:a,spec:i}),r.body||r.form||S){var w,E;if(p)r.headers["Content-Type"]=p;else if(Array.isArray(a.consumes)){var k=hi(a.consumes,1);r.headers["Content-Type"]=k[0]}else if(Array.isArray(i.consumes)){var $=hi(i.consumes,1);r.headers["Content-Type"]=$[0]}else a.parameters&&Mn()(w=a.parameters).call(w,function(he){return he.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":a.parameters&&Mn()(E=a.parameters).call(E,function(he){return he.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(p){var ae,re,le=a.parameters&&Mn()(ae=a.parameters).call(ae,function(he){return he.in==="body"}).length>0,ge=a.parameters&&Mn()(re=a.parameters).call(re,function(he){return he.in==="formData"}).length>0;(le||ge)&&(r.headers["Content-Type"]=p)}return!y&&Array.isArray(a.produces)&&a.produces.length>0&&(r.headers.accept=a.produces.join(", ")),r}function Jy(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,S=Qu()({},r),w=a.authorized,E=w===void 0?{}:w,k=a.specSecurity,$=k===void 0?[]:k,ae=p.security||$,re=E&&!!or()(E).length,le=y.securityDefinitions;return S.headers=S.headers||{},S.query=S.query||{},!or()(a).length||!re||!ae||Array.isArray(p.security)&&!p.security.length?r:(ae.forEach(function(ge){or()(ge).forEach(function(he){var Se=E[he];if(!!Se){var me=Se.token,Fe=Se.value||Se,Ke=le[he],Ue=Ke.type,$e=Ke["x-tokenName"]||"access_token",Be=me&&me[$e],je=me&&me.token_type;if(Se){if(Ue==="apiKey"){var We=Ke.in==="query"?"query":"headers";S[We]=S[We]||{},S[We][Ke.name]=Fe}else if(Ue==="basic")if(Fe.header)S.headers.authorization=Fe.header;else{var Je,ze=Fe.username||"",et=Fe.password||"";Fe.base64=Zp()(Tt()(Je="".concat(ze,":")).call(Je,et)),S.headers.authorization="Basic ".concat(Fe.base64)}else if(Ue==="oauth2"&&Be){var wt;je=!je||je.toLowerCase()==="bearer"?"Bearer":je,S.headers.authorization=Tt()(wt="".concat(je," ")).call(wt,Be)}}}})}),S)}var _p=function(r){return Array.isArray(r)?r:[]},Xy=Pp("OperationNotFoundError",function(r,i,a){this.originalError=a,vi()(this,i||{})}),Qy=function(r,i){return Mn()(i).call(i,function(a){return a.name===r})},Zy=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var a=[];return or()(i).forEach(function(s){or()(i[s]).forEach(function(p){a.push(i[s][p])})}),a},_y={buildRequest:qp};function qy(t){var r=t.http,i=t.fetch,a=t.spec,s=t.operationId,p=t.pathName,y=t.method,S=t.parameters,w=t.securities,E=Py(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),k=r||i||ef;p&&y&&!s&&(s=Gp(p,y));var $=_y.buildRequest(Cr({spec:a,operationId:s,parameters:S,securities:w,http:k},E));return $.body&&(Qp()($.body)||ky()($.body))&&($.body=Zu()($.body)),k($)}function qp(t){var r,i,a=t.spec,s=t.operationId,p=t.responseContentType,y=t.scheme,S=t.requestInterceptor,w=t.responseInterceptor,E=t.contextUrl,k=t.userFetch,$=t.server,ae=t.serverVariables,re=t.http,le=t.parameters,ge=t.parameterBuilders,he=zp(a);ge||(he?ge=x:ge=My);var Se=re&&re.withCredentials?"include":"same-origin",me={url:"",credentials:Se,headers:{},cookies:{}};S&&(me.requestInterceptor=S),w&&(me.responseInterceptor=w),k&&(me.userFetch=k);var Fe=yy(a,s);if(!Fe)throw new Xy("Operation ".concat(s," not found"));var Ke=Fe.operation,Ue=Ke===void 0?{}:Ke,$e=Fe.method,Be=Fe.pathName;if(me.url+=eh({spec:a,scheme:y,contextUrl:E,server:$,serverVariables:ae,pathName:Be,method:$e}),!s)return delete me.cookies,me;me.url+=Be,me.method="".concat($e).toUpperCase(),le=le||{};var je=a.paths[Be]||{};p&&(me.headers.accept=p);var We=Zy(Tt()(r=Tt()(i=[]).call(i,_p(Ue.parameters))).call(r,_p(je.parameters)));We.forEach(function(et){var wt=ge[et.in],Dt;if(et.in==="body"&&et.schema&&et.schema.properties&&(Dt=le),Dt=et&&et.name&&le[et.name],typeof Dt=="undefined"){var Wt;Dt=et&&et.name&&le[Tt()(Wt="".concat(et.in,".")).call(Wt,et.name)]}else if(Qy(et.name,We).length>1){var lr;console.warn(Tt()(lr="Parameter '".concat(et.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(lr,et.name,"' and the passed-in parameter values did not define an 'in' value."))}if(Dt!==null){if(typeof et.default!="undefined"&&typeof Dt=="undefined"&&(Dt=et.default),typeof Dt=="undefined"&&et.required&&!et.allowEmptyValue)throw new Error("Required parameter ".concat(et.name," is not provided"));if(he&&et.schema&&et.schema.type==="object"&&typeof Dt=="string")try{Dt=JSON.parse(Dt)}catch(Mr){throw new Error("Could not parse object parameter value string as JSON")}wt&&wt({req:me,parameter:et,value:Dt,operation:Ue,spec:a})}});var Je=Cr(Cr({},t),{},{operation:Ue});if(he?me=$y(Je,me):me=Yy(Je,me),me.cookies&&or()(me.cookies).length){var ze=or()(me.cookies).reduce(function(et,wt){var Dt=me.cookies[wt],Wt=et?"&":"",lr=Ry.serialize(wt,Dt);return et+Wt+lr},"");me.headers.Cookie=ze}return me.cookies&&delete me.cookies,pp(me),me}var qc=function(r){return r?r.replace(/\W/g,""):null};function eh(t){var r=zp(t.spec);return r?em(t):nm(t)}function em(t){var r=t.spec,i=t.pathName,a=t.method,s=t.server,p=t.contextUrl,y=t.serverVariables,S=y===void 0?{}:y,w=Il()(r,["paths",i,(a||"").toLowerCase(),"servers"])||Il()(r,["paths",i,"servers"])||Il()(r,["servers"]),E="",k=null;if(s&&w&&w.length){var $=ir()(w).call(w,function(le){return le.url});$.indexOf(s)>-1&&(E=s,k=w[$.indexOf(s)])}if(!E&&w&&w.length){E=w[0].url;var ae=hi(w,1);k=ae[0]}if(E.indexOf("{")>-1){var re=rm(E);re.forEach(function(le){if(k.variables&&k.variables[le]){var ge=k.variables[le],he=S[le]||ge.default,Se=new RegExp("{".concat(le,"}"),"g");E=E.replace(Se,he)}})}return tm(E,p)}function tm(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Bo.parse(Bo.resolve(r,t)):Bo.parse(t),a=Bo.parse(r),s=qc(i.protocol)||qc(a.protocol)||"",p=i.host||a.host,y=i.pathname||"",S;if(s&&p){var w;S=Tt()(w="".concat(s,"://")).call(w,p+y)}else S=y;return S[S.length-1]==="/"?Wi()(S).call(S,0,-1):S}function rm(t){for(var r=[],i=/{([^}]+)}/g,a;a=i.exec(t);)r.push(a[1]);return r}function nm(t){var r=t.spec,i=t.scheme,a=t.contextUrl,s=a===void 0?"":a,p=Bo.parse(s),y=Array.isArray(r.schemes)?r.schemes[0]:null,S=i||y||qc(p.protocol)||"http",w=r.host||p.host||"",E=r.basePath||"",k;if(S&&w){var $;k=Tt()($="".concat(S,"://")).call($,w+E)}else k=E;return k[k.length-1]==="/"?Wi()(k).call(k,0,-1):k}Br.http=ef,Br.makeHttp=Zv.bind(null,Br.http),Br.resolve=Jp,Br.resolveSubtree=wy,Br.execute=qy,Br.serializeRes=sp,Br.serializeHeaders=lp,Br.clearCache=xy,Br.makeApisTagOperation=Cy,Br.buildRequest=qp,Br.helpers={opId:sf},Br.getBaseUrl=eh;function Br(t){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"?i.url=t:i=t,!(this instanceof Br))return new Br(i);Qu()(this,i);var a=this.resolve().then(function(){return r.disableInterfaces||Qu()(r,Br.makeApisTagOperation(r)),r});return a.client=this,a}Br.prototype={http:ef,execute:function(r){return this.applyDefaults(),Br.execute(Cr({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:typeof this.url=="string"?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},r))},resolve:function(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Br.resolve(Cr({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},i)).then(function(a){return r.originalSpec=r.spec,r.spec=a.spec,r.errors=a.errors,r})}},Br.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Xd()(i,"http")){var a=Bo.parse(i);r.host||(r.host=a.host),r.schemes||(r.schemes=[a.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var Km=Br.helpers;const im=Br;var om=o(71057),am=o(72940),th=Object.defineProperty,sm=Object.defineProperties,lm=Object.getOwnPropertyDescriptor,um=Object.getOwnPropertyDescriptors,ff=Object.getOwnPropertySymbols,rh=Object.prototype.hasOwnProperty,nh=Object.prototype.propertyIsEnumerable,ed=(t,r,i)=>r in t?th(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,nn=(t,r)=>{for(var i in r||(r={}))rh.call(r,i)&&ed(t,i,r[i]);if(ff)for(var i of ff(r))nh.call(r,i)&&ed(t,i,r[i]);return t},Zn=(t,r)=>sm(t,um(r)),td=(t,r)=>{var i={};for(var a in t)rh.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&ff)for(var a of ff(t))r.indexOf(a)<0&&nh.call(t,a)&&(i[a]=t[a]);return i},fm=(t,r,i,a)=>{for(var s=a>1?void 0:a?lm(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&th(r,i,s),s},gs=(t,r,i)=>(ed(t,typeof r!="symbol"?r+"":r,i),i),ih=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function oh(t){return t.startsWith("//")?"https:"+t:t}const cm={flex:1,display:"flex",flexDirection:"column"};let rd=class extends d.Component{constructor(t){super(t);gs(this,"formApi"),gs(this,"setFormApi",(r,i=r.getState())=>{var a=i,{values:s}=a,p=td(a,["values"]);this.formApi=r,setTimeout(()=>{const y=Zn(nn({},p),{values:Zn(nn({},s),{query:(0,Vr.FU)(s.query||{})})});this.setState({form:y})},0)}),gs(this,"handleChange",r=>{var i=r,{values:a}=i,s=td(i,["values"]);const p=Zn(nn({},s),{values:Zn(nn({},a),{query:(0,Vr.FU)(a.query||{})})});this.setState({form:p}),(0,Vr.Hc)(p)}),gs(this,"handleTabChange",r=>{this.setState({activeTab:r})}),gs(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),gs(this,"handleExecute",()=>ih(this,null,function*(){var r,i,a,s,p,y,S;const{store:w,operation:E,onResponse:k}=this.props,{values:$,invalid:ae}=this.state.form;if(this.formApi.submitForm(),ae){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(i=(r=w==null?void 0:w.options.events)==null?void 0:r.tryItSent)==null||i.call(r,{eventType:zd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description});return}const re=this.props.operation.requestBody,le=re&&re.content&&re.content.active&&re.content.active.name||"";let ge=$.body;if(/json/.test(le))try{ge=JSON.parse(ge)}catch(ze){console.error(ze)}this.setState({loading:!0});const he=this.state.resolvedRawSpec,Se=(0,zt.U2)(he,["paths",E.path,(E.httpVerb||"").toLowerCase(),"servers"])||(0,zt.U2)(he,["paths",E.path,"servers"])||(0,zt.U2)(he,["servers"]);if(!Se)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const me=Se.find(ze=>this.state.server.url.endsWith(ze.url.endsWith("/")?ze.url.substring(0,ze.url.length-1):ze.url)),Fe=Date.now(),Ke=!!window.document.documentMode;let Ue,$e=$.auth;if($.auth){const ze=Object.keys($.auth)[0],et=(0,zt.dw)(ze);Ue=Zn(nn({},he),{components:Zn(nn({},he.components),{securitySchemes:Zn(nn({},he.components.securitySchemes),{[et]:Zn(nn({},he.components.securitySchemes[et]),{type:he.components.securitySchemes[et].type==="openIdConnect"?"oauth2":he.components.securitySchemes[et].type})})})}),$e=Zn(nn({},$e),{[et]:$e[ze]})}else Ue=nn({},he);const Be=w.options.corsProxyUrl;Be&&he.servers&&he.servers.length&&(Ue.servers=he.servers.map(ze=>Zn(nn({},ze),{url:Be+oh(ze.url)})));const je=((s=(a=re==null?void 0:re.content)==null?void 0:a.active)==null?void 0:s.name)||null;if(je&&ge&&as(je)){const ze=Object.values(ge);ge=ze.length>1?ze:ze[0]}const We=(ze,et)=>wt=>(this.props.store.options.sendXUserAgentInTryIt&&(wt.headers["X-User-Agent"]="Redocly Try it API console"),ze?ze(wt,et):wt),Je={userFetch:Ke&&o(54098).fetch,server:Be?Be+oh(me.url):me.url,serverVariables:this.state.server.variables,spec:Ue,pathName:E.path,method:E.httpVerb,parameters:nn(nn(nn(nn({},$.path),$.query),$.header),$.cookie),securities:{authorized:$e},requestBody:ge,requestContentType:je,responseContentType:((p=$.header)==null?void 0:p.Accept)||null,requestInterceptor:We(w.options.requestInterceptor,E)};try{const ze=yield im.execute(Je),et=ze==null?void 0:ze.data;et instanceof Blob&&(as(et.type)&&(ze.fileInfo={rawData:et,fileName:(0,Vr.AM)(ze.headers)}),ze.data=yield et.text()),k==null||k({request:Je,response:ze}),this.setState({response:ze,error:void 0})}catch(ze){ze&&ze.response&&ze.response.data instanceof Blob&&(ze.response.data=yield ze.response.data.text(),k==null||k({request:Je,response:ze.response})),this.setState({response:void 0,error:ze})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-Fe}),(S=(y=w==null?void 0:w.options.events)==null?void 0:y.tryItSent)==null||S.call(y,{eventType:zd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description})}})),this.state={form:{values:{path:(0,Vr.ZS)(t.operation.parameters,"path"),cookie:(0,Vr.ZS)(t.operation.parameters,"cookie"),header:(0,Vr.ZS)(t.operation.parameters,"header"),query:(0,Vr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return ih(this,null,function*(){const{store:t,operation:r}=this.props,i=yield t.dereferenceSpecForTryIt(r);this.setState({resolvedRawSpec:i}),this.formApi.setValues({})})}componentDidUpdate(t){t.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}render(){const{operation:t,className:r,rootElement:i}=this.props,{shaking:a,activeTab:s,form:p,response:y,loading:S,error:w}=this.state,E=!!(y||w);return d.createElement(pm,{shaking:a,className:r,rootElement:i},d.createElement(vn.k1,null,d.createElement(U,{active:s,hasResponse:E,onChange:this.handleTabChange}),this.props.onClose&&d.createElement(Ki.PZ,{onClick:this.props.onClose}," \u2715 ")),d.createElement(Ki.RE,{hidden:s!==0},this.renderRequest()),d.createElement(Ki.RE,{hidden:s!==1},this.renderResponse()),d.createElement(yo,{hasResponse:E,params:p.values,operation:t,loading:S,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:a,securityDefaults:s}=this.props,{form:p,resolvedRawSpec:y,server:S}=this.state,w=p.errors||{},E=w.path||w.cookie||w.header||w.query,k=y&&Gt.JsonPointer.get(y,r.pointer);let $=p.values&&p.values.auth&&Object.keys(p.values.auth)[0];(!$||!p.values.auth[$])&&($=void 0),$&&(p.values.auth[$].token!==void 0||p.values.auth[$].client_id!==void 0||p.values.auth[$].client_secret!==void 0)&&(!p.values.auth[$].token||!p.values.auth[$].token.access_token)&&($=void 0),$&&p.values.auth[$].username!=null&&(!p.values.auth[$].username||!p.values.auth[$].password)&&($=void 0);const ae=r.parameters||[],re=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!y&&d.createElement(d.Fragment,null,"Loading...")||d.createElement(d.Fragment,null,d.createElement(jl,{onChange:this.handleChange,getApi:this.setFormApi,style:Zn(nn({},cm),{margin:0})},d.createElement(vn.UQ,{initialActiveIdx:r.security.length&&$?1:0},r.security.length&&d.createElement(cf,{header:(0,Al.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!$&&!!w.auth,success:!!$},re?d.createElement(hm,{field:"auth",validate:cs},le=>d.createElement(om.Q,{Hook:re,props:{server:S,operation:r,onChange:le,OAuth2:Xr}})):d.createElement(Qh,{formApi:this.formApi,form:p,operation:r,activeServer:S.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&d.createElement(cf,{header:(0,Al.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!w.body},d.createElement(l,{validate:dm,console:this,body:r.requestBody,id:r.id,resolvedBody:k.requestBody,properties:a}))||null,ae.length&&d.createElement(cf,{header:(0,Al.l)("tryItParameters"),"data-cy":"parameters-trigger",error:E,renderChildrenHidden:!0},d.createElement(Xn,{operation:r,values:p.values,errors:p.errors||{}}))||null)),d.createElement(Is,{operation:r,onChange:this.handleServerChange}))}renderResponse(){const{response:t,error:r,time:i}=this.state;return d.createElement(Bs,{response:t,error:r,time:i})}};rd=fm([Wo.Pi],rd);function dm(){}function pm(t){const{shaking:r,className:i,children:a,rootElement:s}=t,[p]=(0,zt.Bs)(s);return d.createElement(Ki.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:p==null?void 0:p.width},a)}function hm(t){const{fieldApi:r,render:i,userProps:a}=Kn(nn({},t)),{setValue:s}=r,{children:p}=a;return i(d.createElement(d.Fragment,null,p(s)))}function cf(t){var r=t,{header:i,error:a,success:s}=r,p=td(r,["header","error","success"]);const y=({toggle:S,expanded:w})=>d.createElement(vn.h4,{onClick:S,isExpanded:w,"data-cy":p["data-cy"]},d.createElement(vn.xz,null,d.createElement(vn.Dx,null,i),d.createElement(Gt.ShelfIcon,{direction:w?"down":"right"})),a&&d.createElement(Gt.CrossIcon,{size:"14px",color:"#ff908b"})||null,s&&d.createElement(Gt.LockIcon,{size:"14px",color:"#56ff26"})||null);return d.createElement(vm,Zn(nn({},p),{header:y}))}const vm=(0,In.ZP)(vn.s_)`
451
+ */var jc=new WeakMap,fg=function(){function t(r){this.observers=new Map,this.obj=r}return t}(),cg=function(){function t(r,i){this.callback=r,this.observer=i}return t}();function dg(t){return jc.get(t)}function pg(t,r){return t.observers.get(r)}function hg(t,r){t.observers.delete(r.callback)}function vg(t,r){r.unobserve()}function gg(t,r){var i=[],a,s=dg(t);if(!s)s=new fg(t),jc.set(t,s);else{var p=pg(s,r);a=p&&p.observer}if(a)return a;if(a={},s.value=Gn(t),r){a.callback=r,a.next=null;var y=function(){Vc(a)},S=function(){clearTimeout(a.next),a.next=setTimeout(y)};typeof window!="undefined"&&(window.addEventListener("mouseup",S),window.addEventListener("keyup",S),window.addEventListener("mousedown",S),window.addEventListener("keydown",S),window.addEventListener("change",S))}return a.patches=i,a.object=t,a.unobserve=function(){Vc(a),clearTimeout(a.next),hg(s,a),typeof window!="undefined"&&(window.removeEventListener("mouseup",S),window.removeEventListener("keyup",S),window.removeEventListener("mousedown",S),window.removeEventListener("keydown",S),window.removeEventListener("change",S))},s.observers.set(r,new cg(r,a)),a}function Vc(t,r){r===void 0&&(r=!1);var i=jc.get(t.object);Wc(i.value,t.object,t.patches,"",r),t.patches.length&&wa(i.value,t.patches);var a=t.patches;return a.length>0&&(t.patches=[],t.callback&&t.callback(a)),a}function Wc(t,r,i,a,s){if(r!==t){typeof r.toJSON=="function"&&(r=r.toJSON());for(var p=Nc(r),y=Nc(t),S=!1,w=!1,E=y.length-1;E>=0;E--){var k=y[E],$=t[k];if(tf(r,k)&&!(r[k]===void 0&&$!==void 0&&Array.isArray(r)===!1)){var ae=r[k];typeof $=="object"&&$!=null&&typeof ae=="object"&&ae!=null?Wc($,ae,i,a+"/"+fo(k),s):$!==ae&&(S=!0,s&&i.push({op:"test",path:a+"/"+fo(k),value:Gn($)}),i.push({op:"replace",path:a+"/"+fo(k),value:Gn(ae)}))}else Array.isArray(t)===Array.isArray(r)?(s&&i.push({op:"test",path:a+"/"+fo(k),value:Gn($)}),i.push({op:"remove",path:a+"/"+fo(k)}),w=!0):(s&&i.push({op:"test",path:a,value:t}),i.push({op:"replace",path:a,value:r}),S=!0)}if(!(!w&&p.length==y.length))for(var E=0;E<p.length;E++){var k=p[E];!tf(t,k)&&r[k]!==void 0&&i.push({op:"add",path:a+"/"+fo(k),value:Gn(r[k])})}}}function yg(t,r,i){i===void 0&&(i=!1);var a=[];return Wc(t,r,a,"",i),a}const zm=Object.assign({},c,v,{JsonPatchError:mp,deepClone:Gn,escapePathComponent:fo,unescapePathComponent:vp});var mg=o(31312),xg=o.n(mg),bg=o(50361),wg=o.n(bg);const sr={add:Ag,replace:Hc,remove:Eg,merge:Cg,mergeDeep:Og,context:Tg,getIn:kg,applyPatch:Sg,parentPathMatch:Fg,flatten:Pl,fullyNormalizeArray:Rg,normalizeArray:Sp,isPromise:Mg,forEachNew:Pg,forEachNewPrimitive:Ig,isJsonPatch:Cp,isContextPatch:Ng,isPatch:of,isMutation:Op,isAdditiveMutation:nf,isGenerator:Dg,isFunction:Ep,isObject:Uo,isError:Lg};function Sg(t,r,i){if(i=i||{},r=Cr(Cr({},r),{},{path:r.path&&bp(r.path)}),r.op==="merge"){var a=$c(t,r.path);vi()(a,r.value),wa(t,[Hc(r.path,a)])}else if(r.op==="mergeDeep"){var s=$c(t,r.path);for(var p in r.value){var y=r.value[p],S=Array.isArray(y);if(S){var w=s[p]||[];s[p]=Tt()(w).call(w,y)}else if(Uo(y)&&!S){var E=Cr({},s[p]);for(var k in y)if(Object.prototype.hasOwnProperty.call(E,k)){E=xg()(wg()(E),y);break}else vi()(E,Yd({},k,y[k]));s[p]=E}else s[p]=y}}else if(r.op==="add"&&r.path===""&&Uo(r.value)){var $=or()(r.value).reduce(function(he,Se){return he.push({op:"add",path:"/".concat(bp(Se)),value:r.value[Se]}),he},[]);wa(t,$)}else if(r.op==="replace"&&r.path===""){var ae=r,re=ae.value;i.allowMetaPatches&&r.meta&&nf(r)&&(Array.isArray(r.value)||Uo(r.value))&&(re=Cr(Cr({},re),r.meta)),t=re}else if(wa(t,[r]),i.allowMetaPatches&&r.meta&&nf(r)&&(Array.isArray(r.value)||Uo(r.value))){var le=$c(t,r.path),ge=Cr(Cr({},le),r.meta);wa(t,[Hc(r.path,ge)])}return t}function bp(t){return Array.isArray(t)?t.length<1?"":"/".concat(ir()(t).call(t,function(r){return(r+"").replace(/~/g,"~0").replace(/\//g,"~1")}).join("/")):t}function Ag(t,r){return{op:"add",path:t,value:r}}function Hc(t,r,i){return{op:"replace",path:t,value:r,meta:i}}function Eg(t){return{op:"remove",path:t}}function Cg(t,r){return{type:"mutation",op:"merge",path:t,value:r}}function Og(t,r){return{type:"mutation",op:"mergeDeep",path:t,value:r}}function Tg(t,r){return{type:"context",path:t,value:r}}function Pg(t,r){try{return wp(t,Gc,r)}catch(i){return i}}function Ig(t,r){try{return wp(t,zc,r)}catch(i){return i}}function wp(t,r,i){var a,s=ir()(a=Mn()(t).call(t,nf)).call(a,function(S){return r(S.value,i,S.path)})||[],p=Pl(s),y=Ap(p);return y}function zc(t,r,i){if(i=i||[],Array.isArray(t))return ir()(t).call(t,function(s,p){return zc(s,r,Tt()(i).call(i,p))});if(Uo(t)){var a;return ir()(a=or()(t)).call(a,function(s){return zc(t[s],r,Tt()(i).call(i,s))})}return r(t,i[i.length-1],i)}function Gc(t,r,i){i=i||[];var a=[];if(i.length>0){var s=r(t,i[i.length-1],i);s&&(a=Tt()(a).call(a,s))}if(Array.isArray(t)){var p=ir()(t).call(t,function(w,E){return Gc(w,r,Tt()(i).call(i,E))});p&&(a=Tt()(a).call(a,p))}else if(Uo(t)){var y,S=ir()(y=or()(t)).call(y,function(w){return Gc(t[w],r,Tt()(i).call(i,w))});S&&(a=Tt()(a).call(a,S))}return a=Pl(a),a}function Fg(t,r){if(!Array.isArray(r))return!1;for(var i=0,a=r.length;i<a;i+=1)if(r[i]!==t[i])return!1;return!0}function kg(t,r){return r.reduce(function(i,a){return typeof a!="undefined"&&i?i[a]:i},t)}function Rg(t){return Ap(Pl(Sp(t)))}function Sp(t){return Array.isArray(t)?t:[t]}function Pl(t){var r;return Tt()(r=[]).apply(r,ma(ir()(t).call(t,function(i){return Array.isArray(i)?Pl(i):i})))}function Ap(t){return Mn()(t).call(t,function(r){return typeof r!="undefined"})}function Uo(t){return t&&hr(t)==="object"}function Mg(t){return Uo(t)&&Ep(t.then)}function Ep(t){return t&&typeof t=="function"}function Lg(t){return t instanceof Error}function Cp(t){if(of(t)){var r=t.op;return r==="add"||r==="remove"||r==="replace"}return!1}function Dg(t){return Object.prototype.toString.call(t)==="[object GeneratorFunction]"}function Op(t){return Cp(t)||of(t)&&t.type==="mutation"}function nf(t){return Op(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Ng(t){return of(t)&&t.type==="context"}function of(t){return t&&hr(t)==="object"}function $c(t,r){try{return Ol(t,r)}catch(i){return console.error(i),{}}}var Bg=o(52424),Ug=o.n(Bg),jg=o(54098),Vg=o(9779),Tp=o.n(Vg);function Pp(t,r){function i(){Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;for(var a=arguments.length,s=new Array(a),p=0;p<a;p++)s[p]=arguments[p];this.message=s[0],r&&r.apply(this,s)}return i.prototype=new Error,i.prototype.name=t,i.prototype.constructor=i,i}var Wg=o(13692),Hg=o.n(Wg),zg=o(47037),Gg=o.n(zg),$g=["properties"],Kg=["properties"],Yg=["definitions","parameters","responses","securityDefinitions","components/schemas","components/responses","components/parameters","components/securitySchemes"],Jg=["schema/example","items/example"];function Ip(t){var r=t[t.length-1],i=t[t.length-2],a=t.join("/");return $g.indexOf(r)>-1&&Kg.indexOf(i)===-1||Yg.indexOf(a)>-1||Jg.some(function(s){return a.indexOf(s)>-1})}function Xg(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.specmap,s=i.getBaseUrlForNodePath,p=s===void 0?function(E){var k;return a.getContext(Tt()(k=[]).call(k,ma(r),ma(E))).baseDoc}:s,y=i.targetKeys,S=y===void 0?["$ref","$$ref"]:y,w=[];return Hg()(t).forEach(function(){if(Oc()(S).call(S,this.key)&&Gg()(this.node)){var k=this.path,$=Tt()(r).call(r,this.path),ae=Kc(this.node,p(k));w.push(a.replace($,ae))}}),w}function Kc(t,r){var i,a=t.split("#"),s=hi(a,2),p=s[0],y=s[1],S=Bo.resolve(p||"",r||"");return y?Tt()(i="".concat(S,"#")).call(i,y):S}var Fp="application/json, application/yaml",Qg=new RegExp("^([a-z]+://|//)","i"),hs=Pp("JSONRefError",function(r,i,a){this.originalError=a,vi()(this,i||{})}),co={},kp=new(Ug()),Zg=[function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="examples"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="responses"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[3]==="requestBody"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="examples"&&t[6]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="examples"&&t[7]==="value"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="example"},function(t){return t[0]==="paths"&&t[2]==="parameters"&&t[4]==="content"&&t[6]==="examples"&&t[8]==="value"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[4]==="content"&&t[7]==="example"},function(t){return t[0]==="paths"&&t[3]==="parameters"&&t[5]==="content"&&t[7]==="examples"&&t[9]==="value"}],_g=function(r){return Zg.some(function(i){return i(r)})},qg={key:"$ref",plugin:function(r,i,a,s){var p=s.getInstance(),y=Wi()(a).call(a,0,-1);if(!(Ip(y)||_g(y))){var S=s.getContext(a),w=S.baseDoc;if(typeof r!="string")return new hs("$ref: must be a string (JSON-Ref)",{$ref:r,baseDoc:w,fullPath:a});var E=Lp(r),k=E[0],$=E[1]||"",ae;try{ae=w||k?Mp(k,w):null}catch(me){return Yc(me,{pointer:$,$ref:r,basePath:ae,fullPath:a})}var re,le;if(oy($,ae,y,s)&&!p.useCircularStructures){var ge=Kc(r,ae);return r===ge?null:sr.replace(a,ge)}if(ae==null?(le=Xc($),re=s.get(le),typeof re=="undefined"&&(re=new hs("Could not resolve reference: ".concat(r),{pointer:$,$ref:r,baseDoc:w,fullPath:a}))):(re=Dp(ae,$),re.__value!=null?re=re.__value:re=re.catch(function(me){throw Yc(me,{pointer:$,$ref:r,baseDoc:w,fullPath:a})})),re instanceof Error)return[sr.remove(a),re];var he=Kc(r,ae),Se=sr.replace(y,re,{$$ref:he});if(ae&&ae!==w)return[Se,sr.context(y,{baseDoc:ae})];try{if(!ay(s.state,Se)||p.useCircularStructures)return Se}catch(me){return null}}}},Rp=vi()(qg,{docCache:co,absoluteify:Mp,clearCache:ty,JSONRefError:hs,wrapError:Yc,getDoc:Np,split:Lp,extractFromDoc:Dp,fetchJSON:ry,extract:Jc,jsonPointerToArray:Xc,unescapeJsonPointerToken:Bp});const ey=Rp;function Mp(t,r){if(!Qg.test(t)){if(!r){var i;throw new hs(Tt()(i="Tried to resolve a relative URL, without having a basePath. path: '".concat(t,"' basePath: '")).call(i,r,"'"))}return Bo.resolve(r,t)}return t}function Yc(t,r){var i;if(t&&t.response&&t.response.body){var a;i=Tt()(a="".concat(t.response.body.code," ")).call(a,t.response.body.message)}else i=t.message;return new hs("Could not resolve reference: ".concat(i),r,t)}function Lp(t){return(t+"").split("#")}function Dp(t,r){var i=co[t];if(i&&!sr.isPromise(i))try{var a=Jc(r,i);return vi()(xa().resolve(a),{__value:a})}catch(s){return xa().reject(s)}return Np(t).then(function(s){return Jc(r,s)})}function ty(t){typeof t!="undefined"?delete co[t]:or()(co).forEach(function(r){delete co[r]})}function Np(t){var r=co[t];return r?sr.isPromise(r)?r:xa().resolve(r):(co[t]=Rp.fetchJSON(t).then(function(i){return co[t]=i,i}),co[t])}function ry(t){return(0,jg.fetch)(t,{headers:{Accept:Fp},loadSpec:!0}).then(function(r){return r.text()}).then(function(r){return tp().safeLoad(r)})}function Jc(t,r){var i=Xc(t);if(i.length<1)return r;var a=sr.getIn(r,i);if(typeof a=="undefined")throw new hs("Could not resolve pointer: ".concat(t," does not exist in document"),{pointer:t});return a}function Xc(t){var r;if(typeof t!="string")throw new TypeError("Expected a string, got a ".concat(hr(t)));return t[0]==="/"&&(t=t.substr(1)),t===""?[]:ir()(r=t.split("/")).call(r,Bp)}function Bp(t){return typeof t!="string"?t:Tp().unescape(t.replace(/~1/g,"/").replace(/~0/g,"~"))}function Up(t){return Tp().escape(t.replace(/~/g,"~0").replace(/\//g,"~1"))}function ny(t){return t.length===0?"":"/".concat(ir()(t).call(t,Up).join("/"))}var iy=function(r){return!r||r==="/"||r==="#"};function Qc(t,r){if(iy(r))return!0;var i=t.charAt(r.length),a=Wi()(r).call(r,-1);return t.indexOf(r)===0&&(!i||i==="/"||i==="#")&&a!=="#"}function oy(t,r,i,a){var s,p,y=kp.get(a);y||(y={},kp.set(a,y));var S=ny(i),w=Tt()(s="".concat(r||"<specmap-base>","#")).call(s,t),E=S.replace(/allOf\/\d+\/?/g,""),k=a.contextTree.get([]).baseDoc;if(r==k&&Qc(E,t))return!0;var $="",ae=i.some(function(re){var le;return $=Tt()(le="".concat($,"/")).call(le,Up(re)),y[$]&&y[$].some(function(ge){return Qc(ge,w)||Qc(w,ge)})});if(ae)return!0;y[E]=Tt()(p=y[E]||[]).call(p,w)}function ay(t,r){var i=[t];return r.path.reduce(function(s,p){return i.push(s[p]),s[p]},t),a(r.value);function a(s){return sr.isObject(s)&&(i.indexOf(s)>=0||or()(s).some(function(p){return a(s[p])}))}}var sy=o(41609),ly=o.n(sy);const uy={key:"allOf",plugin:function(r,i,a,s,p){if(!(p.meta&&p.meta.$$ref)){var y=Wi()(a).call(a,0,-1);if(!Ip(y)){if(!Array.isArray(r)){var S=new TypeError("allOf must be an array");return S.fullPath=a,S}var w=!1,E=p.value;if(y.forEach(function(ae){!E||(E=E[ae])}),E=Cr({},E),!ly()(E)){delete E.allOf;var k=[];if(k.push(s.replace(y,{})),r.forEach(function(ae,re){if(!s.isObject(ae)){if(w)return null;w=!0;var le=new TypeError("Elements in allOf must be objects");return le.fullPath=a,k.push(le)}k.push(s.mergeDeep(y,ae));var ge=Wi()(a).call(a,0,-1),he=Xg(ae,ge,{getBaseUrlForNodePath:function(me){var Fe;return s.getContext(Tt()(Fe=[]).call(Fe,ma(a),[re],ma(me))).baseDoc},specmap:s});k.push.apply(k,ma(he))}),k.push(s.mergeDeep(y,E)),!E.$$ref){var $;k.push(s.remove(Tt()($=[]).call($,y,"$$ref")))}return k}}}}},fy={key:"parameters",plugin:function(r,i,a,s){if(Array.isArray(r)&&r.length){var p=vi()([],r),y=Wi()(a).call(a,0,-1),S=Cr({},sr.getIn(s.spec,y));return r.forEach(function(w,E){try{p[E].default=s.parameterMacro(S,w)}catch($){var k=new Error($);return k.fullPath=a,k}}),sr.replace(a,p)}return sr.replace(a,r)}},cy={key:"properties",plugin:function(r,i,a,s){var p=Cr({},r);for(var y in r)try{p[y].default=s.modelPropertyMacro(p[y])}catch(E){var S=new Error(E);return S.fullPath=a,S}var w=sr.replace(a,p);return w}};var dy=function(){function t(r){Ic(this,t),this.root=Zc(r||{})}return Fc(t,[{key:"set",value:function(i,a){var s=this.getParent(i,!0);if(!s){af(this.root,a,null);return}var p=i[i.length-1],y=s.children;if(y[p]){af(y[p],a,s);return}y[p]=Zc(a,s)}},{key:"get",value:function(i){if(i=i||[],i.length<1)return this.root.value;for(var a=this.root,s,p,y=0;y<i.length&&(p=i[y],s=a.children,!!s[p]);y+=1)a=s[p];return a&&a.protoValue}},{key:"getParent",value:function(i,a){return!i||i.length<1?null:i.length<2?this.root:Wi()(i).call(i,0,-1).reduce(function(s,p){if(!s)return s;var y=s.children;return!y[p]&&a&&(y[p]=Zc(null,s)),y[p]},this.root)}}]),t}();function Zc(t,r){return af({children:{}},t,r)}function af(t,r,i){return t.value=r||{},t.protoValue=i?Cr(Cr({},i.protoValue),t.value):t.value,or()(t.children).forEach(function(a){var s=t.children[a];t.children[a]=af(s,s.value,t)}),t}var jp=100,py=function(){function t(r){var i=this,a,s;Ic(this,t),vi()(this,{spec:"",debugLevel:"info",plugins:[],pluginHistory:{},errors:[],mutations:[],promisedPatches:[],state:{},patches:[],context:{},contextTree:new dy,showDebug:!1,allPatches:[],pluginProp:"specMap",libMethods:vi()(Object.create(this),sr,{getInstance:function(){return i}}),allowMetaPatches:!1},r),this.get=this._get.bind(this),this.getContext=this._getContext.bind(this),this.hasRun=this._hasRun.bind(this),this.wrappedPlugins=Mn()(a=ir()(s=this.plugins).call(s,this.wrapPlugin.bind(this))).call(a,sr.isFunction),this.patches.push(sr.add([],this.spec)),this.patches.push(sr.context([],this.context)),this.updatePatches(this.patches)}return Fc(t,[{key:"debug",value:function(i){if(this.debugLevel===i){for(var a,s=arguments.length,p=new Array(s>1?s-1:0),y=1;y<s;y++)p[y-1]=arguments[y];(a=console).log.apply(a,p)}}},{key:"verbose",value:function(i){if(this.debugLevel==="verbose"){for(var a,s,p=arguments.length,y=new Array(p>1?p-1:0),S=1;S<p;S++)y[S-1]=arguments[S];(a=console).log.apply(a,Tt()(s=["[".concat(i,"] ")]).call(s,y))}}},{key:"wrapPlugin",value:function(i,a){var s=this.pathDiscriminator,p=null,y;return i[this.pluginProp]?(p=i,y=i[this.pluginProp]):sr.isFunction(i)?y=i:sr.isObject(i)&&(y=S(i)),vi()(y.bind(p),{pluginName:i.name||a,isGenerator:sr.isGenerator(y)});function S(w){var E=function($,ae){return Array.isArray($)?$.every(function(re,le){return re===ae[le]}):!0};return Vi().mark(function k($,ae){var re,le,ge,he,Se,me;return Vi().wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:me=function($e,Be,je){var We,Je,ze,et,wt,Dt,Wt,lr,Mr,Or,Kr,Sr,Ur;return Vi().wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(sr.isObject($e)){Xt.next=6;break}if(w.key!==Be[Be.length-1]){Xt.next=4;break}return Xt.next=4,w.plugin($e,w.key,Be,ae);case 4:Xt.next=30;break;case 6:We=Be.length-1,Je=Be[We],ze=Be.indexOf("properties"),et=Je==="properties"&&We===ze,wt=ae.allowMetaPatches&&le[$e.$$ref],Dt=0,Wt=or()($e);case 12:if(!(Dt<Wt.length)){Xt.next=30;break}if(lr=Wt[Dt],Mr=$e[lr],Or=Tt()(Be).call(Be,lr),Kr=sr.isObject(Mr),Sr=$e.$$ref,wt){Xt.next=22;break}if(!Kr){Xt.next=22;break}return ae.allowMetaPatches&&Sr&&(le[Sr]=!0),Xt.delegateYield(me(Mr,Or,je),"t0",22);case 22:if(!(!et&&lr===w.key)){Xt.next=27;break}if(Ur=E(s,Be),!(!s||Ur)){Xt.next=27;break}return Xt.next=27,w.plugin(Mr,lr,Or,ae,je);case 27:Dt++,Xt.next=12;break;case 30:case"end":return Xt.stop()}},re)},re=Vi().mark(me),le={},ge=ya(Mn()($).call($,sr.isAdditiveMutation)),Ke.prev=4,ge.s();case 6:if((he=ge.n()).done){Ke.next=11;break}return Se=he.value,Ke.delegateYield(me(Se.value,Se.path,Se),"t0",9);case 9:Ke.next=6;break;case 11:Ke.next=16;break;case 13:Ke.prev=13,Ke.t1=Ke.catch(4),ge.e(Ke.t1);case 16:return Ke.prev=16,ge.f(),Ke.finish(16);case 19:case"end":return Ke.stop()}},k,null,[[4,13,16,19]])})}}},{key:"nextPlugin",value:function(){var i=this;return ng()(this.wrappedPlugins,function(a){var s=i.getMutationsForPlugin(a);return s.length>0})}},{key:"nextPromisedPatch",value:function(){if(this.promisedPatches.length>0){var i;return xa().race(ir()(i=this.promisedPatches).call(i,function(a){return a.value}))}}},{key:"getPluginHistory",value:function(i){var a=this.constructor.getPluginName(i);return this.pluginHistory[a]||[]}},{key:"getPluginRunCount",value:function(i){return this.getPluginHistory(i).length}},{key:"getPluginHistoryTip",value:function(i){var a=this.getPluginHistory(i),s=a&&a[a.length-1];return s||{}}},{key:"getPluginMutationIndex",value:function(i){var a=this.getPluginHistoryTip(i).mutationIndex;return typeof a!="number"?-1:a}},{key:"updatePluginHistory",value:function(i,a){var s=this.constructor.getPluginName(i);this.pluginHistory[s]=this.pluginHistory[s]||[],this.pluginHistory[s].push(a)}},{key:"updatePatches",value:function(i){var a=this;sr.normalizeArray(i).forEach(function(s){if(s instanceof Error){a.errors.push(s);return}try{if(!sr.isObject(s)){a.debug("updatePatches","Got a non-object patch",s);return}if(a.showDebug&&a.allPatches.push(s),sr.isPromise(s.value)){a.promisedPatches.push(s),a.promisedPatchThen(s);return}if(sr.isContextPatch(s)){a.setContext(s.path,s.value);return}if(sr.isMutation(s)){a.updateMutations(s);return}}catch(p){console.error(p),a.errors.push(p)}})}},{key:"updateMutations",value:function(i){hr(i.value)==="object"&&!Array.isArray(i.value)&&this.allowMetaPatches&&(i.value=Cr({},i.value));var a=sr.applyPatch(this.state,i,{allowMetaPatches:this.allowMetaPatches});a&&(this.mutations.push(i),this.state=a)}},{key:"removePromisedPatch",value:function(i){var a,s=this.promisedPatches.indexOf(i);if(s<0){this.debug("Tried to remove a promisedPatch that isn't there!");return}tg()(a=this.promisedPatches).call(a,s,1)}},{key:"promisedPatchThen",value:function(i){var a=this;return i.value=i.value.then(function(s){var p=Cr(Cr({},i),{},{value:s});a.removePromisedPatch(i),a.updatePatches(p)}).catch(function(s){a.removePromisedPatch(i),a.updatePatches(s)}),i.value}},{key:"getMutations",value:function(i,a){var s;return i=i||0,typeof a!="number"&&(a=this.mutations.length),Wi()(s=this.mutations).call(s,i,a)}},{key:"getCurrentMutations",value:function(){return this.getMutationsForPlugin(this.getCurrentPlugin())}},{key:"getMutationsForPlugin",value:function(i){var a=this.getPluginMutationIndex(i);return this.getMutations(a+1)}},{key:"getCurrentPlugin",value:function(){return this.currentPlugin}},{key:"getLib",value:function(){return this.libMethods}},{key:"_get",value:function(i){return sr.getIn(this.state,i)}},{key:"_getContext",value:function(i){return this.contextTree.get(i)}},{key:"setContext",value:function(i,a){return this.contextTree.set(i,a)}},{key:"_hasRun",value:function(i){var a=this.getPluginRunCount(this.getCurrentPlugin());return a>(i||0)}},{key:"dispatch",value:function(){var i=this,a=this,s=this.nextPlugin();if(!s){var p=this.nextPromisedPatch();if(p)return p.then(function(){return i.dispatch()}).catch(function(){return i.dispatch()});var y={spec:this.state,errors:this.errors};return this.showDebug&&(y.patches=this.allPatches),xa().resolve(y)}if(a.pluginCount=a.pluginCount||{},a.pluginCount[s]=(a.pluginCount[s]||0)+1,a.pluginCount[s]>jp){var S;return xa().resolve({spec:a.state,errors:Tt()(S=a.errors).call(S,new Error("We've reached a hard limit of ".concat(jp," plugin runs")))})}if(s!==this.currentPlugin&&this.promisedPatches.length){var w,E=ir()(w=this.promisedPatches).call(w,function(ae){return ae.value});return xa().all(ir()(E).call(E,function(ae){return ae.then(hp(),hp())})).then(function(){return i.dispatch()})}return k();function k(){a.currentPlugin=s;var ae=a.getCurrentMutations(),re=a.mutations.length-1;try{if(s.isGenerator){var le=ya(s(ae,a.getLib())),ge;try{for(le.s();!(ge=le.n()).done;){var he=ge.value;$(he)}}catch(me){le.e(me)}finally{le.f()}}else{var Se=s(ae,a.getLib());$(Se)}}catch(me){console.error(me),$([vi()(Object.create(me),{plugin:s})])}finally{a.updatePluginHistory(s,{mutationIndex:re})}return a.dispatch()}function $(ae){ae&&(ae=sr.fullyNormalizeArray(ae),a.updatePatches(ae,s))}}}],[{key:"getPluginName",value:function(i){return i.pluginName}},{key:"getPatchesOfType",value:function(i,a){return Mn()(i).call(i,a)}}]),t}();function hy(t){return new py(t).dispatch()}var Sa={refs:ey,allOf:uy,parameters:fy,properties:cy},vy=o(13218),Vp=o.n(vy),Wp=function(r){return String.prototype.toLowerCase.call(r)},Hp=function(r){return r.replace(/[^\w]/gi,"_")};function zp(t){var r=t.openapi;return r?Xd()(r,"3"):!1}function Gm(t){var r=t.swagger;return r?startsWith(r,"2"):!1}function sf(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=a.v2OperationIdCompatibilityMode;if(!t||hr(t)!=="object")return null;var p=(t.operationId||"").replace(/\s/g,"");return p.length?Hp(t.operationId):gy(r,i,{v2OperationIdCompatibilityMode:s})}function gy(t,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=a.v2OperationIdCompatibilityMode;if(s){var p,y,S=Tt()(p="".concat(r.toLowerCase(),"_")).call(p,t).replace(/[\s!@#$%^&*()_+=[{\]};:<>|./?,\\'""-]/g,"_");return S=S||Tt()(y="".concat(t.substring(1),"_")).call(y,r),S.replace(/((_){2,})/g,"_").replace(/^(_)*/g,"").replace(/([_])*$/g,"")}return Tt()(i="".concat(Wp(r))).call(i,Hp(t))}function Gp(t,r){var i;return Tt()(i="".concat(Wp(r),"-")).call(i,t)}function yy(t,r){return!t||!t.paths?null:my(t,function(i){var a=i.pathName,s=i.method,p=i.operation;if(!p||hr(p)!=="object")return!1;var y=p.operationId,S=sf(p,a,s),w=Gp(a,s);return[S,w,y].some(function(E){return E&&E===r})})}function my(t,r){return $p(t,r,!0)||null}function $p(t,r,i){if(!t||hr(t)!=="object"||!t.paths||hr(t.paths)!=="object")return null;var a=t.paths;for(var s in a)for(var p in a[s])if(p.toUpperCase()!=="PARAMETERS"){var y=a[s][p];if(!(!y||hr(y)!=="object")){var S={spec:t,pathName:s,method:p.toUpperCase(),operation:y},w=r(S);if(i&&w)return S}}}function Kp(t){var r=t.spec,i=r.paths,a={};if(!i||r.$$normalized)return t;for(var s in i){var p=i[s];if(!!Vp()(p)){var y=p.parameters,S=function($){var ae=p[$];if(!Vp()(ae))return"continue";var re=sf(ae,s,$);if(re){a[re]?a[re].push(ae):a[re]=[ae];var le=a[re];if(le.length>1)le.forEach(function(Je,ze){var et;Je.__originalOperationId=Je.__originalOperationId||Je.operationId,Je.operationId=Tt()(et="".concat(re)).call(et,ze+1)});else if(typeof ae.operationId!="undefined"){var ge=le[0];ge.__originalOperationId=ge.__originalOperationId||ae.operationId,ge.operationId=re}}if($!=="parameters"){var he=[],Se={};for(var me in r)(me==="produces"||me==="consumes"||me==="security")&&(Se[me]=r[me],he.push(Se));if(y&&(Se.parameters=y,he.push(Se)),he.length){var Fe=ya(he),Ke;try{for(Fe.s();!(Ke=Fe.n()).done;){var Ue=Ke.value;for(var $e in Ue)if(!ae[$e])ae[$e]=Ue[$e];else if($e==="parameters"){var Be=ya(Ue[$e]),je;try{var We=function(){var ze=je.value,et=ae[$e].some(function(wt){return wt.name&&wt.name===ze.name||wt.$ref&&wt.$ref===ze.$ref||wt.$$ref&&wt.$$ref===ze.$$ref||wt===ze});et||ae[$e].push(ze)};for(Be.s();!(je=Be.n()).done;)We()}catch(Je){Be.e(Je)}finally{Be.f()}}}}catch(Je){Fe.e(Je)}finally{Fe.f()}}}};for(var w in p)var E=S(w)}}return r.$$normalized=!0,t}function Yp(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.requestInterceptor,a=r.responseInterceptor,s=t.withCredentials?"include":"same-origin";return function(p){return t({url:p,loadSpec:!0,requestInterceptor:i,responseInterceptor:a,headers:{Accept:Fp},credentials:s}).then(function(y){return y.body})}}function xy(){Sa.refs.clearCache()}function Jp(t){var r=t.fetch,i=t.spec,a=t.url,s=t.mode,p=t.allowMetaPatches,y=p===void 0?!0:p,S=t.pathDiscriminator,w=t.modelPropertyMacro,E=t.parameterMacro,k=t.requestInterceptor,$=t.responseInterceptor,ae=t.skipNormalization,re=t.useCircularStructures,le=t.http,ge=t.baseDoc;if(ge=ge||a,le=r||le||ef,!i)return Yp(le,{requestInterceptor:k,responseInterceptor:$})(ge).then(he);return he(i);function he(Se){ge&&(Sa.refs.docCache[ge]=Se),Sa.refs.fetchJSON=Yp(le,{requestInterceptor:k,responseInterceptor:$});var me=[Sa.refs];return typeof E=="function"&&me.push(Sa.parameters),typeof w=="function"&&me.push(Sa.properties),s!=="strict"&&me.push(Sa.allOf),hy({spec:Se,context:{baseDoc:ge},plugins:me,allowMetaPatches:y,pathDiscriminator:S,parameterMacro:E,modelPropertyMacro:w,useCircularStructures:re}).then(ae?function(){var Fe=Cc(Vi().mark(function Ke(Ue){return Vi().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.abrupt("return",Ue);case 1:case"end":return Be.stop()}},Ke)}));return function(Ke){return Fe.apply(this,arguments)}}():Kp)}}var by=o(27361),Il=o.n(by);function wy(t,r){return _c.apply(this,arguments)}function _c(){return _c=Cc(Vi().mark(function t(r,i){var a,s,p,y,S,w,E,k,$,ae,re,le,ge=arguments;return Vi().wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return a=ge.length>2&&ge[2]!==void 0?ge[2]:{},s=a.returnEntireTree,p=a.baseDoc,y=a.requestInterceptor,S=a.responseInterceptor,w=a.parameterMacro,E=a.modelPropertyMacro,k=a.useCircularStructures,$={pathDiscriminator:i,baseDoc:p,requestInterceptor:y,responseInterceptor:S,parameterMacro:w,modelPropertyMacro:E,useCircularStructures:k},ae=Kp({spec:r}),re=ae.spec,Se.next=6,Jp(Cr(Cr({},$),{},{spec:re,allowMetaPatches:!0,skipNormalization:!0}));case 6:return le=Se.sent,!s&&Array.isArray(i)&&i.length&&(le.spec=Il()(le.spec,i)||null),Se.abrupt("return",le);case 9:case"end":return Se.stop()}},t)})),_c.apply(this,arguments)}var Sy=function(){return null},Ay=function(r){return Array.isArray(r)?r:[r]},lf={mapTagOperations:Oy,makeExecute:Ey};function Ey(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(r){var i=r.pathName,a=r.method,s=r.operationId;return function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.execute(Cr(Cr({spec:t.spec},Pc()(t,"requestInterceptor","responseInterceptor","userFetch")),{},{pathName:i,method:a,parameters:p,operationId:s},y))}}}function $m(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=lf.makeExecute(t),i=lf.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r}),a={};for(var s in i){a[s]={operations:{}};for(var p in i[s])a[s].operations[p]={execute:i[s][p]}}return{apis:a}}function Cy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=lf.makeExecute(t);return{apis:lf.mapTagOperations({v2OperationIdCompatibilityMode:t.v2OperationIdCompatibilityMode,spec:t.spec,cb:r})}}function Oy(t){var r=t.spec,i=t.cb,a=i===void 0?Sy:i,s=t.defaultTag,p=s===void 0?"default":s,y=t.v2OperationIdCompatibilityMode,S={},w={};return $p(r,function(E){var k=E.pathName,$=E.method,ae=E.operation,re=ae.tags?Ay(ae.tags):[p];re.forEach(function(le){if(typeof le=="string"){w[le]=w[le]||{};var ge=w[le],he=sf(ae,k,$,{v2OperationIdCompatibilityMode:y}),Se=a({spec:r,pathName:k,method:$,operation:ae,operationId:he});if(S[he]){var me;S[he]+=1,ge[Tt()(me="".concat(he)).call(me,S[he])]=Se}else if(typeof ge[he]!="undefined"){var Fe,Ke,Ue=S[he]||1;S[he]=Ue+1,ge[Tt()(Fe="".concat(he)).call(Fe,S[he])]=Se;var $e=ge[he];delete ge[he],ge[Tt()(Ke="".concat(he)).call(Ke,Ue)]=$e}else ge[he]=Se}})}),w}var Xp=o(95683);function Ty(t,r){if(t==null)return{};var i={},a=Gd(t),s,p;for(p=0;p<a.length;p++)s=a[p],!(Xp(r).call(r,s)>=0)&&(i[s]=t[s]);return i}function Py(t,r){if(t==null)return{};var i=Ty(t,r),a,s;if(Xu){var p=Xu(t);for(s=0;s<p.length;s++)a=p[s],!(Xp(r).call(r,a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(i[a]=t[a]))}return i}var Iy=o(68630),Qp=o.n(Iy),Fy=o(1469),ky=o.n(Fy),Ry=o(76489);const My={body:Ly,header:Ny,query:Uy,path:By,formData:Dy};function Ly(t){var r=t.req,i=t.value;r.body=i}function Dy(t){var r=t.req,i=t.value,a=t.parameter;(i||a.allowEmptyValue)&&(r.form=r.form||{},r.form[a.name]={value:i,allowEmptyValue:a.allowEmptyValue,collectionFormat:a.collectionFormat})}function Ny(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{},typeof a!="undefined"&&(r.headers[i.name]=a)}function By(t){var r=t.req,i=t.value,a=t.parameter;r.url=r.url.split("{".concat(a.name,"}")).join(encodeURIComponent(i))}function Uy(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},i===!1&&a.type==="boolean"&&(i="false"),i===0&&["number","integer"].indexOf(a.type)>-1&&(i="0"),i)r.query[a.name]={collectionFormat:a.collectionFormat,value:i};else if(a.allowEmptyValue&&i!==void 0){var s=a.name;r.query[s]=r.query[s]||{},r.query[s].allowEmptyValue=!0}}function uf(t,r){return Oc()(r).call(r,"application/json")?typeof t=="string"?t:Zu()(t):t.toString()}function jy(t){var r=t.req,i=t.value,a=t.parameter,s=a.name,p=a.style,y=a.explode,S=a.content;if(S){var w=or()(S)[0];r.url=r.url.split("{".concat(s,"}")).join(ds(uf(i,w),{escape:!0}));return}var E=Rc({key:a.name,value:i,style:p||"simple",explode:y||!1,escape:!0});r.url=r.url.split("{".concat(s,"}")).join(E)}function Vy(t){var r=t.req,i=t.value,a=t.parameter;if(r.query=r.query||{},a.content){var s=or()(a.content)[0];r.query[a.name]=uf(i,s);return}if(i===!1&&(i="false"),i===0&&(i="0"),i)r.query[a.name]={value:i,serializationOption:Pc()(a,["style","explode","allowReserved"])};else if(a.allowEmptyValue&&i!==void 0){var p=a.name;r.query[p]=r.query[p]||{},r.query[p].allowEmptyValue=!0}}var Wy=["accept","authorization","content-type"];function Hy(t){var r=t.req,i=t.parameter,a=t.value;if(r.headers=r.headers||{},!(Wy.indexOf(i.name.toLowerCase())>-1)){if(i.content){var s=or()(i.content)[0];r.headers[i.name]=uf(a,s);return}typeof a!="undefined"&&(r.headers[i.name]=Rc({key:i.name,value:a,style:i.style||"simple",explode:typeof i.explode=="undefined"?!1:i.explode,escape:!1}))}}function zy(t){var r=t.req,i=t.parameter,a=t.value;r.headers=r.headers||{};var s=hr(a);if(i.content){var p,y=or()(i.content)[0];r.headers.Cookie=Tt()(p="".concat(i.name,"=")).call(p,uf(a,y));return}if(s!=="undefined"){var S=s==="object"&&!Array.isArray(a)&&i.explode?"":"".concat(i.name,"=");r.headers.Cookie=S+Rc({key:i.name,value:a,escape:!1,style:i.style||"form",explode:typeof i.explode=="undefined"?!1:i.explode})}}var Gy=o(50706),Zp=o.n(Gy);function $y(t,r){var i=t.operation,a=t.requestBody,s=t.securities,p=t.spec,y=t.attachContentTypeForEmptyPayload,S=t.requestContentType;r=Ky({request:r,securities:s,operation:i,spec:p});var w=i.requestBody||{},E=or()(w.content||{}),k=S&&E.indexOf(S)>-1;if(a||y){if(S&&k)r.headers["Content-Type"]=S;else if(!S){var $=E[0];$&&(r.headers["Content-Type"]=$,S=$)}}else S&&k&&(r.headers["Content-Type"]=S);if(!t.responseContentType&&i.responses){var ae,re=Mn()(ae=ep()(i.responses)).call(ae,function(ge){var he=hi(ge,2),Se=he[0],me=he[1],Fe=parseInt(Se,10);return Fe>=200&&Fe<300&&Qp()(me.content)}).reduce(function(ge,he){var Se=hi(he,2),me=Se[1];return Tt()(ge).call(ge,or()(me.content))},[]);re.length>0&&(r.headers.accept=re.join(", "))}if(a)if(S){if(E.indexOf(S)>-1)if(S==="application/x-www-form-urlencoded"||S==="multipart/form-data")if(hr(a)==="object"){var le=(w.content[S]||{}).encoding||{};r.form={},or()(a).forEach(function(ge){r.form[ge]={value:a[ge],encoding:le[ge]||{}}})}else r.form=a;else r.body=a}else r.body=a;return r}function Ky(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,S=Qu()({},r),w=a.authorized,E=w===void 0?{}:w,k=p.security||y.security||[],$=E&&!!or()(E).length,ae=Il()(y,["components","securitySchemes"])||{};return S.headers=S.headers||{},S.query=S.query||{},!or()(a).length||!$||!k||Array.isArray(p.security)&&!p.security.length?r:(k.forEach(function(re){or()(re).forEach(function(le){var ge=E[le],he=ae[le];if(!!ge){var Se=ge.value||ge,me=he.type;if(ge){if(me==="apiKey")he.in==="query"&&(S.query[he.name]=Se),he.in==="header"&&(S.headers[he.name]=Se),he.in==="cookie"&&(S.cookies[he.name]=Se);else if(me==="http"){if(/^basic$/i.test(he.scheme)){var Fe,Ke=Se.username||"",Ue=Se.password||"",$e=Zp()(Tt()(Fe="".concat(Ke,":")).call(Fe,Ue));S.headers.Authorization="Basic ".concat($e)}/^bearer$/i.test(he.scheme)&&(S.headers.Authorization="Bearer ".concat(Se))}else if(me==="oauth2"||me==="openIdConnect"){var Be,je=ge.token||{},We=he["x-tokenName"]||"access_token",Je=je[We],ze=je.token_type;(!ze||ze.toLowerCase()==="bearer")&&(ze="Bearer"),S.headers.Authorization=Tt()(Be="".concat(ze," ")).call(Be,Je)}}}})}),S)}function Yy(t,r){var i=t.spec,a=t.operation,s=t.securities,p=t.requestContentType,y=t.responseContentType,S=t.attachContentTypeForEmptyPayload;if(r=Jy({request:r,securities:s,operation:a,spec:i}),r.body||r.form||S){var w,E;if(p)r.headers["Content-Type"]=p;else if(Array.isArray(a.consumes)){var k=hi(a.consumes,1);r.headers["Content-Type"]=k[0]}else if(Array.isArray(i.consumes)){var $=hi(i.consumes,1);r.headers["Content-Type"]=$[0]}else a.parameters&&Mn()(w=a.parameters).call(w,function(he){return he.type==="file"}).length?r.headers["Content-Type"]="multipart/form-data":a.parameters&&Mn()(E=a.parameters).call(E,function(he){return he.in==="formData"}).length&&(r.headers["Content-Type"]="application/x-www-form-urlencoded")}else if(p){var ae,re,le=a.parameters&&Mn()(ae=a.parameters).call(ae,function(he){return he.in==="body"}).length>0,ge=a.parameters&&Mn()(re=a.parameters).call(re,function(he){return he.in==="formData"}).length>0;(le||ge)&&(r.headers["Content-Type"]=p)}return!y&&Array.isArray(a.produces)&&a.produces.length>0&&(r.headers.accept=a.produces.join(", ")),r}function Jy(t){var r=t.request,i=t.securities,a=i===void 0?{}:i,s=t.operation,p=s===void 0?{}:s,y=t.spec,S=Qu()({},r),w=a.authorized,E=w===void 0?{}:w,k=a.specSecurity,$=k===void 0?[]:k,ae=p.security||$,re=E&&!!or()(E).length,le=y.securityDefinitions;return S.headers=S.headers||{},S.query=S.query||{},!or()(a).length||!re||!ae||Array.isArray(p.security)&&!p.security.length?r:(ae.forEach(function(ge){or()(ge).forEach(function(he){var Se=E[he];if(!!Se){var me=Se.token,Fe=Se.value||Se,Ke=le[he],Ue=Ke.type,$e=Ke["x-tokenName"]||"access_token",Be=me&&me[$e],je=me&&me.token_type;if(Se){if(Ue==="apiKey"){var We=Ke.in==="query"?"query":"headers";S[We]=S[We]||{},S[We][Ke.name]=Fe}else if(Ue==="basic")if(Fe.header)S.headers.authorization=Fe.header;else{var Je,ze=Fe.username||"",et=Fe.password||"";Fe.base64=Zp()(Tt()(Je="".concat(ze,":")).call(Je,et)),S.headers.authorization="Basic ".concat(Fe.base64)}else if(Ue==="oauth2"&&Be){var wt;je=!je||je.toLowerCase()==="bearer"?"Bearer":je,S.headers.authorization=Tt()(wt="".concat(je," ")).call(wt,Be)}}}})}),S)}var _p=function(r){return Array.isArray(r)?r:[]},Xy=Pp("OperationNotFoundError",function(r,i,a){this.originalError=a,vi()(this,i||{})}),Qy=function(r,i){return Mn()(i).call(i,function(a){return a.name===r})},Zy=function(r){var i={};r.forEach(function(s){i[s.in]||(i[s.in]={}),i[s.in][s.name]=s});var a=[];return or()(i).forEach(function(s){or()(i[s]).forEach(function(p){a.push(i[s][p])})}),a},_y={buildRequest:qp};function qy(t){var r=t.http,i=t.fetch,a=t.spec,s=t.operationId,p=t.pathName,y=t.method,S=t.parameters,w=t.securities,E=Py(t,["http","fetch","spec","operationId","pathName","method","parameters","securities"]),k=r||i||ef;p&&y&&!s&&(s=Gp(p,y));var $=_y.buildRequest(Cr({spec:a,operationId:s,parameters:S,securities:w,http:k},E));return $.body&&(Qp()($.body)||ky()($.body))&&($.body=Zu()($.body)),k($)}function qp(t){var r,i,a=t.spec,s=t.operationId,p=t.responseContentType,y=t.scheme,S=t.requestInterceptor,w=t.responseInterceptor,E=t.contextUrl,k=t.userFetch,$=t.server,ae=t.serverVariables,re=t.http,le=t.parameters,ge=t.parameterBuilders,he=zp(a);ge||(he?ge=x:ge=My);var Se=re&&re.withCredentials?"include":"same-origin",me={url:"",credentials:Se,headers:{},cookies:{}};S&&(me.requestInterceptor=S),w&&(me.responseInterceptor=w),k&&(me.userFetch=k);var Fe=yy(a,s);if(!Fe)throw new Xy("Operation ".concat(s," not found"));var Ke=Fe.operation,Ue=Ke===void 0?{}:Ke,$e=Fe.method,Be=Fe.pathName;if(me.url+=eh({spec:a,scheme:y,contextUrl:E,server:$,serverVariables:ae,pathName:Be,method:$e}),!s)return delete me.cookies,me;me.url+=Be,me.method="".concat($e).toUpperCase(),le=le||{};var je=a.paths[Be]||{};p&&(me.headers.accept=p);var We=Zy(Tt()(r=Tt()(i=[]).call(i,_p(Ue.parameters))).call(r,_p(je.parameters)));We.forEach(function(et){var wt=ge[et.in],Dt;if(et.in==="body"&&et.schema&&et.schema.properties&&(Dt=le),Dt=et&&et.name&&le[et.name],typeof Dt=="undefined"){var Wt;Dt=et&&et.name&&le[Tt()(Wt="".concat(et.in,".")).call(Wt,et.name)]}else if(Qy(et.name,We).length>1){var lr;console.warn(Tt()(lr="Parameter '".concat(et.name,"' is ambiguous because the defined spec has more than one parameter with the name: '")).call(lr,et.name,"' and the passed-in parameter values did not define an 'in' value."))}if(Dt!==null){if(typeof et.default!="undefined"&&typeof Dt=="undefined"&&(Dt=et.default),typeof Dt=="undefined"&&et.required&&!et.allowEmptyValue)throw new Error("Required parameter ".concat(et.name," is not provided"));if(he&&et.schema&&et.schema.type==="object"&&typeof Dt=="string")try{Dt=JSON.parse(Dt)}catch(Mr){throw new Error("Could not parse object parameter value string as JSON")}wt&&wt({req:me,parameter:et,value:Dt,operation:Ue,spec:a})}});var Je=Cr(Cr({},t),{},{operation:Ue});if(he?me=$y(Je,me):me=Yy(Je,me),me.cookies&&or()(me.cookies).length){var ze=or()(me.cookies).reduce(function(et,wt){var Dt=me.cookies[wt],Wt=et?"&":"",lr=Ry.serialize(wt,Dt);return et+Wt+lr},"");me.headers.Cookie=ze}return me.cookies&&delete me.cookies,pp(me),me}var qc=function(r){return r?r.replace(/\W/g,""):null};function eh(t){var r=zp(t.spec);return r?em(t):nm(t)}function em(t){var r=t.spec,i=t.pathName,a=t.method,s=t.server,p=t.contextUrl,y=t.serverVariables,S=y===void 0?{}:y,w=Il()(r,["paths",i,(a||"").toLowerCase(),"servers"])||Il()(r,["paths",i,"servers"])||Il()(r,["servers"]),E="",k=null;if(s&&w&&w.length){var $=ir()(w).call(w,function(le){return le.url});$.indexOf(s)>-1&&(E=s,k=w[$.indexOf(s)])}if(!E&&w&&w.length){E=w[0].url;var ae=hi(w,1);k=ae[0]}if(E.indexOf("{")>-1){var re=rm(E);re.forEach(function(le){if(k.variables&&k.variables[le]){var ge=k.variables[le],he=S[le]||ge.default,Se=new RegExp("{".concat(le,"}"),"g");E=E.replace(Se,he)}})}return tm(E,p)}function tm(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",i=t&&r?Bo.parse(Bo.resolve(r,t)):Bo.parse(t),a=Bo.parse(r),s=qc(i.protocol)||qc(a.protocol)||"",p=i.host||a.host,y=i.pathname||"",S;if(s&&p){var w;S=Tt()(w="".concat(s,"://")).call(w,p+y)}else S=y;return S[S.length-1]==="/"?Wi()(S).call(S,0,-1):S}function rm(t){for(var r=[],i=/{([^}]+)}/g,a;a=i.exec(t);)r.push(a[1]);return r}function nm(t){var r=t.spec,i=t.scheme,a=t.contextUrl,s=a===void 0?"":a,p=Bo.parse(s),y=Array.isArray(r.schemes)?r.schemes[0]:null,S=i||y||qc(p.protocol)||"http",w=r.host||p.host||"",E=r.basePath||"",k;if(S&&w){var $;k=Tt()($="".concat(S,"://")).call($,w+E)}else k=E;return k[k.length-1]==="/"?Wi()(k).call(k,0,-1):k}Br.http=ef,Br.makeHttp=Zv.bind(null,Br.http),Br.resolve=Jp,Br.resolveSubtree=wy,Br.execute=qy,Br.serializeRes=sp,Br.serializeHeaders=lp,Br.clearCache=xy,Br.makeApisTagOperation=Cy,Br.buildRequest=qp,Br.helpers={opId:sf},Br.getBaseUrl=eh;function Br(t){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"?i.url=t:i=t,!(this instanceof Br))return new Br(i);Qu()(this,i);var a=this.resolve().then(function(){return r.disableInterfaces||Qu()(r,Br.makeApisTagOperation(r)),r});return a.client=this,a}Br.prototype={http:ef,execute:function(r){return this.applyDefaults(),Br.execute(Cr({spec:this.spec,http:this.http,securities:{authorized:this.authorizations},contextUrl:typeof this.url=="string"?this.url:void 0,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},r))},resolve:function(){var r=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Br.resolve(Cr({spec:this.spec,url:this.url,http:this.http||this.fetch,allowMetaPatches:this.allowMetaPatches,useCircularStructures:this.useCircularStructures,requestInterceptor:this.requestInterceptor||null,responseInterceptor:this.responseInterceptor||null},i)).then(function(a){return r.originalSpec=r.spec,r.spec=a.spec,r.errors=a.errors,r})}},Br.prototype.applyDefaults=function(){var r=this.spec,i=this.url;if(i&&Xd()(i,"http")){var a=Bo.parse(i);r.host||(r.host=a.host),r.schemes||(r.schemes=[a.protocol.replace(":","")]),r.basePath||(r.basePath="/")}};var Km=Br.helpers;const im=Br;var om=o(71057),am=o(72940),th=Object.defineProperty,sm=Object.defineProperties,lm=Object.getOwnPropertyDescriptor,um=Object.getOwnPropertyDescriptors,ff=Object.getOwnPropertySymbols,rh=Object.prototype.hasOwnProperty,nh=Object.prototype.propertyIsEnumerable,ed=(t,r,i)=>r in t?th(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i,nn=(t,r)=>{for(var i in r||(r={}))rh.call(r,i)&&ed(t,i,r[i]);if(ff)for(var i of ff(r))nh.call(r,i)&&ed(t,i,r[i]);return t},Zn=(t,r)=>sm(t,um(r)),td=(t,r)=>{var i={};for(var a in t)rh.call(t,a)&&r.indexOf(a)<0&&(i[a]=t[a]);if(t!=null&&ff)for(var a of ff(t))r.indexOf(a)<0&&nh.call(t,a)&&(i[a]=t[a]);return i},fm=(t,r,i,a)=>{for(var s=a>1?void 0:a?lm(r,i):r,p=t.length-1,y;p>=0;p--)(y=t[p])&&(s=(a?y(r,i,s):y(s))||s);return a&&s&&th(r,i,s),s},vs=(t,r,i)=>(ed(t,typeof r!="symbol"?r+"":r,i),i),ih=(t,r,i)=>new Promise((a,s)=>{var p=w=>{try{S(i.next(w))}catch(E){s(E)}},y=w=>{try{S(i.throw(w))}catch(E){s(E)}},S=w=>w.done?a(w.value):Promise.resolve(w.value).then(p,y);S((i=i.apply(t,r)).next())});function oh(t){return t.startsWith("//")?"https:"+t:t}const cm={flex:1,display:"flex",flexDirection:"column"};let rd=class extends d.Component{constructor(t){super(t);vs(this,"formApi"),vs(this,"setFormApi",(r,i=r.getState())=>{var a=i,{values:s}=a,p=td(a,["values"]);this.formApi=r,setTimeout(()=>{const y=Zn(nn({},p),{values:Zn(nn({},s),{query:(0,Vr.FU)(s.query||{})})});this.setState({form:y})},0)}),vs(this,"handleChange",r=>{var i=r,{values:a}=i,s=td(i,["values"]);const p=Zn(nn({},s),{values:Zn(nn({},a),{query:(0,Vr.FU)(a.query||{})})});this.setState({form:p}),(0,Vr.Hc)(p)}),vs(this,"handleTabChange",r=>{this.setState({activeTab:r})}),vs(this,"handleServerChange",r=>{this.setState({server:r}),this.props.operation.setActiveServer(r)}),vs(this,"handleExecute",()=>ih(this,null,function*(){var r,i,a,s,p,y,S;const{store:w,operation:E,onResponse:k}=this.props,{values:$,invalid:ae}=this.state.form;if(this.formApi.submitForm(),ae){this.setState({shaking:!0}),setTimeout(()=>this.setState({shaking:!1}),1e3),(i=(r=w==null?void 0:w.options.events)==null?void 0:r.tryItSent)==null||i.call(r,{eventType:zd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"ValidationFailed",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description});return}const re=this.props.operation.requestBody,le=re&&re.content&&re.content.active&&re.content.active.name||"";let ge=$.body;if(/json/.test(le))try{ge=JSON.parse(ge)}catch(ze){console.error(ze)}this.setState({loading:!0});const he=this.state.resolvedRawSpec,Se=(0,zt.U2)(he,["paths",E.path,(E.httpVerb||"").toLowerCase(),"servers"])||(0,zt.U2)(he,["paths",E.path,"servers"])||(0,zt.U2)(he,["servers"]);if(!Se)throw console.error("Servers are not specified in your OpenAPI file. You can't use Try It Out console without specifying servers. If you use OpenAPI 2, make sure you configured host and basepath"),new Error("Servers are not specified");const me=Se.find(ze=>this.state.server.url.endsWith(ze.url.endsWith("/")?ze.url.substring(0,ze.url.length-1):ze.url)),Fe=Date.now(),Ke=!!window.document.documentMode;let Ue,$e=$.auth;if($.auth){const ze=Object.keys($.auth)[0],et=(0,zt.dw)(ze);Ue=Zn(nn({},he),{components:Zn(nn({},he.components),{securitySchemes:Zn(nn({},he.components.securitySchemes),{[et]:Zn(nn({},he.components.securitySchemes[et]),{type:he.components.securitySchemes[et].type==="openIdConnect"?"oauth2":he.components.securitySchemes[et].type})})})}),$e=Zn(nn({},$e),{[et]:$e[ze]})}else Ue=nn({},he);const Be=w.options.corsProxyUrl;Be&&he.servers&&he.servers.length&&(Ue.servers=he.servers.map(ze=>Zn(nn({},ze),{url:Be+oh(ze.url)})));const je=((s=(a=re==null?void 0:re.content)==null?void 0:a.active)==null?void 0:s.name)||null;if(je&&ge&&as(je)){const ze=Object.values(ge);ge=ze.length>1?ze:ze[0]}const We=(ze,et)=>wt=>(this.props.store.options.sendXUserAgentInTryIt&&(wt.headers["X-User-Agent"]="Redocly Try it API console"),ze?ze(wt,et):wt),Je={userFetch:Ke&&o(54098).fetch,server:Be?Be+oh(me.url):me.url,serverVariables:this.state.server.variables,spec:Ue,pathName:E.path,method:E.httpVerb,parameters:nn(nn(nn(nn({},$.path),$.query),$.header),$.cookie),securities:{authorized:$e},requestBody:ge,requestContentType:je,responseContentType:((p=$.header)==null?void 0:p.Accept)||null,requestInterceptor:We(w.options.requestInterceptor,E)};try{const ze=yield im.execute(Je),et=ze==null?void 0:ze.data;et instanceof Blob&&(as(et.type)&&(ze.fileInfo={rawData:et,fileName:(0,Vr.AM)(ze.headers)}),ze.data=yield et.text()),k==null||k({request:Je,response:ze}),this.setState({response:ze,error:void 0})}catch(ze){ze&&ze.response&&ze.response.data instanceof Blob&&(ze.response.data=yield ze.response.data.text(),k==null||k({request:Je,response:ze.response})),this.setState({response:void 0,error:ze})}finally{this.setState({loading:!1,activeTab:1,time:Date.now()-Fe}),(S=(y=w==null?void 0:w.options.events)==null?void 0:y.tryItSent)==null||S.call(y,{eventType:zd.nQ.TryItSent,resource:"Redocly_OperationTryIt",action:"Sent",operationId:E.operationId,operationPath:E.path,operationHttpVerb:E.httpVerb,operationSummary:E.description})}})),this.state={form:{values:{path:(0,Vr.ZS)(t.operation.parameters,"path"),cookie:(0,Vr.ZS)(t.operation.parameters,"cookie"),header:(0,Vr.ZS)(t.operation.parameters,"header"),query:(0,Vr.ZS)(t.operation.parameters,"query")}},shaking:!1,loading:!1,activeTab:0,server:{}}}componentDidMount(){return ih(this,null,function*(){const{store:t,operation:r}=this.props,i=yield t.dereferenceSpecForTryIt(r);this.setState({resolvedRawSpec:i}),this.formApi.setValues({})})}componentDidUpdate(t){t.operation!==this.props.operation&&this.setState({response:void 0,error:void 0,activeTab:0})}render(){const{operation:t,className:r,rootElement:i}=this.props,{shaking:a,activeTab:s,form:p,response:y,loading:S,error:w}=this.state,E=!!(y||w);return d.createElement(pm,{shaking:a,className:r,rootElement:i},d.createElement(vn.k1,null,d.createElement(U,{active:s,hasResponse:E,onChange:this.handleTabChange}),this.props.onClose&&d.createElement(Ki.PZ,{onClick:this.props.onClose}," \u2715 ")),d.createElement(Ki.RE,{hidden:s!==0},this.renderRequest()),d.createElement(Ki.RE,{hidden:s!==1},this.renderResponse()),d.createElement(yo,{hasResponse:E,params:p.values,operation:t,loading:S,execute:this.handleExecute}))}renderRequest(){var t;const{operation:r,store:i,properties:a,securityDefaults:s}=this.props,{form:p,resolvedRawSpec:y,server:S}=this.state,w=p.errors||{},E=w.path||w.cookie||w.header||w.query,k=y&&Gt.JsonPointer.get(y,r.pointer);let $=p.values&&p.values.auth&&Object.keys(p.values.auth)[0];(!$||!p.values.auth[$])&&($=void 0),$&&(p.values.auth[$].token!==void 0||p.values.auth[$].client_id!==void 0||p.values.auth[$].client_secret!==void 0)&&(!p.values.auth[$].token||!p.values.auth[$].token.access_token)&&($=void 0),$&&p.values.auth[$].username!=null&&(!p.values.auth[$].username||!p.values.auth[$].password)&&($=void 0);const ae=r.parameters||[],re=(t=i==null?void 0:i.options.hooks)==null?void 0:t.ReplaceTryItSecurityPanel;return!y&&d.createElement(d.Fragment,null,"Loading...")||d.createElement(d.Fragment,null,d.createElement(jl,{onChange:this.handleChange,getApi:this.setFormApi,style:Zn(nn({},cm),{margin:0})},d.createElement(vn.UQ,{initialActiveIdx:r.security.length&&$?1:0},r.security.length&&d.createElement(cf,{header:(0,Sl.l)("tryItAuth"),"data-cy":"security-trigger",renderChildrenHidden:!0,error:!$&&!!w.auth,success:!!$},re?d.createElement(hm,{field:"auth",validate:El},le=>d.createElement(om.Q,{Hook:re,props:{server:S,operation:r,onChange:le,OAuth2:Xr}})):d.createElement(Qh,{formApi:this.formApi,form:p,operation:r,activeServer:S.url,authCorsProxyUrl:i.options.authCorsProxyUrl,securityDefaults:s}))||null,r.requestBody&&d.createElement(cf,{header:(0,Sl.l)("tryItBody"),"data-cy":"body-trigger",renderChildrenHidden:!0,error:!!w.body},d.createElement(l,{validate:dm,console:this,body:r.requestBody,id:r.id,resolvedBody:k.requestBody,properties:a}))||null,ae.length&&d.createElement(cf,{header:(0,Sl.l)("tryItParameters"),"data-cy":"parameters-trigger",error:E,renderChildrenHidden:!0},d.createElement(Xn,{operation:r,values:p.values,errors:p.errors||{}}))||null)),d.createElement(Ps,{operation:r,onChange:this.handleServerChange}))}renderResponse(){const{response:t,error:r,time:i}=this.state;return d.createElement(Ns,{response:t,error:r,time:i})}};rd=fm([Wo.Pi],rd);function dm(){}function pm(t){const{shaking:r,className:i,children:a,rootElement:s}=t,[p]=(0,zt.Bs)(s);return d.createElement(Ki.q2,{shaking:r,className:i,"data-cy":"console",fullWidth:p==null?void 0:p.width},a)}function hm(t){const{fieldApi:r,render:i,userProps:a}=Kn(nn({},t)),{setValue:s}=r,{children:p}=a;return i(d.createElement(d.Fragment,null,p(s)))}function cf(t){var r=t,{header:i,error:a,success:s}=r,p=td(r,["header","error","success"]);const y=({toggle:S,expanded:w})=>d.createElement(vn.h4,{onClick:S,isExpanded:w,"data-cy":p["data-cy"]},d.createElement(vn.xz,null,d.createElement(vn.Dx,null,i),d.createElement(Gt.ShelfIcon,{direction:w?"down":"right"})),a&&d.createElement(Gt.CrossIcon,{size:"14px",color:"#ff908b"})||null,s&&d.createElement(Gt.LockIcon,{size:"14px",color:"#56ff26"})||null);return d.createElement(vm,Zn(nn({},p),{header:y}))}const vm=(0,In.ZP)(vn.s_)`
452
452
  ${vn.h4} {
453
453
  color: white;
454
454
  border: 1px solid ${({error:t})=>t?"#ff908b":"#89949f"};